opencode-enhancer 1.1.0 → 1.2.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/README.md +93 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +539 -305
- package/dist/index.js.map +1 -1
- package/dist/providers/auth.d.ts.map +1 -1
- package/dist/providers/auth.js +81 -4
- package/dist/providers/auth.js.map +1 -1
- package/dist/settings.d.ts +1 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +45 -19
- package/dist/settings.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +76 -27
- package/dist/store.js.map +1 -1
- package/dist/types.d.ts +10 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +110 -5
- package/dist/types.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ opencode-enhancer plugins update --dry-run
|
|
|
68
68
|
|
|
69
69
|
Default paths:
|
|
70
70
|
|
|
71
|
-
- store: `~/.config/opencode-enhancer/
|
|
71
|
+
- store: `~/.config/opencode-enhancer/settings.json`
|
|
72
72
|
- logs: `~/.config/opencode-enhancer/logs/codex-soft.log`
|
|
73
73
|
- usage cache: `~/.cache/opencode-enhancer/usage-cache.json`
|
|
74
74
|
|
|
@@ -91,3 +91,95 @@ Examples:
|
|
|
91
91
|
- `OPENCODE_ENHANCER_DEBUG`
|
|
92
92
|
- `OPENCODE_ENHANCER_USAGE_BASE_URL`
|
|
93
93
|
- `OPENCODE_ENHANCER_REFRESH_QUEUE_CONCURRENCY`
|
|
94
|
+
|
|
95
|
+
Notification-specific examples:
|
|
96
|
+
|
|
97
|
+
- `OPENCODE_ENHANCER_NOTIFY=1`
|
|
98
|
+
- `OPENCODE_ENHANCER_NOTIFY_BACKEND=auto`
|
|
99
|
+
- `OPENCODE_ENHANCER_NOTIFY_BACKEND=terminal`
|
|
100
|
+
- `OPENCODE_ENHANCER_NOTIFY_BACKEND=system`
|
|
101
|
+
- `OPENCODE_ENHANCER_NOTIFY_NTFY_URL=...`
|
|
102
|
+
|
|
103
|
+
## Notification Settings JSON
|
|
104
|
+
|
|
105
|
+
Per-event notification toggles live in the persisted store JSON (`~/.config/opencode-enhancer/settings.json`, key `settings.notifications`).
|
|
106
|
+
|
|
107
|
+
Default values:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"settings": {
|
|
112
|
+
"notifications": {
|
|
113
|
+
"permissionRequest": true,
|
|
114
|
+
"taskComplete": true,
|
|
115
|
+
"error": true,
|
|
116
|
+
"question": true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
These toggles control notifications when the agent:
|
|
123
|
+
|
|
124
|
+
- asks for permissions
|
|
125
|
+
- finishes a task
|
|
126
|
+
- emits an error
|
|
127
|
+
- asks the user a question
|
|
128
|
+
|
|
129
|
+
## Terminal-native Notifications
|
|
130
|
+
|
|
131
|
+
`opencode-enhancer` can now prefer terminal-native desktop notifications emitted through OSC escape sequences instead of AppleScript-style macOS notifications.
|
|
132
|
+
|
|
133
|
+
Backend selection is controlled with:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
OPENCODE_ENHANCER_NOTIFY_BACKEND=auto
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Supported values:
|
|
140
|
+
|
|
141
|
+
- `auto` - prefer terminal-native notifications when running in a supported terminal with access to a real TTY; otherwise fall back to the existing system backend
|
|
142
|
+
- `terminal` - use terminal-native notifications only; do not fall back to the system backend
|
|
143
|
+
- `system` - always use the existing system backend (`osascript` / `terminal-notifier` on macOS)
|
|
144
|
+
|
|
145
|
+
Current terminal-native target matrix:
|
|
146
|
+
|
|
147
|
+
- Ghostty - supported via `OSC 9`
|
|
148
|
+
- iTerm2 - supported via `OSC 9`
|
|
149
|
+
- kitty - supported via legacy `OSC 9`
|
|
150
|
+
- WezTerm - supported via `OSC 9` (visibility depends on WezTerm notification settings)
|
|
151
|
+
|
|
152
|
+
Notes and limitations:
|
|
153
|
+
|
|
154
|
+
- Terminal-native notifications require the plugin process to reach the controlling terminal. The implementation first tries `/dev/tty`, then falls back to a TTY stderr/stdout stream.
|
|
155
|
+
- `tmux`, `screen`, and `zellij` are not supported in this first slice; they may intercept OSC unless passthrough is configured.
|
|
156
|
+
- On macOS/Linux, the terminal app itself must be allowed to show notifications by the OS.
|
|
157
|
+
- In WezTerm, `notification_handling` must not be set to `NeverShow`.
|
|
158
|
+
- Terminal-native notifications intentionally use a compact single-line payload. Click-to-open URLs are still only available through the existing system backend.
|
|
159
|
+
|
|
160
|
+
Quick manual checks:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Ghostty / iTerm2 / kitty / WezTerm
|
|
164
|
+
printf '\e]9;OpenCode test notification\e\\'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Repo helper for a quick smoke test:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm run notify:smoke
|
|
171
|
+
npm run notify:smoke -- --check
|
|
172
|
+
npm run notify:smoke -- --title "OpenCode smoke" --message "Ghostty/iTerm2/kitty/WezTerm"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
What it does:
|
|
176
|
+
|
|
177
|
+
- detects whether the current terminal matches the same support heuristic used by the plugin
|
|
178
|
+
- prints TTY diagnostics (`/dev/tty`, `stderr.isTTY`, `stdout.isTTY`)
|
|
179
|
+
- sends a single `OSC 9` notification when supported
|
|
180
|
+
|
|
181
|
+
If you want the old behavior regardless of terminal support:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
OPENCODE_ENHANCER_NOTIFY_BACKEND=system
|
|
185
|
+
```
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAkR/D;;;;GAIG;AACH,QAAA,MAAM,eAAe,EAAE,MA2tCtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|