@groeponline/pi-wishcraft 0.23.3 → 0.23.4
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,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.23.4] - 2026-08-20
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Command hooks, session context inject, and `/repairs` run: `setupHooks` is registered on activation.
|
|
9
|
+
- Hook runner ignores EPIPE when a command exits before reading stdin.
|
|
10
|
+
|
|
5
11
|
## [0.23.3] - 2026-08-20
|
|
6
12
|
|
|
7
13
|
### Fixed
|
package/package.json
CHANGED
|
@@ -110,12 +110,20 @@ export function runHookCommand(
|
|
|
110
110
|
finish(null);
|
|
111
111
|
});
|
|
112
112
|
child.on("close", (code) => finish(code));
|
|
113
|
+
// Hooks that exit before reading stdin (typical `exit 2` deny scripts)
|
|
114
|
+
// close the pipe; ignore EPIPE so the harness still records the exit code.
|
|
115
|
+
child.stdin?.on("error", (error: NodeJS.ErrnoException) => {
|
|
116
|
+
if (error.code === "EPIPE") return;
|
|
117
|
+
stderr += String(error);
|
|
118
|
+
});
|
|
113
119
|
|
|
114
120
|
try {
|
|
115
121
|
child.stdin?.write(JSON.stringify(payload));
|
|
116
122
|
child.stdin?.end();
|
|
117
|
-
} catch {
|
|
118
|
-
|
|
123
|
+
} catch (error) {
|
|
124
|
+
if ((error as NodeJS.ErrnoException).code !== "EPIPE") {
|
|
125
|
+
stderr += String(error);
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
});
|
|
121
129
|
}
|
|
@@ -74,11 +74,15 @@ function basePayload(
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/** Registreer de hooks + repairs op de pi extension API. */
|
|
77
|
-
export function setupHooks(
|
|
78
|
-
|
|
77
|
+
export function setupHooks(
|
|
78
|
+
pi: ExtensionAPI,
|
|
79
|
+
rt: RuntimeState,
|
|
80
|
+
cwd: string = process.cwd(),
|
|
81
|
+
): void {
|
|
82
|
+
refreshSettings(rt.currentCtx?.cwd ?? cwd);
|
|
79
83
|
|
|
80
84
|
pi.on("session_start", async () => {
|
|
81
|
-
refreshSettings(cwd);
|
|
85
|
+
refreshSettings(rt.currentCtx?.cwd ?? process.cwd());
|
|
82
86
|
if (!hooksEnabled) return;
|
|
83
87
|
const cmds = commandsFor(hooksSettings, "sessionStart");
|
|
84
88
|
if (cmds.length === 0) return;
|
|
@@ -6,6 +6,7 @@ import { registerCustomSegments } from "../../segments/index.ts";
|
|
|
6
6
|
import { readSettings } from "../settings/settings-io.ts";
|
|
7
7
|
import { registerSessionLifecycle } from "./session-lifecycle.ts";
|
|
8
8
|
import { registerCommands } from "../commands/commands.ts";
|
|
9
|
+
import { setupHooks } from "../hooks/index.ts";
|
|
9
10
|
import { setupInlineInvocation } from "../skills/inline-invocation.ts";
|
|
10
11
|
import {
|
|
11
12
|
config,
|
|
@@ -26,4 +27,5 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
26
27
|
registerSessionLifecycle(pi, rt);
|
|
27
28
|
registerCommands(pi, rt);
|
|
28
29
|
setupInlineInvocation(pi, rt);
|
|
30
|
+
setupHooks(pi, rt, process.cwd());
|
|
29
31
|
}
|