@diegopetrucci/pi-notify 0.1.7 → 0.1.11

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.
@@ -1 +1 @@
1
- 0.79.10
1
+ 0.80.6
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # notify
2
2
 
3
- A pi extension that sends notifications when the agent finishes and is waiting for input.
3
+ A pi extension that sends notifications when the agent has fully settled and is waiting for input.
4
4
 
5
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
 
@@ -64,10 +64,10 @@ Then reload pi:
64
64
 
65
65
  Config files are merged, with project config overriding global config:
66
66
 
67
- - `~/.pi/agent/extensions/notify.json`
68
- - `<project>/.pi/notify.json`
67
+ - `~/<pi-config-dir>/agent/extensions/notify.json`
68
+ - `<project>/<pi-config-dir>/notify.json`
69
69
 
70
- Project config is only read after Pi reports that the project is trusted.
70
+ Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default). Project config is only read after Pi reports that the project is trusted.
71
71
 
72
72
  A ready-to-copy sample file is included at [`notify.example.json`](./notify.example.json).
73
73
 
@@ -137,7 +137,7 @@ You can also customize the sound backend and options if needed.
137
137
 
138
138
  ## Notes
139
139
 
140
- - Hooks the `agent_end` event.
140
+ - Hooks the `agent_settled` event so automatic retries, compaction retries, and queued follow-ups do not trigger intermediate notifications.
141
141
  - Default message is `Pi` / `Ready for input`.
142
142
  - Terminal, desktop, bell, and sound channels can be enabled independently.
143
143
  - To opt into sound playback, set `channels.sound` to `true`.
package/index.ts CHANGED
@@ -9,17 +9,15 @@
9
9
  * - sound playback
10
10
  *
11
11
  * Config files (project overrides global):
12
- * - ~/.pi/agent/extensions/notify.json
13
- * - <cwd>/.pi/notify.json, when the project is trusted
12
+ * - ~/<pi-config-dir>/agent/extensions/notify.json
13
+ * - <cwd>/<pi-config-dir>/notify.json, when the project is trusted
14
14
  */
15
15
 
16
16
  import { execFile } from "node:child_process";
17
17
  import { existsSync, readFileSync } from "node:fs";
18
18
  import { join } from "node:path";
19
19
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
20
- import { getAgentDir } from "@earendil-works/pi-coding-agent";
21
-
22
- const CONFIG_DIR_NAME = ".pi";
20
+ import { CONFIG_DIR_NAME, getAgentDir } from "@earendil-works/pi-coding-agent";
23
21
 
24
22
  type TerminalBackend = "auto" | "osc777" | "osc99" | "none";
25
23
  type DesktopBackend = "auto" | "macos" | "linux" | "windows-toast" | "none";
@@ -257,7 +255,7 @@ async function playSound(config: NotifyConfig, backend: Exclude<SoundBackend, "a
257
255
  }
258
256
 
259
257
  export default function notifyExtension(pi: ExtensionAPI) {
260
- pi.on("agent_end", async (_event, ctx) => {
258
+ pi.on("agent_settled", async (_event, ctx) => {
261
259
  const config = loadConfig(ctx);
262
260
  if (!config.enabled) return;
263
261
  if (config.onlyWhenInteractive && !ctx.hasUI) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-notify",
3
- "version": "0.1.7",
3
+ "version": "0.1.11",
4
4
  "description": "A pi extension that sends a notification when the agent is ready for input.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,5 +30,9 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@earendil-works/pi-coding-agent": "*"
33
+ },
34
+ "type": "module",
35
+ "engines": {
36
+ "node": ">=22.19.0"
33
37
  }
34
38
  }