@assistant-ui/react 0.5.81 → 0.5.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CYIFAX4U.js → chunk-C6UZOY5A.js} +1 -1
- package/dist/chunk-C6UZOY5A.js.map +1 -0
- package/dist/{chunk-RHM73CQE.mjs → chunk-TWIMAOZR.mjs} +1 -1
- package/dist/chunk-TWIMAOZR.mjs.map +1 -0
- package/dist/{edge-rTP-G718.d.mts → edge-8bY1SEQ-.d.mts} +4 -1
- package/dist/{edge-rTP-G718.d.ts → edge-8bY1SEQ-.d.ts} +4 -1
- package/dist/edge.js.map +1 -1
- package/dist/edge.mjs.map +1 -1
- package/dist/index.d.mts +150 -25
- package/dist/index.d.ts +150 -25
- package/dist/index.js +413 -261
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +304 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-CYIFAX4U.js.map +0 -1
- package/dist/chunk-RHM73CQE.mjs.map +0 -1
    
        package/dist/index.d.ts
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 | 
            -
            import { A as Attachment$1, 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 ThreadStep, f as PendingAttachmentStatus, g as CompleteAttachment, h as CompleteAttachmentStatus, i as Tool, j as TextContentPart, I as ImageContentPart, k as ToolCallContentPart, l as CoreToolCallContentPart,  | 
| 2 | 
            -
            export {  | 
| 1 | 
            +
            import { A as Attachment$1, U as Unsubscribe, 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 ThreadStep, f as PendingAttachmentStatus, g as CompleteAttachment, h as CompleteAttachmentStatus, i as Tool, j as TextContentPart, I as ImageContentPart, k as ToolCallContentPart, l as CoreToolCallContentPart, m as UIContentPart, n as CreateEdgeRuntimeAPIOptions, o as ThreadUserContentPart, p as ContentPartStatus, q as ToolCallContentPartStatus } from './edge-8bY1SEQ-.js';
         | 
| 2 | 
            +
            export { r as AttachmentStatus, w as CoreAssistantContentPart, z as CoreAssistantMessage, x as CoreSystemMessage, v as CoreUserContentPart, y as CoreUserMessage, E as EdgeRuntimeRequestOptions, t as ThreadAssistantMessage, s as ThreadSystemMessage, u as ThreadUserMessage } from './edge-8bY1SEQ-.js';
         | 
| 3 3 | 
             
            import * as react from 'react';
         | 
| 4 4 | 
             
            import { ComponentType, PropsWithChildren, FC, ElementRef, ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
         | 
| 5 5 | 
             
            import { StoreApi, UseBoundStore } from 'zustand';
         | 
| @@ -36,8 +36,6 @@ type ThreadComposerRuntimeCore = ComposerRuntimeCore & Readonly<{ | |
| 36 36 | 
             
                attachments: readonly PendingAttachment[];
         | 
| 37 37 | 
             
            }>;
         | 
| 38 38 |  | 
| 39 | 
            -
            type Unsubscribe = () => void;
         | 
| 40 | 
            -
             | 
| 41 39 | 
             
            declare namespace SpeechSynthesisAdapter {
         | 
| 42 40 | 
             
                type Status = {
         | 
| 43 41 | 
             
                    type: "starting" | "running";
         | 
| @@ -53,11 +51,11 @@ declare namespace SpeechSynthesisAdapter { | |
| 53 51 | 
             
                };
         | 
| 54 52 | 
             
            }
         | 
| 55 53 | 
             
            type SpeechSynthesisAdapter = {
         | 
| 56 | 
            -
                speak: ( | 
| 54 | 
            +
                speak: (text: string) => SpeechSynthesisAdapter.Utterance;
         | 
| 57 55 | 
             
            };
         | 
| 58 56 |  | 
| 59 57 | 
             
            declare class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter {
         | 
| 60 | 
            -
                speak( | 
| 58 | 
            +
                speak(text: string): SpeechSynthesisAdapter.Utterance;
         | 
| 61 59 | 
             
            }
         | 
| 62 60 |  | 
| 63 61 | 
             
            interface ExportedMessageRepository {
         | 
| @@ -117,7 +115,12 @@ type SpeechState = Readonly<{ | |
| 117 115 | 
             
            type SubmittedFeedback = Readonly<{
         | 
| 118 116 | 
             
                type: "negative" | "positive";
         | 
| 119 117 | 
             
            }>;
         | 
| 118 | 
            +
            type ThreadRuntimeEventType = "switched-to" | "run-start" | "model-config-update";
         | 
| 120 119 | 
             
            type ThreadRuntimeCore = Readonly<{
         | 
| 120 | 
            +
                getMessageById: (messageId: string) => {
         | 
| 121 | 
            +
                    parentId: string | null;
         | 
| 122 | 
            +
                    message: ThreadMessage;
         | 
| 123 | 
            +
                } | undefined;
         | 
| 121 124 | 
             
                getBranches: (messageId: string) => readonly string[];
         | 
| 122 125 | 
             
                switchToBranch: (branchId: string) => void;
         | 
| 123 126 | 
             
                append: (message: AppendMessage) => void;
         | 
| @@ -142,7 +145,7 @@ type ThreadRuntimeCore = Readonly<{ | |
| 142 145 | 
             
                subscribe: (callback: () => void) => Unsubscribe;
         | 
| 143 146 | 
             
                import(repository: ExportedMessageRepository): void;
         | 
| 144 147 | 
             
                export(): ExportedMessageRepository;
         | 
| 145 | 
            -
                unstable_on(event:  | 
| 148 | 
            +
                unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;
         | 
| 146 149 | 
             
            }>;
         | 
| 147 150 |  | 
| 148 151 | 
             
            type AssistantRuntimeCore = {
         | 
| @@ -357,10 +360,14 @@ declare abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore { | |
| 357 360 | 
             
                private _editComposers;
         | 
| 358 361 | 
             
                getEditComposer(messageId: string): DefaultEditComposerRuntimeCore | undefined;
         | 
| 359 362 | 
             
                beginEdit(messageId: string): void;
         | 
| 363 | 
            +
                getMessageById(messageId: string): {
         | 
| 364 | 
            +
                    parentId: string | null;
         | 
| 365 | 
            +
                    message: ThreadMessage;
         | 
| 366 | 
            +
                };
         | 
| 360 367 | 
             
                getBranches(messageId: string): string[];
         | 
| 361 368 | 
             
                switchToBranch(branchId: string): void;
         | 
| 362 369 | 
             
                protected _notifySubscribers(): void;
         | 
| 363 | 
            -
                _notifyEventSubscribers(event:  | 
| 370 | 
            +
                _notifyEventSubscribers(event: ThreadRuntimeEventType): void;
         | 
| 364 371 | 
             
                subscribe(callback: () => void): Unsubscribe;
         | 
| 365 372 | 
             
                private _submittedFeedback;
         | 
| 366 373 | 
             
                getSubmittedFeedback(messageId: string): Readonly<{
         | 
| @@ -374,7 +381,7 @@ declare abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore { | |
| 374 381 | 
             
                export(): ExportedMessageRepository;
         | 
| 375 382 | 
             
                import(data: ExportedMessageRepository): void;
         | 
| 376 383 | 
             
                private _eventSubscribers;
         | 
| 377 | 
            -
                unstable_on(event:  | 
| 384 | 
            +
                unstable_on(event: ThreadRuntimeEventType, callback: () => void): () => void;
         | 
| 378 385 | 
             
            }
         | 
| 379 386 |  | 
| 380 387 | 
             
            declare class LocalThreadRuntimeCore extends BaseThreadRuntimeCore implements ThreadRuntimeCore {
         | 
| @@ -435,7 +442,7 @@ type AssistantRuntime = { | |
| 435 442 | 
             
                 */
         | 
| 436 443 | 
             
                subscribe(callback: () => void): Unsubscribe;
         | 
| 437 444 | 
             
            };
         | 
| 438 | 
            -
            declare class AssistantRuntimeImpl implements AssistantRuntimeCore, AssistantRuntime {
         | 
| 445 | 
            +
            declare class AssistantRuntimeImpl implements Omit<AssistantRuntimeCore, "thread">, AssistantRuntime {
         | 
| 439 446 | 
             
                private readonly _core;
         | 
| 440 447 | 
             
                private readonly _thread;
         | 
| 441 448 | 
             
                protected constructor(_core: AssistantRuntimeCore, _thread: ThreadRuntime);
         | 
| @@ -451,7 +458,7 @@ declare class AssistantRuntimeImpl implements AssistantRuntimeCore, AssistantRun | |
| 451 458 | 
             
                 * @deprecated Thread is now static and never gets updated. This will be removed in 0.6.0.
         | 
| 452 459 | 
             
                 */
         | 
| 453 460 | 
             
                subscribe(callback: () => void): Unsubscribe;
         | 
| 454 | 
            -
                protected static  | 
| 461 | 
            +
                protected static createMainThreadRuntime(_core: AssistantRuntimeCore, CustomThreadRuntime?: new (binding: ThreadRuntimeCoreBinding) => ThreadRuntime): ThreadRuntime;
         | 
| 455 462 | 
             
                static create(_core: AssistantRuntimeCore, CustomThreadRuntime?: new (binding: ThreadRuntimeCoreBinding) => ThreadRuntime): AssistantRuntime;
         | 
| 456 463 | 
             
            }
         | 
| 457 464 |  | 
| @@ -565,12 +572,64 @@ type ExternalStoreAdapter<T = ThreadMessage> = ExternalStoreAdapterBase<T> & (T | |
| 565 572 | 
             
            type Subscribable = {
         | 
| 566 573 | 
             
                subscribe: (callback: () => void) => Unsubscribe;
         | 
| 567 574 | 
             
            };
         | 
| 568 | 
            -
            type SubscribableWithState<TState> = Subscribable & {
         | 
| 575 | 
            +
            type SubscribableWithState<TState, TPath> = Subscribable & {
         | 
| 576 | 
            +
                path: TPath;
         | 
| 569 577 | 
             
                getState: () => TState;
         | 
| 570 578 | 
             
            };
         | 
| 571 579 |  | 
| 572 | 
            -
            type  | 
| 573 | 
            -
             | 
| 580 | 
            +
            type ThreadRuntimePath = {
         | 
| 581 | 
            +
                ref: string;
         | 
| 582 | 
            +
                threadSelector: {
         | 
| 583 | 
            +
                    type: "main";
         | 
| 584 | 
            +
                };
         | 
| 585 | 
            +
            };
         | 
| 586 | 
            +
            type MessageRuntimePath = ThreadRuntimePath & {
         | 
| 587 | 
            +
                messageSelector: {
         | 
| 588 | 
            +
                    type: "messageId";
         | 
| 589 | 
            +
                    messageId: string;
         | 
| 590 | 
            +
                } | {
         | 
| 591 | 
            +
                    type: "index";
         | 
| 592 | 
            +
                    index: number;
         | 
| 593 | 
            +
                };
         | 
| 594 | 
            +
            };
         | 
| 595 | 
            +
            type ContentPartRuntimePath = MessageRuntimePath & {
         | 
| 596 | 
            +
                contentPartSelector: {
         | 
| 597 | 
            +
                    type: "index";
         | 
| 598 | 
            +
                    index: number;
         | 
| 599 | 
            +
                } | {
         | 
| 600 | 
            +
                    type: "toolCallId";
         | 
| 601 | 
            +
                    toolCallId: string;
         | 
| 602 | 
            +
                };
         | 
| 603 | 
            +
            };
         | 
| 604 | 
            +
            type AttachmentRuntimePath = ((MessageRuntimePath & {
         | 
| 605 | 
            +
                attachmentSource: "message" | "edit-composer";
         | 
| 606 | 
            +
            }) | (ThreadRuntimePath & {
         | 
| 607 | 
            +
                attachmentSource: "thread-composer";
         | 
| 608 | 
            +
            })) & {
         | 
| 609 | 
            +
                attachmentSelector: {
         | 
| 610 | 
            +
                    type: "index";
         | 
| 611 | 
            +
                    index: number;
         | 
| 612 | 
            +
                } | {
         | 
| 613 | 
            +
                    type: "index";
         | 
| 614 | 
            +
                    index: number;
         | 
| 615 | 
            +
                } | {
         | 
| 616 | 
            +
                    type: "index";
         | 
| 617 | 
            +
                    index: number;
         | 
| 618 | 
            +
                };
         | 
| 619 | 
            +
            };
         | 
| 620 | 
            +
            type ComposerRuntimePath = (ThreadRuntimePath & {
         | 
| 621 | 
            +
                composerSource: "thread";
         | 
| 622 | 
            +
            }) | (MessageRuntimePath & {
         | 
| 623 | 
            +
                composerSource: "edit";
         | 
| 624 | 
            +
            });
         | 
| 625 | 
            +
             | 
| 626 | 
            +
            type ThreadComposerRuntimeCoreBinding = SubscribableWithState<ThreadComposerRuntimeCore | undefined, ComposerRuntimePath & {
         | 
| 627 | 
            +
                composerSource: "thread";
         | 
| 628 | 
            +
            }>;
         | 
| 629 | 
            +
            type EditComposerRuntimeCoreBinding = SubscribableWithState<ComposerRuntimeCore | undefined, ComposerRuntimePath & {
         | 
| 630 | 
            +
                composerSource: "edit";
         | 
| 631 | 
            +
            }>;
         | 
| 632 | 
            +
            type ComposerRuntimeCoreBinding = SubscribableWithState<ComposerRuntimeCore | undefined, ComposerRuntimePath>;
         | 
| 574 633 | 
             
            type LegacyEditComposerState = Readonly<{
         | 
| 575 634 | 
             
                type: "edit";
         | 
| 576 635 | 
             
                /** @deprecated Use `text` instead. This will be removed in 0.6.0. */
         | 
| @@ -640,6 +699,7 @@ type EditComposerState = LegacyEditComposerState & BaseComposerState & { | |
| 640 699 | 
             
            };
         | 
| 641 700 | 
             
            type ComposerState = ThreadComposerState | EditComposerState;
         | 
| 642 701 | 
             
            type ComposerRuntime = {
         | 
| 702 | 
            +
                path: ComposerRuntimePath;
         | 
| 643 703 | 
             
                readonly type: "edit" | "thread";
         | 
| 644 704 | 
             
                getState(): ComposerState;
         | 
| 645 705 | 
             
                /** @deprecated Use `getState().isEditing` instead. This will be removed in 0.6.0. */
         | 
| @@ -669,6 +729,7 @@ type ComposerRuntime = { | |
| 669 729 | 
             
            };
         | 
| 670 730 | 
             
            declare abstract class ComposerRuntimeImpl implements ComposerRuntimeCore, ComposerRuntime {
         | 
| 671 731 | 
             
                protected _core: ComposerRuntimeCoreBinding;
         | 
| 732 | 
            +
                get path(): ComposerRuntimePath;
         | 
| 672 733 | 
             
                abstract get type(): "edit" | "thread";
         | 
| 673 734 | 
             
                constructor(_core: ComposerRuntimeCoreBinding);
         | 
| 674 735 | 
             
                /**
         | 
| @@ -714,6 +775,9 @@ declare abstract class ComposerRuntimeImpl implements ComposerRuntimeCore, Compo | |
| 714 775 | 
             
                abstract getAttachmentByIndex(idx: number): AttachmentRuntime;
         | 
| 715 776 | 
             
            }
         | 
| 716 777 | 
             
            type ThreadComposerRuntime = Omit<ComposerRuntime, "getState" | "getAttachmentByIndex"> & {
         | 
| 778 | 
            +
                readonly path: ComposerRuntimePath & {
         | 
| 779 | 
            +
                    composerSource: "thread";
         | 
| 780 | 
            +
                };
         | 
| 717 781 | 
             
                readonly type: "thread";
         | 
| 718 782 | 
             
                getState(): ThreadComposerState;
         | 
| 719 783 | 
             
                /**
         | 
| @@ -725,6 +789,9 @@ type ThreadComposerRuntime = Omit<ComposerRuntime, "getState" | "getAttachmentBy | |
| 725 789 | 
             
                };
         | 
| 726 790 | 
             
            };
         | 
| 727 791 | 
             
            declare class ThreadComposerRuntimeImpl extends ComposerRuntimeImpl implements ThreadComposerRuntime, ThreadComposerState {
         | 
| 792 | 
            +
                get path(): ComposerRuntimePath & {
         | 
| 793 | 
            +
                    composerSource: "thread";
         | 
| 794 | 
            +
                };
         | 
| 728 795 | 
             
                get type(): "thread";
         | 
| 729 796 | 
             
                private _getState;
         | 
| 730 797 | 
             
                constructor(core: ThreadComposerRuntimeCoreBinding);
         | 
| @@ -733,6 +800,9 @@ declare class ThreadComposerRuntimeImpl extends ComposerRuntimeImpl implements T | |
| 733 800 | 
             
                getAttachmentByIndex(idx: number): ThreadComposerAttachmentRuntimeImpl;
         | 
| 734 801 | 
             
            }
         | 
| 735 802 | 
             
            type EditComposerRuntime = Omit<ComposerRuntime, "getState" | "getAttachmentByIndex"> & {
         | 
| 803 | 
            +
                readonly path: ComposerRuntimePath & {
         | 
| 804 | 
            +
                    composerSource: "edit";
         | 
| 805 | 
            +
                };
         | 
| 736 806 | 
             
                readonly type: "edit";
         | 
| 737 807 | 
             
                getState(): EditComposerState;
         | 
| 738 808 | 
             
                beginEdit(): void;
         | 
| @@ -746,9 +816,12 @@ type EditComposerRuntime = Omit<ComposerRuntime, "getState" | "getAttachmentByIn | |
| 746 816 | 
             
            };
         | 
| 747 817 | 
             
            declare class EditComposerRuntimeImpl extends ComposerRuntimeImpl implements EditComposerRuntime, EditComposerState {
         | 
| 748 818 | 
             
                private _beginEdit;
         | 
| 819 | 
            +
                get path(): ComposerRuntimePath & {
         | 
| 820 | 
            +
                    composerSource: "edit";
         | 
| 821 | 
            +
                };
         | 
| 749 822 | 
             
                get type(): "edit";
         | 
| 750 823 | 
             
                private _getState;
         | 
| 751 | 
            -
                constructor(core:  | 
| 824 | 
            +
                constructor(core: EditComposerRuntimeCoreBinding, _beginEdit: () => void);
         | 
| 752 825 | 
             
                getState(): EditComposerState;
         | 
| 753 826 | 
             
                beginEdit(): void;
         | 
| 754 827 | 
             
                /**
         | 
| @@ -782,9 +855,14 @@ type EditComposerAttachmentState = Attachment$1 & { | |
| 782 855 | 
             
            type AttachmentState = ThreadComposerAttachmentState | EditComposerAttachmentState | MessageAttachmentState;
         | 
| 783 856 | 
             
            type AttachmentSnapshotBinding<Source extends AttachmentRuntimeSource> = SubscribableWithState<AttachmentState & {
         | 
| 784 857 | 
             
                source: Source;
         | 
| 858 | 
            +
            }, AttachmentRuntimePath & {
         | 
| 859 | 
            +
                attachmentSource: Source;
         | 
| 785 860 | 
             
            }>;
         | 
| 786 861 | 
             
            type AttachmentRuntimeSource = AttachmentState["source"];
         | 
| 787 862 | 
             
            type AttachmentRuntime<TSource extends AttachmentRuntimeSource = AttachmentRuntimeSource> = {
         | 
| 863 | 
            +
                path: AttachmentRuntimePath & {
         | 
| 864 | 
            +
                    attachmentSource: TSource;
         | 
| 865 | 
            +
                };
         | 
| 788 866 | 
             
                readonly source: TSource;
         | 
| 789 867 | 
             
                getState(): AttachmentState & {
         | 
| 790 868 | 
             
                    source: TSource;
         | 
| @@ -794,6 +872,9 @@ type AttachmentRuntime<TSource extends AttachmentRuntimeSource = AttachmentRunti | |
| 794 872 | 
             
            };
         | 
| 795 873 | 
             
            declare abstract class AttachmentRuntimeImpl<Source extends AttachmentRuntimeSource = AttachmentRuntimeSource> implements AttachmentRuntime {
         | 
| 796 874 | 
             
                private _core;
         | 
| 875 | 
            +
                get path(): AttachmentRuntimePath & {
         | 
| 876 | 
            +
                    attachmentSource: Source;
         | 
| 877 | 
            +
                };
         | 
| 797 878 | 
             
                abstract get source(): Source;
         | 
| 798 879 | 
             
                constructor(_core: AttachmentSnapshotBinding<Source>);
         | 
| 799 880 | 
             
                getState(): AttachmentState & {
         | 
| @@ -832,15 +913,25 @@ type MessageState = ThreadMessage & { | |
| 832 913 | 
             
                branches: readonly string[];
         | 
| 833 914 | 
             
                branchNumber: number;
         | 
| 834 915 | 
             
                branchCount: number;
         | 
| 916 | 
            +
                /**
         | 
| 917 | 
            +
                 * @deprecated This API is still under active development and might change without notice.
         | 
| 918 | 
            +
                 */
         | 
| 835 919 | 
             
                speech: SpeechState | undefined;
         | 
| 836 920 | 
             
                submittedFeedback: SubmittedFeedback | undefined;
         | 
| 837 921 | 
             
            };
         | 
| 838 | 
            -
            type MessageStateBinding = SubscribableWithState<MessageState>;
         | 
| 922 | 
            +
            type MessageStateBinding = SubscribableWithState<MessageState, MessageRuntimePath>;
         | 
| 839 923 | 
             
            type MessageRuntime = {
         | 
| 840 | 
            -
                 | 
| 924 | 
            +
                readonly path: MessageRuntimePath;
         | 
| 925 | 
            +
                readonly composer: EditComposerRuntime;
         | 
| 841 926 | 
             
                getState(): MessageState;
         | 
| 842 927 | 
             
                reload(): void;
         | 
| 928 | 
            +
                /**
         | 
| 929 | 
            +
                 * @deprecated This API is still under active development and might change without notice.
         | 
| 930 | 
            +
                 */
         | 
| 843 931 | 
             
                speak(): void;
         | 
| 932 | 
            +
                /**
         | 
| 933 | 
            +
                 * @deprecated This API is still under active development and might change without notice.
         | 
| 934 | 
            +
                 */
         | 
| 844 935 | 
             
                stopSpeaking(): void;
         | 
| 845 936 | 
             
                submitFeedback({ type }: {
         | 
| 846 937 | 
             
                    type: "positive" | "negative";
         | 
| @@ -849,8 +940,10 @@ type MessageRuntime = { | |
| 849 940 | 
             
                    position?: "previous" | "next" | undefined;
         | 
| 850 941 | 
             
                    branchId?: string | undefined;
         | 
| 851 942 | 
             
                }): void;
         | 
| 943 | 
            +
                unstable_getCopyText(): string;
         | 
| 852 944 | 
             
                subscribe(callback: () => void): Unsubscribe;
         | 
| 853 945 | 
             
                getContentPartByIndex(idx: number): ContentPartRuntime;
         | 
| 946 | 
            +
                getContentPartByToolCallId(toolCallId: string): ContentPartRuntime;
         | 
| 854 947 | 
             
                getAttachmentByIndex(idx: number): AttachmentRuntime & {
         | 
| 855 948 | 
             
                    source: "message";
         | 
| 856 949 | 
             
                };
         | 
| @@ -858,6 +951,7 @@ type MessageRuntime = { | |
| 858 951 | 
             
            declare class MessageRuntimeImpl implements MessageRuntime {
         | 
| 859 952 | 
             
                private _core;
         | 
| 860 953 | 
             
                private _threadBinding;
         | 
| 954 | 
            +
                get path(): MessageRuntimePath;
         | 
| 861 955 | 
             
                constructor(_core: MessageStateBinding, _threadBinding: ThreadRuntimeCoreBinding);
         | 
| 862 956 | 
             
                composer: EditComposerRuntimeImpl;
         | 
| 863 957 | 
             
                getState(): MessageState;
         | 
| @@ -871,8 +965,10 @@ declare class MessageRuntimeImpl implements MessageRuntime { | |
| 871 965 | 
             
                    position?: "previous" | "next" | undefined;
         | 
| 872 966 | 
             
                    branchId?: string | undefined;
         | 
| 873 967 | 
             
                }): void;
         | 
| 968 | 
            +
                unstable_getCopyText(): string;
         | 
| 874 969 | 
             
                subscribe(callback: () => void): Unsubscribe;
         | 
| 875 970 | 
             
                getContentPartByIndex(idx: number): ContentPartRuntimeImpl;
         | 
| 971 | 
            +
                getContentPartByToolCallId(toolCallId: string): ContentPartRuntimeImpl;
         | 
| 876 972 | 
             
                getAttachmentByIndex(idx: number): MessageAttachmentRuntimeImpl;
         | 
| 877 973 | 
             
            }
         | 
| 878 974 |  | 
| @@ -906,7 +1002,7 @@ type CreateAppendMessage = string | { | |
| 906 1002 | 
             
                content: AppendMessage["content"];
         | 
| 907 1003 | 
             
                attachments?: AppendMessage["attachments"] | undefined;
         | 
| 908 1004 | 
             
            };
         | 
| 909 | 
            -
            type ThreadRuntimeCoreBinding = SubscribableWithState<ThreadRuntimeCore> & {
         | 
| 1005 | 
            +
            type ThreadRuntimeCoreBinding = SubscribableWithState<ThreadRuntimeCore, ThreadRuntimePath> & {
         | 
| 910 1006 | 
             
                outerSubscribe(callback: () => void): Unsubscribe;
         | 
| 911 1007 | 
             
            };
         | 
| 912 1008 | 
             
            type ThreadState = Readonly<{
         | 
| @@ -917,10 +1013,14 @@ type ThreadState = Readonly<{ | |
| 917 1013 | 
             
                messages: readonly ThreadMessage[];
         | 
| 918 1014 | 
             
                suggestions: readonly ThreadSuggestion[];
         | 
| 919 1015 | 
             
                extras: unknown;
         | 
| 1016 | 
            +
                /**
         | 
| 1017 | 
            +
                 * @deprecated This API is still under active development and might change without notice.
         | 
| 1018 | 
            +
                 */
         | 
| 920 1019 | 
             
                speech: SpeechState | undefined;
         | 
| 921 1020 | 
             
            }>;
         | 
| 922 1021 | 
             
            type ThreadRuntime = {
         | 
| 923 | 
            -
                 | 
| 1022 | 
            +
                readonly path: ThreadRuntimePath;
         | 
| 1023 | 
            +
                readonly composer: ThreadComposerRuntime;
         | 
| 924 1024 | 
             
                getState(): ThreadState;
         | 
| 925 1025 | 
             
                /**
         | 
| 926 1026 | 
             
                 * @deprecated This method will be removed in 0.6.0. Submit feedback if you need this functionality.
         | 
| @@ -934,8 +1034,12 @@ type ThreadRuntime = { | |
| 934 1034 | 
             
                export(): ExportedMessageRepository;
         | 
| 935 1035 | 
             
                import(repository: ExportedMessageRepository): void;
         | 
| 936 1036 | 
             
                getMesssageByIndex(idx: number): MessageRuntime;
         | 
| 1037 | 
            +
                getMesssageById(messageId: string): MessageRuntime;
         | 
| 1038 | 
            +
                /**
         | 
| 1039 | 
            +
                 * @deprecated This API is still under active development and might change without notice.
         | 
| 1040 | 
            +
                 */
         | 
| 937 1041 | 
             
                stopSpeaking: () => void;
         | 
| 938 | 
            -
                unstable_on(event:  | 
| 1042 | 
            +
                unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;
         | 
| 939 1043 | 
             
                /**
         | 
| 940 1044 | 
             
                 * @deprecated Use `getState().capabilities` instead. This will be removed in 0.6.0.
         | 
| 941 1045 | 
             
                 */
         | 
| @@ -1001,7 +1105,8 @@ type ThreadRuntime = { | |
| 1001 1105 | 
             
                 */
         | 
| 1002 1106 | 
             
                beginEdit: (messageId: string) => void;
         | 
| 1003 1107 | 
             
            };
         | 
| 1004 | 
            -
            declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime {
         | 
| 1108 | 
            +
            declare class ThreadRuntimeImpl implements Omit<ThreadRuntimeCore, "getMessageById">, ThreadRuntime {
         | 
| 1109 | 
            +
                get path(): ThreadRuntimePath;
         | 
| 1005 1110 | 
             
                /**
         | 
| 1006 1111 | 
             
                 * @deprecated Use `getState().threadId` instead. This will be removed in 0.6.0.
         | 
| 1007 1112 | 
             
                 */
         | 
| @@ -1047,6 +1152,10 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime { | |
| 1047 1152 | 
             
                    status: SpeechSynthesisAdapter.Status;
         | 
| 1048 1153 | 
             
                }> | undefined;
         | 
| 1049 1154 | 
             
                unstable_getCore(): Readonly<{
         | 
| 1155 | 
            +
                    getMessageById: (messageId: string) => {
         | 
| 1156 | 
            +
                        parentId: string | null;
         | 
| 1157 | 
            +
                        message: ThreadMessage;
         | 
| 1158 | 
            +
                    } | undefined;
         | 
| 1050 1159 | 
             
                    getBranches: (messageId: string) => readonly string[];
         | 
| 1051 1160 | 
             
                    switchToBranch: (branchId: string) => void;
         | 
| 1052 1161 | 
             
                    append: (message: AppendMessage) => void;
         | 
| @@ -1071,7 +1180,7 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime { | |
| 1071 1180 | 
             
                    subscribe: (callback: () => void) => Unsubscribe;
         | 
| 1072 1181 | 
             
                    import(repository: ExportedMessageRepository): void;
         | 
| 1073 1182 | 
             
                    export(): ExportedMessageRepository;
         | 
| 1074 | 
            -
                    unstable_on(event:  | 
| 1183 | 
            +
                    unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;
         | 
| 1075 1184 | 
             
                }>;
         | 
| 1076 1185 | 
             
                private _threadBinding;
         | 
| 1077 1186 | 
             
                constructor(threadBinding: ThreadRuntimeCoreBinding);
         | 
| @@ -1084,6 +1193,9 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime { | |
| 1084 1193 | 
             
                    messages: readonly ThreadMessage[];
         | 
| 1085 1194 | 
             
                    suggestions: readonly ThreadSuggestion[];
         | 
| 1086 1195 | 
             
                    extras: unknown;
         | 
| 1196 | 
            +
                    /**
         | 
| 1197 | 
            +
                     * @deprecated This API is still under active development and might change without notice.
         | 
| 1198 | 
            +
                     */
         | 
| 1087 1199 | 
             
                    speech: SpeechState | undefined;
         | 
| 1088 1200 | 
             
                }>;
         | 
| 1089 1201 | 
             
                append(message: CreateAppendMessage): void;
         | 
| @@ -1140,8 +1252,10 @@ declare class ThreadRuntimeImpl implements ThreadRuntimeCore, ThreadRuntime { | |
| 1140 1252 | 
             
                export(): ExportedMessageRepository;
         | 
| 1141 1253 | 
             
                import(data: ExportedMessageRepository): void;
         | 
| 1142 1254 | 
             
                getMesssageByIndex(idx: number): MessageRuntimeImpl;
         | 
| 1255 | 
            +
                getMesssageById(messageId: string): MessageRuntimeImpl;
         | 
| 1256 | 
            +
                private _getMessageRuntime;
         | 
| 1143 1257 | 
             
                private _eventListenerNestedSubscriptions;
         | 
| 1144 | 
            -
                unstable_on(event:  | 
| 1258 | 
            +
                unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;
         | 
| 1145 1259 | 
             
            }
         | 
| 1146 1260 |  | 
| 1147 1261 | 
             
            type ContentPartState = (ThreadUserContentPart | ThreadAssistantContentPart) & {
         | 
| @@ -1151,8 +1265,9 @@ type ContentPartState = (ThreadUserContentPart | ThreadAssistantContentPart) & { | |
| 1151 1265 | 
             
                part: ThreadUserContentPart | ThreadAssistantContentPart;
         | 
| 1152 1266 | 
             
                status: ContentPartStatus | ToolCallContentPartStatus;
         | 
| 1153 1267 | 
             
            };
         | 
| 1154 | 
            -
            type ContentPartSnapshotBinding = SubscribableWithState<ContentPartState>;
         | 
| 1268 | 
            +
            type ContentPartSnapshotBinding = SubscribableWithState<ContentPartState, ContentPartRuntimePath>;
         | 
| 1155 1269 | 
             
            type ContentPartRuntime = {
         | 
| 1270 | 
            +
                path: ContentPartRuntimePath;
         | 
| 1156 1271 | 
             
                getState(): ContentPartState;
         | 
| 1157 1272 | 
             
                addToolResult(result: any): void;
         | 
| 1158 1273 | 
             
                subscribe(callback: () => void): Unsubscribe;
         | 
| @@ -1161,6 +1276,7 @@ declare class ContentPartRuntimeImpl implements ContentPartRuntime { | |
| 1161 1276 | 
             
                private contentBinding;
         | 
| 1162 1277 | 
             
                private messageApi;
         | 
| 1163 1278 | 
             
                private threadApi;
         | 
| 1279 | 
            +
                get path(): ContentPartRuntimePath;
         | 
| 1164 1280 | 
             
                constructor(contentBinding: ContentPartSnapshotBinding, messageApi: MessageStateBinding, threadApi: ThreadRuntimeCoreBinding);
         | 
| 1165 1281 | 
             
                getState(): ContentPartState;
         | 
| 1166 1282 | 
             
                addToolResult(result: any): void;
         | 
| @@ -1603,6 +1719,12 @@ declare const useThreadViewportStore: { | |
| 1603 1719 | 
             
                    onScrollToBottom: (callback: () => void) => Unsubscribe;
         | 
| 1604 1720 | 
             
                }>> | null;
         | 
| 1605 1721 | 
             
            };
         | 
| 1722 | 
            +
            declare function useThreadModelConfig(options?: {
         | 
| 1723 | 
            +
                optional?: false | undefined;
         | 
| 1724 | 
            +
            }): ModelConfig;
         | 
| 1725 | 
            +
            declare function useThreadModelConfig(options?: {
         | 
| 1726 | 
            +
                optional?: boolean | undefined;
         | 
| 1727 | 
            +
            }): ModelConfig | null;
         | 
| 1606 1728 |  | 
| 1607 1729 | 
             
            type MessageContextValue = {
         | 
| 1608 1730 | 
             
                useMessageRuntime: UseBoundStore<ReadonlyStore<MessageRuntime>>;
         | 
| @@ -2951,6 +3073,9 @@ declare class ProxyConfigProvider implements ModelConfigProvider { | |
| 2951 3073 | 
             
                private _providers;
         | 
| 2952 3074 | 
             
                getModelConfig(): ModelConfig;
         | 
| 2953 3075 | 
             
                registerModelConfigProvider(provider: ModelConfigProvider): () => void;
         | 
| 3076 | 
            +
                private _subscribers;
         | 
| 3077 | 
            +
                notifySubscribers(): void;
         | 
| 3078 | 
            +
                subscribe(callback: () => void): () => boolean;
         | 
| 2954 3079 | 
             
            }
         | 
| 2955 3080 |  | 
| 2956 3081 | 
             
            declare const generateId: (size?: number) => string;
         | 
| @@ -3037,4 +3162,4 @@ declare namespace internal { | |
| 3037 3162 | 
             
              export { internal_AssistantRuntimeImpl as AssistantRuntimeImpl, internal_BaseAssistantRuntimeCore as BaseAssistantRuntimeCore, internal_DefaultThreadComposerRuntimeCore as DefaultThreadComposerRuntimeCore, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, type internal_ThreadRuntimeCore as ThreadRuntimeCore, type internal_ThreadRuntimeCoreBinding as ThreadRuntimeCoreBinding, internal_ThreadRuntimeImpl as ThreadRuntimeImpl, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
         | 
| 3038 3163 | 
             
            }
         | 
| 3039 3164 |  | 
| 3040 | 
            -
            export { index$7 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveFeedbackNegativeProps, type ActionBarPrimitiveFeedbackPositiveProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$a as AssistantActionBar, type AssistantContextValue, _default$9 as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$8 as AssistantModal, index$6 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, Attachment$1 as Attachment, type AttachmentAdapter, index$5 as AttachmentPrimitive, _default$5 as AttachmentUI, _default$7 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$6 as Composer, _default$5 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartRuntime, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$4 as EditComposer, type 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, type 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$3 as Thread, ThreadAssistantContentPart, type ThreadComposerRuntime, type ThreadComposerState, 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, type ThreadRuntime, type ThreadState, type ThreadSuggestion, ThreadUserContentPart, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps,  | 
| 3165 | 
            +
            export { index$7 as ActionBarPrimitive, type ActionBarPrimitiveCopyProps, type ActionBarPrimitiveEditProps, type ActionBarPrimitiveFeedbackNegativeProps, type ActionBarPrimitiveFeedbackPositiveProps, type ActionBarPrimitiveReloadProps, type ActionBarPrimitiveRootProps, type ActionBarPrimitiveSpeakProps, type ActionBarPrimitiveStopSpeakingProps, type AddToolResultOptions, AppendMessage, _default$a as AssistantActionBar, type AssistantContextValue, _default$9 as AssistantMessage, type AssistantMessageConfig, type AssistantMessageContentProps, _default$8 as AssistantModal, index$6 as AssistantModalPrimitive, type AssistantModalPrimitiveContentProps, type AssistantModalPrimitiveRootProps, type AssistantModalPrimitiveTriggerProps, type AssistantRuntime, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantToolUIsState, Attachment$1 as Attachment, type AttachmentAdapter, index$5 as AttachmentPrimitive, _default$5 as AttachmentUI, _default$7 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$6 as Composer, _default$5 as ComposerAttachment, type ComposerContextValue, type ComposerInputProps, index$3 as ComposerPrimitive, type ComposerPrimitiveCancelProps, type ComposerPrimitiveIfProps, type ComposerPrimitiveInputProps, type ComposerPrimitiveRootProps, type ComposerPrimitiveSendProps, type ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, exports as ContentPart, type ContentPartContextValue, index$2 as ContentPartPrimitive, type ContentPartPrimitiveDisplayProps, type ContentPartPrimitiveImageProps, type ContentPartPrimitiveInProgressProps, type ContentPartPrimitiveTextProps, type ContentPartRuntime, CoreMessage, type DangerousInBrowserRuntimeOptions, EdgeChatAdapter, type EdgeRuntimeOptions, _default$4 as EditComposer, type 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, type 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$3 as Thread, ThreadAssistantContentPart, type ThreadComposerRuntime, type ThreadComposerState, 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, type ThreadRuntime, type ThreadState, type ThreadSuggestion, ThreadUserContentPart, type ThreadViewportState, _default as ThreadWelcome, type ThreadWelcomeConfig, type ThreadWelcomeMessageProps, type ThreadWelcomeSuggestionProps, Tool, ToolCallContentPart, type ToolCallContentPartComponent, type ToolCallContentPartProps, UIContentPart, type UIContentPartComponent, type UIContentPartProps, Unsubscribe, type UseActionBarCopyProps, _default$1 as UserActionBar, _default$2 as UserMessage, _default$5 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, useThreadModelConfig, useThreadRuntime, useThreadRuntimeStore, useThreadScrollToBottom, useThreadStore, useThreadSuggestion, useThreadViewport, useThreadViewportStore, useToolUIs, useToolUIsStore };
         |