@ciridae/ui 1.0.2 → 1.0.4
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/dist/app/auth.d.ts +10 -0
- package/dist/app/auth.js +60 -0
- package/dist/app/error-boundary.d.ts +18 -0
- package/dist/app/error-boundary.js +45 -0
- package/dist/app/feedback.d.ts +12 -0
- package/dist/app/feedback.js +128 -0
- package/dist/app/index.d.ts +8 -0
- package/dist/app/index.js +8 -0
- package/dist/app/request-errors.d.ts +63 -0
- package/dist/app/request-errors.js +172 -0
- package/dist/app/sentry.d.ts +18 -0
- package/dist/app/sentry.js +52 -0
- package/dist/app/telemetry.d.ts +7 -0
- package/dist/app/telemetry.js +28 -0
- package/dist/app/trail.d.ts +9 -0
- package/dist/app/trail.js +18 -0
- package/dist/chat/chat-query-keys.d.ts +3 -3
- package/dist/chat/contract.d.ts +15 -15
- package/dist/chat/conversation-items-query-options.d.ts +114 -114
- package/dist/chat/conversation-source.d.ts +89 -0
- package/dist/chat/conversation-source.js +1 -0
- package/dist/chat/describe-tool-call.d.ts +3 -3
- package/dist/chat/describe-tool-call.js +3 -3
- package/dist/chat/message-text.d.ts +1 -1
- package/dist/chat/message-text.js +116 -48
- package/dist/chat/use-conversation-list.d.ts +6 -6
- package/dist/ciridae.css +16 -4
- package/dist/components/activity-feed.d.ts +3 -2
- package/dist/components/activity-feed.js +1 -0
- package/dist/components/agent-work.d.ts +3 -3
- package/dist/components/app-frame.d.ts +91 -0
- package/dist/components/app-frame.js +134 -0
- package/dist/components/app-navigation.d.ts +30 -3
- package/dist/components/app-navigation.js +105 -14
- package/dist/components/badge.d.ts +30 -5
- package/dist/components/badge.js +134 -15
- package/dist/components/brand-icons.d.ts +3 -3
- package/dist/components/bulk-action-bar.d.ts +1 -1
- package/dist/components/bulk-action-bar.js +3 -3
- package/dist/components/button.d.ts +12 -5
- package/dist/components/button.js +77 -44
- package/dist/components/calendar.d.ts +1 -1
- package/dist/components/calendar.js +44 -17
- package/dist/components/centered-page.d.ts +1 -1
- package/dist/components/centered-page.js +2 -2
- package/dist/components/chart.d.ts +22 -2
- package/dist/components/chart.js +251 -51
- package/dist/components/chat-client-source.d.ts +16 -0
- package/dist/components/chat-client-source.js +297 -0
- package/dist/components/chat-page.d.ts +9 -8
- package/dist/components/chat-page.js +7 -11
- package/dist/components/chat-sheet-controller.d.ts +11 -14
- package/dist/components/chat-sheet-controller.js +3 -3
- package/dist/components/chat-sheet.d.ts +18 -11
- package/dist/components/chat-sheet.js +188 -289
- package/dist/components/chat.d.ts +109 -19
- package/dist/components/chat.js +520 -124
- package/dist/components/checkbox-item.d.ts +6 -3
- package/dist/components/checkbox-item.js +9 -5
- package/dist/components/checkbox-list.d.ts +1 -1
- package/dist/components/chip.d.ts +6 -1
- package/dist/components/chip.js +27 -1
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/color-theme.d.ts +1 -1
- package/dist/components/column-settings.d.ts +1 -1
- package/dist/components/column-settings.js +1 -1
- package/dist/components/command-menu.d.ts +5 -1
- package/dist/components/command-menu.js +98 -32
- package/dist/components/command-palette.d.ts +7 -3
- package/dist/components/command-palette.js +20 -11
- package/dist/components/copyable-id.d.ts +22 -5
- package/dist/components/copyable-id.js +46 -6
- package/dist/components/data-display.d.ts +39 -8
- package/dist/components/data-display.js +138 -19
- package/dist/components/data-grid.d.ts +23 -11
- package/dist/components/data-grid.js +61 -26
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker.js +9 -20
- package/dist/components/date-time.d.ts +1 -1
- package/dist/components/dialog-height-context.d.ts +1 -1
- package/dist/components/document-viewer.d.ts +2 -2
- package/dist/components/drawer.d.ts +11 -6
- package/dist/components/drawer.js +91 -54
- package/dist/components/dropzone.d.ts +4 -4
- package/dist/components/editable-field.d.ts +12 -3
- package/dist/components/editable-field.js +57 -27
- package/dist/components/email-input.d.ts +1 -1
- package/dist/components/email-input.js +6 -5
- package/dist/components/environment-frame.d.ts +2 -2
- package/dist/components/environment-frame.js +37 -6
- package/dist/components/expandable-text.d.ts +1 -1
- package/dist/components/feedback-screenshot.d.ts +1 -1
- package/dist/components/feedback-sheet.d.ts +18 -3
- package/dist/components/feedback-sheet.js +216 -55
- package/dist/components/field-context.d.ts +1 -1
- package/dist/components/filter-bar.d.ts +3 -3
- package/dist/components/filter-bar.js +43 -29
- package/dist/components/form-controls.d.ts +12 -3
- package/dist/components/form-controls.js +46 -22
- package/dist/components/form-layout.d.ts +14 -10
- package/dist/components/form-layout.js +68 -23
- package/dist/components/glass-menu.d.ts +3 -0
- package/dist/components/glass-menu.js +63 -0
- package/dist/components/gradient-edge.d.ts +9 -0
- package/dist/components/gradient-edge.js +31 -0
- package/dist/components/hotkeys.d.ts +2 -2
- package/dist/components/icon.d.ts +1 -1
- package/dist/components/input.d.ts +7 -5
- package/dist/components/input.js +29 -17
- package/dist/components/keyboard-shortcuts.d.ts +2 -2
- package/dist/components/keycap.d.ts +10 -6
- package/dist/components/keycap.js +57 -19
- package/dist/components/layout.d.ts +13 -13
- package/dist/components/lightbox.d.ts +9 -3
- package/dist/components/lightbox.js +13 -9
- package/dist/components/link.d.ts +1 -1
- package/dist/components/locale.d.ts +42 -2
- package/dist/components/locale.js +43 -3
- package/dist/components/log-entry.d.ts +40 -0
- package/dist/components/log-entry.js +146 -0
- package/dist/components/log-list.d.ts +3 -3
- package/dist/components/mention-input.d.ts +2 -2
- package/dist/components/mention-input.js +4 -3
- package/dist/components/menu.d.ts +7 -3
- package/dist/components/menu.js +34 -37
- package/dist/components/meter.d.ts +10 -2
- package/dist/components/meter.js +64 -6
- package/dist/components/navigation.d.ts +21 -4
- package/dist/components/navigation.js +84 -19
- package/dist/components/notification-tray.d.ts +1 -1
- package/dist/components/notification-tray.js +5 -4
- package/dist/components/overlays.d.ts +6 -4
- package/dist/components/overlays.js +69 -40
- package/dist/components/page-frame.d.ts +4 -4
- package/dist/components/page-frame.js +1 -1
- package/dist/components/panel.d.ts +4 -4
- package/dist/components/panel.js +18 -12
- package/dist/components/profile-header.d.ts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/project-avatar.d.ts +1 -1
- package/dist/components/radio-card.d.ts +2 -2
- package/dist/components/radio-card.js +10 -9
- package/dist/components/record.d.ts +29 -5
- package/dist/components/record.js +147 -18
- package/dist/components/resolved-file-url.d.ts +19 -0
- package/dist/components/resolved-file-url.js +49 -0
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/secret-dialog.d.ts +1 -1
- package/dist/components/segmented-bar.d.ts +4 -2
- package/dist/components/segmented-bar.js +16 -6
- package/dist/components/select.d.ts +9 -6
- package/dist/components/select.js +103 -127
- package/dist/components/settings.d.ts +4 -4
- package/dist/components/shell-skeleton.d.ts +1 -1
- package/dist/components/shell-skeleton.js +1 -1
- package/dist/components/shell.d.ts +21 -21
- package/dist/components/shell.js +43 -43
- package/dist/components/side-panel.d.ts +3 -3
- package/dist/components/sidebar.d.ts +13 -8
- package/dist/components/sidebar.js +55 -27
- package/dist/components/single-line-text.d.ts +2 -0
- package/dist/components/single-line-text.js +16 -0
- package/dist/components/site-banner.d.ts +5 -2
- package/dist/components/site-banner.js +17 -6
- package/dist/components/skeleton.d.ts +8 -7
- package/dist/components/skeleton.js +28 -16
- package/dist/components/skeletons.d.ts +17 -5
- package/dist/components/skeletons.js +71 -8
- package/dist/components/stages.d.ts +83 -11
- package/dist/components/stages.js +512 -156
- package/dist/components/stat-card.d.ts +12 -4
- package/dist/components/stat-card.js +92 -37
- package/dist/components/status-banner.d.ts +1 -1
- package/dist/components/status-banner.js +1 -1
- package/dist/components/status.d.ts +2 -2
- package/dist/components/steps.d.ts +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/tabs.d.ts +8 -8
- package/dist/components/tabs.js +26 -13
- package/dist/components/theme-customizer.d.ts +2 -2
- package/dist/components/theme-toggle.d.ts +4 -0
- package/dist/components/theme-toggle.js +67 -0
- package/dist/components/toast.d.ts +10 -3
- package/dist/components/toast.js +78 -29
- package/dist/components/use-new-version-available.d.ts +6 -0
- package/dist/components/use-new-version-available.js +29 -0
- package/dist/components/user-chip.d.ts +3 -3
- package/dist/components/wizard.d.ts +2 -2
- package/dist/feedback/contract.d.ts +136 -136
- package/dist/feedback/feedback-controller.d.ts +6 -6
- package/dist/feedback/generated/zod.gen.d.ts +28 -28
- package/dist/feedback/operator-contract.d.ts +11 -11
- package/dist/feedback/operator-controller.d.ts +32 -13
- package/dist/feedback/operator-controller.js +44 -11
- package/dist/preset.js +289 -33
- package/dist/styled-system/styles.css +3294 -1079
- package/dist/styled-system/tokens/index.mjs +598 -22
- package/dist/styled-system/tokens/tokens.d.ts +11 -11
- package/dist/styled-system/types/prop-type.d.ts +2 -2
- package/dist/styles.css +16 -4
- package/dist/theme/color.d.ts +3 -0
- package/dist/theme/color.js +5 -0
- package/dist/theme/derive.d.ts +9 -2
- package/dist/theme/derive.js +72 -12
- package/dist/theme/palettes.d.ts +49 -6
- package/dist/theme/palettes.js +84 -15
- package/dist/theme/tokens.d.ts +3 -3
- package/dist/theme/tokens.js +107 -32
- package/package.json +40 -3
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
-
import type {
|
|
3
|
-
import type { ConversationId } from "../chat/contract.js";
|
|
2
|
+
import type { ChatConversationSummary } from "../chat/conversation-source.js";
|
|
4
3
|
export { AgentTaskCard, AgentWork, AgentWorkButton, agentTaskAnchorId, jumpToAgentTask, type AgentTask, type AgentTaskAsk, type AgentTaskCardProps, type AgentTaskReply, type AgentWorkButtonProps, type AgentWorkProps, } from "./agent-work.js";
|
|
5
4
|
export type ChatPageProps = ComponentProps<"div"> & {
|
|
6
5
|
/** The open thread, such as a wide `ChatConversation`. */
|
|
@@ -21,14 +20,16 @@ export type ChatPageProps = ComponentProps<"div"> & {
|
|
|
21
20
|
/** Which one column shows under 700px. */
|
|
22
21
|
phoneView?: "history" | "conversation";
|
|
23
22
|
});
|
|
24
|
-
export declare function ChatPage({ variant, history, children, aside, phoneView, className, ...props }: ChatPageProps): import("
|
|
23
|
+
export declare function ChatPage({ variant, history, children, aside, phoneView, className, ...props }: ChatPageProps): import("react").JSX.Element;
|
|
25
24
|
export type ChatHistoryProps = {
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
/** Newest first; `useChatClientConversations` over the lib's chat client, or the app's own. */
|
|
26
|
+
conversations: readonly ChatConversationSummary[];
|
|
27
|
+
/** The list is loading: skeleton rows in its place. */
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
selectedId: string | null;
|
|
30
|
+
onSelect: (conversationId: string) => void;
|
|
30
31
|
onNew: () => void;
|
|
31
32
|
className?: string;
|
|
32
33
|
};
|
|
33
34
|
/** The caller's conversations, newest first under day labels, with search and New chat. */
|
|
34
|
-
export declare function ChatHistory({
|
|
35
|
+
export declare function ChatHistory({ conversations, loading, selectedId, onSelect, onNew, className, }: ChatHistoryProps): import("react").JSX.Element;
|
|
@@ -5,15 +5,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* waits on the user) in the `aside` on the right; under 700px the aside goes and the page's
|
|
6
6
|
* header carries `AgentWorkButton` instead. `variant="conversations"` lays out the
|
|
7
7
|
* conversation history, the open conversation and an optional context column; `ChatHistory`
|
|
8
|
-
* lists the caller's conversations from
|
|
9
|
-
* chat. Under 700px one column shows at a time, the history or the conversation; the context
|
|
8
|
+
* lists the caller's conversations (from `useChatClientConversations`, or the app's own),
|
|
9
|
+
* searchable and grouped by day, with New chat. Under 700px one column shows at a time, the history or the conversation; the context
|
|
10
10
|
* column shows from 1000px up.
|
|
11
11
|
*/
|
|
12
12
|
import { PlusIcon } from "@phosphor-icons/react";
|
|
13
13
|
import { differenceInCalendarDays, isToday, isYesterday } from "date-fns";
|
|
14
14
|
import { useState } from "react";
|
|
15
15
|
import { css, cx } from "#primitives/css";
|
|
16
|
-
import { useConversationList } from "../chat/use-conversation-list.js";
|
|
17
16
|
import { IconButton } from "./button.js";
|
|
18
17
|
import { icon, Spinner } from "./icon.js";
|
|
19
18
|
import { SearchField } from "./input.js";
|
|
@@ -123,21 +122,18 @@ const emptyLine = css({
|
|
|
123
122
|
});
|
|
124
123
|
const skeletonRow = css({ height: "menu.item", display: "flex", alignItems: "center" });
|
|
125
124
|
/** The caller's conversations, newest first under day labels, with search and New chat. */
|
|
126
|
-
export function ChatHistory({
|
|
125
|
+
export function ChatHistory({ conversations, loading = false, selectedId, onSelect, onNew, className, }) {
|
|
127
126
|
const [query, setQuery] = useState("");
|
|
128
127
|
const locale = useCiridaeLocale();
|
|
129
128
|
const { labels } = locale;
|
|
130
|
-
const list = useConversationList(client);
|
|
131
|
-
const conversations = list.data?.pages.flatMap((listPage) => listPage.data) ?? [];
|
|
132
129
|
const needle = query.trim().toLowerCase();
|
|
133
130
|
const matching = needle
|
|
134
131
|
? conversations.filter((conversation) => [conversation.title, conversation.preview].some((text) => text?.toLowerCase().includes(needle)))
|
|
135
132
|
: conversations;
|
|
136
133
|
const groups = groupByDay(matching, locale);
|
|
137
|
-
return (_jsxs("nav", { className: cx(column, css({ flex: "1" }), className), "aria-label": labels.chat.conversations, children: [_jsxs("div", { className: historyHeader, children: [_jsx(SearchField, { size: "compact", placeholder: labels.common.search, "aria-label": labels.chat.searchConversations, value: query, onChange: (event) => setQuery(event.target.value), onClear: query ? () => setQuery("") : undefined, wrapperClassName: css({ flex: "1" }) }), _jsx(IconButton, { "aria-label": labels.chat.newChat, size: "small", onClick: onNew, children: _jsx(PlusIcon, { className: icon({ size: "small" }) }) })] }), _jsxs("div", { className: historyList, children: [
|
|
138
|
-
Array.from({ length: 6 }, (_, index) => (_jsx("div", { className: skeletonRow, children: _jsx(Skeleton, { shape: "text", style: { width: `${72 - (index % 3) * 12}%` } }) }, index))), !
|
|
139
|
-
|
|
140
|
-
return (_jsxs("button", { type: "button", className: historyRow, "aria-current": conversation.id === selectedId ? "page" : undefined, onClick: () => onSelect(conversation.id), children: [_jsx("span", { "data-title": "", children: conversation.title ?? conversation.preview ?? labels.chat.newChat }), status === "queued" || status === "in_progress" ? (_jsx(Spinner, { size: "compact", label: labels.chat.running })) : (_jsx("time", { dateTime: conversation.updated_at, children: formatUpdatedAt(Date.parse(conversation.updated_at), locale) }))] }, conversation.id));
|
|
134
|
+
return (_jsxs("nav", { className: cx(column, css({ flex: "1" }), className), "aria-label": labels.chat.conversations, children: [_jsxs("div", { className: historyHeader, children: [_jsx(SearchField, { size: "compact", placeholder: labels.common.search, "aria-label": labels.chat.searchConversations, value: query, onChange: (event) => setQuery(event.target.value), onClear: query ? () => setQuery("") : undefined, wrapperClassName: css({ flex: "1" }) }), _jsx(IconButton, { "aria-label": labels.chat.newChat, size: "small", onClick: onNew, children: _jsx(PlusIcon, { className: icon({ size: "small" }) }) })] }), _jsxs("div", { className: historyList, children: [loading &&
|
|
135
|
+
Array.from({ length: 6 }, (_, index) => (_jsx("div", { className: skeletonRow, children: _jsx(Skeleton, { shape: "text", style: { width: `${72 - (index % 3) * 12}%` } }) }, index))), !loading && matching.length === 0 && (_jsx("div", { className: emptyLine, children: labels.common.noResults })), groups.map((group) => (_jsxs("section", { children: [_jsx("div", { className: groupLabel, children: group.label }), group.conversations.map((conversation) => {
|
|
136
|
+
return (_jsxs("button", { type: "button", className: historyRow, "aria-current": conversation.id === selectedId ? "page" : undefined, onClick: () => onSelect(conversation.id), children: [_jsx("span", { "data-title": "", children: conversation.title ?? conversation.preview ?? labels.chat.newChat }), conversation.running ? (_jsx(Spinner, { size: "compact", label: labels.chat.running })) : (_jsx("time", { dateTime: new Date(conversation.updatedAt).toISOString(), children: formatUpdatedAt(conversation.updatedAt, locale) }))] }, conversation.id));
|
|
141
137
|
})] }, group.label)))] })] }));
|
|
142
138
|
}
|
|
143
139
|
/** Conversations under Today, Yesterday, Previous 7 days and Earlier, newest first. */
|
|
@@ -152,7 +148,7 @@ function groupByDay(conversations, { labels }) {
|
|
|
152
148
|
: labels.dates.earlier;
|
|
153
149
|
const groups = [];
|
|
154
150
|
for (const conversation of conversations) {
|
|
155
|
-
const label = labelOf(
|
|
151
|
+
const label = labelOf(conversation.updatedAt);
|
|
156
152
|
const group = groups.find((candidate) => candidate.label === label);
|
|
157
153
|
if (group)
|
|
158
154
|
group.conversations.push(conversation);
|
|
@@ -15,13 +15,13 @@ export type UseChatSheetControllerOptions = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare function useChatSheetController({ hotkey, defaultPlacement, dockedQuery, persistKey, onOpenFullPage, }?: UseChatSheetControllerOptions): {
|
|
17
17
|
open: boolean;
|
|
18
|
-
setOpen: import("
|
|
18
|
+
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
19
19
|
toggle: () => void;
|
|
20
20
|
draft: string;
|
|
21
|
-
setDraft: import("
|
|
22
|
-
conversationId: (string & import("zod
|
|
23
|
-
setConversationId: import("
|
|
24
|
-
composerRef: import("
|
|
21
|
+
setDraft: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
22
|
+
conversationId: (string & import("zod").$brand<"ConversationId">) | null;
|
|
23
|
+
setConversationId: import("react").Dispatch<import("react").SetStateAction<(string & import("zod").$brand<"ConversationId">) | null>>;
|
|
24
|
+
composerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
25
25
|
focusComposer: (caret?: number) => void;
|
|
26
26
|
prefill: (text: string) => void;
|
|
27
27
|
placement: ChatSheetPlacement;
|
|
@@ -29,22 +29,19 @@ export declare function useChatSheetController({ hotkey, defaultPlacement, docke
|
|
|
29
29
|
openInSheet: () => void;
|
|
30
30
|
sheetProps: {
|
|
31
31
|
open: boolean;
|
|
32
|
-
onOpenChange: import("
|
|
32
|
+
onOpenChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
33
33
|
placement: ChatSheetPlacement;
|
|
34
34
|
onPlacementChange: ((next: ChatSheetPlacement) => void) | undefined;
|
|
35
35
|
onOpenFullPage: (() => void) | undefined;
|
|
36
|
+
shortcut: HotkeyChord;
|
|
36
37
|
draft: string;
|
|
37
|
-
onDraftChange: import("
|
|
38
|
-
composerRef: import("
|
|
39
|
-
conversationId: (string & import("zod/index.cjs").$brand<"ConversationId">) | null;
|
|
40
|
-
onConversationCreated: (conversation: {
|
|
41
|
-
id: ConversationId;
|
|
42
|
-
}) => void;
|
|
38
|
+
onDraftChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
39
|
+
composerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
43
40
|
};
|
|
44
41
|
pageProps: {
|
|
45
42
|
draft: string;
|
|
46
|
-
onDraftChange: import("
|
|
47
|
-
composerRef: import("
|
|
43
|
+
onDraftChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
44
|
+
composerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
48
45
|
};
|
|
49
46
|
};
|
|
50
47
|
export type ChatSheetController = ReturnType<typeof useChatSheetController>;
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* sheet and a full chat page. `hotkey` (Cmd/Ctrl+J) opens the sheet on its composer, focuses the
|
|
5
5
|
* composer when it is open elsewhere, and closes it from the composer. The sheet docks only where
|
|
6
6
|
* `dockedQuery` matches and is a drawer below it. The app spreads `sheetProps` onto `ChatSheet`
|
|
7
|
-
* (with its
|
|
7
|
+
* (with its source, title and suggestions) and `pageProps` onto a full page's `ChatConversation`;
|
|
8
|
+
* `conversationId` is the open conversation, such as for `useChatClientSource`.
|
|
8
9
|
*/
|
|
9
10
|
import { useCallback, useRef, useState, useSyncExternalStore } from "react";
|
|
10
11
|
import { useHotkey } from "./hotkeys.js";
|
|
@@ -122,11 +123,10 @@ export function useChatSheetController({ hotkey = "Mod+J", defaultPlacement = "d
|
|
|
122
123
|
placement,
|
|
123
124
|
onPlacementChange: dockable ? changePlacement : undefined,
|
|
124
125
|
onOpenFullPage: openFullPage,
|
|
126
|
+
shortcut: hotkey,
|
|
125
127
|
draft,
|
|
126
128
|
onDraftChange: setDraft,
|
|
127
129
|
composerRef,
|
|
128
|
-
conversationId,
|
|
129
|
-
onConversationCreated: (conversation) => setConversationId(conversation.id),
|
|
130
130
|
},
|
|
131
131
|
pageProps: { draft, onDraftChange: setDraft, composerRef },
|
|
132
132
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type AgentTask, type AgentTaskReply } from "./agent-work.js";
|
|
3
|
+
import { type ChatDictation } from "./chat.js";
|
|
3
4
|
import { DrawerBody } from "./drawer.js";
|
|
5
|
+
import type { HotkeyChord } from "./hotkeys.js";
|
|
4
6
|
import type { MentionMark, MentionTrigger } from "./mention-input.js";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
+
import type { Mention } from "../chat/contract.js";
|
|
8
|
+
import type { ChatConversationSource } from "../chat/conversation-source.js";
|
|
9
|
+
export type { ChatConversationItem, ChatConversationSource, ChatConversationSummary, ChatOutgoingMessage, ChatTurnStatus, } from "../chat/conversation-source.js";
|
|
10
|
+
export { useChatClientConversations, useChatClientSource, type UseChatClientSourceOptions, } from "./chat-client-source.js";
|
|
7
11
|
export type ChatSheetPlacement = "docked" | "drawer";
|
|
8
12
|
/** A record the agent reads for this conversation, named in the row under the header. */
|
|
9
13
|
export type ChatSheetContext = {
|
|
@@ -27,13 +31,10 @@ export type ChatConversationProps = {
|
|
|
27
31
|
tasks?: readonly AgentTask[];
|
|
28
32
|
/** The user's approval or answer on a waiting task's card. */
|
|
29
33
|
onTaskReply?: (task: AgentTask, reply: AgentTaskReply) => void;
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/** Null before the first message; the conversation is created with it and reported. */
|
|
33
|
-
conversationId: ConversationId | null;
|
|
34
|
-
onConversationCreated: (conversation: Conversation) => void;
|
|
34
|
+
/** The conversation: `useChatClientSource` over the lib's chat client, or the app's own. */
|
|
35
|
+
source: ChatConversationSource;
|
|
35
36
|
placeholder: string;
|
|
36
|
-
/** The composer's text, when the host owns it, such as
|
|
37
|
+
/** The composer's text, when the host owns it, such as a draft it keeps per conversation. */
|
|
37
38
|
draft?: string;
|
|
38
39
|
onDraftChange?: (draft: string) => void;
|
|
39
40
|
/** The composer's field, so the host can focus it, such as from its shortcut. */
|
|
@@ -54,6 +55,10 @@ export type ChatConversationProps = {
|
|
|
54
55
|
suggestions?: readonly string[];
|
|
55
56
|
/** A Copy control in the footer of each reply once its turn has finished, and not failed. */
|
|
56
57
|
copyReplies?: boolean;
|
|
58
|
+
/** More tools in the composer's bar after the paperclip, such as a dictation button. */
|
|
59
|
+
composerTools?: ReactNode;
|
|
60
|
+
/** While the host takes dictation, its levels as the composer's waveform; see `ChatComposer`. */
|
|
61
|
+
dictation?: ChatDictation;
|
|
57
62
|
};
|
|
58
63
|
export type ChatSheetProps = ChatConversationProps & {
|
|
59
64
|
open: boolean;
|
|
@@ -67,14 +72,16 @@ export type ChatSheetProps = ChatConversationProps & {
|
|
|
67
72
|
onPlacementChange?: (placement: ChatSheetPlacement) => void;
|
|
68
73
|
/** Shows a header button that moves the conversation to a full page. */
|
|
69
74
|
onOpenFullPage?: () => void;
|
|
75
|
+
/** The hotkey that opens the sheet, shown as keys in its header. */
|
|
76
|
+
shortcut?: HotkeyChord;
|
|
70
77
|
};
|
|
71
|
-
export declare function ChatSheet({ open, onOpenChange, title, context, placement, onPlacementChange, onOpenFullPage, ...conversationProps }: ChatSheetProps): import("
|
|
78
|
+
export declare function ChatSheet({ open, onOpenChange, title, context, placement, onPlacementChange, onOpenFullPage, shortcut, ...conversationProps }: ChatSheetProps): import("react").JSX.Element | null;
|
|
72
79
|
/**
|
|
73
80
|
* The thread and the composer: everything that reads or writes the conversation. `layout="wide"`
|
|
74
81
|
* sets both in one readable column for a full page; the sheet uses `sheet`.
|
|
75
82
|
*/
|
|
76
|
-
export declare function ChatConversation({
|
|
83
|
+
export declare function ChatConversation({ source, placeholder, draft, onDraftChange, composerRef, mentions, mentionMark, onMentionSelect, mentionHref, events, assistantName: ownAssistantName, suggestions, copyReplies, composerTools, dictation, variant, tasks, onTaskReply, layout, scrollBody: ScrollBody, }: ChatConversationProps & {
|
|
77
84
|
layout?: "sheet" | "wide";
|
|
78
85
|
/** The drawer's body inside a `Drawer`, a plain element otherwise. */
|
|
79
86
|
scrollBody?: typeof DrawerBody | "div";
|
|
80
|
-
}): import("
|
|
87
|
+
}): import("react").JSX.Element;
|