@opencode-ai/util 0.0.0-dev-18774 → 0.0.0-dev-18777
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.
|
@@ -196,10 +196,13 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
|
|
|
196
196
|
const capture = (readable, name) => {
|
|
197
197
|
if (!readable)
|
|
198
198
|
return Stream.empty;
|
|
199
|
+
// Bun resumes stdio on exit; retain bytes before the lazy Effect reader attaches.
|
|
200
|
+
const buffer = new PassThrough();
|
|
201
|
+
readable.on("error", (cause) => buffer.destroy(toError(cause)));
|
|
202
|
+
readable.pipe(buffer);
|
|
199
203
|
return NodeStream.fromReadable({
|
|
200
|
-
evaluate: () =>
|
|
204
|
+
evaluate: () => buffer,
|
|
201
205
|
onError: (cause) => toPlatformError(`fromReadable(${name})`, toError(cause), command),
|
|
202
|
-
closeOnDone: false,
|
|
203
206
|
}).pipe(Stream.interruptWhen(Deferred.await(stopOutput)), Stream.ensuring(Effect.gen(function* () {
|
|
204
207
|
// Only the capture deadline transfers the reader back to the process scope.
|
|
205
208
|
if (yield* Deferred.isDone(stopOutput))
|
|
@@ -264,7 +267,8 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
|
|
|
264
267
|
const discard = (readable) => {
|
|
265
268
|
if (!readable || readable.destroyed)
|
|
266
269
|
return;
|
|
267
|
-
|
|
270
|
+
readable.unpipe();
|
|
271
|
+
// Discard descendant output without refilling a capture buffer that is no longer consumed.
|
|
268
272
|
const drain = () => {
|
|
269
273
|
while (readable.read() !== null) { }
|
|
270
274
|
};
|