@gonrocca/zero-pi 0.1.15 → 0.1.16

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.
@@ -83,7 +83,7 @@ export default function register(): void {
83
83
  const require = createRequire(import.meta.url);
84
84
  const cp = require("node:child_process") as {
85
85
  spawn: (...args: unknown[]) => KillableChild;
86
- execSync: (command: string, options?: unknown) => unknown;
86
+ exec: (command: string, callback: (error: unknown) => void) => unknown;
87
87
  };
88
88
 
89
89
  const originalSpawn = cp.spawn as typeof cp.spawn & { [WRAPPED]?: boolean };
@@ -92,8 +92,12 @@ export default function register(): void {
92
92
  return;
93
93
  }
94
94
 
95
+ // Fire-and-forget, ASYNC. A blocking execSync here would freeze pi's whole
96
+ // event loop on every subprocess kill — and pi kills a subprocess on most
97
+ // turns (pi-claude-cli's break-early). taskkill can take seconds or hang,
98
+ // so it must never run on the event loop.
95
99
  const exec = (command: string): void => {
96
- cp.execSync(command, { stdio: "ignore" });
100
+ cp.exec(command, () => {});
97
101
  };
98
102
 
99
103
  const patchedSpawn = function (this: unknown, ...args: unknown[]): KillableChild {
@@ -169,8 +169,13 @@ export function spinnerFrames(theme: Theme): string[] {
169
169
 
170
170
  // ── Extension entry point ──────────────────────────────────────────────────
171
171
 
172
+ /** Module guard so a double-load never stacks handlers or a second timer. */
173
+ let registered = false;
174
+
172
175
  export default function register(pi?: PiAPI): void {
173
176
  if (!pi || typeof pi.on !== "function") return;
177
+ if (registered) return;
178
+ registered = true;
174
179
 
175
180
  // The last UI handle seen on any event — the rotation timer uses it.
176
181
  let ui: PiUI | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonrocca/zero-pi",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "zero-pi — an installable layer for pi (pi.dev): the zero spec-driven development workflow, skill auto-learning, and an animated ZERO startup banner. Adds capability to pi without modifying pi.",
5
5
  "type": "module",
6
6
  "keywords": [