@assistant-ui/react 0.12.9 → 0.12.11
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/client/DataRenderers.d.ts +3 -0
- package/dist/client/DataRenderers.d.ts.map +1 -0
- package/dist/client/DataRenderers.js +33 -0
- package/dist/client/DataRenderers.js.map +1 -0
- package/dist/client/ExternalThread.d.ts +1 -1
- package/dist/client/ExternalThread.d.ts.map +1 -1
- package/dist/client/ExternalThread.js +136 -127
- package/dist/client/ExternalThread.js.map +1 -1
- package/dist/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/client/InMemoryThreadList.js +62 -53
- package/dist/client/InMemoryThreadList.js.map +1 -1
- package/dist/client/Tools.d.ts.map +1 -1
- package/dist/client/Tools.js +10 -10
- package/dist/client/Tools.js.map +1 -1
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -3
- package/dist/client/index.js.map +1 -1
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.js +2 -2
- package/dist/context/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.js +1 -1
- package/dist/context/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageProvider.d.ts +1 -1
- package/dist/context/providers/MessageProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageProvider.js +1 -1
- package/dist/context/providers/MessageProvider.js.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.js +6 -9
- package/dist/context/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.js +1 -1
- package/dist/context/providers/ThreadListItemProvider.js.map +1 -1
- package/dist/context/react/utils/ensureBinding.js +1 -1
- package/dist/context/react/utils/ensureBinding.js.map +1 -1
- package/dist/context/react/utils/useRuntimeState.d.ts +1 -1
- package/dist/context/react/utils/useRuntimeState.d.ts.map +1 -1
- package/dist/context/react/utils/useRuntimeState.js.map +1 -1
- package/dist/context/stores/ThreadViewport.d.ts +1 -1
- package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
- package/dist/context/stores/ThreadViewport.js.map +1 -1
- package/dist/devtools/DevToolsHooks.d.ts +1 -1
- package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
- package/dist/hooks/useMessageQuote.d.ts +17 -0
- package/dist/hooks/useMessageQuote.d.ts.map +1 -0
- package/dist/hooks/useMessageQuote.js +20 -0
- package/dist/hooks/useMessageQuote.js.map +1 -0
- package/dist/hooks/useMessageTiming.d.ts +17 -0
- package/dist/hooks/useMessageTiming.d.ts.map +1 -0
- package/dist/hooks/useMessageTiming.js +20 -0
- package/dist/hooks/useMessageTiming.js.map +1 -0
- package/dist/internal.d.ts +3 -11
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -9
- package/dist/internal.js.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +1 -2
- package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.js +37 -24
- package/dist/legacy-runtime/RuntimeAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +2 -2
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +384 -80
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.d.ts +8 -9
- package/dist/legacy-runtime/cloud/auiV0.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.js +20 -45
- package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js +4 -5
- package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/hooks/AssistantContext.d.ts +12 -12
- package/dist/legacy-runtime/hooks/AssistantContext.js +1 -1
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +157 -157
- package/dist/legacy-runtime/hooks/AttachmentContext.js +1 -1
- package/dist/legacy-runtime/hooks/ComposerContext.d.ts +17 -17
- package/dist/legacy-runtime/hooks/ComposerContext.js +4 -4
- package/dist/legacy-runtime/hooks/MessageContext.d.ts +27 -27
- package/dist/legacy-runtime/hooks/MessageContext.js +5 -5
- package/dist/legacy-runtime/hooks/MessagePartContext.d.ts +12 -12
- package/dist/legacy-runtime/hooks/MessagePartContext.js +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts +27 -27
- package/dist/legacy-runtime/hooks/ThreadContext.js +4 -4
- package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts +12 -12
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js +1 -1
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts +2 -63
- package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/AssistantRuntime.js +1 -45
- package/dist/legacy-runtime/runtime/AssistantRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts +2 -62
- package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/AttachmentRuntime.js +1 -55
- package/dist/legacy-runtime/runtime/AttachmentRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +3 -171
- package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ComposerRuntime.js +1 -240
- package/dist/legacy-runtime/runtime/ComposerRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts +2 -39
- package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/MessagePartRuntime.js +1 -66
- package/dist/legacy-runtime/runtime/MessagePartRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/MessageRuntime.d.ts +3 -91
- package/dist/legacy-runtime/runtime/MessageRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/MessageRuntime.js +1 -200
- package/dist/legacy-runtime/runtime/MessageRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts +2 -36
- package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimeBindings.js +3 -0
- package/dist/legacy-runtime/runtime/RuntimeBindings.js.map +1 -1
- package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts +1 -63
- package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +4 -49
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js +1 -87
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts +3 -43
- package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListRuntime.js +1 -138
- package/dist/legacy-runtime/runtime/ThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +3 -270
- package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadRuntime.js +1 -242
- package/dist/legacy-runtime/runtime/ThreadRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime/index.d.ts +1 -8
- package/dist/legacy-runtime/runtime/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.d.ts +2 -4
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.js +2 -3
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.d.ts +2 -3
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.js +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/speech/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.js +1 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +6 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/types.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +38 -28
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +122 -31
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.d.ts +1 -10
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js +1 -19
- package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +1 -53
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +1 -312
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts +1 -27
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js +1 -49
- package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts +1 -23
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js +1 -40
- package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts +1 -16
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts +1 -11
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js +1 -10
- package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +1 -66
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js +1 -159
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +1 -61
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts +1 -36
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +1 -110
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/index.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/core/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts +1 -80
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts +1 -8
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js +1 -18
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts +2 -41
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js +1 -173
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts +1 -46
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js +1 -259
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts +2 -6
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js +1 -11
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts +2 -33
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js +1 -126
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts +1 -4
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js +1 -31
- package/dist/legacy-runtime/runtime-cores/external-store/auto-status.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +2 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +4 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.d.ts +2 -8
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.js +2 -22
- package/dist/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.d.ts +3 -3
- package/dist/legacy-runtime/runtime-cores/external-store/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.js +2 -1
- package/dist/legacy-runtime/runtime-cores/external-store/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/index.d.ts +2 -1
- package/dist/legacy-runtime/runtime-cores/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/index.js +1 -1
- package/dist/legacy-runtime/runtime-cores/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts +1 -38
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts +1 -10
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js +1 -21
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +10 -30
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts +2 -45
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js +1 -86
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts +1 -58
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js +1 -415
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/index.js +1 -0
- package/dist/legacy-runtime/runtime-cores/local/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js +1 -13
- package/dist/legacy-runtime/runtime-cores/local/shouldContinue.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts +1 -7
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js +1 -37
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts +1 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js +1 -141
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts +1 -22
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js +1 -56
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +39 -39
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +41 -67
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +13 -72
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js +10 -3
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts +1 -12
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js +1 -28
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.js +2 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/index.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts +1 -38
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +1 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts +3 -163
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js +2 -393
- package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js.map +1 -1
- package/dist/model-context/frame/index.d.ts +4 -3
- package/dist/model-context/frame/index.d.ts.map +1 -1
- package/dist/model-context/frame/index.js +3 -3
- package/dist/model-context/frame/index.js.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.d.ts +2 -2
- package/dist/model-context/frame/useAssistantFrameHost.d.ts.map +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.js +1 -1
- package/dist/model-context/frame/useAssistantFrameHost.js.map +1 -1
- package/dist/model-context/index.d.ts +6 -3
- package/dist/model-context/index.d.ts.map +1 -1
- package/dist/model-context/index.js +5 -2
- package/dist/model-context/index.js.map +1 -1
- package/dist/model-context/makeAssistantDataUI.d.ts +7 -0
- package/dist/model-context/makeAssistantDataUI.d.ts.map +1 -0
- package/dist/model-context/makeAssistantDataUI.js +11 -0
- package/dist/model-context/makeAssistantDataUI.js.map +1 -0
- package/dist/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/model-context/makeAssistantTool.js.map +1 -1
- package/dist/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/model-context/makeAssistantToolUI.js.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +1 -1
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/model-context/registry/index.d.ts +2 -2
- package/dist/model-context/registry/index.d.ts.map +1 -1
- package/dist/model-context/registry/index.js +1 -2
- package/dist/model-context/registry/index.js.map +1 -1
- package/dist/model-context/toolbox.d.ts.map +1 -1
- package/dist/model-context/toolbox.js.map +1 -1
- package/dist/model-context/useAssistantDataUI.d.ts +7 -0
- package/dist/model-context/useAssistantDataUI.d.ts.map +1 -0
- package/dist/model-context/useAssistantDataUI.js +12 -0
- package/dist/model-context/useAssistantDataUI.js.map +1 -0
- package/dist/model-context/useAssistantInstructions.d.ts +2 -4
- package/dist/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/model-context/useAssistantInstructions.js.map +1 -1
- package/dist/model-context/useAssistantTool.d.ts +2 -3
- package/dist/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/model-context/useAssistantTool.js.map +1 -1
- package/dist/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/model-context/useAssistantToolUI.js.map +1 -1
- package/dist/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/model-context/useInlineRender.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +7 -6
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js +4 -3
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js +4 -3
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.js +5 -5
- package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
- package/dist/primitives/actionBarMore/scope.d.ts.map +1 -1
- package/dist/primitives/actionBarMore/scope.js.map +1 -1
- package/dist/primitives/assistantModal/scope.d.ts.map +1 -1
- package/dist/primitives/assistantModal/scope.js.map +1 -1
- package/dist/primitives/attachment/AttachmentName.js +1 -1
- package/dist/primitives/attachment/AttachmentName.js.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
- package/dist/primitives/attachment/AttachmentThumb.js +2 -2
- package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js +1 -1
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js +3 -3
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +3 -3
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.js +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js +1 -1
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js +1 -1
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerDictate.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerDictate.js +3 -3
- package/dist/primitives/composer/ComposerDictate.js.map +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.js +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerIf.js +4 -4
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts +35 -45
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +25 -9
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerQuote.d.ts +52 -0
- package/dist/primitives/composer/ComposerQuote.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerQuote.js +57 -0
- package/dist/primitives/composer/ComposerQuote.js.map +1 -0
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerStopDictation.js +1 -1
- package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
- package/dist/primitives/composer/index.d.ts +3 -0
- package/dist/primitives/composer/index.d.ts.map +1 -1
- package/dist/primitives/composer/index.js +3 -0
- package/dist/primitives/composer/index.js.map +1 -1
- package/dist/primitives/error/ErrorMessage.js +4 -4
- package/dist/primitives/error/ErrorMessage.js.map +1 -1
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +3 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/primitives/message/MessageAttachments.js +4 -4
- package/dist/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/primitives/message/MessageError.d.ts.map +1 -1
- package/dist/primitives/message/MessageError.js +2 -2
- package/dist/primitives/message/MessageError.js.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js +3 -3
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts +9 -1
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +24 -10
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts +8 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.js +22 -8
- package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
- package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
- package/dist/primitives/message/MessageRoot.js +6 -5
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.js +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts +1 -1
- package/dist/primitives/messagePart/useMessagePartData.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.js +3 -3
- package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartFile.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.js +3 -3
- package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartImage.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.js +3 -3
- package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartReasoning.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.js +3 -3
- package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.d.ts +2 -2
- package/dist/primitives/messagePart/useMessagePartSource.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.js +3 -3
- package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.d.ts +3 -3
- package/dist/primitives/messagePart/useMessagePartText.d.ts.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.js +3 -3
- package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.d.ts.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts +24 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts.map +1 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +37 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js.map +1 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts +31 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts.map +1 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +85 -0
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -0
- package/dist/primitives/selectionToolbar/index.d.ts +3 -0
- package/dist/primitives/selectionToolbar/index.d.ts.map +1 -0
- package/dist/primitives/selectionToolbar/index.js +3 -0
- package/dist/primitives/selectionToolbar/index.js.map +1 -0
- package/dist/primitives/suggestion/SuggestionDescription.js +1 -1
- package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
- package/dist/primitives/suggestion/SuggestionTitle.js +1 -1
- package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.js +6 -3
- package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +1 -1
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadIf.js +7 -7
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +3 -3
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js +5 -2
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestions.js +1 -1
- package/dist/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/primitives/thread/ThreadViewportSlack.js +4 -4
- package/dist/primitives/thread/ThreadViewportSlack.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js +1 -1
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +1 -1
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.js +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
- package/dist/primitives/threadListItemMore/scope.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/scope.js.map +1 -1
- package/dist/types/MessagePartComponentTypes.d.ts +4 -2
- package/dist/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/types/MessagePartComponentTypes.js.map +1 -1
- package/dist/types/index.d.ts +3 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/scopes/dataRenderers.d.ts +13 -0
- package/dist/types/scopes/dataRenderers.d.ts.map +1 -0
- package/dist/types/scopes/dataRenderers.js +2 -0
- package/dist/types/scopes/dataRenderers.js.map +1 -0
- package/dist/types/scopes/index.d.ts +2 -11
- package/dist/types/scopes/index.d.ts.map +1 -1
- package/dist/types/scopes/tools.d.ts +1 -2
- package/dist/types/scopes/tools.d.ts.map +1 -1
- package/dist/types/store-augmentation.d.ts +5 -25
- package/dist/types/store-augmentation.d.ts.map +1 -1
- package/dist/types/store-augmentation.js +1 -1
- package/dist/types/store-augmentation.js.map +1 -1
- package/dist/utils/RequireAtLeastOne.d.ts.map +1 -1
- package/dist/utils/RequireAtLeastOne.js.map +1 -1
- package/dist/utils/getSelectionMessageId.d.ts +2 -0
- package/dist/utils/getSelectionMessageId.d.ts.map +1 -0
- package/dist/utils/getSelectionMessageId.js +21 -0
- package/dist/utils/getSelectionMessageId.js.map +1 -0
- package/dist/utils/hooks/useOnResizeContent.d.ts.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.d.ts.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts +1 -2
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +18 -8
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.d.ts.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.js +5 -5
- package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
- package/package.json +8 -5
- package/src/client/DataRenderers.ts +42 -0
- package/src/client/ExternalThread.ts +149 -136
- package/src/client/InMemoryThreadList.ts +68 -54
- package/src/client/Tools.ts +10 -10
- package/src/client/index.ts +7 -3
- package/src/context/providers/ChainOfThoughtByIndicesProvider.tsx +3 -3
- package/src/context/providers/MessageByIndexProvider.tsx +1 -1
- package/src/context/providers/MessageProvider.tsx +2 -2
- package/src/context/providers/TextMessagePartProvider.tsx +6 -9
- package/src/context/providers/ThreadListItemProvider.tsx +1 -1
- package/src/context/react/utils/ensureBinding.ts +1 -1
- package/src/context/react/utils/useRuntimeState.ts +1 -1
- package/src/context/stores/{ThreadViewport.tsx → ThreadViewport.ts} +1 -1
- package/src/devtools/DevToolsHooks.ts +1 -1
- package/src/hooks/useMessageQuote.ts +27 -0
- package/src/hooks/useMessageTiming.ts +24 -0
- package/src/internal.ts +22 -13
- package/src/legacy-runtime/AssistantRuntimeProvider.tsx +5 -6
- package/src/legacy-runtime/RuntimeAdapter.ts +42 -24
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.ts +646 -0
- package/src/legacy-runtime/cloud/auiV0.ts +29 -53
- package/src/legacy-runtime/cloud/{useCloudThreadListRuntime.tsx → useCloudThreadListRuntime.ts} +5 -7
- package/src/legacy-runtime/hooks/AssistantContext.ts +1 -1
- package/src/legacy-runtime/hooks/AttachmentContext.ts +1 -1
- package/src/legacy-runtime/hooks/ComposerContext.ts +6 -6
- package/src/legacy-runtime/hooks/MessageContext.ts +5 -5
- package/src/legacy-runtime/hooks/MessagePartContext.ts +1 -1
- package/src/legacy-runtime/hooks/ThreadContext.ts +5 -5
- package/src/legacy-runtime/hooks/ThreadListItemContext.ts +1 -1
- package/src/legacy-runtime/runtime/AssistantRuntime.ts +2 -111
- package/src/legacy-runtime/runtime/AttachmentRuntime.ts +7 -119
- package/src/legacy-runtime/runtime/ComposerRuntime.ts +15 -475
- package/src/legacy-runtime/runtime/MessagePartRuntime.ts +2 -117
- package/src/legacy-runtime/runtime/MessageRuntime.ts +3 -335
- package/src/legacy-runtime/runtime/RuntimeBindings.ts +12 -69
- package/src/legacy-runtime/runtime/RuntimePathTypes.ts +8 -61
- package/src/legacy-runtime/runtime/ThreadListItemRuntime.ts +7 -152
- package/src/legacy-runtime/runtime/ThreadListRuntime.ts +6 -224
- package/src/legacy-runtime/runtime/ThreadRuntime.ts +14 -561
- package/src/legacy-runtime/runtime/index.ts +10 -13
- package/src/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.tsx +4 -2
- package/src/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.ts +4 -4
- package/src/legacy-runtime/runtime-cores/adapters/attachment/index.ts +9 -4
- package/src/legacy-runtime/runtime-cores/adapters/feedback/index.ts +2 -1
- package/src/legacy-runtime/runtime-cores/adapters/speech/index.ts +6 -3
- package/src/legacy-runtime/runtime-cores/adapters/suggestion/index.ts +2 -1
- package/src/legacy-runtime/runtime-cores/adapters/thread-history/index.ts +9 -2
- package/src/legacy-runtime/runtime-cores/assistant-transport/transport-scheduling.test.ts +136 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +6 -1
- package/src/legacy-runtime/runtime-cores/assistant-transport/{useAssistantTransportRuntime.tsx → useAssistantTransportRuntime.ts} +46 -36
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.test.ts +223 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +175 -46
- package/src/legacy-runtime/runtime-cores/assistant-transport/utils.ts +5 -37
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.ts +6 -0
- package/src/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.ts +4 -0
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.ts +13 -0
- package/src/legacy-runtime/runtime-cores/core/index.ts +3 -3
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.ts +6 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.ts +2 -0
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.ts +4 -0
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.ts +2 -23
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.ts +2 -0
- package/src/legacy-runtime/runtime-cores/external-store/auto-status.ts +1 -0
- package/src/legacy-runtime/runtime-cores/external-store/{createMessageConverter.tsx → createMessageConverter.ts} +3 -3
- package/src/legacy-runtime/runtime-cores/external-store/{external-message-converter.tsx → external-message-converter.ts} +13 -4
- package/src/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.ts +5 -0
- package/src/legacy-runtime/runtime-cores/external-store/index.ts +9 -6
- package/src/legacy-runtime/runtime-cores/external-store/{useExternalStoreRuntime.tsx → useExternalStoreRuntime.ts} +1 -1
- package/src/legacy-runtime/runtime-cores/index.ts +3 -4
- package/src/legacy-runtime/runtime-cores/local/ChatModelAdapter.ts +7 -0
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.ts +36 -0
- package/src/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.ts +2 -0
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.ts +1 -0
- package/src/legacy-runtime/runtime-cores/local/index.ts +10 -6
- package/src/legacy-runtime/runtime-cores/local/shouldContinue.ts +1 -0
- package/src/legacy-runtime/runtime-cores/local/{useLocalRuntime.tsx → useLocalRuntime.ts} +1 -3
- package/src/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.ts +1 -89
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +33 -136
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.tsx +11 -3
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.ts +1 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/index.ts +5 -3
- package/src/legacy-runtime/runtime-cores/remote-thread-list/types.ts +7 -0
- package/src/legacy-runtime/runtime-cores/remote-thread-list/{useRemoteThreadListRuntime.tsx → useRemoteThreadListRuntime.ts} +9 -5
- package/src/legacy-runtime/runtime-cores/utils/MessageRepository.ts +3 -0
- package/src/model-context/frame/AssistantFrame.test.ts +6 -4
- package/src/model-context/frame/index.ts +9 -3
- package/src/model-context/frame/useAssistantFrameHost.ts +2 -2
- package/src/model-context/index.ts +12 -3
- package/src/model-context/makeAssistantDataUI.ts +22 -0
- package/src/model-context/makeAssistantVisible.tsx +1 -1
- package/src/model-context/registry/index.ts +6 -2
- package/src/model-context/useAssistantDataUI.ts +18 -0
- package/src/model-context/{useAssistantInstructions.tsx → useAssistantInstructions.ts} +2 -4
- package/src/model-context/{useAssistantTool.tsx → useAssistantTool.ts} +2 -3
- package/src/primitives/actionBar/ActionBarCopy.tsx +7 -6
- package/src/primitives/actionBar/{ActionBarEdit.tsx → ActionBarEdit.ts} +1 -1
- package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +4 -3
- package/src/primitives/actionBar/{ActionBarSpeak.tsx → ActionBarSpeak.ts} +4 -3
- package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +1 -1
- package/src/primitives/actionBar/{useActionBarFloatStatus.tsx → useActionBarFloatStatus.ts} +5 -5
- package/src/primitives/attachment/AttachmentName.tsx +1 -1
- package/src/primitives/attachment/AttachmentThumb.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerCount.tsx +1 -1
- package/src/primitives/branchPicker/{BranchPickerNext.tsx → BranchPickerNext.ts} +3 -3
- package/src/primitives/branchPicker/BranchPickerNumber.tsx +1 -1
- package/src/primitives/branchPicker/{BranchPickerPrevious.tsx → BranchPickerPrevious.ts} +3 -3
- package/src/primitives/chainOfThought/{ChainOfThoughtAccordionTrigger.tsx → ChainOfThoughtAccordionTrigger.ts} +1 -3
- package/src/primitives/chainOfThought/ChainOfThoughtParts.tsx +1 -3
- package/src/primitives/composer/{ComposerAddAttachment.tsx → ComposerAddAttachment.ts} +1 -1
- package/src/primitives/composer/ComposerAttachments.tsx +2 -2
- package/src/primitives/composer/{ComposerCancel.tsx → ComposerCancel.ts} +1 -1
- package/src/primitives/composer/{ComposerDictate.tsx → ComposerDictate.ts} +4 -4
- package/src/primitives/composer/ComposerDictationTranscript.tsx +1 -3
- package/src/primitives/composer/{ComposerIf.tsx → ComposerIf.ts} +4 -4
- package/src/primitives/composer/ComposerInput.tsx +57 -17
- package/src/primitives/composer/ComposerQuote.tsx +109 -0
- package/src/primitives/composer/{ComposerStopDictation.tsx → ComposerStopDictation.ts} +1 -1
- package/src/primitives/composer/index.ts +3 -0
- package/src/primitives/error/ErrorMessage.tsx +4 -4
- package/src/primitives/index.ts +3 -0
- package/src/primitives/message/MessageAttachments.tsx +5 -5
- package/src/primitives/message/{MessageError.tsx → MessageError.ts} +3 -3
- package/src/primitives/message/{MessageIf.tsx → MessageIf.ts} +3 -3
- package/src/primitives/message/MessageParts.tsx +40 -10
- package/src/primitives/message/MessagePartsGrouped.tsx +40 -8
- package/src/primitives/message/MessageRoot.tsx +6 -5
- package/src/primitives/messagePart/{MessagePartInProgress.tsx → MessagePartInProgress.ts} +1 -3
- package/src/primitives/messagePart/{useMessagePartData.tsx → useMessagePartData.ts} +4 -4
- package/src/primitives/messagePart/useMessagePartFile.ts +17 -0
- package/src/primitives/messagePart/useMessagePartImage.ts +17 -0
- package/src/primitives/messagePart/useMessagePartReasoning.ts +20 -0
- package/src/primitives/messagePart/useMessagePartSource.ts +17 -0
- package/src/primitives/messagePart/useMessagePartText.ts +22 -0
- package/src/primitives/selectionToolbar/SelectionToolbarQuote.tsx +62 -0
- package/src/primitives/selectionToolbar/SelectionToolbarRoot.tsx +131 -0
- package/src/primitives/selectionToolbar/index.ts +8 -0
- package/src/primitives/suggestion/SuggestionDescription.tsx +1 -1
- package/src/primitives/suggestion/SuggestionTitle.tsx +1 -1
- package/src/primitives/suggestion/{SuggestionTrigger.tsx → SuggestionTrigger.ts} +6 -3
- package/src/primitives/thread/{ThreadEmpty.tsx → ThreadEmpty.ts} +1 -1
- package/src/primitives/thread/{ThreadIf.tsx → ThreadIf.ts} +8 -8
- package/src/primitives/thread/ThreadMessages.tsx +4 -4
- package/src/primitives/thread/{ThreadSuggestion.tsx → ThreadSuggestion.ts} +5 -2
- package/src/primitives/thread/ThreadSuggestions.tsx +1 -1
- package/src/primitives/thread/ThreadViewportSlack.tsx +5 -5
- package/src/primitives/threadList/ThreadListItems.tsx +2 -2
- package/src/primitives/threadList/ThreadListNew.tsx +1 -1
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +1 -1
- package/src/primitives/threadListItem/ThreadListItemTitle.test.tsx +52 -0
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +1 -1
- package/src/tests/BaseComposerRuntimeCore.test.ts +318 -0
- package/src/tests/BaseSubscribable.test.ts +54 -0
- package/src/tests/DataRenderers.test.ts +223 -0
- package/src/tests/ExternalStoreThreadRuntimeCore.test.ts +510 -0
- package/src/tests/LocalThreadRuntimeCore.test.ts +321 -0
- package/src/tests/external-message-converter.test.ts +1 -1
- package/src/tests/shouldContinue.test.ts +89 -0
- package/src/types/{MessagePartComponentTypes.tsx → MessagePartComponentTypes.ts} +9 -2
- package/src/types/index.ts +9 -8
- package/src/types/scopes/dataRenderers.ts +15 -0
- package/src/types/scopes/index.ts +10 -22
- package/src/types/scopes/tools.ts +1 -2
- package/src/types/store-augmentation.ts +5 -25
- package/src/utils/getSelectionMessageId.ts +20 -0
- package/src/utils/smooth/SmoothContext.tsx +2 -2
- package/src/utils/smooth/{useSmooth.tsx → useSmooth.ts} +22 -11
- package/src/utils/{useToolArgsFieldStatus.tsx → useToolArgsFieldStatus.ts} +5 -5
- package/dist/client/ChainOfThoughtClient.d.ts +0 -15
- package/dist/client/ChainOfThoughtClient.d.ts.map +0 -1
- package/dist/client/ChainOfThoughtClient.js +0 -21
- package/dist/client/ChainOfThoughtClient.js.map +0 -1
- package/dist/client/ModelContextClient.d.ts +0 -3
- package/dist/client/ModelContextClient.d.ts.map +0 -1
- package/dist/client/ModelContextClient.js +0 -17
- package/dist/client/ModelContextClient.js.map +0 -1
- package/dist/client/NoOpComposerClient.d.ts +0 -7
- package/dist/client/NoOpComposerClient.d.ts.map +0 -1
- package/dist/client/NoOpComposerClient.js +0 -61
- package/dist/client/NoOpComposerClient.js.map +0 -1
- package/dist/client/Suggestions.d.ts +0 -11
- package/dist/client/Suggestions.d.ts.map +0 -1
- package/dist/client/Suggestions.js +0 -43
- package/dist/client/Suggestions.js.map +0 -1
- package/dist/client/ThreadMessageClient.d.ts +0 -11
- package/dist/client/ThreadMessageClient.d.ts.map +0 -1
- package/dist/client/ThreadMessageClient.js +0 -121
- package/dist/client/ThreadMessageClient.js.map +0 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js +0 -14
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts +0 -13
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js +0 -84
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js +0 -15
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts +0 -11
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.js +0 -81
- package/dist/legacy-runtime/client/MessageRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js +0 -44
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts +0 -11
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js +0 -57
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts +0 -8
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js +0 -94
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.d.ts +0 -11
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.js +0 -31
- package/dist/legacy-runtime/runtime/subscribable/BaseSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.d.ts +0 -13
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.js +0 -37
- package/dist/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.d.ts +0 -13
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.js +0 -34
- package/dist/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.d.ts +0 -12
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.js +0 -39
- package/dist/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.d.ts +0 -3
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.js +0 -2
- package/dist/legacy-runtime/runtime/subscribable/SKIP_UPDATE.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.d.ts +0 -13
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.js +0 -41
- package/dist/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.d.ts +0 -16
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.js +0 -2
- package/dist/legacy-runtime/runtime/subscribable/Subscribable.js.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.d.ts +0 -2
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.js +0 -16
- package/dist/legacy-runtime/runtime/subscribable/shallowEqual.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.d.ts +0 -64
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.d.ts +0 -13
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.js +0 -79
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.d.ts +0 -11
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.js +0 -35
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.d.ts +0 -11
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.js +0 -35
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.d.ts +0 -43
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.d.ts +0 -110
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.d.ts +0 -61
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.js +0 -152
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.d.ts +0 -5
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.js +0 -42
- package/dist/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.d.ts +0 -10
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.d.ts +0 -21
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.js.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.d.ts +0 -16
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.d.ts.map +0 -1
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.js +0 -2
- package/dist/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.js.map +0 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.d.ts +0 -3
- package/dist/legacy-runtime/util-hooks/tapSubscribable.d.ts.map +0 -1
- package/dist/legacy-runtime/util-hooks/tapSubscribable.js +0 -12
- package/dist/legacy-runtime/util-hooks/tapSubscribable.js.map +0 -1
- package/dist/model-context/ModelContextTypes.d.ts +0 -29
- package/dist/model-context/ModelContextTypes.d.ts.map +0 -1
- package/dist/model-context/ModelContextTypes.js +0 -41
- package/dist/model-context/ModelContextTypes.js.map +0 -1
- package/dist/model-context/frame/AssistantFrameHost.d.ts +0 -37
- package/dist/model-context/frame/AssistantFrameHost.d.ts.map +0 -1
- package/dist/model-context/frame/AssistantFrameHost.js +0 -161
- package/dist/model-context/frame/AssistantFrameHost.js.map +0 -1
- package/dist/model-context/frame/AssistantFrameProvider.d.ts +0 -41
- package/dist/model-context/frame/AssistantFrameProvider.d.ts.map +0 -1
- package/dist/model-context/frame/AssistantFrameProvider.js +0 -167
- package/dist/model-context/frame/AssistantFrameProvider.js.map +0 -1
- package/dist/model-context/frame/AssistantFrameTypes.d.ts +0 -29
- package/dist/model-context/frame/AssistantFrameTypes.d.ts.map +0 -1
- package/dist/model-context/frame/AssistantFrameTypes.js +0 -2
- package/dist/model-context/frame/AssistantFrameTypes.js.map +0 -1
- package/dist/model-context/registry/ModelContextRegistry.d.ts +0 -19
- package/dist/model-context/registry/ModelContextRegistry.d.ts.map +0 -1
- package/dist/model-context/registry/ModelContextRegistry.js +0 -114
- package/dist/model-context/registry/ModelContextRegistry.js.map +0 -1
- package/dist/model-context/registry/ModelContextRegistryHandles.d.ts +0 -14
- package/dist/model-context/registry/ModelContextRegistryHandles.d.ts.map +0 -1
- package/dist/model-context/registry/ModelContextRegistryHandles.js +0 -2
- package/dist/model-context/registry/ModelContextRegistryHandles.js.map +0 -1
- package/dist/model-context/tool.d.ts +0 -3
- package/dist/model-context/tool.d.ts.map +0 -1
- package/dist/model-context/tool.js +0 -5
- package/dist/model-context/tool.js.map +0 -1
- package/dist/types/AssistantTypes.d.ts +0 -108
- package/dist/types/AssistantTypes.d.ts.map +0 -1
- package/dist/types/AssistantTypes.js +0 -2
- package/dist/types/AssistantTypes.js.map +0 -1
- package/dist/types/AttachmentTypes.d.ts +0 -35
- package/dist/types/AttachmentTypes.d.ts.map +0 -1
- package/dist/types/AttachmentTypes.js +0 -2
- package/dist/types/AttachmentTypes.js.map +0 -1
- package/dist/types/MessagePartTypes.d.ts +0 -62
- package/dist/types/MessagePartTypes.d.ts.map +0 -1
- package/dist/types/MessagePartTypes.js +0 -2
- package/dist/types/MessagePartTypes.js.map +0 -1
- package/dist/types/Unsubscribe.d.ts +0 -2
- package/dist/types/Unsubscribe.d.ts.map +0 -1
- package/dist/types/Unsubscribe.js +0 -2
- package/dist/types/Unsubscribe.js.map +0 -1
- package/dist/types/scopes/attachment.d.ts +0 -22
- package/dist/types/scopes/attachment.d.ts.map +0 -1
- package/dist/types/scopes/attachment.js +0 -2
- package/dist/types/scopes/attachment.js.map +0 -1
- package/dist/types/scopes/chainOfThought.d.ts +0 -40
- package/dist/types/scopes/chainOfThought.d.ts.map +0 -1
- package/dist/types/scopes/chainOfThought.js +0 -2
- package/dist/types/scopes/chainOfThought.js.map +0 -1
- package/dist/types/scopes/composer.d.ts +0 -67
- package/dist/types/scopes/composer.d.ts.map +0 -1
- package/dist/types/scopes/composer.js +0 -2
- package/dist/types/scopes/composer.js.map +0 -1
- package/dist/types/scopes/message.d.ts +0 -87
- package/dist/types/scopes/message.d.ts.map +0 -1
- package/dist/types/scopes/message.js +0 -2
- package/dist/types/scopes/message.js.map +0 -1
- package/dist/types/scopes/modelContext.d.ts +0 -12
- package/dist/types/scopes/modelContext.d.ts.map +0 -1
- package/dist/types/scopes/modelContext.js +0 -2
- package/dist/types/scopes/modelContext.js.map +0 -1
- package/dist/types/scopes/part.d.ts +0 -43
- package/dist/types/scopes/part.d.ts.map +0 -1
- package/dist/types/scopes/part.js +0 -2
- package/dist/types/scopes/part.js.map +0 -1
- package/dist/types/scopes/suggestion.d.ts +0 -20
- package/dist/types/scopes/suggestion.d.ts.map +0 -1
- package/dist/types/scopes/suggestion.js +0 -2
- package/dist/types/scopes/suggestion.js.map +0 -1
- package/dist/types/scopes/suggestions.d.ts +0 -20
- package/dist/types/scopes/suggestions.d.ts.map +0 -1
- package/dist/types/scopes/suggestions.js +0 -2
- package/dist/types/scopes/suggestions.js.map +0 -1
- package/dist/types/scopes/thread.d.ts +0 -138
- package/dist/types/scopes/thread.d.ts.map +0 -1
- package/dist/types/scopes/thread.js +0 -2
- package/dist/types/scopes/thread.js.map +0 -1
- package/dist/types/scopes/threadListItem.d.ts +0 -50
- package/dist/types/scopes/threadListItem.d.ts.map +0 -1
- package/dist/types/scopes/threadListItem.js +0 -2
- package/dist/types/scopes/threadListItem.js.map +0 -1
- package/dist/types/scopes/threads.d.ts +0 -28
- package/dist/types/scopes/threads.d.ts.map +0 -1
- package/dist/types/scopes/threads.js +0 -2
- package/dist/types/scopes/threads.js.map +0 -1
- package/dist/utils/CompositeContextProvider.d.ts +0 -10
- package/dist/utils/CompositeContextProvider.d.ts.map +0 -1
- package/dist/utils/CompositeContextProvider.js +0 -29
- package/dist/utils/CompositeContextProvider.js.map +0 -1
- package/dist/utils/getThreadMessageText.d.ts +0 -3
- package/dist/utils/getThreadMessageText.d.ts.map +0 -1
- package/dist/utils/getThreadMessageText.js +0 -5
- package/dist/utils/getThreadMessageText.js.map +0 -1
- package/dist/utils/idUtils.d.ts +0 -6
- package/dist/utils/idUtils.d.ts.map +0 -1
- package/dist/utils/idUtils.js +0 -9
- package/dist/utils/idUtils.js.map +0 -1
- package/src/client/ChainOfThoughtClient.ts +0 -43
- package/src/client/ModelContextClient.ts +0 -23
- package/src/client/NoOpComposerClient.tsx +0 -66
- package/src/client/Suggestions.ts +0 -74
- package/src/client/ThreadMessageClient.tsx +0 -178
- package/src/legacy-runtime/client/AttachmentRuntimeClient.ts +0 -19
- package/src/legacy-runtime/client/ComposerRuntimeClient.ts +0 -136
- package/src/legacy-runtime/client/MessagePartRuntimeClient.ts +0 -20
- package/src/legacy-runtime/client/MessageRuntimeClient.ts +0 -151
- package/src/legacy-runtime/client/ThreadListItemRuntimeClient.ts +0 -59
- package/src/legacy-runtime/client/ThreadListRuntimeClient.ts +0 -100
- package/src/legacy-runtime/client/ThreadRuntimeClient.ts +0 -148
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.tsx +0 -182
- package/src/legacy-runtime/runtime/subscribable/BaseSubject.ts +0 -36
- package/src/legacy-runtime/runtime/subscribable/EventSubscriptionSubject.ts +0 -44
- package/src/legacy-runtime/runtime/subscribable/LazyMemoizeSubject.ts +0 -42
- package/src/legacy-runtime/runtime/subscribable/NestedSubscriptionSubject.ts +0 -58
- package/src/legacy-runtime/runtime/subscribable/SKIP_UPDATE.ts +0 -2
- package/src/legacy-runtime/runtime/subscribable/ShallowMemoizeSubject.ts +0 -47
- package/src/legacy-runtime/runtime/subscribable/Subscribable.ts +0 -26
- package/src/legacy-runtime/runtime/subscribable/shallowEqual.ts +0 -16
- package/src/legacy-runtime/runtime-cores/adapters/attachment/AttachmentAdapter.ts +0 -71
- package/src/legacy-runtime/runtime-cores/adapters/attachment/CompositeAttachmentAdapter.ts +0 -107
- package/src/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.ts +0 -49
- package/src/legacy-runtime/runtime-cores/adapters/attachment/SimpleTextAttachmentAdapter.ts +0 -50
- package/src/legacy-runtime/runtime-cores/adapters/feedback/FeedbackAdapter.ts +0 -43
- package/src/legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes.ts +0 -121
- package/src/legacy-runtime/runtime-cores/adapters/speech/WebSpeechDictationAdapter.ts +0 -255
- package/src/legacy-runtime/runtime-cores/adapters/speech/WebSpeechSynthesisAdapter.ts +0 -48
- package/src/legacy-runtime/runtime-cores/adapters/suggestion/SuggestionAdapter.ts +0 -14
- package/src/legacy-runtime/runtime-cores/adapters/thread-history/MessageFormatAdapter.ts +0 -25
- package/src/legacy-runtime/runtime-cores/adapters/thread-history/ThreadHistoryAdapter.ts +0 -26
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.tsx +0 -404
- package/src/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.tsx +0 -72
- package/src/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.tsx +0 -65
- package/src/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.tsx +0 -19
- package/src/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.tsx +0 -20
- package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.tsx +0 -237
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.tsx +0 -86
- package/src/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.tsx +0 -49
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.tsx +0 -154
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.tsx +0 -111
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.tsx +0 -26
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.tsx +0 -235
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.tsx +0 -368
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.tsx +0 -227
- package/src/legacy-runtime/runtime-cores/external-store/auto-status.tsx +0 -67
- package/src/legacy-runtime/runtime-cores/external-store/getExternalStoreMessage.tsx +0 -37
- package/src/legacy-runtime/runtime-cores/local/ChatModelAdapter.tsx +0 -64
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeCore.tsx +0 -32
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.tsx +0 -60
- package/src/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.tsx +0 -116
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.tsx +0 -519
- package/src/legacy-runtime/runtime-cores/local/shouldContinue.tsx +0 -26
- package/src/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.tsx +0 -41
- package/src/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.tsx +0 -194
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.tsx +0 -43
- package/src/legacy-runtime/runtime-cores/remote-thread-list/types.tsx +0 -49
- package/src/legacy-runtime/runtime-cores/utils/MessageRepository.tsx +0 -551
- package/src/legacy-runtime/util-hooks/tapSubscribable.ts +0 -16
- package/src/model-context/ModelContextTypes.ts +0 -76
- package/src/model-context/frame/AssistantFrameHost.ts +0 -218
- package/src/model-context/frame/AssistantFrameProvider.ts +0 -230
- package/src/model-context/frame/AssistantFrameTypes.ts +0 -40
- package/src/model-context/registry/ModelContextRegistry.ts +0 -165
- package/src/model-context/registry/ModelContextRegistryHandles.ts +0 -19
- package/src/model-context/tool.ts +0 -9
- package/src/primitives/messagePart/useMessagePartFile.tsx +0 -18
- package/src/primitives/messagePart/useMessagePartImage.tsx +0 -18
- package/src/primitives/messagePart/useMessagePartReasoning.tsx +0 -18
- package/src/primitives/messagePart/useMessagePartSource.tsx +0 -18
- package/src/primitives/messagePart/useMessagePartText.tsx +0 -18
- package/src/tests/MessageRepository.test.ts +0 -786
- package/src/types/AssistantTypes.ts +0 -166
- package/src/types/AttachmentTypes.ts +0 -45
- package/src/types/MessagePartTypes.ts +0 -82
- package/src/types/Unsubscribe.tsx +0 -1
- package/src/types/scopes/attachment.ts +0 -22
- package/src/types/scopes/chainOfThought.ts +0 -42
- package/src/types/scopes/composer.ts +0 -68
- package/src/types/scopes/message.ts +0 -78
- package/src/types/scopes/modelContext.ts +0 -14
- package/src/types/scopes/part.ts +0 -49
- package/src/types/scopes/suggestion.ts +0 -20
- package/src/types/scopes/suggestions.ts +0 -21
- package/src/types/scopes/thread.ts +0 -141
- package/src/types/scopes/threadListItem.ts +0 -44
- package/src/types/scopes/threads.ts +0 -36
- package/src/utils/CompositeContextProvider.ts +0 -36
- package/src/utils/getThreadMessageText.tsx +0 -15
- package/src/utils/idUtils.tsx +0 -14
- /package/src/model-context/{makeAssistantTool.tsx → makeAssistantTool.ts} +0 -0
- /package/src/model-context/{makeAssistantToolUI.tsx → makeAssistantToolUI.ts} +0 -0
- /package/src/model-context/{toolbox.tsx → toolbox.ts} +0 -0
- /package/src/model-context/{useAssistantToolUI.tsx → useAssistantToolUI.ts} +0 -0
- /package/src/model-context/{useInlineRender.tsx → useInlineRender.ts} +0 -0
- /package/src/primitives/actionBar/{ActionBarReload.tsx → ActionBarReload.ts} +0 -0
- /package/src/primitives/actionBarMore/{scope.tsx → scope.ts} +0 -0
- /package/src/primitives/assistantModal/{scope.tsx → scope.ts} +0 -0
- /package/src/primitives/attachment/{AttachmentRemove.tsx → AttachmentRemove.ts} +0 -0
- /package/src/primitives/composer/{ComposerSend.tsx → ComposerSend.ts} +0 -0
- /package/src/primitives/reasoning/{useScrollLock.tsx → useScrollLock.ts} +0 -0
- /package/src/primitives/thread/{ThreadScrollToBottom.tsx → ThreadScrollToBottom.ts} +0 -0
- /package/src/primitives/thread/{useThreadViewportAutoScroll.tsx → useThreadViewportAutoScroll.ts} +0 -0
- /package/src/primitives/threadListItemMore/{scope.tsx → scope.ts} +0 -0
- /package/src/utils/{RequireAtLeastOne.tsx → RequireAtLeastOne.ts} +0 -0
- /package/src/utils/hooks/{useOnResizeContent.tsx → useOnResizeContent.ts} +0 -0
- /package/src/utils/hooks/{useOnScrollToBottom.tsx → useOnScrollToBottom.ts} +0 -0
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Attachment,
|
|
3
|
-
PendingAttachment,
|
|
4
|
-
} from "../../../../types/AttachmentTypes";
|
|
5
|
-
import { AttachmentAdapter } from "./AttachmentAdapter";
|
|
6
|
-
|
|
7
|
-
function fileMatchesAccept(
|
|
8
|
-
file: { name: string; type: string },
|
|
9
|
-
acceptString: string,
|
|
10
|
-
) {
|
|
11
|
-
// Check if the accept string is "*", which allows any file
|
|
12
|
-
if (acceptString === "*") {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Split the accept string into an array of allowed types
|
|
17
|
-
const allowedTypes = acceptString
|
|
18
|
-
.split(",")
|
|
19
|
-
.map((type) => type.trim().toLowerCase());
|
|
20
|
-
|
|
21
|
-
// Get the file's extension and MIME type
|
|
22
|
-
const fileExtension = `.${file.name.split(".").pop()!.toLowerCase()}`;
|
|
23
|
-
const fileMimeType = file.type.toLowerCase();
|
|
24
|
-
|
|
25
|
-
for (const type of allowedTypes) {
|
|
26
|
-
// Check for file extension match
|
|
27
|
-
if (type.startsWith(".") && type === fileExtension) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Check for exact MIME type match
|
|
32
|
-
if (type.includes("/") && type === fileMimeType) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (type === "image/*" || type === "video/*" || type === "audio/*") {
|
|
37
|
-
// Check for wildcard MIME type match
|
|
38
|
-
if (type.endsWith("/*")) {
|
|
39
|
-
const generalType = type.split("/")[0]!;
|
|
40
|
-
if (fileMimeType.startsWith(`${generalType}/`)) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class CompositeAttachmentAdapter implements AttachmentAdapter {
|
|
51
|
-
private _adapters: AttachmentAdapter[];
|
|
52
|
-
|
|
53
|
-
public accept: string;
|
|
54
|
-
|
|
55
|
-
constructor(adapters: AttachmentAdapter[]) {
|
|
56
|
-
this._adapters = adapters;
|
|
57
|
-
|
|
58
|
-
const wildcardIdx = adapters.findIndex((a) => a.accept === "*");
|
|
59
|
-
if (wildcardIdx !== -1) {
|
|
60
|
-
if (wildcardIdx !== adapters.length - 1)
|
|
61
|
-
throw new Error(
|
|
62
|
-
"A wildcard adapter (handling all files) can only be specified as the last adapter.",
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
this.accept = "*";
|
|
66
|
-
} else {
|
|
67
|
-
this.accept = adapters.map((a) => a.accept).join(",");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public add(state: { file: File }) {
|
|
72
|
-
for (const adapter of this._adapters) {
|
|
73
|
-
if (fileMatchesAccept(state.file, adapter.accept)) {
|
|
74
|
-
return adapter.add(state);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
throw new Error("No matching adapter found for file");
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public async send(attachment: PendingAttachment) {
|
|
81
|
-
const adapters = this._adapters.slice();
|
|
82
|
-
for (const adapter of adapters) {
|
|
83
|
-
if (fileMatchesAccept(attachment.file, adapter.accept)) {
|
|
84
|
-
return adapter.send(attachment);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
throw new Error("No matching adapter found for attachment");
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public async remove(attachment: Attachment) {
|
|
91
|
-
const adapters = this._adapters.slice();
|
|
92
|
-
for (const adapter of adapters) {
|
|
93
|
-
if (
|
|
94
|
-
fileMatchesAccept(
|
|
95
|
-
{
|
|
96
|
-
name: attachment.name,
|
|
97
|
-
type: attachment.contentType,
|
|
98
|
-
},
|
|
99
|
-
adapter.accept,
|
|
100
|
-
)
|
|
101
|
-
) {
|
|
102
|
-
return adapter.remove(attachment);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
throw new Error("No matching adapter found for attachment");
|
|
106
|
-
}
|
|
107
|
-
}
|
package/src/legacy-runtime/runtime-cores/adapters/attachment/SimpleImageAttachmentAdapter.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PendingAttachment,
|
|
3
|
-
CompleteAttachment,
|
|
4
|
-
} from "../../../../types/AttachmentTypes";
|
|
5
|
-
import { AttachmentAdapter } from "./AttachmentAdapter";
|
|
6
|
-
|
|
7
|
-
export class SimpleImageAttachmentAdapter implements AttachmentAdapter {
|
|
8
|
-
public accept = "image/*";
|
|
9
|
-
|
|
10
|
-
public async add(state: { file: File }): Promise<PendingAttachment> {
|
|
11
|
-
return {
|
|
12
|
-
id: state.file.name,
|
|
13
|
-
type: "image",
|
|
14
|
-
name: state.file.name,
|
|
15
|
-
contentType: state.file.type,
|
|
16
|
-
file: state.file,
|
|
17
|
-
status: { type: "requires-action", reason: "composer-send" },
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public async send(
|
|
22
|
-
attachment: PendingAttachment,
|
|
23
|
-
): Promise<CompleteAttachment> {
|
|
24
|
-
return {
|
|
25
|
-
...attachment,
|
|
26
|
-
status: { type: "complete" },
|
|
27
|
-
content: [
|
|
28
|
-
{
|
|
29
|
-
type: "image",
|
|
30
|
-
image: await getFileDataURL(attachment.file),
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public async remove() {
|
|
37
|
-
// noop
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const getFileDataURL = (file: File) =>
|
|
42
|
-
new Promise<string>((resolve, reject) => {
|
|
43
|
-
const reader = new FileReader();
|
|
44
|
-
|
|
45
|
-
reader.onload = () => resolve(reader.result as string);
|
|
46
|
-
reader.onerror = (error) => reject(error);
|
|
47
|
-
|
|
48
|
-
reader.readAsDataURL(file);
|
|
49
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CompleteAttachment,
|
|
3
|
-
PendingAttachment,
|
|
4
|
-
} from "../../../../types/AttachmentTypes";
|
|
5
|
-
import { AttachmentAdapter } from "./AttachmentAdapter";
|
|
6
|
-
|
|
7
|
-
export class SimpleTextAttachmentAdapter implements AttachmentAdapter {
|
|
8
|
-
public accept =
|
|
9
|
-
"text/plain,text/html,text/markdown,text/csv,text/xml,text/json,text/css";
|
|
10
|
-
|
|
11
|
-
public async add(state: { file: File }): Promise<PendingAttachment> {
|
|
12
|
-
return {
|
|
13
|
-
id: state.file.name,
|
|
14
|
-
type: "document",
|
|
15
|
-
name: state.file.name,
|
|
16
|
-
contentType: state.file.type,
|
|
17
|
-
file: state.file,
|
|
18
|
-
status: { type: "requires-action", reason: "composer-send" },
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public async send(
|
|
23
|
-
attachment: PendingAttachment,
|
|
24
|
-
): Promise<CompleteAttachment> {
|
|
25
|
-
return {
|
|
26
|
-
...attachment,
|
|
27
|
-
status: { type: "complete" },
|
|
28
|
-
content: [
|
|
29
|
-
{
|
|
30
|
-
type: "text",
|
|
31
|
-
text: `<attachment name=${attachment.name}>\n${await getFileText(attachment.file)}\n</attachment>`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public async remove() {
|
|
38
|
-
// noop
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const getFileText = (file: File) =>
|
|
43
|
-
new Promise<string>((resolve, reject) => {
|
|
44
|
-
const reader = new FileReader();
|
|
45
|
-
|
|
46
|
-
reader.onload = () => resolve(reader.result as string);
|
|
47
|
-
reader.onerror = (error) => reject(error);
|
|
48
|
-
|
|
49
|
-
reader.readAsText(file);
|
|
50
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ThreadMessage } from "../../../../types/AssistantTypes";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Feedback data structure for rating messages.
|
|
5
|
-
*/
|
|
6
|
-
type FeedbackAdapterFeedback = {
|
|
7
|
-
/** The message being rated */
|
|
8
|
-
message: ThreadMessage;
|
|
9
|
-
/** The type of feedback being provided */
|
|
10
|
-
type: "positive" | "negative";
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Interface for handling user feedback on assistant messages.
|
|
15
|
-
*
|
|
16
|
-
* FeedbackAdapter allows users to provide positive or negative feedback
|
|
17
|
-
* on assistant responses, which can be used for analytics, model improvement,
|
|
18
|
-
* or user experience tracking.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* const feedbackAdapter: FeedbackAdapter = {
|
|
23
|
-
* submit: (feedback) => {
|
|
24
|
-
* console.log(`User gave ${feedback.type} feedback on message:`, feedback.message.id);
|
|
25
|
-
*
|
|
26
|
-
* // Send to analytics service
|
|
27
|
-
* analytics.track('message_feedback', {
|
|
28
|
-
* messageId: feedback.message.id,
|
|
29
|
-
* feedbackType: feedback.type,
|
|
30
|
-
* messageContent: feedback.message.content
|
|
31
|
-
* });
|
|
32
|
-
* }
|
|
33
|
-
* };
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export type FeedbackAdapter = {
|
|
37
|
-
/**
|
|
38
|
-
* Submits user feedback for a message.
|
|
39
|
-
*
|
|
40
|
-
* @param feedback - The feedback data containing message and rating type
|
|
41
|
-
*/
|
|
42
|
-
submit: (feedback: FeedbackAdapterFeedback) => void;
|
|
43
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Unsubscribe } from "../../../../types";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Types and interfaces for speech synthesis (text-to-speech) functionality.
|
|
5
|
-
*/
|
|
6
|
-
export namespace SpeechSynthesisAdapter {
|
|
7
|
-
/**
|
|
8
|
-
* Status of a speech synthesis operation.
|
|
9
|
-
*/
|
|
10
|
-
export type Status =
|
|
11
|
-
| {
|
|
12
|
-
/** Speech is starting or currently running */
|
|
13
|
-
type: "starting" | "running";
|
|
14
|
-
}
|
|
15
|
-
| {
|
|
16
|
-
/** Speech has ended */
|
|
17
|
-
type: "ended";
|
|
18
|
-
/** Reason why speech ended */
|
|
19
|
-
reason: "finished" | "cancelled" | "error";
|
|
20
|
-
/** Error details if speech ended due to error */
|
|
21
|
-
error?: unknown;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Represents a single speech utterance with control and status tracking.
|
|
26
|
-
*/
|
|
27
|
-
export type Utterance = {
|
|
28
|
-
/** Current status of the utterance */
|
|
29
|
-
status: Status;
|
|
30
|
-
/** Cancel the current speech */
|
|
31
|
-
cancel: () => void;
|
|
32
|
-
/** Subscribe to status changes */
|
|
33
|
-
subscribe: (callback: () => void) => Unsubscribe;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Interface for text-to-speech functionality.
|
|
39
|
-
*
|
|
40
|
-
* SpeechSynthesisAdapter provides the ability to convert text content
|
|
41
|
-
* into spoken audio, with status tracking and cancellation support.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```tsx
|
|
45
|
-
* const speechAdapter: SpeechSynthesisAdapter = {
|
|
46
|
-
* speak: (text) => {
|
|
47
|
-
* const utterance = new SpeechSynthesisUtterance(text);
|
|
48
|
-
* speechSynthesis.speak(utterance);
|
|
49
|
-
*
|
|
50
|
-
* return {
|
|
51
|
-
* status: { type: "starting" },
|
|
52
|
-
* cancel: () => speechSynthesis.cancel(),
|
|
53
|
-
* subscribe: (callback) => {
|
|
54
|
-
* utterance.addEventListener('end', callback);
|
|
55
|
-
* return () => utterance.removeEventListener('end', callback);
|
|
56
|
-
* }
|
|
57
|
-
* };
|
|
58
|
-
* }
|
|
59
|
-
* };
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
export type SpeechSynthesisAdapter = {
|
|
63
|
-
/**
|
|
64
|
-
* Converts text to speech and returns an utterance object for control.
|
|
65
|
-
*
|
|
66
|
-
* @param text - The text content to speak
|
|
67
|
-
* @returns An utterance object with status and control methods
|
|
68
|
-
*/
|
|
69
|
-
speak: (text: string) => SpeechSynthesisAdapter.Utterance;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export namespace DictationAdapter {
|
|
73
|
-
export type Status =
|
|
74
|
-
| {
|
|
75
|
-
type: "starting" | "running";
|
|
76
|
-
}
|
|
77
|
-
| {
|
|
78
|
-
type: "ended";
|
|
79
|
-
reason: "stopped" | "cancelled" | "error";
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export type Result = {
|
|
83
|
-
/** The transcribed text */
|
|
84
|
-
transcript: string;
|
|
85
|
-
/**
|
|
86
|
-
* Whether this is a final (committed) result or an interim (partial) result.
|
|
87
|
-
*
|
|
88
|
-
* - `true` (final): The text should be appended to the composer input.
|
|
89
|
-
* This text is finalized and won't change.
|
|
90
|
-
*
|
|
91
|
-
* - `false` (interim/partial): The text is a preview that may change.
|
|
92
|
-
* It should be displayed as a preview but not appended to the input yet.
|
|
93
|
-
* Subsequent interim results replace the previous interim result.
|
|
94
|
-
*
|
|
95
|
-
* Defaults to `true` for backwards compatibility with adapters that
|
|
96
|
-
* don't set this flag.
|
|
97
|
-
*/
|
|
98
|
-
isFinal?: boolean;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export type Session = {
|
|
102
|
-
status: Status;
|
|
103
|
-
stop: () => Promise<void>;
|
|
104
|
-
cancel: () => void;
|
|
105
|
-
onSpeechStart: (callback: () => void) => Unsubscribe;
|
|
106
|
-
onSpeechEnd: (callback: (result: Result) => void) => Unsubscribe;
|
|
107
|
-
onSpeech: (callback: (result: Result) => void) => Unsubscribe;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export type DictationAdapter = {
|
|
112
|
-
listen: () => DictationAdapter.Session;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Whether to disable text input while dictation is active.
|
|
116
|
-
* Some adapters (like ElevenLabs Scribe) return cumulative transcripts
|
|
117
|
-
* that conflict with simultaneous typing.
|
|
118
|
-
* @default false
|
|
119
|
-
*/
|
|
120
|
-
disableInputDuringDictation?: boolean;
|
|
121
|
-
};
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import type { Unsubscribe } from "../../../../types";
|
|
2
|
-
import type { DictationAdapter } from "./SpeechAdapterTypes";
|
|
3
|
-
|
|
4
|
-
// Type definitions for Web Speech API
|
|
5
|
-
// Users can install @types/dom-speech-recognition for full type support
|
|
6
|
-
interface SpeechRecognitionResultItem {
|
|
7
|
-
transcript: string;
|
|
8
|
-
confidence: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface SpeechRecognitionResult {
|
|
12
|
-
readonly length: number;
|
|
13
|
-
item(index: number): SpeechRecognitionResultItem;
|
|
14
|
-
readonly isFinal: boolean;
|
|
15
|
-
[index: number]: SpeechRecognitionResultItem;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface SpeechRecognitionResultList {
|
|
19
|
-
readonly length: number;
|
|
20
|
-
item(index: number): SpeechRecognitionResult;
|
|
21
|
-
[index: number]: SpeechRecognitionResult;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface SpeechRecognitionEvent extends Event {
|
|
25
|
-
readonly resultIndex: number;
|
|
26
|
-
readonly results: SpeechRecognitionResultList;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface SpeechRecognitionErrorEvent extends Event {
|
|
30
|
-
readonly error: string;
|
|
31
|
-
readonly message: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface SpeechRecognitionInstance extends EventTarget {
|
|
35
|
-
lang: string;
|
|
36
|
-
continuous: boolean;
|
|
37
|
-
interimResults: boolean;
|
|
38
|
-
start(): void;
|
|
39
|
-
stop(): void;
|
|
40
|
-
abort(): void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface SpeechRecognitionConstructor {
|
|
44
|
-
new (): SpeechRecognitionInstance;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare global {
|
|
48
|
-
interface Window {
|
|
49
|
-
SpeechRecognition?: SpeechRecognitionConstructor;
|
|
50
|
-
webkitSpeechRecognition?: SpeechRecognitionConstructor;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const getSpeechRecognitionAPI = ():
|
|
55
|
-
| SpeechRecognitionConstructor
|
|
56
|
-
| undefined => {
|
|
57
|
-
if (typeof window === "undefined") return undefined;
|
|
58
|
-
return window.SpeechRecognition ?? window.webkitSpeechRecognition;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* WebSpeechDictationAdapter provides speech-to-text (dictation) functionality using
|
|
63
|
-
* the browser's Web Speech API (SpeechRecognition).
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```tsx
|
|
67
|
-
* const runtime = useChatRuntime({
|
|
68
|
-
* api: "/api/chat",
|
|
69
|
-
* adapters: {
|
|
70
|
-
* dictation: new WebSpeechDictationAdapter(),
|
|
71
|
-
* },
|
|
72
|
-
* });
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export class WebSpeechDictationAdapter implements DictationAdapter {
|
|
76
|
-
private _language: string;
|
|
77
|
-
private _continuous: boolean;
|
|
78
|
-
private _interimResults: boolean;
|
|
79
|
-
|
|
80
|
-
constructor(
|
|
81
|
-
options: {
|
|
82
|
-
/**
|
|
83
|
-
* The language for dictation (e.g., "en-US", "zh-CN").
|
|
84
|
-
* Defaults to the browser's language.
|
|
85
|
-
*/
|
|
86
|
-
language?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Whether to keep recording after the user stops speaking.
|
|
89
|
-
* Defaults to true.
|
|
90
|
-
*/
|
|
91
|
-
continuous?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Whether to return interim (partial) results.
|
|
94
|
-
* Defaults to true for real-time feedback.
|
|
95
|
-
*/
|
|
96
|
-
interimResults?: boolean;
|
|
97
|
-
} = {},
|
|
98
|
-
) {
|
|
99
|
-
const defaultLanguage =
|
|
100
|
-
typeof navigator !== "undefined" && navigator.language
|
|
101
|
-
? navigator.language
|
|
102
|
-
: "en-US";
|
|
103
|
-
this._language = options.language ?? defaultLanguage;
|
|
104
|
-
this._continuous = options.continuous ?? true;
|
|
105
|
-
this._interimResults = options.interimResults ?? true;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Check if the browser supports the Web Speech Recognition API.
|
|
110
|
-
*/
|
|
111
|
-
static isSupported(): boolean {
|
|
112
|
-
return getSpeechRecognitionAPI() !== undefined;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
listen(): DictationAdapter.Session {
|
|
116
|
-
const SpeechRecognitionAPI = getSpeechRecognitionAPI();
|
|
117
|
-
if (!SpeechRecognitionAPI) {
|
|
118
|
-
throw new Error(
|
|
119
|
-
"SpeechRecognition is not supported in this browser. " +
|
|
120
|
-
"Try using Chrome, Edge, or Safari.",
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const recognition = new SpeechRecognitionAPI();
|
|
125
|
-
recognition.lang = this._language;
|
|
126
|
-
recognition.continuous = this._continuous;
|
|
127
|
-
recognition.interimResults = this._interimResults;
|
|
128
|
-
|
|
129
|
-
const speechStartCallbacks = new Set<() => void>();
|
|
130
|
-
const speechEndCallbacks = new Set<
|
|
131
|
-
(result: DictationAdapter.Result) => void
|
|
132
|
-
>();
|
|
133
|
-
const speechCallbacks = new Set<
|
|
134
|
-
(result: DictationAdapter.Result) => void
|
|
135
|
-
>();
|
|
136
|
-
|
|
137
|
-
let finalTranscript = "";
|
|
138
|
-
|
|
139
|
-
const session: DictationAdapter.Session = {
|
|
140
|
-
status: { type: "starting" },
|
|
141
|
-
|
|
142
|
-
stop: async () => {
|
|
143
|
-
recognition.stop();
|
|
144
|
-
return new Promise<void>((resolve) => {
|
|
145
|
-
const checkEnded = () => {
|
|
146
|
-
if (session.status.type === "ended") {
|
|
147
|
-
resolve();
|
|
148
|
-
} else {
|
|
149
|
-
setTimeout(checkEnded, 50);
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
checkEnded();
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
cancel: () => {
|
|
157
|
-
recognition.abort();
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
onSpeechStart: (callback: () => void): Unsubscribe => {
|
|
161
|
-
speechStartCallbacks.add(callback);
|
|
162
|
-
return () => {
|
|
163
|
-
speechStartCallbacks.delete(callback);
|
|
164
|
-
};
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
onSpeechEnd: (
|
|
168
|
-
callback: (result: DictationAdapter.Result) => void,
|
|
169
|
-
): Unsubscribe => {
|
|
170
|
-
speechEndCallbacks.add(callback);
|
|
171
|
-
return () => {
|
|
172
|
-
speechEndCallbacks.delete(callback);
|
|
173
|
-
};
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
onSpeech: (
|
|
177
|
-
callback: (result: DictationAdapter.Result) => void,
|
|
178
|
-
): Unsubscribe => {
|
|
179
|
-
speechCallbacks.add(callback);
|
|
180
|
-
return () => {
|
|
181
|
-
speechCallbacks.delete(callback);
|
|
182
|
-
};
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const updateStatus = (newStatus: DictationAdapter.Status) => {
|
|
187
|
-
session.status = newStatus;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
recognition.addEventListener("speechstart", () => {
|
|
191
|
-
for (const cb of speechStartCallbacks) cb();
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
recognition.addEventListener("start", () => {
|
|
195
|
-
updateStatus({ type: "running" });
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
recognition.addEventListener("result", (event) => {
|
|
199
|
-
const speechEvent = event as unknown as SpeechRecognitionEvent;
|
|
200
|
-
|
|
201
|
-
for (
|
|
202
|
-
let i = speechEvent.resultIndex;
|
|
203
|
-
i < speechEvent.results.length;
|
|
204
|
-
i++
|
|
205
|
-
) {
|
|
206
|
-
const result = speechEvent.results[i];
|
|
207
|
-
if (!result) continue;
|
|
208
|
-
|
|
209
|
-
const transcript = result[0]?.transcript ?? "";
|
|
210
|
-
|
|
211
|
-
if (result.isFinal) {
|
|
212
|
-
finalTranscript += transcript;
|
|
213
|
-
for (const cb of speechCallbacks) cb({ transcript, isFinal: true });
|
|
214
|
-
} else {
|
|
215
|
-
for (const cb of speechCallbacks) cb({ transcript, isFinal: false });
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
recognition.addEventListener("speechend", () => {
|
|
221
|
-
// speechend fires when user stops speaking, but 'end' handles final cleanup
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
recognition.addEventListener("end", () => {
|
|
225
|
-
const currentStatus = session.status;
|
|
226
|
-
if (currentStatus.type !== "ended") {
|
|
227
|
-
updateStatus({ type: "ended", reason: "stopped" });
|
|
228
|
-
}
|
|
229
|
-
if (finalTranscript) {
|
|
230
|
-
for (const cb of speechEndCallbacks)
|
|
231
|
-
cb({ transcript: finalTranscript });
|
|
232
|
-
finalTranscript = "";
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
recognition.addEventListener("error", (event) => {
|
|
237
|
-
const errorEvent = event as unknown as SpeechRecognitionErrorEvent;
|
|
238
|
-
if (errorEvent.error === "aborted") {
|
|
239
|
-
updateStatus({ type: "ended", reason: "cancelled" });
|
|
240
|
-
} else {
|
|
241
|
-
updateStatus({ type: "ended", reason: "error" });
|
|
242
|
-
console.error("Dictation error:", errorEvent.error, errorEvent.message);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
try {
|
|
247
|
-
recognition.start();
|
|
248
|
-
} catch (error) {
|
|
249
|
-
updateStatus({ type: "ended", reason: "error" });
|
|
250
|
-
throw error;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
return session;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { SpeechSynthesisAdapter } from "./SpeechAdapterTypes";
|
|
2
|
-
|
|
3
|
-
export class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter {
|
|
4
|
-
speak(text: string): SpeechSynthesisAdapter.Utterance {
|
|
5
|
-
const utterance = new SpeechSynthesisUtterance(text);
|
|
6
|
-
|
|
7
|
-
const subscribers = new Set<() => void>();
|
|
8
|
-
const handleEnd = (
|
|
9
|
-
reason: "finished" | "error" | "cancelled",
|
|
10
|
-
error?: unknown,
|
|
11
|
-
) => {
|
|
12
|
-
if (res.status.type === "ended") return;
|
|
13
|
-
|
|
14
|
-
res.status = { type: "ended", reason, error };
|
|
15
|
-
subscribers.forEach((handler) => handler());
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
utterance.addEventListener("end", () => handleEnd("finished"));
|
|
19
|
-
utterance.addEventListener("error", (e) => handleEnd("error", e.error));
|
|
20
|
-
|
|
21
|
-
window.speechSynthesis.speak(utterance);
|
|
22
|
-
|
|
23
|
-
const res: SpeechSynthesisAdapter.Utterance = {
|
|
24
|
-
status: { type: "running" },
|
|
25
|
-
cancel: () => {
|
|
26
|
-
window.speechSynthesis.cancel();
|
|
27
|
-
handleEnd("cancelled");
|
|
28
|
-
},
|
|
29
|
-
subscribe: (callback) => {
|
|
30
|
-
if (res.status.type === "ended") {
|
|
31
|
-
let cancelled = false;
|
|
32
|
-
queueMicrotask(() => {
|
|
33
|
-
if (!cancelled) callback();
|
|
34
|
-
});
|
|
35
|
-
return () => {
|
|
36
|
-
cancelled = true;
|
|
37
|
-
};
|
|
38
|
-
} else {
|
|
39
|
-
subscribers.add(callback);
|
|
40
|
-
return () => {
|
|
41
|
-
subscribers.delete(callback);
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
return res;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ThreadMessage } from "../../../../types/AssistantTypes";
|
|
2
|
-
import { ThreadSuggestion } from "../../core";
|
|
3
|
-
|
|
4
|
-
type SuggestionAdapterGenerateOptions = {
|
|
5
|
-
messages: readonly ThreadMessage[];
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type SuggestionAdapter = {
|
|
9
|
-
generate: (
|
|
10
|
-
options: SuggestionAdapterGenerateOptions,
|
|
11
|
-
) =>
|
|
12
|
-
| Promise<readonly ThreadSuggestion[]>
|
|
13
|
-
| AsyncGenerator<readonly ThreadSuggestion[], void>;
|
|
14
|
-
};
|