Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

pantheon-org/opencode-warcraft-notifications

Repository files navigation

🎮 Warcraft II Notifications Plugin for OpenCode

npm version License: MIT TypeScript Bun Documentation

Enhance your OpenCode experience with nostalgic Warcraft II unit sounds!

This plugin plays authentic Warcraft II unit audio clips from both Alliance and Horde factions when your OpenCode session goes idle, bringing back memories of commanding orcs, knights, trolls, and mages in the classic RTS game.

Quick StartDocumentationContributing


Features

  • 🎵 110 Authentic Sounds: Complete collection of Warcraft II Alliance and Horde unit voices (56 Alliance, 54 Horde)
  • 📦 Bundled Sounds: Includes pre-bundled WAV assets copied into a per-user data directory on first use (no runtime network dependency by default)
  • 🎲 Random Selection: Plays a different sound each time for variety
  • ⚔️ Faction Choice: Choose Alliance, Horde, or both factions
  • 💻 Cross-Platform: Works on macOS and Linux
  • 🎨 Toast Notifications: In-app toast notifications with authentic voice lines (e.g., "Yes, milord?" / "Work, work.")
  • 🚀 Automated Releases: Fully automated CI/CD pipeline with AI-powered version management
  • 📚 Comprehensive Documentation: Complete documentation suite for users, developers, and operators
  • 🎮 Unit Variety: Includes voices from:
    • Alliance: Human Units (peasants, knights, mages), Elven Archers, Dwarven Demolition Squad, Naval Units
    • Horde: Orcs, Death Knights, Dragons, Goblin Sappers, Ogres, Ogre-Mages, Troll Axethrowers, Naval Units
    • Special completion sounds

Documentation

This project includes comprehensive documentation for all users:

Quick Access

For Users

For Developers

For Operations

Additional Resources

Quick Start

1. Installation

Add the plugin to your OpenCode config:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@pantheon-ai/opencode-warcraft-notifications"]
}

2. Restart OpenCode

opencode

3. Enjoy!

When your OpenCode session goes idle, you'll hear Warcraft II sounds and see a notification.

On first run, the plugin automatically copies bundled WAV files to your local plugin data directory (no network downloads required).

Next Steps

Configuration

Faction Selection

Choose which faction sounds to play:

  • "alliance" - Play only Alliance unit sounds
  • "horde" - Play only Horde unit sounds
  • "both" - Play random sounds from both factions (default)

Project-specific (.opencode/plugin.json):

{
  "@pantheon-ai/opencode-warcraft-notifications": {
    "faction": "alliance"
  }
}

Global (~/.config/opencode/plugin.json):

{
  "@pantheon-ai/opencode-warcraft-notifications": {
    "faction": "horde"
  }
}

Toast Notifications

By default, the plugin shows toast notifications with the Warcraft II voice line as the title when your session goes idle. You can disable this feature if you prefer silent mode (sound only):

{
  "@pantheon-ai/opencode-warcraft-notifications": {
    "showDescriptionInToast": false
  }
}

Example with toast enabled (default):

  • Toast Title: "Yes, milord?"
  • Toast Message: Created notification system with sound descriptions
  • Sound plays: human_selected1.wav

Example with toast disabled:

  • Sound plays: human_selected1.wav
  • No visual notification shown

Custom Sound Directory

You can customize where sound files are stored:

{
  "@pantheon-ai/opencode-warcraft-notifications": {
    "soundsDir": "/path/to/custom/sounds",
    "faction": "both",
    "showDescriptionInToast": true
  }
}

Configuration Precedence

  1. Project-specific plugin.json soundsDir setting
  2. SOUNDS_DATA_DIR environment variable
  3. Platform-specific default directory

For complete configuration options and examples, see:

How It Works

  1. Idle Detection: When your OpenCode session goes idle, the plugin triggers
  2. Sound Selection: Randomly selects a Warcraft II unit sound from your configured faction(s)
  3. Sound Playback: Plays the sound using platform-specific audio tools
  4. Toast Notification: Shows an in-app toast with the voice line as the title (e.g., "Yes, milord?") and your session summary

The plugin includes 110+ authentic sounds from both factions, including:

  • Unit selection sounds ("Yes, my lord?" / "Zug zug!")
  • Acknowledgment sounds ("For the Alliance!" / "Lok tar!")
  • Work completion sounds ("Work complete!" / "Jobs done!")

Sound Factions

Alliance Units: Peasants, Knights, Mages, Elven Archers, Dwarven Demolition Squad, Naval Units

Horde Units: Orcs, Death Knights, Dragons, Goblin Sappers, Ogres, Ogre-Mages, Troll Axethrowers, Naval Units

For the complete list of sounds and examples, see:

Platform Support

  • macOS: ✅ Full support - Uses afplay for audio playback
  • Linux: ✅ Full support - Uses canberra-gtk-play for audio playback
  • Windows: ⚠️ Partial support - Toast notifications work, sound playback planned for future release
  • Toast Notifications: ✅ Cross-platform using OpenCode's built-in toast system

Windows Support Status

Current: Partial support

  • Plugin loads and initializes on Windows
  • Configuration and sound file management work
  • Toast notifications work via OpenCode TUI
  • Sound playback not yet implemented (logs warning)

Planned: Full sound playback support in future release

For detailed platform-specific setup and troubleshooting, see:

Sound Sources

All sound files are bundled with the plugin from Warcraft II archives. The plugin:

  • Includes 110+ pre-bundled WAV files in the data/ directory
  • Copies files to local storage on first use
  • No network downloads required during runtime
  • Ensures authentic game audio quality

For technical details, see:

Updating

Warning

OpenCode does NOT auto-update plugins

To get the latest version:

(cd ~ && sed -i.bak '/"@pantheon-ai\/opencode-warcraft-notifications"/d' .cache/opencode/package.json && \
rm -rf .cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications && \
echo "Plugin update script finished successfully.")
opencode  # Reinstalls latest

For more details, see the User Guide - Updating.

Development

For development instructions, see the [Development Guide](https://pantheon-org.github.io/opencode-warcraft-notifications/development/.

Quick start:

# Run tests
bun test

# Run type checking
bun run type-check

# Run linting
bun run lint

Documentation Workflow

This project uses a two-directory approach for documentation:

  • ./docs/ - Source documentation (markdown files)
  • ./pages/ - Astro Starlight build configuration

To work with documentation:

# Transform docs from source to build directory
bun run pages:transform

# Start development server with live reload
bun run pages:dev

# Build static site for production
bun run pages:build

# Preview production build
bun run pages:preview

Documentation Flow:

  1. Edit markdown files in ./docs/
  2. Run bun run pages:transform to copy to ./pages/src/content/docs/
  3. Run bun run pages:build to generate static site in ./pages/dist/
  4. GitHub Actions automatically deploys to docs branch → GitHub Pages

For more details, see the Development Guide - Documentation.

Debugging

To debug the plugin and see detailed logging:

# Enable debug logging
DEBUG_OPENCODE=1 opencode

# Test toast notifications manually
bun run test-toast-manual.ts

The debug mode will log:

  • All event types received by the plugin
  • Message text saved for idle summaries
  • Session idle events and handling
  • Toast notification attempts and results
  • Sound file selection and playback

See the [Development Guide](https://pantheon-org.github.io/opencode-warcraft-notifications/development/ for complete development workflow, testing strategies, and contributing guidelines.


Troubleshooting

Having issues? Check these resources:

Contributing

We welcome contributions! Please see:

License

MIT License - see LICENSE file for details.

Support


"Work complete!" - Warcraft II Peasant
"Zug zug!" - Warcraft II Orc