{"id":"0a4bfd20-d5c9-4504-93f2-e3c7e151f122","slug":"even-wei-opencode-orchestrator","kind":"mcp","name":"opencode-orchestrator","summary":"Multi-tenant ephemeral OpenCode CLI orchestrator with AG-UI protocol and PostgreSQL persistence","owner":"even-wei","repoUrl":"https://github.com/even-wei/opencode-orchestrator","license":"MIT","licenseTier":"permissive","trust":"community","stars":1,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-08-15T10:37:11.000Z","addedAt":"2026-10-21T21:44:06.607Z","logoUrl":"https://avatars.githubusercontent.com/u/7878777?u=3d48c9e7c0ee261805640a17659f955daf5428c7&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["databases","design-media"],"tags":[],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-26T04:21:17.935Z","sample":false,"url":"https://conduits.dev/tools/even-wei-opencode-orchestrator","language":"TypeScript","transports":["stdio"],"install":{"npm":"opencode-orchestrator"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# OpenCode Ephemeral Orchestrator\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue.svg)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18.0.0-green.svg)](https://nodejs.org/)\n[![Protocol](https://img.shields.io/badge/Protocol-AG--UI%20SSE-orange.svg)](#-ag-ui-protocol-mapping)\n\n`opencode-orchestrator` is an enterprise-ready, multi-tenant, ephemeral orchestration engine and CLI for [OpenCode](https://github.com/opencode-ai/opencode). It provides stateless task execution inside isolated `tmpfs` sandboxes, persists session history and conversation memory in PostgreSQL, translates events in real time to the **AG-UI Protocol (SSE)**, and supports human-in-the-loop approvals via a bidirectional `stdio` RPC bridge.\n\n---\n\n## 🏛️ Architecture Design\n\n<p align=\"center\">\n  <img src=\"assets/architecture.png\" alt=\"OpenCode Ephemeral Orchestrator Architecture\" width=\"100%\">\n</p>\n\n### Core Architectural Principles\n\n* **Stateless Compute (`tmpfs` Isolation):** Every execution turn provisions a fresh directory at `/tmp/sandboxes/{sessionId}`. OpenCode writes its temporary SQLite database here; upon turn conclusion, the sandbox is purged (`rm -rf`).\n* **Context Rehydration via PostgreSQL:** Before launching the process, the orchestrator queries PostgreSQL for the latest session summary and prior conversation turns, constructing structured context prefixes (`=== PREVIOUS SESSION SUMMARY ===`, `=== RECENT CONVERSATION HISTORY ===`, `=== CURRENT TASK ===`).\n* **Declarative Skills & MCP Integration:** Dynamic agent skills (`SKILL.md`) and Model Context Protocol (`taskConfig.mcp`) servers are automatically provisioned in the sandbox environment immediately prior to process spawning.\n* **AG-UI Protocol Streaming:** OpenCode stdout JSON events are mapped to AG-UI SSE events in real time.\n* **Bidirectional Interaction (Stdio Bridge):** Permission requests trigger an `INTERACTION_REQUEST` event over SSE and suspend the sub-process. User decisions via `POST /api/v1/sessions/:id/interactions` are written directly into `stdin` to resume execution.\n\n---\n\n## 📡 AG-UI Protocol Mapping\n\n| OpenCode Raw Event | AG-UI SSE Event | Description |\n| :--- | :--- | :--- |\n| `token` / `text` | `MESSAGE_START` / `TEXT_MESSAGE_CONTENT` | Assistant response token stream |\n| `plan_update` | `STATE_DELTA` (`path: \"/todos\"`) | Progress plan and checklist updates |\n| `step_finish` | `STATE_DELTA` (`path: \"/metrics\"`) | Token usage and cost metrics |\n| `tool_start` / `tool_use` | `TOOL_CALL_START` | Tool execution triggered |\n| `tool_finish` / `tool_use` | `TOOL_CALL_RESULT` | Tool completion output & status |\n| `permission_request` / `permission` | `INTERACTION_REQUEST` | Approval request halting execution |\n| `session_compacted` | `STATE_DELTA` (`path: \"/summary\"`) | Updated compacted memory summary |\n| `done` | `MESSAGE_END` + `RUN_FINISHED` | Completion status and stream termination |\n\n---\n\n## 🚀 Getting Started\n\n### 1. Installation\n\n```bash\n# Clone repository\ngit clone https://github.com/even-wei/opencode-orchestrator.git\ncd opencode-orchestrator\n\n# Install dependencies\nnpm install\n\n# Build TypeScript\nnpm run build\n```\n\n### 2. Configuration\n\nCopy `.env.example` to `.env` and set your PostgreSQL and timeout configurations:\n\n```bash\ncp .env.example .env\n```\n\n| Variable | Default | Description |\n| :--- | :--- | :--- |\n| `PORT` | `8080` | Port for the HTTP & SSE server |\n| `HOST` | `0.0.0.0` | Host interface to bind |\n| `DATABASE_URL` | `postgresql://...` | PostgreSQL connection string |\n| `SANDBOX_BASE_DIR` | `/tmp/sandboxes` | Base directory for ephemeral execution |\n| `OPENCODE_BIN_PATH`| `opencode` | Path to the OpenCode CLI executable |\n| `DEFAULT_CONTEXT_TURNS` | `10` | Number of previous turns to rehydrate |\n| `PROCESS_TIMEOUT_MS` | `300000` | Process execution timeout (ms) |\n| `INTERACTION_TIMEOUT_MS` | `300000` | Pending approval timeout (ms) |\n\n### 3. Database Migration\n\nSpin up PostgreSQL (or use Docker) and apply `schema.sql`:\n\n```bash\n# Spin up PostgreSQL in Docker\ndocker run -d --name opencode-pg -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=opencode postgres:16\n\n# Apply migrations using CLI\nnpm run cli -- migrate\n```\n\n### 4. Running the Service\n\n```bash\n# Production server\nnpm start\n\n# Development mode with tsx\nnpm run dev\n```\n\n---\n\n## ⌨️ Command-Line Interface (CLI)\n\n`opencode-orchestrator` can also be used as a standalone CLI tool:\n\n```bash\n# Show CLI Help\nnpx opencode-orchestrator --help\n\n# 1. Execute a one-off ephemeral turn directly from terminal\nnpx opencode-orchestrator run \"Write a quicksort in Python\" -m openrouter/deepseek/deepseek-v4-flash\n\n# 2. Run with a published agent from the team registry\nnpx opencode-orchestrator run --agent db-analyzer \"Inspect active table indexes\"\n\n# 3. Run with AG-UI SSE stream output\nnpx opencode-orchestrator run \"Say hello\" -m openrouter/deepseek/deepseek-v4-flash --format sse\n\n# 4. Interactive Agent Genesis Wizard (Create, Test, Iterate, Publish)\nnpx opencode-orchestrator agent init\nnpx opencode-orchestrator agent test my-agent.agent.json\nnpx opencode-orchestrator agent iterate my-agent.agent.json --feedback \"Add LIMIT 20 to queries\"\nnpx opencode-orchestrator agent publish my-agent.agent.json\nnpx opencode-orchestrator agent list\n\n# 5. Start the HTTP & SSE Server\nnpx opencode-orchestrator serve -p 8080\n\n# 6. Run automated system verification (DB, CLI, Sandbox, Skills, OTel)\nnpx opencode-orchestrator verify\n\n# 7. Run live end-to-end turn verification with LLM\nnpx opencode-orchestrator verify --live -m openrouter/deepseek/deepseek-v4-flash\n\n# 8. Apply PostgreSQL migrations\nnpx opencode-orchestrator migrate\n\n# 9. Check database & binary health\nnpx opencode-orchestrator health\n```\n\n---\n\n## 🌐 REST & SSE API Reference\n\n### 1. Initiate Turn & Open AG-UI SSE Stream\n`POST /api/v1/sessions/:id/stream` or `POST /api/v1/sessions/:id/turn` (also supports `GET /api/v1/sessions/:id/stream`)\n\n**Request Body:**\n```json\n{\n  \"tenantId\": \"tenant_101\",\n  \"model\": \"openrouter/deepseek/deepseek-v4-flash\",\n  \"prompt\": \"Create a database migration for the users table\",\n  \"taskConfig\": {\n    \"model\": \"openrouter/deepseek/deepseek-v4-flash\"\n  },\n  \"skills\": [\n    {\n      \"name\": \"db-migrate\",\n      \"content\": \"# Database Migration Guide\\nUse knex migrations.\"\n    }\n  ]\n}\n```\n\n**Response:** `text/event-stream` (AG-UI SSE stream)\n\n```http\nevent: MESSAGE_START\ndata: {\"messageId\":\"msg_101\",\"role\":\"assistant\",\"runId\":\"run_1786789041\"}\n\nevent: TEXT_MESSAGE_CONTENT\ndata: {\"messageId\":\"msg_101\",\"delta\":\"I will create the migration file.\"}\n\nevent: TOOL_CALL_START\ndata: {\"callId\":\"call_1\",\"tool\":\"bash\",\"params\":{\"command\":\"touch migration.sql\"}}\n\nevent: TOOL_CALL_RESULT\ndata: {\"callId\":\"call_1\",\"result\":\"File created\",\"isError\":false}\n\nevent: STATE_DELTA\ndata: {\"path\":\"/metrics\",\"op\":\"replace\",\"value\":{\"tokens\":{\"total\":1200,\"input\":1100,\"output\":100},\"cost\":0.0001}}\n\nevent: MESSAGE_END\ndata: {\"messageId\":\"msg_101\"}\n\nevent: RUN_FINISHED\ndata: {\"runId\":\"run_1786789041\",\"status\":\"completed\",\"exitCode\":0}\n```\n\n---\n\n### 2. Resolve User Approval / Interaction\n`POST /api/v1/sessions/:id/interactions`\n\n**Request Body:**\n```json\n{\n  \"interactionId\": \"perm_101\",\n  \"resolution\": \"approved\",\n  \"data\": {\n    \"selectedOption\": \"approve\",\n    \"feedback\": \"Deployment approved for staging\"\n  }\n}\n```\n\n**Response:**\n```json\n{\n  \"status\": \"acknowledged\",\n  \"interactionId\": \"perm_101\"\n}\n```\n\n---\n\n### 3. Session & Tenant Management Endpoints\n- `POST /api/v1/tenants`: Create/ensure tenant\n- `POST /api/v1/sessions`: Create new session\n- `GET /api/v1/sessions/:id`: Get session metadata & status\n- `GET /api/v1/sessions/:id/events`: Get session event history\n- `GET /health` or `GET /api/v1/health`: Health check endpoint\n- `GET /livez`: Kubernetes liveness probe\n- `GET /readyz`: Kubernetes readiness probe (PostgreSQL verified)\n\n---\n\n## 🏭 Agent Genesis & Continuous Iteration Engine\n\n`opencode-orchestrator` features a built-in **Meta-Agent Factory** that allows any team member to design, test, iterate, and publish production-grade AI agents in under 3 minutes.\n\n<p align=\"center\">\n  <img src=\"assets/agent-genesis-lifecycle.png\" alt=\"AI Agent Genesis and Continuous Iteration Lifecycle\" width=\"100%\">\n</p>\n\n### 1. Interactive Agent Creation (CLI Wizard)\n```bash\nnpx opencode-orchestrator agent init\n```\n* Scans local repository schemas (`package.json`, `schema.sql`, `Dockerfile`).\n* Selects matching Verified MCPs (`postgres`, `github`, `slack`, `fetch`) and Curated Skills (`db-analyzer`, `git-release`, `pr-reviewer`).\n* Synthesizes and lints `SKILL.md` rules and generates benchmark test cases in `./<agent-name>.agent.json`.\n\n### 2. Benchmark Simulation & Sandbox Testing\n```bash\nnpx opencode-orchestrator agent test my-agent.agent.json\n```\nRuns the agent's `evalSuite` in disposable ephemeral sandboxes and asserts deterministic post-conditions (`file_exists`, `output_contains`, `expected_tool_called`).\n\n### 3. Diff-Driven Iterative Steering\n```bash\nnpx opencode-orchestrator agent iterate my-agent.agent.json --feedback \"Never drop tables without confirmation\"\n```\nProposes a visual Git-style Red/Green diff for `SKILL.md`, bumps the semantic patch version, and prompts for confirmation.\n\n### 4. Publish to Team Registry\n```bash\nnpx opencode-orchestrator agent publish my-agent.agent.json\n```\n\n### 5. Execute Registered Agent Directly\n```bash\n# Any teammate can now invoke the published agent:\nnpx opencode-orchestrator run --agent my-agent \"Triage open customer issues\"\n```\n\n### 6. Agent Factory REST Endpoints\n* `GET /api/v1/catalog/mcp`: List verified Model Context Protocol tools.\n* `GET /api/v1/catalog/skills`: List curated operational skills library.\n* `POST /api/v1/agents/synthesize`: Synthesize `AgentBundle` from description/repo scan.\n* `POST /api/v1/agents/refine`: Diff-driven iterative steering.\n* `POST /api/v1/agents/publish`: Save agent bundle to PostgreSQL registry.\n* `GET /api/v1/agents`: List team agent catalog with trust telemetry.\n* `GET /api/v1/agents/:name`: Fetch specific agent bundle.\n\n---\n\n---\n\n## 🧩 Skills & MCP Configuration Guide\n\n`opencode-orchestrator` allows injecting declarative skills (`SKILL.md`) and Model Context Protocol (MCP) servers dynamically into each ephemeral execution turn.\n\n### 1. Declarative Skills\n\nSkills are markdown instructions with YAML frontmatter placed in `.opencode/skills/<skill-name>/SKILL.md`:\n\n```markdown\n---\nname: db-analyzer\ndescription: Inspects database schemas, indexes, and queries using PostgreSQL MCP tools\n---\n\n# PostgreSQL Database Analyzer Skill\n1. Use `postgres-mcp` tools to inspect `information_schema.tables`.\n2. Check foreign key relationships and index coverage.\n3. Recommend composite indexes for slow queries.\n```\n\n### 2. Model Context Protocol (MCP) Servers\n\nMCP servers are configured in `taskConfig.mcp` (injected into `$HOME/.config/opencode/opencode.json`):\n\n```json\n{\n  \"taskConfig\": {\n    \"model\": \"openrouter/deepseek/deepseek-v4-flash\",\n    \"mcp\": {\n      \"postgres\": {\n        \"type\": \"local\",\n        \"command\": \"npx\",\n        \"args\": [\n          \"-y\",\n          \"@modelcontextprotocol/server-postgres\",\n          \"postgresql://postgres:postgres@localhost:5432/opencode\"\n        ],\n        \"enabled\": true\n      },\n      \"filesystem\": {\n        \"type\": \"local\",\n        \"command\": \"npx\",\n        \"args\": [\n          \"-y\",\n          \"@modelcontextprotocol/server-filesystem\",\n          \"/tmp/sandboxes\"\n        ],\n        \"enabled\": true\n      },\n      \"remote-mcp\": {\n        \"type\": \"remote\",\n        \"url\": \"https://mcp.internal.company.com/sse\",\n        \"enabled\": true\n      }\n    }\n  }\n}\n```\n\n> **Note:** If `type` or `enabled` are omitted, `opencode-orchestrator` automatically normalizes `type` to `\"local\"` (or `\"remote\"`) and sets `enabled: true`.\n\n### 3. Example Turn Script\n\nRun a complete turn with skills and MCP using TypeScript:\n\n```bash\nnpx tsx examples/run_turn.ts\n```\n\n---\n\n## 🔭 Self-Hosted Observability & Tracing (Arize Phoenix)\n\n`opencode-orchestrator` features native, zero-overhead **OpenTelemetry (OTel)** tracing compliant with the **OpenInference** standard. You can visualize tool execution Gantt charts, model latencies, token consumption, and human-in-the-loop pauses using self-hosted [Arize Phoenix](https://github.com/Arize-ai/phoenix).\n\n### 1. Self-Hosted Stack with Docker Compose\n\nSpin up PostgreSQL, Arize Phoenix, and OpenCode Orchestrator in a single command:\n\n```bash\ndocker compose up -d\n```\n\n- **Orchestrator API:** `http://localhost:8080`\n- **Arize Phoenix Web UI:** `http://localhost:6006`\n- **Phoenix OTLP Collector:** `http://localhost:6006/v1/traces`\n- **PostgreSQL Database:** `localhost:5432`\n\n### 2. Environment Configuration\n\nAdd the following to your `.env`:\n\n```env\nPHOENIX_ENABLED=true\nPHOENIX_COLLECTOR_URL=http://localhost:6006/v1/traces\nOTEL_SERVICE_NAME=opencode-orchestrator\n```\n\n### 3. What Gets Traced\n- **Root Turn Span (`CHAIN`):** Model, session ID, tenant ID (`user.id`), prompt, total duration, and exit status.\n- **Tool Execution Spans (`TOOL`):** Tool name (`bash`, `read`, `glob`, MCP database tools), inputs, outputs, execution duration, and error states.\n- **Token & Cost Metrics:** Input tokens, output tokens, reasoning tokens, cache hit rate, and total USD cost per turn.\n- **Human-in-the-Loop Spans (`APPROVAL`):** Time spent waiting for user permission and the final decision (`approved` / `rejected`).\n\n---\n\n## 📈 Tool & Service Telemetry (Kubernetes & Grafana Ready)\n\n`opencode-orchestrator` natively emits operational and economic telemetry at both the **Prometheus infrastructure level** and the **PostgreSQL relational level**:\n\n### 1. Prometheus Scrape Endpoint (`/metrics`)\nThe server exposes a standard Prometheus exposition endpoint at `GET /metrics` for scraping by Prometheus, VictoriaMetrics, or Kubernetes Prometheus Operator:\n\n```bash\ncurl http://localhost:8080/metrics\n```\n\n**Exported Metrics:**\n| Metric Name | Type | Description |\n| :--- | :--- | :--- |\n| `orchestrator_turns_total` | Counter | Total turns executed labeled by `tenant_id`, `model`, and `status` (`completed\\|failed`) |\n| `orchestrator_turn_duration_seconds` | Histogram | Turn execution latency percentiles (P50, P90, P99) |\n| `orchestrator_active_sessions` | Gauge | Number of in-flight turns currently running |\n| `orchestrator_sandboxes_provisioned_total` | Counter | Total ephemeral TMPFS sandboxes created |\n| `orchestrator_sandboxes_cleaned_total` | Counter | Total sandboxes purged on turn completion |\n| `orchestrator_tokens_total` | Counter | Tokens consumed by `tenant_id`, `model`, and `type` (`input\\|output\\|reasoning`) |\n| `orchestrator_cost_usd_total` | Counter | Estimated LLM spend in USD |\n| `orchestrator_interactions_total` | Counter | Permission requests emitted by agents |\n| `orchestrator_interactions_resolved_total` | Counter | Human approvals resolved (`approved\\|rejected`) |\n| `orchestrator_node_*` | Gauges/Counters | Node.js process CPU, RSS memory, event loop lag, and GC metrics |\n\n### 2. Kubernetes Prometheus Annotations\nAdd to your Kubernetes Deployment for automatic discovery:\n\n```yaml\nmetadata:\n  annotations:\n    prometheus.io/scrape: \"true\"\n    prometheus.io/port: \"8080\"\n    prometheus.io/path: \"/metrics\"\n```\n\n### 3. PostgreSQL Relational Telemetry (`/api/v1/telemetry`)\nOperational metrics are automatically recorded in the `orchestrator_telemetry` table in PostgreSQL for historical auditing and SQL reporting:\n\n```sql\nSELECT \n    tenant_id, \n    metric_name, \n    count(*) as total_events, \n    sum(metric_value) as aggregate_value\nFROM orchestrator_telemetry\nGROUP BY tenant_id, metric_name;\n```\n\nYou can also fetch recent events via REST API: `GET /api/v1/telemetry?limit=50`.\n\n### 4. Turnkey Grafana Dashboard\nA plug-and-play Grafana dashboard is provided in [`dashboards/grafana-orchestrator.json`](dashboards/grafana-orchestrator.json). Simply import this JSON into Grafana to monitor active sessions, turn latencies, token consumption, and Human-in-the-Loop approval metrics.\n\n---\n\n## 📖 Client Integration & Call Preparation Manual\n\nFor an in-depth guide on how to prepare requests, structure payloads, inject dynamic MCP servers, declare agent skills, and handle streaming SSE events in TypeScript, Python, or cURL, consult the dedicated manual:\n\n👉 **[Complete Turn Preparation & Configuration Manual (docs/CALL_PREPARATION_MANUAL.md)](docs/CALL_PREPARATION_MANUAL.md)**\n\n### Quick Reference: Turn Request Payload\n\n| Field | Type | Required | Description | Example |\n| :--- | :--- | :--- | :--- | :--- |\n| `prompt` | `string` | **Yes** | The natural language task or prompt for this turn | `\"List all database tables\"` |\n| `tenantId` / `userId` | `string` | No | Tenant or user ID for isolation and trace filtering | `\"tenant_dev_101\"` |\n| `model` | `string` | No | Model identifier override | `\"openrouter/deepseek/deepseek-v4-flash\"` |\n| `taskConfig` | `object` | No | Injected into `$HOME/.config/opencode/opencode.json` | `{\"model\": \"...\", \"mcp\": {...}}` |\n| `taskConfig.mcp` | `object` | No | Model Context Protocol servers (local stdio or remote SSE) | See MCP guide below |\n| `skills` | `array` | No | Declarative skills (`{ name, content }`) injected as `SKILL.md` | `[{\"name\": \"db-analyzer\", \"content\": \"...\"}]` |\n| `auth` | `object` | No | Injected into `$HOME/.local/share/opencode/auth.json` | `{\"openrouter\": {\"apiKey\": \"...\"}}` |\n| `binaryPath` | `string` | No | Custom path to the `opencode` binary if overriding default | `\"/usr/local/bin/opencode\"` |\n\n---\n\n## 🧪 Testing & Verification\n\n```bash\n# Run all test suites (unit, integration, and live OpenCode execution)\nnpm test\n```\n\n### Test Suite Structure\n\n* **`tests/unit/agentFactory.test.ts`**: Verifies verified MCPs, curated skills, skill linter, synthesizer, and refiner diffs.\n* **`tests/unit/metrics.test.ts`**: Tests Prometheus counters/gauges and PostgreSQL telemetry persistence.\n* **`tests/unit/cli.test.ts`**: Validates CLI commands, flags, and options.\n* **`tests/unit/sandbox.test.ts`**: Verifies ephemeral sandbox provisioning, skill injection, and purge lifecycle.\n* **`tests/unit/skillsAndMcp.test.ts`**: Verifies MCP configuration normalization and skill injections.\n* **`tests/unit/aguiAdapter.test.ts`**: Tests protocol translation for tokens, plans, tool calls, and permissions.\n* **`tests/unit/sessionStore.test.ts`**: Tests context rehydration and summary formatting.\n* **`tests/integration/agentApi.test.ts`**: Validates Agent Genesis REST endpoints (synthesize, refine, publish, list).\n* **`tests/integration/api.test.ts`**: Validates Express API endpoints and Kubernetes probes (`/livez`, `/readyz`).\n* **`tests/integration/interactionFlow.test.ts`**: Tests stdio pause, resume, and human-in-the-loop approvals.\n* **`tests/integration/turnStreamE2E.test.ts`**: Full simulated E2E turn streaming and HTTP interaction resolution.\n* **`tests/integration/realOpenCode.test.ts`**: Live execution with real OpenCode CLI and OpenRouter DeepSeek.\n\n---\n\n## 🚢 Kubernetes & Production Deployment\n\nIn Kubernetes, mount `/tmp/sandboxes` to a RAM-backed `emptyDir` (`medium: Memory`) for zero-disk-I/O execution:\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: opencode-orchestrator\nspec:\n  replicas: 3\n  template:\n    spec:\n      containers:\n        - name: orchestrator\n          image: ghcr.io/opencode-ai/opencode-orchestrator:latest\n          env:\n            - name: DATABASE_URL\n              valueFrom:\n                secretKeyRef:\n                  name: db-credentials\n                  key: database-url\n            - name: SANDBOX_BASE_DIR\n              value: /tmp/sandboxes\n          volumeMounts:\n            - mountPath: /tmp/sandboxes\n              name: sandbox-storage\n      volumes:\n        - name: sandbox-storage\n          emptyDir:\n            medium: Memory\n            sizeLimit: 4Gi\n```\n\n---\n\n## 📄 License\n\nMIT License. See [LICENSE](LICENSE) for details.\n"}