@tangle-network/agent-runtime 0.85.0 → 0.87.0

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/agent.js CHANGED
@@ -1,12 +1,12 @@
1
- import "./chunk-DLAEEF26.js";
1
+ import "./chunk-VKVNDNG4.js";
2
2
  import {
3
3
  createSandboxForSpec
4
- } from "./chunk-XN5TIJGP.js";
4
+ } from "./chunk-6XCW3M7W.js";
5
5
  import "./chunk-UD4BHQMI.js";
6
6
  import "./chunk-BZF3KQ6G.js";
7
7
  import {
8
8
  mapSandboxEvent
9
- } from "./chunk-4J6RBI3K.js";
9
+ } from "./chunk-QUXZBZCS.js";
10
10
  import "./chunk-7LO5GMAO.js";
11
11
  import "./chunk-YEJR7IXO.js";
12
12
  import "./chunk-DPEUKJRO.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  iterationsToTraceStore,
3
3
  runAnalystLoop
4
- } from "./chunk-YPA5MLVE.js";
5
- import "./chunk-4J6RBI3K.js";
4
+ } from "./chunk-LCXXIL3U.js";
5
+ import "./chunk-QUXZBZCS.js";
6
6
  import "./chunk-YEJR7IXO.js";
7
7
  import "./chunk-DGUM43GV.js";
8
8
  export {
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-BZF3KQ6G.js";
19
19
  import {
20
20
  extractLlmCallEvent
21
- } from "./chunk-4J6RBI3K.js";
21
+ } from "./chunk-QUXZBZCS.js";
22
22
  import {
23
23
  harnessInvocation,
24
24
  runLocalHarness
@@ -2389,10 +2389,30 @@ async function* parseSseChatStream(body) {
2389
2389
  sep = buf.indexOf("\n\n");
2390
2390
  }
2391
2391
  }
2392
+ const tail = parseSseStreamTail(buf);
2393
+ if (tail !== void 0 && tail !== "done") yield tail;
2392
2394
  } finally {
2393
2395
  reader.releaseLock();
2394
2396
  }
2395
2397
  }
2398
+ function parseSseStreamTail(buf) {
2399
+ const tail = buf.trim();
2400
+ if (!tail) return void 0;
2401
+ const framed = parseSseFrame(tail);
2402
+ if (framed !== void 0) return framed;
2403
+ let parsed;
2404
+ try {
2405
+ parsed = JSON.parse(tail);
2406
+ } catch {
2407
+ return void 0;
2408
+ }
2409
+ if (parsed.error) {
2410
+ throw new ValidationError(
2411
+ `bridgeExecutor: bridge upstream error: ${parsed.error.message ?? parsed.error.type ?? "unknown"}`
2412
+ );
2413
+ }
2414
+ return void 0;
2415
+ }
2396
2416
  function parseSseFrame(frame) {
2397
2417
  const dataLines = [];
2398
2418
  for (const rawLine of frame.split("\n")) {
@@ -2411,7 +2431,7 @@ function parseSseFrame(frame) {
2411
2431
  }
2412
2432
  if (parsed.error) {
2413
2433
  throw new ValidationError(
2414
- `bridgeExecutor: bridge stream error: ${parsed.error.message ?? "unknown"}`
2434
+ `bridgeExecutor: bridge stream error: ${parsed.error.message ?? parsed.error.type ?? "unknown"}`
2415
2435
  );
2416
2436
  }
2417
2437
  const out = {};
@@ -6590,4 +6610,4 @@ export {
6590
6610
  createInProcessTransport,
6591
6611
  serveCoordinationMcp
6592
6612
  };
6593
- //# sourceMappingURL=chunk-XN5TIJGP.js.map
6613
+ //# sourceMappingURL=chunk-6XCW3M7W.js.map