kimetsu-pi 0.1.0 → 0.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/extensions/kimetsu.ts +19 -3
- package/package.json +1 -1
package/extensions/kimetsu.ts
CHANGED
|
@@ -8,16 +8,32 @@ import { spawn } from "node:child_process";
|
|
|
8
8
|
|
|
9
9
|
function kimetsuExec(args: string[]): Promise<void> {
|
|
10
10
|
return new Promise((resolve) => {
|
|
11
|
+
let settled = false;
|
|
12
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
13
|
+
const done = () => {
|
|
14
|
+
if (settled) return;
|
|
15
|
+
settled = true;
|
|
16
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
17
|
+
resolve();
|
|
18
|
+
};
|
|
11
19
|
try {
|
|
12
20
|
const child = spawn("kimetsu", args, {
|
|
13
21
|
stdio: "ignore",
|
|
14
22
|
shell: false,
|
|
15
23
|
windowsHide: true,
|
|
16
24
|
});
|
|
17
|
-
|
|
18
|
-
child.
|
|
25
|
+
// A hung binary must never stall the lifecycle hook: cap the wait and
|
|
26
|
+
// kill the child if it overruns. unref() so the timer alone can't keep
|
|
27
|
+
// the host process alive.
|
|
28
|
+
timer = setTimeout(() => {
|
|
29
|
+
child.kill();
|
|
30
|
+
done();
|
|
31
|
+
}, 10000);
|
|
32
|
+
if (typeof timer.unref === "function") timer.unref();
|
|
33
|
+
child.on("error", done); // binary not on PATH — silent no-op
|
|
34
|
+
child.on("close", done); // finished, or killed by the timeout above
|
|
19
35
|
} catch {
|
|
20
|
-
|
|
36
|
+
done(); // any unexpected error — silent no-op
|
|
21
37
|
}
|
|
22
38
|
});
|
|
23
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kimetsu-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Kimetsu brain as a Pi.dev package — persistent cross-session memory for the Pi coding agent.",
|
|
5
5
|
"keywords": ["pi-package", "pi", "kimetsu", "memory", "extension", "skill"],
|
|
6
6
|
"homepage": "https://github.com/RodCor/kimetsu-pi#readme",
|