@assistant-ui/react 0.11.58 → 0.12.0
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/ModelContextClient.d.ts +2 -6
- package/dist/client/ModelContextClient.d.ts.map +1 -1
- package/dist/client/ModelContextClient.js +13 -10
- package/dist/client/ModelContextClient.js.map +1 -1
- package/dist/client/NoOpComposerClient.d.ts +4 -6
- package/dist/client/NoOpComposerClient.d.ts.map +1 -1
- package/dist/client/NoOpComposerClient.js +42 -40
- package/dist/client/NoOpComposerClient.js.map +1 -1
- package/dist/client/ThreadMessageClient.d.ts +2 -6
- package/dist/client/ThreadMessageClient.d.ts.map +1 -1
- package/dist/client/ThreadMessageClient.js +87 -81
- package/dist/client/ThreadMessageClient.js.map +1 -1
- package/dist/client/Tools.d.ts +4 -6
- package/dist/client/Tools.d.ts.map +1 -1
- package/dist/client/Tools.js +33 -31
- package/dist/client/Tools.js.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.js +9 -12
- package/dist/context/providers/AttachmentByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageByIndexProvider.js +7 -22
- package/dist/context/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/context/providers/MessageProvider.d.ts.map +1 -1
- package/dist/context/providers/MessageProvider.js +4 -13
- package/dist/context/providers/MessageProvider.js.map +1 -1
- package/dist/context/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/context/providers/PartByIndexProvider.js +5 -7
- package/dist/context/providers/PartByIndexProvider.js.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/context/providers/TextMessagePartProvider.js +16 -22
- package/dist/context/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadListItemProvider.js +9 -35
- package/dist/context/providers/ThreadListItemProvider.js.map +1 -1
- package/dist/context/react/index.d.ts +0 -4
- package/dist/context/react/index.d.ts.map +1 -1
- package/dist/context/react/index.js +0 -6
- package/dist/context/react/index.js.map +1 -1
- package/dist/devtools/DevToolsHooks.d.ts +3 -3
- package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
- package/dist/devtools/DevToolsHooks.js +5 -5
- package/dist/devtools/DevToolsHooks.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +3 -3
- package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.d.ts +1 -5
- package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/RuntimeAdapter.js +25 -4
- package/dist/legacy-runtime/RuntimeAdapter.js.map +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js +8 -8
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts +6 -6
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js +38 -37
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js +9 -12
- package/dist/legacy-runtime/client/MessagePartRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts +5 -6
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.js +38 -44
- package/dist/legacy-runtime/client/MessageRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js +23 -23
- package/dist/legacy-runtime/client/ThreadListItemRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts +5 -6
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js +30 -31
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts +4 -6
- package/dist/legacy-runtime/client/ThreadRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js +40 -42
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +13 -13
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.d.ts +8 -0
- package/dist/legacy-runtime/cloud/auiV0.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.js +14 -0
- package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
- package/dist/legacy-runtime/hooks/AssistantContext.d.ts +4 -4
- package/dist/legacy-runtime/hooks/AssistantContext.js +4 -4
- package/dist/legacy-runtime/hooks/AssistantContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +14 -14
- package/dist/legacy-runtime/hooks/AttachmentContext.js +5 -5
- package/dist/legacy-runtime/hooks/AttachmentContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ComposerContext.d.ts +10 -10
- package/dist/legacy-runtime/hooks/ComposerContext.js +8 -8
- package/dist/legacy-runtime/hooks/ComposerContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/MessageContext.d.ts +9 -9
- package/dist/legacy-runtime/hooks/MessageContext.js +9 -9
- package/dist/legacy-runtime/hooks/MessageContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/MessagePartContext.d.ts +2 -2
- package/dist/legacy-runtime/hooks/MessagePartContext.js +4 -4
- package/dist/legacy-runtime/hooks/MessagePartContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts +8 -8
- package/dist/legacy-runtime/hooks/ThreadContext.d.ts.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadContext.js +8 -8
- package/dist/legacy-runtime/hooks/ThreadContext.js.map +1 -1
- package/dist/legacy-runtime/hooks/ThreadListItemContext.d.ts +2 -2
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js +5 -5
- package/dist/legacy-runtime/hooks/ThreadListItemContext.js.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.js +3 -3
- package/dist/legacy-runtime/runtime/ThreadListItemRuntime.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 +5 -5
- 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 +15 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js +1 -1
- package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js +2 -2
- package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js +2 -5
- package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +5 -5
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js +7 -2
- package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +5 -5
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
- 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 +9 -8
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +3 -3
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +4 -4
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/model-context/useAssistantInstructions.js +4 -4
- package/dist/model-context/useAssistantInstructions.js.map +1 -1
- package/dist/model-context/useAssistantTool.js +6 -6
- package/dist/model-context/useAssistantTool.js.map +1 -1
- package/dist/model-context/useAssistantToolUI.js +4 -4
- package/dist/model-context/useAssistantToolUI.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +10 -10
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js +5 -5
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js +5 -5
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +5 -5
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +5 -5
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js +5 -5
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarSpeak.js +5 -5
- package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js +5 -5
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
- package/dist/primitives/actionBar/useActionBarFloatStatus.js +2 -2
- package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
- package/dist/primitives/assistantModal/AssistantModalRoot.js +4 -4
- package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
- package/dist/primitives/attachment/AttachmentName.js +2 -2
- package/dist/primitives/attachment/AttachmentName.js.map +1 -1
- package/dist/primitives/attachment/AttachmentRemove.js +4 -4
- 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 +2 -2
- package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js +5 -5
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNumber.js +2 -2
- package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +5 -5
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +6 -6
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachmentDropzone.js +4 -4
- package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAttachments.js +4 -3
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js +5 -5
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerDictate.js +5 -5
- package/dist/primitives/composer/ComposerDictate.js.map +1 -1
- package/dist/primitives/composer/ComposerDictationTranscript.js +2 -2
- package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
- package/dist/primitives/composer/ComposerIf.d.ts +1 -1
- package/dist/primitives/composer/ComposerIf.js +3 -3
- package/dist/primitives/composer/ComposerIf.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +19 -19
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +5 -5
- 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 +6 -5
- package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
- package/dist/primitives/error/ErrorMessage.js +2 -2
- package/dist/primitives/error/ErrorMessage.js.map +1 -1
- package/dist/primitives/index.d.ts +0 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +0 -1
- 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 -3
- package/dist/primitives/message/MessageAttachments.js.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 +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.map +1 -1
- package/dist/primitives/message/MessageParts.js +10 -9
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
- package/dist/primitives/message/MessagePartsGrouped.js +10 -9
- package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
- package/dist/primitives/message/MessageRoot.js +4 -4
- package/dist/primitives/message/MessageRoot.js.map +1 -1
- package/dist/primitives/messagePart/MessagePartInProgress.js +2 -2
- package/dist/primitives/messagePart/MessagePartInProgress.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartData.js +2 -2
- package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartFile.js +2 -2
- package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartImage.js +2 -2
- package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartReasoning.js +2 -2
- package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartSource.js +2 -2
- package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
- package/dist/primitives/messagePart/useMessagePartText.js +2 -2
- package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
- package/dist/primitives/thread/ThreadEmpty.js +2 -2
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadIf.d.ts +1 -1
- package/dist/primitives/thread/ThreadIf.js +3 -3
- 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 +5 -4
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js +10 -10
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/thread/ThreadViewportSlack.js +2 -2
- package/dist/primitives/thread/ThreadViewportSlack.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +4 -4
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js +3 -2
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +4 -4
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +2 -2
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTitle.js +2 -2
- package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +4 -4
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/scopes/attachment.d.ts +22 -0
- package/dist/types/scopes/attachment.d.ts.map +1 -0
- package/dist/types/scopes/attachment.js +2 -0
- package/dist/types/scopes/attachment.js.map +1 -0
- package/dist/{client/types/Composer.d.ts → types/scopes/composer.d.ts} +29 -9
- package/dist/types/scopes/composer.d.ts.map +1 -0
- package/dist/types/scopes/composer.js +2 -0
- package/dist/types/scopes/composer.js.map +1 -0
- package/dist/types/scopes/index.d.ts +10 -0
- package/dist/types/scopes/index.d.ts.map +1 -0
- package/dist/types/scopes/index.js +2 -0
- package/dist/types/scopes/index.js.map +1 -0
- package/dist/{client/types/Message.d.ts → types/scopes/message.d.ts} +35 -27
- package/dist/types/scopes/message.d.ts.map +1 -0
- package/dist/types/scopes/message.js +2 -0
- package/dist/types/scopes/message.js.map +1 -0
- package/dist/types/scopes/modelContext.d.ts +12 -0
- package/dist/types/scopes/modelContext.d.ts.map +1 -0
- package/dist/types/scopes/modelContext.js +2 -0
- package/dist/types/scopes/modelContext.js.map +1 -0
- package/dist/types/scopes/part.d.ts +37 -0
- package/dist/types/scopes/part.d.ts.map +1 -0
- package/dist/types/scopes/part.js +2 -0
- package/dist/types/scopes/part.js.map +1 -0
- package/dist/{client/types/Thread.d.ts → types/scopes/thread.d.ts} +45 -25
- package/dist/types/scopes/thread.d.ts.map +1 -0
- package/dist/types/scopes/thread.js +2 -0
- package/dist/types/scopes/thread.js.map +1 -0
- package/dist/types/scopes/threadListItem.d.ts +50 -0
- package/dist/types/scopes/threadListItem.d.ts.map +1 -0
- package/dist/types/scopes/threadListItem.js +2 -0
- package/dist/types/scopes/threadListItem.js.map +1 -0
- package/dist/types/scopes/threads.d.ts +28 -0
- package/dist/types/scopes/threads.d.ts.map +1 -0
- package/dist/types/scopes/threads.js +2 -0
- package/dist/types/scopes/threads.js.map +1 -0
- package/dist/types/scopes/tools.d.ts +14 -0
- package/dist/types/scopes/tools.d.ts.map +1 -0
- package/dist/types/scopes/tools.js +2 -0
- package/dist/types/scopes/tools.js.map +1 -0
- package/dist/types/store-augmentation.d.ts +24 -0
- package/dist/types/store-augmentation.d.ts.map +1 -0
- package/dist/types/store-augmentation.js +2 -0
- package/dist/types/store-augmentation.js.map +1 -0
- package/dist/utils/smooth/SmoothContext.js +3 -3
- package/dist/utils/smooth/SmoothContext.js.map +1 -1
- package/dist/utils/smooth/useSmooth.js +2 -2
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.js +2 -2
- package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
- package/package.json +3 -2
- package/src/client/ModelContextClient.ts +19 -12
- package/src/client/NoOpComposerClient.tsx +45 -42
- package/src/client/ThreadMessageClient.tsx +99 -86
- package/src/client/Tools.ts +73 -62
- package/src/context/providers/AttachmentByIndexProvider.tsx +9 -17
- package/src/context/providers/MessageByIndexProvider.tsx +7 -32
- package/src/context/providers/MessageProvider.tsx +4 -16
- package/src/context/providers/PartByIndexProvider.tsx +5 -11
- package/src/context/providers/TextMessagePartProvider.tsx +24 -32
- package/src/context/providers/ThreadListItemProvider.tsx +9 -45
- package/src/context/react/index.ts +0 -13
- package/src/devtools/DevToolsHooks.ts +7 -7
- package/src/index.ts +42 -0
- package/src/legacy-runtime/AssistantRuntimeProvider.tsx +4 -7
- package/src/legacy-runtime/RuntimeAdapter.ts +32 -4
- package/src/legacy-runtime/client/AttachmentRuntimeClient.ts +7 -9
- package/src/legacy-runtime/client/ComposerRuntimeClient.ts +54 -50
- package/src/legacy-runtime/client/MessagePartRuntimeClient.ts +12 -17
- package/src/legacy-runtime/client/MessageRuntimeClient.ts +40 -34
- package/src/legacy-runtime/client/ThreadListItemRuntimeClient.ts +17 -17
- package/src/legacy-runtime/client/ThreadListRuntimeClient.ts +47 -42
- package/src/legacy-runtime/client/ThreadRuntimeClient.ts +52 -49
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.tsx +13 -16
- package/src/legacy-runtime/cloud/auiV0.ts +27 -1
- package/src/legacy-runtime/hooks/AssistantContext.ts +7 -7
- package/src/legacy-runtime/hooks/AttachmentContext.ts +7 -7
- package/src/legacy-runtime/hooks/ComposerContext.ts +15 -15
- package/src/legacy-runtime/hooks/MessageContext.ts +14 -14
- package/src/legacy-runtime/hooks/MessagePartContext.ts +6 -6
- package/src/legacy-runtime/hooks/ThreadContext.ts +13 -17
- package/src/legacy-runtime/hooks/ThreadListItemContext.ts +7 -7
- package/src/legacy-runtime/runtime/ThreadListItemRuntime.ts +4 -4
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.tsx +5 -7
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +17 -1
- package/src/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.tsx +1 -1
- package/src/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.tsx +3 -3
- package/src/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.tsx +2 -2
- package/src/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.tsx +4 -6
- package/src/legacy-runtime/runtime-cores/external-store/createMessageConverter.tsx +5 -5
- package/src/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.tsx +6 -2
- package/src/legacy-runtime/runtime-cores/local/useLocalRuntime.tsx +11 -14
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +9 -8
- package/src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.tsx +3 -3
- package/src/model-context/makeAssistantVisible.tsx +4 -4
- package/src/model-context/useAssistantInstructions.tsx +4 -4
- package/src/model-context/useAssistantTool.tsx +6 -6
- package/src/model-context/useAssistantToolUI.tsx +4 -4
- package/src/primitives/actionBar/ActionBarCopy.tsx +10 -10
- package/src/primitives/actionBar/ActionBarEdit.tsx +5 -5
- package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +5 -5
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +5 -5
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +5 -5
- package/src/primitives/actionBar/ActionBarReload.tsx +5 -5
- package/src/primitives/actionBar/ActionBarSpeak.tsx +5 -5
- package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +5 -5
- package/src/primitives/actionBar/useActionBarFloatStatus.tsx +2 -2
- package/src/primitives/assistantModal/AssistantModalRoot.tsx +4 -4
- package/src/primitives/attachment/AttachmentName.tsx +2 -2
- package/src/primitives/attachment/AttachmentRemove.tsx +4 -4
- package/src/primitives/attachment/AttachmentThumb.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerCount.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerNext.tsx +5 -5
- package/src/primitives/branchPicker/BranchPickerNumber.tsx +2 -2
- package/src/primitives/branchPicker/BranchPickerPrevious.tsx +5 -5
- package/src/primitives/composer/ComposerAddAttachment.tsx +6 -6
- package/src/primitives/composer/ComposerAttachmentDropzone.tsx +4 -4
- package/src/primitives/composer/ComposerAttachments.tsx +4 -8
- package/src/primitives/composer/ComposerCancel.tsx +5 -5
- package/src/primitives/composer/ComposerDictate.tsx +5 -5
- package/src/primitives/composer/ComposerDictationTranscript.tsx +2 -2
- package/src/primitives/composer/ComposerIf.tsx +3 -3
- package/src/primitives/composer/ComposerInput.tsx +19 -19
- package/src/primitives/composer/ComposerSend.tsx +5 -5
- package/src/primitives/composer/ComposerStopDictation.tsx +6 -7
- package/src/primitives/error/ErrorMessage.tsx +2 -2
- package/src/primitives/index.ts +0 -2
- package/src/primitives/message/MessageAttachments.tsx +4 -6
- package/src/primitives/message/MessageError.tsx +2 -2
- package/src/primitives/message/MessageIf.tsx +3 -3
- package/src/primitives/message/MessageParts.tsx +10 -13
- package/src/primitives/message/MessagePartsGrouped.tsx +10 -13
- package/src/primitives/message/MessageRoot.tsx +4 -4
- package/src/primitives/messagePart/MessagePartInProgress.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartData.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartFile.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartImage.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartReasoning.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartSource.tsx +2 -2
- package/src/primitives/messagePart/useMessagePartText.tsx +2 -2
- package/src/primitives/thread/ThreadEmpty.tsx +2 -2
- package/src/primitives/thread/ThreadIf.tsx +3 -3
- package/src/primitives/thread/ThreadMessages.tsx +5 -8
- package/src/primitives/thread/ThreadSuggestion.tsx +10 -10
- package/src/primitives/thread/ThreadViewportSlack.tsx +2 -2
- package/src/primitives/thread/useThreadViewportAutoScroll.tsx +4 -4
- package/src/primitives/threadList/ThreadListItems.tsx +3 -5
- package/src/primitives/threadList/ThreadListNew.tsx +4 -4
- package/src/primitives/threadListItem/ThreadListItemArchive.ts +4 -4
- package/src/primitives/threadListItem/ThreadListItemDelete.ts +4 -4
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +2 -2
- package/src/primitives/threadListItem/ThreadListItemTitle.tsx +2 -2
- package/src/primitives/threadListItem/ThreadListItemTrigger.ts +4 -4
- package/src/primitives/threadListItem/ThreadListItemUnarchive.ts +4 -4
- package/src/types/index.ts +0 -8
- package/src/types/scopes/attachment.ts +22 -0
- package/src/{client/types/Composer.ts → types/scopes/composer.ts} +26 -9
- package/src/types/scopes/index.ts +50 -0
- package/src/{client/types/Message.ts → types/scopes/message.ts} +30 -38
- package/src/types/scopes/modelContext.ts +14 -0
- package/src/{client/types/Part.ts → types/scopes/part.ts} +21 -14
- package/src/{client/types/Thread.ts → types/scopes/thread.ts} +44 -53
- package/src/types/scopes/threadListItem.ts +44 -0
- package/src/{client/types/ThreadList.ts → types/scopes/threads.ts} +17 -17
- package/src/types/scopes/tools.ts +19 -0
- package/src/types/store-augmentation.ts +25 -0
- package/src/utils/smooth/SmoothContext.tsx +3 -3
- package/src/utils/smooth/useSmooth.tsx +2 -2
- package/src/utils/useToolArgsFieldStatus.tsx +2 -2
- package/dist/client/AssistantClient.d.ts +0 -21
- package/dist/client/AssistantClient.d.ts.map +0 -1
- package/dist/client/AssistantClient.js +0 -96
- package/dist/client/AssistantClient.js.map +0 -1
- package/dist/client/EventContext.d.ts +0 -4
- package/dist/client/EventContext.d.ts.map +0 -1
- package/dist/client/EventContext.js +0 -12
- package/dist/client/EventContext.js.map +0 -1
- package/dist/client/ModelContext.d.ts +0 -8
- package/dist/client/ModelContext.d.ts.map +0 -1
- package/dist/client/ModelContext.js +0 -12
- package/dist/client/ModelContext.js.map +0 -1
- package/dist/client/types/Attachment.d.ts +0 -7
- package/dist/client/types/Attachment.d.ts.map +0 -1
- package/dist/client/types/Attachment.js +0 -2
- package/dist/client/types/Attachment.js.map +0 -1
- package/dist/client/types/Composer.d.ts.map +0 -1
- package/dist/client/types/Composer.js +0 -2
- package/dist/client/types/Composer.js.map +0 -1
- package/dist/client/types/Message.d.ts.map +0 -1
- package/dist/client/types/Message.js +0 -2
- package/dist/client/types/Message.js.map +0 -1
- package/dist/client/types/ModelContext.d.ts +0 -12
- package/dist/client/types/ModelContext.d.ts.map +0 -1
- package/dist/client/types/ModelContext.js +0 -2
- package/dist/client/types/ModelContext.js.map +0 -1
- package/dist/client/types/Part.d.ts +0 -22
- package/dist/client/types/Part.d.ts.map +0 -1
- package/dist/client/types/Part.js +0 -2
- package/dist/client/types/Part.js.map +0 -1
- package/dist/client/types/Thread.d.ts.map +0 -1
- package/dist/client/types/Thread.js +0 -2
- package/dist/client/types/Thread.js.map +0 -1
- package/dist/client/types/ThreadList.d.ts +0 -24
- package/dist/client/types/ThreadList.d.ts.map +0 -1
- package/dist/client/types/ThreadList.js +0 -2
- package/dist/client/types/ThreadList.js.map +0 -1
- package/dist/client/types/ThreadListItem.d.ts +0 -23
- package/dist/client/types/ThreadListItem.d.ts.map +0 -1
- package/dist/client/types/ThreadListItem.js +0 -2
- package/dist/client/types/ThreadListItem.js.map +0 -1
- package/dist/client/types/Tools.d.ts +0 -13
- package/dist/client/types/Tools.d.ts.map +0 -1
- package/dist/client/types/Tools.js +0 -2
- package/dist/client/types/Tools.js.map +0 -1
- package/dist/client/util-hooks/tapLookupResources.d.ts +0 -15
- package/dist/client/util-hooks/tapLookupResources.d.ts.map +0 -1
- package/dist/client/util-hooks/tapLookupResources.js +0 -26
- package/dist/client/util-hooks/tapLookupResources.js.map +0 -1
- package/dist/context/react/AssistantApiContext.d.ts +0 -138
- package/dist/context/react/AssistantApiContext.d.ts.map +0 -1
- package/dist/context/react/AssistantApiContext.js +0 -158
- package/dist/context/react/AssistantApiContext.js.map +0 -1
- package/dist/context/react/hooks/useAssistantEvent.d.ts +0 -3
- package/dist/context/react/hooks/useAssistantEvent.d.ts.map +0 -1
- package/dist/context/react/hooks/useAssistantEvent.js +0 -13
- package/dist/context/react/hooks/useAssistantEvent.js.map +0 -1
- package/dist/context/react/hooks/useAssistantState.d.ts +0 -3
- package/dist/context/react/hooks/useAssistantState.d.ts.map +0 -1
- package/dist/context/react/hooks/useAssistantState.js +0 -42
- package/dist/context/react/hooks/useAssistantState.js.map +0 -1
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.d.ts +0 -11
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.d.ts.map +0 -1
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.js +0 -44
- package/dist/legacy-runtime/client/EventManagerRuntimeClient.js.map +0 -1
- package/dist/primitives/assistant/AssistantIf.d.ts +0 -12
- package/dist/primitives/assistant/AssistantIf.d.ts.map +0 -1
- package/dist/primitives/assistant/AssistantIf.js +0 -11
- package/dist/primitives/assistant/AssistantIf.js.map +0 -1
- package/dist/types/EventTypes.d.ts +0 -57
- package/dist/types/EventTypes.d.ts.map +0 -1
- package/dist/types/EventTypes.js +0 -17
- package/dist/types/EventTypes.js.map +0 -1
- package/dist/utils/tap-store/derived-scopes.d.ts +0 -75
- package/dist/utils/tap-store/derived-scopes.d.ts.map +0 -1
- package/dist/utils/tap-store/derived-scopes.js +0 -56
- package/dist/utils/tap-store/derived-scopes.js.map +0 -1
- package/dist/utils/tap-store/index.d.ts +0 -4
- package/dist/utils/tap-store/index.d.ts.map +0 -1
- package/dist/utils/tap-store/index.js +0 -4
- package/dist/utils/tap-store/index.js.map +0 -1
- package/dist/utils/tap-store/store.d.ts +0 -14
- package/dist/utils/tap-store/store.d.ts.map +0 -1
- package/dist/utils/tap-store/store.js +0 -9
- package/dist/utils/tap-store/store.js.map +0 -1
- package/dist/utils/tap-store/tap-api.d.ts +0 -13
- package/dist/utils/tap-store/tap-api.d.ts.map +0 -1
- package/dist/utils/tap-store/tap-api.js +0 -49
- package/dist/utils/tap-store/tap-api.js.map +0 -1
- package/src/client/AssistantClient.ts +0 -175
- package/src/client/EventContext.ts +0 -22
- package/src/client/ModelContext.ts +0 -28
- package/src/client/types/Attachment.ts +0 -13
- package/src/client/types/ModelContext.ts +0 -14
- package/src/client/types/ThreadListItem.ts +0 -26
- package/src/client/types/Tools.ts +0 -19
- package/src/client/util-hooks/tapLookupResources.ts +0 -45
- package/src/context/react/AssistantApiContext.tsx +0 -340
- package/src/context/react/hooks/useAssistantEvent.ts +0 -25
- package/src/context/react/hooks/useAssistantState.tsx +0 -65
- package/src/legacy-runtime/client/EventManagerRuntimeClient.ts +0 -81
- package/src/primitives/assistant/AssistantIf.tsx +0 -25
- package/src/types/EventTypes.ts +0 -103
- package/src/utils/tap-store/derived-scopes.ts +0 -175
- package/src/utils/tap-store/index.ts +0 -10
- package/src/utils/tap-store/store.ts +0 -35
- package/src/utils/tap-store/tap-api.ts +0 -70
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { MessageRuntime } from "../../legacy-runtime/runtime";
|
|
4
|
-
import {
|
|
1
|
+
import type { ThreadMessage } from "../AssistantTypes";
|
|
2
|
+
import type {
|
|
5
3
|
SpeechState,
|
|
6
4
|
SubmittedFeedback,
|
|
7
5
|
} from "../../legacy-runtime/runtime-cores/core/ThreadRuntimeCore";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import type { RunConfig } from "../AssistantTypes";
|
|
7
|
+
import type { MessageRuntime } from "../../legacy-runtime/runtime";
|
|
8
|
+
import type { ComposerMethods, ComposerState } from "./composer";
|
|
9
|
+
import type { PartMethods, PartState } from "./part";
|
|
10
|
+
import type { AttachmentMethods } from "./attachment";
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type MessageState = ThreadMessage & {
|
|
13
13
|
readonly parentId: string | null;
|
|
14
14
|
readonly isLast: boolean;
|
|
15
|
-
|
|
16
15
|
readonly branchNumber: number;
|
|
17
16
|
readonly branchCount: number;
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
|
-
* @deprecated
|
|
18
|
+
* @deprecated This API is still under active development and might change without notice.
|
|
21
19
|
*
|
|
22
20
|
* To enable text-to-speech, provide a `SpeechSynthesisAdapter` to the runtime.
|
|
23
21
|
*
|
|
@@ -31,40 +29,28 @@ export type MessageClientState = ThreadMessage & {
|
|
|
31
29
|
* speech: new WebSpeechSynthesisAdapter(),
|
|
32
30
|
* },
|
|
33
31
|
* });
|
|
34
|
-
* ```
|
|
35
32
|
*/
|
|
36
33
|
readonly speech: SpeechState | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated Use `message.metadata.submittedFeedback` instead. This will be removed in 0.12.0.
|
|
39
|
-
*/
|
|
34
|
+
/** @deprecated Use `message.metadata.submittedFeedback` instead. This will be removed in 0.12.0. */
|
|
40
35
|
readonly submittedFeedback: SubmittedFeedback | undefined;
|
|
41
|
-
|
|
42
|
-
readonly
|
|
43
|
-
readonly parts: readonly MessagePartClientState[];
|
|
44
|
-
|
|
36
|
+
readonly composer: ComposerState;
|
|
37
|
+
readonly parts: readonly PartState[];
|
|
45
38
|
readonly isCopied: boolean;
|
|
46
39
|
readonly isHovering: boolean;
|
|
47
|
-
|
|
48
40
|
/** The position of this message in the thread (0 for first message) */
|
|
49
41
|
readonly index: number;
|
|
50
42
|
};
|
|
51
43
|
|
|
52
|
-
export type
|
|
44
|
+
export type MessageMethods = {
|
|
53
45
|
/**
|
|
54
46
|
* Get the current state of the message.
|
|
55
47
|
*/
|
|
56
|
-
getState():
|
|
57
|
-
|
|
58
|
-
readonly composer: ComposerClientApi;
|
|
59
|
-
|
|
48
|
+
getState(): MessageState;
|
|
49
|
+
composer: ComposerMethods;
|
|
60
50
|
reload(config?: { runConfig?: RunConfig }): void;
|
|
61
|
-
/**
|
|
62
|
-
* @deprecated The `speak()` method is deprecated. Use the `ActionBarPrimitive.Speak` component instead.
|
|
63
|
-
*/
|
|
51
|
+
/** @deprecated This API is still under active development and might change without notice. */
|
|
64
52
|
speak(): void;
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated The `stopSpeaking()` method is deprecated. Use the `ActionBarPrimitive.StopSpeaking` component instead.
|
|
67
|
-
*/
|
|
53
|
+
/** @deprecated This API is still under active development and might change without notice. */
|
|
68
54
|
stopSpeaking(): void;
|
|
69
55
|
submitFeedback(feedback: { type: "positive" | "negative" }): void;
|
|
70
56
|
switchToBranch(options: {
|
|
@@ -72,15 +58,21 @@ export type MessageClientApi = {
|
|
|
72
58
|
branchId?: string;
|
|
73
59
|
}): void;
|
|
74
60
|
getCopyText(): string;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
selector: { index: number } | { toolCallId: string },
|
|
78
|
-
) => MessagePartClientApi;
|
|
79
|
-
attachment(selector: { index: number } | { id: string }): AttachmentClientApi;
|
|
80
|
-
|
|
61
|
+
part(selector: { index: number } | { toolCallId: string }): PartMethods;
|
|
62
|
+
attachment(selector: { index: number } | { id: string }): AttachmentMethods;
|
|
81
63
|
setIsCopied(value: boolean): void;
|
|
82
64
|
setIsHovering(value: boolean): void;
|
|
83
|
-
|
|
84
65
|
/** @internal */
|
|
85
66
|
__internal_getRuntime?(): MessageRuntime;
|
|
86
67
|
};
|
|
68
|
+
|
|
69
|
+
export type MessageMeta = {
|
|
70
|
+
source: "thread";
|
|
71
|
+
query: { type: "id"; id: string } | { type: "index"; index: number };
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type MessageClientSchema = {
|
|
75
|
+
state: MessageState;
|
|
76
|
+
methods: MessageMethods;
|
|
77
|
+
meta: MessageMeta;
|
|
78
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Unsubscribe } from "../Unsubscribe";
|
|
2
|
+
import type { ModelContextProvider } from "../../model-context/ModelContextTypes";
|
|
3
|
+
|
|
4
|
+
export type ModelContextState = Record<string, never>;
|
|
5
|
+
|
|
6
|
+
export type ModelContextMethods = ModelContextProvider & {
|
|
7
|
+
getState(): ModelContextState;
|
|
8
|
+
register: (provider: ModelContextProvider) => Unsubscribe;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type ModelContextClientSchema = {
|
|
12
|
+
state: ModelContextState;
|
|
13
|
+
methods: ModelContextMethods;
|
|
14
|
+
};
|
|
@@ -1,37 +1,44 @@
|
|
|
1
|
-
import { ToolResponse } from "assistant-stream";
|
|
2
|
-
import { MessagePartRuntime } from "../../legacy-runtime/runtime";
|
|
3
|
-
import {
|
|
1
|
+
import type { ToolResponse } from "assistant-stream";
|
|
2
|
+
import type { MessagePartRuntime } from "../../legacy-runtime/runtime";
|
|
3
|
+
import type {
|
|
4
4
|
ThreadUserMessagePart,
|
|
5
5
|
ThreadAssistantMessagePart,
|
|
6
6
|
MessagePartStatus,
|
|
7
7
|
ToolCallMessagePartStatus,
|
|
8
|
-
} from "
|
|
8
|
+
} from "../AssistantTypes";
|
|
9
9
|
|
|
10
|
-
export type
|
|
11
|
-
| ThreadUserMessagePart
|
|
12
|
-
| ThreadAssistantMessagePart
|
|
13
|
-
) & {
|
|
10
|
+
export type PartState = (ThreadUserMessagePart | ThreadAssistantMessagePart) & {
|
|
14
11
|
readonly status: MessagePartStatus | ToolCallMessagePartStatus;
|
|
15
12
|
};
|
|
16
13
|
|
|
17
|
-
export type
|
|
14
|
+
export type PartMethods = {
|
|
18
15
|
/**
|
|
19
16
|
* Get the current state of the message part.
|
|
20
17
|
*/
|
|
21
|
-
getState():
|
|
22
|
-
|
|
18
|
+
getState(): PartState;
|
|
23
19
|
/**
|
|
24
20
|
* Add tool result to a tool call message part that has no tool result yet.
|
|
25
21
|
* This is useful when you are collecting a tool result via user input ("human tool calls").
|
|
26
22
|
*/
|
|
27
|
-
addToolResult(result:
|
|
28
|
-
|
|
23
|
+
addToolResult(result: unknown | ToolResponse<unknown>): void;
|
|
29
24
|
/**
|
|
30
25
|
* Resume a tool call that is waiting for human input with a payload.
|
|
31
26
|
* This is useful when a tool has requested human input and is waiting for a response.
|
|
32
27
|
*/
|
|
33
28
|
resumeToolCall(payload: unknown): void;
|
|
34
|
-
|
|
35
29
|
/** @internal */
|
|
36
30
|
__internal_getRuntime?(): MessagePartRuntime;
|
|
37
31
|
};
|
|
32
|
+
|
|
33
|
+
export type PartMeta = {
|
|
34
|
+
source: "message";
|
|
35
|
+
query:
|
|
36
|
+
| { type: "index"; index: number }
|
|
37
|
+
| { type: "toolCallId"; toolCallId: string };
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type PartClientSchema = {
|
|
41
|
+
state: PartState;
|
|
42
|
+
methods: PartMethods;
|
|
43
|
+
meta: PartMeta;
|
|
44
|
+
};
|
|
@@ -1,90 +1,75 @@
|
|
|
1
|
-
import { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ThreadRuntime,
|
|
8
|
-
} from "../../legacy-runtime/runtime";
|
|
9
|
-
import {
|
|
1
|
+
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
2
|
+
import type {
|
|
3
|
+
RuntimeCapabilities,
|
|
4
|
+
SpeechState,
|
|
5
|
+
} from "../../legacy-runtime/runtime-cores/core/ThreadRuntimeCore";
|
|
6
|
+
import type {
|
|
10
7
|
ThreadSuggestion,
|
|
11
8
|
ExportedMessageRepository,
|
|
12
9
|
ThreadMessageLike,
|
|
13
10
|
} from "../../legacy-runtime/runtime-cores";
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import {
|
|
11
|
+
import type {
|
|
12
|
+
CreateAppendMessage,
|
|
13
|
+
CreateStartRunConfig,
|
|
14
|
+
ThreadRuntime,
|
|
15
|
+
} from "../../legacy-runtime/runtime";
|
|
16
|
+
import type { CreateResumeRunConfig } from "../../legacy-runtime/runtime/ThreadRuntime";
|
|
17
|
+
import type { ModelContext } from "../../model-context";
|
|
18
|
+
import type { MessageMethods, MessageState } from "./message";
|
|
19
|
+
import type { ComposerMethods, ComposerState } from "./composer";
|
|
20
20
|
|
|
21
|
-
export type
|
|
21
|
+
export type ThreadState = {
|
|
22
22
|
/**
|
|
23
23
|
* Whether the thread is empty. A thread is considered empty when it has no messages and is not loading.
|
|
24
24
|
*/
|
|
25
25
|
readonly isEmpty: boolean;
|
|
26
|
-
|
|
27
26
|
/**
|
|
28
27
|
* Whether the thread is disabled. Disabled threads cannot receive new messages.
|
|
29
28
|
*/
|
|
30
29
|
readonly isDisabled: boolean;
|
|
31
|
-
|
|
32
30
|
/**
|
|
33
31
|
* Whether the thread is loading its history.
|
|
34
32
|
*/
|
|
35
33
|
readonly isLoading: boolean;
|
|
36
|
-
|
|
37
34
|
/**
|
|
38
35
|
* Whether the thread is running. A thread is considered running when there is an active stream connection to the backend.
|
|
39
36
|
*/
|
|
40
37
|
readonly isRunning: boolean;
|
|
41
|
-
|
|
42
38
|
/**
|
|
43
39
|
* The capabilities of the thread, such as whether the thread supports editing, branch switching, etc.
|
|
44
40
|
*/
|
|
45
41
|
readonly capabilities: RuntimeCapabilities;
|
|
46
|
-
|
|
47
42
|
/**
|
|
48
43
|
* The messages in the currently selected branch of the thread.
|
|
49
44
|
*/
|
|
50
|
-
readonly messages: readonly
|
|
51
|
-
|
|
45
|
+
readonly messages: readonly MessageState[];
|
|
52
46
|
/**
|
|
53
47
|
* The thread state.
|
|
54
|
-
*
|
|
55
48
|
* @deprecated This feature is experimental
|
|
56
49
|
*/
|
|
57
50
|
readonly state: ReadonlyJSONValue;
|
|
58
|
-
|
|
59
51
|
/**
|
|
60
52
|
* Follow up message suggestions to show the user.
|
|
61
53
|
*/
|
|
62
54
|
readonly suggestions: readonly ThreadSuggestion[];
|
|
63
|
-
|
|
64
55
|
/**
|
|
65
56
|
* Custom extra information provided by the runtime.
|
|
66
57
|
*/
|
|
67
58
|
readonly extras: unknown;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @deprecated This API is still under active development and might change without notice.
|
|
71
|
-
*/
|
|
59
|
+
/** @deprecated This API is still under active development and might change without notice. */
|
|
72
60
|
readonly speech: SpeechState | undefined;
|
|
73
|
-
|
|
74
|
-
readonly composer: ComposerClientState;
|
|
61
|
+
readonly composer: ComposerState;
|
|
75
62
|
};
|
|
76
63
|
|
|
77
|
-
export type
|
|
64
|
+
export type ThreadMethods = {
|
|
78
65
|
/**
|
|
79
66
|
* Get the current state of the thread.
|
|
80
67
|
*/
|
|
81
|
-
getState():
|
|
82
|
-
|
|
68
|
+
getState(): ThreadState;
|
|
83
69
|
/**
|
|
84
70
|
* The thread composer runtime.
|
|
85
71
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
composer: ComposerMethods;
|
|
88
73
|
/**
|
|
89
74
|
* Append a new message to the thread.
|
|
90
75
|
*
|
|
@@ -102,49 +87,55 @@ export type ThreadClientApi = {
|
|
|
102
87
|
* ```
|
|
103
88
|
*/
|
|
104
89
|
append(message: CreateAppendMessage): void;
|
|
105
|
-
|
|
106
90
|
/**
|
|
107
91
|
* Start a new run with the given configuration.
|
|
108
92
|
* @param config The configuration for starting the run
|
|
109
93
|
*/
|
|
110
94
|
startRun(config: CreateStartRunConfig): void;
|
|
111
|
-
|
|
112
95
|
/**
|
|
113
96
|
* Resume a run with the given configuration.
|
|
114
97
|
* @param config The configuration for resuming the run
|
|
115
|
-
|
|
98
|
+
*/
|
|
116
99
|
unstable_resumeRun(config: CreateResumeRunConfig): void;
|
|
117
|
-
|
|
118
100
|
cancelRun(): void;
|
|
119
101
|
getModelContext(): ModelContext;
|
|
120
|
-
|
|
121
102
|
export(): ExportedMessageRepository;
|
|
122
103
|
import(repository: ExportedMessageRepository): void;
|
|
123
|
-
|
|
124
104
|
/**
|
|
125
105
|
* Reset the thread with optional initial messages.
|
|
126
|
-
*
|
|
127
106
|
* @param initialMessages - Optional array of initial messages to populate the thread
|
|
128
107
|
*/
|
|
129
108
|
reset(initialMessages?: readonly ThreadMessageLike[]): void;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @deprecated This API is still under active development and might change without notice.
|
|
135
|
-
*/
|
|
109
|
+
message(selector: { id: string } | { index: number }): MessageMethods;
|
|
110
|
+
/** @deprecated This API is still under active development and might change without notice. */
|
|
136
111
|
stopSpeaking(): void;
|
|
137
|
-
|
|
138
112
|
/**
|
|
139
113
|
* Start the voice session for the thread. Establishes any necessary media connections.
|
|
140
114
|
*/
|
|
141
115
|
startVoice(): Promise<void>;
|
|
142
|
-
|
|
143
116
|
/**
|
|
144
117
|
* Stop the currently active voice session.
|
|
145
118
|
*/
|
|
146
119
|
stopVoice(): Promise<void>;
|
|
147
|
-
|
|
148
120
|
/** @internal */
|
|
149
121
|
__internal_getRuntime?(): ThreadRuntime;
|
|
150
122
|
};
|
|
123
|
+
|
|
124
|
+
export type ThreadMeta = {
|
|
125
|
+
source: "threads";
|
|
126
|
+
query: { type: "main" };
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type ThreadEvents = {
|
|
130
|
+
"thread.runStart": { threadId: string };
|
|
131
|
+
"thread.runEnd": { threadId: string };
|
|
132
|
+
"thread.initialize": { threadId: string };
|
|
133
|
+
"thread.modelContextUpdate": { threadId: string };
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export type ThreadClientSchema = {
|
|
137
|
+
state: ThreadState;
|
|
138
|
+
methods: ThreadMethods;
|
|
139
|
+
meta: ThreadMeta;
|
|
140
|
+
events: ThreadEvents;
|
|
141
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ThreadListItemRuntime } from "../../legacy-runtime/runtime";
|
|
2
|
+
import type { ThreadListItemStatus } from "../../legacy-runtime/runtime/ThreadListItemRuntime";
|
|
3
|
+
|
|
4
|
+
export type ThreadListItemState = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly remoteId: string | undefined;
|
|
7
|
+
readonly externalId: string | undefined;
|
|
8
|
+
readonly title?: string | undefined;
|
|
9
|
+
readonly status: ThreadListItemStatus;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ThreadListItemMethods = {
|
|
13
|
+
getState(): ThreadListItemState;
|
|
14
|
+
switchTo(): void;
|
|
15
|
+
rename(newTitle: string): void;
|
|
16
|
+
archive(): void;
|
|
17
|
+
unarchive(): void;
|
|
18
|
+
delete(): void;
|
|
19
|
+
generateTitle(): void;
|
|
20
|
+
initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;
|
|
21
|
+
detach(): void;
|
|
22
|
+
/** @internal */
|
|
23
|
+
__internal_getRuntime?(): ThreadListItemRuntime;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ThreadListItemMeta = {
|
|
27
|
+
source: "threads";
|
|
28
|
+
query:
|
|
29
|
+
| { type: "main" }
|
|
30
|
+
| { type: "id"; id: string }
|
|
31
|
+
| { type: "index"; index: number; archived?: boolean };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type ThreadListItemEvents = {
|
|
35
|
+
"threadListItem.switchedTo": { threadId: string };
|
|
36
|
+
"threadListItem.switchedAway": { threadId: string };
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type ThreadListItemClientSchema = {
|
|
40
|
+
state: ThreadListItemState;
|
|
41
|
+
methods: ThreadListItemMethods;
|
|
42
|
+
meta: ThreadListItemMeta;
|
|
43
|
+
events: ThreadListItemEvents;
|
|
44
|
+
};
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ThreadListItemClientState,
|
|
3
|
-
ThreadListItemClientApi,
|
|
4
|
-
} from "./ThreadListItem";
|
|
5
|
-
import { ThreadClientApi, ThreadClientState } from "./Thread";
|
|
6
1
|
import type { AssistantRuntime } from "../../legacy-runtime/runtime/AssistantRuntime";
|
|
2
|
+
import type {
|
|
3
|
+
ThreadListItemMethods,
|
|
4
|
+
ThreadListItemState,
|
|
5
|
+
} from "./threadListItem";
|
|
6
|
+
import type { ThreadMethods, ThreadState } from "./thread";
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type ThreadsState = {
|
|
9
9
|
readonly mainThreadId: string;
|
|
10
10
|
readonly newThreadId: string | null;
|
|
11
11
|
readonly isLoading: boolean;
|
|
12
12
|
readonly threadIds: readonly string[];
|
|
13
13
|
readonly archivedThreadIds: readonly string[];
|
|
14
|
-
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
readonly main: ThreadClientState;
|
|
14
|
+
readonly threadItems: readonly ThreadListItemState[];
|
|
15
|
+
readonly main: ThreadState;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
export type
|
|
21
|
-
getState():
|
|
22
|
-
|
|
18
|
+
export type ThreadsMethods = {
|
|
19
|
+
getState(): ThreadsState;
|
|
23
20
|
switchToThread(threadId: string): void;
|
|
24
21
|
switchToNewThread(): void;
|
|
25
22
|
item(
|
|
@@ -27,10 +24,13 @@ export type ThreadListClientApi = {
|
|
|
27
24
|
| "main"
|
|
28
25
|
| { id: string }
|
|
29
26
|
| { index: number; archived?: boolean },
|
|
30
|
-
):
|
|
31
|
-
|
|
32
|
-
thread(selector: "main"): ThreadClientApi;
|
|
33
|
-
|
|
27
|
+
): ThreadListItemMethods;
|
|
28
|
+
thread(selector: "main"): ThreadMethods;
|
|
34
29
|
/** @internal */
|
|
35
30
|
__internal_getAssistantRuntime?(): AssistantRuntime;
|
|
36
31
|
};
|
|
32
|
+
|
|
33
|
+
export type ThreadsClientSchema = {
|
|
34
|
+
state: ThreadsState;
|
|
35
|
+
methods: ThreadsMethods;
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToolCallMessagePartComponent } from "../MessagePartComponentTypes";
|
|
2
|
+
import type { Unsubscribe } from "../Unsubscribe";
|
|
3
|
+
|
|
4
|
+
export type ToolsState = {
|
|
5
|
+
tools: Record<string, ToolCallMessagePartComponent[]>;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ToolsMethods = {
|
|
9
|
+
getState(): ToolsState;
|
|
10
|
+
setToolUI(
|
|
11
|
+
toolName: string,
|
|
12
|
+
render: ToolCallMessagePartComponent,
|
|
13
|
+
): Unsubscribe;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type ToolsClientSchema = {
|
|
17
|
+
state: ToolsState;
|
|
18
|
+
methods: ToolsMethods;
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "@assistant-ui/store";
|
|
2
|
+
|
|
3
|
+
import type { ThreadsClientSchema } from "./scopes/threads";
|
|
4
|
+
import type { ThreadListItemClientSchema } from "./scopes/threadListItem";
|
|
5
|
+
import type { ThreadClientSchema } from "./scopes/thread";
|
|
6
|
+
import type { MessageClientSchema } from "./scopes/message";
|
|
7
|
+
import type { PartClientSchema } from "./scopes/part";
|
|
8
|
+
import type { ComposerClientSchema } from "./scopes/composer";
|
|
9
|
+
import type { AttachmentClientSchema } from "./scopes/attachment";
|
|
10
|
+
import type { ToolsClientSchema } from "./scopes/tools";
|
|
11
|
+
import type { ModelContextClientSchema } from "./scopes/modelContext";
|
|
12
|
+
|
|
13
|
+
declare module "@assistant-ui/store" {
|
|
14
|
+
interface ClientRegistry {
|
|
15
|
+
threads: ThreadsClientSchema;
|
|
16
|
+
threadListItem: ThreadListItemClientSchema;
|
|
17
|
+
thread: ThreadClientSchema;
|
|
18
|
+
message: MessageClientSchema;
|
|
19
|
+
part: PartClientSchema;
|
|
20
|
+
composer: ComposerClientSchema;
|
|
21
|
+
attachment: AttachmentClientSchema;
|
|
22
|
+
tools: ToolsClientSchema;
|
|
23
|
+
modelContext: ModelContextClientSchema;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
MessagePartStatus,
|
|
16
16
|
ToolCallMessagePartStatus,
|
|
17
17
|
} from "../../types/AssistantTypes";
|
|
18
|
-
import {
|
|
18
|
+
import { useAui } from "@assistant-ui/store";
|
|
19
19
|
import { createContextStoreHook } from "../../context/react/utils/createContextStoreHook";
|
|
20
20
|
|
|
21
21
|
type SmoothContextValue = {
|
|
@@ -35,10 +35,10 @@ const makeSmoothContext = (
|
|
|
35
35
|
|
|
36
36
|
export const SmoothContextProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
37
37
|
const outer = useSmoothContext({ optional: true });
|
|
38
|
-
const
|
|
38
|
+
const aui = useAui();
|
|
39
39
|
|
|
40
40
|
const [context] = useState(() =>
|
|
41
|
-
makeSmoothContext(
|
|
41
|
+
makeSmoothContext(aui.part().getState().status),
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
// do not wrap if there is an outer SmoothContextProvider
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
5
5
|
import {
|
|
6
6
|
MessagePartStatus,
|
|
7
7
|
ReasoningMessagePart,
|
|
@@ -75,7 +75,7 @@ export const useSmooth = (
|
|
|
75
75
|
smooth: boolean = false,
|
|
76
76
|
): MessagePartState & (TextMessagePart | ReasoningMessagePart) => {
|
|
77
77
|
const { text } = state;
|
|
78
|
-
const id =
|
|
78
|
+
const id = useAuiState(({ message }) => message.id);
|
|
79
79
|
|
|
80
80
|
const idRef = useRef(id);
|
|
81
81
|
const [displayedText, setDisplayedText] = useState(text);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getPartialJsonObjectFieldState } from "assistant-stream/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
3
3
|
|
|
4
4
|
const COMPLETE_STATUS = { type: "complete" };
|
|
5
5
|
|
|
6
6
|
export const useToolArgsFieldStatus = (fieldPath: (string | number)[]) => {
|
|
7
|
-
return
|
|
7
|
+
return useAuiState(({ part }) => {
|
|
8
8
|
if (part.type !== "tool-call")
|
|
9
9
|
throw new Error(
|
|
10
10
|
"useToolArgsFieldStatus can only be used inside tool-call message parts",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ResourceElement } from "@assistant-ui/tap";
|
|
2
|
-
import { ThreadListClientApi, ThreadListClientState } from "./types/ThreadList.js";
|
|
3
|
-
import { AssistantApi } from "../context/react/AssistantApiContext.js";
|
|
4
|
-
import { ToolsApi, ToolsState } from "./types/Tools.js";
|
|
5
|
-
import { ModelContextApi, ModelContextState } from "./types/ModelContext.js";
|
|
6
|
-
export type AssistantClientProps = {
|
|
7
|
-
threads: ResourceElement<{
|
|
8
|
-
state: ThreadListClientState;
|
|
9
|
-
api: ThreadListClientApi;
|
|
10
|
-
}>;
|
|
11
|
-
modelContext?: ResourceElement<{
|
|
12
|
-
state: ModelContextState;
|
|
13
|
-
api: ModelContextApi;
|
|
14
|
-
}>;
|
|
15
|
-
tools?: ResourceElement<{
|
|
16
|
-
state: ToolsState;
|
|
17
|
-
api: ToolsApi;
|
|
18
|
-
}> | undefined;
|
|
19
|
-
};
|
|
20
|
-
export declare const useAssistantClient: (props: AssistantClientProps) => AssistantApi;
|
|
21
|
-
//# sourceMappingURL=AssistantClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantClient.d.ts","sourceRoot":"","sources":["../../src/client/AssistantClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,8BAA2B;AAYhF,OAAO,EACL,YAAY,EAIb,gDAA6C;AAG9C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,yBAAsB;AACrD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gCAA6B;AA4H1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,eAAe,CAAC;QACvB,KAAK,EAAE,qBAAqB,CAAC;QAC7B,GAAG,EAAE,mBAAmB,CAAC;KAC1B,CAAC,CAAC;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;QAC7B,KAAK,EAAE,iBAAiB,CAAC;QACzB,GAAG,EAAE,eAAe,CAAC;KACtB,CAAC,CAAC;IACH,KAAK,CAAC,EACF,eAAe,CAAC;QACd,KAAK,EAAE,UAAU,CAAC;QAClB,GAAG,EAAE,QAAQ,CAAC;KACf,CAAC,GACF,SAAS,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,oBAAoB,iBAK7D,CAAC"}
|