refactor: consolidated json parsing and stream utilities

- Centralized JSON parsing and stream processing logic by moving utilities from `packages/ai` to the shared `@oh-my-pi/pi-utils` package.
- Standardized import paths for JSON parsing and streaming across the agent, ai, and coding-agent packages.
- Refactored SSE stream handling to use consolidated `parseStreamingJson` logic and introduced robust error recovery for malformed container-shaped tail events.
- Cleaned up legacy bundled registry references and updated related module exports and tests to reflect the new utility structure.
This commit is contained in:
can1357
2026-06-27 00:11:42 +02:00
parent eec44769cc
commit eb4a02433c
28 changed files with 92 additions and 391 deletions
@@ -9,12 +9,7 @@ interface RenderableBlock {
}
function isRenderableBlock(value: unknown): value is RenderableBlock {
return (
value !== null &&
typeof value === "object" &&
"render" in value &&
typeof value.render === "function"
);
return value !== null && typeof value === "object" && "render" in value && typeof value.render === "function";
}
function renderPresentedBlocks(value: unknown): string {