Same minimal chat app, built twice, to show exactly what changes when you add harness-sdk to a plain AI SDK chat app.
without-harness-sdk/— a baseline Next.js chat app using@ai-sdk/react'suseChat.with-harness-sdk/— the identical app (same/api/chatroute, unmodified) with the client swapped to harness-sdk'suseHarness.
Both apps call OpenRouter from the same server-side
route (src/app/api/chat/route.ts), so the only real difference between the
two folders is src/app/page.tsx and, in with-harness-sdk, one small file:
src/lib/ai-sdk-transport.ts.
harness-sdk's own AI SDK adapter (@harness-sdk/ai-sdk) isn't published to
npm yet — only the core harness-sdk and statewire packages are. So
with-harness-sdk/src/lib/ai-sdk-transport.ts recreates that adapter from the
published building blocks: harness-sdk/ui-transport's useUIMessageTransport
runs the in-browser harness state machine, wired to a plain AI SDK
DefaultChatTransport so it fetches replies from /api/chat exactly like
useChat does. See the comment at the top of that file for details.
cd without-harness-sdk # or with-harness-sdk
cp .env.example .env # fill in a real OPENROUTER_API_KEY
pnpm install
pnpm devwithout-harness-sdkruns on :9899with-harness-sdkruns on :9898 (matches thedemo.aui.300mil.comnginx reverse proxy)
Both were verified end-to-end: with a fake API key, both apps' /api/chat
produce byte-identical SSE error responses from OpenRouter, confirming the
harness-sdk transport reaches the same endpoint the same way useChat does.