Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/sandbox-blaxel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@voltagent/sandbox-blaxel": minor
---

Add `@voltagent/sandbox-blaxel` — a new workspace sandbox provider that runs your agents' shell commands inside [Blaxel](https://blaxel.ai)-managed sandboxes.

```ts
import { Workspace } from "@voltagent/core";
import { BlaxelSandbox } from "@voltagent/sandbox-blaxel";

const workspace = new Workspace({
sandbox: new BlaxelSandbox({
apiKey: process.env.BL_API_KEY,
workspace: process.env.BL_WORKSPACE,
config: { name: "voltagent-prod", region: "us-pdx-1" },
}),
});
```

Supports streaming stdout/stderr, per-call timeouts and `AbortSignal`, output truncation, and lazy provisioning. Reach the underlying Blaxel SDK directly via `sandbox.getSandbox()` when you need provider-specific APIs (filesystem, previews, sessions, etc.).
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ node_modules/
# serena
.serena

# joggr
.joggr


# example skills
!examples/with-workspace/workspace/skills
2 changes: 2 additions & 0 deletions packages/core/src/workspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import type {
LocalSandboxIsolationOptions,
LocalSandboxIsolationProvider,
LocalSandboxOptions,
NormalizedCommand,
WorkspaceSandbox,
WorkspaceSandboxExecuteOptions,
WorkspaceSandboxResult,
Expand Down Expand Up @@ -470,6 +471,7 @@ export {
type WorkspaceSandboxToolName,
createWorkspaceSandboxToolkit,
normalizeCommandAndArgs,
type NormalizedCommand,
type WorkspaceSandboxToolkitOptions,
type WorkspaceSandboxToolkitContext,
WorkspaceSearch,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/workspace/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export type {
WorkspaceSandboxToolName,
} from "./toolkit";
export { normalizeCommandAndArgs } from "./command-normalization";
export type { NormalizedCommand } from "./command-normalization";
52 changes: 52 additions & 0 deletions packages/sandbox-blaxel/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@voltagent/sandbox-blaxel",
"description": "VoltAgent Blaxel sandbox provider",
"version": "2.0.0",
"dependencies": {
"@blaxel/core": "^0.2.0",
"es-toolkit": "^1.46.1"
},
"devDependencies": {
"@types/node": "^24.2.1",
"@vitest/coverage-v8": "^3.2.4",
"@voltagent/core": "^2.4.1",
"tsup": "^8.5.0",
"typescript": "^5.8.2",
"vitest": "^3.2.4"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
"dist"
],
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"peerDependencies": {
"@voltagent/core": "^2.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/VoltAgent/voltagent.git",
"directory": "packages/sandbox-blaxel"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
"types": "dist/index.d.ts"
}
20 changes: 20 additions & 0 deletions packages/sandbox-blaxel/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Default `defaultTimeoutMs` (60 seconds).
*/
export const DEFAULT_TIMEOUT_MS = 60_000;

/**
* Default `maxOutputBytes` (5 MiB).
*/
export const DEFAULT_MAX_OUTPUT_BYTES = 5 * 1024 * 1024;

/**
* Default `pollIntervalMs` (250 ms).
*/
export const DEFAULT_POLL_INTERVAL_MS = 250;

/**
* Safety cap on `process.wait()` `maxWait` when `timeoutMs: 0` is set.
* 24h — prevents runaway poll loops if a process never terminates.
*/
export const NO_TIMEOUT_MAX_WAIT_MS = 24 * 60 * 60 * 1000;
6 changes: 6 additions & 0 deletions packages/sandbox-blaxel/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { BlaxelSandbox } from "./sandbox";
export type {
BlaxelSandboxConfig,
BlaxelSandboxInstance,
BlaxelSandboxOptions,
} from "./types";
Loading
Loading