lumina-sandbox
v0.1.0
Published
Node.js SDK for Lumina sandboxes
Readme
Lumina Node SDK (lumina-sandbox)
TypeScript/JavaScript SDK for Lumina sandbox lifecycle and tool endpoints.
Install
npm install lumina-sandboxQuick Start
import { LuminaToolClient } from "lumina-sandbox";
const client = new LuminaToolClient({
base_url: "http://localhost:8080",
token: "your-api-key",
lumina_name: "my-sandbox",
});
await client.create_sandbox();
const run = await client.bash("echo Hello from Lumina");
console.log(run.output);
const file = await client.read("/home/user/main.py");
console.log(file);
await client.destroy_sandbox();
await client.close();API Parity with Python SDK
This package mirrors the Python SDK behavior and tool names:
create_sandbox,list_sandboxes,restart_sandbox,destroy_sandboxread,write,edit,glob,grepbash,bash_output,kill_bashToolErrorwithstatus_codemakeTools(client)returning tool map keys:Read,Write,Edit,Glob,Grep,Bash,BashOutput,KillBash
CamelCase aliases are also available (createSandbox, listSandboxes, bashOutput, etc.).
Constructor Options
new LuminaToolClient({
base_url: "http://localhost:8080", // required
token: "...", // required
lumina_name: "my-sandbox", // required
tool_session_id: "optional-session-id",
timeout: 660.0, // HTTP timeout in seconds (same as Python SDK)
});Class Convenience
const client = await LuminaToolClient.create({
base_url: "http://localhost:8080",
token: "...",
name: "my-sandbox",
eager: true,
});Tool Adapter
import { makeTools } from "lumina-sandbox";
const tools = makeTools(client);
await tools.Bash("echo hello");Publish
npm publish --access public