@assistant-ui/react 0.0.3 → 0.0.5
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/index.d.mts +46 -55
- package/dist/index.d.ts +46 -55
- package/dist/index.js +423 -395
- package/dist/index.mjs +430 -398
- package/package.json +4 -8
    
        package/dist/index.d.mts
    CHANGED
    
    | @@ -3,6 +3,7 @@ import { FC, PropsWithChildren } from 'react'; | |
| 3 3 | 
             
            import { TextareaAutosizeProps } from 'react-textarea-autosize';
         | 
| 4 4 | 
             
            import { Message } from 'ai';
         | 
| 5 5 | 
             
            import { UseChatHelpers } from 'ai/react';
         | 
| 6 | 
            +
            import { UseBoundStore, StoreApi } from 'zustand';
         | 
| 6 7 |  | 
| 7 8 | 
             
            declare const ThreadRoot: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
         | 
| 8 9 | 
             
                ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
         | 
| @@ -36,18 +37,18 @@ type ThreadMessagesProps = { | |
| 36 37 | 
             
                components: {
         | 
| 37 38 | 
             
                    Message: React.ComponentType;
         | 
| 38 39 | 
             
                    UserMessage?: React.ComponentType;
         | 
| 39 | 
            -
                     | 
| 40 | 
            +
                    EditComposer?: React.ComponentType;
         | 
| 40 41 | 
             
                    AssistantMessage?: React.ComponentType;
         | 
| 41 42 | 
             
                } | {
         | 
| 42 43 | 
             
                    Message?: React.ComponentType;
         | 
| 43 44 | 
             
                    UserMessage: React.ComponentType;
         | 
| 44 | 
            -
                     | 
| 45 | 
            +
                    EditComposer?: React.ComponentType;
         | 
| 45 46 | 
             
                    AssistantMessage: React.ComponentType;
         | 
| 46 47 | 
             
                };
         | 
| 47 48 | 
             
            };
         | 
| 48 49 | 
             
            declare const ThreadMessages: FC<ThreadMessagesProps>;
         | 
| 49 50 |  | 
| 50 | 
            -
            declare namespace index$ | 
| 51 | 
            +
            declare namespace index$4 {
         | 
| 51 52 | 
             
              export { ThreadEmpty as Empty, ThreadIf as If, ThreadMessages as Messages, ThreadRoot as Root, ThreadViewport as Viewport };
         | 
| 52 53 | 
             
            }
         | 
| 53 54 |  | 
| @@ -67,14 +68,20 @@ declare const ComposerSend: react.ForwardRefExoticComponent<Pick<Omit<react.Deta | |
| 67 68 | 
             
                asChild?: boolean;
         | 
| 68 69 | 
             
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 69 70 |  | 
| 70 | 
            -
            declare const  | 
| 71 | 
            +
            declare const ComposerCancel: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| 71 72 | 
             
                ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
         | 
| 72 73 | 
             
            } & {
         | 
| 73 74 | 
             
                asChild?: boolean;
         | 
| 74 75 | 
             
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 75 76 |  | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 77 | 
            +
            type ComposerIfFilters = {
         | 
| 78 | 
            +
                editing: boolean | undefined;
         | 
| 79 | 
            +
            };
         | 
| 80 | 
            +
            type ComposerIfProps = PropsWithChildren<RequireAtLeastOne<ComposerIfFilters>>;
         | 
| 81 | 
            +
            declare const ComposerIf: FC<ComposerIfProps>;
         | 
| 82 | 
            +
             | 
| 83 | 
            +
            declare namespace index$3 {
         | 
| 84 | 
            +
              export { ComposerCancel as Cancel, ComposerIf as If, ComposerInput as Input, ComposerRoot as Root, ComposerSend as Send };
         | 
| 78 85 | 
             
            }
         | 
| 79 86 |  | 
| 80 87 | 
             
            type MessageProviderProps = {
         | 
| @@ -92,10 +99,9 @@ declare const MessageRoot: react.ForwardRefExoticComponent<Pick<Omit<react.Detai | |
| 92 99 | 
             
            type MessageIfFilters = {
         | 
| 93 100 | 
             
                user: boolean | undefined;
         | 
| 94 101 | 
             
                assistant: boolean | undefined;
         | 
| 95 | 
            -
                editing: boolean | undefined;
         | 
| 96 102 | 
             
                hasBranches: boolean | undefined;
         | 
| 97 103 | 
             
                copied: boolean | undefined;
         | 
| 98 | 
            -
                 | 
| 104 | 
            +
                lastOrHover: boolean | undefined;
         | 
| 99 105 | 
             
            };
         | 
| 100 106 | 
             
            type MessageIfProps = RequireAtLeastOne<MessageIfFilters> & {
         | 
| 101 107 | 
             
                children: React.ReactNode;
         | 
| @@ -104,10 +110,8 @@ declare const MessageIf: FC<MessageIfProps>; | |
| 104 110 |  | 
| 105 111 | 
             
            declare const MessageContent: FC;
         | 
| 106 112 |  | 
| 107 | 
            -
            declare  | 
| 108 | 
            -
             | 
| 109 | 
            -
            declare namespace index$3 {
         | 
| 110 | 
            -
              export { MessageContent as Content, MessageEditableContent as EditableContent, MessageIf as If, MessageProvider as Provider, MessageRoot as Root };
         | 
| 113 | 
            +
            declare namespace index$2 {
         | 
| 114 | 
            +
              export { MessageContent as Content, MessageIf as If, MessageProvider as Provider, MessageRoot as Root };
         | 
| 111 115 | 
             
            }
         | 
| 112 116 |  | 
| 113 117 | 
             
            declare const BranchPickerNext: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| @@ -134,7 +138,7 @@ declare const BranchPickerRoot: react.ForwardRefExoticComponent<Pick<Omit<react. | |
| 134 138 | 
             
                hideWhenSingleBranch?: boolean;
         | 
| 135 139 | 
             
            } & react.RefAttributes<HTMLDivElement>>;
         | 
| 136 140 |  | 
| 137 | 
            -
            declare namespace index$ | 
| 141 | 
            +
            declare namespace index$1 {
         | 
| 138 142 | 
             
              export { BranchPickerCount as Count, BranchPickerNext as Next, BranchPickerNumber as Number, BranchPickerPrevious as Previous, BranchPickerRoot as Root };
         | 
| 139 143 | 
             
            }
         | 
| 140 144 |  | 
| @@ -142,7 +146,11 @@ declare const ActionBarRoot: react.ForwardRefExoticComponent<Pick<Omit<react.Det | |
| 142 146 | 
             
                ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
         | 
| 143 147 | 
             
            } & {
         | 
| 144 148 | 
             
                asChild?: boolean;
         | 
| 145 | 
            -
            }, "key" | keyof react.HTMLAttributes<HTMLDivElement> | "asChild"> &  | 
| 149 | 
            +
            }, "key" | keyof react.HTMLAttributes<HTMLDivElement> | "asChild"> & {
         | 
| 150 | 
            +
                hideWhenBusy?: boolean;
         | 
| 151 | 
            +
                autohide?: "always" | "not-last" | "never";
         | 
| 152 | 
            +
                autohideFloat?: "always" | "single-branch" | "never";
         | 
| 153 | 
            +
            } & react.RefAttributes<HTMLDivElement>>;
         | 
| 146 154 |  | 
| 147 155 | 
             
            type ActionBarCopyProps = {
         | 
| 148 156 | 
             
                copiedDuration?: number;
         | 
| @@ -165,75 +173,58 @@ declare const ActionBarEdit: react.ForwardRefExoticComponent<Pick<Omit<react.Det | |
| 165 173 | 
             
                asChild?: boolean;
         | 
| 166 174 | 
             
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 167 175 |  | 
| 168 | 
            -
            declare namespace index$1 {
         | 
| 169 | 
            -
              export { ActionBarCopy as Copy, ActionBarEdit as Edit, ActionBarReload as Reload, ActionBarRoot as Root };
         | 
| 170 | 
            -
            }
         | 
| 171 | 
            -
             | 
| 172 | 
            -
            declare const EditBarRoot: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
         | 
| 173 | 
            -
                ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
         | 
| 174 | 
            -
            } & {
         | 
| 175 | 
            -
                asChild?: boolean;
         | 
| 176 | 
            -
            }, "key" | keyof react.HTMLAttributes<HTMLDivElement> | "asChild"> & react.RefAttributes<HTMLDivElement>>;
         | 
| 177 | 
            -
             | 
| 178 | 
            -
            declare const EditBarSave: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| 179 | 
            -
                ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
         | 
| 180 | 
            -
            } & {
         | 
| 181 | 
            -
                asChild?: boolean;
         | 
| 182 | 
            -
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 183 | 
            -
             | 
| 184 | 
            -
            declare const EditBarCancel: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| 185 | 
            -
                ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
         | 
| 186 | 
            -
            } & {
         | 
| 187 | 
            -
                asChild?: boolean;
         | 
| 188 | 
            -
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 189 | 
            -
             | 
| 190 176 | 
             
            declare namespace index {
         | 
| 191 | 
            -
              export {  | 
| 177 | 
            +
              export { ActionBarCopy as Copy, ActionBarEdit as Edit, ActionBarReload as Reload, ActionBarRoot as Root };
         | 
| 192 178 | 
             
            }
         | 
| 193 179 |  | 
| 194 | 
            -
            type  | 
| 180 | 
            +
            type VercelAIAssistantProviderProps = {
         | 
| 195 181 | 
             
                chat: UseChatHelpers;
         | 
| 196 182 | 
             
                children: React.ReactNode;
         | 
| 197 183 | 
             
            };
         | 
| 198 | 
            -
            declare const  | 
| 184 | 
            +
            declare const VercelAIAssistantProvider: FC<VercelAIAssistantProviderProps>;
         | 
| 185 | 
            +
             | 
| 186 | 
            +
            type ComposerState = {
         | 
| 187 | 
            +
                isEditing: boolean;
         | 
| 188 | 
            +
                canCancel: boolean;
         | 
| 189 | 
            +
                edit: () => void;
         | 
| 190 | 
            +
                send: () => void;
         | 
| 191 | 
            +
                cancel: () => void;
         | 
| 192 | 
            +
                value: string;
         | 
| 193 | 
            +
                setValue: (value: string) => void;
         | 
| 194 | 
            +
            };
         | 
| 195 | 
            +
            type ComposerStore = {
         | 
| 196 | 
            +
                useComposer: UseBoundStore<StoreApi<ComposerState>>;
         | 
| 197 | 
            +
            };
         | 
| 199 198 |  | 
| 200 199 | 
             
            type BranchState = {
         | 
| 201 200 | 
             
                branchId: number;
         | 
| 202 201 | 
             
                branchCount: number;
         | 
| 203 202 | 
             
            };
         | 
| 204 203 |  | 
| 205 | 
            -
            type  | 
| 206 | 
            -
                isEditing: false;
         | 
| 207 | 
            -
            } | {
         | 
| 208 | 
            -
                isEditing: true;
         | 
| 209 | 
            -
                value: string;
         | 
| 210 | 
            -
            };
         | 
| 211 | 
            -
            type MessageStore = {
         | 
| 204 | 
            +
            type MessageState = {
         | 
| 212 205 | 
             
                message: Message;
         | 
| 213 | 
            -
                editState: MessageEditState;
         | 
| 214 | 
            -
                setEditState: (value: MessageEditState) => void;
         | 
| 215 206 | 
             
                branchState: BranchState;
         | 
| 207 | 
            +
                isLast: boolean;
         | 
| 216 208 | 
             
                isCopied: boolean;
         | 
| 217 209 | 
             
                setIsCopied: (value: boolean) => void;
         | 
| 218 210 | 
             
                isHovering: boolean;
         | 
| 219 211 | 
             
                setIsHovering: (value: boolean) => void;
         | 
| 220 212 | 
             
            };
         | 
| 221 | 
            -
             | 
| 213 | 
            +
            type MessageStore = ComposerStore & {
         | 
| 214 | 
            +
                useMessage: UseBoundStore<StoreApi<MessageState>>;
         | 
| 215 | 
            +
            };
         | 
| 216 | 
            +
            declare const useMessageContext: () => MessageStore;
         | 
| 222 217 |  | 
| 223 218 | 
             
            declare const useCopyMessage: ({ copiedDuration }: {
         | 
| 224 219 | 
             
                copiedDuration?: number | undefined;
         | 
| 225 220 | 
             
            }) => (() => void) | null;
         | 
| 226 221 |  | 
| 227 | 
            -
            declare const useReloadMessage: () => (() =>  | 
| 222 | 
            +
            declare const useReloadMessage: () => (() => void) | null;
         | 
| 228 223 |  | 
| 229 224 | 
             
            declare const useBeginMessageEdit: () => (() => void) | null;
         | 
| 230 225 |  | 
| 231 | 
            -
            declare const useCancelMessageEdit: () => (() => void) | null;
         | 
| 232 | 
            -
             | 
| 233 | 
            -
            declare const useSaveMessageEdit: () => (() => void) | null;
         | 
| 234 | 
            -
             | 
| 235 226 | 
             
            declare const useGoToNextBranch: () => (() => void) | null;
         | 
| 236 227 |  | 
| 237 228 | 
             
            declare const useGoToPreviousBranch: () => (() => void) | null;
         | 
| 238 229 |  | 
| 239 | 
            -
            export { index | 
| 230 | 
            +
            export { index as ActionBarPrimitive, index$1 as BranchPickerPrimitive, index$3 as ComposerPrimitive, index$2 as MessagePrimitive, index$4 as ThreadPrimitive, VercelAIAssistantProvider as VercelAIThreadProvider, useMessageContext as unstable_useMessageContext, useBeginMessageEdit, useCopyMessage, useGoToNextBranch, useGoToPreviousBranch, useReloadMessage };
         | 
    
        package/dist/index.d.ts
    CHANGED
    
    | @@ -3,6 +3,7 @@ import { FC, PropsWithChildren } from 'react'; | |
| 3 3 | 
             
            import { TextareaAutosizeProps } from 'react-textarea-autosize';
         | 
| 4 4 | 
             
            import { Message } from 'ai';
         | 
| 5 5 | 
             
            import { UseChatHelpers } from 'ai/react';
         | 
| 6 | 
            +
            import { UseBoundStore, StoreApi } from 'zustand';
         | 
| 6 7 |  | 
| 7 8 | 
             
            declare const ThreadRoot: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
         | 
| 8 9 | 
             
                ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
         | 
| @@ -36,18 +37,18 @@ type ThreadMessagesProps = { | |
| 36 37 | 
             
                components: {
         | 
| 37 38 | 
             
                    Message: React.ComponentType;
         | 
| 38 39 | 
             
                    UserMessage?: React.ComponentType;
         | 
| 39 | 
            -
                     | 
| 40 | 
            +
                    EditComposer?: React.ComponentType;
         | 
| 40 41 | 
             
                    AssistantMessage?: React.ComponentType;
         | 
| 41 42 | 
             
                } | {
         | 
| 42 43 | 
             
                    Message?: React.ComponentType;
         | 
| 43 44 | 
             
                    UserMessage: React.ComponentType;
         | 
| 44 | 
            -
                     | 
| 45 | 
            +
                    EditComposer?: React.ComponentType;
         | 
| 45 46 | 
             
                    AssistantMessage: React.ComponentType;
         | 
| 46 47 | 
             
                };
         | 
| 47 48 | 
             
            };
         | 
| 48 49 | 
             
            declare const ThreadMessages: FC<ThreadMessagesProps>;
         | 
| 49 50 |  | 
| 50 | 
            -
            declare namespace index$ | 
| 51 | 
            +
            declare namespace index$4 {
         | 
| 51 52 | 
             
              export { ThreadEmpty as Empty, ThreadIf as If, ThreadMessages as Messages, ThreadRoot as Root, ThreadViewport as Viewport };
         | 
| 52 53 | 
             
            }
         | 
| 53 54 |  | 
| @@ -67,14 +68,20 @@ declare const ComposerSend: react.ForwardRefExoticComponent<Pick<Omit<react.Deta | |
| 67 68 | 
             
                asChild?: boolean;
         | 
| 68 69 | 
             
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 69 70 |  | 
| 70 | 
            -
            declare const  | 
| 71 | 
            +
            declare const ComposerCancel: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| 71 72 | 
             
                ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
         | 
| 72 73 | 
             
            } & {
         | 
| 73 74 | 
             
                asChild?: boolean;
         | 
| 74 75 | 
             
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 75 76 |  | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 77 | 
            +
            type ComposerIfFilters = {
         | 
| 78 | 
            +
                editing: boolean | undefined;
         | 
| 79 | 
            +
            };
         | 
| 80 | 
            +
            type ComposerIfProps = PropsWithChildren<RequireAtLeastOne<ComposerIfFilters>>;
         | 
| 81 | 
            +
            declare const ComposerIf: FC<ComposerIfProps>;
         | 
| 82 | 
            +
             | 
| 83 | 
            +
            declare namespace index$3 {
         | 
| 84 | 
            +
              export { ComposerCancel as Cancel, ComposerIf as If, ComposerInput as Input, ComposerRoot as Root, ComposerSend as Send };
         | 
| 78 85 | 
             
            }
         | 
| 79 86 |  | 
| 80 87 | 
             
            type MessageProviderProps = {
         | 
| @@ -92,10 +99,9 @@ declare const MessageRoot: react.ForwardRefExoticComponent<Pick<Omit<react.Detai | |
| 92 99 | 
             
            type MessageIfFilters = {
         | 
| 93 100 | 
             
                user: boolean | undefined;
         | 
| 94 101 | 
             
                assistant: boolean | undefined;
         | 
| 95 | 
            -
                editing: boolean | undefined;
         | 
| 96 102 | 
             
                hasBranches: boolean | undefined;
         | 
| 97 103 | 
             
                copied: boolean | undefined;
         | 
| 98 | 
            -
                 | 
| 104 | 
            +
                lastOrHover: boolean | undefined;
         | 
| 99 105 | 
             
            };
         | 
| 100 106 | 
             
            type MessageIfProps = RequireAtLeastOne<MessageIfFilters> & {
         | 
| 101 107 | 
             
                children: React.ReactNode;
         | 
| @@ -104,10 +110,8 @@ declare const MessageIf: FC<MessageIfProps>; | |
| 104 110 |  | 
| 105 111 | 
             
            declare const MessageContent: FC;
         | 
| 106 112 |  | 
| 107 | 
            -
            declare  | 
| 108 | 
            -
             | 
| 109 | 
            -
            declare namespace index$3 {
         | 
| 110 | 
            -
              export { MessageContent as Content, MessageEditableContent as EditableContent, MessageIf as If, MessageProvider as Provider, MessageRoot as Root };
         | 
| 113 | 
            +
            declare namespace index$2 {
         | 
| 114 | 
            +
              export { MessageContent as Content, MessageIf as If, MessageProvider as Provider, MessageRoot as Root };
         | 
| 111 115 | 
             
            }
         | 
| 112 116 |  | 
| 113 117 | 
             
            declare const BranchPickerNext: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| @@ -134,7 +138,7 @@ declare const BranchPickerRoot: react.ForwardRefExoticComponent<Pick<Omit<react. | |
| 134 138 | 
             
                hideWhenSingleBranch?: boolean;
         | 
| 135 139 | 
             
            } & react.RefAttributes<HTMLDivElement>>;
         | 
| 136 140 |  | 
| 137 | 
            -
            declare namespace index$ | 
| 141 | 
            +
            declare namespace index$1 {
         | 
| 138 142 | 
             
              export { BranchPickerCount as Count, BranchPickerNext as Next, BranchPickerNumber as Number, BranchPickerPrevious as Previous, BranchPickerRoot as Root };
         | 
| 139 143 | 
             
            }
         | 
| 140 144 |  | 
| @@ -142,7 +146,11 @@ declare const ActionBarRoot: react.ForwardRefExoticComponent<Pick<Omit<react.Det | |
| 142 146 | 
             
                ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
         | 
| 143 147 | 
             
            } & {
         | 
| 144 148 | 
             
                asChild?: boolean;
         | 
| 145 | 
            -
            }, "key" | keyof react.HTMLAttributes<HTMLDivElement> | "asChild"> &  | 
| 149 | 
            +
            }, "key" | keyof react.HTMLAttributes<HTMLDivElement> | "asChild"> & {
         | 
| 150 | 
            +
                hideWhenBusy?: boolean;
         | 
| 151 | 
            +
                autohide?: "always" | "not-last" | "never";
         | 
| 152 | 
            +
                autohideFloat?: "always" | "single-branch" | "never";
         | 
| 153 | 
            +
            } & react.RefAttributes<HTMLDivElement>>;
         | 
| 146 154 |  | 
| 147 155 | 
             
            type ActionBarCopyProps = {
         | 
| 148 156 | 
             
                copiedDuration?: number;
         | 
| @@ -165,75 +173,58 @@ declare const ActionBarEdit: react.ForwardRefExoticComponent<Pick<Omit<react.Det | |
| 165 173 | 
             
                asChild?: boolean;
         | 
| 166 174 | 
             
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 167 175 |  | 
| 168 | 
            -
            declare namespace index$1 {
         | 
| 169 | 
            -
              export { ActionBarCopy as Copy, ActionBarEdit as Edit, ActionBarReload as Reload, ActionBarRoot as Root };
         | 
| 170 | 
            -
            }
         | 
| 171 | 
            -
             | 
| 172 | 
            -
            declare const EditBarRoot: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
         | 
| 173 | 
            -
                ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
         | 
| 174 | 
            -
            } & {
         | 
| 175 | 
            -
                asChild?: boolean;
         | 
| 176 | 
            -
            }, "key" | keyof react.HTMLAttributes<HTMLDivElement> | "asChild"> & react.RefAttributes<HTMLDivElement>>;
         | 
| 177 | 
            -
             | 
| 178 | 
            -
            declare const EditBarSave: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| 179 | 
            -
                ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
         | 
| 180 | 
            -
            } & {
         | 
| 181 | 
            -
                asChild?: boolean;
         | 
| 182 | 
            -
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 183 | 
            -
             | 
| 184 | 
            -
            declare const EditBarCancel: react.ForwardRefExoticComponent<Pick<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
         | 
| 185 | 
            -
                ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
         | 
| 186 | 
            -
            } & {
         | 
| 187 | 
            -
                asChild?: boolean;
         | 
| 188 | 
            -
            }, "key" | "asChild" | keyof react.ButtonHTMLAttributes<HTMLButtonElement>> & react.RefAttributes<HTMLButtonElement>>;
         | 
| 189 | 
            -
             | 
| 190 176 | 
             
            declare namespace index {
         | 
| 191 | 
            -
              export {  | 
| 177 | 
            +
              export { ActionBarCopy as Copy, ActionBarEdit as Edit, ActionBarReload as Reload, ActionBarRoot as Root };
         | 
| 192 178 | 
             
            }
         | 
| 193 179 |  | 
| 194 | 
            -
            type  | 
| 180 | 
            +
            type VercelAIAssistantProviderProps = {
         | 
| 195 181 | 
             
                chat: UseChatHelpers;
         | 
| 196 182 | 
             
                children: React.ReactNode;
         | 
| 197 183 | 
             
            };
         | 
| 198 | 
            -
            declare const  | 
| 184 | 
            +
            declare const VercelAIAssistantProvider: FC<VercelAIAssistantProviderProps>;
         | 
| 185 | 
            +
             | 
| 186 | 
            +
            type ComposerState = {
         | 
| 187 | 
            +
                isEditing: boolean;
         | 
| 188 | 
            +
                canCancel: boolean;
         | 
| 189 | 
            +
                edit: () => void;
         | 
| 190 | 
            +
                send: () => void;
         | 
| 191 | 
            +
                cancel: () => void;
         | 
| 192 | 
            +
                value: string;
         | 
| 193 | 
            +
                setValue: (value: string) => void;
         | 
| 194 | 
            +
            };
         | 
| 195 | 
            +
            type ComposerStore = {
         | 
| 196 | 
            +
                useComposer: UseBoundStore<StoreApi<ComposerState>>;
         | 
| 197 | 
            +
            };
         | 
| 199 198 |  | 
| 200 199 | 
             
            type BranchState = {
         | 
| 201 200 | 
             
                branchId: number;
         | 
| 202 201 | 
             
                branchCount: number;
         | 
| 203 202 | 
             
            };
         | 
| 204 203 |  | 
| 205 | 
            -
            type  | 
| 206 | 
            -
                isEditing: false;
         | 
| 207 | 
            -
            } | {
         | 
| 208 | 
            -
                isEditing: true;
         | 
| 209 | 
            -
                value: string;
         | 
| 210 | 
            -
            };
         | 
| 211 | 
            -
            type MessageStore = {
         | 
| 204 | 
            +
            type MessageState = {
         | 
| 212 205 | 
             
                message: Message;
         | 
| 213 | 
            -
                editState: MessageEditState;
         | 
| 214 | 
            -
                setEditState: (value: MessageEditState) => void;
         | 
| 215 206 | 
             
                branchState: BranchState;
         | 
| 207 | 
            +
                isLast: boolean;
         | 
| 216 208 | 
             
                isCopied: boolean;
         | 
| 217 209 | 
             
                setIsCopied: (value: boolean) => void;
         | 
| 218 210 | 
             
                isHovering: boolean;
         | 
| 219 211 | 
             
                setIsHovering: (value: boolean) => void;
         | 
| 220 212 | 
             
            };
         | 
| 221 | 
            -
             | 
| 213 | 
            +
            type MessageStore = ComposerStore & {
         | 
| 214 | 
            +
                useMessage: UseBoundStore<StoreApi<MessageState>>;
         | 
| 215 | 
            +
            };
         | 
| 216 | 
            +
            declare const useMessageContext: () => MessageStore;
         | 
| 222 217 |  | 
| 223 218 | 
             
            declare const useCopyMessage: ({ copiedDuration }: {
         | 
| 224 219 | 
             
                copiedDuration?: number | undefined;
         | 
| 225 220 | 
             
            }) => (() => void) | null;
         | 
| 226 221 |  | 
| 227 | 
            -
            declare const useReloadMessage: () => (() =>  | 
| 222 | 
            +
            declare const useReloadMessage: () => (() => void) | null;
         | 
| 228 223 |  | 
| 229 224 | 
             
            declare const useBeginMessageEdit: () => (() => void) | null;
         | 
| 230 225 |  | 
| 231 | 
            -
            declare const useCancelMessageEdit: () => (() => void) | null;
         | 
| 232 | 
            -
             | 
| 233 | 
            -
            declare const useSaveMessageEdit: () => (() => void) | null;
         | 
| 234 | 
            -
             | 
| 235 226 | 
             
            declare const useGoToNextBranch: () => (() => void) | null;
         | 
| 236 227 |  | 
| 237 228 | 
             
            declare const useGoToPreviousBranch: () => (() => void) | null;
         | 
| 238 229 |  | 
| 239 | 
            -
            export { index | 
| 230 | 
            +
            export { index as ActionBarPrimitive, index$1 as BranchPickerPrimitive, index$3 as ComposerPrimitive, index$2 as MessagePrimitive, index$4 as ThreadPrimitive, VercelAIAssistantProvider as VercelAIThreadProvider, useMessageContext as unstable_useMessageContext, useBeginMessageEdit, useCopyMessage, useGoToNextBranch, useGoToPreviousBranch, useReloadMessage };
         |