@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
|
@@ -22,6 +22,22 @@ import type {
|
|
|
22
22
|
} from "../../types/message";
|
|
23
23
|
import type { MessageTiming } from "../../types/message";
|
|
24
24
|
|
|
25
|
+
type ThreadMessageLikeContentItem = Exclude<
|
|
26
|
+
ThreadMessageLike["content"],
|
|
27
|
+
string
|
|
28
|
+
>[number];
|
|
29
|
+
|
|
30
|
+
const isPendingToolCall = (c: ThreadMessageLikeContentItem): boolean =>
|
|
31
|
+
c.type === "tool-call" && c.result === undefined;
|
|
32
|
+
|
|
33
|
+
const isInterruptedToolCall = (c: ThreadMessageLikeContentItem): boolean => {
|
|
34
|
+
if (c.type !== "tool-call" || c.result !== undefined) return false;
|
|
35
|
+
return (
|
|
36
|
+
c.interrupt != null ||
|
|
37
|
+
(c.approval != null && c.approval.approved === undefined)
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
25
41
|
export namespace useExternalMessageConverter {
|
|
26
42
|
export type Message =
|
|
27
43
|
| (ThreadMessageLike & {
|
|
@@ -335,15 +351,16 @@ export const convertExternalMessages = <T extends WeakKey>(
|
|
|
335
351
|
const result = chunks.map((message, idx) => {
|
|
336
352
|
const isLast = idx === chunks.length - 1;
|
|
337
353
|
const joined = joinExternalMessages(message.outputs);
|
|
354
|
+
const hasInterruptedToolCalls =
|
|
355
|
+
typeof joined.content === "object" &&
|
|
356
|
+
joined.content.some(isInterruptedToolCall);
|
|
338
357
|
const hasPendingToolCalls =
|
|
339
358
|
typeof joined.content === "object" &&
|
|
340
|
-
joined.content.some(
|
|
341
|
-
(c) => c.type === "tool-call" && c.result === undefined,
|
|
342
|
-
);
|
|
359
|
+
joined.content.some(isPendingToolCall);
|
|
343
360
|
const autoStatus = getAutoStatus(
|
|
344
361
|
isLast,
|
|
345
362
|
isRunning,
|
|
346
|
-
|
|
363
|
+
hasInterruptedToolCalls,
|
|
347
364
|
hasPendingToolCalls,
|
|
348
365
|
isLast ? metadata.error : undefined,
|
|
349
366
|
);
|
|
@@ -425,20 +442,16 @@ export const useExternalMessageConverter = <T extends WeakKey>({
|
|
|
425
442
|
const isLast = idx === chunks.length - 1;
|
|
426
443
|
|
|
427
444
|
const joined = joinExternalMessages(message.outputs);
|
|
428
|
-
const
|
|
445
|
+
const hasInterruptedToolCalls =
|
|
429
446
|
typeof joined.content === "object" &&
|
|
430
|
-
joined.content.some(
|
|
431
|
-
(c) => c.type === "tool-call" && c.result === undefined,
|
|
432
|
-
);
|
|
447
|
+
joined.content.some(isInterruptedToolCall);
|
|
433
448
|
const hasPendingToolCalls =
|
|
434
449
|
typeof joined.content === "object" &&
|
|
435
|
-
joined.content.some(
|
|
436
|
-
(c) => c.type === "tool-call" && c.result === undefined,
|
|
437
|
-
);
|
|
450
|
+
joined.content.some(isPendingToolCall);
|
|
438
451
|
const autoStatus = getAutoStatus(
|
|
439
452
|
isLast,
|
|
440
453
|
isRunning,
|
|
441
|
-
|
|
454
|
+
hasInterruptedToolCalls,
|
|
442
455
|
hasPendingToolCalls,
|
|
443
456
|
isLast ? state.metadata.error : undefined,
|
|
444
457
|
);
|
|
@@ -3,6 +3,8 @@ import type {
|
|
|
3
3
|
MessagePartStatus,
|
|
4
4
|
DataMessagePart,
|
|
5
5
|
FileMessagePart,
|
|
6
|
+
GenerativeUIMessagePart,
|
|
7
|
+
GenerativeUISpec,
|
|
6
8
|
ImageMessagePart,
|
|
7
9
|
ReasoningMessagePart,
|
|
8
10
|
SourceMessagePart,
|
|
@@ -69,6 +71,14 @@ export type ToolCallMessagePartProps<
|
|
|
69
71
|
* paused frontend tool execution.
|
|
70
72
|
*/
|
|
71
73
|
resume: (payload: unknown) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Responds to a server-side tool approval gate. Only valid while
|
|
76
|
+
* `approval` is set on the part and `approval.approved === undefined`.
|
|
77
|
+
*/
|
|
78
|
+
respondToApproval: (response: {
|
|
79
|
+
approved: boolean;
|
|
80
|
+
reason?: string;
|
|
81
|
+
}) => void;
|
|
72
82
|
};
|
|
73
83
|
|
|
74
84
|
/** Component used to render a tool-call message part. */
|
|
@@ -79,3 +89,27 @@ export type ToolCallMessagePartComponent<
|
|
|
79
89
|
|
|
80
90
|
export type QuoteMessagePartProps = QuoteInfo;
|
|
81
91
|
export type QuoteMessagePartComponent = ComponentType<QuoteMessagePartProps>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The consumer-provided allowlist of components a generative-ui spec is
|
|
95
|
+
* permitted to render. Keys are the component names referenced in the spec
|
|
96
|
+
* (e.g. `"Card"`, `"Button"`); values are the React components.
|
|
97
|
+
*
|
|
98
|
+
* This registry is the security boundary in the same-realm rendering path —
|
|
99
|
+
* any name not present in the registry is rejected with a typed error.
|
|
100
|
+
*/
|
|
101
|
+
export type GenerativeUIComponentRegistry = Record<string, ComponentType<any>>;
|
|
102
|
+
|
|
103
|
+
export type GenerativeUIMessagePartProps = MessagePartState &
|
|
104
|
+
GenerativeUIMessagePart;
|
|
105
|
+
export type GenerativeUIMessagePartComponent =
|
|
106
|
+
ComponentType<GenerativeUIMessagePartProps>;
|
|
107
|
+
|
|
108
|
+
export type GenerativeUIRenderProps = {
|
|
109
|
+
/** The JSON spec to render. */
|
|
110
|
+
spec: GenerativeUISpec;
|
|
111
|
+
/** The component allowlist. */
|
|
112
|
+
components: GenerativeUIComponentRegistry;
|
|
113
|
+
/** Optional fallback for unknown component names. */
|
|
114
|
+
Fallback?: ComponentType<{ component: string; props?: unknown }> | undefined;
|
|
115
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { isMcpAppUri } from "../../types/message";
|
|
2
|
+
import type { PartState } from "../../store/scopes/part";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Hierarchical adjacent-coalescing grouping for message parts.
|
|
3
6
|
*
|
|
@@ -11,16 +14,71 @@
|
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* Symbol attached to memoizable `groupBy` functions (e.g. those returned
|
|
18
|
+
* by {@link groupPartByType}). Carries a string fingerprint of the config
|
|
19
|
+
* so `MessagePrimitive.GroupedParts` can memo the tree on
|
|
20
|
+
* `[parts, memoKey]` across renders — even when the helper call site
|
|
21
|
+
* reconstructs the function each render.
|
|
22
|
+
*/
|
|
23
|
+
export const GROUPBY_MEMO_KEY: unique symbol = Symbol.for(
|
|
24
|
+
"@assistant-ui/groupBy.memoKey",
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Synthetic part-type key recognized by {@link groupPartByType}: a
|
|
29
|
+
* tool-call whose `mcp.app.resourceUri` points at an assistant-ui MCP
|
|
30
|
+
* app. Map this key to control how MCP-app tool calls are grouped —
|
|
31
|
+
* separately from regular `"tool-call"` parts.
|
|
32
|
+
*/
|
|
33
|
+
type GroupPartType = PartState["type"] | "mcp-app";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Build a `groupBy` from a `part.type → group-key path` lookup.
|
|
37
|
+
* Parts whose type isn't in the map are left ungrouped. The returned
|
|
38
|
+
* function carries a stable {@link GROUPBY_MEMO_KEY} fingerprint so
|
|
39
|
+
* `<MessagePrimitive.GroupedParts>` can memoize its tree across renders.
|
|
40
|
+
*
|
|
41
|
+
* Special key `"mcp-app"` matches tool-call parts that point at an
|
|
42
|
+
* assistant-ui MCP app resource (`ui://...`) and takes precedence over
|
|
43
|
+
* the `"tool-call"` entry for those parts.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <MessagePrimitive.GroupedParts
|
|
48
|
+
* groupBy={groupPartByType({
|
|
49
|
+
* reasoning: ["group-thought", "group-reasoning"],
|
|
50
|
+
* "tool-call": ["group-thought", "group-tool"],
|
|
51
|
+
* "mcp-app": [],
|
|
52
|
+
* })}
|
|
53
|
+
* >
|
|
54
|
+
* {({ part, children }) => { ... }}
|
|
55
|
+
* </MessagePrimitive.GroupedParts>
|
|
56
|
+
* ```
|
|
18
57
|
*/
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
|
23
|
-
|
|
58
|
+
export const groupPartByType = <TKey extends `group-${string}`>(
|
|
59
|
+
map: Partial<Readonly<Record<GroupPartType, readonly TKey[]>>>,
|
|
60
|
+
): ((part: PartState) => readonly TKey[]) => {
|
|
61
|
+
const lookup = map as Readonly<Record<string, readonly TKey[] | undefined>>;
|
|
62
|
+
const fn = ((part) => {
|
|
63
|
+
if (
|
|
64
|
+
part.type === "tool-call" &&
|
|
65
|
+
lookup["mcp-app"] !== undefined &&
|
|
66
|
+
isMcpAppUri(part.mcp?.app?.resourceUri)
|
|
67
|
+
) {
|
|
68
|
+
return lookup["mcp-app"]!;
|
|
69
|
+
}
|
|
70
|
+
return lookup[part.type] ?? [];
|
|
71
|
+
}) as ((part: PartState) => readonly TKey[]) & {
|
|
72
|
+
[GROUPBY_MEMO_KEY]?: string;
|
|
73
|
+
};
|
|
74
|
+
// Sort keys so the fingerprint is insensitive to map insertion order —
|
|
75
|
+
// two maps with the same key/value pairs but different declaration order
|
|
76
|
+
// would otherwise hash differently and invalidate the memo unnecessarily.
|
|
77
|
+
const sortedKeys = Object.keys(map).sort();
|
|
78
|
+
const sortedEntries = sortedKeys.map((k) => [k, map[k as keyof typeof map]]);
|
|
79
|
+
fn[GROUPBY_MEMO_KEY] = `groupPartByType:${JSON.stringify(sortedEntries)}`;
|
|
80
|
+
return fn;
|
|
81
|
+
};
|
|
24
82
|
|
|
25
83
|
export type GroupNode = GroupNodeGroup | GroupNodePart;
|
|
26
84
|
|
|
@@ -43,19 +101,6 @@ export interface GroupNodePart {
|
|
|
43
101
|
readonly nodeKey: string;
|
|
44
102
|
}
|
|
45
103
|
|
|
46
|
-
const EMPTY_PATH: readonly string[] = Object.freeze([]);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Normalize a `groupBy` return value to a path array.
|
|
50
|
-
* `null`/`undefined`/`[]` → `[]` (ungrouped).
|
|
51
|
-
* `"foo"` → `["foo"]`. Arrays pass through.
|
|
52
|
-
*/
|
|
53
|
-
export const normalizeGroupKey = (key: GroupKey): readonly string[] => {
|
|
54
|
-
if (key == null) return EMPTY_PATH;
|
|
55
|
-
if (typeof key === "string") return [key];
|
|
56
|
-
return key;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
104
|
interface BuildFrame {
|
|
60
105
|
key: string;
|
|
61
106
|
nodeKey: string;
|
|
@@ -26,6 +26,7 @@ type MessagePartSnapshotBinding = SubscribableWithState<
|
|
|
26
26
|
export type MessagePartRuntime = {
|
|
27
27
|
addToolResult(result: any | ToolResponse<any>): void;
|
|
28
28
|
resumeToolCall(payload: unknown): void;
|
|
29
|
+
respondToToolApproval(response: { approved: boolean; reason?: string }): void;
|
|
29
30
|
|
|
30
31
|
readonly path: MessagePartRuntimePath;
|
|
31
32
|
getState(): MessagePartState;
|
|
@@ -48,6 +49,7 @@ export class MessagePartRuntimeImpl implements MessagePartRuntime {
|
|
|
48
49
|
protected __internal_bindMethods() {
|
|
49
50
|
this.addToolResult = this.addToolResult.bind(this);
|
|
50
51
|
this.resumeToolCall = this.resumeToolCall.bind(this);
|
|
52
|
+
this.respondToToolApproval = this.respondToToolApproval.bind(this);
|
|
51
53
|
this.getState = this.getState.bind(this);
|
|
52
54
|
this.subscribe = this.subscribe.bind(this);
|
|
53
55
|
}
|
|
@@ -102,6 +104,30 @@ export class MessagePartRuntimeImpl implements MessagePartRuntime {
|
|
|
102
104
|
});
|
|
103
105
|
}
|
|
104
106
|
|
|
107
|
+
public respondToToolApproval(response: {
|
|
108
|
+
approved: boolean;
|
|
109
|
+
reason?: string;
|
|
110
|
+
}) {
|
|
111
|
+
const state = this.contentBinding.getState();
|
|
112
|
+
if (!state) throw new Error("Message part is not available");
|
|
113
|
+
|
|
114
|
+
if (state.type !== "tool-call")
|
|
115
|
+
throw new Error(
|
|
116
|
+
"Tried to respond to tool approval on non-tool message part",
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
if (!state.approval || state.approval.approved !== undefined)
|
|
120
|
+
throw new Error("Tool call has no pending approval");
|
|
121
|
+
|
|
122
|
+
if (!this.threadApi) throw new Error("Thread API is not available");
|
|
123
|
+
|
|
124
|
+
this.threadApi.getState().respondToToolApproval({
|
|
125
|
+
approvalId: state.approval.id,
|
|
126
|
+
approved: response.approved,
|
|
127
|
+
...(response.reason != null && { reason: response.reason }),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
105
131
|
public subscribe(callback: () => void) {
|
|
106
132
|
return this.contentBinding.subscribe(callback);
|
|
107
133
|
}
|
|
@@ -36,7 +36,7 @@ export type ThreadListItemRuntime = {
|
|
|
36
36
|
initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;
|
|
37
37
|
generateTitle(): Promise<void>;
|
|
38
38
|
|
|
39
|
-
switchTo(): Promise<void>;
|
|
39
|
+
switchTo(options?: { unarchive?: boolean }): Promise<void>;
|
|
40
40
|
rename(newTitle: string): Promise<void>;
|
|
41
41
|
archive(): Promise<void>;
|
|
42
42
|
unarchive(): Promise<void>;
|
|
@@ -89,9 +89,9 @@ export class ThreadListItemRuntimeImpl implements ThreadListItemRuntime {
|
|
|
89
89
|
return this._core.getState();
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
public switchTo(): Promise<void> {
|
|
92
|
+
public switchTo(options?: { unarchive?: boolean }): Promise<void> {
|
|
93
93
|
const state = this._core.getState();
|
|
94
|
-
return this._threadListBinding.switchToThread(state.id);
|
|
94
|
+
return this._threadListBinding.switchToThread(state.id, options);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
public rename(newTitle: string): Promise<void> {
|
|
@@ -48,7 +48,10 @@ export type ThreadListRuntime = {
|
|
|
48
48
|
getItemByIndex(idx: number): ThreadListItemRuntime;
|
|
49
49
|
getArchivedItemByIndex(idx: number): ThreadListItemRuntime;
|
|
50
50
|
|
|
51
|
-
switchToThread(
|
|
51
|
+
switchToThread(
|
|
52
|
+
threadId: string,
|
|
53
|
+
options?: { unarchive?: boolean },
|
|
54
|
+
): Promise<void>;
|
|
52
55
|
switchToNewThread(): Promise<void>;
|
|
53
56
|
|
|
54
57
|
getLoadThreadsPromise(): Promise<void>;
|
|
@@ -152,8 +155,11 @@ export class ThreadListRuntimeImpl implements ThreadListRuntime {
|
|
|
152
155
|
this.getArchivedItemByIndex = this.getArchivedItemByIndex.bind(this);
|
|
153
156
|
}
|
|
154
157
|
|
|
155
|
-
public switchToThread(
|
|
156
|
-
|
|
158
|
+
public switchToThread(
|
|
159
|
+
threadId: string,
|
|
160
|
+
options?: { unarchive?: boolean },
|
|
161
|
+
): Promise<void> {
|
|
162
|
+
return this._core.switchToThread(threadId, options);
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
public switchToNewThread(): Promise<void> {
|
|
@@ -15,6 +15,7 @@ import { DefaultThreadComposerRuntimeCore } from "./default-thread-composer-runt
|
|
|
15
15
|
import type {
|
|
16
16
|
AddToolResultOptions,
|
|
17
17
|
ResumeToolCallOptions,
|
|
18
|
+
RespondToToolApprovalOptions,
|
|
18
19
|
ThreadSuggestion,
|
|
19
20
|
SubmitFeedbackOptions,
|
|
20
21
|
ThreadRuntimeCore,
|
|
@@ -59,6 +60,9 @@ export abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore {
|
|
|
59
60
|
public abstract resumeRun(config: ResumeRunConfig): void;
|
|
60
61
|
public abstract addToolResult(options: AddToolResultOptions): void;
|
|
61
62
|
public abstract resumeToolCall(options: ResumeToolCallOptions): void;
|
|
63
|
+
public abstract respondToToolApproval(
|
|
64
|
+
options: RespondToToolApprovalOptions,
|
|
65
|
+
): void;
|
|
62
66
|
public abstract cancelRun(): void;
|
|
63
67
|
public abstract exportExternalState(): any;
|
|
64
68
|
public abstract importExternalState(state: any): void;
|
|
@@ -478,6 +482,14 @@ export abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore {
|
|
|
478
482
|
}
|
|
479
483
|
subscribers.add(wrapped);
|
|
480
484
|
|
|
485
|
+
// `initialize` latches: replay it (deferred) to subscribers that attach
|
|
486
|
+
// after the thread already initialized, mirroring a BehaviorSubject.
|
|
487
|
+
if (event === "initialize" && this._isInitialized) {
|
|
488
|
+
queueMicrotask(() => {
|
|
489
|
+
if (subscribers.has(wrapped)) wrapped({});
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
|
|
481
493
|
return () => {
|
|
482
494
|
this._eventSubscribers.get(event)?.delete(wrapped);
|
|
483
495
|
};
|
|
@@ -32,7 +32,10 @@ export type ThreadListRuntimeCore = {
|
|
|
32
32
|
|
|
33
33
|
getItemById(threadId: string): ThreadListItemCoreState | undefined;
|
|
34
34
|
|
|
35
|
-
switchToThread(
|
|
35
|
+
switchToThread(
|
|
36
|
+
threadId: string,
|
|
37
|
+
options?: { unarchive?: boolean },
|
|
38
|
+
): Promise<void>;
|
|
36
39
|
switchToNewThread(): Promise<void>;
|
|
37
40
|
|
|
38
41
|
getLoadThreadsPromise(): Promise<void>;
|
|
@@ -45,6 +45,12 @@ export type ResumeToolCallOptions = {
|
|
|
45
45
|
payload: unknown;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
export type RespondToToolApprovalOptions = {
|
|
49
|
+
approvalId: string;
|
|
50
|
+
approved: boolean;
|
|
51
|
+
reason?: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
48
54
|
export type SubmitFeedbackOptions = {
|
|
49
55
|
messageId: string;
|
|
50
56
|
type: "negative" | "positive";
|
|
@@ -85,11 +91,12 @@ export type ThreadRuntimeEventPayload = {
|
|
|
85
91
|
*/
|
|
86
92
|
runEnd: Record<string, never>;
|
|
87
93
|
/**
|
|
88
|
-
* @deprecated State-derivable.
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
94
|
+
* @deprecated State-derivable. Observe `state.messages` becoming non-empty
|
|
95
|
+
* via a regular `subscribe` callback instead. This event fires once at the
|
|
96
|
+
* initialization transition; subscribers that attach afterwards receive a
|
|
97
|
+
* one-off replay (on a microtask), by which point the thread already has
|
|
98
|
+
* messages, so handler-visible state differs between live and replayed
|
|
99
|
+
* delivery. Kept for backward compatibility.
|
|
93
100
|
*/
|
|
94
101
|
initialize: Record<string, never>;
|
|
95
102
|
/**
|
|
@@ -136,6 +143,7 @@ export type ThreadRuntimeCore = Readonly<{
|
|
|
136
143
|
|
|
137
144
|
addToolResult: (options: AddToolResultOptions) => void;
|
|
138
145
|
resumeToolCall: (options: ResumeToolCallOptions) => void;
|
|
146
|
+
respondToToolApproval: (options: RespondToToolApprovalOptions) => void;
|
|
139
147
|
|
|
140
148
|
speak: (messageId: string) => void;
|
|
141
149
|
stopSpeaking: () => void;
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
ThreadSystemMessage,
|
|
15
15
|
FileMessagePart,
|
|
16
16
|
DataMessagePart,
|
|
17
|
+
GenerativeUIMessagePart,
|
|
17
18
|
Unstable_AudioMessagePart,
|
|
18
19
|
} from "../../types/message";
|
|
19
20
|
import type { CompleteAttachment } from "../../types/attachment";
|
|
@@ -39,6 +40,7 @@ export type ThreadMessageLike = {
|
|
|
39
40
|
| ImageMessagePart
|
|
40
41
|
| FileMessagePart
|
|
41
42
|
| DataMessagePart
|
|
43
|
+
| GenerativeUIMessagePart
|
|
42
44
|
| Unstable_AudioMessagePart
|
|
43
45
|
| DataPrefixedPart
|
|
44
46
|
| {
|
|
@@ -52,6 +54,13 @@ export type ThreadMessageLike = {
|
|
|
52
54
|
readonly isError?: boolean | undefined;
|
|
53
55
|
readonly parentId?: string | undefined;
|
|
54
56
|
readonly messages?: readonly ThreadMessage[] | undefined;
|
|
57
|
+
readonly interrupt?: { type: "human"; payload: unknown };
|
|
58
|
+
readonly approval?: {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly approved?: boolean;
|
|
61
|
+
readonly reason?: string;
|
|
62
|
+
readonly isAutomatic?: boolean;
|
|
63
|
+
};
|
|
55
64
|
}
|
|
56
65
|
)[];
|
|
57
66
|
readonly id?: string | undefined;
|
|
@@ -105,10 +114,13 @@ export const fromThreadMessageLike = (
|
|
|
105
114
|
image,
|
|
106
115
|
...rest
|
|
107
116
|
}: ImageMessagePart): ImageMessagePart | null => {
|
|
108
|
-
const
|
|
109
|
-
/^data:image\/(png|jpeg|jpg|gif|webp);base64,(.*)$/,
|
|
117
|
+
const dataUri = image.match(
|
|
118
|
+
/^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,(.*)$/,
|
|
110
119
|
);
|
|
111
|
-
if (
|
|
120
|
+
if (dataUri) {
|
|
121
|
+
return { ...rest, image };
|
|
122
|
+
}
|
|
123
|
+
if (/^(https:\/\/|blob:)/.test(image)) {
|
|
112
124
|
return { ...rest, image };
|
|
113
125
|
}
|
|
114
126
|
console.warn(`Invalid image data format detected`);
|
|
@@ -148,6 +160,9 @@ export const fromThreadMessageLike = (
|
|
|
148
160
|
case "data":
|
|
149
161
|
return part;
|
|
150
162
|
|
|
163
|
+
case "generative-ui":
|
|
164
|
+
return part;
|
|
165
|
+
|
|
151
166
|
case "tool-call": {
|
|
152
167
|
const { parentId, messages, ...basePart } = part;
|
|
153
168
|
const commonProps = {
|
|
@@ -9,6 +9,7 @@ import type { RealtimeVoiceAdapter } from "../../adapters/voice";
|
|
|
9
9
|
import type { FeedbackAdapter } from "../../adapters/feedback";
|
|
10
10
|
import type {
|
|
11
11
|
AddToolResultOptions,
|
|
12
|
+
RespondToToolApprovalOptions,
|
|
12
13
|
StartRunConfig,
|
|
13
14
|
ResumeRunConfig,
|
|
14
15
|
ThreadSuggestion,
|
|
@@ -108,6 +109,9 @@ type ExternalStoreAdapterBase<T> = {
|
|
|
108
109
|
onResumeToolCall?:
|
|
109
110
|
| ((options: { toolCallId: string; payload: unknown }) => void)
|
|
110
111
|
| undefined;
|
|
112
|
+
onRespondToToolApproval?:
|
|
113
|
+
| ((options: RespondToToolApprovalOptions) => Promise<void> | void)
|
|
114
|
+
| undefined;
|
|
111
115
|
convertMessage?: ExternalStoreMessageConverter<T> | undefined;
|
|
112
116
|
adapters?:
|
|
113
117
|
| {
|
|
@@ -168,7 +168,10 @@ export class ExternalStoreThreadListRuntimeCore
|
|
|
168
168
|
this._notifySubscribers();
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
public async switchToThread(
|
|
171
|
+
public async switchToThread(
|
|
172
|
+
threadId: string,
|
|
173
|
+
_options?: { unarchive?: boolean },
|
|
174
|
+
): Promise<void> {
|
|
172
175
|
if (this._mainThreadId === threadId) return;
|
|
173
176
|
const onSwitchToThread = this.adapter.onSwitchToThread;
|
|
174
177
|
if (!onSwitchToThread)
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
AddToolResultOptions,
|
|
4
4
|
ResumeRunConfig,
|
|
5
5
|
ResumeToolCallOptions,
|
|
6
|
+
RespondToToolApprovalOptions,
|
|
6
7
|
StartRunConfig,
|
|
7
8
|
ThreadSuggestion,
|
|
8
9
|
} from "../../runtime/interfaces/thread-runtime-core";
|
|
@@ -372,6 +373,12 @@ export class ExternalStoreThreadRuntimeCore
|
|
|
372
373
|
this._store.onResumeToolCall(options);
|
|
373
374
|
}
|
|
374
375
|
|
|
376
|
+
public respondToToolApproval(options: RespondToToolApprovalOptions) {
|
|
377
|
+
if (!this._store.onRespondToToolApproval)
|
|
378
|
+
throw new Error("Runtime does not support tool approvals.");
|
|
379
|
+
this._store.onRespondToToolApproval(options);
|
|
380
|
+
}
|
|
381
|
+
|
|
375
382
|
public override reset(initialMessages?: readonly ThreadMessageLike[]) {
|
|
376
383
|
this._lastSyncedMessageIds = new Set();
|
|
377
384
|
const repo = new MessageRepository();
|
|
@@ -9,6 +9,7 @@ import type { LocalRuntimeOptionsBase } from "./local-runtime-options";
|
|
|
9
9
|
import type {
|
|
10
10
|
AddToolResultOptions,
|
|
11
11
|
ResumeToolCallOptions,
|
|
12
|
+
RespondToToolApprovalOptions,
|
|
12
13
|
ThreadSuggestion,
|
|
13
14
|
ThreadRuntimeCore,
|
|
14
15
|
StartRunConfig,
|
|
@@ -535,4 +536,8 @@ export class LocalThreadRuntimeCore
|
|
|
535
536
|
public resumeToolCall(_options: ResumeToolCallOptions) {
|
|
536
537
|
throw new Error("Local runtime does not support resuming tool calls.");
|
|
537
538
|
}
|
|
539
|
+
|
|
540
|
+
public respondToToolApproval(_options: RespondToToolApprovalOptions) {
|
|
541
|
+
throw new Error("Local runtime does not support tool approvals.");
|
|
542
|
+
}
|
|
538
543
|
}
|
|
@@ -11,6 +11,8 @@ export const MessagePartClient = resource(
|
|
|
11
11
|
getState: () => state,
|
|
12
12
|
addToolResult: (result) => runtime.addToolResult(result),
|
|
13
13
|
resumeToolCall: (payload) => runtime.resumeToolCall(payload),
|
|
14
|
+
respondToToolApproval: (response) =>
|
|
15
|
+
runtime.respondToToolApproval(response),
|
|
14
16
|
__internal_getRuntime: () => runtime,
|
|
15
17
|
};
|
|
16
18
|
},
|
|
@@ -81,8 +81,8 @@ export const ThreadListClient = resource(
|
|
|
81
81
|
: state.threadIds[index]!;
|
|
82
82
|
return threadItems.get({ key: id });
|
|
83
83
|
},
|
|
84
|
-
switchToThread: async (threadId) => {
|
|
85
|
-
await runtime.switchToThread(threadId);
|
|
84
|
+
switchToThread: async (threadId, options) => {
|
|
85
|
+
await runtime.switchToThread(threadId, options);
|
|
86
86
|
},
|
|
87
87
|
switchToNewThread: async () => {
|
|
88
88
|
await runtime.switchToNewThread();
|
package/src/store/scopes/part.ts
CHANGED
|
@@ -26,6 +26,10 @@ export type PartMethods = {
|
|
|
26
26
|
* This is useful when a tool has requested human input and is waiting for a response.
|
|
27
27
|
*/
|
|
28
28
|
resumeToolCall(payload: unknown): void;
|
|
29
|
+
/**
|
|
30
|
+
* Respond to a server-side tool approval gate. The approval id is read from the part.
|
|
31
|
+
*/
|
|
32
|
+
respondToToolApproval(response: { approved: boolean; reason?: string }): void;
|
|
29
33
|
__internal_getRuntime?(): MessagePartRuntime;
|
|
30
34
|
};
|
|
31
35
|
|
|
@@ -12,7 +12,7 @@ export type ThreadListItemState = {
|
|
|
12
12
|
|
|
13
13
|
export type ThreadListItemMethods = {
|
|
14
14
|
getState(): ThreadListItemState;
|
|
15
|
-
switchTo(): void;
|
|
15
|
+
switchTo(options?: { unarchive?: boolean }): void;
|
|
16
16
|
rename(newTitle: string): void;
|
|
17
17
|
archive(): void;
|
|
18
18
|
unarchive(): void;
|
|
@@ -19,7 +19,7 @@ export type ThreadsState = {
|
|
|
19
19
|
|
|
20
20
|
export type ThreadsMethods = {
|
|
21
21
|
getState(): ThreadsState;
|
|
22
|
-
switchToThread(threadId: string): void;
|
|
22
|
+
switchToThread(threadId: string, options?: { unarchive?: boolean }): void;
|
|
23
23
|
switchToNewThread(): void;
|
|
24
24
|
item(
|
|
25
25
|
threadIdOrOptions:
|