@daytona/sdk 0.161.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +180 -0
  2. package/package.json +56 -0
  3. package/src/CodeInterpreter.d.ts +94 -0
  4. package/src/CodeInterpreter.js +297 -0
  5. package/src/CodeInterpreter.js.map +1 -0
  6. package/src/ComputerUse.d.ts +538 -0
  7. package/src/ComputerUse.js +808 -0
  8. package/src/ComputerUse.js.map +1 -0
  9. package/src/Daytona.d.ts +340 -0
  10. package/src/Daytona.js +538 -0
  11. package/src/Daytona.js.map +1 -0
  12. package/src/FileSystem.d.ts +326 -0
  13. package/src/FileSystem.js +412 -0
  14. package/src/FileSystem.js.map +1 -0
  15. package/src/Git.d.ts +202 -0
  16. package/src/Git.js +326 -0
  17. package/src/Git.js.map +1 -0
  18. package/src/Image.d.ts +264 -0
  19. package/src/Image.js +546 -0
  20. package/src/Image.js.map +1 -0
  21. package/src/LspServer.d.ts +171 -0
  22. package/src/LspServer.js +258 -0
  23. package/src/LspServer.js.map +1 -0
  24. package/src/ObjectStorage.d.ts +78 -0
  25. package/src/ObjectStorage.js +199 -0
  26. package/src/ObjectStorage.js.map +1 -0
  27. package/src/Process.d.ts +490 -0
  28. package/src/Process.js +790 -0
  29. package/src/Process.js.map +1 -0
  30. package/src/PtyHandle.d.ts +154 -0
  31. package/src/PtyHandle.js +416 -0
  32. package/src/PtyHandle.js.map +1 -0
  33. package/src/Sandbox.d.ts +425 -0
  34. package/src/Sandbox.js +776 -0
  35. package/src/Sandbox.js.map +1 -0
  36. package/src/Snapshot.d.ts +139 -0
  37. package/src/Snapshot.js +248 -0
  38. package/src/Snapshot.js.map +1 -0
  39. package/src/Volume.d.ts +83 -0
  40. package/src/Volume.js +119 -0
  41. package/src/Volume.js.map +1 -0
  42. package/src/code-toolbox/SandboxJsCodeToolbox.d.ts +5 -0
  43. package/src/code-toolbox/SandboxJsCodeToolbox.js +20 -0
  44. package/src/code-toolbox/SandboxJsCodeToolbox.js.map +1 -0
  45. package/src/code-toolbox/SandboxPythonCodeToolbox.d.ts +11 -0
  46. package/src/code-toolbox/SandboxPythonCodeToolbox.js +359 -0
  47. package/src/code-toolbox/SandboxPythonCodeToolbox.js.map +1 -0
  48. package/src/code-toolbox/SandboxTsCodeToolbox.d.ts +5 -0
  49. package/src/code-toolbox/SandboxTsCodeToolbox.js +29 -0
  50. package/src/code-toolbox/SandboxTsCodeToolbox.js.map +1 -0
  51. package/src/errors/DaytonaError.d.ts +31 -0
  52. package/src/errors/DaytonaError.js +51 -0
  53. package/src/errors/DaytonaError.js.map +1 -0
  54. package/src/index.d.ts +21 -0
  55. package/src/index.js +45 -0
  56. package/src/index.js.map +1 -0
  57. package/src/types/Charts.d.ts +151 -0
  58. package/src/types/Charts.js +46 -0
  59. package/src/types/Charts.js.map +1 -0
  60. package/src/types/CodeInterpreter.d.ts +76 -0
  61. package/src/types/CodeInterpreter.js +7 -0
  62. package/src/types/CodeInterpreter.js.map +1 -0
  63. package/src/types/ExecuteResponse.d.ts +25 -0
  64. package/src/types/ExecuteResponse.js +7 -0
  65. package/src/types/ExecuteResponse.js.map +1 -0
  66. package/src/types/Pty.d.ts +47 -0
  67. package/src/types/Pty.js +7 -0
  68. package/src/types/Pty.js.map +1 -0
  69. package/src/utils/ArtifactParser.d.ts +13 -0
  70. package/src/utils/ArtifactParser.js +55 -0
  71. package/src/utils/ArtifactParser.js.map +1 -0
  72. package/src/utils/Binary.d.ts +38 -0
  73. package/src/utils/Binary.js +168 -0
  74. package/src/utils/Binary.js.map +1 -0
  75. package/src/utils/FileTransfer.d.ts +14 -0
  76. package/src/utils/FileTransfer.js +216 -0
  77. package/src/utils/FileTransfer.js.map +1 -0
  78. package/src/utils/Import.d.ts +97 -0
  79. package/src/utils/Import.js +79 -0
  80. package/src/utils/Import.js.map +1 -0
  81. package/src/utils/Multipart.d.ts +26 -0
  82. package/src/utils/Multipart.js +113 -0
  83. package/src/utils/Multipart.js.map +1 -0
  84. package/src/utils/Runtime.d.ts +43 -0
  85. package/src/utils/Runtime.js +95 -0
  86. package/src/utils/Runtime.js.map +1 -0
  87. package/src/utils/Stream.d.ts +19 -0
  88. package/src/utils/Stream.js +364 -0
  89. package/src/utils/Stream.js.map +1 -0
  90. package/src/utils/WebSocket.d.ts +9 -0
  91. package/src/utils/WebSocket.js +26 -0
  92. package/src/utils/WebSocket.js.map +1 -0
  93. package/src/utils/otel.decorator.d.ts +82 -0
  94. package/src/utils/otel.decorator.js +141 -0
  95. package/src/utils/otel.decorator.js.map +1 -0
@@ -0,0 +1,412 @@
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.FileSystem = void 0;
8
+ const tslib_1 = require("tslib");
9
+ const pathe = tslib_1.__importStar(require("pathe"));
10
+ const Import_1 = require("./utils/Import");
11
+ const Runtime_1 = require("./utils/Runtime");
12
+ const DaytonaError_1 = require("./errors/DaytonaError");
13
+ const FileTransfer_1 = require("./utils/FileTransfer");
14
+ const otel_decorator_1 = require("./utils/otel.decorator");
15
+ /**
16
+ * Provides file system operations within a Sandbox.
17
+ *
18
+ * @class
19
+ */
20
+ class FileSystem {
21
+ clientConfig;
22
+ apiClient;
23
+ constructor(clientConfig, apiClient) {
24
+ this.clientConfig = clientConfig;
25
+ this.apiClient = apiClient;
26
+ }
27
+ /**
28
+ * Create a new directory in the Sandbox with specified permissions.
29
+ *
30
+ * @param {string} path - Path where the directory should be created. Relative paths are resolved based on the sandbox working directory.
31
+ * @param {string} mode - Directory permissions in octal format (e.g. "755")
32
+ * @returns {Promise<void>}
33
+ *
34
+ * @example
35
+ * // Create a directory with standard permissions
36
+ * await fs.createFolder('app/data', '755');
37
+ */
38
+ async createFolder(path, mode) {
39
+ const response = await this.apiClient.createFolder(path, mode);
40
+ return response.data;
41
+ }
42
+ /**
43
+ * Deletes a file or directory from the Sandbox.
44
+ *
45
+ * @param {string} path - Path to the file or directory to delete. Relative paths are resolved based on the sandbox working directory.
46
+ * @param {boolean} [recursive] - If the file is a directory, this must be true to delete it.
47
+ * @returns {Promise<void>}
48
+ *
49
+ * @example
50
+ * // Delete a file
51
+ * await fs.deleteFile('app/temp.log');
52
+ */
53
+ async deleteFile(path, recursive) {
54
+ const response = await this.apiClient.deleteFile(path, recursive);
55
+ return response.data;
56
+ }
57
+ async downloadFile(src, dst, timeout = 30 * 60) {
58
+ const remotePath = src;
59
+ if (typeof dst !== 'string') {
60
+ if (dst) {
61
+ timeout = dst;
62
+ }
63
+ const response = await this.downloadFiles([{ source: remotePath }], timeout);
64
+ if (response[0].error) {
65
+ throw new DaytonaError_1.DaytonaError(response[0].error);
66
+ }
67
+ return response[0].result;
68
+ }
69
+ const response = await this.downloadFiles([{ source: remotePath, destination: dst }], timeout);
70
+ if (response[0].error) {
71
+ throw new DaytonaError_1.DaytonaError(response[0].error);
72
+ }
73
+ }
74
+ /**
75
+ * Downloads multiple files from the Sandbox. If the files already exist locally, they will be overwritten.
76
+ *
77
+ * @param {FileDownloadRequest[]} files - Array of file download requests.
78
+ * @param {number} [timeoutSec] - Timeout for the download operation in seconds. 0 means no timeout.
79
+ * Default is 30 minutes.
80
+ * @returns {Promise<FileDownloadResponse[]>} Array of download results.
81
+ *
82
+ * @throws {DaytonaError} If the request itself fails (network issues, invalid request/response, etc.). Individual
83
+ * file download errors are returned in the `FileDownloadResponse.error` field.
84
+ *
85
+ * @example
86
+ * // Download multiple files
87
+ * const results = await fs.downloadFiles([
88
+ * { source: 'tmp/data.json' },
89
+ * { source: 'tmp/config.json', destination: 'local_config.json' }
90
+ * ]);
91
+ * results.forEach(result => {
92
+ * if (result.error) {
93
+ * console.error(`Error downloading ${result.source}: ${result.error}`);
94
+ * } else if (result.result) {
95
+ * console.log(`Downloaded ${result.source} to ${result.result}`);
96
+ * }
97
+ * });
98
+ */
99
+ async downloadFiles(files, timeoutSec = 30 * 60) {
100
+ if (files.length === 0)
101
+ return [];
102
+ const isNonStreamingRuntime = Runtime_1.RUNTIME === Runtime_1.Runtime.BROWSER || Runtime_1.RUNTIME === Runtime_1.Runtime.SERVERLESS;
103
+ // Prepare destinations and metadata
104
+ const metadataMap = new Map();
105
+ for (const f of files) {
106
+ metadataMap.set(f.source, { destination: f.destination });
107
+ if (f.destination) {
108
+ const fs = await (0, Import_1.dynamicImport)('fs', 'Downloading files to local files is not supported: ');
109
+ await fs.promises.mkdir(pathe.dirname(f.destination), { recursive: true });
110
+ }
111
+ }
112
+ const response = await this.apiClient.downloadFiles({ paths: files.map((f) => f.source) }, {
113
+ responseType: isNonStreamingRuntime ? 'arraybuffer' : 'stream',
114
+ timeout: timeoutSec * 1000,
115
+ });
116
+ const stream = (0, FileTransfer_1.normalizeResponseStream)(response.data);
117
+ // Node.js path: use busboy for efficient streaming
118
+ if (isNonStreamingRuntime) {
119
+ await (0, FileTransfer_1.processDownloadFilesResponseWithBuffered)(stream, response.headers, metadataMap);
120
+ }
121
+ else {
122
+ await (0, FileTransfer_1.processDownloadFilesResponseWithBusboy)(stream, response.headers, metadataMap);
123
+ }
124
+ return files.map((f) => {
125
+ const metadata = metadataMap.get(f.source);
126
+ const error = metadata?.error || (!metadata?.result ? 'No data received for this file' : undefined);
127
+ return {
128
+ source: f.source,
129
+ result: error ? undefined : metadata.result,
130
+ error,
131
+ };
132
+ });
133
+ }
134
+ /**
135
+ * Searches for text patterns within files in the Sandbox.
136
+ *
137
+ * @param {string} path - Directory to search in. Relative paths are resolved based on the sandbox working directory.
138
+ * @param {string} pattern - Search pattern
139
+ * @returns {Promise<Array<Match>>} Array of matches with file and line information
140
+ *
141
+ * @example
142
+ * // Find all TODO comments in TypeScript files
143
+ * const matches = await fs.findFiles('app/src', 'TODO:');
144
+ * matches.forEach(match => {
145
+ * console.log(`${match.file}:${match.line}: ${match.content}`);
146
+ * });
147
+ */
148
+ async findFiles(path, pattern) {
149
+ const response = await this.apiClient.findInFiles(path, pattern);
150
+ return response.data;
151
+ }
152
+ /**
153
+ * Retrieves detailed information about a file or directory.
154
+ *
155
+ * @param {string} path - Path to the file or directory. Relative paths are resolved based on the sandbox working directory.
156
+ * @returns {Promise<FileInfo>} Detailed file information including size, permissions, modification time
157
+ *
158
+ * @example
159
+ * // Get file details
160
+ * const info = await fs.getFileDetails('app/config.json');
161
+ * console.log(`Size: ${info.size}, Modified: ${info.modTime}`);
162
+ */
163
+ async getFileDetails(path) {
164
+ const response = await this.apiClient.getFileInfo(path);
165
+ return response.data;
166
+ }
167
+ /**
168
+ * Lists contents of a directory in the Sandbox.
169
+ *
170
+ * @param {string} path - Directory path to list. Relative paths are resolved based on the sandbox working directory.
171
+ * @returns {Promise<FileInfo[]>} Array of file and directory information
172
+ *
173
+ * @example
174
+ * // List directory contents
175
+ * const files = await fs.listFiles('app/src');
176
+ * files.forEach(file => {
177
+ * console.log(`${file.name} (${file.size} bytes)`);
178
+ * });
179
+ */
180
+ async listFiles(path) {
181
+ const response = await this.apiClient.listFiles(path);
182
+ return response.data;
183
+ }
184
+ /**
185
+ * Moves or renames a file or directory.
186
+ *
187
+ * @param {string} source - Source path. Relative paths are resolved based on the sandbox working directory.
188
+ * @param {string} destination - Destination path. Relative paths are resolved based on the sandbox working directory.
189
+ * @returns {Promise<void>}
190
+ *
191
+ * @example
192
+ * // Move a file to a new location
193
+ * await fs.moveFiles('app/temp/data.json', 'app/data/data.json');
194
+ */
195
+ async moveFiles(source, destination) {
196
+ const response = await this.apiClient.moveFile(source, destination);
197
+ return response.data;
198
+ }
199
+ /**
200
+ * Replaces text content in multiple files.
201
+ *
202
+ * @param {string[]} files - Array of file paths to process. Relative paths are resolved based on the sandbox working directory.
203
+ * @param {string} pattern - Pattern to replace
204
+ * @param {string} newValue - Replacement text
205
+ * @returns {Promise<Array<ReplaceResult>>} Results of the replace operation for each file
206
+ *
207
+ * @example
208
+ * // Update version number across multiple files
209
+ * const results = await fs.replaceInFiles(
210
+ * ['app/package.json', 'app/version.ts'],
211
+ * '"version": "1.0.0"',
212
+ * '"version": "1.1.0"'
213
+ * );
214
+ */
215
+ async replaceInFiles(files, pattern, newValue) {
216
+ const replaceRequest = {
217
+ files,
218
+ newValue,
219
+ pattern,
220
+ };
221
+ const response = await this.apiClient.replaceInFiles(replaceRequest);
222
+ return response.data;
223
+ }
224
+ /**
225
+ * Searches for files and directories by name pattern in the Sandbox.
226
+ *
227
+ * @param {string} path - Directory to search in. Relative paths are resolved based on the sandbox working directory.
228
+ * @param {string} pattern - File name pattern (supports globs)
229
+ * @returns {Promise<SearchFilesResponse>} Search results with matching files
230
+ *
231
+ * @example
232
+ * // Find all TypeScript files
233
+ * const result = await fs.searchFiles('app', '*.ts');
234
+ * result.files.forEach(file => console.log(file));
235
+ */
236
+ async searchFiles(path, pattern) {
237
+ const response = await this.apiClient.searchFiles(path, pattern);
238
+ return response.data;
239
+ }
240
+ /**
241
+ * Sets permissions and ownership for a file or directory.
242
+ *
243
+ * @param {string} path - Path to the file or directory. Relative paths are resolved based on the sandbox working directory.
244
+ * @param {FilePermissionsParams} permissions - Permission settings
245
+ * @returns {Promise<void>}
246
+ *
247
+ * @example
248
+ * // Set file permissions and ownership
249
+ * await fs.setFilePermissions('app/script.sh', {
250
+ * owner: 'daytona',
251
+ * group: 'users',
252
+ * mode: '755' // Execute permission for shell script
253
+ * });
254
+ */
255
+ async setFilePermissions(path, permissions) {
256
+ const response = await this.apiClient.setFilePermissions(path, permissions.owner, permissions.group, permissions.mode);
257
+ return response.data;
258
+ }
259
+ async uploadFile(src, dst, timeout = 30 * 60) {
260
+ await this.uploadFiles([{ source: src, destination: dst }], timeout);
261
+ }
262
+ /**
263
+ * Uploads multiple files to the Sandbox. If files already exist at the destination paths,
264
+ * they will be overwritten.
265
+ *
266
+ * @param {FileUpload[]} files - Array of files to upload.
267
+ * @param {number} [timeout] - Timeout for the upload operation in seconds. 0 means no timeout.
268
+ * Default is 30 minutes.
269
+ * @returns {Promise<void>}
270
+ *
271
+ * @example
272
+ * // Upload multiple text files
273
+ * const files = [
274
+ * {
275
+ * source: Buffer.from('Content of file 1'),
276
+ * destination: '/tmp/file1.txt'
277
+ * },
278
+ * {
279
+ * source: 'app/data/file2.txt',
280
+ * destination: '/tmp/file2.txt'
281
+ * },
282
+ * {
283
+ * source: Buffer.from('{"key": "value"}'),
284
+ * destination: '/tmp/config.json'
285
+ * }
286
+ * ];
287
+ * await fs.uploadFiles(files);
288
+ */
289
+ async uploadFiles(files, timeout = 30 * 60) {
290
+ const isNonStreamingRuntime = Runtime_1.RUNTIME === Runtime_1.Runtime.DENO || Runtime_1.RUNTIME === Runtime_1.Runtime.BROWSER || Runtime_1.RUNTIME === Runtime_1.Runtime.SERVERLESS;
291
+ const FormDataClass = isNonStreamingRuntime
292
+ ? FormData
293
+ : (await (0, Import_1.dynamicImport)('form-data', 'Uploading files is not supported: '));
294
+ const form = new FormDataClass();
295
+ for (const [i, { source, destination }] of files.entries()) {
296
+ form.append(`files[${i}].path`, destination);
297
+ const payload = await this.makeFilePayload(source);
298
+ form.append(`files[${i}].file`, payload, destination);
299
+ }
300
+ if (isNonStreamingRuntime) {
301
+ const url = `${this.clientConfig.basePath}/files/bulk-upload`;
302
+ await fetch(url, {
303
+ method: 'POST',
304
+ headers: this.clientConfig.baseOptions.headers,
305
+ body: form,
306
+ signal: timeout ? AbortSignal.timeout(timeout * 1000) : undefined,
307
+ });
308
+ }
309
+ else {
310
+ await this.apiClient.uploadFiles({
311
+ data: form,
312
+ maxRedirects: 0,
313
+ timeout: timeout * 1000,
314
+ });
315
+ }
316
+ }
317
+ async makeFilePayload(source) {
318
+ // String = file path
319
+ if (typeof source === 'string') {
320
+ const fs = await (0, Import_1.dynamicImport)('fs', 'Uploading file from local file system is not supported: ');
321
+ return fs.createReadStream(source);
322
+ }
323
+ // Blob
324
+ if (Runtime_1.RUNTIME === Runtime_1.Runtime.BROWSER || Runtime_1.RUNTIME === Runtime_1.Runtime.SERVERLESS || Runtime_1.RUNTIME === Runtime_1.Runtime.DENO) {
325
+ // Use .slice() to ensure we have a concrete ArrayBuffer, not ArrayBufferLike
326
+ return new Blob([source.slice()], { type: 'application/octet-stream' });
327
+ }
328
+ // Readable stream
329
+ const stream = await (0, Import_1.dynamicImport)('stream', 'Uploading file is not supported: ');
330
+ return stream.Readable.from(source);
331
+ }
332
+ }
333
+ exports.FileSystem = FileSystem;
334
+ tslib_1.__decorate([
335
+ (0, otel_decorator_1.WithInstrumentation)(),
336
+ tslib_1.__metadata("design:type", Function),
337
+ tslib_1.__metadata("design:paramtypes", [String, String]),
338
+ tslib_1.__metadata("design:returntype", Promise)
339
+ ], FileSystem.prototype, "createFolder", null);
340
+ tslib_1.__decorate([
341
+ (0, otel_decorator_1.WithInstrumentation)(),
342
+ tslib_1.__metadata("design:type", Function),
343
+ tslib_1.__metadata("design:paramtypes", [String, Boolean]),
344
+ tslib_1.__metadata("design:returntype", Promise)
345
+ ], FileSystem.prototype, "deleteFile", null);
346
+ tslib_1.__decorate([
347
+ (0, otel_decorator_1.WithInstrumentation)(),
348
+ tslib_1.__metadata("design:type", Function),
349
+ tslib_1.__metadata("design:paramtypes", [String, Object, Number]),
350
+ tslib_1.__metadata("design:returntype", Promise)
351
+ ], FileSystem.prototype, "downloadFile", null);
352
+ tslib_1.__decorate([
353
+ (0, otel_decorator_1.WithInstrumentation)(),
354
+ tslib_1.__metadata("design:type", Function),
355
+ tslib_1.__metadata("design:paramtypes", [Array, Number]),
356
+ tslib_1.__metadata("design:returntype", Promise)
357
+ ], FileSystem.prototype, "downloadFiles", null);
358
+ tslib_1.__decorate([
359
+ (0, otel_decorator_1.WithInstrumentation)(),
360
+ tslib_1.__metadata("design:type", Function),
361
+ tslib_1.__metadata("design:paramtypes", [String, String]),
362
+ tslib_1.__metadata("design:returntype", Promise)
363
+ ], FileSystem.prototype, "findFiles", null);
364
+ tslib_1.__decorate([
365
+ (0, otel_decorator_1.WithInstrumentation)(),
366
+ tslib_1.__metadata("design:type", Function),
367
+ tslib_1.__metadata("design:paramtypes", [String]),
368
+ tslib_1.__metadata("design:returntype", Promise)
369
+ ], FileSystem.prototype, "getFileDetails", null);
370
+ tslib_1.__decorate([
371
+ (0, otel_decorator_1.WithInstrumentation)(),
372
+ tslib_1.__metadata("design:type", Function),
373
+ tslib_1.__metadata("design:paramtypes", [String]),
374
+ tslib_1.__metadata("design:returntype", Promise)
375
+ ], FileSystem.prototype, "listFiles", null);
376
+ tslib_1.__decorate([
377
+ (0, otel_decorator_1.WithInstrumentation)(),
378
+ tslib_1.__metadata("design:type", Function),
379
+ tslib_1.__metadata("design:paramtypes", [String, String]),
380
+ tslib_1.__metadata("design:returntype", Promise)
381
+ ], FileSystem.prototype, "moveFiles", null);
382
+ tslib_1.__decorate([
383
+ (0, otel_decorator_1.WithInstrumentation)(),
384
+ tslib_1.__metadata("design:type", Function),
385
+ tslib_1.__metadata("design:paramtypes", [Array, String, String]),
386
+ tslib_1.__metadata("design:returntype", Promise)
387
+ ], FileSystem.prototype, "replaceInFiles", null);
388
+ tslib_1.__decorate([
389
+ (0, otel_decorator_1.WithInstrumentation)(),
390
+ tslib_1.__metadata("design:type", Function),
391
+ tslib_1.__metadata("design:paramtypes", [String, String]),
392
+ tslib_1.__metadata("design:returntype", Promise)
393
+ ], FileSystem.prototype, "searchFiles", null);
394
+ tslib_1.__decorate([
395
+ (0, otel_decorator_1.WithInstrumentation)(),
396
+ tslib_1.__metadata("design:type", Function),
397
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
398
+ tslib_1.__metadata("design:returntype", Promise)
399
+ ], FileSystem.prototype, "setFilePermissions", null);
400
+ tslib_1.__decorate([
401
+ (0, otel_decorator_1.WithInstrumentation)(),
402
+ tslib_1.__metadata("design:type", Function),
403
+ tslib_1.__metadata("design:paramtypes", [Object, String, Number]),
404
+ tslib_1.__metadata("design:returntype", Promise)
405
+ ], FileSystem.prototype, "uploadFile", null);
406
+ tslib_1.__decorate([
407
+ (0, otel_decorator_1.WithInstrumentation)(),
408
+ tslib_1.__metadata("design:type", Function),
409
+ tslib_1.__metadata("design:paramtypes", [Array, Number]),
410
+ tslib_1.__metadata("design:returntype", Promise)
411
+ ], FileSystem.prototype, "uploadFiles", null);
412
+ //# 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,qDAA8B;AAU9B,2CAA8C;AAC9C,6CAAkD;AAClD,wDAAoD;AACpD,uDAI6B;AAC7B,2DAA4D;AAmF5D;;;;GAIG;AACH,MAAa,UAAU;IAEF;IACA;IAFnB,YACmB,YAA2B,EAC3B,SAAwB;QADxB,iBAAY,GAAZ,YAAY,CAAe;QAC3B,cAAS,GAAT,SAAS,CAAe;IACxC,CAAC;IAEJ;;;;;;;;;;OAUG;IAEU,AAAN,KAAK,CAAC,YAAY,CAAC,IAAY,EAAE,IAAY;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAC9D,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAED;;;;;;;;;;OAUG;IAEU,AAAN,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,SAAmB;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QACjE,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAiCY,AAAN,KAAK,CAAC,YAAY,CAAC,GAAW,EAAE,GAAqB,EAAE,UAAkB,EAAE,GAAG,EAAE;QACrF,MAAM,UAAU,GAAG,GAAG,CAAA;QAEtB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,IAAI,GAAG,EAAE,CAAC;gBACR,OAAO,GAAG,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,OAAO;QACP,IAAI,iBAAO,KAAK,iBAAO,CAAC,OAAO,IAAI,iBAAO,KAAK,iBAAO,CAAC,UAAU,IAAI,iBAAO,KAAK,iBAAO,CAAC,IAAI,EAAE,CAAC;YAC9F,6EAA6E;YAC7E,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAA;QACzE,CAAC;QAED,kBAAkB;QAClB,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAa,EAAC,QAAQ,EAAE,mCAAmC,CAAC,CAAA;QACjF,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;CACF;AAzaD,gCAyaC;AAvZc;IADZ,IAAA,oCAAmB,GAAE;;;;8CAIrB;AAcY;IADZ,IAAA,oCAAmB,GAAE;;;;4CAIrB;AAiCY;IADZ,IAAA,oCAAmB,GAAE;;;;8CAuBrB;AA4BY;IADZ,IAAA,oCAAmB,GAAE;;;;+CA+CrB;AAiBY;IADZ,IAAA,oCAAmB,GAAE;;;;2CAIrB;AAcY;IADZ,IAAA,oCAAmB,GAAE;;;;gDAIrB;AAgBY;IADZ,IAAA,oCAAmB,GAAE;;;;2CAIrB;AAcY;IADZ,IAAA,oCAAmB,GAAE;;;;2CAIrB;AAmBY;IADZ,IAAA,oCAAmB,GAAE;;;;gDAUrB;AAeY;IADZ,IAAA,oCAAmB,GAAE;;;;6CAIrB;AAkBY;IADZ,IAAA,oCAAmB,GAAE;;;;oDASrB;AAiCY;IADZ,IAAA,oCAAmB,GAAE;;;;4CAGrB;AA8BY;IADZ,IAAA,oCAAmB,GAAE;;;;6CA8BrB"}
package/src/Git.d.ts ADDED
@@ -0,0 +1,202 @@
1
+ import { GitApi, ListBranchResponse, GitStatus } from '@daytonaio/toolbox-api-client';
2
+ /**
3
+ * Response from the git commit.
4
+ *
5
+ * @interface
6
+ * @property {string} sha - The SHA of the commit
7
+ */
8
+ export interface GitCommitResponse {
9
+ sha: string;
10
+ }
11
+ /**
12
+ * Provides Git operations within a Sandbox.
13
+ *
14
+ * @class
15
+ */
16
+ export declare class Git {
17
+ private readonly apiClient;
18
+ constructor(apiClient: GitApi);
19
+ /**
20
+ * Stages the specified files for the next commit, similar to
21
+ * running 'git add' on the command line.
22
+ *
23
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
24
+ * @param {string[]} files - List of file paths or directories to stage, relative to the repository root
25
+ * @returns {Promise<void>}
26
+ *
27
+ * @example
28
+ * // Stage a single file
29
+ * await git.add('workspace/repo', ['file.txt']);
30
+ *
31
+ * @example
32
+ * // Stage whole repository
33
+ * await git.add('workspace/repo', ['.']);
34
+ */
35
+ add(path: string, files: string[]): Promise<void>;
36
+ /**
37
+ * List branches in the repository.
38
+ *
39
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
40
+ * @returns {Promise<ListBranchResponse>} List of branches in the repository
41
+ *
42
+ * @example
43
+ * const response = await git.branches('workspace/repo');
44
+ * console.log(`Branches: ${response.branches}`);
45
+ */
46
+ branches(path: string): Promise<ListBranchResponse>;
47
+ /**
48
+ * Create branch in the repository.
49
+ *
50
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
51
+ * @param {string} name - Name of the new branch to create
52
+ * @returns {Promise<void>}
53
+ *
54
+ * @example
55
+ * await git.createBranch('workspace/repo', 'new-feature');
56
+ */
57
+ createBranch(path: string, name: string): Promise<void>;
58
+ /**
59
+ * Delete branche in the repository.
60
+ *
61
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
62
+ * @param {string} name - Name of the branch to delete
63
+ * @returns {Promise<void>}
64
+ *
65
+ * @example
66
+ * await git.deleteBranch('workspace/repo', 'new-feature');
67
+ */
68
+ deleteBranch(path: string, name: string): Promise<void>;
69
+ /**
70
+ * Checkout branche in the repository.
71
+ *
72
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
73
+ * @param {string} branch - Name of the branch to checkout
74
+ * @returns {Promise<void>}
75
+ *
76
+ * @example
77
+ * await git.checkoutBranch('workspace/repo', 'new-feature');
78
+ */
79
+ checkoutBranch(path: string, branch: string): Promise<void>;
80
+ /**
81
+ * Clones a Git repository into the specified path. It supports
82
+ * cloning specific branches or commits, and can authenticate with the remote
83
+ * repository if credentials are provided.
84
+ *
85
+ * @param {string} url - Repository URL to clone from
86
+ * @param {string} path - Path where the repository should be cloned. Relative paths are resolved based on the sandbox working directory.
87
+ * @param {string} [branch] - Specific branch to clone. If not specified, clones the default branch
88
+ * @param {string} [commitId] - Specific commit to clone. If specified, the repository will be left in a detached HEAD state at this commit
89
+ * @param {string} [username] - Git username for authentication
90
+ * @param {string} [password] - Git password or token for authentication
91
+ * @returns {Promise<void>}
92
+ *
93
+ * @example
94
+ * // Clone the default branch
95
+ * await git.clone(
96
+ * 'https://github.com/user/repo.git',
97
+ * 'workspace/repo'
98
+ * );
99
+ *
100
+ * @example
101
+ * // Clone a specific branch with authentication
102
+ * await git.clone(
103
+ * 'https://github.com/user/private-repo.git',
104
+ * 'workspace/private',
105
+ * branch='develop',
106
+ * username='user',
107
+ * password='token'
108
+ * );
109
+ *
110
+ * @example
111
+ * // Clone a specific commit
112
+ * await git.clone(
113
+ * 'https://github.com/user/repo.git',
114
+ * 'workspace/repo-old',
115
+ * commitId='abc123'
116
+ * );
117
+ */
118
+ clone(url: string, path: string, branch?: string, commitId?: string, username?: string, password?: string): Promise<void>;
119
+ /**
120
+ * Commits staged changes.
121
+ *
122
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
123
+ * @param {string} message - Commit message describing the changes
124
+ * @param {string} author - Name of the commit author
125
+ * @param {string} email - Email address of the commit author
126
+ * @param {boolean} [allowEmpty] - Allow creating an empty commit when no changes are staged
127
+ * @returns {Promise<void>}
128
+ *
129
+ * @example
130
+ * // Stage and commit changes
131
+ * await git.add('workspace/repo', ['README.md']);
132
+ * await git.commit(
133
+ * 'workspace/repo',
134
+ * 'Update documentation',
135
+ * 'John Doe',
136
+ * 'john@example.com',
137
+ * true
138
+ * );
139
+ *
140
+ */
141
+ commit(path: string, message: string, author: string, email: string, allowEmpty?: boolean): Promise<GitCommitResponse>;
142
+ /**
143
+ * Push local changes to the remote repository.
144
+ *
145
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
146
+ * @param {string} [username] - Git username for authentication
147
+ * @param {string} [password] - Git password or token for authentication
148
+ * @returns {Promise<void>}
149
+ *
150
+ * @example
151
+ * // Push to a public repository
152
+ * await git.push('workspace/repo');
153
+ *
154
+ * @example
155
+ * // Push to a private repository
156
+ * await git.push(
157
+ * 'workspace/repo',
158
+ * 'user',
159
+ * 'token'
160
+ * );
161
+ */
162
+ push(path: string, username?: string, password?: string): Promise<void>;
163
+ /**
164
+ * Pulls changes from the remote repository.
165
+ *
166
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
167
+ * @param {string} [username] - Git username for authentication
168
+ * @param {string} [password] - Git password or token for authentication
169
+ * @returns {Promise<void>}
170
+ *
171
+ * @example
172
+ * // Pull from a public repository
173
+ * await git.pull('workspace/repo');
174
+ *
175
+ * @example
176
+ * // Pull from a private repository
177
+ * await git.pull(
178
+ * 'workspace/repo',
179
+ * 'user',
180
+ * 'token'
181
+ * );
182
+ */
183
+ pull(path: string, username?: string, password?: string): Promise<void>;
184
+ /**
185
+ * Gets the current status of the Git repository.
186
+ *
187
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
188
+ * @returns {Promise<GitStatus>} Current repository status including:
189
+ * - currentBranch: Name of the current branch
190
+ * - ahead: Number of commits ahead of the remote branch
191
+ * - behind: Number of commits behind the remote branch
192
+ * - branchPublished: Whether the branch has been published to the remote repository
193
+ * - fileStatus: List of file statuses
194
+ *
195
+ * @example
196
+ * const status = await sandbox.git.status('workspace/repo');
197
+ * console.log(`Current branch: ${status.currentBranch}`);
198
+ * console.log(`Commits ahead: ${status.ahead}`);
199
+ * console.log(`Commits behind: ${status.behind}`);
200
+ */
201
+ status(path: string): Promise<GitStatus>;
202
+ }