1npx -y kimaki@latest
@opencode-ai/sdk/v2. That is a client for OpenCode 1. The real V2 packages are @opencode/client and @opencode/plugin.| OpenCode V2 has | So Kimaki no longer needs |
| one background service shared by the TUI and clients | its own OpenCode server per bot, ports, password |
a durable inbox with steer and queue delivery | its own queue, the abort plugin, prompt replay |
session.execution.* events for each busy period | guessed busy and idle flags |
forms for questions, permission.* events | a separate question pipeline |
| instruction entries that keep the system prompt stable | rewriting the system prompt each turn |
Kimaki 0.x Discord <──> kimaki ──spawns──> private opencode server, one per bot Kimaki 1.x Discord <──> kimaki ──HTTP + events──┐ ├──> your OpenCode 2 service terminal ──> opencode TUI ───────────┘ sessions, queue, forms, permissions, event log
Discord message ──> ingress.ts ──> prompt.ts ──> session.prompt (steer | queue) │ v your OpenCode 2 service │ │ one /api/event stream v event-loop.ts (route by sessionID) │ v Discord <── effects.ts (only writer) <── thread-reducer.ts (pure)
thread-reducer.ts. It folds each event into a thread view and returns a list of effects. It never touches Discord, OpenCode, SQLite or the clock:1234export function reduce({ view, event, prefs }: { view: ThreadView; event: ThreadEvent; prefs: Prefs }): { view: ThreadView effects: Effect[] }
effects.ts is the only code that writes session output to Discord. It runs one FIFO worker per thread, so the order in Discord is the order of the events.thread-session-runtime.ts was 5752 lines. Today the reducer, event loop and effects together are about 1500 lines.kimaki send, and waited with kimaki session wait. Each worker then asked an oracle agent to review its phase. The phase commits (cli2 P0 to cli2 P9) landed on September 30 and October 1. Kimaki 1.0 shipped on October 12.kimaki restart, a crash or an update does not stop a running turn. When the bot is back it reads the state from OpenCode and carries on./session-id in a thread and open it in the terminal:1opencode /path/to/project --session ses_abc123
» **user:** .... /resume brings a TUI session into a Discord thread. See Use the OpenCode TUI with Kimaki sessions.~/.config/opencode and the project, the same as in your TUI.1-# ⬦ prompt cache miss: 0 of 85k tokens cached, 12m 3s after the last request
12kimaki session events ses_xxx > ./tmp/ses_xxx.jsonl jq -r .event.type ./tmp/ses_xxx.jsonl | sort | uniq -c
kimaki many times per session, so startup matters. Subcommands now start in about 0.06s and 70 MB of memory. In 0.x it was 0.46s and 330 MB.1curl -fsSL https://opencode.ai/v2/install | bash
12npm i -g kimaki@latest kimaki
~/.kimaki/discord-sessions.db into a new ~/.kimaki/kimaki.db: bot credentials, channels, thread bindings, scheduled tasks, model and verbosity settings. No onboarding again.npm i -g kimaki@0.31. For plugins and SDK code, read the OpenCode V2 migration guide.| Feature from 0.x | Now |
Kimaki-owned OpenCode server, --opencode-port | the shared service, opencode service restart |
self-upgrade (kimaki upgrade, /upgrade-and-restart) | not ported yet: npm i -g kimaki@latest, then kimaki restart |
| image optimizer and kitty graphics plugins | not ported yet |
syncing your own skills (sync-skills) | not ported yet |
prompt injection guard, --injection-guard | none yet |
external session sync (--enable-sync) | /resume, kimaki session read |
| subrouter and built-in account rotation | @kimaki/plugin-fallback |
| thinking lines, the third verbosity level | reasoning is never shown, two levels |
| thread rename from the OpenCode title | kimaki session title |