forked from bots-garden/ori
| 🛟 Updated. | 1 | schemaVersion: "2" |
| 2 | kind: mixin | |
| 3 | name: ori | |
| 4 | displayName: Ori — ACP web client for Claude Code | |
| 5 | description: > | |
| 6 | Starts the ori web server inside the sandbox. Ori is a browser client for | |
| 7 | ACP (Agent Client Protocol) code agents: a Go backend serves a React SPA | |
| 8 | (Zed-style agent panel: streamed answers, thoughts, tool calls, plans, | |
| 9 | permission prompts) plus a workspace panel (file tree with Material icons, | |
| 10 | Monaco preview/editor with rendered Markdown and AsciiDoc, interactive | |
| 11 | terminal). This kit only launches and describes the server; the binaries | |
| 12 | ship in the k33g/ori template image (template/Dockerfile in the ori | |
| 13 | repository), so use it together with `--template k33g/ori:0.0.1`. | |
| 14 | licenses: | |
| 15 | - MIT | |
| 16 | ||
| 17 | # This mixin only makes sense composed with the claude agent kit: the server | |
| 18 | # it starts drives Claude Code through the claude-code-acp adapter, and the | |
| 19 | # Anthropic credentials/egress come from that kit. | |
| 20 | requires: | |
| 21 | agent: claude | |
| 22 | ||
| 23 | args: | |
| 24 | port: | |
| 25 | default: "8888" | |
| 26 | description: TCP port the ori server listens on inside the sandbox | |
| 27 | pattern: "^[0-9]{2,5}$" | |
| 28 | ||
| 29 | # No extra network permissions: the Anthropic endpoints come from the claude | |
| 30 | # agent kit this mixin composes with, and the ACP adapter is baked into the | |
| 31 | # template image, so nothing is downloaded at runtime. | |
| 32 | ||
| 33 | # Auto-publishes an ephemeral localhost port at create (the create output | |
| 34 | # prints it: "Published web: localhost:<port> -> <port>/tcp"). Pin a fixed | |
| 35 | # host port instead with `-p 8888:8888` at create or `sbx ports … --publish`. | |
| 36 | # The unquoted arg reference decodes as the integer the schema expects. | |
| 37 | ports: | |
| 38 | - container: ${{ kit.args.port }} | |
| 39 | protocol: tcp | |
| 40 | name: web | |
| 41 | ||
| 42 | setup: | |
| 43 | startup: | |
| 44 | # Startup commands run on every container start through the detached | |
| 45 | # dispatcher, so the pgrep guard makes this idempotent. The server binds | |
| 46 | # 0.0.0.0 (empty host in --addr) so published ports reach it from the | |
| 47 | # host's browser. `user` is omitted: startup commands default to uid 1000, | |
| 48 | # the agent user. | |
| 49 | # | |
| 50 | # The PATH export is load-bearing: the dispatcher runs this via | |
| 51 | # `su -s /bin/sh -c … agent`, and su resets PATH to the login.defs | |
| 52 | # default — which does not contain the npm prefix where claude-code-acp | |
| 53 | # lives, nor ~/.local/bin where claude does. | |
| 54 | - command: | |
| 55 | - "sh" | |
| 56 | - "-c" | |
| 57 | - | | |
| 58 | export PATH="/usr/local/share/npm-global/bin:/home/agent/.local/bin:$PATH" | |
| 59 | pgrep -x ori >/dev/null 2>&1 && exit 0 | |
| 60 | nohup /usr/local/bin/ori \ | |
| 61 | --addr ":${{ kit.args.port }}" \ | |
| 62 | --agent-cmd claude-code-acp \ | |
| 63 | --cwd "${WORKSPACE_DIR:-/home/agent/workspace}" \ | |
| 64 | >> /home/agent/.ori.log 2>&1 & | |
| 65 | description: Start the ori web server (idempotent) | |
| 66 | ||
| 67 | agentInstructions: | |
| 68 | content: | | |
| 69 | ## Ori web server (kit `ori`) | |
| 70 | ||
| 71 | This sandbox runs **ori**, a web client for Claude Code over ACP. It was | |
| 72 | started automatically and serves on **port ${{ kit.args.port }}** (all | |
| 73 | interfaces). | |
| 74 | ||
| 75 | - Binaries: `/usr/local/bin/ori` (server) and `/usr/local/bin/ori-mock-agent` | |
| 76 | (a deterministic demo ACP agent that needs no credentials). | |
| 77 | - Log file: `/home/agent/.ori.log`. | |
| 78 | - The server drives its own Claude Code session through the | |
| 79 | `claude-code-acp` adapter (preinstalled); credentials are injected by the | |
| 80 | sandbox proxy, so no login is needed inside the container. | |
| 81 | - Restart it with: | |
| 82 | `pkill -x ori; nohup ori --addr ":${{ kit.args.port }}" --agent-cmd claude-code-acp --cwd "$PWD" >> /home/agent/.ori.log 2>&1 &` | |
| 83 | - To demo without consuming Claude usage, restart it with | |
| 84 | `--agent-cmd ori-mock-agent` instead. | |
| 85 | ||
| 86 | A localhost port for the UI was published on the host at create time (see | |
| 87 | the create output); the human can pin a different one with | |
| 88 | `sbx ports <sandbox-name> --publish <host-port>:${{ kit.args.port }}/tcp`. |