@lumerahq/ui 0.19.6-dev.1 → 0.20.0-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 +38 -0
- package/README.md +29 -15
- package/dist/{RecordSheet-vH48DkJ9.js → RecordSheet-CzJyCMVB.js} +1343 -759
- package/dist/{audit-log-BFPtNHQh.js → audit-log-Dmzbqtc0.js} +5 -5
- package/dist/{automations-TTSbZaKC.js → automations-DD15itWa.js} +53 -53
- package/dist/components/agent-chat/ActivityStrip.d.ts +6 -1
- package/dist/components/agent-chat/ActivityStrip.d.ts.map +1 -1
- package/dist/components/agent-chat/AgentChat.d.ts +1 -1
- package/dist/components/agent-chat/AgentChat.d.ts.map +1 -1
- package/dist/components/agent-chat/AgentChatComposer.d.ts +8 -0
- package/dist/components/agent-chat/AgentChatComposer.d.ts.map +1 -0
- package/dist/components/agent-chat/AgentChatEmptyState.d.ts +9 -0
- package/dist/components/agent-chat/AgentChatEmptyState.d.ts.map +1 -0
- package/dist/components/agent-chat/AgentChatHeader.d.ts +4 -0
- package/dist/components/agent-chat/AgentChatHeader.d.ts.map +1 -0
- package/dist/components/agent-chat/AgentChatToast.d.ts +5 -0
- package/dist/components/agent-chat/AgentChatToast.d.ts.map +1 -0
- package/dist/components/agent-chat/AgentChatTranscript.d.ts +24 -0
- package/dist/components/agent-chat/AgentChatTranscript.d.ts.map +1 -0
- package/dist/components/agent-chat/AssistantTurn.d.ts +40 -0
- package/dist/components/agent-chat/AssistantTurn.d.ts.map +1 -0
- package/dist/components/agent-chat/DefaultContentBlock.d.ts +4 -0
- package/dist/components/agent-chat/DefaultContentBlock.d.ts.map +1 -0
- package/dist/components/agent-chat/Markdown.d.ts +2 -2
- package/dist/components/agent-chat/ReasoningLine.d.ts +10 -0
- package/dist/components/agent-chat/ReasoningLine.d.ts.map +1 -0
- package/dist/components/agent-chat/SystemMarker.d.ts +7 -0
- package/dist/components/agent-chat/SystemMarker.d.ts.map +1 -0
- package/dist/components/agent-chat/ToolStepsCard.d.ts +17 -0
- package/dist/components/agent-chat/ToolStepsCard.d.ts.map +1 -0
- package/dist/components/agent-chat/TurnStatus.d.ts +11 -0
- package/dist/components/agent-chat/TurnStatus.d.ts.map +1 -0
- package/dist/components/agent-chat/UserMessage.d.ts +4 -0
- package/dist/components/agent-chat/UserMessage.d.ts.map +1 -0
- package/dist/components/agent-chat/activity-utils.d.ts +35 -8
- package/dist/components/agent-chat/activity-utils.d.ts.map +1 -1
- package/dist/components/agent-chat/hooks/use-autosize-textarea.d.ts +4 -0
- package/dist/components/agent-chat/hooks/use-autosize-textarea.d.ts.map +1 -0
- package/dist/components/agent-chat/hooks/use-stick-to-bottom.d.ts +7 -0
- package/dist/components/agent-chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
- package/dist/components/agent-chat/hooks/use-transient-toast.d.ts +7 -0
- package/dist/components/agent-chat/hooks/use-transient-toast.d.ts.map +1 -0
- package/dist/components/agent-chat/index.d.ts +2 -1
- package/dist/components/agent-chat/index.d.ts.map +1 -1
- package/dist/components/agent-chat/tool-renderers/ToolCallCard.d.ts +4 -1
- package/dist/components/agent-chat/tool-renderers/ToolCallCard.d.ts.map +1 -1
- package/dist/components/agent-chat/types.d.ts +87 -19
- package/dist/components/agent-chat/types.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +28 -27
- package/dist/{formatters-D4T821Dv.js → formatters-BuHr2I8Z.js} +12 -12
- package/dist/{highlighted-body-OFNGDK62-CRKUSFzd.js → highlighted-body-OFNGDK62-DuBXfvG-.js} +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +102 -101
- package/dist/lib/index.js +72 -72
- package/dist/mermaid-GHXKKRXX-ByaXZtzi.js +4 -0
- package/dist/ui.css +517 -63
- package/dist/{use-automation-run-DEqPHNJJ.js → use-automation-run-1Fd0EFiJ.js} +2 -2
- package/dist/{use-sql-table-DpHd0VWk.js → use-sql-table-_aMNbZ6w.js} +2 -2
- package/package.json +3 -2
- package/dist/mermaid-GHXKKRXX-Dl-OSxG-.js +0 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Notable changes to `@lumerahq/ui`. Earlier releases are not documented here.
|
|
4
|
+
|
|
5
|
+
## 0.20.0
|
|
6
|
+
|
|
7
|
+
`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.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Redesigned `AgentChat`: a header with the agent's identity, an activity dot, and a New button; an empty state with suggested prompts; a transcript with a reasoning line, a grouped tool-step card, streamed markdown with a caret, an error block with in-place Retry, and compaction markers with a collapsible recap; a composer with attachments, a per-turn Web search chip, quick-action chips, Stop, and a border trace while a turn runs.
|
|
12
|
+
- `AgentChat` props: `suggestions`, `composerChips`, `onNewChat`, `headerLeft`, `headerRight`.
|
|
13
|
+
- Labels: `newChat`, `active`, `idle`, `compacting`, `hint`, `working`, `stopped`, `interrupted`, `error`.
|
|
14
|
+
- `DefaultContentBlock` is exported so a custom `ContentBlock` renderer can handle its own block types and delegate the rest. Other default renderers and transcript internals stay unexported.
|
|
15
|
+
- Renderer props: message renderers receive `labels`; header renderers receive `labels`, `isCompacting`, and `onNewChat`; the composer state carries `inFlight`, `hint`, `sendLabel`, `stopLabel`, `chips`, and `webSearchEnabled`; `EmptyState` receives the agent name, description, suggestions, and a pick handler; `LoadEarlierButton` receives its `label`.
|
|
16
|
+
- An Agent Chat page in the package dev app (`pnpm dev`), driven by a scripted transport that covers streaming, tool steps, a failing turn with Retry, Stop, uploads, and auto-compaction.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- A user Stop settles the turn as `aborted`, shown as "Stopped" under the prompt with no Retry. An `interrupted` turn (a cut-off run) renders like a failure, with Retry.
|
|
21
|
+
- Tool step summaries of the form `Label · detail` render as a row with the detail in a mono column; a leading emoji is dropped.
|
|
22
|
+
- The chat markdown variant uses the body text scale.
|
|
23
|
+
- The stylesheet adds `.agent-chat` accent tokens and animations. The `.assistant-md` rules and `pulse-dot` keyframe remain for the assistant surfaces.
|
|
24
|
+
|
|
25
|
+
### Deprecated
|
|
26
|
+
|
|
27
|
+
Still exported so existing apps keep compiling; removed in a later major.
|
|
28
|
+
|
|
29
|
+
- `ActivityStrip`, `ActivityStripItem`, `ActivityStripProps`: `AgentChat` renders reasoning and tool steps itself with its own reasoning line and tool-step card.
|
|
30
|
+
- `encodeActivityLabels`, `summarizeActivityLabels`: only the deprecated `ActivityStrip` uses them.
|
|
31
|
+
- `AgentChatAppearance` and the `appearance` feature flag and renderer prop: the transcript has one appearance and the value is ignored.
|
|
32
|
+
- `labels.emptyTitle`: the empty state is titled with the agent name.
|
|
33
|
+
- `statusText` on header renderer props: still provided; derive custom copy from `phase`, `isWorking`, and `isCompacting`.
|
|
34
|
+
|
|
35
|
+
### Notes
|
|
36
|
+
|
|
37
|
+
- `AssistantPage`, `AssistantWidget`, and `AssistantChat` still render the previous look and will be rebuilt as thin wrappers over `AgentChat` in an upcoming release.
|
|
38
|
+
- Code that builds message or composer renderer prop objects by hand, to render the default `UserMessage` or composer outside `AgentChat`, must supply the new required fields.
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm install @lumerahq/ui
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- **Application Components** -
|
|
13
|
+
- **Application Components** - Agent chat surfaces, data tables, record sheets, and automation runner
|
|
14
14
|
- **Data Table** - Full-featured table with filtering, sorting, and pagination
|
|
15
15
|
- **Bridge Module** - Parent-iframe communication for embedded apps
|
|
16
16
|
- **API Utilities** - Lumera client with SQL, CRUD, file, and email operations
|
|
@@ -27,7 +27,7 @@ Import the package stylesheet once in the app entrypoint before rendering any `@
|
|
|
27
27
|
import '@lumerahq/ui/styles.css';
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
This stylesheet is required for the shared Tailwind/shadcn theme variables, Inter font,
|
|
30
|
+
This stylesheet is required for the shared Tailwind/shadcn theme variables, Inter font, and the agent chat's derived tokens and animations. It is not included automatically when importing from `@lumerahq/ui/components`, `@lumerahq/ui/hooks`, or `@lumerahq/ui/lib`.
|
|
31
31
|
|
|
32
32
|
The stylesheet defines theme tokens as CSS custom properties. Override them on `:root`, `.dark`, or a wrapper class to retheme the assistant without changing component code:
|
|
33
33
|
|
|
@@ -93,15 +93,16 @@ present, and `run_id` retains an upstream automation or function run. Agent and
|
|
|
93
93
|
session filters include these hook events. Webhook and anonymous app writes keep
|
|
94
94
|
their distinct execution types instead of being reported as system work.
|
|
95
95
|
|
|
96
|
-
###
|
|
96
|
+
### Agent Chat
|
|
97
97
|
|
|
98
|
-
|
|
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` (session rail), `AssistantWidget` (floating launcher), and `AssistantChat` (data-sync) still render the previous look and will be rebuilt as thin wrappers over `AgentChat` in an upcoming release.
|
|
99
99
|
|
|
100
100
|
```tsx
|
|
101
|
-
import { useMemo } from 'react';
|
|
101
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
102
102
|
import {
|
|
103
|
-
|
|
103
|
+
AgentChat,
|
|
104
104
|
createLumeraAgentChatTransport,
|
|
105
|
+
postReadyMessage,
|
|
105
106
|
type AgentChatToolRenderer,
|
|
106
107
|
} from '@lumerahq/ui';
|
|
107
108
|
import '@lumerahq/ui/styles.css';
|
|
@@ -109,9 +110,10 @@ import '@lumerahq/ui/styles.css';
|
|
|
109
110
|
const toolRenderers: AgentChatToolRenderer[] = [
|
|
110
111
|
{
|
|
111
112
|
match: (tc) => tc.name === 'send_invoice',
|
|
113
|
+
// "label · detail": the detail lands in the right-aligned mono column.
|
|
112
114
|
summary: (tc) => {
|
|
113
115
|
const input = tc.input as { invoiceId?: string };
|
|
114
|
-
return `Sent invoice ${input.invoiceId ?? ''}`.trim();
|
|
116
|
+
return `Sent invoice · ${input.invoiceId ?? ''}`.trim();
|
|
115
117
|
},
|
|
116
118
|
expandedView: (tc) => <pre>{tc.output ?? ''}</pre>,
|
|
117
119
|
},
|
|
@@ -119,17 +121,23 @@ const toolRenderers: AgentChatToolRenderer[] = [
|
|
|
119
121
|
|
|
120
122
|
export function AppAssistant({ agentId }: { agentId: string }) {
|
|
121
123
|
const transport = useMemo(() => createLumeraAgentChatTransport({ agentId }), [agentId]);
|
|
124
|
+
// The host owns the session; New switches to a fresh one.
|
|
125
|
+
const [sessionId, setSessionId] = useState(() => `session-${Date.now()}`);
|
|
126
|
+
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
postReadyMessage();
|
|
129
|
+
}, []);
|
|
122
130
|
|
|
123
131
|
return (
|
|
124
132
|
<div style={{ height: '100vh' }}>
|
|
125
|
-
<
|
|
133
|
+
<AgentChat
|
|
126
134
|
agentId={agentId}
|
|
135
|
+
sessionId={sessionId}
|
|
127
136
|
transport={transport}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
toolRenderers={toolRenderers}
|
|
137
|
+
suggestions={['Summarize recent activity', 'Find records that need attention']}
|
|
138
|
+
onNewChat={() => setSessionId(`session-${Date.now()}`)}
|
|
139
|
+
features={{ attachments: true, webSearch: true }}
|
|
140
|
+
renderers={{ toolRenderers }}
|
|
133
141
|
className="h-full"
|
|
134
142
|
/>
|
|
135
143
|
</div>
|
|
@@ -137,9 +145,15 @@ export function AppAssistant({ agentId }: { agentId: string }) {
|
|
|
137
145
|
}
|
|
138
146
|
```
|
|
139
147
|
|
|
140
|
-
|
|
148
|
+
The component fills its host's height, so give the parent a height. Colors, radii, and type come from the shared theme tokens (`--primary`, `--radius`, `--font-sans`, …); rebrand by overriding those on `:root`, `.dark`, or a wrapper class.
|
|
149
|
+
|
|
150
|
+
Session actions map to the runtime: **New** calls `onNewChat` (the host owns `sessionId`) and **Retry** on a failed turn uses `transport.retry` (`POST /live/retry`) to re-run it in place. The Web chip appears with `features.webSearch` and is sent per turn as `web_search_enabled`. When the runtime compacts context on its own mid-turn, the chat shows "Compacting context…" until it finishes and the transcript then carries a "Compacted" marker with the recap.
|
|
151
|
+
|
|
152
|
+
**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.
|
|
153
|
+
|
|
154
|
+
`AgentChat` does not list sessions itself; pair it with `useAgentChatSessions()` and pass the chosen `sessionId`. On `AssistantPage`, `sessionFilter` 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.
|
|
141
155
|
|
|
142
|
-
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.
|
|
156
|
+
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.
|
|
143
157
|
|
|
144
158
|
### API Utilities
|
|
145
159
|
|