Setup
How It Works
The installer:- Downloads
peon-ping.tsto~/.config/opencode/plugins/ - Creates
~/.config/opencode/peon-ping/config.json - Installs the default sound pack (
peon) from the registry to~/.openpeon/packs/
- Loads the active pack’s
openpeon.jsonmanifest - Subscribes to OpenCode events (
session.created,session.idle,session.error,permission.asked) - Maps events to CESP categories and plays sounds
- Updates terminal tab titles (
● project: working.../✓ project: done) - Sends desktop notifications when the terminal is not focused
Event Mapping
| OpenCode Event | CESP Category | Trigger |
|---|---|---|
Plugin init / session.created | session.start | OpenCode launches, session starts |
session.status (busy) | task.acknowledge | Agent accepts work |
session.idle | task.complete | Agent finishes turn |
session.error | task.error | Error occurs |
permission.asked | input.required | Permission prompt |
| Rapid prompts detected | user.spam | 3+ prompts in 10 seconds |
Features
Terminal Focus Detection
Desktop notifications only appear when your terminal is not the frontmost app. The plugin uses AppleScript to check focus:Tab Titles
The plugin updates your terminal tab to show task status:project: ready— Session startedproject: working— Agent is busy● project: done— Task complete✗ project: error— Error occurred
Subagent Filtering
OpenCode’s Task tool spawns parallel subagents. Each subagent has aparentID field. The plugin tracks subagent session IDs and skips sounds for them:
Pack Rotation
Per-session pack rotation:SSH & Devcontainer Support
When running in SSH or devcontainers, the plugin detects the environment and routes audio/notifications to a relay on your local machine:Configuration
Config path:~/.config/opencode/peon-ping/config.json
Custom Notification Icon
By default,terminal-notifier shows a generic Terminal icon. You can replace it with the peon icon:
- Finds the peon icon (
peon-icon.png) - Converts it to
.icnsusing built-in macOS tools (sips+iconutil) - Backs up the original
Terminal.icns - Replaces it with the peon icon
brew upgrade terminal-notifier.
Future migration: When jamf/Notifier is available via Homebrew, the plugin will migrate to it. Notifier uses the modern UserNotifications framework and has built-in
--rebrand support.Uninstall
~/.openpeon/packs/ are preserved (shared with other adapters).