@ellie-ai/agent-code-exec-plugin
v0.2.0
Published
Code execution plugin for Ellie agents - execute TypeScript with IPC bridge to runtime tools
Readme
@ellie-ai/agent-code-exec-plugin
Code execution plugin for Ellie agents. Execute TypeScript code in a subprocess with IPC bridge to runtime tools.
Features
- Execute TypeScript code using Bun
- Scripts can call runtime tools via
tool() - Scripts can report progress via
progress() - Correlation IDs for concurrent tool calls
- Configurable timeouts
Installation
bun add @ellie-ai/agent-code-exec-pluginUsage
import { agentPlugin } from "@ellie-ai/agent-plugin";
import { codeExecPlugin } from "@ellie-ai/agent-code-exec-plugin";
const agent = agentPlugin({
model: anthropic({ model: "claude-sonnet-4-20250514" }),
systemMessage: `You can write TypeScript code. Use tool() to call other tools.`,
toolPlugins: [
codeExecPlugin({ timeout: 60000 }),
],
});SDK Functions
Inside sandbox scripts, import from ./ellie:
import { tool, progress } from "./ellie";
// Call a runtime tool
const result = await tool("google-drive-search", { query: "invoices" });
// Report progress
await progress("Processing files...");
// Concurrent calls work correctly
const [a, b] = await Promise.all([
tool("search", { q: "a" }),
tool("search", { q: "b" }),
]);
console.log(result);Configuration
codeExecPlugin({
timeout: 30000, // Execution timeout (default: 30000ms)
rpcTimeout: 60000, // RPC timeout (default: 60000ms)
})Actions
The plugin dispatches these actions for observability:
SANDBOX_EXEC_STARTED- Execution startedSANDBOX_EXEC_COMPLETED- Execution completed successfullySANDBOX_EXEC_FAILED- Execution failedSANDBOX_PROGRESS- Progress message from scriptSANDBOX_TOOL_REQUESTED- Tool call initiatedSANDBOX_TOOL_COMPLETED- Tool call completed
