@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,77 @@
1
+ /**
2
+ * @module code-interpreter
3
+ */
4
+ import { InterpreterContext } from '@daytona/toolbox-api-client';
5
+ /**
6
+ * Represents stdout or stderr output from code execution.
7
+ */
8
+ export interface OutputMessage {
9
+ /**
10
+ * Output content.
11
+ */
12
+ output: string;
13
+ }
14
+ /**
15
+ * Represents an error that occurred during code execution.
16
+ */
17
+ export interface ExecutionError {
18
+ /**
19
+ * Error type/class name (e.g., "ValueError", "SyntaxError").
20
+ */
21
+ name: string;
22
+ /**
23
+ * Error value/message.
24
+ */
25
+ value: string;
26
+ /**
27
+ * Full traceback for the error, if available.
28
+ */
29
+ traceback?: string;
30
+ }
31
+ /**
32
+ * Result of code execution.
33
+ */
34
+ export interface ExecutionResult {
35
+ /**
36
+ * Standard output captured during execution.
37
+ */
38
+ stdout: string;
39
+ /**
40
+ * Standard error captured during execution.
41
+ */
42
+ stderr: string;
43
+ /**
44
+ * Details about an execution error, if one occurred.
45
+ */
46
+ error?: ExecutionError;
47
+ }
48
+ /**
49
+ * Options for executing code in the interpreter.
50
+ */
51
+ export interface RunCodeOptions {
52
+ /**
53
+ * Interpreter context to run code in.
54
+ */
55
+ context?: InterpreterContext;
56
+ /**
57
+ * Environment variables for this execution.
58
+ */
59
+ envs?: Record<string, string>;
60
+ /**
61
+ * Timeout in seconds. Set to 0 for no timeout. Default is 10 minutes.
62
+ */
63
+ timeout?: number;
64
+ /**
65
+ * Callback for stdout messages.
66
+ */
67
+ onStdout?: (message: OutputMessage) => any | Promise<any>;
68
+ /**
69
+ * Callback for stderr messages.
70
+ */
71
+ onStderr?: (message: OutputMessage) => any | Promise<any>;
72
+ /**
73
+ * Callback for execution errors (e.g., runtime exceptions).
74
+ */
75
+ onError?: (error: ExecutionError) => any | Promise<any>;
76
+ }
77
+ //# sourceMappingURL=CodeInterpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeInterpreter.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/CodeInterpreter.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAEhE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACzD;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;CACxD"}
@@ -0,0 +1,7 @@
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
+ //# sourceMappingURL=CodeInterpreter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeInterpreter.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/CodeInterpreter.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,26 @@
1
+ import type { Chart } from './Charts';
2
+ /**
3
+ * Artifacts from the command execution.
4
+ *
5
+ * @interface
6
+ * @property stdout - Standard output from the command, same as `result` in `ExecuteResponse`
7
+ * @property charts - List of chart metadata from matplotlib
8
+ */
9
+ export interface ExecutionArtifacts {
10
+ stdout: string;
11
+ charts?: Chart[];
12
+ }
13
+ /**
14
+ * Response from the command execution.
15
+ *
16
+ * @interface
17
+ * @property exitCode - The exit code from the command execution
18
+ * @property result - The output from the command execution
19
+ * @property artifacts - Artifacts from the command execution
20
+ */
21
+ export interface ExecuteResponse {
22
+ exitCode: number;
23
+ result: string;
24
+ artifacts?: ExecutionArtifacts;
25
+ }
26
+ //# sourceMappingURL=ExecuteResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteResponse.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/ExecuteResponse.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,kBAAkB,CAAA;CAC/B"}
@@ -0,0 +1,7 @@
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
+ //# sourceMappingURL=ExecuteResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteResponse.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/ExecuteResponse.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Options for creating a PTY session
3
+ */
4
+ export interface PtyCreateOptions {
5
+ /**
6
+ * The unique identifier for the PTY session
7
+ */
8
+ id: string;
9
+ /**
10
+ * Starting directory for the PTY session, defaults to the sandbox's working directory
11
+ */
12
+ cwd?: string;
13
+ /**
14
+ * Environment variables for the PTY session
15
+ */
16
+ envs?: Record<string, string>;
17
+ /**
18
+ * Number of terminal columns
19
+ */
20
+ cols?: number;
21
+ /**
22
+ * Number of terminal rows
23
+ */
24
+ rows?: number;
25
+ }
26
+ /**
27
+ * Options for connecting to a PTY session
28
+ */
29
+ export interface PtyConnectOptions {
30
+ /**
31
+ * Callback to handle PTY output data
32
+ */
33
+ onData: (data: Uint8Array) => void | Promise<void>;
34
+ }
35
+ /**
36
+ * PTY session result on exit
37
+ */
38
+ export interface PtyResult {
39
+ /**
40
+ * Exit code when the PTY process ends
41
+ */
42
+ exitCode?: number;
43
+ /**
44
+ * Error message if the PTY failed
45
+ */
46
+ error?: string;
47
+ }
48
+ //# sourceMappingURL=Pty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pty.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/Pty.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1,7 @@
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
+ //# sourceMappingURL=Pty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pty.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/Pty.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,39 @@
1
+ import { Buffer } from 'buffer';
2
+ /**
3
+ * Converts various data types to Uint8Array
4
+ */
5
+ export declare function toUint8Array(data: string | ArrayBuffer | ArrayBufferView): Uint8Array;
6
+ /**
7
+ * Concatenates multiple Uint8Array chunks into a single Uint8Array
8
+ */
9
+ export declare function concatUint8Arrays(parts: Uint8Array[]): Uint8Array;
10
+ /**
11
+ * Converts Uint8Array to Buffer (uses polyfill in non-Node environments)
12
+ */
13
+ export declare function toBuffer(data: Uint8Array): Buffer;
14
+ /**
15
+ * Decodes Uint8Array to UTF-8 string
16
+ */
17
+ export declare function utf8Decode(data: Uint8Array): string;
18
+ /**
19
+ * Finds all occurrences of a pattern in a byte buffer
20
+ */
21
+ export declare function findAllBytes(buffer: Uint8Array, pattern: Uint8Array): number[];
22
+ /**
23
+ * Finds the first occurrence of a pattern in a byte buffer within a range
24
+ */
25
+ export declare function findBytesInRange(buffer: Uint8Array, start: number, end: number, pattern: Uint8Array): number;
26
+ /**
27
+ * Checks if a sequence starts at a given position in a byte buffer
28
+ * Returns the position after the sequence if found, -1 otherwise
29
+ */
30
+ export declare function indexAfterSequence(buffer: Uint8Array, start: number, sequence: Uint8Array): number;
31
+ /**
32
+ * Collects all bytes from various stream types into a single Uint8Array
33
+ */
34
+ export declare function collectStreamBytes(stream: any): Promise<Uint8Array>;
35
+ /**
36
+ * Checks if value is a File object (browser environment)
37
+ */
38
+ export declare function isFile(value: any): boolean;
39
+ //# sourceMappingURL=Binary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Binary.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Binary.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,CAWrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CASjE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,CAmB9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,CAc5G;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,CAKlG;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAgDzE;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAG1C"}
@@ -0,0 +1,168 @@
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.toUint8Array = toUint8Array;
8
+ exports.concatUint8Arrays = concatUint8Arrays;
9
+ exports.toBuffer = toBuffer;
10
+ exports.utf8Decode = utf8Decode;
11
+ exports.findAllBytes = findAllBytes;
12
+ exports.findBytesInRange = findBytesInRange;
13
+ exports.indexAfterSequence = indexAfterSequence;
14
+ exports.collectStreamBytes = collectStreamBytes;
15
+ exports.isFile = isFile;
16
+ const buffer_1 = require("buffer");
17
+ const DaytonaError_1 = require("../errors/DaytonaError");
18
+ /**
19
+ * Converts various data types to Uint8Array
20
+ */
21
+ function toUint8Array(data) {
22
+ if (typeof data === 'string') {
23
+ return new TextEncoder().encode(data);
24
+ }
25
+ if (data instanceof ArrayBuffer) {
26
+ return new Uint8Array(data);
27
+ }
28
+ if (ArrayBuffer.isView(data)) {
29
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
30
+ }
31
+ throw new DaytonaError_1.DaytonaError('Unsupported data type for byte conversion.');
32
+ }
33
+ /**
34
+ * Concatenates multiple Uint8Array chunks into a single Uint8Array
35
+ */
36
+ function concatUint8Arrays(parts) {
37
+ const size = parts.reduce((sum, part) => sum + part.byteLength, 0);
38
+ const result = new Uint8Array(size);
39
+ let offset = 0;
40
+ for (const part of parts) {
41
+ result.set(part, offset);
42
+ offset += part.byteLength;
43
+ }
44
+ return result;
45
+ }
46
+ /**
47
+ * Converts Uint8Array to Buffer (uses polyfill in non-Node environments)
48
+ */
49
+ function toBuffer(data) {
50
+ return buffer_1.Buffer.from(data);
51
+ }
52
+ /**
53
+ * Decodes Uint8Array to UTF-8 string
54
+ */
55
+ function utf8Decode(data) {
56
+ return new TextDecoder('utf-8').decode(data);
57
+ }
58
+ /**
59
+ * Finds all occurrences of a pattern in a byte buffer
60
+ */
61
+ function findAllBytes(buffer, pattern) {
62
+ const results = [];
63
+ let i = 0;
64
+ while (i <= buffer.length - pattern.length) {
65
+ let match = true;
66
+ for (let j = 0; j < pattern.length; j++) {
67
+ if (buffer[i + j] !== pattern[j]) {
68
+ match = false;
69
+ break;
70
+ }
71
+ }
72
+ if (match) {
73
+ results.push(i);
74
+ i += pattern.length;
75
+ }
76
+ else {
77
+ i++;
78
+ }
79
+ }
80
+ return results;
81
+ }
82
+ /**
83
+ * Finds the first occurrence of a pattern in a byte buffer within a range
84
+ */
85
+ function findBytesInRange(buffer, start, end, pattern) {
86
+ let i = start;
87
+ while (i <= end - pattern.length) {
88
+ let match = true;
89
+ for (let j = 0; j < pattern.length; j++) {
90
+ if (buffer[i + j] !== pattern[j]) {
91
+ match = false;
92
+ break;
93
+ }
94
+ }
95
+ if (match)
96
+ return i;
97
+ i++;
98
+ }
99
+ return -1;
100
+ }
101
+ /**
102
+ * Checks if a sequence starts at a given position in a byte buffer
103
+ * Returns the position after the sequence if found, -1 otherwise
104
+ */
105
+ function indexAfterSequence(buffer, start, sequence) {
106
+ for (let j = 0; j < sequence.length; j++) {
107
+ if (buffer[start + j] !== sequence[j])
108
+ return -1;
109
+ }
110
+ return start + sequence.length;
111
+ }
112
+ /**
113
+ * Collects all bytes from various stream types into a single Uint8Array
114
+ */
115
+ async function collectStreamBytes(stream) {
116
+ if (!stream)
117
+ return new Uint8Array(0);
118
+ // ReadableStream (WHATWG)
119
+ if (typeof stream.getReader === 'function') {
120
+ const reader = stream.getReader();
121
+ const chunks = [];
122
+ try {
123
+ while (true) {
124
+ const { done, value } = await reader.read();
125
+ if (done)
126
+ break;
127
+ if (value?.byteLength) {
128
+ chunks.push(value);
129
+ }
130
+ }
131
+ }
132
+ finally {
133
+ await reader.cancel();
134
+ }
135
+ return concatUint8Arrays(chunks);
136
+ }
137
+ // AsyncIterable
138
+ if (stream?.[Symbol.asyncIterator]) {
139
+ const chunks = [];
140
+ for await (const chunk of stream) {
141
+ chunks.push(toUint8Array(chunk));
142
+ }
143
+ return concatUint8Arrays(chunks);
144
+ }
145
+ // Direct data types
146
+ if (typeof stream === 'string' || stream instanceof ArrayBuffer || ArrayBuffer.isView(stream)) {
147
+ return toUint8Array(stream);
148
+ }
149
+ // Blob
150
+ if (typeof Blob !== 'undefined' && stream instanceof Blob) {
151
+ const arrayBuffer = await stream.arrayBuffer();
152
+ return new Uint8Array(arrayBuffer);
153
+ }
154
+ // Response
155
+ if (typeof Response !== 'undefined' && stream instanceof Response) {
156
+ const arrayBuffer = await stream.arrayBuffer();
157
+ return new Uint8Array(arrayBuffer);
158
+ }
159
+ throw new DaytonaError_1.DaytonaError('Unsupported stream type for byte collection.');
160
+ }
161
+ /**
162
+ * Checks if value is a File object (browser environment)
163
+ */
164
+ function isFile(value) {
165
+ const FileConstructor = globalThis.File;
166
+ return typeof FileConstructor !== 'undefined' && value instanceof FileConstructor;
167
+ }
168
+ //# sourceMappingURL=Binary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Binary.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Binary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAQH,oCAWC;AAKD,8CASC;AAKD,4BAEC;AAKD,gCAEC;AAKD,oCAmBC;AAKD,4CAcC;AAMD,gDAKC;AAKD,gDAgDC;AAKD,wBAGC;AAhKD,mCAA+B;AAC/B,yDAAqD;AAErD;;GAEG;AACH,SAAgB,YAAY,CAAC,IAA4C;IACvE,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;IACD,IAAI,IAAI,YAAY,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;IACtE,CAAC;IACD,MAAM,IAAI,2BAAY,CAAC,4CAA4C,CAAC,CAAA;AACtE,C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,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAA;QAC9C,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IACpC,CAAC;IAED,WAAW;IACX,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,MAAM,YAAY,QAAQ,EAAE,CAAC;QAClE,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAA;QAC9C,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IACpC,CAAC;IAED,MAAM,IAAI,2BAAY,CAAC,8CAA8C,CAAC,CAAA;AACxE,CAAC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,KAAU;IAC/B,MAAM,eAAe,GAAI,UAAkB,CAAC,IAAI,CAAA;IAChD,OAAO,OAAO,eAAe,KAAK,WAAW,IAAI,KAAK,YAAY,eAAe,CAAA;AACnF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DownloadMetadata } from '../FileSystem';
2
+ /**
3
+ * Safely aborts a stream
4
+ */
5
+ export declare function abortStream(stream: any): void;
6
+ /**
7
+ * Normalizes response data to extract the actual stream
8
+ */
9
+ export declare function normalizeResponseStream(responseData: any): any;
10
+ /**
11
+ * Processes multipart response using busboy (Node.js path)
12
+ */
13
+ export declare function processDownloadFilesResponseWithBusboy(stream: any, headers: Record<string, string>, metadataMap: Map<string, DownloadMetadata>, onFileStream?: (source: string, fileStream: any) => void): Promise<void>;
14
+ export declare function processDownloadFilesResponseWithBuffered(stream: any, headers: Record<string, string>, metadataMap: Map<string, DownloadMetadata>): Promise<void>;
15
+ //# sourceMappingURL=FileTransfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileTransfer.d.ts","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/FileTransfer.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAA4B,MAAM,eAAe,CAAA;AAqD/E;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAM7C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,GAAG,GAAG,GAAG,CAgB9D;AAED;;GAEG;AACH,wBAAsB,sCAAsC,CAC1D,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC1C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,IAAI,GACvD,OAAO,CAAC,IAAI,CAAC,CAyFf;AA8CD,wBAAsB,wCAAwC,CAC5D,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,CAgDf"}