@daytona/sdk 0.171.0-alpha.3 → 0.171.0-alpha.5

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 (147) hide show
  1. package/package.json +9 -3
  2. package/cjs/CodeInterpreter.d.ts.map +0 -1
  3. package/cjs/ComputerUse.d.ts.map +0 -1
  4. package/cjs/Daytona.d.ts.map +0 -1
  5. package/cjs/FileSystem.d.ts.map +0 -1
  6. package/cjs/Git.d.ts.map +0 -1
  7. package/cjs/Image.d.ts.map +0 -1
  8. package/cjs/LspServer.d.ts.map +0 -1
  9. package/cjs/ObjectStorage.d.ts.map +0 -1
  10. package/cjs/Process.d.ts.map +0 -1
  11. package/cjs/PtyHandle.d.ts.map +0 -1
  12. package/cjs/Sandbox.d.ts.map +0 -1
  13. package/cjs/Snapshot.d.ts.map +0 -1
  14. package/cjs/Volume.d.ts.map +0 -1
  15. package/cjs/__tests__/helpers.d.ts +0 -6
  16. package/cjs/__tests__/helpers.d.ts.map +0 -1
  17. package/cjs/__tests__/helpers.js +0 -26
  18. package/cjs/__tests__/helpers.js.map +0 -1
  19. package/cjs/errors/DaytonaError.d.ts.map +0 -1
  20. package/cjs/index.d.ts.map +0 -1
  21. package/cjs/types/Charts.d.ts.map +0 -1
  22. package/cjs/types/CodeInterpreter.d.ts.map +0 -1
  23. package/cjs/types/ExecuteResponse.d.ts.map +0 -1
  24. package/cjs/types/Pty.d.ts.map +0 -1
  25. package/cjs/utils/Binary.d.ts.map +0 -1
  26. package/cjs/utils/FileTransfer.d.ts.map +0 -1
  27. package/cjs/utils/Import.d.ts.map +0 -1
  28. package/cjs/utils/Multipart.d.ts.map +0 -1
  29. package/cjs/utils/Runtime.d.ts.map +0 -1
  30. package/cjs/utils/Stream.d.ts.map +0 -1
  31. package/cjs/utils/WebSocket.d.ts.map +0 -1
  32. package/cjs/utils/otel.decorator.d.ts.map +0 -1
  33. package/esm/CodeInterpreter.d.ts.map +0 -1
  34. package/esm/ComputerUse.d.ts.map +0 -1
  35. package/esm/Daytona.d.ts.map +0 -1
  36. package/esm/FileSystem.d.ts.map +0 -1
  37. package/esm/Git.d.ts.map +0 -1
  38. package/esm/Image.d.ts.map +0 -1
  39. package/esm/LspServer.d.ts.map +0 -1
  40. package/esm/ObjectStorage.d.ts.map +0 -1
  41. package/esm/Process.d.ts.map +0 -1
  42. package/esm/PtyHandle.d.ts.map +0 -1
  43. package/esm/Sandbox.d.ts.map +0 -1
  44. package/esm/Snapshot.d.ts.map +0 -1
  45. package/esm/Volume.d.ts.map +0 -1
  46. package/esm/__tests__/helpers.d.ts +0 -6
  47. package/esm/__tests__/helpers.d.ts.map +0 -1
  48. package/esm/__tests__/helpers.js +0 -20
  49. package/esm/__tests__/helpers.js.map +0 -1
  50. package/esm/errors/DaytonaError.d.ts.map +0 -1
  51. package/esm/index.d.ts.map +0 -1
  52. package/esm/types/Charts.d.ts.map +0 -1
  53. package/esm/types/CodeInterpreter.d.ts.map +0 -1
  54. package/esm/types/ExecuteResponse.d.ts.map +0 -1
  55. package/esm/types/Pty.d.ts.map +0 -1
  56. package/esm/utils/Binary.d.ts.map +0 -1
  57. package/esm/utils/FileTransfer.d.ts.map +0 -1
  58. package/esm/utils/Import.d.ts.map +0 -1
  59. package/esm/utils/Multipart.d.ts.map +0 -1
  60. package/esm/utils/Runtime.d.ts.map +0 -1
  61. package/esm/utils/Stream.d.ts.map +0 -1
  62. package/esm/utils/WebSocket.d.ts.map +0 -1
  63. package/esm/utils/otel.decorator.d.ts.map +0 -1
  64. package/src/CodeInterpreter.d.ts +0 -94
  65. package/src/CodeInterpreter.js +0 -297
  66. package/src/CodeInterpreter.js.map +0 -1
  67. package/src/ComputerUse.d.ts +0 -538
  68. package/src/ComputerUse.js +0 -808
  69. package/src/ComputerUse.js.map +0 -1
  70. package/src/Daytona.d.ts +0 -353
  71. package/src/Daytona.js +0 -521
  72. package/src/Daytona.js.map +0 -1
  73. package/src/FileSystem.d.ts +0 -344
  74. package/src/FileSystem.js +0 -420
  75. package/src/FileSystem.js.map +0 -1
  76. package/src/Git.d.ts +0 -202
  77. package/src/Git.js +0 -326
  78. package/src/Git.js.map +0 -1
  79. package/src/Image.d.ts +0 -264
  80. package/src/Image.js +0 -586
  81. package/src/Image.js.map +0 -1
  82. package/src/LspServer.d.ts +0 -171
  83. package/src/LspServer.js +0 -259
  84. package/src/LspServer.js.map +0 -1
  85. package/src/ObjectStorage.d.ts +0 -78
  86. package/src/ObjectStorage.js +0 -199
  87. package/src/ObjectStorage.js.map +0 -1
  88. package/src/Process.d.ts +0 -489
  89. package/src/Process.js +0 -647
  90. package/src/Process.js.map +0 -1
  91. package/src/PtyHandle.d.ts +0 -154
  92. package/src/PtyHandle.js +0 -416
  93. package/src/PtyHandle.js.map +0 -1
  94. package/src/Sandbox.d.ts +0 -458
  95. package/src/Sandbox.js +0 -876
  96. package/src/Sandbox.js.map +0 -1
  97. package/src/Snapshot.d.ts +0 -139
  98. package/src/Snapshot.js +0 -248
  99. package/src/Snapshot.js.map +0 -1
  100. package/src/Volume.d.ts +0 -83
  101. package/src/Volume.js +0 -119
  102. package/src/Volume.js.map +0 -1
  103. package/src/__tests__/helpers.d.ts +0 -5
  104. package/src/__tests__/helpers.js +0 -24
  105. package/src/__tests__/helpers.js.map +0 -1
  106. package/src/errors/DaytonaError.d.ts +0 -170
  107. package/src/errors/DaytonaError.js +0 -258
  108. package/src/errors/DaytonaError.js.map +0 -1
  109. package/src/index.d.ts +0 -21
  110. package/src/index.js +0 -49
  111. package/src/index.js.map +0 -1
  112. package/src/types/Charts.d.ts +0 -37
  113. package/src/types/Charts.js +0 -37
  114. package/src/types/Charts.js.map +0 -1
  115. package/src/types/CodeInterpreter.d.ts +0 -76
  116. package/src/types/CodeInterpreter.js +0 -7
  117. package/src/types/CodeInterpreter.js.map +0 -1
  118. package/src/types/ExecuteResponse.d.ts +0 -25
  119. package/src/types/ExecuteResponse.js +0 -7
  120. package/src/types/ExecuteResponse.js.map +0 -1
  121. package/src/types/Pty.d.ts +0 -47
  122. package/src/types/Pty.js +0 -7
  123. package/src/types/Pty.js.map +0 -1
  124. package/src/utils/Binary.d.ts +0 -38
  125. package/src/utils/Binary.js +0 -168
  126. package/src/utils/Binary.js.map +0 -1
  127. package/src/utils/FileTransfer.d.ts +0 -14
  128. package/src/utils/FileTransfer.js +0 -258
  129. package/src/utils/FileTransfer.js.map +0 -1
  130. package/src/utils/Import.d.ts +0 -97
  131. package/src/utils/Import.js +0 -79
  132. package/src/utils/Import.js.map +0 -1
  133. package/src/utils/Multipart.d.ts +0 -28
  134. package/src/utils/Multipart.js +0 -115
  135. package/src/utils/Multipart.js.map +0 -1
  136. package/src/utils/Runtime.d.ts +0 -43
  137. package/src/utils/Runtime.js +0 -95
  138. package/src/utils/Runtime.js.map +0 -1
  139. package/src/utils/Stream.d.ts +0 -19
  140. package/src/utils/Stream.js +0 -364
  141. package/src/utils/Stream.js.map +0 -1
  142. package/src/utils/WebSocket.d.ts +0 -9
  143. package/src/utils/WebSocket.js +0 -26
  144. package/src/utils/WebSocket.js.map +0 -1
  145. package/src/utils/otel.decorator.d.ts +0 -82
  146. package/src/utils/otel.decorator.js +0 -141
  147. package/src/utils/otel.decorator.js.map +0 -1
package/src/Git.js DELETED
@@ -1,326 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2025 Daytona Platforms Inc.
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Git = void 0;
8
- const tslib_1 = require("tslib");
9
- const otel_decorator_1 = require("./utils/otel.decorator");
10
- /**
11
- * Provides Git operations within a Sandbox.
12
- *
13
- * @class
14
- */
15
- class Git {
16
- apiClient;
17
- constructor(apiClient) {
18
- this.apiClient = apiClient;
19
- }
20
- /**
21
- * Stages the specified files for the next commit, similar to
22
- * running 'git add' on the command line.
23
- *
24
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
25
- * @param {string[]} files - List of file paths or directories to stage, relative to the repository root
26
- * @returns {Promise<void>}
27
- *
28
- * @example
29
- * // Stage a single file
30
- * await git.add('workspace/repo', ['file.txt']);
31
- *
32
- * @example
33
- * // Stage whole repository
34
- * await git.add('workspace/repo', ['.']);
35
- */
36
- async add(path, files) {
37
- await this.apiClient.addFiles({
38
- path,
39
- files,
40
- });
41
- }
42
- /**
43
- * List branches in the repository.
44
- *
45
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
46
- * @returns {Promise<ListBranchResponse>} List of branches in the repository
47
- *
48
- * @example
49
- * const response = await git.branches('workspace/repo');
50
- * console.log(`Branches: ${response.branches}`);
51
- */
52
- async branches(path) {
53
- const response = await this.apiClient.listBranches(path);
54
- return response.data;
55
- }
56
- /**
57
- * Create branch in the repository.
58
- *
59
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
60
- * @param {string} name - Name of the new branch to create
61
- * @returns {Promise<void>}
62
- *
63
- * @example
64
- * await git.createBranch('workspace/repo', 'new-feature');
65
- */
66
- async createBranch(path, name) {
67
- await this.apiClient.createBranch({
68
- path,
69
- name,
70
- });
71
- return;
72
- }
73
- /**
74
- * Delete branche in the repository.
75
- *
76
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
77
- * @param {string} name - Name of the branch to delete
78
- * @returns {Promise<void>}
79
- *
80
- * @example
81
- * await git.deleteBranch('workspace/repo', 'new-feature');
82
- */
83
- async deleteBranch(path, name) {
84
- await this.apiClient.deleteBranch({
85
- path,
86
- name,
87
- });
88
- return;
89
- }
90
- /**
91
- * Checkout branche in the repository.
92
- *
93
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
94
- * @param {string} branch - Name of the branch to checkout
95
- * @returns {Promise<void>}
96
- *
97
- * @example
98
- * await git.checkoutBranch('workspace/repo', 'new-feature');
99
- */
100
- async checkoutBranch(path, branch) {
101
- await this.apiClient.checkoutBranch({
102
- path,
103
- branch,
104
- });
105
- return;
106
- }
107
- /**
108
- * Clones a Git repository into the specified path. It supports
109
- * cloning specific branches or commits, and can authenticate with the remote
110
- * repository if credentials are provided.
111
- *
112
- * @param {string} url - Repository URL to clone from
113
- * @param {string} path - Path where the repository should be cloned. Relative paths are resolved based on the sandbox working directory.
114
- * @param {string} [branch] - Specific branch to clone. If not specified, clones the default branch
115
- * @param {string} [commitId] - Specific commit to clone. If specified, the repository will be left in a detached HEAD state at this commit
116
- * @param {string} [username] - Git username for authentication
117
- * @param {string} [password] - Git password or token for authentication
118
- * @returns {Promise<void>}
119
- *
120
- * @example
121
- * // Clone the default branch
122
- * await git.clone(
123
- * 'https://github.com/user/repo.git',
124
- * 'workspace/repo'
125
- * );
126
- *
127
- * @example
128
- * // Clone a specific branch with authentication
129
- * await git.clone(
130
- * 'https://github.com/user/private-repo.git',
131
- * 'workspace/private',
132
- * branch='develop',
133
- * username='user',
134
- * password='token'
135
- * );
136
- *
137
- * @example
138
- * // Clone a specific commit
139
- * await git.clone(
140
- * 'https://github.com/user/repo.git',
141
- * 'workspace/repo-old',
142
- * commitId='abc123'
143
- * );
144
- */
145
- async clone(url, path, branch, commitId, username, password) {
146
- await this.apiClient.cloneRepository({
147
- url: url,
148
- branch: branch,
149
- path,
150
- username,
151
- password,
152
- commit_id: commitId,
153
- });
154
- }
155
- /**
156
- * Commits staged changes.
157
- *
158
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
159
- * @param {string} message - Commit message describing the changes
160
- * @param {string} author - Name of the commit author
161
- * @param {string} email - Email address of the commit author
162
- * @param {boolean} [allowEmpty] - Allow creating an empty commit when no changes are staged
163
- * @returns {Promise<void>}
164
- *
165
- * @example
166
- * // Stage and commit changes
167
- * await git.add('workspace/repo', ['README.md']);
168
- * await git.commit(
169
- * 'workspace/repo',
170
- * 'Update documentation',
171
- * 'John Doe',
172
- * 'john@example.com',
173
- * true
174
- * );
175
- *
176
- */
177
- async commit(path, message, author, email, allowEmpty) {
178
- const response = await this.apiClient.commitChanges({
179
- path,
180
- message,
181
- author,
182
- email,
183
- allow_empty: allowEmpty,
184
- });
185
- return {
186
- sha: response.data.hash,
187
- };
188
- }
189
- /**
190
- * Push local changes to the remote repository.
191
- *
192
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
193
- * @param {string} [username] - Git username for authentication
194
- * @param {string} [password] - Git password or token for authentication
195
- * @returns {Promise<void>}
196
- *
197
- * @example
198
- * // Push to a public repository
199
- * await git.push('workspace/repo');
200
- *
201
- * @example
202
- * // Push to a private repository
203
- * await git.push(
204
- * 'workspace/repo',
205
- * 'user',
206
- * 'token'
207
- * );
208
- */
209
- async push(path, username, password) {
210
- await this.apiClient.pushChanges({
211
- path,
212
- username,
213
- password,
214
- });
215
- }
216
- /**
217
- * Pulls changes from the remote repository.
218
- *
219
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
220
- * @param {string} [username] - Git username for authentication
221
- * @param {string} [password] - Git password or token for authentication
222
- * @returns {Promise<void>}
223
- *
224
- * @example
225
- * // Pull from a public repository
226
- * await git.pull('workspace/repo');
227
- *
228
- * @example
229
- * // Pull from a private repository
230
- * await git.pull(
231
- * 'workspace/repo',
232
- * 'user',
233
- * 'token'
234
- * );
235
- */
236
- async pull(path, username, password) {
237
- await this.apiClient.pullChanges({
238
- path,
239
- username,
240
- password,
241
- });
242
- }
243
- /**
244
- * Gets the current status of the Git repository.
245
- *
246
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
247
- * @returns {Promise<GitStatus>} Current repository status including:
248
- * - currentBranch: Name of the current branch
249
- * - ahead: Number of commits ahead of the remote branch
250
- * - behind: Number of commits behind the remote branch
251
- * - branchPublished: Whether the branch has been published to the remote repository
252
- * - fileStatus: List of file statuses
253
- *
254
- * @example
255
- * const status = await sandbox.git.status('workspace/repo');
256
- * console.log(`Current branch: ${status.currentBranch}`);
257
- * console.log(`Commits ahead: ${status.ahead}`);
258
- * console.log(`Commits behind: ${status.behind}`);
259
- */
260
- async status(path) {
261
- const response = await this.apiClient.getStatus(path);
262
- return response.data;
263
- }
264
- }
265
- exports.Git = Git;
266
- tslib_1.__decorate([
267
- (0, otel_decorator_1.WithInstrumentation)(),
268
- tslib_1.__metadata("design:type", Function),
269
- tslib_1.__metadata("design:paramtypes", [String, Array]),
270
- tslib_1.__metadata("design:returntype", Promise)
271
- ], Git.prototype, "add", null);
272
- tslib_1.__decorate([
273
- (0, otel_decorator_1.WithInstrumentation)(),
274
- tslib_1.__metadata("design:type", Function),
275
- tslib_1.__metadata("design:paramtypes", [String]),
276
- tslib_1.__metadata("design:returntype", Promise)
277
- ], Git.prototype, "branches", null);
278
- tslib_1.__decorate([
279
- (0, otel_decorator_1.WithInstrumentation)(),
280
- tslib_1.__metadata("design:type", Function),
281
- tslib_1.__metadata("design:paramtypes", [String, String]),
282
- tslib_1.__metadata("design:returntype", Promise)
283
- ], Git.prototype, "createBranch", null);
284
- tslib_1.__decorate([
285
- (0, otel_decorator_1.WithInstrumentation)(),
286
- tslib_1.__metadata("design:type", Function),
287
- tslib_1.__metadata("design:paramtypes", [String, String]),
288
- tslib_1.__metadata("design:returntype", Promise)
289
- ], Git.prototype, "deleteBranch", null);
290
- tslib_1.__decorate([
291
- (0, otel_decorator_1.WithInstrumentation)(),
292
- tslib_1.__metadata("design:type", Function),
293
- tslib_1.__metadata("design:paramtypes", [String, String]),
294
- tslib_1.__metadata("design:returntype", Promise)
295
- ], Git.prototype, "checkoutBranch", null);
296
- tslib_1.__decorate([
297
- (0, otel_decorator_1.WithInstrumentation)(),
298
- tslib_1.__metadata("design:type", Function),
299
- tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, String]),
300
- tslib_1.__metadata("design:returntype", Promise)
301
- ], Git.prototype, "clone", null);
302
- tslib_1.__decorate([
303
- (0, otel_decorator_1.WithInstrumentation)(),
304
- tslib_1.__metadata("design:type", Function),
305
- tslib_1.__metadata("design:paramtypes", [String, String, String, String, Boolean]),
306
- tslib_1.__metadata("design:returntype", Promise)
307
- ], Git.prototype, "commit", null);
308
- tslib_1.__decorate([
309
- (0, otel_decorator_1.WithInstrumentation)(),
310
- tslib_1.__metadata("design:type", Function),
311
- tslib_1.__metadata("design:paramtypes", [String, String, String]),
312
- tslib_1.__metadata("design:returntype", Promise)
313
- ], Git.prototype, "push", null);
314
- tslib_1.__decorate([
315
- (0, otel_decorator_1.WithInstrumentation)(),
316
- tslib_1.__metadata("design:type", Function),
317
- tslib_1.__metadata("design:paramtypes", [String, String, String]),
318
- tslib_1.__metadata("design:returntype", Promise)
319
- ], Git.prototype, "pull", null);
320
- tslib_1.__decorate([
321
- (0, otel_decorator_1.WithInstrumentation)(),
322
- tslib_1.__metadata("design:type", Function),
323
- tslib_1.__metadata("design:paramtypes", [String]),
324
- tslib_1.__metadata("design:returntype", Promise)
325
- ], Git.prototype, "status", null);
326
- //# sourceMappingURL=Git.js.map
package/src/Git.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Git.js","sourceRoot":"","sources":["../../../../libs/sdk-typescript/src/Git.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAGH,2DAA4D;AAY5D;;;;GAIG;AACH,MAAa,GAAG;IACe;IAA7B,YAA6B,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAElD;;;;;;;;;;;;;;;OAeG;IAEU,AAAN,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,KAAe;QAC5C,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;YAC5B,IAAI;YACJ,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;OASG;IAEU,AAAN,KAAK,CAAC,QAAQ,CAAC,IAAY;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACxD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAED;;;;;;;;;OASG;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];
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 {};