@assistant-ui/react 0.11.57 → 0.12.0
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/client/ModelContextClient.d.ts +2 -6
- package/dist/client/ModelContextClient.d.ts.map +1 -1
- package/dist/client/ModelContextClient.js +13 -10
- package/dist/client/ModelContextClient.js.map +1 -1
- package/dist/client/NoOpComposerClient.d.ts +4 -6
- package/dist/client/NoOpComposerClient.d.ts.map +1 -1
- package/dist/client/NoOpComposerClient.js +42 -40
- package/dist/client/NoOpComposerClient.js.map +1 -1
- package/dist/client/ThreadMessageClient.d.ts +2 -6
- package/dist/client/ThreadMessageClient.d.ts.map +1 -1
- package/dist/client/ThreadMessageClient.js +87 -81
- package/dist/client/ThreadMessageClient.js.map +1 -1
- package/dist/client/Tools.d.ts +4 -6
- package/dist/client/Tools.d.ts.map +1 -1
- package/dist/client/Tools.js +33 -31
- package/dist/client/Tools.js.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.js +9 -12
- package/dist/context/providers/AttachmentByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.js +7 -22
- package/dist/context/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageProvider.js +4 -13
- package/dist/context/providers/MessageProvider.js.map +1 -1
- package/dist/context/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/PartByIndexProvider.js +5 -7
- package/dist/context/providers/PartByIndexProvider.js.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.js +16 -22
- package/dist/context/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.js +9 -35
- package/dist/context/providers/ThreadListItemProvider.js.map +1 -1
- package/dist/context/react/index.d.ts +0 -4
- package/dist/context/react/index.d.ts.map +1 -1
- package/dist/context/react/index.js +0 -6
- package/dist/context/react/index.js.map +1 -1
- package/dist/devtools/DevToolsHooks.d.ts +3 -3
- package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
- package/dist/devtools/DevToolsHooks.js +5 -5
- package/dist/devtools/DevToolsHooks.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +3 -3
- package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.d.ts +1 -5
- package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.js +25 -4
- package/dist/legacy-runtime/RuntimeAdapter.js.map +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js +8 -8
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts +6 -6
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js +38 -37
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js +9 -12
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts +5 -6
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.js +38 -44
- package/dist/legacy-runtime/client/MessageRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js +23 -23
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts +5 -6
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js +30 -31
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js +40 -42
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +13 -13
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.d.ts +8 -0
- package/dist/legacy-runtime/cloud/auiV0.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.js +14 -0
- package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
- package/dist/legacy-runtime/hooks/AssistantContext.d.ts +4 -4
- package/dist/legacy-runtime/hooks/AssistantContext.js +4 -4
- package/dist/legacy-runtime/hooks/AssistantContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +14 -14
- package/dist/legacy-runtime/hooks/AttachmentContext.js +5 -5
- package/dist/legacy-runtime/hooks/AttachmentContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ComposerContext.d.ts +10 -10
- package/dist/legacy-runtime/hooks/ComposerContext.js +8 -8
- package/dist/legacy-runtime/hooks/ComposerContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/MessageContext.d.ts +9 -9
- package/dist/legacy-runtime/hooks/MessageContext.js +9 -9
- package/dist/legacy-runtime/hooks/MessageContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/MessagePartContext.d.ts +2 -2
- package/dist/legacy-runtime/hooks/MessagePartContext.js +4 -4
- package/dist/legacy-runtime/hooks/MessagePartContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts +8 -8
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.js +8 -8
- package/dist/legacy-runtime/hooks/ThreadContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts +2 -2
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js +5 -5
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js +3 -3
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +5 -5
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +15 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js +2 -5
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +5 -5
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js +7 -2
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +5 -5
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +9 -8
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +3 -3
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +4 -4
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/model-context/useAssistantInstructions.js +4 -4
- package/dist/model-context/useAssistantInstructions.js.map +1 -1
- package/dist/model-context/useAssistantTool.js +6 -6
- package/dist/model-context/useAssistantTool.js.map +1 -1
- package/dist/model-context/useAssistantToolUI.js +4 -4
- package/dist/model-context/useAssistantToolUI.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +10 -10
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js +5 -5
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js +5 -5
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +5 -5
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +5 -5
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js +5 -5
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js +5 -5
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js +5 -5
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.js +2 -2
- package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js +4 -4
- package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
- package/dist/primitives/attachment/AttachmentName.js +2 -2
- package/dist/primitives/attachment/AttachmentName.js.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.js +4 -4
- package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
- package/dist/primitives/attachment/AttachmentThumb.js +2 -2
- package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js +2 -2
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js +5 -5
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js +2 -2
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +5 -5
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +6 -6
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachmentDropzone.js +4 -4
- package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js +4 -3
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js +5 -5
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerDictate.js +5 -5
- package/dist/primitives/composer/ComposerDictate.js.map +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.js +2 -2
- package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts +1 -1
- package/dist/primitives/composer/ComposerIf.js +3 -3
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +19 -19
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +5 -5
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.js +6 -5
- package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
- package/dist/primitives/error/ErrorMessage.js +2 -2
- package/dist/primitives/error/ErrorMessage.js.map +1 -1
- package/dist/primitives/index.d.ts +0 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +0 -1
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/primitives/message/MessageAttachments.js +4 -3
- package/dist/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/primitives/message/MessageError.js +2 -2
- package/dist/primitives/message/MessageError.js.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +1 -1
- package/dist/primitives/message/MessageIf.js +3 -3
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +10 -9
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.js +10 -9
- package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
- package/dist/primitives/message/MessageRoot.js +4 -4
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.js +2 -2
- package/dist/primitives/messagePart/MessagePartInProgress.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.js +2 -2
- package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.js +2 -2
- package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.js +2 -2
- package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.js +2 -2
- package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.js +2 -2
- package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.js +2 -2
- package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +2 -2
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +1 -1
- package/dist/primitives/thread/ThreadIf.js +3 -3
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +5 -4
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js +10 -10
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadViewportSlack.js +2 -2
- package/dist/primitives/thread/ThreadViewportSlack.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +4 -4
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js +3 -2
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +4 -4
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +2 -2
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.js +2 -2
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/scopes/attachment.d.ts +22 -0
- package/dist/types/scopes/attachment.d.ts.map +1 -0
- package/dist/types/scopes/attachment.js +2 -0
- package/dist/types/scopes/attachment.js.map +1 -0
- package/dist/{client/types/Composer.d.ts → types/scopes/composer.d.ts} +29 -9
- package/dist/types/scopes/composer.d.ts.map +1 -0
- package/dist/types/scopes/composer.js +2 -0
- package/dist/types/scopes/composer.js.map +1 -0
- package/dist/types/scopes/index.d.ts +10 -0
- package/dist/types/scopes/index.d.ts.map +1 -0
- package/dist/types/scopes/index.js +2 -0
- package/dist/types/scopes/index.js.map +1 -0
- package/dist/{client/types/Message.d.ts → types/scopes/message.d.ts} +35 -27
- package/dist/types/scopes/message.d.ts.map +1 -0
- package/dist/types/scopes/message.js +2 -0
- package/dist/types/scopes/message.js.map +1 -0
- package/dist/types/scopes/modelContext.d.ts +12 -0
- package/dist/types/scopes/modelContext.d.ts.map +1 -0
- package/dist/types/scopes/modelContext.js +2 -0
- package/dist/types/scopes/modelContext.js.map +1 -0
- package/dist/types/scopes/part.d.ts +37 -0
- package/dist/types/scopes/part.d.ts.map +1 -0
- package/dist/types/scopes/part.js +2 -0
- package/dist/types/scopes/part.js.map +1 -0
- package/dist/{client/types/Thread.d.ts → types/scopes/thread.d.ts} +45 -25
- package/dist/types/scopes/thread.d.ts.map +1 -0
- package/dist/types/scopes/thread.js +2 -0
- package/dist/types/scopes/thread.js.map +1 -0
- package/dist/types/scopes/threadListItem.d.ts +50 -0
- package/dist/types/scopes/threadListItem.d.ts.map +1 -0
- package/dist/types/scopes/threadListItem.js +2 -0
- package/dist/types/scopes/threadListItem.js.map +1 -0
- package/dist/types/scopes/threads.d.ts +28 -0
- package/dist/types/scopes/threads.d.ts.map +1 -0
- package/dist/types/scopes/threads.js +2 -0
- package/dist/types/scopes/threads.js.map +1 -0
- package/dist/types/scopes/tools.d.ts +14 -0
- package/dist/types/scopes/tools.d.ts.map +1 -0
- package/dist/types/scopes/tools.js +2 -0
- package/dist/types/scopes/tools.js.map +1 -0
- package/dist/types/store-augmentation.d.ts +24 -0
- package/dist/types/store-augmentation.d.ts.map +1 -0
- package/dist/types/store-augmentation.js +2 -0
- package/dist/types/store-augmentation.js.map +1 -0
- package/dist/utils/smooth/SmoothContext.js +3 -3
- package/dist/utils/smooth/SmoothContext.js.map +1 -1
- package/dist/utils/smooth/useSmooth.js +2 -2
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.js +2 -2
- package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
- package/package.json +9 -8
- package/src/client/ModelContextClient.ts +19 -12
- package/src/client/NoOpComposerClient.tsx +45 -42
- package/src/client/ThreadMessageClient.tsx +99 -86
- package/src/client/Tools.ts +73 -62
- package/src/context/providers/AttachmentByIndexProvider.tsx +9 -17
- package/src/context/providers/MessageByIndexProvider.tsx +7 -32
- package/src/context/providers/MessageProvider.tsx +4 -16
- package/src/context/providers/PartByIndexProvider.tsx +5 -11
- package/src/context/providers/TextMessagePartProvider.tsx +24 -32
- package/src/context/providers/ThreadListItemProvider.tsx +9 -45
- package/src/context/react/index.ts +0 -13
- package/src/devtools/DevToolsHooks.ts +7 -7
- package/src/index.ts +42 -0
- package/src/legacy-runtime/AssistantRuntimeProvider.tsx +4 -7
- package/src/legacy-runtime/RuntimeAdapter.ts +32 -4
- package/src/legacy-runtime/client/AttachmentRuntimeClient.ts +7 -9
- package/src/legacy-runtime/client/ComposerRuntimeClient.ts +54 -50
- package/src/legacy-runtime/client/MessagePartRuntimeClient.ts +12 -17
- package/src/legacy-runtime/client/MessageRuntimeClient.ts +40 -34
- package/src/legacy-runtime/client/ThreadListItemRuntimeClient.ts +17 -17
- package/src/legacy-runtime/client/ThreadListRuntimeClient.ts +47 -42
- package/src/legacy-runtime/client/ThreadRuntimeClient.ts +52 -49
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.tsx +13 -16
- package/src/legacy-runtime/cloud/auiV0.ts +27 -1
- package/src/legacy-runtime/hooks/AssistantContext.ts +7 -7
- package/src/legacy-runtime/hooks/AttachmentContext.ts +7 -7
- package/src/legacy-runtime/hooks/ComposerContext.ts +15 -15
- package/src/legacy-runtime/hooks/MessageContext.ts +14 -14
- package/src/legacy-runtime/hooks/MessagePartContext.ts +6 -6
- package/src/legacy-runtime/hooks/ThreadContext.ts +13 -17
- package/src/legacy-runtime/hooks/ThreadListItemContext.ts +7 -7
- package/src/legacy-runtime/runtime/ThreadListItemRuntime.ts +4 -4
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.tsx +5 -7
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +17 -1
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.tsx +3 -3
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.tsx +2 -2
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.tsx +4 -6
- package/src/legacy-runtime/runtime-cores/external-store/createMessageConverter.tsx +5 -5
- package/src/legacy-runtime/runtime-cores/external-store/external-message-converter.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.tsx +6 -2
- package/src/legacy-runtime/runtime-cores/local/useLocalRuntime.tsx +11 -14
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +9 -8
- package/src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.tsx +3 -3
- package/src/model-context/makeAssistantVisible.tsx +4 -4
- package/src/model-context/useAssistantInstructions.tsx +4 -4
- package/src/model-context/useAssistantTool.tsx +6 -6
- package/src/model-context/useAssistantToolUI.tsx +4 -4
- package/src/primitives/actionBar/ActionBarCopy.tsx +10 -10
- package/src/primitives/actionBar/ActionBarEdit.tsx +5 -5
- package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +5 -5
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +5 -5
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +5 -5
- package/src/primitives/actionBar/ActionBarReload.tsx +5 -5
- package/src/primitives/actionBar/ActionBarSpeak.tsx +5 -5
- package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +5 -5
- package/src/primitives/actionBar/useActionBarFloatStatus.tsx +2 -2
- package/src/primitives/assistantModal/AssistantModalRoot.tsx +4 -4
- package/src/primitives/attachment/AttachmentName.tsx +2 -2
- package/src/primitives/attachment/AttachmentRemove.tsx +4 -4
- package/src/primitives/attachment/AttachmentThumb.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerCount.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerNext.tsx +5 -5
- package/src/primitives/branchPicker/BranchPickerNumber.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerPrevious.tsx +5 -5
- package/src/primitives/composer/ComposerAddAttachment.tsx +6 -6
- package/src/primitives/composer/ComposerAttachmentDropzone.tsx +4 -4
- package/src/primitives/composer/ComposerAttachments.tsx +4 -8
- package/src/primitives/composer/ComposerCancel.tsx +5 -5
- package/src/primitives/composer/ComposerDictate.tsx +5 -5
- package/src/primitives/composer/ComposerDictationTranscript.tsx +2 -2
- package/src/primitives/composer/ComposerIf.tsx +3 -3
- package/src/primitives/composer/ComposerInput.tsx +19 -19
- package/src/primitives/composer/ComposerSend.tsx +5 -5
- package/src/primitives/composer/ComposerStopDictation.tsx +6 -7
- package/src/primitives/error/ErrorMessage.tsx +2 -2
- package/src/primitives/index.ts +0 -2
- package/src/primitives/message/MessageAttachments.tsx +4 -6
- package/src/primitives/message/MessageError.tsx +2 -2
- package/src/primitives/message/MessageIf.tsx +3 -3
- package/src/primitives/message/MessageParts.tsx +10 -13
- package/src/primitives/message/MessagePartsGrouped.tsx +10 -13
- package/src/primitives/message/MessageRoot.tsx +4 -4
- package/src/primitives/messagePart/MessagePartInProgress.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartData.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartFile.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartImage.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartReasoning.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartSource.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartText.tsx +2 -2
- package/src/primitives/thread/ThreadEmpty.tsx +2 -2
- package/src/primitives/thread/ThreadIf.tsx +3 -3
- package/src/primitives/thread/ThreadMessages.tsx +5 -8
- package/src/primitives/thread/ThreadSuggestion.tsx +10 -10
- package/src/primitives/thread/ThreadViewportSlack.tsx +2 -2
- package/src/primitives/thread/useThreadViewportAutoScroll.tsx +4 -4
- package/src/primitives/threadList/ThreadListItems.tsx +3 -5
- package/src/primitives/threadList/ThreadListNew.tsx +4 -4
- package/src/primitives/threadListItem/ThreadListItemArchive.ts +4 -4
- package/src/primitives/threadListItem/ThreadListItemDelete.ts +4 -4
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +2 -2
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +2 -2
- package/src/primitives/threadListItem/ThreadListItemTrigger.ts +4 -4
- package/src/primitives/threadListItem/ThreadListItemUnarchive.ts +4 -4
- package/src/types/index.ts +0 -8
- package/src/types/scopes/attachment.ts +22 -0
- package/src/{client/types/Composer.ts → types/scopes/composer.ts} +26 -9
- package/src/types/scopes/index.ts +50 -0
- package/src/{client/types/Message.ts → types/scopes/message.ts} +30 -38
- package/src/types/scopes/modelContext.ts +14 -0
- package/src/{client/types/Part.ts → types/scopes/part.ts} +21 -14
- package/src/{client/types/Thread.ts → types/scopes/thread.ts} +44 -53
- package/src/types/scopes/threadListItem.ts +44 -0
- package/src/{client/types/ThreadList.ts → types/scopes/threads.ts} +17 -17
- package/src/types/scopes/tools.ts +19 -0
- package/src/types/store-augmentation.ts +25 -0
- package/src/utils/smooth/SmoothContext.tsx +3 -3
- package/src/utils/smooth/useSmooth.tsx +2 -2
- package/src/utils/useToolArgsFieldStatus.tsx +2 -2
- package/dist/client/AssistantClient.d.ts +0 -21
- package/dist/client/AssistantClient.d.ts.map +0 -1
- package/dist/client/AssistantClient.js +0 -96
- package/dist/client/AssistantClient.js.map +0 -1
- package/dist/client/EventContext.d.ts +0 -4
- package/dist/client/EventContext.d.ts.map +0 -1
- package/dist/client/EventContext.js +0 -12
- package/dist/client/EventContext.js.map +0 -1
- package/dist/client/ModelContext.d.ts +0 -8
- package/dist/client/ModelContext.d.ts.map +0 -1
- package/dist/client/ModelContext.js +0 -12
- package/dist/client/ModelContext.js.map +0 -1
- package/dist/client/types/Attachment.d.ts +0 -7
- package/dist/client/types/Attachment.d.ts.map +0 -1
- package/dist/client/types/Attachment.js +0 -2
- package/dist/client/types/Attachment.js.map +0 -1
- package/dist/client/types/Composer.d.ts.map +0 -1
- package/dist/client/types/Composer.js +0 -2
- package/dist/client/types/Composer.js.map +0 -1
- package/dist/client/types/Message.d.ts.map +0 -1
- package/dist/client/types/Message.js +0 -2
- package/dist/client/types/Message.js.map +0 -1
- package/dist/client/types/ModelContext.d.ts +0 -12
- package/dist/client/types/ModelContext.d.ts.map +0 -1
- package/dist/client/types/ModelContext.js +0 -2
- package/dist/client/types/ModelContext.js.map +0 -1
- package/dist/client/types/Part.d.ts +0 -22
- package/dist/client/types/Part.d.ts.map +0 -1
- package/dist/client/types/Part.js +0 -2
- package/dist/client/types/Part.js.map +0 -1
- package/dist/client/types/Thread.d.ts.map +0 -1
- package/dist/client/types/Thread.js +0 -2
- package/dist/client/types/Thread.js.map +0 -1
- package/dist/client/types/ThreadList.d.ts +0 -24
- package/dist/client/types/ThreadList.d.ts.map +0 -1
- package/dist/client/types/ThreadList.js +0 -2
- package/dist/client/types/ThreadList.js.map +0 -1
- package/dist/client/types/ThreadListItem.d.ts +0 -23
- package/dist/client/types/ThreadListItem.d.ts.map +0 -1
- package/dist/client/types/ThreadListItem.js +0 -2
- package/dist/client/types/ThreadListItem.js.map +0 -1
- package/dist/client/types/Tools.d.ts +0 -13
- package/dist/client/types/Tools.d.ts.map +0 -1
- package/dist/client/types/Tools.js +0 -2
- package/dist/client/types/Tools.js.map +0 -1
- package/dist/client/util-hooks/tapLookupResources.d.ts +0 -15
- package/dist/client/util-hooks/tapLookupResources.d.ts.map +0 -1
- package/dist/client/util-hooks/tapLookupResources.js +0 -26
- package/dist/client/util-hooks/tapLookupResources.js.map +0 -1
- package/dist/context/react/AssistantApiContext.d.ts +0 -138
- package/dist/context/react/AssistantApiContext.d.ts.map +0 -1
- package/dist/context/react/AssistantApiContext.js +0 -158
- package/dist/context/react/AssistantApiContext.js.map +0 -1
- package/dist/context/react/hooks/useAssistantEvent.d.ts +0 -3
- package/dist/context/react/hooks/useAssistantEvent.d.ts.map +0 -1
- package/dist/context/react/hooks/useAssistantEvent.js +0 -13
- package/dist/context/react/hooks/useAssistantEvent.js.map +0 -1
- package/dist/context/react/hooks/useAssistantState.d.ts +0 -3
- package/dist/context/react/hooks/useAssistantState.d.ts.map +0 -1
- package/dist/context/react/hooks/useAssistantState.js +0 -42
- package/dist/context/react/hooks/useAssistantState.js.map +0 -1
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.d.ts +0 -11
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.js +0 -44
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.js.map +0 -1
- package/dist/primitives/assistant/AssistantIf.d.ts +0 -12
- package/dist/primitives/assistant/AssistantIf.d.ts.map +0 -1
- package/dist/primitives/assistant/AssistantIf.js +0 -11
- package/dist/primitives/assistant/AssistantIf.js.map +0 -1
- package/dist/types/EventTypes.d.ts +0 -57
- package/dist/types/EventTypes.d.ts.map +0 -1
- package/dist/types/EventTypes.js +0 -17
- package/dist/types/EventTypes.js.map +0 -1
- package/dist/utils/tap-store/derived-scopes.d.ts +0 -75
- package/dist/utils/tap-store/derived-scopes.d.ts.map +0 -1
- package/dist/utils/tap-store/derived-scopes.js +0 -56
- package/dist/utils/tap-store/derived-scopes.js.map +0 -1
- package/dist/utils/tap-store/index.d.ts +0 -4
- package/dist/utils/tap-store/index.d.ts.map +0 -1
- package/dist/utils/tap-store/index.js +0 -4
- package/dist/utils/tap-store/index.js.map +0 -1
- package/dist/utils/tap-store/store.d.ts +0 -14
- package/dist/utils/tap-store/store.d.ts.map +0 -1
- package/dist/utils/tap-store/store.js +0 -9
- package/dist/utils/tap-store/store.js.map +0 -1
- package/dist/utils/tap-store/tap-api.d.ts +0 -13
- package/dist/utils/tap-store/tap-api.d.ts.map +0 -1
- package/dist/utils/tap-store/tap-api.js +0 -49
- package/dist/utils/tap-store/tap-api.js.map +0 -1
- package/src/client/AssistantClient.ts +0 -175
- package/src/client/EventContext.ts +0 -22
- package/src/client/ModelContext.ts +0 -28
- package/src/client/types/Attachment.ts +0 -13
- package/src/client/types/ModelContext.ts +0 -14
- package/src/client/types/ThreadListItem.ts +0 -26
- package/src/client/types/Tools.ts +0 -19
- package/src/client/util-hooks/tapLookupResources.ts +0 -45
- package/src/context/react/AssistantApiContext.tsx +0 -340
- package/src/context/react/hooks/useAssistantEvent.ts +0 -25
- package/src/context/react/hooks/useAssistantState.tsx +0 -65
- package/src/legacy-runtime/client/EventManagerRuntimeClient.ts +0 -81
- package/src/primitives/assistant/AssistantIf.tsx +0 -25
- package/src/types/EventTypes.ts +0 -103
- package/src/utils/tap-store/derived-scopes.ts +0 -175
- package/src/utils/tap-store/index.ts +0 -10
- package/src/utils/tap-store/store.ts +0 -35
- package/src/utils/tap-store/tap-api.ts +0 -70
|
@@ -5,14 +5,14 @@ import { ActionButtonProps } from "../../utils/createActionButton";
|
|
|
5
5
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
6
6
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
7
7
|
import { useCallback } from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
9
9
|
|
|
10
10
|
const useActionBarFeedbackNegative = () => {
|
|
11
|
-
const
|
|
11
|
+
const aui = useAui();
|
|
12
12
|
|
|
13
13
|
const callback = useCallback(() => {
|
|
14
|
-
|
|
15
|
-
}, [
|
|
14
|
+
aui.message().submitFeedback({ type: "negative" });
|
|
15
|
+
}, [aui]);
|
|
16
16
|
|
|
17
17
|
return callback;
|
|
18
18
|
};
|
|
@@ -26,7 +26,7 @@ export const ActionBarPrimitiveFeedbackNegative = forwardRef<
|
|
|
26
26
|
ActionBarPrimitiveFeedbackNegative.Element,
|
|
27
27
|
ActionBarPrimitiveFeedbackNegative.Props
|
|
28
28
|
>(({ onClick, disabled, ...props }, forwardedRef) => {
|
|
29
|
-
const isSubmitted =
|
|
29
|
+
const isSubmitted = useAuiState(
|
|
30
30
|
(s) => s.message.metadata.submittedFeedback?.type === "negative",
|
|
31
31
|
);
|
|
32
32
|
const callback = useActionBarFeedbackNegative();
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import { forwardRef, useCallback } from "react";
|
|
4
4
|
import { ActionButtonProps } from "../../utils/createActionButton";
|
|
5
5
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
6
|
-
import {
|
|
6
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
7
7
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
8
8
|
|
|
9
9
|
const useActionBarFeedbackPositive = () => {
|
|
10
|
-
const
|
|
10
|
+
const aui = useAui();
|
|
11
11
|
|
|
12
12
|
const callback = useCallback(() => {
|
|
13
|
-
|
|
14
|
-
}, [
|
|
13
|
+
aui.message().submitFeedback({ type: "positive" });
|
|
14
|
+
}, [aui]);
|
|
15
15
|
|
|
16
16
|
return callback;
|
|
17
17
|
};
|
|
@@ -25,7 +25,7 @@ export const ActionBarPrimitiveFeedbackPositive = forwardRef<
|
|
|
25
25
|
ActionBarPrimitiveFeedbackPositive.Element,
|
|
26
26
|
ActionBarPrimitiveFeedbackPositive.Props
|
|
27
27
|
>(({ onClick, disabled, ...props }, forwardedRef) => {
|
|
28
|
-
const isSubmitted =
|
|
28
|
+
const isSubmitted = useAuiState(
|
|
29
29
|
(s) => s.message.metadata.submittedFeedback?.type === "positive",
|
|
30
30
|
);
|
|
31
31
|
const callback = useActionBarFeedbackPositive();
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createActionButton,
|
|
7
7
|
} from "../../utils/createActionButton";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Hook that provides reload functionality for action bar buttons.
|
|
@@ -30,9 +30,9 @@ import { useAssistantState, useAssistantApi } from "../../context";
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
const useActionBarReload = () => {
|
|
33
|
-
const
|
|
33
|
+
const aui = useAui();
|
|
34
34
|
|
|
35
|
-
const disabled =
|
|
35
|
+
const disabled = useAuiState(
|
|
36
36
|
(s) =>
|
|
37
37
|
s.thread.isRunning ||
|
|
38
38
|
s.thread.isDisabled ||
|
|
@@ -40,8 +40,8 @@ const useActionBarReload = () => {
|
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
const callback = useCallback(() => {
|
|
43
|
-
|
|
44
|
-
}, [
|
|
43
|
+
aui.message().reload();
|
|
44
|
+
}, [aui]);
|
|
45
45
|
|
|
46
46
|
if (disabled) return null;
|
|
47
47
|
return callback;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
5
5
|
import {
|
|
6
6
|
ActionButtonElement,
|
|
7
7
|
ActionButtonProps,
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
} from "../../utils/createActionButton";
|
|
10
10
|
|
|
11
11
|
const useActionBarSpeak = () => {
|
|
12
|
-
const
|
|
12
|
+
const aui = useAui();
|
|
13
13
|
const callback = useCallback(async () => {
|
|
14
|
-
|
|
15
|
-
}, [
|
|
14
|
+
aui.message().speak();
|
|
15
|
+
}, [aui]);
|
|
16
16
|
|
|
17
|
-
const hasSpeakableContent =
|
|
17
|
+
const hasSpeakableContent = useAuiState(({ message }) => {
|
|
18
18
|
return (
|
|
19
19
|
(message.role !== "assistant" || message.status?.type !== "running") &&
|
|
20
20
|
message.parts.some((c) => c.type === "text" && c.text.length > 0)
|
|
@@ -6,15 +6,15 @@ import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown";
|
|
|
6
6
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
7
7
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
const useActionBarStopSpeaking = () => {
|
|
12
|
-
const
|
|
13
|
-
const isSpeaking =
|
|
12
|
+
const aui = useAui();
|
|
13
|
+
const isSpeaking = useAuiState(({ message }) => message.speech != null);
|
|
14
14
|
|
|
15
15
|
const callback = useCallback(() => {
|
|
16
|
-
|
|
17
|
-
}, [
|
|
16
|
+
aui.message().stopSpeaking();
|
|
17
|
+
}, [aui]);
|
|
18
18
|
|
|
19
19
|
if (!isSpeaking) return null;
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
4
4
|
|
|
5
5
|
export enum HideAndFloatStatus {
|
|
6
6
|
Hidden = "hidden",
|
|
@@ -19,7 +19,7 @@ export const useActionBarFloatStatus = ({
|
|
|
19
19
|
autohide,
|
|
20
20
|
autohideFloat,
|
|
21
21
|
}: UseActionBarFloatStatusProps) => {
|
|
22
|
-
return
|
|
22
|
+
return useAuiState(({ thread, message }) => {
|
|
23
23
|
if (hideWhenRunning && thread.isRunning) return HideAndFloatStatus.Hidden;
|
|
24
24
|
|
|
25
25
|
const autohideEnabled =
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { FC, useEffect, useState } from "react";
|
|
4
4
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
5
|
import { ScopedProps, usePopoverScope } from "./scope";
|
|
6
|
-
import {
|
|
6
|
+
import { useAui } from "@assistant-ui/store";
|
|
7
7
|
|
|
8
8
|
export namespace AssistantModalPrimitiveRoot {
|
|
9
9
|
export type Props = PopoverPrimitive.PopoverProps & {
|
|
@@ -21,14 +21,14 @@ const useAssistantModalOpenState = ({
|
|
|
21
21
|
const state = useState(defaultOpen);
|
|
22
22
|
|
|
23
23
|
const [, setOpen] = state;
|
|
24
|
-
const
|
|
24
|
+
const aui = useAui();
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
if (!unstable_openOnRunStart) return undefined;
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return aui.on("thread.runStart", () => {
|
|
29
29
|
setOpen(true);
|
|
30
30
|
});
|
|
31
|
-
}, [unstable_openOnRunStart, setOpen,
|
|
31
|
+
}, [unstable_openOnRunStart, setOpen, aui]);
|
|
32
32
|
|
|
33
33
|
return state;
|
|
34
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { FC } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
|
|
6
6
|
export namespace AttachmentPrimitiveName {
|
|
7
7
|
export type Props = Record<string, never>;
|
|
@@ -10,7 +10,7 @@ export namespace AttachmentPrimitiveName {
|
|
|
10
10
|
export const AttachmentPrimitiveName: FC<
|
|
11
11
|
AttachmentPrimitiveName.Props
|
|
12
12
|
> = () => {
|
|
13
|
-
const name =
|
|
13
|
+
const name = useAuiState(({ attachment }) => attachment.name);
|
|
14
14
|
return <>{name}</>;
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
createActionButton,
|
|
7
7
|
} from "../../utils/createActionButton";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
const useAttachmentRemove = () => {
|
|
12
|
-
const
|
|
12
|
+
const aui = useAui();
|
|
13
13
|
|
|
14
14
|
const handleRemoveAttachment = useCallback(() => {
|
|
15
|
-
|
|
16
|
-
}, [
|
|
15
|
+
aui.attachment().remove();
|
|
16
|
+
}, [aui]);
|
|
17
17
|
|
|
18
18
|
return handleRemoveAttachment;
|
|
19
19
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { ComponentPropsWithoutRef, forwardRef, type ComponentRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
|
|
7
7
|
type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
@@ -15,7 +15,7 @@ export const AttachmentPrimitiveThumb = forwardRef<
|
|
|
15
15
|
AttachmentPrimitiveThumb.Element,
|
|
16
16
|
AttachmentPrimitiveThumb.Props
|
|
17
17
|
>((props, ref) => {
|
|
18
|
-
const ext =
|
|
18
|
+
const ext = useAuiState(({ attachment }) => {
|
|
19
19
|
const parts = attachment.name.split(".");
|
|
20
20
|
return parts.length > 1 ? parts.pop()! : "";
|
|
21
21
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { FC } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
|
|
6
6
|
const useBranchPickerCount = () => {
|
|
7
|
-
const branchCount =
|
|
7
|
+
const branchCount = useAuiState(({ message }) => message.branchCount);
|
|
8
8
|
return branchCount;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
createActionButton,
|
|
7
7
|
} from "../../utils/createActionButton";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
const useBranchPickerNext = () => {
|
|
12
|
-
const
|
|
13
|
-
const disabled =
|
|
12
|
+
const aui = useAui();
|
|
13
|
+
const disabled = useAuiState(({ thread, message }) => {
|
|
14
14
|
// Disabled if no next branch
|
|
15
15
|
if (message.branchNumber >= message.branchCount) return true;
|
|
16
16
|
|
|
@@ -23,8 +23,8 @@ const useBranchPickerNext = () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const callback = useCallback(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
26
|
+
aui.message().switchToBranch({ position: "next" });
|
|
27
|
+
}, [aui]);
|
|
28
28
|
|
|
29
29
|
if (disabled) return null;
|
|
30
30
|
return callback;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { FC } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
|
|
6
6
|
const useBranchPickerNumber = () => {
|
|
7
|
-
const branchNumber =
|
|
7
|
+
const branchNumber = useAuiState(({ message }) => message.branchNumber);
|
|
8
8
|
return branchNumber;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createActionButton,
|
|
7
7
|
} from "../../utils/createActionButton";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Hook that provides navigation to the previous branch functionality.
|
|
@@ -30,8 +30,8 @@ import { useAssistantState, useAssistantApi } from "../../context";
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
const useBranchPickerPrevious = () => {
|
|
33
|
-
const
|
|
34
|
-
const disabled =
|
|
33
|
+
const aui = useAui();
|
|
34
|
+
const disabled = useAuiState(({ thread, message }) => {
|
|
35
35
|
// Disabled if no previous branch
|
|
36
36
|
if (message.branchNumber <= 1) return true;
|
|
37
37
|
|
|
@@ -44,8 +44,8 @@ const useBranchPickerPrevious = () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const callback = useCallback(() => {
|
|
47
|
-
|
|
48
|
-
}, [
|
|
47
|
+
aui.message().switchToBranch({ position: "previous" });
|
|
48
|
+
}, [aui]);
|
|
49
49
|
|
|
50
50
|
if (disabled) return null;
|
|
51
51
|
return callback;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createActionButton,
|
|
7
7
|
} from "../../utils/createActionButton";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
const useComposerAddAttachment = ({
|
|
12
12
|
multiple = true,
|
|
@@ -14,8 +14,8 @@ const useComposerAddAttachment = ({
|
|
|
14
14
|
/** allow selecting multiple files */
|
|
15
15
|
multiple?: boolean | undefined;
|
|
16
16
|
} = {}) => {
|
|
17
|
-
const disabled =
|
|
18
|
-
const
|
|
17
|
+
const disabled = useAuiState(({ composer }) => !composer.isEditing);
|
|
18
|
+
const aui = useAui();
|
|
19
19
|
|
|
20
20
|
const callback = useCallback(() => {
|
|
21
21
|
const input = document.createElement("input");
|
|
@@ -23,7 +23,7 @@ const useComposerAddAttachment = ({
|
|
|
23
23
|
input.multiple = multiple;
|
|
24
24
|
input.hidden = true;
|
|
25
25
|
|
|
26
|
-
const attachmentAccept =
|
|
26
|
+
const attachmentAccept = aui.composer().getState().attachmentAccept;
|
|
27
27
|
if (attachmentAccept !== "*") {
|
|
28
28
|
input.accept = attachmentAccept;
|
|
29
29
|
}
|
|
@@ -34,7 +34,7 @@ const useComposerAddAttachment = ({
|
|
|
34
34
|
const fileList = (e.target as HTMLInputElement).files;
|
|
35
35
|
if (!fileList) return;
|
|
36
36
|
for (const file of fileList) {
|
|
37
|
-
|
|
37
|
+
aui.composer().addAttachment(file);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
document.body.removeChild(input);
|
|
@@ -47,7 +47,7 @@ const useComposerAddAttachment = ({
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
input.click();
|
|
50
|
-
}, [
|
|
50
|
+
}, [aui, multiple]);
|
|
51
51
|
|
|
52
52
|
if (disabled) return null;
|
|
53
53
|
return callback;
|
|
@@ -4,7 +4,7 @@ import { forwardRef, useCallback, useState } from "react";
|
|
|
4
4
|
|
|
5
5
|
import { Slot } from "@radix-ui/react-slot";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { useAui } from "@assistant-ui/store";
|
|
8
8
|
|
|
9
9
|
export namespace ComposerPrimitiveAttachmentDropzone {
|
|
10
10
|
export type Element = HTMLDivElement;
|
|
@@ -19,7 +19,7 @@ export const ComposerPrimitiveAttachmentDropzone = forwardRef<
|
|
|
19
19
|
ComposerPrimitiveAttachmentDropzone.Props
|
|
20
20
|
>(({ disabled, asChild = false, children, ...rest }, ref) => {
|
|
21
21
|
const [isDragging, setIsDragging] = useState(false);
|
|
22
|
-
const
|
|
22
|
+
const aui = useAui();
|
|
23
23
|
|
|
24
24
|
const handleDragEnterCapture = useCallback(
|
|
25
25
|
(e: React.DragEvent) => {
|
|
@@ -59,13 +59,13 @@ export const ComposerPrimitiveAttachmentDropzone = forwardRef<
|
|
|
59
59
|
setIsDragging(false);
|
|
60
60
|
for (const file of e.dataTransfer.files) {
|
|
61
61
|
try {
|
|
62
|
-
await
|
|
62
|
+
await aui.composer().addAttachment(file);
|
|
63
63
|
} catch (error) {
|
|
64
64
|
console.error("Failed to add attachment:", error);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
[disabled,
|
|
68
|
+
[disabled, aui],
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
const dragProps = {
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { ComponentType, type FC, memo, useMemo } from "react";
|
|
4
4
|
import { Attachment } from "../../types";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
ComposerAttachmentByIndexProvider,
|
|
8
|
-
} from "../../context";
|
|
5
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
6
|
+
import { ComposerAttachmentByIndexProvider } from "../../context/providers";
|
|
9
7
|
|
|
10
8
|
export namespace ComposerPrimitiveAttachments {
|
|
11
9
|
export type Props = {
|
|
@@ -41,7 +39,7 @@ const getComponent = (
|
|
|
41
39
|
const AttachmentComponent: FC<{
|
|
42
40
|
components: ComposerPrimitiveAttachments.Props["components"];
|
|
43
41
|
}> = ({ components }) => {
|
|
44
|
-
const attachment =
|
|
42
|
+
const attachment = useAuiState(({ attachment }) => attachment);
|
|
45
43
|
if (!attachment) return null;
|
|
46
44
|
|
|
47
45
|
const Component = getComponent(components, attachment);
|
|
@@ -96,9 +94,7 @@ ComposerPrimitiveAttachmentByIndex.displayName =
|
|
|
96
94
|
export const ComposerPrimitiveAttachments: FC<
|
|
97
95
|
ComposerPrimitiveAttachments.Props
|
|
98
96
|
> = ({ components }) => {
|
|
99
|
-
const attachmentsCount =
|
|
100
|
-
(s) => s.composer.attachments.length,
|
|
101
|
-
);
|
|
97
|
+
const attachmentsCount = useAuiState((s) => s.composer.attachments.length);
|
|
102
98
|
|
|
103
99
|
const attachmentElements = useMemo(() => {
|
|
104
100
|
return Array.from({ length: attachmentsCount }, (_, index) => (
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
createActionButton,
|
|
7
7
|
} from "../../utils/createActionButton";
|
|
8
8
|
import { useCallback } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
10
10
|
|
|
11
11
|
const useComposerCancel = () => {
|
|
12
|
-
const
|
|
13
|
-
const disabled =
|
|
12
|
+
const aui = useAui();
|
|
13
|
+
const disabled = useAuiState(({ composer }) => !composer.canCancel);
|
|
14
14
|
|
|
15
15
|
const callback = useCallback(() => {
|
|
16
|
-
|
|
17
|
-
}, [
|
|
16
|
+
aui.composer().cancel();
|
|
17
|
+
}, [aui]);
|
|
18
18
|
|
|
19
19
|
if (disabled) return null;
|
|
20
20
|
return callback;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
5
5
|
import type {
|
|
6
6
|
ActionButtonElement,
|
|
7
7
|
ActionButtonProps,
|
|
@@ -9,8 +9,8 @@ import type {
|
|
|
9
9
|
import { createActionButton } from "../../utils/createActionButton";
|
|
10
10
|
|
|
11
11
|
const useComposerDictate = () => {
|
|
12
|
-
const
|
|
13
|
-
const disabled =
|
|
12
|
+
const aui = useAui();
|
|
13
|
+
const disabled = useAuiState(
|
|
14
14
|
({ thread, composer }) =>
|
|
15
15
|
composer.dictation != null ||
|
|
16
16
|
!thread.capabilities.dictation ||
|
|
@@ -18,8 +18,8 @@ const useComposerDictate = () => {
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
const callback = useCallback(() => {
|
|
21
|
-
|
|
22
|
-
}, [
|
|
21
|
+
aui.composer().startDictation();
|
|
22
|
+
}, [aui]);
|
|
23
23
|
|
|
24
24
|
if (disabled) return null;
|
|
25
25
|
return callback;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
4
|
import { type ComponentRef, forwardRef, ComponentPropsWithoutRef } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
6
6
|
|
|
7
7
|
export namespace ComposerPrimitiveDictationTranscript {
|
|
8
8
|
export type Element = ComponentRef<typeof Primitive.span>;
|
|
@@ -28,7 +28,7 @@ export const ComposerPrimitiveDictationTranscript = forwardRef<
|
|
|
28
28
|
ComposerPrimitiveDictationTranscript.Element,
|
|
29
29
|
ComposerPrimitiveDictationTranscript.Props
|
|
30
30
|
>(({ children, ...props }, forwardRef) => {
|
|
31
|
-
const transcript =
|
|
31
|
+
const transcript = useAuiState(
|
|
32
32
|
({ composer }) => composer.dictation?.transcript,
|
|
33
33
|
);
|
|
34
34
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { FC, PropsWithChildren } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
import type { RequireAtLeastOne } from "../../utils/RequireAtLeastOne";
|
|
6
6
|
|
|
7
7
|
type ComposerIfFilters = {
|
|
@@ -14,7 +14,7 @@ type ComposerIfFilters = {
|
|
|
14
14
|
export type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;
|
|
15
15
|
|
|
16
16
|
const useComposerIf = (props: UseComposerIfProps) => {
|
|
17
|
-
return
|
|
17
|
+
return useAuiState(({ composer }) => {
|
|
18
18
|
if (props.editing === true && !composer.isEditing) return false;
|
|
19
19
|
if (props.editing === false && composer.isEditing) return false;
|
|
20
20
|
|
|
@@ -31,7 +31,7 @@ export namespace ComposerPrimitiveIf {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* @deprecated Use `<
|
|
34
|
+
* @deprecated Use `<AuiIf condition={({ composer }) => ...} />` instead.
|
|
35
35
|
*/
|
|
36
36
|
export const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props> = ({
|
|
37
37
|
children,
|
|
@@ -16,8 +16,8 @@ import TextareaAutosize, {
|
|
|
16
16
|
} from "react-textarea-autosize";
|
|
17
17
|
import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown";
|
|
18
18
|
import { useOnScrollToBottom } from "../../utils/hooks/useOnScrollToBottom";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
20
|
+
import { flushResourcesSync } from "@assistant-ui/tap";
|
|
21
21
|
|
|
22
22
|
export namespace ComposerPrimitiveInput {
|
|
23
23
|
export type Element = HTMLTextAreaElement;
|
|
@@ -98,9 +98,9 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
98
98
|
},
|
|
99
99
|
forwardedRef,
|
|
100
100
|
) => {
|
|
101
|
-
const
|
|
101
|
+
const aui = useAui();
|
|
102
102
|
|
|
103
|
-
const value =
|
|
103
|
+
const value = useAuiState(({ composer }) => {
|
|
104
104
|
if (!composer.isEditing) return "";
|
|
105
105
|
return composer.text;
|
|
106
106
|
});
|
|
@@ -108,7 +108,7 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
108
108
|
const Component = asChild ? Slot : TextareaAutosize;
|
|
109
109
|
|
|
110
110
|
const isDisabled =
|
|
111
|
-
|
|
111
|
+
useAuiState(
|
|
112
112
|
({ thread, composer }) =>
|
|
113
113
|
thread.isDisabled || composer.dictation?.inputDisabled,
|
|
114
114
|
) || disabledProp;
|
|
@@ -121,7 +121,7 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
121
121
|
// Only handle ESC if it originated from within this input
|
|
122
122
|
if (!textareaRef.current?.contains(e.target as Node)) return;
|
|
123
123
|
|
|
124
|
-
const composer =
|
|
124
|
+
const composer = aui.composer();
|
|
125
125
|
if (composer.getState().canCancel) {
|
|
126
126
|
composer.cancel();
|
|
127
127
|
e.preventDefault();
|
|
@@ -135,7 +135,7 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
135
135
|
if (e.nativeEvent.isComposing) return;
|
|
136
136
|
|
|
137
137
|
if (e.key === "Enter" && e.shiftKey === false) {
|
|
138
|
-
const isRunning =
|
|
138
|
+
const isRunning = aui.thread().getState().isRunning;
|
|
139
139
|
|
|
140
140
|
if (!isRunning) {
|
|
141
141
|
e.preventDefault();
|
|
@@ -147,14 +147,14 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
147
147
|
|
|
148
148
|
const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {
|
|
149
149
|
if (!addAttachmentOnPaste) return;
|
|
150
|
-
const threadCapabilities =
|
|
150
|
+
const threadCapabilities = aui.thread().getState().capabilities;
|
|
151
151
|
const files = Array.from(e.clipboardData?.files || []);
|
|
152
152
|
|
|
153
153
|
if (threadCapabilities.attachments && files.length > 0) {
|
|
154
154
|
try {
|
|
155
155
|
e.preventDefault();
|
|
156
156
|
await Promise.all(
|
|
157
|
-
files.map((file) =>
|
|
157
|
+
files.map((file) => aui.composer().addAttachment(file)),
|
|
158
158
|
);
|
|
159
159
|
} catch (error) {
|
|
160
160
|
console.error("Error adding attachment:", error);
|
|
@@ -175,7 +175,7 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
175
175
|
|
|
176
176
|
useOnScrollToBottom(() => {
|
|
177
177
|
if (
|
|
178
|
-
|
|
178
|
+
aui.composer().getState().type === "thread" &&
|
|
179
179
|
unstable_focusOnScrollToBottom
|
|
180
180
|
) {
|
|
181
181
|
focus();
|
|
@@ -184,23 +184,23 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
184
184
|
|
|
185
185
|
useEffect(() => {
|
|
186
186
|
if (
|
|
187
|
-
|
|
187
|
+
aui.composer().getState().type !== "thread" ||
|
|
188
188
|
!unstable_focusOnRunStart
|
|
189
189
|
)
|
|
190
190
|
return undefined;
|
|
191
191
|
|
|
192
|
-
return
|
|
193
|
-
}, [unstable_focusOnRunStart, focus,
|
|
192
|
+
return aui.on("thread.runStart", focus);
|
|
193
|
+
}, [unstable_focusOnRunStart, focus, aui]);
|
|
194
194
|
|
|
195
195
|
useEffect(() => {
|
|
196
196
|
if (
|
|
197
|
-
|
|
197
|
+
aui.composer().getState().type !== "thread" ||
|
|
198
198
|
!unstable_focusOnThreadSwitched
|
|
199
199
|
)
|
|
200
200
|
return undefined;
|
|
201
201
|
|
|
202
|
-
return
|
|
203
|
-
}, [unstable_focusOnThreadSwitched, focus,
|
|
202
|
+
return aui.on("threadListItem.switchedTo", focus);
|
|
203
|
+
}, [unstable_focusOnThreadSwitched, focus, aui]);
|
|
204
204
|
|
|
205
205
|
return (
|
|
206
206
|
<Component
|
|
@@ -210,9 +210,9 @@ export const ComposerPrimitiveInput = forwardRef<
|
|
|
210
210
|
ref={ref as React.ForwardedRef<HTMLTextAreaElement>}
|
|
211
211
|
disabled={isDisabled}
|
|
212
212
|
onChange={composeEventHandlers(onChange, (e) => {
|
|
213
|
-
if (!
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
if (!aui.composer().getState().isEditing) return;
|
|
214
|
+
flushResourcesSync(() => {
|
|
215
|
+
aui.composer().setText(e.target.value);
|
|
216
216
|
});
|
|
217
217
|
})}
|
|
218
218
|
onKeyDown={composeEventHandlers(onKeyDown, handleKeyPress)}
|