@assistant-ui/react 0.5.46 → 0.5.48

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
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, A as AppendMessage, i as Tool, j as CoreToolCallContentPart, k as CreateEdgeRuntimeAPIOptions } from './edge-6dYzFCV5.mjs';
4
- export { q as CoreAssistantContentPart, t as CoreAssistantMessage, r as CoreSystemMessage, p as CoreUserContentPart, s as CoreUserMessage, E as EdgeRuntimeRequestOptions, n as ThreadAssistantMessage, m as ThreadSystemMessage, l as ThreadUserContentPart, o as ThreadUserMessage } from './edge-6dYzFCV5.mjs';
3
+ import { T as TextContentPart, C as ContentPartStatus, I as ImageContentPart, U as UIContentPart, a as ToolCallContentPart, b as ToolCallContentPartStatus, c as ThreadAssistantContentPart, M as MessageStatus, d as ThreadRoundtrip, e as ThreadMessage, f as ModelConfig, g as ModelConfigProvider, h as CoreMessage, i as ThreadComposerAttachment, j as MessageAttachment, A as AppendMessage, k as Tool, l as CoreToolCallContentPart, m as CreateEdgeRuntimeAPIOptions } from './edge-Dwfu6YTG.mjs';
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-Dwfu6YTG.mjs';
5
5
  import { UseBoundStore, StoreApi } from 'zustand';
6
6
  import { Primitive } from '@radix-ui/react-primitive';
7
7
  import * as PopoverPrimitive from '@radix-ui/react-popover';
@@ -16,6 +16,28 @@ import 'zod';
16
16
 
17
17
  type Unsubscribe = () => void;
18
18
 
19
+ type TextContentPartProps = {
20
+ part: TextContentPart;
21
+ status: ContentPartStatus;
22
+ };
23
+ type TextContentPartComponent = ComponentType<TextContentPartProps>;
24
+ type ImageContentPartProps = {
25
+ part: ImageContentPart;
26
+ status: ContentPartStatus;
27
+ };
28
+ type ImageContentPartComponent = ComponentType<ImageContentPartProps>;
29
+ type UIContentPartProps = {
30
+ part: UIContentPart;
31
+ status: ContentPartStatus;
32
+ };
33
+ type UIContentPartComponent = ComponentType<UIContentPartProps>;
34
+ type ToolCallContentPartProps<TArgs extends Record<string, unknown> = any, TResult = unknown> = {
35
+ part: ToolCallContentPart<TArgs, TResult>;
36
+ status: ToolCallContentPartStatus;
37
+ addResult: (result: any) => void;
38
+ };
39
+ type ToolCallContentPartComponent<TArgs extends Record<string, unknown> = any, TResult = any> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>;
40
+
19
41
  type ReadonlyStore<T> = UseBoundStore<Omit<StoreApi<T>, "setState" | "destroy">>;
20
42
 
21
43
  type ReactThreadRuntime = ThreadRuntime & {
@@ -61,28 +83,6 @@ declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRu
61
83
  private subscriptionHandler;
62
84
  }
63
85
 
64
- type TextContentPartProps = {
65
- part: TextContentPart;
66
- status: ContentPartStatus;
67
- };
68
- type TextContentPartComponent = ComponentType<TextContentPartProps>;
69
- type ImageContentPartProps = {
70
- part: ImageContentPart;
71
- status: ContentPartStatus;
72
- };
73
- type ImageContentPartComponent = ComponentType<ImageContentPartProps>;
74
- type UIContentPartProps = {
75
- part: UIContentPart;
76
- status: ContentPartStatus;
77
- };
78
- type UIContentPartComponent = ComponentType<UIContentPartProps>;
79
- type ToolCallContentPartProps<TArgs extends Record<string, unknown> = any, TResult = unknown> = {
80
- part: ToolCallContentPart<TArgs, TResult>;
81
- status: ToolCallContentPartStatus;
82
- addResult: (result: any) => void;
83
- };
84
- type ToolCallContentPartComponent<TArgs extends Record<string, unknown> = any, TResult = any> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>;
85
-
86
86
  interface ExportedMessageRepository {
87
87
  headId?: string | null;
88
88
  messages: Array<{
@@ -110,6 +110,37 @@ declare class MessageRepository {
110
110
  import({ headId, messages }: ExportedMessageRepository): void;
111
111
  }
112
112
 
113
+ type AttachmentAdapter = {
114
+ accept: string;
115
+ add(state: {
116
+ file: File;
117
+ }): Promise<ThreadComposerAttachment>;
118
+ remove(attachment: ThreadComposerAttachment): Promise<void>;
119
+ send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
120
+ };
121
+
122
+ declare class ThreadRuntimeComposer implements ThreadRuntime.Composer {
123
+ private runtime;
124
+ private notifySubscribers;
125
+ private _attachmentAdapter?;
126
+ attachmentAccept: string;
127
+ get isEmpty(): boolean;
128
+ constructor(runtime: {
129
+ messages: ThreadRuntime["messages"];
130
+ append: (message: AppendMessage) => void;
131
+ }, notifySubscribers: () => void);
132
+ setAttachmentAdapter(adapter: AttachmentAdapter | undefined): boolean;
133
+ private _attachments;
134
+ get attachments(): ThreadComposerAttachment[];
135
+ addAttachment(file: File): Promise<void>;
136
+ removeAttachment(attachmentId: string): Promise<void>;
137
+ private _text;
138
+ get text(): string;
139
+ setText(value: string): void;
140
+ reset(): void;
141
+ send(): Promise<void>;
142
+ }
143
+
113
144
  declare namespace SpeechSynthesisAdapter {
114
145
  type Status = {
115
146
  type: "starting" | "running";
@@ -132,6 +163,7 @@ type LocalRuntimeOptions = {
132
163
  initialMessages?: readonly CoreMessage[] | undefined;
133
164
  maxToolRoundtrips?: number | undefined;
134
165
  adapters?: {
166
+ attachments?: AttachmentAdapter | undefined;
135
167
  speech?: SpeechSynthesisAdapter | undefined;
136
168
  } | undefined;
137
169
  };
@@ -153,14 +185,12 @@ declare class LocalThreadRuntime implements ThreadRuntime {
153
185
  cancel: boolean;
154
186
  unstable_copy: boolean;
155
187
  speak: boolean;
188
+ attachments: boolean;
156
189
  };
157
190
  readonly threadId: string;
158
191
  readonly isDisabled = false;
159
192
  get messages(): ThreadMessage[];
160
- readonly composer: {
161
- text: string;
162
- setText: (value: string) => void;
163
- };
193
+ readonly composer: ThreadRuntimeComposer;
164
194
  constructor(configProvider: ModelConfigProvider, adapter: ChatModelAdapter, { initialMessages, ...options }: LocalRuntimeOptions);
165
195
  private _options;
166
196
  get options(): LocalRuntimeOptions;
@@ -252,12 +282,42 @@ declare class EdgeChatAdapter implements ChatModelAdapter {
252
282
  type EdgeRuntimeOptions = EdgeChatAdapterOptions & LocalRuntimeOptions;
253
283
  declare const useEdgeRuntime: ({ initialMessages, maxToolRoundtrips, adapters, ...options }: EdgeRuntimeOptions) => LocalRuntime;
254
284
 
285
+ declare class SimpleImageAttachmentAdapter implements AttachmentAdapter {
286
+ accept: string;
287
+ add(state: {
288
+ file: File;
289
+ }): Promise<ThreadComposerAttachment>;
290
+ send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
291
+ remove(): Promise<void>;
292
+ }
293
+
294
+ declare class SimpleTextAttachmentAdapter implements AttachmentAdapter {
295
+ accept: string;
296
+ add(state: {
297
+ file: File;
298
+ }): Promise<ThreadComposerAttachment>;
299
+ send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
300
+ remove(): Promise<void>;
301
+ }
302
+
303
+ declare class CompositeAttachmentAdapter implements AttachmentAdapter {
304
+ private _adapters;
305
+ accept: string;
306
+ constructor(adapters: AttachmentAdapter[]);
307
+ add(state: {
308
+ file: File;
309
+ }): Promise<ThreadComposerAttachment>;
310
+ send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
311
+ remove(attachment: ThreadComposerAttachment): Promise<void>;
312
+ }
313
+
255
314
  type ThreadMessageLike = {
256
315
  role: "assistant" | "user" | "system";
257
316
  content: string | (TextContentPart | ImageContentPart | ToolCallContentPart<any, any> | CoreToolCallContentPart<any, any> | UIContentPart)[];
258
317
  id?: string | undefined;
259
318
  createdAt?: Date | undefined;
260
319
  status?: MessageStatus | undefined;
320
+ attachments?: MessageAttachment[] | undefined;
261
321
  };
262
322
 
263
323
  type ExternalStoreMessageConverter<T> = (message: T, idx: number) => ThreadMessageLike;
@@ -279,6 +339,9 @@ type ExternalStoreAdapterBase<T> = {
279
339
  onSwitchThread?: ((threadId: string | null) => Promise<void> | void) | undefined;
280
340
  onSpeak?: ((message: ThreadMessage) => SpeechSynthesisAdapter.Utterance) | undefined;
281
341
  convertMessage?: ExternalStoreMessageConverter<T> | undefined;
342
+ adapters?: {
343
+ attachments?: AttachmentAdapter | undefined;
344
+ };
282
345
  unstable_capabilities?: {
283
346
  copy?: boolean | undefined;
284
347
  } | undefined;
@@ -346,13 +409,15 @@ type internal_MessageRepository = MessageRepository;
346
409
  declare const internal_MessageRepository: typeof MessageRepository;
347
410
  type internal_ProxyConfigProvider = ProxyConfigProvider;
348
411
  declare const internal_ProxyConfigProvider: typeof ProxyConfigProvider;
412
+ type internal_ThreadRuntimeComposer = ThreadRuntimeComposer;
413
+ declare const internal_ThreadRuntimeComposer: typeof ThreadRuntimeComposer;
349
414
  declare const internal_TooltipIconButton: typeof TooltipIconButton;
350
415
  declare const internal_generateId: typeof generateId;
351
416
  declare const internal_useSmooth: typeof useSmooth;
352
417
  declare const internal_useSmoothStatus: typeof useSmoothStatus;
353
418
  declare const internal_withSmoothContextProvider: typeof withSmoothContextProvider;
354
419
  declare namespace internal {
355
- export { internal_BaseAssistantRuntime as BaseAssistantRuntime, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
420
+ export { internal_BaseAssistantRuntime as BaseAssistantRuntime, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_ThreadRuntimeComposer as ThreadRuntimeComposer, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
356
421
  }
357
422
 
358
423
  type ConverterCallback<TIn> = (cache: ThreadMessage | undefined, message: TIn, idx: number) => ThreadMessage;
@@ -372,10 +437,7 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
372
437
  isDisabled: boolean;
373
438
  converter: ThreadMessageConverter;
374
439
  private _store;
375
- readonly composer: {
376
- text: string;
377
- setText: (value: string) => void;
378
- };
440
+ readonly composer: ThreadRuntimeComposer;
379
441
  constructor(store: ExternalStoreAdapter<any>);
380
442
  get store(): ExternalStoreAdapter<any>;
381
443
  set store(store: ExternalStoreAdapter<any>);
@@ -440,6 +502,7 @@ type RuntimeCapabilities = {
440
502
  cancel: boolean;
441
503
  unstable_copy: boolean;
442
504
  speak: boolean;
505
+ attachments: boolean;
443
506
  };
444
507
 
445
508
  type AddToolResultOptions = {
@@ -468,8 +531,15 @@ type ThreadRuntime = ThreadActionsState & Readonly<{
468
531
  }>;
469
532
  declare namespace ThreadRuntime {
470
533
  type Composer = Readonly<{
534
+ attachmentAccept: string;
535
+ attachments: ThreadComposerAttachment[];
536
+ addAttachment: (file: File) => Promise<void>;
537
+ removeAttachment: (attachmentId: string) => Promise<void>;
538
+ isEmpty: boolean;
471
539
  text: string;
472
540
  setText: (value: string) => void;
541
+ reset: () => void;
542
+ send: () => void;
473
543
  }>;
474
544
  }
475
545
 
@@ -542,6 +612,7 @@ type EditComposerState = Readonly<{
542
612
  setText: (value: string) => void;
543
613
  canCancel: boolean;
544
614
  isEditing: boolean;
615
+ isEmpty: boolean;
545
616
  edit: () => void;
546
617
  send: () => void;
547
618
  cancel: () => void;
@@ -593,10 +664,15 @@ type ComposerState = Readonly<{
593
664
  value: string;
594
665
  /** @deprecated Use `setText` instead. */
595
666
  setValue: (value: string) => void;
667
+ attachments: readonly ThreadComposerAttachment[];
668
+ addAttachment: (file: File) => void;
669
+ removeAttachment: (attachmentId: string) => void;
596
670
  text: string;
597
671
  setText: (value: string) => void;
672
+ reset: () => void;
598
673
  canCancel: boolean;
599
674
  isEditing: true;
675
+ isEmpty: boolean;
600
676
  send: () => void;
601
677
  cancel: () => void;
602
678
  focus: () => void;
@@ -607,6 +683,7 @@ type CreateAppendMessage = string | {
607
683
  parentId?: string | null | undefined;
608
684
  role?: AppendMessage["role"] | undefined;
609
685
  content: AppendMessage["content"];
686
+ attachments?: AppendMessage["attachments"] | undefined;
610
687
  };
611
688
  declare const useAppendMessage: () => (message: CreateAppendMessage) => void;
612
689
 
@@ -671,6 +748,8 @@ declare const useComposerIf: (props: UseComposerIfProps) => boolean;
671
748
 
672
749
  declare const useComposerSend: () => (() => void) | null;
673
750
 
751
+ declare const useComposerAddAttachment: () => (() => void) | null;
752
+
674
753
  declare const useContentPartDisplay: () => Readonly<{
675
754
  status: ContentPartStatus;
676
755
  part: UIContentPart;
@@ -694,6 +773,7 @@ type MessageIfFilters = {
694
773
  copied: boolean | undefined;
695
774
  lastOrHover: boolean | undefined;
696
775
  speaking: boolean | undefined;
776
+ hasAttachments: boolean | undefined;
697
777
  };
698
778
  type UseMessageIfProps = RequireAtLeastOne<MessageIfFilters>;
699
779
  declare const useMessageIf: (props: UseMessageIfProps) => boolean;
@@ -731,8 +811,8 @@ declare const ActionBarPrimitiveRoot: react.ForwardRefExoticComponent<Omit<Omit<
731
811
  asChild?: boolean;
732
812
  }, "ref"> & UseActionBarFloatStatusProps & react.RefAttributes<HTMLDivElement>>;
733
813
 
734
- type PrimitiveButtonProps$1 = ComponentPropsWithoutRef<typeof Primitive.button>;
735
- type ActionButtonProps<THook> = PrimitiveButtonProps$1 & (THook extends (props: infer TProps) => unknown ? TProps : never);
814
+ type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
815
+ type ActionButtonProps<THook> = PrimitiveButtonProps & (THook extends (props: infer TProps) => unknown ? TProps : never);
736
816
 
737
817
  type ActionBarPrimitiveCopyProps = ActionButtonProps<typeof useActionBarCopy>;
738
818
  declare const ActionBarPrimitiveCopy: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
@@ -843,8 +923,7 @@ declare const ComposerPrimitiveInput: react.ForwardRefExoticComponent<TextareaAu
843
923
  asChild?: boolean | undefined;
844
924
  } & react.RefAttributes<HTMLTextAreaElement>>;
845
925
 
846
- type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
847
- type ComposerPrimitiveSendProps = PrimitiveButtonProps;
926
+ type ComposerPrimitiveSendProps = ActionButtonProps<typeof useComposerSend>;
848
927
  declare const ComposerPrimitiveSend: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
849
928
  ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
850
929
  } & {
@@ -858,11 +937,27 @@ declare const ComposerPrimitiveCancel: react.ForwardRefExoticComponent<Omit<Omit
858
937
  asChild?: boolean;
859
938
  }, "ref"> & react.RefAttributes<HTMLButtonElement>>;
860
939
 
940
+ declare const ComposerPrimitiveAddAttachment: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
941
+ ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
942
+ } & {
943
+ asChild?: boolean;
944
+ }, "ref"> & react.RefAttributes<HTMLButtonElement>>;
945
+
946
+ type ComposerPrimitiveAttachmentsProps = {
947
+ components: {
948
+ Image?: ComponentType | undefined;
949
+ Document?: ComponentType | undefined;
950
+ File?: ComponentType | undefined;
951
+ Attachment?: ComponentType | undefined;
952
+ } | undefined;
953
+ };
954
+ declare const ComposerPrimitiveAttachments: FC<ComposerPrimitiveAttachmentsProps>;
955
+
861
956
  type ComposerPrimitiveIfProps = PropsWithChildren<UseComposerIfProps>;
862
957
  declare const ComposerPrimitiveIf: FC<ComposerPrimitiveIfProps>;
863
958
 
864
959
  declare namespace index$3 {
865
- export { ComposerPrimitiveCancel as Cancel, ComposerPrimitiveIf as If, ComposerPrimitiveInput as Input, ComposerPrimitiveRoot as Root, ComposerPrimitiveSend as Send };
960
+ export { ComposerPrimitiveAddAttachment as AddAttachment, ComposerPrimitiveAttachments as Attachments, ComposerPrimitiveCancel as Cancel, ComposerPrimitiveIf as If, ComposerPrimitiveInput as Input, ComposerPrimitiveRoot as Root, ComposerPrimitiveSend as Send };
866
961
  }
867
962
 
868
963
  type PrimitiveSpanProps$1 = ComponentPropsWithoutRef<typeof Primitive.span>;
@@ -929,8 +1024,18 @@ type MessagePrimitiveInProgressProps = PrimitiveSpanProps;
929
1024
  */
930
1025
  declare const MessagePrimitiveInProgress: FC<MessagePrimitiveInProgressProps>;
931
1026
 
1027
+ type MessagePrimitiveAttachmentsProps = {
1028
+ components: {
1029
+ Image?: ComponentType | undefined;
1030
+ Document?: ComponentType | undefined;
1031
+ File?: ComponentType | undefined;
1032
+ Attachment?: ComponentType | undefined;
1033
+ } | undefined;
1034
+ };
1035
+ declare const MessagePrimitiveAttachments: FC<MessagePrimitiveAttachmentsProps>;
1036
+
932
1037
  declare namespace index$1 {
933
- export { MessagePrimitiveContent as Content, MessagePrimitiveIf as If, MessagePrimitiveInProgress as InProgress, MessagePrimitiveRoot as Root };
1038
+ export { MessagePrimitiveAttachments as Attachments, MessagePrimitiveContent as Content, MessagePrimitiveIf as If, MessagePrimitiveInProgress as InProgress, MessagePrimitiveRoot as Root };
934
1039
  }
935
1040
 
936
1041
  type PrimitiveDivProps$1 = ComponentPropsWithoutRef<typeof Primitive.div>;
@@ -1025,6 +1130,9 @@ type AssistantMessageConfig = {
1025
1130
  type BranchPickerConfig = {
1026
1131
  allowBranchPicker?: boolean | undefined;
1027
1132
  };
1133
+ type ComposerConfig = {
1134
+ allowAttachments?: boolean | undefined;
1135
+ };
1028
1136
  type StringsConfig = {
1029
1137
  assistantModal?: {
1030
1138
  open: {
@@ -1077,6 +1185,12 @@ type StringsConfig = {
1077
1185
  cancel?: {
1078
1186
  tooltip?: string | undefined;
1079
1187
  } | undefined;
1188
+ addAttachment?: {
1189
+ tooltip?: string | undefined;
1190
+ } | undefined;
1191
+ removeAttachment?: {
1192
+ tooltip?: string | undefined;
1193
+ };
1080
1194
  input?: {
1081
1195
  placeholder?: string | undefined;
1082
1196
  };
@@ -1104,6 +1218,7 @@ type ThreadConfig = {
1104
1218
  assistantMessage?: AssistantMessageConfig;
1105
1219
  userMessage?: UserMessageConfig;
1106
1220
  branchPicker?: BranchPickerConfig;
1221
+ composer?: ComposerConfig;
1107
1222
  strings?: StringsConfig;
1108
1223
  tools?: AssistantToolUI[];
1109
1224
  };
@@ -1114,7 +1229,7 @@ type ThreadConfigProviderProps = PropsWithChildren<{
1114
1229
  declare const ThreadConfigProvider: FC<ThreadConfigProviderProps>;
1115
1230
 
1116
1231
  declare const AssistantActionBar: FC;
1117
- declare const exports$a: {
1232
+ declare const exports$c: {
1118
1233
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1119
1234
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
1120
1235
  } & {
@@ -1126,11 +1241,11 @@ declare const exports$a: {
1126
1241
  StopSpeaking: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1127
1242
  SpeechControl: FC;
1128
1243
  };
1129
- declare const _default$9: typeof AssistantActionBar & typeof exports$a;
1244
+ declare const _default$b: typeof AssistantActionBar & typeof exports$c;
1130
1245
 
1131
1246
  declare const AssistantMessage: FC;
1132
1247
  type AssistantMessageContentProps = MessagePrimitiveContentProps & ComponentPropsWithoutRef<"div">;
1133
- declare const exports$9: {
1248
+ declare const exports$b: {
1134
1249
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1135
1250
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
1136
1251
  } & {
@@ -1139,13 +1254,13 @@ declare const exports$9: {
1139
1254
  Avatar: FC;
1140
1255
  Content: react.ForwardRefExoticComponent<MessagePrimitiveContentProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
1141
1256
  };
1142
- declare const _default$8: typeof AssistantMessage & typeof exports$9;
1257
+ declare const _default$a: typeof AssistantMessage & typeof exports$b;
1143
1258
 
1144
1259
  declare const AssistantModal: FC<ThreadConfig>;
1145
1260
  type AssistantModalButtonProps = TooltipIconButtonProps & {
1146
1261
  "data-state"?: "open" | "closed";
1147
1262
  };
1148
- declare const exports$8: {
1263
+ declare const exports$a: {
1149
1264
  Root: FC<PopoverPrimitive.PopoverProps & {
1150
1265
  config?: ThreadConfig | undefined;
1151
1266
  } & {
@@ -1158,10 +1273,10 @@ declare const exports$8: {
1158
1273
  Button: react.ForwardRefExoticComponent<Partial<AssistantModalButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1159
1274
  Anchor: react.ForwardRefExoticComponent<Partial<Omit<Omit<PopoverPrimitive.PopoverAnchorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
1160
1275
  };
1161
- declare const _default$7: typeof AssistantModal & typeof exports$8;
1276
+ declare const _default$9: typeof AssistantModal & typeof exports$a;
1162
1277
 
1163
1278
  declare const BranchPicker: FC;
1164
- declare const exports$7: {
1279
+ declare const exports$9: {
1165
1280
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1166
1281
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
1167
1282
  } & {
@@ -1172,14 +1287,14 @@ declare const exports$7: {
1172
1287
  Previous: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1173
1288
  Next: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1174
1289
  };
1175
- declare const _default$6: typeof BranchPicker & typeof exports$7;
1290
+ declare const _default$8: typeof BranchPicker & typeof exports$9;
1176
1291
 
1177
1292
  declare const Composer: FC;
1178
1293
  declare const ComposerInputStyled: react.ForwardRefExoticComponent<Partial<Omit<react_textarea_autosize.TextareaAutosizeProps & {
1179
1294
  asChild?: boolean | undefined;
1180
1295
  } & react.RefAttributes<HTMLTextAreaElement>, "ref">> & react.RefAttributes<HTMLTextAreaElement>>;
1181
1296
  type ComposerInputProps = ComponentPropsWithoutRef<typeof ComposerInputStyled>;
1182
- declare const exports$6: {
1297
+ declare const exports$8: {
1183
1298
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
1184
1299
  ref?: ((instance: HTMLFormElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLFormElement> | null | undefined;
1185
1300
  } & {
@@ -1191,11 +1306,20 @@ declare const exports$6: {
1191
1306
  Action: FC;
1192
1307
  Send: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1193
1308
  Cancel: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1309
+ AddAttachment: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1310
+ Attachments: FC<Partial<ComposerPrimitiveAttachmentsProps>>;
1311
+ };
1312
+ declare const _default$7: typeof Composer & typeof exports$8;
1313
+
1314
+ declare const ComposerAttachment: FC;
1315
+ declare const exports$7: {
1316
+ Root: react.ForwardRefExoticComponent<Partial<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
1317
+ Remove: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1194
1318
  };
1195
- declare const _default$5: typeof Composer & typeof exports$6;
1319
+ declare const _default$6: typeof ComposerAttachment & typeof exports$7;
1196
1320
 
1197
1321
  declare const EditComposer: FC;
1198
- declare const exports$5: {
1322
+ declare const exports$6: {
1199
1323
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
1200
1324
  ref?: ((instance: HTMLFormElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLFormElement> | null | undefined;
1201
1325
  } & {
@@ -1208,11 +1332,11 @@ declare const exports$5: {
1208
1332
  Cancel: react.ForwardRefExoticComponent<Partial<ButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1209
1333
  Send: react.ForwardRefExoticComponent<Partial<ButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1210
1334
  };
1211
- declare const _default$4: typeof EditComposer & typeof exports$5;
1335
+ declare const _default$5: typeof EditComposer & typeof exports$6;
1212
1336
 
1213
1337
  declare const Thread: FC<ThreadConfig>;
1214
1338
  type ThreadRootProps = ThreadPrimitiveRootProps & ThreadConfigProviderProps;
1215
- declare const exports$4: {
1339
+ declare const exports$5: {
1216
1340
  Root: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1217
1341
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
1218
1342
  } & {
@@ -1238,22 +1362,23 @@ declare const exports$4: {
1238
1362
  ScrollToBottom: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1239
1363
  ViewportFooter: react.ForwardRefExoticComponent<Partial<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
1240
1364
  };
1241
- declare const _default$3: typeof Thread & typeof exports$4;
1365
+ declare const _default$4: typeof Thread & typeof exports$5;
1242
1366
 
1243
1367
  declare const UserMessage: FC;
1244
1368
  type UserMessageContentProps = MessagePrimitiveContentProps & ComponentPropsWithoutRef<"div">;
1245
- declare const exports$3: {
1369
+ declare const exports$4: {
1246
1370
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1247
1371
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
1248
1372
  } & {
1249
1373
  asChild?: boolean;
1250
1374
  }, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
1251
1375
  Content: react.ForwardRefExoticComponent<MessagePrimitiveContentProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
1376
+ Attachments: FC<Partial<MessagePrimitiveAttachmentsProps>>;
1252
1377
  };
1253
- declare const _default$2: typeof UserMessage & typeof exports$3;
1378
+ declare const _default$3: typeof UserMessage & typeof exports$4;
1254
1379
 
1255
1380
  declare const UserActionBar: FC;
1256
- declare const exports$2: {
1381
+ declare const exports$3: {
1257
1382
  Root: react.ForwardRefExoticComponent<Partial<Omit<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1258
1383
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
1259
1384
  } & {
@@ -1261,7 +1386,13 @@ declare const exports$2: {
1261
1386
  }, "ref"> & UseActionBarFloatStatusProps & react.RefAttributes<HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
1262
1387
  Edit: react.ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & react.RefAttributes<HTMLButtonElement>>;
1263
1388
  };
1264
- declare const _default$1: typeof UserActionBar & typeof exports$2;
1389
+ declare const _default$2: typeof UserActionBar & typeof exports$3;
1390
+
1391
+ declare const UserMessageAttachment: FC;
1392
+ declare const exports$2: {
1393
+ Root: react.ForwardRefExoticComponent<Partial<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & react.RefAttributes<HTMLDivElement>>;
1394
+ };
1395
+ declare const _default$1: typeof UserMessageAttachment & typeof exports$2;
1265
1396
 
1266
1397
  declare const ThreadWelcome: FC;
1267
1398
  declare const ThreadWelcomeMessageStyled: react.ForwardRefExoticComponent<Partial<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">> & react.RefAttributes<HTMLParagraphElement>>;
@@ -1287,4 +1418,4 @@ declare const exports: {
1287
1418
  Text: FC;
1288
1419
  };
1289
1420
 
1290
- export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$9 as AssistantActionBar, type AssistantActionsState, type AssistantContextValue, _default$8 as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$7 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, _default$6 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$5 as Composer, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerState, 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$4 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, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, _default$3 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$1 as UserActionBar, _default$2 as UserMessage, 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, useComposerCancel, useComposerContext, useComposerIf, useComposerSend, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessageContext, useMessageIf, useSwitchToNewThread, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadScrollToBottom, useThreadSuggestion };
1421
+ 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, _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 };