@vokality/design-system 4.0.2 → 5.0.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 CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to `@vokality/design-system`. The package follows [semantic versioning](https://semver.org); see CONTRIBUTING.md for what counts as breaking.
4
4
 
5
+ ## 5.0.0 — 2026-10-19
6
+
7
+ Agent activity in chat transcripts.
8
+
9
+ ### Added
10
+ - Agent runs in the chat transcript. A `ChatActivity` has a `title`, `state` (`working`, `waiting`, `finished`, `failed`, `stopped`), `elapsed`, a one-line `outcome`, ordered `entries` and an `omitted` step count. Entries are narration (`ChatActivityNarration`) or typed steps (`ChatActivityStep`: `read`, `search`, `edit`, `run`, `web`, `plan`, `delegate` or `tool`, each with its own icon, and `started`, `succeeded`, `failed` or `left_running`). A working run shows a live status line over its latest six entries, with earlier entries behind a disclosure; an ended run collapses to one line that opens to every entry. Failed runs and steps say so in words as well as colour. Screen readers hear a run through its own polite status, at most once every five seconds, never once per step.
11
+ - A `waiting` activity state for a run that asks a person a question. It shows its latest entries without the working mark, says “Waiting” in the accent colour, and its steps are not announced.
12
+ - `ChatInbox` `headerActions`: controls at the trailing end of whichever header is showing, on one row at 380px.
13
+ - `ChatAuthor.source: { label, mark? }` names the channel a message came through, beside the author.
14
+ - `ChatMessage.actions: ChatAction[]`: extra-small buttons under a message (`outline` by default, or `primary`, `ghost`, `danger`).
15
+ - Read-only conversations: `composer` is optional on `ChatPanelProps`, `ChatInbox` and `ChatWidget`. Without it, `readOnlyNotice` (or localized default copy) takes the composer's place and says why.
16
+ - Localized chat copy for activity states, step states, earlier entries, omitted steps, announcements and the read-only notice in English and Dutch (`LocaleProvider.messages.chat`).
17
+ - Stories: a working run, a finished run, a failed run, omitted steps, runs between messages from two channels, message actions and a read-only inbox.
18
+
19
+ ### Changed (breaking)
20
+ - `ChatPanelProps.messages` is replaced by `items: readonly ChatItem[]`, on `ChatInbox` and `ChatWidget` too. A `ChatItem` is `{ type: "message", ...ChatMessage }` or `{ type: "activity", ...ChatActivity }`; add `type: "message"` to existing messages and rename the prop.
21
+ - `ChatInbox` fills its container (`height: 100%`) instead of sizing itself to the viewport (up to 42rem), so it can fill a docked pane. Give the inbox's container a height. A 380px docked pane gets the narrow list-or-conversation layout. New `DockedPane`, `HeaderActions` and `ActivityWaiting` stories.
22
+
5
23
  ## 4.0.2 — 2026-10-19
6
24
 
7
25
  ### Fixed
package/README.md CHANGED
@@ -124,11 +124,11 @@ The app supplies `uploadAttachment(file, { signal })`, which returns a promise o
124
124
 
125
125
  ## Chat surfaces
126
126
 
127
- `ChatWidget` supplies a floating launcher and a Radix popup. `ChatInbox` supplies an embedded conversation list and message panel, with a list/detail view on phones. Both reuse the Markdown rich editor for formatting, emoji and optional attachment uploads. Apps supply render-ready messages, selected conversations and send/retry callbacks; transport, streaming updates, persistence and authentication remain app responsibilities.
127
+ `ChatWidget` supplies a floating launcher and a Radix popup. `ChatInbox` supplies an embedded conversation list and message panel, with a list/detail view on phones. Both reuse the Markdown rich editor for formatting, emoji and optional attachment uploads. Apps supply a transcript of render-ready messages and agent runs (`items`), selected conversations and send/retry callbacks; transport, streaming updates, persistence and authentication remain app responsibilities. A message can name the channel it came through and carry extra-small actions; an agent run shows its narration and steps, collapsed to one line once it ends. Omit the composer for a read-only conversation.
128
128
 
129
129
  The composer starts with a message field, emoji and optional attachment action. One formatting toggle reveals basic text tools. Motion adds short chat entrance/exit, launcher feedback and new-message transitions; existing history stays still, and reduced-motion preferences disable these animations. See the [Motion and Radix integration guide](https://motion.dev/docs/radix) for the upstream composition pattern.
130
130
 
131
- Import the components from `@vokality/design-system/chat-widget` and `@vokality/design-system/chat-inbox`. Shared message, conversation and composer types are defined in `@vokality/design-system/chat-models`. See the component documentation for controlled draft and message contracts.
131
+ Import the components from `@vokality/design-system/chat-widget` and `@vokality/design-system/chat-inbox`. Shared transcript, activity, conversation and composer types are defined in `@vokality/design-system/chat-models`. See the component documentation for controlled draft and message contracts.
132
132
 
133
133
  ## Starting a new project
134
134
 
package/dist/chat.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { ButtonProps } from "./components/Button/Button.js";
2
3
  import type { RichTextEditorProps } from "./components/RichTextEditor/RichTextEditor.js";
4
+ /** The channel a message arrived through, drawn beside the author's name. Pass a decorative mark. */
5
+ export interface ChatSource {
6
+ label: string;
7
+ mark?: ReactNode;
8
+ }
3
9
  /** Render-ready identity; pass an Avatar or another accessible visual in the slot. */
4
10
  export interface ChatAuthor {
5
11
  name: string;
6
12
  avatar?: ReactNode;
13
+ source?: ChatSource;
7
14
  }
8
15
  /** Applications own delivery, persistence and retry requests. Omit for a sent message. */
9
16
  export type ChatMessageDelivery = {
@@ -12,6 +19,15 @@ export type ChatMessageDelivery = {
12
19
  state: "failed";
13
20
  error?: ReactNode;
14
21
  };
22
+ /** An extra-small button under a message. The application handles what selecting it does. */
23
+ export interface ChatAction {
24
+ id: string;
25
+ label: string;
26
+ onSelect: () => void;
27
+ disabled?: boolean;
28
+ /** Default outline. */
29
+ variant?: Extract<ButtonProps["variant"], "primary" | "outline" | "ghost" | "danger">;
30
+ }
15
31
  export interface ChatMessage {
16
32
  id: string;
17
33
  author: ChatAuthor;
@@ -20,7 +36,50 @@ export interface ChatMessage {
20
36
  timestamp?: ReactNode;
21
37
  direction: "incoming" | "outgoing";
22
38
  delivery?: ChatMessageDelivery;
39
+ actions?: readonly ChatAction[];
40
+ }
41
+ /** What an agent run is doing: working, or waiting for a person to answer; then how it ended. */
42
+ export type ChatActivityState = "working" | "waiting" | "finished" | "failed" | "stopped";
43
+ /** Each kind of step draws its own icon. */
44
+ export type ChatActivityStepKind = "read" | "search" | "edit" | "run" | "web" | "plan" | "delegate" | "tool";
45
+ /** A step that was still running when its run ended was left running. */
46
+ export type ChatActivityStepState = "started" | "succeeded" | "failed" | "left_running";
47
+ /** What the agent said while it worked. */
48
+ export interface ChatActivityNarration {
49
+ type: "narration";
50
+ id: string;
51
+ content: ReactNode;
52
+ }
53
+ /** One thing the agent did, with display-ready text: "Read src/app.ts", "Searched for useLocale" and "12 matches". */
54
+ export interface ChatActivityStep {
55
+ type: "step";
56
+ id: string;
57
+ kind: ChatActivityStepKind;
58
+ label: string;
59
+ outcome?: string;
60
+ state: ChatActivityStepState;
61
+ }
62
+ export type ChatActivityEntry = ChatActivityNarration | ChatActivityStep;
63
+ /** One agent run in the conversation: its narration and steps in order. */
64
+ export interface ChatActivity {
65
+ id: string;
66
+ /** Names the run: "Working on the fix". */
67
+ title: string;
68
+ state: ChatActivityState;
69
+ /** Application-formatted running time. */
70
+ elapsed?: ReactNode;
71
+ /** One line on how the run ended: "Edited 4 files, checks passed". */
72
+ outcome?: ReactNode;
73
+ entries: readonly ChatActivityEntry[];
74
+ /** Steps the application did not keep, shown as a count after the entries. */
75
+ omitted?: number;
23
76
  }
77
+ /** One entry in a transcript, in conversation order. */
78
+ export type ChatItem = ({
79
+ type: "message";
80
+ } & ChatMessage) | ({
81
+ type: "activity";
82
+ } & ChatActivity);
24
83
  /** The application handles async sending and supplies pending/error message data. */
25
84
  export interface ChatComposerOptions extends Pick<RichTextEditorProps, "value" | "defaultValue" | "onChange" | "disabled" | "placeholder" | "name" | "onUploadAttachment" | "accept" | "maxFileSize" | "emojiOptions" | "onUploadError"> {
26
85
  /** Returns after accepting the message. Only uncontrolled drafts clear automatically. */
@@ -41,8 +100,12 @@ export interface ChatThread {
41
100
  }
42
101
  /** Shared conversation presentation used by the widget and inbox. */
43
102
  export interface ChatPanelProps {
44
- messages: readonly ChatMessage[];
45
- composer: ChatComposerOptions;
103
+ /** Messages and agent activity in conversation order, each with a stable id. */
104
+ items: readonly ChatItem[];
105
+ /** Omit for a read-only conversation; `readOnlyNotice` then takes the composer's place. */
106
+ composer?: ChatComposerOptions;
107
+ /** Says why the conversation can't be answered. Shown only without a composer; defaults to localized copy. */
108
+ readOnlyNotice?: ReactNode;
46
109
  emptyState?: ReactNode;
47
110
  /** App-provided response/loading feedback, displayed in a polite status region. */
48
111
  pending?: ReactNode;
@@ -6,6 +6,8 @@ export interface ChatInboxProps extends ChatPanelProps {
6
6
  selectedThreadId: string | null;
7
7
  onSelectThread: (threadId: string | null) => void;
8
8
  emptySelection?: ReactNode;
9
+ /** Controls at the trailing end of the header that is showing: the conversation's while a thread is open, otherwise the thread list's. Pass xs IconButtons or Buttons. */
10
+ headerActions?: ReactNode;
9
11
  }
10
12
  /** Controlled thread selection; CSS handles the narrow-screen list/detail presentation. */
11
- export declare function ChatInbox({ title, threads, selectedThreadId, onSelectThread, emptySelection, className, ...panel }: ChatInboxProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function ChatInbox({ title, threads, selectedThreadId, onSelectThread, emptySelection, headerActions, className, ...panel }: ChatInboxProps): import("react/jsx-runtime").JSX.Element;
@@ -16,7 +16,7 @@ function ThreadList({ threads, selectedId, activeRef, onSelect }) {
16
16
  return _jsx("ul", { className: "vk-chat-threads", children: threads.map((thread) => _jsx("li", { children: _jsxs("button", { ref: thread.id === selectedId ? activeRef : undefined, type: "button", className: "vk-chat-thread", "aria-current": thread.id === selectedId ? "true" : undefined, disabled: thread.disabled, onClick: () => { onSelect(thread.id); }, children: [_jsx("span", { className: "vk-chat-thread-avatar", children: thread.avatar || _jsx(Avatar, { name: thread.title, decorative: true }) }), _jsxs("span", { className: "vk-chat-thread-text", children: [_jsx("span", { className: "vk-chat-thread-title", children: thread.title }), thread.preview ? _jsx("span", { className: "vk-chat-thread-preview", children: thread.preview }) : null, _jsxs("span", { className: "vk-chat-thread-meta", children: [thread.timestamp, thread.unreadCount && thread.unreadCount > 0 ? _jsx("span", { className: "vk-chat-thread-count", "aria-label": messages.chat.unread(thread.unreadCount), children: formatNumber(thread.unreadCount, { locale }) }) : null] })] })] }) }, thread.id)) });
17
17
  }
18
18
  /** Controlled thread selection; CSS handles the narrow-screen list/detail presentation. */
19
- export function ChatInbox({ title, threads, selectedThreadId, onSelectThread, emptySelection, className, ...panel }) {
19
+ export function ChatInbox({ title, threads, selectedThreadId, onSelectThread, emptySelection, headerActions, className, ...panel }) {
20
20
  const { messages } = useLocale();
21
21
  const listTitleId = useUid("vk-chat-threads");
22
22
  const selected = threads.find((thread) => thread.id === selectedThreadId);
@@ -45,5 +45,6 @@ export function ChatInbox({ title, threads, selectedThreadId, onSelectThread, em
45
45
  onSelectThread(null);
46
46
  };
47
47
  const empty = emptySelection === undefined ? messages.chat.chooseThread : emptySelection;
48
- return (_jsxs("div", { className: cx("vk-chat-inbox", selected && "vk-chat-inbox-selected", className), children: [_jsxs("section", { className: "vk-chat-inbox-list", "aria-labelledby": listTitleId, children: [_jsx("header", { className: "vk-chat-header", children: _jsx("h2", { id: listTitleId, className: "vk-chat-title", children: title || messages.chat.conversations }) }), _jsx(ThreadList, { threads: threads, selectedId: selectedThreadId, activeRef: activeRef, onSelect: select })] }), _jsx("section", { className: "vk-chat-inbox-detail", "aria-label": selected?.title || messages.chat.messages, children: selected ? _jsxs(_Fragment, { children: [_jsxs("header", { className: "vk-chat-header", children: [_jsx(IconButton, { icon: "chevron-left", label: messages.chat.back, className: "vk-chat-back", onClick: back }), _jsx("h2", { ref: headingRef, tabIndex: -1, className: "vk-chat-title", children: selected.title })] }), _jsx(ChatPanel, { ...panel }, selected.id)] }) : _jsx("div", { className: "vk-chat-empty vk-chat-no-selection", children: empty }) })] }));
48
+ const actions = headerActions ? _jsx("div", { className: "vk-chat-header-actions", children: headerActions }) : null;
49
+ return (_jsxs("div", { className: cx("vk-chat-inbox", selected && "vk-chat-inbox-selected", className), children: [_jsxs("section", { className: "vk-chat-inbox-list", "aria-labelledby": listTitleId, children: [_jsxs("header", { className: "vk-chat-header", children: [_jsx("h2", { id: listTitleId, className: "vk-chat-title", children: title || messages.chat.conversations }), selected ? null : actions] }), _jsx(ThreadList, { threads: threads, selectedId: selectedThreadId, activeRef: activeRef, onSelect: select })] }), _jsx("section", { className: "vk-chat-inbox-detail", "aria-label": selected?.title || messages.chat.messages, children: selected ? _jsxs(_Fragment, { children: [_jsxs("header", { className: "vk-chat-header", children: [_jsx(IconButton, { icon: "chevron-left", label: messages.chat.back, className: "vk-chat-back", onClick: back }), _jsx("h2", { ref: headingRef, tabIndex: -1, className: "vk-chat-title", children: selected.title }), actions] }), _jsx(ChatPanel, { ...panel }, selected.id)] }) : _jsx("div", { className: "vk-chat-empty vk-chat-no-selection", children: empty }) })] }));
49
50
  }
@@ -1,3 +1,3 @@
1
1
  import type { ChatPanelProps } from "../../chat.js";
2
- /** Shared transcript, feedback and Markdown composer; no transport or persistence. */
2
+ /** Shared transcript, feedback and Markdown composer (or a read-only notice); no transport or persistence. */
3
3
  export declare function ChatPanel(props: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -6,8 +6,8 @@ import { Button } from "../Button/Button.js";
6
6
  import { Icon } from "../Icon/Icon.js";
7
7
  import { ChatComposer } from "./composer.js";
8
8
  import { ChatTranscript } from "./transcript.js";
9
- /** Shared transcript, feedback and Markdown composer; no transport or persistence. */
9
+ /** Shared transcript, feedback and Markdown composer (or a read-only notice); no transport or persistence. */
10
10
  export function ChatPanel(props) {
11
11
  const { messages } = useLocale();
12
- return (_jsxs("div", { className: cx("vk-chat-panel", props.className), children: [_jsx(ChatTranscript, { messages: props.messages, emptyState: props.emptyState, pending: props.pending, error: props.error, label: props["aria-label"], onRetryMessage: props.onRetryMessage }), props.error ? _jsxs("div", { className: "vk-chat-feedback", role: "alert", children: [_jsx(Icon, { name: "circle-alert", size: 16 }), _jsx("div", { children: props.error }), props.onRetry ? _jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: props.onRetry, children: messages.chat.tryAgain }) : null] }) : null, _jsx(ChatComposer, { options: props.composer })] }));
12
+ return (_jsxs("div", { className: cx("vk-chat-panel", props.className), children: [_jsx(ChatTranscript, { items: props.items, emptyState: props.emptyState, pending: props.pending, error: props.error, label: props["aria-label"], onRetryMessage: props.onRetryMessage }), props.error ? _jsxs("div", { className: "vk-chat-feedback", role: "alert", children: [_jsx(Icon, { name: "circle-alert", size: 16 }), _jsx("div", { children: props.error }), props.onRetry ? _jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: props.onRetry, children: messages.chat.tryAgain }) : null] }) : null, props.composer ? _jsx(ChatComposer, { options: props.composer }) : _jsxs("div", { className: "vk-chat-read-only", children: [_jsx(Icon, { name: "info", size: 16 }), _jsx("div", { children: props.readOnlyNotice === undefined ? messages.chat.readOnly : props.readOnlyNotice })] })] }));
13
13
  }
@@ -0,0 +1,6 @@
1
+ import type { ChatActivity } from "../../chat.js";
2
+ /** An agent run in the transcript. The log ignores its entries; a throttled status speaks for it. */
3
+ export declare function ActivityItem({ activity, reducedMotion }: {
4
+ activity: ChatActivity;
5
+ reducedMotion: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { Collapsible } from "radix-ui";
5
+ import * as m from "motion/react-m";
6
+ import { useLocale } from "../../localization.js";
7
+ import { useThrottled } from "../../internal/useThrottled.js";
8
+ import { Button } from "../Button/Button.js";
9
+ import { Icon } from "../Icon/Icon.js";
10
+ /** A working run shows this many of its latest entries; the rest wait behind a disclosure. */
11
+ const LATEST_ENTRIES = 6;
12
+ /** Screen readers hear about a run at most this often, never once per step. */
13
+ const ANNOUNCE_INTERVAL = 5000;
14
+ const STEP_ICON = { read: "file", search: "search", edit: "pencil", run: "chevron-right", web: "arrow-up-right", plan: "menu", delegate: "users", tool: "ellipsis" };
15
+ const STATE_ICON = { waiting: "message-circle", finished: "circle-check", failed: "circle-alert", stopped: "minus" };
16
+ function activityWord(state, chat) {
17
+ switch (state) {
18
+ case "working": return chat.activityWorking;
19
+ case "waiting": return chat.activityWaiting;
20
+ case "finished": return chat.activityFinished;
21
+ case "failed": return chat.activityFailed;
22
+ case "stopped": return chat.activityStopped;
23
+ }
24
+ }
25
+ function stepWord(state, chat) {
26
+ switch (state) {
27
+ case "started": return chat.stepStarted;
28
+ case "failed": return chat.stepFailed;
29
+ case "left_running": return chat.stepKeptRunning;
30
+ case "succeeded": return undefined;
31
+ }
32
+ }
33
+ function WorkingMark() {
34
+ return _jsx("span", { className: "vk-spinner vk-chat-activity-spinner", "aria-hidden": "true" });
35
+ }
36
+ /** A started step shows the working mark only while its run is live; otherwise it says it is in progress. */
37
+ function StepState({ state, live }) {
38
+ const { messages } = useLocale();
39
+ const word = stepWord(state, messages.chat);
40
+ if (!word)
41
+ return null;
42
+ if (state === "started" && live)
43
+ return _jsxs("span", { className: "vk-chat-step-state", children: [_jsx(WorkingMark, {}), _jsx("span", { className: "vk-sr-only", children: word })] });
44
+ return _jsxs("span", { className: "vk-chat-step-state", children: [state === "failed" ? _jsx(Icon, { name: "circle-alert", size: 14 }) : null, word] });
45
+ }
46
+ function Step({ step, live }) {
47
+ return (_jsxs("li", { className: "vk-chat-step", "data-state": step.state, children: [_jsx(Icon, { name: STEP_ICON[step.kind], size: 14, className: "vk-chat-step-icon" }), _jsxs("span", { className: "vk-chat-step-text", children: [_jsx("span", { className: "vk-chat-step-label", children: step.label }), step.outcome ? _jsx("span", { className: "vk-chat-step-outcome", children: step.outcome }) : null] }), _jsx(StepState, { state: step.state, live: live })] }));
48
+ }
49
+ function Entries({ entries, live }) {
50
+ if (!entries.length)
51
+ return null;
52
+ return _jsx("ol", { className: "vk-chat-activity-entries", children: entries.map((entry) => entry.type === "step" ? _jsx(Step, { step: entry, live: live }, entry.id) : _jsx("li", { className: "vk-prose vk-chat-narration", children: entry.content }, entry.id)) });
53
+ }
54
+ function Omitted({ count }) {
55
+ const { messages } = useLocale();
56
+ if (!count || count <= 0)
57
+ return null;
58
+ return _jsx("p", { className: "vk-chat-activity-omitted", children: messages.chat.omittedSteps(count) });
59
+ }
60
+ /** Title, state word, outcome and elapsed time: the run's status line, and its summary once it ends. */
61
+ function Summary({ activity }) {
62
+ const { messages } = useLocale();
63
+ return _jsxs(_Fragment, { children: [activity.state === "working" ? _jsx(WorkingMark, {}) : _jsx(Icon, { name: STATE_ICON[activity.state], size: 16, className: "vk-chat-activity-icon" }), _jsxs("span", { className: "vk-chat-activity-text", children: [_jsx("span", { className: "vk-chat-activity-title", children: activity.title }), _jsx("span", { className: "vk-chat-activity-state", children: activityWord(activity.state, messages.chat) }), activity.outcome ? _jsx("span", { className: "vk-chat-activity-outcome", children: activity.outcome }) : null, activity.elapsed ? _jsx("span", { className: "vk-chat-activity-elapsed", children: activity.elapsed }) : null] })] });
64
+ }
65
+ /** A working or waiting run: the latest entries under its status line; earlier ones open above them. */
66
+ function OpenActivity({ activity }) {
67
+ const live = activity.state === "working";
68
+ const { messages } = useLocale();
69
+ const earlier = activity.entries.slice(0, Math.max(0, activity.entries.length - LATEST_ENTRIES));
70
+ const latest = activity.entries.slice(earlier.length);
71
+ return _jsxs(_Fragment, { children: [_jsx("div", { className: "vk-chat-activity-line", children: _jsx(Summary, { activity: activity }) }), _jsxs("div", { className: "vk-chat-activity-body", children: [earlier.length ? _jsxs(Collapsible.Root, { className: "vk-chat-activity-earlier", children: [_jsx(Collapsible.Trigger, { asChild: true, children: _jsxs(Button, { type: "button", size: "xs", variant: "ghost", className: "vk-chat-activity-more", children: [_jsx(Icon, { name: "chevron-down", size: 14, className: "vk-chat-activity-chevron" }), messages.chat.earlierEntries(earlier.length)] }) }), _jsx(Collapsible.Content, { children: _jsx(Entries, { entries: earlier, live: live }) })] }) : null, _jsx(Entries, { entries: latest, live: live }), _jsx(Omitted, { count: activity.omitted })] })] });
72
+ }
73
+ /** One line that opens to the whole run. */
74
+ function EndedActivity({ activity }) {
75
+ if (!activity.entries.length && !activity.omitted)
76
+ return _jsx("div", { className: "vk-chat-activity-line", children: _jsx(Summary, { activity: activity }) });
77
+ return (_jsxs(Collapsible.Root, { children: [_jsxs(Collapsible.Trigger, { className: "vk-chat-activity-line vk-chat-activity-toggle", children: [_jsx(Summary, { activity: activity }), _jsx(Icon, { name: "chevron-down", size: 16, className: "vk-chat-activity-chevron" })] }), _jsxs(Collapsible.Content, { className: "vk-chat-activity-body", children: [_jsx(Entries, { entries: activity.entries, live: false }), _jsx(Omitted, { count: activity.omitted })] })] }));
78
+ }
79
+ function latestStep(entries) {
80
+ for (let index = entries.length - 1; index >= 0; index--) {
81
+ const entry = entries[index];
82
+ if (entry?.type === "step")
83
+ return entry;
84
+ }
85
+ return undefined;
86
+ }
87
+ /** The latest step while working, otherwise the run's state; nothing for what was already there on mount. */
88
+ function useAnnouncement(activity) {
89
+ const { messages } = useLocale();
90
+ const step = latestStep(activity.entries);
91
+ const text = activity.state !== "working"
92
+ ? messages.chat.activityStatus(activity.title, activityWord(activity.state, messages.chat))
93
+ : step ? messages.chat.activityStep(activity.title, step.label, step.state === "failed" ? messages.chat.stepFailed : undefined) : "";
94
+ const [initial] = useState(text);
95
+ const shown = useThrottled(text, ANNOUNCE_INTERVAL);
96
+ return shown === initial ? "" : shown;
97
+ }
98
+ /** An agent run in the transcript. The log ignores its entries; a throttled status speaks for it. */
99
+ export function ActivityItem({ activity, reducedMotion }) {
100
+ const announcement = useAnnouncement(activity);
101
+ return (_jsxs(m.li, { className: "vk-chat-activity", "data-state": activity.state, initial: { opacity: 0, y: reducedMotion ? 0 : 4 }, animate: { opacity: 1, y: 0 }, transition: { duration: reducedMotion ? 0 : 0.16, ease: "easeOut" }, children: [_jsx("div", { "aria-live": "off", children: activity.state === "working" || activity.state === "waiting" ? _jsx(OpenActivity, { activity: activity }) : _jsx(EndedActivity, { activity: activity }) }), _jsx("div", { role: "status", className: "vk-sr-only", children: announcement })] }));
102
+ }
@@ -1,13 +1,13 @@
1
1
  import { type ReactNode } from "react";
2
- import type { ChatMessage } from "../../chat.js";
2
+ import type { ChatItem } from "../../chat.js";
3
3
  interface TranscriptProps {
4
- messages: readonly ChatMessage[];
4
+ items: readonly ChatItem[];
5
5
  emptyState?: ReactNode;
6
6
  pending?: ReactNode;
7
7
  error?: ReactNode;
8
8
  label?: string;
9
9
  onRetryMessage?: (id: string) => void;
10
10
  }
11
- /** A native scrollable log. Follow new messages only while the reader is near its end. */
11
+ /** A native scrollable log of messages and agent runs. Follow new items only while the reader is near its end. */
12
12
  export declare function ChatTranscript(props: TranscriptProps): import("react/jsx-runtime").JSX.Element;
13
13
  export {};
@@ -9,6 +9,7 @@ import { Avatar } from "../Avatar/Avatar.js";
9
9
  import { Button } from "../Button/Button.js";
10
10
  import { Icon } from "../Icon/Icon.js";
11
11
  import { cx } from "../../lib/cx.js";
12
+ import { ActivityItem } from "./activity.js";
12
13
  function MessageDelivery({ message, onRetry }) {
13
14
  const { messages } = useLocale();
14
15
  if (!message.delivery)
@@ -18,9 +19,9 @@ function MessageDelivery({ message, onRetry }) {
18
19
  return (_jsxs("div", { className: "vk-chat-delivery vk-chat-delivery-failed", children: [_jsx(Icon, { name: "circle-alert", size: 14 }), _jsx("span", { children: message.delivery.error || messages.chat.failed }), onRetry ? _jsx(Button, { type: "button", size: "sm", variant: "ghost", "aria-label": messages.chat.retryMessage(message.author.name), onClick: () => { onRetry(message.id); }, children: messages.chat.retry }) : null] }));
19
20
  }
20
21
  function MessageItem({ message, onRetry, reducedMotion }) {
21
- return (_jsxs(m.li, { className: cx("vk-chat-message", "vk-chat-message-" + message.direction), initial: { opacity: 0, y: reducedMotion ? 0 : 4 }, animate: { opacity: 1, y: 0 }, transition: { duration: reducedMotion ? 0 : 0.16, ease: "easeOut" }, children: [_jsx("span", { className: "vk-chat-message-avatar", children: message.author.avatar || _jsx(Avatar, { name: message.author.name, size: 28, decorative: true }) }), _jsxs("div", { className: "vk-chat-message-body", children: [_jsxs("div", { className: "vk-chat-message-meta", children: [_jsx("span", { className: "vk-chat-message-author", children: message.author.name }), message.timestamp ? _jsx("span", { className: "vk-chat-message-time", children: message.timestamp }) : null] }), _jsx("div", { className: "vk-prose vk-chat-message-content", children: message.content }), _jsx(MessageDelivery, { message: message, onRetry: onRetry })] })] }));
22
+ return (_jsxs(m.li, { className: cx("vk-chat-message", "vk-chat-message-" + message.direction), initial: { opacity: 0, y: reducedMotion ? 0 : 4 }, animate: { opacity: 1, y: 0 }, transition: { duration: reducedMotion ? 0 : 0.16, ease: "easeOut" }, children: [_jsx("span", { className: "vk-chat-message-avatar", children: message.author.avatar || _jsx(Avatar, { name: message.author.name, size: 28, decorative: true }) }), _jsxs("div", { className: "vk-chat-message-body", children: [_jsxs("div", { className: "vk-chat-message-meta", children: [_jsx("span", { className: "vk-chat-message-author", children: message.author.name }), message.author.source ? _jsxs("span", { className: "vk-chat-message-source", children: [message.author.source.mark, message.author.source.label] }) : null, message.timestamp ? _jsx("span", { className: "vk-chat-message-time", children: message.timestamp }) : null] }), _jsx("div", { className: "vk-prose vk-chat-message-content", children: message.content }), _jsx(MessageDelivery, { message: message, onRetry: onRetry })] }), message.actions?.length ? _jsx("div", { className: "vk-chat-message-actions", children: message.actions.map((action) => _jsx(Button, { type: "button", size: "xs", variant: action.variant || "outline", disabled: action.disabled, onClick: action.onSelect, children: action.label }, action.id)) }) : null] }));
22
23
  }
23
- /** A native scrollable log. Follow new messages only while the reader is near its end. */
24
+ /** A native scrollable log of messages and agent runs. Follow new items only while the reader is near its end. */
24
25
  export function ChatTranscript(props) {
25
26
  const { messages } = useLocale();
26
27
  const reducedMotion = useReducedMotion() === true;
@@ -30,10 +31,10 @@ export function ChatTranscript(props) {
30
31
  const node = scrollRef.current;
31
32
  if (node && follow.current)
32
33
  node.scrollTop = node.scrollHeight;
33
- }, [props.messages, props.pending]);
34
+ }, [props.items, props.pending]);
34
35
  const empty = props.emptyState === undefined ? messages.chat.empty : props.emptyState;
35
36
  return (_jsxs("div", { ref: scrollRef, role: "log", "aria-label": props.label || messages.chat.messages, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", tabIndex: 0, className: "vk-chat-transcript", onScroll: (event) => {
36
37
  const node = event.currentTarget;
37
38
  follow.current = node.scrollHeight - node.scrollTop - node.clientHeight <= 32;
38
- }, children: [_jsx(LazyMotion, { features: domAnimation, children: _jsx("ol", { className: "vk-chat-messages", children: _jsx(AnimatePresence, { initial: false, children: props.messages.map((message) => _jsx(MessageItem, { message: message, onRetry: props.onRetryMessage, reducedMotion: reducedMotion }, message.id)) }) }) }), !props.messages.length && !props.pending && !props.error ? _jsx("div", { className: "vk-chat-empty", children: empty }) : null, props.pending ? _jsx("div", { className: "vk-chat-pending", role: "status", children: props.pending }) : null] }));
39
+ }, children: [_jsx(LazyMotion, { features: domAnimation, children: _jsx("ol", { className: "vk-chat-messages", children: _jsx(AnimatePresence, { initial: false, children: props.items.map((item) => item.type === "activity" ? _jsx(ActivityItem, { activity: item, reducedMotion: reducedMotion }, item.id) : _jsx(MessageItem, { message: item, onRetry: props.onRetryMessage, reducedMotion: reducedMotion }, item.id)) }) }) }), !props.items.length && !props.pending && !props.error ? _jsx("div", { className: "vk-chat-empty", children: empty }) : null, props.pending ? _jsx("div", { className: "vk-chat-pending", role: "status", children: props.pending }) : null] }));
39
40
  }
@@ -1941,6 +1941,8 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
1941
1941
  .vk-chat-message-outgoing .vk-chat-message-body { border-color: var(--primary-line); background: var(--primary-tint); }
1942
1942
  .vk-chat-message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-xs) var(--space-sm); margin-bottom: var(--space-xs); }
1943
1943
  .vk-chat-message-author { font-size: var(--text-xs); font-weight: 600; color: var(--foreground); overflow-wrap: anywhere; }
1944
+ .vk-chat-message-source { display: inline-flex; align-items: center; gap: var(--space-xs); padding-inline: var(--space-xs); border: 1px solid var(--border-subtle); font-size: var(--text-xs); line-height: 1.5; color: var(--muted-foreground); overflow-wrap: anywhere; }
1945
+ .vk-chat-message-source > svg, .vk-chat-message-source > img { flex: none; width: 0.75rem; height: 0.75rem; }
1944
1946
  .vk-chat-message-time { font: var(--text-xs)/1.5 var(--font-numeric); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
1945
1947
  .vk-chat-message-content { min-width: 0; max-width: none; font-size: var(--text-sm); color: var(--foreground); white-space: pre-wrap; overflow-wrap: anywhere; }
1946
1948
  .vk-chat-message-content > :last-child { margin-bottom: 0; }
@@ -1951,24 +1953,73 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
1951
1953
  .vk-chat-delivery { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--muted-foreground); overflow-wrap: anywhere; }
1952
1954
  .vk-chat-delivery-failed { color: var(--danger); }
1953
1955
  .vk-chat-delivery .vk-btn { width: auto; }
1956
+ .vk-chat-message-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
1957
+ .vk-chat-message-outgoing .vk-chat-message-actions { justify-content: flex-end; }
1958
+ .vk-chat-message-actions .vk-btn { width: auto; }
1959
+ /* An agent run: a status line over its narration and steps. The log ignores the entries; a throttled status announces them. */
1960
+ .vk-chat-activity { min-width: 0; border: 1px solid var(--border-subtle); color: var(--foreground); }
1961
+ .vk-chat-activity-line { display: flex; align-items: flex-start; gap: var(--space-sm); box-sizing: border-box; width: 100%; min-width: 0; padding: calc((var(--control-height) - 1.5em) / 2) var(--space-md); border: 0; background: transparent; color: inherit; font: inherit; font-size: var(--text-sm); line-height: 1.5; text-align: start; }
1962
+ /* Marks line up with the first line of text when the summary wraps. */
1963
+ .vk-chat-activity-line > .vk-icon { margin-top: calc((1.5em - 16px) / 2); }
1964
+ .vk-chat-activity-line > .vk-chat-activity-spinner { margin-top: calc((1.5em - 0.75rem) / 2); }
1965
+ .vk-chat-activity-toggle { cursor: pointer; }
1966
+ .vk-chat-activity-toggle:hover { background: var(--card-fill); }
1967
+ .vk-chat-activity-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
1968
+ .vk-chat-activity-text { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-sm); min-width: 0; }
1969
+ .vk-chat-activity-title { font-weight: 600; overflow-wrap: anywhere; }
1970
+ .vk-chat-activity-state, .vk-chat-activity-outcome { color: var(--muted-foreground); overflow-wrap: anywhere; }
1971
+ .vk-chat-activity-elapsed { margin-inline-start: auto; font: var(--text-xs)/1.5 var(--font-numeric); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
1972
+ .vk-chat-activity-icon { flex: none; color: var(--muted-foreground); }
1973
+ .vk-chat-activity[data-state="finished"] .vk-chat-activity-icon { color: var(--success); }
1974
+ /* Waiting on a person: the accent, with the word "Waiting" beside it. */
1975
+ .vk-chat-activity[data-state="waiting"] { border-color: var(--primary-line); }
1976
+ .vk-chat-activity[data-state="waiting"] .vk-chat-activity-icon, .vk-chat-activity[data-state="waiting"] .vk-chat-activity-state { color: var(--primary); }
1977
+ .vk-chat-activity[data-state="failed"] .vk-chat-activity-icon, .vk-chat-activity[data-state="failed"] .vk-chat-activity-state { color: var(--danger); }
1978
+ .vk-chat-activity-spinner { flex: none; width: 0.75rem; height: 0.75rem; }
1979
+ .vk-chat-activity-chevron { flex: none; color: var(--muted-foreground); transition: transform 0.16s ease-out; }
1980
+ [data-state="open"] > .vk-chat-activity-chevron { transform: rotate(180deg); }
1981
+ .vk-chat-activity-body { display: grid; gap: var(--space-xs); padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--border-subtle); }
1982
+ .vk-chat-activity-body[hidden] { display: none; }
1983
+ .vk-chat-activity-earlier { display: grid; gap: var(--space-xs); justify-items: start; }
1984
+ .vk-chat-activity-earlier > .vk-btn { width: auto; }
1985
+ .vk-chat-activity-entries { display: grid; gap: var(--space-xs); width: 100%; margin: 0; padding: 0; list-style: none; }
1986
+ .vk-chat-narration { max-width: none; padding-block: var(--space-xs); font-size: var(--text-sm); color: var(--foreground); overflow-wrap: anywhere; }
1987
+ .vk-chat-narration > :last-child { margin-bottom: 0; }
1988
+ .vk-chat-step { display: flex; align-items: baseline; gap: var(--space-sm); min-width: 0; font-size: var(--text-xs); line-height: 1.5; color: var(--muted-foreground); }
1989
+ .vk-chat-step-icon { flex: none; align-self: center; }
1990
+ .vk-chat-step-text { display: flex; flex: 1; flex-wrap: wrap; gap: 0 var(--space-sm); min-width: 0; }
1991
+ .vk-chat-step-label { color: var(--foreground); overflow-wrap: anywhere; }
1992
+ .vk-chat-step-outcome { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
1993
+ .vk-chat-step-state { display: inline-flex; flex: none; align-items: center; align-self: center; gap: var(--space-xs); }
1994
+ .vk-chat-step[data-state="failed"] .vk-chat-step-state { color: var(--danger); }
1995
+ .vk-chat-activity-omitted { margin: 0; font-size: var(--text-xs); line-height: 1.5; color: var(--muted-foreground); }
1954
1996
  .vk-chat-empty { display: grid; align-content: center; min-width: 0; padding: var(--space-xl) var(--space-md); font-size: var(--text-sm); line-height: 1.6; color: var(--muted-foreground); overflow-wrap: anywhere; }
1955
1997
  .vk-chat-pending { padding-block: var(--space-md); font-size: var(--text-sm); color: var(--muted-foreground); overflow-wrap: anywhere; }
1956
1998
  .vk-chat-feedback { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--danger-line); color: var(--danger); font-size: var(--text-sm); overflow-wrap: anywhere; }
1957
1999
  .vk-chat-feedback > div { flex: 1; min-width: 0; }
1958
2000
  .vk-chat-feedback .vk-btn { width: auto; }
2001
+ .vk-chat-read-only { display: flex; flex: none; align-items: flex-start; gap: var(--space-sm); padding: var(--space-md); border-top: 1px solid var(--border-subtle); background: var(--background); font-size: var(--text-sm); line-height: 1.5; color: var(--muted-foreground); overflow-wrap: anywhere; }
2002
+ .vk-chat-read-only > svg { flex: none; margin-top: 0.125rem; }
2003
+ .vk-chat-read-only > div { flex: 1; min-width: 0; }
1959
2004
  .vk-chat-composer { display: grid; grid-template-rows: minmax(0, 1fr) auto; flex: 0 1 auto; gap: var(--space-sm); box-sizing: border-box; min-width: 0; min-height: 0; max-height: 65%; overflow: hidden; padding: var(--space-md); border-top: 1px solid var(--border-subtle); background: var(--background); }
1960
2005
  .vk-chat-composer > .vk-field { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
1961
2006
  .vk-chat-composer .vk-rich-content { min-height: 4rem; max-height: 8rem; overflow-y: auto; padding: var(--space-sm); }
1962
2007
  .vk-chat-composer-actions { display: flex; justify-content: flex-end; }
1963
2008
  .vk-chat-composer-actions .vk-btn { width: auto; }
1964
2009
  @media (max-width: 40rem) {
1965
- .vk-chat-header, .vk-chat-transcript, .vk-chat-composer { padding: var(--space-sm); }
2010
+ .vk-chat-header, .vk-chat-transcript, .vk-chat-composer, .vk-chat-read-only { padding: var(--space-sm); }
2011
+ .vk-chat-activity-line, .vk-chat-activity-body { padding-inline: var(--space-sm); }
1966
2012
  .vk-chat-message { max-width: 100%; }
1967
2013
  .vk-chat-message-body { padding: var(--space-sm); }
1968
2014
  }
1969
2015
  @media (forced-colors: active) {
1970
2016
  .vk-chat-message-outgoing .vk-chat-message-body { border-color: Highlight; }
1971
- .vk-chat-delivery-failed, .vk-chat-feedback { color: CanvasText; }
2017
+ .vk-chat-delivery-failed, .vk-chat-feedback, .vk-chat-step[data-state="failed"] .vk-chat-step-state, .vk-chat-activity[data-state="failed"] .vk-chat-activity-state, .vk-chat-activity[data-state="waiting"] .vk-chat-activity-state, .vk-chat-activity-icon { color: CanvasText; }
2018
+ .vk-chat-activity[data-state="waiting"] { border-color: Highlight; }
2019
+ .vk-chat-activity-toggle { color: ButtonText; }
2020
+ }
2021
+ @media (prefers-reduced-motion: reduce) {
2022
+ .vk-chat-activity-chevron { transition: none; }
1972
2023
  }
1973
2024
  .vk-chat-widget-launcher { position: fixed; z-index: var(--z-fixed); inset-block-end: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); inset-inline-end: calc(var(--space-lg) + env(safe-area-inset-right, 0px)); }
1974
2025
  .vk-chat-widget-start { inset-inline-end: auto; inset-inline-start: calc(var(--space-lg) + env(safe-area-inset-left, 0px)); }
@@ -1980,7 +2031,7 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
1980
2031
  .vk-chat-widget-panel { transform-origin: var(--radix-popover-content-transform-origin); }
1981
2032
  .vk-chat-widget-panel[data-state="closed"] { pointer-events: none; }
1982
2033
  @media (max-height: 32rem) {
1983
- .vk-chat-widget-panel .vk-chat-header, .vk-chat-widget-panel .vk-chat-transcript, .vk-chat-widget-panel .vk-chat-composer { padding: var(--space-sm); }
2034
+ .vk-chat-widget-panel .vk-chat-header, .vk-chat-widget-panel .vk-chat-transcript, .vk-chat-widget-panel .vk-chat-composer, .vk-chat-widget-panel .vk-chat-read-only { padding: var(--space-sm); }
1984
2035
  .vk-chat-widget-panel .vk-chat-transcript { flex: 0 1 4rem; min-height: 0; max-height: 25%; }
1985
2036
  .vk-chat-widget-panel .vk-chat-composer { flex: 1; max-height: none; }
1986
2037
  .vk-chat-widget-panel .vk-chat-composer .vk-rich-content { min-height: 2rem; padding-block: var(--space-xs); }
@@ -1989,7 +2040,8 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
1989
2040
  .vk-chat-widget-trigger { border-color: ButtonText; color: ButtonText; }
1990
2041
  .vk-chat-unread { background: Highlight; color: HighlightText; }
1991
2042
  }
1992
- .vk-chat-inbox { container-type: inline-size; display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); box-sizing: border-box; width: 100%; height: min(42rem, calc(100dvh - 2 * var(--space-md))); min-width: 0; min-height: 0; border: 1px solid var(--border-subtle); background: var(--background); color: var(--foreground); }
2043
+ /* The inbox fills its container; the application gives the container a height (a docked pane, a page region). */
2044
+ .vk-chat-inbox { container-type: inline-size; display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); box-sizing: border-box; width: 100%; height: 100%; min-width: 0; min-height: 0; border: 1px solid var(--border-subtle); background: var(--background); color: var(--foreground); }
1993
2045
  .vk-chat-inbox-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-inline-end: 1px solid var(--border-subtle); }
1994
2046
  .vk-chat-threads { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0; list-style: none; }
1995
2047
  .vk-chat-threads > li + li { border-top: 1px solid var(--border-subtle); }
@@ -2006,6 +2058,8 @@ textarea.vk-input, .vk-textarea { resize: vertical; min-height: 8rem; padding-bl
2006
2058
  .vk-chat-inbox-detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
2007
2059
  .vk-chat-no-selection { flex: 1; }
2008
2060
  .vk-chat-back { display: none; }
2061
+ .vk-chat-header-actions { display: flex; flex: none; align-items: center; gap: var(--space-xs); margin-inline-start: auto; }
2062
+ .vk-chat-header-actions .vk-btn { width: auto; }
2009
2063
  @container (max-width: 40rem) {
2010
2064
  .vk-chat-inbox-list { border-inline-end: 0; }
2011
2065
  .vk-chat-inbox:not(.vk-chat-inbox-selected) .vk-chat-inbox-detail, .vk-chat-inbox-selected .vk-chat-inbox-list { display: none; }
@@ -0,0 +1,2 @@
1
+ /** Follows `value` at most once per `interval` milliseconds; the latest value always arrives. */
2
+ export declare function useThrottled<T>(value: T, interval: number): T;
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { useEffect, useRef, useState } from "react";
3
+ /** Follows `value` at most once per `interval` milliseconds; the latest value always arrives. */
4
+ export function useThrottled(value, interval) {
5
+ const [shown, setShown] = useState(value);
6
+ const last = useRef(0);
7
+ useEffect(() => {
8
+ if (Object.is(value, shown))
9
+ return;
10
+ const timer = setTimeout(() => {
11
+ last.current = Date.now();
12
+ setShown(value);
13
+ }, Math.max(0, last.current + interval - Date.now()));
14
+ return () => { clearTimeout(timer); };
15
+ }, [value, shown, interval]);
16
+ return shown;
17
+ }
@@ -54,6 +54,19 @@ export interface ChatMessages {
54
54
  noThreads: string;
55
55
  conversations: string;
56
56
  unread: (count: number) => string;
57
+ readOnly: string;
58
+ activityWorking: string;
59
+ activityWaiting: string;
60
+ activityFinished: string;
61
+ activityFailed: string;
62
+ activityStopped: string;
63
+ stepStarted: string;
64
+ stepFailed: string;
65
+ stepKeptRunning: string;
66
+ earlierEntries: (count: number) => string;
67
+ omittedSteps: (count: number) => string;
68
+ activityStep: (title: string, step: string, state?: string) => string;
69
+ activityStatus: (title: string, state: string) => string;
57
70
  }
58
71
  /** Built-in interface copy. Functions keep interpolation and plurals typed. */
59
72
  export interface LocaleMessages {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useMemo } from "react";
4
- import { resolveLocale } from "./lib/format.js";
4
+ import { formatNumber, resolveLocale } from "./lib/format.js";
5
5
  const englishEmojiNames = {
6
6
  "😀": "Grinning face", "🙂": "Smile", "❤️": "Heart", "👍": "Thumbs up", "👎": "Thumbs down", "🎉": "Celebration",
7
7
  "✅": "Check", "⚠️": "Warning", "💡": "Idea", "🚀": "Rocket", "👀": "Eyes", "🙏": "Thank you",
@@ -16,6 +16,12 @@ const english = {
16
16
  send: "Send message", sending: "Sending message", failed: "Message not sent", retry: "Retry", retryMessage: (author) => "Retry message from " + author,
17
17
  tryAgain: "Try again", back: "Back to conversations", empty: "No messages yet. Start the conversation.", chooseThread: "Choose a conversation to read and reply.", noThreads: "No conversations yet.",
18
18
  conversations: "Conversations", unread: (count) => String(count) + (count === 1 ? " unread message" : " unread messages"),
19
+ readOnly: "Replies aren't available in this conversation.",
20
+ activityWorking: "Working", activityWaiting: "Waiting", activityFinished: "Finished", activityFailed: "Failed", activityStopped: "Stopped",
21
+ stepStarted: "In progress", stepFailed: "Failed", stepKeptRunning: "Kept running",
22
+ earlierEntries: (count) => formatNumber(count, { locale: "en-US" }) + (count === 1 ? " earlier entry" : " earlier entries"),
23
+ omittedSteps: (count) => "and " + formatNumber(count, { locale: "en-US" }) + (count === 1 ? " more step" : " more steps"),
24
+ activityStep: (title, step, state) => title + ": " + step + (state ? " (" + state + ")" : ""), activityStatus: (title, state) => title + ": " + state,
19
25
  },
20
26
  richText: {
21
27
  formatting: "Formatting options",
@@ -66,6 +72,12 @@ const dutch = {
66
72
  send: "Bericht verzenden", sending: "Bericht wordt verzonden", failed: "Bericht niet verzonden", retry: "Opnieuw proberen", retryMessage: (author) => "Bericht van " + author + " opnieuw proberen",
67
73
  tryAgain: "Opnieuw proberen", back: "Terug naar gesprekken", empty: "Nog geen berichten. Begin het gesprek.", chooseThread: "Kies een gesprek om te lezen en te antwoorden.", noThreads: "Nog geen gesprekken.",
68
74
  conversations: "Gesprekken", unread: (count) => String(count) + (count === 1 ? " ongelezen bericht" : " ongelezen berichten"),
75
+ readOnly: "In dit gesprek kun je niet antwoorden.",
76
+ activityWorking: "Bezig", activityWaiting: "Wacht op jou", activityFinished: "Klaar", activityFailed: "Mislukt", activityStopped: "Gestopt",
77
+ stepStarted: "Bezig", stepFailed: "Mislukt", stepKeptRunning: "Blijft actief",
78
+ earlierEntries: (count) => formatNumber(count, { locale: "nl-NL" }) + (count === 1 ? " eerdere regel" : " eerdere regels"),
79
+ omittedSteps: (count) => "en nog " + formatNumber(count, { locale: "nl-NL" }) + (count === 1 ? " stap" : " stappen"),
80
+ activityStep: (title, step, state) => title + ": " + step + (state ? " (" + state + ")" : ""), activityStatus: (title, state) => title + ": " + state,
69
81
  },
70
82
  richText: {
71
83
  formatting: "Opmaakopties",