@tangle-network/agent-app 3.0.29 → 3.0.30

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.
@@ -1,24 +1,9 @@
1
+ import { type ParsedSSEEvent } from "@tangle-network/agent-core/sse";
1
2
  /**
2
- * POST-based SSE reading for the assistant chat stream. The browser
3
- * `EventSource` is GET-only and can't send a request body, so the stream is read
4
- * off a `fetch` POST response.
3
+ * Read the assistant's POST response through the shared SSE transport. The
4
+ * native EventSource is GET-only and cannot send the chat request body.
5
5
  *
6
- * The framing parser is vendored here (rather than depending on an internal SDK)
7
- * so this module stays self-contained and consumable by any host. It mirrors the
8
- * standard SSE wire format: events separated by a blank line, `event:` / `data:`
9
- * fields, `:`-prefixed comments ignored, multi-line `data:` joined with `\n`, and
10
- * each event's data JSON-parsed (falling back to the raw string).
11
- */
12
- interface ParsedSSEEvent<T = unknown> {
13
- data: T;
14
- rawData: string;
15
- eventId?: string;
16
- eventType?: string;
17
- }
18
- /**
19
- * Read a fetch `Response` body and invoke `onEvent` for each parsed SSE event
20
- * (its `eventType` plus JSON-parsed `data`), in wire order. Resolves when the
21
- * stream closes. The caller owns abort (via the fetch `signal`).
6
+ * Events retain their wire order and JSON/raw payload mapping. The shared
7
+ * reader owns UTF-8 framing, cancellation on failure, and releasing its lock.
22
8
  */
23
9
  export declare function readSSEEvents(body: ReadableStream<Uint8Array>, onEvent: (event: ParsedSSEEvent) => void): Promise<void>;
24
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "3.0.29",
3
+ "version": "3.0.30",
4
4
  "packageManager": "pnpm@11.28.8",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [