@assistant-ui/core 0.1.5 → 0.1.8
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/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mention.d.ts +24 -0
- package/dist/adapters/mention.d.ts.map +1 -0
- package/dist/adapters/mention.js +42 -0
- package/dist/adapters/mention.js.map +1 -0
- 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 +47 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -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 +7 -7
- package/dist/react/RuntimeAdapter.js.map +1 -1
- package/dist/react/client/Tools.js +5 -6
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/index.d.ts +69 -9
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +69 -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/useComposerSend.d.ts +2 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.js +5 -3
- package/dist/react/primitive-hooks/useComposerSend.js.map +1 -1
- 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/composer/ComposerQueue.d.ts +31 -0
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -0
- package/dist/react/primitives/composer/ComposerQueue.js +30 -0
- package/dist/react/primitives/composer/ComposerQueue.js.map +1 -0
- 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/QueueItemByIndexProvider.d.ts +6 -0
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -0
- package/dist/react/providers/QueueItemByIndexProvider.js +13 -0
- package/dist/react/providers/QueueItemByIndexProvider.js.map +1 -0
- 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 +2 -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 +5 -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/external-store-thread-runtime-core.js +2 -0
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.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 +3 -2
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +1 -0
- package/dist/runtimes/local/local-thread-runtime-core.js.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 +86 -0
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -0
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +170 -0
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -0
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.js +1 -0
- package/dist/runtimes/remote-thread-list/empty-thread-core.js.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +9 -0
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.js +20 -0
- package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
- 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/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.js +4 -0
- package/dist/store/clients/no-op-composer-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +1 -1
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/runtime-adapter.js +20 -27
- 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 +17 -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/composer-runtime-client.js +4 -0
- package/dist/store/runtime-clients/composer-runtime-client.js.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/scope-registration.d.ts +2 -0
- package/dist/store/scope-registration.d.ts.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 +26 -3
- 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/queue-item.d.ts +20 -0
- package/dist/store/scopes/queue-item.d.ts.map +1 -0
- package/dist/store/scopes/queue-item.js +2 -0
- package/dist/store/scopes/queue-item.js.map +1 -0
- 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/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mention.d.ts +32 -0
- package/dist/types/mention.d.ts.map +1 -0
- package/dist/types/mention.js +2 -0
- package/dist/types/mention.js.map +1 -0
- 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 +12 -12
- package/src/adapters/attachment.ts +1 -1
- package/src/adapters/feedback.ts +1 -1
- package/src/adapters/index.ts +4 -0
- package/src/adapters/mention.ts +77 -0
- package/src/adapters/speech.ts +1 -1
- package/src/adapters/suggestion.ts +1 -1
- package/src/index.ts +265 -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 +7 -8
- package/src/react/client/DataRenderers.ts +2 -2
- package/src/react/client/Tools.ts +7 -8
- package/src/react/index.ts +162 -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/useComposerSend.ts +11 -4
- 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/composer/ComposerQueue.tsx +58 -0
- 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/QueueItemByIndexProvider.tsx +21 -0
- package/src/react/providers/ReadonlyThreadProvider.tsx +84 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +1 -1
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +2 -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 +5 -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 +4 -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 +4 -3
- package/src/runtimes/local/should-continue.ts +1 -1
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +224 -0
- package/src/runtimes/remote-thread-list/empty-thread-core.ts +1 -0
- package/src/runtimes/remote-thread-list/optimistic-state.ts +27 -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 +5 -1
- package/src/store/clients/runtime-adapter.ts +21 -32
- package/src/store/clients/suggestions.ts +2 -1
- package/src/store/clients/thread-message-client.ts +4 -3
- package/src/store/index.ts +83 -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 +8 -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/scope-registration.ts +2 -0
- package/src/store/scopes/attachment.ts +2 -2
- package/src/store/scopes/chain-of-thought.ts +2 -1
- package/src/store/scopes/composer.ts +27 -9
- 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/queue-item.ts +20 -0
- 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/OptimisticState-list-race.test.ts +256 -0
- package/src/tests/external-store-thread-runtime-core.test.ts +1 -1
- package/src/tests/mention-formatter.test.ts +112 -0
- package/src/types/index.ts +7 -0
- package/src/types/mention.ts +50 -0
- package/src/utils/composite-context-provider.ts +1 -1
- package/src/utils/text.ts +2 -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/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/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/utils/index.ts +0 -14
|
@@ -9,6 +9,7 @@ import type { ModelContextClientSchema } from "./scopes/model-context";
|
|
|
9
9
|
import type { SuggestionsClientSchema } from "./scopes/suggestions";
|
|
10
10
|
import type { SuggestionClientSchema } from "./scopes/suggestion";
|
|
11
11
|
import type { ChainOfThoughtClientSchema } from "./scopes/chain-of-thought";
|
|
12
|
+
import type { QueueItemClientSchema } from "./scopes/queue-item";
|
|
12
13
|
|
|
13
14
|
declare module "@assistant-ui/store" {
|
|
14
15
|
interface ScopeRegistry {
|
|
@@ -23,5 +24,6 @@ declare module "@assistant-ui/store" {
|
|
|
23
24
|
suggestions: SuggestionsClientSchema;
|
|
24
25
|
suggestion: SuggestionClientSchema;
|
|
25
26
|
chainOfThought: ChainOfThoughtClientSchema;
|
|
27
|
+
queueItem: QueueItemClientSchema;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
@@ -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,12 +1,19 @@
|
|
|
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";
|
|
8
|
+
import type { QueueItemState, QueueItemMethods } from "./queue-item";
|
|
9
|
+
|
|
10
|
+
export type ComposerSendOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Whether to steer (interrupt the current run and process this message immediately).
|
|
13
|
+
* When false (default), the message is queued and processed in order.
|
|
14
|
+
*/
|
|
15
|
+
steer?: boolean;
|
|
16
|
+
};
|
|
10
17
|
|
|
11
18
|
export type ComposerState = {
|
|
12
19
|
readonly text: string;
|
|
@@ -30,6 +37,12 @@ export type ComposerState = {
|
|
|
30
37
|
* Undefined when no quote is set.
|
|
31
38
|
*/
|
|
32
39
|
readonly quote: QuoteInfo | undefined;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The queue of messages waiting to be processed.
|
|
43
|
+
* Empty when no messages are queued.
|
|
44
|
+
*/
|
|
45
|
+
readonly queue: readonly QueueItemState[];
|
|
33
46
|
};
|
|
34
47
|
|
|
35
48
|
export type ComposerMethods = {
|
|
@@ -41,7 +54,7 @@ export type ComposerMethods = {
|
|
|
41
54
|
clearAttachments(): Promise<void>;
|
|
42
55
|
attachment(selector: { index: number } | { id: string }): AttachmentMethods;
|
|
43
56
|
reset(): Promise<void>;
|
|
44
|
-
send(): void;
|
|
57
|
+
send(opts?: ComposerSendOptions): void;
|
|
45
58
|
cancel(): void;
|
|
46
59
|
beginEdit(): void;
|
|
47
60
|
|
|
@@ -61,6 +74,11 @@ export type ComposerMethods = {
|
|
|
61
74
|
*/
|
|
62
75
|
setQuote(quote: QuoteInfo | undefined): void;
|
|
63
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Access a queue item by index.
|
|
79
|
+
*/
|
|
80
|
+
queueItem(selector: { index: number }): QueueItemMethods;
|
|
81
|
+
|
|
64
82
|
__internal_getRuntime?(): ComposerRuntime;
|
|
65
83
|
};
|
|
66
84
|
|
|
@@ -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;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type QueueItemState = {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly prompt: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type QueueItemMethods = {
|
|
7
|
+
getState(): QueueItemState;
|
|
8
|
+
steer(): void;
|
|
9
|
+
remove(): void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type QueueItemMeta = {
|
|
13
|
+
source: "composer";
|
|
14
|
+
query: { index: number };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type QueueItemClientSchema = {
|
|
18
|
+
methods: QueueItemMethods;
|
|
19
|
+
meta: QueueItemMeta;
|
|
20
|
+
};
|
|
@@ -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
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { OptimisticState } from "../runtimes/remote-thread-list/optimistic-state";
|
|
3
|
+
import {
|
|
4
|
+
type RemoteThreadState,
|
|
5
|
+
type RemoteThreadData,
|
|
6
|
+
type THREAD_MAPPING_ID,
|
|
7
|
+
createThreadMappingId,
|
|
8
|
+
updateStatusReducer,
|
|
9
|
+
} from "../runtimes/remote-thread-list/remote-thread-state";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Reproduces the race condition where a stale list() response
|
|
13
|
+
* re-introduces a thread that was deleted/archived while the list
|
|
14
|
+
* was in flight.
|
|
15
|
+
*
|
|
16
|
+
* Root cause (before fix): OptimisticState's `then` callback could
|
|
17
|
+
* overwrite `_baseValue`, erasing effects from transforms that had
|
|
18
|
+
* already completed. The fix re-applies completed `optimistic`
|
|
19
|
+
* callbacks after every `then`.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const EMPTY_STATE: RemoteThreadState = {
|
|
23
|
+
isLoading: false,
|
|
24
|
+
newThreadId: undefined,
|
|
25
|
+
threadIds: [],
|
|
26
|
+
archivedThreadIds: [],
|
|
27
|
+
threadIdMap: {},
|
|
28
|
+
threadData: {},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type ListResult = {
|
|
32
|
+
threads: {
|
|
33
|
+
remoteId: string;
|
|
34
|
+
status: "regular" | "archived";
|
|
35
|
+
title?: string;
|
|
36
|
+
externalId?: string | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Simulates getLoadThreadsPromise's then callback (plain version, no workarounds). */
|
|
41
|
+
const applyListResult = (
|
|
42
|
+
state: RemoteThreadState,
|
|
43
|
+
l: ListResult,
|
|
44
|
+
): RemoteThreadState => {
|
|
45
|
+
const newThreadIds: string[] = [];
|
|
46
|
+
const newArchivedThreadIds: string[] = [];
|
|
47
|
+
const newThreadIdMap = {} as Record<string, THREAD_MAPPING_ID>;
|
|
48
|
+
const newThreadData = {} as Record<THREAD_MAPPING_ID, RemoteThreadData>;
|
|
49
|
+
|
|
50
|
+
for (const thread of l.threads) {
|
|
51
|
+
if (thread.status === "regular") newThreadIds.push(thread.remoteId);
|
|
52
|
+
else newArchivedThreadIds.push(thread.remoteId);
|
|
53
|
+
|
|
54
|
+
const mappingId = createThreadMappingId(thread.remoteId);
|
|
55
|
+
newThreadIdMap[thread.remoteId] = mappingId;
|
|
56
|
+
newThreadData[mappingId] = {
|
|
57
|
+
id: thread.remoteId,
|
|
58
|
+
remoteId: thread.remoteId,
|
|
59
|
+
externalId: thread.externalId,
|
|
60
|
+
status: thread.status,
|
|
61
|
+
title: thread.title,
|
|
62
|
+
initializeTask: Promise.resolve({
|
|
63
|
+
remoteId: thread.remoteId,
|
|
64
|
+
externalId: thread.externalId,
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
...state,
|
|
71
|
+
threadIds: newThreadIds,
|
|
72
|
+
archivedThreadIds: newArchivedThreadIds,
|
|
73
|
+
threadIdMap: { ...state.threadIdMap, ...newThreadIdMap },
|
|
74
|
+
threadData: { ...state.threadData, ...newThreadData },
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** Creates a deferred promise for controlling resolution order. */
|
|
79
|
+
function deferred<T>() {
|
|
80
|
+
let resolve!: (v: T) => void;
|
|
81
|
+
const promise = new Promise<T>((r) => {
|
|
82
|
+
resolve = r;
|
|
83
|
+
});
|
|
84
|
+
return { promise, resolve };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
describe("list + delete race condition", () => {
|
|
88
|
+
it("stale list() does not re-add a thread deleted while list was in flight", async () => {
|
|
89
|
+
const state = new OptimisticState<RemoteThreadState>(EMPTY_STATE);
|
|
90
|
+
|
|
91
|
+
const listDeferred = deferred<ListResult>();
|
|
92
|
+
const deleteDeferred = deferred<void>();
|
|
93
|
+
|
|
94
|
+
// 1. list() starts
|
|
95
|
+
const listPromise = state.optimisticUpdate({
|
|
96
|
+
execute: () => listDeferred.promise,
|
|
97
|
+
loading: (s) => ({ ...s, isLoading: true }),
|
|
98
|
+
then: applyListResult,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// 2. delete starts (while list is in flight)
|
|
102
|
+
const deletePromise = state.optimisticUpdate({
|
|
103
|
+
execute: () => deleteDeferred.promise,
|
|
104
|
+
optimistic: (s) => updateStatusReducer(s, "thread-A", "deleted"),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// 3. DELETE resolves first
|
|
108
|
+
deleteDeferred.resolve();
|
|
109
|
+
await deletePromise;
|
|
110
|
+
|
|
111
|
+
// 4. list resolves with stale data that includes deleted thread
|
|
112
|
+
listDeferred.resolve({
|
|
113
|
+
threads: [{ remoteId: "thread-A", status: "regular", title: "A" }],
|
|
114
|
+
});
|
|
115
|
+
await listPromise;
|
|
116
|
+
|
|
117
|
+
// Thread A must NOT reappear
|
|
118
|
+
expect(state.value.threadIds).not.toContain("thread-A");
|
|
119
|
+
expect(
|
|
120
|
+
state.value.threadData[createThreadMappingId("thread-A")],
|
|
121
|
+
).toBeUndefined();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("stale list() does not revert archive back to regular", async () => {
|
|
125
|
+
// Start with thread A already in state
|
|
126
|
+
const mappingId = createThreadMappingId("thread-A");
|
|
127
|
+
const initial: RemoteThreadState = {
|
|
128
|
+
...EMPTY_STATE,
|
|
129
|
+
threadIds: ["thread-A"],
|
|
130
|
+
threadIdMap: { "thread-A": mappingId },
|
|
131
|
+
threadData: {
|
|
132
|
+
[mappingId]: {
|
|
133
|
+
id: "thread-A",
|
|
134
|
+
remoteId: "thread-A",
|
|
135
|
+
externalId: undefined,
|
|
136
|
+
status: "regular",
|
|
137
|
+
title: "A",
|
|
138
|
+
initializeTask: Promise.resolve({
|
|
139
|
+
remoteId: "thread-A",
|
|
140
|
+
externalId: undefined,
|
|
141
|
+
}),
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const state = new OptimisticState<RemoteThreadState>(initial);
|
|
147
|
+
|
|
148
|
+
const listDeferred = deferred<ListResult>();
|
|
149
|
+
const archiveDeferred = deferred<void>();
|
|
150
|
+
|
|
151
|
+
// 1. list() starts
|
|
152
|
+
const listPromise = state.optimisticUpdate({
|
|
153
|
+
execute: () => listDeferred.promise,
|
|
154
|
+
loading: (s) => ({ ...s, isLoading: true }),
|
|
155
|
+
then: applyListResult,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// 2. archive starts
|
|
159
|
+
const archivePromise = state.optimisticUpdate({
|
|
160
|
+
execute: () => archiveDeferred.promise,
|
|
161
|
+
optimistic: (s) => updateStatusReducer(s, "thread-A", "archived"),
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// 3. archive resolves first
|
|
165
|
+
archiveDeferred.resolve();
|
|
166
|
+
await archivePromise;
|
|
167
|
+
|
|
168
|
+
// 4. list resolves with stale data (thread-A as regular)
|
|
169
|
+
listDeferred.resolve({
|
|
170
|
+
threads: [{ remoteId: "thread-A", status: "regular", title: "A" }],
|
|
171
|
+
});
|
|
172
|
+
await listPromise;
|
|
173
|
+
|
|
174
|
+
// Thread A should remain archived, NOT be reverted to regular
|
|
175
|
+
expect(state.value.threadIds).not.toContain("thread-A");
|
|
176
|
+
expect(state.value.archivedThreadIds).toContain("thread-A");
|
|
177
|
+
expect(
|
|
178
|
+
state.value.threadData[createThreadMappingId("thread-A")]?.status,
|
|
179
|
+
).toBe("archived");
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it("threads NOT modified during list() are loaded normally", async () => {
|
|
183
|
+
const state = new OptimisticState<RemoteThreadState>(EMPTY_STATE);
|
|
184
|
+
|
|
185
|
+
const listDeferred = deferred<ListResult>();
|
|
186
|
+
const deleteDeferred = deferred<void>();
|
|
187
|
+
|
|
188
|
+
// 1. list() starts
|
|
189
|
+
const listPromise = state.optimisticUpdate({
|
|
190
|
+
execute: () => listDeferred.promise,
|
|
191
|
+
loading: (s) => ({ ...s, isLoading: true }),
|
|
192
|
+
then: applyListResult,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// 2. delete thread A (while list is in flight)
|
|
196
|
+
const deletePromise = state.optimisticUpdate({
|
|
197
|
+
execute: () => deleteDeferred.promise,
|
|
198
|
+
optimistic: (s) => updateStatusReducer(s, "thread-A", "deleted"),
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
deleteDeferred.resolve();
|
|
202
|
+
await deletePromise;
|
|
203
|
+
|
|
204
|
+
// 3. list resolves with [A, B] — A should be filtered, B should load
|
|
205
|
+
listDeferred.resolve({
|
|
206
|
+
threads: [
|
|
207
|
+
{ remoteId: "thread-A", status: "regular", title: "A" },
|
|
208
|
+
{ remoteId: "thread-B", status: "regular", title: "B" },
|
|
209
|
+
],
|
|
210
|
+
});
|
|
211
|
+
await listPromise;
|
|
212
|
+
|
|
213
|
+
expect(state.value.threadIds).toEqual(["thread-B"]);
|
|
214
|
+
expect(state.value.threadIds).not.toContain("thread-A");
|
|
215
|
+
expect(
|
|
216
|
+
state.value.threadData[createThreadMappingId("thread-B")],
|
|
217
|
+
).toBeDefined();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it("list resolves before delete — no race, both work correctly", async () => {
|
|
221
|
+
const state = new OptimisticState<RemoteThreadState>(EMPTY_STATE);
|
|
222
|
+
|
|
223
|
+
const listDeferred = deferred<ListResult>();
|
|
224
|
+
const deleteDeferred = deferred<void>();
|
|
225
|
+
|
|
226
|
+
const listPromise = state.optimisticUpdate({
|
|
227
|
+
execute: () => listDeferred.promise,
|
|
228
|
+
loading: (s) => ({ ...s, isLoading: true }),
|
|
229
|
+
then: applyListResult,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
const deletePromise = state.optimisticUpdate({
|
|
233
|
+
execute: () => deleteDeferred.promise,
|
|
234
|
+
optimistic: (s) => updateStatusReducer(s, "thread-A", "deleted"),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// list resolves FIRST this time
|
|
238
|
+
listDeferred.resolve({
|
|
239
|
+
threads: [{ remoteId: "thread-A", status: "regular", title: "A" }],
|
|
240
|
+
});
|
|
241
|
+
await listPromise;
|
|
242
|
+
|
|
243
|
+
// thread A is in base state now, but delete's optimistic still hides it
|
|
244
|
+
expect(state.value.threadIds).not.toContain("thread-A");
|
|
245
|
+
|
|
246
|
+
// delete resolves
|
|
247
|
+
deleteDeferred.resolve();
|
|
248
|
+
await deletePromise;
|
|
249
|
+
|
|
250
|
+
// thread A is gone from both base and cached
|
|
251
|
+
expect(state.value.threadIds).not.toContain("thread-A");
|
|
252
|
+
expect(
|
|
253
|
+
state.value.threadData[createThreadMappingId("thread-A")],
|
|
254
|
+
).toBeUndefined();
|
|
255
|
+
});
|
|
256
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
2
|
import { ExternalStoreThreadRuntimeCore } from "../runtimes/external-store/external-store-thread-runtime-core";
|
|
3
3
|
import type { ExternalStoreAdapter } from "../runtimes/external-store/external-store-adapter";
|
|
4
|
-
import type { ModelContextProvider } from "../model-context";
|
|
4
|
+
import type { ModelContextProvider } from "../model-context/types";
|
|
5
5
|
|
|
6
6
|
const mockContextProvider: ModelContextProvider = {
|
|
7
7
|
getModelContext: () => ({}),
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { unstable_defaultDirectiveFormatter } from "../adapters/mention";
|
|
3
|
+
|
|
4
|
+
describe("unstable_defaultDirectiveFormatter", () => {
|
|
5
|
+
describe("serialize", () => {
|
|
6
|
+
it("serializes with id === label (no name attr)", () => {
|
|
7
|
+
expect(
|
|
8
|
+
unstable_defaultDirectiveFormatter.serialize({
|
|
9
|
+
id: "weather",
|
|
10
|
+
type: "tool",
|
|
11
|
+
label: "weather",
|
|
12
|
+
}),
|
|
13
|
+
).toBe(":tool[weather]");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("serializes with id !== label (includes name attr)", () => {
|
|
17
|
+
expect(
|
|
18
|
+
unstable_defaultDirectiveFormatter.serialize({
|
|
19
|
+
id: "get_weather",
|
|
20
|
+
type: "tool",
|
|
21
|
+
label: "Weather",
|
|
22
|
+
}),
|
|
23
|
+
).toBe(":tool[Weather]{name=get_weather}");
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe("parse", () => {
|
|
28
|
+
it("parses plain text", () => {
|
|
29
|
+
expect(unstable_defaultDirectiveFormatter.parse("hello world")).toEqual([
|
|
30
|
+
{ kind: "text", text: "hello world" },
|
|
31
|
+
]);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("parses a single directive without name attr", () => {
|
|
35
|
+
expect(
|
|
36
|
+
unstable_defaultDirectiveFormatter.parse("use :tool[weather] please"),
|
|
37
|
+
).toEqual([
|
|
38
|
+
{ kind: "text", text: "use " },
|
|
39
|
+
{ kind: "mention", type: "tool", label: "weather", id: "weather" },
|
|
40
|
+
{ kind: "text", text: " please" },
|
|
41
|
+
]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("parses a directive with name attr", () => {
|
|
45
|
+
expect(
|
|
46
|
+
unstable_defaultDirectiveFormatter.parse(
|
|
47
|
+
":tool[Weather]{name=get_weather}",
|
|
48
|
+
),
|
|
49
|
+
).toEqual([
|
|
50
|
+
{
|
|
51
|
+
kind: "mention",
|
|
52
|
+
type: "tool",
|
|
53
|
+
label: "Weather",
|
|
54
|
+
id: "get_weather",
|
|
55
|
+
},
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("parses multiple directives in text", () => {
|
|
60
|
+
const result = unstable_defaultDirectiveFormatter.parse(
|
|
61
|
+
":tool[a] and :tool[b]{name=bb}",
|
|
62
|
+
);
|
|
63
|
+
expect(result).toHaveLength(3);
|
|
64
|
+
expect(result[0]).toEqual({
|
|
65
|
+
kind: "mention",
|
|
66
|
+
type: "tool",
|
|
67
|
+
label: "a",
|
|
68
|
+
id: "a",
|
|
69
|
+
});
|
|
70
|
+
expect(result[1]).toEqual({ kind: "text", text: " and " });
|
|
71
|
+
expect(result[2]).toEqual({
|
|
72
|
+
kind: "mention",
|
|
73
|
+
type: "tool",
|
|
74
|
+
label: "b",
|
|
75
|
+
id: "bb",
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("parses hyphenated types", () => {
|
|
80
|
+
expect(
|
|
81
|
+
unstable_defaultDirectiveFormatter.parse(
|
|
82
|
+
":data-source[My DB]{name=db_1}",
|
|
83
|
+
),
|
|
84
|
+
).toEqual([
|
|
85
|
+
{
|
|
86
|
+
kind: "mention",
|
|
87
|
+
type: "data-source",
|
|
88
|
+
label: "My DB",
|
|
89
|
+
id: "db_1",
|
|
90
|
+
},
|
|
91
|
+
]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("roundtrips serialize → parse", () => {
|
|
95
|
+
const item = {
|
|
96
|
+
id: "get_weather",
|
|
97
|
+
type: "tool",
|
|
98
|
+
label: "Weather",
|
|
99
|
+
};
|
|
100
|
+
const serialized = unstable_defaultDirectiveFormatter.serialize(item);
|
|
101
|
+
const parsed = unstable_defaultDirectiveFormatter.parse(serialized);
|
|
102
|
+
expect(parsed).toEqual([
|
|
103
|
+
{
|
|
104
|
+
kind: "mention",
|
|
105
|
+
type: "tool",
|
|
106
|
+
label: "Weather",
|
|
107
|
+
id: "get_weather",
|
|
108
|
+
},
|
|
109
|
+
]);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -38,3 +38,10 @@ export type {
|
|
|
38
38
|
export type { Unsubscribe } from "./unsubscribe";
|
|
39
39
|
|
|
40
40
|
export type { QuoteInfo } from "./quote";
|
|
41
|
+
|
|
42
|
+
export type {
|
|
43
|
+
Unstable_MentionItem,
|
|
44
|
+
Unstable_MentionCategory,
|
|
45
|
+
Unstable_DirectiveSegment,
|
|
46
|
+
Unstable_DirectiveFormatter,
|
|
47
|
+
} from "./mention";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ReadonlyJSONObject } from "assistant-stream/utils";
|
|
2
|
+
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Mention Item (user-facing definition for items that can be @-mentioned)
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
export type Unstable_MentionItem = {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly type: string;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly icon?: string | undefined;
|
|
12
|
+
readonly description?: string | undefined;
|
|
13
|
+
readonly metadata?: ReadonlyJSONObject | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// =============================================================================
|
|
17
|
+
// Mention Category (for hierarchical navigation)
|
|
18
|
+
// =============================================================================
|
|
19
|
+
|
|
20
|
+
export type Unstable_MentionCategory = {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly icon?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// Directive Segment (parsed representation of mention directives in text)
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
/** Parsed segment from directive text */
|
|
31
|
+
export type Unstable_DirectiveSegment =
|
|
32
|
+
| { readonly kind: "text"; readonly text: string }
|
|
33
|
+
| {
|
|
34
|
+
readonly kind: "mention";
|
|
35
|
+
readonly type: string;
|
|
36
|
+
readonly label: string;
|
|
37
|
+
readonly id: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// Directive Formatter (configurable serialization/parsing for mentions)
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
/** Configurable formatter for mention directive serialization/parsing */
|
|
45
|
+
export type Unstable_DirectiveFormatter = {
|
|
46
|
+
/** Serialize a mention item to directive text */
|
|
47
|
+
serialize(item: Unstable_MentionItem): string;
|
|
48
|
+
/** Parse text into alternating text and mention segments */
|
|
49
|
+
parse(text: string): readonly Unstable_DirectiveSegment[];
|
|
50
|
+
};
|