Add Agent Computer provider

Add an Agent Computer provider to the TypeScript SDK, wire in provider-specific inspector URLs, and document the new deploy flow with an example package.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Harivansh Rathi 2026-03-26 14:59:01 -04:00
parent bf484e7c96
commit e7d31de44f
17 changed files with 729 additions and 6 deletions

View file

@ -0,0 +1,60 @@
---
title: "Agent Computer"
description: "Run Sandbox Agent on Agent Computer managed workers."
---
## Prerequisites
- `COMPUTER_API_KEY` or `AGENTCOMPUTER_API_KEY`
- An Agent Computer managed-worker image, or default machine source, that already has your coding agent authenticated
The platform image already includes Sandbox Agent, Claude Code, and Codex. Agent credentials still live inside the machine, so make sure your image or workspace bootstrap has already handled agent login.
## TypeScript example
```bash
npm install sandbox-agent@0.4.x
```
```typescript
import { SandboxAgent } from "sandbox-agent";
import { agentcomputer } from "sandbox-agent/agentcomputer";
const sdk = await SandboxAgent.start({
sandbox: agentcomputer(),
});
try {
const health = await sdk.getHealth();
console.log(health.status);
console.log(sdk.inspectorUrl);
const agents = await sdk.listAgents();
console.log(agents.agents.map((agent) => agent.id));
} finally {
await sdk.destroySandbox();
}
```
The `agentcomputer` provider creates a managed-worker computer, waits until browser access is ready, and routes SDK requests through the machine's authenticated web host. `sdk.inspectorUrl` is already a browser-ready URL, so it opens the built-in Inspector directly.
By default, the provider creates:
- `runtimeFamily: "managed-worker"`
- `usePlatformDefault: true`
Pass `create` when you want to override the handle, workspace name, or other machine-create settings:
```typescript
const sdk = await SandboxAgent.start({
sandbox: agentcomputer({
create: {
handle: "sandbox-agent-demo",
workspaceName: "sandbox-agent-demo",
usePlatformDefault: false,
},
}),
});
```
Set `apiUrl` when you are targeting a self-hosted or local Agent Computer API instead of `https://api.computer.agentcomputer.ai`.