@assistant-ui/react-native 0.1.41 → 0.1.42

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.ts CHANGED
@@ -14,9 +14,9 @@ import { threadListItem_d_exports } from "./primitives/threadListItem.js";
14
14
  import { chainOfThought_d_exports } from "./primitives/chainOfThought.js";
15
15
  import { suggestion_d_exports } from "./primitives/suggestion.js";
16
16
  import { index_d_exports } from "./primitives/error/index.js";
17
- import { AppendMessage, AssistantRuntime, Attachment, AttachmentAdapter, AttachmentRuntime, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, CompleteAttachment, ComposerRuntime, CompositeAttachmentAdapter, CreateAttachment, CreateSuggestionAdapterOptions, DataMessagePart, EditComposerRuntime, ExportedMessageRepository, ExportedMessageRepositoryItem, FeedbackAdapter, FileMessagePart, ImageMessagePart, InMemoryThreadListAdapter, LanguageModelConfig, LanguageModelV1CallSettings, MessageRole, MessageRuntime, MessageStatus, ModelContext, ModelContextProvider, ModelContextRegistry, ModelContextRegistryInstructionHandle, ModelContextRegistryProviderHandle, ModelContextRegistryToolHandle, PendingAttachment, RealtimeVoiceAdapter, ReasoningMessagePart, RemoteThreadListAdapter, RemoteThreadListOptions, RemoteThreadListProviderComponent, RespondToToolApprovalOptions, RunConfig, RuntimeCapabilities, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SourceMessagePart, SuggestionAdapter, SuggestionAdapterGenerateOptions, TextMessagePart, ThreadAssistantMessage, ThreadAssistantMessagePart, ThreadComposerRuntime, ThreadHistoryAdapter, ThreadListItemRuntime, ThreadListRuntime, ThreadMessage, ThreadMessageLike, ThreadRuntime, ThreadSystemMessage, ThreadUserMessage, ThreadUserMessagePart, ToolApprovalDisplay, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolCallMessagePart, ToolCallTiming, ToolModelContentPart, Unstable_AudioMessagePart, Unstable_InteractableSnapshotEntry, Unstable_InteractableVersion, Unsubscribe, VoiceSessionControls, VoiceSessionHelpers, createSuggestionAdapter, createVoiceSession, fromThreadMessageLike, generateId, mergeModelContexts, tool, toolApprovalAcceptsText, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
17
+ import { AppendMessage, AssistantRuntime, Attachment, AttachmentAdapter, AttachmentRuntime, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, CompleteAttachment, ComposerRuntime, CompositeAttachmentAdapter, CreateAttachment, CreateSuggestionAdapterOptions, DataMessagePart, EditComposerRuntime, ExportedMessageRepository, ExportedMessageRepositoryItem, ExternalStoreAdapter, ExternalStoreBranchChange, ExternalStoreMessageConverter, ExternalStoreSharedOptions, ExternalStoreThreadData, ExternalStoreThreadListAdapter, ExternalThreadBranchAdapter, ExternalThreadQueueAdapter, FeedbackAdapter, FileMessagePart, ImageMessagePart, InMemoryThreadListAdapter, LanguageModelConfig, LanguageModelV1CallSettings, MessageNotSentError, MessageQueueController, MessageQueueDriver, MessageRole, MessageRuntime, MessageStatus, ModelContext, ModelContextProvider, ModelContextRegistry, ModelContextRegistryInstructionHandle, ModelContextRegistryProviderHandle, ModelContextRegistryToolHandle, PendingAttachment, RealtimeVoiceAdapter, ReasoningMessagePart, RemoteThreadListAdapter, RemoteThreadListOptions, RemoteThreadListProviderComponent, RespondToToolApprovalOptions, RunConfig, RuntimeCapabilities, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SourceMessagePart, SuggestionAdapter, SuggestionAdapterGenerateOptions, TextMessagePart, ThreadAssistantMessage, ThreadAssistantMessagePart, ThreadComposerRuntime, ThreadHistoryAdapter, ThreadListItemRuntime, ThreadListRuntime, ThreadMessage, ThreadMessageLike, ThreadRuntime, ThreadSystemMessage, ThreadUserMessage, ThreadUserMessagePart, ToolApprovalDisplay, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolCallMessagePart, ToolCallTiming, ToolModelContentPart, Unstable_AudioMessagePart, Unstable_InteractableSnapshotEntry, Unstable_InteractableVersion, Unsubscribe, VoiceSessionControls, VoiceSessionHelpers, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, toolApprovalAcceptsText, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
18
18
  import { AssistantClient, AssistantEventCallback, AssistantEventName, AssistantEventPayload, AssistantEventScope, AssistantEventSelector, AssistantState, AuiConfig, AuiIf, AuiProvider, useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
19
- import { AssistantContextConfig, AssistantDataUI, AssistantDataUIProps, AssistantInteractableProps, AssistantTool, AssistantToolProps, AssistantToolUI, AssistantToolUIProps, ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ComposerAttachmentByIndexProvider, DataMessagePartComponent, DataMessagePartProps, DataRenderers, EmptyMessagePartComponent, EmptyMessagePartProps, FileMessagePartComponent, FileMessagePartProps, GroupByContext, ImageMessagePartComponent, ImageMessagePartProps, Interactables, McpToolkitDefinition, McpToolkitEntry, McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, PartByIndexProvider, ProviderToolConfig, ReasoningGroupComponent, ReasoningGroupProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, RuntimeAdapterProvider, RuntimeAdapters, SourceMessagePartComponent, SourceMessagePartProps, SuggestionByIndexProvider, TextMessagePartComponent, TextMessagePartProps, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, ToolArgsStatus, ToolCallMessagePartComponent, ToolCallMessagePartProps, ToolCallText, ToolDefinition, Toolkit, ToolkitDefinition, ToolkitDefinitionEntry, Tools, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, Unstable_InferInteractableState, Unstable_InteractableConfig, Unstable_InteractableDefinition, Unstable_InteractablePersistedState, Unstable_InteractablePersistenceAdapter, Unstable_InteractablePersistenceStatus, Unstable_InteractableRegistration, Unstable_InteractableStateSchema, Unstable_InteractableToolConfig, Unstable_InteractableToolRenderProps, Unstable_InteractableVersionInfo, Unstable_InteractablesClientSchema, Unstable_InteractablesConfig, Unstable_InteractablesMethods, Unstable_InteractablesState, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
20
- import { AttachmentState, ChainOfThoughtClient, ComposerState, MessageState, ModelContext as ModelContextClient, QueueItemState, SuggestionConfig, Suggestions, ThreadListItemState, ThreadState, ThreadsState } from "@assistant-ui/core/store";
19
+ import { AssistantContextConfig, AssistantDataUI, AssistantDataUIProps, AssistantInteractableProps, AssistantTool, AssistantToolProps, AssistantToolUI, AssistantToolUIProps, ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ComposerAttachmentByIndexProvider, DataMessagePartComponent, DataMessagePartProps, DataRenderers, EmptyMessagePartComponent, EmptyMessagePartProps, ExternalMessageConversionCache as Unstable_ExternalMessageConversionCache, FileMessagePartComponent, FileMessagePartProps, GroupByContext, ImageMessagePartComponent, ImageMessagePartProps, Interactables, JoinStrategy, McpToolkitDefinition, McpToolkitEntry, McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, PartByIndexProvider, ProviderToolConfig, ReasoningGroupComponent, ReasoningGroupProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, RuntimeAdapterProvider, RuntimeAdapters, SourceMessagePartComponent, SourceMessagePartProps, SuggestionByIndexProvider, TextMessagePartComponent, TextMessagePartProps, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, ToolArgsStatus, ToolCallMessagePartComponent, ToolCallMessagePartProps, ToolCallText, ToolDefinition, Toolkit, ToolkitDefinition, ToolkitDefinitionEntry, Tools, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, Unstable_InferInteractableState, Unstable_InteractableConfig, Unstable_InteractableDefinition, Unstable_InteractablePersistedState, Unstable_InteractablePersistenceAdapter, Unstable_InteractablePersistenceStatus, Unstable_InteractableRegistration, Unstable_InteractableStateSchema, Unstable_InteractableToolConfig, Unstable_InteractableToolRenderProps, Unstable_InteractableVersionInfo, Unstable_InteractablesClientSchema, Unstable_InteractablesConfig, Unstable_InteractablesMethods, Unstable_InteractablesState, convertExternalMessages as unstable_convertExternalMessages, createExternalMessageConversionCache as unstable_createExternalMessageConversionCache, createMessageConverter as unstable_createMessageConverter, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
20
+ import { AttachmentState, ChainOfThoughtClient, ComposerState, MessageState, ModelContext as ModelContextClient, QueueItemState, SuggestionConfig, Suggestions, TaskState, ThreadListItemState, ThreadState, ThreadsState } from "@assistant-ui/core/store";
21
21
  import { Tool } from "assistant-stream";
22
- export { actionBar_d_exports as ActionBarPrimitive, type AppendMessage, type AssistantClient, type AssistantContextConfig, type AssistantDataUI, type AssistantDataUIProps, type AssistantEventCallback, type AssistantEventName, type AssistantEventPayload, type AssistantEventScope, type AssistantEventSelector, type AssistantInteractableProps, type AssistantRuntime, AssistantRuntimeProvider, type AssistantState, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type Attachment, type AttachmentAdapter, attachment_d_exports as AttachmentPrimitive, type AttachmentRuntime, type AttachmentState, AuiConfig, AuiIf, AuiProvider, branchPicker_d_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_d_exports as ChainOfThoughtPrimitive, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type CompleteAttachment, ComposerAttachmentByIndexProvider, composer_d_exports as ComposerPrimitive, type ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, type CreateAttachment, type CreateSuggestionAdapterOptions, type DataMessagePart, type DataMessagePartComponent, type DataMessagePartProps, DataRenderers, type EditComposerRuntime, type EmptyMessagePartComponent, type EmptyMessagePartProps, index_d_exports as ErrorPrimitive, ExportedMessageRepository, type ExportedMessageRepositoryItem, type FeedbackAdapter, type FileMessagePart, type FileMessagePartComponent, type FileMessagePartProps, type GroupByContext, type ImageMessagePart, type ImageMessagePartComponent, type ImageMessagePartProps, InMemoryThreadListAdapter, Interactables, type LanguageModelConfig, type LanguageModelV1CallSettings, type LocalRuntimeOptions, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, message_d_exports as MessagePrimitive, type MessageRole, type MessageRuntime, type MessageState, type MessageStatus, type ModelContext, ModelContextClient, type ModelContextProvider, ModelContextRegistry, type ModelContextRegistryInstructionHandle, type ModelContextRegistryProviderHandle, type ModelContextRegistryToolHandle, PartByIndexProvider, type PendingAttachment, type ProviderToolConfig, queueItem_d_exports as QueueItemPrimitive, type QueueItemState, type RealtimeVoiceAdapter, type ReasoningGroupComponent, type ReasoningGroupProps, type ReasoningMessagePart, type ReasoningMessagePartComponent, type ReasoningMessagePartProps, type RemoteThreadListAdapter, type RemoteThreadListOptions, type RemoteThreadListProviderComponent, type RespondToToolApprovalOptions, type RunConfig, RuntimeAdapterProvider, type RuntimeAdapters, type RuntimeCapabilities, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, type SourceMessagePart, type SourceMessagePartComponent, type SourceMessagePartProps, type SuggestionAdapter, type SuggestionAdapterGenerateOptions, SuggestionByIndexProvider, type SuggestionConfig, suggestion_d_exports as SuggestionPrimitive, Suggestions, type TextMessagePart, type TextMessagePartComponent, type TextMessagePartProps, TextMessagePartProvider, type ThreadAssistantMessage, type ThreadAssistantMessagePart, type ThreadComposerRuntime, type ThreadHistoryAdapter, ThreadListItemByIndexProvider, threadListItem_d_exports as ThreadListItemPrimitive, type ThreadListItemRuntime, ThreadListItemRuntimeProvider, type ThreadListItemState, threadList_d_exports as ThreadListPrimitive, type ThreadListRuntime, type ThreadMessage, type ThreadMessageLike, thread_d_exports as ThreadPrimitive, type ThreadRuntime, type ThreadState, type ThreadSystemMessage, type ThreadUserMessage, type ThreadUserMessagePart, type ThreadsState, type Tool, type ToolApprovalDisplay, type ToolApprovalOption, type ToolApprovalOptionKind, type ToolApprovalResponse, type ToolArgsStatus, type ToolCallMessagePart, type ToolCallMessagePartComponent, type ToolCallMessagePartProps, type ToolCallText, type ToolCallTiming, type ToolDefinition, type ToolModelContentPart, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, Tools, type Unstable_AudioMessagePart, type Unstable_AudioMessagePartComponent, type Unstable_AudioMessagePartProps, type Unstable_InferInteractableState, type Unstable_InteractableConfig, type Unstable_InteractableDefinition, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractableRegistration, type Unstable_InteractableSnapshotEntry, type Unstable_InteractableStateSchema, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableVersion, type Unstable_InteractableVersionInfo, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, type Unstable_InteractablesMethods, type Unstable_InteractablesState, type Unsubscribe, type VoiceSessionControls, type VoiceSessionHelpers, createSuggestionAdapter, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, providerTool, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
22
+ export { actionBar_d_exports as ActionBarPrimitive, type AppendMessage, type AssistantClient, type AssistantContextConfig, type AssistantDataUI, type AssistantDataUIProps, type AssistantEventCallback, type AssistantEventName, type AssistantEventPayload, type AssistantEventScope, type AssistantEventSelector, type AssistantInteractableProps, type AssistantRuntime, AssistantRuntimeProvider, type AssistantState, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type Attachment, type AttachmentAdapter, attachment_d_exports as AttachmentPrimitive, type AttachmentRuntime, type AttachmentState, AuiConfig, AuiIf, AuiProvider, branchPicker_d_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_d_exports as ChainOfThoughtPrimitive, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type CompleteAttachment, ComposerAttachmentByIndexProvider, composer_d_exports as ComposerPrimitive, type ComposerRuntime, type ComposerState, CompositeAttachmentAdapter, type CreateAttachment, type CreateSuggestionAdapterOptions, type DataMessagePart, type DataMessagePartComponent, type DataMessagePartProps, DataRenderers, type EditComposerRuntime, type EmptyMessagePartComponent, type EmptyMessagePartProps, index_d_exports as ErrorPrimitive, ExportedMessageRepository, type ExportedMessageRepositoryItem, type ExternalStoreAdapter, type ExternalStoreBranchChange, type ExternalStoreMessageConverter, type ExternalStoreSharedOptions, type ExternalStoreThreadData, type ExternalStoreThreadListAdapter, type ExternalThreadBranchAdapter, type ExternalThreadQueueAdapter, type FeedbackAdapter, type FileMessagePart, type FileMessagePartComponent, type FileMessagePartProps, type GroupByContext, type ImageMessagePart, type ImageMessagePartComponent, type ImageMessagePartProps, InMemoryThreadListAdapter, Interactables, type JoinStrategy, type LanguageModelConfig, type LanguageModelV1CallSettings, type LocalRuntimeOptions, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, message_d_exports as MessagePrimitive, type MessageQueueController, type MessageQueueDriver, type MessageRole, type MessageRuntime, type MessageState, type MessageStatus, type ModelContext, ModelContextClient, type ModelContextProvider, ModelContextRegistry, type ModelContextRegistryInstructionHandle, type ModelContextRegistryProviderHandle, type ModelContextRegistryToolHandle, PartByIndexProvider, type PendingAttachment, type ProviderToolConfig, queueItem_d_exports as QueueItemPrimitive, type QueueItemState, type RealtimeVoiceAdapter, type ReasoningGroupComponent, type ReasoningGroupProps, type ReasoningMessagePart, type ReasoningMessagePartComponent, type ReasoningMessagePartProps, type RemoteThreadListAdapter, type RemoteThreadListOptions, type RemoteThreadListProviderComponent, type RespondToToolApprovalOptions, type RunConfig, RuntimeAdapterProvider, type RuntimeAdapters, type RuntimeCapabilities, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, type SourceMessagePart, type SourceMessagePartComponent, type SourceMessagePartProps, type SuggestionAdapter, type SuggestionAdapterGenerateOptions, SuggestionByIndexProvider, type SuggestionConfig, suggestion_d_exports as SuggestionPrimitive, Suggestions, type TaskState, type TextMessagePart, type TextMessagePartComponent, type TextMessagePartProps, TextMessagePartProvider, type ThreadAssistantMessage, type ThreadAssistantMessagePart, type ThreadComposerRuntime, type ThreadHistoryAdapter, ThreadListItemByIndexProvider, threadListItem_d_exports as ThreadListItemPrimitive, type ThreadListItemRuntime, ThreadListItemRuntimeProvider, type ThreadListItemState, threadList_d_exports as ThreadListPrimitive, type ThreadListRuntime, type ThreadMessage, type ThreadMessageLike, thread_d_exports as ThreadPrimitive, type ThreadRuntime, type ThreadState, type ThreadSystemMessage, type ThreadUserMessage, type ThreadUserMessagePart, type ThreadsState, type Tool, type ToolApprovalDisplay, type ToolApprovalOption, type ToolApprovalOptionKind, type ToolApprovalResponse, type ToolArgsStatus, type ToolCallMessagePart, type ToolCallMessagePartComponent, type ToolCallMessagePartProps, type ToolCallText, type ToolCallTiming, type ToolDefinition, type ToolModelContentPart, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, Tools, type Unstable_AudioMessagePart, type Unstable_AudioMessagePartComponent, type Unstable_AudioMessagePartProps, type Unstable_ExternalMessageConversionCache, type Unstable_InferInteractableState, type Unstable_InteractableConfig, type Unstable_InteractableDefinition, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractableRegistration, type Unstable_InteractableSnapshotEntry, type Unstable_InteractableStateSchema, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableVersion, type Unstable_InteractableVersionInfo, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, type Unstable_InteractablesMethods, type Unstable_InteractablesState, type Unsubscribe, type VoiceSessionControls, type VoiceSessionHelpers, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, unstable_convertExternalMessages, unstable_createExternalMessageConversionCache, unstable_createMessageConverter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
package/dist/index.js CHANGED
@@ -13,8 +13,8 @@ import { threadListItem_exports } from "./primitives/threadListItem.js";
13
13
  import { chainOfThought_exports } from "./primitives/chainOfThought.js";
14
14
  import { suggestion_exports } from "./primitives/suggestion.js";
15
15
  import { error_exports } from "./primitives/error/index.js";
16
- import { CompositeAttachmentAdapter, ExportedMessageRepository, InMemoryThreadListAdapter, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, createSuggestionAdapter, createVoiceSession, fromThreadMessageLike, generateId, mergeModelContexts, tool, toolApprovalAcceptsText, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
16
+ import { CompositeAttachmentAdapter, ExportedMessageRepository, InMemoryThreadListAdapter, MessageNotSentError, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, toolApprovalAcceptsText, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
17
17
  import { AuiConfig, AuiIf, AuiProvider, useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
18
- import { ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ComposerAttachmentByIndexProvider, DataRenderers, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, PartByIndexProvider, RuntimeAdapterProvider, SuggestionByIndexProvider, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, Tools, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
18
+ import { ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ComposerAttachmentByIndexProvider, DataRenderers, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, PartByIndexProvider, RuntimeAdapterProvider, SuggestionByIndexProvider, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider, Tools, convertExternalMessages as unstable_convertExternalMessages, createExternalMessageConversionCache as unstable_createExternalMessageConversionCache, createMessageConverter as unstable_createMessageConverter, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
19
19
  import { ChainOfThoughtClient, ModelContext as ModelContextClient, Suggestions } from "@assistant-ui/core/store";
20
- export { actionBar_exports as ActionBarPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_exports as ChainOfThoughtPrimitive, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, error_exports as ErrorPrimitive, ExportedMessageRepository, InMemoryThreadListAdapter, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, message_exports as MessagePrimitive, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, RuntimeAdapterProvider, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, createSuggestionAdapter, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, providerTool, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
20
+ export { actionBar_exports as ActionBarPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, ChainOfThoughtPartByIndexProvider, chainOfThought_exports as ChainOfThoughtPrimitive, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, error_exports as ErrorPrimitive, ExportedMessageRepository, InMemoryThreadListAdapter, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, message_exports as MessagePrimitive, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, RuntimeAdapterProvider, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, bindExternalStoreMessage, createMessageQueue, createSuggestionAdapter, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, toolApprovalAcceptsText, unstable_Interactables, unstable_convertExternalMessages, unstable_createExternalMessageConversionCache, unstable_createMessageConverter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useRemoteThreadListRuntime, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
@@ -1,14 +1,12 @@
1
1
  import { PressableProps } from "react-native";
2
2
  //#region src/primitives/composer/ComposerAddAttachment.d.ts
3
- type ComposerAddAttachmentProps = Omit<PressableProps, "onPress" | "children"> & {
3
+ type ComposerAddAttachmentProps = Omit<PressableProps, "children"> & {
4
4
  children: PressableProps["children"];
5
5
  };
6
6
  /**
7
- * A button that triggers the attachment adding flow.
7
+ * A button for adding attachments. It is disabled while the composer cannot accept attachments.
8
8
  *
9
- * Note: The actual file picker implementation is platform-specific.
10
- * This component calls `useComposerAddAttachment()` from `@assistant-ui/core/react`.
11
- * You must handle the file selection in your own component using the returned `addAttachment` callback.
9
+ * React Native has no file input, so the caller opens the platform picker (for example `expo-image-picker`) in `onPress` and passes the selection to `aui.composer.addAttachment`.
12
10
  */
13
11
  declare const ComposerAddAttachment: ({ children, disabled: disabledProp, ...pressableProps }: ComposerAddAttachmentProps) => import("react").JSX.Element;
14
12
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAddAttachment.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"mappings":";;KAGY,6BAA6B,KACvC;EAGA,UAAU;;;;;;;;;cAUC,0BAAyB,UAAA,UAAA,iBAAA,kBAInC,+CAA0B,IAAA"}
1
+ {"version":3,"file":"ComposerAddAttachment.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"mappings":";;KAGY,6BAA6B,KAAK;EAC5C,UAAU;;;;;;;cAQC,0BAAyB,UAAA,UAAA,iBAAA,kBAInC,+CAA0B,IAAA"}
@@ -4,11 +4,9 @@ import { Pressable } from "react-native";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/primitives/composer/ComposerAddAttachment.tsx
6
6
  /**
7
- * A button that triggers the attachment adding flow.
7
+ * A button for adding attachments. It is disabled while the composer cannot accept attachments.
8
8
  *
9
- * Note: The actual file picker implementation is platform-specific.
10
- * This component calls `useComposerAddAttachment()` from `@assistant-ui/core/react`.
11
- * You must handle the file selection in your own component using the returned `addAttachment` callback.
9
+ * React Native has no file input, so the caller opens the platform picker (for example `expo-image-picker`) in `onPress` and passes the selection to `aui.composer.addAttachment`.
12
10
  */
13
11
  const ComposerAddAttachment = (t0) => {
14
12
  const $ = c(8);
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAddAttachment.js","names":["Pressable","PressableProps","useComposerAddAttachment","ComposerAddAttachmentProps","Omit","children","ComposerAddAttachment","t0","$","_c","disabledProp","pressableProps","disabled","t1","t2"],"sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"sourcesContent":["import { Pressable, type PressableProps } from \"react-native\";\nimport { useComposerAddAttachment } from \"@assistant-ui/core/react\";\n\nexport type ComposerAddAttachmentProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n};\n\n/**\n * A button that triggers the attachment adding flow.\n *\n * Note: The actual file picker implementation is platform-specific.\n * This component calls `useComposerAddAttachment()` from `@assistant-ui/core/react`.\n * You must handle the file selection in your own component using the returned `addAttachment` callback.\n */\nexport const ComposerAddAttachment = ({\n children,\n disabled: disabledProp,\n ...pressableProps\n}: ComposerAddAttachmentProps) => {\n const { disabled } = useComposerAddAttachment();\n\n return (\n <Pressable\n disabled={disabledProp ?? disabled}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAaM,yBAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAAO,UAAAF,cAAA,GAAAC,kBAAAJ;EAITC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAN,WAAAG,EAAA;EAAAE,eAAAF,EAAA;EAAAG,iBAAAH,EAAA;CAAA;CAC3B,MAAA,EAAAI,aAAqBV,yBAAyB;CAIhC,MAAAW,KAAAH,gBAAAE;CAAwB,IAAAE;CAAA,IAAAN,EAAA,OAAAH,YAAAG,EAAA,OAAAG,kBAAAH,EAAA,OAAAK,IAAA;EADpCC,KAAA,oBAAC,WAAD;GACY,UAAAD;GACQ,mBAAA;GAAQ,GACtBF;GAEHN;EALO,CAAA;EAMEG,EAAA,KAAAH;EAAAG,EAAA,KAAAG;EAAAH,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OANZM;AAMY"}
1
+ {"version":3,"file":"ComposerAddAttachment.js","names":["Pressable","PressableProps","useComposerAddAttachment","ComposerAddAttachmentProps","Omit","children","ComposerAddAttachment","t0","$","_c","disabledProp","pressableProps","disabled","t1","t2"],"sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"sourcesContent":["import { Pressable, type PressableProps } from \"react-native\";\nimport { useComposerAddAttachment } from \"@assistant-ui/core/react\";\n\nexport type ComposerAddAttachmentProps = Omit<PressableProps, \"children\"> & {\n children: PressableProps[\"children\"];\n};\n\n/**\n * A button for adding attachments. It is disabled while the composer cannot accept attachments.\n *\n * React Native has no file input, so the caller opens the platform picker (for example `expo-image-picker`) in `onPress` and passes the selection to `aui.composer.addAttachment`.\n */\nexport const ComposerAddAttachment = ({\n children,\n disabled: disabledProp,\n ...pressableProps\n}: ComposerAddAttachmentProps) => {\n const { disabled } = useComposerAddAttachment();\n\n return (\n <Pressable\n disabled={disabledProp ?? disabled}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAaM,yBAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAAO,UAAAF,cAAA,GAAAC,kBAAAJ;EAITC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAN,WAAAG,EAAA;EAAAE,eAAAF,EAAA;EAAAG,iBAAAH,EAAA;CAAA;CAC3B,MAAA,EAAAI,aAAqBV,yBAAyB;CAIhC,MAAAW,KAAAH,gBAAAE;CAAwB,IAAAE;CAAA,IAAAN,EAAA,OAAAH,YAAAG,EAAA,OAAAG,kBAAAH,EAAA,OAAAK,IAAA;EADpCC,KAAA,oBAAC,WAAD;GACY,UAAAD;GACQ,mBAAA;GAAQ,GACtBF;GAEHN;EALO,CAAA;EAMEG,EAAA,KAAAH;EAAAG,EAAA,KAAAG;EAAAH,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OANZM;AAMY"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadMessages.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"mappings":";;;;KA2BK;EAEC,SAAS;EACT,eAAe;EACf,mBAAmB;EACnB,wBAAwB;EACxB,qBAAqB;EACrB,cAAc;EACd,mBAAmB;EACnB,gBAAgB;;EAGhB,UAAU;EACV,eAAe;EACf,mBAAmB;EACnB,wBAAwB;EACxB,qBAAqB;EACrB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;;KAGjB;;EAGC,YAAY;EACZ;;EAGA,WAAW;IAAS,SAAS;QAAmB;EAChD;;KAGM,8BAA8B,KACxC,cAAc,sDAGd;EACE;EACA;EACA;EACA;;;KAIQ,sBAAsB;cAsSrB,wCAAsB,0BAAA,8CAAA,cAAA,SAAA;;cA4GtB,gCAAc,0BAAA,8CAAA,cAAA,SAAA"}
1
+ {"version":3,"file":"ThreadMessages.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"mappings":";;;;KA2BK;EAEC,SAAS;EACT,eAAe;EACf,mBAAmB;EACnB,wBAAwB;EACxB,qBAAqB;EACrB,cAAc;EACd,mBAAmB;EACnB,gBAAgB;;EAGhB,UAAU;EACV,eAAe;EACf,mBAAmB;EACnB,wBAAwB;EACxB,qBAAqB;EACrB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;;KAGjB;;EAGC,YAAY;EACZ;;EAGA,WAAW;IAAS,SAAS;QAAmB;EAChD;;KAGM,8BAA8B,KACxC,cAAc,sDAGd;EACE;EACA;EACA;EACA;;;KAIQ,sBAAsB;cA6UrB,wCAAsB,0BAAA,8CAAA,cAAA,SAAA;;cA8GtB,gCAAc,0BAAA,8CAAA,cAAA,SAAA"}
@@ -100,96 +100,111 @@ const useComposedFlatListRef = (forwardedRef) => {
100
100
  return t1;
101
101
  };
102
102
  const useThreadMessagesFlatListAutoScroll = (t0) => {
103
- const $ = c(25);
104
- const { flatListRef, hasMessages, autoScroll: t1, scrollToBottomOnRunStart: t2, scrollToBottomOnInitialize: t3, scrollToBottomOnThreadSwitch: t4 } = t0;
105
- const autoScroll = t1 === void 0 ? true : t1;
106
- const scrollToBottomOnRunStart = t2 === void 0 ? true : t2;
107
- const scrollToBottomOnInitialize = t3 === void 0 ? true : t3;
108
- const scrollToBottomOnThreadSwitch = t4 === void 0 ? true : t4;
109
- let t5;
103
+ const $ = c(29);
104
+ const { flatListRef, hasMessages, horizontal: t1, autoScroll: t2, scrollToBottomOnRunStart: t3, scrollToBottomOnInitialize: t4, scrollToBottomOnThreadSwitch: t5 } = t0;
105
+ const horizontal = t1 === void 0 ? false : t1;
106
+ const autoScroll = t2 === void 0 ? true : t2;
107
+ const scrollToBottomOnRunStart = t3 === void 0 ? true : t3;
108
+ const scrollToBottomOnInitialize = t4 === void 0 ? true : t4;
109
+ const scrollToBottomOnThreadSwitch = t5 === void 0 ? true : t5;
110
+ let t6;
110
111
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
111
- t5 = {
112
+ t6 = {
112
113
  contentHeight: 0,
113
114
  viewportHeight: 0,
114
115
  scrollY: 0
115
116
  };
116
- $[0] = t5;
117
- } else t5 = $[0];
118
- const metricsRef = useRef(t5);
117
+ $[0] = t6;
118
+ } else t6 = $[0];
119
+ const metricsRef = useRef(t6);
119
120
  const isAtBottomRef = useRef(true);
120
- const lastScrollEventYRef = useRef(0);
121
+ const lastScrollEventOffsetRef = useRef(0);
121
122
  const initializeScrollRequestedRef = useRef(false);
123
+ const contentSizeVersionRef = useRef(0);
122
124
  const pendingScrollToBottomRef = useRef(false);
123
- let t6;
125
+ let t7;
124
126
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
125
- t6 = () => {
127
+ t7 = () => {
126
128
  const { contentHeight, scrollY, viewportHeight } = metricsRef.current;
127
129
  isAtBottomRef.current = contentHeight <= viewportHeight || contentHeight - scrollY - viewportHeight <= AT_BOTTOM_THRESHOLD;
128
130
  };
129
- $[1] = t6;
130
- } else t6 = $[1];
131
- const updateIsAtBottom = t6;
132
- let t7;
131
+ $[1] = t7;
132
+ } else t7 = $[1];
133
+ const updateIsAtBottom = t7;
134
+ let t8;
133
135
  if ($[2] !== flatListRef) {
134
- t7 = (animated) => {
136
+ t8 = (animated) => {
135
137
  const { contentHeight: contentHeight_0, viewportHeight: viewportHeight_0 } = metricsRef.current;
136
- metricsRef.current.scrollY = Math.max(0, contentHeight_0 - viewportHeight_0);
138
+ const offset = Math.max(0, contentHeight_0 - viewportHeight_0);
139
+ metricsRef.current.scrollY = offset;
137
140
  isAtBottomRef.current = true;
138
- flatListRef.current?.scrollToEnd({ animated });
141
+ flatListRef.current?.scrollToOffset({
142
+ offset,
143
+ animated
144
+ });
139
145
  };
140
146
  $[2] = flatListRef;
141
- $[3] = t7;
142
- } else t7 = $[3];
143
- const scrollToBottom = t7;
144
- let t8;
145
- if ($[4] !== autoScroll || $[5] !== scrollToBottom) {
146
- t8 = (event) => {
147
+ $[3] = t8;
148
+ } else t8 = $[3];
149
+ const scrollToBottom = t8;
150
+ let t9;
151
+ if ($[4] !== autoScroll || $[5] !== horizontal || $[6] !== scrollToBottom) {
152
+ t9 = (event) => {
147
153
  const wasAtBottom = isAtBottomRef.current;
148
154
  const previousViewportHeight = metricsRef.current.viewportHeight;
149
- const viewportHeight_1 = event.nativeEvent.layout.height;
155
+ const viewportHeight_1 = horizontal ? event.nativeEvent.layout.width : event.nativeEvent.layout.height;
150
156
  metricsRef.current.viewportHeight = viewportHeight_1;
151
157
  updateIsAtBottom();
158
+ const pending = pendingScrollToBottomRef.current;
159
+ if (pending && contentSizeVersionRef.current >= pending.minimumContentSizeVersion && viewportHeight_1 > 0) {
160
+ pendingScrollToBottomRef.current = false;
161
+ scrollToBottom(pending.animated);
162
+ return;
163
+ }
152
164
  if (!wasAtBottom) return;
153
- if (autoScroll && previousViewportHeight !== 0 && viewportHeight_1 !== previousViewportHeight) {
154
- const pending = pendingScrollToBottomRef.current;
155
- scrollToBottom(pending ? pending.animated : false);
156
- } else isAtBottomRef.current = true;
165
+ if (autoScroll && previousViewportHeight !== 0 && viewportHeight_1 !== previousViewportHeight) scrollToBottom(pending ? pending.animated : false);
166
+ else isAtBottomRef.current = true;
157
167
  };
158
168
  $[4] = autoScroll;
159
- $[5] = scrollToBottom;
160
- $[6] = t8;
161
- } else t8 = $[6];
162
- const handleLayout = t8;
163
- let t9;
164
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
165
- t9 = (event_0) => {
169
+ $[5] = horizontal;
170
+ $[6] = scrollToBottom;
171
+ $[7] = t9;
172
+ } else t9 = $[7];
173
+ const handleLayout = t9;
174
+ let t10;
175
+ if ($[8] !== horizontal) {
176
+ t10 = (event_0) => {
166
177
  const { contentOffset, contentSize, layoutMeasurement } = event_0.nativeEvent;
167
- const previousEventY = lastScrollEventYRef.current;
178
+ const scrollOffset = horizontal ? contentOffset.x : contentOffset.y;
179
+ const previousEventOffset = lastScrollEventOffsetRef.current;
168
180
  const wasPinnedToBottom = isAtBottomRef.current;
169
- lastScrollEventYRef.current = contentOffset.y;
181
+ lastScrollEventOffsetRef.current = scrollOffset;
170
182
  metricsRef.current = {
171
- contentHeight: contentSize.height,
172
- viewportHeight: layoutMeasurement.height,
173
- scrollY: contentOffset.y
183
+ contentHeight: horizontal ? contentSize.width : contentSize.height,
184
+ viewportHeight: horizontal ? layoutMeasurement.width : layoutMeasurement.height,
185
+ scrollY: scrollOffset
174
186
  };
175
187
  updateIsAtBottom();
176
- const upwardMove = contentOffset.y < previousEventY;
188
+ const upwardMove = scrollOffset < previousEventOffset;
177
189
  if (wasPinnedToBottom && !upwardMove) isAtBottomRef.current = true;
178
190
  if (!isAtBottomRef.current && upwardMove) pendingScrollToBottomRef.current = false;
179
191
  };
180
- $[7] = t9;
181
- } else t9 = $[7];
182
- const handleScroll = t9;
183
- let t10;
184
- if ($[8] !== autoScroll || $[9] !== scrollToBottom) {
185
- t10 = (_width, height) => {
192
+ $[8] = horizontal;
193
+ $[9] = t10;
194
+ } else t10 = $[9];
195
+ const handleScroll = t10;
196
+ let t11;
197
+ if ($[10] !== autoScroll || $[11] !== horizontal || $[12] !== scrollToBottom) {
198
+ t11 = (width, height) => {
186
199
  const metrics = metricsRef.current;
200
+ const contentHeight_1 = horizontal ? width : height;
187
201
  const previousContentHeight = metrics.contentHeight;
188
202
  const wasAtBottom_0 = isAtBottomRef.current;
189
- metrics.contentHeight = height;
203
+ if (contentHeight_1 > 0) contentSizeVersionRef.current = contentSizeVersionRef.current + 1;
204
+ metrics.contentHeight = contentHeight_1;
190
205
  updateIsAtBottom();
191
206
  const pendingScroll = pendingScrollToBottomRef.current;
192
- if (pendingScroll) {
207
+ if (pendingScroll && contentSizeVersionRef.current >= pendingScroll.minimumContentSizeVersion && metrics.viewportHeight > 0) {
193
208
  pendingScrollToBottomRef.current = false;
194
209
  scrollToBottom(pendingScroll.animated);
195
210
  return;
@@ -197,18 +212,19 @@ const useThreadMessagesFlatListAutoScroll = (t0) => {
197
212
  if (!autoScroll) return;
198
213
  if (!wasAtBottom_0) return;
199
214
  if (previousContentHeight === 0) return;
200
- if (height <= previousContentHeight) return;
215
+ if (contentHeight_1 <= previousContentHeight) return;
201
216
  scrollToBottom(false);
202
217
  };
203
- $[8] = autoScroll;
204
- $[9] = scrollToBottom;
205
- $[10] = t10;
206
- } else t10 = $[10];
207
- const handleContentSizeChange = t10;
208
- let t11;
218
+ $[10] = autoScroll;
219
+ $[11] = horizontal;
220
+ $[12] = scrollToBottom;
221
+ $[13] = t11;
222
+ } else t11 = $[13];
223
+ const handleContentSizeChange = t11;
209
224
  let t12;
210
- if ($[11] !== hasMessages || $[12] !== scrollToBottom || $[13] !== scrollToBottomOnInitialize) {
211
- t11 = () => {
225
+ let t13;
226
+ if ($[14] !== hasMessages || $[15] !== scrollToBottom || $[16] !== scrollToBottomOnInitialize) {
227
+ t12 = () => {
212
228
  if (!scrollToBottomOnInitialize) return;
213
229
  if (!hasMessages) {
214
230
  initializeScrollRequestedRef.current = false;
@@ -216,65 +232,75 @@ const useThreadMessagesFlatListAutoScroll = (t0) => {
216
232
  }
217
233
  if (initializeScrollRequestedRef.current) return;
218
234
  initializeScrollRequestedRef.current = true;
219
- pendingScrollToBottomRef.current = { animated: false };
235
+ pendingScrollToBottomRef.current = {
236
+ animated: false,
237
+ minimumContentSizeVersion: Math.max(1, contentSizeVersionRef.current)
238
+ };
220
239
  scrollToBottom(false);
221
240
  };
222
- t12 = [
241
+ t13 = [
223
242
  hasMessages,
224
243
  scrollToBottom,
225
244
  scrollToBottomOnInitialize
226
245
  ];
227
- $[11] = hasMessages;
228
- $[12] = scrollToBottom;
229
- $[13] = scrollToBottomOnInitialize;
230
- $[14] = t11;
231
- $[15] = t12;
246
+ $[14] = hasMessages;
247
+ $[15] = scrollToBottom;
248
+ $[16] = scrollToBottomOnInitialize;
249
+ $[17] = t12;
250
+ $[18] = t13;
232
251
  } else {
233
- t11 = $[14];
234
- t12 = $[15];
252
+ t12 = $[17];
253
+ t13 = $[18];
235
254
  }
236
- useEffect(t11, t12);
237
- let t13;
238
- if ($[16] !== scrollToBottom || $[17] !== scrollToBottomOnRunStart) {
239
- t13 = () => {
240
- if (!scrollToBottomOnRunStart) return;
241
- pendingScrollToBottomRef.current = { animated: true };
242
- scrollToBottom(true);
243
- };
244
- $[16] = scrollToBottom;
245
- $[17] = scrollToBottomOnRunStart;
246
- $[18] = t13;
247
- } else t13 = $[18];
248
- useAuiEvent("thread.runStart", t13);
255
+ useEffect(t12, t13);
249
256
  let t14;
250
- if ($[19] !== scrollToBottom || $[20] !== scrollToBottomOnThreadSwitch) {
257
+ if ($[19] !== scrollToBottom || $[20] !== scrollToBottomOnRunStart) {
251
258
  t14 = () => {
252
- if (!scrollToBottomOnThreadSwitch) return;
253
- initializeScrollRequestedRef.current = false;
254
- lastScrollEventYRef.current = 0;
255
- pendingScrollToBottomRef.current = { animated: false };
256
- scrollToBottom(false);
259
+ if (!scrollToBottomOnRunStart) return;
260
+ pendingScrollToBottomRef.current = {
261
+ animated: true,
262
+ minimumContentSizeVersion: contentSizeVersionRef.current + 1
263
+ };
264
+ scrollToBottom(true);
257
265
  };
258
266
  $[19] = scrollToBottom;
259
- $[20] = scrollToBottomOnThreadSwitch;
267
+ $[20] = scrollToBottomOnRunStart;
260
268
  $[21] = t14;
261
269
  } else t14 = $[21];
262
- useAuiEvent("threads.selectionChanged", t14);
270
+ useAuiEvent("thread.runStart", t14);
263
271
  let t15;
264
- if ($[22] !== handleContentSizeChange || $[23] !== handleLayout) {
265
- t15 = {
272
+ if ($[22] !== scrollToBottom || $[23] !== scrollToBottomOnThreadSwitch) {
273
+ t15 = () => {
274
+ if (!scrollToBottomOnThreadSwitch) return;
275
+ initializeScrollRequestedRef.current = false;
276
+ lastScrollEventOffsetRef.current = 0;
277
+ pendingScrollToBottomRef.current = {
278
+ animated: false,
279
+ minimumContentSizeVersion: contentSizeVersionRef.current + 1
280
+ };
281
+ scrollToBottom(false);
282
+ };
283
+ $[22] = scrollToBottom;
284
+ $[23] = scrollToBottomOnThreadSwitch;
285
+ $[24] = t15;
286
+ } else t15 = $[24];
287
+ useAuiEvent("threads.selectionChanged", t15);
288
+ let t16;
289
+ if ($[25] !== handleContentSizeChange || $[26] !== handleLayout || $[27] !== handleScroll) {
290
+ t16 = {
266
291
  handleLayout,
267
292
  handleScroll,
268
293
  handleContentSizeChange
269
294
  };
270
- $[22] = handleContentSizeChange;
271
- $[23] = handleLayout;
272
- $[24] = t15;
273
- } else t15 = $[24];
274
- return t15;
295
+ $[25] = handleContentSizeChange;
296
+ $[26] = handleLayout;
297
+ $[27] = handleScroll;
298
+ $[28] = t16;
299
+ } else t16 = $[28];
300
+ return t16;
275
301
  };
276
302
  const ThreadMessagesFlatList = forwardRef((t0, forwardedRef) => {
277
- const $ = c(46);
303
+ const $ = c(48);
278
304
  let autoScroll;
279
305
  let children;
280
306
  let components;
@@ -317,26 +343,28 @@ const ThreadMessagesFlatList = forwardRef((t0, forwardedRef) => {
317
343
  const [flatListRef, setFlatListRef] = useComposedFlatListRef(forwardedRef);
318
344
  const t1 = messages.length > 0;
319
345
  let t2;
320
- if ($[12] !== autoScroll || $[13] !== flatListRef || $[14] !== scrollToBottomOnInitialize || $[15] !== scrollToBottomOnRunStart || $[16] !== scrollToBottomOnThreadSwitch || $[17] !== t1) {
346
+ if ($[12] !== autoScroll || $[13] !== flatListProps.horizontal || $[14] !== flatListRef || $[15] !== scrollToBottomOnInitialize || $[16] !== scrollToBottomOnRunStart || $[17] !== scrollToBottomOnThreadSwitch || $[18] !== t1) {
321
347
  t2 = {
322
348
  flatListRef,
323
349
  hasMessages: t1,
350
+ horizontal: flatListProps.horizontal,
324
351
  autoScroll,
325
352
  scrollToBottomOnInitialize,
326
353
  scrollToBottomOnRunStart,
327
354
  scrollToBottomOnThreadSwitch
328
355
  };
329
356
  $[12] = autoScroll;
330
- $[13] = flatListRef;
331
- $[14] = scrollToBottomOnInitialize;
332
- $[15] = scrollToBottomOnRunStart;
333
- $[16] = scrollToBottomOnThreadSwitch;
334
- $[17] = t1;
335
- $[18] = t2;
336
- } else t2 = $[18];
357
+ $[13] = flatListProps.horizontal;
358
+ $[14] = flatListRef;
359
+ $[15] = scrollToBottomOnInitialize;
360
+ $[16] = scrollToBottomOnRunStart;
361
+ $[17] = scrollToBottomOnThreadSwitch;
362
+ $[18] = t1;
363
+ $[19] = t2;
364
+ } else t2 = $[19];
337
365
  const { handleContentSizeChange: handleAutoScrollContentSizeChange, handleLayout: handleAutoScrollLayout, handleScroll: handleAutoScrollScroll } = useThreadMessagesFlatListAutoScroll(t2);
338
366
  let t3;
339
- if ($[19] !== children || $[20] !== components) {
367
+ if ($[20] !== children || $[21] !== components) {
340
368
  t3 = (t4) => {
341
369
  const { index } = t4;
342
370
  if (children) return /* @__PURE__ */ jsx(ThreadMessageByChildren, {
@@ -348,50 +376,55 @@ const ThreadMessagesFlatList = forwardRef((t0, forwardedRef) => {
348
376
  components
349
377
  });
350
378
  };
351
- $[19] = children;
352
- $[20] = components;
353
- $[21] = t3;
354
- } else t3 = $[21];
379
+ $[20] = children;
380
+ $[21] = components;
381
+ $[22] = t3;
382
+ } else t3 = $[22];
355
383
  const renderItem = t3;
356
384
  const keyExtractor = _temp4;
357
385
  const scrollTracking = (autoScroll ?? true) || (scrollToBottomOnInitialize ?? true) || (scrollToBottomOnRunStart ?? true) || (scrollToBottomOnThreadSwitch ?? true);
358
386
  let t4;
359
- if ($[22] !== handleAutoScrollLayout || $[23] !== onLayout) {
387
+ if ($[23] !== handleAutoScrollLayout || $[24] !== onLayout) {
360
388
  t4 = (event) => {
361
389
  handleAutoScrollLayout(event);
362
390
  onLayout?.(event);
363
391
  };
364
- $[22] = handleAutoScrollLayout;
365
- $[23] = onLayout;
366
- $[24] = t4;
367
- } else t4 = $[24];
392
+ $[23] = handleAutoScrollLayout;
393
+ $[24] = onLayout;
394
+ $[25] = t4;
395
+ } else t4 = $[25];
368
396
  const handleLayout = t4;
369
397
  let t5;
370
- if ($[25] !== handleAutoScrollScroll || $[26] !== onScroll) {
398
+ if ($[26] !== handleAutoScrollScroll || $[27] !== onScroll) {
371
399
  t5 = (event_0) => {
372
400
  handleAutoScrollScroll(event_0);
373
401
  onScroll?.(event_0);
374
402
  };
375
- $[25] = handleAutoScrollScroll;
376
- $[26] = onScroll;
377
- $[27] = t5;
378
- } else t5 = $[27];
403
+ $[26] = handleAutoScrollScroll;
404
+ $[27] = onScroll;
405
+ $[28] = t5;
406
+ } else t5 = $[28];
379
407
  const handleScroll = t5;
380
408
  let t6;
381
- if ($[28] !== handleAutoScrollContentSizeChange || $[29] !== onContentSizeChange) {
409
+ if ($[29] !== handleAutoScrollContentSizeChange || $[30] !== onContentSizeChange) {
382
410
  t6 = (width, height) => {
383
411
  handleAutoScrollContentSizeChange(width, height);
384
412
  onContentSizeChange?.(width, height);
385
413
  };
386
- $[28] = handleAutoScrollContentSizeChange;
387
- $[29] = onContentSizeChange;
388
- $[30] = t6;
389
- } else t6 = $[30];
414
+ $[29] = handleAutoScrollContentSizeChange;
415
+ $[30] = onContentSizeChange;
416
+ $[31] = t6;
417
+ } else t6 = $[31];
390
418
  const handleContentSizeChange = t6;
391
419
  const t7 = messages;
392
420
  let t8;
393
- if ($[31] !== handleContentSizeChange || $[32] !== handleLayout || $[33] !== handleScroll || $[34] !== onContentSizeChange || $[35] !== onLayout || $[36] !== onScroll || $[37] !== scrollEventThrottle || $[38] !== scrollTracking) {
394
- t8 = scrollTracking ? {
421
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
422
+ t8 = { minIndexForVisible: 0 };
423
+ $[32] = t8;
424
+ } else t8 = $[32];
425
+ let t9;
426
+ if ($[33] !== handleContentSizeChange || $[34] !== handleLayout || $[35] !== handleScroll || $[36] !== onContentSizeChange || $[37] !== onLayout || $[38] !== onScroll || $[39] !== scrollEventThrottle || $[40] !== scrollTracking) {
427
+ t9 = scrollTracking ? {
395
428
  onContentSizeChange: handleContentSizeChange,
396
429
  onLayout: handleLayout,
397
430
  onScroll: handleScroll,
@@ -402,34 +435,35 @@ const ThreadMessagesFlatList = forwardRef((t0, forwardedRef) => {
402
435
  ...onScroll && { onScroll },
403
436
  ...scrollEventThrottle !== void 0 && { scrollEventThrottle }
404
437
  };
405
- $[31] = handleContentSizeChange;
406
- $[32] = handleLayout;
407
- $[33] = handleScroll;
408
- $[34] = onContentSizeChange;
409
- $[35] = onLayout;
410
- $[36] = onScroll;
411
- $[37] = scrollEventThrottle;
412
- $[38] = scrollTracking;
413
- $[39] = t8;
414
- } else t8 = $[39];
415
- let t9;
416
- if ($[40] !== flatListProps || $[41] !== renderItem || $[42] !== setFlatListRef || $[43] !== t7 || $[44] !== t8) {
417
- t9 = /* @__PURE__ */ jsx(FlatList, {
438
+ $[33] = handleContentSizeChange;
439
+ $[34] = handleLayout;
440
+ $[35] = handleScroll;
441
+ $[36] = onContentSizeChange;
442
+ $[37] = onLayout;
443
+ $[38] = onScroll;
444
+ $[39] = scrollEventThrottle;
445
+ $[40] = scrollTracking;
446
+ $[41] = t9;
447
+ } else t9 = $[41];
448
+ let t10;
449
+ if ($[42] !== flatListProps || $[43] !== renderItem || $[44] !== setFlatListRef || $[45] !== t7 || $[46] !== t9) {
450
+ t10 = /* @__PURE__ */ jsx(FlatList, {
418
451
  ref: setFlatListRef,
419
452
  data: t7,
420
453
  renderItem,
421
454
  keyExtractor,
422
- ...t8,
455
+ maintainVisibleContentPosition: t8,
456
+ ...t9,
423
457
  ...flatListProps
424
458
  });
425
- $[40] = flatListProps;
426
- $[41] = renderItem;
427
- $[42] = setFlatListRef;
428
- $[43] = t7;
429
- $[44] = t8;
430
- $[45] = t9;
431
- } else t9 = $[45];
432
- return t9;
459
+ $[42] = flatListProps;
460
+ $[43] = renderItem;
461
+ $[44] = setFlatListRef;
462
+ $[45] = t7;
463
+ $[46] = t9;
464
+ $[47] = t10;
465
+ } else t10 = $[47];
466
+ return t10;
433
467
  });
434
468
  ThreadMessagesFlatList.displayName = "ThreadPrimitive.MessagesFlatList";
435
469
  /** @deprecated Use ThreadPrimitive.MessagesFlatList instead. */