@agento-nexus/sdk
v0.1.1
Published
Agent OS in Cloud Sandboxes — OpenFang + E2B + Claude Code
Readme
@agento-nexus/sdk
Agent OS in Cloud Sandboxes. Run AI agents with full tool access in isolated E2B sandboxes, orchestrate multi-agent workflows, and bridge Claude Code into cloud environments.
Install
npm install @agento-nexus/sdkRequires Node >= 20. ESM-only.
Core Concepts
FangBox
An isolated cloud sandbox with an OpenFang agent daemon and Claude Code pre-installed. Each FangBox is a full Linux environment where agents can execute code, use tools, and run autonomously.
import { createFangBox } from '@agento-nexus/sdk'
const box = await createFangBox({
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
timeout: 300, // seconds
})
// Deploy an agent using a Hand manifest
await box.client.deployHand({
name: 'researcher',
model: 'claude-sonnet-4-6',
system_prompt: 'You are a research analyst...',
tools: ['web_search', 'file_read', 'file_write'],
})
// Message the agent
const response = await box.client.message('researcher', {
role: 'user',
content: 'Analyze the competitive landscape for AI code assistants',
})
console.log(response.content)
// Clean up
await box.close()ClaudeBridge
Execute Claude Code prompts directly inside a sandbox — giving Claude full access to the sandbox filesystem, terminal, and tools.
const result = await box.claudeBridge.execute({
prompt: 'Create a REST API with Express that serves user data from a SQLite database',
outputFormat: 'json',
cwd: '/home/user/project',
})
console.log(result.output) // Claude's response
console.log(result.exitCode) // 0 on successFleet
Orchestrate multi-agent workflows as directed acyclic graphs. Each step runs in its own sandbox with dependency resolution and parallel execution.
import { Fleet } from '@agento-nexus/sdk'
const fleet = new Fleet({ maxConcurrency: 3 })
const result = await fleet.run({
name: 'research-and-report',
steps: [
{
id: 'research',
hand: { name: 'researcher', system_prompt: '...' },
prompt: 'Research AI market trends for 2026',
},
{
id: 'analyze',
hand: { name: 'analyst', system_prompt: '...' },
prompt: 'Analyze the research findings',
dependsOn: ['research'],
},
{
id: 'report',
hand: { name: 'writer', system_prompt: '...' },
prompt: 'Write an executive report from the analysis',
dependsOn: ['analyze'],
},
],
})
console.log(result.steps.report.output)TemplateBuilder
Build custom E2B sandbox templates with pre-installed tools and configurations.
import { TemplateBuilder } from '@agento-nexus/sdk'
const template = new TemplateBuilder({
base: 'openfang-claude',
packages: ['postgresql', 'redis'],
files: { '/etc/openfang/config.toml': configContent },
})
await template.build()Events
Both FangBox and Fleet emit typed events for monitoring:
box.events.on(event => {
if (event.type === 'agent:message') {
console.log(`[${event.agentName}]: ${event.content}`)
}
})
fleet.events.on(event => {
if (event.type === 'step:complete') {
console.log(`Step ${event.stepId} finished in ${event.durationMs}ms`)
}
})CLI
npx @agento-nexus/sdk --helpAPI Reference
Exports
| Export | Description |
|--------|-------------|
| FangBox | Sandbox wrapper with agent daemon + Claude Code |
| createFangBox(config?) | Create and initialize a FangBox |
| OpenFangClient | HTTP client for the OpenFang daemon API |
| ClaudeBridge | Execute Claude Code inside sandboxes |
| Fleet | DAG workflow orchestrator across multiple sandboxes |
| TemplateBuilder | Build custom sandbox templates |
| retry(fn, opts?) | Retry utility with exponential backoff |
| TypedEmitter | Type-safe event emitter |
| Logger | Structured logger |
Types
| Type | Description |
|------|-------------|
| FangBoxConfig | Sandbox creation options |
| HandManifest | Agent definition (name, model, system prompt, tools) |
| AgentInfo | Running agent status |
| AgentMessage | Conversation message |
| AgentResponse | Agent reply |
| ClaudeCodeRequest | Claude Code execution options |
| ClaudeCodeResult | Claude Code execution output |
| WorkflowDefinition | Fleet workflow DAG |
| WorkflowStep | Single step in a workflow |
| StepResult | Output of a completed step |
| WorkflowResult | Full workflow execution result |
Requirements
- Node.js >= 20
- E2B API key (
E2B_API_KEY) - Anthropic API key for Claude Code (
ANTHROPIC_API_KEY)
License
MIT
