Skip to content

v0.3.4

Choose a tag to compare

@atlasmarkz atlasmarkz released this 04 Jun 06:26
· 41 commits to main since this release

"# opencode-buddy v0.3.4\n\n## What's in this release\n\nTUI plugin with full sidebar integration. The buddy now lives natively in the opencode TUI sidebar — no tmux, no separate process.\n\n### Slash commands\n\n| Command | Effect |\n| --- | --- |\n| /buddy-feed | Feed the buddy (+25 hunger, -5 energy) |\n| /buddy-play | Play with the buddy (+20 happiness, +5 xp, -5 hunger) |\n| /buddy-rest | Let the buddy rest (+30 energy) |\n| /buddy | Show current stats as a toast |\n| /buddy-rename | Rename (max 20 chars, opens prompt dialog) |\n| /buddy-switch | Switch species (opens picker, 6 options) |\n\nSlash commands update state directly without going through the LLM — instant feedback.\n\n### Auto-reactions\n\n- session.idle → 4 second celebrating animation\n- session.error → 5 second scared animation\n- Energy < 20 → auto-transition to sleeping\n- Hunger < 25 → auto-transition to scared for 30s\n\n### Postinstall\n\nnpm install -g opencode-buddy now auto-registers the plugin in both ~/.config/opencode/opencode.json and ~/.config/opencode/tui.json. Skip-safe: leaves JSONC files with comments alone.\n\n### Bug fix since 0.3.3\n\nTUI plugin install was failing with NpmInstallFailedError: An unknown git error occurred. Root cause: npa(\"opencode-buddy/tui\") interprets the spec as a git URL (github:opencode-buddy/tui). The fix: use the same opencode-buddy spec in both configs. opencode's resolvePackageEntrypoint reads the package's exports field and picks the right entry based on runtime kind (server vs tui), so the same spec serves both purposes.\n\n## Install\n\nbash\nnpm install -g opencode-buddy\n# restart opencode\n\n\nThe postinstall handles the two config files. If you use JSONC with comments, add the entry manually:\n\njsonc\n// ~/.config/opencode/opencode.json\n{ \"plugin\": [\"opencode-buddy\"] }\n\n\njson\n// ~/.config/opencode/tui.json\n{ \"$schema\": \"https://opencode.ai/tui.json\", \"plugin\": [\"opencode-buddy\"] }\n\n\nRequires opencode ≥ 1.15.\n\n## Architecture\n\nmermaid\nflowchart LR\n User[Opencode TUI user]\n Prompt[Prompt]\n Sidebar[Sidebar]\n Keymap{{keymap}}\n Slots{{slot registry}}\n\n subgraph opencode-runtime[\"opencode TUI\"]\n Keymap\n Slots\n end\n\n subgraph buddy[\"opencode-buddy package\"]\n TuiEntry[tui entry]\n View[View component]\n SlashCmds[slash commands]\n end\n\n StateFile[(\"~/.config/opencode-buddy/state.json\")]\n\n User -->|types /buddy-feed| Prompt\n Prompt --> Keymap\n Keymap --> SlashCmds\n SlashCmds -->|read+write| StateFile\n\n Slots -->|invokes renderer| View\n View -->|render frame| Sidebar\n View -->|reads mtime| StateFile\n\n classDef store fill:#1e293b,stroke:#64748b,color:#f1f5f9\n class StateFile store\n\n\n## License\n\nMIT\n"