@daytonaio/sdk 0.128.0-alpha.1 → 0.128.0
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 +0 -1
- package/{cjs → src}/Daytona.js +0 -1
- package/src/Daytona.js.map +1 -0
- 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/Daytona.js.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/Sandbox.d.ts
DELETED
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import { SandboxState, SandboxApi, Sandbox as SandboxDto, PaginatedSandboxes as PaginatedSandboxesDto, PortPreviewUrl, SandboxVolume, BuildInfo, SandboxBackupStateEnum, Configuration, SshAccessDto, SshAccessValidationDto } from '@daytonaio/api-client';
|
|
2
|
-
import { FileSystem } from './FileSystem.js';
|
|
3
|
-
import { Git } from './Git.js';
|
|
4
|
-
import { CodeRunParams, Process } from './Process.js';
|
|
5
|
-
import { LspLanguageId, LspServer } from './LspServer.js';
|
|
6
|
-
import { ComputerUse } from './ComputerUse.js';
|
|
7
|
-
import { AxiosInstance } from 'axios';
|
|
8
|
-
import { CodeInterpreter } from './CodeInterpreter.js';
|
|
9
|
-
/**
|
|
10
|
-
* Interface defining methods that a code toolbox must implement
|
|
11
|
-
* @interface
|
|
12
|
-
*/
|
|
13
|
-
export interface SandboxCodeToolbox {
|
|
14
|
-
/** Generates a command to run the provided code */
|
|
15
|
-
getRunCommand(code: string, params?: CodeRunParams): string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Represents a Daytona Sandbox.
|
|
19
|
-
*
|
|
20
|
-
* @property {FileSystem} fs - File system operations interface
|
|
21
|
-
* @property {Git} git - Git operations interface
|
|
22
|
-
* @property {Process} process - Process execution interface
|
|
23
|
-
* @property {CodeInterpreter} codeInterpreter - Stateful interpreter interface for executing code.
|
|
24
|
-
* Currently supports only Python. For other languages, use the `process.codeRun` method.
|
|
25
|
-
* @property {ComputerUse} computerUse - Computer use operations interface for desktop automation
|
|
26
|
-
* @property {string} id - Unique identifier for the Sandbox
|
|
27
|
-
* @property {string} organizationId - Organization ID of the Sandbox
|
|
28
|
-
* @property {string} [snapshot] - Daytona snapshot used to create the Sandbox
|
|
29
|
-
* @property {string} user - OS user running in the Sandbox
|
|
30
|
-
* @property {Record<string, string>} env - Environment variables set in the Sandbox
|
|
31
|
-
* @property {Record<string, string>} labels - Custom labels attached to the Sandbox
|
|
32
|
-
* @property {boolean} public - Whether the Sandbox is publicly accessible
|
|
33
|
-
* @property {string} target - Target location of the runner where the Sandbox runs
|
|
34
|
-
* @property {number} cpu - Number of CPUs allocated to the Sandbox
|
|
35
|
-
* @property {number} gpu - Number of GPUs allocated to the Sandbox
|
|
36
|
-
* @property {number} memory - Amount of memory allocated to the Sandbox in GiB
|
|
37
|
-
* @property {number} disk - Amount of disk space allocated to the Sandbox in GiB
|
|
38
|
-
* @property {SandboxState} state - Current state of the Sandbox (e.g., "started", "stopped")
|
|
39
|
-
* @property {string} [errorReason] - Error message if Sandbox is in error state
|
|
40
|
-
* @property {SandboxBackupStateEnum} [backupState] - Current state of Sandbox backup
|
|
41
|
-
* @property {string} [backupCreatedAt] - When the backup was created
|
|
42
|
-
* @property {number} [autoStopInterval] - Auto-stop interval in minutes
|
|
43
|
-
* @property {number} [autoArchiveInterval] - Auto-archive interval in minutes
|
|
44
|
-
* @property {number} [autoDeleteInterval] - Auto-delete interval in minutes
|
|
45
|
-
* @property {Array<SandboxVolume>} [volumes] - Volumes attached to the Sandbox
|
|
46
|
-
* @property {BuildInfo} [buildInfo] - Build information for the Sandbox if it was created from dynamic build
|
|
47
|
-
* @property {string} [createdAt] - When the Sandbox was created
|
|
48
|
-
* @property {string} [updatedAt] - When the Sandbox was last updated
|
|
49
|
-
* @property {boolean} networkBlockAll - Whether to block all network access for the Sandbox
|
|
50
|
-
* @property {string} [networkAllowList] - Comma-separated list of allowed CIDR network addresses for the Sandbox
|
|
51
|
-
*
|
|
52
|
-
* @class
|
|
53
|
-
*/
|
|
54
|
-
export declare class Sandbox implements SandboxDto {
|
|
55
|
-
private readonly clientConfig;
|
|
56
|
-
private readonly axiosInstance;
|
|
57
|
-
private readonly sandboxApi;
|
|
58
|
-
private readonly codeToolbox;
|
|
59
|
-
private readonly getToolboxBaseUrl;
|
|
60
|
-
readonly fs: FileSystem;
|
|
61
|
-
readonly git: Git;
|
|
62
|
-
readonly process: Process;
|
|
63
|
-
readonly computerUse: ComputerUse;
|
|
64
|
-
readonly codeInterpreter: CodeInterpreter;
|
|
65
|
-
id: string;
|
|
66
|
-
name: string;
|
|
67
|
-
organizationId: string;
|
|
68
|
-
snapshot?: string;
|
|
69
|
-
user: string;
|
|
70
|
-
env: Record<string, string>;
|
|
71
|
-
labels: Record<string, string>;
|
|
72
|
-
public: boolean;
|
|
73
|
-
target: string;
|
|
74
|
-
cpu: number;
|
|
75
|
-
gpu: number;
|
|
76
|
-
memory: number;
|
|
77
|
-
disk: number;
|
|
78
|
-
state?: SandboxState;
|
|
79
|
-
errorReason?: string;
|
|
80
|
-
backupState?: SandboxBackupStateEnum;
|
|
81
|
-
backupCreatedAt?: string;
|
|
82
|
-
autoStopInterval?: number;
|
|
83
|
-
autoArchiveInterval?: number;
|
|
84
|
-
autoDeleteInterval?: number;
|
|
85
|
-
volumes?: Array<SandboxVolume>;
|
|
86
|
-
buildInfo?: BuildInfo;
|
|
87
|
-
createdAt?: string;
|
|
88
|
-
updatedAt?: string;
|
|
89
|
-
networkBlockAll: boolean;
|
|
90
|
-
networkAllowList?: string;
|
|
91
|
-
private infoApi;
|
|
92
|
-
/**
|
|
93
|
-
* Creates a new Sandbox instance
|
|
94
|
-
*
|
|
95
|
-
* @param {SandboxDto} sandboxDto - The API Sandbox instance
|
|
96
|
-
* @param {SandboxApi} sandboxApi - API client for Sandbox operations
|
|
97
|
-
* @param {InfoApi} infoApi - API client for info operations
|
|
98
|
-
* @param {SandboxCodeToolbox} codeToolbox - Language-specific toolbox implementation
|
|
99
|
-
*/
|
|
100
|
-
constructor(sandboxDto: SandboxDto, clientConfig: Configuration, axiosInstance: AxiosInstance, sandboxApi: SandboxApi, codeToolbox: SandboxCodeToolbox, getToolboxBaseUrl: () => Promise<string>);
|
|
101
|
-
/**
|
|
102
|
-
* Gets the user's home directory path for the logged in user inside the Sandbox.
|
|
103
|
-
*
|
|
104
|
-
* @returns {Promise<string | undefined>} The absolute path to the Sandbox user's home directory for the logged in user
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* const userHomeDir = await sandbox.getUserHomeDir();
|
|
108
|
-
* console.log(`Sandbox user home: ${userHomeDir}`);
|
|
109
|
-
*/
|
|
110
|
-
getUserHomeDir(): Promise<string | undefined>;
|
|
111
|
-
/**
|
|
112
|
-
* @deprecated Use `getUserHomeDir` instead. This method will be removed in a future version.
|
|
113
|
-
*/
|
|
114
|
-
getUserRootDir(): Promise<string | undefined>;
|
|
115
|
-
/**
|
|
116
|
-
* Gets the working directory path inside the Sandbox.
|
|
117
|
-
*
|
|
118
|
-
* @returns {Promise<string | undefined>} The absolute path to the Sandbox working directory. Uses the WORKDIR specified
|
|
119
|
-
* in the Dockerfile if present, or falling back to the user's home directory if not.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* const workDir = await sandbox.getWorkDir();
|
|
123
|
-
* console.log(`Sandbox working directory: ${workDir}`);
|
|
124
|
-
*/
|
|
125
|
-
getWorkDir(): Promise<string | undefined>;
|
|
126
|
-
/**
|
|
127
|
-
* Creates a new Language Server Protocol (LSP) server instance.
|
|
128
|
-
*
|
|
129
|
-
* The LSP server provides language-specific features like code completion,
|
|
130
|
-
* diagnostics, and more.
|
|
131
|
-
*
|
|
132
|
-
* @param {LspLanguageId} languageId - The language server type (e.g., "typescript")
|
|
133
|
-
* @param {string} pathToProject - Path to the project root directory. Relative paths are resolved based on the sandbox working directory.
|
|
134
|
-
* @returns {LspServer} A new LSP server instance configured for the specified language
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* const lsp = await sandbox.createLspServer('typescript', 'workspace/project');
|
|
138
|
-
*/
|
|
139
|
-
createLspServer(languageId: LspLanguageId | string, pathToProject: string): Promise<LspServer>;
|
|
140
|
-
/**
|
|
141
|
-
* Sets labels for the Sandbox.
|
|
142
|
-
*
|
|
143
|
-
* Labels are key-value pairs that can be used to organize and identify Sandboxes.
|
|
144
|
-
*
|
|
145
|
-
* @param {Record<string, string>} labels - Dictionary of key-value pairs representing Sandbox labels
|
|
146
|
-
* @returns {Promise<void>}
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* // Set sandbox labels
|
|
150
|
-
* await sandbox.setLabels({
|
|
151
|
-
* project: 'my-project',
|
|
152
|
-
* environment: 'development',
|
|
153
|
-
* team: 'backend'
|
|
154
|
-
* });
|
|
155
|
-
*/
|
|
156
|
-
setLabels(labels: Record<string, string>): Promise<Record<string, string>>;
|
|
157
|
-
/**
|
|
158
|
-
* Start the Sandbox.
|
|
159
|
-
*
|
|
160
|
-
* This method starts the Sandbox and waits for it to be ready.
|
|
161
|
-
*
|
|
162
|
-
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
163
|
-
* Defaults to 60-second timeout.
|
|
164
|
-
* @returns {Promise<void>}
|
|
165
|
-
* @throws {DaytonaError} - `DaytonaError` - If Sandbox fails to start or times out
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
168
|
-
* const sandbox = await daytona.getCurrentSandbox('my-sandbox');
|
|
169
|
-
* await sandbox.start(40); // Wait up to 40 seconds
|
|
170
|
-
* console.log('Sandbox started successfully');
|
|
171
|
-
*/
|
|
172
|
-
start(timeout?: number): Promise<void>;
|
|
173
|
-
/**
|
|
174
|
-
* Stops the Sandbox.
|
|
175
|
-
*
|
|
176
|
-
* This method stops the Sandbox and waits for it to be fully stopped.
|
|
177
|
-
*
|
|
178
|
-
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
179
|
-
* Defaults to 60-second timeout.
|
|
180
|
-
* @returns {Promise<void>}
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* const sandbox = await daytona.getCurrentSandbox('my-sandbox');
|
|
184
|
-
* await sandbox.stop();
|
|
185
|
-
* console.log('Sandbox stopped successfully');
|
|
186
|
-
*/
|
|
187
|
-
stop(timeout?: number): Promise<void>;
|
|
188
|
-
/**
|
|
189
|
-
* Deletes the Sandbox.
|
|
190
|
-
* @returns {Promise<void>}
|
|
191
|
-
*/
|
|
192
|
-
delete(timeout?: number): Promise<void>;
|
|
193
|
-
/**
|
|
194
|
-
* Waits for the Sandbox to reach the 'started' state.
|
|
195
|
-
*
|
|
196
|
-
* This method polls the Sandbox status until it reaches the 'started' state
|
|
197
|
-
* or encounters an error.
|
|
198
|
-
*
|
|
199
|
-
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
200
|
-
* Defaults to 60 seconds.
|
|
201
|
-
* @returns {Promise<void>}
|
|
202
|
-
* @throws {DaytonaError} - `DaytonaError` - If the sandbox ends up in an error state or fails to start within the timeout period.
|
|
203
|
-
*/
|
|
204
|
-
waitUntilStarted(timeout?: number): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Wait for Sandbox to reach 'stopped' state.
|
|
207
|
-
*
|
|
208
|
-
* This method polls the Sandbox status until it reaches the 'stopped' state
|
|
209
|
-
* or encounters an error.
|
|
210
|
-
*
|
|
211
|
-
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
212
|
-
* Defaults to 60 seconds.
|
|
213
|
-
* @returns {Promise<void>}
|
|
214
|
-
* @throws {DaytonaError} - `DaytonaError` - If the sandbox fails to stop within the timeout period.
|
|
215
|
-
*/
|
|
216
|
-
waitUntilStopped(timeout?: number): Promise<void>;
|
|
217
|
-
/**
|
|
218
|
-
* Refreshes the Sandbox data from the API.
|
|
219
|
-
*
|
|
220
|
-
* @returns {Promise<void>}
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* await sandbox.refreshData();
|
|
224
|
-
* console.log(`Sandbox ${sandbox.id}:`);
|
|
225
|
-
* console.log(`State: ${sandbox.state}`);
|
|
226
|
-
* console.log(`Resources: ${sandbox.cpu} CPU, ${sandbox.memory} GiB RAM`);
|
|
227
|
-
*/
|
|
228
|
-
refreshData(): Promise<void>;
|
|
229
|
-
/**
|
|
230
|
-
* Refreshes the sandbox activity to reset the timer for automated lifecycle management actions.
|
|
231
|
-
*
|
|
232
|
-
* This method updates the sandbox's last activity timestamp without changing its state.
|
|
233
|
-
* It is useful for keeping long-running sessions alive while there is still user activity.
|
|
234
|
-
*
|
|
235
|
-
* @returns {Promise<void>}
|
|
236
|
-
*
|
|
237
|
-
* @example
|
|
238
|
-
* // Keep sandbox activity alive
|
|
239
|
-
* await sandbox.refreshActivity();
|
|
240
|
-
*/
|
|
241
|
-
refreshActivity(): Promise<void>;
|
|
242
|
-
/**
|
|
243
|
-
* Set the auto-stop interval for the Sandbox.
|
|
244
|
-
*
|
|
245
|
-
* The Sandbox will automatically stop after being idle (no new events) for the specified interval.
|
|
246
|
-
* Events include any state changes or interactions with the Sandbox through the sdk.
|
|
247
|
-
* Interactions using Sandbox Previews are not included.
|
|
248
|
-
*
|
|
249
|
-
* @param {number} interval - Number of minutes of inactivity before auto-stopping.
|
|
250
|
-
* Set to 0 to disable auto-stop. Default is 15 minutes.
|
|
251
|
-
* @returns {Promise<void>}
|
|
252
|
-
* @throws {DaytonaError} - `DaytonaError` - If interval is not a non-negative integer
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* // Auto-stop after 1 hour
|
|
256
|
-
* await sandbox.setAutostopInterval(60);
|
|
257
|
-
* // Or disable auto-stop
|
|
258
|
-
* await sandbox.setAutostopInterval(0);
|
|
259
|
-
*/
|
|
260
|
-
setAutostopInterval(interval: number): Promise<void>;
|
|
261
|
-
/**
|
|
262
|
-
* Set the auto-archive interval for the Sandbox.
|
|
263
|
-
*
|
|
264
|
-
* The Sandbox will automatically archive after being continuously stopped for the specified interval.
|
|
265
|
-
*
|
|
266
|
-
* @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-archived.
|
|
267
|
-
* Set to 0 for the maximum interval. Default is 7 days.
|
|
268
|
-
* @returns {Promise<void>}
|
|
269
|
-
* @throws {DaytonaError} - `DaytonaError` - If interval is not a non-negative integer
|
|
270
|
-
*
|
|
271
|
-
* @example
|
|
272
|
-
* // Auto-archive after 1 hour
|
|
273
|
-
* await sandbox.setAutoArchiveInterval(60);
|
|
274
|
-
* // Or use the maximum interval
|
|
275
|
-
* await sandbox.setAutoArchiveInterval(0);
|
|
276
|
-
*/
|
|
277
|
-
setAutoArchiveInterval(interval: number): Promise<void>;
|
|
278
|
-
/**
|
|
279
|
-
* Set the auto-delete interval for the Sandbox.
|
|
280
|
-
*
|
|
281
|
-
* The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
|
282
|
-
*
|
|
283
|
-
* @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
|
284
|
-
* Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
|
285
|
-
* By default, auto-delete is disabled.
|
|
286
|
-
* @returns {Promise<void>}
|
|
287
|
-
*
|
|
288
|
-
* @example
|
|
289
|
-
* // Auto-delete after 1 hour
|
|
290
|
-
* await sandbox.setAutoDeleteInterval(60);
|
|
291
|
-
* // Or delete immediately upon stopping
|
|
292
|
-
* await sandbox.setAutoDeleteInterval(0);
|
|
293
|
-
* // Or disable auto-delete
|
|
294
|
-
* await sandbox.setAutoDeleteInterval(-1);
|
|
295
|
-
*/
|
|
296
|
-
setAutoDeleteInterval(interval: number): Promise<void>;
|
|
297
|
-
/**
|
|
298
|
-
* Retrieves the preview link for the sandbox at the specified port. If the port is closed,
|
|
299
|
-
* it will be opened automatically. For private sandboxes, a token is included to grant access
|
|
300
|
-
* to the URL.
|
|
301
|
-
*
|
|
302
|
-
* @param {number} port - The port to open the preview link on.
|
|
303
|
-
* @returns {PortPreviewUrl} The response object for the preview link, which includes the `url`
|
|
304
|
-
* and the `token` (to access private sandboxes).
|
|
305
|
-
*
|
|
306
|
-
* @example
|
|
307
|
-
* const previewLink = await sandbox.getPreviewLink(3000);
|
|
308
|
-
* console.log(`Preview URL: ${previewLink.url}`);
|
|
309
|
-
* console.log(`Token: ${previewLink.token}`);
|
|
310
|
-
*/
|
|
311
|
-
getPreviewLink(port: number): Promise<PortPreviewUrl>;
|
|
312
|
-
/**
|
|
313
|
-
* Archives the sandbox, making it inactive and preserving its state. When sandboxes are archived, the entire filesystem
|
|
314
|
-
* state is moved to cost-effective object storage, making it possible to keep sandboxes available for an extended period.
|
|
315
|
-
* The tradeoff between archived and stopped states is that starting an archived sandbox takes more time, depending on its size.
|
|
316
|
-
* Sandbox must be stopped before archiving.
|
|
317
|
-
*/
|
|
318
|
-
archive(): Promise<void>;
|
|
319
|
-
/**
|
|
320
|
-
* Creates an SSH access token for the sandbox.
|
|
321
|
-
*
|
|
322
|
-
* @param {number} expiresInMinutes - The number of minutes the SSH access token will be valid for.
|
|
323
|
-
* @returns {Promise<SshAccessDto>} The SSH access token.
|
|
324
|
-
*/
|
|
325
|
-
createSshAccess(expiresInMinutes?: number): Promise<SshAccessDto>;
|
|
326
|
-
/**
|
|
327
|
-
* Revokes an SSH access token for the sandbox.
|
|
328
|
-
*
|
|
329
|
-
* @param {string} token - The token to revoke.
|
|
330
|
-
* @returns {Promise<void>}
|
|
331
|
-
*/
|
|
332
|
-
revokeSshAccess(token: string): Promise<void>;
|
|
333
|
-
/**
|
|
334
|
-
* Validates an SSH access token for the sandbox.
|
|
335
|
-
*
|
|
336
|
-
* @param {string} token - The token to validate.
|
|
337
|
-
* @returns {Promise<SshAccessValidationDto>} The SSH access validation result.
|
|
338
|
-
*/
|
|
339
|
-
validateSshAccess(token: string): Promise<SshAccessValidationDto>;
|
|
340
|
-
/**
|
|
341
|
-
* Assigns the API sandbox data to the Sandbox object.
|
|
342
|
-
*
|
|
343
|
-
* @param {SandboxDto} sandboxDto - The API sandbox instance to assign data from
|
|
344
|
-
* @returns {void}
|
|
345
|
-
*/
|
|
346
|
-
private processSandboxDto;
|
|
347
|
-
/**
|
|
348
|
-
* Refreshes the Sandbox data from the API, but does not throw an error if the sandbox has been deleted.
|
|
349
|
-
* Instead, it sets the state to destroyed.
|
|
350
|
-
*
|
|
351
|
-
* @returns {Promise<void>}
|
|
352
|
-
*/
|
|
353
|
-
private refreshDataSafe;
|
|
354
|
-
private ensureToolboxUrl;
|
|
355
|
-
}
|
|
356
|
-
export interface PaginatedSandboxes extends Omit<PaginatedSandboxesDto, 'items'> {
|
|
357
|
-
items: Sandbox[];
|
|
358
|
-
}
|
|
359
|
-
//# sourceMappingURL=Sandbox.d.ts.map
|
package/esm/Sandbox.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
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