@assistant-ui/core 0.3.19 → 0.3.21
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 +50 -43
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +52 -21
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +2 -5
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +7 -8
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/index.d.ts +14 -9
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/speech.d.ts +63 -65
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +16 -2
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +19 -22
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +60 -58
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +8 -11
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +50 -45
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/adapters/voice.js +17 -3
- package/dist/adapters/voice.js.map +1 -1
- package/dist/index.d.ts +70 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/duplicate-detection.d.ts +1 -4
- package/dist/internal/duplicate-detection.d.ts.map +1 -1
- package/dist/internal.d.ts +27 -58
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +8 -6
- package/dist/model-context/frame/host.d.ts +20 -23
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +3 -1
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +28 -30
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +6 -0
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/frame/types.d.ts +24 -27
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/frame/validate.d.ts +3 -0
- package/dist/model-context/frame/validate.d.ts.map +1 -0
- package/dist/model-context/frame/validate.js +26 -0
- package/dist/model-context/frame/validate.js.map +1 -0
- package/dist/model-context/interactable-composer-metadata.d.ts +51 -39
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +30 -6
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +9 -12
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +15 -18
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +15 -17
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +12 -14
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +40 -43
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +9 -12
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +23 -26
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +4 -8
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +28 -23
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +77 -58
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +4 -7
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +6 -9
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +2 -5
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +9 -12
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +3 -6
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +306 -101
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +34 -37
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +2 -1
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts +10 -12
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +4 -8
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +9 -11
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +32 -22
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +160 -122
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +5 -5
- package/dist/react/interactables-legacy/Interactables.d.ts +2 -5
- package/dist/react/interactables-legacy/Interactables.d.ts.map +1 -1
- package/dist/react/interactables-legacy/Interactables.js +15 -8
- package/dist/react/interactables-legacy/Interactables.js.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.d.ts +6 -9
- package/dist/react/interactables-legacy/interactable-model-context.d.ts.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.js +13 -14
- package/dist/react/interactables-legacy/interactable-model-context.js.map +1 -1
- package/dist/react/interactables-legacy/scopes.d.ts +42 -46
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +8 -11
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +7 -9
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +23 -14
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js +54 -25
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js.map +1 -1
- package/dist/react/model-context/define-mcp-toolkit.d.ts +15 -18
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +13 -6
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +1 -4
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +3 -6
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +26 -29
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +6 -9
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +6 -9
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +6 -9
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +5 -7
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +1 -4
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +44 -32
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +3 -6
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +7 -10
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +3 -6
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +9 -13
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +13 -16
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +3 -5
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +3 -6
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +40 -40
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +10 -9
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +4 -7
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +7 -9
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +7 -10
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +6 -9
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +3 -6
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +3 -6
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +4 -7
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +3 -6
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +3 -6
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +4 -7
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +2 -5
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +3 -6
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +5 -8
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +1 -4
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +3 -6
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +7 -10
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.js +4 -4
- package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +3 -6
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +8 -11
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +27 -29
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +26 -28
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +13 -13
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +13 -17
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +30 -33
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +42 -33
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +30 -28
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +14 -15
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +122 -120
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -3
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +208 -194
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +124 -82
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +8 -11
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +4 -7
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +16 -19
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +61 -64
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +25 -27
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.js +24 -5
- package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +26 -28
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +6 -9
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +5 -8
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +4 -7
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +3 -6
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +3 -6
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +3 -6
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +3 -6
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +4 -7
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +7 -10
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +4 -7
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +4 -7
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.js +5 -1
- package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +4 -7
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +4 -8
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +210 -219
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +70 -46
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +186 -198
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +13 -4
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +17 -23
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.js +3 -1
- package/dist/react/runtimes/RemoteThreadResource.js.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +10 -11
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +11 -14
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +6 -8
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js +9 -2
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.d.ts +9 -12
- package/dist/react/runtimes/assistant-transport/runManager.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.js +4 -1
- package/dist/react/runtimes/assistant-transport/runManager.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/types.d.ts +123 -118
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +7 -10
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js +17 -6
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts +3 -6
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +2 -5
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +7 -10
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +426 -216
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +15 -18
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +8 -4
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +146 -125
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +120 -8
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +13 -15
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +5 -7
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +2 -5
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.js +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +3 -6
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +9 -11
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +15 -19
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.js.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +14 -17
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +17 -21
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-store-history-copy.d.ts +25 -0
- package/dist/react/runtimes/external-store-history-copy.d.ts.map +1 -0
- package/dist/react/runtimes/external-store-history-copy.js +148 -0
- package/dist/react/runtimes/external-store-history-copy.js.map +1 -0
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +3 -6
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.js +72 -35
- package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts +2 -5
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +29 -41
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +142 -34
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +3 -6
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +2 -2
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +5 -7
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +4 -6
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +72 -70
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +11 -15
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +60 -60
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +21 -24
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/types/store-augmentation.d.ts +10 -11
- package/dist/react/types/store-augmentation.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +6 -8
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +35 -37
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +3 -6
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +3 -6
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +28 -31
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +51 -49
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/bindings.d.ts +35 -35
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +215 -201
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +4 -0
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +31 -30
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +25 -2
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +87 -82
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +4 -3
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +54 -57
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +70 -72
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +77 -81
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +306 -308
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +2 -1
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +9 -12
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +150 -101
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +400 -122
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +121 -104
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +174 -62
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +30 -31
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +21 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +28 -31
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +23 -2
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +15 -18
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +8 -11
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +98 -83
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +67 -70
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +225 -211
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +25 -20
- package/dist/runtime/internal.d.ts.map +1 -0
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +37 -40
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +32 -33
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +10 -2
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/queue/queue-item.d.ts +7 -10
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +9 -11
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +16 -15
- package/dist/runtime/utils/attachment-add-operations.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.js +24 -2
- package/dist/runtime/utils/attachment-add-operations.js.map +1 -1
- package/dist/runtime/utils/attachment-send-operations.d.ts +12 -0
- package/dist/runtime/utils/attachment-send-operations.d.ts.map +1 -0
- package/dist/runtime/utils/attachment-send-operations.js +34 -0
- package/dist/runtime/utils/attachment-send-operations.js.map +1 -0
- package/dist/runtime/utils/auto-status.d.ts +11 -13
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +3 -5
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +31 -33
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +47 -48
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +6 -5
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +6 -9
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +24 -27
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +52 -54
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +8 -7
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/pending-tool-calls.d.ts +12 -14
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +7 -10
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +6 -9
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.d.ts +21 -0
- package/dist/runtime/utils/stored-message-parts.d.ts.map +1 -0
- package/dist/runtime/utils/stored-message-parts.js +103 -0
- package/dist/runtime/utils/stored-message-parts.js.map +1 -0
- package/dist/runtime/utils/streaming-timing.d.ts +23 -26
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +38 -34
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +16 -6
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts +5 -7
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.js +31 -4
- package/dist/runtime/utils/thread-runtime-lifecycle.js.map +1 -1
- package/dist/runtime/utils/tool-call-tree.d.ts +10 -13
- package/dist/runtime/utils/tool-call-tree.d.ts.map +1 -1
- package/dist/runtime/utils/tool-interactions.d.ts +10 -0
- package/dist/runtime/utils/tool-interactions.d.ts.map +1 -0
- package/dist/runtime/utils/tool-interactions.js +92 -0
- package/dist/runtime/utils/tool-interactions.js.map +1 -0
- package/dist/runtimes/assistant-transport/utils.d.ts +1 -4
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +220 -200
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +6 -8
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js +4 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-shared-options.d.ts +3 -6
- package/dist/runtimes/external-store/external-store-shared-options.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +40 -43
- 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 +2 -2
- 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 +119 -125
- 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 +71 -18
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +5 -8
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +96 -98
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.js +3 -0
- package/dist/runtimes/inert/InertThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/internal.d.ts +20 -16
- package/dist/runtimes/internal.d.ts.map +1 -0
- package/dist/runtimes/local/local-runtime-core.d.ts +7 -10
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +41 -44
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +42 -45
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +94 -93
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +220 -29
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +2 -5
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +77 -55
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +28 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +12 -15
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +3 -6
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +2 -5
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +34 -31
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.js +8 -3
- package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +60 -63
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.js +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +31 -33
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +5 -8
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +119 -121
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +147 -149
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +22 -7
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/chain-of-thought-client.d.ts +8 -11
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +56 -58
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +1270 -741
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +2 -5
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +3 -6
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.js +3 -1
- package/dist/store/clients/no-op-composer-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +2 -5
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +4 -6
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/submission-message.d.ts +8 -0
- package/dist/store/clients/submission-message.d.ts.map +1 -0
- package/dist/store/clients/submission-message.js +22 -0
- package/dist/store/clients/submission-message.js.map +1 -0
- package/dist/store/clients/suggestions.d.ts +8 -11
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +12 -12
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.js +81 -82
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/clients/thread-selection-events.d.ts +1 -4
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +7 -10
- package/dist/store/clients/thread-tasks.d.ts.map +1 -1
- package/dist/store/env.d.ts +1 -4
- package/dist/store/env.d.ts.map +1 -1
- package/dist/store/index.d.ts +33 -36
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -5
- package/dist/store/internal.d.ts +12 -12
- package/dist/store/internal.d.ts.map +1 -0
- package/dist/store/internal.js +2 -2
- package/dist/store/primitive-predicates.d.ts +14 -16
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +10 -5
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +11 -14
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +65 -62
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/handle-runtime-action.d.ts +1 -4
- package/dist/store/runtime-clients/handle-runtime-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts +1 -4
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +2 -5
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.js +26 -16
- package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +10 -11
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +121 -113
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +5 -8
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +6 -9
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +221 -158
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/useSubscribable.d.ts +3 -6
- package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -1
- package/dist/store/scope-registration.d.ts +28 -29
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/attachment.d.ts +19 -22
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +33 -35
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +147 -135
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +119 -112
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +10 -13
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +53 -50
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +21 -23
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +14 -17
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +18 -21
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +27 -30
- package/dist/store/scopes/task.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.d.ts +68 -71
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +197 -200
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +49 -52
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +73 -69
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +35 -7
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/types/attachment.d.ts +35 -37
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +7 -8
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +13 -16
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +15 -17
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/message.d.ts +358 -318
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +3 -6
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +10 -13
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +1 -4
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +2 -5
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +9 -13
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +16 -19
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +19 -21
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/id.d.ts +3 -6
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +1 -4
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +1 -4
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +1 -4
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +5 -8
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +3 -6
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +6 -8
- package/dist/utils/normalizePartStatus.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.js +3 -2
- package/dist/utils/normalizePartStatus.js.map +1 -1
- package/dist/utils/notify-event-listeners.d.ts +2 -4
- package/dist/utils/notify-event-listeners.d.ts.map +1 -1
- package/dist/utils/record.d.ts +1 -4
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +2 -5
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +2 -5
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +3 -6
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/package.json +15 -13
- package/src/adapters/attachment.test.ts +98 -1
- package/src/adapters/attachment.ts +77 -20
- package/src/adapters/feedback.ts +1 -0
- package/src/adapters/speech.test.ts +94 -0
- package/src/adapters/speech.ts +16 -2
- package/src/adapters/thread-history.ts +16 -5
- package/src/adapters/voice.test.ts +169 -0
- package/src/adapters/voice.ts +25 -4
- package/src/index.ts +14 -2
- package/src/internal.ts +7 -0
- package/src/model-context/frame/host.test.ts +51 -1
- package/src/model-context/frame/host.ts +3 -1
- package/src/model-context/frame/provider.test.ts +106 -20
- package/src/model-context/frame/provider.ts +8 -1
- package/src/model-context/frame/validate.ts +57 -0
- package/src/model-context/interactable-composer-metadata.test.ts +82 -0
- package/src/model-context/interactable-composer-metadata.ts +45 -2
- package/src/react/RuntimeAdapter.test.ts +4 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +711 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +125 -109
- package/src/react/client/Interactables.test.ts +865 -8
- package/src/react/client/Interactables.ts +325 -45
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +9 -3
- package/src/react/client/RemoteThreadList.initialize-failure.test.ts +124 -0
- package/src/react/client/RemoteThreadList.test.ts +5 -6
- package/src/react/client/RemoteThreadList.ts +6 -0
- package/src/react/client/Tools.ts +2 -3
- package/src/react/client/interactable-model-context.test.ts +56 -13
- package/src/react/client/interactable-model-context.ts +48 -23
- package/src/react/index.ts +2 -2
- package/src/react/interactables-legacy/Interactables.test.ts +221 -4
- package/src/react/interactables-legacy/Interactables.ts +25 -14
- package/src/react/interactables-legacy/interactable-model-context.ts +26 -24
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +40 -22
- package/src/react/interactables-shared/useInteractablePersistenceQueue.test.tsx +22 -2
- package/src/react/interactables-shared/useInteractablePersistenceQueue.ts +63 -11
- package/src/react/model-context/useInteractable.test.tsx +56 -29
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +5 -5
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +33 -0
- package/src/react/primitive-hooks/useSuggestionTrigger.ts +7 -4
- package/src/react/primitives/generativeUI/GenerativeUI.test.tsx +170 -0
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +43 -28
- package/src/react/primitives/message/MessageAttachments.test.tsx +2 -6
- package/src/react/primitives/message/MessageAttachments.tsx +14 -8
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +155 -8
- package/src/react/primitives/message/MessageGroupedParts.tsx +19 -6
- package/src/react/primitives/message/MessageParts.test.tsx +84 -0
- package/src/react/primitives/message/MessageParts.tool-interaction.test.tsx +69 -0
- package/src/react/primitives/message/MessageParts.tsx +29 -8
- package/src/react/primitives/thread/ThreadMessages.test.tsx +25 -7
- package/src/react/primitives/thread/ThreadSuggestions.test.tsx +97 -0
- package/src/react/primitives/thread/ThreadSuggestions.tsx +29 -6
- package/src/react/providers/ReadonlyThreadProvider.tsx +2 -2
- package/src/react/providers/TextMessagePartProvider.tsx +3 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.layout.test.tsx +62 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.retry.test.tsx +2 -2
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.running.test.tsx +93 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +181 -21
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +62 -17
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +112 -77
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +19 -3
- package/src/react/runtimes/RemoteThreadResource.ts +5 -2
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.test.ts +3 -1
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.ts +10 -2
- package/src/react/runtimes/assistant-transport/runManager.ts +3 -0
- package/src/react/runtimes/assistant-transport/transport-parentid.test.tsx +57 -0
- package/src/react/runtimes/assistant-transport/transport-scheduling.test.ts +73 -46
- package/src/react/runtimes/assistant-transport/transport-thread-id.test.tsx +571 -0
- package/src/react/runtimes/assistant-transport/types.ts +9 -1
- package/src/react/runtimes/assistant-transport/useAssistantTransport.spec.md +10 -0
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.test.tsx +108 -1
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.ts +33 -9
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.integration.test.tsx +289 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.test.tsx +471 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.engagement.test.tsx +330 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +78 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +463 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +595 -227
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +33 -4
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +7 -3
- package/src/react/runtimes/cloud/auiV0.ts +275 -6
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +873 -0
- package/src/react/runtimes/createMessageConverter.ts +9 -3
- package/src/react/runtimes/external-message-converter.test.ts +7 -3
- package/src/react/runtimes/external-store-history-copy.ts +223 -0
- package/src/react/runtimes/remote-thread-hook-on-tap.test.ts +2 -1
- package/src/react/runtimes/useExternalStoreRuntime.history-copy.test.tsx +483 -0
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +84 -3
- package/src/react/runtimes/useExternalStoreRuntime.suggestions.test.tsx +6 -2
- package/src/react/runtimes/useExternalStoreRuntime.ts +25 -5
- package/src/react/runtimes/useLocalRuntime.test.tsx +145 -1
- package/src/react/runtimes/useLocalRuntime.ts +8 -5
- package/src/react/runtimes/useRemoteThreadListRuntime.concurrent.test.tsx +84 -4
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +5 -1
- package/src/react/types/MessagePartComponentTypes.ts +10 -0
- package/src/react/types/scopes/interactables.ts +3 -0
- package/src/runtime/api/attachment-runtime.ts +10 -5
- package/src/runtime/api/bindings.ts +6 -1
- package/src/runtime/api/composer-runtime.ts +29 -6
- package/src/runtime/api/message-part-runtime.test.ts +215 -0
- package/src/runtime/api/message-part-runtime.ts +44 -1
- package/src/runtime/api/message-runtime.test.ts +112 -2
- package/src/runtime/api/message-runtime.ts +25 -7
- package/src/runtime/api/thread-list-item-runtime.ts +5 -5
- package/src/runtime/api/thread-list-runtime.ts +3 -3
- package/src/runtime/api/thread-runtime.test.ts +59 -0
- package/src/runtime/api/thread-runtime.ts +21 -11
- package/src/runtime/base/base-composer-runtime-core.ts +548 -153
- package/src/runtime/base/base-thread-runtime-core.test.ts +1614 -136
- package/src/runtime/base/base-thread-runtime-core.ts +236 -46
- package/src/runtime/base/default-edit-composer-runtime-core.ts +24 -2
- package/src/runtime/base/default-thread-composer-runtime-core.ts +33 -3
- package/src/runtime/interfaces/composer-runtime-core.ts +19 -0
- package/src/runtime/interfaces/thread-runtime-core.ts +24 -1
- package/src/runtime/queue/message-queue.ts +11 -1
- package/src/runtime/utils/attachment-add-operations.ts +45 -2
- package/src/runtime/utils/attachment-send-operations.ts +54 -0
- package/src/runtime/utils/auto-status.test.ts +54 -0
- package/src/runtime/utils/auto-status.ts +3 -10
- package/src/runtime/utils/external-message-conversion.test.ts +91 -0
- package/src/runtime/utils/external-message-conversion.ts +9 -6
- package/src/runtime/utils/message-repository.test.ts +69 -1
- package/src/runtime/utils/message-repository.ts +14 -7
- package/src/runtime/utils/stored-message-parts.ts +216 -0
- package/src/runtime/utils/thread-message-like.test.ts +58 -0
- package/src/runtime/utils/thread-message-like.ts +79 -48
- package/src/runtime/utils/thread-runtime-lifecycle.test.ts +67 -0
- package/src/runtime/utils/thread-runtime-lifecycle.ts +42 -8
- package/src/runtime/utils/tool-interactions.test.ts +193 -0
- package/src/runtime/utils/tool-interactions.ts +147 -0
- package/src/runtimes/external-store/external-store-adapter.ts +25 -0
- package/src/runtimes/external-store/external-store-runtime-core.ts +10 -2
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +2 -2
- package/src/runtimes/external-store/external-store-thread-runtime-core.test.ts +49 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +114 -32
- package/src/runtimes/inert/InertThreadRuntimeCore.test.ts +127 -56
- package/src/runtimes/inert/InertThreadRuntimeCore.ts +10 -1
- package/src/runtimes/local/local-thread-runtime-core.edit-cancellation.test.ts +70 -0
- package/src/runtimes/local/local-thread-runtime-core.test.ts +1866 -169
- package/src/runtimes/local/local-thread-runtime-core.ts +365 -40
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +53 -1
- package/src/runtimes/remote-thread-list/optimistic-state.ts +8 -3
- package/src/runtimes/tool-invocations/EDGE_CASES.md +19 -4
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +392 -39
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +31 -8
- package/src/store/clients/external-thread.test.ts +145 -0
- package/src/store/clients/external-thread.ts +669 -144
- package/src/store/clients/model-context-client.test.ts +8 -8
- package/src/store/clients/no-op-composer-client.ts +2 -0
- package/src/store/clients/submission-message.ts +27 -0
- package/src/store/clients/thread-message-client.test.ts +39 -0
- package/src/store/clients/thread-message-client.ts +13 -6
- package/src/store/index.ts +2 -2
- package/src/store/internal.ts +1 -0
- package/src/store/primitive-predicates.test.ts +119 -0
- package/src/store/primitive-predicates.ts +19 -4
- package/src/store/runtime-clients/composer-runtime-client.ts +4 -3
- package/src/store/runtime-clients/message-part-runtime-client.test.ts +42 -0
- package/src/store/runtime-clients/message-part-runtime-client.ts +4 -0
- package/src/store/runtime-clients/message-runtime-client.ts +5 -0
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +243 -0
- package/src/store/runtime-clients/thread-runtime-client.ts +46 -9
- package/src/store/scopes/composer.ts +22 -4
- package/src/store/scopes/message.ts +12 -1
- package/src/store/scopes/part.ts +8 -0
- package/src/subscribable/subscribable.test.ts +205 -3
- package/src/subscribable/subscribable.ts +49 -7
- package/src/tests/RemoteThreadListThreadListRuntimeCore-errors.test.ts +95 -1
- package/src/tests/attachment-adapters.test.ts +16 -1
- package/src/tests/auiV0Encode.test.ts +412 -1
- package/src/tests/base-composer-runtime-core-addAttachment.test.ts +6 -6
- package/src/tests/base-composer-runtime-core-send.test.ts +722 -29
- package/src/tests/base-composer-runtime-core.test.ts +212 -5
- package/src/tests/composer-can-cancel.test.ts +35 -6
- package/src/tests/composer-can-send.test.ts +120 -1
- package/src/tests/composer-submission.test.tsx +796 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +149 -2
- package/src/tests/external-store-thread-list-runtime-core.test.ts +111 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +810 -28
- package/src/tests/external-store-thread-runtime-core.test.ts +217 -0
- package/src/tests/external-thread-attachments.test.tsx +763 -26
- package/src/tests/external-thread-feedback.test.tsx +20 -7
- package/src/tests/external-thread-isLast.test.tsx +69 -0
- package/src/tests/external-thread-parity.test.tsx +1 -1
- package/src/tests/get-thread-state-isRunning.test.ts +2 -2
- package/src/tests/message-queue.test.ts +45 -10
- package/src/tests/remote-thread-list-adapter-switch.test.ts +45 -1
- package/src/tests/thread-switch-events.test.tsx +11 -7
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +2 -1
- package/src/types/message.test.ts +19 -0
- package/src/types/message.ts +65 -10
- package/src/utils/normalizePartStatus.ts +14 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -16
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +0 -1
- package/dist/tests/remote-thread-list-test-helpers.js +0 -59
- package/dist/tests/remote-thread-list-test-helpers.js.map +0 -1
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region src/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts
|
|
1
|
+
import { type ComponentType, type FC, type PropsWithChildren, type ReactNode } from "react";
|
|
2
|
+
import type { PartState } from "../../../store/scopes/part.js";
|
|
3
|
+
import type { ReasoningMessagePartComponent, ToolCallMessagePartComponent } from "../../types/MessagePartComponentTypes.js";
|
|
5
4
|
type ChainOfThoughtPartsComponentConfig = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
/** Component for rendering reasoning parts */
|
|
6
|
+
Reasoning?: ReasoningMessagePartComponent | undefined;
|
|
7
|
+
/** Fallback component for tool-call parts */
|
|
8
|
+
tools?: {
|
|
9
|
+
Fallback?: ToolCallMessagePartComponent | undefined;
|
|
10
|
+
};
|
|
11
|
+
/** Layout component to wrap the rendered parts when expanded */
|
|
12
|
+
Layout?: ComponentType<PropsWithChildren> | undefined;
|
|
14
13
|
};
|
|
15
|
-
declare namespace ChainOfThoughtPrimitiveParts {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
export declare namespace ChainOfThoughtPrimitiveParts {
|
|
15
|
+
type Props = {
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use the children render function instead.
|
|
18
|
+
*/
|
|
19
|
+
components?: ChainOfThoughtPartsComponentConfig;
|
|
20
|
+
children?: never;
|
|
21
|
+
} | {
|
|
22
|
+
/** Render function called for each part. Receives the part. */
|
|
23
|
+
children: (value: {
|
|
24
|
+
part: PartState;
|
|
25
|
+
}) => ReactNode;
|
|
26
|
+
components?: never;
|
|
27
|
+
};
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Renders the parts within a chain of thought, with support for collapsed/expanded states.
|
|
@@ -33,7 +32,6 @@ declare namespace ChainOfThoughtPrimitiveParts {
|
|
|
33
32
|
* When collapsed, no parts are shown. When expanded, all parts are rendered
|
|
34
33
|
* using the provided component configuration through the part scope mechanism.
|
|
35
34
|
*/
|
|
36
|
-
declare const ChainOfThoughtPrimitiveParts: FC<ChainOfThoughtPrimitiveParts.Props>;
|
|
37
|
-
|
|
38
|
-
export { ChainOfThoughtPrimitiveParts };
|
|
35
|
+
export declare const ChainOfThoughtPrimitiveParts: FC<ChainOfThoughtPrimitiveParts.Props>;
|
|
36
|
+
export {};
|
|
39
37
|
//# sourceMappingURL=ChainOfThoughtParts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainOfThoughtParts.d.ts","
|
|
1
|
+
{"version":3,"file":"ChainOfThoughtParts.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,sCAAmC;AAG5D,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,iDAA8C;AAE/C,KAAK,kCAAkC,GAAG;IACxC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IACtD,6CAA6C;IAC7C,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAC;KACrD,CAAC;IACF,gEAAgE;IAChE,MAAM,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;CACvD,CAAC;AAEF,yBAAiB,4BAA4B,CAAC;IAC5C,KAAY,KAAK,GACb;QACE;;WAEG;QACH,UAAU,CAAC,EAAE,kCAAkC,CAAC;QAChD,QAAQ,CAAC,EAAE,KAAK,CAAC;KAClB,GACD;QACE,+DAA+D;QAC/D,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,KAAK,SAAS,CAAC;QACpD,UAAU,CAAC,EAAE,KAAK,CAAC;KACpB,CAAC;CACP;AA4BD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,4BAA4B,CAAC,KAAK,CAoCnC,CAAC"}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { Attachment } from "../../../types/attachment.js";
|
|
2
|
-
import { ComponentType, FC, ReactNode } from "react";
|
|
3
|
-
//#region src/react/primitives/composer/ComposerAttachments.d.ts
|
|
1
|
+
import type { Attachment } from "../../../types/attachment.js";
|
|
2
|
+
import { type ComponentType, type FC, type ReactNode } from "react";
|
|
4
3
|
type ComposerAttachmentsComponentConfig = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Image?: ComponentType | undefined;
|
|
5
|
+
Document?: ComponentType | undefined;
|
|
6
|
+
File?: ComponentType | undefined;
|
|
7
|
+
Attachment?: ComponentType | undefined;
|
|
9
8
|
};
|
|
10
|
-
declare namespace ComposerPrimitiveAttachments {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
export declare namespace ComposerPrimitiveAttachments {
|
|
10
|
+
type Props = {
|
|
11
|
+
/** @deprecated Use the children render function instead. */
|
|
12
|
+
components: ComposerAttachmentsComponentConfig;
|
|
13
|
+
children?: never;
|
|
14
|
+
} | {
|
|
15
|
+
/** Render function called for each attachment. Receives the attachment. */
|
|
16
|
+
children: (value: {
|
|
17
|
+
attachment: Attachment;
|
|
18
|
+
}) => ReactNode;
|
|
19
|
+
components?: never;
|
|
20
|
+
};
|
|
22
21
|
}
|
|
23
|
-
declare namespace ComposerPrimitiveAttachmentByIndex {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
export declare namespace ComposerPrimitiveAttachmentByIndex {
|
|
23
|
+
type Props = {
|
|
24
|
+
index: number;
|
|
25
|
+
components?: ComposerAttachmentsComponentConfig;
|
|
26
|
+
};
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Renders a single attachment at the specified index within the composer.
|
|
31
30
|
*/
|
|
32
|
-
declare const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props>;
|
|
33
|
-
declare const ComposerPrimitiveAttachments: FC<ComposerPrimitiveAttachments.Props>;
|
|
34
|
-
|
|
35
|
-
export { ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments };
|
|
31
|
+
export declare const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props>;
|
|
32
|
+
export declare const ComposerPrimitiveAttachments: FC<ComposerPrimitiveAttachments.Props>;
|
|
33
|
+
export {};
|
|
36
34
|
//# sourceMappingURL=ComposerAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerAttachments.d.ts","
|
|
1
|
+
{"version":3,"file":"ComposerAttachments.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,qCAAkC;AAC5D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAKf,KAAK,kCAAkC,GAAG;IACxC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACrC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,yBAAiB,4BAA4B,CAAC;IAC5C,KAAY,KAAK,GACb;QACE,4DAA4D;QAC5D,UAAU,EAAE,kCAAkC,CAAC;QAC/C,QAAQ,CAAC,EAAE,KAAK,CAAC;KAClB,GACD;QACE,2EAA2E;QAC3E,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,UAAU,EAAE,UAAU,CAAA;SAAE,KAAK,SAAS,CAAC;QAC3D,UAAU,CAAC,EAAE,KAAK,CAAC;KACpB,CAAC;CACP;AA8BD,yBAAiB,kCAAkC,CAAC;IAClD,KAAY,KAAK,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,kCAAkC,CAAC;KACjD,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,EAAE,CAAC,kCAAkC,CAAC,KAAK,CAezF,CAAC;AAqCJ,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,4BAA4B,CAAC,KAAK,CAkBnC,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from "react";
|
|
2
|
-
//#region src/react/primitives/composer/ComposerIf.d.ts
|
|
1
|
+
import type { FC, PropsWithChildren } from "react";
|
|
3
2
|
type ComposerIfFilters = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/** Whether the composer is in editing mode */
|
|
4
|
+
editing: boolean | undefined;
|
|
5
|
+
/** Whether dictation is currently active */
|
|
6
|
+
dictation: boolean | undefined;
|
|
8
7
|
};
|
|
9
|
-
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
9
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
10
|
+
}[Keys];
|
|
11
|
+
export type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;
|
|
12
|
+
export declare namespace ComposerPrimitiveIf {
|
|
13
|
+
type Props = PropsWithChildren<UseComposerIfProps>;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.
|
|
16
17
|
*/
|
|
17
|
-
declare const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props>;
|
|
18
|
-
|
|
19
|
-
export { ComposerPrimitiveIf, RequireAtLeastOne, UseComposerIfProps };
|
|
18
|
+
export declare const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props>;
|
|
19
|
+
export {};
|
|
20
20
|
//# sourceMappingURL=ComposerIf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerIf.d.ts","
|
|
1
|
+
{"version":3,"file":"ComposerIf.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerIf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,KAAK,iBAAiB,GAAG;IACvB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,4CAA4C;IAC5C,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,IAAI,CACrE,CAAC,EACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CACvB,GACC;KACG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;CACzE,CAAC,IAAI,CAAC,CAAC;AAEV,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAetE,yBAAiB,mBAAmB,CAAC;IACnC,KAAY,KAAK,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CAC3D;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAM7D,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../store/scopes/queue-item.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}) => ReactNode;
|
|
11
|
-
};
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { QueueItemState } from "../../../store/scopes/queue-item.js";
|
|
3
|
+
export declare namespace ComposerPrimitiveQueue {
|
|
4
|
+
type Props = {
|
|
5
|
+
/** Render function called for each queue item. Receives the queue item state. */
|
|
6
|
+
children: (value: {
|
|
7
|
+
queueItem: QueueItemState;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
};
|
|
12
10
|
}
|
|
13
11
|
/**
|
|
14
12
|
* Renders all queue items in the composer.
|
|
@@ -25,11 +23,9 @@ declare namespace ComposerPrimitiveQueue {
|
|
|
25
23
|
* </ComposerPrimitive.Queue>
|
|
26
24
|
* ```
|
|
27
25
|
*/
|
|
28
|
-
declare const ComposerPrimitiveQueue: import("react").NamedExoticComponent<{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
export declare const ComposerPrimitiveQueue: import("react").NamedExoticComponent<{
|
|
27
|
+
children: (value: {
|
|
28
|
+
queueItem: QueueItemState;
|
|
29
|
+
}) => ReactNode;
|
|
32
30
|
}>;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { ComposerPrimitiveQueue };
|
|
35
31
|
//# sourceMappingURL=ComposerQueue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerQueue.d.ts","
|
|
1
|
+
{"version":3,"file":"ComposerQueue.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/composer/ComposerQueue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,4CAAyC;AAGvE,yBAAiB,sBAAsB,CAAC;IACtC,KAAY,KAAK,GAAG;QAClB,iFAAiF;QACjF,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,SAAS,EAAE,cAAc,CAAA;SAAE,KAAK,SAAS,CAAC;KAC/D,CAAC;CACH;AA8BD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB;cA1CvB,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,cAAc,CAAA;KAAE,KAAK,SAAS;EA0CQ,CAAC"}
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region src/react/primitives/generativeUI/GenerativeUI.d.ts
|
|
1
|
+
import { type ComponentType, type FC } from "react";
|
|
2
|
+
import type { GenerativeUISpec } from "../../../types/message.js";
|
|
3
|
+
import type { GenerativeUIComponentRegistry, GenerativeUIRenderProps } from "../../types/MessagePartComponentTypes.js";
|
|
5
4
|
/**
|
|
6
5
|
* Thrown when a generative-ui spec references a component name that is not
|
|
7
6
|
* present in the consumer-provided allowlist. The allowlist is the security
|
|
8
7
|
* boundary in the same-realm rendering path — there is no fallback by
|
|
9
8
|
* default. Pass `Fallback` to opt into a soft-fail UX.
|
|
10
9
|
*/
|
|
11
|
-
declare class GenerativeUIRenderError extends Error {
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export declare class GenerativeUIRenderError extends Error {
|
|
11
|
+
readonly componentName: string;
|
|
12
|
+
constructor(componentName: string, message?: string);
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* Internal renderer. Resolves a {@link GenerativeUISpec} against the consumer
|
|
17
16
|
* allowlist. Used by `MessagePrimitive.GenerativeUI` and by
|
|
18
17
|
* `MessagePrimitive.Parts` when handling a `generative-ui` part.
|
|
19
18
|
*/
|
|
20
|
-
declare const GenerativeUIRender: FC<GenerativeUIRenderProps>;
|
|
21
|
-
declare namespace MessagePrimitiveGenerativeUI {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
export declare const GenerativeUIRender: FC<GenerativeUIRenderProps>;
|
|
20
|
+
export declare namespace MessagePrimitiveGenerativeUI {
|
|
21
|
+
type Props = {
|
|
22
|
+
/**
|
|
23
|
+
* The component allowlist. Keys are the names referenced in the spec
|
|
24
|
+
* (e.g. `"Card"`, `"Button"`), values are the React components.
|
|
25
|
+
*
|
|
26
|
+
* This is the security boundary — any name not in the allowlist is
|
|
27
|
+
* rejected with {@link GenerativeUIRenderError}.
|
|
28
|
+
*/
|
|
29
|
+
components: GenerativeUIComponentRegistry;
|
|
30
|
+
/**
|
|
31
|
+
* Optional override spec. If omitted, the primitive reads the
|
|
32
|
+
* `generative-ui` part from the surrounding `MessagePartProvider` /
|
|
33
|
+
* `PartByIndexProvider` context.
|
|
34
|
+
*/
|
|
35
|
+
spec?: GenerativeUISpec | undefined;
|
|
36
|
+
/** Optional fallback for unknown component names. */
|
|
37
|
+
Fallback?: ComponentType<{
|
|
38
|
+
component: string;
|
|
39
|
+
props?: unknown;
|
|
40
|
+
}> | undefined;
|
|
41
|
+
};
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
44
|
* Renders a generative-ui message part using a consumer-provided allowlist.
|
|
@@ -58,7 +57,5 @@ declare namespace MessagePrimitiveGenerativeUI {
|
|
|
58
57
|
* />
|
|
59
58
|
* ```
|
|
60
59
|
*/
|
|
61
|
-
declare const MessagePrimitiveGenerativeUI: FC<MessagePrimitiveGenerativeUI.Props>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { GenerativeUIRender, GenerativeUIRenderError, MessagePrimitiveGenerativeUI };
|
|
60
|
+
export declare const MessagePrimitiveGenerativeUI: FC<MessagePrimitiveGenerativeUI.Props>;
|
|
64
61
|
//# sourceMappingURL=GenerativeUI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerativeUI.d.ts","
|
|
1
|
+
{"version":3,"file":"GenerativeUI.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/generativeUI/GenerativeUI.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EAIR,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAEV,gBAAgB,EACjB,kCAA+B;AAChC,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACxB,iDAA8C;AAE/C;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,SAAgB,aAAa,EAAE,MAAM,CAAC;gBAGpC,aAAa,EAAE,MAAM,EACrB,OAAO,SAAwE;CAMlF;AA+ED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAY1D,CAAC;AAIF,yBAAiB,4BAA4B,CAAC;IAC5C,KAAY,KAAK,GAAG;QAClB;;;;;;WAMG;QACH,UAAU,EAAE,6BAA6B,CAAC;QAC1C;;;;WAIG;QACH,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;QACpC,qDAAqD;QACrD,QAAQ,CAAC,EACL,aAAa,CAAC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC,GACrD,SAAS,CAAC;KACf,CAAC;CACH;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,4BAA4B,CAAC,KAAK,CAqBnC,CAAC"}
|
|
@@ -18,16 +18,30 @@ var GenerativeUIRenderError = class extends Error {
|
|
|
18
18
|
this.componentName = componentName;
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
const isObjectNode = (node) => typeof node === "object" && node !== null;
|
|
22
|
-
const
|
|
21
|
+
const isObjectNode = (node) => typeof node === "object" && node !== null && !Array.isArray(node);
|
|
22
|
+
const toNodeList = (value) => {
|
|
23
|
+
if (value === void 0 || value === null) return [];
|
|
24
|
+
return Array.isArray(value) ? value : [value];
|
|
25
|
+
};
|
|
26
|
+
const warn = (message, ...args) => {
|
|
27
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV !== "production") console.warn(message, ...args);
|
|
28
|
+
};
|
|
29
|
+
/** Bounds recursion so a runaway or adversarial model response cannot overflow the stack. */
|
|
30
|
+
const MAX_DEPTH = 64;
|
|
31
|
+
const renderNode = (node, components, Fallback, path, depth = 0) => {
|
|
32
|
+
if (depth > MAX_DEPTH) {
|
|
33
|
+
warn(`[generative-ui] Skipping node nested past ${MAX_DEPTH} levels at ${path}.`);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
23
36
|
if (node === void 0 || node === null) return null;
|
|
24
|
-
if (typeof node === "string") return node;
|
|
37
|
+
if (typeof node === "string" || typeof node === "number") return node;
|
|
38
|
+
if (Array.isArray(node)) return node.map((child, i) => renderNode(child, components, Fallback, `${path}/${i}`, depth + 1));
|
|
25
39
|
if (!isObjectNode(node) || !("component" in node) || typeof node.component !== "string") {
|
|
26
|
-
|
|
40
|
+
warn(`[generative-ui] Skipping malformed node at ${path}:`, node);
|
|
27
41
|
return null;
|
|
28
42
|
}
|
|
29
43
|
const { component, props, children, key } = node;
|
|
30
|
-
const Resolved = components[component];
|
|
44
|
+
const Resolved = Object.hasOwn(components, component) ? components[component] : void 0;
|
|
31
45
|
if (!Resolved) {
|
|
32
46
|
if (Fallback) return /* @__PURE__ */ jsx(Fallback, {
|
|
33
47
|
component,
|
|
@@ -35,16 +49,10 @@ const renderNode = (node, components, Fallback, path) => {
|
|
|
35
49
|
}, key ?? path);
|
|
36
50
|
throw new GenerativeUIRenderError(component);
|
|
37
51
|
}
|
|
38
|
-
const renderedChildren = children?.length ? children.map((child, i) => renderNode(child, components, Fallback, `${path}/${i}`)) : void 0;
|
|
39
52
|
return createElement(Resolved, {
|
|
40
53
|
...props ?? {},
|
|
41
54
|
key: key ?? path
|
|
42
|
-
}, ...
|
|
43
|
-
};
|
|
44
|
-
const normalizeRoot = (spec) => {
|
|
45
|
-
if (!spec || spec.root === void 0 || spec.root === null) return [];
|
|
46
|
-
const root = spec.root;
|
|
47
|
-
return Array.isArray(root) ? root : [root];
|
|
55
|
+
}, ...toNodeList(children).map((child, i) => renderNode(child, components, Fallback, `${path}/${i}`, depth + 1)));
|
|
48
56
|
};
|
|
49
57
|
/**
|
|
50
58
|
* Internal renderer. Resolves a {@link GenerativeUISpec} against the consumer
|
|
@@ -54,35 +62,36 @@ const normalizeRoot = (spec) => {
|
|
|
54
62
|
const GenerativeUIRender = (t0) => {
|
|
55
63
|
const $ = c(11);
|
|
56
64
|
const { spec, components, Fallback } = t0;
|
|
57
|
-
|
|
58
|
-
if ($[0] !== spec) {
|
|
59
|
-
t1 = normalizeRoot(spec);
|
|
60
|
-
$[0] = spec;
|
|
61
|
-
$[1] = t1;
|
|
62
|
-
} else t1 = $[1];
|
|
63
|
-
const nodes = t1;
|
|
65
|
+
const t1 = spec?.root;
|
|
64
66
|
let t2;
|
|
67
|
+
if ($[0] !== t1) {
|
|
68
|
+
t2 = toNodeList(t1);
|
|
69
|
+
$[0] = t1;
|
|
70
|
+
$[1] = t2;
|
|
71
|
+
} else t2 = $[1];
|
|
72
|
+
const nodes = t2;
|
|
73
|
+
let t3;
|
|
65
74
|
if ($[2] !== Fallback || $[3] !== components || $[4] !== nodes) {
|
|
66
|
-
let
|
|
75
|
+
let t4;
|
|
67
76
|
if ($[6] !== Fallback || $[7] !== components) {
|
|
68
|
-
|
|
77
|
+
t4 = (node, i) => renderNode(node, components, Fallback, `${i}`);
|
|
69
78
|
$[6] = Fallback;
|
|
70
79
|
$[7] = components;
|
|
71
|
-
$[8] =
|
|
72
|
-
} else
|
|
73
|
-
|
|
80
|
+
$[8] = t4;
|
|
81
|
+
} else t4 = $[8];
|
|
82
|
+
t3 = nodes.map(t4);
|
|
74
83
|
$[2] = Fallback;
|
|
75
84
|
$[3] = components;
|
|
76
85
|
$[4] = nodes;
|
|
77
|
-
$[5] =
|
|
78
|
-
} else
|
|
79
|
-
let
|
|
80
|
-
if ($[9] !==
|
|
81
|
-
|
|
82
|
-
$[9] =
|
|
83
|
-
$[10] =
|
|
84
|
-
} else
|
|
85
|
-
return
|
|
86
|
+
$[5] = t3;
|
|
87
|
+
} else t3 = $[5];
|
|
88
|
+
let t4;
|
|
89
|
+
if ($[9] !== t3) {
|
|
90
|
+
t4 = /* @__PURE__ */ jsx(Fragment$1, { children: t3 });
|
|
91
|
+
$[9] = t3;
|
|
92
|
+
$[10] = t4;
|
|
93
|
+
} else t4 = $[10];
|
|
94
|
+
return t4;
|
|
86
95
|
};
|
|
87
96
|
GenerativeUIRender.displayName = "GenerativeUIRender";
|
|
88
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerativeUI.js","names":["c","_c","ComponentType","FC","ReactNode","createElement","useMemo","useAuiState","GenerativeUINode","GenerativeUISpec","GenerativeUIComponentRegistry","GenerativeUIRenderProps","GenerativeUIRenderError","Error","componentName","constructor","message","name","isObjectNode","node","
|
|
1
|
+
{"version":3,"file":"GenerativeUI.js","names":["c","_c","ComponentType","FC","ReactNode","createElement","useMemo","useAuiState","GenerativeUINode","GenerativeUISpec","GenerativeUIComponentRegistry","GenerativeUIRenderProps","GenerativeUIRenderError","Error","componentName","constructor","message","name","isObjectNode","node","Extract","component","Array","isArray","toNodeList","value","undefined","warn","args","process","env","NODE_ENV","console","MAX_DEPTH","renderNode","components","Fallback","path","depth","map","child","i","props","children","key","Resolved","Object","hasOwn","GenerativeUIRender","t0","$","spec","t1","root","t2","nodes","t3","t4","displayName","MessagePrimitiveGenerativeUI","Props","storeSpec","_temp","partSpec","s","part","type"],"sources":["../../../../src/react/primitives/generativeUI/GenerativeUI.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentType,\n type FC,\n type ReactNode,\n createElement,\n useMemo,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type {\n GenerativeUINode,\n GenerativeUISpec,\n} from \"../../../types/message\";\nimport type {\n GenerativeUIComponentRegistry,\n GenerativeUIRenderProps,\n} from \"../../types/MessagePartComponentTypes\";\n\n/**\n * Thrown when a generative-ui spec references a component name that is not\n * present in the consumer-provided allowlist. The allowlist is the security\n * boundary in the same-realm rendering path — there is no fallback by\n * default. Pass `Fallback` to opt into a soft-fail UX.\n */\nexport class GenerativeUIRenderError extends Error {\n public readonly componentName: string;\n\n constructor(\n componentName: string,\n message = `Component \"${componentName}\" is not in the generative-ui allowlist.`,\n ) {\n super(message);\n this.name = \"GenerativeUIRenderError\";\n this.componentName = componentName;\n }\n}\n\nconst isObjectNode = (\n node: GenerativeUINode,\n): node is Extract<GenerativeUINode, { component: string }> =>\n typeof node === \"object\" && node !== null && !Array.isArray(node);\n\nconst toNodeList = (\n value: GenerativeUINode | null | undefined,\n): readonly GenerativeUINode[] => {\n if (value === undefined || value === null) return [];\n return Array.isArray(value) ? value : [value];\n};\n\nconst warn = (message: string, ...args: unknown[]) => {\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.warn(message, ...args);\n }\n};\n\n/** Bounds recursion so a runaway or adversarial model response cannot overflow the stack. */\nconst MAX_DEPTH = 64;\n\nconst renderNode = (\n node: GenerativeUINode | undefined,\n components: GenerativeUIComponentRegistry,\n Fallback: GenerativeUIRenderProps[\"Fallback\"],\n path: string,\n depth = 0,\n): ReactNode => {\n if (depth > MAX_DEPTH) {\n warn(\n `[generative-ui] Skipping node nested past ${MAX_DEPTH} levels at ${path}.`,\n );\n return null;\n }\n if (node === undefined || node === null) return null;\n\n if (typeof node === \"string\" || typeof node === \"number\") return node;\n\n if (Array.isArray(node)) {\n return node.map((child, i) =>\n renderNode(child, components, Fallback, `${path}/${i}`, depth + 1),\n );\n }\n\n if (\n !isObjectNode(node) ||\n !(\"component\" in node) ||\n typeof node.component !== \"string\"\n ) {\n warn(`[generative-ui] Skipping malformed node at ${path}:`, node);\n return null;\n }\n\n const { component, props, children, key } = node;\n\n const Resolved = Object.hasOwn(components, component)\n ? components[component]\n : undefined;\n if (!Resolved) {\n if (Fallback) {\n return <Fallback key={key ?? path} component={component} props={props} />;\n }\n throw new GenerativeUIRenderError(component);\n }\n\n return createElement(\n Resolved,\n { ...(props ?? {}), key: key ?? path },\n ...toNodeList(children).map((child, i) =>\n renderNode(child, components, Fallback, `${path}/${i}`, depth + 1),\n ),\n );\n};\n\n/**\n * Internal renderer. Resolves a {@link GenerativeUISpec} against the consumer\n * allowlist. Used by `MessagePrimitive.GenerativeUI` and by\n * `MessagePrimitive.Parts` when handling a `generative-ui` part.\n */\nexport const GenerativeUIRender: FC<GenerativeUIRenderProps> = ({\n spec,\n components,\n Fallback,\n}) => {\n const nodes = useMemo(() => toNodeList(spec?.root), [spec]);\n\n return (\n <>\n {nodes.map((node, i) => renderNode(node, components, Fallback, `${i}`))}\n </>\n );\n};\n\nGenerativeUIRender.displayName = \"GenerativeUIRender\";\n\nexport namespace MessagePrimitiveGenerativeUI {\n export type Props = {\n /**\n * The component allowlist. Keys are the names referenced in the spec\n * (e.g. `\"Card\"`, `\"Button\"`), values are the React components.\n *\n * This is the security boundary — any name not in the allowlist is\n * rejected with {@link GenerativeUIRenderError}.\n */\n components: GenerativeUIComponentRegistry;\n /**\n * Optional override spec. If omitted, the primitive reads the\n * `generative-ui` part from the surrounding `MessagePartProvider` /\n * `PartByIndexProvider` context.\n */\n spec?: GenerativeUISpec | undefined;\n /** Optional fallback for unknown component names. */\n Fallback?:\n | ComponentType<{ component: string; props?: unknown }>\n | undefined;\n };\n}\n\n/**\n * Renders a generative-ui message part using a consumer-provided allowlist.\n *\n * The agent emits a `generative-ui` message part containing a JSON spec\n * (see {@link GenerativeUISpec}). This primitive walks the spec and resolves\n * each `component` name against the allowlist. Names not in the allowlist\n * throw {@link GenerativeUIRenderError} unless a `Fallback` is provided.\n *\n * Stream-friendly: a partial spec renders progressively as it is filled in.\n *\n * @example\n * ```tsx\n * <MessagePrimitive.GenerativeUI\n * components={{ Card: MyCard, Button: MyButton }}\n * />\n * ```\n */\nexport const MessagePrimitiveGenerativeUI: FC<\n MessagePrimitiveGenerativeUI.Props\n> = ({ components, spec, Fallback }) => {\n // Selector reads store state only — combining with the `spec` prop inside\n // the selector closes over a value that may change identity per render and\n // would trigger spurious tearing-detection re-renders in\n // `useSyncExternalStore`.\n const storeSpec = useAuiState((s) => {\n const part = s.part as { type?: string; spec?: GenerativeUISpec };\n return part?.type === \"generative-ui\" ? part.spec : undefined;\n });\n const partSpec = spec ?? storeSpec;\n\n if (!partSpec) return null;\n\n return (\n <GenerativeUIRender\n spec={partSpec}\n components={components}\n Fallback={Fallback}\n />\n );\n};\n\nMessagePrimitiveGenerativeUI.displayName = \"MessagePrimitive.GenerativeUI\";\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAaY,0BAAb,cAA6CC,MAAM;CACjD;CAEAE,YACED,eACAE,UAAU,cAAcF,cAAa,2CACrC;EACA,MAAME,OAAO;EACb,KAAKC,OAAO;EACZ,KAAKH,gBAAgBA;CACvB;AACF;AAEA,MAAMI,gBACJC,SAEA,OAAOA,SAAS,YAAYA,SAAS,QAAQ,CAACG,MAAMC,QAAQJ,IAAI;AAElE,MAAMK,cACJC,UACgC;CAChC,IAAIA,UAAUC,KAAAA,KAAaD,UAAU,MAAM,OAAO,CAAA;CAClD,OAAOH,MAAMC,QAAQE,KAAK,IAAIA,QAAQ,CAACA,KAAK;AAC9C;AAEA,MAAME,QAAQX,SAAiB,GAAGY,SAAoB;CACpD,IACE,OAAOC,YAAY,eACnBA,QAAQC,KAAKC,aAAa,cAE1BC,QAAQL,KAAKX,SAAS,GAAGY,IAAI;AAEjC;;AAGA,MAAMK,YAAY;AAElB,MAAMC,cACJf,MACAgB,YACAC,UACAC,MACAC,QAAQ,MACM;CACd,IAAIA,QAAQL,WAAW;EACrBN,KACE,6CAA6CM,UAAS,aAAcI,KAAI,EAC1E;EACA,OAAO;CACT;CACA,IAAIlB,SAASO,KAAAA,KAAaP,SAAS,MAAM,OAAO;CAEhD,IAAI,OAAOA,SAAS,YAAY,OAAOA,SAAS,UAAU,OAAOA;CAEjE,IAAIG,MAAMC,QAAQJ,IAAI,GACpB,OAAOA,KAAKoB,KAAKC,OAAOC,MACtBP,WAAWM,OAAOL,YAAYC,UAAU,GAAGC,KAAI,GAAII,KAAKH,QAAQ,CAAC,CACnE;CAGF,IACE,CAACpB,aAAaC,IAAI,KAClB,EAAE,eAAeA,SACjB,OAAOA,KAAKE,cAAc,UAC1B;EACAM,KAAK,8CAA8CU,KAAI,IAAKlB,IAAI;EAChE,OAAO;CACT;CAEA,MAAM,EAAEE,WAAWqB,OAAOC,UAAUC,QAAQzB;CAE5C,MAAM0B,WAAWC,OAAOC,OAAOZ,YAAYd,SAAS,IAChDc,WAAWd,aACXK,KAAAA;CACJ,IAAI,CAACmB,UAAU;EACb,IAAIT,UACF,OAAO,oBAAC,UAAD;GAAuCf;GAAkBqB;EAAM,GAAhDE,OAAOP,IAAyC;EAExE,MAAM,IAAIzB,wBAAwBS,SAAS;CAC7C;CAEA,OAAOhB,cACLwC,UACA;EAAE,GAAIH,SAAS,CAAC;EAAIE,KAAKA,OAAOP;CAAK,GACrC,GAAGb,WAAWmB,QAAQ,CAAC,CAACJ,KAAKC,OAAOC,MAClCP,WAAWM,OAAOL,YAAYC,UAAU,GAAGC,KAAI,GAAII,KAAKH,QAAQ,CAAC,CACnE,CACF;AACF;;;;;;AAOA,MAAaU,sBAAkDC,OAAA;CAAA,MAAAC,IAAAjD,EAAA,EAAA;CAAC,MAAA,EAAAkD,MAAAhB,YAAAC,aAAAa;CAKvB,MAAAG,KAAAD,MAAIE;CAAM,IAAAC;CAAA,IAAAJ,EAAA,OAAAE,IAAA;EAArBE,KAAA9B,WAAW4B,EAAU;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAlD,MAAAK,QAA4BD;CAAgC,IAAAE;CAAA,IAAAN,EAAA,OAAAd,YAAAc,EAAA,OAAAf,cAAAe,EAAA,OAAAK,OAAA;EAAA,IAAAE;EAAA,IAAAP,EAAA,OAAAd,YAAAc,EAAA,OAAAf,YAAA;GAI7CsB,MAAAtC,MAAAsB,MAAaP,WAAWf,MAAMgB,YAAYC,UAAU,GAAGK,GAAG;GAACS,EAAA,KAAAd;GAAAc,EAAA,KAAAf;GAAAe,EAAA,KAAAO;EAAA,OAAAA,KAAAP,EAAA;EAArEM,KAAAD,MAAKhB,IAAKkB,EAA2D;EAACP,EAAA,KAAAd;EAAAc,EAAA,KAAAf;EAAAe,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAM,IAAA;EADzEC,KAAA,oBAAA,YAAA,EAAA,UACGD,GAAsE,CAAA;EACtEN,EAAA,KAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAFHO;AAEG;AAIPT,mBAAmBU,cAAc;;;;;;;;;;;;;;;;;;AA0CjC,MAAaC,gCAETV,OAAA;CAAA,MAAAC,IAAAjD,EAAA,CAAA;CAAC,MAAA,EAAAkC,YAAAgB,MAAAf,aAAAa;CAKH,MAAAY,YAAkBtD,YAAYuD,KAG7B;CACD,MAAAC,WAAiBZ,QAAAU;CAEjB,IAAI,CAACE,UAAQ,OAAS;CAAK,IAAAX;CAAA,IAAAF,EAAA,OAAAd,YAAAc,EAAA,OAAAf,cAAAe,EAAA,OAAAa,UAAA;EAGzBX,KAAA,oBAAC,oBAAD;GACQW,MAAAA;GACM5B;GACFC;EAAQ,CAAA;EAClBc,EAAA,KAAAd;EAAAc,EAAA,KAAAf;EAAAe,EAAA,KAAAa;EAAAb,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAJFE;AAIE;AAINO,6BAA6BD,cAAc;AAtBvC,SAAAI,MAAAE,GAAA;CAMA,MAAAC,OAAaD,EAACC;CAAoD,OAC3DA,MAAIC,SAAW,kBAAkBD,KAAId,OAArCzB,KAAAA;AAAsD"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentType, FC, ReactNode } from "react";
|
|
3
|
-
//#region src/react/primitives/message/MessageAttachments.d.ts
|
|
1
|
+
import type { Attachment } from "../../../types/attachment.js";
|
|
2
|
+
import { type ComponentType, type FC, type ReactNode } from "react";
|
|
4
3
|
type MessageAttachmentsComponentConfig = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Image?: ComponentType | undefined;
|
|
5
|
+
Document?: ComponentType | undefined;
|
|
6
|
+
File?: ComponentType | undefined;
|
|
7
|
+
Attachment?: ComponentType | undefined;
|
|
9
8
|
};
|
|
10
|
-
declare namespace MessagePrimitiveAttachments {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
export declare namespace MessagePrimitiveAttachments {
|
|
10
|
+
type Props = {
|
|
11
|
+
/** @deprecated Use the children render function instead. */
|
|
12
|
+
components: MessageAttachmentsComponentConfig;
|
|
13
|
+
children?: never;
|
|
14
|
+
} | {
|
|
15
|
+
/**
|
|
16
|
+
* Render function called for each attachment. Receives the attachment,
|
|
17
|
+
* which is still being prepared while the message is the composer's
|
|
18
|
+
* submission.
|
|
19
|
+
*/
|
|
20
|
+
children: (value: {
|
|
21
|
+
attachment: Attachment;
|
|
22
|
+
}) => ReactNode;
|
|
23
|
+
components?: never;
|
|
24
|
+
};
|
|
22
25
|
}
|
|
23
|
-
declare namespace MessagePrimitiveAttachmentByIndex {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
export declare namespace MessagePrimitiveAttachmentByIndex {
|
|
27
|
+
type Props = {
|
|
28
|
+
index: number;
|
|
29
|
+
components?: MessageAttachmentsComponentConfig;
|
|
30
|
+
};
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* Renders a single attachment at the specified index within the current message.
|
|
31
34
|
*/
|
|
32
|
-
declare const MessagePrimitiveAttachmentByIndex: FC<MessagePrimitiveAttachmentByIndex.Props>;
|
|
33
|
-
declare const MessagePrimitiveAttachments: FC<MessagePrimitiveAttachments.Props>;
|
|
34
|
-
|
|
35
|
-
export { MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments };
|
|
35
|
+
export declare const MessagePrimitiveAttachmentByIndex: FC<MessagePrimitiveAttachmentByIndex.Props>;
|
|
36
|
+
export declare const MessagePrimitiveAttachments: FC<MessagePrimitiveAttachments.Props>;
|
|
37
|
+
export {};
|
|
36
38
|
//# sourceMappingURL=MessageAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageAttachments.d.ts","
|
|
1
|
+
{"version":3,"file":"MessageAttachments.d.ts","sourceRoot":"","sources":["../../../../src/react/primitives/message/MessageAttachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,qCAAkC;AAC5D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAKf,KAAK,iCAAiC,GAAG;IACvC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACrC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,KAAK,GACb;QACE,4DAA4D;QAC5D,UAAU,EAAE,iCAAiC,CAAC;QAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC;KAClB,GACD;QACE;;;;WAIG;QACH,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,UAAU,EAAE,UAAU,CAAA;SAAE,KAAK,SAAS,CAAC;QAC3D,UAAU,CAAC,EAAE,KAAK,CAAC;KACpB,CAAC;CACP;AA8BD,yBAAiB,iCAAiC,CAAC;IACjD,KAAY,KAAK,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,iCAAiC,CAAC;KAChD,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,iCAAiC,EAAE,EAAE,CAAC,iCAAiC,CAAC,KAAK,CAevF,CAAC;AAsCJ,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAC1C,2BAA2B,CAAC,KAAK,CAkBlC,CAAC"}
|
|
@@ -18,23 +18,22 @@ const AttachmentComponent = (t0) => {
|
|
|
18
18
|
const { components } = t0;
|
|
19
19
|
const attachment = useAuiState(_temp);
|
|
20
20
|
if (!attachment) return null;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$[
|
|
26
|
-
$[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const Component = t2;
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[0] !== attachment || $[1] !== components) {
|
|
23
|
+
t1 = getComponent(components, attachment);
|
|
24
|
+
$[0] = attachment;
|
|
25
|
+
$[1] = components;
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
} else t1 = $[2];
|
|
28
|
+
const Component = t1;
|
|
30
29
|
if (!Component) return null;
|
|
31
|
-
let
|
|
30
|
+
let t2;
|
|
32
31
|
if ($[3] !== Component) {
|
|
33
|
-
|
|
32
|
+
t2 = /* @__PURE__ */ jsx(Component, {});
|
|
34
33
|
$[3] = Component;
|
|
35
|
-
$[4] =
|
|
36
|
-
} else
|
|
37
|
-
return
|
|
34
|
+
$[4] = t2;
|
|
35
|
+
} else t2 = $[4];
|
|
36
|
+
return t2;
|
|
38
37
|
};
|
|
39
38
|
/**
|
|
40
39
|
* Renders a single attachment at the specified index within the current message.
|
|
@@ -64,7 +63,7 @@ MessagePrimitiveAttachmentByIndex.displayName = "MessagePrimitive.AttachmentByIn
|
|
|
64
63
|
const MessagePrimitiveAttachmentsInner = ({ children }) => {
|
|
65
64
|
const attachmentIds = useAuiState(useShallowSelector((s) => {
|
|
66
65
|
if (s.message.role !== "user") return [];
|
|
67
|
-
return (s.message.attachments ?? []).map((attachment) => attachment.id);
|
|
66
|
+
return (s.message.submission?.attachments ?? s.message.attachments ?? []).map((attachment) => attachment.id);
|
|
68
67
|
}));
|
|
69
68
|
return useMemo(() => attachmentIds.map((attachmentId, index) => /* @__PURE__ */ jsx(MessageAttachmentByIndexProvider, {
|
|
70
69
|
index,
|