Skip to content

Documentation / @agentick/sandbox / SandboxHandle

Interface: SandboxHandle ​

Defined in: types.ts:13

Properties ​

id ​

readonly id: string

Defined in: types.ts:15

Unique sandbox instance ID.


workspacePath ​

readonly workspacePath: string

Defined in: types.ts:18

Absolute path to the workspace root inside the sandbox.

Methods ​

addMount() ​

addMount(mount): Promise<void>

Defined in: types.ts:33

Add a filesystem mount at runtime. Takes effect immediately.

Parameters ​

mount ​

Mount

Returns ​

Promise<void>


destroy() ​

destroy(): Promise<void>

Defined in: types.ts:42

Tear down the sandbox and release resources.

Returns ​

Promise<void>


editFile() ​

editFile(path, edits): Promise<EditResult>

Defined in: types.ts:30

Apply surgical edits to a file.

Parameters ​

path ​

string

edits ​

Edit[]

Returns ​

Promise<EditResult>


exec() ​

exec(command, options?): Promise<ExecResult>

Defined in: types.ts:21

Execute a shell command.

Parameters ​

command ​

string

options? ​

ExecOptions

Returns ​

Promise<ExecResult>


listMounts() ​

listMounts(): Mount[]

Defined in: types.ts:39

List current mounts.

Returns ​

Mount[]


readFile() ​

readFile(path): Promise<string>

Defined in: types.ts:24

Read a file from the sandbox filesystem.

Parameters ​

path ​

string

Returns ​

Promise<string>


removeMount() ​

removeMount(hostPath): void

Defined in: types.ts:36

Remove a mount by host path.

Parameters ​

hostPath ​

string

Returns ​

void


writeFile() ​

writeFile(path, content): Promise<void>

Defined in: types.ts:27

Write a file to the sandbox filesystem.

Parameters ​

path ​

string

content ​

string

Returns ​

Promise<void>

Released under the ISC License.