@daytonaio/sdk 0.170.0 → 0.171.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/LICENSE +190 -0
  2. package/cjs/CodeInterpreter.d.ts +95 -0
  3. package/cjs/CodeInterpreter.d.ts.map +1 -0
  4. package/cjs/CodeInterpreter.js +297 -0
  5. package/cjs/CodeInterpreter.js.map +1 -0
  6. package/cjs/ComputerUse.d.ts +539 -0
  7. package/cjs/ComputerUse.d.ts.map +1 -0
  8. package/cjs/ComputerUse.js +808 -0
  9. package/cjs/ComputerUse.js.map +1 -0
  10. package/cjs/Daytona.d.ts +355 -0
  11. package/cjs/Daytona.d.ts.map +1 -0
  12. package/cjs/Daytona.js +527 -0
  13. package/cjs/Daytona.js.map +1 -0
  14. package/cjs/FileSystem.d.ts +371 -0
  15. package/cjs/FileSystem.d.ts.map +1 -0
  16. package/cjs/FileSystem.js +489 -0
  17. package/cjs/FileSystem.js.map +1 -0
  18. package/cjs/Git.d.ts +203 -0
  19. package/cjs/Git.d.ts.map +1 -0
  20. package/cjs/Git.js +326 -0
  21. package/cjs/Git.js.map +1 -0
  22. package/cjs/Image.d.ts +265 -0
  23. package/cjs/Image.d.ts.map +1 -0
  24. package/cjs/Image.js +586 -0
  25. package/cjs/Image.js.map +1 -0
  26. package/cjs/LspServer.d.ts +172 -0
  27. package/cjs/LspServer.d.ts.map +1 -0
  28. package/cjs/LspServer.js +259 -0
  29. package/cjs/LspServer.js.map +1 -0
  30. package/cjs/ObjectStorage.d.ts +79 -0
  31. package/cjs/ObjectStorage.d.ts.map +1 -0
  32. package/cjs/ObjectStorage.js +199 -0
  33. package/cjs/ObjectStorage.js.map +1 -0
  34. package/cjs/Process.d.ts +490 -0
  35. package/cjs/Process.d.ts.map +1 -0
  36. package/cjs/Process.js +647 -0
  37. package/cjs/Process.js.map +1 -0
  38. package/cjs/PtyHandle.d.ts +155 -0
  39. package/cjs/PtyHandle.d.ts.map +1 -0
  40. package/cjs/PtyHandle.js +416 -0
  41. package/cjs/PtyHandle.js.map +1 -0
  42. package/cjs/README.md +180 -0
  43. package/cjs/Sandbox.d.ts +476 -0
  44. package/cjs/Sandbox.d.ts.map +1 -0
  45. package/cjs/Sandbox.js +905 -0
  46. package/cjs/Sandbox.js.map +1 -0
  47. package/cjs/Snapshot.d.ts +140 -0
  48. package/cjs/Snapshot.d.ts.map +1 -0
  49. package/cjs/Snapshot.js +248 -0
  50. package/cjs/Snapshot.js.map +1 -0
  51. package/cjs/Volume.d.ts +84 -0
  52. package/cjs/Volume.d.ts.map +1 -0
  53. package/cjs/Volume.js +119 -0
  54. package/cjs/Volume.js.map +1 -0
  55. package/cjs/__tests__/helpers.d.ts +6 -0
  56. package/cjs/__tests__/helpers.d.ts.map +1 -0
  57. package/cjs/__tests__/helpers.js +26 -0
  58. package/cjs/__tests__/helpers.js.map +1 -0
  59. package/cjs/errors/DaytonaError.d.ts +171 -0
  60. package/cjs/errors/DaytonaError.d.ts.map +1 -0
  61. package/cjs/errors/DaytonaError.js +258 -0
  62. package/cjs/errors/DaytonaError.js.map +1 -0
  63. package/cjs/index.d.ts +22 -0
  64. package/cjs/index.d.ts.map +1 -0
  65. package/cjs/index.js +49 -0
  66. package/cjs/index.js.map +1 -0
  67. package/cjs/package.json +3 -0
  68. package/cjs/types/Charts.d.ts +38 -0
  69. package/cjs/types/Charts.d.ts.map +1 -0
  70. package/cjs/types/Charts.js +37 -0
  71. package/cjs/types/Charts.js.map +1 -0
  72. package/cjs/types/CodeInterpreter.d.ts +77 -0
  73. package/cjs/types/CodeInterpreter.d.ts.map +1 -0
  74. package/cjs/types/CodeInterpreter.js +7 -0
  75. package/cjs/types/CodeInterpreter.js.map +1 -0
  76. package/cjs/types/ExecuteResponse.d.ts +26 -0
  77. package/cjs/types/ExecuteResponse.d.ts.map +1 -0
  78. package/cjs/types/ExecuteResponse.js +7 -0
  79. package/cjs/types/ExecuteResponse.js.map +1 -0
  80. package/cjs/types/Pty.d.ts +48 -0
  81. package/cjs/types/Pty.d.ts.map +1 -0
  82. package/cjs/types/Pty.js +7 -0
  83. package/cjs/types/Pty.js.map +1 -0
  84. package/cjs/utils/Binary.d.ts +39 -0
  85. package/cjs/utils/Binary.d.ts.map +1 -0
  86. package/cjs/utils/Binary.js +168 -0
  87. package/cjs/utils/Binary.js.map +1 -0
  88. package/cjs/utils/FileTransfer.d.ts +15 -0
  89. package/cjs/utils/FileTransfer.d.ts.map +1 -0
  90. package/cjs/utils/FileTransfer.js +261 -0
  91. package/cjs/utils/FileTransfer.js.map +1 -0
  92. package/cjs/utils/Import.d.ts +125 -0
  93. package/cjs/utils/Import.d.ts.map +1 -0
  94. package/cjs/utils/Import.js +112 -0
  95. package/cjs/utils/Import.js.map +1 -0
  96. package/cjs/utils/Multipart.d.ts +29 -0
  97. package/cjs/utils/Multipart.d.ts.map +1 -0
  98. package/cjs/utils/Multipart.js +115 -0
  99. package/cjs/utils/Multipart.js.map +1 -0
  100. package/cjs/utils/Runtime.d.ts +44 -0
  101. package/cjs/utils/Runtime.d.ts.map +1 -0
  102. package/cjs/utils/Runtime.js +95 -0
  103. package/cjs/utils/Runtime.js.map +1 -0
  104. package/cjs/utils/Stream.d.ts +20 -0
  105. package/cjs/utils/Stream.d.ts.map +1 -0
  106. package/cjs/utils/Stream.js +364 -0
  107. package/cjs/utils/Stream.js.map +1 -0
  108. package/cjs/utils/WebSocket.d.ts +10 -0
  109. package/cjs/utils/WebSocket.d.ts.map +1 -0
  110. package/cjs/utils/WebSocket.js +26 -0
  111. package/cjs/utils/WebSocket.js.map +1 -0
  112. package/cjs/utils/otel.decorator.d.ts +83 -0
  113. package/cjs/utils/otel.decorator.d.ts.map +1 -0
  114. package/cjs/utils/otel.decorator.js +141 -0
  115. package/cjs/utils/otel.decorator.js.map +1 -0
  116. package/esm/CodeInterpreter.d.ts +95 -0
  117. package/esm/CodeInterpreter.d.ts.map +1 -0
  118. package/esm/CodeInterpreter.js +292 -0
  119. package/esm/CodeInterpreter.js.map +1 -0
  120. package/esm/ComputerUse.d.ts +539 -0
  121. package/esm/ComputerUse.d.ts.map +1 -0
  122. package/esm/ComputerUse.js +799 -0
  123. package/esm/ComputerUse.js.map +1 -0
  124. package/esm/Daytona.d.ts +355 -0
  125. package/esm/Daytona.d.ts.map +1 -0
  126. package/esm/Daytona.js +523 -0
  127. package/esm/Daytona.js.map +1 -0
  128. package/esm/FileSystem.d.ts +371 -0
  129. package/esm/FileSystem.d.ts.map +1 -0
  130. package/esm/FileSystem.js +485 -0
  131. package/esm/FileSystem.js.map +1 -0
  132. package/esm/Git.d.ts +203 -0
  133. package/esm/Git.d.ts.map +1 -0
  134. package/esm/Git.js +322 -0
  135. package/esm/Git.js.map +1 -0
  136. package/esm/Image.d.ts +265 -0
  137. package/esm/Image.d.ts.map +1 -0
  138. package/esm/Image.js +581 -0
  139. package/esm/Image.js.map +1 -0
  140. package/esm/LspServer.d.ts +172 -0
  141. package/esm/LspServer.d.ts.map +1 -0
  142. package/esm/LspServer.js +255 -0
  143. package/esm/LspServer.js.map +1 -0
  144. package/esm/ObjectStorage.d.ts +79 -0
  145. package/esm/ObjectStorage.d.ts.map +1 -0
  146. package/esm/ObjectStorage.js +195 -0
  147. package/esm/ObjectStorage.js.map +1 -0
  148. package/esm/Process.d.ts +490 -0
  149. package/esm/Process.d.ts.map +1 -0
  150. package/esm/Process.js +642 -0
  151. package/esm/Process.js.map +1 -0
  152. package/esm/PtyHandle.d.ts +155 -0
  153. package/esm/PtyHandle.d.ts.map +1 -0
  154. package/esm/PtyHandle.js +412 -0
  155. package/esm/PtyHandle.js.map +1 -0
  156. package/esm/README.md +180 -0
  157. package/esm/Sandbox.d.ts +476 -0
  158. package/esm/Sandbox.d.ts.map +1 -0
  159. package/esm/Sandbox.js +901 -0
  160. package/esm/Sandbox.js.map +1 -0
  161. package/esm/Snapshot.d.ts +140 -0
  162. package/esm/Snapshot.d.ts.map +1 -0
  163. package/esm/Snapshot.js +244 -0
  164. package/esm/Snapshot.js.map +1 -0
  165. package/esm/Volume.d.ts +84 -0
  166. package/esm/Volume.d.ts.map +1 -0
  167. package/esm/Volume.js +115 -0
  168. package/esm/Volume.js.map +1 -0
  169. package/esm/__tests__/helpers.d.ts +6 -0
  170. package/esm/__tests__/helpers.d.ts.map +1 -0
  171. package/esm/__tests__/helpers.js +20 -0
  172. package/esm/__tests__/helpers.js.map +1 -0
  173. package/esm/errors/DaytonaError.d.ts +171 -0
  174. package/esm/errors/DaytonaError.d.ts.map +1 -0
  175. package/esm/errors/DaytonaError.js +243 -0
  176. package/esm/errors/DaytonaError.js.map +1 -0
  177. package/esm/index.d.ts +22 -0
  178. package/esm/index.d.ts.map +1 -0
  179. package/esm/index.js +21 -0
  180. package/esm/index.js.map +1 -0
  181. package/esm/package.json +3 -0
  182. package/esm/types/Charts.d.ts +38 -0
  183. package/esm/types/Charts.d.ts.map +1 -0
  184. package/esm/types/Charts.js +33 -0
  185. package/esm/types/Charts.js.map +1 -0
  186. package/esm/types/CodeInterpreter.d.ts +77 -0
  187. package/esm/types/CodeInterpreter.d.ts.map +1 -0
  188. package/esm/types/CodeInterpreter.js +6 -0
  189. package/esm/types/CodeInterpreter.js.map +1 -0
  190. package/esm/types/ExecuteResponse.d.ts +26 -0
  191. package/esm/types/ExecuteResponse.d.ts.map +1 -0
  192. package/esm/types/ExecuteResponse.js +6 -0
  193. package/esm/types/ExecuteResponse.js.map +1 -0
  194. package/esm/types/Pty.d.ts +48 -0
  195. package/esm/types/Pty.d.ts.map +1 -0
  196. package/esm/types/Pty.js +6 -0
  197. package/esm/types/Pty.js.map +1 -0
  198. package/esm/utils/Binary.d.ts +39 -0
  199. package/esm/utils/Binary.d.ts.map +1 -0
  200. package/esm/utils/Binary.js +157 -0
  201. package/esm/utils/Binary.js.map +1 -0
  202. package/esm/utils/FileTransfer.d.ts +15 -0
  203. package/esm/utils/FileTransfer.d.ts.map +1 -0
  204. package/esm/utils/FileTransfer.js +254 -0
  205. package/esm/utils/FileTransfer.js.map +1 -0
  206. package/esm/utils/Import.d.ts +95 -0
  207. package/esm/utils/Import.d.ts.map +1 -0
  208. package/esm/utils/Import.js +77 -0
  209. package/esm/utils/Import.js.map +1 -0
  210. package/esm/utils/Multipart.d.ts +29 -0
  211. package/esm/utils/Multipart.d.ts.map +1 -0
  212. package/esm/utils/Multipart.js +109 -0
  213. package/esm/utils/Multipart.js.map +1 -0
  214. package/esm/utils/Runtime.d.ts +44 -0
  215. package/esm/utils/Runtime.d.ts.map +1 -0
  216. package/esm/utils/Runtime.js +89 -0
  217. package/esm/utils/Runtime.js.map +1 -0
  218. package/esm/utils/Stream.d.ts +20 -0
  219. package/esm/utils/Stream.d.ts.map +1 -0
  220. package/esm/utils/Stream.js +360 -0
  221. package/esm/utils/Stream.js.map +1 -0
  222. package/esm/utils/WebSocket.d.ts +10 -0
  223. package/esm/utils/WebSocket.d.ts.map +1 -0
  224. package/esm/utils/WebSocket.js +22 -0
  225. package/esm/utils/WebSocket.js.map +1 -0
  226. package/esm/utils/otel.decorator.d.ts +83 -0
  227. package/esm/utils/otel.decorator.d.ts.map +1 -0
  228. package/esm/utils/otel.decorator.js +136 -0
  229. package/esm/utils/otel.decorator.js.map +1 -0
  230. package/package.json +20 -8
  231. package/src/ComputerUse.d.ts +4 -4
  232. package/src/ComputerUse.js +4 -4
  233. package/src/Sandbox.d.ts +1 -18
  234. package/src/Sandbox.js +0 -29
  235. package/src/Sandbox.js.map +1 -1
  236. package/src/__tests__/helpers.js +0 -2
  237. package/src/__tests__/helpers.js.map +1 -1
package/esm/Image.js ADDED
@@ -0,0 +1,581 @@
1
+ /*
2
+ * Copyright 2025 Daytona Platforms Inc.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import * as pathe from 'pathe';
6
+ import { quote, parse as parseShellQuote } from 'shell-quote';
7
+ import { DaytonaNotFoundError, DaytonaValidationError } from './errors/DaytonaError.js';
8
+ import { dynamicRequire } from './utils/Import.js';
9
+ const SUPPORTED_PYTHON_SERIES = ['3.9', '3.10', '3.11', '3.12', '3.13'];
10
+ const LATEST_PYTHON_MICRO_VERSIONS = ['3.9.22', '3.10.17', '3.11.12', '3.12.10', '3.13.3'];
11
+ /**
12
+ * Represents an image definition for a Daytona sandbox.
13
+ * Do not construct this class directly. Instead use one of its static factory methods,
14
+ * such as `Image.base()`, `Image.debianSlim()` or `Image.fromDockerfile()`.
15
+ *
16
+ * @class
17
+ * @property {string} dockerfile - The Dockerfile content.
18
+ * @property {Context[]} contextList - The list of context files to be added to the image.
19
+ */
20
+ export class Image {
21
+ _dockerfile = '';
22
+ _contextList = [];
23
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
24
+ constructor() { }
25
+ get dockerfile() {
26
+ return this._dockerfile;
27
+ }
28
+ get contextList() {
29
+ return this._contextList;
30
+ }
31
+ /**
32
+ * Adds commands to install packages using pip.
33
+ *
34
+ * @param {string | string[]} packages - The packages to install.
35
+ * @param {Object} options - The options for the pip install command.
36
+ * @param {string[]} options.findLinks - The find-links to use for the pip install command.
37
+ * @returns {Image} The Image instance.
38
+ *
39
+ * @example
40
+ * const image = Image.debianSlim('3.12').pipInstall('numpy', { findLinks: ['https://pypi.org/simple'] })
41
+ */
42
+ pipInstall(packages, options) {
43
+ const pkgs = this.flattenStringArgs('pipInstall', 'packages', packages);
44
+ if (!pkgs.length)
45
+ return this;
46
+ const extraArgs = this.formatPipInstallArgs(options);
47
+ this._dockerfile += `RUN python -m pip install ${quote(pkgs.sort())}${extraArgs}\n`;
48
+ return this;
49
+ }
50
+ /**
51
+ * Installs dependencies from a requirements.txt file.
52
+ *
53
+ * @param {string} requirementsTxt - The path to the requirements.txt file.
54
+ * @param {PipInstallOptions} options - The options for the pip install command.
55
+ * @returns {Image} The Image instance.
56
+ *
57
+ * @example
58
+ * const image = Image.debianSlim('3.12')
59
+ * image.pipInstallFromRequirements('requirements.txt', { findLinks: ['https://pypi.org/simple'] })
60
+ */
61
+ pipInstallFromRequirements(requirementsTxt, options) {
62
+ const importErrorPrefix = '"pipInstallFromRequirements" is not supported: ';
63
+ const expandTilde = dynamicRequire('expand-tilde', importErrorPrefix);
64
+ const fs = dynamicRequire('fs', importErrorPrefix);
65
+ const expandedPath = expandTilde(requirementsTxt);
66
+ if (!fs.existsSync(expandedPath)) {
67
+ throw new DaytonaNotFoundError(`Requirements file ${requirementsTxt} does not exist`);
68
+ }
69
+ if (!fs.statSync(expandedPath).isFile()) {
70
+ throw new DaytonaValidationError(`Requirements path ${requirementsTxt} exists but is not a file`);
71
+ }
72
+ const extraArgs = this.formatPipInstallArgs(options);
73
+ this._contextList.push({ sourcePath: expandedPath, archivePath: expandedPath });
74
+ this._dockerfile += `COPY ${expandedPath} /.requirements.txt\n`;
75
+ this._dockerfile += `RUN python -m pip install -r /.requirements.txt${extraArgs}\n`;
76
+ return this;
77
+ }
78
+ /**
79
+ * Installs dependencies from a pyproject.toml file.
80
+ *
81
+ * @param {string} pyprojectToml - The path to the pyproject.toml file.
82
+ * @param {PyprojectOptions} options - The options for the pip install command.
83
+ * @returns {Image} The Image instance.
84
+ *
85
+ * @example
86
+ * const image = Image.debianSlim('3.12')
87
+ * image.pipInstallFromPyproject('pyproject.toml', { optionalDependencies: ['dev'] })
88
+ */
89
+ pipInstallFromPyproject(pyprojectToml, options) {
90
+ const importErrorPrefix = '"pipInstallFromPyproject" is not supported: ';
91
+ const expandTilde = dynamicRequire('expand-tilde', importErrorPrefix);
92
+ const toml = dynamicRequire('@iarna/toml', importErrorPrefix);
93
+ const fs = dynamicRequire('fs', importErrorPrefix);
94
+ const expandedPath = expandTilde(pyprojectToml);
95
+ if (!fs.existsSync(expandedPath)) {
96
+ throw new DaytonaNotFoundError(`pyproject.toml file ${pyprojectToml} does not exist`);
97
+ }
98
+ if (!fs.statSync(expandedPath).isFile()) {
99
+ throw new DaytonaValidationError(`pyproject.toml path ${pyprojectToml} exists but is not a file`);
100
+ }
101
+ let tomlData;
102
+ try {
103
+ tomlData = toml.parse(fs.readFileSync(expandedPath, 'utf-8'));
104
+ }
105
+ catch (error) {
106
+ const errorMessage = error instanceof Error ? error.message : String(error);
107
+ throw new DaytonaValidationError(`Invalid pyproject.toml file ${pyprojectToml}: ${errorMessage}`);
108
+ }
109
+ const dependencies = [];
110
+ if (!tomlData || !tomlData.project || !Array.isArray(tomlData.project.dependencies)) {
111
+ const msg = 'No [project.dependencies] section in pyproject.toml file. ' +
112
+ 'See https://packaging.python.org/en/latest/guides/writing-pyproject-toml ' +
113
+ 'for further file format guidelines.';
114
+ throw new DaytonaValidationError(msg);
115
+ }
116
+ dependencies.push(...tomlData.project.dependencies);
117
+ if (options?.optionalDependencies && tomlData.project['optional-dependencies']) {
118
+ const optionalGroups = tomlData.project['optional-dependencies'];
119
+ if (typeof optionalGroups !== 'object' || Array.isArray(optionalGroups)) {
120
+ throw new DaytonaValidationError('optional-dependencies must be a mapping in pyproject.toml');
121
+ }
122
+ for (const group of options.optionalDependencies) {
123
+ const deps = optionalGroups[group];
124
+ if (Array.isArray(deps)) {
125
+ dependencies.push(...deps);
126
+ }
127
+ }
128
+ }
129
+ return this.pipInstall(dependencies, options);
130
+ }
131
+ /**
132
+ * Adds a local file to the image.
133
+ *
134
+ * @param {string} localPath - The path to the local file.
135
+ * @param {string} remotePath - The path of the file in the image.
136
+ * @returns {Image} The Image instance.
137
+ *
138
+ * @example
139
+ * const image = Image
140
+ * .debianSlim('3.12')
141
+ * .addLocalFile('requirements.txt', '/home/daytona/requirements.txt')
142
+ */
143
+ addLocalFile(localPath, remotePath) {
144
+ const importErrorPrefix = '"addLocalFile" is not supported: ';
145
+ const expandTilde = dynamicRequire('expand-tilde', importErrorPrefix);
146
+ const fs = dynamicRequire('fs', importErrorPrefix);
147
+ if (remotePath.endsWith('/')) {
148
+ remotePath = remotePath + pathe.basename(localPath);
149
+ }
150
+ const expandedPath = expandTilde(localPath);
151
+ if (!fs.existsSync(expandedPath)) {
152
+ throw new DaytonaNotFoundError(`Local file ${localPath} does not exist`);
153
+ }
154
+ if (!fs.statSync(expandedPath).isFile()) {
155
+ throw new DaytonaValidationError(`Local path ${localPath} exists but is not a file`);
156
+ }
157
+ this._contextList.push({ sourcePath: expandedPath, archivePath: expandedPath });
158
+ this._dockerfile += `COPY ${expandedPath} ${remotePath}\n`;
159
+ return this;
160
+ }
161
+ /**
162
+ * Adds a local directory to the image.
163
+ *
164
+ * @param {string} localPath - The path to the local directory.
165
+ * @param {string} remotePath - The path of the directory in the image.
166
+ * @returns {Image} The Image instance.
167
+ *
168
+ * @example
169
+ * const image = Image
170
+ * .debianSlim('3.12')
171
+ * .addLocalDir('src', '/home/daytona/src')
172
+ */
173
+ addLocalDir(localPath, remotePath) {
174
+ const importErrorPrefix = '"addLocalDir" is not supported: ';
175
+ const expandTilde = dynamicRequire('expand-tilde', importErrorPrefix);
176
+ const fs = dynamicRequire('fs', importErrorPrefix);
177
+ const expandedPath = expandTilde(localPath);
178
+ if (!fs.existsSync(expandedPath)) {
179
+ throw new DaytonaNotFoundError(`Local directory ${localPath} does not exist`);
180
+ }
181
+ if (!fs.statSync(expandedPath).isDirectory()) {
182
+ throw new DaytonaValidationError(`Local path ${localPath} exists but is not a directory`);
183
+ }
184
+ this._contextList.push({ sourcePath: expandedPath, archivePath: expandedPath });
185
+ this._dockerfile += `COPY ${expandedPath} ${remotePath}\n`;
186
+ return this;
187
+ }
188
+ /**
189
+ * Runs commands in the image.
190
+ *
191
+ * @param {string | string[]} commands - The commands to run.
192
+ * @returns {Image} The Image instance.
193
+ *
194
+ * @example
195
+ * const image = Image
196
+ * .debianSlim('3.12')
197
+ * .runCommands(
198
+ * 'echo "Hello, world!"',
199
+ * ['bash', '-c', 'echo Hello, world, again!']
200
+ * )
201
+ */
202
+ runCommands(...commands) {
203
+ for (const command of commands) {
204
+ if (Array.isArray(command)) {
205
+ this._dockerfile += `RUN ${command.map((c) => `"${c.replace(/"/g, '\\\\\\"').replace(/'/g, "\\'")}"`).join(' ')}\n`;
206
+ }
207
+ else {
208
+ this._dockerfile += `RUN ${command}\n`;
209
+ }
210
+ }
211
+ return this;
212
+ }
213
+ /**
214
+ * Sets environment variables in the image.
215
+ *
216
+ * @param {Record<string, string>} envVars - The environment variables to set.
217
+ * @returns {Image} The Image instance.
218
+ *
219
+ * @example
220
+ * const image = Image
221
+ * .debianSlim('3.12')
222
+ * .env({ FOO: 'bar' })
223
+ */
224
+ env(envVars) {
225
+ const nonStringKeys = Object.entries(envVars)
226
+ .filter(([, value]) => typeof value !== 'string')
227
+ .map(([key]) => key);
228
+ if (nonStringKeys.length) {
229
+ throw new DaytonaValidationError(`Image ENV variables must be strings. Invalid keys: ${nonStringKeys}`);
230
+ }
231
+ for (const [key, val] of Object.entries(envVars)) {
232
+ this._dockerfile += `ENV ${key}=${quote([val])}\n`;
233
+ }
234
+ return this;
235
+ }
236
+ /**
237
+ * Sets the working directory in the image.
238
+ *
239
+ * @param {string} dirPath - The path to the working directory.
240
+ * @returns {Image} The Image instance.
241
+ *
242
+ * @example
243
+ * const image = Image
244
+ * .debianSlim('3.12')
245
+ * .workdir('/home/daytona')
246
+ */
247
+ workdir(dirPath) {
248
+ this._dockerfile += `WORKDIR ${quote([dirPath])}\n`;
249
+ return this;
250
+ }
251
+ /**
252
+ * Sets the entrypoint for the image.
253
+ *
254
+ * @param {string[]} entrypointCommands - The commands to set as the entrypoint.
255
+ * @returns {Image} The Image instance.
256
+ *
257
+ * @example
258
+ * const image = Image
259
+ * .debianSlim('3.12')
260
+ * .entrypoint(['/bin/bash'])
261
+ */
262
+ entrypoint(entrypointCommands) {
263
+ if (!Array.isArray(entrypointCommands) || !entrypointCommands.every((x) => typeof x === 'string')) {
264
+ throw new DaytonaValidationError('entrypoint_commands must be a list of strings');
265
+ }
266
+ const argsStr = entrypointCommands.map((arg) => `"${arg}"`).join(', ');
267
+ this._dockerfile += `ENTRYPOINT [${argsStr}]\n`;
268
+ return this;
269
+ }
270
+ /**
271
+ * Sets the default command for the image.
272
+ *
273
+ * @param {string[]} cmd - The command to set as the default command.
274
+ * @returns {Image} The Image instance.
275
+ *
276
+ * @example
277
+ * const image = Image
278
+ * .debianSlim('3.12')
279
+ * .cmd(['/bin/bash'])
280
+ */
281
+ cmd(cmd) {
282
+ if (!Array.isArray(cmd) || !cmd.every((x) => typeof x === 'string')) {
283
+ throw new DaytonaValidationError('Image CMD must be a list of strings');
284
+ }
285
+ const cmdStr = cmd.map((arg) => `"${arg}"`).join(', ');
286
+ this._dockerfile += `CMD [${cmdStr}]\n`;
287
+ return this;
288
+ }
289
+ /**
290
+ * Extends an image with arbitrary Dockerfile-like commands.
291
+ *
292
+ * @param {string | string[]} dockerfileCommands - The commands to add to the Dockerfile.
293
+ * @param {string} contextDir - The path to the context directory.
294
+ * @returns {Image} The Image instance.
295
+ *
296
+ * @example
297
+ * const image = Image
298
+ * .debianSlim('3.12')
299
+ * .dockerfileCommands(['RUN echo "Hello, world!"'])
300
+ */
301
+ dockerfileCommands(dockerfileCommands, contextDir) {
302
+ if (contextDir) {
303
+ const importErrorPrefix = '"dockerfileCommands" is not supported: ';
304
+ const expandTilde = dynamicRequire('expand-tilde', importErrorPrefix);
305
+ const fs = dynamicRequire('fs', importErrorPrefix);
306
+ const expandedPath = expandTilde(contextDir);
307
+ if (!fs.existsSync(expandedPath)) {
308
+ throw new DaytonaNotFoundError(`Context directory ${contextDir} does not exist`);
309
+ }
310
+ if (!fs.statSync(expandedPath).isDirectory()) {
311
+ throw new DaytonaValidationError(`Context path ${contextDir} exists but is not a directory`);
312
+ }
313
+ }
314
+ for (const [contextPath, originalPath] of Image.extractCopySources(dockerfileCommands.join('\n'), contextDir || '')) {
315
+ let archiveBasePath = contextPath;
316
+ if (contextDir && !originalPath.startsWith(contextDir)) {
317
+ archiveBasePath = contextPath.substring(contextDir.length);
318
+ // Remove leading separators
319
+ // eslint-disable-next-line no-useless-escape
320
+ archiveBasePath = archiveBasePath.replace(/^[\/\\]+/, '');
321
+ }
322
+ this._contextList.push({ sourcePath: contextPath, archivePath: archiveBasePath });
323
+ }
324
+ this._dockerfile += dockerfileCommands.join('\n') + '\n';
325
+ return this;
326
+ }
327
+ /**
328
+ * Creates an Image from an existing Dockerfile.
329
+ *
330
+ * @param {string} path - The path to the Dockerfile.
331
+ * @returns {Image} The Image instance.
332
+ *
333
+ * @example
334
+ * const image = Image.fromDockerfile('Dockerfile')
335
+ */
336
+ static fromDockerfile(path) {
337
+ const importErrorPrefix = '"fromDockerfile" is not supported: ';
338
+ const expandTilde = dynamicRequire('expand-tilde', importErrorPrefix);
339
+ const fs = dynamicRequire('fs', importErrorPrefix);
340
+ const expandedPath = pathe.resolve(expandTilde(path));
341
+ if (!fs.existsSync(expandedPath)) {
342
+ throw new DaytonaNotFoundError(`Dockerfile ${path} does not exist`);
343
+ }
344
+ if (!fs.statSync(expandedPath).isFile()) {
345
+ throw new DaytonaValidationError(`Dockerfile path ${path} exists but is not a file`);
346
+ }
347
+ const dockerfileContent = fs.readFileSync(expandedPath, 'utf-8');
348
+ const img = new Image();
349
+ img._dockerfile = dockerfileContent;
350
+ // Remove dockerfile filename from path to get the path prefix
351
+ const pathPrefix = pathe.dirname(expandedPath) + pathe.sep;
352
+ for (const [contextPath, originalPath] of Image.extractCopySources(dockerfileContent, pathPrefix)) {
353
+ let archiveBasePath = contextPath;
354
+ if (!originalPath.startsWith(pathPrefix)) {
355
+ // Remove the path prefix from the context path to get the archive path
356
+ archiveBasePath = contextPath.substring(pathPrefix.length);
357
+ // Remove leading separators
358
+ // eslint-disable-next-line no-useless-escape
359
+ archiveBasePath = archiveBasePath.replace(/^[\/\\]+/, '');
360
+ }
361
+ img._contextList.push({ sourcePath: contextPath, archivePath: archiveBasePath });
362
+ }
363
+ return img;
364
+ }
365
+ /**
366
+ * Creates an Image from an existing base image.
367
+ *
368
+ * @param {string} image - The base image to use.
369
+ * @returns {Image} The Image instance.
370
+ *
371
+ * @example
372
+ * const image = Image.base('python:3.12-slim-bookworm')
373
+ */
374
+ static base(image) {
375
+ const img = new Image();
376
+ img._dockerfile = `FROM ${image}\n`;
377
+ return img;
378
+ }
379
+ /**
380
+ * Creates a Debian slim image based on the official Python Docker image.
381
+ *
382
+ * @param {string} pythonVersion - The Python version to use.
383
+ * @returns {Image} The Image instance.
384
+ *
385
+ * @example
386
+ * const image = Image.debianSlim('3.12')
387
+ */
388
+ static debianSlim(pythonVersion) {
389
+ const version = Image.processPythonVersion(pythonVersion);
390
+ const img = new Image();
391
+ const commands = [
392
+ `FROM python:${version}-slim-bookworm`,
393
+ 'RUN apt-get update',
394
+ 'RUN apt-get install -y gcc gfortran build-essential',
395
+ 'RUN pip install --upgrade pip',
396
+ // Set debian front-end to non-interactive to avoid users getting stuck with input prompts.
397
+ "RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections",
398
+ ];
399
+ img._dockerfile = commands.join('\n') + '\n';
400
+ return img;
401
+ }
402
+ /**
403
+ * Formats pip install arguments in a single string.
404
+ *
405
+ * @param {PipInstallOptions} options - The options for the pip install command.
406
+ * @returns {string} The formatted pip install arguments.
407
+ */
408
+ formatPipInstallArgs(options) {
409
+ if (!options)
410
+ return '';
411
+ let extraArgs = '';
412
+ if (options.findLinks) {
413
+ for (const findLink of options.findLinks) {
414
+ extraArgs += ` --find-links ${quote([findLink])}`;
415
+ }
416
+ }
417
+ if (options.indexUrl) {
418
+ extraArgs += ` --index-url ${quote([options.indexUrl])}`;
419
+ }
420
+ if (options.extraIndexUrls) {
421
+ for (const extraIndexUrl of options.extraIndexUrls) {
422
+ extraArgs += ` --extra-index-url ${quote([extraIndexUrl])}`;
423
+ }
424
+ }
425
+ if (options.pre) {
426
+ extraArgs += ' --pre';
427
+ }
428
+ if (options.extraOptions) {
429
+ extraArgs += ` ${options.extraOptions.trim()}`;
430
+ }
431
+ return extraArgs;
432
+ }
433
+ /**
434
+ * Flattens a string argument.
435
+ *
436
+ * @param {string} functionName - The name of the function.
437
+ * @param {string} argName - The name of the argument.
438
+ * @param {any} args - The argument to flatten.
439
+ * @returns {string[]} The flattened argument.
440
+ */
441
+ flattenStringArgs(functionName, argName, args) {
442
+ const result = [];
443
+ const flatten = (arg) => {
444
+ if (typeof arg === 'string') {
445
+ result.push(arg);
446
+ }
447
+ else if (Array.isArray(arg)) {
448
+ for (const item of arg) {
449
+ flatten(item);
450
+ }
451
+ }
452
+ else {
453
+ throw new DaytonaValidationError(`${functionName}: ${argName} must only contain strings`);
454
+ }
455
+ };
456
+ flatten(args);
457
+ return result;
458
+ }
459
+ /**
460
+ * Processes the Python version.
461
+ *
462
+ * @param {string} pythonVersion - The Python version to use.
463
+ * @returns {string} The processed Python version.
464
+ */
465
+ static processPythonVersion(pythonVersion) {
466
+ if (!pythonVersion) {
467
+ // Default to latest
468
+ pythonVersion = SUPPORTED_PYTHON_SERIES[SUPPORTED_PYTHON_SERIES.length - 1];
469
+ }
470
+ if (!SUPPORTED_PYTHON_SERIES.includes(pythonVersion)) {
471
+ throw new DaytonaValidationError(`Unsupported Python version: ${pythonVersion}. ` +
472
+ `Daytona supports the following series: ${SUPPORTED_PYTHON_SERIES.join(', ')}`);
473
+ }
474
+ // Map series to latest micro version
475
+ const seriesMap = Object.fromEntries(LATEST_PYTHON_MICRO_VERSIONS.map((v) => {
476
+ const [major, minor, micro] = v.split('.');
477
+ return [`${major}.${minor}`, micro];
478
+ }));
479
+ const micro = seriesMap[pythonVersion];
480
+ return `${pythonVersion}.${micro}`;
481
+ }
482
+ /**
483
+ * Extracts source files from COPY commands in a Dockerfile.
484
+ *
485
+ * @param {string} dockerfileContent - The content of the Dockerfile.
486
+ * @param {string} pathPrefix - The path prefix to use for the sources.
487
+ * @returns {Array<[string, string]>} The list of the actual file path and its corresponding COPY-command source path.
488
+ */
489
+ static extractCopySources(dockerfileContent, pathPrefix = '') {
490
+ const sources = [];
491
+ const lines = dockerfileContent.split('\n');
492
+ for (const line of lines) {
493
+ // Skip empty lines and comments
494
+ if (!line.trim() || line.trim().startsWith('#')) {
495
+ continue;
496
+ }
497
+ // Check if the line contains a COPY command
498
+ if (/^\s*COPY\s+(?!.*--from=)/i.test(line)) {
499
+ // Skip COPY instructions that use heredoc syntax (inline content, not file references)
500
+ if (line.includes('<<')) {
501
+ continue;
502
+ }
503
+ const importErrorPrefix = '"extractCopySources" is not supported: ';
504
+ const fg = dynamicRequire('fast-glob', importErrorPrefix);
505
+ const commandParts = this.parseCopyCommand(line);
506
+ if (commandParts) {
507
+ // Get source paths from the parsed command parts
508
+ for (const source of commandParts.sources) {
509
+ // Handle absolute and relative paths differently
510
+ const fullPathPattern = pathe.isAbsolute(source) ? source : pathe.join(pathPrefix, source);
511
+ const matchingFiles = fg.sync([fullPathPattern], { dot: true });
512
+ if (matchingFiles.length > 0) {
513
+ for (const matchingFile of matchingFiles) {
514
+ sources.push([matchingFile, source]);
515
+ }
516
+ }
517
+ else {
518
+ sources.push([fullPathPattern, source]);
519
+ }
520
+ }
521
+ }
522
+ }
523
+ }
524
+ return sources;
525
+ }
526
+ /**
527
+ * Parses a COPY command to extract sources and destination.
528
+ *
529
+ * @param {string} line - The line to parse.
530
+ * @returns {Object} The parsed sources and destination.
531
+ */
532
+ static parseCopyCommand(line) {
533
+ // Remove initial "COPY" and strip whitespace
534
+ const parts = line.trim().substring(4).trim();
535
+ // Handle JSON array format: COPY ["src1", "src2", "dest"]
536
+ if (parts.startsWith('[')) {
537
+ try {
538
+ // Parse the JSON-like array format
539
+ const elements = parseShellQuote(parts.replace('[', '').replace(']', '')).filter((x) => typeof x === 'string');
540
+ if (elements.length < 2) {
541
+ return null;
542
+ }
543
+ return {
544
+ sources: elements.slice(0, -1),
545
+ dest: elements[elements.length - 1],
546
+ };
547
+ }
548
+ catch {
549
+ return null;
550
+ }
551
+ }
552
+ // Handle regular format with possible flags
553
+ const splitParts = parseShellQuote(parts).filter((x) => typeof x === 'string');
554
+ // Extract flags like --chown, --chmod, --from
555
+ let sourcesStartIdx = 0;
556
+ for (let i = 0; i < splitParts.length; i++) {
557
+ const part = splitParts[i];
558
+ if (part.startsWith('--')) {
559
+ // Skip the flag and its value if it has one
560
+ if (!part.includes('=') && i + 1 < splitParts.length && !splitParts[i + 1].startsWith('--')) {
561
+ sourcesStartIdx = i + 2;
562
+ }
563
+ else {
564
+ sourcesStartIdx = i + 1;
565
+ }
566
+ }
567
+ else {
568
+ break;
569
+ }
570
+ }
571
+ // After skipping flags, we need at least one source and one destination
572
+ if (splitParts.length - sourcesStartIdx < 2) {
573
+ return null;
574
+ }
575
+ return {
576
+ sources: splitParts.slice(sourcesStartIdx, -1),
577
+ dest: splitParts[splitParts.length - 1],
578
+ };
579
+ }
580
+ }
581
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/Image.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAA;AAEhF,MAAM,4BAA4B,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;AA4C1F;;;;;;;;GAQG;AACH,MAAM,OAAO,KAAK;IACR,WAAW,GAAG,EAAE,CAAA;IAChB,YAAY,GAAc,EAAE,CAAA;IAEpC,gEAAgE;IAChE,gBAAuB,CAAC;IAExB,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;IAED;;;;;;;;;;O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