dondon-notify 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 kdcokenny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # opencode-notify
2
+
3
+ > Know when your AI needs you back. Native OS notifications for OpenCode.
4
+
5
+ A plugin for [OpenCode](https://github.com/sst/opencode) that delivers native desktop notifications when tasks complete, errors occur, or the AI needs your input. Stop tab-switching to check if it's done.
6
+
7
+ ## Why This Exists
8
+
9
+ You delegate a task and switch to another window. Now you're checking back every 30 seconds. Did it finish? Did it error? Is it waiting for permission?
10
+
11
+ This plugin solves that:
12
+
13
+ - **Stay focused** - Work in other apps. A notification arrives when the AI needs you.
14
+ - **Native feel** - Uses macOS Notification Center, Windows Toast, or Linux notify-send.
15
+ - **Smart defaults** - Won't spam you. Only notifies for meaningful events, and only when you're not already looking at the terminal.
16
+
17
+ ## Installation
18
+
19
+ **Option 1: Local install (recommended for development)**
20
+
21
+ Copy the plugin directly:
22
+
23
+ ```bash
24
+ mkdir -p .opencode/plugin
25
+ cp /path/to/opencode-notify/src/notify.ts .opencode/plugin/dondon-notify.ts
26
+ cp -r /path/to/opencode-notify/src/plugin/kdco-primitives .opencode/plugin/
27
+ cd .opencode && bun add node-notifier detect-terminal
28
+ ```
29
+
30
+ Then add to your `opencode.jsonc`:
31
+ ```jsonc
32
+ {
33
+ "plugin": ["dondon-notify"]
34
+ }
35
+ ```
36
+
37
+ **Option 2: Via OCX with local file:// registry**
38
+
39
+ Add to your project's `ocx.jsonc`:
40
+ ```jsonc
41
+ {
42
+ "registries": {
43
+ "local": {
44
+ "url": "file:///path/to/opencode-notify"
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ Then install:
51
+ ```bash
52
+ ocx add local/dondon-notify
53
+ ```
54
+
55
+ ## How It Works
56
+
57
+ > "Notify the human when the AI needs them back, not for every micro-event."
58
+
59
+ | Event | Notifies? | Sound | Why |
60
+ |-------|-----------|-------|-----|
61
+ | Session complete | Yes | Glass | Main task done - time to review |
62
+ | Session error | Yes | Basso | Something broke - needs attention |
63
+ | Permission needed | Yes | Submarine | AI is blocked, waiting for you |
64
+ | Sub-task complete | No | - | Parent session handles orchestration |
65
+
66
+ The plugin automatically:
67
+ 1. Detects your terminal emulator (supports 37+ terminals)
68
+ 2. Suppresses notifications when your terminal is focused
69
+ 3. Enables click-to-focus on macOS (click notification → terminal foregrounds)
70
+
71
+ ## Platform Support
72
+
73
+ | Feature | macOS | Windows | Linux |
74
+ |---------|-------|---------|-------|
75
+ | Native notifications | Yes | Yes | Yes |
76
+ | Custom sounds | Yes | No | No |
77
+ | Focus detection | Yes | No | Kitty, GNOME Terminal* |
78
+ | Click-to-focus | Yes | No | Kitty |
79
+ | Terminal detection | Yes | Yes | Yes |
80
+
81
+ \* Focus detection on Linux requires xprop and is currently implemented for Kitty
82
+
83
+ ## Configuration (Optional)
84
+
85
+ Works out of the box. To customize, create `~/.config/opencode/dondon-notify.json`:
86
+
87
+ ```json
88
+ {
89
+ "enabled": true,
90
+ "notifyChildSessions": false,
91
+ "suppressWhenFocused": true,
92
+ "sounds": {
93
+ "idle": "Glass",
94
+ "error": "Basso",
95
+ "permission": "Submarine"
96
+ },
97
+ "kitty": {
98
+ "enabled": true,
99
+ "sounds": false,
100
+ "focusOnClick": true
101
+ }
102
+ }
103
+ ```
104
+
105
+ **Available macOS sounds:** Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink
106
+
107
+ **Kitty configuration:** The `kitty` section allows you to customize Kitty-specific behavior:
108
+ - `enabled`: Use native Kitty notifications (default: true)
109
+ - `sounds`: Enable notification sounds (default: false, Kitty doesn't support sounds)
110
+ - `focusOnClick`: Focus terminal when notification is clicked (default: true)
111
+
112
+ ## FAQ
113
+
114
+ ### Does this add bloat to my context?
115
+
116
+ Minimal footprint. The plugin is event-driven - it listens for session events and fires notifications. No tools are added to your conversation, no prompts are injected beyond initial setup.
117
+
118
+ ### Will I get spammed with notifications?
119
+
120
+ No. Smart defaults prevent noise:
121
+ - Only notifies for parent sessions (not every sub-task)
122
+ - Suppresses when your terminal is the active window
123
+ - Batches notifications when multiple delegations complete together
124
+
125
+ ### Can I disable it temporarily?
126
+
127
+ Set `"enabled": false` in the config file, or delete the config to return to defaults.
128
+
129
+ ## Supported Terminals
130
+
131
+ Uses [`detect-terminal`](https://github.com/jonschlinkert/detect-terminal) to automatically identify your terminal. Supports 37+ terminals including:
132
+
133
+ Ghostty, Kitty, iTerm2, WezTerm, Alacritty, Hyper, Terminal.app, Windows Terminal, VS Code integrated terminal, and many more.
134
+
135
+ ### Enhanced Kitty Support
136
+
137
+ When running in **Kitty on Linux**, the plugin provides enhanced features:
138
+
139
+ - **Native Kitty notifications** using OSC 99 escape codes for better integration
140
+ - **Click-to-focus** notifications automatically bring Kitty to the foreground
141
+ - **Improved focus detection** using xprop and Kitty's WINDOWID
142
+ - **Optimized performance** with direct terminal communication
143
+
144
+ Kitty notifications are more responsive and integrate seamlessly with the terminal environment.
145
+
146
+ ## Manual Installation
147
+
148
+ If you prefer not to use OCX, copy the source from [`src/`](./src) to `.opencode/plugin/`.
149
+
150
+ **Caveats:**
151
+ - Manually install dependencies (`node-notifier`, `detect-terminal`)
152
+ - Updates require manual re-copying
153
+
154
+ ## Disclaimer
155
+
156
+ This project is not built by the OpenCode team and is not affiliated with [OpenCode](https://github.com/sst/opencode) in any way.
157
+
158
+ ## License
159
+
160
+ MIT
package/ocx.jsonc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://ocx.kdco.dev/schema.json",
3
+ "registries": {
4
+ "dondon": {
5
+ "url": "https://registry.dondon.haus"
6
+ }
7
+ },
8
+ "lockRegistries": false,
9
+ "skipCompatCheck": false
10
+ }
package/opencode.jsonc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json"
3
+ // Add MCP servers, tools, plugins here
4
+ }
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "dondon-notify",
3
+ "version": "0.1.0",
4
+ "description": "Native OS notifications for OpenCode - know when tasks complete",
5
+ "type": "module",
6
+ "main": "src/notify.ts",
7
+ "exports": {
8
+ ".": "./src/notify.ts"
9
+ },
10
+ "dependencies": {
11
+ "detect-terminal": "^1.0.0",
12
+ "node-notifier": "^10.0.1"
13
+ },
14
+ "peerDependencies": {
15
+ "@opencode-ai/plugin": ">=1.0.0",
16
+ "@opencode-ai/sdk": ">=1.0.0"
17
+ },
18
+ "keywords": [
19
+ "opencode",
20
+ "opencode-plugin",
21
+ "notifications",
22
+ "desktop-notifications"
23
+ ],
24
+ "author": "Scott Hyndman <scotty.hyndman@gmail.com>",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/shyndman/opencode-notify.git"
29
+ }
30
+ }
package/registry.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://ocx.kdco.dev/schema/registry.json",
3
+ "name": "dondon-notify",
4
+ "description": "Native OS notifications for OpenCode - know when tasks complete",
5
+ "components": [
6
+ {
7
+ "name": "dondon-notify",
8
+ "description": "Native desktop notifications with terminal detection and focus awareness",
9
+ "type": "ocx:plugin",
10
+ "npmDependencies": ["node-notifier", "detect-terminal"],
11
+ "files": [
12
+ {
13
+ "path": "src/notify.ts",
14
+ "target": "plugin/dondon-notify.ts"
15
+ }
16
+ ]
17
+ }
18
+ ]
19
+ }