@diegopetrucci/pi-notify 0.1.7 → 0.1.10

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
@@ -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
 
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.10",
4
4
  "description": "A pi extension that sends a notification when the agent is ready for input.",
5
5
  "keywords": [
6
6
  "pi-package",