type alias ResponseChunk

Daemon → client: one streamed response chunk in the per-request stream.

const chunks: ResponseChunk[] = [
  { type: 'stdout', data: 'ok 1 Cart: checkout\n' },
  { type: 'done', exitCode: 0 }, // exactly one terminal chunk ends the stream
];
chunks[1].type; // 'done'

Definition

{ type: "stdout"; data: string; }
| { type: "result"; result: RunResult; }
| { type: "stderr"; data: string; }
| { type: "pong"; pid: number; nodeVersion: string; cwd: string; startedAt: number; }
| { type: "done"; exitCode: number; }
| { type: "fatal"; message: string; }

Usage

import { type ResponseChunk } from "lib/commands/daemon/protocol.ts";