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