@iota-uz/sdk 0.4.31 → 0.4.33
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/bichat/index.cjs +94 -8
- package/dist/bichat/index.cjs.map +1 -1
- package/dist/bichat/index.d.cts +17 -1
- package/dist/bichat/index.d.ts +17 -1
- package/dist/bichat/index.mjs +94 -9
- package/dist/bichat/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bichat/index.d.cts
CHANGED
|
@@ -530,6 +530,7 @@ interface SendMessageOptions {
|
|
|
530
530
|
debugMode?: boolean;
|
|
531
531
|
replaceFromMessageID?: string;
|
|
532
532
|
reasoningEffort?: string;
|
|
533
|
+
model?: string;
|
|
533
534
|
}
|
|
534
535
|
interface SessionListResult$1 {
|
|
535
536
|
sessions: Session$1[];
|
|
@@ -655,9 +656,11 @@ interface ChatSessionStateValue {
|
|
|
655
656
|
debugLimits: DebugLimits | null;
|
|
656
657
|
reasoningEffort: string | undefined;
|
|
657
658
|
reasoningEffortOptions: string[] | undefined;
|
|
659
|
+
model: string | undefined;
|
|
658
660
|
setError: (error: string | null) => void;
|
|
659
661
|
retryFetchSession: () => void;
|
|
660
662
|
setReasoningEffort: (effort: string) => void;
|
|
663
|
+
setModel: (model: string | undefined) => void;
|
|
661
664
|
}
|
|
662
665
|
interface ChatMessagingStateValue {
|
|
663
666
|
turns: ConversationTurn$1[];
|
|
@@ -770,6 +773,8 @@ interface ChatSessionProps {
|
|
|
770
773
|
logoSlot?: ReactNode;
|
|
771
774
|
/** Custom action buttons for the header */
|
|
772
775
|
actionsSlot?: ReactNode;
|
|
776
|
+
/** Custom content rendered above the message input (e.g., model selector) */
|
|
777
|
+
inputHeaderSlot?: ReactNode;
|
|
773
778
|
/** Callback when user navigates back */
|
|
774
779
|
onBack?: () => void;
|
|
775
780
|
/** Custom verbs for the typing indicator (e.g. ['Thinking', 'Analyzing', ...]) */
|
|
@@ -785,6 +790,8 @@ interface ChatSessionProps {
|
|
|
785
790
|
}
|
|
786
791
|
declare function ChatSession(props: ChatSessionProps): react_jsx_runtime.JSX.Element;
|
|
787
792
|
|
|
793
|
+
declare function ModelSelector(): react_jsx_runtime.JSX.Element | null;
|
|
794
|
+
|
|
788
795
|
interface SessionArtifactsPanelProps {
|
|
789
796
|
dataSource: ChatDataSource;
|
|
790
797
|
sessionId: string;
|
|
@@ -3680,6 +3687,11 @@ interface Extensions {
|
|
|
3680
3687
|
provider?: string;
|
|
3681
3688
|
apiKeyConfigured?: boolean;
|
|
3682
3689
|
reasoningEffortOptions?: string[];
|
|
3690
|
+
models?: Array<{
|
|
3691
|
+
id: string;
|
|
3692
|
+
label: string;
|
|
3693
|
+
default?: boolean;
|
|
3694
|
+
}>;
|
|
3683
3695
|
};
|
|
3684
3696
|
debug?: {
|
|
3685
3697
|
limits?: {
|
|
@@ -3874,9 +3886,11 @@ interface SessionSnapshot {
|
|
|
3874
3886
|
debugLimits: DebugLimits | null;
|
|
3875
3887
|
reasoningEffort: string | undefined;
|
|
3876
3888
|
reasoningEffortOptions: string[] | undefined;
|
|
3889
|
+
model: string | undefined;
|
|
3877
3890
|
setError: (error: string | null) => void;
|
|
3878
3891
|
retryFetchSession: () => void;
|
|
3879
3892
|
setReasoningEffort: (effort: string) => void;
|
|
3893
|
+
setModel: (model: string | undefined) => void;
|
|
3880
3894
|
}
|
|
3881
3895
|
/** Superset of ChatMessagingStateValue used internally by the state machine; includes internal-only fields such as generationInProgress. */
|
|
3882
3896
|
interface MessagingSnapshot {
|
|
@@ -3997,6 +4011,7 @@ declare class ChatMachine {
|
|
|
3997
4011
|
readonly removeQueueItem: (index: number) => void;
|
|
3998
4012
|
readonly updateQueueItem: (index: number, content: string) => void;
|
|
3999
4013
|
readonly setReasoningEffort: (effort: string) => void;
|
|
4014
|
+
readonly setModel: (model: string | undefined) => void;
|
|
4000
4015
|
constructor(config: ChatMachineConfig);
|
|
4001
4016
|
private buildReasoningEffortOptions;
|
|
4002
4017
|
private sanitizeReasoningEffort;
|
|
@@ -4027,6 +4042,7 @@ declare class ChatMachine {
|
|
|
4027
4042
|
private _setDebugModeForSession;
|
|
4028
4043
|
private _hydrateDebugModeForSession;
|
|
4029
4044
|
private _setReasoningEffort;
|
|
4045
|
+
private _setModel;
|
|
4030
4046
|
private _fetchSessionIfNeeded;
|
|
4031
4047
|
/**
|
|
4032
4048
|
* Sets turns from fetch, preserving pending user-only turns if server hasn't caught up.
|
|
@@ -4232,4 +4248,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
|
|
|
4232
4248
|
*/
|
|
4233
4249
|
declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
|
|
4234
4250
|
|
|
4235
|
-
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
4251
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
package/dist/bichat/index.d.ts
CHANGED
|
@@ -530,6 +530,7 @@ interface SendMessageOptions {
|
|
|
530
530
|
debugMode?: boolean;
|
|
531
531
|
replaceFromMessageID?: string;
|
|
532
532
|
reasoningEffort?: string;
|
|
533
|
+
model?: string;
|
|
533
534
|
}
|
|
534
535
|
interface SessionListResult$1 {
|
|
535
536
|
sessions: Session$1[];
|
|
@@ -655,9 +656,11 @@ interface ChatSessionStateValue {
|
|
|
655
656
|
debugLimits: DebugLimits | null;
|
|
656
657
|
reasoningEffort: string | undefined;
|
|
657
658
|
reasoningEffortOptions: string[] | undefined;
|
|
659
|
+
model: string | undefined;
|
|
658
660
|
setError: (error: string | null) => void;
|
|
659
661
|
retryFetchSession: () => void;
|
|
660
662
|
setReasoningEffort: (effort: string) => void;
|
|
663
|
+
setModel: (model: string | undefined) => void;
|
|
661
664
|
}
|
|
662
665
|
interface ChatMessagingStateValue {
|
|
663
666
|
turns: ConversationTurn$1[];
|
|
@@ -770,6 +773,8 @@ interface ChatSessionProps {
|
|
|
770
773
|
logoSlot?: ReactNode;
|
|
771
774
|
/** Custom action buttons for the header */
|
|
772
775
|
actionsSlot?: ReactNode;
|
|
776
|
+
/** Custom content rendered above the message input (e.g., model selector) */
|
|
777
|
+
inputHeaderSlot?: ReactNode;
|
|
773
778
|
/** Callback when user navigates back */
|
|
774
779
|
onBack?: () => void;
|
|
775
780
|
/** Custom verbs for the typing indicator (e.g. ['Thinking', 'Analyzing', ...]) */
|
|
@@ -785,6 +790,8 @@ interface ChatSessionProps {
|
|
|
785
790
|
}
|
|
786
791
|
declare function ChatSession(props: ChatSessionProps): react_jsx_runtime.JSX.Element;
|
|
787
792
|
|
|
793
|
+
declare function ModelSelector(): react_jsx_runtime.JSX.Element | null;
|
|
794
|
+
|
|
788
795
|
interface SessionArtifactsPanelProps {
|
|
789
796
|
dataSource: ChatDataSource;
|
|
790
797
|
sessionId: string;
|
|
@@ -3680,6 +3687,11 @@ interface Extensions {
|
|
|
3680
3687
|
provider?: string;
|
|
3681
3688
|
apiKeyConfigured?: boolean;
|
|
3682
3689
|
reasoningEffortOptions?: string[];
|
|
3690
|
+
models?: Array<{
|
|
3691
|
+
id: string;
|
|
3692
|
+
label: string;
|
|
3693
|
+
default?: boolean;
|
|
3694
|
+
}>;
|
|
3683
3695
|
};
|
|
3684
3696
|
debug?: {
|
|
3685
3697
|
limits?: {
|
|
@@ -3874,9 +3886,11 @@ interface SessionSnapshot {
|
|
|
3874
3886
|
debugLimits: DebugLimits | null;
|
|
3875
3887
|
reasoningEffort: string | undefined;
|
|
3876
3888
|
reasoningEffortOptions: string[] | undefined;
|
|
3889
|
+
model: string | undefined;
|
|
3877
3890
|
setError: (error: string | null) => void;
|
|
3878
3891
|
retryFetchSession: () => void;
|
|
3879
3892
|
setReasoningEffort: (effort: string) => void;
|
|
3893
|
+
setModel: (model: string | undefined) => void;
|
|
3880
3894
|
}
|
|
3881
3895
|
/** Superset of ChatMessagingStateValue used internally by the state machine; includes internal-only fields such as generationInProgress. */
|
|
3882
3896
|
interface MessagingSnapshot {
|
|
@@ -3997,6 +4011,7 @@ declare class ChatMachine {
|
|
|
3997
4011
|
readonly removeQueueItem: (index: number) => void;
|
|
3998
4012
|
readonly updateQueueItem: (index: number, content: string) => void;
|
|
3999
4013
|
readonly setReasoningEffort: (effort: string) => void;
|
|
4014
|
+
readonly setModel: (model: string | undefined) => void;
|
|
4000
4015
|
constructor(config: ChatMachineConfig);
|
|
4001
4016
|
private buildReasoningEffortOptions;
|
|
4002
4017
|
private sanitizeReasoningEffort;
|
|
@@ -4027,6 +4042,7 @@ declare class ChatMachine {
|
|
|
4027
4042
|
private _setDebugModeForSession;
|
|
4028
4043
|
private _hydrateDebugModeForSession;
|
|
4029
4044
|
private _setReasoningEffort;
|
|
4045
|
+
private _setModel;
|
|
4030
4046
|
private _fetchSessionIfNeeded;
|
|
4031
4047
|
/**
|
|
4032
4048
|
* Sets turns from fetch, preserving pending user-only turns if server hasn't caught up.
|
|
@@ -4232,4 +4248,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
|
|
|
4232
4248
|
*/
|
|
4233
4249
|
declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
|
|
4234
4250
|
|
|
4235
|
-
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
4251
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
package/dist/bichat/index.mjs
CHANGED
|
@@ -1842,9 +1842,11 @@ function deriveSessionSnapshot(state, methods) {
|
|
|
1842
1842
|
debugLimits: state.session.debugLimits,
|
|
1843
1843
|
reasoningEffort: state.session.reasoningEffort,
|
|
1844
1844
|
reasoningEffortOptions: state.session.reasoningEffortOptions,
|
|
1845
|
+
model: state.session.model,
|
|
1845
1846
|
setError: methods.setError,
|
|
1846
1847
|
retryFetchSession: methods.retryFetchSession,
|
|
1847
|
-
setReasoningEffort: methods.setReasoningEffort
|
|
1848
|
+
setReasoningEffort: methods.setReasoningEffort,
|
|
1849
|
+
setModel: methods.setModel
|
|
1848
1850
|
};
|
|
1849
1851
|
}
|
|
1850
1852
|
function deriveMessagingSnapshot(state, methods) {
|
|
@@ -2125,7 +2127,8 @@ var ChatMachine = class {
|
|
|
2125
2127
|
this.cachedSessionSnapshot = deriveSessionSnapshot(this.state, {
|
|
2126
2128
|
setError: this.setError,
|
|
2127
2129
|
retryFetchSession: this.retryFetchSession,
|
|
2128
|
-
setReasoningEffort: this.setReasoningEffort
|
|
2130
|
+
setReasoningEffort: this.setReasoningEffort,
|
|
2131
|
+
setModel: this.setModel
|
|
2129
2132
|
});
|
|
2130
2133
|
this.lastSessionSnapshotVersion = this.sessionSnapshotVersion;
|
|
2131
2134
|
}
|
|
@@ -2197,7 +2200,8 @@ var ChatMachine = class {
|
|
|
2197
2200
|
debugModeBySession: {},
|
|
2198
2201
|
debugLimits: readDebugLimitsFromGlobalContext(),
|
|
2199
2202
|
reasoningEffort: initialReasoningEffort,
|
|
2200
|
-
reasoningEffortOptions: this.reasoningEffortOptions ?? void 0
|
|
2203
|
+
reasoningEffortOptions: this.reasoningEffortOptions ?? void 0,
|
|
2204
|
+
model: void 0
|
|
2201
2205
|
},
|
|
2202
2206
|
messaging: {
|
|
2203
2207
|
turns: [],
|
|
@@ -2240,6 +2244,7 @@ var ChatMachine = class {
|
|
|
2240
2244
|
this.removeQueueItem = this._removeQueueItem.bind(this);
|
|
2241
2245
|
this.updateQueueItem = this._updateQueueItem.bind(this);
|
|
2242
2246
|
this.setReasoningEffort = this._setReasoningEffort.bind(this);
|
|
2247
|
+
this.setModel = this._setModel.bind(this);
|
|
2243
2248
|
}
|
|
2244
2249
|
buildReasoningEffortOptions() {
|
|
2245
2250
|
const options = readReasoningEffortOptionsFromGlobalContext();
|
|
@@ -2383,6 +2388,9 @@ var ChatMachine = class {
|
|
|
2383
2388
|
}
|
|
2384
2389
|
clearReasoningEffort();
|
|
2385
2390
|
}
|
|
2391
|
+
_setModel(model) {
|
|
2392
|
+
this._updateSession({ model });
|
|
2393
|
+
}
|
|
2386
2394
|
// =====================================================================
|
|
2387
2395
|
// Private — session fetch
|
|
2388
2396
|
// =====================================================================
|
|
@@ -2857,6 +2865,7 @@ var ChatMachine = class {
|
|
|
2857
2865
|
debugMode,
|
|
2858
2866
|
replaceFromMessageID,
|
|
2859
2867
|
reasoningEffort,
|
|
2868
|
+
model,
|
|
2860
2869
|
tempTurnId
|
|
2861
2870
|
} = params;
|
|
2862
2871
|
let accumulatedContent = "";
|
|
@@ -2872,7 +2881,8 @@ var ChatMachine = class {
|
|
|
2872
2881
|
{
|
|
2873
2882
|
debugMode,
|
|
2874
2883
|
replaceFromMessageID,
|
|
2875
|
-
reasoningEffort
|
|
2884
|
+
reasoningEffort,
|
|
2885
|
+
model
|
|
2876
2886
|
}
|
|
2877
2887
|
)) {
|
|
2878
2888
|
if (this.abortController?.signal.aborted) {
|
|
@@ -3022,7 +3032,7 @@ var ChatMachine = class {
|
|
|
3022
3032
|
if (this.disposed) {
|
|
3023
3033
|
return;
|
|
3024
3034
|
}
|
|
3025
|
-
if (!content.trim() || this.state.messaging.loading) {
|
|
3035
|
+
if (!content.trim() || this.state.messaging.loading || isOpenQuestionStatus(this.state.messaging.pendingQuestion?.status)) {
|
|
3026
3036
|
return;
|
|
3027
3037
|
}
|
|
3028
3038
|
const trimmedContent = content.trim();
|
|
@@ -3079,6 +3089,7 @@ var ChatMachine = class {
|
|
|
3079
3089
|
reasoningEffort: this.sanitizeReasoningEffort(
|
|
3080
3090
|
this.state.session.reasoningEffort
|
|
3081
3091
|
),
|
|
3092
|
+
model: this.state.session.model,
|
|
3082
3093
|
tempTurnId: tempTurn.id
|
|
3083
3094
|
});
|
|
3084
3095
|
if (stopped) {
|
|
@@ -3117,7 +3128,7 @@ var ChatMachine = class {
|
|
|
3117
3128
|
this.sendingSessionId = null;
|
|
3118
3129
|
if (shouldDrainQueue) {
|
|
3119
3130
|
const queue = this.state.input.messageQueue;
|
|
3120
|
-
if (queue.length > 0) {
|
|
3131
|
+
if (queue.length > 0 && !isOpenQuestionStatus(this.state.messaging.pendingQuestion?.status)) {
|
|
3121
3132
|
const next = queue[0];
|
|
3122
3133
|
this._updateInput({ messageQueue: queue.slice(1) });
|
|
3123
3134
|
setTimeout(() => {
|
|
@@ -8026,6 +8037,7 @@ function AssistantMessage({
|
|
|
8026
8037
|
actionsSlotProps,
|
|
8027
8038
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8028
8039
|
!hideTimestamp && /* @__PURE__ */ jsx("span", { className: classes.timestamp, children: timestamp }),
|
|
8040
|
+
showDebug && turn.debug?.attempts?.[0]?.model && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium leading-none text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-800", children: turn.debug.attempts[0].model }),
|
|
8029
8041
|
/* @__PURE__ */ jsx(
|
|
8030
8042
|
"button",
|
|
8031
8043
|
{
|
|
@@ -12129,6 +12141,7 @@ function ChatSessionCore({
|
|
|
12129
12141
|
welcomeSlot,
|
|
12130
12142
|
logoSlot,
|
|
12131
12143
|
actionsSlot,
|
|
12144
|
+
inputHeaderSlot,
|
|
12132
12145
|
onBack,
|
|
12133
12146
|
thinkingVerbs,
|
|
12134
12147
|
onSessionRestored,
|
|
@@ -12161,7 +12174,8 @@ function ChatSessionCore({
|
|
|
12161
12174
|
streamErrorRetryable,
|
|
12162
12175
|
isCompacting,
|
|
12163
12176
|
retryLastMessage,
|
|
12164
|
-
clearStreamError
|
|
12177
|
+
clearStreamError,
|
|
12178
|
+
pendingQuestion
|
|
12165
12179
|
} = useChatMessaging();
|
|
12166
12180
|
const {
|
|
12167
12181
|
inputError,
|
|
@@ -12177,6 +12191,7 @@ function ChatSessionCore({
|
|
|
12177
12191
|
const isArchived = session?.status === "archived";
|
|
12178
12192
|
const accessReadOnly = session?.access ? !session.access.canWrite : false;
|
|
12179
12193
|
const effectiveReadOnly = Boolean(readOnly ?? isReadOnly) || isArchived || accessReadOnly;
|
|
12194
|
+
const composerDisabled = isOpenQuestionStatus(pendingQuestion?.status);
|
|
12180
12195
|
const [restoring, setRestoring] = useState(false);
|
|
12181
12196
|
const handleRestore = useCallback(async () => {
|
|
12182
12197
|
if (!session?.id) {
|
|
@@ -12415,7 +12430,7 @@ function ChatSessionCore({
|
|
|
12415
12430
|
className: "relative flex min-h-0 flex-1 overflow-hidden",
|
|
12416
12431
|
children: [
|
|
12417
12432
|
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: showWelcome ? /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col overflow-auto", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center px-4 py-8", children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-5xl", children: [
|
|
12418
|
-
welcomeSlot || /* @__PURE__ */ jsx(WelcomeContent_default, { onPromptSelect: handlePromptSelect, disabled: loading }),
|
|
12433
|
+
welcomeSlot || /* @__PURE__ */ jsx(WelcomeContent_default, { onPromptSelect: handlePromptSelect, disabled: loading || composerDisabled }),
|
|
12419
12434
|
streamError && /* @__PURE__ */ jsx("div", { className: "px-6 pt-4", children: /* @__PURE__ */ jsx(
|
|
12420
12435
|
StreamError,
|
|
12421
12436
|
{
|
|
@@ -12425,6 +12440,7 @@ function ChatSessionCore({
|
|
|
12425
12440
|
onDismiss: clearStreamError
|
|
12426
12441
|
}
|
|
12427
12442
|
) }),
|
|
12443
|
+
!effectiveReadOnly && inputHeaderSlot,
|
|
12428
12444
|
!effectiveReadOnly && /* @__PURE__ */ jsx(
|
|
12429
12445
|
MessageInput,
|
|
12430
12446
|
{
|
|
@@ -12446,6 +12462,7 @@ function ChatSessionCore({
|
|
|
12446
12462
|
onCancelStreaming: cancel,
|
|
12447
12463
|
containerClassName: "pt-6 px-6",
|
|
12448
12464
|
formClassName: "mx-auto",
|
|
12465
|
+
disabled: composerDisabled,
|
|
12449
12466
|
reasoningEffortOptions,
|
|
12450
12467
|
reasoningEffort,
|
|
12451
12468
|
onReasoningEffortChange: setReasoningEffort
|
|
@@ -12486,6 +12503,7 @@ function ChatSessionCore({
|
|
|
12486
12503
|
onDismiss: clearStreamError
|
|
12487
12504
|
}
|
|
12488
12505
|
) }),
|
|
12506
|
+
!effectiveReadOnly && inputHeaderSlot,
|
|
12489
12507
|
!effectiveReadOnly && /* @__PURE__ */ jsx(
|
|
12490
12508
|
MessageInput,
|
|
12491
12509
|
{
|
|
@@ -12505,6 +12523,7 @@ function ChatSessionCore({
|
|
|
12505
12523
|
onRemoveQueueItem: removeQueueItem,
|
|
12506
12524
|
onUpdateQueueItem: updateQueueItem,
|
|
12507
12525
|
onCancelStreaming: cancel,
|
|
12526
|
+
disabled: composerDisabled,
|
|
12508
12527
|
reasoningEffortOptions,
|
|
12509
12528
|
reasoningEffort,
|
|
12510
12529
|
onReasoningEffortChange: setReasoningEffort
|
|
@@ -12625,6 +12644,69 @@ function ChatSession(props) {
|
|
|
12625
12644
|
}
|
|
12626
12645
|
);
|
|
12627
12646
|
}
|
|
12647
|
+
init_IotaContext();
|
|
12648
|
+
init_useTranslation();
|
|
12649
|
+
function ModelSelector() {
|
|
12650
|
+
const { model, setModel } = useChatSession();
|
|
12651
|
+
const context = useIotaContext();
|
|
12652
|
+
const { t } = useTranslation();
|
|
12653
|
+
const models = useMemo(
|
|
12654
|
+
() => context.extensions?.llm?.models ?? [],
|
|
12655
|
+
[context.extensions?.llm?.models]
|
|
12656
|
+
);
|
|
12657
|
+
const defaultModel = models.find((m) => m.default) ?? models[0];
|
|
12658
|
+
const currentModel = model ?? defaultModel?.id;
|
|
12659
|
+
useEffect(() => {
|
|
12660
|
+
if (!model && defaultModel) {
|
|
12661
|
+
setModel(defaultModel.id);
|
|
12662
|
+
}
|
|
12663
|
+
}, [model, defaultModel, setModel]);
|
|
12664
|
+
const rotateModel = useCallback(() => {
|
|
12665
|
+
const currentIndex = models.findIndex((m) => m.id === currentModel);
|
|
12666
|
+
const nextIndex = (currentIndex + 1) % models.length;
|
|
12667
|
+
setModel(models[nextIndex].id);
|
|
12668
|
+
}, [currentModel, models, setModel]);
|
|
12669
|
+
useEffect(() => {
|
|
12670
|
+
const handler = (e) => {
|
|
12671
|
+
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key === "m") {
|
|
12672
|
+
e.preventDefault();
|
|
12673
|
+
rotateModel();
|
|
12674
|
+
}
|
|
12675
|
+
};
|
|
12676
|
+
document.addEventListener("keydown", handler);
|
|
12677
|
+
return () => document.removeEventListener("keydown", handler);
|
|
12678
|
+
}, [rotateModel]);
|
|
12679
|
+
if (models.length < 2) {
|
|
12680
|
+
return null;
|
|
12681
|
+
}
|
|
12682
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 pt-3 pb-1", children: [
|
|
12683
|
+
/* @__PURE__ */ jsx("div", { className: "inline-flex rounded-lg bg-gray-100 p-0.5 dark:bg-gray-800", children: models.map((m, i) => {
|
|
12684
|
+
const isActive = m.id === currentModel;
|
|
12685
|
+
const isFast = i === 0;
|
|
12686
|
+
return /* @__PURE__ */ jsxs(
|
|
12687
|
+
"button",
|
|
12688
|
+
{
|
|
12689
|
+
type: "button",
|
|
12690
|
+
onClick: () => setModel(m.id),
|
|
12691
|
+
className: `
|
|
12692
|
+
flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium transition-all duration-150
|
|
12693
|
+
${isActive ? isFast ? "bg-white text-amber-600 shadow-sm dark:bg-gray-700 dark:text-amber-400" : "bg-white text-blue-600 shadow-sm dark:bg-gray-700 dark:text-blue-400" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}
|
|
12694
|
+
`,
|
|
12695
|
+
children: [
|
|
12696
|
+
isFast ? /* @__PURE__ */ jsx(Lightning, { size: 13, weight: "fill" }) : /* @__PURE__ */ jsx(Brain, { size: 13, weight: "fill" }),
|
|
12697
|
+
/* @__PURE__ */ jsx("span", { children: t(m.label) })
|
|
12698
|
+
]
|
|
12699
|
+
},
|
|
12700
|
+
m.id
|
|
12701
|
+
);
|
|
12702
|
+
}) }),
|
|
12703
|
+
/* @__PURE__ */ jsxs("span", { className: "hidden select-none text-[10px] text-gray-400 sm:block dark:text-gray-500", children: [
|
|
12704
|
+
navigator.platform.includes("Mac") ? "\u2318" : "Ctrl",
|
|
12705
|
+
"\u21E7",
|
|
12706
|
+
"M"
|
|
12707
|
+
] })
|
|
12708
|
+
] });
|
|
12709
|
+
}
|
|
12628
12710
|
|
|
12629
12711
|
// ui/src/bichat/index.ts
|
|
12630
12712
|
init_MarkdownRenderer();
|
|
@@ -19144,6 +19226,9 @@ async function* sendMessage(deps, sessionId, content, attachments = [], signal,
|
|
|
19144
19226
|
if (options?.reasoningEffort) {
|
|
19145
19227
|
payload.reasoningEffort = options.reasoningEffort;
|
|
19146
19228
|
}
|
|
19229
|
+
if (options?.model) {
|
|
19230
|
+
payload.model = options.model;
|
|
19231
|
+
}
|
|
19147
19232
|
const timeoutMs = deps.streamConnectTimeoutMs ?? 0;
|
|
19148
19233
|
if (timeoutMs > 0) {
|
|
19149
19234
|
connectionTimeoutID = setTimeout(() => {
|
|
@@ -19645,6 +19730,6 @@ function createHttpDataSource(config) {
|
|
|
19645
19730
|
return new HttpDataSource(config);
|
|
19646
19731
|
}
|
|
19647
19732
|
|
|
19648
|
-
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, ActivityTrace, Alert_default as Alert, AllChatsList, ArchiveBanner_default as ArchiveBanner, ArchivedChatList, AssistantMessage, AssistantTurnView, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview_default as AttachmentPreview, AttachmentUpload_default as AttachmentUpload, Avatar, AvatarStack, BiChatLayout, Bubble, CHART_VISUAL, ChartCard, ChatHeader, ChatMachine, ChatSession, ChatSessionProvider, MemoizedCodeBlock as CodeBlock, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, ConfirmationStep, DateGroupHeader, DebugPanel, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, MemoizedEmptyState as EmptyState, ErrorBoundary, HttpDataSource, ImageModal, InlineQuestionForm, InteractiveTableCard, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, MessageList, MessageRole, PermissionGuard, QuestionForm, QuestionStep, RateLimiter, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, SessionItem_default as SessionItem, SessionMembersModal, SessionSkeleton, Sidebar2 as Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, SkeletonText, SkipLink, Slot, SourcesPanel, StreamError, StreamingCursor, SystemMessage, TabbedChartGroup, TabbedTableGroup, TableExportButton, TableWithExport, ThemeProvider, Toast, ToastContainer, TouchContextMenu, Turn, TurnBubble, MemoizedTypingIndicator as TypingIndicator, MemoizedUserAvatar as UserAvatar, MemoizedUserFilter as UserFilter, UserMessage, UserTurnView, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming2 as useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
19733
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, ActivityTrace, Alert_default as Alert, AllChatsList, ArchiveBanner_default as ArchiveBanner, ArchivedChatList, AssistantMessage, AssistantTurnView, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview_default as AttachmentPreview, AttachmentUpload_default as AttachmentUpload, Avatar, AvatarStack, BiChatLayout, Bubble, CHART_VISUAL, ChartCard, ChatHeader, ChatMachine, ChatSession, ChatSessionProvider, MemoizedCodeBlock as CodeBlock, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, ConfirmationStep, DateGroupHeader, DebugPanel, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, MemoizedEmptyState as EmptyState, ErrorBoundary, HttpDataSource, ImageModal, InlineQuestionForm, InteractiveTableCard, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, MessageList, MessageRole, ModelSelector, PermissionGuard, QuestionForm, QuestionStep, RateLimiter, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, SessionItem_default as SessionItem, SessionMembersModal, SessionSkeleton, Sidebar2 as Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, SkeletonText, SkipLink, Slot, SourcesPanel, StreamError, StreamingCursor, SystemMessage, TabbedChartGroup, TabbedTableGroup, TableExportButton, TableWithExport, ThemeProvider, Toast, ToastContainer, TouchContextMenu, Turn, TurnBubble, MemoizedTypingIndicator as TypingIndicator, MemoizedUserAvatar as UserAvatar, MemoizedUserFilter as UserFilter, UserMessage, UserTurnView, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming2 as useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
19649
19734
|
//# sourceMappingURL=index.mjs.map
|
|
19650
19735
|
//# sourceMappingURL=index.mjs.map
|