@mjasnikovs/pi-task 0.40.36 → 0.40.37

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.
@@ -9,6 +9,8 @@ export declare const CHILD_BASE_ARGS: readonly ["--print", "--no-skills", "--no-
9
9
  export interface WritableLike {
10
10
  write(chunk: string): boolean;
11
11
  end(): void;
12
+ /** Optional so a mock stdin stays two methods; a real pipe always has it. */
13
+ on?(event: 'error', listener: (err: unknown) => void): unknown;
12
14
  }
13
15
  export interface ProcLike extends EventEmitter {
14
16
  /** Present only when the child was spawned with stdin 'pipe' (prompt delivery). */
@@ -236,6 +236,10 @@ export function runChild(spawn, invocation, cwd, signal, opts) {
236
236
  ...(invocation.env ? { env: invocation.env } : {})
237
237
  });
238
238
  if (usesStdin) {
239
+ // A child killed before it read the prompt leaves the pipe broken, and an
240
+ // unhandled EPIPE on stdin takes the whole process down. The child's own
241
+ // exit is what reports that run; this write has nothing left to say.
242
+ proc.stdin?.on?.('error', () => { });
239
243
  // pi reads the prompt from stdin and waits for EOF, so write then end.
240
244
  proc.stdin?.write(invocation.stdin);
241
245
  proc.stdin?.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.40.36",
3
+ "version": "0.40.37",
4
4
  "description": "Deterministic task planning and spec-orchestration for local models — crash-safe /task pipelines with verify/enforce gates, a real-time remote web view, and web/docs/fetch/worker subagent tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",