@lumerahq/ui 0.20.0 → 0.20.1-dev.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/CHANGELOG.md +23 -0
- package/README.md +65 -3
- package/dist/{RecordSheet-Cq027sFr.js → RecordSheet-QIaJy2yB.js} +287 -794
- package/dist/components/assistant/AssistantChat.d.ts +14 -5
- package/dist/components/assistant/AssistantChat.d.ts.map +1 -1
- package/dist/components/assistant/AssistantPage.d.ts +10 -1
- package/dist/components/assistant/AssistantPage.d.ts.map +1 -1
- package/dist/components/assistant/AssistantWidget.d.ts +11 -4
- package/dist/components/assistant/AssistantWidget.d.ts.map +1 -1
- package/dist/components/assistant/SessionRail.d.ts +12 -0
- package/dist/components/assistant/SessionRail.d.ts.map +1 -0
- package/dist/components/assistant/index.d.ts +4 -1
- package/dist/components/assistant/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/{highlighted-body-OFNGDK62-ByL2oaVl.js → highlighted-body-OFNGDK62-CmQu6WAu.js} +1 -1
- package/dist/index.js +4 -3
- package/dist/mermaid-GHXKKRXX-BVhL5XWj.js +4 -0
- package/dist/ui.css +20 -452
- package/package.json +1 -1
- package/dist/components/assistant/chat-ui.d.ts +0 -48
- package/dist/components/assistant/chat-ui.d.ts.map +0 -1
- package/dist/mermaid-GHXKKRXX-BkfFnaMM.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@lumerahq/ui`. Earlier releases are not documented here.
|
|
4
4
|
|
|
5
|
+
## 0.20.1
|
|
6
|
+
|
|
7
|
+
The assistant surfaces now render on `AgentChat`, so existing apps get the redesigned look without code changes. Nothing exported in 0.20 is removed.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `SessionRail`: the conversation list from `AssistantPage`, exported so a host can put a rail beside `AgentChat` in a few lines. The README has a page recipe and a launcher recipe.
|
|
12
|
+
- `webSearch` on `AssistantChat`, `AssistantPage`, and `AssistantWidget` shows the per-turn Web chip.
|
|
13
|
+
- The accent tints `--agent-chat-accent-soft` and `--agent-chat-accent-ink` are defined on `:root` and `.dark` as well as on the chat root, so the rail and tool cards keep their colours outside `AgentChat`.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- `AssistantChat` is a thin wrapper over `AgentChat` that keeps the data-sync transport; `AssistantPage` and `AssistantWidget` render through it. The old transcript, composer, and header are gone, with the `.assistant-md` rules and the `pulse-dot` keyframe only they used.
|
|
18
|
+
- On these surfaces the empty state is titled with `title`, so `emptyTitle` is ignored. A read-only `AssistantPage` with no session shows "No conversations yet." as the empty-state description.
|
|
19
|
+
|
|
20
|
+
### Deprecated
|
|
21
|
+
|
|
22
|
+
Still exported so existing apps keep compiling; removed in a later major.
|
|
23
|
+
|
|
24
|
+
- `AssistantChat`, `AssistantPage`, `AssistantWidget`: use `AgentChat`, with `withDataSync` for `onDataChange`, `SessionRail` plus `useAgentChatSessions` for a page, and your own launcher for a widget.
|
|
25
|
+
- `AssistantComposerChip`: the same shape as `AgentChatComposerChip`.
|
|
26
|
+
- `emptyTitle` on the three surfaces.
|
|
27
|
+
|
|
5
28
|
## 0.20.0
|
|
6
29
|
|
|
7
30
|
`AgentChat` is now the primary chat component. Use it for new chat UIs and move existing ones to it when you can. Nothing exported in 0.19 is removed; see Deprecated below.
|
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ their distinct execution types instead of being reported as system work.
|
|
|
95
95
|
|
|
96
96
|
### Agent Chat
|
|
97
97
|
|
|
98
|
-
`AgentChat` is the primary chat component as of 0.20. It renders a header with the agent's identity and activity, an empty state with suggested prompts, the transcript (reasoning line, grouped tool-step card, streamed markdown, error block with in-place Retry, compaction markers), and a composer with attachments, a per-turn Web search chip, and Stop. Use it for new chat UIs and move existing ones to it at the first opportunity. `AssistantPage
|
|
98
|
+
`AgentChat` is the primary chat component as of 0.20. It renders a header with the agent's identity and activity, an empty state with suggested prompts, the transcript (reasoning line, grouped tool-step card, streamed markdown, error block with in-place Retry, compaction markers), and a composer with attachments, a per-turn Web search chip, and Stop. Use it for new chat UIs and move existing ones to it at the first opportunity. As of 0.20.1 `AssistantChat`, `AssistantPage`, and `AssistantWidget` are deprecated wrappers over it: existing apps get the new look without code changes, but the three will be removed in a later major, so migrate when you can. `AssistantChat` becomes `AgentChat` with the transport wrapped in `withDataSync` for `onDataChange`; `AssistantPage` becomes the page recipe below; `AssistantWidget` becomes the launcher recipe below.
|
|
99
99
|
|
|
100
100
|
```tsx
|
|
101
101
|
import { useEffect, useMemo, useState } from 'react';
|
|
@@ -152,9 +152,71 @@ Session actions map to the runtime: **New** calls `onNewChat` (the host owns `se
|
|
|
152
152
|
|
|
153
153
|
**Deprecated in 0.20** (still exported, removed in a later major): `ActivityStrip` with `ActivityStripItem` / `ActivityStripProps`, `encodeActivityLabels`, `summarizeActivityLabels`, the `appearance` feature flag and `AgentChatAppearance` type, `labels.emptyTitle`, and `statusText` on custom `Header` renderers. `AgentChat` renders reasoning and tool steps itself, with its own reasoning line and tool-step card, and has one transcript appearance.
|
|
154
154
|
|
|
155
|
-
`AgentChat` does not list sessions itself; pair it with `useAgentChatSessions()` and pass the chosen `sessionId
|
|
155
|
+
`AgentChat` does not list sessions itself; pair it with `useAgentChatSessions()` and `SessionRail`, and pass the chosen `sessionId` (page recipe below). `sessionFilter` on `useAgentChatSessions` scopes the visible session list and ignores a backend-selected active session that does not pass the predicate. It is a client-side presentation filter, not an authorization boundary.
|
|
156
156
|
|
|
157
|
-
Custom tool renderers are checked before the built-in renderer registry, so they can add support for custom tools or override how a built-in tool appears. A summary of the form `Label · detail` renders as a step row with the detail in the mono column; a leading emoji, if any, is dropped. Pass it to `AgentChat` as `renderers={{ toolRenderers }}`; the assistant surfaces take the same array through their `toolRenderers` prop.
|
|
157
|
+
Custom tool renderers are checked before the built-in renderer registry, so they can add support for custom tools or override how a built-in tool appears. A summary of the form `Label · detail` renders as a step row with the detail in the mono column; a leading emoji, if any, is dropped. Pass it to `AgentChat` as `renderers={{ toolRenderers }}`; the deprecated assistant surfaces take the same array through their `toolRenderers` prop.
|
|
158
|
+
|
|
159
|
+
#### Page: a session rail beside the chat
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
import { AgentChat, SessionRail, createLumeraAgentChatTransport, useAgentChatSessions } from '@lumerahq/ui';
|
|
163
|
+
|
|
164
|
+
export function AssistantRoute({ agentId }: { agentId: string }) {
|
|
165
|
+
const transport = useMemo(() => createLumeraAgentChatTransport({ agentId }), [agentId]);
|
|
166
|
+
const sessions = useAgentChatSessions({ agentId, transport, autoLoad: true });
|
|
167
|
+
const [picked, setPicked] = useState<string>();
|
|
168
|
+
const sessionId = picked ?? sessions.activeSessionId;
|
|
169
|
+
const startNew = () => setPicked(`session-${Date.now()}`);
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<div className="flex h-screen">
|
|
173
|
+
<SessionRail
|
|
174
|
+
sessions={sessions.sessions}
|
|
175
|
+
activeSessionId={sessionId}
|
|
176
|
+
isLoading={sessions.isLoading}
|
|
177
|
+
onSelect={setPicked}
|
|
178
|
+
onNew={startNew}
|
|
179
|
+
onRename={(id, name) => void sessions.renameSession(id, name)}
|
|
180
|
+
/>
|
|
181
|
+
<AgentChat
|
|
182
|
+
agentId={agentId}
|
|
183
|
+
sessionId={sessionId}
|
|
184
|
+
transport={transport}
|
|
185
|
+
disabled={!sessionId}
|
|
186
|
+
onNewChat={startNew}
|
|
187
|
+
onTurnComplete={() => void sessions.loadSessions()}
|
|
188
|
+
className="flex-1 rounded-none border-0 shadow-none"
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### Launcher: a floating button that opens the chat
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
export function AssistantLauncher({ agentId }: { agentId: string }) {
|
|
199
|
+
const transport = useMemo(() => createLumeraAgentChatTransport({ agentId }), [agentId]);
|
|
200
|
+
const [open, setOpen] = useState(false);
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
<>
|
|
204
|
+
<button
|
|
205
|
+
type="button"
|
|
206
|
+
onClick={() => setOpen((value) => !value)}
|
|
207
|
+
className="fixed right-5 bottom-5 rounded-full bg-foreground px-4 py-2 text-sm text-background"
|
|
208
|
+
>
|
|
209
|
+
{open ? 'Close' : 'Chat'}
|
|
210
|
+
</button>
|
|
211
|
+
{open && (
|
|
212
|
+
<div className="fixed right-5 bottom-20 h-[min(640px,calc(100vh-7rem))] w-[440px] max-w-[calc(100vw-2.5rem)]">
|
|
213
|
+
<AgentChat agentId={agentId} sessionId="support-current" transport={transport} />
|
|
214
|
+
</div>
|
|
215
|
+
)}
|
|
216
|
+
</>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
```
|
|
158
220
|
|
|
159
221
|
### API Utilities
|
|
160
222
|
|