How openonion/oo-chat works
oo-chat is a Next.js client for discovering ConnectOnion agents and chatting with them. The main flow is address entry and profile lookup, then a session page delegates connection, streaming, and session persistence to @connectonion/react through useAgentSDK; chat UI renders the normalized events and handles approvals and user prompts. Separate surfaces support identity and settings, agent discovery, recent-chat synchronization, dashboards, and agent wikis. The SDK and relay internals are external; several UI subsystems are represented from the tree and README rather than sampled implementation.
Main entry points: [address]/page.tsx Agent profile · [sessionId]/page.tsx Session route · use-agent-info.ts Agent info lookup · app/page.tsx Agent picker
Components 24
Navigation and discovery
- Agent picker
app/page.tsx - Agent profile
app/[address]/page.tsx - Agent info lookup
hooks/use-agent-info.ts - Agent discovery
app/explore/page.tsx - Online agents API
app/api/agents/online/route.ts
Chat experience
- Session route
app/[address]/[sessionId]/page.tsx - Agent SDK adapter
components/chat/use-agent-sdk.ts - Chat interface
components/chat/chat.tsx - Message rendering
components/chat/chat-messages.tsx - Coding workroom
components/chat/messages/coding-agent-workroom.tsx - Onboarding gate
components/chat/onboard-gate.tsx
Identity and session index
- Browser identity
hooks/use-identity.ts - Authentication proxy
app/api/auth/route.ts - Recent chat index
store/chat-store.ts - Recent chat sync
hooks/use-recent-chat-sync.ts - Settings
app/settings/page.tsx
Agent workspaces
- Dashboard pane
components/dashboard/dashboard-pane.tsx - Workspace shell
components/dashboard/workspace-shell.tsx - Agent wiki
components/wiki/wiki-view.tsx - Wiki route
app/[address]/wiki/page.tsx
Other components
- User
- ConnectOnion React SDK
- Agent relay
- Remote agent
Connections 27
- User → Agent picker: chooses address
README.md - Agent picker → Agent profile: opens profile
README.md - Agent picker → Agent info lookup: loads agent info
app/page.tsx - Agent profile → Agent info lookup: loads agent info
app/[address]/page.tsx - Agent info lookup → ConnectOnion React SDK: fetches profile
hooks/use-agent-info.ts - User → Agent discovery: browses agents
app/explore/page.tsx - Agent discovery → Online agents API: requests online list
- Online agents API → ConnectOnion React SDK: queries capabilities
app/api/agents/online/route.ts - Agent profile → Session route: starts session
README.md - Session route → Agent SDK adapter: binds session
app/[address]/[sessionId]/page.tsx - Agent SDK adapter → ConnectOnion React SDK: opens agent session
components/chat/use-agent-sdk.ts - ConnectOnion React SDK → Agent relay: streams over WebSocket
README.md - Agent relay → Remote agent: relays events
README.md - Session route → Chat interface: renders conversation
app/[address]/[sessionId]/page.tsx - Chat interface → Message rendering: renders messages
- Message rendering → Coding workroom: renders workroom
- Agent profile → Onboarding gate: gates access
app/[address]/page.tsx - User → Browser identity: manages identity
hooks/use-identity.ts - Browser identity → Authentication proxy: authenticates via
README.md - Browser identity → Recent chat index: stores profile state
hooks/use-identity.ts - Recent chat sync → Recent chat index: reconciles sessions
hooks/use-recent-chat-sync.ts - ConnectOnion React SDK → Recent chat sync: provides host history
README.md - User → Settings: configures account
app/settings/page.tsx - Session route → Workspace shell: hosts chat pane
app/[address]/[sessionId]/page.tsx - Workspace shell → Dashboard pane: shows dashboard
components/dashboard/workspace-shell.tsx - Wiki route → Agent wiki: renders wiki
app/[address]/wiki/page.tsx - Wiki route → Agent info lookup: loads agent info
app/[address]/wiki/page.tsx