@daytonaio/sdk 0.170.0 → 0.171.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/LICENSE +190 -0
  2. package/cjs/CodeInterpreter.d.ts +95 -0
  3. package/cjs/CodeInterpreter.d.ts.map +1 -0
  4. package/cjs/CodeInterpreter.js +297 -0
  5. package/cjs/CodeInterpreter.js.map +1 -0
  6. package/cjs/ComputerUse.d.ts +539 -0
  7. package/cjs/ComputerUse.d.ts.map +1 -0
  8. package/cjs/ComputerUse.js +808 -0
  9. package/cjs/ComputerUse.js.map +1 -0
  10. package/cjs/Daytona.d.ts +355 -0
  11. package/cjs/Daytona.d.ts.map +1 -0
  12. package/cjs/Daytona.js +527 -0
  13. package/cjs/Daytona.js.map +1 -0
  14. package/cjs/FileSystem.d.ts +371 -0
  15. package/cjs/FileSystem.d.ts.map +1 -0
  16. package/cjs/FileSystem.js +489 -0
  17. package/cjs/FileSystem.js.map +1 -0
  18. package/cjs/Git.d.ts +203 -0
  19. package/cjs/Git.d.ts.map +1 -0
  20. package/cjs/Git.js +326 -0
  21. package/cjs/Git.js.map +1 -0
  22. package/cjs/Image.d.ts +265 -0
  23. package/cjs/Image.d.ts.map +1 -0
  24. package/cjs/Image.js +586 -0
  25. package/cjs/Image.js.map +1 -0
  26. package/cjs/LspServer.d.ts +172 -0
  27. package/cjs/LspServer.d.ts.map +1 -0
  28. package/cjs/LspServer.js +259 -0
  29. package/cjs/LspServer.js.map +1 -0
  30. package/cjs/ObjectStorage.d.ts +79 -0
  31. package/cjs/ObjectStorage.d.ts.map +1 -0
  32. package/cjs/ObjectStorage.js +199 -0
  33. package/cjs/ObjectStorage.js.map +1 -0
  34. package/cjs/Process.d.ts +490 -0
  35. package/cjs/Process.d.ts.map +1 -0
  36. package/cjs/Process.js +647 -0
  37. package/cjs/Process.js.map +1 -0
  38. package/cjs/PtyHandle.d.ts +155 -0
  39. package/cjs/PtyHandle.d.ts.map +1 -0
  40. package/cjs/PtyHandle.js +416 -0
  41. package/cjs/PtyHandle.js.map +1 -0
  42. package/cjs/README.md +180 -0
  43. package/cjs/Sandbox.d.ts +476 -0
  44. package/cjs/Sandbox.d.ts.map +1 -0
  45. package/cjs/Sandbox.js +905 -0
  46. package/cjs/Sandbox.js.map +1 -0
  47. package/cjs/Snapshot.d.ts +140 -0
  48. package/cjs/Snapshot.d.ts.map +1 -0
  49. package/cjs/Snapshot.js +248 -0
  50. package/cjs/Snapshot.js.map +1 -0
  51. package/cjs/Volume.d.ts +84 -0
  52. package/cjs/Volume.d.ts.map +1 -0
  53. package/cjs/Volume.js +119 -0
  54. package/cjs/Volume.js.map +1 -0
  55. package/cjs/__tests__/helpers.d.ts +6 -0
  56. package/cjs/__tests__/helpers.d.ts.map +1 -0
  57. package/cjs/__tests__/helpers.js +26 -0
  58. package/cjs/__tests__/helpers.js.map +1 -0
  59. package/cjs/errors/DaytonaError.d.ts +171 -0
  60. package/cjs/errors/DaytonaError.d.ts.map +1 -0
  61. package/cjs/errors/DaytonaError.js +258 -0
  62. package/cjs/errors/DaytonaError.js.map +1 -0
  63. package/cjs/index.d.ts +22 -0
  64. package/cjs/index.d.ts.map +1 -0
  65. package/cjs/index.js +49 -0
  66. package/cjs/index.js.map +1 -0
  67. package/cjs/package.json +3 -0
  68. package/cjs/types/Charts.d.ts +38 -0
  69. package/cjs/types/Charts.d.ts.map +1 -0
  70. package/cjs/types/Charts.js +37 -0
  71. package/cjs/types/Charts.js.map +1 -0
  72. package/cjs/types/CodeInterpreter.d.ts +77 -0
  73. package/cjs/types/CodeInterpreter.d.ts.map +1 -0
  74. package/cjs/types/CodeInterpreter.js +7 -0
  75. package/cjs/types/CodeInterpreter.js.map +1 -0
  76. package/cjs/types/ExecuteResponse.d.ts +26 -0
  77. package/cjs/types/ExecuteResponse.d.ts.map +1 -0
  78. package/cjs/types/ExecuteResponse.js +7 -0
  79. package/cjs/types/ExecuteResponse.js.map +1 -0
  80. package/cjs/types/Pty.d.ts +48 -0
  81. package/cjs/types/Pty.d.ts.map +1 -0
  82. package/cjs/types/Pty.js +7 -0
  83. package/cjs/types/Pty.js.map +1 -0
  84. package/cjs/utils/Binary.d.ts +39 -0
  85. package/cjs/utils/Binary.d.ts.map +1 -0
  86. package/cjs/utils/Binary.js +168 -0
  87. package/cjs/utils/Binary.js.map +1 -0
  88. package/cjs/utils/FileTransfer.d.ts +15 -0
  89. package/cjs/utils/FileTransfer.d.ts.map +1 -0
  90. package/cjs/utils/FileTransfer.js +261 -0
  91. package/cjs/utils/FileTransfer.js.map +1 -0
  92. package/cjs/utils/Import.d.ts +125 -0
  93. package/cjs/utils/Import.d.ts.map +1 -0
  94. package/cjs/utils/Import.js +112 -0
  95. package/cjs/utils/Import.js.map +1 -0
  96. package/cjs/utils/Multipart.d.ts +29 -0
  97. package/cjs/utils/Multipart.d.ts.map +1 -0
  98. package/cjs/utils/Multipart.js +115 -0
  99. package/cjs/utils/Multipart.js.map +1 -0
  100. package/cjs/utils/Runtime.d.ts +44 -0
  101. package/cjs/utils/Runtime.d.ts.map +1 -0
  102. package/cjs/utils/Runtime.js +95 -0
  103. package/cjs/utils/Runtime.js.map +1 -0
  104. package/cjs/utils/Stream.d.ts +20 -0
  105. package/cjs/utils/Stream.d.ts.map +1 -0
  106. package/cjs/utils/Stream.js +364 -0
  107. package/cjs/utils/Stream.js.map +1 -0
  108. package/cjs/utils/WebSocket.d.ts +10 -0
  109. package/cjs/utils/WebSocket.d.ts.map +1 -0
  110. package/cjs/utils/WebSocket.js +26 -0
  111. package/cjs/utils/WebSocket.js.map +1 -0
  112. package/cjs/utils/otel.decorator.d.ts +83 -0
  113. package/cjs/utils/otel.decorator.d.ts.map +1 -0
  114. package/cjs/utils/otel.decorator.js +141 -0
  115. package/cjs/utils/otel.decorator.js.map +1 -0
  116. package/esm/CodeInterpreter.d.ts +95 -0
  117. package/esm/CodeInterpreter.d.ts.map +1 -0
  118. package/esm/CodeInterpreter.js +292 -0
  119. package/esm/CodeInterpreter.js.map +1 -0
  120. package/esm/ComputerUse.d.ts +539 -0
  121. package/esm/ComputerUse.d.ts.map +1 -0
  122. package/esm/ComputerUse.js +799 -0
  123. package/esm/ComputerUse.js.map +1 -0
  124. package/esm/Daytona.d.ts +355 -0
  125. package/esm/Daytona.d.ts.map +1 -0
  126. package/esm/Daytona.js +523 -0
  127. package/esm/Daytona.js.map +1 -0
  128. package/esm/FileSystem.d.ts +371 -0
  129. package/esm/FileSystem.d.ts.map +1 -0
  130. package/esm/FileSystem.js +485 -0
  131. package/esm/FileSystem.js.map +1 -0
  132. package/esm/Git.d.ts +203 -0
  133. package/esm/Git.d.ts.map +1 -0
  134. package/esm/Git.js +322 -0
  135. package/esm/Git.js.map +1 -0
  136. package/esm/Image.d.ts +265 -0
  137. package/esm/Image.d.ts.map +1 -0
  138. package/esm/Image.js +581 -0
  139. package/esm/Image.js.map +1 -0
  140. package/esm/LspServer.d.ts +172 -0
  141. package/esm/LspServer.d.ts.map +1 -0
  142. package/esm/LspServer.js +255 -0
  143. package/esm/LspServer.js.map +1 -0
  144. package/esm/ObjectStorage.d.ts +79 -0
  145. package/esm/ObjectStorage.d.ts.map +1 -0
  146. package/esm/ObjectStorage.js +195 -0
  147. package/esm/ObjectStorage.js.map +1 -0
  148. package/esm/Process.d.ts +490 -0
  149. package/esm/Process.d.ts.map +1 -0
  150. package/esm/Process.js +642 -0
  151. package/esm/Process.js.map +1 -0
  152. package/esm/PtyHandle.d.ts +155 -0
  153. package/esm/PtyHandle.d.ts.map +1 -0
  154. package/esm/PtyHandle.js +412 -0
  155. package/esm/PtyHandle.js.map +1 -0
  156. package/esm/README.md +180 -0
  157. package/esm/Sandbox.d.ts +476 -0
  158. package/esm/Sandbox.d.ts.map +1 -0
  159. package/esm/Sandbox.js +901 -0
  160. package/esm/Sandbox.js.map +1 -0
  161. package/esm/Snapshot.d.ts +140 -0
  162. package/esm/Snapshot.d.ts.map +1 -0
  163. package/esm/Snapshot.js +244 -0
  164. package/esm/Snapshot.js.map +1 -0
  165. package/esm/Volume.d.ts +84 -0
  166. package/esm/Volume.d.ts.map +1 -0
  167. package/esm/Volume.js +115 -0
  168. package/esm/Volume.js.map +1 -0
  169. package/esm/__tests__/helpers.d.ts +6 -0
  170. package/esm/__tests__/helpers.d.ts.map +1 -0
  171. package/esm/__tests__/helpers.js +20 -0
  172. package/esm/__tests__/helpers.js.map +1 -0
  173. package/esm/errors/DaytonaError.d.ts +171 -0
  174. package/esm/errors/DaytonaError.d.ts.map +1 -0
  175. package/esm/errors/DaytonaError.js +243 -0
  176. package/esm/errors/DaytonaError.js.map +1 -0
  177. package/esm/index.d.ts +22 -0
  178. package/esm/index.d.ts.map +1 -0
  179. package/esm/index.js +21 -0
  180. package/esm/index.js.map +1 -0
  181. package/esm/package.json +3 -0
  182. package/esm/types/Charts.d.ts +38 -0
  183. package/esm/types/Charts.d.ts.map +1 -0
  184. package/esm/types/Charts.js +33 -0
  185. package/esm/types/Charts.js.map +1 -0
  186. package/esm/types/CodeInterpreter.d.ts +77 -0
  187. package/esm/types/CodeInterpreter.d.ts.map +1 -0
  188. package/esm/types/CodeInterpreter.js +6 -0
  189. package/esm/types/CodeInterpreter.js.map +1 -0
  190. package/esm/types/ExecuteResponse.d.ts +26 -0
  191. package/esm/types/ExecuteResponse.d.ts.map +1 -0
  192. package/esm/types/ExecuteResponse.js +6 -0
  193. package/esm/types/ExecuteResponse.js.map +1 -0
  194. package/esm/types/Pty.d.ts +48 -0
  195. package/esm/types/Pty.d.ts.map +1 -0
  196. package/esm/types/Pty.js +6 -0
  197. package/esm/types/Pty.js.map +1 -0
  198. package/esm/utils/Binary.d.ts +39 -0
  199. package/esm/utils/Binary.d.ts.map +1 -0
  200. package/esm/utils/Binary.js +157 -0
  201. package/esm/utils/Binary.js.map +1 -0
  202. package/esm/utils/FileTransfer.d.ts +15 -0
  203. package/esm/utils/FileTransfer.d.ts.map +1 -0
  204. package/esm/utils/FileTransfer.js +254 -0
  205. package/esm/utils/FileTransfer.js.map +1 -0
  206. package/esm/utils/Import.d.ts +95 -0
  207. package/esm/utils/Import.d.ts.map +1 -0
  208. package/esm/utils/Import.js +77 -0
  209. package/esm/utils/Import.js.map +1 -0
  210. package/esm/utils/Multipart.d.ts +29 -0
  211. package/esm/utils/Multipart.d.ts.map +1 -0
  212. package/esm/utils/Multipart.js +109 -0
  213. package/esm/utils/Multipart.js.map +1 -0
  214. package/esm/utils/Runtime.d.ts +44 -0
  215. package/esm/utils/Runtime.d.ts.map +1 -0
  216. package/esm/utils/Runtime.js +89 -0
  217. package/esm/utils/Runtime.js.map +1 -0
  218. package/esm/utils/Stream.d.ts +20 -0
  219. package/esm/utils/Stream.d.ts.map +1 -0
  220. package/esm/utils/Stream.js +360 -0
  221. package/esm/utils/Stream.js.map +1 -0
  222. package/esm/utils/WebSocket.d.ts +10 -0
  223. package/esm/utils/WebSocket.d.ts.map +1 -0
  224. package/esm/utils/WebSocket.js +22 -0
  225. package/esm/utils/WebSocket.js.map +1 -0
  226. package/esm/utils/otel.decorator.d.ts +83 -0
  227. package/esm/utils/otel.decorator.d.ts.map +1 -0
  228. package/esm/utils/otel.decorator.js +136 -0
  229. package/esm/utils/otel.decorator.js.map +1 -0
  230. package/package.json +20 -8
  231. package/src/ComputerUse.d.ts +4 -4
  232. package/src/ComputerUse.js +4 -4
  233. package/src/Sandbox.d.ts +1 -18
  234. package/src/Sandbox.js +0 -29
  235. package/src/Sandbox.js.map +1 -1
  236. package/src/__tests__/helpers.js +0 -2
  237. package/src/__tests__/helpers.js.map +1 -1
@@ -0,0 +1,261 @@
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.abortStream = abortStream;
8
+ exports.normalizeResponseStream = normalizeResponseStream;
9
+ exports.processDownloadFilesResponseWithBusboy = processDownloadFilesResponseWithBusboy;
10
+ exports.processDownloadFilesResponseWithBuffered = processDownloadFilesResponseWithBuffered;
11
+ const tslib_1 = require("tslib");
12
+ const buffer_1 = require("buffer");
13
+ const busboy_1 = tslib_1.__importDefault(require("busboy"));
14
+ const DaytonaError_1 = require("../errors/DaytonaError");
15
+ const Import_1 = require("./Import");
16
+ const Binary_1 = require("./Binary");
17
+ const Multipart_1 = require("./Multipart");
18
+ const Multipart_2 = require("./Multipart");
19
+ /**
20
+ * Parses a bulk-download error part into the legacy message and structured metadata.
21
+ */
22
+ function parseDownloadErrorPart(data, contentType) {
23
+ let message = new TextDecoder('utf-8').decode(data).trim();
24
+ if (!contentType || !/application\/json/i.test(contentType)) {
25
+ return { message };
26
+ }
27
+ try {
28
+ const payload = JSON.parse(message);
29
+ if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
30
+ return { message };
31
+ }
32
+ const payloadObject = payload;
33
+ const structuredMessage = payloadObject.message;
34
+ const statusCode = payloadObject.statusCode ?? payloadObject.status_code;
35
+ const errorCode = payloadObject.code ?? payloadObject.error_code;
36
+ if (typeof structuredMessage === 'string') {
37
+ message = structuredMessage;
38
+ }
39
+ return {
40
+ message,
41
+ errorDetails: {
42
+ message,
43
+ statusCode: typeof statusCode === 'number' ? statusCode : undefined,
44
+ errorCode: typeof errorCode === 'string' ? errorCode : undefined,
45
+ },
46
+ };
47
+ }
48
+ catch {
49
+ return { message };
50
+ }
51
+ }
52
+ /**
53
+ * Records a per-file error part on the corresponding download metadata entry.
54
+ */
55
+ function assignDownloadErrorPart(metadata, data, contentType) {
56
+ const { message, errorDetails } = parseDownloadErrorPart(data, contentType);
57
+ metadata.error = message;
58
+ metadata.errorDetails = errorDetails;
59
+ }
60
+ /**
61
+ * Safely aborts a stream
62
+ */
63
+ function abortStream(stream) {
64
+ if (stream && typeof stream.destroy === 'function') {
65
+ stream.destroy();
66
+ }
67
+ else if (stream && typeof stream.cancel === 'function') {
68
+ stream.cancel();
69
+ }
70
+ }
71
+ /**
72
+ * Normalizes response data to extract the actual stream
73
+ */
74
+ function normalizeResponseStream(responseData) {
75
+ if (!responseData || typeof responseData !== 'object') {
76
+ return responseData;
77
+ }
78
+ // WHATWG ReadableStream
79
+ if (responseData.body && typeof responseData.body.getReader === 'function') {
80
+ return responseData.body;
81
+ }
82
+ // Some adapters use .stream
83
+ if (responseData.stream) {
84
+ return responseData.stream;
85
+ }
86
+ return responseData;
87
+ }
88
+ /**
89
+ * Processes multipart response using busboy (Node.js path)
90
+ */
91
+ async function processDownloadFilesResponseWithBusboy(stream, headers, metadataMap, onFileStream) {
92
+ const fileTasks = [];
93
+ await new Promise((resolve, reject) => {
94
+ const bb = (0, busboy_1.default)({
95
+ headers,
96
+ preservePath: true,
97
+ });
98
+ bb.on('file', (fieldName, fileStream, fileInfo) => {
99
+ const source = fileInfo?.filename;
100
+ if (!source) {
101
+ abortStream(stream);
102
+ reject(new DaytonaError_1.DaytonaError(`Received unexpected file "${fileInfo?.filename}".`));
103
+ return;
104
+ }
105
+ const metadata = metadataMap.get(source);
106
+ if (!metadata) {
107
+ abortStream(stream);
108
+ reject(new DaytonaError_1.DaytonaError(`Target metadata missing for valid source: ${source}`));
109
+ return;
110
+ }
111
+ if (fieldName === 'error') {
112
+ // Collect per-file error metadata.
113
+ const chunks = [];
114
+ fileStream.on('data', (chunk) => chunks.push(chunk));
115
+ fileStream.on('end', () => {
116
+ assignDownloadErrorPart(metadata, buffer_1.Buffer.concat(chunks), fileInfo?.mimeType);
117
+ });
118
+ fileStream.on('error', (err) => {
119
+ metadata.error = `Stream error: ${err.message}`;
120
+ });
121
+ }
122
+ else if (fieldName === 'file') {
123
+ if (onFileStream) {
124
+ onFileStream(source, fileStream);
125
+ }
126
+ else if (metadata.destination) {
127
+ // Stream to file
128
+ fileTasks.push(new Promise((resolveTask) => {
129
+ (0, Import_1.dynamicImport)('fs', 'Downloading files to local files is not supported: ').then((fs) => {
130
+ const writeStream = fs.createWriteStream(metadata.destination, { autoClose: true });
131
+ fileStream.pipe(writeStream);
132
+ writeStream.on('finish', () => {
133
+ metadata.result = metadata.destination;
134
+ resolveTask();
135
+ });
136
+ writeStream.on('error', (err) => {
137
+ metadata.error = `Write stream failed: ${err.message}`;
138
+ resolveTask();
139
+ });
140
+ fileStream.on('error', (err) => {
141
+ metadata.error = `Read stream failed: ${err.message}`;
142
+ });
143
+ });
144
+ }));
145
+ }
146
+ else {
147
+ // Collect to buffer
148
+ const chunks = [];
149
+ fileStream.on('data', (chunk) => {
150
+ chunks.push(buffer_1.Buffer.isBuffer(chunk) ? chunk : buffer_1.Buffer.from(chunk));
151
+ });
152
+ fileStream.on('end', () => {
153
+ metadata.result = buffer_1.Buffer.concat(chunks);
154
+ });
155
+ fileStream.on('error', (err) => {
156
+ metadata.error = `Read failed: ${err.message}`;
157
+ });
158
+ }
159
+ }
160
+ else {
161
+ // Unknown field, drain it
162
+ fileStream.resume();
163
+ }
164
+ });
165
+ bb.on('error', (err) => {
166
+ abortStream(stream);
167
+ reject(err);
168
+ });
169
+ bb.on('finish', resolve);
170
+ // Feed stream into busboy
171
+ feedStreamToBusboy(stream, bb).catch((err) => bb.destroy(err));
172
+ });
173
+ await Promise.all(fileTasks);
174
+ }
175
+ /**
176
+ * Feeds various stream types into busboy
177
+ */
178
+ async function feedStreamToBusboy(stream, bb) {
179
+ // Node.js stream (piping)
180
+ if (typeof stream?.pipe === 'function') {
181
+ stream.pipe(bb);
182
+ return;
183
+ }
184
+ // Direct buffer-like data
185
+ if (typeof stream === 'string' || stream instanceof ArrayBuffer || ArrayBuffer.isView(stream)) {
186
+ const data = (0, Binary_1.toUint8Array)(stream);
187
+ bb.write(buffer_1.Buffer.from(data));
188
+ bb.end();
189
+ return;
190
+ }
191
+ // WHATWG ReadableStream
192
+ if (typeof stream?.getReader === 'function') {
193
+ const reader = stream.getReader();
194
+ while (true) {
195
+ const { done, value } = await reader.read();
196
+ if (done)
197
+ break;
198
+ bb.write(buffer_1.Buffer.from(value));
199
+ }
200
+ bb.end();
201
+ return;
202
+ }
203
+ // AsyncIterable
204
+ if (stream?.[Symbol.asyncIterator]) {
205
+ for await (const chunk of stream) {
206
+ const buffer = buffer_1.Buffer.isBuffer(chunk) ? chunk : buffer_1.Buffer.from((0, Binary_1.toUint8Array)(chunk));
207
+ bb.write(buffer);
208
+ }
209
+ bb.end();
210
+ return;
211
+ }
212
+ // Unsupported stream type
213
+ throw new DaytonaError_1.DaytonaError(`Unsupported stream type: ${stream?.constructor?.name || typeof stream}`);
214
+ }
215
+ async function processDownloadFilesResponseWithBuffered(stream, headers, metadataMap) {
216
+ const contentType = (0, Multipart_1.getHeader)(headers, 'content-type') || '';
217
+ const bodyBytes = await (0, Binary_1.collectStreamBytes)(stream);
218
+ // Try native FormData parsing for multipart/form-data
219
+ if (/^multipart\/form-data/i.test(contentType) && typeof Response !== 'undefined') {
220
+ try {
221
+ const formDataParts = await (0, Multipart_1.parseMultipartWithFormData)(bodyBytes, contentType);
222
+ for (const part of formDataParts) {
223
+ const metadata = metadataMap.get(part.filename);
224
+ if (!metadata) {
225
+ continue;
226
+ }
227
+ if (part.fieldName === 'error') {
228
+ assignDownloadErrorPart(metadata, part.data, part.contentType);
229
+ }
230
+ else {
231
+ metadata.result = (0, Binary_1.toBuffer)(part.data);
232
+ }
233
+ }
234
+ return;
235
+ }
236
+ catch {
237
+ // Fall through to manual parsing
238
+ }
239
+ }
240
+ // Manual multipart parsing (handles multipart/mixed, etc.)
241
+ const boundary = (0, Multipart_1.extractBoundary)(contentType);
242
+ if (!boundary) {
243
+ throw new DaytonaError_1.DaytonaError(`Missing multipart boundary in Content-Type: "${contentType}"`);
244
+ }
245
+ const parts = (0, Multipart_2.parseMultipart)(bodyBytes, boundary);
246
+ for (const part of parts) {
247
+ if (!part.filename)
248
+ continue;
249
+ const metadata = metadataMap.get(part.filename);
250
+ if (!metadata)
251
+ continue;
252
+ if (part.name === 'error') {
253
+ assignDownloadErrorPart(metadata, part.data, part.headers['content-type']);
254
+ }
255
+ else if (part.name === 'file') {
256
+ metadata.result = (0, Binary_1.toBuffer)(part.data);
257
+ }
258
+ }
259
+ return;
260
+ }
261
+ //# sourceMappingURL=FileTransfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileTransfer.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/FileTransfer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAiEH,kCAMC;AAKD,0DAgBC;AAKD,wFA8FC;AA8CD,4FAoDC;;AA/RD,mCAA+B;AAC/B,4DAA2B;AAC3B,yDAAqD;AACrD,qCAAwC;AACxC,qCAAqE;AACrE,2CAAoF;AACpF,2CAA4C;AAQ5C;;GAEG;AACH,SAAS,sBAAsB,CAAC,IAAgB,EAAE,WAAoB;IACpE,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1D,IAAI,CAAC,WAAW,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,CAAA;IACpB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAY,CAAA;QAC9C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACtE,OAAO,EAAE,OAAO,EAAE,CAAA;QACpB,CAAC;QAED,MAAM,aAAa,GAAG,OAAkC,CAAA;QACxD,MAAM,iBAAiB,GAAG,aAAa,CAAC,OAAO,CAAA;QAC/C,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,IAAI,aAAa,CAAC,WAAW,CAAA;QACxE,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,UAAU,CAAA;QAEhE,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;YAC1C,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import("fast-glob/out/types").Pattern | import("fast-glob/out/types").Pattern[], options: import("fast-glob/out/settings").Options & ({
5
+ objectMode: true;
6
+ } | {
7
+ stats: true;
8
+ })): import("fast-glob/out/types").Entry[];
9
+ sync(source: import("fast-glob/out/types").Pattern | import("fast-glob/out/types").Pattern[], options?: import("fast-glob/out/settings").Options): string[];
10
+ stream(source: import("fast-glob/out/types").Pattern | import("fast-glob/out/types").Pattern[], options?: import("fast-glob/out/settings").Options): NodeJS.ReadableStream;
11
+ generateTasks(source: import("fast-glob/out/types").Pattern | import("fast-glob/out/types").Pattern[], options?: import("fast-glob/out/settings").Options): import("fast-glob").Task[];
12
+ isDynamicPattern(source: import("fast-glob/out/types").Pattern, options?: import("fast-glob/out/settings").Options): boolean;
13
+ escapePath(source: string): import("fast-glob/out/types").Pattern;
14
+ convertPathToPattern(source: string): import("fast-glob/out/types").Pattern;
15
+ glob: typeof import("fast-glob");
16
+ globSync: typeof import("fast-glob").sync;
17
+ globStream: typeof import("fast-glob").stream;
18
+ async: typeof import("fast-glob");
19
+ posix: typeof import("fast-glob").posix;
20
+ win32: typeof import("fast-glob").win32;
21
+ }>;
22
+ '@iarna/toml': () => Promise<{
23
+ default: typeof import("@iarna/toml");
24
+ parse: import("@iarna/toml").FuncParse;
25
+ stringify: import("@iarna/toml").FuncStringify;
26
+ }>;
27
+ stream: () => Promise<{
28
+ default: typeof import("stream");
29
+ Stream: typeof import("stream");
30
+ promises: typeof import("node:stream/promises");
31
+ duplexPair(options?: import("stream").DuplexOptions): [import("stream").Duplex, import("stream").Duplex];
32
+ addAbortSignal<T extends import("stream")>(signal: AbortSignal, stream: T): T;
33
+ getDefaultHighWaterMark(objectMode: boolean): number;
34
+ setDefaultHighWaterMark(objectMode: boolean, value: number): void;
35
+ finished: typeof import("stream").finished;
36
+ pipeline: typeof import("stream").pipeline;
37
+ isErrored(stream: import("stream").Readable | import("stream").Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
38
+ isReadable(stream: import("stream").Readable | NodeJS.ReadableStream): boolean;
39
+ Readable: typeof import("stream").Readable;
40
+ Writable: typeof import("stream").Writable;
41
+ Duplex: typeof import("stream").Duplex;
42
+ Transform: typeof import("stream").Transform;
43
+ PassThrough: typeof import("stream").PassThrough;
44
+ errorMonitor: typeof import("events").errorMonitor;
45
+ captureRejectionSymbol: typeof import("events").captureRejectionSymbol;
46
+ captureRejections: boolean;
47
+ defaultMaxListeners: number;
48
+ EventEmitter: typeof import("events");
49
+ EventEmitterAsyncResource: typeof import("events").EventEmitterAsyncResource;
50
+ }>;
51
+ tar: () => Promise<{
52
+ default: typeof import("tar");
53
+ c: import("tar/dist/commonjs/make-command").TarCommand<import("tar").Pack, import("tar").PackSync>;
54
+ x: import("tar/dist/commonjs/make-command").TarCommand<import("tar").Unpack, import("tar").UnpackSync>;
55
+ t: import("tar/dist/commonjs/make-command").TarCommand<import("tar").Parser, import("tar").Parser & {
56
+ sync: true;
57
+ }>;
58
+ r: import("tar/dist/commonjs/make-command").TarCommand<never, never>;
59
+ types: typeof import("tar/dist/commonjs/types");
60
+ u: import("tar/dist/commonjs/make-command").TarCommand<never, never>;
61
+ create: import("tar/dist/commonjs/make-command").TarCommand<import("tar").Pack, import("tar").PackSync>;
62
+ extract: import("tar/dist/commonjs/make-command").TarCommand<import("tar").Unpack, import("tar").UnpackSync>;
63
+ Header: typeof import("tar").Header;
64
+ filesFilter: (opt: import("tar/dist/commonjs/options").TarOptions, files: string[]) => void;
65
+ list: import("tar/dist/commonjs/make-command").TarCommand<import("tar").Parser, import("tar").Parser & {
66
+ sync: true;
67
+ }>;
68
+ PackJob: typeof import("tar").PackJob;
69
+ Pack: typeof import("tar").Pack;
70
+ PackSync: typeof import("tar").PackSync;
71
+ Parser: typeof import("tar").Parser;
72
+ Pax: typeof import("tar").Pax;
73
+ ReadEntry: typeof import("tar").ReadEntry;
74
+ replace: import("tar/dist/commonjs/make-command").TarCommand<never, never>;
75
+ Unpack: typeof import("tar").Unpack;
76
+ UnpackSync: typeof import("tar").UnpackSync;
77
+ update: import("tar/dist/commonjs/make-command").TarCommand<never, never>;
78
+ WriteEntry: typeof import("tar").WriteEntry;
79
+ WriteEntrySync: typeof import("tar").WriteEntrySync;
80
+ WriteEntryTar: typeof import("tar").WriteEntryTar;
81
+ }>;
82
+ 'expand-tilde': () => Promise<any>;
83
+ ObjectStorage: () => Promise<typeof import("../ObjectStorage.js")>;
84
+ fs: () => Promise<typeof import("fs")>;
85
+ 'form-data': () => Promise<{
86
+ default: typeof import("form-data");
87
+ Stream: typeof import("stream");
88
+ promises: typeof import("node:stream/promises");
89
+ duplexPair(options?: import("stream").DuplexOptions): [import("stream").Duplex, import("stream").Duplex];
90
+ addAbortSignal<T extends import("stream")>(signal: AbortSignal, stream: T): T;
91
+ getDefaultHighWaterMark(objectMode: boolean): number;
92
+ setDefaultHighWaterMark(objectMode: boolean, value: number): void;
93
+ finished: typeof import("stream").finished;
94
+ pipeline: typeof import("stream").pipeline;
95
+ isErrored(stream: import("stream").Readable | import("stream").Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
96
+ isReadable(stream: import("stream").Readable | NodeJS.ReadableStream): boolean;
97
+ Readable: typeof import("stream").Readable;
98
+ Writable: typeof import("stream").Writable;
99
+ Duplex: typeof import("stream").Duplex;
100
+ Transform: typeof import("stream").Transform;
101
+ PassThrough: typeof import("stream").PassThrough;
102
+ errorMonitor: typeof import("events").errorMonitor;
103
+ captureRejectionSymbol: typeof import("events").captureRejectionSymbol;
104
+ captureRejections: boolean;
105
+ defaultMaxListeners: number;
106
+ EventEmitter: typeof import("events");
107
+ EventEmitterAsyncResource: typeof import("events").EventEmitterAsyncResource;
108
+ }>;
109
+ util: () => Promise<typeof import("util")>;
110
+ };
111
+ declare const requireMap: {
112
+ 'fast-glob': () => any;
113
+ '@iarna/toml': () => any;
114
+ stream: () => any;
115
+ tar: () => any;
116
+ 'expand-tilde': () => any;
117
+ fs: () => any;
118
+ 'form-data': () => any;
119
+ };
120
+ type ModuleMap = typeof loaderMap;
121
+ export declare function dynamicImport<K extends keyof ModuleMap>(name: K, errorPrefix?: string): Promise<Awaited<ReturnType<ModuleMap[K]>>>;
122
+ type RequireMap = typeof requireMap;
123
+ export declare function dynamicRequire<K extends keyof RequireMap>(name: K, errorPrefix?: string): ReturnType<RequireMap[K]>;
124
+ export {};
125
+ //# sourceMappingURL=Import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Import.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Import.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAOL,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;gBAE1B,OAAO,CAAC,cAAc,MAAM,CAAC,CAAC;CACzC,CAAA;AAED,QAAA,MAAM,UAAU;;;;;;;;CAQf,CAAA;AAaD,KAAK,SAAS,GAAG,OAAO,SAAS,CAAA;AAEjC,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,SAAS,EAC3D,IAAI,EAAE,CAAC,EACP,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAsB5C;AAED,KAAK,UAAU,GAAG,OAAO,UAAU,CAAA;AAEnC,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAsBnH"}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.dynamicImport = dynamicImport;
41
+ exports.dynamicRequire = dynamicRequire;
42
+ const DaytonaError_1 = require("../errors/DaytonaError");
43
+ const Runtime_1 = require("./Runtime");
44
+ const loaderMap = {
45
+ 'fast-glob': () => Promise.resolve().then(() => __importStar(require('fast-glob'))),
46
+ '@iarna/toml': () => Promise.resolve().then(() => __importStar(require('@iarna/toml'))),
47
+ stream: () => Promise.resolve().then(() => __importStar(require('stream'))),
48
+ tar: () => Promise.resolve().then(() => __importStar(require('tar'))),
49
+ 'expand-tilde': () => Promise.resolve().then(() => __importStar(require('expand-tilde'))),
50
+ ObjectStorage: () => Promise.resolve().then(() => __importStar(require('../ObjectStorage.js'))),
51
+ fs: () => Promise.resolve().then(() => __importStar(require('fs'))),
52
+ 'form-data': () => Promise.resolve().then(() => __importStar(require('form-data'))),
53
+ util: () => Promise.resolve().then(() => __importStar(require('util'))),
54
+ };
55
+ const requireMap = {
56
+ 'fast-glob': () => require('fast-glob'),
57
+ '@iarna/toml': () => require('@iarna/toml'),
58
+ stream: () => require('stream'),
59
+ tar: () => require('tar'),
60
+ 'expand-tilde': () => require('expand-tilde'),
61
+ fs: () => require('fs'),
62
+ 'form-data': () => require('form-data'),
63
+ };
64
+ const validateMap = {
65
+ 'fast-glob': (mod) => typeof mod === 'function' && typeof mod?.sync === 'function',
66
+ '@iarna/toml': (mod) => typeof mod.parse === 'function' && typeof mod.stringify === 'function',
67
+ stream: (mod) => typeof mod.Readable === 'function' && typeof mod.Writable === 'function',
68
+ tar: (mod) => typeof mod.extract === 'function' && typeof mod.create === 'function',
69
+ 'expand-tilde': (mod) => typeof mod === 'function',
70
+ fs: (mod) => typeof mod.createReadStream === 'function' && typeof mod.readFile === 'function',
71
+ 'form-data': (mod) => typeof mod === 'function',
72
+ util: (mod) => typeof mod.promisify === 'function',
73
+ };
74
+ async function dynamicImport(name, errorPrefix) {
75
+ const loader = loaderMap[name];
76
+ if (!loader) {
77
+ throw new DaytonaError_1.DaytonaError(`${errorPrefix || ''} Unknown module "${name}"`);
78
+ }
79
+ let mod;
80
+ try {
81
+ mod = (await loader());
82
+ mod = mod?.default ?? mod;
83
+ }
84
+ catch (err) {
85
+ const msg = err instanceof Error ? err.message : String(err);
86
+ throw new DaytonaError_1.DaytonaError(`${errorPrefix || ''} Module "${name}" is not available in the "${Runtime_1.RUNTIME}" runtime: ${msg}`);
87
+ }
88
+ if (validateMap[name] && !validateMap[name](mod)) {
89
+ throw new DaytonaError_1.DaytonaError(`${errorPrefix || ''} Module "${name}" didn't pass import validation in the "${Runtime_1.RUNTIME}" runtime`);
90
+ }
91
+ return mod;
92
+ }
93
+ function dynamicRequire(name, errorPrefix) {
94
+ const loader = requireMap[name];
95
+ if (!loader) {
96
+ throw new DaytonaError_1.DaytonaError(`${errorPrefix || ''} Unknown module "${name}"`);
97
+ }
98
+ let mod;
99
+ try {
100
+ mod = loader();
101
+ mod = mod?.default ?? mod;
102
+ }
103
+ catch (err) {
104
+ const msg = err instanceof Error ? err.message : String(err);
105
+ throw new DaytonaError_1.DaytonaError(`${errorPrefix || ''} Module "${name}" is not available in the "${Runtime_1.RUNTIME}" runtime: ${msg}`);
106
+ }
107
+ if (validateMap[name] && !validateMap[name](mod)) {
108
+ throw new DaytonaError_1.DaytonaError(`${errorPrefix || ''} Module "${name}" didn't pass import validation in the "${Runtime_1.RUNTIME}" runtime`);
109
+ }
110
+ return mod;
111
+ }
112
+ //# sourceMappingURL=Import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Import.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Import.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCH,sCAyBC;AAID,wCAsBC;AAzFD,yDAAqD;AACrD,uCAAmC;AAEnC,MAAM,SAAS,GAAG;IAChB,WAAW,EAAE,GAAG,EAAE,mDAAQ,WAAW,GAAC;IACtC,aAAa,EAAE,GAAG,EAAE,mDAAQ,aAAa,GAAC;IAC1C,MAAM,EAAE,GAAG,EAAE,mDAAQ,QAAQ,GAAC;IAC9B,GAAG,EAAE,GAAG,EAAE,mDAAQ,KAAK,GAAC;IACxB,cAAc,EAAE,GAAG,EAAE,mDAAQ,cAAc,GAAC;IAC5C,aAAa,EAAE,GAAG,EAAE,mDAAQ,qBAAqB,GAAC;IAClD,EAAE,EAAE,GAAiC,EAAE,mDAAQ,IAAI,GAAC;IACpD,WAAW,EAAE,GAAG,EAAE,mDAAQ,WAAW,GAAC;IACtC,IAAI,EAAE,GAAmC,EAAE,mDAAQ,MAAM,GAAC;CAC3D,CAAA;AAED,MAAM,UAAU,GA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AAE,oBAAoB,IAAI,GAAG,CAAC,CAAA;IACzE,CAAC;IAED,IAAI,GAAQ,CAAA;IACZ,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,EAAE,CAAA;QACd,GAAG,GAAG,GAAG,EAAE,OAAO,IAAI,GAAG,CAAA;IAC3B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC5D,MAAM,IAAI,2BAAY,CAAC,GAAG,WAAW,IAAI,EAAE,YAAY,IAAI,8BAA8B,iBAAO,cAAc,GAAG,EAAE,CAAC,CAAA;IACtH,CAAC;IAED,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,2BAAY,CACpB,GAAG,WAAW,IAAI,EAAE,YAAY,IAAI,2CAA2C,iBAAO,WAAW,CAClG,CAAA;IACH,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -0,0 +1,29 @@
1
+ export interface MultipartPart {
2
+ name: string | undefined;
3
+ filename: string | undefined;
4
+ headers: Record<string, string>;
5
+ data: Uint8Array;
6
+ }
7
+ /**
8
+ * Extracts the boundary from a Content-Type header
9
+ */
10
+ export declare function extractBoundary(contentType: string): string | null;
11
+ /**
12
+ * Parses multipart/form-data or multipart/mixed response body
13
+ */
14
+ export declare function parseMultipart(body: Uint8Array, boundary: string): MultipartPart[];
15
+ /**
16
+ * Parses multipart response using browser's native FormData API
17
+ * This is more reliable than manual parsing when available
18
+ */
19
+ export declare function parseMultipartWithFormData(bodyBytes: Uint8Array, contentType: string): Promise<Array<{
20
+ fieldName: string;
21
+ filename: string;
22
+ contentType: string;
23
+ data: Uint8Array;
24
+ }>>;
25
+ /**
26
+ * Extracts a header value from response headers (case-insensitive)
27
+ */
28
+ export declare function getHeader(headers: any, key: string): string | undefined;
29
+ //# sourceMappingURL=Multipart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Multipart.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Multipart.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,IAAI,EAAE,UAAU,CAAA;CACjB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGlE;AAWD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,EAAE,CAmDlF;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC,CA4BhG;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMvE"}