@lukeashford/aurelius 2.11.0 → 2.12.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/dist/index.d.mts +95 -23
- package/dist/index.d.ts +95 -23
- package/dist/index.js +228 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +177 -39
- package/dist/index.mjs.map +1 -1
- package/llms.md +231 -82
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -629,8 +629,17 @@ interface MessageActionsConfig {
|
|
|
629
629
|
showCopy?: boolean;
|
|
630
630
|
}
|
|
631
631
|
interface MessageProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
632
|
+
/**
|
|
633
|
+
* Whether the message is from the user or the assistant
|
|
634
|
+
*/
|
|
632
635
|
variant?: MessageVariant;
|
|
636
|
+
/**
|
|
637
|
+
* The message content (supports Markdown)
|
|
638
|
+
*/
|
|
633
639
|
content: string;
|
|
640
|
+
/**
|
|
641
|
+
* Whether the message is currently being streamed (shows cursor)
|
|
642
|
+
*/
|
|
634
643
|
isStreaming?: boolean;
|
|
635
644
|
/**
|
|
636
645
|
* Branch navigation info (shows branch indicator if provided and total > 1)
|
|
@@ -726,6 +735,17 @@ interface ChatInputProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
726
735
|
*/
|
|
727
736
|
acceptedFileTypes?: string;
|
|
728
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* ChatInput is a context-aware input component that can transition between
|
|
740
|
+
* a centered position (for empty states) and a bottom position (for active conversations).
|
|
741
|
+
*
|
|
742
|
+
* Features:
|
|
743
|
+
* - Auto-expanding textarea
|
|
744
|
+
* - File attachments with preview
|
|
745
|
+
* - Drag and drop support
|
|
746
|
+
* - Streaming state with stop button
|
|
747
|
+
* - Animated transition between positions
|
|
748
|
+
*/
|
|
729
749
|
declare const ChatInput: React$1.ForwardRefExoticComponent<ChatInputProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
730
750
|
|
|
731
751
|
interface Conversation {
|
|
@@ -756,6 +776,14 @@ interface ConversationSidebarProps extends React$1.HTMLAttributes<HTMLDivElement
|
|
|
756
776
|
* Callback to toggle collapse state
|
|
757
777
|
*/
|
|
758
778
|
onToggleCollapse?: () => void;
|
|
779
|
+
/**
|
|
780
|
+
* Current width of the sidebar (when expanded)
|
|
781
|
+
*/
|
|
782
|
+
width?: number;
|
|
783
|
+
/**
|
|
784
|
+
* Callback to start resizing
|
|
785
|
+
*/
|
|
786
|
+
onResizeStart?: (e: React$1.MouseEvent) => void;
|
|
759
787
|
}
|
|
760
788
|
/**
|
|
761
789
|
* ConversationSidebar displays a collapsible list of past conversations.
|
|
@@ -850,17 +878,14 @@ interface UseArtifactsReturn {
|
|
|
850
878
|
artifacts: Artifact[];
|
|
851
879
|
/**
|
|
852
880
|
* Schedule a new artifact (adds to list with isPending=true, shows skeleton).
|
|
853
|
-
* Use when an operator starts processing (e.g., SSE operator.started event).
|
|
854
881
|
*/
|
|
855
882
|
scheduleArtifact: (artifact: Omit<Artifact, 'isPending'>) => void;
|
|
856
883
|
/**
|
|
857
884
|
* Show an artifact (updates existing or adds new with isPending=false).
|
|
858
|
-
* Use when artifact content is ready (e.g., SSE artifact.created event).
|
|
859
885
|
*/
|
|
860
886
|
showArtifact: (artifactId: string, artifact: Omit<Artifact, 'id' | 'isPending'>) => void;
|
|
861
887
|
/**
|
|
862
888
|
* Remove an artifact from the list.
|
|
863
|
-
* Use when artifact generation fails (e.g., SSE operator.failed event).
|
|
864
889
|
*/
|
|
865
890
|
removeArtifact: (artifactId: string) => void;
|
|
866
891
|
/**
|
|
@@ -894,6 +919,18 @@ interface UseArtifactsReturn {
|
|
|
894
919
|
*/
|
|
895
920
|
declare function useArtifacts(): UseArtifactsReturn;
|
|
896
921
|
|
|
922
|
+
interface UseResizableProps {
|
|
923
|
+
initialWidth: number;
|
|
924
|
+
minWidth: number;
|
|
925
|
+
maxWidth: number;
|
|
926
|
+
direction: 'left' | 'right';
|
|
927
|
+
}
|
|
928
|
+
declare function useResizable({ initialWidth, minWidth, maxWidth, direction, }: UseResizableProps): {
|
|
929
|
+
width: number;
|
|
930
|
+
isResizing: boolean;
|
|
931
|
+
startResizing: (e: React.MouseEvent) => void;
|
|
932
|
+
};
|
|
933
|
+
|
|
897
934
|
/**
|
|
898
935
|
* Conversation Tree Types
|
|
899
936
|
*
|
|
@@ -1016,9 +1053,21 @@ declare function messagesToTree(messages: Array<{
|
|
|
1016
1053
|
declare function isBranchPoint(tree: ConversationTree, nodeId: string): boolean;
|
|
1017
1054
|
|
|
1018
1055
|
interface ChatMessage {
|
|
1056
|
+
/**
|
|
1057
|
+
* Unique identifier for the message
|
|
1058
|
+
*/
|
|
1019
1059
|
id: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether the message is from the user or the assistant
|
|
1062
|
+
*/
|
|
1020
1063
|
variant: 'user' | 'assistant';
|
|
1064
|
+
/**
|
|
1065
|
+
* Message content (Markdown supported)
|
|
1066
|
+
*/
|
|
1021
1067
|
content: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* Whether the message is currently streaming
|
|
1070
|
+
*/
|
|
1022
1071
|
isStreaming?: boolean;
|
|
1023
1072
|
}
|
|
1024
1073
|
interface ChatInterfaceProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onSubmit'> {
|
|
@@ -1041,79 +1090,86 @@ interface ChatInterfaceProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>
|
|
|
1041
1090
|
*/
|
|
1042
1091
|
conversations?: Conversation[];
|
|
1043
1092
|
/**
|
|
1044
|
-
* Called when a message is submitted
|
|
1093
|
+
* Called when a message is submitted from the input.
|
|
1094
|
+
* Provides the text content and any files attached.
|
|
1045
1095
|
*/
|
|
1046
1096
|
onMessageSubmit?: (message: string, attachments?: Attachment[]) => void;
|
|
1047
1097
|
/**
|
|
1048
|
-
* Called when a user message is edited
|
|
1098
|
+
* Called when a user message is edited.
|
|
1099
|
+
* In tree mode, this creates a new branch.
|
|
1049
1100
|
*/
|
|
1050
1101
|
onEditMessage?: (messageId: string, newContent: string) => void;
|
|
1051
1102
|
/**
|
|
1052
|
-
* Called when an assistant message is retried
|
|
1103
|
+
* Called when an assistant message is retried.
|
|
1104
|
+
* In tree mode, this creates a new branch.
|
|
1053
1105
|
*/
|
|
1054
1106
|
onRetryMessage?: (messageId: string) => void;
|
|
1055
1107
|
/**
|
|
1056
|
-
* Called when Stop button is clicked during streaming
|
|
1108
|
+
* Called when the Stop button is clicked during assistant streaming.
|
|
1057
1109
|
*/
|
|
1058
1110
|
onStop?: () => void;
|
|
1059
1111
|
/**
|
|
1060
|
-
* Called when a conversation is selected from sidebar
|
|
1112
|
+
* Called when a conversation is selected from the sidebar.
|
|
1061
1113
|
*/
|
|
1062
1114
|
onSelectConversation?: (id: string) => void;
|
|
1063
1115
|
/**
|
|
1064
|
-
* Called when "New Chat" is clicked
|
|
1116
|
+
* Called when the "New Chat" button is clicked in the sidebar.
|
|
1065
1117
|
*/
|
|
1066
1118
|
onNewChat?: () => void;
|
|
1067
1119
|
/**
|
|
1068
|
-
* Whether the assistant is currently streaming a response
|
|
1120
|
+
* Whether the assistant is currently streaming a response.
|
|
1121
|
+
* Shows a stop button and disables certain actions.
|
|
1069
1122
|
*/
|
|
1070
1123
|
isStreaming?: boolean;
|
|
1071
1124
|
/**
|
|
1072
|
-
* Whether to show the thinking indicator
|
|
1125
|
+
* Whether to show the thinking indicator.
|
|
1126
|
+
* Typically shown after a user message but before the first streaming token.
|
|
1073
1127
|
*/
|
|
1074
1128
|
isThinking?: boolean;
|
|
1075
1129
|
/**
|
|
1076
|
-
*
|
|
1130
|
+
* Placeholder text for the main chat input.
|
|
1077
1131
|
*/
|
|
1078
1132
|
placeholder?: string;
|
|
1079
1133
|
/**
|
|
1080
|
-
* Helper text shown in empty state
|
|
1134
|
+
* Helper text shown in the empty state (when there are no messages).
|
|
1081
1135
|
*/
|
|
1082
1136
|
emptyStateHelper?: React$1.ReactNode;
|
|
1083
1137
|
/**
|
|
1084
|
-
*
|
|
1138
|
+
* Whether the sidebar should be initially collapsed.
|
|
1085
1139
|
*/
|
|
1086
1140
|
initialSidebarCollapsed?: boolean;
|
|
1087
1141
|
/**
|
|
1088
|
-
* Custom
|
|
1142
|
+
* Custom content to show when the conversation is empty.
|
|
1143
|
+
* Overrides the default centered input and helper text.
|
|
1089
1144
|
*/
|
|
1090
1145
|
emptyState?: React$1.ReactNode;
|
|
1091
1146
|
/**
|
|
1092
|
-
* Whether to show attachment button
|
|
1147
|
+
* Whether to show the attachment (paperclip) button in the input.
|
|
1093
1148
|
*/
|
|
1094
1149
|
showAttachmentButton?: boolean;
|
|
1095
1150
|
/**
|
|
1096
|
-
* Whether to enable message actions (copy, edit, retry)
|
|
1151
|
+
* Whether to enable message-level actions (copy, edit, retry).
|
|
1097
1152
|
*/
|
|
1098
1153
|
enableMessageActions?: boolean;
|
|
1099
1154
|
/**
|
|
1100
|
-
* Current attachments for the input
|
|
1155
|
+
* Current attachments for the chat input (controlled).
|
|
1101
1156
|
*/
|
|
1102
1157
|
attachments?: Attachment[];
|
|
1103
1158
|
/**
|
|
1104
|
-
* Called when attachments
|
|
1159
|
+
* Called when attachments are added or removed in the chat input.
|
|
1105
1160
|
*/
|
|
1106
1161
|
onAttachmentsChange?: (attachments: Attachment[]) => void;
|
|
1107
1162
|
/**
|
|
1108
|
-
* Artifacts to display in the panel.
|
|
1163
|
+
* Artifacts to display in the side panel.
|
|
1164
|
+
* Best managed via the useArtifacts hook and passed here.
|
|
1109
1165
|
*/
|
|
1110
1166
|
artifacts?: Artifact[];
|
|
1111
1167
|
/**
|
|
1112
|
-
* Whether the artifacts panel is open (controlled
|
|
1168
|
+
* Whether the artifacts panel is currently open (controlled).
|
|
1113
1169
|
*/
|
|
1114
1170
|
isArtifactsPanelOpen?: boolean;
|
|
1115
1171
|
/**
|
|
1116
|
-
* Called when artifacts panel
|
|
1172
|
+
* Called when the artifacts panel is opened or closed (controlled).
|
|
1117
1173
|
*/
|
|
1118
1174
|
onArtifactsPanelOpenChange?: (open: boolean) => void;
|
|
1119
1175
|
}
|
|
@@ -1198,6 +1254,14 @@ interface ArtifactsPanelProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
1198
1254
|
* Whether artifacts are still loading (show skeletons)
|
|
1199
1255
|
*/
|
|
1200
1256
|
isLoading?: boolean;
|
|
1257
|
+
/**
|
|
1258
|
+
* Current width of the panel (when expanded)
|
|
1259
|
+
*/
|
|
1260
|
+
width?: number;
|
|
1261
|
+
/**
|
|
1262
|
+
* Callback to start resizing
|
|
1263
|
+
*/
|
|
1264
|
+
onResizeStart?: (e: React$1.MouseEvent) => void;
|
|
1201
1265
|
}
|
|
1202
1266
|
/**
|
|
1203
1267
|
* ArtifactsPanel displays rich content artifacts in a slide-in panel.
|
|
@@ -1265,6 +1329,10 @@ interface ThinkingIndicatorProps extends React$1.HTMLAttributes<HTMLDivElement>
|
|
|
1265
1329
|
*/
|
|
1266
1330
|
phrases?: string[];
|
|
1267
1331
|
}
|
|
1332
|
+
/**
|
|
1333
|
+
* ThinkingIndicator shows an animated state when the assistant is processing a request
|
|
1334
|
+
* but has not yet started streaming tokens. It cycles through flavorful "thinking" phrases.
|
|
1335
|
+
*/
|
|
1268
1336
|
declare const ThinkingIndicator: React$1.ForwardRefExoticComponent<ThinkingIndicatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1269
1337
|
|
|
1270
1338
|
interface BranchNavigatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
@@ -1293,6 +1361,10 @@ interface BranchNavigatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
1293
1361
|
*/
|
|
1294
1362
|
showIcon?: boolean;
|
|
1295
1363
|
}
|
|
1364
|
+
/**
|
|
1365
|
+
* BranchNavigator provides a UI for switching between conversation branches.
|
|
1366
|
+
* Used in the Message component to navigate sibling branches (e.g., "1/3").
|
|
1367
|
+
*/
|
|
1296
1368
|
declare const BranchNavigator: React$1.ForwardRefExoticComponent<BranchNavigatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1297
1369
|
|
|
1298
1370
|
type BrandIconSize = 'sm' | 'md' | 'lg';
|
|
@@ -1361,4 +1433,4 @@ declare const SectionHeading: React$1.ForwardRefExoticComponent<SectionHeadingPr
|
|
|
1361
1433
|
|
|
1362
1434
|
declare const version = "2.0.0";
|
|
1363
1435
|
|
|
1364
|
-
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, type Artifact, type ArtifactType, ArtifactsPanel, type ArtifactsPanelProps, ArtifactsPanelToggle, type ArtifactsPanelToggleProps, type AspectRatio, type AspectRatioPreset, type Attachment, type AttachmentItem, AttachmentPreview, type AttachmentPreviewProps, type AttachmentStatus, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, BranchNavigator, type BranchNavigatorProps, BrandIcon, type BrandIconProps, type BrandIconSize, type BrandIconVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, type CardVariant, ChatInput, type ChatInputPosition, type ChatInputProps, ChatInterface, type ChatInterfaceProps, type ChatMessage, ChatView, type ChatViewItem, type ChatViewProps, Checkbox, type CheckboxProps, Col, type ColOffset, type ColOrder, type ColProps, type ColSpan, CollapsedSidebarToggle, type CollapsedSidebarToggleProps, ColorSwatch, type ColorSwatchProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerProps, type ContainerSize, type Conversation, ConversationSidebar, type ConversationSidebarProps, type ConversationTree, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, FileChip, type FileChipProps, type FileChipStatus, HelperText, type HelperTextProps, ImageCard, type ImageCardProps, Input, type InputAddonProps, type InputElementProps, InputGroup, type InputGroupProps, InputLeftAddon, InputLeftElement, type InputProps, InputRightAddon, InputRightElement, InputWrapper, type InputWrapperProps, Label, type LabelProps, List, ListItem, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, MarkdownContent, type MarkdownContentProps, Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, MenuTrigger, type MenuTriggerProps, Message, MessageActions, type MessageActionsConfig, type MessageActionsProps, type MessageActionsVariant, type MessageBranchInfo, type MessageNode, type MessageProps, type MessageVariant, Modal, type ModalProps, Navbar, NavbarBrand, type NavbarBrandProps, NavbarContent, type NavbarContentProps, NavbarDivider, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, Pagination, type PaginationProps, Popover, type PopoverAlign, type PopoverPosition, type PopoverProps, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Radio, type RadioProps, Row, type RowAlign, type RowGutter, type RowJustify, type RowProps, SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackDirection, type StackGap, type StackProps, type Step, type StepStatus, Stepper, type StepperProps, StreamingCursor, type StreamingCursorProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Textarea, type TextareaProps, ThinkingIndicator, type ThinkingIndicatorProps, type ToastData, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, type UseArtifactsReturn, type UseScrollAnchorOptions, type UseScrollAnchorReturn, type VideoAspectRatio, type VideoAspectRatioPreset, VideoCard, type VideoCardProps, addMessageToTree, createEmptyTree, createPreviewUrl, generateId, getActivePathMessages, getSiblingInfo, isBranchPoint, isImageFile, messagesToTree, revokePreviewUrl, switchBranch, updateNodeContent, useArtifacts, useScrollAnchor, useToast, version };
|
|
1436
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, type Artifact, type ArtifactType, ArtifactsPanel, type ArtifactsPanelProps, ArtifactsPanelToggle, type ArtifactsPanelToggleProps, type AspectRatio, type AspectRatioPreset, type Attachment, type AttachmentItem, AttachmentPreview, type AttachmentPreviewProps, type AttachmentStatus, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, BranchNavigator, type BranchNavigatorProps, BrandIcon, type BrandIconProps, type BrandIconSize, type BrandIconVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, type CardVariant, ChatInput, type ChatInputPosition, type ChatInputProps, ChatInterface, type ChatInterfaceProps, type ChatMessage, ChatView, type ChatViewItem, type ChatViewProps, Checkbox, type CheckboxProps, Col, type ColOffset, type ColOrder, type ColProps, type ColSpan, CollapsedSidebarToggle, type CollapsedSidebarToggleProps, ColorSwatch, type ColorSwatchProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerProps, type ContainerSize, type Conversation, ConversationSidebar, type ConversationSidebarProps, type ConversationTree, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, FileChip, type FileChipProps, type FileChipStatus, HelperText, type HelperTextProps, ImageCard, type ImageCardProps, Input, type InputAddonProps, type InputElementProps, InputGroup, type InputGroupProps, InputLeftAddon, InputLeftElement, type InputProps, InputRightAddon, InputRightElement, InputWrapper, type InputWrapperProps, Label, type LabelProps, List, ListItem, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, MarkdownContent, type MarkdownContentProps, Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, MenuTrigger, type MenuTriggerProps, Message, MessageActions, type MessageActionsConfig, type MessageActionsProps, type MessageActionsVariant, type MessageBranchInfo, type MessageNode, type MessageProps, type MessageVariant, Modal, type ModalProps, Navbar, NavbarBrand, type NavbarBrandProps, NavbarContent, type NavbarContentProps, NavbarDivider, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, Pagination, type PaginationProps, Popover, type PopoverAlign, type PopoverPosition, type PopoverProps, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Radio, type RadioProps, Row, type RowAlign, type RowGutter, type RowJustify, type RowProps, SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackDirection, type StackGap, type StackProps, type Step, type StepStatus, Stepper, type StepperProps, StreamingCursor, type StreamingCursorProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Textarea, type TextareaProps, ThinkingIndicator, type ThinkingIndicatorProps, type ToastData, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, type UseArtifactsReturn, type UseScrollAnchorOptions, type UseScrollAnchorReturn, type VideoAspectRatio, type VideoAspectRatioPreset, VideoCard, type VideoCardProps, addMessageToTree, createEmptyTree, createPreviewUrl, generateId, getActivePathMessages, getSiblingInfo, isBranchPoint, isImageFile, messagesToTree, revokePreviewUrl, switchBranch, updateNodeContent, useArtifacts, useResizable, useScrollAnchor, useToast, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -629,8 +629,17 @@ interface MessageActionsConfig {
|
|
|
629
629
|
showCopy?: boolean;
|
|
630
630
|
}
|
|
631
631
|
interface MessageProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
632
|
+
/**
|
|
633
|
+
* Whether the message is from the user or the assistant
|
|
634
|
+
*/
|
|
632
635
|
variant?: MessageVariant;
|
|
636
|
+
/**
|
|
637
|
+
* The message content (supports Markdown)
|
|
638
|
+
*/
|
|
633
639
|
content: string;
|
|
640
|
+
/**
|
|
641
|
+
* Whether the message is currently being streamed (shows cursor)
|
|
642
|
+
*/
|
|
634
643
|
isStreaming?: boolean;
|
|
635
644
|
/**
|
|
636
645
|
* Branch navigation info (shows branch indicator if provided and total > 1)
|
|
@@ -726,6 +735,17 @@ interface ChatInputProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
726
735
|
*/
|
|
727
736
|
acceptedFileTypes?: string;
|
|
728
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* ChatInput is a context-aware input component that can transition between
|
|
740
|
+
* a centered position (for empty states) and a bottom position (for active conversations).
|
|
741
|
+
*
|
|
742
|
+
* Features:
|
|
743
|
+
* - Auto-expanding textarea
|
|
744
|
+
* - File attachments with preview
|
|
745
|
+
* - Drag and drop support
|
|
746
|
+
* - Streaming state with stop button
|
|
747
|
+
* - Animated transition between positions
|
|
748
|
+
*/
|
|
729
749
|
declare const ChatInput: React$1.ForwardRefExoticComponent<ChatInputProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
730
750
|
|
|
731
751
|
interface Conversation {
|
|
@@ -756,6 +776,14 @@ interface ConversationSidebarProps extends React$1.HTMLAttributes<HTMLDivElement
|
|
|
756
776
|
* Callback to toggle collapse state
|
|
757
777
|
*/
|
|
758
778
|
onToggleCollapse?: () => void;
|
|
779
|
+
/**
|
|
780
|
+
* Current width of the sidebar (when expanded)
|
|
781
|
+
*/
|
|
782
|
+
width?: number;
|
|
783
|
+
/**
|
|
784
|
+
* Callback to start resizing
|
|
785
|
+
*/
|
|
786
|
+
onResizeStart?: (e: React$1.MouseEvent) => void;
|
|
759
787
|
}
|
|
760
788
|
/**
|
|
761
789
|
* ConversationSidebar displays a collapsible list of past conversations.
|
|
@@ -850,17 +878,14 @@ interface UseArtifactsReturn {
|
|
|
850
878
|
artifacts: Artifact[];
|
|
851
879
|
/**
|
|
852
880
|
* Schedule a new artifact (adds to list with isPending=true, shows skeleton).
|
|
853
|
-
* Use when an operator starts processing (e.g., SSE operator.started event).
|
|
854
881
|
*/
|
|
855
882
|
scheduleArtifact: (artifact: Omit<Artifact, 'isPending'>) => void;
|
|
856
883
|
/**
|
|
857
884
|
* Show an artifact (updates existing or adds new with isPending=false).
|
|
858
|
-
* Use when artifact content is ready (e.g., SSE artifact.created event).
|
|
859
885
|
*/
|
|
860
886
|
showArtifact: (artifactId: string, artifact: Omit<Artifact, 'id' | 'isPending'>) => void;
|
|
861
887
|
/**
|
|
862
888
|
* Remove an artifact from the list.
|
|
863
|
-
* Use when artifact generation fails (e.g., SSE operator.failed event).
|
|
864
889
|
*/
|
|
865
890
|
removeArtifact: (artifactId: string) => void;
|
|
866
891
|
/**
|
|
@@ -894,6 +919,18 @@ interface UseArtifactsReturn {
|
|
|
894
919
|
*/
|
|
895
920
|
declare function useArtifacts(): UseArtifactsReturn;
|
|
896
921
|
|
|
922
|
+
interface UseResizableProps {
|
|
923
|
+
initialWidth: number;
|
|
924
|
+
minWidth: number;
|
|
925
|
+
maxWidth: number;
|
|
926
|
+
direction: 'left' | 'right';
|
|
927
|
+
}
|
|
928
|
+
declare function useResizable({ initialWidth, minWidth, maxWidth, direction, }: UseResizableProps): {
|
|
929
|
+
width: number;
|
|
930
|
+
isResizing: boolean;
|
|
931
|
+
startResizing: (e: React.MouseEvent) => void;
|
|
932
|
+
};
|
|
933
|
+
|
|
897
934
|
/**
|
|
898
935
|
* Conversation Tree Types
|
|
899
936
|
*
|
|
@@ -1016,9 +1053,21 @@ declare function messagesToTree(messages: Array<{
|
|
|
1016
1053
|
declare function isBranchPoint(tree: ConversationTree, nodeId: string): boolean;
|
|
1017
1054
|
|
|
1018
1055
|
interface ChatMessage {
|
|
1056
|
+
/**
|
|
1057
|
+
* Unique identifier for the message
|
|
1058
|
+
*/
|
|
1019
1059
|
id: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether the message is from the user or the assistant
|
|
1062
|
+
*/
|
|
1020
1063
|
variant: 'user' | 'assistant';
|
|
1064
|
+
/**
|
|
1065
|
+
* Message content (Markdown supported)
|
|
1066
|
+
*/
|
|
1021
1067
|
content: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* Whether the message is currently streaming
|
|
1070
|
+
*/
|
|
1022
1071
|
isStreaming?: boolean;
|
|
1023
1072
|
}
|
|
1024
1073
|
interface ChatInterfaceProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'onSubmit'> {
|
|
@@ -1041,79 +1090,86 @@ interface ChatInterfaceProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>
|
|
|
1041
1090
|
*/
|
|
1042
1091
|
conversations?: Conversation[];
|
|
1043
1092
|
/**
|
|
1044
|
-
* Called when a message is submitted
|
|
1093
|
+
* Called when a message is submitted from the input.
|
|
1094
|
+
* Provides the text content and any files attached.
|
|
1045
1095
|
*/
|
|
1046
1096
|
onMessageSubmit?: (message: string, attachments?: Attachment[]) => void;
|
|
1047
1097
|
/**
|
|
1048
|
-
* Called when a user message is edited
|
|
1098
|
+
* Called when a user message is edited.
|
|
1099
|
+
* In tree mode, this creates a new branch.
|
|
1049
1100
|
*/
|
|
1050
1101
|
onEditMessage?: (messageId: string, newContent: string) => void;
|
|
1051
1102
|
/**
|
|
1052
|
-
* Called when an assistant message is retried
|
|
1103
|
+
* Called when an assistant message is retried.
|
|
1104
|
+
* In tree mode, this creates a new branch.
|
|
1053
1105
|
*/
|
|
1054
1106
|
onRetryMessage?: (messageId: string) => void;
|
|
1055
1107
|
/**
|
|
1056
|
-
* Called when Stop button is clicked during streaming
|
|
1108
|
+
* Called when the Stop button is clicked during assistant streaming.
|
|
1057
1109
|
*/
|
|
1058
1110
|
onStop?: () => void;
|
|
1059
1111
|
/**
|
|
1060
|
-
* Called when a conversation is selected from sidebar
|
|
1112
|
+
* Called when a conversation is selected from the sidebar.
|
|
1061
1113
|
*/
|
|
1062
1114
|
onSelectConversation?: (id: string) => void;
|
|
1063
1115
|
/**
|
|
1064
|
-
* Called when "New Chat" is clicked
|
|
1116
|
+
* Called when the "New Chat" button is clicked in the sidebar.
|
|
1065
1117
|
*/
|
|
1066
1118
|
onNewChat?: () => void;
|
|
1067
1119
|
/**
|
|
1068
|
-
* Whether the assistant is currently streaming a response
|
|
1120
|
+
* Whether the assistant is currently streaming a response.
|
|
1121
|
+
* Shows a stop button and disables certain actions.
|
|
1069
1122
|
*/
|
|
1070
1123
|
isStreaming?: boolean;
|
|
1071
1124
|
/**
|
|
1072
|
-
* Whether to show the thinking indicator
|
|
1125
|
+
* Whether to show the thinking indicator.
|
|
1126
|
+
* Typically shown after a user message but before the first streaming token.
|
|
1073
1127
|
*/
|
|
1074
1128
|
isThinking?: boolean;
|
|
1075
1129
|
/**
|
|
1076
|
-
*
|
|
1130
|
+
* Placeholder text for the main chat input.
|
|
1077
1131
|
*/
|
|
1078
1132
|
placeholder?: string;
|
|
1079
1133
|
/**
|
|
1080
|
-
* Helper text shown in empty state
|
|
1134
|
+
* Helper text shown in the empty state (when there are no messages).
|
|
1081
1135
|
*/
|
|
1082
1136
|
emptyStateHelper?: React$1.ReactNode;
|
|
1083
1137
|
/**
|
|
1084
|
-
*
|
|
1138
|
+
* Whether the sidebar should be initially collapsed.
|
|
1085
1139
|
*/
|
|
1086
1140
|
initialSidebarCollapsed?: boolean;
|
|
1087
1141
|
/**
|
|
1088
|
-
* Custom
|
|
1142
|
+
* Custom content to show when the conversation is empty.
|
|
1143
|
+
* Overrides the default centered input and helper text.
|
|
1089
1144
|
*/
|
|
1090
1145
|
emptyState?: React$1.ReactNode;
|
|
1091
1146
|
/**
|
|
1092
|
-
* Whether to show attachment button
|
|
1147
|
+
* Whether to show the attachment (paperclip) button in the input.
|
|
1093
1148
|
*/
|
|
1094
1149
|
showAttachmentButton?: boolean;
|
|
1095
1150
|
/**
|
|
1096
|
-
* Whether to enable message actions (copy, edit, retry)
|
|
1151
|
+
* Whether to enable message-level actions (copy, edit, retry).
|
|
1097
1152
|
*/
|
|
1098
1153
|
enableMessageActions?: boolean;
|
|
1099
1154
|
/**
|
|
1100
|
-
* Current attachments for the input
|
|
1155
|
+
* Current attachments for the chat input (controlled).
|
|
1101
1156
|
*/
|
|
1102
1157
|
attachments?: Attachment[];
|
|
1103
1158
|
/**
|
|
1104
|
-
* Called when attachments
|
|
1159
|
+
* Called when attachments are added or removed in the chat input.
|
|
1105
1160
|
*/
|
|
1106
1161
|
onAttachmentsChange?: (attachments: Attachment[]) => void;
|
|
1107
1162
|
/**
|
|
1108
|
-
* Artifacts to display in the panel.
|
|
1163
|
+
* Artifacts to display in the side panel.
|
|
1164
|
+
* Best managed via the useArtifacts hook and passed here.
|
|
1109
1165
|
*/
|
|
1110
1166
|
artifacts?: Artifact[];
|
|
1111
1167
|
/**
|
|
1112
|
-
* Whether the artifacts panel is open (controlled
|
|
1168
|
+
* Whether the artifacts panel is currently open (controlled).
|
|
1113
1169
|
*/
|
|
1114
1170
|
isArtifactsPanelOpen?: boolean;
|
|
1115
1171
|
/**
|
|
1116
|
-
* Called when artifacts panel
|
|
1172
|
+
* Called when the artifacts panel is opened or closed (controlled).
|
|
1117
1173
|
*/
|
|
1118
1174
|
onArtifactsPanelOpenChange?: (open: boolean) => void;
|
|
1119
1175
|
}
|
|
@@ -1198,6 +1254,14 @@ interface ArtifactsPanelProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
1198
1254
|
* Whether artifacts are still loading (show skeletons)
|
|
1199
1255
|
*/
|
|
1200
1256
|
isLoading?: boolean;
|
|
1257
|
+
/**
|
|
1258
|
+
* Current width of the panel (when expanded)
|
|
1259
|
+
*/
|
|
1260
|
+
width?: number;
|
|
1261
|
+
/**
|
|
1262
|
+
* Callback to start resizing
|
|
1263
|
+
*/
|
|
1264
|
+
onResizeStart?: (e: React$1.MouseEvent) => void;
|
|
1201
1265
|
}
|
|
1202
1266
|
/**
|
|
1203
1267
|
* ArtifactsPanel displays rich content artifacts in a slide-in panel.
|
|
@@ -1265,6 +1329,10 @@ interface ThinkingIndicatorProps extends React$1.HTMLAttributes<HTMLDivElement>
|
|
|
1265
1329
|
*/
|
|
1266
1330
|
phrases?: string[];
|
|
1267
1331
|
}
|
|
1332
|
+
/**
|
|
1333
|
+
* ThinkingIndicator shows an animated state when the assistant is processing a request
|
|
1334
|
+
* but has not yet started streaming tokens. It cycles through flavorful "thinking" phrases.
|
|
1335
|
+
*/
|
|
1268
1336
|
declare const ThinkingIndicator: React$1.ForwardRefExoticComponent<ThinkingIndicatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1269
1337
|
|
|
1270
1338
|
interface BranchNavigatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
@@ -1293,6 +1361,10 @@ interface BranchNavigatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
1293
1361
|
*/
|
|
1294
1362
|
showIcon?: boolean;
|
|
1295
1363
|
}
|
|
1364
|
+
/**
|
|
1365
|
+
* BranchNavigator provides a UI for switching between conversation branches.
|
|
1366
|
+
* Used in the Message component to navigate sibling branches (e.g., "1/3").
|
|
1367
|
+
*/
|
|
1296
1368
|
declare const BranchNavigator: React$1.ForwardRefExoticComponent<BranchNavigatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1297
1369
|
|
|
1298
1370
|
type BrandIconSize = 'sm' | 'md' | 'lg';
|
|
@@ -1361,4 +1433,4 @@ declare const SectionHeading: React$1.ForwardRefExoticComponent<SectionHeadingPr
|
|
|
1361
1433
|
|
|
1362
1434
|
declare const version = "2.0.0";
|
|
1363
1435
|
|
|
1364
|
-
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, type Artifact, type ArtifactType, ArtifactsPanel, type ArtifactsPanelProps, ArtifactsPanelToggle, type ArtifactsPanelToggleProps, type AspectRatio, type AspectRatioPreset, type Attachment, type AttachmentItem, AttachmentPreview, type AttachmentPreviewProps, type AttachmentStatus, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, BranchNavigator, type BranchNavigatorProps, BrandIcon, type BrandIconProps, type BrandIconSize, type BrandIconVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, type CardVariant, ChatInput, type ChatInputPosition, type ChatInputProps, ChatInterface, type ChatInterfaceProps, type ChatMessage, ChatView, type ChatViewItem, type ChatViewProps, Checkbox, type CheckboxProps, Col, type ColOffset, type ColOrder, type ColProps, type ColSpan, CollapsedSidebarToggle, type CollapsedSidebarToggleProps, ColorSwatch, type ColorSwatchProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerProps, type ContainerSize, type Conversation, ConversationSidebar, type ConversationSidebarProps, type ConversationTree, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, FileChip, type FileChipProps, type FileChipStatus, HelperText, type HelperTextProps, ImageCard, type ImageCardProps, Input, type InputAddonProps, type InputElementProps, InputGroup, type InputGroupProps, InputLeftAddon, InputLeftElement, type InputProps, InputRightAddon, InputRightElement, InputWrapper, type InputWrapperProps, Label, type LabelProps, List, ListItem, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, MarkdownContent, type MarkdownContentProps, Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, MenuTrigger, type MenuTriggerProps, Message, MessageActions, type MessageActionsConfig, type MessageActionsProps, type MessageActionsVariant, type MessageBranchInfo, type MessageNode, type MessageProps, type MessageVariant, Modal, type ModalProps, Navbar, NavbarBrand, type NavbarBrandProps, NavbarContent, type NavbarContentProps, NavbarDivider, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, Pagination, type PaginationProps, Popover, type PopoverAlign, type PopoverPosition, type PopoverProps, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Radio, type RadioProps, Row, type RowAlign, type RowGutter, type RowJustify, type RowProps, SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackDirection, type StackGap, type StackProps, type Step, type StepStatus, Stepper, type StepperProps, StreamingCursor, type StreamingCursorProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Textarea, type TextareaProps, ThinkingIndicator, type ThinkingIndicatorProps, type ToastData, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, type UseArtifactsReturn, type UseScrollAnchorOptions, type UseScrollAnchorReturn, type VideoAspectRatio, type VideoAspectRatioPreset, VideoCard, type VideoCardProps, addMessageToTree, createEmptyTree, createPreviewUrl, generateId, getActivePathMessages, getSiblingInfo, isBranchPoint, isImageFile, messagesToTree, revokePreviewUrl, switchBranch, updateNodeContent, useArtifacts, useScrollAnchor, useToast, version };
|
|
1436
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, type Artifact, type ArtifactType, ArtifactsPanel, type ArtifactsPanelProps, ArtifactsPanelToggle, type ArtifactsPanelToggleProps, type AspectRatio, type AspectRatioPreset, type Attachment, type AttachmentItem, AttachmentPreview, type AttachmentPreviewProps, type AttachmentStatus, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, BranchNavigator, type BranchNavigatorProps, BrandIcon, type BrandIconProps, type BrandIconSize, type BrandIconVariant, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, type CardVariant, ChatInput, type ChatInputPosition, type ChatInputProps, ChatInterface, type ChatInterfaceProps, type ChatMessage, ChatView, type ChatViewItem, type ChatViewProps, Checkbox, type CheckboxProps, Col, type ColOffset, type ColOrder, type ColProps, type ColSpan, CollapsedSidebarToggle, type CollapsedSidebarToggleProps, ColorSwatch, type ColorSwatchProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerProps, type ContainerSize, type Conversation, ConversationSidebar, type ConversationSidebarProps, type ConversationTree, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, FileChip, type FileChipProps, type FileChipStatus, HelperText, type HelperTextProps, ImageCard, type ImageCardProps, Input, type InputAddonProps, type InputElementProps, InputGroup, type InputGroupProps, InputLeftAddon, InputLeftElement, type InputProps, InputRightAddon, InputRightElement, InputWrapper, type InputWrapperProps, Label, type LabelProps, List, ListItem, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, MarkdownContent, type MarkdownContentProps, Menu, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, MenuTrigger, type MenuTriggerProps, Message, MessageActions, type MessageActionsConfig, type MessageActionsProps, type MessageActionsVariant, type MessageBranchInfo, type MessageNode, type MessageProps, type MessageVariant, Modal, type ModalProps, Navbar, NavbarBrand, type NavbarBrandProps, NavbarContent, type NavbarContentProps, NavbarDivider, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, Pagination, type PaginationProps, Popover, type PopoverAlign, type PopoverPosition, type PopoverProps, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Radio, type RadioProps, Row, type RowAlign, type RowGutter, type RowJustify, type RowProps, SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackDirection, type StackGap, type StackProps, type Step, type StepStatus, Stepper, type StepperProps, StreamingCursor, type StreamingCursorProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Textarea, type TextareaProps, ThinkingIndicator, type ThinkingIndicatorProps, type ToastData, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, type UseArtifactsReturn, type UseScrollAnchorOptions, type UseScrollAnchorReturn, type VideoAspectRatio, type VideoAspectRatioPreset, VideoCard, type VideoCardProps, addMessageToTree, createEmptyTree, createPreviewUrl, generateId, getActivePathMessages, getSiblingInfo, isBranchPoint, isImageFile, messagesToTree, revokePreviewUrl, switchBranch, updateNodeContent, useArtifacts, useResizable, useScrollAnchor, useToast, version };
|