@daytonaio/sdk 0.170.0 → 0.171.0-alpha.4

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 (198) hide show
  1. package/LICENSE +190 -0
  2. package/{src → cjs}/CodeInterpreter.d.ts +1 -0
  3. package/cjs/CodeInterpreter.js.map +1 -0
  4. package/{src → cjs}/ComputerUse.d.ts +2 -1
  5. package/{src → cjs}/ComputerUse.js +2 -2
  6. package/cjs/ComputerUse.js.map +1 -0
  7. package/{src → cjs}/Daytona.d.ts +3 -1
  8. package/{src → cjs}/Daytona.js +8 -2
  9. package/cjs/Daytona.js.map +1 -0
  10. package/{src → cjs}/FileSystem.d.ts +27 -0
  11. package/{src → cjs}/FileSystem.js +69 -0
  12. package/cjs/FileSystem.js.map +1 -0
  13. package/{src → cjs}/Git.d.ts +1 -0
  14. package/cjs/Git.js.map +1 -0
  15. package/{src → cjs}/Image.d.ts +1 -0
  16. package/cjs/Image.js.map +1 -0
  17. package/{src → cjs}/LspServer.d.ts +1 -0
  18. package/cjs/LspServer.js.map +1 -0
  19. package/{src → cjs}/ObjectStorage.d.ts +1 -0
  20. package/cjs/ObjectStorage.js.map +1 -0
  21. package/{src → cjs}/Process.d.ts +1 -0
  22. package/cjs/Process.js.map +1 -0
  23. package/{src → cjs}/PtyHandle.d.ts +1 -0
  24. package/cjs/PtyHandle.js.map +1 -0
  25. package/cjs/README.md +180 -0
  26. package/{src → cjs}/Sandbox.d.ts +1 -0
  27. package/{src → cjs}/Sandbox.js +1 -1
  28. package/cjs/Sandbox.js.map +1 -0
  29. package/{src → cjs}/Snapshot.d.ts +1 -0
  30. package/cjs/Snapshot.js.map +1 -0
  31. package/{src → cjs}/Volume.d.ts +1 -0
  32. package/cjs/Volume.js.map +1 -0
  33. package/{src → cjs}/errors/DaytonaError.d.ts +1 -0
  34. package/cjs/errors/DaytonaError.js.map +1 -0
  35. package/{src → cjs}/index.d.ts +1 -0
  36. package/cjs/index.js.map +1 -0
  37. package/cjs/package.json +3 -0
  38. package/{src → cjs}/types/Charts.d.ts +1 -0
  39. package/cjs/types/Charts.js.map +1 -0
  40. package/{src → cjs}/types/CodeInterpreter.d.ts +1 -0
  41. package/cjs/types/CodeInterpreter.js.map +1 -0
  42. package/{src → cjs}/types/ExecuteResponse.d.ts +1 -0
  43. package/cjs/types/ExecuteResponse.js.map +1 -0
  44. package/{src → cjs}/types/Pty.d.ts +1 -0
  45. package/cjs/types/Pty.js.map +1 -0
  46. package/{src → cjs}/utils/Binary.d.ts +1 -0
  47. package/cjs/utils/Binary.js.map +1 -0
  48. package/{src → cjs}/utils/FileTransfer.d.ts +2 -1
  49. package/{src → cjs}/utils/FileTransfer.js +5 -2
  50. package/cjs/utils/FileTransfer.js.map +1 -0
  51. package/cjs/utils/Import.d.ts +125 -0
  52. package/cjs/utils/Import.js +112 -0
  53. package/cjs/utils/Import.js.map +1 -0
  54. package/{src → cjs}/utils/Multipart.d.ts +1 -0
  55. package/cjs/utils/Multipart.js.map +1 -0
  56. package/{src → cjs}/utils/Runtime.d.ts +1 -0
  57. package/cjs/utils/Runtime.js.map +1 -0
  58. package/{src → cjs}/utils/Stream.d.ts +1 -0
  59. package/cjs/utils/Stream.js.map +1 -0
  60. package/{src → cjs}/utils/WebSocket.d.ts +1 -0
  61. package/cjs/utils/WebSocket.js.map +1 -0
  62. package/{src → cjs}/utils/otel.decorator.d.ts +1 -0
  63. package/cjs/utils/otel.decorator.js.map +1 -0
  64. package/esm/CodeInterpreter.d.ts +95 -0
  65. package/esm/CodeInterpreter.js +292 -0
  66. package/esm/CodeInterpreter.js.map +1 -0
  67. package/esm/ComputerUse.d.ts +539 -0
  68. package/esm/ComputerUse.js +799 -0
  69. package/esm/ComputerUse.js.map +1 -0
  70. package/esm/Daytona.d.ts +355 -0
  71. package/esm/Daytona.js +523 -0
  72. package/esm/Daytona.js.map +1 -0
  73. package/esm/FileSystem.d.ts +371 -0
  74. package/esm/FileSystem.js +485 -0
  75. package/esm/FileSystem.js.map +1 -0
  76. package/esm/Git.d.ts +203 -0
  77. package/esm/Git.js +322 -0
  78. package/esm/Git.js.map +1 -0
  79. package/esm/Image.d.ts +265 -0
  80. package/esm/Image.js +581 -0
  81. package/esm/Image.js.map +1 -0
  82. package/esm/LspServer.d.ts +172 -0
  83. package/esm/LspServer.js +255 -0
  84. package/esm/LspServer.js.map +1 -0
  85. package/esm/ObjectStorage.d.ts +79 -0
  86. package/esm/ObjectStorage.js +195 -0
  87. package/esm/ObjectStorage.js.map +1 -0
  88. package/esm/Process.d.ts +490 -0
  89. package/esm/Process.js +642 -0
  90. package/esm/Process.js.map +1 -0
  91. package/esm/PtyHandle.d.ts +155 -0
  92. package/esm/PtyHandle.js +412 -0
  93. package/esm/PtyHandle.js.map +1 -0
  94. package/esm/README.md +180 -0
  95. package/esm/Sandbox.d.ts +476 -0
  96. package/esm/Sandbox.js +901 -0
  97. package/esm/Sandbox.js.map +1 -0
  98. package/esm/Snapshot.d.ts +140 -0
  99. package/esm/Snapshot.js +244 -0
  100. package/esm/Snapshot.js.map +1 -0
  101. package/esm/Volume.d.ts +84 -0
  102. package/esm/Volume.js +115 -0
  103. package/esm/Volume.js.map +1 -0
  104. package/esm/errors/DaytonaError.d.ts +171 -0
  105. package/esm/errors/DaytonaError.js +243 -0
  106. package/esm/errors/DaytonaError.js.map +1 -0
  107. package/esm/index.d.ts +22 -0
  108. package/esm/index.js +21 -0
  109. package/esm/index.js.map +1 -0
  110. package/esm/package.json +3 -0
  111. package/esm/types/Charts.d.ts +38 -0
  112. package/esm/types/Charts.js +33 -0
  113. package/esm/types/Charts.js.map +1 -0
  114. package/esm/types/CodeInterpreter.d.ts +77 -0
  115. package/esm/types/CodeInterpreter.js +6 -0
  116. package/esm/types/CodeInterpreter.js.map +1 -0
  117. package/esm/types/ExecuteResponse.d.ts +26 -0
  118. package/esm/types/ExecuteResponse.js +6 -0
  119. package/esm/types/ExecuteResponse.js.map +1 -0
  120. package/esm/types/Pty.d.ts +48 -0
  121. package/esm/types/Pty.js +6 -0
  122. package/esm/types/Pty.js.map +1 -0
  123. package/esm/utils/Binary.d.ts +39 -0
  124. package/esm/utils/Binary.js +157 -0
  125. package/esm/utils/Binary.js.map +1 -0
  126. package/esm/utils/FileTransfer.d.ts +15 -0
  127. package/esm/utils/FileTransfer.js +254 -0
  128. package/esm/utils/FileTransfer.js.map +1 -0
  129. package/{src → esm}/utils/Import.d.ts +3 -5
  130. package/{src → esm}/utils/Import.js +12 -14
  131. package/esm/utils/Import.js.map +1 -0
  132. package/esm/utils/Multipart.d.ts +29 -0
  133. package/esm/utils/Multipart.js +109 -0
  134. package/esm/utils/Multipart.js.map +1 -0
  135. package/esm/utils/Runtime.d.ts +44 -0
  136. package/esm/utils/Runtime.js +89 -0
  137. package/esm/utils/Runtime.js.map +1 -0
  138. package/esm/utils/Stream.d.ts +20 -0
  139. package/esm/utils/Stream.js +360 -0
  140. package/esm/utils/Stream.js.map +1 -0
  141. package/esm/utils/WebSocket.d.ts +10 -0
  142. package/esm/utils/WebSocket.js +22 -0
  143. package/esm/utils/WebSocket.js.map +1 -0
  144. package/esm/utils/otel.decorator.d.ts +83 -0
  145. package/esm/utils/otel.decorator.js +136 -0
  146. package/esm/utils/otel.decorator.js.map +1 -0
  147. package/package.json +26 -8
  148. package/src/CodeInterpreter.js.map +0 -1
  149. package/src/ComputerUse.js.map +0 -1
  150. package/src/Daytona.js.map +0 -1
  151. package/src/FileSystem.js.map +0 -1
  152. package/src/Git.js.map +0 -1
  153. package/src/Image.js.map +0 -1
  154. package/src/LspServer.js.map +0 -1
  155. package/src/ObjectStorage.js.map +0 -1
  156. package/src/Process.js.map +0 -1
  157. package/src/PtyHandle.js.map +0 -1
  158. package/src/Sandbox.js.map +0 -1
  159. package/src/Snapshot.js.map +0 -1
  160. package/src/Volume.js.map +0 -1
  161. package/src/__tests__/helpers.d.ts +0 -5
  162. package/src/__tests__/helpers.js +0 -26
  163. package/src/__tests__/helpers.js.map +0 -1
  164. package/src/errors/DaytonaError.js.map +0 -1
  165. package/src/index.js.map +0 -1
  166. package/src/types/Charts.js.map +0 -1
  167. package/src/types/CodeInterpreter.js.map +0 -1
  168. package/src/types/ExecuteResponse.js.map +0 -1
  169. package/src/types/Pty.js.map +0 -1
  170. package/src/utils/Binary.js.map +0 -1
  171. package/src/utils/FileTransfer.js.map +0 -1
  172. package/src/utils/Import.js.map +0 -1
  173. package/src/utils/Multipart.js.map +0 -1
  174. package/src/utils/Runtime.js.map +0 -1
  175. package/src/utils/Stream.js.map +0 -1
  176. package/src/utils/WebSocket.js.map +0 -1
  177. package/src/utils/otel.decorator.js.map +0 -1
  178. /package/{src → cjs}/CodeInterpreter.js +0 -0
  179. /package/{src → cjs}/Git.js +0 -0
  180. /package/{src → cjs}/Image.js +0 -0
  181. /package/{src → cjs}/LspServer.js +0 -0
  182. /package/{src → cjs}/ObjectStorage.js +0 -0
  183. /package/{src → cjs}/Process.js +0 -0
  184. /package/{src → cjs}/PtyHandle.js +0 -0
  185. /package/{src → cjs}/Snapshot.js +0 -0
  186. /package/{src → cjs}/Volume.js +0 -0
  187. /package/{src → cjs}/errors/DaytonaError.js +0 -0
  188. /package/{src → cjs}/index.js +0 -0
  189. /package/{src → cjs}/types/Charts.js +0 -0
  190. /package/{src → cjs}/types/CodeInterpreter.js +0 -0
  191. /package/{src → cjs}/types/ExecuteResponse.js +0 -0
  192. /package/{src → cjs}/types/Pty.js +0 -0
  193. /package/{src → cjs}/utils/Binary.js +0 -0
  194. /package/{src → cjs}/utils/Multipart.js +0 -0
  195. /package/{src → cjs}/utils/Runtime.js +0 -0
  196. /package/{src → cjs}/utils/Stream.js +0 -0
  197. /package/{src → cjs}/utils/WebSocket.js +0 -0
  198. /package/{src → cjs}/utils/otel.decorator.js +0 -0
@@ -0,0 +1,485 @@
1
+ /*
2
+ * Copyright 2025 Daytona Platforms Inc.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { __decorate, __metadata } from "tslib";
6
+ import * as pathe from 'pathe';
7
+ import { dynamicImport } from './utils/Import.js';
8
+ import { RUNTIME, Runtime } from './utils/Runtime.js';
9
+ import { createDaytonaError, DaytonaError } from './errors/DaytonaError.js';
10
+ import { normalizeResponseStream, processDownloadFilesResponseWithBusboy, processDownloadFilesResponseWithBuffered, } from './utils/FileTransfer.js';
11
+ import { WithInstrumentation } from './utils/otel.decorator.js';
12
+ function createFileDownloadError(error, errorDetails) {
13
+ if (!errorDetails) {
14
+ return new DaytonaError(error);
15
+ }
16
+ return createDaytonaError(errorDetails.message, errorDetails.statusCode, undefined, errorDetails.errorCode);
17
+ }
18
+ /**
19
+ * Provides file system operations within a Sandbox.
20
+ *
21
+ * @class
22
+ */
23
+ export class FileSystem {
24
+ clientConfig;
25
+ apiClient;
26
+ constructor(clientConfig, apiClient) {
27
+ this.clientConfig = clientConfig;
28
+ this.apiClient = apiClient;
29
+ }
30
+ /**
31
+ * Create a new directory in the Sandbox with specified permissions.
32
+ *
33
+ * @param {string} path - Path where the directory should be created. Relative paths are resolved based on the sandbox working directory.
34
+ * @param {string} mode - Directory permissions in octal format (e.g. "755")
35
+ * @returns {Promise<void>}
36
+ *
37
+ * @example
38
+ * // Create a directory with standard permissions
39
+ * await fs.createFolder('app/data', '755');
40
+ */
41
+ async createFolder(path, mode) {
42
+ const response = await this.apiClient.createFolder(path, mode);
43
+ return response.data;
44
+ }
45
+ /**
46
+ * Deletes a file or directory from the Sandbox.
47
+ *
48
+ * @param {string} path - Path to the file or directory to delete. Relative paths are resolved based on the sandbox working directory.
49
+ * @param {boolean} [recursive] - If the file is a directory, this must be true to delete it.
50
+ * @returns {Promise<void>}
51
+ *
52
+ * @example
53
+ * // Delete a file
54
+ * await fs.deleteFile('app/temp.log');
55
+ */
56
+ async deleteFile(path, recursive) {
57
+ const response = await this.apiClient.deleteFile(path, recursive);
58
+ return response.data;
59
+ }
60
+ async downloadFile(src, dst, timeout = 30 * 60) {
61
+ const remotePath = src;
62
+ if (typeof dst !== 'string') {
63
+ if (dst) {
64
+ timeout = dst;
65
+ }
66
+ const response = await this.downloadFiles([{ source: remotePath }], timeout);
67
+ if (response[0].error) {
68
+ throw createFileDownloadError(response[0].error, response[0].errorDetails);
69
+ }
70
+ return response[0].result;
71
+ }
72
+ const response = await this.downloadFiles([{ source: remotePath, destination: dst }], timeout);
73
+ if (response[0].error) {
74
+ throw createFileDownloadError(response[0].error, response[0].errorDetails);
75
+ }
76
+ }
77
+ /**
78
+ * Downloads a single file from the Sandbox as a readable stream without buffering
79
+ * the entire file into memory. The returned stream can be piped directly to an HTTP
80
+ * response, a file write stream, or any other writable destination.
81
+ *
82
+ * This method is only supported in Node.js-compatible runtimes (Node.js, Bun).
83
+ * Browser and serverless environments should use {@link downloadFile} instead.
84
+ *
85
+ * @param {string} remotePath - Path to the file in the Sandbox. Relative paths are
86
+ * resolved based on the sandbox working directory.
87
+ * @param {number} [timeout] - Timeout in seconds. 0 means no timeout. Default is 30 minutes.
88
+ * @returns {Promise<Readable>} A Node.js Readable stream of the file content.
89
+ *
90
+ * @example
91
+ * // Pipe directly to an HTTP response
92
+ * const stream = await sandbox.fs.downloadFileStream('outputs/report.pdf');
93
+ * stream.pipe(res);
94
+ *
95
+ * @example
96
+ * // Pipe to a local file
97
+ * import { createWriteStream } from 'fs';
98
+ * const stream = await sandbox.fs.downloadFileStream('outputs/data.csv');
99
+ * stream.pipe(createWriteStream('local-data.csv'));
100
+ */
101
+ async downloadFileStream(remotePath, timeout = 30 * 60) {
102
+ const isNonStreamingRuntime = RUNTIME === Runtime.BROWSER || RUNTIME === Runtime.SERVERLESS;
103
+ if (isNonStreamingRuntime) {
104
+ throw new DaytonaError('downloadFileStream is not supported in browser or serverless environments. Use downloadFile instead.');
105
+ }
106
+ const response = await this.apiClient.downloadFiles({ paths: [remotePath] }, {
107
+ responseType: 'stream',
108
+ timeout: timeout * 1000,
109
+ });
110
+ const responseStream = normalizeResponseStream(response.data);
111
+ const metadataMap = new Map();
112
+ metadataMap.set(remotePath, {});
113
+ return new Promise((resolve, reject) => {
114
+ let resolvedStream = null;
115
+ processDownloadFilesResponseWithBusboy(responseStream, response.headers, metadataMap, (_source, fileStream) => {
116
+ resolvedStream = fileStream;
117
+ resolve(resolvedStream);
118
+ })
119
+ .then(() => {
120
+ if (!resolvedStream) {
121
+ const metadata = metadataMap.get(remotePath);
122
+ if (metadata?.error) {
123
+ reject(createFileDownloadError(metadata.error, metadata.errorDetails));
124
+ }
125
+ else {
126
+ reject(new DaytonaError(`No file data received for: ${remotePath}`));
127
+ }
128
+ }
129
+ })
130
+ .catch((err) => {
131
+ if (!resolvedStream) {
132
+ reject(err);
133
+ }
134
+ else if (!resolvedStream.destroyed) {
135
+ resolvedStream.destroy(err instanceof Error ? err : new Error(String(err)));
136
+ }
137
+ });
138
+ });
139
+ }
140
+ /**
141
+ * Downloads multiple files from the Sandbox. If the files already exist locally, they will be overwritten.
142
+ *
143
+ * @param {FileDownloadRequest[]} files - Array of file download requests.
144
+ * @param {number} [timeoutSec] - Timeout for the download operation in seconds. 0 means no timeout.
145
+ * Default is 30 minutes.
146
+ * @returns {Promise<FileDownloadResponse[]>} Array of download results.
147
+ *
148
+ * @throws {DaytonaError} If the request itself fails (network issues, invalid request/response, etc.). Individual
149
+ * file download errors are returned in `FileDownloadResponse.error`. When the daemon provides structured
150
+ * per-file metadata, it is also available in `FileDownloadResponse.errorDetails`.
151
+ *
152
+ * @example
153
+ * // Download multiple files
154
+ * const results = await fs.downloadFiles([
155
+ * { source: 'tmp/data.json' },
156
+ * { source: 'tmp/config.json', destination: 'local_config.json' }
157
+ * ]);
158
+ * results.forEach(result => {
159
+ * if (result.error) {
160
+ * console.error(`Error downloading ${result.source}: ${result.error}`);
161
+ * } else if (result.result) {
162
+ * console.log(`Downloaded ${result.source} to ${result.result}`);
163
+ * }
164
+ * });
165
+ */
166
+ async downloadFiles(files, timeoutSec = 30 * 60) {
167
+ if (files.length === 0)
168
+ return [];
169
+ const isNonStreamingRuntime = RUNTIME === Runtime.BROWSER || RUNTIME === Runtime.SERVERLESS;
170
+ // Prepare destinations and metadata
171
+ const metadataMap = new Map();
172
+ for (const f of files) {
173
+ metadataMap.set(f.source, { destination: f.destination });
174
+ if (f.destination) {
175
+ const fs = await dynamicImport('fs', 'Downloading files to local files is not supported: ');
176
+ await fs.promises.mkdir(pathe.dirname(f.destination), { recursive: true });
177
+ }
178
+ }
179
+ const response = await this.apiClient.downloadFiles({ paths: files.map((f) => f.source) }, {
180
+ responseType: isNonStreamingRuntime ? 'arraybuffer' : 'stream',
181
+ timeout: timeoutSec * 1000,
182
+ });
183
+ const stream = normalizeResponseStream(response.data);
184
+ // Node.js path: use busboy for efficient streaming
185
+ if (isNonStreamingRuntime) {
186
+ await processDownloadFilesResponseWithBuffered(stream, response.headers, metadataMap);
187
+ }
188
+ else {
189
+ await processDownloadFilesResponseWithBusboy(stream, response.headers, metadataMap);
190
+ }
191
+ return files.map((f) => {
192
+ const metadata = metadataMap.get(f.source);
193
+ const error = metadata?.error || (!metadata?.result ? 'No data received for this file' : undefined);
194
+ return {
195
+ source: f.source,
196
+ result: error ? undefined : metadata.result,
197
+ error,
198
+ errorDetails: error ? metadata?.errorDetails : undefined,
199
+ };
200
+ });
201
+ }
202
+ /**
203
+ * Searches for text patterns within files in the Sandbox.
204
+ *
205
+ * @param {string} path - Directory to search in. Relative paths are resolved based on the sandbox working directory.
206
+ * @param {string} pattern - Search pattern
207
+ * @returns {Promise<Array<Match>>} Array of matches with file and line information
208
+ *
209
+ * @example
210
+ * // Find all TODO comments in TypeScript files
211
+ * const matches = await fs.findFiles('app/src', 'TODO:');
212
+ * matches.forEach(match => {
213
+ * console.log(`${match.file}:${match.line}: ${match.content}`);
214
+ * });
215
+ */
216
+ async findFiles(path, pattern) {
217
+ const response = await this.apiClient.findInFiles(path, pattern);
218
+ return response.data;
219
+ }
220
+ /**
221
+ * Retrieves detailed information about a file or directory.
222
+ *
223
+ * @param {string} path - Path to the file or directory. Relative paths are resolved based on the sandbox working directory.
224
+ * @returns {Promise<FileInfo>} Detailed file information including size, permissions, modification time
225
+ *
226
+ * @example
227
+ * // Get file details
228
+ * const info = await fs.getFileDetails('app/config.json');
229
+ * console.log(`Size: ${info.size}, Modified: ${info.modTime}`);
230
+ */
231
+ async getFileDetails(path) {
232
+ const response = await this.apiClient.getFileInfo(path);
233
+ return response.data;
234
+ }
235
+ /**
236
+ * Lists contents of a directory in the Sandbox.
237
+ *
238
+ * @param {string} path - Directory path to list. Relative paths are resolved based on the sandbox working directory.
239
+ * @returns {Promise<FileInfo[]>} Array of file and directory information
240
+ *
241
+ * @example
242
+ * // List directory contents
243
+ * const files = await fs.listFiles('app/src');
244
+ * files.forEach(file => {
245
+ * console.log(`${file.name} (${file.size} bytes)`);
246
+ * });
247
+ */
248
+ async listFiles(path) {
249
+ const response = await this.apiClient.listFiles(path);
250
+ return response.data;
251
+ }
252
+ /**
253
+ * Moves or renames a file or directory.
254
+ *
255
+ * @param {string} source - Source path. Relative paths are resolved based on the sandbox working directory.
256
+ * @param {string} destination - Destination path. Relative paths are resolved based on the sandbox working directory.
257
+ * @returns {Promise<void>}
258
+ *
259
+ * @example
260
+ * // Move a file to a new location
261
+ * await fs.moveFiles('app/temp/data.json', 'app/data/data.json');
262
+ */
263
+ async moveFiles(source, destination) {
264
+ const response = await this.apiClient.moveFile(source, destination);
265
+ return response.data;
266
+ }
267
+ /**
268
+ * Replaces text content in multiple files.
269
+ *
270
+ * @param {string[]} files - Array of file paths to process. Relative paths are resolved based on the sandbox working directory.
271
+ * @param {string} pattern - Pattern to replace
272
+ * @param {string} newValue - Replacement text
273
+ * @returns {Promise<Array<ReplaceResult>>} Results of the replace operation for each file
274
+ *
275
+ * @example
276
+ * // Update version number across multiple files
277
+ * const results = await fs.replaceInFiles(
278
+ * ['app/package.json', 'app/version.ts'],
279
+ * '"version": "1.0.0"',
280
+ * '"version": "1.1.0"'
281
+ * );
282
+ */
283
+ async replaceInFiles(files, pattern, newValue) {
284
+ const replaceRequest = {
285
+ files,
286
+ newValue,
287
+ pattern,
288
+ };
289
+ const response = await this.apiClient.replaceInFiles(replaceRequest);
290
+ return response.data;
291
+ }
292
+ /**
293
+ * Searches for files and directories by name pattern in the Sandbox.
294
+ *
295
+ * @param {string} path - Directory to search in. Relative paths are resolved based on the sandbox working directory.
296
+ * @param {string} pattern - File name pattern (supports globs)
297
+ * @returns {Promise<SearchFilesResponse>} Search results with matching files
298
+ *
299
+ * @example
300
+ * // Find all TypeScript files
301
+ * const result = await fs.searchFiles('app', '*.ts');
302
+ * result.files.forEach(file => console.log(file));
303
+ */
304
+ async searchFiles(path, pattern) {
305
+ const response = await this.apiClient.searchFiles(path, pattern);
306
+ return response.data;
307
+ }
308
+ /**
309
+ * Sets permissions and ownership for a file or directory.
310
+ *
311
+ * @param {string} path - Path to the file or directory. Relative paths are resolved based on the sandbox working directory.
312
+ * @param {FilePermissionsParams} permissions - Permission settings
313
+ * @returns {Promise<void>}
314
+ *
315
+ * @example
316
+ * // Set file permissions and ownership
317
+ * await fs.setFilePermissions('app/script.sh', {
318
+ * owner: 'daytona',
319
+ * group: 'users',
320
+ * mode: '755' // Execute permission for shell script
321
+ * });
322
+ */
323
+ async setFilePermissions(path, permissions) {
324
+ const response = await this.apiClient.setFilePermissions(path, permissions.owner, permissions.group, permissions.mode);
325
+ return response.data;
326
+ }
327
+ async uploadFile(src, dst, timeout = 30 * 60) {
328
+ await this.uploadFiles([{ source: src, destination: dst }], timeout);
329
+ }
330
+ /**
331
+ * Uploads multiple files to the Sandbox. If files already exist at the destination paths,
332
+ * they will be overwritten.
333
+ *
334
+ * @param {FileUpload[]} files - Array of files to upload.
335
+ * @param {number} [timeout] - Timeout for the upload operation in seconds. 0 means no timeout.
336
+ * Default is 30 minutes.
337
+ * @returns {Promise<void>}
338
+ *
339
+ * @example
340
+ * // Upload multiple text files
341
+ * const files = [
342
+ * {
343
+ * source: Buffer.from('Content of file 1'),
344
+ * destination: '/tmp/file1.txt'
345
+ * },
346
+ * {
347
+ * source: 'app/data/file2.txt',
348
+ * destination: '/tmp/file2.txt'
349
+ * },
350
+ * {
351
+ * source: Buffer.from('{"key": "value"}'),
352
+ * destination: '/tmp/config.json'
353
+ * }
354
+ * ];
355
+ * await fs.uploadFiles(files);
356
+ */
357
+ async uploadFiles(files, timeout = 30 * 60) {
358
+ const isNonStreamingRuntime = RUNTIME === Runtime.DENO || RUNTIME === Runtime.BROWSER || RUNTIME === Runtime.SERVERLESS;
359
+ const FormDataClass = isNonStreamingRuntime
360
+ ? FormData
361
+ : (await dynamicImport('form-data', 'Uploading files is not supported: '));
362
+ const form = new FormDataClass();
363
+ for (const [i, { source, destination }] of files.entries()) {
364
+ form.append(`files[${i}].path`, destination);
365
+ const payload = await this.makeFilePayload(source);
366
+ form.append(`files[${i}].file`, payload, destination);
367
+ }
368
+ if (isNonStreamingRuntime) {
369
+ const url = `${this.clientConfig.basePath}/files/bulk-upload`;
370
+ await fetch(url, {
371
+ method: 'POST',
372
+ headers: this.clientConfig.baseOptions.headers,
373
+ body: form,
374
+ signal: timeout ? AbortSignal.timeout(timeout * 1000) : undefined,
375
+ });
376
+ }
377
+ else {
378
+ await this.apiClient.uploadFiles({
379
+ data: form,
380
+ maxRedirects: 0,
381
+ timeout: timeout * 1000,
382
+ });
383
+ }
384
+ }
385
+ async makeFilePayload(source) {
386
+ // String = file path
387
+ if (typeof source === 'string') {
388
+ const fs = await dynamicImport('fs', 'Uploading file from local file system is not supported: ');
389
+ return fs.createReadStream(source);
390
+ }
391
+ // Blob
392
+ if (RUNTIME === Runtime.BROWSER || RUNTIME === Runtime.SERVERLESS || RUNTIME === Runtime.DENO) {
393
+ // Use .slice() to ensure we have a concrete ArrayBuffer, not ArrayBufferLike
394
+ return new Blob([source.slice()], { type: 'application/octet-stream' });
395
+ }
396
+ // Readable stream
397
+ const stream = await dynamicImport('stream', 'Uploading file is not supported: ');
398
+ return stream.Readable.from(source);
399
+ }
400
+ }
401
+ __decorate([
402
+ WithInstrumentation(),
403
+ __metadata("design:type", Function),
404
+ __metadata("design:paramtypes", [String, String]),
405
+ __metadata("design:returntype", Promise)
406
+ ], FileSystem.prototype, "createFolder", null);
407
+ __decorate([
408
+ WithInstrumentation(),
409
+ __metadata("design:type", Function),
410
+ __metadata("design:paramtypes", [String, Boolean]),
411
+ __metadata("design:returntype", Promise)
412
+ ], FileSystem.prototype, "deleteFile", null);
413
+ __decorate([
414
+ WithInstrumentation(),
415
+ __metadata("design:type", Function),
416
+ __metadata("design:paramtypes", [String, Object, Number]),
417
+ __metadata("design:returntype", Promise)
418
+ ], FileSystem.prototype, "downloadFile", null);
419
+ __decorate([
420
+ WithInstrumentation(),
421
+ __metadata("design:type", Function),
422
+ __metadata("design:paramtypes", [String, Number]),
423
+ __metadata("design:returntype", Promise)
424
+ ], FileSystem.prototype, "downloadFileStream", null);
425
+ __decorate([
426
+ WithInstrumentation(),
427
+ __metadata("design:type", Function),
428
+ __metadata("design:paramtypes", [Array, Number]),
429
+ __metadata("design:returntype", Promise)
430
+ ], FileSystem.prototype, "downloadFiles", null);
431
+ __decorate([
432
+ WithInstrumentation(),
433
+ __metadata("design:type", Function),
434
+ __metadata("design:paramtypes", [String, String]),
435
+ __metadata("design:returntype", Promise)
436
+ ], FileSystem.prototype, "findFiles", null);
437
+ __decorate([
438
+ WithInstrumentation(),
439
+ __metadata("design:type", Function),
440
+ __metadata("design:paramtypes", [String]),
441
+ __metadata("design:returntype", Promise)
442
+ ], FileSystem.prototype, "getFileDetails", null);
443
+ __decorate([
444
+ WithInstrumentation(),
445
+ __metadata("design:type", Function),
446
+ __metadata("design:paramtypes", [String]),
447
+ __metadata("design:returntype", Promise)
448
+ ], FileSystem.prototype, "listFiles", null);
449
+ __decorate([
450
+ WithInstrumentation(),
451
+ __metadata("design:type", Function),
452
+ __metadata("design:paramtypes", [String, String]),
453
+ __metadata("design:returntype", Promise)
454
+ ], FileSystem.prototype, "moveFiles", null);
455
+ __decorate([
456
+ WithInstrumentation(),
457
+ __metadata("design:type", Function),
458
+ __metadata("design:paramtypes", [Array, String, String]),
459
+ __metadata("design:returntype", Promise)
460
+ ], FileSystem.prototype, "replaceInFiles", null);
461
+ __decorate([
462
+ WithInstrumentation(),
463
+ __metadata("design:type", Function),
464
+ __metadata("design:paramtypes", [String, String]),
465
+ __metadata("design:returntype", Promise)
466
+ ], FileSystem.prototype, "searchFiles", null);
467
+ __decorate([
468
+ WithInstrumentation(),
469
+ __metadata("design:type", Function),
470
+ __metadata("design:paramtypes", [String, Object]),
471
+ __metadata("design:returntype", Promise)
472
+ ], FileSystem.prototype, "setFilePermissions", null);
473
+ __decorate([
474
+ WithInstrumentation(),
475
+ __metadata("design:type", Function),
476
+ __metadata("design:paramtypes", [Object, String, Number]),
477
+ __metadata("design:returntype", Promise)
478
+ ], FileSystem.prototype, "uploadFile", null);
479
+ __decorate([
480
+ WithInstrumentation(),
481
+ __metadata("design:type", Function),
482
+ __metadata("design:paramtypes", [Array, Number]),
483
+ __metadata("design:returntype", Promise)
484
+ ], FileSystem.prototype, "uploadFiles", null);
485
+ //# sourceMappingURL=FileSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/FileSystem.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAU9B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAExE,OAAO,EACL,uBAAuB,EACvB,sCAAsC,EACtC,wCAAwC,GACzC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAqG5D,SAAS,uBAAuB,CAAC,KAAa,EAAE,YAAuC;IACrF,IAAI,CAAC,YAAY,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