agentbox-sdk 0.1.522 → 0.1.523

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.
@@ -15,12 +15,12 @@ import {
15
15
  parseHarnessCommandInvocation,
16
16
  resolveHarnessCommand,
17
17
  skillDirective
18
- } from "../chunk-EQ5AFLAW.js";
18
+ } from "../chunk-PFGHRDL4.js";
19
19
  import "../chunk-AE2FQ6YU.js";
20
20
  import {
21
21
  AGENT_RESERVED_PORTS,
22
22
  collectAllAgentReservedPorts
23
- } from "../chunk-D4LSWCFA.js";
23
+ } from "../chunk-55PSWQJZ.js";
24
24
  import "../chunk-NSJM57Z4.js";
25
25
  import {
26
26
  AgentProvider
@@ -10,7 +10,7 @@ import {
10
10
  sleep,
11
11
  suppressUnhandledRejection,
12
12
  time
13
- } from "./chunk-D4LSWCFA.js";
13
+ } from "./chunk-55PSWQJZ.js";
14
14
  import {
15
15
  shellQuote,
16
16
  toShellCommand
@@ -20,7 +20,7 @@ import {
20
20
  sleep,
21
21
  time,
22
22
  waitFor
23
- } from "./chunk-D4LSWCFA.js";
23
+ } from "./chunk-55PSWQJZ.js";
24
24
  import {
25
25
  shellQuote
26
26
  } from "./chunk-NSJM57Z4.js";
@@ -3518,30 +3518,35 @@ async function fetchWithDaemonRetry(input, init) {
3518
3518
  async function* parseNdjsonStream(body) {
3519
3519
  const reader = body.getReader();
3520
3520
  const decoder = new TextDecoder();
3521
- let buffer = "";
3522
- while (true) {
3523
- const { done, value } = await reader.read();
3524
- if (done) break;
3525
- buffer += decoder.decode(value, { stream: true });
3526
- let idx;
3527
- while ((idx = buffer.indexOf("\n")) !== -1) {
3528
- const line = buffer.slice(0, idx).trim();
3529
- buffer = buffer.slice(idx + 1);
3530
- if (line) {
3531
- try {
3532
- yield JSON.parse(line);
3533
- } catch {
3534
- }
3535
- }
3536
- }
3537
- }
3538
- buffer += decoder.decode();
3539
- if (buffer.trim()) {
3521
+ let pending = [];
3522
+ const parse = (line) => {
3540
3523
  try {
3541
- yield JSON.parse(buffer);
3524
+ return { value: JSON.parse(line) };
3542
3525
  } catch {
3526
+ return void 0;
3543
3527
  }
3544
- }
3528
+ };
3529
+ while (true) {
3530
+ const { done, value } = await reader.read();
3531
+ if (done) break;
3532
+ const text2 = decoder.decode(value, { stream: true });
3533
+ let start = 0;
3534
+ let idx = text2.indexOf("\n");
3535
+ while (idx !== -1) {
3536
+ pending.push(text2.slice(start, idx));
3537
+ const line = pending.join("").trim();
3538
+ pending = [];
3539
+ start = idx + 1;
3540
+ const parsed2 = line ? parse(line) : void 0;
3541
+ if (parsed2) yield parsed2.value;
3542
+ idx = text2.indexOf("\n", start);
3543
+ }
3544
+ if (start < text2.length) pending.push(text2.slice(start));
3545
+ }
3546
+ pending.push(decoder.decode());
3547
+ const tail = pending.join("").trim();
3548
+ const parsed = tail ? parse(tail) : void 0;
3549
+ if (parsed) yield parsed.value;
3545
3550
  }
3546
3551
  async function daemonBaseUrl(sandbox) {
3547
3552
  const url = await sandbox.getPreviewLink(DAEMON_PORT);
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  parseHarnessCommandInvocation,
16
16
  resolveHarnessCommand,
17
17
  skillDirective
18
- } from "./chunk-EQ5AFLAW.js";
18
+ } from "./chunk-PFGHRDL4.js";
19
19
  import {
20
20
  ProviderLogAssembler,
21
21
  createNormalizedEvent,
@@ -27,11 +27,11 @@ import {
27
27
  Sandbox,
28
28
  SandboxAdapter,
29
29
  buildGitCloneCommand
30
- } from "./chunk-ZQUE5KT6.js";
30
+ } from "./chunk-OGV5XZWI.js";
31
31
  import {
32
32
  AGENT_RESERVED_PORTS,
33
33
  collectAllAgentReservedPorts
34
- } from "./chunk-D4LSWCFA.js";
34
+ } from "./chunk-55PSWQJZ.js";
35
35
  import "./chunk-NSJM57Z4.js";
36
36
  import {
37
37
  AgentProvider,
@@ -2,8 +2,8 @@ import {
2
2
  Sandbox,
3
3
  SandboxAdapter,
4
4
  buildGitCloneCommand
5
- } from "../chunk-ZQUE5KT6.js";
6
- import "../chunk-D4LSWCFA.js";
5
+ } from "../chunk-OGV5XZWI.js";
6
+ import "../chunk-55PSWQJZ.js";
7
7
  import "../chunk-NSJM57Z4.js";
8
8
  import {
9
9
  SandboxProvider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentbox-sdk",
3
- "version": "0.1.522",
3
+ "version": "0.1.523",
4
4
  "description": "Swappable coding agents and sandbox providers for Bun and TypeScript.",
5
5
  "license": "MIT",
6
6
  "repository": {
File without changes