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