@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,28 +1,32 @@
|
|
|
1
1
|
import { useCallback, useSyncExternalStore } from "react";
|
|
2
2
|
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
//#region src/react/primitive-hooks/useVoice.ts
|
|
4
|
+
const useVoiceState = () => {
|
|
5
|
+
return useAuiState((s) => s.thread.voice);
|
|
5
6
|
};
|
|
6
7
|
const getServerVolume = () => 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return useSyncExternalStore(thread.subscribeVoiceVolume, thread.getVoiceVolume, getServerVolume);
|
|
8
|
+
const useVoiceVolume = () => {
|
|
9
|
+
const thread = useAui().thread();
|
|
10
|
+
return useSyncExternalStore(thread.subscribeVoiceVolume, thread.getVoiceVolume, getServerVolume);
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const useVoiceControls = () => {
|
|
13
|
+
const aui = useAui();
|
|
14
|
+
return {
|
|
15
|
+
connect: useCallback(() => {
|
|
16
|
+
aui.thread().connectVoice();
|
|
17
|
+
}, [aui]),
|
|
18
|
+
disconnect: useCallback(() => {
|
|
19
|
+
aui.thread().disconnectVoice();
|
|
20
|
+
}, [aui]),
|
|
21
|
+
mute: useCallback(() => {
|
|
22
|
+
aui.thread().muteVoice();
|
|
23
|
+
}, [aui]),
|
|
24
|
+
unmute: useCallback(() => {
|
|
25
|
+
aui.thread().unmuteVoice();
|
|
26
|
+
}, [aui])
|
|
27
|
+
};
|
|
27
28
|
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { useVoiceControls, useVoiceState, useVoiceVolume };
|
|
31
|
+
|
|
28
32
|
//# sourceMappingURL=useVoice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVoice.js","
|
|
1
|
+
{"version":3,"file":"useVoice.js","names":[],"sources":["../../../src/react/primitive-hooks/useVoice.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type { VoiceSessionState } from \"../../runtime/interfaces/thread-runtime-core\";\n\nexport const useVoiceState = (): VoiceSessionState | undefined => {\n return useAuiState((s) => s.thread.voice);\n};\n\nconst getServerVolume = () => 0;\n\nexport const useVoiceVolume = (): number => {\n const aui = useAui();\n const thread = aui.thread();\n return useSyncExternalStore(\n thread.subscribeVoiceVolume,\n thread.getVoiceVolume,\n getServerVolume,\n );\n};\n\nexport const useVoiceControls = () => {\n const aui = useAui();\n\n const connect = useCallback(() => {\n aui.thread().connectVoice();\n }, [aui]);\n\n const disconnect = useCallback(() => {\n aui.thread().disconnectVoice();\n }, [aui]);\n\n const mute = useCallback(() => {\n aui.thread().muteVoice();\n }, [aui]);\n\n const unmute = useCallback(() => {\n aui.thread().unmuteVoice();\n }, [aui]);\n\n return { connect, disconnect, mute, unmute };\n};\n"],"mappings":";;;AAIA,MAAa,sBAAqD;CAChE,OAAO,aAAa,MAAM,EAAE,OAAO,KAAK;AAC1C;AAEA,MAAM,wBAAwB;AAE9B,MAAa,uBAA+B;CAE1C,MAAM,SADM,OACK,EAAE,OAAO;CAC1B,OAAO,qBACL,OAAO,sBACP,OAAO,gBACP,eACF;AACF;AAEA,MAAa,yBAAyB;CACpC,MAAM,MAAM,OAAO;CAkBnB,OAAO;EAAE,SAhBO,kBAAkB;GAChC,IAAI,OAAO,EAAE,aAAa;EAC5B,GAAG,CAAC,GAAG,CAcQ;EAAG,YAZC,kBAAkB;GACnC,IAAI,OAAO,EAAE,gBAAgB;EAC/B,GAAG,CAAC,GAAG,CAUoB;EAAG,MARjB,kBAAkB;GAC7B,IAAI,OAAO,EAAE,UAAU;EACzB,GAAG,CAAC,GAAG,CAM0B;EAAG,QAJrB,kBAAkB;GAC/B,IAAI,OAAO,EAAE,YAAY;EAC3B,GAAG,CAAC,GAAG,CAEkC;CAAE;AAC7C"}
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ReasoningMessagePartComponent, ToolCallMessagePartComponent } from "../../types/MessagePartComponentTypes.js";
|
|
2
|
+
import { PartState } from "../../../store/scopes/part.js";
|
|
3
|
+
import { ComponentType, FC, PropsWithChildren, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts
|
|
4
6
|
type ChainOfThoughtPartsComponentConfig = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
/** Layout component to wrap the rendered parts when expanded */
|
|
12
|
-
Layout?: ComponentType<PropsWithChildren> | undefined;
|
|
7
|
+
/** Component for rendering reasoning parts */Reasoning?: ReasoningMessagePartComponent | undefined; /** Fallback component for tool-call parts */
|
|
8
|
+
tools?: {
|
|
9
|
+
Fallback?: ToolCallMessagePartComponent | undefined;
|
|
10
|
+
}; /** Layout component to wrap the rendered parts when expanded */
|
|
11
|
+
Layout?: ComponentType<PropsWithChildren> | undefined;
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
13
|
+
declare namespace ChainOfThoughtPrimitiveParts {
|
|
14
|
+
type Props = {
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use the children render function instead.
|
|
17
|
+
*/
|
|
18
|
+
components?: ChainOfThoughtPartsComponentConfig;
|
|
19
|
+
children?: never;
|
|
20
|
+
} | {
|
|
21
|
+
/** Render function called for each part. Receives the part. */children: (value: {
|
|
22
|
+
part: PartState;
|
|
23
|
+
}) => ReactNode;
|
|
24
|
+
components?: never;
|
|
25
|
+
};
|
|
28
26
|
}
|
|
29
27
|
/**
|
|
30
28
|
* Renders the parts within a chain of thought, with support for collapsed/expanded states.
|
|
@@ -32,6 +30,7 @@ export declare namespace ChainOfThoughtPrimitiveParts {
|
|
|
32
30
|
* When collapsed, no parts are shown. When expanded, all parts are rendered
|
|
33
31
|
* using the provided component configuration through the part scope mechanism.
|
|
34
32
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
declare const ChainOfThoughtPrimitiveParts: FC<ChainOfThoughtPrimitiveParts.Props>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ChainOfThoughtPrimitiveParts };
|
|
37
36
|
//# sourceMappingURL=ChainOfThoughtParts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainOfThoughtParts.d.ts","
|
|
1
|
+
{"version":3,"file":"ChainOfThoughtParts.d.ts","names":[],"sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"mappings":";;;;;KAgBK,kCAAA;gDAEH,SAAA,GAAY,6BAAA,cAFyB;EAIrC,KAAA;IACE,QAAA,GAAW,4BAAA;EAAA,GAGU;EAAvB,MAAA,GAAS,aAAA,CAAc,iBAAA;AAAA;AAAA,kBAGR,4BAAA;EAAA,KACH,KAAA;IAVA;;;IAeN,UAAA,GAAa,kCAAA;IACb,QAAA;EAAA;IAViB,+DAcjB,QAAA,GAAW,KAAA;MAAS,IAAA,EAAM,SAAA;IAAA,MAAgB,SAAA;IAC1C,UAAA;EAAA;AAAA;;;;;;;cAsCK,4BAAA,EAA8B,EAAE,CAC3C,4BAAA,CAA6B,KAAA"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, } from "react";
|
|
3
|
-
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
4
1
|
import { ChainOfThoughtPartByIndexProvider } from "../../providers/ChainOfThoughtPartByIndexProvider.js";
|
|
5
2
|
import { MessagePartComponent } from "../message/MessageParts.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx
|
|
6
7
|
const ChainOfThoughtPrimitivePartsInner = ({ children }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const partsLength = useAuiState((s) => s.chainOfThought.parts.length);
|
|
9
|
+
return useMemo(() => Array.from({ length: partsLength }, (_, index) => /* @__PURE__ */ jsx(ChainOfThoughtPartByIndexProvider, {
|
|
10
|
+
index,
|
|
11
|
+
children: /* @__PURE__ */ jsx(RenderChildrenWithAccessor, {
|
|
12
|
+
getItemState: (aui) => aui.chainOfThought().part({ index }).getState(),
|
|
13
|
+
children: (getItem) => children({ get part() {
|
|
14
|
+
return getItem();
|
|
15
|
+
} })
|
|
16
|
+
})
|
|
17
|
+
}, index)), [partsLength, children]);
|
|
13
18
|
};
|
|
14
19
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tools: {
|
|
29
|
-
Fallback: components?.tools?.Fallback,
|
|
30
|
-
},
|
|
31
|
-
}), [components?.Reasoning, components?.tools?.Fallback]);
|
|
32
|
-
const Layout = components?.Layout;
|
|
33
|
-
return (_jsx(ChainOfThoughtPrimitivePartsInner, { children: () => Layout ? (_jsx(Layout, { children: _jsx(MessagePartComponent, { components: messageComponents }) })) : (_jsx(MessagePartComponent, { components: messageComponents })) }));
|
|
20
|
+
* Renders the parts within a chain of thought, with support for collapsed/expanded states.
|
|
21
|
+
*
|
|
22
|
+
* When collapsed, no parts are shown. When expanded, all parts are rendered
|
|
23
|
+
* using the provided component configuration through the part scope mechanism.
|
|
24
|
+
*/
|
|
25
|
+
const ChainOfThoughtPrimitiveParts = ({ components, children }) => {
|
|
26
|
+
if (children) return /* @__PURE__ */ jsx(ChainOfThoughtPrimitivePartsInner, { children });
|
|
27
|
+
const messageComponents = useMemo(() => ({
|
|
28
|
+
Reasoning: components?.Reasoning,
|
|
29
|
+
tools: { Fallback: components?.tools?.Fallback }
|
|
30
|
+
}), [components?.Reasoning, components?.tools?.Fallback]);
|
|
31
|
+
const Layout = components?.Layout;
|
|
32
|
+
return /* @__PURE__ */ jsx(ChainOfThoughtPrimitivePartsInner, { children: () => Layout ? /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx(MessagePartComponent, { components: messageComponents }) }) : /* @__PURE__ */ jsx(MessagePartComponent, { components: messageComponents }) });
|
|
34
33
|
};
|
|
35
34
|
ChainOfThoughtPrimitiveParts.displayName = "ChainOfThoughtPrimitive.Parts";
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ChainOfThoughtPrimitiveParts };
|
|
37
|
+
|
|
36
38
|
//# sourceMappingURL=ChainOfThoughtParts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainOfThoughtParts.js","
|
|
1
|
+
{"version":3,"file":"ChainOfThoughtParts.js","names":[],"sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"sourcesContent":["import {\n type ComponentType,\n type FC,\n type PropsWithChildren,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport type { PartState } from \"../../../store/scopes/part\";\nimport { ChainOfThoughtPartByIndexProvider } from \"../../providers/ChainOfThoughtPartByIndexProvider\";\nimport { MessagePartComponent } from \"../message/MessageParts\";\nimport type {\n ReasoningMessagePartComponent,\n ToolCallMessagePartComponent,\n} from \"../../types/MessagePartComponentTypes\";\n\ntype ChainOfThoughtPartsComponentConfig = {\n /** Component for rendering reasoning parts */\n Reasoning?: ReasoningMessagePartComponent | undefined;\n /** Fallback component for tool-call parts */\n tools?: {\n Fallback?: ToolCallMessagePartComponent | undefined;\n };\n /** Layout component to wrap the rendered parts when expanded */\n Layout?: ComponentType<PropsWithChildren> | undefined;\n};\n\nexport namespace ChainOfThoughtPrimitiveParts {\n export type Props =\n | {\n /**\n * @deprecated Use the children render function instead.\n */\n components?: ChainOfThoughtPartsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each part. Receives the part. */\n children: (value: { part: PartState }) => ReactNode;\n components?: never;\n };\n}\n\nconst ChainOfThoughtPrimitivePartsInner: FC<{\n children: (value: { part: PartState }) => ReactNode;\n}> = ({ children }) => {\n const partsLength = useAuiState((s) => s.chainOfThought.parts.length);\n\n return useMemo(\n () =>\n Array.from({ length: partsLength }, (_, index) => (\n <ChainOfThoughtPartByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.chainOfThought().part({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get part() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </ChainOfThoughtPartByIndexProvider>\n )),\n [partsLength, children],\n );\n};\n\n/**\n * Renders the parts within a chain of thought, with support for collapsed/expanded states.\n *\n * When collapsed, no parts are shown. When expanded, all parts are rendered\n * using the provided component configuration through the part scope mechanism.\n */\nexport const ChainOfThoughtPrimitiveParts: FC<\n ChainOfThoughtPrimitiveParts.Props\n> = ({ components, children }) => {\n if (children) {\n return (\n <ChainOfThoughtPrimitivePartsInner>\n {children}\n </ChainOfThoughtPrimitivePartsInner>\n );\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n // biome-ignore lint/correctness/useHookAtTopLevel: intentional conditional/nested hook usage\n const messageComponents = useMemo(\n () => ({\n Reasoning: components?.Reasoning,\n tools: {\n Fallback: components?.tools?.Fallback,\n },\n }),\n [components?.Reasoning, components?.tools?.Fallback],\n );\n\n const Layout = components?.Layout;\n\n return (\n <ChainOfThoughtPrimitivePartsInner>\n {() =>\n Layout ? (\n <Layout>\n <MessagePartComponent components={messageComponents} />\n </Layout>\n ) : (\n <MessagePartComponent components={messageComponents} />\n )\n }\n </ChainOfThoughtPrimitivePartsInner>\n );\n};\n\nChainOfThoughtPrimitiveParts.displayName = \"ChainOfThoughtPrimitive.Parts\";\n"],"mappings":";;;;;;AA2CA,MAAM,qCAEA,EAAE,eAAe;CACrB,MAAM,cAAc,aAAa,MAAM,EAAE,eAAe,MAAM,MAAM;CAEpE,OAAO,cAEH,MAAM,KAAK,EAAE,QAAQ,YAAY,IAAI,GAAG,UACtC,oBAAC,mCAAD;EAAsD;YACpD,oBAAC,4BAAD;GACE,eAAe,QACb,IAAI,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,SAAS;cAG9C,YACA,SAAS,EACP,IAAI,OAAO;IACT,OAAO,QAAQ;GACjB,EACF,CAAC;EAEuB,CAAA;CACK,GAdK,KAcL,CACpC,GACH,CAAC,aAAa,QAAQ,CACxB;AACF;;;;;;;AAQA,MAAa,gCAER,EAAE,YAAY,eAAe;CAChC,IAAI,UACF,OACE,oBAAC,mCAAD,EACG,SACgC,CAAA;CAMvC,MAAM,oBAAoB,eACjB;EACL,WAAW,YAAY;EACvB,OAAO,EACL,UAAU,YAAY,OAAO,SAC/B;CACF,IACA,CAAC,YAAY,WAAW,YAAY,OAAO,QAAQ,CACrD;CAEA,MAAM,SAAS,YAAY;CAE3B,OACE,oBAAC,mCAAD,EAAA,gBAEI,SACE,oBAAC,QAAD,EAAA,UACE,oBAAC,sBAAD,EAAsB,YAAY,kBAAoB,CAAA,EAChD,CAAA,IAER,oBAAC,sBAAD,EAAsB,YAAY,kBAAoB,CAAA,EAGzB,CAAA;AAEvC;AAEA,6BAA6B,cAAc"}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Attachment } from "../../../types/attachment.js";
|
|
2
|
+
import { ComponentType, FC, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/react/primitives/composer/ComposerAttachments.d.ts
|
|
3
5
|
type ComposerAttachmentsComponentConfig = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Image?: ComponentType | undefined;
|
|
7
|
+
Document?: ComponentType | undefined;
|
|
8
|
+
File?: ComponentType | undefined;
|
|
9
|
+
Attachment?: ComponentType | undefined;
|
|
8
10
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
components?: never;
|
|
20
|
-
};
|
|
11
|
+
declare namespace ComposerPrimitiveAttachments {
|
|
12
|
+
type Props = {
|
|
13
|
+
/** @deprecated Use the children render function instead. */components: ComposerAttachmentsComponentConfig;
|
|
14
|
+
children?: never;
|
|
15
|
+
} | {
|
|
16
|
+
/** Render function called for each attachment. Receives the attachment. */children: (value: {
|
|
17
|
+
attachment: Attachment;
|
|
18
|
+
}) => ReactNode;
|
|
19
|
+
components?: never;
|
|
20
|
+
};
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
declare namespace ComposerPrimitiveAttachmentByIndex {
|
|
23
|
+
type Props = {
|
|
24
|
+
index: number;
|
|
25
|
+
components?: ComposerAttachmentsComponentConfig;
|
|
26
|
+
};
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Renders a single attachment at the specified index within the composer.
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
declare const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props>;
|
|
32
|
+
declare const ComposerPrimitiveAttachments: FC<ComposerPrimitiveAttachments.Props>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments };
|
|
34
35
|
//# sourceMappingURL=ComposerAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerAttachments.d.ts","
|
|
1
|
+
{"version":3,"file":"ComposerAttachments.d.ts","names":[],"sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"mappings":";;;;KAWK,kCAAA;EACH,KAAA,GAAQ,aAAA;EACR,QAAA,GAAW,aAAA;EACX,IAAA,GAAO,aAAA;EACP,UAAA,GAAa,aAAA;AAAA;AAAA,kBAGE,4BAAA;EAAA,KACH,KAAA;IAJC,4DAOP,UAAA,EAAY,kCAAA;IACZ,QAAA;EAAA;IAXE,2EAeF,QAAA,GAAW,KAAA;MAAS,UAAA,EAAY,UAAA;IAAA,MAAiB,SAAA;IACjD,UAAA;EAAA;AAAA;AAAA,kBAgCS,kCAAA;EAAA,KACH,KAAA;IACV,KAAA;IACA,UAAA,GAAa,kCAAkC;EAAA;AAAA;;;;cAOtC,kCAAA,EAAoC,EAAE,CAAC,kCAAA,CAAmC,KAAA;AAAA,cAgD1E,4BAAA,EAA8B,EAAE,CAC3C,4BAAA,CAA6B,KAAA"}
|
|
@@ -1,59 +1,55 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useMemo, } from "react";
|
|
3
|
-
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
4
1
|
import { ComposerAttachmentByIndexProvider } from "../../providers/AttachmentByIndexProvider.js";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/react/primitives/composer/ComposerAttachments.tsx
|
|
5
6
|
const getComponent = (components, attachment) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
case "file":
|
|
13
|
-
return components?.File ?? components?.Attachment;
|
|
14
|
-
default:
|
|
15
|
-
return components?.Attachment;
|
|
16
|
-
}
|
|
7
|
+
switch (attachment.type) {
|
|
8
|
+
case "image": return components?.Image ?? components?.Attachment;
|
|
9
|
+
case "document": return components?.Document ?? components?.Attachment;
|
|
10
|
+
case "file": return components?.File ?? components?.Attachment;
|
|
11
|
+
default: return components?.Attachment;
|
|
12
|
+
}
|
|
17
13
|
};
|
|
18
14
|
const AttachmentComponent = ({ components }) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return null;
|
|
25
|
-
return _jsx(Component, {});
|
|
15
|
+
const attachment = useAuiState((s) => s.attachment);
|
|
16
|
+
if (!attachment) return null;
|
|
17
|
+
const Component = getComponent(components, attachment);
|
|
18
|
+
if (!Component) return null;
|
|
19
|
+
return /* @__PURE__ */ jsx(Component, {});
|
|
26
20
|
};
|
|
27
21
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ComposerPrimitiveAttachmentByIndex.displayName =
|
|
38
|
-
"ComposerPrimitive.AttachmentByIndex";
|
|
22
|
+
* Renders a single attachment at the specified index within the composer.
|
|
23
|
+
*/
|
|
24
|
+
const ComposerPrimitiveAttachmentByIndex = memo(({ index, components }) => {
|
|
25
|
+
return /* @__PURE__ */ jsx(ComposerAttachmentByIndexProvider, {
|
|
26
|
+
index,
|
|
27
|
+
children: /* @__PURE__ */ jsx(AttachmentComponent, { components })
|
|
28
|
+
});
|
|
29
|
+
}, (prev, next) => prev.index === next.index && prev.components?.Image === next.components?.Image && prev.components?.Document === next.components?.Document && prev.components?.File === next.components?.File && prev.components?.Attachment === next.components?.Attachment);
|
|
30
|
+
ComposerPrimitiveAttachmentByIndex.displayName = "ComposerPrimitive.AttachmentByIndex";
|
|
39
31
|
const ComposerPrimitiveAttachmentsInner = ({ children }) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
const attachmentsCount = useAuiState((s) => s.composer.attachments.length);
|
|
33
|
+
return useMemo(() => Array.from({ length: attachmentsCount }, (_, index) => /* @__PURE__ */ jsx(ComposerAttachmentByIndexProvider, {
|
|
34
|
+
index,
|
|
35
|
+
children: /* @__PURE__ */ jsx(RenderChildrenWithAccessor, {
|
|
36
|
+
getItemState: (aui) => aui.composer().attachment({ index }).getState(),
|
|
37
|
+
children: (getItem) => children({ get attachment() {
|
|
38
|
+
return getItem();
|
|
39
|
+
} })
|
|
40
|
+
})
|
|
41
|
+
}, index)), [attachmentsCount, children]);
|
|
46
42
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} }));
|
|
55
|
-
}
|
|
56
|
-
return (_jsx(ComposerPrimitiveAttachmentsInner, { children: children }));
|
|
43
|
+
const ComposerPrimitiveAttachments = ({ components, children }) => {
|
|
44
|
+
if (components) return /* @__PURE__ */ jsx(ComposerPrimitiveAttachmentsInner, { children: ({ attachment }) => {
|
|
45
|
+
const Component = getComponent(components, attachment);
|
|
46
|
+
if (!Component) return null;
|
|
47
|
+
return /* @__PURE__ */ jsx(Component, {});
|
|
48
|
+
} });
|
|
49
|
+
return /* @__PURE__ */ jsx(ComposerPrimitiveAttachmentsInner, { children });
|
|
57
50
|
};
|
|
58
51
|
ComposerPrimitiveAttachments.displayName = "ComposerPrimitive.Attachments";
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments };
|
|
54
|
+
|
|
59
55
|
//# sourceMappingURL=ComposerAttachments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerAttachments.js","
|
|
1
|
+
{"version":3,"file":"ComposerAttachments.js","names":[],"sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"sourcesContent":["import type { Attachment } from \"../../../types/attachment\";\nimport {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport { ComposerAttachmentByIndexProvider } from \"../../providers/AttachmentByIndexProvider\";\n\ntype ComposerAttachmentsComponentConfig = {\n Image?: ComponentType | undefined;\n Document?: ComponentType | undefined;\n File?: ComponentType | undefined;\n Attachment?: ComponentType | undefined;\n};\n\nexport namespace ComposerPrimitiveAttachments {\n export type Props =\n | {\n /** @deprecated Use the children render function instead. */\n components: ComposerAttachmentsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each attachment. Receives the attachment. */\n children: (value: { attachment: Attachment }) => ReactNode;\n components?: never;\n };\n}\n\nconst getComponent = (\n components: ComposerAttachmentsComponentConfig | undefined,\n attachment: Attachment,\n) => {\n const type = attachment.type;\n switch (type) {\n case \"image\":\n return components?.Image ?? components?.Attachment;\n case \"document\":\n return components?.Document ?? components?.Attachment;\n case \"file\":\n return components?.File ?? components?.Attachment;\n default:\n return components?.Attachment;\n }\n};\n\nconst AttachmentComponent: FC<{\n components: ComposerAttachmentsComponentConfig | undefined;\n}> = ({ components }) => {\n const attachment = useAuiState((s) => s.attachment);\n if (!attachment) return null;\n\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n};\n\nexport namespace ComposerPrimitiveAttachmentByIndex {\n export type Props = {\n index: number;\n components?: ComposerAttachmentsComponentConfig;\n };\n}\n\n/**\n * Renders a single attachment at the specified index within the composer.\n */\nexport const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <ComposerAttachmentByIndexProvider index={index}>\n <AttachmentComponent components={components} />\n </ComposerAttachmentByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Document === next.components?.Document &&\n prev.components?.File === next.components?.File &&\n prev.components?.Attachment === next.components?.Attachment,\n );\n\nComposerPrimitiveAttachmentByIndex.displayName =\n \"ComposerPrimitive.AttachmentByIndex\";\n\nconst ComposerPrimitiveAttachmentsInner: FC<{\n children: (value: { attachment: Attachment }) => ReactNode;\n}> = ({ children }) => {\n const attachmentsCount = useAuiState((s) => s.composer.attachments.length);\n\n return useMemo(\n () =>\n Array.from({ length: attachmentsCount }, (_, index) => (\n <ComposerAttachmentByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.composer().attachment({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get attachment() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </ComposerAttachmentByIndexProvider>\n )),\n [attachmentsCount, children],\n );\n};\n\nexport const ComposerPrimitiveAttachments: FC<\n ComposerPrimitiveAttachments.Props\n> = ({ components, children }) => {\n if (components) {\n return (\n <ComposerPrimitiveAttachmentsInner>\n {({ attachment }) => {\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n }}\n </ComposerPrimitiveAttachmentsInner>\n );\n }\n return (\n <ComposerPrimitiveAttachmentsInner>\n {children}\n </ComposerPrimitiveAttachmentsInner>\n );\n};\n\nComposerPrimitiveAttachments.displayName = \"ComposerPrimitive.Attachments\";\n"],"mappings":";;;;;AAgCA,MAAM,gBACJ,YACA,eACG;CAEH,QADa,WAAW,MACxB;EACE,KAAK,SACH,OAAO,YAAY,SAAS,YAAY;EAC1C,KAAK,YACH,OAAO,YAAY,YAAY,YAAY;EAC7C,KAAK,QACH,OAAO,YAAY,QAAQ,YAAY;EACzC,SACE,OAAO,YAAY;CACvB;AACF;AAEA,MAAM,uBAEA,EAAE,iBAAiB;CACvB,MAAM,aAAa,aAAa,MAAM,EAAE,UAAU;CAClD,IAAI,CAAC,YAAY,OAAO;CAExB,MAAM,YAAY,aAAa,YAAY,UAAU;CACrD,IAAI,CAAC,WAAW,OAAO;CACvB,OAAO,oBAAC,WAAD,CAAY,CAAA;AACrB;;;;AAYA,MAAa,qCACX,MACG,EAAE,OAAO,iBAAiB;CACzB,OACE,oBAAC,mCAAD;EAA0C;YACxC,oBAAC,qBAAD,EAAiC,WAAa,CAAA;CACb,CAAA;AAEvC,IACC,MAAM,SACL,KAAK,UAAU,KAAK,SACpB,KAAK,YAAY,UAAU,KAAK,YAAY,SAC5C,KAAK,YAAY,aAAa,KAAK,YAAY,YAC/C,KAAK,YAAY,SAAS,KAAK,YAAY,QAC3C,KAAK,YAAY,eAAe,KAAK,YAAY,UACrD;AAEF,mCAAmC,cACjC;AAEF,MAAM,qCAEA,EAAE,eAAe;CACrB,MAAM,mBAAmB,aAAa,MAAM,EAAE,SAAS,YAAY,MAAM;CAEzE,OAAO,cAEH,MAAM,KAAK,EAAE,QAAQ,iBAAiB,IAAI,GAAG,UAC3C,oBAAC,mCAAD;EAAsD;YACpD,oBAAC,4BAAD;GACE,eAAe,QACb,IAAI,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,SAAS;cAG9C,YACA,SAAS,EACP,IAAI,aAAa;IACf,OAAO,QAAQ;GACjB,EACF,CAAC;EAEuB,CAAA;CACK,GAdK,KAcL,CACpC,GACH,CAAC,kBAAkB,QAAQ,CAC7B;AACF;AAEA,MAAa,gCAER,EAAE,YAAY,eAAe;CAChC,IAAI,YACF,OACE,oBAAC,mCAAD,EAAA,WACI,EAAE,iBAAiB;EACnB,MAAM,YAAY,aAAa,YAAY,UAAU;EACrD,IAAI,CAAC,WAAW,OAAO;EACvB,OAAO,oBAAC,WAAD,CAAY,CAAA;CACrB,EACiC,CAAA;CAGvC,OACE,oBAAC,mCAAD,EACG,SACgC,CAAA;AAEvC;AAEA,6BAA6B,cAAc"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/react/primitives/composer/ComposerIf.d.ts
|
|
2
4
|
type ComposerIfFilters = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** Whether dictation is currently active */
|
|
6
|
-
dictation: boolean | undefined;
|
|
5
|
+
/** Whether the composer is in editing mode */editing: boolean | undefined; /** Whether dictation is currently active */
|
|
6
|
+
dictation: boolean | undefined;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare namespace ComposerPrimitiveIf {
|
|
13
|
-
type Props = PropsWithChildren<UseComposerIfProps>;
|
|
8
|
+
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & { [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>> }[Keys];
|
|
9
|
+
type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;
|
|
10
|
+
declare namespace ComposerPrimitiveIf {
|
|
11
|
+
type Props = PropsWithChildren<UseComposerIfProps>;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
* @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
declare const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ComposerPrimitiveIf, RequireAtLeastOne, UseComposerIfProps };
|
|
20
19
|
//# sourceMappingURL=ComposerIf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerIf.d.ts","
|
|
1
|
+
{"version":3,"file":"ComposerIf.d.ts","names":[],"sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"mappings":";;;KAGK,iBAAA;gDAEH,OAAA,uBAFoB;EAIpB,SAAS;AAAA;AAAA,KAGC,iBAAA,uBAAwC,CAAA,SAAU,CAAA,IAAK,IAAA,CACjE,CAAA,EACA,OAAA,OAAc,CAAA,EAAG,IAAA,aAGT,IAAA,KAAS,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,KAAM,OAAA,CAAQ,IAAA,CAAK,CAAA,EAAG,OAAA,CAAQ,IAAA,EAAM,CAAA,MACpE,IAAA;AAAA,KAEQ,kBAAA,GAAqB,iBAAiB,CAAC,iBAAA;AAAA,kBAelC,mBAAA;EAAA,KACH,KAAA,GAAQ,iBAAiB,CAAC,kBAAA;AAAA;;;;cAM3B,mBAAA,EAAqB,EAAE,CAAC,mBAAA,CAAoB,KAAA"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { useAuiState } from "@assistant-ui/store";
|
|
2
|
+
//#region src/react/primitives/composer/ComposerIf.tsx
|
|
2
3
|
const useComposerIf = (props) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (props.dictation === false && isDictating)
|
|
12
|
-
return false;
|
|
13
|
-
return true;
|
|
14
|
-
});
|
|
4
|
+
return useAuiState((s) => {
|
|
5
|
+
if (props.editing === true && !s.composer.isEditing) return false;
|
|
6
|
+
if (props.editing === false && s.composer.isEditing) return false;
|
|
7
|
+
const isDictating = s.composer.dictation != null;
|
|
8
|
+
if (props.dictation === true && !isDictating) return false;
|
|
9
|
+
if (props.dictation === false && isDictating) return false;
|
|
10
|
+
return true;
|
|
11
|
+
});
|
|
15
12
|
};
|
|
16
13
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return result ? children : null;
|
|
14
|
+
* @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.
|
|
15
|
+
*/
|
|
16
|
+
const ComposerPrimitiveIf = ({ children, ...query }) => {
|
|
17
|
+
return useComposerIf(query) ? children : null;
|
|
22
18
|
};
|
|
23
19
|
ComposerPrimitiveIf.displayName = "ComposerPrimitive.If";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ComposerPrimitiveIf };
|
|
22
|
+
|
|
24
23
|
//# sourceMappingURL=ComposerIf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerIf.js","
|
|
1
|
+
{"version":3,"file":"ComposerIf.js","names":[],"sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\ntype ComposerIfFilters = {\n /** Whether the composer is in editing mode */\n editing: boolean | undefined;\n /** Whether dictation is currently active */\n dictation: boolean | undefined;\n};\n\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;\n\nconst useComposerIf = (props: UseComposerIfProps) => {\n return useAuiState((s) => {\n if (props.editing === true && !s.composer.isEditing) return false;\n if (props.editing === false && s.composer.isEditing) return false;\n\n const isDictating = s.composer.dictation != null;\n if (props.dictation === true && !isDictating) return false;\n if (props.dictation === false && isDictating) return false;\n\n return true;\n });\n};\n\nexport namespace ComposerPrimitiveIf {\n export type Props = PropsWithChildren<UseComposerIfProps>;\n}\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.\n */\nexport const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useComposerIf(query);\n return result ? children : null;\n};\n\nComposerPrimitiveIf.displayName = \"ComposerPrimitive.If\";\n"],"mappings":";;AAoBA,MAAM,iBAAiB,UAA8B;CACnD,OAAO,aAAa,MAAM;EACxB,IAAI,MAAM,YAAY,QAAQ,CAAC,EAAE,SAAS,WAAW,OAAO;EAC5D,IAAI,MAAM,YAAY,SAAS,EAAE,SAAS,WAAW,OAAO;EAE5D,MAAM,cAAc,EAAE,SAAS,aAAa;EAC5C,IAAI,MAAM,cAAc,QAAQ,CAAC,aAAa,OAAO;EACrD,IAAI,MAAM,cAAc,SAAS,aAAa,OAAO;EAErD,OAAO;CACT,CAAC;AACH;;;;AASA,MAAa,uBAAsD,EACjE,UACA,GAAG,YACC;CAEJ,OADe,cAAc,KACjB,IAAI,WAAW;AAC7B;AAEA,oBAAoB,cAAc"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
1
|
+
import { QueueItemState } from "../../../store/scopes/queue-item.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/react/primitives/composer/ComposerQueue.d.ts
|
|
5
|
+
declare namespace ComposerPrimitiveQueue {
|
|
6
|
+
type Props = {
|
|
7
|
+
/** Render function called for each queue item. Receives the queue item state. */children: (value: {
|
|
8
|
+
queueItem: QueueItemState;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
};
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Renders all queue items in the composer.
|
|
@@ -23,9 +24,11 @@ export declare namespace ComposerPrimitiveQueue {
|
|
|
23
24
|
* </ComposerPrimitive.Queue>
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
declare const ComposerPrimitiveQueue: import("react").NamedExoticComponent<{
|
|
28
|
+
children: (value: {
|
|
29
|
+
queueItem: QueueItemState;
|
|
30
|
+
}) => ReactNode;
|
|
30
31
|
}>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ComposerPrimitiveQueue };
|
|
31
34
|
//# sourceMappingURL=ComposerQueue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerQueue.d.ts","
|
|
1
|
+
{"version":3,"file":"ComposerQueue.d.ts","names":[],"sources":["../../../../src/react/primitives/composer/ComposerQueue.tsx"],"mappings":";;;;kBAKiB,sBAAA;EAAA,KACH,KAAA;IADG,iFAGb,QAAA,GAAW,KAAA;MAAS,SAAA,EAAW,cAAA;IAAA,MAAqB,SAAS;EAAA;AAAA;;;;;;AAAA;AA+CjE;;;;;;;;;cAAa,sBAAA,kBAAsB,oBAAA;aA1CtB,KAAA;IAAS,SAAA,EAAW,cAAA;EAAA,MAAqB,SAAS;AAAA"}
|