@daytonaio/sdk 0.128.0-alpha.1 → 0.128.1
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/package.json +8 -20
- package/{cjs → src}/CodeInterpreter.d.ts +0 -1
- package/src/CodeInterpreter.js.map +1 -0
- package/{esm → src}/ComputerUse.d.ts +0 -1
- package/src/ComputerUse.js.map +1 -0
- package/{cjs → src}/Daytona.d.ts +1 -2
- package/{cjs → src}/Daytona.js +8 -6
- package/{cjs → src}/Daytona.js.map +1 -1
- package/{esm → src}/FileSystem.d.ts +0 -1
- package/src/FileSystem.js.map +1 -0
- package/{esm → src}/Git.d.ts +0 -1
- package/src/Git.js.map +1 -0
- package/{cjs → src}/Image.d.ts +0 -21
- package/{cjs → src}/Image.js +91 -123
- package/src/Image.js.map +1 -0
- package/{cjs → src}/LspServer.d.ts +0 -1
- package/src/LspServer.js.map +1 -0
- package/{esm → src}/ObjectStorage.d.ts +0 -1
- package/src/ObjectStorage.js.map +1 -0
- package/{cjs → src}/Process.d.ts +0 -1
- package/src/Process.js.map +1 -0
- package/{cjs → src}/PtyHandle.d.ts +0 -1
- package/src/PtyHandle.js.map +1 -0
- package/{cjs → src}/Sandbox.d.ts +17 -2
- package/{cjs → src}/Sandbox.js +27 -1
- package/src/Sandbox.js.map +1 -0
- package/{cjs → src}/Snapshot.d.ts +0 -2
- package/{cjs → src}/Snapshot.js +1 -9
- package/src/Snapshot.js.map +1 -0
- package/{esm → src}/Volume.d.ts +0 -1
- package/src/Volume.js.map +1 -0
- package/{cjs → src}/code-toolbox/SandboxJsCodeToolbox.d.ts +0 -1
- package/src/code-toolbox/SandboxJsCodeToolbox.js.map +1 -0
- package/{cjs → src}/code-toolbox/SandboxPythonCodeToolbox.d.ts +0 -1
- package/src/code-toolbox/SandboxPythonCodeToolbox.js.map +1 -0
- package/{cjs → src}/code-toolbox/SandboxTsCodeToolbox.d.ts +0 -1
- package/src/code-toolbox/SandboxTsCodeToolbox.js.map +1 -0
- package/{esm → src}/errors/DaytonaError.d.ts +0 -1
- package/src/errors/DaytonaError.js.map +1 -0
- package/{cjs → src}/index.d.ts +0 -1
- package/src/index.js.map +1 -0
- package/{esm → src}/types/Charts.d.ts +0 -1
- package/src/types/Charts.js.map +1 -0
- package/{esm → src}/types/CodeInterpreter.d.ts +0 -1
- package/src/types/CodeInterpreter.js.map +1 -0
- package/{cjs → src}/types/ExecuteResponse.d.ts +0 -1
- package/src/types/ExecuteResponse.js.map +1 -0
- package/{cjs → src}/types/Pty.d.ts +0 -1
- package/src/types/Pty.js.map +1 -0
- package/{cjs → src}/utils/ArtifactParser.d.ts +0 -1
- package/src/utils/ArtifactParser.js.map +1 -0
- package/{esm → src}/utils/Binary.d.ts +0 -1
- package/src/utils/Binary.js.map +1 -0
- package/{cjs → src}/utils/FileTransfer.d.ts +0 -1
- package/src/utils/FileTransfer.js.map +1 -0
- package/{cjs → src}/utils/Import.d.ts +15 -2
- package/src/utils/Import.js +77 -0
- package/src/utils/Import.js.map +1 -0
- package/{esm → src}/utils/Multipart.d.ts +0 -1
- package/src/utils/Multipart.js.map +1 -0
- package/{cjs → src}/utils/Runtime.d.ts +0 -1
- package/src/utils/Runtime.js.map +1 -0
- package/{cjs → src}/utils/Stream.d.ts +0 -1
- package/src/utils/Stream.js.map +1 -0
- package/{esm → src}/utils/WebSocket.d.ts +0 -1
- package/src/utils/WebSocket.js.map +1 -0
- package/LICENSE +0 -190
- package/cjs/CodeInterpreter.d.ts.map +0 -1
- package/cjs/CodeInterpreter.js.map +0 -1
- package/cjs/ComputerUse.d.ts +0 -443
- package/cjs/ComputerUse.d.ts.map +0 -1
- package/cjs/ComputerUse.js.map +0 -1
- package/cjs/Daytona.d.ts.map +0 -1
- package/cjs/FileSystem.d.ts +0 -328
- package/cjs/FileSystem.d.ts.map +0 -1
- package/cjs/FileSystem.js.map +0 -1
- package/cjs/Git.d.ts +0 -203
- package/cjs/Git.d.ts.map +0 -1
- package/cjs/Git.js.map +0 -1
- package/cjs/Image.d.ts.map +0 -1
- package/cjs/Image.js.map +0 -1
- package/cjs/LspServer.d.ts.map +0 -1
- package/cjs/LspServer.js.map +0 -1
- package/cjs/ObjectStorage.d.ts +0 -79
- package/cjs/ObjectStorage.d.ts.map +0 -1
- package/cjs/ObjectStorage.js.map +0 -1
- package/cjs/Process.d.ts.map +0 -1
- package/cjs/Process.js.map +0 -1
- package/cjs/PtyHandle.d.ts.map +0 -1
- package/cjs/PtyHandle.js.map +0 -1
- package/cjs/README.md +0 -147
- package/cjs/Sandbox.d.ts.map +0 -1
- package/cjs/Sandbox.js.map +0 -1
- package/cjs/Snapshot.d.ts.map +0 -1
- package/cjs/Snapshot.js.map +0 -1
- package/cjs/Volume.d.ts +0 -84
- package/cjs/Volume.d.ts.map +0 -1
- package/cjs/Volume.js.map +0 -1
- package/cjs/code-toolbox/SandboxJsCodeToolbox.d.ts.map +0 -1
- package/cjs/code-toolbox/SandboxJsCodeToolbox.js.map +0 -1
- package/cjs/code-toolbox/SandboxPythonCodeToolbox.d.ts.map +0 -1
- package/cjs/code-toolbox/SandboxPythonCodeToolbox.js.map +0 -1
- package/cjs/code-toolbox/SandboxTsCodeToolbox.d.ts.map +0 -1
- package/cjs/code-toolbox/SandboxTsCodeToolbox.js.map +0 -1
- package/cjs/errors/DaytonaError.d.ts +0 -32
- package/cjs/errors/DaytonaError.d.ts.map +0 -1
- package/cjs/errors/DaytonaError.js.map +0 -1
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/package.json +0 -3
- package/cjs/types/Charts.d.ts +0 -152
- package/cjs/types/Charts.d.ts.map +0 -1
- package/cjs/types/Charts.js.map +0 -1
- package/cjs/types/CodeInterpreter.d.ts +0 -77
- package/cjs/types/CodeInterpreter.d.ts.map +0 -1
- package/cjs/types/CodeInterpreter.js.map +0 -1
- package/cjs/types/ExecuteResponse.d.ts.map +0 -1
- package/cjs/types/ExecuteResponse.js.map +0 -1
- package/cjs/types/Pty.d.ts.map +0 -1
- package/cjs/types/Pty.js.map +0 -1
- package/cjs/utils/ArtifactParser.d.ts.map +0 -1
- package/cjs/utils/ArtifactParser.js.map +0 -1
- package/cjs/utils/Binary.d.ts +0 -39
- package/cjs/utils/Binary.d.ts.map +0 -1
- package/cjs/utils/Binary.js.map +0 -1
- package/cjs/utils/FileTransfer.d.ts.map +0 -1
- package/cjs/utils/FileTransfer.js.map +0 -1
- package/cjs/utils/Import.d.ts.map +0 -1
- package/cjs/utils/Import.js +0 -81
- package/cjs/utils/Import.js.map +0 -1
- package/cjs/utils/Multipart.d.ts +0 -27
- package/cjs/utils/Multipart.d.ts.map +0 -1
- package/cjs/utils/Multipart.js.map +0 -1
- package/cjs/utils/Runtime.d.ts.map +0 -1
- package/cjs/utils/Runtime.js.map +0 -1
- package/cjs/utils/Stream.d.ts.map +0 -1
- package/cjs/utils/Stream.js.map +0 -1
- package/cjs/utils/WebSocket.d.ts +0 -10
- package/cjs/utils/WebSocket.d.ts.map +0 -1
- package/cjs/utils/WebSocket.js.map +0 -1
- package/esm/CodeInterpreter.d.ts +0 -96
- package/esm/CodeInterpreter.d.ts.map +0 -1
- package/esm/CodeInterpreter.js +0 -295
- package/esm/CodeInterpreter.js.map +0 -1
- package/esm/ComputerUse.d.ts.map +0 -1
- package/esm/ComputerUse.js +0 -509
- package/esm/ComputerUse.js.map +0 -1
- package/esm/Daytona.d.ts +0 -354
- package/esm/Daytona.d.ts.map +0 -1
- package/esm/Daytona.js +0 -410
- package/esm/Daytona.js.map +0 -1
- package/esm/FileSystem.d.ts.map +0 -1
- package/esm/FileSystem.js +0 -331
- package/esm/FileSystem.js.map +0 -1
- package/esm/Git.d.ts.map +0 -1
- package/esm/Git.js +0 -260
- package/esm/Git.js.map +0 -1
- package/esm/Image.d.ts +0 -285
- package/esm/Image.d.ts.map +0 -1
- package/esm/Image.js +0 -569
- package/esm/Image.js.map +0 -1
- package/esm/LspServer.d.ts +0 -172
- package/esm/LspServer.d.ts.map +0 -1
- package/esm/LspServer.js +0 -204
- package/esm/LspServer.js.map +0 -1
- package/esm/ObjectStorage.d.ts.map +0 -1
- package/esm/ObjectStorage.js +0 -187
- package/esm/ObjectStorage.js.map +0 -1
- package/esm/Process.d.ts +0 -442
- package/esm/Process.d.ts.map +0 -1
- package/esm/Process.js +0 -644
- package/esm/Process.js.map +0 -1
- package/esm/PtyHandle.d.ts +0 -155
- package/esm/PtyHandle.d.ts.map +0 -1
- package/esm/PtyHandle.js +0 -374
- package/esm/PtyHandle.js.map +0 -1
- package/esm/README.md +0 -147
- package/esm/Sandbox.d.ts +0 -359
- package/esm/Sandbox.d.ts.map +0 -1
- package/esm/Sandbox.js +0 -532
- package/esm/Sandbox.js.map +0 -1
- package/esm/Snapshot.d.ts +0 -138
- package/esm/Snapshot.d.ts.map +0 -1
- package/esm/Snapshot.js +0 -207
- package/esm/Snapshot.js.map +0 -1
- package/esm/Volume.d.ts.map +0 -1
- package/esm/Volume.js +0 -95
- package/esm/Volume.js.map +0 -1
- package/esm/code-toolbox/SandboxJsCodeToolbox.d.ts +0 -6
- package/esm/code-toolbox/SandboxJsCodeToolbox.d.ts.map +0 -1
- package/esm/code-toolbox/SandboxJsCodeToolbox.js +0 -13
- package/esm/code-toolbox/SandboxJsCodeToolbox.js.map +0 -1
- package/esm/code-toolbox/SandboxPythonCodeToolbox.d.ts +0 -12
- package/esm/code-toolbox/SandboxPythonCodeToolbox.d.ts.map +0 -1
- package/esm/code-toolbox/SandboxPythonCodeToolbox.js +0 -355
- package/esm/code-toolbox/SandboxPythonCodeToolbox.js.map +0 -1
- package/esm/code-toolbox/SandboxTsCodeToolbox.d.ts +0 -6
- package/esm/code-toolbox/SandboxTsCodeToolbox.d.ts.map +0 -1
- package/esm/code-toolbox/SandboxTsCodeToolbox.js +0 -14
- package/esm/code-toolbox/SandboxTsCodeToolbox.js.map +0 -1
- package/esm/errors/DaytonaError.d.ts.map +0 -1
- package/esm/errors/DaytonaError.js +0 -44
- package/esm/errors/DaytonaError.js.map +0 -1
- package/esm/index.d.ts +0 -22
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/package.json +0 -3
- package/esm/types/Charts.d.ts.map +0 -1
- package/esm/types/Charts.js +0 -42
- package/esm/types/Charts.js.map +0 -1
- package/esm/types/CodeInterpreter.d.ts.map +0 -1
- package/esm/types/CodeInterpreter.js +0 -6
- package/esm/types/CodeInterpreter.js.map +0 -1
- package/esm/types/ExecuteResponse.d.ts +0 -26
- package/esm/types/ExecuteResponse.d.ts.map +0 -1
- package/esm/types/ExecuteResponse.js +0 -6
- package/esm/types/ExecuteResponse.js.map +0 -1
- package/esm/types/Pty.d.ts +0 -48
- package/esm/types/Pty.d.ts.map +0 -1
- package/esm/types/Pty.js +0 -6
- package/esm/types/Pty.js.map +0 -1
- package/esm/utils/ArtifactParser.d.ts +0 -14
- package/esm/utils/ArtifactParser.d.ts.map +0 -1
- package/esm/utils/ArtifactParser.js +0 -51
- package/esm/utils/ArtifactParser.js.map +0 -1
- package/esm/utils/Binary.d.ts.map +0 -1
- package/esm/utils/Binary.js +0 -157
- package/esm/utils/Binary.js.map +0 -1
- package/esm/utils/FileTransfer.d.ts +0 -15
- package/esm/utils/FileTransfer.d.ts.map +0 -1
- package/esm/utils/FileTransfer.js +0 -209
- package/esm/utils/FileTransfer.js.map +0 -1
- package/esm/utils/Import.d.ts +0 -211
- package/esm/utils/Import.d.ts.map +0 -1
- package/esm/utils/Import.js +0 -45
- package/esm/utils/Import.js.map +0 -1
- package/esm/utils/Multipart.d.ts.map +0 -1
- package/esm/utils/Multipart.js +0 -107
- package/esm/utils/Multipart.js.map +0 -1
- package/esm/utils/Runtime.d.ts +0 -37
- package/esm/utils/Runtime.d.ts.map +0 -1
- package/esm/utils/Runtime.js +0 -57
- package/esm/utils/Runtime.js.map +0 -1
- package/esm/utils/Stream.d.ts +0 -20
- package/esm/utils/Stream.d.ts.map +0 -1
- package/esm/utils/Stream.js +0 -360
- package/esm/utils/Stream.js.map +0 -1
- package/esm/utils/WebSocket.d.ts.map +0 -1
- package/esm/utils/WebSocket.js +0 -22
- package/esm/utils/WebSocket.js.map +0 -1
- /package/{cjs → src}/CodeInterpreter.js +0 -0
- /package/{cjs → src}/ComputerUse.js +0 -0
- /package/{cjs → src}/FileSystem.js +0 -0
- /package/{cjs → src}/Git.js +0 -0
- /package/{cjs → src}/LspServer.js +0 -0
- /package/{cjs → src}/ObjectStorage.js +0 -0
- /package/{cjs → src}/Process.js +0 -0
- /package/{cjs → src}/PtyHandle.js +0 -0
- /package/{cjs → src}/Volume.js +0 -0
- /package/{cjs → src}/code-toolbox/SandboxJsCodeToolbox.js +0 -0
- /package/{cjs → src}/code-toolbox/SandboxPythonCodeToolbox.js +0 -0
- /package/{cjs → src}/code-toolbox/SandboxTsCodeToolbox.js +0 -0
- /package/{cjs → src}/errors/DaytonaError.js +0 -0
- /package/{cjs → src}/index.js +0 -0
- /package/{cjs → src}/types/Charts.js +0 -0
- /package/{cjs → src}/types/CodeInterpreter.js +0 -0
- /package/{cjs → src}/types/ExecuteResponse.js +0 -0
- /package/{cjs → src}/types/Pty.js +0 -0
- /package/{cjs → src}/utils/ArtifactParser.js +0 -0
- /package/{cjs → src}/utils/Binary.js +0 -0
- /package/{cjs → src}/utils/FileTransfer.js +0 -0
- /package/{cjs → src}/utils/Multipart.js +0 -0
- /package/{cjs → src}/utils/Runtime.js +0 -0
- /package/{cjs → src}/utils/Stream.js +0 -0
- /package/{cjs → src}/utils/WebSocket.js +0 -0
package/esm/CodeInterpreter.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { InterpreterApi, InterpreterContext } from '@daytonaio/toolbox-api-client';
|
|
2
|
-
import { Configuration } from '@daytonaio/api-client';
|
|
3
|
-
import { ExecutionResult, RunCodeOptions } from './types/CodeInterpreter.js';
|
|
4
|
-
/**
|
|
5
|
-
* Handles Python code interpretation and execution within a Sandbox.
|
|
6
|
-
*
|
|
7
|
-
* Provides methods to execute code (currently only Python) in isolated interpreter contexts,
|
|
8
|
-
* manage contexts, and stream execution output via callbacks.
|
|
9
|
-
*
|
|
10
|
-
* For other languages, use the `codeRun` method from the `Process` interface, or execute the appropriate command directly in the sandbox terminal.
|
|
11
|
-
*/
|
|
12
|
-
export declare class CodeInterpreter {
|
|
13
|
-
private readonly clientConfig;
|
|
14
|
-
private readonly apiClient;
|
|
15
|
-
private readonly getPreviewToken;
|
|
16
|
-
private readonly ensureToolboxUrl;
|
|
17
|
-
constructor(clientConfig: Configuration, apiClient: InterpreterApi, getPreviewToken: () => Promise<string>, ensureToolboxUrl: () => Promise<void>);
|
|
18
|
-
/**
|
|
19
|
-
* Run Python code in the sandbox.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} code - Code to run.
|
|
22
|
-
* @param {RunCodeOptions} options - Execution options (context, envs, callbacks, timeout).
|
|
23
|
-
* @returns {Promise<ExecutionResult>} ExecutionResult containing stdout, stderr and optional error info.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* const handleStdout = (msg: OutputMessage) => process.stdout.write(`STDOUT: ${msg.output}`)
|
|
28
|
-
* const handleStderr = (msg: OutputMessage) => process.stdout.write(`STDERR: ${msg.output}`)
|
|
29
|
-
* const handleError = (err: ExecutionError) =>
|
|
30
|
-
* console.error(`ERROR: ${err.name}: ${err.value}\n${err.traceback ?? ''}`)
|
|
31
|
-
*
|
|
32
|
-
* const code = `
|
|
33
|
-
* import sys
|
|
34
|
-
* import time
|
|
35
|
-
* for i in range(5):
|
|
36
|
-
* print(i)
|
|
37
|
-
* time.sleep(1)
|
|
38
|
-
* sys.stderr.write("Counting done!")
|
|
39
|
-
* `
|
|
40
|
-
*
|
|
41
|
-
* const result = await codeInterpreter.runCode(code, {
|
|
42
|
-
* onStdout: handleStdout,
|
|
43
|
-
* onStderr: handleStderr,
|
|
44
|
-
* onError: handleError,
|
|
45
|
-
* timeout: 10,
|
|
46
|
-
* })
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
runCode(code: string, options?: RunCodeOptions): Promise<ExecutionResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Create a new isolated interpreter context.
|
|
52
|
-
*
|
|
53
|
-
* @param {string} [cwd] - Working directory for the context. Uses sandbox working directory if omitted.
|
|
54
|
-
*
|
|
55
|
-
* @returns {Promise<InterpreterContext>} The created context.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* const ctx = await sandbox.codeInterpreter.createContext()
|
|
60
|
-
* await sandbox.codeInterpreter.runCode('x = 10', { context: ctx })
|
|
61
|
-
* await sandbox.codeInterpreter.deleteContext(ctx.id!)
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
createContext(cwd?: string): Promise<InterpreterContext>;
|
|
65
|
-
/**
|
|
66
|
-
* List all user-created interpreter contexts (default context is excluded).
|
|
67
|
-
*
|
|
68
|
-
* @returns {Promise<InterpreterContext[]>} List of contexts.
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```ts
|
|
72
|
-
* const contexts = await sandbox.codeInterpreter.listContexts()
|
|
73
|
-
* for (const ctx of contexts) {
|
|
74
|
-
* console.log(ctx.id, ctx.language, ctx.cwd)
|
|
75
|
-
* }
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
listContexts(): Promise<InterpreterContext[]>;
|
|
79
|
-
/**
|
|
80
|
-
* Delete an interpreter context and shut down its worker process.
|
|
81
|
-
*
|
|
82
|
-
* @param {InterpreterContext} context - Context to delete.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```ts
|
|
86
|
-
* const ctx = await sandbox.codeInterpreter.createContext()
|
|
87
|
-
* // ... use context ...
|
|
88
|
-
* await sandbox.codeInterpreter.deleteContext(ctx)
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
deleteContext(context: InterpreterContext): Promise<void>;
|
|
92
|
-
private extractMessageText;
|
|
93
|
-
private normalizeCloseEvent;
|
|
94
|
-
private createCloseError;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=CodeInterpreter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInterpreter.d.ts","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/CodeInterpreter.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAkB,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAUzF;;;;;;;GAOG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAHhB,YAAY,EAAE,aAAa,EAC3B,SAAS,EAAE,cAAc,EACzB,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACtC,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;IAuJ1F;;;;;;;;;;;;;OAaG;IACU,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIrE;;;;;;;;;;;;OAYG;IACU,YAAY,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAI1D;;;;;;;;;;;OAWG;IACU,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;YAIxD,kBAAkB;IAyBhC,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,gBAAgB;CAWzB"}
|
package/esm/CodeInterpreter.js
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Daytona Platforms Inc.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module code-interpreter
|
|
7
|
-
*/
|
|
8
|
-
import WebSocket from 'isomorphic-ws';
|
|
9
|
-
import { DaytonaError, DaytonaTimeoutError } from './errors/DaytonaError.js';
|
|
10
|
-
import { createSandboxWebSocket } from './utils/WebSocket.js';
|
|
11
|
-
const WEBSOCKET_TIMEOUT_CODE = 4008;
|
|
12
|
-
/**
|
|
13
|
-
* Handles Python code interpretation and execution within a Sandbox.
|
|
14
|
-
*
|
|
15
|
-
* Provides methods to execute code (currently only Python) in isolated interpreter contexts,
|
|
16
|
-
* manage contexts, and stream execution output via callbacks.
|
|
17
|
-
*
|
|
18
|
-
* For other languages, use the `codeRun` method from the `Process` interface, or execute the appropriate command directly in the sandbox terminal.
|
|
19
|
-
*/
|
|
20
|
-
export class CodeInterpreter {
|
|
21
|
-
clientConfig;
|
|
22
|
-
apiClient;
|
|
23
|
-
getPreviewToken;
|
|
24
|
-
ensureToolboxUrl;
|
|
25
|
-
constructor(clientConfig, apiClient, getPreviewToken, ensureToolboxUrl) {
|
|
26
|
-
this.clientConfig = clientConfig;
|
|
27
|
-
this.apiClient = apiClient;
|
|
28
|
-
this.getPreviewToken = getPreviewToken;
|
|
29
|
-
this.ensureToolboxUrl = ensureToolboxUrl;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Run Python code in the sandbox.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} code - Code to run.
|
|
35
|
-
* @param {RunCodeOptions} options - Execution options (context, envs, callbacks, timeout).
|
|
36
|
-
* @returns {Promise<ExecutionResult>} ExecutionResult containing stdout, stderr and optional error info.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const handleStdout = (msg: OutputMessage) => process.stdout.write(`STDOUT: ${msg.output}`)
|
|
41
|
-
* const handleStderr = (msg: OutputMessage) => process.stdout.write(`STDERR: ${msg.output}`)
|
|
42
|
-
* const handleError = (err: ExecutionError) =>
|
|
43
|
-
* console.error(`ERROR: ${err.name}: ${err.value}\n${err.traceback ?? ''}`)
|
|
44
|
-
*
|
|
45
|
-
* const code = `
|
|
46
|
-
* import sys
|
|
47
|
-
* import time
|
|
48
|
-
* for i in range(5):
|
|
49
|
-
* print(i)
|
|
50
|
-
* time.sleep(1)
|
|
51
|
-
* sys.stderr.write("Counting done!")
|
|
52
|
-
* `
|
|
53
|
-
*
|
|
54
|
-
* const result = await codeInterpreter.runCode(code, {
|
|
55
|
-
* onStdout: handleStdout,
|
|
56
|
-
* onStderr: handleStderr,
|
|
57
|
-
* onError: handleError,
|
|
58
|
-
* timeout: 10,
|
|
59
|
-
* })
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
async runCode(code, options = {}) {
|
|
63
|
-
if (!code || !code.trim()) {
|
|
64
|
-
throw new DaytonaError('Code is required for execution');
|
|
65
|
-
}
|
|
66
|
-
await this.ensureToolboxUrl();
|
|
67
|
-
const url = `${this.clientConfig.basePath.replace(/^http/, 'ws')}/process/interpreter/execute`;
|
|
68
|
-
const ws = await createSandboxWebSocket(url, this.clientConfig.baseOptions?.headers || {}, this.getPreviewToken);
|
|
69
|
-
const result = { stdout: '', stderr: '' };
|
|
70
|
-
return new Promise((resolve, reject) => {
|
|
71
|
-
let settled = false;
|
|
72
|
-
const cleanup = () => {
|
|
73
|
-
detach();
|
|
74
|
-
try {
|
|
75
|
-
if (ws.readyState === WebSocket.OPEN || ws.readyState === WebSocket.CONNECTING) {
|
|
76
|
-
ws.close();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
/* ignore */
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const fail = (error) => {
|
|
84
|
-
if (settled)
|
|
85
|
-
return;
|
|
86
|
-
settled = true;
|
|
87
|
-
cleanup();
|
|
88
|
-
reject(error);
|
|
89
|
-
};
|
|
90
|
-
const succeed = () => {
|
|
91
|
-
if (settled)
|
|
92
|
-
return;
|
|
93
|
-
settled = true;
|
|
94
|
-
cleanup();
|
|
95
|
-
resolve(result);
|
|
96
|
-
};
|
|
97
|
-
const handleOpen = () => {
|
|
98
|
-
const payload = { code };
|
|
99
|
-
const context = options.context;
|
|
100
|
-
if (context?.id) {
|
|
101
|
-
payload.contextId = context.id;
|
|
102
|
-
}
|
|
103
|
-
if (options.envs) {
|
|
104
|
-
payload.envs = options.envs;
|
|
105
|
-
}
|
|
106
|
-
payload.timeout = options.timeout;
|
|
107
|
-
ws.send(JSON.stringify(payload));
|
|
108
|
-
};
|
|
109
|
-
const handleMessage = async (event) => {
|
|
110
|
-
try {
|
|
111
|
-
const text = await this.extractMessageText(event);
|
|
112
|
-
if (!text) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const chunk = JSON.parse(text);
|
|
116
|
-
const chunkType = chunk.type;
|
|
117
|
-
if (chunkType === 'stdout') {
|
|
118
|
-
const stdout = chunk.text ?? '';
|
|
119
|
-
result.stdout += stdout;
|
|
120
|
-
if (options.onStdout) {
|
|
121
|
-
await options.onStdout({ output: stdout });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else if (chunkType === 'stderr') {
|
|
125
|
-
const stderr = chunk.text ?? '';
|
|
126
|
-
result.stderr += stderr;
|
|
127
|
-
if (options.onStderr) {
|
|
128
|
-
await options.onStderr({ output: stderr });
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
else if (chunkType === 'error') {
|
|
132
|
-
const error = {
|
|
133
|
-
name: chunk.name ?? '',
|
|
134
|
-
value: chunk.value ?? '',
|
|
135
|
-
traceback: chunk.traceback ?? '',
|
|
136
|
-
};
|
|
137
|
-
result.error = error;
|
|
138
|
-
if (options.onError) {
|
|
139
|
-
await options.onError(error);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else if (chunkType === 'control') {
|
|
143
|
-
const controlText = chunk.text ?? '';
|
|
144
|
-
if (controlText === 'completed' || controlText === 'interrupted') {
|
|
145
|
-
succeed();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
// Ignore invalid JSON payloads
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const handleClose = (event, reason) => {
|
|
154
|
-
if (settled)
|
|
155
|
-
return;
|
|
156
|
-
const { code, message } = this.normalizeCloseEvent(event, reason);
|
|
157
|
-
if (code !== 1000 && code !== 1001) {
|
|
158
|
-
fail(this.createCloseError(code, message));
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
succeed();
|
|
162
|
-
};
|
|
163
|
-
const handleError = (error) => {
|
|
164
|
-
fail(new DaytonaError(`Failed to execute code: ${error.message ?? String(error)}`));
|
|
165
|
-
};
|
|
166
|
-
const detach = () => {
|
|
167
|
-
if ('removeEventListener' in ws) {
|
|
168
|
-
ws.removeEventListener('open', handleOpen);
|
|
169
|
-
ws.removeEventListener('message', handleMessage);
|
|
170
|
-
ws.removeEventListener('close', handleClose);
|
|
171
|
-
ws.removeEventListener('error', handleError);
|
|
172
|
-
}
|
|
173
|
-
if ('off' in ws) {
|
|
174
|
-
;
|
|
175
|
-
ws.off('open', handleOpen);
|
|
176
|
-
ws.off('message', handleMessage);
|
|
177
|
-
ws.off('close', handleClose);
|
|
178
|
-
ws.off('error', handleError);
|
|
179
|
-
}
|
|
180
|
-
else if ('removeListener' in ws) {
|
|
181
|
-
;
|
|
182
|
-
ws.removeListener('open', handleOpen);
|
|
183
|
-
ws.removeListener('message', handleMessage);
|
|
184
|
-
ws.removeListener('close', handleClose);
|
|
185
|
-
ws.removeListener('error', handleError);
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
if ('addEventListener' in ws) {
|
|
189
|
-
ws.addEventListener('open', handleOpen);
|
|
190
|
-
ws.addEventListener('message', handleMessage);
|
|
191
|
-
ws.addEventListener('close', handleClose);
|
|
192
|
-
ws.addEventListener('error', handleError);
|
|
193
|
-
}
|
|
194
|
-
else if ('on' in ws) {
|
|
195
|
-
;
|
|
196
|
-
ws.on('open', handleOpen);
|
|
197
|
-
ws.on('message', handleMessage);
|
|
198
|
-
ws.on('close', handleClose);
|
|
199
|
-
ws.on('error', handleError);
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
throw new DaytonaError('Unsupported WebSocket implementation');
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Create a new isolated interpreter context.
|
|
208
|
-
*
|
|
209
|
-
* @param {string} [cwd] - Working directory for the context. Uses sandbox working directory if omitted.
|
|
210
|
-
*
|
|
211
|
-
* @returns {Promise<InterpreterContext>} The created context.
|
|
212
|
-
*
|
|
213
|
-
* @example
|
|
214
|
-
* ```ts
|
|
215
|
-
* const ctx = await sandbox.codeInterpreter.createContext()
|
|
216
|
-
* await sandbox.codeInterpreter.runCode('x = 10', { context: ctx })
|
|
217
|
-
* await sandbox.codeInterpreter.deleteContext(ctx.id!)
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
async createContext(cwd) {
|
|
221
|
-
return (await this.apiClient.createInterpreterContext({ cwd })).data;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* List all user-created interpreter contexts (default context is excluded).
|
|
225
|
-
*
|
|
226
|
-
* @returns {Promise<InterpreterContext[]>} List of contexts.
|
|
227
|
-
*
|
|
228
|
-
* @example
|
|
229
|
-
* ```ts
|
|
230
|
-
* const contexts = await sandbox.codeInterpreter.listContexts()
|
|
231
|
-
* for (const ctx of contexts) {
|
|
232
|
-
* console.log(ctx.id, ctx.language, ctx.cwd)
|
|
233
|
-
* }
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
async listContexts() {
|
|
237
|
-
return (await this.apiClient.listInterpreterContexts()).data.contexts ?? [];
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Delete an interpreter context and shut down its worker process.
|
|
241
|
-
*
|
|
242
|
-
* @param {InterpreterContext} context - Context to delete.
|
|
243
|
-
*
|
|
244
|
-
* @example
|
|
245
|
-
* ```ts
|
|
246
|
-
* const ctx = await sandbox.codeInterpreter.createContext()
|
|
247
|
-
* // ... use context ...
|
|
248
|
-
* await sandbox.codeInterpreter.deleteContext(ctx)
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
async deleteContext(context) {
|
|
252
|
-
await this.apiClient.deleteInterpreterContext(context.id);
|
|
253
|
-
}
|
|
254
|
-
async extractMessageText(event) {
|
|
255
|
-
const data = event && typeof event === 'object' && 'data' in event ? event.data : event;
|
|
256
|
-
if (typeof data === 'string') {
|
|
257
|
-
return data;
|
|
258
|
-
}
|
|
259
|
-
if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
|
|
260
|
-
return new TextDecoder('utf-8').decode(new Uint8Array(data));
|
|
261
|
-
}
|
|
262
|
-
if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
|
263
|
-
return await data.text();
|
|
264
|
-
}
|
|
265
|
-
if (ArrayBuffer.isView(data)) {
|
|
266
|
-
return new TextDecoder('utf-8').decode(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
|
|
267
|
-
}
|
|
268
|
-
if (data == null) {
|
|
269
|
-
return '';
|
|
270
|
-
}
|
|
271
|
-
return data.toString();
|
|
272
|
-
}
|
|
273
|
-
normalizeCloseEvent(event, reason) {
|
|
274
|
-
if (typeof event === 'number') {
|
|
275
|
-
return {
|
|
276
|
-
code: event,
|
|
277
|
-
message: reason ? reason.toString('utf-8') : '',
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
return {
|
|
281
|
-
code: event.code,
|
|
282
|
-
message: event.reason,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
createCloseError(code, message) {
|
|
286
|
-
if (code === WEBSOCKET_TIMEOUT_CODE) {
|
|
287
|
-
return new DaytonaTimeoutError('Execution timed out: operation exceeded the configured `timeout`. Provide a larger value if needed.');
|
|
288
|
-
}
|
|
289
|
-
if (message) {
|
|
290
|
-
return new DaytonaError(message + ` (close code ${code})`);
|
|
291
|
-
}
|
|
292
|
-
return new DaytonaError(`Code execution failed: WebSocket closed with code ${code}`);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
//# sourceMappingURL=CodeInterpreter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInterpreter.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/CodeInterpreter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,SAAS,MAAM,eAAe,CAAA;AAGrC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAEzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAO1D,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAEnC;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAEP;IACA;IACA;IACA;IAJnB,YACmB,YAA2B,EAC3B,SAAyB,EACzB,eAAsC,EACtC,gBAAqC;QAHrC,iBAAY,GAAZ,YAAY,CAAe;QAC3B,cAAS,GAAT,SAAS,CAAgB;QACzB,oBAAe,GAAf,eAAe,CAAuB;QACtC,qBAAgB,GAAhB,gBAAgB,CAAqB;IACrD,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACI,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,UAA0B,EAAE;QAC7D,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,YAAY,CAAC,gCAAgC,CAAC,CAAA;QAC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A;QACH,CAAC;QAED,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,MAAM;SACtB,CAAA;IACH,CAAC;IAEO,gBAAgB,CAAC,IAAY,EAAE,OAAgB;QACrD,IAAI,IAAI,KAAK,sBAAsB,EAAE,CAAC;YACpC,OAAO,IAAI,mBAAmB,CAC5B,qGAAqG,CACtG,CAAA;QACH,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,IAAI,YAAY,CAAC,OAAO,GAAG,gBAAgB,IAAI,GAAG,CAAC,CAAA;QAC5D,CAAC;QACD,OAAO,IAAI,YAAY,CAAC,qDAAqD,IAAI,EAAE,CAAC,CAAA;IACtF,CAAC;CACF"}
|
package/esm/ComputerUse.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComputerUse.d.ts","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/ComputerUse.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,qBAAqB,EAGrB,kBAAkB,EAElB,iBAAiB,EAKjB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,+BAA+B,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,KAAK;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