@assistant-ui/react 0.5.52 → 0.5.53

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ComponentType, PropsWithChildren, FC, ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
3
- import { T as ThreadAssistantContentPart, M as MessageStatus, a as ThreadRoundtrip, b as ThreadMessage, c as ModelConfig, d as ModelConfigProvider, e as TextContentPart, C as ContentPartStatus, I as ImageContentPart, U as UIContentPart, f as ToolCallContentPart, g as ToolCallContentPartStatus, h as CoreMessage, i as ThreadComposerAttachment, j as MessageAttachment, A as AppendMessage, k as Tool, l as CoreToolCallContentPart, m as CreateEdgeRuntimeAPIOptions } from './edge-BJordJU0.mjs';
3
+ import { T as ThreadAssistantContentPart, M as MessageStatus, a as ThreadRoundtrip, b as ThreadMessage, c as ModelConfig, d as ModelConfigProvider, C as ContentPartStatus, e as TextContentPart, I as ImageContentPart, U as UIContentPart, f as ToolCallContentPart, g as ToolCallContentPartStatus, h as CoreMessage, i as ThreadComposerAttachment, j as MessageAttachment, A as AppendMessage, k as Tool, l as CoreToolCallContentPart, m as CreateEdgeRuntimeAPIOptions } from './edge-BJordJU0.mjs';
4
4
  export { s as CoreAssistantContentPart, v as CoreAssistantMessage, t as CoreSystemMessage, r as CoreUserContentPart, u as CoreUserMessage, E as EdgeRuntimeRequestOptions, p as ThreadAssistantMessage, o as ThreadSystemMessage, n as ThreadUserContentPart, q as ThreadUserMessage } from './edge-BJordJU0.mjs';
5
5
  import { UseBoundStore, StoreApi } from 'zustand';
6
6
  import { Primitive } from '@radix-ui/react-primitive';
@@ -61,6 +61,10 @@ declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRu
61
61
  private subscriptionHandler;
62
62
  }
63
63
 
64
+ type EmptyContentPartProps = {
65
+ status: ContentPartStatus;
66
+ };
67
+ type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;
64
68
  type TextContentPartProps = {
65
69
  part: TextContentPart;
66
70
  status: ContentPartStatus;
@@ -232,9 +236,10 @@ type fromLanguageModelMessagesOptions = {
232
236
  declare const fromLanguageModelMessages: (lm: LanguageModelV1Message[], { mergeRoundtrips }: fromLanguageModelMessagesOptions) => CoreMessage[];
233
237
 
234
238
  declare const fromCoreMessages: (message: readonly CoreMessage[]) => ThreadMessage[];
235
- declare const fromCoreMessage: (message: CoreMessage, { id, status, }?: {
239
+ declare const fromCoreMessage: (message: CoreMessage, { id, status, attachments, }?: {
236
240
  id?: string | undefined;
237
241
  status?: MessageStatus | undefined;
242
+ attachments?: readonly MessageAttachment[] | undefined;
238
243
  }) => ThreadMessage;
239
244
 
240
245
  declare const toCoreMessages: (message: ThreadMessage[]) => CoreMessage[];
@@ -1010,7 +1015,7 @@ declare const MessagePrimitiveIf: FC<MessagePrimitiveIfProps>;
1010
1015
 
1011
1016
  type MessagePrimitiveContentProps = {
1012
1017
  components?: {
1013
- Empty?: TextContentPartComponent | undefined;
1018
+ Empty?: EmptyContentPartComponent | undefined;
1014
1019
  Text?: TextContentPartComponent | undefined;
1015
1020
  Image?: ImageContentPartComponent | undefined;
1016
1021
  UI?: UIContentPartComponent | undefined;
@@ -1074,14 +1079,20 @@ declare const ThreadPrimitiveViewport: react.ForwardRefExoticComponent<Omit<Omit
1074
1079
  type ThreadPrimitiveMessagesProps = {
1075
1080
  components: {
1076
1081
  Message: ComponentType;
1077
- UserMessage?: ComponentType | undefined;
1078
1082
  EditComposer?: ComponentType | undefined;
1083
+ UserEditComposer?: ComponentType | undefined;
1084
+ AssistantEditComposer?: ComponentType | undefined;
1085
+ SystemEditComposer?: ComponentType | undefined;
1086
+ UserMessage?: ComponentType | undefined;
1079
1087
  AssistantMessage?: ComponentType | undefined;
1080
1088
  SystemMessage?: ComponentType | undefined;
1081
1089
  } | {
1082
1090
  Message?: ComponentType | undefined;
1083
- UserMessage: ComponentType;
1084
1091
  EditComposer?: ComponentType | undefined;
1092
+ UserEditComposer?: ComponentType | undefined;
1093
+ AssistantEditComposer?: ComponentType | undefined;
1094
+ SystemEditComposer?: ComponentType | undefined;
1095
+ UserMessage: ComponentType;
1085
1096
  AssistantMessage: ComponentType;
1086
1097
  SystemMessage?: ComponentType | undefined;
1087
1098
  };
@@ -1423,4 +1434,4 @@ declare const exports: {
1423
1434
  Text: FC;
1424
1435
  };
1425
1436
 
1426
- export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$b as AssistantActionBar, type AssistantActionsState, type AssistantContextValue, _default$a as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$9 as AssistantModal, index$5 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantModelConfigState, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, type AttachmentAdapter, _default$8 as BranchPicker, index$4 as BranchPickerPrimitive, type BranchPickerPrimitiveCountProps, type BranchPickerPrimitiveNextProps, type BranchPickerPrimitiveNumberProps, type BranchPickerPrimitivePreviousProps, type BranchPickerPrimitiveRootProps, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, _default$7 as Composer, _default$6 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartState, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$5 as EditComposer, type EditComposerState, type ExternalStoreAdapter, type ExternalStoreMessageConverter, ExternalStoreRuntime, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, type ReactThreadRuntime, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$4 as Thread, type ThreadActionsState, ThreadAssistantContentPart, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, type ThreadMessagesState, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, ThreadRuntime, type ThreadState, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps, type Unsubscribe, type UseActionBarCopyProps, _default$2 as UserActionBar, _default$3 as UserMessage, _default$1 as UserMessageAttachment, type UserMessageConfig, type UserMessageContentProps, WebSpeechSynthesisAdapter, fromCoreMessage, fromCoreMessages, fromLanguageModelMessages, fromLanguageModelTools, getExternalStoreMessage, makeAssistantTool, makeAssistantToolUI, streamUtils, subscribeToMainThread, toCoreMessage, toCoreMessages, toLanguageModelMessages, toLanguageModelTools, useActionBarCopy, useActionBarEdit, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantContext, useAssistantInstructions, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerSend, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessageContext, useMessageIf, useSwitchToNewThread, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadScrollToBottom, useThreadSuggestion };
1437
+ export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$b as AssistantActionBar, type AssistantActionsState, type AssistantContextValue, _default$a as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$9 as AssistantModal, index$5 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantModelConfigState, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, type AttachmentAdapter, _default$8 as BranchPicker, index$4 as BranchPickerPrimitive, type BranchPickerPrimitiveCountProps, type BranchPickerPrimitiveNextProps, type BranchPickerPrimitiveNumberProps, type BranchPickerPrimitivePreviousProps, type BranchPickerPrimitiveRootProps, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, _default$7 as Composer, _default$6 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartState, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$5 as EditComposer, type EditComposerState, type EmptyContentPartComponent, type EmptyContentPartProps, type ExternalStoreAdapter, type ExternalStoreMessageConverter, ExternalStoreRuntime, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, type ReactThreadRuntime, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$4 as Thread, type ThreadActionsState, ThreadAssistantContentPart, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, type ThreadMessagesState, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, ThreadRuntime, type ThreadState, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps, type Unsubscribe, type UseActionBarCopyProps, _default$2 as UserActionBar, _default$3 as UserMessage, _default$1 as UserMessageAttachment, type UserMessageConfig, type UserMessageContentProps, WebSpeechSynthesisAdapter, fromCoreMessage, fromCoreMessages, fromLanguageModelMessages, fromLanguageModelTools, getExternalStoreMessage, makeAssistantTool, makeAssistantToolUI, streamUtils, subscribeToMainThread, toCoreMessage, toCoreMessages, toLanguageModelMessages, toLanguageModelTools, useActionBarCopy, useActionBarEdit, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantContext, useAssistantInstructions, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerSend, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessageContext, useMessageIf, useSwitchToNewThread, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadScrollToBottom, useThreadSuggestion };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ComponentType, PropsWithChildren, FC, ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
3
- import { T as ThreadAssistantContentPart, M as MessageStatus, a as ThreadRoundtrip, b as ThreadMessage, c as ModelConfig, d as ModelConfigProvider, e as TextContentPart, C as ContentPartStatus, I as ImageContentPart, U as UIContentPart, f as ToolCallContentPart, g as ToolCallContentPartStatus, h as CoreMessage, i as ThreadComposerAttachment, j as MessageAttachment, A as AppendMessage, k as Tool, l as CoreToolCallContentPart, m as CreateEdgeRuntimeAPIOptions } from './edge-BJordJU0.js';
3
+ import { T as ThreadAssistantContentPart, M as MessageStatus, a as ThreadRoundtrip, b as ThreadMessage, c as ModelConfig, d as ModelConfigProvider, C as ContentPartStatus, e as TextContentPart, I as ImageContentPart, U as UIContentPart, f as ToolCallContentPart, g as ToolCallContentPartStatus, h as CoreMessage, i as ThreadComposerAttachment, j as MessageAttachment, A as AppendMessage, k as Tool, l as CoreToolCallContentPart, m as CreateEdgeRuntimeAPIOptions } from './edge-BJordJU0.js';
4
4
  export { s as CoreAssistantContentPart, v as CoreAssistantMessage, t as CoreSystemMessage, r as CoreUserContentPart, u as CoreUserMessage, E as EdgeRuntimeRequestOptions, p as ThreadAssistantMessage, o as ThreadSystemMessage, n as ThreadUserContentPart, q as ThreadUserMessage } from './edge-BJordJU0.js';
5
5
  import { UseBoundStore, StoreApi } from 'zustand';
6
6
  import { Primitive } from '@radix-ui/react-primitive';
@@ -61,6 +61,10 @@ declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRu
61
61
  private subscriptionHandler;
62
62
  }
63
63
 
64
+ type EmptyContentPartProps = {
65
+ status: ContentPartStatus;
66
+ };
67
+ type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;
64
68
  type TextContentPartProps = {
65
69
  part: TextContentPart;
66
70
  status: ContentPartStatus;
@@ -232,9 +236,10 @@ type fromLanguageModelMessagesOptions = {
232
236
  declare const fromLanguageModelMessages: (lm: LanguageModelV1Message[], { mergeRoundtrips }: fromLanguageModelMessagesOptions) => CoreMessage[];
233
237
 
234
238
  declare const fromCoreMessages: (message: readonly CoreMessage[]) => ThreadMessage[];
235
- declare const fromCoreMessage: (message: CoreMessage, { id, status, }?: {
239
+ declare const fromCoreMessage: (message: CoreMessage, { id, status, attachments, }?: {
236
240
  id?: string | undefined;
237
241
  status?: MessageStatus | undefined;
242
+ attachments?: readonly MessageAttachment[] | undefined;
238
243
  }) => ThreadMessage;
239
244
 
240
245
  declare const toCoreMessages: (message: ThreadMessage[]) => CoreMessage[];
@@ -1010,7 +1015,7 @@ declare const MessagePrimitiveIf: FC<MessagePrimitiveIfProps>;
1010
1015
 
1011
1016
  type MessagePrimitiveContentProps = {
1012
1017
  components?: {
1013
- Empty?: TextContentPartComponent | undefined;
1018
+ Empty?: EmptyContentPartComponent | undefined;
1014
1019
  Text?: TextContentPartComponent | undefined;
1015
1020
  Image?: ImageContentPartComponent | undefined;
1016
1021
  UI?: UIContentPartComponent | undefined;
@@ -1074,14 +1079,20 @@ declare const ThreadPrimitiveViewport: react.ForwardRefExoticComponent<Omit<Omit
1074
1079
  type ThreadPrimitiveMessagesProps = {
1075
1080
  components: {
1076
1081
  Message: ComponentType;
1077
- UserMessage?: ComponentType | undefined;
1078
1082
  EditComposer?: ComponentType | undefined;
1083
+ UserEditComposer?: ComponentType | undefined;
1084
+ AssistantEditComposer?: ComponentType | undefined;
1085
+ SystemEditComposer?: ComponentType | undefined;
1086
+ UserMessage?: ComponentType | undefined;
1079
1087
  AssistantMessage?: ComponentType | undefined;
1080
1088
  SystemMessage?: ComponentType | undefined;
1081
1089
  } | {
1082
1090
  Message?: ComponentType | undefined;
1083
- UserMessage: ComponentType;
1084
1091
  EditComposer?: ComponentType | undefined;
1092
+ UserEditComposer?: ComponentType | undefined;
1093
+ AssistantEditComposer?: ComponentType | undefined;
1094
+ SystemEditComposer?: ComponentType | undefined;
1095
+ UserMessage: ComponentType;
1085
1096
  AssistantMessage: ComponentType;
1086
1097
  SystemMessage?: ComponentType | undefined;
1087
1098
  };
@@ -1423,4 +1434,4 @@ declare const exports: {
1423
1434
  Text: FC;
1424
1435
  };
1425
1436
 
1426
- export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$b as AssistantActionBar, type AssistantActionsState, type AssistantContextValue, _default$a as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$9 as AssistantModal, index$5 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantModelConfigState, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, type AttachmentAdapter, _default$8 as BranchPicker, index$4 as BranchPickerPrimitive, type BranchPickerPrimitiveCountProps, type BranchPickerPrimitiveNextProps, type BranchPickerPrimitiveNumberProps, type BranchPickerPrimitivePreviousProps, type BranchPickerPrimitiveRootProps, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, _default$7 as Composer, _default$6 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartState, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$5 as EditComposer, type EditComposerState, type ExternalStoreAdapter, type ExternalStoreMessageConverter, ExternalStoreRuntime, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, type ReactThreadRuntime, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$4 as Thread, type ThreadActionsState, ThreadAssistantContentPart, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, type ThreadMessagesState, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, ThreadRuntime, type ThreadState, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps, type Unsubscribe, type UseActionBarCopyProps, _default$2 as UserActionBar, _default$3 as UserMessage, _default$1 as UserMessageAttachment, type UserMessageConfig, type UserMessageContentProps, WebSpeechSynthesisAdapter, fromCoreMessage, fromCoreMessages, fromLanguageModelMessages, fromLanguageModelTools, getExternalStoreMessage, makeAssistantTool, makeAssistantToolUI, streamUtils, subscribeToMainThread, toCoreMessage, toCoreMessages, toLanguageModelMessages, toLanguageModelTools, useActionBarCopy, useActionBarEdit, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantContext, useAssistantInstructions, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerSend, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessageContext, useMessageIf, useSwitchToNewThread, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadScrollToBottom, useThreadSuggestion };
1437
+ export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$b as AssistantActionBar, type AssistantActionsState, type AssistantContextValue, _default$a as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$9 as AssistantModal, index$5 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantModelConfigState, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, type AttachmentAdapter, _default$8 as BranchPicker, index$4 as BranchPickerPrimitive, type BranchPickerPrimitiveCountProps, type BranchPickerPrimitiveNextProps, type BranchPickerPrimitiveNumberProps, type BranchPickerPrimitivePreviousProps, type BranchPickerPrimitiveRootProps, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, _default$7 as Composer, _default$6 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartState, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$5 as EditComposer, type EditComposerState, type EmptyContentPartComponent, type EmptyContentPartProps, type ExternalStoreAdapter, type ExternalStoreMessageConverter, ExternalStoreRuntime, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, type ReactThreadRuntime, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$4 as Thread, type ThreadActionsState, ThreadAssistantContentPart, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, type ThreadMessagesState, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, ThreadRuntime, type ThreadState, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps, type Unsubscribe, type UseActionBarCopyProps, _default$2 as UserActionBar, _default$3 as UserMessage, _default$1 as UserMessageAttachment, type UserMessageConfig, type UserMessageContentProps, WebSpeechSynthesisAdapter, fromCoreMessage, fromCoreMessages, fromLanguageModelMessages, fromLanguageModelTools, getExternalStoreMessage, makeAssistantTool, makeAssistantToolUI, streamUtils, subscribeToMainThread, toCoreMessage, toCoreMessages, toLanguageModelMessages, toLanguageModelTools, useActionBarCopy, useActionBarEdit, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantContext, useAssistantInstructions, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerSend, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessageContext, useMessageIf, useSwitchToNewThread, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadScrollToBottom, useThreadSuggestion };
package/dist/index.js CHANGED
@@ -373,7 +373,8 @@ var fromCoreMessages = (message) => {
373
373
  };
374
374
  var fromCoreMessage = (message, {
375
375
  id = generateId(),
376
- status = { type: "complete", reason: "unknown" }
376
+ status = { type: "complete", reason: "unknown" },
377
+ attachments = []
377
378
  } = {}) => {
378
379
  const commonProps = {
379
380
  id,
@@ -401,7 +402,7 @@ var fromCoreMessage = (message, {
401
402
  ...commonProps,
402
403
  role,
403
404
  content: message.content,
404
- attachments: []
405
+ attachments
405
406
  };
406
407
  case "system":
407
408
  return {
@@ -1218,20 +1219,16 @@ var LocalThreadRuntime = (_class6 = class {
1218
1219
  this.notifySubscribers();
1219
1220
  }
1220
1221
  async append(message) {
1221
- if (message.role !== "user")
1222
- throw new Error(
1223
- "Only appending user messages are supported in LocalRuntime. This is likely an internal bug in assistant-ui."
1224
- );
1225
- const userMessageId = generateId();
1226
- const userMessage = {
1227
- id: userMessageId,
1228
- role: "user",
1229
- content: message.content,
1230
- attachments: _nullishCoalesce(message.attachments, () => ( [])),
1231
- createdAt: /* @__PURE__ */ new Date()
1232
- };
1233
- this.repository.addOrUpdateMessage(message.parentId, userMessage);
1234
- await this.startRun(userMessageId);
1222
+ const newMessage = fromCoreMessage(message, {
1223
+ attachments: message.attachments
1224
+ });
1225
+ this.repository.addOrUpdateMessage(message.parentId, newMessage);
1226
+ if (message.role === "user") {
1227
+ await this.startRun(newMessage.id);
1228
+ } else {
1229
+ this.repository.resetHead(newMessage.id);
1230
+ this.notifySubscribers();
1231
+ }
1235
1232
  }
1236
1233
  async startRun(parentId) {
1237
1234
  this.repository.resetHead(parentId);
@@ -2506,11 +2503,8 @@ var useActionBarCopy = ({
2506
2503
  // src/primitive-hooks/actionBar/useActionBarEdit.tsx
2507
2504
 
2508
2505
  var useActionBarEdit = () => {
2509
- const { useMessage, useEditComposer } = useMessageContext();
2510
- const disabled = useCombinedStore(
2511
- [useMessage, useEditComposer],
2512
- (m, c) => m.message.role !== "user" || c.isEditing
2513
- );
2506
+ const { useEditComposer } = useMessageContext();
2507
+ const disabled = useEditComposer((c) => c.isEditing);
2514
2508
  const callback = _react.useCallback.call(void 0, () => {
2515
2509
  const { edit } = useEditComposer.getState();
2516
2510
  edit();
@@ -3233,6 +3227,8 @@ var getContentPartState = ({ message }, useContentPart, partIndex) => {
3233
3227
  } else {
3234
3228
  return null;
3235
3229
  }
3230
+ } else if (message.content.length === 1 && part.type === "text" && part.text.length === 0) {
3231
+ part = EMPTY_CONTENT;
3236
3232
  }
3237
3233
  const status = toContentPartStatus(message, partIndex, part);
3238
3234
  const currentState = _optionalChain([useContentPart, 'optionalAccess', _114 => _114.getState, 'call', _115 => _115()]);
@@ -3335,8 +3331,8 @@ var defaultComponents = {
3335
3331
  };
3336
3332
  var MessageContentPartComponent = ({
3337
3333
  components: {
3338
- Empty = defaultComponents.Text,
3339
3334
  Text: Text2 = defaultComponents.Text,
3335
+ Empty,
3340
3336
  Image: Image2 = defaultComponents.Image,
3341
3337
  UI = defaultComponents.UI,
3342
3338
  tools: { by_name = {}, Fallback: Fallback2 = void 0 } = {}
@@ -3352,7 +3348,9 @@ var MessageContentPartComponent = ({
3352
3348
  case "text":
3353
3349
  if (status.type === "requires-action")
3354
3350
  throw new Error("Encountered unexpected requires-action status");
3355
- if (part === EMPTY_CONTENT) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Empty, { part, status });
3351
+ if (part === EMPTY_CONTENT && !!Empty) {
3352
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Empty, { status });
3353
+ }
3356
3354
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text2, { part, status });
3357
3355
  case "image":
3358
3356
  if (status.type === "requires-action")
@@ -4055,19 +4053,11 @@ var useMessageContext2 = (messageIndex) => {
4055
4053
  const useEditComposer = makeEditComposerStore({
4056
4054
  onEdit: () => {
4057
4055
  const message = useMessage.getState().message;
4058
- if (message.role !== "user")
4059
- throw new Error(
4060
- "Tried to edit a non-user message. Editing is only supported for user messages. This is likely an internal bug in assistant-ui."
4061
- );
4062
4056
  const text = getThreadMessageText(message);
4063
4057
  return text;
4064
4058
  },
4065
4059
  onSend: (text) => {
4066
4060
  const { message, parentId } = useMessage.getState();
4067
- if (message.role !== "user")
4068
- throw new Error(
4069
- "Tried to edit a non-user message. Editing is only supported for user messages. This is likely an internal bug in assistant-ui."
4070
- );
4071
4061
  const previousText = getThreadMessageText(message);
4072
4062
  if (previousText === text) return;
4073
4063
  const nonTextParts = message.content.filter(
@@ -4075,7 +4065,7 @@ var useMessageContext2 = (messageIndex) => {
4075
4065
  );
4076
4066
  useThreadActions.getState().append({
4077
4067
  parentId,
4078
- role: "user",
4068
+ role: message.role,
4079
4069
  content: [{ type: "text", text }, ...nonTextParts],
4080
4070
  attachments: message.attachments
4081
4071
  });
@@ -4109,32 +4099,53 @@ var MessageProvider = ({
4109
4099
 
4110
4100
  // src/primitives/thread/ThreadMessages.tsx
4111
4101
 
4102
+ var isComponentsSame = (prev, next) => {
4103
+ return prev.Message === next.Message && prev.EditComposer === next.EditComposer && prev.UserEditComposer === next.UserEditComposer && prev.AssistantEditComposer === next.AssistantEditComposer && prev.SystemEditComposer === next.SystemEditComposer && prev.UserMessage === next.UserMessage && prev.AssistantMessage === next.AssistantMessage && prev.SystemMessage === next.SystemMessage;
4104
+ };
4112
4105
  var DEFAULT_SYSTEM_MESSAGE = () => null;
4113
- var getComponents = (components) => {
4114
- return {
4115
- EditComposer: _nullishCoalesce(_nullishCoalesce(components.EditComposer, () => ( components.UserMessage)), () => ( components.Message)),
4116
- UserMessage: _nullishCoalesce(components.UserMessage, () => ( components.Message)),
4117
- AssistantMessage: _nullishCoalesce(components.AssistantMessage, () => ( components.Message)),
4118
- SystemMessage: _nullishCoalesce(components.SystemMessage, () => ( DEFAULT_SYSTEM_MESSAGE))
4119
- };
4106
+ var getComponent3 = (components, role, isEditing) => {
4107
+ switch (role) {
4108
+ case "user":
4109
+ if (isEditing) {
4110
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(components.UserEditComposer, () => ( components.EditComposer)), () => ( components.UserMessage)), () => ( components.Message));
4111
+ } else {
4112
+ return _nullishCoalesce(components.UserMessage, () => ( components.Message));
4113
+ }
4114
+ case "assistant":
4115
+ if (isEditing) {
4116
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(components.AssistantEditComposer, () => ( components.EditComposer)), () => ( components.AssistantMessage)), () => ( components.Message));
4117
+ } else {
4118
+ return _nullishCoalesce(components.AssistantMessage, () => ( components.Message));
4119
+ }
4120
+ case "system":
4121
+ if (isEditing) {
4122
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(components.SystemEditComposer, () => ( components.EditComposer)), () => ( components.SystemMessage)), () => ( components.Message));
4123
+ } else {
4124
+ return _nullishCoalesce(components.SystemMessage, () => ( DEFAULT_SYSTEM_MESSAGE));
4125
+ }
4126
+ default:
4127
+ const _exhaustiveCheck = role;
4128
+ throw new Error(`Unknown message role: ${_exhaustiveCheck}`);
4129
+ }
4130
+ };
4131
+ var ThreadMessageComponent = ({
4132
+ components
4133
+ }) => {
4134
+ const { useMessage, useEditComposer } = useMessageContext();
4135
+ const role = useMessage((m) => m.message.role);
4136
+ const isEditing = useEditComposer((c) => c.isEditing);
4137
+ const Component = getComponent3(components, role, isEditing);
4138
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, {});
4120
4139
  };
4121
4140
  var ThreadMessageImpl = ({
4122
4141
  messageIndex,
4123
4142
  components
4124
4143
  }) => {
4125
- const { UserMessage: UserMessage2, EditComposer: EditComposer2, AssistantMessage: AssistantMessage2, SystemMessage: SystemMessage2 } = getComponents(components);
4126
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, MessageProvider, { messageIndex, children: [
4127
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, MessagePrimitiveIf, { user: true, children: [
4128
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ComposerPrimitiveIf, { editing: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserMessage2, {}) }),
4129
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ComposerPrimitiveIf, { editing: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EditComposer2, {}) })
4130
- ] }),
4131
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MessagePrimitiveIf, { assistant: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssistantMessage2, {}) }),
4132
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MessagePrimitiveIf, { system: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SystemMessage2, {}) })
4133
- ] });
4144
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MessageProvider, { messageIndex, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadMessageComponent, { components }) });
4134
4145
  };
4135
4146
  var ThreadMessage = _react.memo.call(void 0,
4136
4147
  ThreadMessageImpl,
4137
- (prev, next) => prev.messageIndex === next.messageIndex && prev.components.Message === next.components.Message && prev.components.UserMessage === next.components.UserMessage && prev.components.EditComposer === next.components.EditComposer && prev.components.AssistantMessage === next.components.AssistantMessage && prev.components.SystemMessage === next.components.SystemMessage
4148
+ (prev, next) => prev.messageIndex === next.messageIndex && isComponentsSame(prev.components, next.components)
4138
4149
  );
4139
4150
  var ThreadPrimitiveMessagesImpl = ({
4140
4151
  components
@@ -4147,7 +4158,7 @@ var ThreadPrimitiveMessagesImpl = ({
4147
4158
  ThreadPrimitiveMessagesImpl.displayName = "ThreadPrimitive.Messages";
4148
4159
  var ThreadPrimitiveMessages = _react.memo.call(void 0,
4149
4160
  ThreadPrimitiveMessagesImpl,
4150
- (prev, next) => _optionalChain([prev, 'access', _198 => _198.components, 'optionalAccess', _199 => _199.Message]) === _optionalChain([next, 'access', _200 => _200.components, 'optionalAccess', _201 => _201.Message]) && _optionalChain([prev, 'access', _202 => _202.components, 'optionalAccess', _203 => _203.UserMessage]) === _optionalChain([next, 'access', _204 => _204.components, 'optionalAccess', _205 => _205.UserMessage]) && _optionalChain([prev, 'access', _206 => _206.components, 'optionalAccess', _207 => _207.EditComposer]) === _optionalChain([next, 'access', _208 => _208.components, 'optionalAccess', _209 => _209.EditComposer]) && _optionalChain([prev, 'access', _210 => _210.components, 'optionalAccess', _211 => _211.AssistantMessage]) === _optionalChain([next, 'access', _212 => _212.components, 'optionalAccess', _213 => _213.AssistantMessage]) && _optionalChain([prev, 'access', _214 => _214.components, 'optionalAccess', _215 => _215.SystemMessage]) === _optionalChain([next, 'access', _216 => _216.components, 'optionalAccess', _217 => _217.SystemMessage])
4161
+ (prev, next) => isComponentsSame(prev.components, next.components)
4151
4162
  );
4152
4163
 
4153
4164
  // src/primitives/thread/ThreadScrollToBottom.tsx
@@ -4179,7 +4190,7 @@ var ThreadConfigProvider = ({
4179
4190
  }) => {
4180
4191
  const assistant = useAssistantContext({ optional: true });
4181
4192
  const configProvider = config && Object.keys(_nullishCoalesce(config, () => ( {}))).length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
4182
- if (!_optionalChain([config, 'optionalAccess', _218 => _218.runtime])) return configProvider;
4193
+ if (!_optionalChain([config, 'optionalAccess', _198 => _198.runtime])) return configProvider;
4183
4194
  if (assistant) {
4184
4195
  throw new Error(
4185
4196
  "You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
@@ -4452,7 +4463,7 @@ var AssistantMessageContent = _react.forwardRef.call(void 0, ({ components: comp
4452
4463
  {
4453
4464
  components: {
4454
4465
  ...componentsProp,
4455
- Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _219 => _219.Text]), () => ( components.Text)), () => ( content_part_default.Text)),
4466
+ Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _199 => _199.Text]), () => ( components.Text)), () => ( content_part_default.Text)),
4456
4467
  tools: toolsComponents
4457
4468
  }
4458
4469
  }
@@ -4597,7 +4608,7 @@ var ComposerAttachments = ({ components }) => {
4597
4608
  {
4598
4609
  components: {
4599
4610
  ...components,
4600
- Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _220 => _220.Attachment]), () => ( composer_attachment_default))
4611
+ Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _200 => _200.Attachment]), () => ( composer_attachment_default))
4601
4612
  }
4602
4613
  }
4603
4614
  ) });
@@ -4730,7 +4741,7 @@ var ThreadWelcomeSuggestion = ({
4730
4741
  };
4731
4742
  var ThreadWelcomeSuggestions = () => {
4732
4743
  const { welcome: { suggestions } = {} } = useThreadConfig();
4733
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([suggestions, 'optionalAccess', _221 => _221.map, 'call', _222 => _222((suggestion, idx) => {
4744
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([suggestions, 'optionalAccess', _201 => _201.map, 'call', _202 => _202((suggestion, idx) => {
4734
4745
  const key = `${suggestion.prompt}-${idx}`;
4735
4746
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestion, { suggestion }, key);
4736
4747
  })]) });
@@ -4831,7 +4842,7 @@ var UserMessageContent = _react.forwardRef.call(void 0,
4831
4842
  {
4832
4843
  components: {
4833
4844
  ...components,
4834
- Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _223 => _223.Text]), () => ( content_part_default.Text))
4845
+ Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _203 => _203.Text]), () => ( content_part_default.Text))
4835
4846
  }
4836
4847
  }
4837
4848
  ) });
@@ -4849,7 +4860,7 @@ var UserMessageAttachments = ({
4849
4860
  {
4850
4861
  components: {
4851
4862
  ...components,
4852
- Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _224 => _224.Attachment]), () => ( user_message_attachment_default))
4863
+ Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _204 => _204.Attachment]), () => ( user_message_attachment_default))
4853
4864
  }
4854
4865
  }
4855
4866
  ) }) });
@@ -4950,10 +4961,10 @@ var ThreadMessages = ({ components, ...rest }) => {
4950
4961
  thread_exports.Messages,
4951
4962
  {
4952
4963
  components: {
4953
- UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _225 => _225.UserMessage]), () => ( user_message_default)),
4954
- EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _226 => _226.EditComposer]), () => ( edit_composer_default)),
4955
- AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _227 => _227.AssistantMessage]), () => ( assistant_message_default)),
4956
- SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _228 => _228.SystemMessage]), () => ( SystemMessage))
4964
+ UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _205 => _205.UserMessage]), () => ( user_message_default)),
4965
+ EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _206 => _206.EditComposer]), () => ( edit_composer_default)),
4966
+ AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _207 => _207.AssistantMessage]), () => ( assistant_message_default)),
4967
+ SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _208 => _208.SystemMessage]), () => ( SystemMessage))
4957
4968
  },
4958
4969
  ...rest
4959
4970
  }