MCPcopy Index your code
hub / github.com/anomalyco/opencode / fromBunStream

Function fromBunStream

packages/opencode/test/lib/cli-process.ts:41–46  ·  view source on GitHub ↗
(name: string, get: () => ReadableStream<Uint8Array>)

Source from the content-addressed store, hash-verified

39// Centralizes the `evaluate` + `onError` boilerplate and tags errors with the
40// stream name so a stderr/stdout failure is greppable in logs.
41function 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

Callers 2

forkStderrDrainFunction · 0.85
withCliFixtureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected