@pi-archimedes/notify 2.9.0 → 2.9.1
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/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/notify-osc99.test.ts +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-archimedes/notify",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/danielcherubini/pi-archimedes.git"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
".": "./src/index.ts"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@pi-archimedes/core": "2.9.
|
|
21
|
+
"@pi-archimedes/core": "2.9.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@earendil-works/pi-coding-agent": ">=0.84.4",
|
package/src/index.ts
CHANGED
|
@@ -66,7 +66,7 @@ export function notifyOSC9(message: string): void {
|
|
|
66
66
|
/** OSC 99 — Kitty terminal */
|
|
67
67
|
export function notifyOSC99(title: string, body: string): void {
|
|
68
68
|
const seq1 = `\x1b]99;i=1:d=0;${title}\x1b\\`;
|
|
69
|
-
const seq2 = `\x1b]99;i=1:p
|
|
69
|
+
const seq2 = `\x1b]99;i=1:p=body;${body}\x1b\\`;
|
|
70
70
|
process.stderr.write(wrapForTmux(seq1));
|
|
71
71
|
process.stderr.write(wrapForTmux(seq2));
|
|
72
72
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { notifyOSC99 } from "./index.js";
|
|
3
|
+
|
|
4
|
+
describe("notifyOSC99", () => {
|
|
5
|
+
afterEach(() => {
|
|
6
|
+
vi.restoreAllMocks();
|
|
7
|
+
vi.unstubAllEnvs();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("emits the body text as the OSC 99 body payload, not as the payload type", () => {
|
|
11
|
+
vi.stubEnv("TMUX", "");
|
|
12
|
+
const write = vi.spyOn(process.stderr, "write").mockImplementation(() => true);
|
|
13
|
+
|
|
14
|
+
notifyOSC99("Pi", "Task complete — waiting for input");
|
|
15
|
+
|
|
16
|
+
expect(write.mock.calls.map(([chunk]) => chunk)).toEqual([
|
|
17
|
+
"\x1b]99;i=1:d=0;Pi\x1b\\",
|
|
18
|
+
"\x1b]99;i=1:p=body;Task complete — waiting for input\x1b\\",
|
|
19
|
+
]);
|
|
20
|
+
});
|
|
21
|
+
});
|