@assistant-ui/core 0.1.5 → 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 +0 -1
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.js +0 -9
- package/dist/react/AssistantRuntimeProvider.js.map +1 -1
- 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/index.d.ts +67 -9
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +67 -8
- 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/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/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/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/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/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/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/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 +6 -6
- package/dist/react/runtimes/useLocalRuntime.js +1 -1
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- 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 +1 -12
- package/src/react/RuntimeAdapter.ts +2 -1
- package/src/react/client/DataRenderers.ts +2 -2
- package/src/react/client/Tools.ts +2 -2
- package/src/react/index.ts +157 -10
- package/src/react/model-context/useInlineRender.ts +1 -1
- 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/useComposerDictate.ts +18 -0
- package/src/react/primitive-hooks/useMessageError.ts +10 -0
- package/src/react/primitive-hooks/useSuggestionTrigger.ts +43 -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/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/createMessageConverter.ts +1 -1
- package/src/react/runtimes/external-message-converter.ts +2 -2
- package/src/react/runtimes/useLocalRuntime.ts +1 -1
- 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/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/primitive-hooks/index.d.ts +0 -15
- package/dist/react/primitive-hooks/index.d.ts.map +0 -1
- package/dist/react/primitive-hooks/index.js +0 -15
- package/dist/react/primitive-hooks/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 -11
- package/dist/react/runtimes/index.d.ts.map +0 -1
- package/dist/react/runtimes/index.js +0 -11
- 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/primitive-hooks/index.ts +0 -20
- package/src/react/providers/index.ts +0 -15
- package/src/react/runtimes/cloud/index.ts +0 -3
- package/src/react/runtimes/index.ts +0 -36
- 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
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
|
+
import type { ThreadMessage } from "../../types/message";
|
|
3
|
+
import type { ThreadRuntimeCore } from "../../runtime/interfaces/thread-runtime-core";
|
|
4
|
+
import { BaseSubscribable } from "../../subscribable/subscribable";
|
|
5
|
+
|
|
6
|
+
const READONLY_THREAD_ERROR = new Error(
|
|
7
|
+
"This is a readonly thread. You cannot perform mutations on readonly threads.",
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export class ReadonlyThreadRuntimeCore
|
|
11
|
+
extends BaseSubscribable
|
|
12
|
+
implements ThreadRuntimeCore
|
|
13
|
+
{
|
|
14
|
+
private _messages: readonly ThreadMessage[] = [];
|
|
15
|
+
|
|
16
|
+
get messages() {
|
|
17
|
+
return this._messages;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
setMessages(messages: readonly ThreadMessage[]) {
|
|
21
|
+
if (this._messages === messages) return;
|
|
22
|
+
this._messages = messages;
|
|
23
|
+
this._notifySubscribers();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
getMessageById(messageId: string) {
|
|
27
|
+
const idx = this._messages.findIndex((m) => m.id === messageId);
|
|
28
|
+
if (idx === -1) return undefined;
|
|
29
|
+
return {
|
|
30
|
+
parentId: this._messages[idx - 1]?.id ?? null,
|
|
31
|
+
message: this._messages[idx]!,
|
|
32
|
+
index: idx,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getBranches(messageId: string) {
|
|
37
|
+
// no branching in readonly threads
|
|
38
|
+
const idx = this._messages.findIndex((m) => m.id === messageId);
|
|
39
|
+
if (idx === -1) return [];
|
|
40
|
+
return [messageId];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
switchToBranch(): void {
|
|
44
|
+
throw READONLY_THREAD_ERROR;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
append(): void {
|
|
48
|
+
throw READONLY_THREAD_ERROR;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
startRun(): void {
|
|
52
|
+
throw READONLY_THREAD_ERROR;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
resumeRun(): void {
|
|
56
|
+
throw READONLY_THREAD_ERROR;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
cancelRun(): void {
|
|
60
|
+
// noop - nothing to cancel
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
addToolResult(): void {
|
|
64
|
+
throw READONLY_THREAD_ERROR;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
resumeToolCall(): void {
|
|
68
|
+
throw READONLY_THREAD_ERROR;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
speak(): void {
|
|
72
|
+
throw READONLY_THREAD_ERROR;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
stopSpeaking(): void {
|
|
76
|
+
// noop
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
submitFeedback(): void {
|
|
80
|
+
throw READONLY_THREAD_ERROR;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getModelContext() {
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
exportExternalState() {
|
|
88
|
+
throw READONLY_THREAD_ERROR;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
importExternalState(): void {
|
|
92
|
+
throw READONLY_THREAD_ERROR;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
unstable_loadExternalState(): void {
|
|
96
|
+
throw READONLY_THREAD_ERROR;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
composer = {
|
|
100
|
+
attachments: [] as never[],
|
|
101
|
+
attachmentAccept: "*",
|
|
102
|
+
|
|
103
|
+
async addAttachment() {
|
|
104
|
+
throw READONLY_THREAD_ERROR;
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
async removeAttachment() {
|
|
108
|
+
throw READONLY_THREAD_ERROR;
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
isEditing: false as const,
|
|
112
|
+
canCancel: false,
|
|
113
|
+
isEmpty: true,
|
|
114
|
+
text: "",
|
|
115
|
+
|
|
116
|
+
setText() {
|
|
117
|
+
throw READONLY_THREAD_ERROR;
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
role: "user" as const,
|
|
121
|
+
|
|
122
|
+
setRole() {
|
|
123
|
+
throw READONLY_THREAD_ERROR;
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
runConfig: {},
|
|
127
|
+
|
|
128
|
+
setRunConfig() {
|
|
129
|
+
throw READONLY_THREAD_ERROR;
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
async reset() {
|
|
133
|
+
// noop
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
async clearAttachments() {
|
|
137
|
+
// noop
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
send() {
|
|
141
|
+
throw READONLY_THREAD_ERROR;
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
cancel() {
|
|
145
|
+
// noop
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
dictation: undefined,
|
|
149
|
+
|
|
150
|
+
startDictation() {
|
|
151
|
+
throw READONLY_THREAD_ERROR;
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
stopDictation() {
|
|
155
|
+
// noop
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
quote: undefined,
|
|
159
|
+
|
|
160
|
+
setQuote() {
|
|
161
|
+
throw READONLY_THREAD_ERROR;
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
subscribe() {
|
|
165
|
+
return () => {};
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
unstable_on() {
|
|
169
|
+
return () => {};
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
getEditComposer() {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
beginEdit(): void {
|
|
178
|
+
throw READONLY_THREAD_ERROR;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
speech = undefined;
|
|
182
|
+
|
|
183
|
+
capabilities = {
|
|
184
|
+
switchToBranch: false,
|
|
185
|
+
switchBranchDuringRun: false,
|
|
186
|
+
edit: false,
|
|
187
|
+
reload: false,
|
|
188
|
+
cancel: false,
|
|
189
|
+
unstable_copy: false,
|
|
190
|
+
speech: false,
|
|
191
|
+
dictation: false,
|
|
192
|
+
attachments: false,
|
|
193
|
+
feedback: false,
|
|
194
|
+
} as const;
|
|
195
|
+
|
|
196
|
+
isDisabled = false;
|
|
197
|
+
isLoading = false;
|
|
198
|
+
|
|
199
|
+
state = null;
|
|
200
|
+
suggestions = [] as never[];
|
|
201
|
+
extras = undefined;
|
|
202
|
+
|
|
203
|
+
import(): void {
|
|
204
|
+
throw READONLY_THREAD_ERROR;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export() {
|
|
208
|
+
return {
|
|
209
|
+
messages: this._messages.map((message, idx) => ({
|
|
210
|
+
message,
|
|
211
|
+
parentId: this._messages[idx - 1]?.id ?? null,
|
|
212
|
+
})),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
reset(): void {
|
|
217
|
+
throw READONLY_THREAD_ERROR;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
unstable_on(): Unsubscribe {
|
|
221
|
+
return () => {};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
ChainOfThoughtState,
|
|
5
5
|
ChainOfThoughtPart,
|
|
6
6
|
} from "../scopes/chain-of-thought";
|
|
7
|
-
import type { MessagePartStatus } from "../../types";
|
|
7
|
+
import type { MessagePartStatus } from "../../types/message";
|
|
8
8
|
import type { PartMethods } from "../scopes/part";
|
|
9
9
|
|
|
10
10
|
const COMPLETE_STATUS: MessagePartStatus = Object.freeze({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resource, tapMemo, tapState } from "@assistant-ui/tap";
|
|
2
2
|
import type { ClientOutput } from "@assistant-ui/store";
|
|
3
|
-
import { CompositeContextProvider } from "../../utils";
|
|
4
|
-
import type { ModelContextState } from "../scopes";
|
|
3
|
+
import { CompositeContextProvider } from "../../utils/composite-context-provider";
|
|
4
|
+
import type { ModelContextState } from "../scopes/model-context";
|
|
5
5
|
|
|
6
6
|
const version = 1;
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resource, tapMemo } from "@assistant-ui/tap";
|
|
2
2
|
import type { ClientOutput } from "@assistant-ui/store";
|
|
3
|
-
import type { ComposerState } from "../scopes";
|
|
3
|
+
import type { ComposerState } from "../scopes/composer";
|
|
4
4
|
|
|
5
5
|
export const NoOpComposerClient = resource(
|
|
6
6
|
({ type }: { type: "edit" | "thread" }): ClientOutput<"composer"> => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resource, tapEffect, tapResource } from "@assistant-ui/tap";
|
|
2
2
|
import type { AssistantRuntime } from "../../runtime/api/assistant-runtime";
|
|
3
|
-
import { ThreadListClient } from "../runtime-clients";
|
|
3
|
+
import { ThreadListClient } from "../runtime-clients/thread-list-runtime-client";
|
|
4
4
|
import {
|
|
5
5
|
tapAssistantClientRef,
|
|
6
6
|
Derived,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { resource, tapState, withKey } from "@assistant-ui/tap";
|
|
2
2
|
import type { ClientOutput } from "@assistant-ui/store";
|
|
3
3
|
import { tapClientLookup } from "@assistant-ui/store";
|
|
4
|
-
import type { SuggestionsState
|
|
4
|
+
import type { SuggestionsState } from "../scopes/suggestions";
|
|
5
|
+
import type { SuggestionState } from "../scopes/suggestion";
|
|
5
6
|
|
|
6
7
|
export type SuggestionConfig =
|
|
7
8
|
| string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ThreadAssistantMessagePart,
|
|
3
3
|
ThreadUserMessagePart,
|
|
4
|
-
Attachment,
|
|
5
4
|
ThreadMessage,
|
|
6
|
-
} from "../../types";
|
|
5
|
+
} from "../../types/message";
|
|
6
|
+
import type { Attachment } from "../../types/attachment";
|
|
7
7
|
import {
|
|
8
8
|
resource,
|
|
9
9
|
tapMemo,
|
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
} from "@assistant-ui/tap";
|
|
14
14
|
import type { ClientOutput } from "@assistant-ui/store";
|
|
15
15
|
import { tapClientLookup } from "@assistant-ui/store";
|
|
16
|
-
import type { MessageState
|
|
16
|
+
import type { MessageState } from "../scopes/message";
|
|
17
|
+
import type { PartState } from "../scopes/part";
|
|
17
18
|
import { NoOpComposerClient } from "./no-op-composer-client";
|
|
18
19
|
|
|
19
20
|
const ThreadMessagePartClient = resource(
|
package/src/store/index.ts
CHANGED
|
@@ -1,7 +1,81 @@
|
|
|
1
1
|
/// <reference path="./scope-registration.ts" />
|
|
2
2
|
|
|
3
3
|
// scopes
|
|
4
|
-
export
|
|
4
|
+
export type {
|
|
5
|
+
ThreadsState,
|
|
6
|
+
ThreadsMethods,
|
|
7
|
+
ThreadsClientSchema,
|
|
8
|
+
} from "./scopes/threads";
|
|
9
|
+
export type {
|
|
10
|
+
ThreadListItemState,
|
|
11
|
+
ThreadListItemMethods,
|
|
12
|
+
ThreadListItemMeta,
|
|
13
|
+
ThreadListItemEvents,
|
|
14
|
+
ThreadListItemClientSchema,
|
|
15
|
+
} from "./scopes/thread-list-item";
|
|
16
|
+
export type {
|
|
17
|
+
ThreadState,
|
|
18
|
+
ThreadMethods,
|
|
19
|
+
ThreadMeta,
|
|
20
|
+
ThreadEvents,
|
|
21
|
+
ThreadClientSchema,
|
|
22
|
+
} from "./scopes/thread";
|
|
23
|
+
export type {
|
|
24
|
+
MessageState,
|
|
25
|
+
MessageMethods,
|
|
26
|
+
MessageMeta,
|
|
27
|
+
MessageClientSchema,
|
|
28
|
+
} from "./scopes/message";
|
|
29
|
+
export type {
|
|
30
|
+
PartState,
|
|
31
|
+
PartMethods,
|
|
32
|
+
PartMeta,
|
|
33
|
+
PartClientSchema,
|
|
34
|
+
} from "./scopes/part";
|
|
35
|
+
export type {
|
|
36
|
+
ComposerState,
|
|
37
|
+
ComposerMethods,
|
|
38
|
+
ComposerMeta,
|
|
39
|
+
ComposerEvents,
|
|
40
|
+
ComposerClientSchema,
|
|
41
|
+
} from "./scopes/composer";
|
|
42
|
+
export type {
|
|
43
|
+
AttachmentState,
|
|
44
|
+
AttachmentMethods,
|
|
45
|
+
AttachmentMeta,
|
|
46
|
+
AttachmentClientSchema,
|
|
47
|
+
} from "./scopes/attachment";
|
|
48
|
+
export type {
|
|
49
|
+
SuggestionsState,
|
|
50
|
+
SuggestionsMethods,
|
|
51
|
+
SuggestionsClientSchema,
|
|
52
|
+
Suggestion,
|
|
53
|
+
} from "./scopes/suggestions";
|
|
54
|
+
export type {
|
|
55
|
+
SuggestionState,
|
|
56
|
+
SuggestionMethods,
|
|
57
|
+
SuggestionMeta,
|
|
58
|
+
SuggestionClientSchema,
|
|
59
|
+
} from "./scopes/suggestion";
|
|
60
|
+
export type {
|
|
61
|
+
ModelContextState,
|
|
62
|
+
ModelContextMethods,
|
|
63
|
+
ModelContextClientSchema,
|
|
64
|
+
} from "./scopes/model-context";
|
|
65
|
+
export type {
|
|
66
|
+
ChainOfThoughtState,
|
|
67
|
+
ChainOfThoughtMethods,
|
|
68
|
+
ChainOfThoughtMeta,
|
|
69
|
+
ChainOfThoughtClientSchema,
|
|
70
|
+
ChainOfThoughtPart,
|
|
71
|
+
} from "./scopes/chain-of-thought";
|
|
5
72
|
|
|
6
73
|
// clients
|
|
7
|
-
export
|
|
74
|
+
export { NoOpComposerClient } from "./clients/no-op-composer-client";
|
|
75
|
+
export { Suggestions, type SuggestionConfig } from "./clients/suggestions";
|
|
76
|
+
export { ChainOfThoughtClient } from "./clients/chain-of-thought-client";
|
|
77
|
+
export {
|
|
78
|
+
ThreadMessageClient,
|
|
79
|
+
type ThreadMessageClientProps,
|
|
80
|
+
} from "./clients/thread-message-client";
|
|
81
|
+
export { ModelContext } from "./clients/model-context-client";
|
package/src/store/internal.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { AttachmentRuntimeClient } from "./runtime-clients/attachment-runtime-client";
|
|
2
|
+
export { MessagePartClient } from "./runtime-clients/message-part-runtime-client";
|
|
3
|
+
export { ComposerClient } from "./runtime-clients/composer-runtime-client";
|
|
4
|
+
export { MessageClient } from "./runtime-clients/message-runtime-client";
|
|
5
|
+
export { ThreadClient } from "./runtime-clients/thread-runtime-client";
|
|
6
|
+
export { ThreadListItemClient } from "./runtime-clients/thread-list-item-runtime-client";
|
|
7
|
+
export { ThreadListClient } from "./runtime-clients/thread-list-runtime-client";
|
|
2
8
|
export {
|
|
3
9
|
RuntimeAdapterResource,
|
|
4
10
|
baseRuntimeAdapterTransformScopes,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resource } from "@assistant-ui/tap";
|
|
2
2
|
import { type ClientOutput } from "@assistant-ui/store";
|
|
3
|
-
import { AttachmentRuntime } from "../../runtime";
|
|
3
|
+
import { AttachmentRuntime } from "../../runtime/api/attachment-runtime";
|
|
4
4
|
import { tapSubscribable } from "./tap-subscribable";
|
|
5
5
|
|
|
6
6
|
export const AttachmentRuntimeClient = resource(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Unsubscribe } from "../../types";
|
|
1
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
2
|
import {
|
|
3
3
|
resource,
|
|
4
4
|
tapMemo,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
ComposerRuntime,
|
|
17
17
|
EditComposerRuntime,
|
|
18
|
-
|
|
19
|
-
} from "../../runtime";
|
|
20
|
-
import { ComposerState } from "../scopes";
|
|
18
|
+
} from "../../runtime/api/composer-runtime";
|
|
19
|
+
import { ComposerRuntimeEventType } from "../../runtime/interfaces/composer-runtime-core";
|
|
20
|
+
import { ComposerState } from "../scopes/composer";
|
|
21
21
|
import { AttachmentRuntimeClient } from "./attachment-runtime-client";
|
|
22
22
|
import { tapSubscribable } from "./tap-subscribable";
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resource } from "@assistant-ui/tap";
|
|
2
2
|
import { type ClientOutput } from "@assistant-ui/store";
|
|
3
|
-
import { MessagePartRuntime } from "../../runtime";
|
|
3
|
+
import { MessagePartRuntime } from "../../runtime/api/message-part-runtime";
|
|
4
4
|
import { tapSubscribable } from "./tap-subscribable";
|
|
5
5
|
|
|
6
6
|
export const MessagePartClient = resource(
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
tapClientLookup,
|
|
12
12
|
tapClientResource,
|
|
13
13
|
} from "@assistant-ui/store";
|
|
14
|
-
import { MessageRuntime } from "../../runtime";
|
|
14
|
+
import { MessageRuntime } from "../../runtime/api/message-runtime";
|
|
15
15
|
import { tapSubscribable } from "./tap-subscribable";
|
|
16
16
|
import { ComposerClient } from "./composer-runtime-client";
|
|
17
17
|
import { MessagePartClient } from "./message-part-runtime-client";
|
|
18
|
-
import { MessageState } from "../scopes";
|
|
18
|
+
import { MessageState } from "../scopes/message";
|
|
19
19
|
import { AttachmentRuntimeClient } from "./attachment-runtime-client";
|
|
20
20
|
|
|
21
21
|
const MessageAttachmentClientByIndex = resource(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tapState, tapEffect } from "@assistant-ui/tap";
|
|
2
|
-
import type { SubscribableWithState } from "../../subscribable";
|
|
2
|
+
import type { SubscribableWithState } from "../../subscribable/subscribable";
|
|
3
3
|
|
|
4
4
|
export const tapSubscribable = <T>(
|
|
5
5
|
subscribable: Omit<SubscribableWithState<T, any>, "path">,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { Unsubscribe } from "../../types";
|
|
1
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
2
|
import { resource, tapEffect } from "@assistant-ui/tap";
|
|
3
3
|
import { type ClientOutput, tapAssistantEmit } from "@assistant-ui/store";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ThreadListItemEventType,
|
|
6
|
+
ThreadListItemRuntime,
|
|
7
|
+
} from "../../runtime/api/thread-list-item-runtime";
|
|
5
8
|
import { tapSubscribable } from "./tap-subscribable";
|
|
6
9
|
|
|
7
10
|
export const ThreadListItemClient = resource(
|
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
tapClientLookup,
|
|
5
5
|
tapClientResource,
|
|
6
6
|
} from "@assistant-ui/store";
|
|
7
|
-
import { ThreadListRuntime
|
|
7
|
+
import { ThreadListRuntime } from "../../runtime/api/thread-list-runtime";
|
|
8
|
+
import { AssistantRuntime } from "../../runtime/api/assistant-runtime";
|
|
8
9
|
import { tapSubscribable } from "./tap-subscribable";
|
|
9
10
|
import { ThreadListItemClient } from "./thread-list-item-runtime-client";
|
|
10
11
|
import { ThreadClient } from "./thread-runtime-client";
|
|
11
|
-
import { ThreadsState } from "../scopes";
|
|
12
|
+
import { ThreadsState } from "../scopes/threads";
|
|
12
13
|
|
|
13
14
|
const ThreadListItemClientById = resource(
|
|
14
15
|
({ runtime, id }: { runtime: ThreadListRuntime; id: string }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Unsubscribe } from "../../types";
|
|
2
|
-
import { ThreadRuntimeEventType
|
|
1
|
+
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
2
|
+
import { ThreadRuntimeEventType } from "../../runtime/interfaces/thread-runtime-core";
|
|
3
|
+
import { ThreadRuntime } from "../../runtime/api/thread-runtime";
|
|
3
4
|
import {
|
|
4
5
|
resource,
|
|
5
6
|
tapResource,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
import { ComposerClient } from "./composer-runtime-client";
|
|
18
19
|
import { MessageClient } from "./message-runtime-client";
|
|
19
20
|
import { tapSubscribable } from "./tap-subscribable";
|
|
20
|
-
import { ThreadState } from "../scopes";
|
|
21
|
+
import { ThreadState } from "../scopes/thread";
|
|
21
22
|
|
|
22
23
|
const MessageClientById = resource(
|
|
23
24
|
({
|
|
@@ -115,7 +116,8 @@ export const ThreadClient = resource(
|
|
|
115
116
|
composer: () => composer.methods,
|
|
116
117
|
append: runtime.append,
|
|
117
118
|
startRun: runtime.startRun,
|
|
118
|
-
|
|
119
|
+
resumeRun: runtime.resumeRun,
|
|
120
|
+
unstable_resumeRun: runtime.resumeRun,
|
|
119
121
|
cancelRun: runtime.cancelRun,
|
|
120
122
|
getModelContext: runtime.getModelContext,
|
|
121
123
|
export: runtime.export,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Attachment } from "../../types";
|
|
2
|
-
import type { AttachmentRuntime } from "../../runtime";
|
|
1
|
+
import type { Attachment } from "../../types/attachment";
|
|
2
|
+
import type { AttachmentRuntime } from "../../runtime/api/attachment-runtime";
|
|
3
3
|
|
|
4
4
|
export type AttachmentState = Attachment;
|
|
5
5
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolCallMessagePartStatus } from "../../types/message";
|
|
2
|
+
import type { MessagePartStatus } from "../../types/message";
|
|
2
3
|
import type { PartMethods, PartState } from "./part";
|
|
3
4
|
|
|
4
5
|
export type ChainOfThoughtPart = Extract<
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "../../types";
|
|
8
|
-
import type { ComposerRuntime, DictationState } from "../../runtime";
|
|
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 { RunConfig } from "../../types/message";
|
|
5
|
+
import type { ComposerRuntime } from "../../runtime/api/composer-runtime";
|
|
6
|
+
import type { DictationState } from "../../runtime/interfaces/composer-runtime-core";
|
|
9
7
|
import type { AttachmentMethods } from "./attachment";
|
|
10
8
|
|
|
11
9
|
export type ComposerState = {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { ThreadMessage
|
|
1
|
+
import type { ThreadMessage } from "../../types/message";
|
|
2
|
+
import type { RunConfig } from "../../types/message";
|
|
2
3
|
import type {
|
|
3
4
|
SpeechState,
|
|
4
5
|
SubmittedFeedback,
|
|
5
|
-
|
|
6
|
-
} from "../../runtime";
|
|
6
|
+
} from "../../runtime/interfaces/thread-runtime-core";
|
|
7
|
+
import type { MessageRuntime } from "../../runtime/api/message-runtime";
|
|
7
8
|
import type { ComposerMethods, ComposerState } from "./composer";
|
|
8
9
|
import type { PartMethods, PartState } from "./part";
|
|
9
10
|
import type { AttachmentMethods } from "./attachment";
|
|
@@ -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
|
|
|
4
4
|
export type ModelContextState = Record<string, never>;
|
|
5
5
|
|
package/src/store/scopes/part.ts
CHANGED
|
@@ -2,10 +2,10 @@ import type { ToolResponse } from "assistant-stream";
|
|
|
2
2
|
import type {
|
|
3
3
|
ThreadUserMessagePart,
|
|
4
4
|
ThreadAssistantMessagePart,
|
|
5
|
-
MessagePartStatus,
|
|
6
5
|
ToolCallMessagePartStatus,
|
|
7
|
-
} from "../../types";
|
|
8
|
-
import type {
|
|
6
|
+
} from "../../types/message";
|
|
7
|
+
import type { MessagePartStatus } from "../../types/message";
|
|
8
|
+
import type { MessagePartRuntime } from "../../runtime/api/message-part-runtime";
|
|
9
9
|
|
|
10
10
|
export type PartState = (ThreadUserMessagePart | ThreadAssistantMessagePart) & {
|
|
11
11
|
readonly status: MessagePartStatus | ToolCallMessagePartStatus;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
ThreadListItemStatus,
|
|
4
|
-
} from "../../runtime";
|
|
1
|
+
import type { ThreadListItemRuntime } from "../../runtime/api/thread-list-item-runtime";
|
|
2
|
+
import type { ThreadListItemStatus } from "../../runtime/interfaces/thread-list-runtime-core";
|
|
5
3
|
|
|
6
4
|
export type ThreadListItemState = {
|
|
7
5
|
readonly id: string;
|
|
@@ -3,14 +3,16 @@ import type {
|
|
|
3
3
|
RuntimeCapabilities,
|
|
4
4
|
SpeechState,
|
|
5
5
|
ThreadSuggestion,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
} from "../../runtime/interfaces/thread-runtime-core";
|
|
7
|
+
import type { ExportedMessageRepository } from "../../runtime/utils/message-repository";
|
|
8
|
+
import type { ThreadMessageLike } from "../../runtime/utils/thread-message-like";
|
|
9
|
+
import type {
|
|
8
10
|
CreateAppendMessage,
|
|
9
11
|
CreateStartRunConfig,
|
|
10
12
|
CreateResumeRunConfig,
|
|
11
13
|
ThreadRuntime,
|
|
12
|
-
} from "../../runtime";
|
|
13
|
-
import type { ModelContext } from "../../model-context";
|
|
14
|
+
} from "../../runtime/api/thread-runtime";
|
|
15
|
+
import type { ModelContext } from "../../model-context/types";
|
|
14
16
|
import type { MessageMethods, MessageState } from "./message";
|
|
15
17
|
import type { ComposerMethods, ComposerState } from "./composer";
|
|
16
18
|
|
|
@@ -92,6 +94,11 @@ export type ThreadMethods = {
|
|
|
92
94
|
* Resume a run with the given configuration.
|
|
93
95
|
* @param config The configuration for resuming the run
|
|
94
96
|
*/
|
|
97
|
+
resumeRun(config: CreateResumeRunConfig): void;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated Use `resumeRun` instead.
|
|
101
|
+
*/
|
|
95
102
|
unstable_resumeRun(config: CreateResumeRunConfig): void;
|
|
96
103
|
cancelRun(): void;
|
|
97
104
|
getModelContext(): ModelContext;
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
MessageRepository,
|
|
4
4
|
ExportedMessageRepository,
|
|
5
5
|
} from "../runtime/utils/message-repository";
|
|
6
|
-
import type { ThreadMessage
|
|
6
|
+
import type { ThreadMessage } from "../types/message";
|
|
7
|
+
import type { TextMessagePart } from "../types/message";
|
|
7
8
|
import type { ThreadMessageLike } from "../runtime/utils/thread-message-like";
|
|
8
9
|
|
|
9
10
|
// Mock generateId and generateOptimisticId to make tests deterministic
|