@diegopetrucci/pi-notify 0.1.1 → 0.1.3
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 +20 -4
- package/index.ts +3 -3
- package/notify.example.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A pi extension that sends notifications when the agent finishes and is waiting for input.
|
|
4
4
|
|
|
5
|
-
This started from the original `notify.ts` example in [`
|
|
5
|
+
This started from the original `notify.ts` example in [`earendil-works/pi-mono`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/examples/extensions/notify.ts), but now supports multiple notification channels and JSON configuration.
|
|
6
6
|
|
|
7
7
|
## Supported notification channels
|
|
8
8
|
|
|
@@ -24,12 +24,13 @@ This started from the original `notify.ts` example in [`badlogic/pi-mono`](https
|
|
|
24
24
|
- Linux sound playback via `canberra-gtk-play` or `paplay`
|
|
25
25
|
- Windows beep via `powershell.exe`
|
|
26
26
|
|
|
27
|
-
By default,
|
|
27
|
+
By default, these channels are enabled:
|
|
28
28
|
|
|
29
29
|
- terminal notification
|
|
30
30
|
- desktop notification
|
|
31
31
|
- bell
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
Sound remains available as an opt-in option via config.
|
|
33
34
|
|
|
34
35
|
The extension automatically picks the appropriate backend for the current environment.
|
|
35
36
|
|
|
@@ -80,7 +81,7 @@ Example:
|
|
|
80
81
|
"terminal": true,
|
|
81
82
|
"desktop": true,
|
|
82
83
|
"bell": true,
|
|
83
|
-
"sound":
|
|
84
|
+
"sound": false
|
|
84
85
|
},
|
|
85
86
|
"terminal": {
|
|
86
87
|
"backend": "auto"
|
|
@@ -99,6 +100,20 @@ Example:
|
|
|
99
100
|
}
|
|
100
101
|
```
|
|
101
102
|
|
|
103
|
+
### Enable sound
|
|
104
|
+
|
|
105
|
+
Minimal example:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"channels": {
|
|
110
|
+
"sound": true
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
You can also customize the sound backend and options if needed.
|
|
116
|
+
|
|
102
117
|
### Config fields
|
|
103
118
|
|
|
104
119
|
- `enabled`: master on/off switch
|
|
@@ -123,3 +138,4 @@ Example:
|
|
|
123
138
|
- Hooks the `agent_end` event.
|
|
124
139
|
- Default message is `Pi` / `Ready for input`.
|
|
125
140
|
- Terminal, desktop, bell, and sound channels can be enabled independently.
|
|
141
|
+
- To opt into sound playback, set `channels.sound` to `true`.
|
package/index.ts
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
import { execFile } from "node:child_process";
|
|
17
17
|
import { existsSync, readFileSync } from "node:fs";
|
|
18
18
|
import { join } from "node:path";
|
|
19
|
-
import type { ExtensionAPI } from "@
|
|
20
|
-
import { getAgentDir } from "@
|
|
19
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
20
|
+
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
21
21
|
|
|
22
22
|
type TerminalBackend = "auto" | "osc777" | "osc99" | "none";
|
|
23
23
|
type DesktopBackend = "auto" | "macos" | "linux" | "windows-toast" | "none";
|
|
@@ -59,7 +59,7 @@ const DEFAULT_CONFIG: NotifyConfig = {
|
|
|
59
59
|
terminal: true,
|
|
60
60
|
desktop: true,
|
|
61
61
|
bell: true,
|
|
62
|
-
sound:
|
|
62
|
+
sound: false,
|
|
63
63
|
},
|
|
64
64
|
terminal: {
|
|
65
65
|
backend: "auto",
|
package/notify.example.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopetrucci/pi-notify",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A pi extension that sends a notification when the agent is ready for input.",
|
|
5
5
|
"keywords": ["pi-package", "pi", "notification", "terminal"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@
|
|
26
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
27
27
|
}
|
|
28
28
|
}
|