@meistrari/sandbox-sdk 1.0.6 → 1.0.7
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.
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -289,7 +289,7 @@ class SandboxClient {
|
|
|
289
289
|
throw await FetchError.from(url, "POST", res);
|
|
290
290
|
}
|
|
291
291
|
let capturedRunId;
|
|
292
|
-
let
|
|
292
|
+
let receivedTerminalEvent = false;
|
|
293
293
|
let stdoutCharsEmitted = 0;
|
|
294
294
|
let stderrCharsEmitted = 0;
|
|
295
295
|
const streamStartMs = Date.now();
|
|
@@ -344,7 +344,7 @@ class SandboxClient {
|
|
|
344
344
|
capturedRunId = event.runId;
|
|
345
345
|
}
|
|
346
346
|
if (event.type === "done" || event.type === "error") {
|
|
347
|
-
|
|
347
|
+
receivedTerminalEvent = true;
|
|
348
348
|
}
|
|
349
349
|
if (event.type === "stdout" && event.content) {
|
|
350
350
|
stdoutCharsEmitted += event.content.length;
|
|
@@ -355,7 +355,7 @@ class SandboxClient {
|
|
|
355
355
|
yield event;
|
|
356
356
|
}
|
|
357
357
|
} catch (error) {
|
|
358
|
-
if (
|
|
358
|
+
if (receivedTerminalEvent) {
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
361
|
if (!capturedRunId) {
|
|
@@ -364,7 +364,7 @@ class SandboxClient {
|
|
|
364
364
|
yield* recoverViaPolling(this, capturedRunId, stdoutCharsEmitted, stderrCharsEmitted);
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
if (!
|
|
367
|
+
if (!receivedTerminalEvent && capturedRunId) {
|
|
368
368
|
yield* recoverViaPolling(this, capturedRunId, stdoutCharsEmitted, stderrCharsEmitted);
|
|
369
369
|
}
|
|
370
370
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -287,7 +287,7 @@ class SandboxClient {
|
|
|
287
287
|
throw await FetchError.from(url, "POST", res);
|
|
288
288
|
}
|
|
289
289
|
let capturedRunId;
|
|
290
|
-
let
|
|
290
|
+
let receivedTerminalEvent = false;
|
|
291
291
|
let stdoutCharsEmitted = 0;
|
|
292
292
|
let stderrCharsEmitted = 0;
|
|
293
293
|
const streamStartMs = Date.now();
|
|
@@ -342,7 +342,7 @@ class SandboxClient {
|
|
|
342
342
|
capturedRunId = event.runId;
|
|
343
343
|
}
|
|
344
344
|
if (event.type === "done" || event.type === "error") {
|
|
345
|
-
|
|
345
|
+
receivedTerminalEvent = true;
|
|
346
346
|
}
|
|
347
347
|
if (event.type === "stdout" && event.content) {
|
|
348
348
|
stdoutCharsEmitted += event.content.length;
|
|
@@ -353,7 +353,7 @@ class SandboxClient {
|
|
|
353
353
|
yield event;
|
|
354
354
|
}
|
|
355
355
|
} catch (error) {
|
|
356
|
-
if (
|
|
356
|
+
if (receivedTerminalEvent) {
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
359
|
if (!capturedRunId) {
|
|
@@ -362,7 +362,7 @@ class SandboxClient {
|
|
|
362
362
|
yield* recoverViaPolling(this, capturedRunId, stdoutCharsEmitted, stderrCharsEmitted);
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
|
-
if (!
|
|
365
|
+
if (!receivedTerminalEvent && capturedRunId) {
|
|
366
366
|
yield* recoverViaPolling(this, capturedRunId, stdoutCharsEmitted, stderrCharsEmitted);
|
|
367
367
|
}
|
|
368
368
|
}
|