@assistant-ui/react 0.12.10 → 0.12.12
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 +68 -58
- package/dist/client/ExternalThread.d.ts +1 -1
- package/dist/client/ExternalThread.d.ts.map +1 -1
- package/dist/client/ExternalThread.js +138 -127
- package/dist/client/ExternalThread.js.map +1 -1
- package/dist/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/client/InMemoryThreadList.js +62 -54
- package/dist/client/InMemoryThreadList.js.map +1 -1
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +7 -4
- package/dist/client/index.js.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.d.ts +1 -7
- package/dist/context/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.js +1 -22
- package/dist/context/providers/AttachmentByIndexProvider.js.map +1 -1
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts +1 -5
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.js +1 -19
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
- package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts +1 -4
- package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/ChainOfThoughtPartByIndexProvider.js +1 -12
- package/dist/context/providers/ChainOfThoughtPartByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.d.ts +1 -4
- package/dist/context/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.js +1 -17
- package/dist/context/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageProvider.d.ts +1 -1
- package/dist/context/providers/MessageProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageProvider.js +1 -1
- package/dist/context/providers/MessageProvider.js.map +1 -1
- package/dist/context/providers/PartByIndexProvider.d.ts +1 -4
- package/dist/context/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/PartByIndexProvider.js +1 -12
- package/dist/context/providers/PartByIndexProvider.js.map +1 -1
- package/dist/context/providers/SuggestionByIndexProvider.d.ts +1 -5
- package/dist/context/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/SuggestionByIndexProvider.js +1 -12
- package/dist/context/providers/SuggestionByIndexProvider.js.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.d.ts +1 -5
- package/dist/context/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.js +1 -28
- package/dist/context/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.d.ts +1 -9
- package/dist/context/providers/ThreadListItemProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.js +1 -19
- package/dist/context/providers/ThreadListItemProvider.js.map +1 -1
- package/dist/context/providers/index.d.ts +1 -0
- package/dist/context/providers/index.d.ts.map +1 -1
- package/dist/context/providers/index.js +1 -0
- package/dist/context/providers/index.js.map +1 -1
- package/dist/context/react/utils/useRuntimeState.d.ts +1 -1
- package/dist/context/react/utils/useRuntimeState.d.ts.map +1 -1
- package/dist/context/react/utils/useRuntimeState.js.map +1 -1
- package/dist/context/stores/ThreadViewport.d.ts +1 -1
- package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
- package/dist/context/stores/ThreadViewport.js.map +1 -1
- package/dist/devtools/DevToolsHooks.d.ts +1 -1
- package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
- package/dist/hooks/useMessageQuote.d.ts +1 -1
- package/dist/hooks/useMessageQuote.d.ts.map +1 -1
- package/dist/hooks/useMessageTiming.d.ts +17 -0
- package/dist/hooks/useMessageTiming.d.ts.map +1 -0
- package/dist/hooks/useMessageTiming.js +20 -0
- package/dist/hooks/useMessageTiming.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +3 -11
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -9
- package/dist/internal.js.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +8 -9
- package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.d.ts +1 -2
- package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.js +1 -35
- package/dist/legacy-runtime/RuntimeAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +2 -2
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +384 -80
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.d.ts +8 -9
- package/dist/legacy-runtime/cloud/auiV0.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.js +20 -45
- package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js +4 -5
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/hooks/AssistantContext.d.ts +11 -11
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +436 -268
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/ComposerContext.d.ts +11 -11
- package/dist/legacy-runtime/hooks/MessageContext.d.ts +22 -22
- package/dist/legacy-runtime/hooks/MessagePartContext.d.ts +11 -11
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts +22 -22
- package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts +11 -11
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts +2 -63
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/AssistantRuntime.js +1 -45
- package/dist/legacy-runtime/runtime/AssistantRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts +2 -62
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/AttachmentRuntime.js +1 -55
- package/dist/legacy-runtime/runtime/AttachmentRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +3 -183
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ComposerRuntime.js +1 -249
- package/dist/legacy-runtime/runtime/ComposerRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts +2 -39
- package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/MessagePartRuntime.js +1 -66
- package/dist/legacy-runtime/runtime/MessagePartRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/MessageRuntime.d.ts +3 -91
- package/dist/legacy-runtime/runtime/MessageRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/MessageRuntime.js +1 -200
- package/dist/legacy-runtime/runtime/MessageRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts +2 -36
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimeBindings.js +3 -0
- package/dist/legacy-runtime/runtime/RuntimeBindings.js.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts +1 -63
- package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +4 -49
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js +1 -87
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts +3 -43
- package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListRuntime.js +1 -138
- package/dist/legacy-runtime/runtime/ThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +3 -272
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadRuntime.js +1 -242
- package/dist/legacy-runtime/runtime/ThreadRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/index.d.ts +1 -8
- package/dist/legacy-runtime/runtime/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.d.ts +2 -4
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.js +2 -3
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.d.ts +2 -3
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.js +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.js +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +23 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +19 -15
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +119 -28
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.d.ts +1 -10
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js +1 -19
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +1 -57
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +1 -326
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts +1 -27
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js +1 -49
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts +1 -23
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js +1 -40
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts +1 -16
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts +1 -11
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js +1 -10
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +1 -66
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js +1 -159
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +1 -64
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts +1 -36
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +1 -110
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/index.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/core/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts +1 -80
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts +1 -8
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js +1 -18
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts +2 -41
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js +1 -173
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts +1 -46
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js +1 -259
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts +2 -6
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js +1 -11
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts +2 -33
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js +1 -126
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts +1 -4
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js +1 -31
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +2 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +12 -7
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.d.ts +2 -8
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.js +2 -22
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/external-store/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.js +2 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/index.d.ts +2 -1
- package/dist/legacy-runtime/runtime-cores/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/index.js +1 -1
- package/dist/legacy-runtime/runtime-cores/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts +1 -38
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts +1 -10
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js +1 -21
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +10 -30
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts +2 -45
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js +1 -86
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts +1 -58
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js +1 -415
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.js +1 -0
- package/dist/legacy-runtime/runtime-cores/local/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js +1 -13
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts +1 -7
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js +1 -37
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js +1 -145
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts +1 -22
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js +1 -56
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +39 -39
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +41 -67
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +13 -72
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js +10 -3
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts +1 -12
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js +1 -28
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.js +2 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts +1 -38
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.js.map +1 -1
- 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 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +15 -6
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts +3 -163
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js +2 -393
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js.map +1 -1
- package/dist/model-context/frame/index.d.ts +4 -3
- package/dist/model-context/frame/index.d.ts.map +1 -1
- package/dist/model-context/frame/index.js +3 -3
- package/dist/model-context/frame/index.js.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.d.ts +2 -2
- package/dist/model-context/frame/useAssistantFrameHost.d.ts.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.js +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.js.map +1 -1
- package/dist/model-context/index.d.ts +5 -11
- package/dist/model-context/index.d.ts.map +1 -1
- package/dist/model-context/index.js +7 -9
- package/dist/model-context/index.js.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +1 -1
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/model-context/registry/index.d.ts +2 -2
- package/dist/model-context/registry/index.d.ts.map +1 -1
- package/dist/model-context/registry/index.js +1 -2
- package/dist/model-context/registry/index.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreContent.js +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreContent.js.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreItem.js +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreItem.js.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.js +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.js.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js +1 -1
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js.map +1 -1
- package/dist/primitives/actionBarMore/scope.d.ts +1 -1
- package/dist/primitives/actionBarMore/scope.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/scope.js +1 -1
- package/dist/primitives/actionBarMore/scope.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalAnchor.d.ts +1 -1
- package/dist/primitives/assistantModal/AssistantModalAnchor.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalAnchor.js +1 -1
- package/dist/primitives/assistantModal/AssistantModalAnchor.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.js +1 -1
- package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.js +1 -1
- package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
- package/dist/primitives/assistantModal/scope.d.ts +1 -1
- package/dist/primitives/assistantModal/scope.d.ts.map +1 -1
- package/dist/primitives/assistantModal/scope.js +1 -1
- package/dist/primitives/assistantModal/scope.js.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts +1 -38
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.js +1 -38
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachmentDropzone.js +2 -2
- package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts +1 -36
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js +1 -61
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerDictate.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerDictate.js.map +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts +2 -17
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerIf.js +1 -23
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +2 -2
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +1 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts +1 -36
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/primitives/message/MessageAttachments.js +1 -65
- package/dist/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/primitives/message/MessageError.d.ts.map +1 -1
- package/dist/primitives/message/MessageError.js.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +1 -1
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js +1 -1
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts +5 -211
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +29 -256
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts +8 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.js +19 -5
- package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartFile.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartImage.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartSource.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.d.ts +3 -3
- package/dist/primitives/messagePart/useMessagePartText.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.d.ts.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js.map +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.d.ts +3 -0
- package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +4 -1
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadIf.js +1 -1
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +1 -94
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +1 -109
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestions.d.ts +1 -52
- package/dist/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestions.js +1 -56
- package/dist/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/primitives/thread/ThreadViewportSlack.js +2 -2
- package/dist/primitives/thread/ThreadViewportSlack.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.d.ts +1 -34
- package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js +1 -35
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +1 -7
- package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.js +1 -7
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js.map +1 -1
- package/dist/primitives/threadListItemMore/scope.d.ts +1 -1
- package/dist/primitives/threadListItemMore/scope.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/scope.js +1 -1
- package/dist/primitives/threadListItemMore/scope.js.map +1 -1
- package/dist/types/index.d.ts +3 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/scopes/index.d.ts +2 -12
- package/dist/types/scopes/index.d.ts.map +1 -1
- package/dist/utils/RequireAtLeastOne.d.ts.map +1 -1
- package/dist/utils/RequireAtLeastOne.js.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.d.ts.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.d.ts.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts +1 -2
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +17 -7
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.d.ts.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
- package/package.json +11 -10
- package/src/client/ExternalThread.ts +148 -135
- package/src/client/InMemoryThreadList.ts +68 -55
- package/src/client/index.ts +9 -4
- package/src/context/providers/AttachmentByIndexProvider.tsx +4 -34
- package/src/context/providers/ChainOfThoughtByIndicesProvider.tsx +1 -34
- package/src/context/providers/ChainOfThoughtPartByIndexProvider.tsx +1 -18
- package/src/context/providers/MessageByIndexProvider.tsx +1 -23
- package/src/context/providers/MessageProvider.tsx +2 -2
- package/src/context/providers/PartByIndexProvider.tsx +1 -18
- package/src/context/providers/SuggestionByIndexProvider.tsx +4 -21
- package/src/context/providers/TextMessagePartProvider.tsx +1 -49
- package/src/context/providers/ThreadListItemProvider.tsx +4 -33
- package/src/context/providers/index.ts +1 -0
- package/src/context/react/utils/useRuntimeState.ts +1 -1
- package/src/context/stores/{ThreadViewport.tsx → ThreadViewport.ts} +1 -1
- package/src/devtools/DevToolsHooks.ts +1 -1
- package/src/hooks/useMessageQuote.ts +1 -1
- package/src/hooks/useMessageTiming.ts +24 -0
- package/src/index.ts +1 -1
- package/src/internal.ts +22 -13
- package/src/legacy-runtime/AssistantRuntimeProvider.tsx +12 -18
- package/src/legacy-runtime/RuntimeAdapter.ts +1 -48
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.ts +646 -0
- package/src/legacy-runtime/cloud/auiV0.ts +29 -53
- package/src/legacy-runtime/cloud/{useCloudThreadListRuntime.tsx → useCloudThreadListRuntime.ts} +5 -7
- package/src/legacy-runtime/runtime/AssistantRuntime.ts +2 -111
- package/src/legacy-runtime/runtime/AttachmentRuntime.ts +7 -119
- package/src/legacy-runtime/runtime/ComposerRuntime.ts +15 -497
- package/src/legacy-runtime/runtime/MessagePartRuntime.ts +2 -117
- package/src/legacy-runtime/runtime/MessageRuntime.ts +3 -335
- package/src/legacy-runtime/runtime/RuntimeBindings.ts +12 -69
- package/src/legacy-runtime/runtime/RuntimePathTypes.ts +8 -61
- package/src/legacy-runtime/runtime/ThreadListItemRuntime.ts +7 -152
- package/src/legacy-runtime/runtime/ThreadListRuntime.ts +6 -224
- package/src/legacy-runtime/runtime/ThreadRuntime.ts +14 -561
- package/src/legacy-runtime/runtime/index.ts +10 -13
- package/src/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.tsx +4 -2
- package/src/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.ts +5 -5
- package/src/legacy-runtime/runtime-cores/adapters/attachment/index.ts +9 -4
- package/src/legacy-runtime/runtime-cores/adapters/feedback/index.ts +2 -1
- package/src/legacy-runtime/runtime-cores/adapters/speech/index.ts +6 -3
- package/src/legacy-runtime/runtime-cores/adapters/suggestion/index.ts +2 -1
- package/src/legacy-runtime/runtime-cores/adapters/thread-history/index.ts +9 -2
- package/src/legacy-runtime/runtime-cores/assistant-transport/index.ts +1 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/transport-scheduling.test.ts +136 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +26 -1
- package/src/legacy-runtime/runtime-cores/assistant-transport/{useAssistantTransportRuntime.tsx → useAssistantTransportRuntime.ts} +27 -18
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.test.ts +223 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +171 -42
- package/src/legacy-runtime/runtime-cores/assistant-transport/utils.ts +5 -37
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.ts +6 -0
- package/src/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.ts +4 -0
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.ts +13 -0
- package/src/legacy-runtime/runtime-cores/core/index.ts +3 -3
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.ts +6 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.ts +2 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.ts +4 -0
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.ts +2 -23
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.ts +2 -0
- package/src/legacy-runtime/runtime-cores/external-store/auto-status.ts +1 -0
- package/src/legacy-runtime/runtime-cores/external-store/{createMessageConverter.tsx → createMessageConverter.ts} +1 -1
- package/src/legacy-runtime/runtime-cores/external-store/{external-message-converter.tsx → external-message-converter.ts} +32 -25
- package/src/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.ts +6 -0
- package/src/legacy-runtime/runtime-cores/external-store/index.ts +10 -6
- package/src/legacy-runtime/runtime-cores/external-store/{useExternalStoreRuntime.tsx → useExternalStoreRuntime.ts} +1 -1
- package/src/legacy-runtime/runtime-cores/index.ts +3 -4
- package/src/legacy-runtime/runtime-cores/local/ChatModelAdapter.ts +7 -0
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.ts +36 -0
- package/src/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.ts +2 -0
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/local/index.ts +10 -6
- package/src/legacy-runtime/runtime-cores/local/shouldContinue.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.ts +1 -89
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +33 -136
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.tsx +11 -3
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/index.ts +5 -3
- package/src/legacy-runtime/runtime-cores/remote-thread-list/types.ts +7 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/{useRemoteThreadListRuntime.tsx → useRemoteThreadListRuntime.ts} +29 -9
- package/src/legacy-runtime/runtime-cores/utils/MessageRepository.ts +3 -0
- package/src/model-context/frame/AssistantFrame.test.ts +6 -4
- package/src/model-context/frame/index.ts +9 -3
- package/src/model-context/frame/useAssistantFrameHost.ts +2 -2
- package/src/model-context/index.ts +33 -17
- package/src/model-context/makeAssistantVisible.tsx +1 -1
- package/src/model-context/registry/index.ts +6 -2
- package/src/primitives/actionBarMore/ActionBarMoreContent.tsx +1 -1
- package/src/primitives/actionBarMore/ActionBarMoreItem.tsx +1 -1
- package/src/primitives/actionBarMore/ActionBarMoreRoot.tsx +1 -1
- package/src/primitives/actionBarMore/ActionBarMoreSeparator.tsx +1 -1
- package/src/primitives/actionBarMore/ActionBarMoreTrigger.tsx +1 -1
- package/src/primitives/actionBarMore/{scope.tsx → scope.ts} +1 -1
- package/src/primitives/assistantModal/AssistantModalAnchor.tsx +1 -1
- package/src/primitives/assistantModal/AssistantModalContent.tsx +1 -1
- package/src/primitives/assistantModal/AssistantModalRoot.tsx +1 -1
- package/src/primitives/assistantModal/AssistantModalTrigger.tsx +1 -1
- package/src/primitives/assistantModal/{scope.tsx → scope.ts} +1 -1
- package/src/primitives/chainOfThought/ChainOfThoughtParts.tsx +1 -85
- package/src/primitives/composer/ComposerAttachmentDropzone.tsx +2 -2
- package/src/primitives/composer/ComposerAttachments.tsx +4 -110
- package/src/primitives/composer/ComposerIf.ts +4 -0
- package/src/primitives/composer/ComposerInput.tsx +2 -2
- package/src/primitives/index.ts +1 -0
- package/src/primitives/message/MessageAttachments.tsx +4 -113
- package/src/primitives/message/{MessageIf.tsx → MessageIf.ts} +1 -1
- package/src/primitives/message/MessageParts.tsx +43 -612
- package/src/primitives/message/MessagePartsGrouped.tsx +38 -6
- package/src/primitives/messagePart/{useMessagePartData.tsx → useMessagePartData.ts} +1 -1
- package/src/primitives/messagePart/{useMessagePartFile.tsx → useMessagePartFile.ts} +1 -2
- package/src/primitives/messagePart/{useMessagePartImage.tsx → useMessagePartImage.ts} +1 -2
- package/src/primitives/messagePart/{useMessagePartReasoning.tsx → useMessagePartReasoning.ts} +4 -2
- package/src/primitives/messagePart/{useMessagePartSource.tsx → useMessagePartSource.ts} +1 -2
- package/src/primitives/messagePart/{useMessagePartText.tsx → useMessagePartText.ts} +5 -2
- package/src/primitives/selectionToolbar/SelectionToolbarQuote.tsx +1 -1
- package/src/primitives/thread/{ThreadEmpty.tsx → ThreadEmpty.ts} +4 -3
- package/src/primitives/thread/{ThreadIf.tsx → ThreadIf.ts} +1 -1
- package/src/primitives/thread/ThreadMessages.tsx +4 -217
- package/src/primitives/thread/ThreadSuggestions.tsx +4 -106
- package/src/primitives/thread/ThreadViewportSlack.tsx +2 -2
- package/src/primitives/threadList/ThreadListItems.tsx +4 -79
- package/src/primitives/threadListItem/ThreadListItemTitle.test.tsx +56 -0
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +1 -17
- package/src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx +1 -1
- package/src/primitives/threadListItemMore/ThreadListItemMoreItem.tsx +1 -1
- package/src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx +1 -1
- package/src/primitives/threadListItemMore/ThreadListItemMoreSeparator.tsx +1 -1
- package/src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx +1 -1
- package/src/primitives/threadListItemMore/{scope.tsx → scope.ts} +1 -1
- package/src/tests/BaseComposerRuntimeCore.test.ts +423 -0
- package/src/tests/BaseSubscribable.test.ts +54 -0
- package/src/tests/DataRenderers.test.ts +222 -0
- package/src/tests/ExternalStoreThreadRuntimeCore.test.ts +510 -0
- package/src/tests/LocalThreadRuntimeCore.test.ts +321 -0
- package/src/tests/external-message-converter.test.ts +1 -1
- package/src/tests/shouldContinue.test.ts +89 -0
- package/src/types/index.ts +11 -11
- package/src/types/scopes/index.ts +12 -22
- package/src/utils/smooth/SmoothContext.tsx +2 -2
- package/src/utils/smooth/{useSmooth.tsx → useSmooth.ts} +21 -10
- package/dist/client/ChainOfThoughtClient.d.ts +0 -15
- package/dist/client/ChainOfThoughtClient.d.ts.map +0 -1
- package/dist/client/ChainOfThoughtClient.js +0 -21
- package/dist/client/ChainOfThoughtClient.js.map +0 -1
- package/dist/client/ModelContextClient.d.ts +0 -3
- package/dist/client/ModelContextClient.d.ts.map +0 -1
- package/dist/client/ModelContextClient.js +0 -17
- package/dist/client/ModelContextClient.js.map +0 -1
- package/dist/client/NoOpComposerClient.d.ts +0 -7
- package/dist/client/NoOpComposerClient.d.ts.map +0 -1
- package/dist/client/NoOpComposerClient.js +0 -65
- package/dist/client/NoOpComposerClient.js.map +0 -1
- package/dist/client/Suggestions.d.ts +0 -11
- package/dist/client/Suggestions.d.ts.map +0 -1
- package/dist/client/Suggestions.js +0 -43
- package/dist/client/Suggestions.js.map +0 -1
- package/dist/client/ThreadMessageClient.d.ts +0 -11
- package/dist/client/ThreadMessageClient.d.ts.map +0 -1
- package/dist/client/ThreadMessageClient.js +0 -121
- package/dist/client/ThreadMessageClient.js.map +0 -1
- package/dist/client/Tools.d.ts +0 -8
- package/dist/client/Tools.d.ts.map +0 -1
- package/dist/client/Tools.js +0 -68
- package/dist/client/Tools.js.map +0 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js +0 -14
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts +0 -13
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js +0 -86
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js +0 -15
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts +0 -11
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.js +0 -81
- package/dist/legacy-runtime/client/MessageRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js +0 -44
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts +0 -11
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js +0 -57
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js +0 -94
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.d.ts +0 -11
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.js +0 -31
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.d.ts +0 -13
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.js +0 -37
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.d.ts +0 -13
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.js +0 -34
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.d.ts +0 -12
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.js +0 -39
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.d.ts +0 -3
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.js +0 -2
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.d.ts +0 -13
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.js +0 -41
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.d.ts +0 -16
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.js +0 -2
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.d.ts +0 -2
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.js +0 -16
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.d.ts +0 -64
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.d.ts +0 -13
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.js +0 -79
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.d.ts +0 -11
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.js +0 -35
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.d.ts +0 -11
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.js +0 -35
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.d.ts +0 -43
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.d.ts +0 -110
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.d.ts +0 -61
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.js +0 -152
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.d.ts +0 -5
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.js +0 -42
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.d.ts +0 -10
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.d.ts +0 -21
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.d.ts +0 -16
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.js.map +0 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.d.ts +0 -3
- package/dist/legacy-runtime/util-hooks/tapSubscribable.d.ts.map +0 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.js +0 -12
- package/dist/legacy-runtime/util-hooks/tapSubscribable.js.map +0 -1
- package/dist/model-context/ModelContextTypes.d.ts +0 -29
- package/dist/model-context/ModelContextTypes.d.ts.map +0 -1
- package/dist/model-context/ModelContextTypes.js +0 -41
- package/dist/model-context/ModelContextTypes.js.map +0 -1
- package/dist/model-context/frame/AssistantFrameHost.d.ts +0 -37
- package/dist/model-context/frame/AssistantFrameHost.d.ts.map +0 -1
- package/dist/model-context/frame/AssistantFrameHost.js +0 -161
- package/dist/model-context/frame/AssistantFrameHost.js.map +0 -1
- package/dist/model-context/frame/AssistantFrameProvider.d.ts +0 -41
- package/dist/model-context/frame/AssistantFrameProvider.d.ts.map +0 -1
- package/dist/model-context/frame/AssistantFrameProvider.js +0 -167
- package/dist/model-context/frame/AssistantFrameProvider.js.map +0 -1
- package/dist/model-context/frame/AssistantFrameTypes.d.ts +0 -29
- package/dist/model-context/frame/AssistantFrameTypes.d.ts.map +0 -1
- package/dist/model-context/frame/AssistantFrameTypes.js +0 -2
- package/dist/model-context/frame/AssistantFrameTypes.js.map +0 -1
- package/dist/model-context/makeAssistantTool.d.ts +0 -7
- package/dist/model-context/makeAssistantTool.d.ts.map +0 -1
- package/dist/model-context/makeAssistantTool.js +0 -11
- package/dist/model-context/makeAssistantTool.js.map +0 -1
- package/dist/model-context/makeAssistantToolUI.d.ts +0 -7
- package/dist/model-context/makeAssistantToolUI.d.ts.map +0 -1
- package/dist/model-context/makeAssistantToolUI.js +0 -11
- package/dist/model-context/makeAssistantToolUI.js.map +0 -1
- package/dist/model-context/registry/ModelContextRegistry.d.ts +0 -19
- package/dist/model-context/registry/ModelContextRegistry.d.ts.map +0 -1
- package/dist/model-context/registry/ModelContextRegistry.js +0 -114
- package/dist/model-context/registry/ModelContextRegistry.js.map +0 -1
- package/dist/model-context/registry/ModelContextRegistryHandles.d.ts +0 -14
- package/dist/model-context/registry/ModelContextRegistryHandles.d.ts.map +0 -1
- package/dist/model-context/registry/ModelContextRegistryHandles.js +0 -2
- package/dist/model-context/registry/ModelContextRegistryHandles.js.map +0 -1
- package/dist/model-context/tool.d.ts +0 -3
- package/dist/model-context/tool.d.ts.map +0 -1
- package/dist/model-context/tool.js +0 -5
- package/dist/model-context/tool.js.map +0 -1
- package/dist/model-context/toolbox.d.ts +0 -10
- package/dist/model-context/toolbox.d.ts.map +0 -1
- package/dist/model-context/toolbox.js +0 -3
- package/dist/model-context/toolbox.js.map +0 -1
- package/dist/model-context/useAssistantInstructions.d.ts +0 -6
- package/dist/model-context/useAssistantInstructions.d.ts.map +0 -1
- package/dist/model-context/useAssistantInstructions.js +0 -23
- package/dist/model-context/useAssistantInstructions.js.map +0 -1
- package/dist/model-context/useAssistantTool.d.ts +0 -8
- package/dist/model-context/useAssistantTool.d.ts.map +0 -1
- package/dist/model-context/useAssistantTool.js +0 -23
- package/dist/model-context/useAssistantTool.js.map +0 -1
- package/dist/model-context/useAssistantToolUI.d.ts +0 -7
- package/dist/model-context/useAssistantToolUI.d.ts.map +0 -1
- package/dist/model-context/useAssistantToolUI.js +0 -12
- package/dist/model-context/useAssistantToolUI.js.map +0 -1
- package/dist/model-context/useInlineRender.d.ts +0 -4
- package/dist/model-context/useInlineRender.d.ts.map +0 -1
- package/dist/model-context/useInlineRender.js +0 -16
- package/dist/model-context/useInlineRender.js.map +0 -1
- package/dist/types/AssistantTypes.d.ts +0 -108
- package/dist/types/AssistantTypes.d.ts.map +0 -1
- package/dist/types/AssistantTypes.js +0 -2
- package/dist/types/AssistantTypes.js.map +0 -1
- package/dist/types/AttachmentTypes.d.ts +0 -35
- package/dist/types/AttachmentTypes.d.ts.map +0 -1
- package/dist/types/AttachmentTypes.js +0 -2
- package/dist/types/AttachmentTypes.js.map +0 -1
- package/dist/types/MessagePartComponentTypes.d.ts +0 -31
- package/dist/types/MessagePartComponentTypes.d.ts.map +0 -1
- package/dist/types/MessagePartComponentTypes.js +0 -2
- package/dist/types/MessagePartComponentTypes.js.map +0 -1
- package/dist/types/MessagePartTypes.d.ts +0 -62
- package/dist/types/MessagePartTypes.d.ts.map +0 -1
- package/dist/types/MessagePartTypes.js +0 -2
- package/dist/types/MessagePartTypes.js.map +0 -1
- package/dist/types/QuoteTypes.d.ts +0 -5
- package/dist/types/QuoteTypes.d.ts.map +0 -1
- package/dist/types/QuoteTypes.js +0 -2
- package/dist/types/QuoteTypes.js.map +0 -1
- package/dist/types/Unsubscribe.d.ts +0 -2
- package/dist/types/Unsubscribe.d.ts.map +0 -1
- package/dist/types/Unsubscribe.js +0 -2
- package/dist/types/Unsubscribe.js.map +0 -1
- package/dist/types/scopes/attachment.d.ts +0 -22
- package/dist/types/scopes/attachment.d.ts.map +0 -1
- package/dist/types/scopes/attachment.js +0 -2
- package/dist/types/scopes/attachment.js.map +0 -1
- package/dist/types/scopes/chainOfThought.d.ts +0 -40
- package/dist/types/scopes/chainOfThought.d.ts.map +0 -1
- package/dist/types/scopes/chainOfThought.js +0 -2
- package/dist/types/scopes/chainOfThought.js.map +0 -1
- package/dist/types/scopes/composer.d.ts +0 -77
- package/dist/types/scopes/composer.d.ts.map +0 -1
- package/dist/types/scopes/composer.js +0 -2
- package/dist/types/scopes/composer.js.map +0 -1
- package/dist/types/scopes/message.d.ts +0 -87
- package/dist/types/scopes/message.d.ts.map +0 -1
- package/dist/types/scopes/message.js +0 -2
- package/dist/types/scopes/message.js.map +0 -1
- package/dist/types/scopes/modelContext.d.ts +0 -12
- package/dist/types/scopes/modelContext.d.ts.map +0 -1
- package/dist/types/scopes/modelContext.js +0 -2
- package/dist/types/scopes/modelContext.js.map +0 -1
- package/dist/types/scopes/part.d.ts +0 -43
- package/dist/types/scopes/part.d.ts.map +0 -1
- package/dist/types/scopes/part.js +0 -2
- package/dist/types/scopes/part.js.map +0 -1
- package/dist/types/scopes/suggestion.d.ts +0 -20
- package/dist/types/scopes/suggestion.d.ts.map +0 -1
- package/dist/types/scopes/suggestion.js +0 -2
- package/dist/types/scopes/suggestion.js.map +0 -1
- package/dist/types/scopes/suggestions.d.ts +0 -20
- package/dist/types/scopes/suggestions.d.ts.map +0 -1
- package/dist/types/scopes/suggestions.js +0 -2
- package/dist/types/scopes/suggestions.js.map +0 -1
- package/dist/types/scopes/thread.d.ts +0 -138
- package/dist/types/scopes/thread.d.ts.map +0 -1
- package/dist/types/scopes/thread.js +0 -2
- package/dist/types/scopes/thread.js.map +0 -1
- package/dist/types/scopes/threadListItem.d.ts +0 -50
- package/dist/types/scopes/threadListItem.d.ts.map +0 -1
- package/dist/types/scopes/threadListItem.js +0 -2
- package/dist/types/scopes/threadListItem.js.map +0 -1
- package/dist/types/scopes/threads.d.ts +0 -28
- package/dist/types/scopes/threads.d.ts.map +0 -1
- package/dist/types/scopes/threads.js +0 -2
- package/dist/types/scopes/threads.js.map +0 -1
- package/dist/types/scopes/tools.d.ts +0 -14
- package/dist/types/scopes/tools.d.ts.map +0 -1
- package/dist/types/scopes/tools.js +0 -2
- package/dist/types/scopes/tools.js.map +0 -1
- package/dist/types/store-augmentation.d.ts +0 -30
- package/dist/types/store-augmentation.d.ts.map +0 -1
- package/dist/types/store-augmentation.js +0 -2
- package/dist/types/store-augmentation.js.map +0 -1
- package/dist/utils/CompositeContextProvider.d.ts +0 -10
- package/dist/utils/CompositeContextProvider.d.ts.map +0 -1
- package/dist/utils/CompositeContextProvider.js +0 -29
- package/dist/utils/CompositeContextProvider.js.map +0 -1
- package/dist/utils/getThreadMessageText.d.ts +0 -3
- package/dist/utils/getThreadMessageText.d.ts.map +0 -1
- package/dist/utils/getThreadMessageText.js +0 -5
- package/dist/utils/getThreadMessageText.js.map +0 -1
- package/dist/utils/idUtils.d.ts +0 -6
- package/dist/utils/idUtils.d.ts.map +0 -1
- package/dist/utils/idUtils.js +0 -9
- package/dist/utils/idUtils.js.map +0 -1
- package/src/client/ChainOfThoughtClient.ts +0 -43
- package/src/client/ModelContextClient.ts +0 -23
- package/src/client/NoOpComposerClient.tsx +0 -70
- package/src/client/Suggestions.ts +0 -74
- package/src/client/ThreadMessageClient.tsx +0 -178
- package/src/client/Tools.ts +0 -97
- package/src/legacy-runtime/client/AttachmentRuntimeClient.ts +0 -19
- package/src/legacy-runtime/client/ComposerRuntimeClient.ts +0 -138
- package/src/legacy-runtime/client/MessagePartRuntimeClient.ts +0 -20
- package/src/legacy-runtime/client/MessageRuntimeClient.ts +0 -151
- package/src/legacy-runtime/client/ThreadListItemRuntimeClient.ts +0 -59
- package/src/legacy-runtime/client/ThreadListRuntimeClient.ts +0 -100
- package/src/legacy-runtime/client/ThreadRuntimeClient.ts +0 -148
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.tsx +0 -182
- package/src/legacy-runtime/runtime/subscribable/BaseSubject.ts +0 -36
- package/src/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.ts +0 -44
- package/src/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.ts +0 -42
- package/src/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.ts +0 -58
- package/src/legacy-runtime/runtime/subscribable/SKIP_UPDATE.ts +0 -2
- package/src/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.ts +0 -47
- package/src/legacy-runtime/runtime/subscribable/Subscribable.ts +0 -26
- package/src/legacy-runtime/runtime/subscribable/shallowEqual.ts +0 -16
- package/src/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.ts +0 -71
- package/src/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.ts +0 -107
- package/src/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.ts +0 -49
- package/src/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.ts +0 -50
- package/src/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.ts +0 -43
- package/src/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.ts +0 -121
- package/src/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.ts +0 -255
- package/src/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.ts +0 -48
- package/src/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.ts +0 -14
- package/src/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.ts +0 -25
- package/src/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.ts +0 -26
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.tsx +0 -423
- package/src/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.tsx +0 -72
- package/src/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.tsx +0 -65
- package/src/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.tsx +0 -19
- package/src/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.tsx +0 -20
- package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.tsx +0 -237
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.tsx +0 -90
- package/src/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.tsx +0 -49
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.tsx +0 -154
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.tsx +0 -111
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.tsx +0 -26
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.tsx +0 -235
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.tsx +0 -368
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.tsx +0 -227
- package/src/legacy-runtime/runtime-cores/external-store/auto-status.tsx +0 -67
- package/src/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.tsx +0 -37
- package/src/legacy-runtime/runtime-cores/local/ChatModelAdapter.tsx +0 -64
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeCore.tsx +0 -32
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.tsx +0 -60
- package/src/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.tsx +0 -116
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.tsx +0 -519
- package/src/legacy-runtime/runtime-cores/local/shouldContinue.tsx +0 -26
- package/src/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.tsx +0 -41
- package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.tsx +0 -200
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.tsx +0 -43
- package/src/legacy-runtime/runtime-cores/remote-thread-list/types.tsx +0 -49
- package/src/legacy-runtime/runtime-cores/utils/MessageRepository.tsx +0 -551
- package/src/legacy-runtime/util-hooks/tapSubscribable.ts +0 -16
- package/src/model-context/ModelContextTypes.ts +0 -76
- package/src/model-context/frame/AssistantFrameHost.ts +0 -218
- package/src/model-context/frame/AssistantFrameProvider.ts +0 -230
- package/src/model-context/frame/AssistantFrameTypes.ts +0 -40
- package/src/model-context/makeAssistantTool.tsx +0 -22
- package/src/model-context/makeAssistantToolUI.tsx +0 -22
- package/src/model-context/registry/ModelContextRegistry.ts +0 -165
- package/src/model-context/registry/ModelContextRegistryHandles.ts +0 -19
- package/src/model-context/tool.ts +0 -9
- package/src/model-context/toolbox.tsx +0 -17
- package/src/model-context/useAssistantInstructions.tsx +0 -34
- package/src/model-context/useAssistantTool.tsx +0 -40
- package/src/model-context/useAssistantToolUI.tsx +0 -20
- package/src/model-context/useInlineRender.tsx +0 -27
- package/src/primitives/composer/ComposerIf.tsx +0 -44
- package/src/tests/MessageRepository.test.ts +0 -786
- package/src/types/AssistantTypes.ts +0 -166
- package/src/types/AttachmentTypes.ts +0 -45
- package/src/types/MessagePartComponentTypes.tsx +0 -59
- package/src/types/MessagePartTypes.ts +0 -82
- package/src/types/QuoteTypes.ts +0 -4
- package/src/types/Unsubscribe.tsx +0 -1
- package/src/types/scopes/attachment.ts +0 -22
- package/src/types/scopes/chainOfThought.ts +0 -42
- package/src/types/scopes/composer.ts +0 -80
- package/src/types/scopes/message.ts +0 -78
- package/src/types/scopes/modelContext.ts +0 -14
- package/src/types/scopes/part.ts +0 -49
- package/src/types/scopes/suggestion.ts +0 -20
- package/src/types/scopes/suggestions.ts +0 -21
- package/src/types/scopes/thread.ts +0 -141
- package/src/types/scopes/threadListItem.ts +0 -44
- package/src/types/scopes/threads.ts +0 -36
- package/src/types/scopes/tools.ts +0 -19
- package/src/types/store-augmentation.ts +0 -31
- package/src/utils/CompositeContextProvider.ts +0 -36
- package/src/utils/getThreadMessageText.tsx +0 -15
- package/src/utils/idUtils.tsx +0 -14
- /package/src/legacy-runtime/runtime-cores/local/{useLocalRuntime.tsx → useLocalRuntime.ts} +0 -0
- /package/src/primitives/actionBar/{ActionBarEdit.tsx → ActionBarEdit.ts} +0 -0
- /package/src/primitives/actionBar/{ActionBarReload.tsx → ActionBarReload.ts} +0 -0
- /package/src/primitives/actionBar/{ActionBarSpeak.tsx → ActionBarSpeak.ts} +0 -0
- /package/src/primitives/actionBar/{useActionBarFloatStatus.tsx → useActionBarFloatStatus.ts} +0 -0
- /package/src/primitives/attachment/{AttachmentRemove.tsx → AttachmentRemove.ts} +0 -0
- /package/src/primitives/branchPicker/{BranchPickerNext.tsx → BranchPickerNext.ts} +0 -0
- /package/src/primitives/branchPicker/{BranchPickerPrevious.tsx → BranchPickerPrevious.ts} +0 -0
- /package/src/primitives/chainOfThought/{ChainOfThoughtAccordionTrigger.tsx → ChainOfThoughtAccordionTrigger.ts} +0 -0
- /package/src/primitives/composer/{ComposerAddAttachment.tsx → ComposerAddAttachment.ts} +0 -0
- /package/src/primitives/composer/{ComposerCancel.tsx → ComposerCancel.ts} +0 -0
- /package/src/primitives/composer/{ComposerDictate.tsx → ComposerDictate.ts} +0 -0
- /package/src/primitives/composer/{ComposerSend.tsx → ComposerSend.ts} +0 -0
- /package/src/primitives/composer/{ComposerStopDictation.tsx → ComposerStopDictation.ts} +0 -0
- /package/src/primitives/message/{MessageError.tsx → MessageError.ts} +0 -0
- /package/src/primitives/messagePart/{MessagePartInProgress.tsx → MessagePartInProgress.ts} +0 -0
- /package/src/primitives/reasoning/{useScrollLock.tsx → useScrollLock.ts} +0 -0
- /package/src/primitives/suggestion/{SuggestionTrigger.tsx → SuggestionTrigger.ts} +0 -0
- /package/src/primitives/thread/{ThreadScrollToBottom.tsx → ThreadScrollToBottom.ts} +0 -0
- /package/src/primitives/thread/{ThreadSuggestion.tsx → ThreadSuggestion.ts} +0 -0
- /package/src/primitives/thread/{useThreadViewportAutoScroll.tsx → useThreadViewportAutoScroll.ts} +0 -0
- /package/src/utils/{RequireAtLeastOne.tsx → RequireAtLeastOne.ts} +0 -0
- /package/src/utils/hooks/{useOnResizeContent.tsx → useOnResizeContent.ts} +0 -0
- /package/src/utils/hooks/{useOnScrollToBottom.tsx → useOnScrollToBottom.ts} +0 -0
- /package/src/utils/{useToolArgsFieldStatus.tsx → useToolArgsFieldStatus.ts} +0 -0
|
@@ -1,336 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import type { FC } from "react";
|
|
3
4
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "react";
|
|
10
|
-
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
11
|
-
import {
|
|
12
|
-
PartByIndexProvider,
|
|
13
|
-
TextMessagePartProvider,
|
|
14
|
-
} from "../../context/providers";
|
|
15
|
-
import { ChainOfThoughtByIndicesProvider } from "../../context/providers/ChainOfThoughtByIndicesProvider";
|
|
5
|
+
MessagePrimitiveParts as MessagePrimitivePartsBase,
|
|
6
|
+
MessagePartComponent as MessagePartComponentBase,
|
|
7
|
+
MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase,
|
|
8
|
+
messagePartsDefaultComponents,
|
|
9
|
+
} from "@assistant-ui/core/react";
|
|
16
10
|
import { MessagePartPrimitiveText } from "../messagePart/MessagePartText";
|
|
17
11
|
import { MessagePartPrimitiveImage } from "../messagePart/MessagePartImage";
|
|
18
|
-
import type {
|
|
19
|
-
Unstable_AudioMessagePartComponent,
|
|
20
|
-
EmptyMessagePartComponent,
|
|
21
|
-
TextMessagePartComponent,
|
|
22
|
-
ImageMessagePartComponent,
|
|
23
|
-
SourceMessagePartComponent,
|
|
24
|
-
ToolCallMessagePartComponent,
|
|
25
|
-
ToolCallMessagePartProps,
|
|
26
|
-
FileMessagePartComponent,
|
|
27
|
-
ReasoningMessagePartComponent,
|
|
28
|
-
ReasoningGroupComponent,
|
|
29
|
-
} from "../../types/MessagePartComponentTypes";
|
|
30
12
|
import { MessagePartPrimitiveInProgress } from "../messagePart/MessagePartInProgress";
|
|
31
|
-
import { MessagePartStatus } from "../../types/AssistantTypes";
|
|
32
|
-
import { useShallow } from "zustand/shallow";
|
|
33
|
-
|
|
34
|
-
type MessagePartRange =
|
|
35
|
-
| { type: "single"; index: number }
|
|
36
|
-
| { type: "toolGroup"; startIndex: number; endIndex: number }
|
|
37
|
-
| { type: "reasoningGroup"; startIndex: number; endIndex: number }
|
|
38
|
-
| { type: "chainOfThoughtGroup"; startIndex: number; endIndex: number };
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Creates a group state manager for a specific part type.
|
|
42
|
-
* Returns functions to start, end, and finalize groups.
|
|
43
|
-
*/
|
|
44
|
-
const createGroupState = <
|
|
45
|
-
T extends "toolGroup" | "reasoningGroup" | "chainOfThoughtGroup",
|
|
46
|
-
>(
|
|
47
|
-
groupType: T,
|
|
48
|
-
) => {
|
|
49
|
-
let start = -1;
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
startGroup: (index: number) => {
|
|
53
|
-
if (start === -1) {
|
|
54
|
-
start = index;
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
endGroup: (endIndex: number, ranges: MessagePartRange[]) => {
|
|
58
|
-
if (start !== -1) {
|
|
59
|
-
ranges.push({
|
|
60
|
-
type: groupType,
|
|
61
|
-
startIndex: start,
|
|
62
|
-
endIndex,
|
|
63
|
-
} as MessagePartRange);
|
|
64
|
-
start = -1;
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
finalize: (endIndex: number, ranges: MessagePartRange[]) => {
|
|
68
|
-
if (start !== -1) {
|
|
69
|
-
ranges.push({
|
|
70
|
-
type: groupType,
|
|
71
|
-
startIndex: start,
|
|
72
|
-
endIndex,
|
|
73
|
-
} as MessagePartRange);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Groups consecutive tool-call and reasoning message parts into ranges.
|
|
81
|
-
* Always groups tool calls and reasoning parts, even if there's only one.
|
|
82
|
-
* When useChainOfThought is true, groups tool-call and reasoning parts together.
|
|
83
|
-
*/
|
|
84
|
-
const groupMessageParts = (
|
|
85
|
-
messageTypes: readonly string[],
|
|
86
|
-
useChainOfThought: boolean,
|
|
87
|
-
): MessagePartRange[] => {
|
|
88
|
-
const ranges: MessagePartRange[] = [];
|
|
89
|
-
|
|
90
|
-
if (useChainOfThought) {
|
|
91
|
-
const chainOfThoughtGroup = createGroupState("chainOfThoughtGroup");
|
|
92
|
-
|
|
93
|
-
for (let i = 0; i < messageTypes.length; i++) {
|
|
94
|
-
const type = messageTypes[i];
|
|
95
|
-
|
|
96
|
-
if (type === "tool-call" || type === "reasoning") {
|
|
97
|
-
chainOfThoughtGroup.startGroup(i);
|
|
98
|
-
} else {
|
|
99
|
-
chainOfThoughtGroup.endGroup(i - 1, ranges);
|
|
100
|
-
ranges.push({ type: "single", index: i });
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
chainOfThoughtGroup.finalize(messageTypes.length - 1, ranges);
|
|
105
|
-
} else {
|
|
106
|
-
const toolGroup = createGroupState("toolGroup");
|
|
107
|
-
const reasoningGroup = createGroupState("reasoningGroup");
|
|
108
|
-
|
|
109
|
-
for (let i = 0; i < messageTypes.length; i++) {
|
|
110
|
-
const type = messageTypes[i];
|
|
111
|
-
|
|
112
|
-
if (type === "tool-call") {
|
|
113
|
-
reasoningGroup.endGroup(i - 1, ranges);
|
|
114
|
-
toolGroup.startGroup(i);
|
|
115
|
-
} else if (type === "reasoning") {
|
|
116
|
-
toolGroup.endGroup(i - 1, ranges);
|
|
117
|
-
reasoningGroup.startGroup(i);
|
|
118
|
-
} else {
|
|
119
|
-
toolGroup.endGroup(i - 1, ranges);
|
|
120
|
-
reasoningGroup.endGroup(i - 1, ranges);
|
|
121
|
-
ranges.push({ type: "single", index: i });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
toolGroup.finalize(messageTypes.length - 1, ranges);
|
|
126
|
-
reasoningGroup.finalize(messageTypes.length - 1, ranges);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return ranges;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const useMessagePartsGroups = (
|
|
133
|
-
useChainOfThought: boolean,
|
|
134
|
-
): MessagePartRange[] => {
|
|
135
|
-
const messageTypes = useAuiState(
|
|
136
|
-
useShallow((s) => s.message.parts.map((c: any) => c.type)),
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
return useMemo(() => {
|
|
140
|
-
if (messageTypes.length === 0) {
|
|
141
|
-
return [];
|
|
142
|
-
}
|
|
143
|
-
return groupMessageParts(messageTypes, useChainOfThought);
|
|
144
|
-
}, [messageTypes, useChainOfThought]);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export namespace MessagePrimitiveParts {
|
|
148
|
-
type BaseComponents = {
|
|
149
|
-
/** Component for rendering empty messages */
|
|
150
|
-
Empty?: EmptyMessagePartComponent | undefined;
|
|
151
|
-
/** Component for rendering text content */
|
|
152
|
-
Text?: TextMessagePartComponent | undefined;
|
|
153
|
-
/** Component for rendering source content */
|
|
154
|
-
Source?: SourceMessagePartComponent | undefined;
|
|
155
|
-
/** Component for rendering image content */
|
|
156
|
-
Image?: ImageMessagePartComponent | undefined;
|
|
157
|
-
/** Component for rendering file content */
|
|
158
|
-
File?: FileMessagePartComponent | undefined;
|
|
159
|
-
/** Component for rendering audio content (experimental) */
|
|
160
|
-
Unstable_Audio?: Unstable_AudioMessagePartComponent | undefined;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
type ToolsConfig =
|
|
164
|
-
| {
|
|
165
|
-
/** Map of tool names to their specific components */
|
|
166
|
-
by_name?:
|
|
167
|
-
| Record<string, ToolCallMessagePartComponent | undefined>
|
|
168
|
-
| undefined;
|
|
169
|
-
/** Fallback component for unregistered tools */
|
|
170
|
-
Fallback?: ComponentType<ToolCallMessagePartProps> | undefined;
|
|
171
|
-
}
|
|
172
|
-
| {
|
|
173
|
-
/** Override component that handles all tool calls */
|
|
174
|
-
Override: ComponentType<ToolCallMessagePartProps>;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Standard component configuration for rendering reasoning and tool-call parts
|
|
179
|
-
* individually (with optional grouping).
|
|
180
|
-
*
|
|
181
|
-
* Cannot be combined with `ChainOfThought`.
|
|
182
|
-
*/
|
|
183
|
-
type StandardComponents = BaseComponents & {
|
|
184
|
-
/** Component for rendering reasoning content (typically hidden) */
|
|
185
|
-
Reasoning?: ReasoningMessagePartComponent | undefined;
|
|
186
|
-
/** Configuration for tool call rendering */
|
|
187
|
-
tools?: ToolsConfig | undefined;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Component for rendering grouped consecutive tool calls.
|
|
191
|
-
*
|
|
192
|
-
* When provided, this component will automatically wrap consecutive tool-call
|
|
193
|
-
* message parts, allowing you to create collapsible sections, custom styling,
|
|
194
|
-
* or other grouped presentations for multiple tool calls.
|
|
195
|
-
*
|
|
196
|
-
* The component receives:
|
|
197
|
-
* - `startIndex`: The index of the first tool call in the group
|
|
198
|
-
* - `endIndex`: The index of the last tool call in the group
|
|
199
|
-
* - `children`: The rendered tool call components
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* ```tsx
|
|
203
|
-
* // Collapsible tool group
|
|
204
|
-
* ToolGroup: ({ startIndex, endIndex, children }) => (
|
|
205
|
-
* <details className="tool-group">
|
|
206
|
-
* <summary>
|
|
207
|
-
* {endIndex - startIndex + 1} tool calls
|
|
208
|
-
* </summary>
|
|
209
|
-
* <div className="tool-group-content">
|
|
210
|
-
* {children}
|
|
211
|
-
* </div>
|
|
212
|
-
* </details>
|
|
213
|
-
* )
|
|
214
|
-
* ```
|
|
215
|
-
*
|
|
216
|
-
* @param startIndex - Index of the first tool call in the group
|
|
217
|
-
* @param endIndex - Index of the last tool call in the group
|
|
218
|
-
* @param children - Rendered tool call components to display within the group
|
|
219
|
-
*
|
|
220
|
-
* @deprecated This feature is still experimental and subject to change.
|
|
221
|
-
*/
|
|
222
|
-
ToolGroup?: ComponentType<
|
|
223
|
-
PropsWithChildren<{ startIndex: number; endIndex: number }>
|
|
224
|
-
>;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Component for rendering grouped reasoning parts.
|
|
228
|
-
*
|
|
229
|
-
* When provided, this component will automatically wrap reasoning message parts
|
|
230
|
-
* (one or more consecutive) in a group container. Each reasoning part inside
|
|
231
|
-
* renders its own text independently - no text merging occurs.
|
|
232
|
-
*
|
|
233
|
-
* The component receives:
|
|
234
|
-
* - `startIndex`: The index of the first reasoning part in the group
|
|
235
|
-
* - `endIndex`: The index of the last reasoning part in the group
|
|
236
|
-
* - `children`: The rendered Reasoning components (one per part)
|
|
237
|
-
*
|
|
238
|
-
* @example
|
|
239
|
-
* ```tsx
|
|
240
|
-
* // Collapsible reasoning group
|
|
241
|
-
* ReasoningGroup: ({ children }) => (
|
|
242
|
-
* <details className="reasoning-group">
|
|
243
|
-
* <summary>Reasoning</summary>
|
|
244
|
-
* <div className="reasoning-content">
|
|
245
|
-
* {children}
|
|
246
|
-
* </div>
|
|
247
|
-
* </details>
|
|
248
|
-
* )
|
|
249
|
-
* ```
|
|
250
|
-
*
|
|
251
|
-
* @param startIndex - Index of the first reasoning part in the group
|
|
252
|
-
* @param endIndex - Index of the last reasoning part in the group
|
|
253
|
-
* @param children - Rendered reasoning part components
|
|
254
|
-
*/
|
|
255
|
-
ReasoningGroup?: ReasoningGroupComponent;
|
|
256
|
-
|
|
257
|
-
ChainOfThought?: never;
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Chain of thought component configuration.
|
|
262
|
-
*
|
|
263
|
-
* When `ChainOfThought` is set, it takes control of rendering ALL reasoning and
|
|
264
|
-
* tool-call parts in the message. The `Reasoning`, `tools`, `ReasoningGroup`, and
|
|
265
|
-
* `ToolGroup` components cannot be used alongside it.
|
|
266
|
-
*
|
|
267
|
-
* The component is automatically wrapped in a ChainOfThoughtByIndicesProvider
|
|
268
|
-
* that sets up the chainOfThought client scope with the correct parts.
|
|
269
|
-
*
|
|
270
|
-
* @example
|
|
271
|
-
* ```tsx
|
|
272
|
-
* // Chain of thought with accordion
|
|
273
|
-
* ChainOfThought: () => (
|
|
274
|
-
* <ChainOfThoughtPrimitive.Root>
|
|
275
|
-
* <ChainOfThoughtPrimitive.AccordionTrigger>
|
|
276
|
-
* Toggle reasoning
|
|
277
|
-
* </ChainOfThoughtPrimitive.AccordionTrigger>
|
|
278
|
-
* <ChainOfThoughtPrimitive.Parts />
|
|
279
|
-
* </ChainOfThoughtPrimitive.Root>
|
|
280
|
-
* )
|
|
281
|
-
* ```
|
|
282
|
-
*/
|
|
283
|
-
type ChainOfThoughtComponents = BaseComponents & {
|
|
284
|
-
ChainOfThought: ComponentType;
|
|
285
|
-
|
|
286
|
-
Reasoning?: never;
|
|
287
|
-
tools?: never;
|
|
288
|
-
ToolGroup?: never;
|
|
289
|
-
ReasoningGroup?: never;
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
export type Props = {
|
|
293
|
-
/**
|
|
294
|
-
* Component configuration for rendering different types of message content.
|
|
295
|
-
*
|
|
296
|
-
* You can provide custom components for each content type (text, image, file, etc.)
|
|
297
|
-
* and configure tool rendering behavior. If not provided, default components will be used.
|
|
298
|
-
*
|
|
299
|
-
* Use either `Reasoning`/`tools`/`ToolGroup`/`ReasoningGroup` for standard rendering,
|
|
300
|
-
* or `ChainOfThought` to group all reasoning and tool-call parts into a single
|
|
301
|
-
* collapsible component. These two modes are mutually exclusive.
|
|
302
|
-
*/
|
|
303
|
-
components?: StandardComponents | ChainOfThoughtComponents | undefined;
|
|
304
|
-
/**
|
|
305
|
-
* When enabled, shows the Empty component if the last part in the message
|
|
306
|
-
* is anything other than Text or Reasoning.
|
|
307
|
-
*
|
|
308
|
-
* This can be useful to ensure there's always a visible element at the end
|
|
309
|
-
* of messages that end with non-text content like tool calls or images.
|
|
310
|
-
*
|
|
311
|
-
* @experimental This API is experimental and may change in future versions.
|
|
312
|
-
* @default true
|
|
313
|
-
*/
|
|
314
|
-
unstable_showEmptyOnNonTextEnd?: boolean | undefined;
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
13
|
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
...props
|
|
321
|
-
}: {
|
|
322
|
-
Fallback: ToolCallMessagePartComponent | undefined;
|
|
323
|
-
} & ToolCallMessagePartProps) => {
|
|
324
|
-
const Render = useAuiState((s) => {
|
|
325
|
-
const Render = s.tools.tools[props.toolName] ?? Fallback;
|
|
326
|
-
if (Array.isArray(Render)) return Render[0] ?? Fallback;
|
|
327
|
-
return Render;
|
|
328
|
-
});
|
|
329
|
-
if (!Render) return null;
|
|
330
|
-
return <Render {...props} />;
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
const defaultComponents = {
|
|
14
|
+
const webDefaultComponents = {
|
|
15
|
+
...messagePartsDefaultComponents,
|
|
334
16
|
Text: () => (
|
|
335
17
|
<p style={{ whiteSpace: "pre-line" }}>
|
|
336
18
|
<MessagePartPrimitiveText />
|
|
@@ -339,304 +21,53 @@ const defaultComponents = {
|
|
|
339
21
|
</MessagePartPrimitiveInProgress>
|
|
340
22
|
</p>
|
|
341
23
|
),
|
|
342
|
-
Reasoning: () => null,
|
|
343
|
-
Source: () => null,
|
|
344
24
|
Image: () => <MessagePartPrimitiveImage />,
|
|
345
|
-
File: () => null,
|
|
346
|
-
Unstable_Audio: () => null,
|
|
347
|
-
ToolGroup: ({ children }) => children,
|
|
348
|
-
ReasoningGroup: ({ children }) => children,
|
|
349
25
|
} satisfies MessagePrimitiveParts.Props["components"];
|
|
350
26
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
export const MessagePartComponent: FC<MessagePartComponentProps> = ({
|
|
356
|
-
components: {
|
|
357
|
-
Text = defaultComponents.Text,
|
|
358
|
-
Reasoning = defaultComponents.Reasoning,
|
|
359
|
-
Image = defaultComponents.Image,
|
|
360
|
-
Source = defaultComponents.Source,
|
|
361
|
-
File = defaultComponents.File,
|
|
362
|
-
Unstable_Audio: Audio = defaultComponents.Unstable_Audio,
|
|
363
|
-
tools = {},
|
|
364
|
-
} = {},
|
|
365
|
-
}) => {
|
|
366
|
-
const aui = useAui();
|
|
367
|
-
const part = useAuiState((s) => s.part);
|
|
368
|
-
|
|
369
|
-
const type = part.type;
|
|
370
|
-
if (type === "tool-call") {
|
|
371
|
-
const addResult = aui.part().addToolResult;
|
|
372
|
-
const resume = aui.part().resumeToolCall;
|
|
373
|
-
if ("Override" in tools)
|
|
374
|
-
return <tools.Override {...part} addResult={addResult} resume={resume} />;
|
|
375
|
-
const Tool = tools.by_name?.[part.toolName] ?? tools.Fallback;
|
|
376
|
-
return (
|
|
377
|
-
<ToolUIDisplay
|
|
378
|
-
{...part}
|
|
379
|
-
Fallback={Tool}
|
|
380
|
-
addResult={addResult}
|
|
381
|
-
resume={resume}
|
|
382
|
-
/>
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
if (part.status?.type === "requires-action")
|
|
387
|
-
throw new Error("Encountered unexpected requires-action status");
|
|
388
|
-
|
|
389
|
-
switch (type) {
|
|
390
|
-
case "text":
|
|
391
|
-
return <Text {...part} />;
|
|
392
|
-
|
|
393
|
-
case "reasoning":
|
|
394
|
-
return <Reasoning {...part} />;
|
|
395
|
-
|
|
396
|
-
case "source":
|
|
397
|
-
return <Source {...part} />;
|
|
398
|
-
|
|
399
|
-
case "image":
|
|
400
|
-
return <Image {...part} />;
|
|
401
|
-
|
|
402
|
-
case "file":
|
|
403
|
-
return <File {...part} />;
|
|
404
|
-
|
|
405
|
-
case "audio":
|
|
406
|
-
return <Audio {...part} />;
|
|
407
|
-
|
|
408
|
-
case "data":
|
|
409
|
-
return null;
|
|
410
|
-
|
|
411
|
-
default:
|
|
412
|
-
const unhandledType: never = type;
|
|
413
|
-
throw new Error(`Unknown message part type: ${unhandledType}`);
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
export namespace MessagePrimitivePartByIndex {
|
|
418
|
-
export type Props = {
|
|
419
|
-
index: number;
|
|
420
|
-
components: MessagePrimitiveParts.Props["components"];
|
|
421
|
-
};
|
|
27
|
+
export namespace MessagePrimitiveParts {
|
|
28
|
+
export type Props = MessagePrimitivePartsBase.Props;
|
|
422
29
|
}
|
|
423
30
|
|
|
424
31
|
/**
|
|
425
|
-
* Renders a
|
|
426
|
-
*
|
|
427
|
-
* This component provides direct access to render a specific message part
|
|
428
|
-
* within the current message context, using the provided component configuration.
|
|
429
|
-
*
|
|
430
|
-
* @example
|
|
431
|
-
* ```tsx
|
|
432
|
-
* <MessagePrimitive.PartByIndex
|
|
433
|
-
* index={0}
|
|
434
|
-
* components={{
|
|
435
|
-
* Text: MyTextComponent,
|
|
436
|
-
* Image: MyImageComponent
|
|
437
|
-
* }}
|
|
438
|
-
* />
|
|
439
|
-
* ```
|
|
440
|
-
*/
|
|
441
|
-
export const MessagePrimitivePartByIndex: FC<MessagePrimitivePartByIndex.Props> =
|
|
442
|
-
memo(
|
|
443
|
-
({ index, components }) => {
|
|
444
|
-
return (
|
|
445
|
-
<PartByIndexProvider index={index}>
|
|
446
|
-
<MessagePartComponent components={components} />
|
|
447
|
-
</PartByIndexProvider>
|
|
448
|
-
);
|
|
449
|
-
},
|
|
450
|
-
(prev, next) =>
|
|
451
|
-
prev.index === next.index &&
|
|
452
|
-
prev.components?.Text === next.components?.Text &&
|
|
453
|
-
prev.components?.Reasoning === next.components?.Reasoning &&
|
|
454
|
-
prev.components?.Source === next.components?.Source &&
|
|
455
|
-
prev.components?.Image === next.components?.Image &&
|
|
456
|
-
prev.components?.File === next.components?.File &&
|
|
457
|
-
prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&
|
|
458
|
-
prev.components?.tools === next.components?.tools &&
|
|
459
|
-
prev.components?.ToolGroup === next.components?.ToolGroup &&
|
|
460
|
-
prev.components?.ReasoningGroup === next.components?.ReasoningGroup,
|
|
461
|
-
);
|
|
462
|
-
|
|
463
|
-
MessagePrimitivePartByIndex.displayName = "MessagePrimitive.PartByIndex";
|
|
464
|
-
|
|
465
|
-
const EmptyPartFallback: FC<{
|
|
466
|
-
status: MessagePartStatus;
|
|
467
|
-
component: TextMessagePartComponent;
|
|
468
|
-
}> = ({ status, component: Component }) => {
|
|
469
|
-
return (
|
|
470
|
-
<TextMessagePartProvider text="" isRunning={status.type === "running"}>
|
|
471
|
-
<Component type="text" text="" status={status} />
|
|
472
|
-
</TextMessagePartProvider>
|
|
473
|
-
);
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
const COMPLETE_STATUS: MessagePartStatus = Object.freeze({
|
|
477
|
-
type: "complete",
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
const EmptyPartsImpl: FC<MessagePartComponentProps> = ({ components }) => {
|
|
481
|
-
const status = useAuiState(
|
|
482
|
-
(s) => (s.message.status ?? COMPLETE_STATUS) as MessagePartStatus,
|
|
483
|
-
);
|
|
484
|
-
|
|
485
|
-
if (components?.Empty) return <components.Empty status={status} />;
|
|
486
|
-
|
|
487
|
-
return (
|
|
488
|
-
<EmptyPartFallback
|
|
489
|
-
status={status}
|
|
490
|
-
component={components?.Text ?? defaultComponents.Text}
|
|
491
|
-
/>
|
|
492
|
-
);
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
const EmptyParts = memo(
|
|
496
|
-
EmptyPartsImpl,
|
|
497
|
-
(prev, next) =>
|
|
498
|
-
prev.components?.Empty === next.components?.Empty &&
|
|
499
|
-
prev.components?.Text === next.components?.Text,
|
|
500
|
-
);
|
|
501
|
-
|
|
502
|
-
const ConditionalEmptyImpl: FC<{
|
|
503
|
-
components: MessagePrimitiveParts.Props["components"];
|
|
504
|
-
enabled: boolean;
|
|
505
|
-
}> = ({ components, enabled }) => {
|
|
506
|
-
const shouldShowEmpty = useAuiState((s) => {
|
|
507
|
-
if (!enabled) return false;
|
|
508
|
-
if (s.message.parts.length === 0) return false;
|
|
509
|
-
|
|
510
|
-
const lastPart = s.message.parts[s.message.parts.length - 1];
|
|
511
|
-
return lastPart?.type !== "text" && lastPart?.type !== "reasoning";
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
if (!shouldShowEmpty) return null;
|
|
515
|
-
return <EmptyParts components={components} />;
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
const ConditionalEmpty = memo(
|
|
519
|
-
ConditionalEmptyImpl,
|
|
520
|
-
(prev, next) =>
|
|
521
|
-
prev.enabled === next.enabled &&
|
|
522
|
-
prev.components?.Empty === next.components?.Empty &&
|
|
523
|
-
prev.components?.Text === next.components?.Text,
|
|
524
|
-
);
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Renders the parts of a message with support for multiple content types.
|
|
528
|
-
*
|
|
529
|
-
* This component automatically handles different types of message content including
|
|
530
|
-
* text, images, files, tool calls, and more. It provides a flexible component
|
|
531
|
-
* system for customizing how each content type is rendered.
|
|
532
|
-
*
|
|
533
|
-
* @example
|
|
534
|
-
* ```tsx
|
|
535
|
-
* <MessagePrimitive.Parts
|
|
536
|
-
* components={{
|
|
537
|
-
* Text: ({ text }) => <p className="message-text">{text}</p>,
|
|
538
|
-
* Image: ({ image }) => <img src={image} alt="Message image" />,
|
|
539
|
-
* tools: {
|
|
540
|
-
* by_name: {
|
|
541
|
-
* calculator: CalculatorTool,
|
|
542
|
-
* weather: WeatherTool,
|
|
543
|
-
* },
|
|
544
|
-
* Fallback: DefaultToolComponent
|
|
545
|
-
* }
|
|
546
|
-
* }}
|
|
547
|
-
* />
|
|
548
|
-
* ```
|
|
32
|
+
* Renders the parts of a message with web-specific default components.
|
|
549
33
|
*/
|
|
550
34
|
export const MessagePrimitiveParts: FC<MessagePrimitiveParts.Props> = ({
|
|
551
35
|
components,
|
|
552
|
-
|
|
36
|
+
...rest
|
|
553
37
|
}) => {
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
key={`chainOfThought-${range.startIndex}`}
|
|
578
|
-
startIndex={range.startIndex}
|
|
579
|
-
endIndex={range.endIndex}
|
|
580
|
-
>
|
|
581
|
-
<ChainOfThoughtComponent />
|
|
582
|
-
</ChainOfThoughtByIndicesProvider>
|
|
583
|
-
);
|
|
584
|
-
} else if (range.type === "toolGroup") {
|
|
585
|
-
const ToolGroupComponent =
|
|
586
|
-
components?.ToolGroup ?? defaultComponents.ToolGroup;
|
|
587
|
-
return (
|
|
588
|
-
<ToolGroupComponent
|
|
589
|
-
key={`tool-${range.startIndex}`}
|
|
590
|
-
startIndex={range.startIndex}
|
|
591
|
-
endIndex={range.endIndex}
|
|
592
|
-
>
|
|
593
|
-
{Array.from(
|
|
594
|
-
{ length: range.endIndex - range.startIndex + 1 },
|
|
595
|
-
(_, i) => (
|
|
596
|
-
<MessagePrimitivePartByIndex
|
|
597
|
-
key={i}
|
|
598
|
-
index={range.startIndex + i}
|
|
599
|
-
components={components}
|
|
600
|
-
/>
|
|
601
|
-
),
|
|
602
|
-
)}
|
|
603
|
-
</ToolGroupComponent>
|
|
604
|
-
);
|
|
605
|
-
} else {
|
|
606
|
-
// reasoningGroup
|
|
607
|
-
const ReasoningGroupComponent =
|
|
608
|
-
components?.ReasoningGroup ?? defaultComponents.ReasoningGroup;
|
|
609
|
-
return (
|
|
610
|
-
<ReasoningGroupComponent
|
|
611
|
-
key={`reasoning-${range.startIndex}`}
|
|
612
|
-
startIndex={range.startIndex}
|
|
613
|
-
endIndex={range.endIndex}
|
|
614
|
-
>
|
|
615
|
-
{Array.from(
|
|
616
|
-
{ length: range.endIndex - range.startIndex + 1 },
|
|
617
|
-
(_, i) => (
|
|
618
|
-
<MessagePrimitivePartByIndex
|
|
619
|
-
key={i}
|
|
620
|
-
index={range.startIndex + i}
|
|
621
|
-
components={components}
|
|
622
|
-
/>
|
|
623
|
-
),
|
|
624
|
-
)}
|
|
625
|
-
</ReasoningGroupComponent>
|
|
626
|
-
);
|
|
38
|
+
const merged = components
|
|
39
|
+
? {
|
|
40
|
+
Text: components.Text ?? webDefaultComponents.Text,
|
|
41
|
+
Image: components.Image ?? webDefaultComponents.Image,
|
|
42
|
+
Reasoning:
|
|
43
|
+
components.Reasoning ?? messagePartsDefaultComponents.Reasoning,
|
|
44
|
+
Source: components.Source ?? messagePartsDefaultComponents.Source,
|
|
45
|
+
File: components.File ?? messagePartsDefaultComponents.File,
|
|
46
|
+
Unstable_Audio:
|
|
47
|
+
components.Unstable_Audio ??
|
|
48
|
+
messagePartsDefaultComponents.Unstable_Audio,
|
|
49
|
+
...("ChainOfThought" in components
|
|
50
|
+
? { ChainOfThought: components.ChainOfThought }
|
|
51
|
+
: {
|
|
52
|
+
tools: components.tools,
|
|
53
|
+
data: components.data,
|
|
54
|
+
ToolGroup:
|
|
55
|
+
components.ToolGroup ?? messagePartsDefaultComponents.ToolGroup,
|
|
56
|
+
ReasoningGroup:
|
|
57
|
+
components.ReasoningGroup ??
|
|
58
|
+
messagePartsDefaultComponents.ReasoningGroup,
|
|
59
|
+
}),
|
|
60
|
+
Empty: components.Empty,
|
|
627
61
|
}
|
|
628
|
-
|
|
629
|
-
}, [messageRanges, components, contentLength]);
|
|
62
|
+
: webDefaultComponents;
|
|
630
63
|
|
|
631
|
-
return
|
|
632
|
-
<>
|
|
633
|
-
{partsElements}
|
|
634
|
-
<ConditionalEmpty
|
|
635
|
-
components={components}
|
|
636
|
-
enabled={unstable_showEmptyOnNonTextEnd}
|
|
637
|
-
/>
|
|
638
|
-
</>
|
|
639
|
-
);
|
|
64
|
+
return <MessagePrimitivePartsBase components={merged as any} {...rest} />;
|
|
640
65
|
};
|
|
641
66
|
|
|
642
67
|
MessagePrimitiveParts.displayName = "MessagePrimitive.Parts";
|
|
68
|
+
|
|
69
|
+
// Re-export everything else unchanged
|
|
70
|
+
export {
|
|
71
|
+
MessagePartComponentBase as MessagePartComponent,
|
|
72
|
+
MessagePrimitivePartByIndexBase as MessagePrimitivePartByIndex,
|
|
73
|
+
};
|