@assistant-ui/core 0.2.4 → 0.2.6
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/adapters/attachment.d.ts +43 -39
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +148 -183
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +6 -2
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/directive-formatter.js +36 -33
- package/dist/adapters/directive-formatter.js.map +1 -1
- package/dist/adapters/feedback.d.ts +9 -6
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/feedback.js +0 -2
- package/dist/adapters/index.d.ts +9 -13
- package/dist/adapters/index.js +5 -6
- package/dist/adapters/speech.d.ts +66 -63
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +170 -174
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +9 -6
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/suggestion.js +0 -2
- package/dist/adapters/thread-history.d.ts +40 -37
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/thread-history.js +0 -2
- package/dist/adapters/trigger.d.ts +9 -8
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/trigger.js +0 -2
- package/dist/adapters/voice.d.ts +46 -42
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/adapters/voice.js +98 -107
- package/dist/adapters/voice.js.map +1 -1
- package/dist/index.d.ts +45 -53
- package/dist/index.js +16 -20
- package/dist/internal.d.ts +37 -8
- package/dist/internal.js +34 -18
- package/dist/model-context/frame/host.d.ts +23 -19
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +121 -135
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +20 -16
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +115 -126
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/frame/types.d.ts +25 -22
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/frame/types.js +5 -1
- package/dist/model-context/frame/types.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +13 -9
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry-handles.js +0 -2
- package/dist/model-context/registry.d.ts +19 -15
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/registry.js +93 -107
- package/dist/model-context/registry.js.map +1 -1
- package/dist/model-context/tool.d.ts +6 -2
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/tool.js +30 -27
- package/dist/model-context/tool.js.map +1 -1
- package/dist/model-context/types.d.ts +37 -33
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/model-context/types.js +24 -38
- package/dist/model-context/types.js.map +1 -1
- package/dist/react/AssistantProvider.d.ts +12 -8
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantProvider.js +16 -9
- package/dist/react/AssistantProvider.js.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +26 -18
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.js +33 -25
- package/dist/react/AssistantRuntimeProvider.js.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +5 -2
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.js +11 -11
- package/dist/react/RuntimeAdapter.js.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +14 -11
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +136 -147
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +8 -4
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.js +13 -13
- package/dist/react/adapters/TitleGenerationAdapter.js.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +6 -2
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.js +53 -51
- package/dist/react/client/DataRenderers.js.map +1 -1
- package/dist/react/client/Interactables.d.ts +6 -2
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +251 -257
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/Tools.d.ts +13 -14
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +57 -68
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +10 -6
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +51 -59
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +96 -90
- package/dist/react/index.js +89 -96
- package/dist/react/model-context/makeAssistantDataUI.d.ts +9 -6
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.js +17 -13
- package/dist/react/model-context/makeAssistantDataUI.js.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +9 -6
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.js +18 -14
- package/dist/react/model-context/makeAssistantTool.js.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +9 -6
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.js +19 -15
- package/dist/react/model-context/makeAssistantToolUI.js.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +13 -11
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.js +0 -2
- package/dist/react/model-context/useAssistantContext.d.ts +5 -3
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.js +13 -14
- package/dist/react/model-context/useAssistantContext.js.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +9 -7
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.js +19 -12
- package/dist/react/model-context/useAssistantDataUI.js.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +5 -3
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.js +18 -16
- package/dist/react/model-context/useAssistantInstructions.js.map +1 -1
- package/dist/react/model-context/useAssistantInteractable.d.ts +12 -8
- package/dist/react/model-context/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInteractable.js +36 -26
- package/dist/react/model-context/useAssistantInteractable.js.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +9 -6
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.js +48 -47
- package/dist/react/model-context/useAssistantTool.js.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +9 -7
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.js +22 -15
- package/dist/react/model-context/useAssistantToolUI.js.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +7 -3
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.js +12 -12
- package/dist/react/model-context/useInlineRender.js.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +9 -7
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableState.js +29 -31
- package/dist/react/model-context/useInteractableState.js.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +7 -7
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.js +44 -50
- package/dist/react/model-context/useToolArgsStatus.js.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +13 -7
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.js +31 -23
- package/dist/react/primitive-hooks/useActionBarCopy.js.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +6 -3
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.js +13 -7
- package/dist/react/primitive-hooks/useActionBarEdit.js.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +9 -6
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.js +22 -14
- package/dist/react/primitive-hooks/useActionBarFeedback.js.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +6 -3
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.js +13 -9
- package/dist/react/primitive-hooks/useActionBarReload.js.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +6 -3
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.js +15 -11
- package/dist/react/primitive-hooks/useActionBarSpeak.js.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +6 -3
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.js +13 -7
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.js.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +6 -3
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.js +17 -14
- package/dist/react/primitive-hooks/useBranchPickerNext.js.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +6 -3
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.js +17 -14
- package/dist/react/primitive-hooks/useBranchPickerPrevious.js.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +8 -4
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.js +13 -7
- package/dist/react/primitive-hooks/useComposerAddAttachment.js.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +6 -3
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.js +13 -7
- package/dist/react/primitive-hooks/useComposerCancel.js.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +6 -3
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.js +13 -9
- package/dist/react/primitive-hooks/useComposerDictate.js.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +8 -4
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.js +13 -8
- package/dist/react/primitive-hooks/useComposerSend.js.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +5 -2
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.js +9 -6
- package/dist/react/primitive-hooks/useEditComposerCancel.js.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +6 -3
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.js +13 -7
- package/dist/react/primitive-hooks/useEditComposerSend.js.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +8 -5
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.js +16 -11
- package/dist/react/primitive-hooks/useMessageBranching.js.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +4 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.js +6 -5
- package/dist/react/primitive-hooks/useMessageError.js.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +6 -3
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.js +13 -7
- package/dist/react/primitive-hooks/useMessageReload.js.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +14 -7
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.js +33 -28
- package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +4 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.js +6 -2
- package/dist/react/primitive-hooks/useThreadIsEmpty.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +4 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.js +6 -2
- package/dist/react/primitive-hooks/useThreadIsRunning.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +5 -2
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.js +9 -6
- package/dist/react/primitive-hooks/useThreadListItemArchive.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +5 -2
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.js +9 -6
- package/dist/react/primitive-hooks/useThreadListItemDelete.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +5 -2
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.js +9 -6
- package/dist/react/primitive-hooks/useThreadListItemTrigger.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +5 -2
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.js +9 -6
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +6 -3
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.js +13 -7
- package/dist/react/primitive-hooks/useThreadListLoadMore.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +5 -2
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.js +9 -6
- package/dist/react/primitive-hooks/useThreadListNew.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +6 -2
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.js +6 -2
- package/dist/react/primitive-hooks/useThreadMessages.js.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +12 -8
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.js +25 -21
- package/dist/react/primitive-hooks/useVoice.js.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +26 -27
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js +30 -28
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +27 -26
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.js +44 -48
- package/dist/react/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +12 -13
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.js +16 -17
- package/dist/react/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +16 -13
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.js +31 -23
- package/dist/react/primitives/composer/ComposerQueue.js.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +64 -0
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -0
- package/dist/react/primitives/generativeUI/GenerativeUI.js +91 -0
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -0
- package/dist/react/primitives/message/MessageAttachments.d.ts +27 -26
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +47 -52
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +82 -71
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +63 -61
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +148 -145
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +363 -335
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +11 -8
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageQuote.js +24 -21
- package/dist/react/primitives/message/MessageQuote.js.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +8 -4
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.js +6 -3
- package/dist/react/primitives/messagePart/MessagePartInProgress.js.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +16 -13
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.js +45 -41
- package/dist/react/primitives/part/PartMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +40 -55
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.js +58 -92
- package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +25 -25
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.js +39 -35
- package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +27 -26
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.js +47 -23
- package/dist/react/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +10 -6
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.js +7 -4
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +9 -5
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.js +30 -20
- package/dist/react/providers/AttachmentByIndexProvider.js.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +8 -4
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.js +19 -17
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +7 -3
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js +18 -11
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +7 -3
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.js +25 -16
- package/dist/react/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +7 -3
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.js +18 -11
- package/dist/react/providers/PartByIndexProvider.js.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +8 -4
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.js +14 -10
- package/dist/react/providers/QueueItemByIndexProvider.js.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +11 -7
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.js +46 -42
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +8 -4
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.js +14 -10
- package/dist/react/providers/SuggestionByIndexProvider.js.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +8 -4
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.js +32 -22
- package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +8 -4
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.js +22 -11
- package/dist/react/providers/ThreadListItemByIndexProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +8 -4
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.js +12 -8
- package/dist/react/providers/ThreadListItemRuntimeProvider.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +121 -109
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +123 -129
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +149 -135
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +460 -515
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +19 -15
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.js +16 -9
- package/dist/react/runtimes/RuntimeAdapterProvider.js.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +8 -4
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +372 -485
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +19 -13
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +83 -80
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +61 -58
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +80 -87
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +10 -7
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js +101 -101
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +23 -14
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.js +43 -46
- package/dist/react/runtimes/createMessageConverter.js.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +40 -31
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.js +226 -296
- package/dist/react/runtimes/external-message-converter.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +7 -3
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.js +18 -15
- package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +41 -26
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +58 -67
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +7 -3
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +51 -62
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useToolInvocations.d.ts +39 -34
- package/dist/react/runtimes/useToolInvocations.d.ts.map +1 -1
- package/dist/react/runtimes/useToolInvocations.js +371 -481
- package/dist/react/runtimes/useToolInvocations.js.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +73 -41
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.js +0 -2
- package/dist/react/types/scopes/dataRenderers.d.ts +15 -11
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.js +0 -2
- package/dist/react/types/scopes/interactables.d.ts +44 -42
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.js +0 -2
- package/dist/react/types/scopes/tools.d.ts +16 -12
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.js +0 -2
- package/dist/react/types/store-augmentation.d.ts +11 -9
- package/dist/react/types/store-augmentation.d.ts.map +1 -1
- package/dist/react/types/store-augmentation.js +0 -2
- package/dist/react/utils/getMessageQuote.d.ts +9 -6
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.js +8 -5
- package/dist/react/utils/getMessageQuote.js.map +1 -1
- package/dist/react/utils/groupParts.d.ts +59 -28
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/groupParts.js +104 -89
- package/dist/react/utils/groupParts.js.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +32 -28
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.js +25 -22
- package/dist/runtime/api/assistant-runtime.js.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +48 -45
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js +55 -52
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/bindings.d.ts +30 -25
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/bindings.js +0 -2
- package/dist/runtime/api/composer-runtime.d.ts +184 -182
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +239 -245
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +37 -27
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +74 -65
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +91 -80
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +169 -194
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +57 -54
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/paths.js +0 -2
- package/dist/runtime/api/thread-list-item-runtime.d.ts +68 -61
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.js +85 -84
- package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +57 -48
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js +160 -147
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +279 -272
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +244 -244
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +13 -9
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.js +13 -9
- package/dist/runtime/base/base-assistant-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +60 -57
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +348 -392
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +90 -84
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +349 -357
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +37 -30
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +70 -77
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +25 -21
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +51 -48
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +12 -8
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.js +0 -2
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +70 -67
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.js +0 -2
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +45 -39
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.js +0 -2
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +155 -145
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.js +0 -2
- package/dist/runtime/internal.d.ts +19 -23
- package/dist/runtime/internal.js +18 -22
- package/dist/runtime/utils/auto-status.d.ts +8 -4
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +18 -22
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +34 -31
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.js +0 -2
- package/dist/runtime/utils/external-store-message.d.ts +9 -5
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/external-store-message.js +21 -21
- package/dist/runtime/utils/external-store-message.js.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +48 -42
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +213 -267
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +51 -39
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +125 -139
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtimes/assistant-transport/utils.d.ts +4 -1
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/assistant-transport/utils.js +9 -5
- package/dist/runtimes/assistant-transport/utils.js.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +101 -97
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.js +0 -2
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +9 -5
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js +16 -13
- package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +46 -40
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js +141 -171
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +54 -47
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +216 -288
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +9 -5
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.js +14 -11
- package/dist/runtimes/external-store/thread-message-converter.js.map +1 -1
- package/dist/runtimes/internal.d.ts +15 -19
- package/dist/runtimes/internal.js +13 -17
- package/dist/runtimes/local/local-runtime-core.d.ts +11 -7
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-core.js +18 -18
- package/dist/runtimes/local/local-runtime-core.js.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +27 -23
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.js +0 -2
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +46 -42
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.js +84 -83
- package/dist/runtimes/local/local-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +81 -59
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +345 -424
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +6 -2
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/local/should-continue.js +7 -12
- package/dist/runtimes/local/should-continue.js.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +97 -92
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +167 -176
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +15 -11
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.js +33 -28
- package/dist/runtimes/remote-thread-list/adapter/in-memory.js.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +6 -2
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.js +155 -160
- package/dist/runtimes/remote-thread-list/empty-thread-core.js.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +27 -27
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.js +63 -73
- package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +46 -43
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.js +81 -91
- package/dist/runtimes/remote-thread-list/remote-thread-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +65 -61
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.js +0 -2
- package/dist/store/clients/chain-of-thought-client.d.ts +16 -12
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/chain-of-thought-client.js +24 -15
- package/dist/store/clients/chain-of-thought-client.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +6 -2
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/model-context-client.js +32 -26
- package/dist/store/clients/model-context-client.js.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +8 -4
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.js +67 -63
- package/dist/store/clients/no-op-composer-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +8 -4
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/runtime-adapter.js +33 -33
- package/dist/store/clients/runtime-adapter.js.map +1 -1
- package/dist/store/clients/suggestions.d.ts +12 -8
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/suggestions.js +28 -32
- package/dist/store/clients/suggestions.js.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +13 -9
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.js +98 -105
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/index.d.ts +18 -18
- package/dist/store/index.js +6 -8
- package/dist/store/internal.d.ts +9 -9
- package/dist/store/internal.js +9 -9
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +9 -5
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.js +12 -8
- package/dist/store/runtime-clients/attachment-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +14 -10
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +86 -89
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +9 -5
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.js +14 -9
- package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +12 -8
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +66 -70
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/tap-subscribable.d.ts +6 -2
- package/dist/store/runtime-clients/tap-subscribable.d.ts.map +1 -1
- package/dist/store/runtime-clients/tap-subscribable.js +14 -10
- package/dist/store/runtime-clients/tap-subscribable.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +9 -5
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js +33 -38
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +12 -8
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.js +53 -53
- package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +9 -5
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +93 -85
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/scope-registration.d.ts +29 -27
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scope-registration.js +0 -2
- package/dist/store/scopes/attachment.d.ts +23 -19
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/attachment.js +0 -2
- package/dist/store/scopes/chain-of-thought.d.ts +36 -33
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.js +0 -2
- package/dist/store/scopes/composer.d.ts +118 -115
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/composer.js +0 -2
- package/dist/store/scopes/message.d.ts +81 -81
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/message.js +0 -2
- package/dist/store/scopes/model-context.d.ts +14 -10
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/model-context.js +0 -2
- package/dist/store/scopes/part.d.ts +49 -39
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/part.js +0 -2
- package/dist/store/scopes/queue-item.d.ts +18 -15
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.js +0 -2
- package/dist/store/scopes/suggestion.d.ts +17 -14
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.js +0 -2
- package/dist/store/scopes/suggestions.d.ts +18 -14
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.js +0 -2
- package/dist/store/scopes/thread-list-item.d.ts +62 -56
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.js +0 -2
- package/dist/store/scopes/thread.d.ts +151 -149
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/thread.js +0 -2
- package/dist/store/scopes/threads.d.ts +36 -30
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/store/scopes/threads.js +0 -2
- package/dist/subscribable/subscribable.d.ts +62 -58
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +196 -220
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +13 -9
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +1 -1
- package/dist/tests/remote-thread-list-test-helpers.js +49 -42
- package/dist/tests/remote-thread-list-test-helpers.js.map +1 -1
- package/dist/types/attachment.d.ts +35 -32
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/attachment.js +0 -2
- package/dist/types/directive.d.ts +15 -13
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/directive.js +0 -2
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.js +0 -2
- package/dist/types/message.d.ts +238 -208
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js +6 -2
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +6 -3
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/quote.js +0 -2
- package/dist/types/trigger.d.ts +14 -10
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/trigger.js +0 -2
- package/dist/types/unsubscribe.d.ts +4 -1
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/types/unsubscribe.js +0 -2
- package/dist/utils/composite-context-provider.d.ts +11 -8
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.js +31 -28
- package/dist/utils/composite-context-provider.js.map +1 -1
- package/dist/utils/id.d.ts +8 -5
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +9 -5
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +4 -1
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.js +20 -25
- package/dist/utils/json/is-json-equal.js.map +1 -1
- package/dist/utils/json/is-json.d.ts +9 -5
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/is-json.js +17 -28
- package/dist/utils/json/is-json.js.map +1 -1
- package/dist/utils/text.d.ts +6 -2
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js +6 -3
- package/dist/utils/text.js.map +1 -1
- package/package.json +12 -12
- package/src/index.ts +4 -0
- package/src/react/index.ts +18 -0
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +182 -0
- package/src/react/primitives/message/MessageGroupedParts.tsx +38 -31
- package/src/react/primitives/message/MessageParts.tsx +64 -2
- package/src/react/providers/TextMessagePartProvider.tsx +3 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +11 -7
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +7 -2
- package/src/react/runtimes/cloud/auiV0.ts +1 -1
- package/src/react/runtimes/external-message-converter.ts +25 -12
- package/src/react/types/MessagePartComponentTypes.ts +34 -0
- package/src/react/utils/groupParts.ts +67 -22
- package/src/runtime/api/message-part-runtime.ts +26 -0
- package/src/runtime/api/thread-list-item-runtime.ts +3 -3
- package/src/runtime/api/thread-list-runtime.ts +9 -3
- package/src/runtime/base/base-thread-runtime-core.ts +12 -0
- package/src/runtime/interfaces/thread-list-runtime-core.ts +4 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +13 -5
- package/src/runtime/utils/thread-message-like.ts +18 -3
- package/src/runtimes/external-store/external-store-adapter.ts +4 -0
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +4 -1
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +7 -0
- package/src/runtimes/local/local-thread-runtime-core.ts +5 -0
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +4 -0
- package/src/runtimes/remote-thread-list/empty-thread-core.ts +4 -0
- package/src/store/clients/thread-message-client.ts +3 -0
- package/src/store/runtime-clients/message-part-runtime-client.ts +2 -0
- package/src/store/runtime-clients/thread-list-runtime-client.ts +2 -2
- package/src/store/scopes/part.ts +4 -0
- package/src/store/scopes/thread-list-item.ts +1 -1
- package/src/store/scopes/threads.ts +1 -1
- package/src/tests/RemoteThreadListThreadListRuntimeCore-switchToThread-unarchive.test.ts +88 -0
- package/src/tests/external-store-thread-runtime-core.test.ts +83 -0
- package/src/tests/groupParts.test.ts +118 -32
- package/src/types/index.ts +3 -0
- package/src/types/message.ts +56 -1
- package/dist/adapters/feedback.js.map +0 -1
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/adapters/index.js.map +0 -1
- package/dist/adapters/suggestion.js.map +0 -1
- package/dist/adapters/thread-history.js.map +0 -1
- package/dist/adapters/trigger.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal.d.ts.map +0 -1
- package/dist/internal.js.map +0 -1
- package/dist/model-context/registry-handles.js.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js.map +0 -1
- package/dist/react/model-context/toolbox.js.map +0 -1
- package/dist/react/types/MessagePartComponentTypes.js.map +0 -1
- package/dist/react/types/scopes/dataRenderers.js.map +0 -1
- package/dist/react/types/scopes/interactables.js.map +0 -1
- package/dist/react/types/scopes/tools.js.map +0 -1
- package/dist/react/types/store-augmentation.js.map +0 -1
- package/dist/runtime/api/bindings.js.map +0 -1
- package/dist/runtime/api/paths.js.map +0 -1
- package/dist/runtime/interfaces/assistant-runtime-core.js.map +0 -1
- package/dist/runtime/interfaces/composer-runtime-core.js.map +0 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.js.map +0 -1
- package/dist/runtime/interfaces/thread-runtime-core.js.map +0 -1
- package/dist/runtime/internal.d.ts.map +0 -1
- package/dist/runtime/internal.js.map +0 -1
- package/dist/runtime/utils/chat-model-adapter.js.map +0 -1
- package/dist/runtimes/external-store/external-store-adapter.js.map +0 -1
- package/dist/runtimes/internal.d.ts.map +0 -1
- package/dist/runtimes/internal.js.map +0 -1
- package/dist/runtimes/local/local-runtime-options.js.map +0 -1
- package/dist/runtimes/remote-thread-list/types.js.map +0 -1
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js.map +0 -1
- package/dist/store/internal.d.ts.map +0 -1
- package/dist/store/internal.js.map +0 -1
- package/dist/store/scope-registration.js.map +0 -1
- package/dist/store/scopes/attachment.js.map +0 -1
- package/dist/store/scopes/chain-of-thought.js.map +0 -1
- package/dist/store/scopes/composer.js.map +0 -1
- package/dist/store/scopes/message.js.map +0 -1
- package/dist/store/scopes/model-context.js.map +0 -1
- package/dist/store/scopes/part.js.map +0 -1
- package/dist/store/scopes/queue-item.js.map +0 -1
- package/dist/store/scopes/suggestion.js.map +0 -1
- package/dist/store/scopes/suggestions.js.map +0 -1
- package/dist/store/scopes/thread-list-item.js.map +0 -1
- package/dist/store/scopes/thread.js.map +0 -1
- package/dist/store/scopes/threads.js.map +0 -1
- package/dist/types/attachment.js.map +0 -1
- package/dist/types/directive.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/quote.js.map +0 -1
- package/dist/types/trigger.js.map +0 -1
- package/dist/types/unsubscribe.js.map +0 -1
|
@@ -1,390 +1,418 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo, useMemo, } from "react";
|
|
3
|
-
import { RenderChildrenWithAccessor, useAuiState, useAui, } from "@assistant-ui/store";
|
|
1
|
+
import { isMcpAppUri } from "../../../types/message.js";
|
|
4
2
|
import { PartByIndexProvider } from "../../providers/PartByIndexProvider.js";
|
|
5
3
|
import { TextMessagePartProvider } from "../../providers/TextMessagePartProvider.js";
|
|
6
4
|
import { ChainOfThoughtByIndicesProvider } from "../../providers/ChainOfThoughtByIndicesProvider.js";
|
|
7
5
|
import { getMessageQuote } from "../../utils/getMessageQuote.js";
|
|
8
|
-
import {
|
|
6
|
+
import { GenerativeUIRender } from "../generativeUI/GenerativeUI.js";
|
|
7
|
+
import { memo, useMemo } from "react";
|
|
8
|
+
import { RenderChildrenWithAccessor, useAui, useAuiState } from "@assistant-ui/store";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { useShallow } from "zustand/shallow";
|
|
11
|
+
//#region src/react/primitives/message/MessageParts.tsx
|
|
10
12
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
* Creates a group state manager for a specific part type.
|
|
14
|
+
* Returns functions to start, end, and finalize groups.
|
|
15
|
+
*/
|
|
14
16
|
const createGroupState = (groupType) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
};
|
|
17
|
+
let start = -1;
|
|
18
|
+
return {
|
|
19
|
+
startGroup: (index) => {
|
|
20
|
+
if (start === -1) start = index;
|
|
21
|
+
},
|
|
22
|
+
endGroup: (endIndex, ranges) => {
|
|
23
|
+
if (start !== -1) {
|
|
24
|
+
ranges.push({
|
|
25
|
+
type: groupType,
|
|
26
|
+
startIndex: start,
|
|
27
|
+
endIndex
|
|
28
|
+
});
|
|
29
|
+
start = -1;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
finalize: (endIndex, ranges) => {
|
|
33
|
+
if (start !== -1) ranges.push({
|
|
34
|
+
type: groupType,
|
|
35
|
+
startIndex: start,
|
|
36
|
+
endIndex
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
42
40
|
};
|
|
43
41
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
* Groups consecutive tool-call and reasoning message parts into ranges.
|
|
43
|
+
* Always groups tool calls and reasoning parts, even if there's only one.
|
|
44
|
+
* When useChainOfThought is true, groups tool-call and reasoning parts together.
|
|
45
|
+
*/
|
|
48
46
|
const groupMessageParts = (messageTypes, useChainOfThought) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
47
|
+
const ranges = [];
|
|
48
|
+
if (useChainOfThought) {
|
|
49
|
+
const chainOfThoughtGroup = createGroupState("chainOfThoughtGroup");
|
|
50
|
+
for (let i = 0; i < messageTypes.length; i++) {
|
|
51
|
+
const type = messageTypes[i];
|
|
52
|
+
if (type === "tool-call" || type === "reasoning") chainOfThoughtGroup.startGroup(i);
|
|
53
|
+
else {
|
|
54
|
+
chainOfThoughtGroup.endGroup(i - 1, ranges);
|
|
55
|
+
ranges.push({
|
|
56
|
+
type: "single",
|
|
57
|
+
index: i
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
chainOfThoughtGroup.finalize(messageTypes.length - 1, ranges);
|
|
62
|
+
} else {
|
|
63
|
+
const toolGroup = createGroupState("toolGroup");
|
|
64
|
+
const reasoningGroup = createGroupState("reasoningGroup");
|
|
65
|
+
for (let i = 0; i < messageTypes.length; i++) {
|
|
66
|
+
const type = messageTypes[i];
|
|
67
|
+
if (type === "tool-call") {
|
|
68
|
+
reasoningGroup.endGroup(i - 1, ranges);
|
|
69
|
+
toolGroup.startGroup(i);
|
|
70
|
+
} else if (type === "reasoning") {
|
|
71
|
+
toolGroup.endGroup(i - 1, ranges);
|
|
72
|
+
reasoningGroup.startGroup(i);
|
|
73
|
+
} else {
|
|
74
|
+
toolGroup.endGroup(i - 1, ranges);
|
|
75
|
+
reasoningGroup.endGroup(i - 1, ranges);
|
|
76
|
+
ranges.push({
|
|
77
|
+
type: "single",
|
|
78
|
+
index: i
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
toolGroup.finalize(messageTypes.length - 1, ranges);
|
|
83
|
+
reasoningGroup.finalize(messageTypes.length - 1, ranges);
|
|
84
|
+
}
|
|
85
|
+
return ranges;
|
|
87
86
|
};
|
|
88
87
|
const useMessagePartsGroups = (useChainOfThought) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return groupMessageParts(messageTypes, useChainOfThought);
|
|
95
|
-
}, [messageTypes, useChainOfThought]);
|
|
88
|
+
const messageTypes = useAuiState(useShallow((s) => s.message.parts.map((c) => c.type)));
|
|
89
|
+
return useMemo(() => {
|
|
90
|
+
if (messageTypes.length === 0) return [];
|
|
91
|
+
return groupMessageParts(messageTypes, useChainOfThought);
|
|
92
|
+
}, [messageTypes, useChainOfThought]);
|
|
96
93
|
};
|
|
97
94
|
const ToolUIDisplay = ({ Fallback, ...props }) => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return null;
|
|
106
|
-
return _jsx(Render, { ...props });
|
|
95
|
+
const Render = useAuiState((s) => {
|
|
96
|
+
const Render = s.tools.tools[props.toolName] ?? Fallback;
|
|
97
|
+
if (Array.isArray(Render)) return Render[0] ?? Fallback;
|
|
98
|
+
return Render;
|
|
99
|
+
});
|
|
100
|
+
if (!Render) return null;
|
|
101
|
+
return /* @__PURE__ */ jsx(Render, { ...props });
|
|
107
102
|
};
|
|
108
103
|
const getDataRenderer = (dataRenderers, name, inlineFallback) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return dataRenderers.fallbacks[0] ?? inlineFallback;
|
|
104
|
+
const named = dataRenderers.renderers[name]?.[0];
|
|
105
|
+
if (named) return named;
|
|
106
|
+
return dataRenderers.fallbacks[0] ?? inlineFallback;
|
|
113
107
|
};
|
|
114
108
|
const DataUIDisplay = ({ Fallback, ...props }) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return _jsx(Render, { ...props });
|
|
109
|
+
const Render = useAuiState((s) => getDataRenderer(s.dataRenderers, props.name, Fallback));
|
|
110
|
+
if (!Render) return null;
|
|
111
|
+
return /* @__PURE__ */ jsx(Render, { ...props });
|
|
119
112
|
};
|
|
120
113
|
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
* Platform-agnostic no-op default components.
|
|
115
|
+
* Each platform (web, RN) wraps MessagePrimitiveParts with its own defaults.
|
|
116
|
+
*/
|
|
117
|
+
const defaultComponents = {
|
|
118
|
+
Text: () => null,
|
|
119
|
+
Reasoning: () => null,
|
|
120
|
+
Source: () => null,
|
|
121
|
+
Image: () => null,
|
|
122
|
+
File: () => null,
|
|
123
|
+
Unstable_Audio: () => null,
|
|
124
|
+
ToolGroup: ({ children }) => children,
|
|
125
|
+
ReasoningGroup: ({ children }) => children
|
|
133
126
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
127
|
+
const MessagePartComponent = ({ components: { Text = defaultComponents.Text, Reasoning = defaultComponents.Reasoning, Image = defaultComponents.Image, Source = defaultComponents.Source, File = defaultComponents.File, Unstable_Audio: Audio = defaultComponents.Unstable_Audio, tools = {}, data, generativeUI } = {} }) => {
|
|
128
|
+
const aui = useAui();
|
|
129
|
+
const part = useAuiState((s) => s.part);
|
|
130
|
+
const type = part.type;
|
|
131
|
+
if (type === "tool-call") {
|
|
132
|
+
const addResult = aui.part().addToolResult;
|
|
133
|
+
const resume = aui.part().resumeToolCall;
|
|
134
|
+
const respondToApproval = aui.part().respondToToolApproval;
|
|
135
|
+
if ("Override" in tools) return /* @__PURE__ */ jsx(tools.Override, {
|
|
136
|
+
...part,
|
|
137
|
+
addResult,
|
|
138
|
+
resume,
|
|
139
|
+
respondToApproval
|
|
140
|
+
});
|
|
141
|
+
const Tool = tools.by_name?.[part.toolName] ?? tools.Fallback;
|
|
142
|
+
return /* @__PURE__ */ jsx(ToolUIDisplay, {
|
|
143
|
+
...part,
|
|
144
|
+
Fallback: Tool,
|
|
145
|
+
addResult,
|
|
146
|
+
resume,
|
|
147
|
+
respondToApproval
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (part.status?.type === "requires-action") throw new Error("Encountered unexpected requires-action status");
|
|
151
|
+
switch (type) {
|
|
152
|
+
case "text": return /* @__PURE__ */ jsx(Text, { ...part });
|
|
153
|
+
case "reasoning": return /* @__PURE__ */ jsx(Reasoning, { ...part });
|
|
154
|
+
case "source": return /* @__PURE__ */ jsx(Source, { ...part });
|
|
155
|
+
case "image": return /* @__PURE__ */ jsx(Image, { ...part });
|
|
156
|
+
case "file": return /* @__PURE__ */ jsx(File, { ...part });
|
|
157
|
+
case "audio": return /* @__PURE__ */ jsx(Audio, { ...part });
|
|
158
|
+
case "data": {
|
|
159
|
+
const Data = data?.by_name?.[part.name] ?? data?.Fallback;
|
|
160
|
+
return /* @__PURE__ */ jsx(DataUIDisplay, {
|
|
161
|
+
...part,
|
|
162
|
+
Fallback: Data
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
case "generative-ui":
|
|
166
|
+
if (!generativeUI?.components) {
|
|
167
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV !== "production") console.warn("MessagePrimitive.Parts received a generative-ui part but no `components.generativeUI.components` allowlist was provided. Pass an allowlist or render with <MessagePrimitive.GenerativeUI />.");
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
return /* @__PURE__ */ jsx(GenerativeUIRender, {
|
|
171
|
+
spec: part.spec,
|
|
172
|
+
components: generativeUI.components,
|
|
173
|
+
Fallback: generativeUI.Fallback
|
|
174
|
+
});
|
|
175
|
+
default:
|
|
176
|
+
console.warn(`Unknown message part type: ${type}`);
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
169
179
|
};
|
|
170
180
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
prev.components?.Image === next.components?.Image &&
|
|
180
|
-
prev.components?.File === next.components?.File &&
|
|
181
|
-
prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&
|
|
182
|
-
prev.components?.tools === next.components?.tools &&
|
|
183
|
-
prev.components?.data === next.components?.data &&
|
|
184
|
-
prev.components?.ToolGroup === next.components?.ToolGroup &&
|
|
185
|
-
prev.components?.ReasoningGroup === next.components?.ReasoningGroup);
|
|
181
|
+
* Renders a single message part at the specified index.
|
|
182
|
+
*/
|
|
183
|
+
const MessagePrimitivePartByIndex = memo(({ index, components }) => {
|
|
184
|
+
return /* @__PURE__ */ jsx(PartByIndexProvider, {
|
|
185
|
+
index,
|
|
186
|
+
children: /* @__PURE__ */ jsx(MessagePartComponent, { components })
|
|
187
|
+
});
|
|
188
|
+
}, (prev, next) => prev.index === next.index && prev.components?.Text === next.components?.Text && prev.components?.Reasoning === next.components?.Reasoning && prev.components?.Source === next.components?.Source && prev.components?.Image === next.components?.Image && prev.components?.File === next.components?.File && prev.components?.Unstable_Audio === next.components?.Unstable_Audio && prev.components?.tools === next.components?.tools && prev.components?.data === next.components?.data && prev.components?.generativeUI === next.components?.generativeUI && prev.components?.ToolGroup === next.components?.ToolGroup && prev.components?.ReasoningGroup === next.components?.ReasoningGroup);
|
|
186
189
|
MessagePrimitivePartByIndex.displayName = "MessagePrimitive.PartByIndex";
|
|
187
190
|
const EmptyPartFallback = ({ status, component: Component }) => {
|
|
188
|
-
|
|
191
|
+
return /* @__PURE__ */ jsx(TextMessagePartProvider, {
|
|
192
|
+
text: "",
|
|
193
|
+
isRunning: status.type === "running",
|
|
194
|
+
children: /* @__PURE__ */ jsx(Component, {
|
|
195
|
+
type: "text",
|
|
196
|
+
text: "",
|
|
197
|
+
status
|
|
198
|
+
})
|
|
199
|
+
});
|
|
189
200
|
};
|
|
190
|
-
const COMPLETE_STATUS = Object.freeze({
|
|
191
|
-
|
|
192
|
-
});
|
|
193
|
-
const RUNNING_STATUS = Object.freeze({
|
|
194
|
-
type: "running",
|
|
195
|
-
});
|
|
201
|
+
const COMPLETE_STATUS = Object.freeze({ type: "complete" });
|
|
202
|
+
const RUNNING_STATUS = Object.freeze({ type: "running" });
|
|
196
203
|
const EmptyPartsImpl = ({ components }) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
const status = useAuiState((s) => s.message.status ?? COMPLETE_STATUS);
|
|
205
|
+
if (components?.Empty) return /* @__PURE__ */ jsx(components.Empty, { status });
|
|
206
|
+
if (status.type !== "running") return null;
|
|
207
|
+
return /* @__PURE__ */ jsx(EmptyPartFallback, {
|
|
208
|
+
status,
|
|
209
|
+
component: components?.Text ?? defaultComponents.Text
|
|
210
|
+
});
|
|
203
211
|
};
|
|
204
|
-
const EmptyParts = memo(EmptyPartsImpl, (prev, next) => prev.components?.Empty === next.components?.Empty &&
|
|
205
|
-
prev.components?.Text === next.components?.Text);
|
|
212
|
+
const EmptyParts = memo(EmptyPartsImpl, (prev, next) => prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
|
|
206
213
|
const ConditionalEmptyImpl = ({ components, enabled }) => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
});
|
|
215
|
-
if (!shouldShowEmpty)
|
|
216
|
-
return null;
|
|
217
|
-
return _jsx(EmptyParts, { components: components });
|
|
214
|
+
if (!useAuiState((s) => {
|
|
215
|
+
if (!enabled) return false;
|
|
216
|
+
if (s.message.parts.length === 0) return false;
|
|
217
|
+
const lastPart = s.message.parts[s.message.parts.length - 1];
|
|
218
|
+
return lastPart?.type !== "text" && lastPart?.type !== "reasoning";
|
|
219
|
+
})) return null;
|
|
220
|
+
return /* @__PURE__ */ jsx(EmptyParts, { components });
|
|
218
221
|
};
|
|
219
|
-
const ConditionalEmpty = memo(ConditionalEmptyImpl, (prev, next) => prev.enabled === next.enabled &&
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
222
|
+
const ConditionalEmpty = memo(ConditionalEmptyImpl, (prev, next) => prev.enabled === next.enabled && prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
|
|
223
|
+
const QuoteRendererImpl = ({ Quote }) => {
|
|
224
|
+
const quoteInfo = useAuiState(getMessageQuote);
|
|
225
|
+
if (!quoteInfo) return null;
|
|
226
|
+
return /* @__PURE__ */ jsx(Quote, {
|
|
227
|
+
text: quoteInfo.text,
|
|
228
|
+
messageId: quoteInfo.messageId
|
|
229
|
+
});
|
|
227
230
|
};
|
|
228
231
|
const QuoteRenderer = memo(QuoteRendererImpl);
|
|
229
232
|
function resolveToolRender(toolsState, part) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
return toolsState.mcpApp.render;
|
|
236
|
-
}
|
|
237
|
-
return null;
|
|
233
|
+
const entry = toolsState.tools[part.toolName];
|
|
234
|
+
const named = Array.isArray(entry) ? entry[0] ?? null : entry ?? null;
|
|
235
|
+
if (named) return named;
|
|
236
|
+
if (isMcpAppUri(part.mcp?.app?.resourceUri) && toolsState.mcpApp) return toolsState.mcpApp.render;
|
|
237
|
+
return null;
|
|
238
238
|
}
|
|
239
239
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
* Stable propless component that renders the registered tool UI for the
|
|
241
|
+
* current part context. Reads tool registry and part state from context.
|
|
242
|
+
*/
|
|
243
243
|
const RegisteredToolUI = () => {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
244
|
+
const aui = useAui();
|
|
245
|
+
const part = useAuiState((s) => s.part);
|
|
246
|
+
const Render = useAuiState((s) => s.part.type === "tool-call" ? resolveToolRender(s.tools, s.part) : null);
|
|
247
|
+
if (!Render || part.type !== "tool-call") return null;
|
|
248
|
+
return /* @__PURE__ */ jsx(Render, {
|
|
249
|
+
...part,
|
|
250
|
+
addResult: aui.part().addToolResult,
|
|
251
|
+
resume: aui.part().resumeToolCall,
|
|
252
|
+
respondToApproval: aui.part().respondToToolApproval
|
|
253
|
+
});
|
|
250
254
|
};
|
|
251
255
|
/**
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
* Stable propless component that renders the registered data renderer UI
|
|
257
|
+
* for the current part context.
|
|
258
|
+
*/
|
|
255
259
|
const RegisteredDataRendererUI = () => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
if (!Render || part.type !== "data")
|
|
261
|
-
return null;
|
|
262
|
-
return _jsx(Render, { ...part });
|
|
260
|
+
const part = useAuiState((s) => s.part);
|
|
261
|
+
const Render = useAuiState((s) => s.part.type === "data" ? getDataRenderer(s.dataRenderers, s.part.name, void 0) ?? null : null);
|
|
262
|
+
if (!Render || part.type !== "data") return null;
|
|
263
|
+
return /* @__PURE__ */ jsx(Render, { ...part });
|
|
263
264
|
};
|
|
264
265
|
/**
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
266
|
+
* Fallback component rendered when the children render function returns null.
|
|
267
|
+
* Renders registered tool/data UIs via context.
|
|
268
|
+
* For all other part types, renders nothing.
|
|
269
|
+
*
|
|
270
|
+
* This allows users to write:
|
|
271
|
+
* {({ part }) => {
|
|
272
|
+
* if (part.type === "text") return <MyText />;
|
|
273
|
+
* return null; // tool UIs and data UIs still render via registry
|
|
274
|
+
* }}
|
|
275
|
+
*
|
|
276
|
+
* To explicitly render nothing (suppressing registered UIs), return <></>.
|
|
277
|
+
*/
|
|
277
278
|
const DefaultPartFallback = () => {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return _jsx(RegisteredDataRendererUI, {});
|
|
283
|
-
return null;
|
|
279
|
+
const partType = useAuiState((s) => s.part.type);
|
|
280
|
+
if (partType === "tool-call") return /* @__PURE__ */ jsx(RegisteredToolUI, {});
|
|
281
|
+
if (partType === "data") return /* @__PURE__ */ jsx(RegisteredDataRendererUI, {});
|
|
282
|
+
return null;
|
|
284
283
|
};
|
|
285
284
|
const EMPTY_RUNNING_TEXT_PART = Object.freeze({
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
type: "text",
|
|
286
|
+
text: "",
|
|
287
|
+
status: RUNNING_STATUS
|
|
289
288
|
});
|
|
290
289
|
/**
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
290
|
+
* @internal
|
|
291
|
+
* Renders a single part by index, calling `children` with the
|
|
292
|
+
* {@link EnrichedPartState} (tool/data UI enrichments + addResult/resume
|
|
293
|
+
* for tool calls). Shared between `<MessagePrimitive.Parts>` and
|
|
294
|
+
* `<MessagePrimitive.GroupedParts>`. Returns whatever `children`
|
|
295
|
+
* returns — callers decide how to handle a `null` return.
|
|
296
|
+
*/
|
|
297
|
+
const MessagePartChildren = ({ index, children }) => {
|
|
298
|
+
const aui = useAui();
|
|
299
|
+
const dataRenderers = useAuiState((s) => s.dataRenderers);
|
|
300
|
+
return /* @__PURE__ */ jsx(PartByIndexProvider, {
|
|
301
|
+
index,
|
|
302
|
+
children: /* @__PURE__ */ jsx(RenderChildrenWithAccessor, {
|
|
303
|
+
getItemState: (aui) => aui.message().part({ index }).getState(),
|
|
304
|
+
children: (getItem) => children({ get part() {
|
|
305
|
+
const state = getItem();
|
|
306
|
+
if (state.type === "tool-call") {
|
|
307
|
+
const hasUI = resolveToolRender(aui.tools().getState(), state) !== null;
|
|
308
|
+
const partMethods = aui.message().part({ index });
|
|
309
|
+
return {
|
|
310
|
+
...state,
|
|
311
|
+
toolUI: hasUI ? /* @__PURE__ */ jsx(RegisteredToolUI, {}) : null,
|
|
312
|
+
addResult: partMethods.addToolResult,
|
|
313
|
+
resume: partMethods.resumeToolCall,
|
|
314
|
+
respondToApproval: partMethods.respondToToolApproval
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
if (state.type === "data") {
|
|
318
|
+
const hasUI = getDataRenderer(dataRenderers, state.name, void 0) !== void 0;
|
|
319
|
+
return {
|
|
320
|
+
...state,
|
|
321
|
+
dataRendererUI: hasUI ? /* @__PURE__ */ jsx(RegisteredDataRendererUI, {}) : null
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return state;
|
|
325
|
+
} })
|
|
326
|
+
})
|
|
327
|
+
});
|
|
328
328
|
};
|
|
329
329
|
const MessagePrimitivePartsInner = ({ children }) => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
330
|
+
const contentLength = useAuiState((s) => s.message.parts.length);
|
|
331
|
+
const isRunning = useAuiState((s) => (s.message.status?.type ?? "complete") === "running");
|
|
332
|
+
const isEmptyRunning = contentLength === 0 && isRunning;
|
|
333
|
+
if (contentLength === 0) {
|
|
334
|
+
if (!isEmptyRunning) return null;
|
|
335
|
+
return /* @__PURE__ */ jsx(TextMessagePartProvider, {
|
|
336
|
+
text: "",
|
|
337
|
+
isRunning: true,
|
|
338
|
+
children: children({ part: EMPTY_RUNNING_TEXT_PART })
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: Array.from({ length: contentLength }, (_, index) => /* @__PURE__ */ jsx(MessagePartChildren, {
|
|
342
|
+
index,
|
|
343
|
+
children: (value) => children(value) ?? /* @__PURE__ */ jsx(DefaultPartFallback, {})
|
|
344
|
+
}, index)) });
|
|
339
345
|
};
|
|
340
346
|
/**
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
* Renders the parts of a message with support for multiple content types.
|
|
348
|
+
*
|
|
349
|
+
* This is the platform-agnostic base. Each platform wraps this with its own
|
|
350
|
+
* default components (web uses `<p>`, `<span>`; RN would use `<Text>`, etc.).
|
|
351
|
+
*/
|
|
352
|
+
const MessagePrimitiveParts = ({ components, unstable_showEmptyOnNonTextEnd = true, children }) => {
|
|
353
|
+
if (children) return /* @__PURE__ */ jsx(MessagePrimitivePartsInner, { children });
|
|
354
|
+
return /* @__PURE__ */ jsx(MessagePrimitivePartsCompat, {
|
|
355
|
+
components,
|
|
356
|
+
unstable_showEmptyOnNonTextEnd
|
|
357
|
+
});
|
|
351
358
|
};
|
|
352
359
|
MessagePrimitiveParts.displayName = "MessagePrimitive.Parts";
|
|
353
360
|
const MessagePrimitivePartsCompat = ({ components, unstable_showEmptyOnNonTextEnd }) => {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
361
|
+
const contentLength = useAuiState((s) => s.message.parts.length);
|
|
362
|
+
const messageRanges = useMessagePartsGroups(!!components?.ChainOfThought);
|
|
363
|
+
const partsElements = useMemo(() => {
|
|
364
|
+
if (contentLength === 0) return /* @__PURE__ */ jsx(EmptyParts, { components });
|
|
365
|
+
return messageRanges.map((range) => {
|
|
366
|
+
if (range.type === "single") return /* @__PURE__ */ jsx(MessagePrimitivePartByIndex, {
|
|
367
|
+
index: range.index,
|
|
368
|
+
components
|
|
369
|
+
}, range.index);
|
|
370
|
+
else if (range.type === "chainOfThoughtGroup") {
|
|
371
|
+
const ChainOfThoughtComponent = components?.ChainOfThought;
|
|
372
|
+
if (!ChainOfThoughtComponent) return null;
|
|
373
|
+
return /* @__PURE__ */ jsx(ChainOfThoughtByIndicesProvider, {
|
|
374
|
+
startIndex: range.startIndex,
|
|
375
|
+
endIndex: range.endIndex,
|
|
376
|
+
children: /* @__PURE__ */ jsx(ChainOfThoughtComponent, {})
|
|
377
|
+
}, `chainOfThought-${range.startIndex}`);
|
|
378
|
+
} else if (range.type === "toolGroup") return /* @__PURE__ */ jsx(components?.ToolGroup ?? defaultComponents.ToolGroup, {
|
|
379
|
+
startIndex: range.startIndex,
|
|
380
|
+
endIndex: range.endIndex,
|
|
381
|
+
children: Array.from({ length: range.endIndex - range.startIndex + 1 }, (_, i) => {
|
|
382
|
+
const partIndex = range.startIndex + i;
|
|
383
|
+
return /* @__PURE__ */ jsx(MessagePrimitivePartByIndex, {
|
|
384
|
+
index: partIndex,
|
|
385
|
+
components
|
|
386
|
+
}, `part-${partIndex}`);
|
|
387
|
+
})
|
|
388
|
+
}, `tool-${range.startIndex}`);
|
|
389
|
+
else return /* @__PURE__ */ jsx(components?.ReasoningGroup ?? defaultComponents.ReasoningGroup, {
|
|
390
|
+
startIndex: range.startIndex,
|
|
391
|
+
endIndex: range.endIndex,
|
|
392
|
+
children: Array.from({ length: range.endIndex - range.startIndex + 1 }, (_, i) => {
|
|
393
|
+
const partIndex = range.startIndex + i;
|
|
394
|
+
return /* @__PURE__ */ jsx(MessagePrimitivePartByIndex, {
|
|
395
|
+
index: partIndex,
|
|
396
|
+
components
|
|
397
|
+
}, `part-${partIndex}`);
|
|
398
|
+
})
|
|
399
|
+
}, `reasoning-${range.startIndex}`);
|
|
400
|
+
});
|
|
401
|
+
}, [
|
|
402
|
+
messageRanges,
|
|
403
|
+
components,
|
|
404
|
+
contentLength
|
|
405
|
+
]);
|
|
406
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
407
|
+
components?.Quote && /* @__PURE__ */ jsx(QuoteRenderer, { Quote: components.Quote }),
|
|
408
|
+
partsElements,
|
|
409
|
+
/* @__PURE__ */ jsx(ConditionalEmpty, {
|
|
410
|
+
components,
|
|
411
|
+
enabled: unstable_showEmptyOnNonTextEnd
|
|
412
|
+
})
|
|
413
|
+
] });
|
|
389
414
|
};
|
|
415
|
+
//#endregion
|
|
416
|
+
export { MessagePartChildren, MessagePartComponent, MessagePrimitivePartByIndex, MessagePrimitiveParts, defaultComponents };
|
|
417
|
+
|
|
390
418
|
//# sourceMappingURL=MessageParts.js.map
|