@zhushanwen/pi-unified-hooks 0.0.4 → 0.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhushanwen/pi-unified-hooks",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Unified hooks extension - collect scattered hooks in one place for easy maintenance",
5
5
  "main": "index.ts",
6
6
  "type": "module",
@@ -22,6 +22,9 @@ export function setupToolErrorHandler(pi: ExtensionAPI): void {
22
22
  pi.on("tool_execution_end", async (event: unknown) => {
23
23
  const e = event as ToolExecutionEndLikeEvent;
24
24
  if (!e.isError) return;
25
- console.log(`[unified-hooks] ${e.toolName} error (callId=${e.toolCallId})`);
25
+ // Tool error diagnostics are internal — surfacing to the terminal
26
+ // would leak to the input area. ctx.ui.notify is unnecessary because
27
+ // tool errors are already surfaced by Pi's own error rendering.
28
+ console.warn(`[unified-hooks] ${e.toolName} error (callId=${e.toolCallId})`);
26
29
  });
27
30
  }
package/src/index.ts CHANGED
@@ -41,11 +41,13 @@ export default function unifiedHooksExtension(pi: ExtensionAPI): void {
41
41
  }
42
42
  }
43
43
 
44
- // Log hook status on session start for debugging
44
+ // Hook status is an internal diagnostic — surfacing to the terminal
45
+ // would leak to the input area. Use console.warn (stderr) for
46
+ // development debugging; production should be silent.
45
47
  pi.on("session_start", () => {
46
48
  const enabled = hooks.filter((h) => h.enabled).map((h) => h.name);
47
49
  const disabled = hooks.filter((h) => !h.enabled).map((h) => h.name);
48
- console.log(
50
+ console.warn(
49
51
  `[unified-hooks] Loaded: ${enabled.join(", ") || "(none)"}${
50
52
  disabled.length ? ` | Failed: ${disabled.join(", ")}` : ""
51
53
  }`