Compare commits

..
Author SHA1 Message Date
Chris Tate 07de14b686 fix(image,react-pdf): resolve Buffer/stream type errors breaking build
@resvg/resvg-js's asPng() and @react-pdf/renderer's renderToBuffer()
return Node Buffer, which no longer satisfies the declared Uint8Array
return types under the current @types/node/TypeScript resolution,
failing dts builds (and therefore the release workflow's build step).
Wrap the Buffers in zero-copy Uint8Array views.

renderToStream() was declared as returning a web ReadableStream, but
@react-pdf/renderer's renderToStream() actually resolves to a
NodeJS.ReadableStream; declare what it really returns.
2026-07-01 18:53:18 -05:00
Chris Tate e2d00faeaa Add harness-chat example (#302)
* Add harness-chat example: json-render as the UI for agent harnesses

A Claude Code agent runs in a Vercel Sandbox via AI SDK 7's experimental HarnessAgent and reports its work (steps, file changes, terminal output, test results) as a streamed json-render spec. Because HarnessAgent.stream() returns a standard StreamTextResult, the existing pipeJsonRender -> useJsonRenderMessage pipeline works unchanged.

The example pins matching AI SDK 7 canary packages so the harness adapter, React hooks, and Vercel sandbox transport resolve together.

* harness-chat: fix dev-runtime issues found in live run

- allowedDevOrigins for the portless proxy origin (Next 16 silently fails to hydrate on non-allowlisted cross-origin dev requests)
- serverExternalPackages for the harness adapter, which loads its sandbox bridge via new URL(..., import.meta.url) and cannot be bundled
- README: document CLI-login (TTY) vs OIDC sandbox auth paths

* harness-chat: agent picker, charts, and design polish

- Add a UI agent selector (Claude Code / Codex / Pi) with per-agent harness sessions and monochrome brand marks
- Add monochrome bar/line chart components to the catalog and registry
- Polish the chat shell: minimalist Geist/Geist-Mono design, tool-call icons + containers, inline-code shading, and a working text shimmer

* harness-chat: add mermaid diagrams to README

- Replace the ASCII data-flow sketch with a mermaid flowchart and a sequence diagram of a turn
- Update prose/setup to reflect the three-agent selector (Claude Code / Codex / Pi)

* Fix harness chat reset and signed charts
2026-06-15 11:00:59 -05:00
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -206,5 +206,6 @@ export async function renderToPng(
const resvg = new Resvg(svg);
const pngData = resvg.render();
return pngData.asPng();
const png = pngData.asPng();
return new Uint8Array(png.buffer, png.byteOffset, png.byteLength);
}
+3 -2
View File
@@ -153,7 +153,8 @@ export async function renderToBuffer(
options?: RenderOptions,
): Promise<Uint8Array> {
const document = buildDocument(spec, options);
return pdfRenderToBuffer(document as any);
const buffer = await pdfRenderToBuffer(document as any);
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
}
/**
@@ -162,7 +163,7 @@ export async function renderToBuffer(
export async function renderToStream(
spec: Spec,
options?: RenderOptions,
): Promise<ReadableStream> {
): Promise<NodeJS.ReadableStream> {
const document = buildDocument(spec, options);
return pdfRenderToStream(document as any);
}