@daytonaio/sdk 0.171.0-alpha.9 → 0.171.0

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 (199) hide show
  1. package/package.json +8 -47
  2. package/{cjs → src}/CodeInterpreter.d.ts +0 -1
  3. package/src/CodeInterpreter.js.map +1 -0
  4. package/{cjs → src}/ComputerUse.d.ts +0 -1
  5. package/src/ComputerUse.js.map +1 -0
  6. package/{cjs → src}/Daytona.d.ts +0 -1
  7. package/{cjs → src}/Daytona.js +17 -19
  8. package/src/Daytona.js.map +1 -0
  9. package/{esm → src}/FileSystem.d.ts +0 -1
  10. package/src/FileSystem.js.map +1 -0
  11. package/{esm → src}/Git.d.ts +0 -1
  12. package/src/Git.js.map +1 -0
  13. package/{cjs → src}/Image.d.ts +0 -1
  14. package/src/Image.js.map +1 -0
  15. package/{esm → src}/LspServer.d.ts +0 -1
  16. package/src/LspServer.js.map +1 -0
  17. package/{cjs → src}/ObjectStorage.d.ts +0 -1
  18. package/src/ObjectStorage.js.map +1 -0
  19. package/{cjs → src}/Process.d.ts +0 -1
  20. package/src/Process.js.map +1 -0
  21. package/{cjs → src}/PtyHandle.d.ts +0 -1
  22. package/src/PtyHandle.js.map +1 -0
  23. package/{cjs → src}/Sandbox.d.ts +0 -1
  24. package/src/Sandbox.js.map +1 -0
  25. package/{cjs → src}/Snapshot.d.ts +0 -1
  26. package/src/Snapshot.js.map +1 -0
  27. package/{esm → src}/Volume.d.ts +0 -1
  28. package/src/Volume.js.map +1 -0
  29. package/src/__tests__/helpers.d.ts +5 -0
  30. package/src/__tests__/helpers.js +26 -0
  31. package/src/__tests__/helpers.js.map +1 -0
  32. package/{esm → src}/errors/DaytonaError.d.ts +0 -1
  33. package/src/errors/DaytonaError.js.map +1 -0
  34. package/{cjs → src}/index.d.ts +0 -1
  35. package/src/index.js.map +1 -0
  36. package/{esm → src}/types/Charts.d.ts +0 -1
  37. package/src/types/Charts.js.map +1 -0
  38. package/{esm → src}/types/CodeInterpreter.d.ts +0 -1
  39. package/src/types/CodeInterpreter.js.map +1 -0
  40. package/{cjs → src}/types/ExecuteResponse.d.ts +0 -1
  41. package/src/types/ExecuteResponse.js.map +1 -0
  42. package/{cjs → src}/types/Pty.d.ts +0 -1
  43. package/src/types/Pty.js.map +1 -0
  44. package/{esm → src}/utils/Binary.d.ts +0 -1
  45. package/src/utils/Binary.js.map +1 -0
  46. package/{cjs → src}/utils/FileTransfer.d.ts +0 -1
  47. package/src/utils/FileTransfer.js.map +1 -0
  48. package/src/utils/Import.d.ts +97 -0
  49. package/{cjs → src}/utils/Import.js +11 -41
  50. package/src/utils/Import.js.map +1 -0
  51. package/{esm → src}/utils/Multipart.d.ts +0 -1
  52. package/src/utils/Multipart.js.map +1 -0
  53. package/{esm → src}/utils/Runtime.d.ts +0 -1
  54. package/src/utils/Runtime.js.map +1 -0
  55. package/{cjs → src}/utils/Stream.d.ts +0 -1
  56. package/src/utils/Stream.js.map +1 -0
  57. package/{esm → src}/utils/WebSocket.d.ts +0 -1
  58. package/src/utils/WebSocket.js.map +1 -0
  59. package/{esm → src}/utils/otel.decorator.d.ts +0 -1
  60. package/src/utils/otel.decorator.js.map +1 -0
  61. package/LICENSE +0 -190
  62. package/cjs/CodeInterpreter.js.map +0 -1
  63. package/cjs/ComputerUse.js.map +0 -1
  64. package/cjs/Daytona.js.map +0 -1
  65. package/cjs/FileSystem.d.ts +0 -371
  66. package/cjs/FileSystem.js.map +0 -1
  67. package/cjs/Git.d.ts +0 -203
  68. package/cjs/Git.js.map +0 -1
  69. package/cjs/Image.js.map +0 -1
  70. package/cjs/LspServer.d.ts +0 -172
  71. package/cjs/LspServer.js.map +0 -1
  72. package/cjs/ObjectStorage.js.map +0 -1
  73. package/cjs/Process.js.map +0 -1
  74. package/cjs/PtyHandle.js.map +0 -1
  75. package/cjs/README.md +0 -180
  76. package/cjs/Sandbox.js.map +0 -1
  77. package/cjs/Snapshot.js.map +0 -1
  78. package/cjs/Volume.d.ts +0 -84
  79. package/cjs/Volume.js.map +0 -1
  80. package/cjs/errors/DaytonaError.d.ts +0 -171
  81. package/cjs/errors/DaytonaError.js.map +0 -1
  82. package/cjs/index.js.map +0 -1
  83. package/cjs/package.json +0 -3
  84. package/cjs/types/Charts.d.ts +0 -38
  85. package/cjs/types/Charts.js.map +0 -1
  86. package/cjs/types/CodeInterpreter.d.ts +0 -77
  87. package/cjs/types/CodeInterpreter.js.map +0 -1
  88. package/cjs/types/ExecuteResponse.js.map +0 -1
  89. package/cjs/types/Pty.js.map +0 -1
  90. package/cjs/utils/Binary.d.ts +0 -39
  91. package/cjs/utils/Binary.js.map +0 -1
  92. package/cjs/utils/FileTransfer.js.map +0 -1
  93. package/cjs/utils/Import.d.ts +0 -38
  94. package/cjs/utils/Import.js.map +0 -1
  95. package/cjs/utils/Multipart.d.ts +0 -29
  96. package/cjs/utils/Multipart.js.map +0 -1
  97. package/cjs/utils/Runtime.d.ts +0 -44
  98. package/cjs/utils/Runtime.js.map +0 -1
  99. package/cjs/utils/Stream.js.map +0 -1
  100. package/cjs/utils/WebSocket.d.ts +0 -10
  101. package/cjs/utils/WebSocket.js.map +0 -1
  102. package/cjs/utils/otel.decorator.d.ts +0 -83
  103. package/cjs/utils/otel.decorator.js.map +0 -1
  104. package/esm/CodeInterpreter.d.ts +0 -95
  105. package/esm/CodeInterpreter.js +0 -292
  106. package/esm/CodeInterpreter.js.map +0 -1
  107. package/esm/ComputerUse.d.ts +0 -539
  108. package/esm/ComputerUse.js +0 -799
  109. package/esm/ComputerUse.js.map +0 -1
  110. package/esm/Daytona.d.ts +0 -355
  111. package/esm/Daytona.js +0 -525
  112. package/esm/Daytona.js.map +0 -1
  113. package/esm/FileSystem.js +0 -485
  114. package/esm/FileSystem.js.map +0 -1
  115. package/esm/Git.js +0 -322
  116. package/esm/Git.js.map +0 -1
  117. package/esm/Image.d.ts +0 -265
  118. package/esm/Image.js +0 -581
  119. package/esm/Image.js.map +0 -1
  120. package/esm/LspServer.js +0 -255
  121. package/esm/LspServer.js.map +0 -1
  122. package/esm/ObjectStorage.d.ts +0 -79
  123. package/esm/ObjectStorage.js +0 -195
  124. package/esm/ObjectStorage.js.map +0 -1
  125. package/esm/Process.d.ts +0 -490
  126. package/esm/Process.js +0 -642
  127. package/esm/Process.js.map +0 -1
  128. package/esm/PtyHandle.d.ts +0 -155
  129. package/esm/PtyHandle.js +0 -412
  130. package/esm/PtyHandle.js.map +0 -1
  131. package/esm/README.md +0 -180
  132. package/esm/Sandbox.d.ts +0 -476
  133. package/esm/Sandbox.js +0 -901
  134. package/esm/Sandbox.js.map +0 -1
  135. package/esm/Snapshot.d.ts +0 -140
  136. package/esm/Snapshot.js +0 -244
  137. package/esm/Snapshot.js.map +0 -1
  138. package/esm/Volume.js +0 -115
  139. package/esm/Volume.js.map +0 -1
  140. package/esm/errors/DaytonaError.js +0 -243
  141. package/esm/errors/DaytonaError.js.map +0 -1
  142. package/esm/index.d.ts +0 -22
  143. package/esm/index.js +0 -21
  144. package/esm/index.js.map +0 -1
  145. package/esm/package.json +0 -3
  146. package/esm/types/Charts.js +0 -33
  147. package/esm/types/Charts.js.map +0 -1
  148. package/esm/types/CodeInterpreter.js +0 -6
  149. package/esm/types/CodeInterpreter.js.map +0 -1
  150. package/esm/types/ExecuteResponse.d.ts +0 -26
  151. package/esm/types/ExecuteResponse.js +0 -6
  152. package/esm/types/ExecuteResponse.js.map +0 -1
  153. package/esm/types/Pty.d.ts +0 -48
  154. package/esm/types/Pty.js +0 -6
  155. package/esm/types/Pty.js.map +0 -1
  156. package/esm/utils/Binary.js +0 -157
  157. package/esm/utils/Binary.js.map +0 -1
  158. package/esm/utils/FileTransfer.d.ts +0 -15
  159. package/esm/utils/FileTransfer.js +0 -254
  160. package/esm/utils/FileTransfer.js.map +0 -1
  161. package/esm/utils/Import.d.ts +0 -38
  162. package/esm/utils/Import.js +0 -106
  163. package/esm/utils/Import.js.map +0 -1
  164. package/esm/utils/Multipart.js +0 -109
  165. package/esm/utils/Multipart.js.map +0 -1
  166. package/esm/utils/Runtime.js +0 -89
  167. package/esm/utils/Runtime.js.map +0 -1
  168. package/esm/utils/Stream.d.ts +0 -20
  169. package/esm/utils/Stream.js +0 -360
  170. package/esm/utils/Stream.js.map +0 -1
  171. package/esm/utils/WebSocket.js +0 -22
  172. package/esm/utils/WebSocket.js.map +0 -1
  173. package/esm/utils/otel.decorator.js +0 -136
  174. package/esm/utils/otel.decorator.js.map +0 -1
  175. /package/{cjs → src}/CodeInterpreter.js +0 -0
  176. /package/{cjs → src}/ComputerUse.js +0 -0
  177. /package/{cjs → src}/FileSystem.js +0 -0
  178. /package/{cjs → src}/Git.js +0 -0
  179. /package/{cjs → src}/Image.js +0 -0
  180. /package/{cjs → src}/LspServer.js +0 -0
  181. /package/{cjs → src}/ObjectStorage.js +0 -0
  182. /package/{cjs → src}/Process.js +0 -0
  183. /package/{cjs → src}/PtyHandle.js +0 -0
  184. /package/{cjs → src}/Sandbox.js +0 -0
  185. /package/{cjs → src}/Snapshot.js +0 -0
  186. /package/{cjs → src}/Volume.js +0 -0
  187. /package/{cjs → src}/errors/DaytonaError.js +0 -0
  188. /package/{cjs → src}/index.js +0 -0
  189. /package/{cjs → src}/types/Charts.js +0 -0
  190. /package/{cjs → src}/types/CodeInterpreter.js +0 -0
  191. /package/{cjs → src}/types/ExecuteResponse.js +0 -0
  192. /package/{cjs → src}/types/Pty.js +0 -0
  193. /package/{cjs → src}/utils/Binary.js +0 -0
  194. /package/{cjs → src}/utils/FileTransfer.js +0 -0
  195. /package/{cjs → src}/utils/Multipart.js +0 -0
  196. /package/{cjs → src}/utils/Runtime.js +0 -0
  197. /package/{cjs → src}/utils/Stream.js +0 -0
  198. /package/{cjs → src}/utils/WebSocket.js +0 -0
  199. /package/{cjs → src}/utils/otel.decorator.js +0 -0
package/esm/Git.js DELETED
@@ -1,322 +0,0 @@
1
- /*
2
- * Copyright 2025 Daytona Platforms Inc.
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- import { __decorate, __metadata } from "tslib";
6
- import { WithInstrumentation } from './utils/otel.decorator.js';
7
- /**
8
- * Provides Git operations within a Sandbox.
9
- *
10
- * @class
11
- */
12
- export class Git {
13
- apiClient;
14
- constructor(apiClient) {
15
- this.apiClient = apiClient;
16
- }
17
- /**
18
- * Stages the specified files for the next commit, similar to
19
- * running 'git add' on the command line.
20
- *
21
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
22
- * @param {string[]} files - List of file paths or directories to stage, relative to the repository root
23
- * @returns {Promise<void>}
24
- *
25
- * @example
26
- * // Stage a single file
27
- * await git.add('workspace/repo', ['file.txt']);
28
- *
29
- * @example
30
- * // Stage whole repository
31
- * await git.add('workspace/repo', ['.']);
32
- */
33
- async add(path, files) {
34
- await this.apiClient.addFiles({
35
- path,
36
- files,
37
- });
38
- }
39
- /**
40
- * List branches in the repository.
41
- *
42
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
43
- * @returns {Promise<ListBranchResponse>} List of branches in the repository
44
- *
45
- * @example
46
- * const response = await git.branches('workspace/repo');
47
- * console.log(`Branches: ${response.branches}`);
48
- */
49
- async branches(path) {
50
- const response = await this.apiClient.listBranches(path);
51
- return response.data;
52
- }
53
- /**
54
- * Create branch in the repository.
55
- *
56
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
57
- * @param {string} name - Name of the new branch to create
58
- * @returns {Promise<void>}
59
- *
60
- * @example
61
- * await git.createBranch('workspace/repo', 'new-feature');
62
- */
63
- async createBranch(path, name) {
64
- await this.apiClient.createBranch({
65
- path,
66
- name,
67
- });
68
- return;
69
- }
70
- /**
71
- * Delete branche in the repository.
72
- *
73
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
74
- * @param {string} name - Name of the branch to delete
75
- * @returns {Promise<void>}
76
- *
77
- * @example
78
- * await git.deleteBranch('workspace/repo', 'new-feature');
79
- */
80
- async deleteBranch(path, name) {
81
- await this.apiClient.deleteBranch({
82
- path,
83
- name,
84
- });
85
- return;
86
- }
87
- /**
88
- * Checkout branche in the repository.
89
- *
90
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
91
- * @param {string} branch - Name of the branch to checkout
92
- * @returns {Promise<void>}
93
- *
94
- * @example
95
- * await git.checkoutBranch('workspace/repo', 'new-feature');
96
- */
97
- async checkoutBranch(path, branch) {
98
- await this.apiClient.checkoutBranch({
99
- path,
100
- branch,
101
- });
102
- return;
103
- }
104
- /**
105
- * Clones a Git repository into the specified path. It supports
106
- * cloning specific branches or commits, and can authenticate with the remote
107
- * repository if credentials are provided.
108
- *
109
- * @param {string} url - Repository URL to clone from
110
- * @param {string} path - Path where the repository should be cloned. Relative paths are resolved based on the sandbox working directory.
111
- * @param {string} [branch] - Specific branch to clone. If not specified, clones the default branch
112
- * @param {string} [commitId] - Specific commit to clone. If specified, the repository will be left in a detached HEAD state at this commit
113
- * @param {string} [username] - Git username for authentication
114
- * @param {string} [password] - Git password or token for authentication
115
- * @returns {Promise<void>}
116
- *
117
- * @example
118
- * // Clone the default branch
119
- * await git.clone(
120
- * 'https://github.com/user/repo.git',
121
- * 'workspace/repo'
122
- * );
123
- *
124
- * @example
125
- * // Clone a specific branch with authentication
126
- * await git.clone(
127
- * 'https://github.com/user/private-repo.git',
128
- * 'workspace/private',
129
- * branch='develop',
130
- * username='user',
131
- * password='token'
132
- * );
133
- *
134
- * @example
135
- * // Clone a specific commit
136
- * await git.clone(
137
- * 'https://github.com/user/repo.git',
138
- * 'workspace/repo-old',
139
- * commitId='abc123'
140
- * );
141
- */
142
- async clone(url, path, branch, commitId, username, password) {
143
- await this.apiClient.cloneRepository({
144
- url: url,
145
- branch: branch,
146
- path,
147
- username,
148
- password,
149
- commit_id: commitId,
150
- });
151
- }
152
- /**
153
- * Commits staged changes.
154
- *
155
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
156
- * @param {string} message - Commit message describing the changes
157
- * @param {string} author - Name of the commit author
158
- * @param {string} email - Email address of the commit author
159
- * @param {boolean} [allowEmpty] - Allow creating an empty commit when no changes are staged
160
- * @returns {Promise<void>}
161
- *
162
- * @example
163
- * // Stage and commit changes
164
- * await git.add('workspace/repo', ['README.md']);
165
- * await git.commit(
166
- * 'workspace/repo',
167
- * 'Update documentation',
168
- * 'John Doe',
169
- * 'john@example.com',
170
- * true
171
- * );
172
- *
173
- */
174
- async commit(path, message, author, email, allowEmpty) {
175
- const response = await this.apiClient.commitChanges({
176
- path,
177
- message,
178
- author,
179
- email,
180
- allow_empty: allowEmpty,
181
- });
182
- return {
183
- sha: response.data.hash,
184
- };
185
- }
186
- /**
187
- * Push local changes to the remote repository.
188
- *
189
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
190
- * @param {string} [username] - Git username for authentication
191
- * @param {string} [password] - Git password or token for authentication
192
- * @returns {Promise<void>}
193
- *
194
- * @example
195
- * // Push to a public repository
196
- * await git.push('workspace/repo');
197
- *
198
- * @example
199
- * // Push to a private repository
200
- * await git.push(
201
- * 'workspace/repo',
202
- * 'user',
203
- * 'token'
204
- * );
205
- */
206
- async push(path, username, password) {
207
- await this.apiClient.pushChanges({
208
- path,
209
- username,
210
- password,
211
- });
212
- }
213
- /**
214
- * Pulls changes from the remote repository.
215
- *
216
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
217
- * @param {string} [username] - Git username for authentication
218
- * @param {string} [password] - Git password or token for authentication
219
- * @returns {Promise<void>}
220
- *
221
- * @example
222
- * // Pull from a public repository
223
- * await git.pull('workspace/repo');
224
- *
225
- * @example
226
- * // Pull from a private repository
227
- * await git.pull(
228
- * 'workspace/repo',
229
- * 'user',
230
- * 'token'
231
- * );
232
- */
233
- async pull(path, username, password) {
234
- await this.apiClient.pullChanges({
235
- path,
236
- username,
237
- password,
238
- });
239
- }
240
- /**
241
- * Gets the current status of the Git repository.
242
- *
243
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
244
- * @returns {Promise<GitStatus>} Current repository status including:
245
- * - currentBranch: Name of the current branch
246
- * - ahead: Number of commits ahead of the remote branch
247
- * - behind: Number of commits behind the remote branch
248
- * - branchPublished: Whether the branch has been published to the remote repository
249
- * - fileStatus: List of file statuses
250
- *
251
- * @example
252
- * const status = await sandbox.git.status('workspace/repo');
253
- * console.log(`Current branch: ${status.currentBranch}`);
254
- * console.log(`Commits ahead: ${status.ahead}`);
255
- * console.log(`Commits behind: ${status.behind}`);
256
- */
257
- async status(path) {
258
- const response = await this.apiClient.getStatus(path);
259
- return response.data;
260
- }
261
- }
262
- __decorate([
263
- WithInstrumentation(),
264
- __metadata("design:type", Function),
265
- __metadata("design:paramtypes", [String, Array]),
266
- __metadata("design:returntype", Promise)
267
- ], Git.prototype, "add", null);
268
- __decorate([
269
- WithInstrumentation(),
270
- __metadata("design:type", Function),
271
- __metadata("design:paramtypes", [String]),
272
- __metadata("design:returntype", Promise)
273
- ], Git.prototype, "branches", null);
274
- __decorate([
275
- WithInstrumentation(),
276
- __metadata("design:type", Function),
277
- __metadata("design:paramtypes", [String, String]),
278
- __metadata("design:returntype", Promise)
279
- ], Git.prototype, "createBranch", null);
280
- __decorate([
281
- WithInstrumentation(),
282
- __metadata("design:type", Function),
283
- __metadata("design:paramtypes", [String, String]),
284
- __metadata("design:returntype", Promise)
285
- ], Git.prototype, "deleteBranch", null);
286
- __decorate([
287
- WithInstrumentation(),
288
- __metadata("design:type", Function),
289
- __metadata("design:paramtypes", [String, String]),
290
- __metadata("design:returntype", Promise)
291
- ], Git.prototype, "checkoutBranch", null);
292
- __decorate([
293
- WithInstrumentation(),
294
- __metadata("design:type", Function),
295
- __metadata("design:paramtypes", [String, String, String, String, String, String]),
296
- __metadata("design:returntype", Promise)
297
- ], Git.prototype, "clone", null);
298
- __decorate([
299
- WithInstrumentation(),
300
- __metadata("design:type", Function),
301
- __metadata("design:paramtypes", [String, String, String, String, Boolean]),
302
- __metadata("design:returntype", Promise)
303
- ], Git.prototype, "commit", null);
304
- __decorate([
305
- WithInstrumentation(),
306
- __metadata("design:type", Function),
307
- __metadata("design:paramtypes", [String, String, String]),
308
- __metadata("design:returntype", Promise)
309
- ], Git.prototype, "push", null);
310
- __decorate([
311
- WithInstrumentation(),
312
- __metadata("design:type", Function),
313
- __metadata("design:paramtypes", [String, String, String]),
314
- __metadata("design:returntype", Promise)
315
- ], Git.prototype, "pull", null);
316
- __decorate([
317
- WithInstrumentation(),
318
- __metadata("design:type", Function),
319
- __metadata("design:paramtypes", [String]),
320
- __metadata("design:returntype", Promise)
321
- ], Git.prototype, "status", null);
322
- //# sourceMappingURL=Git.js.map
package/esm/Git.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Git.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/Git.ts"],"names":[],"mappings":"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"}
package/esm/Image.d.ts DELETED
@@ -1,265 +0,0 @@
1
- declare const SUPPORTED_PYTHON_SERIES: readonly ["3.9", "3.10", "3.11", "3.12", "3.13"];
2
- type SupportedPythonSeries = (typeof SUPPORTED_PYTHON_SERIES)[number];
3
- /**
4
- * Represents a context file to be added to the image.
5
- *
6
- * @interface
7
- * @property {string} sourcePath - The path to the source file or directory.
8
- * @property {string} archivePath - The path inside the archive file in object storage.
9
- */
10
- export interface Context {
11
- sourcePath: string;
12
- archivePath: string;
13
- }
14
- /**
15
- * Options for the pip install command.
16
- *
17
- * @interface
18
- * @property {string[]} findLinks - The find-links to use for the pip install command.
19
- * @property {string} indexUrl - The index URL to use for the pip install command.
20
- * @property {string[]} extraIndexUrls - The extra index URLs to use for the pip install command.
21
- * @property {boolean} pre - Whether to install pre-release versions.
22
- * @property {string} extraOptions - The extra options to use for the pip install command. Given string is passed directly to the pip install command.
23
- */
24
- export interface PipInstallOptions {
25
- findLinks?: string[];
26
- indexUrl?: string;
27
- extraIndexUrls?: string[];
28
- pre?: boolean;
29
- extraOptions?: string;
30
- }
31
- /**
32
- * Options for the pip install command from a pyproject.toml file.
33
- *
34
- * @interface
35
- * @property {string[]} optionalDependencies - The optional dependencies to install.
36
- *
37
- * @extends {PipInstallOptions}
38
- */
39
- export interface PyprojectOptions extends PipInstallOptions {
40
- optionalDependencies?: string[];
41
- }
42
- /**
43
- * Represents an image definition for a Daytona sandbox.
44
- * Do not construct this class directly. Instead use one of its static factory methods,
45
- * such as `Image.base()`, `Image.debianSlim()` or `Image.fromDockerfile()`.
46
- *
47
- * @class
48
- * @property {string} dockerfile - The Dockerfile content.
49
- * @property {Context[]} contextList - The list of context files to be added to the image.
50
- */
51
- export declare class Image {
52
- private _dockerfile;
53
- private _contextList;
54
- private constructor();
55
- get dockerfile(): string;
56
- get contextList(): Context[];
57
- /**
58
- * Adds commands to install packages using pip.
59
- *
60
- * @param {string | string[]} packages - The packages to install.
61
- * @param {Object} options - The options for the pip install command.
62
- * @param {string[]} options.findLinks - The find-links to use for the pip install command.
63
- * @returns {Image} The Image instance.
64
- *
65
- * @example
66
- * const image = Image.debianSlim('3.12').pipInstall('numpy', { findLinks: ['https://pypi.org/simple'] })
67
- */
68
- pipInstall(packages: string | string[], options?: PipInstallOptions): Image;
69
- /**
70
- * Installs dependencies from a requirements.txt file.
71
- *
72
- * @param {string} requirementsTxt - The path to the requirements.txt file.
73
- * @param {PipInstallOptions} options - The options for the pip install command.
74
- * @returns {Image} The Image instance.
75
- *
76
- * @example
77
- * const image = Image.debianSlim('3.12')
78
- * image.pipInstallFromRequirements('requirements.txt', { findLinks: ['https://pypi.org/simple'] })
79
- */
80
- pipInstallFromRequirements(requirementsTxt: string, options?: PipInstallOptions): Image;
81
- /**
82
- * Installs dependencies from a pyproject.toml file.
83
- *
84
- * @param {string} pyprojectToml - The path to the pyproject.toml file.
85
- * @param {PyprojectOptions} options - The options for the pip install command.
86
- * @returns {Image} The Image instance.
87
- *
88
- * @example
89
- * const image = Image.debianSlim('3.12')
90
- * image.pipInstallFromPyproject('pyproject.toml', { optionalDependencies: ['dev'] })
91
- */
92
- pipInstallFromPyproject(pyprojectToml: string, options?: PyprojectOptions): Image;
93
- /**
94
- * Adds a local file to the image.
95
- *
96
- * @param {string} localPath - The path to the local file.
97
- * @param {string} remotePath - The path of the file in the image.
98
- * @returns {Image} The Image instance.
99
- *
100
- * @example
101
- * const image = Image
102
- * .debianSlim('3.12')
103
- * .addLocalFile('requirements.txt', '/home/daytona/requirements.txt')
104
- */
105
- addLocalFile(localPath: string, remotePath: string): Image;
106
- /**
107
- * Adds a local directory to the image.
108
- *
109
- * @param {string} localPath - The path to the local directory.
110
- * @param {string} remotePath - The path of the directory in the image.
111
- * @returns {Image} The Image instance.
112
- *
113
- * @example
114
- * const image = Image
115
- * .debianSlim('3.12')
116
- * .addLocalDir('src', '/home/daytona/src')
117
- */
118
- addLocalDir(localPath: string, remotePath: string): Image;
119
- /**
120
- * Runs commands in the image.
121
- *
122
- * @param {string | string[]} commands - The commands to run.
123
- * @returns {Image} The Image instance.
124
- *
125
- * @example
126
- * const image = Image
127
- * .debianSlim('3.12')
128
- * .runCommands(
129
- * 'echo "Hello, world!"',
130
- * ['bash', '-c', 'echo Hello, world, again!']
131
- * )
132
- */
133
- runCommands(...commands: (string | string[])[]): Image;
134
- /**
135
- * Sets environment variables in the image.
136
- *
137
- * @param {Record<string, string>} envVars - The environment variables to set.
138
- * @returns {Image} The Image instance.
139
- *
140
- * @example
141
- * const image = Image
142
- * .debianSlim('3.12')
143
- * .env({ FOO: 'bar' })
144
- */
145
- env(envVars: Record<string, string>): Image;
146
- /**
147
- * Sets the working directory in the image.
148
- *
149
- * @param {string} dirPath - The path to the working directory.
150
- * @returns {Image} The Image instance.
151
- *
152
- * @example
153
- * const image = Image
154
- * .debianSlim('3.12')
155
- * .workdir('/home/daytona')
156
- */
157
- workdir(dirPath: string): Image;
158
- /**
159
- * Sets the entrypoint for the image.
160
- *
161
- * @param {string[]} entrypointCommands - The commands to set as the entrypoint.
162
- * @returns {Image} The Image instance.
163
- *
164
- * @example
165
- * const image = Image
166
- * .debianSlim('3.12')
167
- * .entrypoint(['/bin/bash'])
168
- */
169
- entrypoint(entrypointCommands: string[]): Image;
170
- /**
171
- * Sets the default command for the image.
172
- *
173
- * @param {string[]} cmd - The command to set as the default command.
174
- * @returns {Image} The Image instance.
175
- *
176
- * @example
177
- * const image = Image
178
- * .debianSlim('3.12')
179
- * .cmd(['/bin/bash'])
180
- */
181
- cmd(cmd: string[]): Image;
182
- /**
183
- * Extends an image with arbitrary Dockerfile-like commands.
184
- *
185
- * @param {string | string[]} dockerfileCommands - The commands to add to the Dockerfile.
186
- * @param {string} contextDir - The path to the context directory.
187
- * @returns {Image} The Image instance.
188
- *
189
- * @example
190
- * const image = Image
191
- * .debianSlim('3.12')
192
- * .dockerfileCommands(['RUN echo "Hello, world!"'])
193
- */
194
- dockerfileCommands(dockerfileCommands: string[], contextDir?: string): Image;
195
- /**
196
- * Creates an Image from an existing Dockerfile.
197
- *
198
- * @param {string} path - The path to the Dockerfile.
199
- * @returns {Image} The Image instance.
200
- *
201
- * @example
202
- * const image = Image.fromDockerfile('Dockerfile')
203
- */
204
- static fromDockerfile(path: string): Image;
205
- /**
206
- * Creates an Image from an existing base image.
207
- *
208
- * @param {string} image - The base image to use.
209
- * @returns {Image} The Image instance.
210
- *
211
- * @example
212
- * const image = Image.base('python:3.12-slim-bookworm')
213
- */
214
- static base(image: string): Image;
215
- /**
216
- * Creates a Debian slim image based on the official Python Docker image.
217
- *
218
- * @param {string} pythonVersion - The Python version to use.
219
- * @returns {Image} The Image instance.
220
- *
221
- * @example
222
- * const image = Image.debianSlim('3.12')
223
- */
224
- static debianSlim(pythonVersion?: SupportedPythonSeries): Image;
225
- /**
226
- * Formats pip install arguments in a single string.
227
- *
228
- * @param {PipInstallOptions} options - The options for the pip install command.
229
- * @returns {string} The formatted pip install arguments.
230
- */
231
- private formatPipInstallArgs;
232
- /**
233
- * Flattens a string argument.
234
- *
235
- * @param {string} functionName - The name of the function.
236
- * @param {string} argName - The name of the argument.
237
- * @param {any} args - The argument to flatten.
238
- * @returns {string[]} The flattened argument.
239
- */
240
- private flattenStringArgs;
241
- /**
242
- * Processes the Python version.
243
- *
244
- * @param {string} pythonVersion - The Python version to use.
245
- * @returns {string} The processed Python version.
246
- */
247
- private static processPythonVersion;
248
- /**
249
- * Extracts source files from COPY commands in a Dockerfile.
250
- *
251
- * @param {string} dockerfileContent - The content of the Dockerfile.
252
- * @param {string} pathPrefix - The path prefix to use for the sources.
253
- * @returns {Array<[string, string]>} The list of the actual file path and its corresponding COPY-command source path.
254
- */
255
- private static extractCopySources;
256
- /**
257
- * Parses a COPY command to extract sources and destination.
258
- *
259
- * @param {string} line - The line to parse.
260
- * @returns {Object} The parsed sources and destination.
261
- */
262
- private static parseCopyCommand;
263
- }
264
- export {};
265
- //# sourceMappingURL=Image.d.ts.map