@fyeeme/pi-peon-ping 1.1.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.1.1] - 2026-08-08
6
+
7
+ ### Changed
8
+
9
+ - Tab 标题改用 provided API:删除手写 ANSI `setTabTitle`(`process.stdout.write(\x1b]0;...\x07)`),四处调用点(`session_start`/`before_agent_start`/`agent_settled`/`tool_result`,均在 `ctx.hasUI` 守卫下)改为 `ctx.ui.setTitle(...)`——mode 感知,print/json 模式自动 no-op,不再向 stdout 写裸 ANSI。
10
+ - `Stop` 事件映射从 `agent_end` 改为 `agent_settled`(与 ExtensionAPI 实际事件名一致)。
11
+
5
12
  ## [1.1.0] - 2026-07-26
6
13
 
7
14
  ### Added
package/README.md CHANGED
@@ -97,9 +97,9 @@ pi-peon-ping auto-discovers the installed `peon.sh` with the following priority
97
97
 
98
98
  When a `.ps1` file is found, it is automatically run with `powershell` instead of `bash`.
99
99
 
100
- ### peon-ping 配置
100
+ ### peon-ping configuration
101
101
 
102
- 所有 peon-ping 的功能配置通过 `peon` CLI 进行:
102
+ All peon-ping feature configuration is done through the `peon` CLI:
103
103
 
104
104
  ```bash
105
105
  peon packs use glados # Switch sound pack
package/index.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * Event mapping (pi ExtensionAPI → peon.sh hook_event_name):
15
15
  * session_start → SessionStart
16
16
  * turn_start → UserPromptSubmit
17
- * turn_end → Stop
17
+ * agent_settled → Stop
18
18
  * tool_result (event.isError === true) → PostToolUseFailure
19
19
  * session_shutdown → SessionEnd
20
20
  *
@@ -131,13 +131,9 @@ export function resolveShellAndScript(
131
131
  }
132
132
 
133
133
  // ============================================================================
134
- // Terminal tab title helpers
134
+ // Terminal tab title (via pi's mode-aware ctx.ui.setTitle)
135
135
  // ============================================================================
136
136
 
137
- export function setTabTitle(title: string): void {
138
- process.stdout.write(`\x1b]0;${title}\x07`);
139
- }
140
-
141
137
  // ============================================================================
142
138
  // Session ID helpers
143
139
  // ============================================================================
@@ -323,14 +319,14 @@ export default function peonPingExtension(pi: ExtensionAPI): void {
323
319
  pi.on("session_start", async (_event, ctx) => {
324
320
  const config = readPeonConfig(peonPath);
325
321
  const sessionId = getSessionId(ctx);
326
- if (ctx.hasUI) setTabTitle(`● ${projectName}: ready`);
322
+ if (ctx.hasUI) ctx.ui.setTitle(`● ${projectName}: ready`);
327
323
  firePeon(peonPath, "SessionStart", cwd, sessionId, config);
328
324
  });
329
325
 
330
326
  pi.on("before_agent_start", async (_event, ctx) => {
331
327
  const config = readPeonConfig(peonPath);
332
328
  const sessionId = getSessionId(ctx);
333
- if (ctx.hasUI) setTabTitle(`● ${projectName}: working...`);
329
+ if (ctx.hasUI) ctx.ui.setTitle(`● ${projectName}: working...`);
334
330
  firePeon(peonPath, "UserPromptSubmit", cwd, sessionId, config);
335
331
  });
336
332
 
@@ -340,10 +336,10 @@ export default function peonPingExtension(pi: ExtensionAPI): void {
340
336
  firePeon(peonPath, "PreCompact", cwd, sessionId, config);
341
337
  });
342
338
 
343
- pi.on("agent_end", async (_event, ctx) => {
339
+ pi.on("agent_settled", async (_event, ctx) => {
344
340
  const config = readPeonConfig(peonPath);
345
341
  const sessionId = getSessionId(ctx);
346
- if (ctx.hasUI) setTabTitle(`✓ ${projectName}: done`);
342
+ if (ctx.hasUI) ctx.ui.setTitle(`✓ ${projectName}: done`);
347
343
  firePeon(peonPath, "Stop", cwd, sessionId, config);
348
344
  });
349
345
 
@@ -351,7 +347,7 @@ export default function peonPingExtension(pi: ExtensionAPI): void {
351
347
  if (!event.isError) return;
352
348
  const config = readPeonConfig(peonPath);
353
349
  const sessionId = getSessionId(ctx);
354
- if (ctx.hasUI) setTabTitle(`✗ ${projectName}: error`);
350
+ if (ctx.hasUI) ctx.ui.setTitle(`✗ ${projectName}: error`);
355
351
  firePeon(peonPath, "PostToolUseFailure", cwd, sessionId, config);
356
352
  });
357
353
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fyeeme/pi-peon-ping",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "peon-ping adapter for pi — routes lifecycle events through peon.sh for sound packs, notifications, and trainer reminders.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,10 +44,10 @@
44
44
  "typecheck": "tsc"
45
45
  },
46
46
  "peerDependencies": {
47
- "@earendil-works/pi-coding-agent": ">=0.77.0"
47
+ "@earendil-works/pi-coding-agent": ">=0.84.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@earendil-works/pi-coding-agent": "0.77.0",
50
+ "@earendil-works/pi-coding-agent": "0.84.1",
51
51
  "@types/node": "22.19.19",
52
52
  "typescript": "5.9.3"
53
53
  }