@assistant-ui/react 0.5.67 → 0.5.68

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as ThreadComposerAttachment, a as ThreadMessage, C as CoreMessage, A as AppendMessage, M as ModelConfig, b as ModelConfigProvider, c as ThreadAssistantContentPart, d as MessageStatus, e as ThreadRoundtrip, f as MessageAttachment, g as Tool, h as TextContentPart, I as ImageContentPart, i as ToolCallContentPart, j as CoreToolCallContentPart, U as UIContentPart, k as CreateEdgeRuntimeAPIOptions, l as ThreadUserContentPart, m as ContentPartStatus, n as ToolCallContentPartStatus } from './edge-BDAlTCC1.js';
2
- 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, q as ThreadUserMessage } from './edge-BDAlTCC1.js';
1
+ import { A as Attachment, P as PendingAttachment, T as ThreadMessage, C as CoreMessage, a as AppendMessage, M as ModelConfig, b as ModelConfigProvider, c as ThreadAssistantContentPart, d as MessageStatus, e as ThreadRoundtrip, f as PendingAttachmentStatus, g as CompleteAttachment, h as CompleteAttachmentStatus, i as Tool, j as TextContentPart, I as ImageContentPart, k as ToolCallContentPart, l as CoreToolCallContentPart, U as UIContentPart, m as CreateEdgeRuntimeAPIOptions, n as ThreadUserContentPart, o as ContentPartStatus, p as ToolCallContentPartStatus } from './edge-BhYWMe-K.js';
2
+ export { q as AttachmentStatus, v as CoreAssistantContentPart, y as CoreAssistantMessage, w as CoreSystemMessage, u as CoreUserContentPart, x as CoreUserMessage, E as EdgeRuntimeRequestOptions, s as ThreadAssistantMessage, r as ThreadSystemMessage, t as ThreadUserMessage } from './edge-BhYWMe-K.js';
3
3
  import * as react from 'react';
4
4
  import { ComponentType, PropsWithChildren, FC, ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
5
5
  import { StoreApi, UseBoundStore } from 'zustand';
@@ -16,7 +16,7 @@ import 'zod';
16
16
 
17
17
  type ComposerRuntimeCore = Readonly<{
18
18
  attachmentAccept: string;
19
- attachments: readonly ThreadComposerAttachment[];
19
+ attachments: readonly Attachment[];
20
20
  addAttachment: (file: File) => Promise<void>;
21
21
  removeAttachment: (attachmentId: string) => Promise<void>;
22
22
  isEditing: boolean;
@@ -32,6 +32,9 @@ type ComposerRuntimeCore = Readonly<{
32
32
  cancel: () => void;
33
33
  subscribe: (callback: () => void) => Unsubscribe;
34
34
  }>;
35
+ type ThreadComposerRuntimeCore = ComposerRuntimeCore & Readonly<{
36
+ attachments: readonly PendingAttachment[];
37
+ }>;
35
38
 
36
39
  type Unsubscribe = () => void;
37
40
 
@@ -114,7 +117,7 @@ type ThreadRuntimeCore = Readonly<{
114
117
  speak: (messageId: string) => SpeechSynthesisAdapter.Utterance;
115
118
  submitFeedback: (feedback: SubmitFeedbackOptions) => void;
116
119
  getModelConfig: () => ModelConfig;
117
- composer: ComposerRuntimeCore;
120
+ composer: ThreadComposerRuntimeCore;
118
121
  getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;
119
122
  beginEdit: (messageId: string) => void;
120
123
  capabilities: Readonly<RuntimeCapabilities>;
@@ -168,11 +171,7 @@ type ChatModelAdapter = {
168
171
  run: (options: ChatModelRunOptions) => Promise<ChatModelRunResult> | AsyncGenerator<ChatModelRunResult, void>;
169
172
  };
170
173
 
171
- type ReactThreadRuntimeCore = ThreadRuntimeCore & {
172
- unstable_synchronizer?: ComponentType;
173
- };
174
-
175
- declare abstract class BaseAssistantRuntimeCore<TThreadRuntime extends ReactThreadRuntimeCore> implements AssistantRuntimeCore {
174
+ declare abstract class BaseAssistantRuntimeCore<TThreadRuntime extends ThreadRuntimeCore> implements AssistantRuntimeCore {
176
175
  private _thread;
177
176
  constructor(_thread: TThreadRuntime);
178
177
  get thread(): TThreadRuntime;
@@ -189,17 +188,21 @@ type AttachmentAdapter = {
189
188
  accept: string;
190
189
  add(state: {
191
190
  file: File;
192
- }): Promise<ThreadComposerAttachment>;
193
- remove(attachment: ThreadComposerAttachment): Promise<void>;
194
- send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
191
+ }): Promise<Omit<PendingAttachment, "status"> & {
192
+ status?: PendingAttachmentStatus;
193
+ }>;
194
+ remove(attachment: Attachment): Promise<void>;
195
+ send(attachment: PendingAttachment): Promise<Omit<CompleteAttachment, "status"> & {
196
+ status?: CompleteAttachmentStatus;
197
+ }>;
195
198
  };
196
199
 
197
200
  declare class SimpleImageAttachmentAdapter implements AttachmentAdapter {
198
201
  accept: string;
199
202
  add(state: {
200
203
  file: File;
201
- }): Promise<ThreadComposerAttachment>;
202
- send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
204
+ }): Promise<PendingAttachment>;
205
+ send(attachment: PendingAttachment): Promise<CompleteAttachment>;
203
206
  remove(): Promise<void>;
204
207
  }
205
208
 
@@ -207,8 +210,8 @@ declare class SimpleTextAttachmentAdapter implements AttachmentAdapter {
207
210
  accept: string;
208
211
  add(state: {
209
212
  file: File;
210
- }): Promise<ThreadComposerAttachment>;
211
- send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
213
+ }): Promise<PendingAttachment>;
214
+ send(attachment: PendingAttachment): Promise<CompleteAttachment>;
212
215
  remove(): Promise<void>;
213
216
  }
214
217
 
@@ -218,17 +221,21 @@ declare class CompositeAttachmentAdapter implements AttachmentAdapter {
218
221
  constructor(adapters: AttachmentAdapter[]);
219
222
  add(state: {
220
223
  file: File;
221
- }): Promise<ThreadComposerAttachment>;
222
- send(attachment: ThreadComposerAttachment): Promise<MessageAttachment>;
223
- remove(attachment: ThreadComposerAttachment): Promise<void>;
224
+ }): Promise<Omit<PendingAttachment, "status"> & {
225
+ status?: PendingAttachmentStatus;
226
+ }>;
227
+ send(attachment: PendingAttachment): Promise<Omit<CompleteAttachment, "status"> & {
228
+ status?: CompleteAttachmentStatus;
229
+ }>;
230
+ remove(attachment: Attachment): Promise<void>;
224
231
  }
225
232
 
226
233
  declare abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
227
234
  readonly isEditing = true;
228
235
  attachmentAccept: string;
229
236
  private _attachments;
230
- protected set attachments(value: readonly ThreadComposerAttachment[]);
231
- get attachments(): readonly ThreadComposerAttachment[];
237
+ protected set attachments(value: readonly Attachment[]);
238
+ get attachments(): readonly Attachment[];
232
239
  abstract get canCancel(): boolean;
233
240
  get isEmpty(): boolean;
234
241
  private _text;
@@ -247,10 +254,11 @@ declare abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
247
254
  subscribe(callback: () => void): Unsubscribe;
248
255
  }
249
256
 
250
- declare class DefaultThreadComposerRuntimeCore extends BaseComposerRuntimeCore {
257
+ declare class DefaultThreadComposerRuntimeCore extends BaseComposerRuntimeCore implements ThreadComposerRuntimeCore {
251
258
  private runtime;
252
259
  private _canCancel;
253
260
  get canCancel(): boolean;
261
+ get attachments(): readonly PendingAttachment[];
254
262
  constructor(runtime: Omit<ThreadRuntimeCore, "composer">);
255
263
  connect(): Unsubscribe;
256
264
  handleSend(message: Omit<AppendMessage, "parentId">): Promise<void>;
@@ -380,7 +388,7 @@ declare const fromCoreMessages: (message: readonly CoreMessage[]) => ThreadMessa
380
388
  declare const fromCoreMessage: (message: CoreMessage, { id, status, attachments, }?: {
381
389
  id?: string | undefined;
382
390
  status?: MessageStatus | undefined;
383
- attachments?: readonly MessageAttachment[] | undefined;
391
+ attachments?: readonly CompleteAttachment[] | undefined;
384
392
  }) => ThreadMessage;
385
393
 
386
394
  declare const toCoreMessages: (message: ThreadMessage[]) => CoreMessage[];
@@ -434,7 +442,7 @@ type ThreadMessageLike = {
434
442
  id?: string | undefined;
435
443
  createdAt?: Date | undefined;
436
444
  status?: MessageStatus | undefined;
437
- attachments?: MessageAttachment[] | undefined;
445
+ attachments?: CompleteAttachment[] | undefined;
438
446
  };
439
447
 
440
448
  type ExternalStoreMessageConverter<T> = (message: T, idx: number) => ThreadMessageLike;
@@ -497,9 +505,10 @@ type SubscribableWithState<TState> = Subscribable & {
497
505
  getState: () => TState;
498
506
  };
499
507
 
500
- type ThreadComposerRuntimeCoreBinding = SubscribableWithState<ComposerRuntimeCore | undefined>;
508
+ type ThreadComposerRuntimeCoreBinding = SubscribableWithState<ThreadComposerRuntimeCore | undefined>;
509
+ type ComposerRuntimeCoreBinding = SubscribableWithState<ComposerRuntimeCore | undefined>;
501
510
  type LegacyEditComposerState = Readonly<{
502
- type: "edit" | "thread";
511
+ type: "edit";
503
512
  /** @deprecated Use `text` instead. This will be removed in 0.6.0. */
504
513
  value: string;
505
514
  /** @deprecated Use `useComposerRuntime().setText()` instead. This will be removed in 0.6.0. */
@@ -526,13 +535,13 @@ type LegacyEditComposerState = Readonly<{
526
535
  cancel: () => void;
527
536
  }>;
528
537
  type LegacyThreadComposerState = Readonly<{
529
- type: "thread" | "edit";
538
+ type: "thread";
530
539
  /** @deprecated Use `text` instead. This will be removed in 0.6.0. */
531
540
  value: string;
532
541
  /** @deprecated Use `useComposerRuntime().setText` instead. This will be removed in 0.6.0. */
533
542
  setValue: (value: string) => void;
534
543
  attachmentAccept: string;
535
- attachments: readonly ThreadComposerAttachment[];
544
+ attachments: readonly Attachment[];
536
545
  /** @deprecated Use `useComposerRuntime().addAttachment` instead. This will be removed in 0.6.0. */
537
546
  addAttachment: (file: File) => void;
538
547
  /** @deprecated Use `useComposerRuntime().removeAttachment` instead. This will be removed in 0.6.0. */
@@ -556,24 +565,26 @@ type LegacyThreadComposerState = Readonly<{
556
565
  /** @deprecated This feature is being removed in 0.6.0. Submit feedback if you need it. */
557
566
  onFocus: (listener: () => void) => Unsubscribe;
558
567
  }>;
559
- type ComposerState = LegacyThreadComposerState & LegacyEditComposerState & Readonly<{
560
- type: "thread" | "edit";
568
+ type BaseComposerState = {
561
569
  text: string;
562
570
  attachmentAccept: string;
563
- attachments: readonly ThreadComposerAttachment[];
571
+ attachments: readonly Attachment[];
564
572
  canCancel: boolean;
565
573
  isEditing: boolean;
566
574
  isEmpty: boolean;
567
- }>;
568
- /** @deprecated Use `ComposerState` instead. */
569
- type ThreadComposerState = ComposerState;
570
- /** @deprecated Use `ComposerState` instead. */
571
- type EditComposerState = ComposerState;
572
- declare class ComposerRuntime implements ComposerRuntimeCore {
573
- private _core;
574
- private _beginEdit?;
575
- get type(): "edit" | "thread";
576
- constructor(_core: ThreadComposerRuntimeCoreBinding, _beginEdit?: (() => void) | undefined);
575
+ };
576
+ type ThreadComposerState = LegacyThreadComposerState & BaseComposerState & {
577
+ type: "thread";
578
+ attachments: readonly PendingAttachment[];
579
+ };
580
+ type EditComposerState = LegacyEditComposerState & BaseComposerState & {
581
+ type: "edit";
582
+ };
583
+ type ComposerState = ThreadComposerState | EditComposerState;
584
+ declare abstract class ComposerRuntime implements ComposerRuntimeCore {
585
+ protected _core: ComposerRuntimeCoreBinding;
586
+ abstract get type(): "edit" | "thread";
587
+ constructor(_core: ComposerRuntimeCoreBinding);
577
588
  /**
578
589
  * @deprecated Use `getState().isEditing` instead. This will be removed in 0.6.0.
579
590
  */
@@ -597,12 +608,12 @@ declare class ComposerRuntime implements ComposerRuntimeCore {
597
608
  /**
598
609
  * @deprecated Use `getState().attachments` instead. This will be removed in 0.6.0.
599
610
  */
600
- get attachments(): readonly ThreadComposerAttachment[];
611
+ get attachments(): readonly Attachment[] | (readonly Attachment[] & readonly PendingAttachment[]);
601
612
  /**
602
613
  * @deprecated Use `getState().text` instead. This will be removed in 0.6.0.
603
614
  */
604
615
  get value(): string;
605
- getState(): ComposerState;
616
+ abstract getState(): ComposerState;
606
617
  setText(text: string): void;
607
618
  setValue(text: string): void;
608
619
  addAttachment(file: File): Promise<void>;
@@ -613,15 +624,85 @@ declare class ComposerRuntime implements ComposerRuntimeCore {
613
624
  reset(): void;
614
625
  send(): void;
615
626
  cancel(): void;
627
+ subscribe(callback: () => void): Unsubscribe;
628
+ abstract unstable_getAttachmentByIndex(idx: number): AttachmentRuntime;
629
+ }
630
+ declare class ThreadComposerRuntime extends ComposerRuntime implements ThreadComposerState {
631
+ get type(): "thread";
632
+ private _getState;
633
+ constructor(core: ThreadComposerRuntimeCoreBinding);
634
+ get attachments(): readonly Attachment[] & readonly PendingAttachment[];
635
+ getState(): ThreadComposerState;
636
+ private _focusListeners;
637
+ focus(): void;
638
+ onFocus(callback: () => void): () => boolean;
639
+ unstable_getAttachmentByIndex(idx: number): ThreadComposerAttachmentRuntime;
640
+ }
641
+ declare class EditComposerRuntime extends ComposerRuntime implements EditComposerState {
642
+ private _beginEdit;
643
+ get type(): "edit";
644
+ private _getState;
645
+ constructor(core: ComposerRuntimeCoreBinding, _beginEdit: () => void);
646
+ getState(): EditComposerState;
616
647
  beginEdit(): void;
617
648
  /**
618
649
  * @deprecated Use `beginEdit()` instead. This will be removed in 0.6.0.
619
650
  */
620
651
  edit(): void;
652
+ unstable_getAttachmentByIndex(idx: number): EditComposerAttachmentRuntime;
653
+ }
654
+
655
+ type MessageAttachmentState = CompleteAttachment & {
656
+ source: "message";
657
+ /**
658
+ * @deprecated You can directly access content part fields in the state. Replace `.attachment.type` with `.type` etc. This will be removed in 0.6.0.
659
+ */
660
+ attachment: CompleteAttachment;
661
+ };
662
+ type ThreadComposerAttachmentState = PendingAttachment & {
663
+ source: "thread-composer";
664
+ /**
665
+ * @deprecated You can directly access content part fields in the state. Replace `.attachment.type` with `.type` etc. This will be removed in 0.6.0.
666
+ */
667
+ attachment: PendingAttachment;
668
+ };
669
+ type EditComposerAttachmentState = Attachment & {
670
+ source: "edit-composer";
671
+ /**
672
+ * @deprecated You can directly access content part fields in the state. Replace `.attachment.type` with `.type` etc. This will be removed in 0.6.0.
673
+ */
674
+ attachment: Attachment;
675
+ };
676
+ type AttachmentState = ThreadComposerAttachmentState | EditComposerAttachmentState | MessageAttachmentState;
677
+ type AttachmentSnapshotBinding<Source extends AttachmentRuntimeSource> = SubscribableWithState<AttachmentState & {
678
+ source: Source;
679
+ }>;
680
+ type AttachmentRuntimeSource = AttachmentState["source"];
681
+ declare abstract class AttachmentRuntime<Source extends AttachmentRuntimeSource = AttachmentRuntimeSource> {
682
+ private _core;
683
+ abstract get source(): Source;
684
+ constructor(_core: AttachmentSnapshotBinding<Source>);
685
+ getState(): AttachmentState & {
686
+ source: Source;
687
+ };
688
+ abstract remove(): Promise<void>;
621
689
  subscribe(callback: () => void): Unsubscribe;
622
- private _focusListeners;
623
- private focus;
624
- private onFocus;
690
+ }
691
+ declare abstract class ComposerAttachmentRuntime<Source extends "thread-composer" | "edit-composer"> extends AttachmentRuntime<Source> {
692
+ private _composerApi;
693
+ constructor(core: AttachmentSnapshotBinding<Source>, _composerApi: ComposerRuntimeCoreBinding);
694
+ remove(): Promise<void>;
695
+ }
696
+ declare class ThreadComposerAttachmentRuntime extends ComposerAttachmentRuntime<"thread-composer"> {
697
+ get source(): "thread-composer";
698
+ }
699
+ declare class EditComposerAttachmentRuntime extends ComposerAttachmentRuntime<"edit-composer"> {
700
+ get source(): "edit-composer";
701
+ }
702
+ declare class MessageAttachmentRuntime extends AttachmentRuntime<"message"> {
703
+ get source(): "message";
704
+ constructor(core: AttachmentSnapshotBinding<"message">);
705
+ remove(): never;
625
706
  }
626
707
 
627
708
  type MessageState = ThreadMessage & {
@@ -643,9 +724,7 @@ declare class MessageRuntime {
643
724
  private _core;
644
725
  private _threadBinding;
645
726
  constructor(_core: MessageStateBinding, _threadBinding: ThreadRuntimeCoreBinding);
646
- composer: ComposerRuntime & {
647
- type: "edit";
648
- };
727
+ composer: EditComposerRuntime;
649
728
  getState(): MessageState;
650
729
  unstable_edit(message: Omit<AppendMessage, "parentId">): void;
651
730
  reload(): void;
@@ -659,6 +738,7 @@ declare class MessageRuntime {
659
738
  }): void;
660
739
  subscribe(callback: () => void): Unsubscribe;
661
740
  unstable_getContentPartByIndex(idx: number): ContentPartRuntime;
741
+ unstable_getAttachmentByIndex(idx: number): MessageAttachmentRuntime;
662
742
  }
663
743
 
664
744
  type CreateAppendMessage = string | {
@@ -715,7 +795,7 @@ declare class ThreadRuntime implements ThreadRuntimeCore {
715
795
  speak: (messageId: string) => SpeechSynthesisAdapter.Utterance;
716
796
  submitFeedback: (feedback: SubmitFeedbackOptions) => void;
717
797
  getModelConfig: () => ModelConfig;
718
- composer: ComposerRuntimeCore;
798
+ composer: ThreadComposerRuntimeCore;
719
799
  getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;
720
800
  beginEdit: (messageId: string) => void;
721
801
  capabilities: Readonly<RuntimeCapabilities>;
@@ -728,7 +808,7 @@ declare class ThreadRuntime implements ThreadRuntimeCore {
728
808
  }>;
729
809
  private _threadBinding;
730
810
  constructor(threadBinding: ThreadRuntimeCoreBinding);
731
- readonly composer: ComposerRuntime;
811
+ readonly composer: ThreadComposerRuntime;
732
812
  getState(): Readonly<{
733
813
  threadId: string;
734
814
  isDisabled: boolean;
@@ -747,11 +827,11 @@ declare class ThreadRuntime implements ThreadRuntimeCore {
747
827
  speak(messageId: string): SpeechSynthesisAdapter.Utterance;
748
828
  submitFeedback(options: SubmitFeedbackOptions): void;
749
829
  /**
750
- * @deprecated This is a temporary API. This will be removed in 0.6.0.
830
+ * @deprecated Use `getMesssageById(id).unstable_getMessageByIndex(idx).composer` instead. This will be removed in 0.6.0.
751
831
  */
752
832
  getEditComposer(messageId: string): Readonly<{
753
833
  attachmentAccept: string;
754
- attachments: readonly ThreadComposerAttachment[];
834
+ attachments: readonly Attachment[];
755
835
  addAttachment: (file: File) => Promise<void>;
756
836
  removeAttachment: (attachmentId: string) => Promise<void>;
757
837
  isEditing: boolean;
@@ -765,7 +845,7 @@ declare class ThreadRuntime implements ThreadRuntimeCore {
765
845
  subscribe: (callback: () => void) => Unsubscribe;
766
846
  }> | undefined;
767
847
  /**
768
- * @deprecated This is a temporary API. This will be removed in 0.6.0.
848
+ * @deprecated Use `getMesssageById(id).unstable_getMessageByIndex(idx).composer.beginEdit()` instead. This will be removed in 0.6.0.
769
849
  */
770
850
  beginEdit(messageId: string): void;
771
851
  export(): ExportedMessageRepository;
@@ -1139,21 +1219,21 @@ declare const useThreadMessagesStore: {
1139
1219
  }): ReadonlyStore<readonly ThreadMessage[]> | null;
1140
1220
  };
1141
1221
  declare const useThreadComposer: {
1142
- (): ComposerState;
1143
- <TSelected>(selector: (state: ComposerState) => TSelected): TSelected;
1222
+ (): ThreadComposerState;
1223
+ <TSelected>(selector: (state: ThreadComposerState) => TSelected): TSelected;
1144
1224
  (options: {
1145
1225
  optional: true;
1146
- }): ComposerState | null;
1226
+ }): ThreadComposerState | null;
1147
1227
  <TSelected>(options: {
1148
1228
  optional: true;
1149
- selector?: (state: ComposerState) => TSelected;
1229
+ selector?: (state: ThreadComposerState) => TSelected;
1150
1230
  }): TSelected | null;
1151
1231
  };
1152
1232
  declare const useThreadComposerStore: {
1153
- (): ReadonlyStore<ComposerState>;
1233
+ (): ReadonlyStore<ThreadComposerState>;
1154
1234
  (options: {
1155
1235
  optional: true;
1156
- }): ReadonlyStore<ComposerState> | null;
1236
+ }): ReadonlyStore<ThreadComposerState> | null;
1157
1237
  };
1158
1238
  declare const useThreadViewport: {
1159
1239
  (): Readonly<{
@@ -1312,21 +1392,21 @@ declare const useMessageUtilsStore: {
1312
1392
  }>> | null;
1313
1393
  };
1314
1394
  declare const useEditComposer: {
1315
- (): ComposerState;
1316
- <TSelected>(selector: (state: ComposerState) => TSelected): TSelected;
1395
+ (): EditComposerState;
1396
+ <TSelected>(selector: (state: EditComposerState) => TSelected): TSelected;
1317
1397
  (options: {
1318
1398
  optional: true;
1319
- }): ComposerState | null;
1399
+ }): EditComposerState | null;
1320
1400
  <TSelected>(options: {
1321
1401
  optional: true;
1322
- selector?: (state: ComposerState) => TSelected;
1402
+ selector?: (state: EditComposerState) => TSelected;
1323
1403
  }): TSelected | null;
1324
1404
  };
1325
1405
  declare const useEditComposerStore: {
1326
- (): ReadonlyStore<ComposerState>;
1406
+ (): ReadonlyStore<EditComposerState>;
1327
1407
  (options: {
1328
1408
  optional: true;
1329
- }): ReadonlyStore<ComposerState> | null;
1409
+ }): ReadonlyStore<EditComposerState> | null;
1330
1410
  };
1331
1411
 
1332
1412
  type ContentPartContextValue = {
@@ -1366,7 +1446,7 @@ declare const useContentPartStore: {
1366
1446
  };
1367
1447
 
1368
1448
  type ComposerContextValue = {
1369
- useComposer: ReadonlyStore<ComposerState>;
1449
+ useComposer: UseBoundStore<ReadonlyStore<ComposerState>>;
1370
1450
  type: "edit" | "new";
1371
1451
  };
1372
1452
  declare const useComposerContext: () => ComposerContextValue;
@@ -2205,6 +2285,8 @@ declare class ProxyConfigProvider implements ModelConfigProvider {
2205
2285
  registerModelConfigProvider(provider: ModelConfigProvider): () => void;
2206
2286
  }
2207
2287
 
2288
+ declare const generateId: (size?: number) => string;
2289
+
2208
2290
  declare const useSmooth: (state: ContentPartState & TextContentPart, smooth?: boolean) => ContentPartState & TextContentPart;
2209
2291
 
2210
2292
  declare const withSmoothContextProvider: <C extends ComponentType<any>>(Component: C) => C;
@@ -2264,11 +2346,9 @@ declare const useSmoothStatus: {
2264
2346
  }): TSelected | null;
2265
2347
  };
2266
2348
 
2267
- declare const generateId: (size?: number) => string;
2268
-
2269
2349
  type internal_AssistantRuntime<TThreadRuntime extends ThreadRuntime = ThreadRuntime> = AssistantRuntime<TThreadRuntime>;
2270
2350
  declare const internal_AssistantRuntime: typeof AssistantRuntime;
2271
- type internal_BaseAssistantRuntimeCore<TThreadRuntime extends ReactThreadRuntimeCore> = BaseAssistantRuntimeCore<TThreadRuntime>;
2351
+ type internal_BaseAssistantRuntimeCore<TThreadRuntime extends ThreadRuntimeCore> = BaseAssistantRuntimeCore<TThreadRuntime>;
2272
2352
  declare const internal_BaseAssistantRuntimeCore: typeof BaseAssistantRuntimeCore;
2273
2353
  type internal_DefaultThreadComposerRuntimeCore = DefaultThreadComposerRuntimeCore;
2274
2354
  declare const internal_DefaultThreadComposerRuntimeCore: typeof DefaultThreadComposerRuntimeCore;
@@ -2276,9 +2356,9 @@ type internal_MessageRepository = MessageRepository;
2276
2356
  declare const internal_MessageRepository: typeof MessageRepository;
2277
2357
  type internal_ProxyConfigProvider = ProxyConfigProvider;
2278
2358
  declare const internal_ProxyConfigProvider: typeof ProxyConfigProvider;
2279
- type internal_ReactThreadRuntimeCore = ReactThreadRuntimeCore;
2280
2359
  type internal_ThreadRuntime = ThreadRuntime;
2281
2360
  declare const internal_ThreadRuntime: typeof ThreadRuntime;
2361
+ type internal_ThreadRuntimeCore = ThreadRuntimeCore;
2282
2362
  type internal_ThreadRuntimeCoreBinding = ThreadRuntimeCoreBinding;
2283
2363
  declare const internal_TooltipIconButton: typeof TooltipIconButton;
2284
2364
  declare const internal_generateId: typeof generateId;
@@ -2286,7 +2366,7 @@ declare const internal_useSmooth: typeof useSmooth;
2286
2366
  declare const internal_useSmoothStatus: typeof useSmoothStatus;
2287
2367
  declare const internal_withSmoothContextProvider: typeof withSmoothContextProvider;
2288
2368
  declare namespace internal {
2289
- export { internal_AssistantRuntime as AssistantRuntime, internal_BaseAssistantRuntimeCore as BaseAssistantRuntimeCore, internal_DefaultThreadComposerRuntimeCore as DefaultThreadComposerRuntimeCore, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, type internal_ReactThreadRuntimeCore as ReactThreadRuntimeCore, internal_ThreadRuntime as ThreadRuntime, type internal_ThreadRuntimeCoreBinding as ThreadRuntimeCoreBinding, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
2369
+ export { internal_AssistantRuntime as AssistantRuntime, internal_BaseAssistantRuntimeCore as BaseAssistantRuntimeCore, internal_DefaultThreadComposerRuntimeCore as DefaultThreadComposerRuntimeCore, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_ThreadRuntime as ThreadRuntime, type internal_ThreadRuntimeCore as ThreadRuntimeCore, type internal_ThreadRuntimeCoreBinding as ThreadRuntimeCoreBinding, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
2290
2370
  }
2291
2371
 
2292
- export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveFeedbackNegativeProps, type ActionBarPrimitiveFeedbackPositiveProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$b as AssistantActionBar, type AssistantContextValue, _default$a as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$9 as AssistantModal, index$5 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, 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, ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, ContentPartRuntime, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$5 as EditComposer, type EditComposerState, type EmptyContentPartComponent, type EmptyContentPartProps, type ExternalStoreAdapter, type ExternalStoreMessageConverter, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, MessageRuntime, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SubmitFeedbackOptions, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$4 as Thread, ThreadAssistantContentPart, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, ThreadRuntime, type ThreadState, ThreadUserContentPart, 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, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantActions, useAssistantActionsStore, useAssistantContext, useAssistantInstructions, useAssistantRuntime, useAssistantRuntimeStore, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposer, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerRuntime, useComposerSend, useComposerStore, useContentPart, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartRuntime, useContentPartStore, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useEditComposer, useEditComposerStore, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessage, useMessageContext, useMessageIf, useMessageRuntime, useMessageStore, useMessageUtils, useMessageUtilsStore, useSwitchToNewThread, useThread, useThreadActions, useThreadActionsStore, useThreadComposer, useThreadComposerStore, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadMessages, useThreadMessagesStore, useThreadRuntime, useThreadRuntimeStore, useThreadScrollToBottom, useThreadStore, useThreadSuggestion, useThreadViewport, useThreadViewportStore, useToolUIs, useToolUIsStore };
2372
+ export { index$6 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveFeedbackNegativeProps, type ActionBarPrimitiveFeedbackPositiveProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$b as AssistantActionBar, type AssistantContextValue, _default$a as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$9 as AssistantModal, index$5 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, Attachment, 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, CompleteAttachment, _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, ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, ContentPartRuntime, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$5 as EditComposer, EditComposerRuntime, type EditComposerState, type EmptyContentPartComponent, type EmptyContentPartProps, type ExternalStoreAdapter, type ExternalStoreMessageConverter, internal as INTERNAL, ImageContentPart, type ImageContentPartComponent, type ImageContentPartProps, type LocalRuntimeOptions, type MessageContextValue, index$1 as MessagePrimitive, type MessagePrimitiveContentProps, type MessagePrimitiveIfProps, type MessagePrimitiveInProgressProps, type MessagePrimitiveRootProps, MessageRuntime, type MessageState, MessageStatus, type MessageUtilsState, ModelConfig, ModelConfigProvider, PendingAttachment, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SpeechSynthesisAdapter, StreamUtils, type StringsConfig, type SubmitFeedbackOptions, type SuggestionConfig, TextContentPart, type TextContentPartComponent, type TextContentPartProps, TextContentPartProvider, _default$4 as Thread, ThreadAssistantContentPart, ThreadComposerRuntime, type ThreadConfig, ThreadConfigProvider, type ThreadConfigProviderProps, type ThreadContextValue, ThreadMessage, type ThreadMessageLike, index as ThreadPrimitive, type ThreadPrimitiveEmptyProps, type ThreadPrimitiveIfProps, type ThreadPrimitiveMessagesProps, type ThreadPrimitiveRootProps, type ThreadPrimitiveScrollToBottomProps, type ThreadPrimitiveSuggestionProps, type ThreadPrimitiveViewportProps, type ThreadRootProps, ThreadRuntime, type ThreadState, ThreadUserContentPart, 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, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAppendMessage, useAssistantActions, useAssistantActionsStore, useAssistantContext, useAssistantInstructions, useAssistantRuntime, useAssistantRuntimeStore, useAssistantTool, useAssistantToolUI, useBranchPickerCount, useBranchPickerNext, useBranchPickerNumber, useBranchPickerPrevious, useComposer, useComposerAddAttachment, useComposerCancel, useComposerContext, useComposerIf, useComposerRuntime, useComposerSend, useComposerStore, useContentPart, useContentPartContext, useContentPartDisplay, useContentPartImage, useContentPartRuntime, useContentPartStore, useContentPartText, useDangerousInBrowserRuntime, useEdgeRuntime, useEditComposer, useEditComposerStore, useExternalMessageConverter, useExternalStoreRuntime, useLocalRuntime, useMessage, useMessageContext, useMessageIf, useMessageRuntime, useMessageStore, useMessageUtils, useMessageUtilsStore, useSwitchToNewThread, useThread, useThreadActions, useThreadActionsStore, useThreadComposer, useThreadComposerStore, useThreadConfig, useThreadContext, useThreadEmpty, useThreadIf, useThreadMessages, useThreadMessagesStore, useThreadRuntime, useThreadRuntimeStore, useThreadScrollToBottom, useThreadStore, useThreadSuggestion, useThreadViewport, useThreadViewportStore, useToolUIs, useToolUIsStore };