@mohak34/opencode-notifier 0.1.18-beta.0 → 0.1.18-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,9 +78,11 @@ Get-Content "$env:USERPROFILE\.cache\opencode\node_modules\@mohak34\opencode-not
78
78
 
79
79
  The plugin works out of the box on all platforms. For best results:
80
80
 
81
- - **macOS**: No additional setup required
82
- - **Windows**: No additional setup required
83
- - **Linux**: For sounds, one of these should be installed: `paplay`, `aplay`, `mpv`, or `ffplay`. For notifications, `notify-send` is recommended.
81
+ - **macOS**: No additional setup required. Notifications display the Script Editor icon (custom icons not supported with osascript for reliability)
82
+ - **Windows**: No additional setup required. The OpenCode icon displays in notifications
83
+ - **Linux**: For sounds, one of these should be installed: `paplay`, `aplay`, `mpv`, or `ffplay`. For notifications, `notify-send` is recommended. The OpenCode icon displays in notifications
84
+
85
+ **Note**: To disable icons, set `showIcon: false` in your configuration.
84
86
 
85
87
  ## Configuration
86
88
 
@@ -92,6 +94,7 @@ To customize the plugin, create `~/.config/opencode/opencode-notifier.json`:
92
94
  "notification": true,
93
95
  "timeout": 5,
94
96
  "showProjectName": true,
97
+ "showIcon": true,
95
98
  "command": {
96
99
  "enabled": false,
97
100
  "path": "/path/to/command",
@@ -130,6 +133,7 @@ To customize the plugin, create `~/.config/opencode/opencode-notifier.json`:
130
133
  | `notification` | boolean | `true` | Global toggle for all notifications |
131
134
  | `timeout` | number | `5` | Notification duration in seconds (Linux only) |
132
135
  | `showProjectName` | boolean | `true` | Show project folder name in notification title |
136
+ | `showIcon` | boolean | `true` | Show OpenCode icon in notifications |
133
137
  | `command` | object | — | Command execution settings (enabled/path/args/minDuration) |
134
138
 
135
139
  ### Events
package/dist/index.js CHANGED
@@ -3743,6 +3743,7 @@ var DEFAULT_CONFIG = {
3743
3743
  notification: true,
3744
3744
  timeout: 5,
3745
3745
  showProjectName: true,
3746
+ showIcon: true,
3746
3747
  command: {
3747
3748
  enabled: false,
3748
3749
  path: "",
@@ -3810,6 +3811,7 @@ function loadConfig() {
3810
3811
  notification: globalNotification,
3811
3812
  timeout: typeof userConfig.timeout === "number" && userConfig.timeout > 0 ? userConfig.timeout : DEFAULT_CONFIG.timeout,
3812
3813
  showProjectName: userConfig.showProjectName ?? DEFAULT_CONFIG.showProjectName,
3814
+ showIcon: userConfig.showIcon ?? DEFAULT_CONFIG.showIcon,
3813
3815
  command: {
3814
3816
  enabled: typeof userCommand.enabled === "boolean" ? userCommand.enabled : DEFAULT_CONFIG.command.enabled,
3815
3817
  path: typeof userCommand.path === "string" ? userCommand.path : DEFAULT_CONFIG.command.path,
@@ -3854,11 +3856,14 @@ function getMessage(config, event) {
3854
3856
  function getSoundPath(config, event) {
3855
3857
  return config.sounds[event];
3856
3858
  }
3857
- function getIconPath() {
3859
+ function getIconPath(config) {
3860
+ if (!config.showIcon) {
3861
+ return;
3862
+ }
3858
3863
  try {
3859
3864
  const __filename2 = fileURLToPath(import.meta.url);
3860
3865
  const __dirname2 = dirname(__filename2);
3861
- const iconPath = join(__dirname2, "..", "..", "logos", "opencode-logo-dark.png");
3866
+ const iconPath = join(__dirname2, "..", "logos", "opencode-logo-dark.png");
3862
3867
  if (existsSync(iconPath)) {
3863
3868
  return iconPath;
3864
3869
  }
@@ -4043,7 +4048,7 @@ async function handleEvent(config, eventType, projectName, elapsedSeconds) {
4043
4048
  const message = getMessage(config, eventType);
4044
4049
  if (isEventNotificationEnabled(config, eventType)) {
4045
4050
  const title = getNotificationTitle(config, projectName);
4046
- const iconPath = getIconPath();
4051
+ const iconPath = getIconPath(config);
4047
4052
  promises.push(sendNotification(title, message, config.timeout, iconPath));
4048
4053
  }
4049
4054
  if (isEventSoundEnabled(config, eventType)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohak34/opencode-notifier",
3
- "version": "0.1.18-beta.0",
3
+ "version": "0.1.18-beta.2",
4
4
  "description": "OpenCode plugin that sends system notifications and plays sounds when permission is needed, generation completes, or errors occur",
5
5
  "author": "mohak34",
6
6
  "license": "MIT",