@assistant-ui/react 0.5.100 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api/AssistantRuntime.d.ts +6 -86
- package/dist/api/AssistantRuntime.d.ts.map +1 -1
- package/dist/api/AssistantRuntime.js +0 -8
- package/dist/api/AssistantRuntime.js.map +1 -1
- package/dist/api/AssistantRuntime.mjs +0 -8
- package/dist/api/AssistantRuntime.mjs.map +1 -1
- package/dist/api/AttachmentRuntime.d.ts +4 -16
- package/dist/api/AttachmentRuntime.d.ts.map +1 -1
- package/dist/api/AttachmentRuntime.js.map +1 -1
- package/dist/api/AttachmentRuntime.mjs.map +1 -1
- package/dist/api/ComposerRuntime.d.ts +15 -131
- package/dist/api/ComposerRuntime.d.ts.map +1 -1
- package/dist/api/ComposerRuntime.js +4 -84
- package/dist/api/ComposerRuntime.js.map +1 -1
- package/dist/api/ComposerRuntime.mjs +4 -84
- package/dist/api/ComposerRuntime.mjs.map +1 -1
- package/dist/api/ContentPartRuntime.d.ts +2 -6
- package/dist/api/ContentPartRuntime.d.ts.map +1 -1
- package/dist/api/ContentPartRuntime.js.map +1 -1
- package/dist/api/ContentPartRuntime.mjs.map +1 -1
- package/dist/api/MessageRuntime.d.ts +8 -19
- package/dist/api/MessageRuntime.d.ts.map +1 -1
- package/dist/api/MessageRuntime.js +11 -7
- package/dist/api/MessageRuntime.js.map +1 -1
- package/dist/api/MessageRuntime.mjs +10 -6
- package/dist/api/MessageRuntime.mjs.map +1 -1
- package/dist/api/RuntimePathTypes.d.ts +33 -33
- package/dist/api/RuntimePathTypes.d.ts.map +1 -1
- package/dist/api/RuntimePathTypes.js.map +1 -1
- package/dist/api/ThreadListItemRuntime.d.ts +12 -8
- package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/api/ThreadListItemRuntime.js +10 -6
- package/dist/api/ThreadListItemRuntime.js.map +1 -1
- package/dist/api/ThreadListItemRuntime.mjs +10 -6
- package/dist/api/ThreadListItemRuntime.mjs.map +1 -1
- package/dist/api/ThreadListRuntime.d.ts +10 -28
- package/dist/api/ThreadListRuntime.d.ts.map +1 -1
- package/dist/api/ThreadListRuntime.js +23 -26
- package/dist/api/ThreadListRuntime.js.map +1 -1
- package/dist/api/ThreadListRuntime.mjs +23 -26
- package/dist/api/ThreadListRuntime.mjs.map +1 -1
- package/dist/api/ThreadRuntime.d.ts +53 -211
- package/dist/api/ThreadRuntime.d.ts.map +1 -1
- package/dist/api/ThreadRuntime.js +2 -94
- package/dist/api/ThreadRuntime.js.map +1 -1
- package/dist/api/ThreadRuntime.mjs +2 -94
- package/dist/api/ThreadRuntime.mjs.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/context/providers/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/AssistantRuntimeProvider.js +0 -1
- package/dist/context/providers/AssistantRuntimeProvider.js.map +1 -1
- package/dist/context/providers/AssistantRuntimeProvider.mjs +0 -1
- package/dist/context/providers/AssistantRuntimeProvider.mjs.map +1 -1
- package/dist/context/providers/TextContentPartProvider.d.ts.map +1 -1
- package/dist/context/providers/TextContentPartProvider.js +0 -2
- package/dist/context/providers/TextContentPartProvider.js.map +1 -1
- package/dist/context/providers/TextContentPartProvider.mjs +0 -2
- package/dist/context/providers/TextContentPartProvider.mjs.map +1 -1
- package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +1 -4
- package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.js +1 -13
- package/dist/context/providers/ThreadRuntimeProvider.js.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.mjs +1 -13
- package/dist/context/providers/ThreadRuntimeProvider.mjs.map +1 -1
- package/dist/context/react/AssistantContext.d.ts +10 -120
- package/dist/context/react/AssistantContext.d.ts.map +1 -1
- package/dist/context/react/AssistantContext.js +0 -15
- package/dist/context/react/AssistantContext.js.map +1 -1
- package/dist/context/react/AssistantContext.mjs +0 -11
- package/dist/context/react/AssistantContext.mjs.map +1 -1
- package/dist/context/react/AttachmentContext.d.ts +32 -48
- package/dist/context/react/AttachmentContext.d.ts.map +1 -1
- package/dist/context/react/ComposerContext.d.ts +0 -5
- package/dist/context/react/ComposerContext.d.ts.map +1 -1
- package/dist/context/react/ComposerContext.js +3 -5
- package/dist/context/react/ComposerContext.js.map +1 -1
- package/dist/context/react/ComposerContext.mjs +2 -3
- package/dist/context/react/ComposerContext.mjs.map +1 -1
- package/dist/context/react/ContentPartContext.d.ts +0 -5
- package/dist/context/react/ContentPartContext.d.ts.map +1 -1
- package/dist/context/react/ContentPartContext.js +3 -5
- package/dist/context/react/ContentPartContext.js.map +1 -1
- package/dist/context/react/ContentPartContext.mjs +2 -3
- package/dist/context/react/ContentPartContext.mjs.map +1 -1
- package/dist/context/react/MessageContext.d.ts +6 -46
- package/dist/context/react/MessageContext.d.ts.map +1 -1
- package/dist/context/react/MessageContext.js +2 -6
- package/dist/context/react/MessageContext.js.map +1 -1
- package/dist/context/react/MessageContext.mjs +2 -4
- package/dist/context/react/MessageContext.mjs.map +1 -1
- package/dist/context/react/ThreadContext.d.ts +11 -1749
- package/dist/context/react/ThreadContext.d.ts.map +1 -1
- package/dist/context/react/ThreadContext.js +4 -30
- package/dist/context/react/ThreadContext.js.map +1 -1
- package/dist/context/react/ThreadContext.mjs +4 -22
- package/dist/context/react/ThreadContext.mjs.map +1 -1
- package/dist/context/react/ThreadListItemContext.d.ts +6 -24
- package/dist/context/react/ThreadListItemContext.d.ts.map +1 -1
- package/dist/context/react/index.d.ts +5 -101
- package/dist/context/react/index.d.ts.map +1 -1
- package/dist/context/react/index.js +0 -38
- package/dist/context/react/index.js.map +1 -1
- package/dist/context/react/index.mjs +5 -49
- package/dist/context/react/index.mjs.map +1 -1
- package/dist/context/stores/AssistantToolUIs.d.ts +9 -6
- package/dist/context/stores/AssistantToolUIs.d.ts.map +1 -1
- package/dist/context/stores/AssistantToolUIs.js.map +1 -1
- package/dist/context/stores/AssistantToolUIs.mjs.map +1 -1
- package/dist/context/stores/MessageUtils.d.ts +7 -12
- package/dist/context/stores/MessageUtils.d.ts.map +1 -1
- package/dist/context/stores/MessageUtils.js.map +1 -1
- package/dist/context/stores/MessageUtils.mjs.map +1 -1
- package/dist/context/stores/ThreadViewport.d.ts +6 -10
- package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
- package/dist/context/stores/ThreadViewport.js +0 -1
- package/dist/context/stores/ThreadViewport.js.map +1 -1
- package/dist/context/stores/ThreadViewport.mjs +0 -2
- package/dist/context/stores/ThreadViewport.mjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -1
- package/dist/internal.mjs +2 -0
- package/dist/internal.mjs.map +1 -1
- package/dist/model-config/useAssistantToolUI.d.ts.map +1 -1
- package/dist/model-config/useAssistantToolUI.js.map +1 -1
- package/dist/model-config/useAssistantToolUI.mjs.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts +1 -4
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.js.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartDisplay.mjs.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts +1 -4
- package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartImage.js.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartImage.mjs.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartText.d.ts +1 -4
- package/dist/primitive-hooks/contentPart/useContentPartText.d.ts.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartText.js.map +1 -1
- package/dist/primitive-hooks/contentPart/useContentPartText.mjs.map +1 -1
- package/dist/primitive-hooks/index.d.ts +0 -5
- package/dist/primitive-hooks/index.d.ts.map +1 -1
- package/dist/primitive-hooks/index.js +1 -11
- package/dist/primitive-hooks/index.js.map +1 -1
- package/dist/primitive-hooks/index.mjs +0 -5
- package/dist/primitive-hooks/index.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -5
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarRoot.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.mjs.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +0 -4
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.mjs.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts +0 -4
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.mjs.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts +0 -4
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.mjs.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts +0 -4
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.mjs.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +0 -4
- package/dist/primitives/branchPicker/BranchPickerRoot.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.mjs.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -5
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +2 -2
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.mjs +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.mjs.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts +0 -4
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.mjs.map +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts +0 -4
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.mjs.map +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts +0 -4
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerIf.mjs.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts +0 -4
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.mjs.map +1 -1
- package/dist/primitives/composer/ComposerRoot.d.ts +0 -1
- package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerRoot.js +2 -2
- package/dist/primitives/composer/ComposerRoot.js.map +1 -1
- package/dist/primitives/composer/ComposerRoot.mjs +1 -1
- package/dist/primitives/composer/ComposerRoot.mjs.map +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts +1 -5
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +2 -2
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.mjs +1 -1
- package/dist/primitives/composer/ComposerSend.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartDisplay.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartDisplay.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartDisplay.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartDisplay.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartImage.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartImage.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartImage.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartImage.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartInProgress.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartInProgress.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartInProgress.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartInProgress.mjs.map +1 -1
- package/dist/primitives/contentPart/ContentPartText.d.ts +0 -4
- package/dist/primitives/contentPart/ContentPartText.d.ts.map +1 -1
- package/dist/primitives/contentPart/ContentPartText.js.map +1 -1
- package/dist/primitives/contentPart/ContentPartText.mjs.map +1 -1
- package/dist/primitives/index.d.ts +0 -7
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/index.mjs.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts +0 -4
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/primitives/message/MessageAttachments.js +2 -4
- package/dist/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.mjs +2 -4
- package/dist/primitives/message/MessageAttachments.mjs.map +1 -1
- package/dist/primitives/message/MessageContent.d.ts +0 -4
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +6 -6
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageContent.mjs +7 -7
- package/dist/primitives/message/MessageContent.mjs.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +0 -4
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageIf.mjs.map +1 -1
- package/dist/primitives/message/MessageRoot.d.ts +0 -4
- package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/message/MessageRoot.mjs.map +1 -1
- package/dist/primitives/message/index.d.ts +0 -1
- package/dist/primitives/message/index.d.ts.map +1 -1
- package/dist/primitives/message/index.js +0 -3
- package/dist/primitives/message/index.js.map +1 -1
- package/dist/primitives/message/index.mjs +0 -2
- package/dist/primitives/message/index.mjs.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.d.ts +0 -4
- package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +2 -2
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.mjs +1 -1
- package/dist/primitives/thread/ThreadEmpty.mjs.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +0 -4
- package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.mjs.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +0 -4
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.mjs.map +1 -1
- package/dist/primitives/thread/ThreadRoot.d.ts +0 -4
- package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadRoot.js.map +1 -1
- package/dist/primitives/thread/ThreadRoot.mjs.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts +0 -4
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.mjs.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +0 -4
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.mjs.map +1 -1
- package/dist/primitives/thread/ThreadViewport.d.ts +0 -4
- package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadViewport.js.map +1 -1
- package/dist/primitives/thread/ThreadViewport.mjs.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +3 -2
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.mjs +3 -2
- package/dist/primitives/threadListItem/ThreadListItemArchive.mjs.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +14 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +47 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.mjs +23 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.mjs.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +8 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -0
- package/dist/primitives/{message/MessageInProgress.js → threadListItem/ThreadListItemTitle.js} +13 -10
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.mjs +14 -0
- package/dist/primitives/threadListItem/ThreadListItemTitle.mjs.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +13 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -0
- package/dist/{runtimes/core/subscribeToMainThread.js → primitives/threadListItem/ThreadListItemTrigger.js} +17 -22
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.mjs +21 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.mjs.map +1 -0
- package/dist/primitives/threadListItem/index.d.ts +3 -0
- package/dist/primitives/threadListItem/index.d.ts.map +1 -1
- package/dist/primitives/threadListItem/index.js +9 -0
- package/dist/primitives/threadListItem/index.js.map +1 -1
- package/dist/primitives/threadListItem/index.mjs +6 -0
- package/dist/primitives/threadListItem/index.mjs.map +1 -1
- package/dist/runtimes/attachment/AttachmentAdapter.d.ts +3 -7
- package/dist/runtimes/attachment/AttachmentAdapter.d.ts.map +1 -1
- package/dist/runtimes/attachment/AttachmentAdapter.js.map +1 -1
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.d.ts +2 -6
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.d.ts.map +1 -1
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.js +1 -2
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.js.map +1 -1
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.mjs +1 -2
- package/dist/runtimes/attachment/CompositeAttachmentAdapter.mjs.map +1 -1
- package/dist/runtimes/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/composer/BaseComposerRuntimeCore.js +0 -6
- package/dist/runtimes/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs +0 -6
- package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts +6 -7
- package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/BaseThreadRuntimeCore.js +8 -4
- package/dist/runtimes/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/BaseThreadRuntimeCore.mjs +8 -4
- package/dist/runtimes/core/BaseThreadRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/core/ComposerRuntimeCore.d.ts +0 -3
- package/dist/runtimes/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ComposerRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/ThreadListRuntimeCore.d.ts +7 -10
- package/dist/runtimes/core/ThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/ThreadRuntimeCore.d.ts +30 -17
- package/dist/runtimes/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/core/index.d.ts +1 -2
- package/dist/runtimes/core/index.d.ts.map +1 -1
- package/dist/runtimes/core/index.js +0 -12
- package/dist/runtimes/core/index.js.map +1 -1
- package/dist/runtimes/core/index.mjs +0 -5
- package/dist/runtimes/core/index.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts +0 -4
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js +0 -2
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs +0 -2
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.js +0 -2
- package/dist/runtimes/edge/streams/runResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.mjs +0 -2
- package/dist/runtimes/edge/streams/runResultStream.mjs.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts +3 -16
- package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreAdapter.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js +0 -3
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs +0 -3
- package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +10 -12
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js +29 -7
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs +29 -7
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts +2 -12
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js +4 -3
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs +4 -3
- package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.js +2 -0
- package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.mjs +2 -0
- package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.d.ts +0 -8
- package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts +1 -6
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.js +1 -2
- package/dist/runtimes/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.mjs +1 -2
- package/dist/runtimes/local/LocalRuntimeOptions.mjs.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts +16 -20
- package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.js +112 -72
- package/dist/runtimes/local/LocalThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs +112 -72
- package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.d.ts +19 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.d.ts.map +1 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.js +87 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.js.map +1 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.mjs +62 -0
- package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.mjs.map +1 -0
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.js +15 -11
- package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +15 -11
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
- package/dist/styles/index.css.map +1 -1
- package/dist/types/AssistantTypes.d.ts +1 -18
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/types/AttachmentTypes.d.ts +1 -1
- package/dist/types/AttachmentTypes.d.ts.map +1 -1
- package/dist/types/AttachmentTypes.js.map +1 -1
- package/dist/types/ContentPartComponentTypes.d.ts +4 -28
- package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
- package/dist/types/ContentPartComponentTypes.js.map +1 -1
- package/dist/ui/assistant-message.d.ts +1 -10
- package/dist/ui/assistant-message.d.ts.map +1 -1
- package/dist/ui/assistant-message.js.map +1 -1
- package/dist/ui/assistant-message.mjs.map +1 -1
- package/dist/ui/composer.d.ts +1 -25
- package/dist/ui/composer.d.ts.map +1 -1
- package/dist/ui/composer.js.map +1 -1
- package/dist/ui/composer.mjs.map +1 -1
- package/dist/ui/index.d.ts +6 -14
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +0 -4
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +14 -24
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/thread-welcome.d.ts +5 -17
- package/dist/ui/thread-welcome.d.ts.map +1 -1
- package/dist/ui/thread-welcome.js.map +1 -1
- package/dist/ui/thread-welcome.mjs.map +1 -1
- package/dist/ui/thread.d.ts +1 -19
- package/dist/ui/thread.d.ts.map +1 -1
- package/dist/ui/thread.js.map +1 -1
- package/dist/ui/thread.mjs.map +1 -1
- package/dist/ui/user-message.d.ts +1 -18
- package/dist/ui/user-message.d.ts.map +1 -1
- package/dist/ui/user-message.js.map +1 -1
- package/dist/ui/user-message.mjs.map +1 -1
- package/dist/utils/smooth/SmoothContext.js +2 -2
- package/dist/utils/smooth/SmoothContext.js.map +1 -1
- package/dist/utils/smooth/SmoothContext.mjs +3 -3
- package/dist/utils/smooth/SmoothContext.mjs.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +0 -1
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/smooth/useSmooth.mjs +0 -1
- package/dist/utils/smooth/useSmooth.mjs.map +1 -1
- package/package.json +7 -7
- package/src/api/AssistantRuntime.ts +3 -25
- package/src/api/AttachmentRuntime.ts +4 -16
- package/src/api/ComposerRuntime.ts +18 -214
- package/src/api/ContentPartRuntime.ts +2 -6
- package/src/api/MessageRuntime.ts +16 -20
- package/src/api/RuntimePathTypes.ts +26 -26
- package/src/api/ThreadListItemRuntime.ts +19 -11
- package/src/api/ThreadListRuntime.ts +39 -58
- package/src/api/ThreadRuntime.ts +52 -213
- package/src/api/index.ts +4 -0
- package/src/context/providers/AssistantRuntimeProvider.tsx +0 -1
- package/src/context/providers/TextContentPartProvider.tsx +0 -2
- package/src/context/providers/ThreadRuntimeProvider.tsx +1 -17
- package/src/context/react/AssistantContext.ts +0 -25
- package/src/context/react/ComposerContext.ts +1 -1
- package/src/context/react/ContentPartContext.ts +1 -1
- package/src/context/react/MessageContext.ts +2 -2
- package/src/context/react/ThreadContext.ts +5 -42
- package/src/context/react/index.ts +2 -125
- package/src/context/stores/AssistantToolUIs.ts +9 -2
- package/src/context/stores/MessageUtils.ts +6 -6
- package/src/context/stores/ThreadViewport.tsx +5 -6
- package/src/index.ts +0 -1
- package/src/internal.ts +1 -0
- package/src/model-config/useAssistantToolUI.tsx +0 -1
- package/src/primitive-hooks/contentPart/useContentPartDisplay.tsx +1 -1
- package/src/primitive-hooks/contentPart/useContentPartImage.tsx +1 -2
- package/src/primitive-hooks/contentPart/useContentPartText.tsx +1 -1
- package/src/primitive-hooks/index.ts +0 -5
- package/src/primitives/actionBar/ActionBarCopy.tsx +0 -5
- package/src/primitives/actionBar/ActionBarEdit.tsx +0 -5
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +0 -6
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +0 -6
- package/src/primitives/actionBar/ActionBarReload.tsx +0 -5
- package/src/primitives/actionBar/ActionBarRoot.tsx +0 -5
- package/src/primitives/actionBar/ActionBarSpeak.tsx +0 -5
- package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +0 -6
- package/src/primitives/assistantModal/AssistantModalContent.tsx +1 -7
- package/src/primitives/assistantModal/AssistantModalRoot.tsx +0 -6
- package/src/primitives/assistantModal/AssistantModalTrigger.tsx +0 -6
- package/src/primitives/branchPicker/BranchPickerCount.tsx +0 -5
- package/src/primitives/branchPicker/BranchPickerNext.tsx +0 -6
- package/src/primitives/branchPicker/BranchPickerNumber.tsx +0 -5
- package/src/primitives/branchPicker/BranchPickerPrevious.tsx +1 -6
- package/src/primitives/branchPicker/BranchPickerRoot.tsx +0 -5
- package/src/primitives/composer/ComposerAddAttachment.tsx +2 -7
- package/src/primitives/composer/ComposerAttachments.tsx +0 -6
- package/src/primitives/composer/ComposerCancel.tsx +0 -5
- package/src/primitives/composer/ComposerIf.tsx +0 -5
- package/src/primitives/composer/ComposerInput.tsx +0 -5
- package/src/primitives/composer/ComposerRoot.tsx +1 -3
- package/src/primitives/composer/ComposerSend.tsx +2 -7
- package/src/primitives/contentPart/ContentPartDisplay.tsx +0 -6
- package/src/primitives/contentPart/ContentPartImage.tsx +0 -5
- package/src/primitives/contentPart/ContentPartInProgress.tsx +0 -6
- package/src/primitives/contentPart/ContentPartText.tsx +0 -5
- package/src/primitives/index.ts +0 -8
- package/src/primitives/message/MessageAttachments.tsx +2 -10
- package/src/primitives/message/MessageContent.tsx +7 -15
- package/src/primitives/message/MessageIf.tsx +0 -5
- package/src/primitives/message/MessageRoot.tsx +0 -5
- package/src/primitives/message/index.ts +0 -1
- package/src/primitives/thread/ThreadEmpty.tsx +1 -6
- package/src/primitives/thread/ThreadIf.tsx +0 -5
- package/src/primitives/thread/ThreadMessages.tsx +0 -5
- package/src/primitives/thread/ThreadRoot.tsx +0 -5
- package/src/primitives/thread/ThreadScrollToBottom.tsx +0 -6
- package/src/primitives/thread/ThreadSuggestion.tsx +0 -5
- package/src/primitives/thread/ThreadViewport.tsx +0 -5
- package/src/primitives/threadListItem/ThreadListItemArchive.ts +3 -2
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +29 -0
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +19 -0
- package/src/primitives/threadListItem/ThreadListItemTrigger.ts +25 -0
- package/src/primitives/threadListItem/index.ts +4 -1
- package/src/runtimes/attachment/AttachmentAdapter.ts +2 -12
- package/src/runtimes/attachment/CompositeAttachmentAdapter.ts +1 -1
- package/src/runtimes/composer/BaseComposerRuntimeCore.tsx +0 -8
- package/src/runtimes/core/BaseThreadRuntimeCore.tsx +11 -5
- package/src/runtimes/core/ComposerRuntimeCore.tsx +0 -3
- package/src/runtimes/core/ThreadListRuntimeCore.tsx +7 -11
- package/src/runtimes/core/ThreadRuntimeCore.tsx +33 -17
- package/src/runtimes/core/index.ts +1 -2
- package/src/runtimes/edge/converters/toCoreMessages.ts +1 -1
- package/src/runtimes/edge/createEdgeRuntimeAPI.ts +0 -6
- package/src/runtimes/edge/streams/runResultStream.ts +0 -2
- package/src/runtimes/external-store/ExternalStoreAdapter.tsx +3 -17
- package/src/runtimes/external-store/ExternalStoreRuntimeCore.tsx +0 -3
- package/src/runtimes/external-store/ExternalStoreThreadListRuntimeCore.tsx +39 -7
- package/src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx +4 -3
- package/src/runtimes/external-store/ThreadMessageLike.tsx +4 -3
- package/src/runtimes/local/ChatModelAdapter.tsx +0 -9
- package/src/runtimes/local/LocalRuntimeOptions.tsx +1 -7
- package/src/runtimes/local/LocalThreadListRuntimeCore.tsx +140 -96
- package/src/runtimes/local/LocalThreadMetadataRuntimeCore.tsx +79 -0
- package/src/runtimes/local/LocalThreadRuntimeCore.tsx +16 -11
- package/src/types/AssistantTypes.ts +1 -20
- package/src/types/AttachmentTypes.ts +1 -2
- package/src/types/ContentPartComponentTypes.tsx +4 -31
- package/src/ui/assistant-message.tsx +0 -5
- package/src/ui/composer.tsx +0 -5
- package/src/ui/index.ts +5 -23
- package/src/ui/thread-welcome.tsx +6 -9
- package/src/ui/thread.tsx +0 -5
- package/src/ui/user-message.tsx +2 -12
- package/src/utils/smooth/SmoothContext.tsx +3 -3
- package/src/utils/smooth/useSmooth.tsx +0 -1
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -34
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -8
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/hooks/useAppendMessage.d.ts +0 -6
- package/dist/hooks/useAppendMessage.d.ts.map +0 -1
- package/dist/hooks/useAppendMessage.js +0 -42
- package/dist/hooks/useAppendMessage.js.map +0 -1
- package/dist/hooks/useAppendMessage.mjs +0 -17
- package/dist/hooks/useAppendMessage.mjs.map +0 -1
- package/dist/hooks/useSwitchToNewThread.d.ts +0 -5
- package/dist/hooks/useSwitchToNewThread.d.ts.map +0 -1
- package/dist/hooks/useSwitchToNewThread.js +0 -39
- package/dist/hooks/useSwitchToNewThread.js.map +0 -1
- package/dist/hooks/useSwitchToNewThread.mjs +0 -14
- package/dist/hooks/useSwitchToNewThread.mjs.map +0 -1
- package/dist/primitive-hooks/actionBar/index.d.ts +0 -34
- package/dist/primitive-hooks/actionBar/index.d.ts.map +0 -1
- package/dist/primitive-hooks/actionBar/index.js +0 -49
- package/dist/primitive-hooks/actionBar/index.js.map +0 -1
- package/dist/primitive-hooks/actionBar/index.mjs +0 -20
- package/dist/primitive-hooks/actionBar/index.mjs.map +0 -1
- package/dist/primitive-hooks/branchPicker/index.d.ts +0 -17
- package/dist/primitive-hooks/branchPicker/index.d.ts.map +0 -1
- package/dist/primitive-hooks/branchPicker/index.js +0 -40
- package/dist/primitive-hooks/branchPicker/index.js.map +0 -1
- package/dist/primitive-hooks/branchPicker/index.mjs +0 -12
- package/dist/primitive-hooks/branchPicker/index.mjs.map +0 -1
- package/dist/primitive-hooks/composer/index.d.ts +0 -17
- package/dist/primitive-hooks/composer/index.d.ts.map +0 -1
- package/dist/primitive-hooks/composer/index.js +0 -40
- package/dist/primitive-hooks/composer/index.js.map +0 -1
- package/dist/primitive-hooks/composer/index.mjs +0 -12
- package/dist/primitive-hooks/composer/index.mjs.map +0 -1
- package/dist/primitive-hooks/message/index.d.ts +0 -5
- package/dist/primitive-hooks/message/index.d.ts.map +0 -1
- package/dist/primitive-hooks/message/index.js +0 -31
- package/dist/primitive-hooks/message/index.js.map +0 -1
- package/dist/primitive-hooks/message/index.mjs +0 -6
- package/dist/primitive-hooks/message/index.mjs.map +0 -1
- package/dist/primitive-hooks/thread/index.d.ts +0 -17
- package/dist/primitive-hooks/thread/index.d.ts.map +0 -1
- package/dist/primitive-hooks/thread/index.js +0 -40
- package/dist/primitive-hooks/thread/index.js.map +0 -1
- package/dist/primitive-hooks/thread/index.mjs +0 -12
- package/dist/primitive-hooks/thread/index.mjs.map +0 -1
- package/dist/primitives/actionBar/types.d.ts +0 -9
- package/dist/primitives/actionBar/types.d.ts.map +0 -1
- package/dist/primitives/actionBar/types.js +0 -19
- package/dist/primitives/actionBar/types.js.map +0 -1
- package/dist/primitives/actionBar/types.mjs +0 -1
- package/dist/primitives/actionBar/types.mjs.map +0 -1
- package/dist/primitives/assistantModal/types.d.ts +0 -4
- package/dist/primitives/assistantModal/types.d.ts.map +0 -1
- package/dist/primitives/assistantModal/types.js +0 -19
- package/dist/primitives/assistantModal/types.js.map +0 -1
- package/dist/primitives/assistantModal/types.mjs +0 -1
- package/dist/primitives/assistantModal/types.mjs.map +0 -1
- package/dist/primitives/attachment/types.d.ts +0 -1
- package/dist/primitives/attachment/types.d.ts.map +0 -1
- package/dist/primitives/attachment/types.js +0 -2
- package/dist/primitives/attachment/types.js.map +0 -1
- package/dist/primitives/attachment/types.mjs +0 -1
- package/dist/primitives/attachment/types.mjs.map +0 -1
- package/dist/primitives/branchPicker/types.d.ts +0 -6
- package/dist/primitives/branchPicker/types.d.ts.map +0 -1
- package/dist/primitives/branchPicker/types.js +0 -19
- package/dist/primitives/branchPicker/types.js.map +0 -1
- package/dist/primitives/branchPicker/types.mjs +0 -1
- package/dist/primitives/branchPicker/types.mjs.map +0 -1
- package/dist/primitives/composer/types.d.ts +0 -6
- package/dist/primitives/composer/types.d.ts.map +0 -1
- package/dist/primitives/composer/types.js +0 -19
- package/dist/primitives/composer/types.js.map +0 -1
- package/dist/primitives/composer/types.mjs +0 -1
- package/dist/primitives/composer/types.mjs.map +0 -1
- package/dist/primitives/contentPart/types.d.ts +0 -5
- package/dist/primitives/contentPart/types.d.ts.map +0 -1
- package/dist/primitives/contentPart/types.js +0 -19
- package/dist/primitives/contentPart/types.js.map +0 -1
- package/dist/primitives/contentPart/types.mjs +0 -1
- package/dist/primitives/contentPart/types.mjs.map +0 -1
- package/dist/primitives/message/MessageInProgress.d.ts +0 -13
- package/dist/primitives/message/MessageInProgress.d.ts.map +0 -1
- package/dist/primitives/message/MessageInProgress.js.map +0 -1
- package/dist/primitives/message/MessageInProgress.mjs +0 -11
- package/dist/primitives/message/MessageInProgress.mjs.map +0 -1
- package/dist/primitives/message/types.d.ts +0 -5
- package/dist/primitives/message/types.d.ts.map +0 -1
- package/dist/primitives/message/types.js +0 -19
- package/dist/primitives/message/types.js.map +0 -1
- package/dist/primitives/message/types.mjs +0 -1
- package/dist/primitives/message/types.mjs.map +0 -1
- package/dist/primitives/thread/types.d.ts +0 -8
- package/dist/primitives/thread/types.d.ts.map +0 -1
- package/dist/primitives/thread/types.js +0 -19
- package/dist/primitives/thread/types.js.map +0 -1
- package/dist/primitives/thread/types.mjs +0 -1
- package/dist/primitives/thread/types.mjs.map +0 -1
- package/dist/runtimes/core/subscribeToMainThread.d.ts +0 -6
- package/dist/runtimes/core/subscribeToMainThread.d.ts.map +0 -1
- package/dist/runtimes/core/subscribeToMainThread.js.map +0 -1
- package/dist/runtimes/core/subscribeToMainThread.mjs +0 -23
- package/dist/runtimes/core/subscribeToMainThread.mjs.map +0 -1
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useAppendMessage.tsx +0 -19
- package/src/hooks/useSwitchToNewThread.tsx +0 -14
- package/src/primitive-hooks/actionBar/index.ts +0 -39
- package/src/primitive-hooks/branchPicker/index.ts +0 -18
- package/src/primitive-hooks/composer/index.ts +0 -17
- package/src/primitive-hooks/message/index.ts +0 -4
- package/src/primitive-hooks/thread/index.ts +0 -16
- package/src/primitives/actionBar/types.ts +0 -8
- package/src/primitives/assistantModal/types.ts +0 -3
- package/src/primitives/attachment/types.ts +0 -0
- package/src/primitives/branchPicker/types.ts +0 -5
- package/src/primitives/composer/types.ts +0 -5
- package/src/primitives/contentPart/types.ts +0 -4
- package/src/primitives/message/MessageInProgress.tsx +0 -22
- package/src/primitives/message/types.ts +0 -4
- package/src/primitives/thread/types.ts +0 -7
- package/src/runtimes/core/subscribeToMainThread.ts +0 -30
package/src/api/ThreadRuntime.ts
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
import {
|
2
|
-
AddToolResultOptions,
|
3
2
|
ThreadSuggestion,
|
4
3
|
RuntimeCapabilities,
|
5
|
-
SubmitFeedbackOptions,
|
6
4
|
ThreadRuntimeCore,
|
7
5
|
SpeechState,
|
8
|
-
SubmittedFeedback,
|
9
6
|
ThreadRuntimeEventType,
|
7
|
+
ThreadMetadata,
|
10
8
|
} from "../runtimes/core/ThreadRuntimeCore";
|
11
9
|
import { ExportedMessageRepository } from "../runtimes/utils/MessageRepository";
|
12
10
|
import {
|
@@ -32,7 +30,6 @@ import {
|
|
32
30
|
} from "./ComposerRuntime";
|
33
31
|
import { LazyMemoizeSubject } from "./subscribable/LazyMemoizeSubject";
|
34
32
|
import { SKIP_UPDATE } from "./subscribable/SKIP_UPDATE";
|
35
|
-
import { ComposerRuntimeCore } from "../runtimes/core/ComposerRuntimeCore";
|
36
33
|
import { MessageRuntimePath, ThreadRuntimePath } from "./RuntimePathTypes";
|
37
34
|
|
38
35
|
export type CreateAppendMessage =
|
@@ -77,51 +74,59 @@ export type ThreadRuntimeCoreBinding = SubscribableWithState<
|
|
77
74
|
outerSubscribe(callback: () => void): Unsubscribe;
|
78
75
|
};
|
79
76
|
|
80
|
-
export type ThreadState =
|
77
|
+
export type ThreadState = {
|
81
78
|
/**
|
82
79
|
* The thread ID.
|
80
|
+
* @deprecated This field is deprecated and will be removed in 0.8.0. Use `metadata.threadId` instead.
|
83
81
|
*/
|
84
|
-
threadId: string;
|
82
|
+
readonly threadId: string;
|
83
|
+
|
84
|
+
/**
|
85
|
+
* The thread metadata.
|
86
|
+
*/
|
87
|
+
readonly metadata: ThreadMetadata;
|
88
|
+
|
85
89
|
/**
|
86
90
|
* Whether the thread is disabled. Disabled threads cannot receive new messages.
|
87
91
|
*/
|
88
|
-
isDisabled: boolean;
|
92
|
+
readonly isDisabled: boolean;
|
89
93
|
|
90
94
|
/**
|
91
95
|
* Whether the thread is running. A thread is considered running when there is an active stream connection to the backend.
|
92
96
|
*/
|
93
|
-
isRunning: boolean;
|
97
|
+
readonly isRunning: boolean;
|
94
98
|
|
95
99
|
/**
|
96
100
|
* The capabilities of the thread, such as whether the thread supports editing, branch switching, etc.
|
97
101
|
*/
|
98
|
-
capabilities: RuntimeCapabilities;
|
102
|
+
readonly capabilities: RuntimeCapabilities;
|
99
103
|
|
100
104
|
/**
|
101
105
|
* The messages in the currently selected branch of the thread.
|
102
106
|
*/
|
103
|
-
messages: readonly ThreadMessage[];
|
107
|
+
readonly messages: readonly ThreadMessage[];
|
104
108
|
|
105
109
|
/**
|
106
110
|
* Follow up message suggestions to show the user.
|
107
111
|
*/
|
108
|
-
suggestions: readonly ThreadSuggestion[];
|
112
|
+
readonly suggestions: readonly ThreadSuggestion[];
|
109
113
|
|
110
114
|
/**
|
111
115
|
* Custom extra information provided by the runtime.
|
112
116
|
*/
|
113
|
-
extras: unknown;
|
117
|
+
readonly extras: unknown;
|
114
118
|
|
115
119
|
/**
|
116
120
|
* @deprecated This API is still under active development and might change without notice.
|
117
121
|
*/
|
118
|
-
speech: SpeechState | undefined;
|
119
|
-
}
|
122
|
+
readonly speech: SpeechState | undefined;
|
123
|
+
};
|
120
124
|
|
121
125
|
export const getThreadState = (runtime: ThreadRuntimeCore): ThreadState => {
|
122
126
|
const lastMessage = runtime.messages.at(-1);
|
123
127
|
return Object.freeze({
|
124
|
-
threadId: runtime.threadId,
|
128
|
+
threadId: runtime.metadata.threadId,
|
129
|
+
metadata: runtime.metadata,
|
125
130
|
capabilities: runtime.capabilities,
|
126
131
|
isDisabled: runtime.isDisabled,
|
127
132
|
isRunning:
|
@@ -135,18 +140,44 @@ export const getThreadState = (runtime: ThreadRuntimeCore): ThreadState => {
|
|
135
140
|
});
|
136
141
|
};
|
137
142
|
|
138
|
-
export type ThreadRuntime =
|
143
|
+
export type ThreadRuntime = {
|
144
|
+
/**
|
145
|
+
* The selector for the thread runtime.
|
146
|
+
*/
|
139
147
|
readonly path: ThreadRuntimePath;
|
140
148
|
|
149
|
+
/**
|
150
|
+
* The thread composer runtime.
|
151
|
+
*/
|
141
152
|
readonly composer: ThreadComposerRuntime;
|
142
|
-
getState(): ThreadState;
|
143
153
|
|
144
154
|
/**
|
145
|
-
*
|
155
|
+
* Gets a snapshot of the thread state.
|
146
156
|
*/
|
147
|
-
|
157
|
+
getState(): ThreadState;
|
148
158
|
|
159
|
+
/**
|
160
|
+
* Append a new message to the thread.
|
161
|
+
*
|
162
|
+
* @example ```ts
|
163
|
+
* // append a new user message with the text "Hello, world!"
|
164
|
+
* threadRuntime.append("Hello, world!");
|
165
|
+
* ```
|
166
|
+
*
|
167
|
+
* @example ```ts
|
168
|
+
* // append a new assistant message with the text "Hello, world!"
|
169
|
+
* threadRuntime.append({
|
170
|
+
* role: "assistant",
|
171
|
+
* content: [{ type: "text", text: "Hello, world!" }],
|
172
|
+
* });
|
173
|
+
* ```
|
174
|
+
*/
|
149
175
|
append(message: CreateAppendMessage): void;
|
176
|
+
|
177
|
+
/**
|
178
|
+
*
|
179
|
+
* @param parentId
|
180
|
+
*/
|
150
181
|
startRun(parentId: string | null): void;
|
151
182
|
subscribe(callback: () => void): Unsubscribe;
|
152
183
|
cancelRun(): void;
|
@@ -162,153 +193,13 @@ export type ThreadRuntime = Readonly<{
|
|
162
193
|
stopSpeaking: () => void;
|
163
194
|
|
164
195
|
unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;
|
196
|
+
};
|
165
197
|
|
166
|
-
|
167
|
-
|
168
|
-
/**
|
169
|
-
* @deprecated Use `getState().capabilities` instead. This will be removed in 0.6.0.
|
170
|
-
*/
|
171
|
-
capabilities: Readonly<RuntimeCapabilities>;
|
172
|
-
|
173
|
-
/**
|
174
|
-
* @deprecated Use `getState().threadId` instead. This will be removed in 0.6.0.
|
175
|
-
*/
|
176
|
-
threadId: string;
|
177
|
-
|
178
|
-
/**
|
179
|
-
* @deprecated Use `getState().isDisabled` instead. This will be removed in 0.6.0.
|
180
|
-
*/
|
181
|
-
isDisabled: boolean;
|
182
|
-
|
183
|
-
/**
|
184
|
-
* @deprecated Use `getState().isRunning` instead. This will be removed in 0.6.0.
|
185
|
-
*/
|
186
|
-
isRunning: boolean;
|
187
|
-
|
188
|
-
/**
|
189
|
-
* @deprecated Use `getState().messages` instead. This will be removed in 0.6.0.
|
190
|
-
*/
|
191
|
-
messages: readonly ThreadMessage[];
|
192
|
-
|
193
|
-
/**
|
194
|
-
* @deprecated Use `getState().followupSuggestions` instead. This will be removed in 0.6.0.
|
195
|
-
*/
|
196
|
-
suggestions: readonly ThreadSuggestion[];
|
197
|
-
|
198
|
-
/**
|
199
|
-
* @deprecated Use `getState().speechState` instead. This will be removed in 0.6.0.
|
200
|
-
*/
|
201
|
-
speech: SpeechState | undefined;
|
202
|
-
|
203
|
-
/**
|
204
|
-
* @deprecated Use `getState().extras` instead. This will be removed in 0.6.0.
|
205
|
-
*/
|
206
|
-
extras: unknown;
|
207
|
-
|
208
|
-
/**
|
209
|
-
* @deprecated Use `getMesssageById(id).getState().branchNumber` / `getMesssageById(id).getState().branchCount` instead. This will be removed in 0.6.0.
|
210
|
-
*/
|
211
|
-
getBranches: (messageId: string) => readonly string[];
|
212
|
-
|
213
|
-
/**
|
214
|
-
* @deprecated Use `getMesssageById(id).switchToBranch({ options })` instead. This will be removed in 0.6.0.
|
215
|
-
*/
|
216
|
-
switchToBranch: (branchId: string) => void;
|
217
|
-
|
218
|
-
/**
|
219
|
-
* @deprecated Use `getMesssageById(id).getContentPartByToolCallId(toolCallId).addToolResult({ result })` instead. This will be removed in 0.6.0.
|
220
|
-
*/
|
221
|
-
addToolResult: (options: AddToolResultOptions) => void;
|
222
|
-
|
223
|
-
/**
|
224
|
-
* @deprecated Use `getMesssageById(id).speak()` instead. This will be removed in 0.6.0.
|
225
|
-
*/
|
226
|
-
speak: (messageId: string) => void;
|
227
|
-
|
228
|
-
/**
|
229
|
-
* @deprecated Use `getMesssageById(id).getState().submittedFeedback` instead. This will be removed in 0.6.0.
|
230
|
-
*/
|
231
|
-
getSubmittedFeedback: (messageId: string) => SubmittedFeedback | undefined;
|
232
|
-
|
233
|
-
/**
|
234
|
-
* @deprecated Use `getMesssageById(id).submitFeedback({ type })` instead. This will be removed in 0.6.0.
|
235
|
-
*/
|
236
|
-
submitFeedback: (feedback: SubmitFeedbackOptions) => void;
|
237
|
-
|
238
|
-
/**
|
239
|
-
* @deprecated Use `getMesssageById(id).composer` instead. This will be removed in 0.6.0.
|
240
|
-
*/
|
241
|
-
getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;
|
242
|
-
|
243
|
-
/**
|
244
|
-
* @deprecated Use `getMesssageById(id).composer.beginEdit()` instead. This will be removed in 0.6.0.
|
245
|
-
*/
|
246
|
-
beginEdit: (messageId: string) => void;
|
247
|
-
}>;
|
248
|
-
|
249
|
-
export class ThreadRuntimeImpl
|
250
|
-
implements Omit<ThreadRuntimeCore, "getMessageById">, ThreadRuntime
|
251
|
-
{
|
198
|
+
export class ThreadRuntimeImpl implements ThreadRuntime {
|
252
199
|
public get path() {
|
253
200
|
return this._threadBinding.path;
|
254
201
|
}
|
255
202
|
|
256
|
-
/**
|
257
|
-
* @deprecated Use `getState().threadId` instead. This will be removed in 0.6.0.
|
258
|
-
*/
|
259
|
-
public get threadId() {
|
260
|
-
return this.getState().threadId;
|
261
|
-
}
|
262
|
-
|
263
|
-
/**
|
264
|
-
* @deprecated Use `getState().isDisabled` instead. This will be removed in 0.6.0.
|
265
|
-
*/
|
266
|
-
public get isDisabled() {
|
267
|
-
return this.getState().isDisabled;
|
268
|
-
}
|
269
|
-
|
270
|
-
/**
|
271
|
-
* @deprecated Use `getState().isRunning` instead. This will be removed in 0.6.0.
|
272
|
-
*/
|
273
|
-
public get isRunning() {
|
274
|
-
return this.getState().isRunning;
|
275
|
-
}
|
276
|
-
|
277
|
-
/**
|
278
|
-
* @deprecated Use `getState().capabilities` instead. This will be removed in 0.6.0.
|
279
|
-
*/
|
280
|
-
public get capabilities() {
|
281
|
-
return this.getState().capabilities;
|
282
|
-
}
|
283
|
-
|
284
|
-
/**
|
285
|
-
* @deprecated Use `getState().extras` instead. This will be removed in 0.6.0.
|
286
|
-
*/
|
287
|
-
public get extras() {
|
288
|
-
return this._threadBinding.getState().extras;
|
289
|
-
}
|
290
|
-
|
291
|
-
/**
|
292
|
-
* @deprecated Use `getState().followupSuggestions` instead. This will be removed in 0.6.0.
|
293
|
-
*/
|
294
|
-
public get suggestions() {
|
295
|
-
return this._threadBinding.getState().suggestions;
|
296
|
-
}
|
297
|
-
|
298
|
-
/**
|
299
|
-
* @deprecated Use `getState().messages` instead. This will be removed in 0.6.0.
|
300
|
-
*/
|
301
|
-
public get messages() {
|
302
|
-
return this._threadBinding.getState().messages;
|
303
|
-
}
|
304
|
-
|
305
|
-
/**
|
306
|
-
* @deprecated Use `getState().speechState` instead. This will be removed in 0.6.0.
|
307
|
-
*/
|
308
|
-
public get speech() {
|
309
|
-
return this._threadBinding.getState().speech;
|
310
|
-
}
|
311
|
-
|
312
203
|
public unstable_getCore() {
|
313
204
|
return this._threadBinding.getState();
|
314
205
|
}
|
@@ -363,18 +254,10 @@ export class ThreadRuntimeImpl
|
|
363
254
|
return this._threadBinding.subscribe(callback);
|
364
255
|
}
|
365
256
|
|
366
|
-
/**
|
367
|
-
* @derprecated Use `getMesssageById(id).getState().branchNumber` / `getMesssageById(id).getState().branchCount` instead. This will be removed in 0.6.0.
|
368
|
-
*/
|
369
|
-
public getBranches(messageId: string) {
|
370
|
-
return this._threadBinding.getState().getBranches(messageId);
|
371
|
-
}
|
372
|
-
|
373
257
|
public getModelConfig() {
|
374
258
|
return this._threadBinding.getState().getModelConfig();
|
375
259
|
}
|
376
260
|
|
377
|
-
// TODO sometimes you want to continue when there is no child message
|
378
261
|
public startRun(parentId: string | null) {
|
379
262
|
return this._threadBinding.getState().startRun(parentId);
|
380
263
|
}
|
@@ -383,27 +266,6 @@ export class ThreadRuntimeImpl
|
|
383
266
|
this._threadBinding.getState().cancelRun();
|
384
267
|
}
|
385
268
|
|
386
|
-
/**
|
387
|
-
* @deprecated Use `getMesssageById(id).getContentPartByToolCallId(toolCallId).addToolResult({ result })` instead. This will be removed in 0.6.0.
|
388
|
-
*/
|
389
|
-
public addToolResult(options: AddToolResultOptions) {
|
390
|
-
this._threadBinding.getState().addToolResult(options);
|
391
|
-
}
|
392
|
-
|
393
|
-
/**
|
394
|
-
* @deprecated Use `getMesssageById(id).switchToBranch({ options })` instead. This will be removed in 0.6.0.
|
395
|
-
*/
|
396
|
-
public switchToBranch(branchId: string) {
|
397
|
-
return this._threadBinding.getState().switchToBranch(branchId);
|
398
|
-
}
|
399
|
-
|
400
|
-
/**
|
401
|
-
* @deprecated Use `getMesssageById(id).speak()` instead. This will be removed in 0.6.0.
|
402
|
-
*/
|
403
|
-
public speak(messageId: string) {
|
404
|
-
return this._threadBinding.getState().speak(messageId);
|
405
|
-
}
|
406
|
-
|
407
269
|
public stopSpeaking() {
|
408
270
|
return this._threadBinding.getState().stopSpeaking();
|
409
271
|
}
|
@@ -412,27 +274,6 @@ export class ThreadRuntimeImpl
|
|
412
274
|
return this._threadBinding.getState().getSubmittedFeedback(messageId);
|
413
275
|
}
|
414
276
|
|
415
|
-
/**
|
416
|
-
* @deprecated Use `getMesssageById(id).submitFeedback({ type })` instead. This will be removed in 0.6.0.
|
417
|
-
*/
|
418
|
-
public submitFeedback(options: SubmitFeedbackOptions) {
|
419
|
-
return this._threadBinding.getState().submitFeedback(options);
|
420
|
-
}
|
421
|
-
|
422
|
-
/**
|
423
|
-
* @deprecated Use `getMesssageById(id).getMessageByIndex(idx).composer` instead. This will be removed in 0.6.0.
|
424
|
-
*/
|
425
|
-
public getEditComposer(messageId: string) {
|
426
|
-
return this._threadBinding.getState().getEditComposer(messageId);
|
427
|
-
}
|
428
|
-
|
429
|
-
/**
|
430
|
-
* @deprecated Use `getMesssageById(id).getMessageByIndex(idx).composer.beginEdit()` instead. This will be removed in 0.6.0.
|
431
|
-
*/
|
432
|
-
public beginEdit(messageId: string) {
|
433
|
-
return this._threadBinding.getState().beginEdit(messageId);
|
434
|
-
}
|
435
|
-
|
436
277
|
public export() {
|
437
278
|
return this._threadBinding.getState().export();
|
438
279
|
}
|
@@ -500,11 +341,9 @@ export class ThreadRuntimeImpl
|
|
500
341
|
return {
|
501
342
|
...message,
|
502
343
|
|
503
|
-
message,
|
504
344
|
isLast: messages.at(-1)?.id === message.id,
|
505
345
|
parentId,
|
506
346
|
|
507
|
-
branches,
|
508
347
|
branchNumber: branches.indexOf(message.id) + 1,
|
509
348
|
branchCount: branches.length,
|
510
349
|
|
package/src/api/index.ts
CHANGED
@@ -15,3 +15,7 @@ export type {
|
|
15
15
|
} from "./ComposerRuntime";
|
16
16
|
export type { AttachmentRuntime, AttachmentState } from "./AttachmentRuntime";
|
17
17
|
export type { ThreadListRuntime, ThreadListState } from "./ThreadListRuntime";
|
18
|
+
export type {
|
19
|
+
ThreadListItemRuntime,
|
20
|
+
ThreadListItemState,
|
21
|
+
} from "./ThreadListItemRuntime";
|
@@ -41,7 +41,6 @@ export const TextContentPartProvider: FC<TextContentPartProvider.Props> = ({
|
|
41
41
|
);
|
42
42
|
const useContentPart = create<ContentPartState>(() => ({
|
43
43
|
status: isRunning ? RUNNING_STATUS : COMPLETE_STATUS,
|
44
|
-
part: { type: "text", text },
|
45
44
|
type: "text",
|
46
45
|
text,
|
47
46
|
}));
|
@@ -64,7 +63,6 @@ export const TextContentPartProvider: FC<TextContentPartProvider.Props> = ({
|
|
64
63
|
{
|
65
64
|
type: "text",
|
66
65
|
text,
|
67
|
-
part: { type: "text", text },
|
68
66
|
status: targetStatus,
|
69
67
|
} satisfies ContentPartState,
|
70
68
|
true,
|
@@ -34,19 +34,6 @@ const useThreadStore = (runtime: ThreadRuntime) => {
|
|
34
34
|
return store;
|
35
35
|
};
|
36
36
|
|
37
|
-
const useThreadMessagesStore = (runtime: ThreadRuntime) => {
|
38
|
-
const [store] = useState(() => create(() => runtime.messages));
|
39
|
-
|
40
|
-
useEffect(() => {
|
41
|
-
const updateState = () =>
|
42
|
-
writableStore(store).setState(runtime.messages, true);
|
43
|
-
updateState();
|
44
|
-
return runtime.subscribe(updateState);
|
45
|
-
}, [runtime, store]);
|
46
|
-
|
47
|
-
return store;
|
48
|
-
};
|
49
|
-
|
50
37
|
const useThreadComposerStore = (runtime: ThreadComposerRuntime) => {
|
51
38
|
const [store] = useState(() => create(() => runtime.getState()));
|
52
39
|
|
@@ -65,7 +52,6 @@ export const ThreadRuntimeProvider: FC<
|
|
65
52
|
> = ({ children, runtime }) => {
|
66
53
|
const useThreadRuntime = useThreadRuntimeStore(runtime);
|
67
54
|
const useThread = useThreadStore(runtime);
|
68
|
-
const useThreadMessages = useThreadMessagesStore(runtime);
|
69
55
|
const useThreadComposer = useThreadComposerStore(runtime.composer);
|
70
56
|
|
71
57
|
const context = useMemo<ThreadContextValue>(() => {
|
@@ -74,12 +60,10 @@ export const ThreadRuntimeProvider: FC<
|
|
74
60
|
return {
|
75
61
|
useThread,
|
76
62
|
useThreadRuntime,
|
77
|
-
useThreadMessages,
|
78
|
-
useThreadActions: useThreadRuntime,
|
79
63
|
useComposer: useThreadComposer,
|
80
64
|
useViewport,
|
81
65
|
};
|
82
|
-
}, [useThread, useThreadRuntime,
|
66
|
+
}, [useThread, useThreadRuntime, useThreadComposer]);
|
83
67
|
|
84
68
|
return (
|
85
69
|
<ThreadContext.Provider value={context}>{children}</ThreadContext.Provider>
|
@@ -13,11 +13,6 @@ export type AssistantContextValue = {
|
|
13
13
|
useToolUIs: UseBoundStore<ReadonlyStore<AssistantToolUIsState>>;
|
14
14
|
useAssistantRuntime: UseBoundStore<ReadonlyStore<AssistantRuntime>>;
|
15
15
|
useThreadList: UseBoundStore<ReadonlyStore<ThreadListState>>;
|
16
|
-
|
17
|
-
/**
|
18
|
-
* @deprecated Use `useAssistantRuntime` instead. This will be removed in 0.6.0.
|
19
|
-
*/
|
20
|
-
useAssistantActions: UseBoundStore<ReadonlyStore<AssistantRuntime>>;
|
21
16
|
};
|
22
17
|
|
23
18
|
export const AssistantContext = createContext<AssistantContextValue | null>(
|
@@ -43,26 +38,6 @@ export function useAssistantRuntime(options?: {
|
|
43
38
|
return context.useAssistantRuntime();
|
44
39
|
}
|
45
40
|
|
46
|
-
export const actions = createContextStoreHook(
|
47
|
-
useAssistantContext,
|
48
|
-
"useAssistantActions",
|
49
|
-
);
|
50
|
-
|
51
|
-
/**
|
52
|
-
* @deprecated Use `useAssistantRuntime` instead. This will be removed in 0.6.0.
|
53
|
-
*/
|
54
|
-
export const useAssistantActionsStore = actions.useAssistantActionsStore;
|
55
|
-
|
56
|
-
/**
|
57
|
-
* @deprecated Use `useAssistantRuntime` instead. This will be removed in 0.6.0.
|
58
|
-
*/
|
59
|
-
export const useAssistantActions = actions.useAssistantActions;
|
60
|
-
|
61
|
-
/**
|
62
|
-
* @deprecated Use `useAssistantRuntime` instead. This will be removed in 0.6.0.
|
63
|
-
*/
|
64
|
-
export const useAssistantRuntimeStore = useAssistantActionsStore;
|
65
|
-
|
66
41
|
export const { useToolUIs, useToolUIsStore } = createContextStoreHook(
|
67
42
|
useAssistantContext,
|
68
43
|
"useToolUIs",
|
@@ -36,7 +36,7 @@ export function useContentPartRuntime(options?: {
|
|
36
36
|
return context.useContentPartRuntime();
|
37
37
|
}
|
38
38
|
|
39
|
-
export const { useContentPart
|
39
|
+
export const { useContentPart } = createContextStoreHook(
|
40
40
|
useContentPartContext,
|
41
41
|
"useContentPart",
|
42
42
|
);
|
@@ -38,7 +38,7 @@ export function useMessageRuntime(options?: {
|
|
38
38
|
return context.useMessageRuntime();
|
39
39
|
}
|
40
40
|
|
41
|
-
export const { useMessage
|
41
|
+
export const { useMessage } = createContextStoreHook(
|
42
42
|
useMessageContext,
|
43
43
|
"useMessage",
|
44
44
|
);
|
@@ -48,7 +48,7 @@ export const { useMessageUtils, useMessageUtilsStore } = createContextStoreHook(
|
|
48
48
|
"useMessageUtils",
|
49
49
|
);
|
50
50
|
|
51
|
-
export const { useEditComposer
|
51
|
+
export const { useEditComposer } = createContextStoreHook(
|
52
52
|
useMessageContext,
|
53
53
|
"useEditComposer",
|
54
54
|
);
|
@@ -8,17 +8,12 @@ import { createContextHook } from "./utils/createContextHook";
|
|
8
8
|
import { createContextStoreHook } from "./utils/createContextStoreHook";
|
9
9
|
import { ThreadRuntime } from "../../api/ThreadRuntime";
|
10
10
|
import { ThreadState } from "../../api/ThreadRuntime";
|
11
|
-
import { ModelConfig
|
11
|
+
import { ModelConfig } from "../../types";
|
12
12
|
import { ThreadComposerState } from "../../api/ComposerRuntime";
|
13
13
|
|
14
14
|
export type ThreadContextValue = {
|
15
15
|
useThread: UseBoundStore<ReadonlyStore<ThreadState>>;
|
16
|
-
/**
|
17
|
-
* @deprecated Use `useThreadRuntime` instead. This will be removed in 0.6.0.
|
18
|
-
*/
|
19
|
-
useThreadActions: UseBoundStore<ReadonlyStore<ThreadRuntime>>;
|
20
16
|
useThreadRuntime: UseBoundStore<ReadonlyStore<ThreadRuntime>>;
|
21
|
-
useThreadMessages: UseBoundStore<ReadonlyStore<readonly ThreadMessage[]>>;
|
22
17
|
useComposer: UseBoundStore<ReadonlyStore<ThreadComposerState>>;
|
23
18
|
useViewport: UseBoundStore<ReadonlyStore<ThreadViewportState>>;
|
24
19
|
};
|
@@ -42,48 +37,16 @@ export function useThreadRuntime(options?: { optional?: boolean | undefined }) {
|
|
42
37
|
return context.useThreadRuntime();
|
43
38
|
}
|
44
39
|
|
45
|
-
export const
|
40
|
+
export const { useThread } = createContextStoreHook(
|
46
41
|
useThreadContext,
|
47
|
-
"
|
42
|
+
"useThread",
|
48
43
|
);
|
49
44
|
|
50
|
-
|
51
|
-
* @deprecated Use `useThreadRuntime` instead. This will be removed in 0.6.0.
|
52
|
-
*/
|
53
|
-
export const useThreadActionsStore = actions.useThreadActionsStore;
|
54
|
-
|
55
|
-
/**
|
56
|
-
* @deprecated Use `useThreadRuntime` instead. This will be removed in 0.6.0.
|
57
|
-
*/
|
58
|
-
export const useThreadActions = actions.useThreadActions;
|
59
|
-
|
60
|
-
/**
|
61
|
-
* @deprecated Use `useThreadRuntime` instead. This will be removed in 0.6.0.
|
62
|
-
*/
|
63
|
-
export const useThreadRuntimeStore = useThreadActionsStore;
|
64
|
-
|
65
|
-
export const { useThread, useThreadStore } = createContextStoreHook(
|
45
|
+
export const { useComposer: useThreadComposer } = createContextStoreHook(
|
66
46
|
useThreadContext,
|
67
|
-
"
|
47
|
+
"useComposer",
|
68
48
|
);
|
69
49
|
|
70
|
-
const messages = createContextStoreHook(useThreadContext, "useThreadMessages");
|
71
|
-
|
72
|
-
/**
|
73
|
-
* @deprecated Use `useThread().messages` instead. This will be removed in 0.6.0.
|
74
|
-
*/
|
75
|
-
export const useThreadMessages = messages.useThreadMessages;
|
76
|
-
|
77
|
-
/**
|
78
|
-
* @deprecated Use `useThreadRuntime().getState().messages` instead. This will be removed in 0.6.0.
|
79
|
-
*/
|
80
|
-
export const useThreadMessagesStore = messages.useThreadMessagesStore;
|
81
|
-
|
82
|
-
export const {
|
83
|
-
useComposer: useThreadComposer,
|
84
|
-
useComposerStore: useThreadComposerStore,
|
85
|
-
} = createContextStoreHook(useThreadContext, "useComposer");
|
86
|
-
|
87
50
|
export const {
|
88
51
|
useViewport: useThreadViewport,
|
89
52
|
useViewportStore: useThreadViewportStore,
|