@assistant-ui/core 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/attachment.d.ts +1 -1
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +1 -1
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/speech.d.ts +1 -1
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/suggestion.d.ts +1 -1
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/index.d.ts +44 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +13 -2
- package/dist/internal.js.map +1 -1
- package/dist/model-context/frame/host.d.ts +1 -1
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/provider.d.ts +1 -1
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +1 -1
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +1 -1
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +9 -0
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -0
- package/dist/react/AssistantRuntimeProvider.js +7 -0
- package/dist/react/AssistantRuntimeProvider.js.map +1 -0
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.js +2 -1
- package/dist/react/RuntimeAdapter.js.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +15 -0
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -0
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +154 -0
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -0
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +6 -0
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -0
- package/dist/react/adapters/TitleGenerationAdapter.js +15 -0
- package/dist/react/adapters/TitleGenerationAdapter.js.map +1 -0
- package/dist/react/index.d.ts +67 -6
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +70 -5
- package/dist/react/index.js.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +1 -1
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +10 -0
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useActionBarCopy.js +26 -0
- package/dist/react/primitive-hooks/useActionBarCopy.js.map +1 -0
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +5 -0
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useActionBarEdit.js +11 -0
- package/dist/react/primitive-hooks/useActionBarEdit.js.map +1 -0
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +9 -0
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useActionBarFeedback.js +19 -0
- package/dist/react/primitive-hooks/useActionBarFeedback.js.map +1 -0
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +5 -0
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useActionBarReload.js +13 -0
- package/dist/react/primitive-hooks/useActionBarReload.js.map +1 -0
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +5 -0
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useActionBarSpeak.js +15 -0
- package/dist/react/primitive-hooks/useActionBarSpeak.js.map +1 -0
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +5 -0
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.js +11 -0
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.js.map +1 -0
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +5 -0
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useBranchPickerNext.js +18 -0
- package/dist/react/primitive-hooks/useBranchPickerNext.js.map +1 -0
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +5 -0
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useBranchPickerPrevious.js +18 -0
- package/dist/react/primitive-hooks/useBranchPickerPrevious.js.map +1 -0
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +6 -0
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useComposerAddAttachment.js +11 -0
- package/dist/react/primitive-hooks/useComposerAddAttachment.js.map +1 -0
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +5 -0
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useComposerCancel.js +11 -0
- package/dist/react/primitive-hooks/useComposerCancel.js.map +1 -0
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +5 -0
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useComposerDictate.js +13 -0
- package/dist/react/primitive-hooks/useComposerDictate.js.map +1 -0
- package/dist/react/primitive-hooks/useComposerSend.d.ts +5 -0
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useComposerSend.js +11 -0
- package/dist/react/primitive-hooks/useComposerSend.js.map +1 -0
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +4 -0
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useEditComposerCancel.js +10 -0
- package/dist/react/primitive-hooks/useEditComposerCancel.js.map +1 -0
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +5 -0
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useEditComposerSend.js +11 -0
- package/dist/react/primitive-hooks/useEditComposerSend.js.map +1 -0
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +7 -0
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useMessageBranching.js +15 -0
- package/dist/react/primitive-hooks/useMessageBranching.js.map +1 -0
- package/dist/react/primitive-hooks/useMessageError.d.ts +2 -0
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useMessageError.js +8 -0
- package/dist/react/primitive-hooks/useMessageError.js.map +1 -0
- package/dist/react/primitive-hooks/useMessageReload.d.ts +5 -0
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useMessageReload.js +11 -0
- package/dist/react/primitive-hooks/useMessageReload.js.map +1 -0
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +10 -0
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useSuggestionTrigger.js +32 -0
- package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +2 -0
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadIsEmpty.js +5 -0
- package/dist/react/primitive-hooks/useThreadIsEmpty.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +2 -0
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadIsRunning.js +5 -0
- package/dist/react/primitive-hooks/useThreadIsRunning.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +4 -0
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemArchive.js +10 -0
- package/dist/react/primitive-hooks/useThreadListItemArchive.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +4 -0
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemDelete.js +10 -0
- package/dist/react/primitive-hooks/useThreadListItemDelete.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +4 -0
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemTrigger.js +10 -0
- package/dist/react/primitive-hooks/useThreadListItemTrigger.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +4 -0
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.js +10 -0
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +4 -0
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadListNew.js +10 -0
- package/dist/react/primitive-hooks/useThreadListNew.js.map +1 -0
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +3 -0
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -0
- package/dist/react/primitive-hooks/useThreadMessages.js +5 -0
- package/dist/react/primitive-hooks/useThreadMessages.js.map +1 -0
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +23 -13
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js +16 -8
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +19 -8
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.js +19 -7
- package/dist/react/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +19 -8
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +19 -7
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +41 -5
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +113 -5
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +10 -0
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -0
- package/dist/react/primitives/message/MessageQuote.js +27 -0
- package/dist/react/primitives/message/MessageQuote.js.map +1 -0
- package/dist/react/primitives/part/PartMessages.d.ts +37 -0
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -0
- package/dist/react/primitives/part/PartMessages.js +49 -0
- package/dist/react/primitives/part/PartMessages.js.map +1 -0
- package/dist/react/primitives/thread/ThreadMessages.d.ts +54 -72
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.js +32 -37
- package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +18 -10
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.js +25 -11
- package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +18 -6
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.js +15 -7
- package/dist/react/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +9 -0
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -0
- package/dist/react/providers/ReadonlyThreadProvider.js +52 -0
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -0
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js +2 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +2 -1
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +28 -0
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -0
- package/dist/react/runtimes/useLocalRuntime.js +64 -0
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -0
- package/dist/react/runtimes/useToolInvocations.d.ts +1 -1
- package/dist/react/runtimes/useToolInvocations.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +3 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +9 -0
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -0
- package/dist/react/utils/getMessageQuote.js +7 -0
- package/dist/react/utils/getMessageQuote.js.map +1 -0
- package/dist/runtime/api/assistant-runtime.d.ts +2 -2
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +2 -1
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/bindings.d.ts +1 -1
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +5 -1
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +2 -1
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +3 -1
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +3 -1
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +2 -1
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js +2 -1
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +18 -10
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +9 -3
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +2 -2
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +5 -2
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +3 -2
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +2 -2
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +5 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +4 -2
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.d.ts +1 -1
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +3 -2
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +1 -1
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +2 -1
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +3 -1
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +2 -2
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/internal.d.ts +1 -0
- package/dist/runtimes/internal.d.ts.map +1 -1
- package/dist/runtimes/internal.js +2 -0
- package/dist/runtimes/internal.js.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.js +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +2 -2
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +1 -1
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +85 -0
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -0
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +169 -0
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -0
- package/dist/runtimes/remote-thread-list/types.d.ts +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/store/clients/model-context-client.js +1 -1
- package/dist/store/clients/model-context-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.js +1 -1
- package/dist/store/clients/runtime-adapter.js.map +1 -1
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/suggestions.js.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +1 -1
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/index.d.ts +16 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +5 -3
- package/dist/store/index.js.map +1 -1
- package/dist/store/internal.d.ts +7 -1
- package/dist/store/internal.d.ts.map +1 -1
- package/dist/store/internal.js +7 -1
- package/dist/store/internal.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/tap-subscribable.d.ts +1 -1
- package/dist/store/runtime-clients/tap-subscribable.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +2 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +2 -1
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/scopes/attachment.d.ts +2 -2
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +2 -1
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +6 -2
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +4 -2
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +2 -2
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +3 -2
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.d.ts +2 -1
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +9 -2
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +1 -1
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +1 -1
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +1 -1
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.js +1 -1
- package/dist/utils/composite-context-provider.js.map +1 -1
- package/dist/utils/text.d.ts +1 -1
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js.map +1 -1
- package/package.json +10 -10
- package/src/adapters/attachment.ts +1 -1
- package/src/adapters/feedback.ts +1 -1
- package/src/adapters/speech.ts +1 -1
- package/src/adapters/suggestion.ts +1 -1
- package/src/index.ts +254 -5
- package/src/internal.ts +37 -2
- package/src/model-context/frame/host.ts +1 -1
- package/src/model-context/frame/provider.ts +1 -1
- package/src/model-context/registry.ts +1 -1
- package/src/model-context/types.ts +1 -1
- package/src/react/AssistantRuntimeProvider.tsx +22 -0
- package/src/react/RuntimeAdapter.ts +2 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +227 -0
- package/src/react/adapters/TitleGenerationAdapter.ts +20 -0
- package/src/react/client/DataRenderers.ts +2 -2
- package/src/react/client/Tools.ts +2 -2
- package/src/react/index.ts +167 -5
- package/src/react/model-context/useInlineRender.ts +1 -1
- package/src/react/primitive-hooks/useActionBarCopy.ts +38 -0
- package/src/react/primitive-hooks/useActionBarEdit.ts +13 -0
- package/src/react/primitive-hooks/useActionBarFeedback.ts +28 -0
- package/src/react/primitive-hooks/useActionBarReload.ts +18 -0
- package/src/react/primitive-hooks/useActionBarSpeak.ts +20 -0
- package/src/react/primitive-hooks/useActionBarStopSpeaking.ts +13 -0
- package/src/react/primitive-hooks/useBranchPickerNext.ts +19 -0
- package/src/react/primitive-hooks/useBranchPickerPrevious.ts +19 -0
- package/src/react/primitive-hooks/useComposerAddAttachment.ts +17 -0
- package/src/react/primitive-hooks/useComposerCancel.ts +13 -0
- package/src/react/primitive-hooks/useComposerDictate.ts +18 -0
- package/src/react/primitive-hooks/useComposerSend.ts +15 -0
- package/src/react/primitive-hooks/useEditComposerCancel.ts +12 -0
- package/src/react/primitive-hooks/useEditComposerSend.ts +13 -0
- package/src/react/primitive-hooks/useMessageBranching.ts +18 -0
- package/src/react/primitive-hooks/useMessageError.ts +10 -0
- package/src/react/primitive-hooks/useMessageReload.ts +13 -0
- package/src/react/primitive-hooks/useSuggestionTrigger.ts +43 -0
- package/src/react/primitive-hooks/useThreadIsEmpty.ts +5 -0
- package/src/react/primitive-hooks/useThreadIsRunning.ts +5 -0
- package/src/react/primitive-hooks/useThreadListItemArchive.ts +12 -0
- package/src/react/primitive-hooks/useThreadListItemDelete.ts +12 -0
- package/src/react/primitive-hooks/useThreadListItemTrigger.ts +12 -0
- package/src/react/primitive-hooks/useThreadListItemUnarchive.ts +12 -0
- package/src/react/primitive-hooks/useThreadListNew.ts +12 -0
- package/src/react/primitive-hooks/useThreadMessages.ts +6 -0
- package/src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx +72 -28
- package/src/react/primitives/composer/ComposerAttachments.tsx +69 -30
- package/src/react/primitives/message/MessageAttachments.tsx +69 -30
- package/src/react/primitives/message/MessageParts.tsx +212 -24
- package/src/react/primitives/message/MessageQuote.tsx +37 -0
- package/src/react/primitives/part/PartMessages.tsx +75 -0
- package/src/react/primitives/thread/ThreadMessages.tsx +113 -99
- package/src/react/primitives/thread/ThreadSuggestions.tsx +72 -28
- package/src/react/primitives/threadList/ThreadListItems.tsx +69 -23
- package/src/react/providers/ReadonlyThreadProvider.tsx +84 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +1 -1
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +1 -1
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +1 -1
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +2 -2
- package/src/react/runtimes/cloud/auiV0.ts +1 -1
- package/src/react/runtimes/cloud/useCloudThreadListAdapter.tsx +3 -1
- package/src/react/runtimes/createMessageConverter.ts +1 -1
- package/src/react/runtimes/external-message-converter.ts +2 -2
- package/src/react/runtimes/useLocalRuntime.ts +101 -0
- package/src/react/runtimes/useToolInvocations.ts +1 -1
- package/src/react/types/MessagePartComponentTypes.ts +4 -0
- package/src/react/utils/getMessageQuote.ts +18 -0
- package/src/runtime/api/assistant-runtime.ts +2 -2
- package/src/runtime/api/attachment-runtime.ts +2 -1
- package/src/runtime/api/bindings.ts +1 -1
- package/src/runtime/api/composer-runtime.ts +9 -10
- package/src/runtime/api/message-part-runtime.ts +3 -3
- package/src/runtime/api/message-runtime.ts +5 -6
- package/src/runtime/api/thread-list-item-runtime.ts +1 -1
- package/src/runtime/api/thread-list-runtime.ts +5 -3
- package/src/runtime/api/thread-runtime.ts +19 -11
- package/src/runtime/base/base-assistant-runtime-core.ts +2 -2
- package/src/runtime/base/base-composer-runtime-core.ts +6 -7
- package/src/runtime/base/base-thread-runtime-core.ts +3 -2
- package/src/runtime/base/default-edit-composer-runtime-core.ts +1 -1
- package/src/runtime/base/default-thread-composer-runtime-core.ts +1 -1
- package/src/runtime/interfaces/assistant-runtime-core.ts +2 -2
- package/src/runtime/interfaces/composer-runtime-core.ts +5 -8
- package/src/runtime/interfaces/thread-list-runtime-core.ts +1 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +4 -7
- package/src/runtime/utils/auto-status.ts +1 -1
- package/src/runtime/utils/chat-model-adapter.ts +7 -5
- package/src/runtime/utils/external-store-message.ts +1 -1
- package/src/runtime/utils/message-repository.ts +2 -1
- package/src/runtime/utils/thread-message-like.ts +3 -4
- package/src/runtimes/external-store/external-store-adapter.ts +1 -1
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +1 -1
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +2 -2
- package/src/runtimes/external-store/thread-message-converter.ts +1 -1
- package/src/runtimes/internal.ts +3 -0
- package/src/runtimes/local/local-thread-list-runtime-core.ts +1 -1
- package/src/runtimes/local/local-thread-runtime-core.ts +3 -3
- package/src/runtimes/local/should-continue.ts +1 -1
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +223 -0
- package/src/runtimes/remote-thread-list/types.ts +1 -1
- package/src/store/clients/chain-of-thought-client.ts +1 -1
- package/src/store/clients/model-context-client.ts +2 -2
- package/src/store/clients/no-op-composer-client.ts +1 -1
- package/src/store/clients/runtime-adapter.ts +1 -1
- package/src/store/clients/suggestions.ts +2 -1
- package/src/store/clients/thread-message-client.ts +4 -3
- package/src/store/index.ts +76 -2
- package/src/store/internal.ts +7 -1
- package/src/store/runtime-clients/attachment-runtime-client.ts +1 -1
- package/src/store/runtime-clients/composer-runtime-client.ts +4 -4
- package/src/store/runtime-clients/message-part-runtime-client.ts +1 -1
- package/src/store/runtime-clients/message-runtime-client.ts +2 -2
- package/src/store/runtime-clients/tap-subscribable.ts +1 -1
- package/src/store/runtime-clients/thread-list-item-runtime-client.ts +5 -2
- package/src/store/runtime-clients/thread-list-runtime-client.ts +3 -2
- package/src/store/runtime-clients/thread-runtime-client.ts +6 -4
- package/src/store/scopes/attachment.ts +2 -2
- package/src/store/scopes/chain-of-thought.ts +2 -1
- package/src/store/scopes/composer.ts +6 -8
- package/src/store/scopes/message.ts +4 -3
- package/src/store/scopes/model-context.ts +2 -2
- package/src/store/scopes/part.ts +3 -3
- package/src/store/scopes/thread-list-item.ts +2 -4
- package/src/store/scopes/thread.ts +11 -4
- package/src/store/scopes/threads.ts +1 -1
- package/src/subscribable/subscribable.ts +1 -1
- package/src/tests/MessageRepository.test.ts +2 -1
- package/src/tests/external-store-thread-runtime-core.test.ts +1 -1
- package/src/tests/no-unsafe-process-env.test.ts +58 -0
- package/src/utils/composite-context-provider.ts +1 -1
- package/src/utils/text.ts +2 -1
- package/dist/adapters/index.d.ts +0 -8
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/adapters/index.js +0 -3
- package/dist/adapters/index.js.map +0 -1
- package/dist/model-context/frame/index.d.ts +0 -5
- package/dist/model-context/frame/index.d.ts.map +0 -1
- package/dist/model-context/frame/index.js +0 -4
- package/dist/model-context/frame/index.js.map +0 -1
- package/dist/model-context/index.d.ts +0 -8
- package/dist/model-context/index.d.ts.map +0 -1
- package/dist/model-context/index.js +0 -9
- package/dist/model-context/index.js.map +0 -1
- package/dist/react/client/index.d.ts +0 -3
- package/dist/react/client/index.d.ts.map +0 -1
- package/dist/react/client/index.js +0 -3
- package/dist/react/client/index.js.map +0 -1
- package/dist/react/model-context/index.d.ts +0 -12
- package/dist/react/model-context/index.d.ts.map +0 -1
- package/dist/react/model-context/index.js +0 -11
- package/dist/react/model-context/index.js.map +0 -1
- package/dist/react/providers/index.d.ts +0 -10
- package/dist/react/providers/index.d.ts.map +0 -1
- package/dist/react/providers/index.js +0 -10
- package/dist/react/providers/index.js.map +0 -1
- package/dist/react/runtimes/cloud/index.d.ts +0 -4
- package/dist/react/runtimes/cloud/index.d.ts.map +0 -1
- package/dist/react/runtimes/cloud/index.js +0 -4
- package/dist/react/runtimes/cloud/index.js.map +0 -1
- package/dist/react/runtimes/index.d.ts +0 -10
- package/dist/react/runtimes/index.d.ts.map +0 -1
- package/dist/react/runtimes/index.js +0 -10
- package/dist/react/runtimes/index.js.map +0 -1
- package/dist/react/types/index.d.ts +0 -3
- package/dist/react/types/index.d.ts.map +0 -1
- package/dist/react/types/index.js +0 -2
- package/dist/react/types/index.js.map +0 -1
- package/dist/react/types/scopes/index.d.ts +0 -3
- package/dist/react/types/scopes/index.d.ts.map +0 -1
- package/dist/react/types/scopes/index.js +0 -2
- package/dist/react/types/scopes/index.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -20
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -7
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtimes/external-store/index.d.ts +0 -8
- package/dist/runtimes/external-store/index.d.ts.map +0 -1
- package/dist/runtimes/external-store/index.js +0 -5
- package/dist/runtimes/external-store/index.js.map +0 -1
- package/dist/runtimes/index.d.ts +0 -6
- package/dist/runtimes/index.d.ts.map +0 -1
- package/dist/runtimes/index.js +0 -4
- package/dist/runtimes/index.js.map +0 -1
- package/dist/runtimes/local/index.d.ts +0 -7
- package/dist/runtimes/local/index.d.ts.map +0 -1
- package/dist/runtimes/local/index.js +0 -5
- package/dist/runtimes/local/index.js.map +0 -1
- package/dist/store/clients/index.d.ts +0 -6
- package/dist/store/clients/index.d.ts.map +0 -1
- package/dist/store/clients/index.js +0 -6
- package/dist/store/clients/index.js.map +0 -1
- package/dist/store/runtime-clients/index.d.ts +0 -8
- package/dist/store/runtime-clients/index.d.ts.map +0 -1
- package/dist/store/runtime-clients/index.js +0 -8
- package/dist/store/runtime-clients/index.js.map +0 -1
- package/dist/store/scopes/index.d.ts +0 -12
- package/dist/store/scopes/index.d.ts.map +0 -1
- package/dist/store/scopes/index.js +0 -2
- package/dist/store/scopes/index.js.map +0 -1
- package/dist/subscribable/index.d.ts +0 -3
- package/dist/subscribable/index.d.ts.map +0 -1
- package/dist/subscribable/index.js +0 -8
- package/dist/subscribable/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -7
- package/dist/utils/index.js.map +0 -1
- package/src/adapters/index.ts +0 -30
- package/src/model-context/frame/index.ts +0 -10
- package/src/model-context/index.ts +0 -35
- package/src/react/client/index.ts +0 -2
- package/src/react/model-context/index.ts +0 -25
- package/src/react/providers/index.ts +0 -15
- package/src/react/runtimes/cloud/index.ts +0 -3
- package/src/react/runtimes/index.ts +0 -30
- package/src/react/types/index.ts +0 -31
- package/src/react/types/scopes/index.ts +0 -6
- package/src/runtime/index.ts +0 -109
- package/src/runtimes/external-store/index.ts +0 -15
- package/src/runtimes/index.ts +0 -28
- package/src/runtimes/local/index.ts +0 -6
- package/src/store/clients/index.ts +0 -8
- package/src/store/runtime-clients/index.ts +0 -7
- package/src/store/scopes/index.ts +0 -68
- package/src/subscribable/index.ts +0 -21
- package/src/types/index.ts +0 -40
- package/src/utils/index.ts +0 -14
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
type ComponentType,
|
|
3
|
+
type FC,
|
|
4
|
+
type ReactNode,
|
|
5
|
+
memo,
|
|
6
|
+
useMemo,
|
|
7
|
+
} from "react";
|
|
8
|
+
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
9
|
+
import type { SuggestionState } from "../../../store/scopes/suggestion";
|
|
3
10
|
import { SuggestionByIndexProvider } from "../../providers/SuggestionByIndexProvider";
|
|
4
11
|
|
|
12
|
+
type SuggestionsComponentConfig = {
|
|
13
|
+
/** Component used to render each suggestion */
|
|
14
|
+
Suggestion: ComponentType;
|
|
15
|
+
};
|
|
16
|
+
|
|
5
17
|
export namespace ThreadPrimitiveSuggestions {
|
|
6
|
-
export type Props =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
export type Props =
|
|
19
|
+
| {
|
|
20
|
+
/** @deprecated Use the children render function instead. */
|
|
21
|
+
components: SuggestionsComponentConfig;
|
|
22
|
+
children?: never;
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
/** Render function called for each suggestion. Receives the suggestion. */
|
|
26
|
+
children: (value: { suggestion: SuggestionState }) => ReactNode;
|
|
27
|
+
components?: never;
|
|
28
|
+
};
|
|
15
29
|
}
|
|
16
30
|
|
|
17
31
|
type SuggestionComponentProps = {
|
|
18
|
-
components:
|
|
32
|
+
components: SuggestionsComponentConfig;
|
|
19
33
|
};
|
|
20
34
|
|
|
21
35
|
const SuggestionComponent: FC<SuggestionComponentProps> = ({ components }) => {
|
|
@@ -26,7 +40,7 @@ const SuggestionComponent: FC<SuggestionComponentProps> = ({ components }) => {
|
|
|
26
40
|
export namespace ThreadPrimitiveSuggestionByIndex {
|
|
27
41
|
export type Props = {
|
|
28
42
|
index: number;
|
|
29
|
-
components:
|
|
43
|
+
components: SuggestionsComponentConfig;
|
|
30
44
|
};
|
|
31
45
|
}
|
|
32
46
|
|
|
@@ -50,33 +64,63 @@ export const ThreadPrimitiveSuggestionByIndex: FC<ThreadPrimitiveSuggestionByInd
|
|
|
50
64
|
ThreadPrimitiveSuggestionByIndex.displayName =
|
|
51
65
|
"ThreadPrimitive.SuggestionByIndex";
|
|
52
66
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export const ThreadPrimitiveSuggestionsImpl: FC<
|
|
57
|
-
ThreadPrimitiveSuggestions.Props
|
|
58
|
-
> = ({ components }) => {
|
|
67
|
+
const ThreadPrimitiveSuggestionsInner: FC<{
|
|
68
|
+
children: (value: { suggestion: SuggestionState }) => ReactNode;
|
|
69
|
+
}> = ({ children }) => {
|
|
59
70
|
const suggestionsLength = useAuiState(
|
|
60
71
|
(s) => s.suggestions.suggestions.length,
|
|
61
72
|
);
|
|
62
73
|
|
|
63
|
-
|
|
74
|
+
return useMemo(() => {
|
|
64
75
|
if (suggestionsLength === 0) return null;
|
|
65
76
|
return Array.from({ length: suggestionsLength }, (_, index) => (
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
<SuggestionByIndexProvider key={index} index={index}>
|
|
78
|
+
<RenderChildrenWithAccessor
|
|
79
|
+
getItemState={(aui) =>
|
|
80
|
+
aui.suggestions().suggestion({ index }).getState()
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
{(getItem) =>
|
|
84
|
+
children({
|
|
85
|
+
get suggestion() {
|
|
86
|
+
return getItem();
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
</RenderChildrenWithAccessor>
|
|
91
|
+
</SuggestionByIndexProvider>
|
|
71
92
|
));
|
|
72
|
-
}, [suggestionsLength,
|
|
93
|
+
}, [suggestionsLength, children]);
|
|
94
|
+
};
|
|
73
95
|
|
|
74
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Renders all suggestions.
|
|
98
|
+
*/
|
|
99
|
+
export const ThreadPrimitiveSuggestionsImpl: FC<
|
|
100
|
+
ThreadPrimitiveSuggestions.Props
|
|
101
|
+
> = ({ components, children }) => {
|
|
102
|
+
if (components) {
|
|
103
|
+
return (
|
|
104
|
+
<ThreadPrimitiveSuggestionsInner>
|
|
105
|
+
{() => <SuggestionComponent components={components} />}
|
|
106
|
+
</ThreadPrimitiveSuggestionsInner>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return (
|
|
110
|
+
<ThreadPrimitiveSuggestionsInner>
|
|
111
|
+
{children}
|
|
112
|
+
</ThreadPrimitiveSuggestionsInner>
|
|
113
|
+
);
|
|
75
114
|
};
|
|
76
115
|
|
|
77
116
|
ThreadPrimitiveSuggestionsImpl.displayName = "ThreadPrimitive.Suggestions";
|
|
78
117
|
|
|
79
118
|
export const ThreadPrimitiveSuggestions = memo(
|
|
80
119
|
ThreadPrimitiveSuggestionsImpl,
|
|
81
|
-
(prev, next) =>
|
|
120
|
+
(prev, next) => {
|
|
121
|
+
if (prev.children || next.children) {
|
|
122
|
+
return prev.children === next.children;
|
|
123
|
+
}
|
|
124
|
+
return prev.components!.Suggestion === next.components!.Suggestion;
|
|
125
|
+
},
|
|
82
126
|
);
|
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import { ComponentType, FC, memo, useMemo } from "react";
|
|
2
|
-
import { useAuiState } from "@assistant-ui/store";
|
|
3
|
-
import {
|
|
1
|
+
import { ComponentType, FC, ReactNode, memo, useMemo } from "react";
|
|
2
|
+
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
3
|
+
import type { ThreadListItemState } from "../../../store/scopes/thread-list-item";
|
|
4
|
+
import { ThreadListItemByIndexProvider } from "../../providers/ThreadListItemByIndexProvider";
|
|
5
|
+
|
|
6
|
+
type ThreadListItemsComponentConfig = {
|
|
7
|
+
ThreadListItem: ComponentType;
|
|
8
|
+
};
|
|
4
9
|
|
|
5
10
|
export namespace ThreadListPrimitiveItems {
|
|
6
11
|
export type Props = {
|
|
7
12
|
archived?: boolean | undefined;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
} & (
|
|
14
|
+
| {
|
|
15
|
+
/** @deprecated Use the children render function instead. */
|
|
16
|
+
components: ThreadListItemsComponentConfig;
|
|
17
|
+
children?: never;
|
|
18
|
+
}
|
|
19
|
+
| {
|
|
20
|
+
/** Render function called for each thread list item. Receives the item. */
|
|
21
|
+
children: (value: { threadListItem: ThreadListItemState }) => ReactNode;
|
|
22
|
+
components?: never;
|
|
23
|
+
}
|
|
24
|
+
);
|
|
12
25
|
}
|
|
13
26
|
|
|
14
27
|
export namespace ThreadListPrimitiveItemByIndex {
|
|
15
28
|
export type Props = {
|
|
16
29
|
index: number;
|
|
17
30
|
archived?: boolean | undefined;
|
|
18
|
-
components:
|
|
31
|
+
components: ThreadListItemsComponentConfig;
|
|
19
32
|
};
|
|
20
33
|
}
|
|
21
34
|
|
|
@@ -41,26 +54,59 @@ export const ThreadListPrimitiveItemByIndex: FC<ThreadListPrimitiveItemByIndex.P
|
|
|
41
54
|
|
|
42
55
|
ThreadListPrimitiveItemByIndex.displayName = "ThreadListPrimitive.ItemByIndex";
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
archived
|
|
46
|
-
|
|
47
|
-
}) => {
|
|
57
|
+
const ThreadListPrimitiveItemsInner: FC<{
|
|
58
|
+
archived: boolean;
|
|
59
|
+
children: (value: { threadListItem: ThreadListItemState }) => ReactNode;
|
|
60
|
+
}> = ({ archived, children }) => {
|
|
48
61
|
const contentLength = useAuiState((s) =>
|
|
49
62
|
archived ? s.threads.archivedThreadIds.length : s.threads.threadIds.length,
|
|
50
63
|
);
|
|
51
64
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
return useMemo(
|
|
66
|
+
() =>
|
|
67
|
+
Array.from({ length: contentLength }, (_, index) => (
|
|
68
|
+
<ThreadListItemByIndexProvider
|
|
69
|
+
key={index}
|
|
70
|
+
index={index}
|
|
71
|
+
archived={archived}
|
|
72
|
+
>
|
|
73
|
+
<RenderChildrenWithAccessor
|
|
74
|
+
getItemState={(aui) =>
|
|
75
|
+
aui.threads().item({ index, archived }).getState()
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
{(getItem) =>
|
|
79
|
+
children({
|
|
80
|
+
get threadListItem() {
|
|
81
|
+
return getItem();
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
</RenderChildrenWithAccessor>
|
|
86
|
+
</ThreadListItemByIndexProvider>
|
|
87
|
+
)),
|
|
88
|
+
[contentLength, archived, children],
|
|
89
|
+
);
|
|
90
|
+
};
|
|
62
91
|
|
|
63
|
-
|
|
92
|
+
export const ThreadListPrimitiveItems: FC<ThreadListPrimitiveItems.Props> = ({
|
|
93
|
+
archived = false,
|
|
94
|
+
components,
|
|
95
|
+
children,
|
|
96
|
+
}) => {
|
|
97
|
+
if (components) {
|
|
98
|
+
const ThreadListItemComponent = components.ThreadListItem;
|
|
99
|
+
return (
|
|
100
|
+
<ThreadListPrimitiveItemsInner archived={archived}>
|
|
101
|
+
{() => <ThreadListItemComponent />}
|
|
102
|
+
</ThreadListPrimitiveItemsInner>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return (
|
|
106
|
+
<ThreadListPrimitiveItemsInner archived={archived}>
|
|
107
|
+
{children}
|
|
108
|
+
</ThreadListPrimitiveItemsInner>
|
|
109
|
+
);
|
|
64
110
|
};
|
|
65
111
|
|
|
66
112
|
ThreadListPrimitiveItems.displayName = "ThreadListPrimitive.Items";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type FC,
|
|
3
|
+
type PropsWithChildren,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useState,
|
|
7
|
+
} from "react";
|
|
8
|
+
import { useAui, AuiProvider, Derived } from "@assistant-ui/store";
|
|
9
|
+
import type { ThreadMessage } from "../../types/message";
|
|
10
|
+
import { ReadonlyThreadRuntimeCore } from "../../runtimes/readonly/ReadonlyThreadRuntimeCore";
|
|
11
|
+
import {
|
|
12
|
+
ThreadRuntimeImpl,
|
|
13
|
+
type ThreadRuntimeCoreBinding,
|
|
14
|
+
type ThreadListItemRuntimeBinding,
|
|
15
|
+
} from "../../runtime/internal";
|
|
16
|
+
import { ThreadClient } from "../../store/runtime-clients/thread-runtime-client";
|
|
17
|
+
import type { ThreadListItemState } from "../../runtime/api/bindings";
|
|
18
|
+
|
|
19
|
+
const READONLY_THREAD_PATH = Object.freeze({
|
|
20
|
+
ref: "readonly-thread",
|
|
21
|
+
threadSelector: { type: "main" as const },
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const READONLY_THREAD_LIST_ITEM: ThreadListItemState = Object.freeze({
|
|
25
|
+
id: "readonly",
|
|
26
|
+
remoteId: undefined,
|
|
27
|
+
externalId: undefined,
|
|
28
|
+
isMain: true,
|
|
29
|
+
status: "regular" as const,
|
|
30
|
+
title: undefined,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const READONLY_THREAD_LIST_ITEM_BINDING: ThreadListItemRuntimeBinding =
|
|
34
|
+
Object.freeze({
|
|
35
|
+
path: READONLY_THREAD_PATH,
|
|
36
|
+
getState: () => READONLY_THREAD_LIST_ITEM,
|
|
37
|
+
subscribe: () => () => {},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export namespace ReadonlyThreadProvider {
|
|
41
|
+
export type Props = PropsWithChildren<{
|
|
42
|
+
messages: readonly ThreadMessage[];
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const ReadonlyThreadProvider: FC<ReadonlyThreadProvider.Props> = ({
|
|
47
|
+
messages,
|
|
48
|
+
children,
|
|
49
|
+
}) => {
|
|
50
|
+
const [core] = useState(() => {
|
|
51
|
+
const c = new ReadonlyThreadRuntimeCore();
|
|
52
|
+
c.setMessages(messages);
|
|
53
|
+
return c;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
core.setMessages(messages);
|
|
58
|
+
}, [core, messages]);
|
|
59
|
+
|
|
60
|
+
const threadRuntime = useMemo(() => {
|
|
61
|
+
const threadBinding: ThreadRuntimeCoreBinding = {
|
|
62
|
+
path: READONLY_THREAD_PATH,
|
|
63
|
+
getState: () => core,
|
|
64
|
+
subscribe: (callback) => core.subscribe(callback),
|
|
65
|
+
outerSubscribe: (callback) => core.subscribe(callback),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return new ThreadRuntimeImpl(
|
|
69
|
+
threadBinding,
|
|
70
|
+
READONLY_THREAD_LIST_ITEM_BINDING,
|
|
71
|
+
);
|
|
72
|
+
}, [core]);
|
|
73
|
+
|
|
74
|
+
const aui = useAui({
|
|
75
|
+
thread: ThreadClient({ runtime: threadRuntime }),
|
|
76
|
+
composer: Derived({
|
|
77
|
+
source: "thread",
|
|
78
|
+
query: {},
|
|
79
|
+
get: (aui) => aui.thread().composer(),
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return <AuiProvider value={aui}>{children}</AuiProvider>;
|
|
84
|
+
};
|
|
@@ -14,7 +14,7 @@ import { ThreadListItemRuntimeProvider } from "../providers/ThreadListItemRuntim
|
|
|
14
14
|
import type { ThreadRuntimeCore } from "../../runtime/interfaces/thread-runtime-core";
|
|
15
15
|
import type { ThreadListRuntimeCore } from "../../runtime/interfaces/thread-list-runtime-core";
|
|
16
16
|
import type { AssistantRuntime } from "../../runtime/api/assistant-runtime";
|
|
17
|
-
import { BaseSubscribable } from "../../subscribable";
|
|
17
|
+
import { BaseSubscribable } from "../../subscribable/subscribable";
|
|
18
18
|
import { ThreadRuntimeImpl } from "../../runtime/api/thread-runtime";
|
|
19
19
|
import { ThreadListRuntimeImpl } from "../../runtime/api/thread-list-runtime";
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThreadListRuntimeCore } from "../../runtime/interfaces/thread-list-runtime-core";
|
|
2
2
|
import { generateId } from "../../utils/id";
|
|
3
|
-
import { BaseSubscribable } from "../../subscribable";
|
|
3
|
+
import { BaseSubscribable } from "../../subscribable/subscribable";
|
|
4
4
|
import { OptimisticState } from "../../runtimes/remote-thread-list/optimistic-state";
|
|
5
5
|
import { EMPTY_THREAD_CORE } from "../../runtimes/remote-thread-list/empty-thread-core";
|
|
6
6
|
import type {
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
MessageFormatAdapter,
|
|
6
6
|
MessageFormatItem,
|
|
7
7
|
MessageFormatRepository,
|
|
8
|
-
} from "../../../adapters";
|
|
8
|
+
} from "../../../adapters/thread-history";
|
|
9
9
|
import type { ExportedMessageRepositoryItem } from "../../../runtime/utils/message-repository";
|
|
10
10
|
import {
|
|
11
11
|
AssistantCloud,
|
|
@@ -3,8 +3,8 @@ import type {
|
|
|
3
3
|
Attachment,
|
|
4
4
|
PendingAttachment,
|
|
5
5
|
CompleteAttachment,
|
|
6
|
-
|
|
7
|
-
} from "../../../types";
|
|
6
|
+
} from "../../../types/attachment";
|
|
7
|
+
import type { ThreadUserMessagePart } from "../../../types/message";
|
|
8
8
|
import type { AttachmentAdapter } from "../../../adapters/attachment";
|
|
9
9
|
|
|
10
10
|
const guessAttachmentType = (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageStatus, ThreadMessage } from "../../../types";
|
|
1
|
+
import type { MessageStatus, ThreadMessage } from "../../../types/message";
|
|
2
2
|
import { fromThreadMessageLike } from "../../../runtime/utils/thread-message-like";
|
|
3
3
|
import { CloudMessage } from "assistant-cloud";
|
|
4
4
|
import { isJSONValue } from "../../../utils/json/is-json";
|
|
@@ -26,7 +26,9 @@ type CloudThreadListAdapterOptions = {
|
|
|
26
26
|
delete?: ((threadId: string) => Promise<void>) | undefined;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
const baseUrl =
|
|
29
|
+
const baseUrl =
|
|
30
|
+
typeof process !== "undefined" &&
|
|
31
|
+
process?.env?.["NEXT_PUBLIC_ASSISTANT_BASE_URL"];
|
|
30
32
|
const autoCloud = baseUrl
|
|
31
33
|
? new AssistantCloud({ baseUrl, anonymous: true })
|
|
32
34
|
: undefined;
|
|
@@ -16,11 +16,11 @@ import type { ToolExecutionStatus } from "./useToolInvocations";
|
|
|
16
16
|
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
17
17
|
import { generateErrorMessageId } from "../../utils/id";
|
|
18
18
|
import type {
|
|
19
|
-
MessageTiming,
|
|
20
19
|
ThreadAssistantMessage,
|
|
21
20
|
ThreadMessage,
|
|
22
21
|
ToolCallMessagePart,
|
|
23
|
-
} from "../../types";
|
|
22
|
+
} from "../../types/message";
|
|
23
|
+
import type { MessageTiming } from "../../types/message";
|
|
24
24
|
|
|
25
25
|
export namespace useExternalMessageConverter {
|
|
26
26
|
export type Message =
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import type {
|
|
3
|
+
AssistantRuntime,
|
|
4
|
+
ChatModelAdapter,
|
|
5
|
+
ThreadMessageLike,
|
|
6
|
+
} from "../../index";
|
|
7
|
+
import type { LocalRuntimeOptionsBase } from "../../runtimes/local/local-runtime-options";
|
|
8
|
+
import { AssistantRuntimeImpl, LocalRuntimeCore } from "../../internal";
|
|
9
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
10
|
+
import { useRemoteThreadListRuntime } from "./useRemoteThreadListRuntime";
|
|
11
|
+
import { useCloudThreadListAdapter } from "./cloud/useCloudThreadListAdapter";
|
|
12
|
+
import { useRuntimeAdapters } from "./RuntimeAdapterProvider";
|
|
13
|
+
import type { AssistantCloud } from "assistant-cloud";
|
|
14
|
+
|
|
15
|
+
export type LocalRuntimeOptions = Omit<LocalRuntimeOptionsBase, "adapters"> & {
|
|
16
|
+
cloud?: AssistantCloud | undefined;
|
|
17
|
+
initialMessages?: readonly ThreadMessageLike[] | undefined;
|
|
18
|
+
adapters?: Omit<LocalRuntimeOptionsBase["adapters"], "chatModel"> | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const useLocalThreadRuntime = (
|
|
22
|
+
chatModel: ChatModelAdapter,
|
|
23
|
+
{ initialMessages, ...options }: LocalRuntimeOptions,
|
|
24
|
+
): AssistantRuntime => {
|
|
25
|
+
const { modelContext, ...threadListAdapters } = useRuntimeAdapters() ?? {};
|
|
26
|
+
const opt = {
|
|
27
|
+
...options,
|
|
28
|
+
adapters: {
|
|
29
|
+
...threadListAdapters,
|
|
30
|
+
...options.adapters,
|
|
31
|
+
chatModel,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const [runtime] = useState(() => new LocalRuntimeCore(opt, initialMessages));
|
|
36
|
+
|
|
37
|
+
const threadIdRef = useRef<string | undefined>(undefined);
|
|
38
|
+
threadIdRef.current = useAuiState((s) => s.threadListItem.remoteId);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
runtime.threads
|
|
42
|
+
.getMainThreadRuntimeCore()
|
|
43
|
+
.__internal_setGetThreadId(() => threadIdRef.current);
|
|
44
|
+
}, [runtime]);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
return () => {
|
|
48
|
+
runtime.threads.getMainThreadRuntimeCore().detach();
|
|
49
|
+
};
|
|
50
|
+
}, [runtime]);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
runtime.threads.getMainThreadRuntimeCore().__internal_setOptions(opt);
|
|
54
|
+
runtime.threads.getMainThreadRuntimeCore().__internal_load();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!modelContext) return undefined;
|
|
59
|
+
return runtime.registerModelContextProvider(modelContext);
|
|
60
|
+
}, [modelContext, runtime]);
|
|
61
|
+
|
|
62
|
+
return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const splitLocalRuntimeOptions = <T extends LocalRuntimeOptions>(
|
|
66
|
+
options: T,
|
|
67
|
+
) => {
|
|
68
|
+
const {
|
|
69
|
+
cloud,
|
|
70
|
+
initialMessages,
|
|
71
|
+
maxSteps,
|
|
72
|
+
adapters,
|
|
73
|
+
unstable_humanToolNames,
|
|
74
|
+
...rest
|
|
75
|
+
} = options;
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
localRuntimeOptions: {
|
|
79
|
+
cloud,
|
|
80
|
+
initialMessages,
|
|
81
|
+
maxSteps,
|
|
82
|
+
adapters,
|
|
83
|
+
unstable_humanToolNames,
|
|
84
|
+
},
|
|
85
|
+
otherOptions: rest,
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const useLocalRuntime = (
|
|
90
|
+
chatModel: ChatModelAdapter,
|
|
91
|
+
{ cloud, ...options }: LocalRuntimeOptions = {},
|
|
92
|
+
): AssistantRuntime => {
|
|
93
|
+
const cloudAdapter = useCloudThreadListAdapter({ cloud });
|
|
94
|
+
return useRemoteThreadListRuntime({
|
|
95
|
+
runtimeHook: function RuntimeHook() {
|
|
96
|
+
return useLocalThreadRuntime(chatModel, options);
|
|
97
|
+
},
|
|
98
|
+
adapter: cloudAdapter,
|
|
99
|
+
allowNesting: true,
|
|
100
|
+
});
|
|
101
|
+
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type ReadonlyJSONValue,
|
|
14
14
|
} from "assistant-stream/utils";
|
|
15
15
|
import { isJSONValueEqual } from "../../utils/json/is-json-equal";
|
|
16
|
-
import type { ThreadMessage } from "../../types";
|
|
16
|
+
import type { ThreadMessage } from "../../types/message";
|
|
17
17
|
|
|
18
18
|
export type AssistantTransportState = {
|
|
19
19
|
readonly messages: readonly ThreadMessage[];
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
TextMessagePart,
|
|
10
10
|
ToolCallMessagePart,
|
|
11
11
|
Unstable_AudioMessagePart,
|
|
12
|
+
QuoteInfo,
|
|
12
13
|
} from "../..";
|
|
13
14
|
import type { MessagePartState } from "../..";
|
|
14
15
|
import { ToolResponse } from "assistant-stream";
|
|
@@ -64,3 +65,6 @@ export type ToolCallMessagePartComponent<
|
|
|
64
65
|
TArgs = any,
|
|
65
66
|
TResult = any,
|
|
66
67
|
> = ComponentType<ToolCallMessagePartProps<TArgs, TResult>>;
|
|
68
|
+
|
|
69
|
+
export type QuoteMessagePartProps = QuoteInfo;
|
|
70
|
+
export type QuoteMessagePartComponent = ComponentType<QuoteMessagePartProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QuoteInfo } from "../../types/quote";
|
|
2
|
+
|
|
3
|
+
type MessageQuoteState = {
|
|
4
|
+
message: {
|
|
5
|
+
metadata?: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const getMessageQuote = (
|
|
10
|
+
state: MessageQuoteState,
|
|
11
|
+
): QuoteInfo | undefined => {
|
|
12
|
+
const metadata = state.message.metadata;
|
|
13
|
+
if (!metadata || typeof metadata !== "object") return undefined;
|
|
14
|
+
|
|
15
|
+
return (metadata as { custom?: Record<string, unknown> }).custom?.quote as
|
|
16
|
+
| QuoteInfo
|
|
17
|
+
| undefined;
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Unsubscribe } from "../../types";
|
|
2
|
-
import type { ModelContextProvider } from "../../model-context";
|
|
1
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
|
+
import type { ModelContextProvider } from "../../model-context/types";
|
|
3
3
|
import type { AssistantRuntimeCore } from "../interfaces/assistant-runtime-core";
|
|
4
4
|
import type { ThreadRuntime } from "./thread-runtime";
|
|
5
5
|
import {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Attachment, CompleteAttachment
|
|
1
|
+
import type { Attachment, CompleteAttachment } from "../../types/attachment";
|
|
2
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
3
|
import type { SubscribableWithState } from "../../subscribable/subscribable";
|
|
3
4
|
|
|
4
5
|
import type { ComposerRuntimeCoreBinding } from "./bindings";
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
QuoteInfo,
|
|
7
|
-
Unsubscribe,
|
|
8
|
-
} from "../../types";
|
|
1
|
+
import type { Attachment, CreateAttachment } from "../../types/attachment";
|
|
2
|
+
import type { MessageRole } from "../../types/message";
|
|
3
|
+
import type { QuoteInfo } from "../../types/quote";
|
|
4
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
5
|
+
import type { RunConfig } from "../../types/message";
|
|
9
6
|
import {
|
|
10
7
|
LazyMemoizeSubject,
|
|
8
|
+
EventSubscriptionSubject,
|
|
9
|
+
} from "../../subscribable/subscribable";
|
|
10
|
+
import {
|
|
11
11
|
ShallowMemoizeSubject,
|
|
12
12
|
SKIP_UPDATE,
|
|
13
|
-
|
|
14
|
-
} from "../../subscribable";
|
|
13
|
+
} from "../../subscribable/subscribable";
|
|
15
14
|
import type {
|
|
16
15
|
ComposerRuntimeCore,
|
|
17
16
|
ComposerRuntimeEventType,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ThreadAssistantMessagePart,
|
|
3
3
|
ThreadUserMessagePart,
|
|
4
|
-
MessagePartStatus,
|
|
5
4
|
ToolCallMessagePartStatus,
|
|
6
|
-
|
|
7
|
-
} from "../../types";
|
|
5
|
+
} from "../../types/message";
|
|
6
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
7
|
+
import type { MessagePartStatus } from "../../types/message";
|
|
8
8
|
import type { SubscribableWithState } from "../../subscribable/subscribable";
|
|
9
9
|
import type { ThreadRuntimeCoreBinding } from "./thread-runtime";
|
|
10
10
|
import type { MessageStateBinding } from "./bindings";
|
|
@@ -4,20 +4,19 @@ import {
|
|
|
4
4
|
} from "../interfaces/thread-runtime-core";
|
|
5
5
|
import { symbolInnerMessage } from "../utils/external-store-message";
|
|
6
6
|
import type {
|
|
7
|
-
MessagePartStatus,
|
|
8
|
-
RunConfig,
|
|
9
7
|
ToolCallMessagePartStatus,
|
|
10
8
|
ThreadMessage,
|
|
11
9
|
ThreadAssistantMessagePart,
|
|
12
10
|
ThreadUserMessagePart,
|
|
13
|
-
|
|
14
|
-
} from "../../types";
|
|
11
|
+
} from "../../types/message";
|
|
12
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
13
|
+
import type { MessagePartStatus, RunConfig } from "../../types/message";
|
|
15
14
|
import { getThreadMessageText } from "../../utils/text";
|
|
15
|
+
import { NestedSubscriptionSubject } from "../../subscribable/subscribable";
|
|
16
16
|
import {
|
|
17
|
-
NestedSubscriptionSubject,
|
|
18
17
|
SKIP_UPDATE,
|
|
19
18
|
ShallowMemoizeSubject,
|
|
20
|
-
} from "../../subscribable";
|
|
19
|
+
} from "../../subscribable/subscribable";
|
|
21
20
|
import {
|
|
22
21
|
AttachmentRuntime,
|
|
23
22
|
AttachmentState,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Unsubscribe } from "../../types";
|
|
1
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
2
|
import type { SubscribableWithState } from "../../subscribable/subscribable";
|
|
3
3
|
import type { ThreadListItemRuntimePath } from "./paths";
|
|
4
4
|
import type { ThreadListRuntimeCoreBinding } from "./thread-list-runtime";
|