@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.
- package/.pi-fleet-tested-version +1 -1
- package/README.md +3 -3
- package/index.ts +4 -6
- package/package.json +1 -1
package/.pi-fleet-tested-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
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
|
-
-
|
|
68
|
-
- `<project
|
|
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
|
-
* -
|
|
13
|
-
* - <cwd
|
|
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("
|
|
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;
|