opencode-permission-notify 0.1.0 → 0.1.1
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 +44 -31
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# opencode-permission-notify
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Approval prompts from OpenCode, as a native macOS floating panel in the top-right
|
|
4
|
+
corner of your screen — with **Allow once / Always / Reject** buttons, so you never
|
|
5
|
+
have to switch back to the OpenCode window to answer.
|
|
5
6
|
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
- **Non-activating** — the panel is an `NSWindowStyleMaskNonactivatingPanel`; clicking a button does not bring OpenCode forward or interrupt what you are doing
|
|
8
|
+
- **Quiet when it should be** — if OpenCode is already frontmost, nothing pops up
|
|
9
|
+
- **Never lost** — answers are written back immediately; after 5 minutes the panel closes and hands the request back to the in-window prompt
|
|
10
|
+
- **No dependencies** — no terminal-notifier, no notification permission; the helper binary ships with the package
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## Install
|
|
12
13
|
|
|
13
14
|
```jsonc
|
|
14
15
|
// ~/.config/opencode/opencode.jsonc
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
}
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Or point at a local checkout while developing:
|
|
21
22
|
|
|
22
23
|
```jsonc
|
|
23
24
|
{
|
|
@@ -25,47 +26,59 @@
|
|
|
25
26
|
}
|
|
26
27
|
```
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
`~/Library/Application Support/opencode/permission-notify/bin/notify-request
|
|
29
|
+
On first load the bundled universal binary (arm64 + x86_64) is extracted to
|
|
30
|
+
`~/Library/Application Support/opencode/permission-notify/bin/notify-request`.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
**Requirements**: macOS, OpenCode V2 (desktop or TUI — the plugin runs in the
|
|
33
|
+
server).
|
|
32
34
|
|
|
33
|
-
##
|
|
35
|
+
## How it works
|
|
34
36
|
|
|
35
37
|
```
|
|
36
|
-
OpenCode
|
|
37
|
-
↓
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
OpenCode server emits permission.asked
|
|
39
|
+
↓ the plugin filters by location (only the instance owning the session's
|
|
40
|
+
directory handles it)
|
|
41
|
+
notify-request:
|
|
42
|
+
OpenCode is frontmost → exit quietly
|
|
43
|
+
otherwise draw a panel in the top-right corner and wait for a click
|
|
44
|
+
↓ stdout: index of the chosen button
|
|
42
45
|
ctx.permission.reply({ sessionID, requestID, decision })
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
The three buttons map to the `once` / `always` / `reject` decisions.
|
|
46
49
|
|
|
47
|
-
##
|
|
50
|
+
## Configuration
|
|
48
51
|
|
|
49
|
-
|
|
|
52
|
+
| Environment variable | Description |
|
|
50
53
|
| --- | --- |
|
|
51
|
-
| `PERMISSION_NOTIFY_HELPER` |
|
|
54
|
+
| `PERMISSION_NOTIFY_HELPER` | Override the helper path (rarely needed) |
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
Log file: `~/Library/Application Support/opencode/permission-notify/notify.log`
|
|
54
57
|
|
|
55
|
-
##
|
|
58
|
+
## Build from source
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
Requires Xcode Command Line Tools:
|
|
58
61
|
|
|
59
62
|
```sh
|
|
60
|
-
./build.sh #
|
|
63
|
+
./build.sh # builds bin/notify-request (universal)
|
|
61
64
|
```
|
|
62
65
|
|
|
63
|
-
##
|
|
66
|
+
## Limitations
|
|
64
67
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
+
- macOS only
|
|
69
|
+
- Panels stack by request (up to five slots); many simultaneous requests overlap slightly
|
|
70
|
+
- Rejections do not carry feedback text yet (OpenCode supports reject-with-reason; this only sends `reject`)
|
|
68
71
|
|
|
69
|
-
##
|
|
72
|
+
## License
|
|
70
73
|
|
|
71
74
|
MIT
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 中文说明
|
|
79
|
+
|
|
80
|
+
把 OpenCode 的授权请求变成屏幕右上角的 macOS 原生浮窗,带「允许一次 / 总是允许 / 拒绝」
|
|
81
|
+
三个按钮,不抢焦点、不用切回窗口;OpenCode 已在前台时不弹。通用二进制助手随包分发。
|
|
82
|
+
|
|
83
|
+
安装:在 `~/.config/opencode/opencode.jsonc` 的 `plugins` 中加 `"opencode-permission-notify"`。
|
|
84
|
+
仅支持 macOS + OpenCode V2。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-permission-notify",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Approval prompts from OpenCode as a native macOS floating panel in the top-right corner, with Allow once / Always / Reject buttons. 把 OpenCode 的授权请求变成右上角带按钮的原生浮窗。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Mingpei Wang",
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
"os": [
|
|
25
25
|
"darwin"
|
|
26
26
|
]
|
|
27
|
-
}
|
|
27
|
+
}
|