@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
package/cjs/Process.js ADDED
@@ -0,0 +1,647 @@
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.Process = exports.CodeRunParams = exports.MAX_PREFIX_LEN = exports.STDERR_PREFIX_BYTES = exports.STDOUT_PREFIX_BYTES = void 0;
8
+ const tslib_1 = require("tslib");
9
+ const Charts_1 = require("./types/Charts");
10
+ const Stream_1 = require("./utils/Stream");
11
+ const PtyHandle_1 = require("./PtyHandle");
12
+ const WebSocket_1 = require("./utils/WebSocket");
13
+ const otel_decorator_1 = require("./utils/otel.decorator");
14
+ // 3-byte multiplexing markers inserted by the shell labelers
15
+ exports.STDOUT_PREFIX_BYTES = new Uint8Array([0x01, 0x01, 0x01]);
16
+ exports.STDERR_PREFIX_BYTES = new Uint8Array([0x02, 0x02, 0x02]);
17
+ exports.MAX_PREFIX_LEN = Math.max(exports.STDOUT_PREFIX_BYTES.length, exports.STDERR_PREFIX_BYTES.length);
18
+ /**
19
+ * Parameters for code execution.
20
+ */
21
+ class CodeRunParams {
22
+ /**
23
+ * Command line arguments
24
+ */
25
+ argv;
26
+ /**
27
+ * Environment variables
28
+ */
29
+ env;
30
+ }
31
+ exports.CodeRunParams = CodeRunParams;
32
+ /**
33
+ * Handles process and code execution within a Sandbox.
34
+ *
35
+ * @class
36
+ */
37
+ class Process {
38
+ clientConfig;
39
+ apiClient;
40
+ getPreviewToken;
41
+ language;
42
+ constructor(clientConfig, apiClient, getPreviewToken, language) {
43
+ this.clientConfig = clientConfig;
44
+ this.apiClient = apiClient;
45
+ this.getPreviewToken = getPreviewToken;
46
+ this.language = language;
47
+ }
48
+ /**
49
+ * Executes a shell command in the Sandbox.
50
+ *
51
+ * @param {string} command - Shell command to execute
52
+ * @param {string} [cwd] - Working directory for command execution. If not specified, uses the sandbox working directory.
53
+ * @param {Record<string, string>} [env] - Environment variables to set for the command
54
+ * @param {number} [timeout] - Maximum time in seconds to wait for the command to complete.
55
+ * @returns {Promise<ExecuteResponse>} Command execution results containing:
56
+ * - exitCode: The command's exit status
57
+ * - result: Standard output from the command
58
+ * - artifacts: ExecutionArtifacts object containing `stdout` (same as result) and `charts` (matplotlib charts metadata)
59
+ *
60
+ * @example
61
+ * // Simple command
62
+ * const response = await process.executeCommand('echo "Hello"');
63
+ * console.log(response.artifacts.stdout); // Prints: Hello
64
+ *
65
+ * @example
66
+ * // Command with working directory
67
+ * const result = await process.executeCommand('ls', 'workspace/src');
68
+ *
69
+ * @example
70
+ * // Command with timeout
71
+ * const result = await process.executeCommand('sleep 10', undefined, 5);
72
+ */
73
+ async executeCommand(command, cwd, env, timeout) {
74
+ const response = await this.apiClient.executeCommand({
75
+ command,
76
+ timeout,
77
+ cwd: cwd,
78
+ envs: env && Object.keys(env).length ? env : undefined,
79
+ });
80
+ const result = response.data.result ?? '';
81
+ return {
82
+ exitCode: response.data.exitCode ?? response.data.code,
83
+ result,
84
+ artifacts: {
85
+ stdout: result,
86
+ },
87
+ };
88
+ }
89
+ /**
90
+ * Executes code in the Sandbox using the appropriate language runtime.
91
+ *
92
+ * @param {string} code - Code to execute
93
+ * @param {CodeRunParams} params - Parameters for code execution
94
+ * @param {number} [timeout] - Maximum time in seconds to wait for execution to complete
95
+ * @returns {Promise<ExecuteResponse>} Code execution results containing:
96
+ * - exitCode: The execution's exit status
97
+ * - result: Standard output from the code
98
+ * - artifacts: ExecutionArtifacts object containing `stdout` (same as result) and `charts` (matplotlib charts metadata)
99
+ *
100
+ * @example
101
+ * // Run TypeScript code
102
+ * const response = await process.codeRun(`
103
+ * const x = 10;
104
+ * const y = 20;
105
+ * console.log(\`Sum: \${x + y}\`);
106
+ * `);
107
+ * console.log(response.artifacts.stdout); // Prints: Sum: 30
108
+ *
109
+ * @example
110
+ * // Run Python code with matplotlib
111
+ * const response = await process.codeRun(`
112
+ * import matplotlib.pyplot as plt
113
+ * import numpy as np
114
+ *
115
+ * x = np.linspace(0, 10, 30)
116
+ * y = np.sin(x)
117
+ *
118
+ * plt.figure(figsize=(8, 5))
119
+ * plt.plot(x, y, 'b-', linewidth=2)
120
+ * plt.title('Line Chart')
121
+ * plt.xlabel('X-axis (seconds)')
122
+ * plt.ylabel('Y-axis (amplitude)')
123
+ * plt.grid(True)
124
+ * plt.show()
125
+ * `);
126
+ *
127
+ * if (response.artifacts?.charts) {
128
+ * const chart = response.artifacts.charts[0];
129
+ *
130
+ * console.log(`Type: ${chart.type}`);
131
+ * console.log(`Title: ${chart.title}`);
132
+ * if (chart.type === ChartType.LINE) {
133
+ * const lineChart = chart as LineChart
134
+ * console.log('X Label:', lineChart.x_label)
135
+ * console.log('Y Label:', lineChart.y_label)
136
+ * console.log('X Ticks:', lineChart.x_ticks)
137
+ * console.log('Y Ticks:', lineChart.y_ticks)
138
+ * console.log('X Tick Labels:', lineChart.x_tick_labels)
139
+ * console.log('Y Tick Labels:', lineChart.y_tick_labels)
140
+ * console.log('X Scale:', lineChart.x_scale)
141
+ * console.log('Y Scale:', lineChart.y_scale)
142
+ * console.log('Elements:')
143
+ * console.dir(lineChart.elements, { depth: null })
144
+ * }
145
+ * }
146
+ */
147
+ async codeRun(code, params, timeout) {
148
+ if (!this.language) {
149
+ throw new Error('Code language is required for codeRun');
150
+ }
151
+ const request = {
152
+ code,
153
+ language: this.language,
154
+ argv: params?.argv,
155
+ envs: params?.env,
156
+ timeout,
157
+ };
158
+ const response = await this.apiClient.codeRun(request);
159
+ const data = response.data;
160
+ const charts = data.artifacts?.charts?.map(Charts_1.parseChart) ?? [];
161
+ return {
162
+ exitCode: data.exitCode ?? 0,
163
+ result: data.result ?? '',
164
+ artifacts: {
165
+ stdout: data.result ?? '',
166
+ charts,
167
+ },
168
+ };
169
+ }
170
+ /**
171
+ * Creates a new long-running background session in the Sandbox.
172
+ *
173
+ * Sessions are background processes that maintain state between commands, making them ideal for
174
+ * scenarios requiring multiple related commands or persistent environment setup. You can run
175
+ * long-running commands and monitor process status.
176
+ *
177
+ * @param {string} sessionId - Unique identifier for the new session
178
+ * @returns {Promise<void>}
179
+ *
180
+ * @example
181
+ * // Create a new session
182
+ * const sessionId = 'my-session';
183
+ * await process.createSession(sessionId);
184
+ * const session = await process.getSession(sessionId);
185
+ * // Do work...
186
+ * await process.deleteSession(sessionId);
187
+ */
188
+ async createSession(sessionId) {
189
+ await this.apiClient.createSession({
190
+ sessionId,
191
+ });
192
+ }
193
+ /**
194
+ * Get a session in the sandbox.
195
+ *
196
+ * @param {string} sessionId - Unique identifier of the session to retrieve
197
+ * @returns {Promise<Session>} Session information including:
198
+ * - sessionId: The session's unique identifier
199
+ * - commands: List of commands executed in the session
200
+ *
201
+ * @example
202
+ * const session = await process.getSession('my-session');
203
+ * session.commands.forEach(cmd => {
204
+ * console.log(`Command: ${cmd.command}`);
205
+ * });
206
+ */
207
+ async getSession(sessionId) {
208
+ const response = await this.apiClient.getSession(sessionId);
209
+ return response.data;
210
+ }
211
+ /**
212
+ * Get the sandbox entrypoint session
213
+ *
214
+ * @returns {Promise<Session>} Entrypoint session information including:
215
+ * - sessionId: The entrypoint session's unique identifier
216
+ * - commands: List of commands executed in the entrypoint session
217
+ *
218
+ * @example
219
+ * const session = await process.getEntrypointSession();
220
+ * session.commands.forEach(cmd => {
221
+ * console.log(`Command: ${cmd.command}`);
222
+ * });
223
+ */
224
+ async getEntrypointSession() {
225
+ const response = await this.apiClient.getEntrypointSession();
226
+ return response.data;
227
+ }
228
+ /**
229
+ * Gets information about a specific command executed in a session.
230
+ *
231
+ * @param {string} sessionId - Unique identifier of the session
232
+ * @param {string} commandId - Unique identifier of the command
233
+ * @returns {Promise<Command>} Command information including:
234
+ * - id: The command's unique identifier
235
+ * - command: The executed command string
236
+ * - exitCode: Command's exit status (if completed)
237
+ *
238
+ * @example
239
+ * const cmd = await process.getSessionCommand('my-session', 'cmd-123');
240
+ * if (cmd.exitCode === 0) {
241
+ * console.log(`Command ${cmd.command} completed successfully`);
242
+ * }
243
+ */
244
+ async getSessionCommand(sessionId, commandId) {
245
+ const response = await this.apiClient.getSessionCommand(sessionId, commandId);
246
+ return response.data;
247
+ }
248
+ /**
249
+ * Executes a command in an existing session.
250
+ *
251
+ * @param {string} sessionId - Unique identifier of the session to use
252
+ * @param {SessionExecuteRequest} req - Command execution request containing:
253
+ * - command: The command to execute
254
+ * - runAsync: Whether to execute asynchronously
255
+ * - suppressInputEcho: Whether to suppress input echo. Default is `false`.
256
+ * @param {number} timeout - Timeout in seconds
257
+ * @returns {Promise<SessionExecuteResponse>} Command execution results containing:
258
+ * - cmdId: Unique identifier for the executed command
259
+ * - output: Combined command output (stdout and stderr) (if synchronous execution)
260
+ * - stdout: Standard output from the command
261
+ * - stderr: Standard error from the command
262
+ * - exitCode: Command exit status (if synchronous execution)
263
+ *
264
+ * @example
265
+ * // Execute commands in sequence, maintaining state
266
+ * const sessionId = 'my-session';
267
+ *
268
+ * // Change directory
269
+ * await process.executeSessionCommand(sessionId, {
270
+ * command: 'cd /home/daytona'
271
+ * });
272
+ *
273
+ * // Run command in new directory
274
+ * const result = await process.executeSessionCommand(sessionId, {
275
+ * command: 'pwd'
276
+ * });
277
+ * console.log('[STDOUT]:', result.stdout);
278
+ * console.log('[STDERR]:', result.stderr);
279
+ */
280
+ async executeSessionCommand(sessionId, req, timeout) {
281
+ const response = await this.apiClient.sessionExecuteCommand(sessionId, req, timeout ? { timeout: timeout * 1000 } : {});
282
+ return {
283
+ ...response.data,
284
+ stdout: response.data.stdout ?? '',
285
+ stderr: response.data.stderr ?? '',
286
+ };
287
+ }
288
+ async getSessionCommandLogs(sessionId, commandId, onStdout, onStderr) {
289
+ if (!onStdout && !onStderr) {
290
+ const response = await this.apiClient.getSessionCommandLogs(sessionId, commandId);
291
+ return {
292
+ output: response.data.output ?? '',
293
+ stdout: response.data.stdout ?? '',
294
+ stderr: response.data.stderr ?? '',
295
+ };
296
+ }
297
+ const url = `${this.clientConfig.basePath.replace(/^http/, 'ws')}/process/session/${sessionId}/command/${commandId}/logs?follow=true`;
298
+ const ws = await (0, WebSocket_1.createSandboxWebSocket)(url, this.clientConfig.baseOptions?.headers || {}, this.getPreviewToken);
299
+ await (0, Stream_1.stdDemuxStream)(ws, onStdout, onStderr);
300
+ }
301
+ async getEntrypointLogs(onStdout, onStderr) {
302
+ if (!onStdout && !onStderr) {
303
+ const response = await this.apiClient.getEntrypointLogs();
304
+ return {
305
+ output: response.data.output ?? '',
306
+ stdout: response.data.stdout ?? '',
307
+ stderr: response.data.stderr ?? '',
308
+ };
309
+ }
310
+ const url = `${this.clientConfig.basePath.replace(/^http/, 'ws')}/process/session/entrypoint/logs?follow=true`;
311
+ const ws = await (0, WebSocket_1.createSandboxWebSocket)(url, this.clientConfig.baseOptions?.headers || {}, this.getPreviewToken);
312
+ await (0, Stream_1.stdDemuxStream)(ws, onStdout, onStderr);
313
+ }
314
+ /**
315
+ * Sends input data to a command executed in a session.
316
+ *
317
+ * @param {string} sessionId - Unique identifier of the session
318
+ * @param {string} commandId - Unique identifier of the command
319
+ * @param {string} data - Input data to send
320
+ * @returns {Promise<void>}
321
+ */
322
+ async sendSessionCommandInput(sessionId, commandId, data) {
323
+ await this.apiClient.sendInput(sessionId, commandId, { data });
324
+ }
325
+ /**
326
+ * Lists all active sessions in the Sandbox.
327
+ *
328
+ * @returns {Promise<Session[]>} Array of active sessions
329
+ *
330
+ * @example
331
+ * const sessions = await process.listSessions();
332
+ * sessions.forEach(session => {
333
+ * console.log(`Session ${session.sessionId}:`);
334
+ * session.commands.forEach(cmd => {
335
+ * console.log(`- ${cmd.command} (${cmd.exitCode})`);
336
+ * });
337
+ * });
338
+ */
339
+ async listSessions() {
340
+ const response = await this.apiClient.listSessions();
341
+ return response.data;
342
+ }
343
+ /**
344
+ * Delete a session from the Sandbox.
345
+ *
346
+ * @param {string} sessionId - Unique identifier of the session to delete
347
+ * @returns {Promise<void>}
348
+ *
349
+ * @example
350
+ * // Clean up a completed session
351
+ * await process.deleteSession('my-session');
352
+ */
353
+ async deleteSession(sessionId) {
354
+ await this.apiClient.deleteSession(sessionId);
355
+ }
356
+ /**
357
+ * Create a new PTY (pseudo-terminal) session in the sandbox.
358
+ *
359
+ * Creates an interactive terminal session that can execute commands and handle user input.
360
+ * The PTY session behaves like a real terminal, supporting features like command history.
361
+ *
362
+ * @param {PtyCreateOptions & PtyConnectOptions} options - PTY session configuration including creation and connection options
363
+ * @returns {Promise<PtyHandle>} PTY handle for managing the session
364
+ *
365
+ * @example
366
+ * // Create a PTY session with custom configuration
367
+ * const ptyHandle = await process.createPty({
368
+ * id: 'my-interactive-session',
369
+ * cwd: '/workspace',
370
+ * envs: { TERM: 'xterm-256color', LANG: 'en_US.UTF-8' },
371
+ * cols: 120,
372
+ * rows: 30,
373
+ * onData: (data) => {
374
+ * // Handle terminal output
375
+ * const text = new TextDecoder().decode(data);
376
+ * process.stdout.write(text);
377
+ * },
378
+ * });
379
+ *
380
+ * // Wait for connection to be established
381
+ * await ptyHandle.waitForConnection();
382
+ *
383
+ * // Send commands to the terminal
384
+ * await ptyHandle.sendInput('ls -la\n');
385
+ * await ptyHandle.sendInput('echo "Hello, PTY!"\n');
386
+ * await ptyHandle.sendInput('exit\n');
387
+ *
388
+ * // Wait for completion and get result
389
+ * const result = await ptyHandle.wait();
390
+ * console.log(`PTY session completed with exit code: ${result.exitCode}`);
391
+ *
392
+ * // Clean up
393
+ * await ptyHandle.disconnect();
394
+ */
395
+ async createPty(options) {
396
+ const request = {
397
+ id: options.id,
398
+ cwd: options.cwd,
399
+ envs: options.envs,
400
+ cols: options.cols,
401
+ rows: options.rows,
402
+ lazyStart: true,
403
+ };
404
+ const response = await this.apiClient.createPtySession(request);
405
+ return await this.connectPty(response.data.sessionId, options);
406
+ }
407
+ /**
408
+ * Connect to an existing PTY session in the sandbox.
409
+ *
410
+ * Establishes a WebSocket connection to an existing PTY session, allowing you to
411
+ * interact with a previously created terminal session.
412
+ *
413
+ * @param {string} sessionId - ID of the PTY session to connect to
414
+ * @param {PtyConnectOptions} options - Options for the connection including data handler
415
+ * @returns {Promise<PtyHandle>} PTY handle for managing the session
416
+ *
417
+ * @example
418
+ * // Connect to an existing PTY session
419
+ * const handle = await process.connectPty('my-session', {
420
+ * onData: (data) => {
421
+ * // Handle terminal output
422
+ * const text = new TextDecoder().decode(data);
423
+ * process.stdout.write(text);
424
+ * },
425
+ * });
426
+ *
427
+ * // Wait for connection to be established
428
+ * await handle.waitForConnection();
429
+ *
430
+ * // Send commands to the existing session
431
+ * await handle.sendInput('pwd\n');
432
+ * await handle.sendInput('ls -la\n');
433
+ * await handle.sendInput('exit\n');
434
+ *
435
+ * // Wait for completion
436
+ * const result = await handle.wait();
437
+ * console.log(`Session exited with code: ${result.exitCode}`);
438
+ *
439
+ * // Clean up
440
+ * await handle.disconnect();
441
+ */
442
+ async connectPty(sessionId, options) {
443
+ const url = `${this.clientConfig.basePath.replace(/^http/, 'ws')}/process/pty/${sessionId}/connect`;
444
+ const ws = await (0, WebSocket_1.createSandboxWebSocket)(url, this.clientConfig.baseOptions?.headers || {}, this.getPreviewToken);
445
+ const handle = new PtyHandle_1.PtyHandle(ws, (cols, rows) => this.resizePtySession(sessionId, cols, rows), () => this.killPtySession(sessionId), options.onData, sessionId);
446
+ await handle.waitForConnection();
447
+ return handle;
448
+ }
449
+ /**
450
+ * List all PTY sessions in the sandbox.
451
+ *
452
+ * Retrieves information about all PTY sessions, both active and inactive,
453
+ * that have been created in this sandbox.
454
+ *
455
+ * @returns {Promise<PtySessionInfo[]>} Array of PTY session information
456
+ *
457
+ * @example
458
+ * // List all PTY sessions
459
+ * const sessions = await process.listPtySessions();
460
+ *
461
+ * for (const session of sessions) {
462
+ * console.log(`Session ID: ${session.id}`);
463
+ * console.log(`Active: ${session.active}`);
464
+ * console.log(`Created: ${session.createdAt}`);
465
+ * }
466
+ * console.log('---');
467
+ * }
468
+ */
469
+ async listPtySessions() {
470
+ return (await this.apiClient.listPtySessions()).data.sessions;
471
+ }
472
+ /**
473
+ * Get detailed information about a specific PTY session.
474
+ *
475
+ * Retrieves comprehensive information about a PTY session including its current state,
476
+ * configuration, and metadata.
477
+ *
478
+ * @param {string} sessionId - ID of the PTY session to retrieve information for
479
+ * @returns {Promise<PtySessionInfo>} PTY session information
480
+ *
481
+ * @throws {Error} If the PTY session doesn't exist
482
+ *
483
+ * @example
484
+ * // Get details about a specific PTY session
485
+ * const session = await process.getPtySessionInfo('my-session');
486
+ *
487
+ * console.log(`Session ID: ${session.id}`);
488
+ * console.log(`Active: ${session.active}`);
489
+ * console.log(`Working Directory: ${session.cwd}`);
490
+ * console.log(`Terminal Size: ${session.cols}x${session.rows}`);
491
+ *
492
+ * if (session.processId) {
493
+ * console.log(`Process ID: ${session.processId}`);
494
+ * }
495
+ */
496
+ async getPtySessionInfo(sessionId) {
497
+ return (await this.apiClient.getPtySession(sessionId)).data;
498
+ }
499
+ /**
500
+ * Kill a PTY session and terminate its associated process.
501
+ *
502
+ * Forcefully terminates the PTY session and cleans up all associated resources.
503
+ * This will close any active connections and kill the underlying shell process.
504
+ *
505
+ * @param {string} sessionId - ID of the PTY session to kill
506
+ * @returns {Promise<void>}
507
+ *
508
+ * @throws {Error} If the PTY session doesn't exist or cannot be killed
509
+ *
510
+ * @note This operation is irreversible. Any unsaved work in the terminal session will be lost.
511
+ *
512
+ * @example
513
+ * // Kill a specific PTY session
514
+ * await process.killPtySession('my-session');
515
+ *
516
+ * // Verify the session is no longer active
517
+ * try {
518
+ * const info = await process.getPtySessionInfo('my-session');
519
+ * console.log(`Session still exists but active: ${info.active}`);
520
+ * } catch (error) {
521
+ * console.log('Session has been completely removed');
522
+ * }
523
+ */
524
+ async killPtySession(sessionId) {
525
+ await this.apiClient.deletePtySession(sessionId);
526
+ }
527
+ /**
528
+ * Resize a PTY session's terminal dimensions.
529
+ *
530
+ * Changes the terminal size of an active PTY session. This is useful when the
531
+ * client terminal is resized or when you need to adjust the display for different
532
+ * output requirements.
533
+ *
534
+ * @param {string} sessionId - ID of the PTY session to resize
535
+ * @param {number} cols - New number of terminal columns
536
+ * @param {number} rows - New number of terminal rows
537
+ * @returns {Promise<PtySessionInfo>} Updated session information reflecting the new terminal size
538
+ *
539
+ * @throws {Error} If the PTY session doesn't exist or resize operation fails
540
+ *
541
+ * @note The resize operation will send a SIGWINCH signal to the shell process,
542
+ * allowing terminal applications to adapt to the new size.
543
+ *
544
+ * @example
545
+ * // Resize a PTY session to a larger terminal
546
+ * const updatedInfo = await process.resizePtySession('my-session', 150, 40);
547
+ * console.log(`Terminal resized to ${updatedInfo.cols}x${updatedInfo.rows}`);
548
+ *
549
+ * // You can also use the PtyHandle's resize method
550
+ * await ptyHandle.resize(150, 40); // cols, rows
551
+ */
552
+ async resizePtySession(sessionId, cols, rows) {
553
+ return (await this.apiClient.resizePtySession(sessionId, { cols, rows })).data;
554
+ }
555
+ }
556
+ exports.Process = Process;
557
+ tslib_1.__decorate([
558
+ (0, otel_decorator_1.WithInstrumentation)(),
559
+ tslib_1.__metadata("design:type", Function),
560
+ tslib_1.__metadata("design:paramtypes", [String, String, Object, Number]),
561
+ tslib_1.__metadata("design:returntype", Promise)
562
+ ], Process.prototype, "executeCommand", null);
563
+ tslib_1.__decorate([
564
+ (0, otel_decorator_1.WithInstrumentation)(),
565
+ tslib_1.__metadata("design:type", Function),
566
+ tslib_1.__metadata("design:paramtypes", [String, CodeRunParams, Number]),
567
+ tslib_1.__metadata("design:returntype", Promise)
568
+ ], Process.prototype, "codeRun", null);
569
+ tslib_1.__decorate([
570
+ (0, otel_decorator_1.WithInstrumentation)(),
571
+ tslib_1.__metadata("design:type", Function),
572
+ tslib_1.__metadata("design:paramtypes", [String]),
573
+ tslib_1.__metadata("design:returntype", Promise)
574
+ ], Process.prototype, "createSession", null);
575
+ tslib_1.__decorate([
576
+ (0, otel_decorator_1.WithInstrumentation)(),
577
+ tslib_1.__metadata("design:type", Function),
578
+ tslib_1.__metadata("design:paramtypes", [String, String]),
579
+ tslib_1.__metadata("design:returntype", Promise)
580
+ ], Process.prototype, "getSessionCommand", null);
581
+ tslib_1.__decorate([
582
+ (0, otel_decorator_1.WithInstrumentation)(),
583
+ tslib_1.__metadata("design:type", Function),
584
+ tslib_1.__metadata("design:paramtypes", [String, Object, Number]),
585
+ tslib_1.__metadata("design:returntype", Promise)
586
+ ], Process.prototype, "executeSessionCommand", null);
587
+ tslib_1.__decorate([
588
+ (0, otel_decorator_1.WithInstrumentation)(),
589
+ tslib_1.__metadata("design:type", Function),
590
+ tslib_1.__metadata("design:paramtypes", [String, String, Function, Function]),
591
+ tslib_1.__metadata("design:returntype", Promise)
592
+ ], Process.prototype, "getSessionCommandLogs", null);
593
+ tslib_1.__decorate([
594
+ (0, otel_decorator_1.WithInstrumentation)(),
595
+ tslib_1.__metadata("design:type", Function),
596
+ tslib_1.__metadata("design:paramtypes", [Function, Function]),
597
+ tslib_1.__metadata("design:returntype", Promise)
598
+ ], Process.prototype, "getEntrypointLogs", null);
599
+ tslib_1.__decorate([
600
+ (0, otel_decorator_1.WithInstrumentation)(),
601
+ tslib_1.__metadata("design:type", Function),
602
+ tslib_1.__metadata("design:paramtypes", []),
603
+ tslib_1.__metadata("design:returntype", Promise)
604
+ ], Process.prototype, "listSessions", null);
605
+ tslib_1.__decorate([
606
+ (0, otel_decorator_1.WithInstrumentation)(),
607
+ tslib_1.__metadata("design:type", Function),
608
+ tslib_1.__metadata("design:paramtypes", [String]),
609
+ tslib_1.__metadata("design:returntype", Promise)
610
+ ], Process.prototype, "deleteSession", null);
611
+ tslib_1.__decorate([
612
+ (0, otel_decorator_1.WithInstrumentation)(),
613
+ tslib_1.__metadata("design:type", Function),
614
+ tslib_1.__metadata("design:paramtypes", [Object]),
615
+ tslib_1.__metadata("design:returntype", Promise)
616
+ ], Process.prototype, "createPty", null);
617
+ tslib_1.__decorate([
618
+ (0, otel_decorator_1.WithInstrumentation)(),
619
+ tslib_1.__metadata("design:type", Function),
620
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
621
+ tslib_1.__metadata("design:returntype", Promise)
622
+ ], Process.prototype, "connectPty", null);
623
+ tslib_1.__decorate([
624
+ (0, otel_decorator_1.WithInstrumentation)(),
625
+ tslib_1.__metadata("design:type", Function),
626
+ tslib_1.__metadata("design:paramtypes", []),
627
+ tslib_1.__metadata("design:returntype", Promise)
628
+ ], Process.prototype, "listPtySessions", null);
629
+ tslib_1.__decorate([
630
+ (0, otel_decorator_1.WithInstrumentation)(),
631
+ tslib_1.__metadata("design:type", Function),
632
+ tslib_1.__metadata("design:paramtypes", [String]),
633
+ tslib_1.__metadata("design:returntype", Promise)
634
+ ], Process.prototype, "getPtySessionInfo", null);
635
+ tslib_1.__decorate([
636
+ (0, otel_decorator_1.WithInstrumentation)(),
637
+ tslib_1.__metadata("design:type", Function),
638
+ tslib_1.__metadata("design:paramtypes", [String]),
639
+ tslib_1.__metadata("design:returntype", Promise)
640
+ ], Process.prototype, "killPtySession", null);
641
+ tslib_1.__decorate([
642
+ (0, otel_decorator_1.WithInstrumentation)(),
643
+ tslib_1.__metadata("design:type", Function),
644
+ tslib_1.__metadata("design:paramtypes", [String, Number, Number]),
645
+ tslib_1.__metadata("design:returntype", Promise)
646
+ ], Process.prototype, "resizePtySession", null);
647
+ //# sourceMappingURL=Process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Process.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/Process.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAcH,2CAA2C;AAC3C,2CAA+C;AAC/C,2CAAuC;AAEvC,iDAA0D;AAC1D,2DAA4D;AAE5D,6DAA6D;AAChD,QAAA,mBAAmB,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACxD,QAAA,mBAAmB,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACxD,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,2BAAmB,CAAC,MAAM,EAAE,2BAAmB,CAAC,MAAM,CAAC,CAAA;AAE9F;;GAEG;AACH,MAAa,aAAa;IACxB;;OAEG;IACH,IAAI,CAAW;IACf;;OAEG;IACH,GAAG,CAAyB;CAC7B;AATD,sCASC;AAaD;;;;GAIG;AACH,MAAa,OAAO;IAEC;IACA;IACA;IACA;IAJnB,YACmB,YAA2B,EAC3B,S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