pi-smart-voice-notify 0.4.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0] - 2026-05-22
4
+
5
+ ### Added
6
+ - Added `PI_SMART_NOTIFY_AGENT_ERROR_GRACE_MS` to delay agent-error notifications briefly so related idle/error state can settle before notifying.
7
+ - Added webhook destination hardening with public HTTP(S)-only validation, private/reserved host rejection, DNS validation, and DNS-pinned dispatch.
8
+
9
+ ### Changed
10
+ - Added request timeouts and a 10 MiB audio response cap for remote ElevenLabs/OpenAI-compatible TTS fetches.
11
+ - Improved Linux focus detection and moved debug log writes onto asynchronous file logging with flush support.
12
+ - Reorganized checked-in tests into the dedicated `test/` directory with webhook, TTS, Linux, sound-theme, and notification coverage.
13
+
3
14
  ## [0.4.0] - 2026-04-30
4
15
 
5
16
  ### Added
package/README.md CHANGED
@@ -16,6 +16,7 @@ Windows-optimized smart notification extension for the Pi coding agent.
16
16
  - **Voice** – auto-selectable TTS engines: Edge, espeak-ng, ElevenLabs, OpenAI-compatible, and Windows SAPI
17
17
  - **Desktop toasts** – cross-platform notifications via `node-notifier` (Windows/macOS/Linux)
18
18
  - **Webhook delivery** – optional Discord or generic HTTP webhook notifications
19
+ - Validates webhook targets as public HTTP(S) destinations and blocks localhost/private/reserved networks before dispatch
19
20
 
20
21
  - **Intelligent event detection**
21
22
  - Task completion (idle)
@@ -133,6 +134,9 @@ A starter template is provided in `config/config.example.json`. On startup, the
133
134
  | `enableErrorNotification` | boolean | `true` | Notify on errors |
134
135
  | `suppressIdleAfterError` | boolean | `true` | Skip idle notification if turn had errors |
135
136
 
137
+
138
+ Error notifications are delayed briefly before delivery so Pi can settle related turn state and suppress a redundant idle alert. Override the default 10000 ms delay with `PI_SMART_NOTIFY_AGENT_ERROR_GRACE_MS` when you need faster or slower error alerts.
139
+
136
140
  *Question notifications only work when a custom `question` tool is loaded.
137
141
 
138
142
  Forwarded permission watcher notifications use privacy-safe text, require the request `targetSessionId` to match the active Pi session, and never include raw forwarded `message` content.
@@ -188,6 +192,9 @@ Paths can be absolute or relative to the extension directory.
188
192
  | `minNotificationIntervalMs` | number | `1500` | Throttle interval between same-type notifications |
189
193
  | `debugLog` | boolean | `false` | Enable debug logging to file |
190
194
 
195
+
196
+ Webhook dispatch only attempts public `http`/`https` URLs. The extension rejects localhost-style names, `.local`/`.internal`/`.lan`/`.home.arpa` hosts, private or reserved IP literals, and hostnames whose DNS results include private or reserved addresses; validated DNS results are pinned for the outbound request. Use `PI_SMART_NOTIFY_WEBHOOK_TIMEOUT_MS` to override the default 8000 ms webhook request timeout.
197
+
191
198
  ## Notification Modes
192
199
 
193
200
  | Mode | Behavior |
package/package.json CHANGED
@@ -1,70 +1,74 @@
1
- {
2
- "name": "pi-smart-voice-notify",
3
- "version": "0.4.0",
4
- "description": "Windows-optimized smart voice, sound, and desktop notifications for Pi coding agent.",
5
- "type": "module",
6
- "main": "./index.ts",
7
- "exports": {
8
- ".": "./index.ts"
9
- },
10
- "files": [
11
- "index.ts",
12
- "src",
13
- "config/config.example.json",
14
- "assets",
15
- "README.md",
16
- "CHANGELOG.md",
17
- "LICENSE"
18
- ],
19
- "scripts": {
20
- "build": "npx --yes -p typescript@5.7.3 -p @types/node@20.17.57 tsc -p tsconfig.json --noEmit",
21
- "lint": "npm run build",
22
- "test": "node --experimental-strip-types --test src/abortable-command.test.ts src/reminder-playback.test.ts src/permission-forwarding-watcher.test.ts src/index.test.ts",
23
- "check": "npm run build && npm run test"
24
- },
25
- "keywords": [
26
- "pi-package",
27
- "pi",
28
- "pi-extension",
29
- "pi-coding-agent",
30
- "coding-agent",
31
- "voice-notify",
32
- "desktop-notification",
33
- "notifications",
34
- "voice",
35
- "audio",
36
- "text-to-speech",
37
- "tts",
38
- "windows",
39
- "linux",
40
- "macos"
41
- ],
42
- "author": "MasuRii",
43
- "license": "MIT",
44
- "repository": {
45
- "type": "git",
46
- "url": "git+https://github.com/MasuRii/pi-smart-voice-notify.git"
47
- },
48
- "homepage": "https://github.com/MasuRii/pi-smart-voice-notify#readme",
49
- "bugs": {
50
- "url": "https://github.com/MasuRii/pi-smart-voice-notify/issues"
51
- },
52
- "engines": {
53
- "node": ">=24"
54
- },
55
- "publishConfig": {
56
- "access": "public"
57
- },
58
- "pi": {
59
- "extensions": [
60
- "./index.ts"
61
- ]
62
- },
63
- "peerDependencies": {
64
- "@mariozechner/pi-coding-agent": "^0.70.6",
65
- "@mariozechner/pi-tui": "^0.70.6"
66
- },
67
- "dependencies": {
68
- "node-notifier": "^10.0.1"
69
- }
70
- }
1
+ {
2
+ "name": "pi-smart-voice-notify",
3
+ "version": "0.5.0",
4
+ "description": "Windows-optimized smart voice, sound, and desktop notifications for Pi coding agent.",
5
+ "type": "module",
6
+ "main": "./index.ts",
7
+ "exports": {
8
+ ".": "./index.ts"
9
+ },
10
+ "files": [
11
+ "index.ts",
12
+ "src",
13
+ "config/config.example.json",
14
+ "assets",
15
+ "README.md",
16
+ "CHANGELOG.md",
17
+ "LICENSE"
18
+ ],
19
+ "scripts": {
20
+ "build": "npx --yes -p typescript@5.7.3 -p @types/node@20.17.57 tsc -p tsconfig.json --noEmit",
21
+ "lint": "npm run build",
22
+ "test": "node --experimental-strip-types --test test/abortable-command.test.ts test/reminder-playback.test.ts test/permission-forwarding-watcher.test.ts test/sound-theme.test.ts test/webhook.test.ts test/linux.test.ts test/index.test.ts test/tts.test.ts",
23
+ "check": "npm run build && npm run test"
24
+ },
25
+ "keywords": [
26
+ "pi-package",
27
+ "pi",
28
+ "pi-extension",
29
+ "pi-coding-agent",
30
+ "coding-agent",
31
+ "voice-notify",
32
+ "desktop-notification",
33
+ "notifications",
34
+ "voice",
35
+ "audio",
36
+ "text-to-speech",
37
+ "tts",
38
+ "windows",
39
+ "linux",
40
+ "macos"
41
+ ],
42
+ "author": "MasuRii",
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/MasuRii/pi-smart-voice-notify.git"
47
+ },
48
+ "homepage": "https://github.com/MasuRii/pi-smart-voice-notify#readme",
49
+ "bugs": {
50
+ "url": "https://github.com/MasuRii/pi-smart-voice-notify/issues"
51
+ },
52
+ "engines": {
53
+ "node": ">=24"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "pi": {
59
+ "extensions": [
60
+ "./index.ts"
61
+ ]
62
+ },
63
+ "peerDependencies": {
64
+ "@earendil-works/pi-coding-agent": "^0.75.4",
65
+ "@earendil-works/pi-tui": "^0.75.4"
66
+ },
67
+ "dependencies": {
68
+ "node-notifier": "^10.0.1",
69
+ "undici": "^8.3.0"
70
+ },
71
+ "devDependencies": {
72
+ "@types/node": "20.17.57"
73
+ }
74
+ }
@@ -1,4 +1,4 @@
1
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
1
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
2
2
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { isAbsolute, join } from "node:path";
4
4