@assistant-ui/react 0.15.20 → 0.15.22
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/README.md +1 -1
- package/dist/assistant-transport.d.ts +28 -28
- package/dist/assistant-transport.d.ts.map +1 -1
- package/dist/assistant-transport.js.map +1 -1
- package/dist/augmentations.d.ts +31 -9
- package/dist/augmentations.d.ts.map +1 -1
- package/dist/cloud-renderer/CloudRendererHost.d.ts +13 -0
- package/dist/cloud-renderer/CloudRendererHost.d.ts.map +1 -0
- package/dist/cloud-renderer/CloudRendererHost.js +291 -0
- package/dist/cloud-renderer/CloudRendererHost.js.map +1 -0
- package/dist/context/ReadonlyStore.d.ts +3 -6
- package/dist/context/ReadonlyStore.d.ts.map +1 -1
- package/dist/context/index.d.ts +13 -13
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/providers/AttachmentByIndexProvider.d.ts +2 -2
- package/dist/context/providers/AttachmentByIndexProvider.d.ts.map +1 -0
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts +2 -2
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -0
- package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts +2 -2
- package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -0
- package/dist/context/providers/MessageByIndexProvider.d.ts +2 -2
- package/dist/context/providers/MessageByIndexProvider.d.ts.map +1 -0
- package/dist/context/providers/MessageProvider.d.ts +3 -6
- package/dist/context/providers/MessageProvider.d.ts.map +1 -1
- package/dist/context/providers/PartByIndexProvider.d.ts +2 -2
- package/dist/context/providers/PartByIndexProvider.d.ts.map +1 -0
- package/dist/context/providers/SuggestionByIndexProvider.d.ts +2 -2
- package/dist/context/providers/SuggestionByIndexProvider.d.ts.map +1 -0
- package/dist/context/providers/TextMessagePartProvider.d.ts +2 -2
- package/dist/context/providers/TextMessagePartProvider.d.ts.map +1 -0
- package/dist/context/providers/ThreadListItemProvider.d.ts +2 -2
- package/dist/context/providers/ThreadListItemProvider.d.ts.map +1 -0
- package/dist/context/providers/ThreadViewportProvider.d.ts +5 -8
- package/dist/context/providers/ThreadViewportProvider.d.ts.map +1 -1
- package/dist/context/react/ThreadViewportContext.d.ts +20 -23
- package/dist/context/react/ThreadViewportContext.d.ts.map +1 -1
- package/dist/context/react/utils/createContextHook.d.ts +3 -6
- package/dist/context/react/utils/createContextHook.d.ts.map +1 -1
- package/dist/context/react/utils/createContextStoreHook.d.ts +16 -19
- package/dist/context/react/utils/createContextStoreHook.d.ts.map +1 -1
- package/dist/context/stores/ThreadViewport.d.ts +76 -79
- package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
- package/dist/devtools/DevToolsHooks.d.ts +22 -24
- package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
- package/dist/hooks/useMessageQuote.d.ts +2 -5
- package/dist/hooks/useMessageQuote.d.ts.map +1 -1
- package/dist/hooks/useMessageTiming.d.ts +2 -5
- package/dist/hooks/useMessageTiming.d.ts.map +1 -1
- package/dist/hooks/useToolCallElapsed.d.ts +1 -4
- package/dist/hooks/useToolCallElapsed.d.ts.map +1 -1
- package/dist/hooks/useToolCallElapsed.js +1 -1
- package/dist/index.d.ts +126 -82
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -13
- package/dist/internal.d.ts +8 -11
- package/dist/internal.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts +27 -30
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.d.ts +2 -2
- package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +1 -0
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +2 -2
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts +3 -3
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts +3 -3
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +4 -3
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts +3 -3
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts +2 -2
- package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +5 -3
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +4 -3
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts +3 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts +3 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +4 -3
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts +3 -2
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts +4 -3
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts.map +1 -0
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js +1 -1
- package/dist/mcp-apps/McpAppRenderer.d.ts +52 -55
- package/dist/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/mcp-apps/McpAppRenderer.js +2 -2
- package/dist/mcp-apps/McpAppsRemoteHost.d.ts +2 -5
- package/dist/mcp-apps/McpAppsRemoteHost.d.ts.map +1 -1
- package/dist/mcp-apps/app-frame.d.ts +2 -5
- package/dist/mcp-apps/app-frame.d.ts.map +1 -1
- package/dist/mcp-apps/bridge.d.ts +15 -18
- package/dist/mcp-apps/bridge.d.ts.map +1 -1
- package/dist/mcp-apps/index.d.ts +5 -5
- package/dist/mcp-apps/index.d.ts.map +1 -0
- package/dist/mcp-apps/types.d.ts +114 -116
- package/dist/mcp-apps/types.d.ts.map +1 -1
- package/dist/mcp-apps/utils.d.ts +3 -5
- package/dist/mcp-apps/utils.d.ts.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.d.ts +8 -9
- package/dist/model-context/frame/useAssistantFrameHost.d.ts.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.js +1 -1
- package/dist/model-context/makeAssistantVisible.d.ts +5 -7
- package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +2 -2
- package/dist/primitives/actionBar/ActionBarCopy.d.ts +15 -17
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts +12 -14
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts +13 -15
- package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js +4 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +8 -10
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +11 -9
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +8 -10
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +11 -9
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarInteractionContext.d.ts +4 -7
- package/dist/primitives/actionBar/ActionBarInteractionContext.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts +12 -14
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarRoot.d.ts +51 -53
- package/dist/primitives/actionBar/ActionBarRoot.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts +8 -10
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +8 -10
- package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts +11 -14
- package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts.map +1 -1
- package/dist/primitives/actionBar.d.ts +9 -14
- package/dist/primitives/actionBar.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts +11 -14
- package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts +8 -11
- package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts +5 -8
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts +8 -11
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts +8 -11
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/scope.d.ts +5 -8
- package/dist/primitives/actionBarMore/scope.d.ts.map +1 -1
- package/dist/primitives/actionBarMore.d.ts +5 -10
- package/dist/primitives/actionBarMore.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalAnchor.d.ts +8 -11
- package/dist/primitives/assistantModal/AssistantModalAnchor.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts +13 -16
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts +7 -10
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts +8 -11
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts.map +1 -1
- package/dist/primitives/assistantModal/popoverRenderPrimitives.d.ts +7 -10
- package/dist/primitives/assistantModal/popoverRenderPrimitives.d.ts.map +1 -1
- package/dist/primitives/assistantModal/scope.d.ts +5 -8
- package/dist/primitives/assistantModal/scope.d.ts.map +1 -1
- package/dist/primitives/assistantModal.d.ts +4 -9
- package/dist/primitives/assistantModal.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentName.d.ts +4 -7
- package/dist/primitives/attachment/AttachmentName.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.d.ts +8 -10
- package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.js +1 -1
- package/dist/primitives/attachment/AttachmentRoot.d.ts +12 -14
- package/dist/primitives/attachment/AttachmentRoot.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentThumb.d.ts +8 -10
- package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentThumb.js +1 -1
- package/dist/primitives/attachment.d.ts +4 -9
- package/dist/primitives/attachment.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.d.ts +8 -11
- package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts +12 -14
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +4 -7
- package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +12 -14
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +20 -23
- package/dist/primitives/branchPicker/BranchPickerRoot.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerRoot.js +1 -1
- package/dist/primitives/branchPicker.d.ts +5 -10
- package/dist/primitives/branchPicker.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +12 -14
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts +2 -2
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts +8 -10
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts.map +1 -1
- package/dist/primitives/chainOfThought.d.ts +3 -8
- package/dist/primitives/chainOfThought.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts +13 -15
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +1 -1
- package/dist/primitives/composer/ComposerAttachmentDropzone.d.ts +11 -13
- package/dist/primitives/composer/ComposerAttachmentDropzone.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachmentDropzone.js +9 -7
- package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts +2 -2
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerCancel.d.ts +12 -14
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCompactContext.d.ts +4 -7
- package/dist/primitives/composer/ComposerCompactContext.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerDictate.d.ts +8 -10
- package/dist/primitives/composer/ComposerDictate.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.d.ts +7 -10
- package/dist/primitives/composer/ComposerDictationTranscript.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.js +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts +3 -2
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerInput.d.ts +74 -77
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +3 -3
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerInputPluginContext.d.ts +27 -30
- package/dist/primitives/composer/ComposerInputPluginContext.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerQueue.d.ts +2 -2
- package/dist/primitives/composer/ComposerQueue.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerQuote.d.ts +19 -22
- package/dist/primitives/composer/ComposerQuote.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerQuote.js +1 -1
- package/dist/primitives/composer/ComposerRoot.d.ts +28 -31
- package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerRoot.js +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts +12 -15
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.d.ts +8 -10
- package/dist/primitives/composer/ComposerStopDictation.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.js +1 -1
- package/dist/primitives/composer/trigger/TriggerPopover.d.ts +33 -36
- package/dist/primitives/composer/trigger/TriggerPopover.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopover.js +2 -2
- package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts +12 -15
- package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverAction.js +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverBack.d.ts +7 -10
- package/dist/primitives/composer/trigger/TriggerPopoverBack.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts +20 -23
- package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts +10 -13
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.js +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts +22 -25
- package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverResource.d.ts +44 -46
- package/dist/primitives/composer/trigger/TriggerPopoverResource.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts +39 -41
- package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/detectTrigger.d.ts +6 -9
- package/dist/primitives/composer/trigger/detectTrigger.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/index.d.ts +16 -19
- package/dist/primitives/composer/trigger/index.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/matchesTriggerItemQuery.d.ts +2 -5
- package/dist/primitives/composer/trigger/matchesTriggerItemQuery.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/triggerDetectionResource.d.ts +13 -16
- package/dist/primitives/composer/trigger/triggerDetectionResource.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/triggerKeyboardResource.d.ts +25 -28
- package/dist/primitives/composer/trigger/triggerKeyboardResource.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/triggerNavigationResource.d.ts +20 -23
- package/dist/primitives/composer/trigger/triggerNavigationResource.d.ts.map +1 -1
- package/dist/primitives/composer/trigger/triggerSelectionResource.d.ts +27 -30
- package/dist/primitives/composer/trigger/triggerSelectionResource.d.ts.map +1 -1
- package/dist/primitives/composer/useComposerInputState.d.ts +8 -11
- package/dist/primitives/composer/useComposerInputState.d.ts.map +1 -1
- package/dist/primitives/composer.d.ts +31 -25
- package/dist/primitives/composer.d.ts.map +1 -1
- package/dist/primitives/dropdownMenuRenderPrimitives.d.ts +9 -12
- package/dist/primitives/dropdownMenuRenderPrimitives.d.ts.map +1 -1
- package/dist/primitives/error/ErrorMessage.d.ts +7 -10
- package/dist/primitives/error/ErrorMessage.d.ts.map +1 -1
- package/dist/primitives/error/ErrorRoot.d.ts +7 -10
- package/dist/primitives/error/ErrorRoot.d.ts.map +1 -1
- package/dist/primitives/error.d.ts +2 -7
- package/dist/primitives/error.d.ts.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts +2 -2
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -0
- package/dist/primitives/message/MessageError.d.ts +2 -5
- package/dist/primitives/message/MessageError.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +17 -19
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts +6 -8
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts +136 -138
- package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.js +103 -71
- package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
- package/dist/primitives/message/MessageRoot.d.ts +7 -10
- package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
- package/dist/primitives/message/MessageRoot.js +6 -2
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/message.d.ts +12 -12
- package/dist/primitives/message.d.ts.map +1 -1
- package/dist/primitives/messagePart/MessagePartImage.d.ts +11 -14
- package/dist/primitives/messagePart/MessagePartImage.d.ts.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.d.ts +2 -2
- package/dist/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -0
- package/dist/primitives/messagePart/MessagePartText.d.ts +37 -40
- package/dist/primitives/messagePart/MessagePartText.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts +2 -5
- package/dist/primitives/messagePart/useMessagePartData.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.d.ts +3 -6
- package/dist/primitives/messagePart/useMessagePartFile.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.d.ts +3 -6
- package/dist/primitives/messagePart/useMessagePartImage.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts +3 -6
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.d.ts +20 -23
- package/dist/primitives/messagePart/useMessagePartSource.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.d.ts +4 -7
- package/dist/primitives/messagePart/useMessagePartText.d.ts.map +1 -1
- package/dist/primitives/messagePart.d.ts +4 -9
- package/dist/primitives/messagePart.d.ts.map +1 -1
- package/dist/primitives/queueItem/QueueItemRemove.d.ts +8 -10
- package/dist/primitives/queueItem/QueueItemRemove.d.ts.map +1 -1
- package/dist/primitives/queueItem/QueueItemRemove.js +1 -1
- package/dist/primitives/queueItem/QueueItemSteer.d.ts +8 -10
- package/dist/primitives/queueItem/QueueItemSteer.d.ts.map +1 -1
- package/dist/primitives/queueItem/QueueItemSteer.js +1 -1
- package/dist/primitives/queueItem/QueueItemText.d.ts +7 -10
- package/dist/primitives/queueItem/QueueItemText.d.ts.map +1 -1
- package/dist/primitives/queueItem/QueueItemText.js +1 -1
- package/dist/primitives/queueItem.d.ts +3 -8
- package/dist/primitives/queueItem.d.ts.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.d.ts +2 -5
- package/dist/primitives/reasoning/useScrollLock.d.ts.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.js +14 -15
- package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts +7 -10
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts.map +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts +15 -17
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts.map +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +86 -43
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -1
- package/dist/primitives/selectionToolbar.d.ts +2 -7
- package/dist/primitives/selectionToolbar.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionDescription.d.ts +7 -10
- package/dist/primitives/suggestion/SuggestionDescription.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionDescription.js +1 -1
- package/dist/primitives/suggestion/SuggestionTitle.d.ts +7 -10
- package/dist/primitives/suggestion/SuggestionTitle.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionTitle.js +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts +37 -39
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
- package/dist/primitives/suggestion.d.ts +3 -8
- package/dist/primitives/suggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.d.ts +4 -7
- package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +9 -11
- package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +2 -2
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -0
- package/dist/primitives/thread/ThreadRoot.d.ts +11 -14
- package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadRoot.js +15 -8
- package/dist/primitives/thread/ThreadRoot.js.map +1 -1
- package/dist/primitives/thread/ThreadRootElementContext.d.ts +4 -0
- package/dist/primitives/thread/ThreadRootElementContext.d.ts.map +1 -0
- package/dist/primitives/thread/ThreadRootElementContext.js +11 -0
- package/dist/primitives/thread/ThreadRootElementContext.js.map +1 -0
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts +13 -15
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +49 -51
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestions.d.ts +2 -2
- package/dist/primitives/thread/ThreadSuggestions.d.ts.map +1 -0
- package/dist/primitives/thread/ThreadViewport.d.ts +89 -92
- package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadViewport.js +1 -1
- package/dist/primitives/thread/ThreadViewportFooter.d.ts +7 -10
- package/dist/primitives/thread/ThreadViewportFooter.d.ts.map +1 -1
- package/dist/primitives/thread/topAnchor/computeTopAnchorSlack.d.ts +9 -12
- package/dist/primitives/thread/topAnchor/computeTopAnchorSlack.d.ts.map +1 -1
- package/dist/primitives/thread/topAnchor/createReserveObservers.d.ts +3 -6
- package/dist/primitives/thread/topAnchor/createReserveObservers.d.ts.map +1 -1
- package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.d.ts +18 -21
- package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.d.ts.map +1 -1
- package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.js +55 -6
- package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.js.map +1 -1
- package/dist/primitives/thread/topAnchor/topAnchorTurn.d.ts +14 -16
- package/dist/primitives/thread/topAnchor/topAnchorTurn.d.ts.map +1 -1
- package/dist/primitives/thread/topAnchor/topAnchorUtils.d.ts +5 -8
- package/dist/primitives/thread/topAnchor/topAnchorUtils.d.ts.map +1 -1
- package/dist/primitives/thread/topAnchor/useTopAnchorReserve.d.ts +1 -4
- package/dist/primitives/thread/topAnchor/useTopAnchorReserve.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts +30 -33
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +39 -16
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/thread.d.ts +12 -15
- package/dist/primitives/thread.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.d.ts +2 -2
- package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -0
- package/dist/primitives/threadList/ThreadListLoadMore.d.ts +8 -10
- package/dist/primitives/threadList/ThreadListLoadMore.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.d.ts +7 -10
- package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +1 -1
- package/dist/primitives/threadList/ThreadListRoot.d.ts +8 -10
- package/dist/primitives/threadList/ThreadListRoot.d.ts.map +1 -1
- package/dist/primitives/threadList.d.ts +5 -9
- package/dist/primitives/threadList.d.ts.map +1 -1
- package/dist/primitives/threadListFocusGroup.d.ts +17 -19
- package/dist/primitives/threadListFocusGroup.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +8 -10
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +8 -10
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +8 -10
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +2 -2
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +8 -10
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +8 -10
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem.d.ts +6 -11
- package/dist/primitives/threadListItem.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts +11 -14
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts +8 -11
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts +15 -18
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts +8 -11
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts +8 -11
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/scope.d.ts +5 -8
- package/dist/primitives/threadListItemMore/scope.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore.d.ts +5 -10
- package/dist/primitives/threadListItemMore.d.ts.map +1 -1
- package/dist/sandbox-host/SandboxHost.d.ts +31 -34
- package/dist/sandbox-host/SandboxHost.d.ts.map +1 -1
- package/dist/unstable/useComposerInput.d.ts +37 -40
- package/dist/unstable/useComposerInput.d.ts.map +1 -1
- package/dist/unstable/useComposerInput.js +1 -1
- package/dist/unstable/useComposerInputHistory.d.ts +5 -8
- package/dist/unstable/useComposerInputHistory.d.ts.map +1 -1
- package/dist/unstable/useComposerInputHistory.js +2 -2
- package/dist/unstable/useLiveCompletionAdapter.d.ts +20 -23
- package/dist/unstable/useLiveCompletionAdapter.d.ts.map +1 -1
- package/dist/unstable/useMentionAdapter.d.ts +63 -66
- package/dist/unstable/useMentionAdapter.d.ts.map +1 -1
- package/dist/unstable/useMentionAdapter.js +1 -1
- package/dist/unstable/useMessageStallDetection.d.ts +13 -16
- package/dist/unstable/useMessageStallDetection.d.ts.map +1 -1
- package/dist/unstable/useMessageStallDetection.js +1 -1
- package/dist/unstable/useModelContextSnapshot.d.ts +16 -19
- package/dist/unstable/useModelContextSnapshot.d.ts.map +1 -1
- package/dist/unstable/useSlashCommandAdapter.d.ts +24 -27
- package/dist/unstable/useSlashCommandAdapter.d.ts.map +1 -1
- package/dist/unstable/webmcp/WebMcpRegistrationResource.d.ts +9 -12
- package/dist/unstable/webmcp/WebMcpRegistrationResource.d.ts.map +1 -1
- package/dist/unstable/webmcp/convertTools.d.ts +9 -12
- package/dist/unstable/webmcp/convertTools.d.ts.map +1 -1
- package/dist/unstable/webmcp/convertTools.js +2 -2
- package/dist/unstable/webmcp/convertTools.js.map +1 -1
- package/dist/unstable/webmcp/useWebMcpProvider.d.ts +7 -10
- package/dist/unstable/webmcp/useWebMcpProvider.d.ts.map +1 -1
- package/dist/unstable/webmcp/useWebMcpProvider.js +1 -1
- package/dist/unstable/webmcp/webmcp-host.d.ts +29 -32
- package/dist/unstable/webmcp/webmcp-host.d.ts.map +1 -1
- package/dist/utils/Primitive.d.ts +91 -92
- package/dist/utils/Primitive.d.ts.map +1 -1
- package/dist/utils/RequireAtLeastOne.d.ts +3 -4
- package/dist/utils/RequireAtLeastOne.d.ts.map +1 -1
- package/dist/utils/createActionButton.d.ts +7 -9
- package/dist/utils/createActionButton.d.ts.map +1 -1
- package/dist/utils/getSelectionMessageId.d.ts +1 -4
- package/dist/utils/getSelectionMessageId.d.ts.map +1 -1
- package/dist/utils/getSelectionMessageId.js +2 -1
- package/dist/utils/getSelectionMessageId.js.map +1 -1
- package/dist/utils/hooks/useManagedRef.d.ts +1 -4
- package/dist/utils/hooks/useManagedRef.d.ts.map +1 -1
- package/dist/utils/hooks/useMediaQuery.d.ts +1 -4
- package/dist/utils/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.d.ts +1 -4
- package/dist/utils/hooks/useOnResizeContent.d.ts.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.d.ts +2 -5
- package/dist/utils/hooks/useOnScrollToBottom.d.ts.map +1 -1
- package/dist/utils/hooks/useSizeHandle.d.ts +2 -5
- package/dist/utils/hooks/useSizeHandle.d.ts.map +1 -1
- package/dist/utils/smooth/SmoothContext.d.ts +108 -111
- package/dist/utils/smooth/SmoothContext.d.ts.map +1 -1
- package/dist/utils/smooth/SmoothContext.js +1 -1
- package/dist/utils/smooth/useSmooth.d.ts +28 -31
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +1 -1
- package/package.json +17 -16
- package/src/assistant-transport.ts +5 -4
- package/src/cloud-renderer/CloudRendererHost.test.tsx +362 -0
- package/src/cloud-renderer/CloudRendererHost.tsx +249 -0
- package/src/index.ts +29 -1
- package/src/mcp-apps/McpAppRenderer.test.tsx +1 -2
- package/src/primitives/actionBar/ActionBarExportMarkdown.test.tsx +30 -0
- package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +4 -0
- package/src/primitives/actionBar/ActionBarFeedback.test.tsx +87 -0
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +1 -0
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +1 -0
- package/src/primitives/composer/ComposerAddAttachment.test.tsx +7 -5
- package/src/primitives/composer/ComposerAttachmentDropzone.test.tsx +54 -0
- package/src/primitives/composer/ComposerAttachmentDropzone.tsx +12 -6
- package/src/primitives/composer/ComposerInput.test.tsx +18 -0
- package/src/primitives/composer/ComposerInput.tsx +8 -2
- package/src/primitives/composer/ComposerRoot.test.tsx +5 -3
- package/src/primitives/message/MessagePartsGrouped.test.tsx +151 -4
- package/src/primitives/message/MessagePartsGrouped.tool-interaction.test.tsx +97 -0
- package/src/primitives/message/MessagePartsGrouped.tsx +14 -5
- package/src/primitives/message/MessageRoot.test.tsx +108 -0
- package/src/primitives/message/MessageRoot.tsx +5 -1
- package/src/primitives/reasoning/useScrollLock.test.tsx +47 -0
- package/src/primitives/reasoning/useScrollLock.ts +15 -17
- package/src/primitives/selectionToolbar/SelectionToolbarRoot.test.tsx +271 -13
- package/src/primitives/selectionToolbar/SelectionToolbarRoot.tsx +67 -13
- package/src/primitives/thread/ThreadRoot.tsx +10 -1
- package/src/primitives/thread/ThreadRootElementContext.ts +10 -0
- package/src/primitives/thread/topAnchor/mountTopAnchorReserve.test.ts +196 -0
- package/src/primitives/thread/topAnchor/mountTopAnchorReserve.ts +78 -5
- package/src/primitives/thread/useThreadViewportAutoScroll.test.tsx +317 -0
- package/src/primitives/thread/useThreadViewportAutoScroll.ts +47 -2
- package/src/tests/RemoteThreadListRuntime.reloadMainThread.test.tsx +2 -4
- package/src/tests/augmentations.test.ts +7 -0
- package/src/tests/threadListItemIsRunning.test.tsx +3 -2
- package/src/unstable/useMentionAdapter.test.tsx +15 -21
- package/src/unstable/useModelContextSnapshot.test.tsx +3 -2
- package/src/unstable/webmcp/convertTools.test.ts +81 -39
- package/src/unstable/webmcp/convertTools.ts +7 -11
- package/src/unstable/webmcp/useWebMcpProvider.test.tsx +12 -3
- package/src/utils/getSelectionMessageId.test.ts +28 -0
- package/src/utils/getSelectionMessageId.ts +7 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -6
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +0 -1
- package/dist/tests/remote-thread-list-test-helpers.js +0 -29
- package/dist/tests/remote-thread-list-test-helpers.js.map +0 -1
- package/dist/tests/setup.d.ts +0 -1
- package/dist/tests/setup.js +0 -6
- package/dist/tests/setup.js.map +0 -1
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly execute: () => void;
|
|
1
|
+
import type { Unstable_TriggerAdapter, Unstable_TriggerItem } from "@assistant-ui/core";
|
|
2
|
+
import type { Unstable_IconComponent } from "./useMentionAdapter.js";
|
|
3
|
+
export type Unstable_SlashCommand = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label?: string | undefined;
|
|
6
|
+
readonly description?: string | undefined;
|
|
7
|
+
readonly icon?: string | undefined;
|
|
8
|
+
readonly execute: () => void;
|
|
10
9
|
};
|
|
11
|
-
type Unstable_UseSlashCommandAdapterOptions = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export type Unstable_UseSlashCommandAdapterOptions = {
|
|
11
|
+
readonly commands: readonly Unstable_SlashCommand[];
|
|
12
|
+
/** Strip the trigger text from the composer after executing. @default false */
|
|
13
|
+
readonly removeOnExecute?: boolean | undefined;
|
|
14
|
+
/** Maps `metadata.icon` / `category.id` string keys to React components. */
|
|
15
|
+
readonly iconMap?: Record<string, Unstable_IconComponent>;
|
|
16
|
+
/** Fallback icon when no entry in `iconMap` matches. */
|
|
17
|
+
readonly fallbackIcon?: Unstable_IconComponent;
|
|
19
18
|
};
|
|
20
|
-
type Unstable_SlashCommandAction = {
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
export type Unstable_SlashCommandAction = {
|
|
20
|
+
readonly onExecute: (item: Unstable_TriggerItem) => void;
|
|
21
|
+
readonly removeOnExecute?: boolean | undefined;
|
|
23
22
|
};
|
|
24
23
|
/**
|
|
25
24
|
* @deprecated Under active development and may change without notice.
|
|
@@ -41,12 +40,10 @@ type Unstable_SlashCommandAction = {
|
|
|
41
40
|
* <ComposerTriggerPopover char="/" {...slash} />
|
|
42
41
|
* ```
|
|
43
42
|
*/
|
|
44
|
-
declare function unstable_useSlashCommandAdapter(options: Unstable_UseSlashCommandAdapterOptions): {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
export declare function unstable_useSlashCommandAdapter(options: Unstable_UseSlashCommandAdapterOptions): {
|
|
44
|
+
adapter: Unstable_TriggerAdapter;
|
|
45
|
+
action: Unstable_SlashCommandAction;
|
|
46
|
+
iconMap?: Record<string, Unstable_IconComponent>;
|
|
47
|
+
fallbackIcon?: Unstable_IconComponent;
|
|
49
48
|
};
|
|
50
|
-
//#endregion
|
|
51
|
-
export { Unstable_SlashCommand, Unstable_SlashCommandAction, Unstable_UseSlashCommandAdapterOptions, unstable_useSlashCommandAdapter };
|
|
52
49
|
//# sourceMappingURL=useSlashCommandAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlashCommandAdapter.d.ts","
|
|
1
|
+
{"version":3,"file":"useSlashCommandAdapter.d.ts","sourceRoot":"","sources":["../../src/unstable/useSlashCommandAdapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,+BAA4B;AAGlE,MAAM,MAAM,qBAAqB,GAAG;IACl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
-
tool: Tool<any, any>;
|
|
1
|
+
import type { Tool } from "assistant-stream";
|
|
2
|
+
import type { WebMcpHost } from "./webmcp-host.js";
|
|
3
|
+
export type WebMcpRegistrationProps = {
|
|
4
|
+
host: WebMcpHost;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Re-registers when it changes; an execute-only edit reads through instead. */
|
|
7
|
+
signature: string;
|
|
8
|
+
tool: Tool<any, any>;
|
|
10
9
|
};
|
|
11
|
-
declare const WebMcpRegistrationResource: import("@assistant-ui/tap").Resource<string | null, [WebMcpRegistrationProps]>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { WebMcpRegistrationProps, WebMcpRegistrationResource };
|
|
10
|
+
export declare const WebMcpRegistrationResource: import("@assistant-ui/tap").Resource<string | null, [WebMcpRegistrationProps]>;
|
|
14
11
|
//# sourceMappingURL=WebMcpRegistrationResource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebMcpRegistrationResource.d.ts","
|
|
1
|
+
{"version":3,"file":"WebMcpRegistrationResource.d.ts","sourceRoot":"","sources":["../../../src/unstable/webmcp/WebMcpRegistrationResource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAsB;AAEhD,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACtB,CAAC;AA+EF,eAAO,MAAM,0BAA0B,gFAAkC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/unstable/webmcp/convertTools.d.ts
|
|
1
|
+
import { type Tool } from "assistant-stream";
|
|
2
|
+
import type { WebMcpCallToolResult, WebMcpToolDescriptor } from "./webmcp-host.js";
|
|
4
3
|
/**
|
|
5
4
|
* The predicate the WebMCP provider uses when no `filter` is passed: an enabled
|
|
6
5
|
* frontend tool with a client-side `execute`. A tool authored without a `type`
|
|
@@ -8,14 +7,12 @@ import { Tool } from "assistant-stream";
|
|
|
8
7
|
* type-less form from a backend or human tool. A `filter` replaces this, so
|
|
9
8
|
* pass it through to narrow the default set rather than widen it.
|
|
10
9
|
*/
|
|
11
|
-
declare const defaultWebMcpFilter: (_name: string, tool: Tool<any, any>) => boolean;
|
|
12
|
-
declare const toWebMcpInputSchema: (tool: Tool<any, any>) => unknown;
|
|
13
|
-
declare const toMcpContent: (result: unknown, options: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export declare const defaultWebMcpFilter: (_name: string, tool: Tool<any, any>) => boolean;
|
|
11
|
+
export declare const toWebMcpInputSchema: (tool: Tool<any, any>) => unknown;
|
|
12
|
+
export declare const toMcpContent: (result: unknown, options: {
|
|
13
|
+
tool: Tool<any, any>;
|
|
14
|
+
toolCallId: string;
|
|
15
|
+
args: Record<string, unknown>;
|
|
17
16
|
}) => Promise<WebMcpCallToolResult>;
|
|
18
|
-
declare const toWebMcpTool: (name: string, getTool: () => Tool<any, any>, lifecycleSignal?: AbortSignal) => WebMcpToolDescriptor;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { defaultWebMcpFilter, toMcpContent, toWebMcpInputSchema, toWebMcpTool };
|
|
17
|
+
export declare const toWebMcpTool: (name: string, getTool: () => Tool<any, any>, lifecycleSignal?: AbortSignal) => WebMcpToolDescriptor;
|
|
21
18
|
//# sourceMappingURL=convertTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertTools.d.ts","
|
|
1
|
+
{"version":3,"file":"convertTools.d.ts","sourceRoot":"","sources":["../../../src/unstable/webmcp/convertTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EAEV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EACV,oBAAoB,EAEpB,oBAAoB,EACrB,yBAAsB;AAEvB;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,MAAM,EACb,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,KACnB,OAGa,CAAC;AAEjB,eAAO,MAAM,mBAAmB,GAAI,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,KAAG,OAGnB,CAAC;AAwCzC,eAAO,MAAM,YAAY,GACvB,QAAQ,OAAO,EACf,SAAS;IACP,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,KACA,OAAO,CAAC,oBAAoB,CAuB9B,CAAC;AA2EF,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,SAAS,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAC7B,kBAAkB,WAAW,KAC5B,oBA2ED,CAAC"}
|
|
@@ -112,7 +112,7 @@ const toWebMcpTool = (name, getTool, lifecycleSignal) => ({
|
|
|
112
112
|
execute: async (rawArgs, context) => {
|
|
113
113
|
if (lifecycleSignal?.aborted) return errorResult(`Tool "${name}" is no longer registered`);
|
|
114
114
|
const tool = getTool();
|
|
115
|
-
|
|
115
|
+
let args = rawArgs ?? {};
|
|
116
116
|
const toolCallId = generateId();
|
|
117
117
|
let cleanup;
|
|
118
118
|
try {
|
|
@@ -134,7 +134,7 @@ const toWebMcpTool = (name, getTool, lifecycleSignal) => ({
|
|
|
134
134
|
executeFn = tool.experimental_onSchemaValidationError ?? (() => {
|
|
135
135
|
throw new Error(`Function parameter validation failed. ${JSON.stringify(issues)}`);
|
|
136
136
|
});
|
|
137
|
-
}
|
|
137
|
+
} else args = validation.value;
|
|
138
138
|
}
|
|
139
139
|
if (abortSignal?.aborted) return errorResult("Tool execution was cancelled.");
|
|
140
140
|
if (!executeFn) return errorResult(`Tool "${name}" has no client-side implementation.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertTools.js","names":["ToolResponse","toJSONSchema","Tool","ToolModelContentPart","generateId","WebMcpCallToolResult","WebMcpContent","WebMcpToolDescriptor","defaultWebMcpFilter","_name","tool","type","undefined","execute","disabled","toWebMcpInputSchema","parameters","properties","textContent","text","errorResult","message","isError","content","toText","value","toString","JSON","stringify","String","primitiveContent","mapModelContentPart","part","mediaType","startsWith","data","mimeType","toMcpContent","result","options","toolCallId","args","Record","Promise","response","toResponse","modelContent","map","toModelOutput","parts","input","output","e","console","warn","StandardSchemaLike","version","validate","issues","isStandardSchema","schema","TOOL_ABORTED","Symbol","isThenable","T","PromiseLike","then","raceWithAbort","abortSignal","AbortSignal","onAbort","abortPromise","resolve","aborted","addEventListener","once","race","removeEventListener","combineAbortSignals","callerSignal","lifecycleSignal","signal","cleanup","controller","AbortController","teardown","length","pop","abort","reason","listen","push","toWebMcpTool","name","getTool","description","inputSchema","rawArgs","context","combined","executeFn","validation","experimental_onSchemaValidationError","Error","human","reject"],"sources":["../../../src/unstable/webmcp/convertTools.ts"],"sourcesContent":["import {\n ToolResponse,\n toJSONSchema,\n type Tool,\n type ToolModelContentPart,\n} from \"assistant-stream\";\nimport { generateId } from \"@assistant-ui/core/internal\";\nimport type {\n WebMcpCallToolResult,\n WebMcpContent,\n WebMcpToolDescriptor,\n} from \"./webmcp-host\";\n\n/**\n * The predicate the WebMCP provider uses when no `filter` is passed: an enabled\n * frontend tool with a client-side `execute`. A tool authored without a `type`\n * is included, because `execute` is what distinguishes the deprecated\n * type-less form from a backend or human tool. A `filter` replaces this, so\n * pass it through to narrow the default set rather than widen it.\n */\nexport const defaultWebMcpFilter = (\n _name: string,\n tool: Tool<any, any>,\n): boolean =>\n (tool.type === \"frontend\" || tool.type === undefined) &&\n !!tool.execute &&\n !tool.disabled;\n\nexport const toWebMcpInputSchema = (tool: Tool<any, any>): unknown =>\n tool.parameters\n ? toJSONSchema(tool.parameters)\n : { type: \"object\", properties: {} };\n\nconst textContent = (text: string): WebMcpContent => ({ type: \"text\", text });\n\nconst errorResult = (message: string): WebMcpCallToolResult => ({\n isError: true,\n content: [textContent(message)],\n});\n\n// bigint throws in JSON.stringify and symbol serializes to undefined, but both\n// have a faithful string form. A value that cannot be serialized at all still\n// throws through to the error result.\nconst toText = (value: unknown): string => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"bigint\" || typeof value === \"symbol\") {\n return value.toString();\n }\n return JSON.stringify(value) ?? String(value);\n};\n\nconst primitiveContent = (value: unknown): WebMcpContent[] => [\n textContent(toText(value)),\n];\n\nconst mapModelContentPart = (part: ToolModelContentPart): WebMcpContent => {\n if (part.type === \"text\") {\n return textContent(part.text ?? \"\");\n }\n if (part.type === \"file\") {\n if (\n typeof part.mediaType === \"string\" &&\n part.mediaType.startsWith(\"image/\")\n ) {\n return { type: \"image\", data: part.data ?? \"\", mimeType: part.mediaType };\n }\n return textContent(part.data ?? \"\");\n }\n return textContent(toText(part));\n};\n\nexport const toMcpContent = async (\n result: unknown,\n options: {\n tool: Tool<any, any>;\n toolCallId: string;\n args: Record<string, unknown>;\n },\n): Promise<WebMcpCallToolResult> => {\n const response = ToolResponse.toResponse(result);\n if (response.modelContent) {\n const content = response.modelContent.map(mapModelContentPart);\n return response.isError ? { isError: true, content } : { content };\n }\n if (!response.isError && options.tool.toModelOutput) {\n try {\n const parts = await options.tool.toModelOutput({\n toolCallId: options.toolCallId,\n input: options.args,\n output: response.result,\n });\n return { content: parts.map(mapModelContentPart) };\n } catch (e) {\n console.warn(\n \"[assistant-ui] toModelOutput threw; falling back to default projection.\",\n e,\n );\n }\n }\n const content = primitiveContent(response.result);\n return response.isError ? { isError: true, content } : { content };\n};\n\ntype StandardSchemaLike = {\n \"~standard\": {\n version: number;\n validate: (\n value: unknown,\n ) =>\n | { issues?: readonly unknown[] | undefined }\n | Promise<{ issues?: readonly unknown[] | undefined }>;\n };\n};\n\nconst isStandardSchema = (schema: unknown): schema is StandardSchemaLike =>\n typeof schema === \"object\" &&\n schema !== null &&\n \"~standard\" in schema &&\n (schema as StandardSchemaLike)[\"~standard\"].version === 1;\n\nconst TOOL_ABORTED = Symbol(\"assistant-ui.webmcp-tool-aborted\");\n\nconst isThenable = <T>(value: T | PromiseLike<T>): value is PromiseLike<T> =>\n typeof (value as PromiseLike<T> | null | undefined)?.then === \"function\";\n\nconst raceWithAbort = async <T>(\n value: PromiseLike<T>,\n abortSignal: AbortSignal,\n): Promise<T | typeof TOOL_ABORTED> => {\n let onAbort!: () => void;\n const abortPromise = new Promise<typeof TOOL_ABORTED>((resolve) => {\n onAbort = () => resolve(TOOL_ABORTED);\n if (abortSignal.aborted) {\n onAbort();\n } else {\n abortSignal.addEventListener(\"abort\", onAbort, { once: true });\n }\n });\n\n try {\n // Unlike assistant-stream's helper, cancellation wins when validation aborts and rejects synchronously.\n return await Promise.race([abortPromise, value]);\n } finally {\n abortSignal.removeEventListener(\"abort\", onAbort);\n }\n};\n\n// AbortSignal.any sits above the browserslist floor and rejects any input that\n// is not a native AbortSignal, which a navigator.modelContext polyfill's signal\n// is not. The merged signal tracks its inputs only until cleanup runs, where\n// the single-signal path hands the caller the lifecycle signal itself.\nconst combineAbortSignals = (\n callerSignal: AbortSignal,\n lifecycleSignal: AbortSignal,\n): { signal: AbortSignal; cleanup: () => void } => {\n const controller = new AbortController();\n const teardown: (() => void)[] = [];\n const cleanup = () => {\n while (teardown.length) teardown.pop()!();\n };\n const abort = (reason: unknown) => {\n cleanup();\n controller.abort(reason);\n };\n const listen = (signal: AbortSignal) => {\n const onAbort = () => abort(signal.reason);\n signal.addEventListener(\"abort\", onAbort, { once: true });\n teardown.push(() => signal.removeEventListener(\"abort\", onAbort));\n };\n\n if (callerSignal.aborted) {\n abort(callerSignal.reason);\n } else if (lifecycleSignal.aborted) {\n abort(lifecycleSignal.reason);\n } else {\n listen(callerSignal);\n listen(lifecycleSignal);\n }\n\n return { signal: controller.signal, cleanup };\n};\n\nexport const toWebMcpTool = (\n name: string,\n getTool: () => Tool<any, any>,\n lifecycleSignal?: AbortSignal,\n): WebMcpToolDescriptor => ({\n name,\n description: getTool().description ?? \"\",\n inputSchema: toWebMcpInputSchema(getTool()),\n execute: async (rawArgs, context) => {\n if (lifecycleSignal?.aborted) {\n return errorResult(`Tool \"${name}\" is no longer registered`);\n }\n const tool = getTool();\n const args = (rawArgs ?? {}) as Record<string, unknown>;\n const toolCallId = generateId();\n let cleanup: (() => void) | undefined;\n try {\n const callerSignal = context?.signal;\n let abortSignal: AbortSignal | undefined;\n if (callerSignal && lifecycleSignal) {\n const combined = combineAbortSignals(callerSignal, lifecycleSignal);\n abortSignal = combined.signal;\n cleanup = combined.cleanup;\n } else {\n abortSignal = callerSignal ?? lifecycleSignal;\n }\n\n if (abortSignal?.aborted) {\n return errorResult(\"Tool execution was cancelled.\");\n }\n\n let executeFn = tool.execute;\n if (isStandardSchema(tool.parameters)) {\n const result = tool.parameters[\"~standard\"].validate(args);\n const validation = isThenable(result)\n ? abortSignal\n ? await raceWithAbort(result, abortSignal)\n : await result\n : result;\n if (validation === TOOL_ABORTED) {\n return errorResult(\"Tool execution was cancelled.\");\n }\n if (validation.issues) {\n const issues = validation.issues;\n executeFn =\n tool.experimental_onSchemaValidationError ??\n (() => {\n throw new Error(\n `Function parameter validation failed. ${JSON.stringify(issues)}`,\n );\n });\n }\n }\n\n if (abortSignal?.aborted) {\n return errorResult(\"Tool execution was cancelled.\");\n }\n\n if (!executeFn) {\n return errorResult(`Tool \"${name}\" has no client-side implementation.`);\n }\n\n const result = await executeFn(args, {\n toolCallId,\n abortSignal: abortSignal ?? new AbortController().signal,\n human: () =>\n Promise.reject(\n new Error(\"human input not supported in WebMCP context\"),\n ),\n });\n return await toMcpContent(result, { tool, toolCallId, args });\n } catch (e) {\n return errorResult(e instanceof Error ? e.message : String(e));\n } finally {\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WzB,MAAM,IAChC8B,cACE,MAAMD,cAAc7B,QAAQ8B,WAAW,IACvC,MAAM9B,SACRA;IACJ,IAAI+D,eAAexC,cACjB,OAAOzC,YAAY,+BAA+B;IAEpD,IAAIiF,WAAW3C,QAAQ;KACrB,MAAMA,SAAS2C,WAAW3C;KAC1B0C,YACE1F,KAAK4F,+CACE;MACL,MAAM,IAAIC,MACR,yCAAyC5E,KAAKC,UAAU8B,MAAM,GAChE;KACF;IACJ;GACF;GAEA,IAAIU,aAAaK,SACf,OAAOrD,YAAY,+BAA+B;GAGpD,IAAI,CAACgF,WACH,OAAOhF,YAAY,SAASyE,KAAI,qCAAsC;GAGxE,MAAMvD,SAAS,MAAM8D,UAAU3D,MAAM;IACnCD;IACA4B,aAAaA,eAAe,IAAIgB,gBAAgB,CAAC,CAACH;IAClDuB,aACE7D,QAAQ8D,uBACN,IAAIF,MAAM,6CAA6C,CACzD;GACJ,CAAC;GACD,OAAO,MAAMlE,aAAaC,QAAQ;IAAE5B;IAAM8B;IAAYC;GAAK,CAAC;EAC9D,SAASW,GAAG;GACV,OAAOhC,YAAYgC,aAAamD,QAAQnD,EAAE/B,UAAUQ,OAAOuB,CAAC,CAAC;EAC/D,UAAU;GACR8B,UAAU;EACZ;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"convertTools.js","names":["ToolResponse","toJSONSchema","Tool","ToolModelContentPart","generateId","WebMcpCallToolResult","WebMcpContent","WebMcpToolDescriptor","defaultWebMcpFilter","_name","tool","type","undefined","execute","disabled","toWebMcpInputSchema","parameters","properties","textContent","text","errorResult","message","isError","content","toText","value","toString","JSON","stringify","String","primitiveContent","mapModelContentPart","part","mediaType","startsWith","data","mimeType","toMcpContent","result","options","toolCallId","args","Record","Promise","response","toResponse","modelContent","map","toModelOutput","parts","input","output","e","console","warn","StandardSchemaLike","Extract","NonNullable","isStandardSchema","schema","version","TOOL_ABORTED","Symbol","isThenable","T","PromiseLike","then","raceWithAbort","abortSignal","AbortSignal","onAbort","abortPromise","resolve","aborted","addEventListener","once","race","removeEventListener","combineAbortSignals","callerSignal","lifecycleSignal","signal","cleanup","controller","AbortController","teardown","length","pop","abort","reason","listen","push","toWebMcpTool","name","getTool","description","inputSchema","rawArgs","context","combined","executeFn","validate","validation","issues","experimental_onSchemaValidationError","Error","human","reject"],"sources":["../../../src/unstable/webmcp/convertTools.ts"],"sourcesContent":["import {\n ToolResponse,\n toJSONSchema,\n type Tool,\n type ToolModelContentPart,\n} from \"assistant-stream\";\nimport { generateId } from \"@assistant-ui/core/internal\";\nimport type {\n WebMcpCallToolResult,\n WebMcpContent,\n WebMcpToolDescriptor,\n} from \"./webmcp-host\";\n\n/**\n * The predicate the WebMCP provider uses when no `filter` is passed: an enabled\n * frontend tool with a client-side `execute`. A tool authored without a `type`\n * is included, because `execute` is what distinguishes the deprecated\n * type-less form from a backend or human tool. A `filter` replaces this, so\n * pass it through to narrow the default set rather than widen it.\n */\nexport const defaultWebMcpFilter = (\n _name: string,\n tool: Tool<any, any>,\n): boolean =>\n (tool.type === \"frontend\" || tool.type === undefined) &&\n !!tool.execute &&\n !tool.disabled;\n\nexport const toWebMcpInputSchema = (tool: Tool<any, any>): unknown =>\n tool.parameters\n ? toJSONSchema(tool.parameters)\n : { type: \"object\", properties: {} };\n\nconst textContent = (text: string): WebMcpContent => ({ type: \"text\", text });\n\nconst errorResult = (message: string): WebMcpCallToolResult => ({\n isError: true,\n content: [textContent(message)],\n});\n\n// bigint throws in JSON.stringify and symbol serializes to undefined, but both\n// have a faithful string form. A value that cannot be serialized at all still\n// throws through to the error result.\nconst toText = (value: unknown): string => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"bigint\" || typeof value === \"symbol\") {\n return value.toString();\n }\n return JSON.stringify(value) ?? String(value);\n};\n\nconst primitiveContent = (value: unknown): WebMcpContent[] => [\n textContent(toText(value)),\n];\n\nconst mapModelContentPart = (part: ToolModelContentPart): WebMcpContent => {\n if (part.type === \"text\") {\n return textContent(part.text ?? \"\");\n }\n if (part.type === \"file\") {\n if (\n typeof part.mediaType === \"string\" &&\n part.mediaType.startsWith(\"image/\")\n ) {\n return { type: \"image\", data: part.data ?? \"\", mimeType: part.mediaType };\n }\n return textContent(part.data ?? \"\");\n }\n return textContent(toText(part));\n};\n\nexport const toMcpContent = async (\n result: unknown,\n options: {\n tool: Tool<any, any>;\n toolCallId: string;\n args: Record<string, unknown>;\n },\n): Promise<WebMcpCallToolResult> => {\n const response = ToolResponse.toResponse(result);\n if (response.modelContent) {\n const content = response.modelContent.map(mapModelContentPart);\n return response.isError ? { isError: true, content } : { content };\n }\n if (!response.isError && options.tool.toModelOutput) {\n try {\n const parts = await options.tool.toModelOutput({\n toolCallId: options.toolCallId,\n input: options.args,\n output: response.result,\n });\n return { content: parts.map(mapModelContentPart) };\n } catch (e) {\n console.warn(\n \"[assistant-ui] toModelOutput threw; falling back to default projection.\",\n e,\n );\n }\n }\n const content = primitiveContent(response.result);\n return response.isError ? { isError: true, content } : { content };\n};\n\ntype StandardSchemaLike = Extract<\n NonNullable<Tool[\"parameters\"]>,\n { readonly \"~standard\": unknown }\n>;\n\nconst isStandardSchema = (schema: unknown): schema is StandardSchemaLike =>\n typeof schema === \"object\" &&\n schema !== null &&\n \"~standard\" in schema &&\n (schema as StandardSchemaLike)[\"~standard\"].version === 1;\n\nconst TOOL_ABORTED = Symbol(\"assistant-ui.webmcp-tool-aborted\");\n\nconst isThenable = <T>(value: T | PromiseLike<T>): value is PromiseLike<T> =>\n typeof (value as PromiseLike<T> | null | undefined)?.then === \"function\";\n\nconst raceWithAbort = async <T>(\n value: PromiseLike<T>,\n abortSignal: AbortSignal,\n): Promise<T | typeof TOOL_ABORTED> => {\n let onAbort!: () => void;\n const abortPromise = new Promise<typeof TOOL_ABORTED>((resolve) => {\n onAbort = () => resolve(TOOL_ABORTED);\n if (abortSignal.aborted) {\n onAbort();\n } else {\n abortSignal.addEventListener(\"abort\", onAbort, { once: true });\n }\n });\n\n try {\n // Unlike assistant-stream's helper, cancellation wins when validation aborts and rejects synchronously.\n return await Promise.race([abortPromise, value]);\n } finally {\n abortSignal.removeEventListener(\"abort\", onAbort);\n }\n};\n\n// AbortSignal.any sits above the browserslist floor and rejects any input that\n// is not a native AbortSignal, which a navigator.modelContext polyfill's signal\n// is not. The merged signal tracks its inputs only until cleanup runs, where\n// the single-signal path hands the caller the lifecycle signal itself.\nconst combineAbortSignals = (\n callerSignal: AbortSignal,\n lifecycleSignal: AbortSignal,\n): { signal: AbortSignal; cleanup: () => void } => {\n const controller = new AbortController();\n const teardown: (() => void)[] = [];\n const cleanup = () => {\n while (teardown.length) teardown.pop()!();\n };\n const abort = (reason: unknown) => {\n cleanup();\n controller.abort(reason);\n };\n const listen = (signal: AbortSignal) => {\n const onAbort = () => abort(signal.reason);\n signal.addEventListener(\"abort\", onAbort, { once: true });\n teardown.push(() => signal.removeEventListener(\"abort\", onAbort));\n };\n\n if (callerSignal.aborted) {\n abort(callerSignal.reason);\n } else if (lifecycleSignal.aborted) {\n abort(lifecycleSignal.reason);\n } else {\n listen(callerSignal);\n listen(lifecycleSignal);\n }\n\n return { signal: controller.signal, cleanup };\n};\n\nexport const toWebMcpTool = (\n name: string,\n getTool: () => Tool<any, any>,\n lifecycleSignal?: AbortSignal,\n): WebMcpToolDescriptor => ({\n name,\n description: getTool().description ?? \"\",\n inputSchema: toWebMcpInputSchema(getTool()),\n execute: async (rawArgs, context) => {\n if (lifecycleSignal?.aborted) {\n return errorResult(`Tool \"${name}\" is no longer registered`);\n }\n const tool = getTool();\n let args = (rawArgs ?? {}) as Record<string, unknown>;\n const toolCallId = generateId();\n let cleanup: (() => void) | undefined;\n try {\n const callerSignal = context?.signal;\n let abortSignal: AbortSignal | undefined;\n if (callerSignal && lifecycleSignal) {\n const combined = combineAbortSignals(callerSignal, lifecycleSignal);\n abortSignal = combined.signal;\n cleanup = combined.cleanup;\n } else {\n abortSignal = callerSignal ?? lifecycleSignal;\n }\n\n if (abortSignal?.aborted) {\n return errorResult(\"Tool execution was cancelled.\");\n }\n\n let executeFn = tool.execute;\n if (isStandardSchema(tool.parameters)) {\n const result = tool.parameters[\"~standard\"].validate(args);\n const validation = isThenable(result)\n ? abortSignal\n ? await raceWithAbort(result, abortSignal)\n : await result\n : result;\n if (validation === TOOL_ABORTED) {\n return errorResult(\"Tool execution was cancelled.\");\n }\n if (validation.issues) {\n const issues = validation.issues;\n executeFn =\n tool.experimental_onSchemaValidationError ??\n (() => {\n throw new Error(\n `Function parameter validation failed. ${JSON.stringify(issues)}`,\n );\n });\n } else {\n args = validation.value;\n }\n }\n\n if (abortSignal?.aborted) {\n return errorResult(\"Tool execution was cancelled.\");\n }\n\n if (!executeFn) {\n return errorResult(`Tool \"${name}\" has no client-side implementation.`);\n }\n\n const result = await executeFn(args, {\n toolCallId,\n abortSignal: abortSignal ?? new AbortController().signal,\n human: () =>\n Promise.reject(\n new Error(\"human input not supported in WebMCP context\"),\n ),\n });\n return await toMcpContent(result, { tool, toolCallId, args });\n } catch (e) {\n return errorResult(e instanceof Error ? e.message : String(e));\n } finally {\n cleanup?.();\n }\n },\n});\n"],"mappings":";;;;;;;;;;AAoBA,MAAaQ,uBACXC,OACAC,UAECA,KAAKC,SAAS,cAAcD,KAAKC,SAASC,KAAAA,MAC3C,CAAC,CAACF,KAAKG,WACP,CAACH,KAAKI;AAER,MAAaC,uBAAuBL,SAClCA,KAAKM,aACDf,aAAaS,KAAKM,UAAU,IAC5B;CAAEL,MAAM;CAAUM,YAAY,CAAC;AAAE;AAEvC,MAAMC,eAAeC,UAAiC;CAAER,MAAM;CAAQQ;AAAK;AAE3E,MAAMC,eAAeC,aAA2C;CAC9DC,SAAS;CACTC,SAAS,CAACL,YAAYG,OAAO,CAAC;AAChC;AAKA,MAAMG,UAAUC,UAA2B;CACzC,IAAI,OAAOA,UAAU,UAAU,OAAOA;CACtC,IAAI,OAAOA,UAAU,YAAY,OAAOA,UAAU,UAChD,OAAOA,MAAMC,SAAS;CAExB,OAAOC,KAAKC,UAAUH,KA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zD;GACJ,CAAC;GACD,OAAO,MAAMpE,aAAaC,QAAQ;IAAE5B;IAAM8B;IAAYC;GAAK,CAAC;EAC9D,SAASW,GAAG;GACV,OAAOhC,YAAYgC,aAAaqD,QAAQrD,EAAE/B,UAAUQ,OAAOuB,CAAC,CAAC;EAC/D,UAAU;GACR8B,UAAU;EACZ;CACF;AACF"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Tool } from "assistant-stream";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
filter?: (name: string, tool: Tool<any, any>) => boolean;
|
|
1
|
+
import type { Tool } from "assistant-stream";
|
|
2
|
+
export type Unstable_WebMcpProviderOptions = {
|
|
3
|
+
filter?: (name: string, tool: Tool<any, any>) => boolean;
|
|
5
4
|
};
|
|
6
|
-
type Unstable_WebMcpProviderResult = {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export type Unstable_WebMcpProviderResult = {
|
|
6
|
+
status: "unsupported" | "active";
|
|
7
|
+
registeredToolNames: readonly string[];
|
|
9
8
|
};
|
|
10
9
|
/**
|
|
11
10
|
* Publishes the frontend tools in the model context to a WebMCP-capable
|
|
@@ -15,7 +14,5 @@ type Unstable_WebMcpProviderResult = {
|
|
|
15
14
|
* `document.modelContext` (or `navigator.modelContext`), and the sorted names
|
|
16
15
|
* of the tools currently registered with the host.
|
|
17
16
|
*/
|
|
18
|
-
declare const unstable_useWebMcpProvider: (options?: Unstable_WebMcpProviderOptions) => Unstable_WebMcpProviderResult;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { Unstable_WebMcpProviderOptions, Unstable_WebMcpProviderResult, unstable_useWebMcpProvider };
|
|
17
|
+
export declare const unstable_useWebMcpProvider: (options?: Unstable_WebMcpProviderOptions) => Unstable_WebMcpProviderResult;
|
|
21
18
|
//# sourceMappingURL=useWebMcpProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebMcpProvider.d.ts","
|
|
1
|
+
{"version":3,"file":"useWebMcpProvider.d.ts","sourceRoot":"","sources":["../../../src/unstable/webmcp/useWebMcpProvider.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAU7C,MAAM,MAAM,8BAA8B,GAAG;IAC3C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,aAAa,GAAG,QAAQ,CAAC;IACjC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC,CAAC;AA4FF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,UAAS,8BAAmC,KAC3C,6BAuBF,CAAC"}
|
|
@@ -4,8 +4,8 @@ import { getDefaultWebMcpHost } from "./webmcp-host.js";
|
|
|
4
4
|
import { defaultWebMcpFilter, toWebMcpInputSchema } from "./convertTools.js";
|
|
5
5
|
import { WebMcpRegistrationResource } from "./WebMcpRegistrationResource.js";
|
|
6
6
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
7
|
-
import { useAui } from "@assistant-ui/store";
|
|
8
7
|
import { useEffect, useState, useSyncExternalStore } from "@assistant-ui/tap/react-shim";
|
|
8
|
+
import { useAui } from "@assistant-ui/store";
|
|
9
9
|
import { useResources, useTapRoot, withKey } from "@assistant-ui/tap";
|
|
10
10
|
import { shallowEqual } from "@assistant-ui/store/internal";
|
|
11
11
|
//#region src/unstable/webmcp/useWebMcpProvider.ts
|
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
text: string;
|
|
1
|
+
export type WebMcpContent = {
|
|
2
|
+
type: "text";
|
|
3
|
+
text: string;
|
|
5
4
|
} | {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
type: "image";
|
|
6
|
+
data: string;
|
|
7
|
+
mimeType: string;
|
|
9
8
|
};
|
|
10
|
-
type WebMcpCallToolResult = {
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export type WebMcpCallToolResult = {
|
|
10
|
+
content: WebMcpContent[];
|
|
11
|
+
isError?: boolean;
|
|
13
12
|
};
|
|
14
|
-
type WebMcpToolDescriptor = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
export type WebMcpToolDescriptor = {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema: unknown;
|
|
17
|
+
execute: (args: unknown, context?: {
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
}) => Promise<WebMcpCallToolResult>;
|
|
21
20
|
};
|
|
22
|
-
type WebMcpModelContext = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
export type WebMcpModelContext = {
|
|
22
|
+
/**
|
|
23
|
+
* Aborting `options.signal` is what unregisters the tool. The explainer
|
|
24
|
+
* defines no other removal method, and a name-keyed one could not be used
|
|
25
|
+
* safely: a later registration may already hold the name.
|
|
26
|
+
*/
|
|
27
|
+
registerTool(tool: WebMcpToolDescriptor, options?: {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}): Promise<void> | void;
|
|
31
30
|
};
|
|
32
|
-
type WebMcpHost = {
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export type WebMcpHost = {
|
|
32
|
+
available: boolean;
|
|
33
|
+
registerTool(def: WebMcpToolDescriptor, onError?: (error: unknown) => void): () => void;
|
|
35
34
|
};
|
|
36
|
-
declare const getDefaultWebMcpHost: () => WebMcpHost;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { WebMcpCallToolResult, WebMcpContent, WebMcpHost, WebMcpModelContext, WebMcpToolDescriptor, getDefaultWebMcpHost };
|
|
35
|
+
export declare const getDefaultWebMcpHost: () => WebMcpHost;
|
|
39
36
|
//# sourceMappingURL=webmcp-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webmcp-host.d.ts","
|
|
1
|
+
{"version":3,"file":"webmcp-host.d.ts","sourceRoot":"","sources":["../../../src/unstable/webmcp/webmcp-host.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CACP,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,YAAY,CACV,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACjC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CACV,GAAG,EAAE,oBAAoB,EACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACjC,MAAM,IAAI,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,oBAAoB,QAAO,UASvC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ComponentProps, ComponentPropsWithoutRef, ComponentRef, ElementType, ForwardRefExoticComponent, ReactElement, ReactNode, RefAttributes } from "react";
|
|
2
|
-
import { Primitive as
|
|
1
|
+
import { type ComponentProps, type ComponentPropsWithoutRef, type ComponentRef, type ElementType, type ForwardRefExoticComponent, type ReactElement, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
import { Primitive as RadixPrimitive } from "radix-ui/internal";
|
|
3
3
|
import { Slot } from "radix-ui";
|
|
4
|
-
//#region src/utils/Primitive.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Thin wrapper around Radix `Primitive` that adds `render` prop support.
|
|
7
6
|
*
|
|
@@ -14,9 +13,9 @@ import { Slot } from "radix-ui";
|
|
|
14
13
|
declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul"];
|
|
15
14
|
type PrimitiveNode = (typeof NODES)[number];
|
|
16
15
|
type WithRenderPropProps<T extends ElementType> = ComponentPropsWithoutRef<T> & {
|
|
17
|
-
|
|
16
|
+
render?: ReactElement | undefined;
|
|
18
17
|
};
|
|
19
|
-
type PrimitiveProps<E extends PrimitiveNode> = WithRenderPropProps<(typeof
|
|
18
|
+
type PrimitiveProps<E extends PrimitiveNode> = WithRenderPropProps<(typeof RadixPrimitive)[E]>;
|
|
20
19
|
/**
|
|
21
20
|
* Composes a `render` element at a call site that has already computed its props.
|
|
22
21
|
*
|
|
@@ -26,92 +25,92 @@ type PrimitiveProps<E extends PrimitiveNode> = WithRenderPropProps<(typeof Primi
|
|
|
26
25
|
declare function renderSlot(render: ReactElement, children: ReactNode, props: ComponentProps<typeof Slot.Root>): ReactElement;
|
|
27
26
|
declare function withRenderProp<T extends ElementType>(Component: T): ForwardRefExoticComponent<WithRenderPropProps<T> & RefAttributes<ComponentRef<T>>>;
|
|
28
27
|
declare const Primitive: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
28
|
+
input: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
29
|
+
asChild?: boolean;
|
|
30
|
+
}, "ref"> & {
|
|
31
|
+
render?: ReactElement | undefined;
|
|
32
|
+
} & RefAttributes<HTMLInputElement>>;
|
|
33
|
+
select: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSelectElement> & import("react").SelectHTMLAttributes<HTMLSelectElement> & {
|
|
34
|
+
asChild?: boolean;
|
|
35
|
+
}, "ref"> & {
|
|
36
|
+
render?: ReactElement | undefined;
|
|
37
|
+
} & RefAttributes<HTMLSelectElement>>;
|
|
38
|
+
div: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
39
|
+
asChild?: boolean;
|
|
40
|
+
}, "ref"> & {
|
|
41
|
+
render?: ReactElement | undefined;
|
|
42
|
+
} & RefAttributes<HTMLDivElement>>;
|
|
43
|
+
a: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
}, "ref"> & {
|
|
46
|
+
render?: ReactElement | undefined;
|
|
47
|
+
} & RefAttributes<HTMLAnchorElement>>;
|
|
48
|
+
button: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
}, "ref"> & {
|
|
51
|
+
render?: ReactElement | undefined;
|
|
52
|
+
} & RefAttributes<HTMLButtonElement>>;
|
|
53
|
+
form: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
|
|
54
|
+
asChild?: boolean;
|
|
55
|
+
}, "ref"> & {
|
|
56
|
+
render?: ReactElement | undefined;
|
|
57
|
+
} & RefAttributes<HTMLFormElement>>;
|
|
58
|
+
h2: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
}, "ref"> & {
|
|
61
|
+
render?: ReactElement | undefined;
|
|
62
|
+
} & RefAttributes<HTMLHeadingElement>>;
|
|
63
|
+
h3: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
64
|
+
asChild?: boolean;
|
|
65
|
+
}, "ref"> & {
|
|
66
|
+
render?: ReactElement | undefined;
|
|
67
|
+
} & RefAttributes<HTMLHeadingElement>>;
|
|
68
|
+
img: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & {
|
|
69
|
+
asChild?: boolean;
|
|
70
|
+
}, "ref"> & {
|
|
71
|
+
render?: ReactElement | undefined;
|
|
72
|
+
} & RefAttributes<HTMLImageElement>>;
|
|
73
|
+
label: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLabelElement> & import("react").LabelHTMLAttributes<HTMLLabelElement> & {
|
|
74
|
+
asChild?: boolean;
|
|
75
|
+
}, "ref"> & {
|
|
76
|
+
render?: ReactElement | undefined;
|
|
77
|
+
} & RefAttributes<HTMLLabelElement>>;
|
|
78
|
+
li: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & {
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
}, "ref"> & {
|
|
81
|
+
render?: ReactElement | undefined;
|
|
82
|
+
} & RefAttributes<HTMLLIElement>>;
|
|
83
|
+
nav: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement> & {
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
}, "ref"> & {
|
|
86
|
+
render?: ReactElement | undefined;
|
|
87
|
+
} & RefAttributes<HTMLElement>>;
|
|
88
|
+
ol: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLOListElement> & import("react").OlHTMLAttributes<HTMLOListElement> & {
|
|
89
|
+
asChild?: boolean;
|
|
90
|
+
}, "ref"> & {
|
|
91
|
+
render?: ReactElement | undefined;
|
|
92
|
+
} & RefAttributes<HTMLOListElement>>;
|
|
93
|
+
p: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & {
|
|
94
|
+
asChild?: boolean;
|
|
95
|
+
}, "ref"> & {
|
|
96
|
+
render?: ReactElement | undefined;
|
|
97
|
+
} & RefAttributes<HTMLParagraphElement>>;
|
|
98
|
+
span: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
99
|
+
asChild?: boolean;
|
|
100
|
+
}, "ref"> & {
|
|
101
|
+
render?: ReactElement | undefined;
|
|
102
|
+
} & RefAttributes<HTMLSpanElement>>;
|
|
103
|
+
ul: ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLUListElement> & import("react").HTMLAttributes<HTMLUListElement> & {
|
|
104
|
+
asChild?: boolean;
|
|
105
|
+
}, "ref"> & {
|
|
106
|
+
render?: ReactElement | undefined;
|
|
107
|
+
} & RefAttributes<HTMLUListElement>>;
|
|
108
|
+
svg: ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement> & {
|
|
109
|
+
asChild?: boolean;
|
|
110
|
+
}, "ref"> & {
|
|
111
|
+
render?: ReactElement | undefined;
|
|
112
|
+
} & RefAttributes<SVGSVGElement>>;
|
|
114
113
|
};
|
|
115
|
-
|
|
116
|
-
export {
|
|
114
|
+
export { Primitive, renderSlot, withRenderProp };
|
|
115
|
+
export type { PrimitiveProps, WithRenderPropProps };
|
|
117
116
|
//# sourceMappingURL=Primitive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Primitive.d.ts","
|
|
1
|
+
{"version":3,"file":"Primitive.d.ts","sourceRoot":"","sources":["../../src/utils/Primitive.tsx"],"names":[],"mappings":"AA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AS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;;;;iBAAxB,YAAY,GAAG,SAAS;;CA4GpC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { RequireAtLeastOne };
|
|
1
|
+
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
2
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
3
|
+
}[Keys];
|
|
5
4
|
//# sourceMappingURL=RequireAtLeastOne.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequireAtLeastOne.d.ts","
|
|
1
|
+
{"version":3,"file":"RequireAtLeastOne.d.ts","sourceRoot":"","sources":["../../src/utils/RequireAtLeastOne.ts"],"names":[],"mappings":"AAAA,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"}
|