@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: () => readable,
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
- // read() also drains while a backpressured Effect adapter still has a readable listener.
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
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/util",
4
- "version": "0.0.0-dev-18774",
4
+ "version": "0.0.0-dev-18777",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {