React + Jotai client for @shiit/coding-agent. Renders the agent timeline (messages, tool calls, file ops) and exposes a transport-agnostic store you can wire to any AgentSessionServer.
npm install @fungi.computer/chatreact, react-dom, and @shiit/coding-agent are peer or runtime deps — install them too.
import {
ChatInput,
ChatMessage,
MarkdownRenderer,
chatStore,
connectToSession,
sendAbort,
} from "@fungi.computer/chat";
import {
AgentSessionClient,
WebSocketClientTransport,
} from "@shiit/coding-agent/client";
const client = new AgentSessionClient(
new WebSocketClientTransport({ url: "wss://api.example.com/agent" }),
);
await connectToSession(client, { sessionId: "abc123" });
// Render the timeline
function Timeline() {
const messages = useAtomValue(chatStore.timeline);
return messages.map((m) => <ChatMessage key={m.id} message={m} />);
}| Export | Purpose |
|---|---|
ChatInput |
Message input + send. Handles IME, paste, attachments. |
ChatMessage |
Renders a single message (user / assistant / tool). |
MarkdownRenderer |
GFM markdown with syntax highlighting. |
| Export | Purpose |
|---|---|
vanillaMilkshake |
Prism theme for code blocks. |
Re-exported from ./store:
| Export | Purpose |
|---|---|
chatStore |
Jotai atoms for the timeline, status, input. |
connectToSession |
Wire a client to the store, start streaming. |
disconnectSession |
Tear down the connection. |
sendAbort |
Cancel the current run. |
sendCompact |
Request a context-compaction pass. |
agentConnectedAtom |
Read-only: is the client connected? |
agentSessionIdAtom |
Read-only: current session id. |
agentStatusAtom |
Read-only: idle | running | compacting. |
agentTimelineAtom |
Read-only: full timeline array. |
@shiit/coding-agent— the agent runtime this client talks to. Client transports (WebSocketClientTransport,InMemoryClientTransport) live in the@shiit/coding-agent/clientsubpath export.fungi.computer— the multi-tenant product that uses this client.
MIT