How lucasinstra/opencode-status-popup works
This Windows-only OpenCode plugin turns session and permission events into a shared status indicator. Its main workflow is: OpenCode events update per-instance activity, instances publish presence files, and one supervised PowerShell host renders either a floating pill or tray icon. Users can also switch renderers and tray-idle behavior through server commands, the TUI palette, or renderer menus. The graph preserves the documented renderer and interaction capabilities; several host-side implementation details are unsampled, so those links rely on README evidence.
Main entry points: index.ts Plugin setup · popup.ps1 PowerShell host · paths.ts Control request files · tray.ps1 Tray icon
Components 19
Plugin runtime
- Plugin setup
src/index.ts - Configuration
src/config.ts - Session activity
src/status.ts - Host supervisor
src/host.ts - Debug logging
src/debug.ts
Shared state
- Presence writer
src/presence.ts - Presence files
src/paths.ts - Shared preferences
src/sharedMode.ts - Shared position
src/sharedPosition.ts - State paths
src/paths.ts - Control request files
src/paths.ts
User controls
- Server commands
src/index.ts - Palette commands
src/tui.ts
Windows host
- PowerShell host
host/popup.ps1 - Floating pill
host/window.ps1 - Tray icon
host/tray.ps1 - Tray rendering
host/TrayIcon.cs
Other components
- OpenCode
- User
Connections 26
- OpenCode → Plugin setup: loads plugin
README.md - Plugin setup → Configuration: parses options
src/index.ts - Plugin setup → Session activity: creates tracker
src/index.ts - Plugin setup → Presence writer: publishes state
src/index.ts - Session activity → Presence writer: provides snapshot
src/index.ts - Presence writer → Presence files: writes presence
src/presence.ts - Plugin setup → Host supervisor: ensures host
src/index.ts - Host supervisor → PowerShell host: spawns host
README.md - PowerShell host → Presence files: reads presence
- PowerShell host → Floating pill: renders window
README.md - PowerShell host → Tray icon: renders tray
README.md - Tray icon → Tray rendering: uses renderer
- User → Server commands: invokes commands
README.md - User → Palette commands: chooses palette
README.md - User → Floating pill: uses menu
README.md - User → Tray icon: uses menu
README.md - Server commands → Shared preferences: updates choices
src/index.ts - Palette commands → Control request files: writes requests
src/tui.ts - Server commands → Control request files: polls requests
src/index.ts - Control request files → Shared preferences: applies requests
src/index.ts - Plugin setup → Shared position: publishes position
src/index.ts - Shared position → PowerShell host: supplies placement
README.md - Plugin setup → State paths: resolves state paths
src/index.ts - Plugin setup → Debug logging: creates logger
src/index.ts - Floating pill → Control request files: requests mode
README.md - Tray icon → Control request files: requests mode
README.md