← Back to home

Unichat

Chat interfaces need widgets, not just messages.

Unichat is an RSC server workbench for defining a server-owned widget contract, streaming it from an endpoint, and rendering the same payload through web and React Native registries.

RSC widget server Typed envelopes Web renderer React Native adapter
unichat/rsc-workbench streaming
Builder TaskPanel

title:string
status:'ready' | 'blocked'
actions:Array

Envelope widget.contract

kind: tool
target: both
component: TaskPanel

Renderer web + native

Cards, artifacts, action panels, and tool results mount from the same server intent.

Unichat

Here is the next widget payload.

tool RSC endpoint check

Stream markdown for the transcript and widget envelopes for each client surface.

Core bet

A chat product becomes more useful when the server can choose structured interface pieces, not only plain text. The transcript should carry widgets, artifacts, actions, and tool output.

Server boundary

The RSC endpoint owns orchestration, model calls, tool results, and widget selection, then streams a small contract the client can render with platform-native components.

Cross-surface

The same envelope should map to a web registry and a React Native registry so app teams can keep product logic server-side while UI stays native to each surface.

Widget loop

Define the contract once, render it where the thread lives.

01

Describe

Name the widget, target surface, props, and user-facing purpose.

02

Package

Turn that shape into a typed envelope with renderer-neutral props.

03

Stream

Send transcript markdown and widget payloads from one RSC endpoint.

04

Resolve

Let each registry map server intent to local web or native components.

05

Harden

Ask the server to refine the contract, route, adapter, and SDK surface.

Repo shape

Next.js workbench, Expo shell, shared contract, provider-backed stream.

app/ and components/ hold the web RSC widget-server workbench. apps/unichat/ carries the Expo and React Native product shell. packages/core/ defines messages, widget cards, markdown parsing, and prompts. packages/ui/ shares theme tokens for cross-surface consistency. The chat route supports mock, hosted, Ollama, and LM Studio providers.
Current state

The local repo has moved from a generic Unichat shell into a usable widget contract builder with generated envelope, server, web, and React Native code tabs.

Native surface

The Expo route is shaped around the same chat context, with quick prompts, widget cards, and a bridge back to the server API.

Public trail

The Vercel deployment is live at unichat-swart.vercel.app. The source repo is matthoffner/unichat and keeps the current product notes in UNICHAT.md.