(name: string, get: () => ReadableStream<Uint8Array>)
| 39 | // Centralizes the `evaluate` + `onError` boilerplate and tags errors with the |
| 40 | // stream name so a stderr/stdout failure is greppable in logs. |
| 41 | function fromBunStream(name: string, get: () => ReadableStream<Uint8Array>) { |
| 42 | return Stream.fromReadableStream({ |
| 43 | evaluate: get, |
| 44 | onError: (cause) => new Error(`${name} stream error: ${String(cause)}`), |
| 45 | }) |
| 46 | } |
| 47 | |
| 48 | // Long-lived processes (serve, acp) all want the same stderr drain: read every |
| 49 | // chunk, push to a tail buffer, swallow stream errors (the child closing the |
no outgoing calls
no test coverage detected