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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user