Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

aui-hsdk-demo

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's useChat.
  • with-harness-sdk/ — the identical app (same /api/chat route, unmodified) with the client swapped to harness-sdk's useHarness.

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.

Why there's a custom transport file

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.

Running either app

cd without-harness-sdk   # or with-harness-sdk
cp .env.example .env     # fill in a real OPENROUTER_API_KEY
pnpm install
pnpm dev
  • without-harness-sdk runs on :9899
  • with-harness-sdk runs on :9898 (matches the demo.aui.300mil.com nginx 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages