refactor(stream-parsing): restructured stream utilities to use Web standard APIs and generic SSE parsing

- Refactored SSE stream parsing to use generic `readSseJson` utility instead of domain-specific handlers across multiple packages.
- Migrated from Node.js Buffer API to Web standard APIs (Uint8Array, TextDecoder, DataView) for cross-platform compatibility.
- Simplified stream transformation pipeline by consolidating multiple stream operations into unified `createTextLineSplitter` utility.
- Refactored `ptree.ts` to remove complex stream pumping infrastructure and simplify stderr handling with direct async iteration.
- Rewrote stream utilities to operate at binary level with byte-level parsing for improved efficiency and reduced string allocations.
- Updated TypeScript configuration to include DOM.AsyncIterable type definitions for async iterable DOM API support.
This commit is contained in:
can1357
2026-02-05 10:59:47 +01:00
parent 251d5a91ef
commit 1f7c4f6f90
39 changed files with 679 additions and 714 deletions
@@ -49,7 +49,7 @@ export async function processFileArguments(fileArgs: string[], options?: Process
if (mimeType) {
// Handle image file
const base64Content = buffer.toString("base64");
const base64Content = buffer.toBase64();
let attachment: ImageContent;
let dimensionNote: string | undefined;