reifyui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Epsilla
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # ReifyUI
2
+
3
+ ### The rendering & interaction layer for agentic applications.
4
+
5
+ Bring your own components or use ours. ReifyUI lets any agent stream, render, and drive
6
+ **application-native** interfaces — and lets users act back on them — across any model and any
7
+ agent framework.
8
+
9
+ **Model-agnostic. Framework-agnostic. Design-system-native.**
10
+
11
+ _Reify_ — to make the abstract concrete. ReifyUI reifies an agent's intent into UI.
12
+
13
+ ```bash
14
+ npm install reifyui
15
+ ```
16
+
17
+ > **Status: v0.1, early.** ReifyUI is an open foundation, not a finished platform. This first
18
+ > release ships the rendering-and-interaction core described under **Today** below. The larger
19
+ > vision — a component registry, agent-driven composition, and protocol interop — is on the
20
+ > **Roadmap**, stated plainly so you can tell what runs now from what's coming. We don't ship
21
+ > vaporware in the feature list.
22
+
23
+ ---
24
+
25
+ ## Why ReifyUI
26
+
27
+ The generative-UI space is splitting into layers that get lumped together: component toolkits
28
+ (Tambo), generated-experience APIs (Thesys), chat-first UI frameworks (assistant-ui), agent
29
+ frontend stacks (CopilotKit), and emerging **standards** for what an agent may render — A2UI,
30
+ AG-UI, MCP Apps.
31
+
32
+ ReifyUI's bet is the layer none of them fully own: a **beautiful, production component runtime**
33
+ that is neutral about your model, your agent framework, and the wire protocol — and that adapts
34
+ to *your* application's design system rather than imposing its own. Not another chat widget; the
35
+ surface every agent product renders through.
36
+
37
+ - **Model-agnostic** — parses the OpenAI-style Responses/SSE event shape today; the renderer
38
+ cares about events, not who produced them.
39
+ - **Framework-agnostic** — plain React + peer deps, no runtime lock-in, no hosted service required.
40
+ - **Design-system-native** — CSS-variable theming you own; components inherit your look, not ours.
41
+ - **Standards-friendly** — built to *support* A2UI / AG-UI / MCP Apps as they land, not to compete
42
+ with them (Roadmap).
43
+
44
+ ---
45
+
46
+ ## Today (v0.1) — what actually ships
47
+
48
+ A production-grade surface for rendering and interacting with a live agent turn:
49
+
50
+ | Area | Exports |
51
+ |---|---|
52
+ | **Streaming** | `pumpResponsesStream`, `createResponsesDispatcher`, `readSSEStream` — parse the Responses SSE event shape into ordered blocks |
53
+ | **Block state** | `withText`, `withReasoning`, `withStep`, `withResult`, `asstText`, `createConversationStore` — session-continuation state machine |
54
+ | **Chat surface** | `ChatMessages`, `UserTurn`, `AssistantTurn`, `ToolGroup`, `ToolRow`, `Composer` — message list + a collapsible "ran 5 commands, wrote a file" tool-step timeline |
55
+ | **Rich blocks** | `CodeBlock` (highlight.js + mermaid + charts), `useResizablePane`, `PaneResizer` |
56
+ | **Slides** | a slide renderer/editor + `reifyui/styles/slides.css` |
57
+ | **Spreadsheet** | `SheetGrid`, `sheetToDelimited`, `sheetToAoA` — an AI-editable grid |
58
+ | **Icons / tool meta** | `Ic*` icon set, `toolMeta`, `humanize`, `summarizeSteps` |
59
+ | **Auth (optional)** | `configureAuth`, `login`, `AuthForm`, `GoogleButton` — a thin JWT client for products with a `/v1/auth`-style backend; wired to nothing by default |
60
+
61
+ Extracted from production agent products and hardened there. Full TypeScript definitions ship
62
+ with the package.
63
+
64
+ ## Roadmap — the layer we're building toward
65
+
66
+ Stated as intent, not shipped features:
67
+
68
+ - **Component registry + bring-your-own** — register your React components (with schemas); let an
69
+ agent select, populate, and update them, in or out of chat.
70
+ - **Agent-driven composition** — declarative component trees resolved by name against an approved
71
+ allowlist (safe generative UI), not free-form HTML.
72
+ - **Bidirectional state & actions** — a shared state channel agents and UI both read/write, with
73
+ human-in-the-loop approvals and frontend tool calls.
74
+ - **Protocol interop** — first-class **A2UI**, **AG-UI**, and **MCP Apps** support, so ReifyUI is
75
+ the best renderer for the standards rather than a rival to them.
76
+ - **Design-system adaptation** — map generated intent onto your tokens/components automatically.
77
+ - **Beyond web** — web first, native renderers after.
78
+
79
+ Issues and RFCs for these are welcome.
80
+
81
+ ---
82
+
83
+ ## Quick start
84
+
85
+ Render a live agent turn from a Server-Sent-Events response:
86
+
87
+ ```jsx
88
+ import { useState } from 'react';
89
+ import { ChatMessages, Composer, createConversationStore, pumpResponsesStream } from 'reifyui';
90
+ import 'reifyui/styles/chat.css';
91
+ import 'reifyui/styles/themes/light.css'; // or themes/dark.css
92
+
93
+ const store = createConversationStore();
94
+
95
+ export function Chat({ endpoint }) {
96
+ const [, force] = useState(0);
97
+ store.subscribe(() => force((n) => n + 1));
98
+
99
+ async function send(text) {
100
+ const res = await fetch(endpoint, {
101
+ method: 'POST',
102
+ headers: { 'content-type': 'application/json' },
103
+ body: JSON.stringify({ input: text, stream: true }),
104
+ });
105
+ await pumpResponsesStream({ response: res, store });
106
+ }
107
+
108
+ return (
109
+ <>
110
+ <ChatMessages store={store} />
111
+ <Composer onSend={send} placeholder="Ask anything…" />
112
+ </>
113
+ );
114
+ }
115
+ ```
116
+
117
+ Peer dependencies: `react` and `react-dom` (>=18). The rich blocks are **optional** — install them
118
+ only if you use them: `highlight.js` (code), `mermaid` (diagrams), `echarts` (charts). If you don't
119
+ import a feature, it adds nothing to your bundle.
120
+
121
+ ## Styling
122
+
123
+ CSS ships as plain files you import where you want them — nothing is injected for you:
124
+
125
+ ```js
126
+ import 'reifyui/styles/chat.css'; // chat surface + tool steps + composer
127
+ import 'reifyui/styles/themes/light.css'; // light theme variables
128
+ import 'reifyui/styles/themes/dark.css'; // dark theme variables
129
+ import 'reifyui/styles/slides.css'; // slides
130
+ import 'reifyui/styles/sheet.css'; // spreadsheet grid
131
+ ```
132
+
133
+ Themes are CSS-variable files — load one, or switch at runtime by toggling which you apply. Override
134
+ the variables to match your design system.
135
+
136
+ ## Optional: auth client
137
+
138
+ ReifyUI includes a small, framework-agnostic auth client for products whose backend exposes a JSON
139
+ `/v1/auth`-style API (login / register / Google SSO / org switch, JWT in `localStorage`). It is
140
+ optional and **not** wired to any hosted service — you point it at your own backend:
141
+
142
+ ```js
143
+ import { configureAuth, login } from 'reifyui';
144
+ configureAuth({ product: 'myapp', engine: 'https://api.example.com' }); // required, once at boot
145
+ ```
146
+
147
+ ## License
148
+
149
+ MIT © Epsilla