@assistant-ui/core 0.3.18 → 0.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/attachment.d.ts +9 -10
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +2 -1
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +1 -2
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +2 -2
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/speech.d.ts +6 -7
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +13 -3
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +5 -6
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +10 -7
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +1 -2
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +5 -6
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/duplicate-detection.d.ts +1 -2
- package/dist/internal/duplicate-detection.d.ts.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/model-context/frame/host.d.ts +1 -2
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +26 -11
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +1 -2
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/types.d.ts +5 -6
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.d.ts +9 -10
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +11 -9
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +3 -4
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +1 -2
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +2 -3
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +2 -3
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +8 -9
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +3 -4
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +1 -2
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +2 -3
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +4 -5
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +43 -19
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +2 -3
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +1 -2
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +1 -2
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.js +20 -15
- package/dist/react/client/DataRenderers.js.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +3 -4
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +1 -2
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +11 -5
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +2 -3
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +3 -2
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts +2 -2
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +2 -3
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +3 -2
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/interactables-legacy/Interactables.d.ts +1 -2
- package/dist/react/interactables-legacy/Interactables.d.ts.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.d.ts +2 -3
- package/dist/react/interactables-legacy/interactable-model-context.d.ts.map +1 -1
- package/dist/react/interactables-legacy/scopes.d.ts +9 -10
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +2 -3
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.js +3 -0
- package/dist/react/interactables-legacy/useAssistantInteractable.js.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +1 -2
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +1 -2
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/model-context/define-mcp-toolkit.d.ts +4 -5
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +2 -3
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +1 -2
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +3 -4
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +3 -4
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +2 -3
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +2 -3
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +2 -3
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +2 -3
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +1 -2
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +9 -10
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +2 -2
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +2 -3
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +2 -2
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +2 -3
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +2 -3
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +1 -2
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +1 -2
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +4 -5
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.js +4 -1
- package/dist/react/model-context/useInteractable.js.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +1 -2
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +1 -2
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.js +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +2 -3
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +2 -3
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +2 -3
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +1 -2
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +1 -2
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +1 -2
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +1 -2
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +1 -2
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +1 -2
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +1 -2
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +2 -3
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +3 -4
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +2 -3
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +4 -5
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +4 -5
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +2 -3
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +4 -5
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +27 -28
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +4 -5
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +13 -5
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -2
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +10 -10
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +2 -3
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +2 -3
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +4 -4
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.js +1 -0
- package/dist/react/primitives/part/PartMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +7 -8
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.js +6 -5
- package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +5 -6
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +4 -5
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +2 -3
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +2 -3
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +1 -2
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +1 -2
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +1 -2
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +1 -2
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +1 -2
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +2 -3
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +2 -3
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +2 -3
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +1 -2
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +1 -2
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +1 -2
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +3 -2
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +17 -7
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +1 -2
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +2 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +4 -5
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +3 -3
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +2 -3
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +3 -4
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.d.ts +2 -3
- package/dist/react/runtimes/assistant-transport/runManager.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/types.d.ts +17 -18
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +4 -5
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts +1 -2
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +1 -2
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +3 -26
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +152 -378
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +2 -2
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +22 -2
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +51 -18
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +125 -17
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +6 -6
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.js +4 -0
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +1 -2
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +5 -0
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -0
- package/dist/react/runtimes/cloud/sdkIdentity.js +9 -0
- package/dist/react/runtimes/cloud/sdkIdentity.js.map +1 -0
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +1 -2
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +1 -2
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +1 -2
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +3 -4
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +14 -4
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.js +26 -61
- package/dist/react/runtimes/external-message-converter.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +1 -2
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts +1 -2
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +3 -4
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +1 -2
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +3 -3
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +4 -4
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +2 -2
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +26 -27
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +3 -4
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +10 -11
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +4 -5
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +1 -2
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +13 -9
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/groupParts.js +6 -0
- package/dist/react/utils/groupParts.js.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +3 -2
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.js +6 -1
- package/dist/react/utils/useJSONEqual.js.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +6 -0
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -0
- package/dist/react/utils/useJSONSchemaDependency.js +20 -0
- package/dist/react/utils/useJSONSchemaDependency.js.map +1 -0
- package/dist/runtime/api/assistant-runtime.d.ts +2 -3
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +6 -7
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/bindings.d.ts +5 -6
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +10 -10
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +3 -4
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +3 -2
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +8 -6
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +3 -2
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +6 -7
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +8 -8
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +4 -5
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +10 -11
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +2 -5
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +1 -2
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +2 -2
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +46 -10
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +10 -3
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +212 -77
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +1 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +12 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +1 -2
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +7 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +1 -2
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +1 -2
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +10 -11
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +4 -5
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +23 -16
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +2 -3
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +10 -4
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +70 -7
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/queue/queue-item.d.ts +2 -3
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +2 -3
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +3 -4
- package/dist/runtime/utils/attachment-add-operations.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.d.ts +9 -6
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +12 -4
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +5 -6
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +26 -15
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +51 -14
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +4 -5
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +3 -4
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +4 -5
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +3 -3
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/pending-tool-calls.d.ts +2 -3
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +1 -2
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +2 -3
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.d.ts +21 -0
- package/dist/runtime/utils/stored-message-parts.d.ts.map +1 -0
- package/dist/runtime/utils/stored-message-parts.js +83 -0
- package/dist/runtime/utils/stored-message-parts.js.map +1 -0
- package/dist/runtime/utils/streaming-timing.d.ts +4 -5
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +7 -6
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +4 -2
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts +3 -4
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts.map +1 -1
- package/dist/runtime/utils/tool-call-tree.d.ts +4 -5
- package/dist/runtime/utils/tool-call-tree.d.ts.map +1 -1
- package/dist/runtimes/assistant-transport/utils.d.ts +1 -2
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +9 -6
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +1 -2
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-shared-options.d.ts +2 -3
- package/dist/runtimes/external-store/external-store-shared-options.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +2 -3
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +4 -3
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +36 -6
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +2 -3
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +2 -3
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/internal.d.ts +1 -1
- package/dist/runtimes/local/local-runtime-core.d.ts +1 -2
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +1 -2
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +2 -3
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +10 -5
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +57 -10
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +1 -2
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +1 -2
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +1 -2
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +1 -2
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +1 -2
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +1 -2
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +16 -17
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +7 -8
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +2 -3
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +8 -9
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +4 -5
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +2 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/chain-of-thought-client.d.ts +1 -2
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +3 -4
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +256 -211
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +1 -2
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +1 -2
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +1 -2
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +1 -2
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/suggestions.d.ts +3 -4
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +2 -3
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-selection-events.d.ts +1 -2
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +12 -0
- package/dist/store/clients/thread-tasks.d.ts.map +1 -0
- package/dist/store/clients/thread-tasks.js +69 -0
- package/dist/store/clients/thread-tasks.js.map +1 -0
- package/dist/store/env.d.ts +1 -2
- package/dist/store/env.d.ts.map +1 -1
- package/dist/store/index.d.ts +3 -2
- package/dist/store/index.js +3 -3
- package/dist/store/primitive-predicates.d.ts +11 -12
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +4 -4
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-runtime-action.d.ts +1 -2
- package/dist/store/runtime-clients/handle-runtime-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts +1 -2
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +1 -2
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +176 -128
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/useSubscribable.d.ts +1 -2
- package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -1
- package/dist/store/scope-registration.d.ts +2 -0
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/attachment.d.ts +4 -5
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +5 -6
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +6 -7
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +6 -6
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +3 -4
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +4 -5
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +4 -4
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +4 -5
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +5 -6
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +35 -0
- package/dist/store/scopes/task.d.ts.map +1 -0
- package/dist/store/scopes/task.js +0 -0
- package/dist/store/scopes/thread-list-item.d.ts +5 -6
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +25 -6
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +4 -5
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +15 -15
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +23 -15
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +5 -6
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +1 -1
- package/dist/types/attachment.d.ts +9 -10
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +3 -4
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +2 -3
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +8 -9
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/message.d.ts +53 -44
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +1 -2
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +2 -3
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +1 -2
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +2 -3
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.js +30 -14
- package/dist/utils/abortable-iterable.js.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +1 -2
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +6 -7
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +17 -2
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.js +32 -7
- package/dist/utils/getGroupStatus.js.map +1 -1
- package/dist/utils/id.d.ts +3 -4
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +1 -2
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +1 -2
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +1 -2
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +4 -5
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +2 -3
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +4 -5
- package/dist/utils/normalizePartStatus.d.ts.map +1 -1
- package/dist/utils/notify-event-listeners.d.ts +1 -2
- package/dist/utils/notify-event-listeners.d.ts.map +1 -1
- package/dist/utils/record.d.ts +1 -2
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +2 -3
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +1 -2
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +3 -4
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/dist/utils/wire-media.js +2 -2
- package/dist/utils/wire-media.js.map +1 -1
- package/package.json +15 -14
- package/src/adapters/attachment.ts +8 -1
- package/src/adapters/feedback.ts +1 -0
- package/src/adapters/speech.test.ts +236 -0
- package/src/adapters/speech.ts +17 -10
- package/src/adapters/thread-history.ts +3 -0
- package/src/index.ts +1 -0
- package/src/model-context/frame/host.test.ts +113 -1
- package/src/model-context/frame/host.ts +39 -12
- package/src/model-context/frame/provider.test.ts +45 -20
- package/src/model-context/interactable-composer-metadata.test.ts +30 -0
- package/src/model-context/interactable-composer-metadata.ts +10 -10
- package/src/react/RuntimeAdapter.test.ts +4 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +361 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +69 -19
- package/src/react/client/DataRenderers.test.tsx +45 -0
- package/src/react/client/DataRenderers.ts +13 -9
- package/src/react/client/Interactables.test.ts +52 -4
- package/src/react/client/Interactables.ts +7 -1
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +9 -3
- package/src/react/client/RemoteThreadList.test.ts +46 -7
- package/src/react/client/RemoteThreadList.ts +15 -2
- package/src/react/client/interactable-model-context.test.ts +44 -0
- package/src/react/client/interactable-model-context.ts +3 -2
- package/src/react/index.ts +5 -1
- package/src/react/interactables-legacy/Interactables.test.ts +9 -3
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +150 -0
- package/src/react/interactables-legacy/useAssistantInteractable.ts +10 -1
- package/src/react/model-context/useInteractable.test.tsx +204 -0
- package/src/react/model-context/useInteractable.ts +3 -0
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +5 -6
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +0 -1
- package/src/react/primitives/generativeUI/GenerativeUI.test.tsx +54 -0
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +13 -18
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +99 -0
- package/src/react/primitives/message/MessageGroupedParts.tsx +15 -4
- package/src/react/primitives/part/PartMessages.test.tsx +104 -1
- package/src/react/primitives/part/PartMessages.tsx +1 -0
- package/src/react/primitives/thread/ThreadMessages.test.tsx +160 -0
- package/src/react/primitives/thread/ThreadMessages.tsx +8 -5
- package/src/react/providers/ReadonlyThreadProvider.test.tsx +56 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.layout.test.tsx +62 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.retry.test.tsx +2 -2
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +23 -20
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +24 -17
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +39 -24
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +7 -1
- package/src/react/runtimes/assistant-transport/transport-scheduling.test.ts +73 -46
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.test.tsx +66 -1
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +20 -14
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +323 -1
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +190 -523
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +81 -0
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +27 -1
- package/src/react/runtimes/cloud/auiV0.ts +281 -26
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +522 -0
- package/src/react/runtimes/cloud/createCloudThreadListAdapter.test.ts +21 -0
- package/src/react/runtimes/cloud/createCloudThreadListAdapter.ts +7 -1
- package/src/react/runtimes/cloud/sdkIdentity.ts +9 -0
- package/src/react/runtimes/cloud/useCloudThreadListAdapter.test.tsx +18 -4
- package/src/react/runtimes/external-message-converter.test.ts +143 -4
- package/src/react/runtimes/external-message-converter.ts +39 -93
- package/src/react/runtimes/remote-thread-hook-on-tap.test.ts +2 -1
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +8 -2
- package/src/react/runtimes/useExternalStoreRuntime.suggestions.test.tsx +6 -2
- package/src/react/runtimes/useRemoteThreadListRuntime.concurrent.test.tsx +84 -4
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +6 -2
- package/src/react/utils/groupParts.ts +12 -1
- package/src/react/utils/useJSONEqual.ts +9 -0
- package/src/react/utils/useJSONSchemaDependency.ts +22 -0
- package/src/runtime/api/message-part-runtime.ts +4 -1
- package/src/runtime/api/message-runtime.ts +15 -2
- package/src/runtime/api/thread-runtime.test.ts +58 -0
- package/src/runtime/api/thread-runtime.ts +2 -4
- package/src/runtime/base/base-composer-runtime-core.ts +69 -16
- package/src/runtime/base/base-thread-runtime-core.test.ts +1799 -49
- package/src/runtime/base/base-thread-runtime-core.ts +296 -94
- package/src/runtime/base/default-edit-composer-runtime-core.ts +12 -2
- package/src/runtime/base/default-thread-composer-runtime-core.ts +12 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +8 -0
- package/src/runtime/queue/message-queue.ts +79 -7
- package/src/runtime/utils/auto-status.test.ts +112 -1
- package/src/runtime/utils/auto-status.ts +31 -5
- package/src/runtime/utils/external-message-conversion.test.ts +177 -0
- package/src/runtime/utils/external-message-conversion.ts +128 -33
- package/src/runtime/utils/message-repository.test.ts +49 -0
- package/src/runtime/utils/message-repository.ts +3 -3
- package/src/runtime/utils/stored-message-parts.ts +174 -0
- package/src/runtime/utils/thread-message-like.test.ts +52 -0
- package/src/runtime/utils/thread-message-like.ts +11 -2
- package/src/runtimes/external-store/external-store-adapter.ts +4 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +74 -9
- package/src/runtimes/local/local-thread-runtime-core.test.ts +189 -12
- package/src/runtimes/local/local-thread-runtime-core.ts +91 -10
- package/src/runtimes/tool-invocations/EDGE_CASES.md +2 -6
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +133 -0
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +10 -6
- package/src/store/clients/external-thread.ts +53 -14
- package/src/store/clients/thread-tasks.test.ts +274 -0
- package/src/store/clients/thread-tasks.ts +138 -0
- package/src/store/index.ts +8 -0
- package/src/store/primitive-predicates.test.ts +64 -5
- package/src/store/primitive-predicates.ts +10 -2
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +110 -0
- package/src/store/runtime-clients/thread-runtime-client.ts +31 -1
- package/src/store/scope-registration.ts +2 -0
- package/src/store/scopes/message.ts +4 -1
- package/src/store/scopes/task.ts +34 -0
- package/src/store/scopes/thread.ts +16 -0
- package/src/store/thread-tasks.test.tsx +209 -0
- package/src/subscribable/subscribable.test.ts +161 -1
- package/src/subscribable/subscribable.ts +25 -15
- package/src/tests/MessageRepository.test.ts +1 -5
- package/src/tests/attachment-adapters.test.ts +16 -1
- package/src/tests/auiV0Encode.test.ts +304 -0
- package/src/tests/base-composer-runtime-core-addAttachment.test.ts +6 -6
- package/src/tests/base-composer-runtime-core-send.test.ts +51 -0
- package/src/tests/base-composer-runtime-core.test.ts +329 -6
- package/src/tests/composer-can-cancel.test.ts +35 -6
- package/src/tests/composer-can-send.test.ts +22 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +47 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +369 -16
- package/src/tests/external-store-thread-runtime-core.test.ts +31 -0
- package/src/tests/external-thread-attachments.test.tsx +91 -23
- package/src/tests/external-thread-feedback.test.tsx +20 -7
- package/src/tests/external-thread-parity.test.tsx +35 -1
- package/src/tests/groupParts.test.ts +71 -0
- package/src/tests/message-queue.test.ts +290 -2
- package/src/tests/remote-thread-list-reactive-threadId.test.ts +51 -0
- package/src/tests/thread-switch-events.test.tsx +11 -7
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +45 -1
- package/src/types/index.ts +1 -0
- package/src/types/message.test.ts +19 -0
- package/src/types/message.ts +23 -7
- package/src/utils/abortable-iterable.test.ts +115 -0
- package/src/utils/abortable-iterable.ts +34 -23
- package/src/utils/getGroupStatus.test.ts +70 -4
- package/src/utils/getGroupStatus.ts +35 -12
- package/src/utils/wire-media.test.ts +10 -0
- package/src/utils/wire-media.ts +6 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/utils/silent-runtime-action.d.ts
|
|
2
|
-
declare const SILENT_RUNTIME_ACTION: unique symbol;
|
|
3
|
-
declare const isSilentRuntimeAction: (error: unknown) => boolean;
|
|
2
|
+
export declare const SILENT_RUNTIME_ACTION: unique symbol;
|
|
3
|
+
export declare const isSilentRuntimeAction: (error: unknown) => boolean;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { SILENT_RUNTIME_ACTION, isSilentRuntimeAction };
|
|
6
5
|
//# sourceMappingURL=silent-runtime-action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"silent-runtime-action.d.ts","names":[],"sources":["../../src/utils/silent-runtime-action.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"silent-runtime-action.d.ts","names":[],"sources":["../../src/utils/silent-runtime-action.ts"],"mappings":";qBAAa;qBAIA,wBAAyB"}
|
package/dist/utils/text.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AppendMessage, ThreadMessage } from "../types/message.js";
|
|
2
2
|
//#region src/utils/text.d.ts
|
|
3
|
-
declare const getThreadMessageText: (message: ThreadMessage | AppendMessage) => string;
|
|
3
|
+
export declare const getThreadMessageText: (message: ThreadMessage | AppendMessage) => string;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { getThreadMessageText };
|
|
6
5
|
//# sourceMappingURL=text.d.ts.map
|
package/dist/utils/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","names":[],"sources":["../../src/utils/text.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"text.d.ts","names":[],"sources":["../../src/utils/text.ts"],"mappings":";;qBAGa,uBACX,SAAS,gBAAgB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* for a url source and whenever inline bytes fail to sniff, so it fails exactly
|
|
9
9
|
* where a fallback is needed.
|
|
10
10
|
*/
|
|
11
|
-
declare function resolveImageMediaType(image: string, contentType?: string | undefined): string;
|
|
11
|
+
export declare function resolveImageMediaType(image: string, contentType?: string | undefined): string;
|
|
12
12
|
/**
|
|
13
13
|
* The media type to declare for a `FileMessagePart`: its own `mimeType`, then
|
|
14
14
|
* the payload's data URL declaration, then `application/octet-stream`.
|
|
@@ -16,7 +16,7 @@ declare function resolveImageMediaType(image: string, contentType?: string | und
|
|
|
16
16
|
* `mimeType` is a plain string, and an adapter reading `file.type` on a file
|
|
17
17
|
* the OS cannot type yields `""`, so the declared value is not always present.
|
|
18
18
|
*/
|
|
19
|
-
declare function resolveFileMediaType(data: string, mimeType?: string | undefined): string;
|
|
19
|
+
export declare function resolveFileMediaType(data: string, mimeType?: string | undefined): string;
|
|
20
20
|
/**
|
|
21
21
|
* A payload placed into a wire field that is contractually a url.
|
|
22
22
|
*
|
|
@@ -29,7 +29,6 @@ declare function resolveFileMediaType(data: string, mimeType?: string | undefine
|
|
|
29
29
|
* cannot be corrected without transcoding the payload and is authoritative for
|
|
30
30
|
* the bytes it carries anyway.
|
|
31
31
|
*/
|
|
32
|
-
declare function toMediaWireUrl(payload: string, mediaType: string): string;
|
|
32
|
+
export declare function toMediaWireUrl(payload: string, mediaType: string): string;
|
|
33
33
|
//#endregion
|
|
34
|
-
export { resolveFileMediaType, resolveImageMediaType, toMediaWireUrl };
|
|
35
34
|
//# sourceMappingURL=wire-media.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-media.d.ts","names":[],"sources":["../../src/utils/wire-media.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"wire-media.d.ts","names":[],"sources":["../../src/utils/wire-media.ts"],"mappings":";;;;;;;;;;wBAYgB,sBACd,eACA;;;;;;;;wBA+Bc,qBACd,cACA;;;;;;;;;;;;;wBAiBc,eAAe,iBAAiB"}
|
package/dist/utils/wire-media.js
CHANGED
|
@@ -11,9 +11,9 @@ import { detectImageMediaType } from "./image-media-type.js";
|
|
|
11
11
|
* where a fallback is needed.
|
|
12
12
|
*/
|
|
13
13
|
function resolveImageMediaType(image, contentType) {
|
|
14
|
-
if (contentType?.startsWith("image/")) return contentType;
|
|
14
|
+
if (contentType?.startsWith("image/") && !contentType.includes("*")) return contentType;
|
|
15
15
|
const declared = dataUrlMediaType(image);
|
|
16
|
-
if (declared?.startsWith("image/")) return declared;
|
|
16
|
+
if (declared?.startsWith("image/") && !declared.includes("*")) return declared;
|
|
17
17
|
const payload = parseDataUrl(image)?.data ?? (isParsableUrl(image) ? void 0 : image);
|
|
18
18
|
if (payload !== void 0) {
|
|
19
19
|
const sniffed = detectImageMediaType(payload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-media.js","names":["dataUrlMediaType","isParsableUrl","parseDataUrl","detectImageMediaType","resolveImageMediaType","image","contentType","startsWith","declared","parsed","payload","data","undefined","sniffed","resolveFileMediaType","mimeType","toMediaWireUrl","mediaType"],"sources":["../../src/utils/wire-media.ts"],"sourcesContent":["import { dataUrlMediaType, isParsableUrl, parseDataUrl } from \"./data-url\";\nimport { detectImageMediaType } from \"./image-media-type\";\n\n/**\n * The media type to declare for an `ImageMessagePart`, which carries none of\n * its own: an attachment's content type, then the payload's data URL\n * declaration, then its leading bytes, then `image/png`.\n *\n * The floor cannot be a wildcard. `image/*` is rejected outright by the AI SDK\n * for a url source and whenever inline bytes fail to sniff, so it fails exactly\n * where a fallback is needed.\n */\nexport function resolveImageMediaType(\n image: string,\n contentType?: string | undefined,\n): string {\n if (contentType?.startsWith(\"image/\")) return contentType;\n\n const declared = dataUrlMediaType(image);\n if (declared?.startsWith(\"image/\")) return declared;\n\n // Read through a data URL envelope too, so a generic one such as\n // `application/octet-stream` does not mask the format. A url of any other\n // scheme has no local bytes to read.\n const parsed = parseDataUrl(image);\n const payload = parsed?.data ?? (isParsableUrl(image) ? undefined : image);\n if (payload !== undefined) {\n const sniffed = detectImageMediaType(payload);\n if (sniffed) return sniffed;\n }\n\n return \"image/png\";\n}\n\n/**\n * The media type to declare for a `FileMessagePart`: its own `mimeType`, then\n * the payload's data URL declaration, then `application/octet-stream`.\n *\n * `mimeType` is a plain string, and an adapter reading `file.type` on a file\n * the OS cannot type yields `\"\"`, so the declared value is not always present.\n */\nexport function resolveFileMediaType(\n data: string,\n mimeType?: string | undefined,\n): string {\n return mimeType || dataUrlMediaType(data) || \"application/octet-stream\";\n}\n\n/**\n * A payload placed into a wire field that is contractually a url.\n *\n * Two hazards drive this. A consumer may hand the value to an unguarded\n * `new URL()`, so a payload that is not a url has to be wrapped; and a data\n * URL's own media type wins over a separately declared one downstream, so a\n * base64 envelope that disagrees with `mediaType` is rebuilt around the same\n * bytes. Everything else passes through byte for byte: an envelope that agrees,\n * a url of any other scheme, and a percent-encoded data URL, whose declaration\n * cannot be corrected without transcoding the payload and is authoritative for\n * the bytes it carries anyway.\n */\nexport function toMediaWireUrl(payload: string, mediaType: string): string {\n const parsed = parseDataUrl(payload);\n if (parsed) {\n return parsed.mimeType === mediaType\n ? payload\n : `data:${mediaType};base64,${parsed.data}`;\n }\n if (isParsableUrl(payload)) return payload;\n return `data:${mediaType};base64,${payload}`;\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgBI,sBACdC,OACAC,aACQ;CACR,IAAIA,aAAaC,WAAW,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"wire-media.js","names":["dataUrlMediaType","isParsableUrl","parseDataUrl","detectImageMediaType","resolveImageMediaType","image","contentType","startsWith","includes","declared","parsed","payload","data","undefined","sniffed","resolveFileMediaType","mimeType","toMediaWireUrl","mediaType"],"sources":["../../src/utils/wire-media.ts"],"sourcesContent":["import { dataUrlMediaType, isParsableUrl, parseDataUrl } from \"./data-url\";\nimport { detectImageMediaType } from \"./image-media-type\";\n\n/**\n * The media type to declare for an `ImageMessagePart`, which carries none of\n * its own: an attachment's content type, then the payload's data URL\n * declaration, then its leading bytes, then `image/png`.\n *\n * The floor cannot be a wildcard. `image/*` is rejected outright by the AI SDK\n * for a url source and whenever inline bytes fail to sniff, so it fails exactly\n * where a fallback is needed.\n */\nexport function resolveImageMediaType(\n image: string,\n contentType?: string | undefined,\n): string {\n if (contentType?.startsWith(\"image/\") && !contentType.includes(\"*\")) {\n return contentType;\n }\n\n const declared = dataUrlMediaType(image);\n if (declared?.startsWith(\"image/\") && !declared.includes(\"*\")) {\n return declared;\n }\n\n // Read through a data URL envelope too, so a generic one such as\n // `application/octet-stream` does not mask the format. A url of any other\n // scheme has no local bytes to read.\n const parsed = parseDataUrl(image);\n const payload = parsed?.data ?? (isParsableUrl(image) ? undefined : image);\n if (payload !== undefined) {\n const sniffed = detectImageMediaType(payload);\n if (sniffed) return sniffed;\n }\n\n return \"image/png\";\n}\n\n/**\n * The media type to declare for a `FileMessagePart`: its own `mimeType`, then\n * the payload's data URL declaration, then `application/octet-stream`.\n *\n * `mimeType` is a plain string, and an adapter reading `file.type` on a file\n * the OS cannot type yields `\"\"`, so the declared value is not always present.\n */\nexport function resolveFileMediaType(\n data: string,\n mimeType?: string | undefined,\n): string {\n return mimeType || dataUrlMediaType(data) || \"application/octet-stream\";\n}\n\n/**\n * A payload placed into a wire field that is contractually a url.\n *\n * Two hazards drive this. A consumer may hand the value to an unguarded\n * `new URL()`, so a payload that is not a url has to be wrapped; and a data\n * URL's own media type wins over a separately declared one downstream, so a\n * base64 envelope that disagrees with `mediaType` is rebuilt around the same\n * bytes. Everything else passes through byte for byte: an envelope that agrees,\n * a url of any other scheme, and a percent-encoded data URL, whose declaration\n * cannot be corrected without transcoding the payload and is authoritative for\n * the bytes it carries anyway.\n */\nexport function toMediaWireUrl(payload: string, mediaType: string): string {\n const parsed = parseDataUrl(payload);\n if (parsed) {\n return parsed.mimeType === mediaType\n ? payload\n : `data:${mediaType};base64,${parsed.data}`;\n }\n if (isParsableUrl(payload)) return payload;\n return `data:${mediaType};base64,${payload}`;\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgBI,sBACdC,OACAC,aACQ;CACR,IAAIA,aAAaC,WAAW,QAAQ,KAAK,CAACD,YAAYE,SAAS,GAAG,GAChE,OAAOF;CAGT,MAAMG,WAAWT,iBAAiBK,KAAK;CACvC,IAAII,UAAUF,WAAW,QAAQ,KAAK,CAACE,SAASD,SAAS,GAAG,GAC1D,OAAOC;CAOT,MAAME,UADST,aAAaG,KACZK,CAAM,EAAEE,SAASX,cAAcI,KAAK,IAAIQ,KAAAA,IAAYR;CACpE,IAAIM,YAAYE,KAAAA,GAAW;EACzB,MAAMC,UAAUX,qBAAqBQ,OAAO;EAC5C,IAAIG,SAAS,OAAOA;CACtB;CAEA,OAAO;AACT;;;;;;;;AASA,SAAgBC,qBACdH,MACAI,UACQ;CACR,OAAOA,YAAYhB,iBAAiBY,IAAI,KAAK;AAC/C;;;;;;;;;;;;;AAcA,SAAgBK,eAAeN,SAAiBO,WAA2B;CACzE,MAAMR,SAASR,aAAaS,OAAO;CACnC,IAAID,QACF,OAAOA,OAAOM,aAAaE,YACvBP,UACA,QAAQO,UAAS,UAAWR,OAAOE;CAEzC,IAAIX,cAAcU,OAAO,GAAG,OAAOA;CACnC,OAAO,QAAQO,UAAS,UAAWP;AACrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "Framework-agnostic core runtime for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assistant",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
],
|
|
60
60
|
"sideEffects": false,
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"assistant-stream": "^0.3.
|
|
62
|
+
"assistant-stream": "^0.3.44",
|
|
63
63
|
"nanoid": "^6.0.1"
|
|
64
64
|
},
|
|
65
65
|
"optionalDevDependencies": {
|
|
66
66
|
"@assistant-ui/x-generative-compiler": ">=0.0.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@assistant-ui/store": "^0.3.
|
|
70
|
-
"@assistant-ui/tap": "^0.9.
|
|
69
|
+
"@assistant-ui/store": "^0.3.14",
|
|
70
|
+
"@assistant-ui/tap": "^0.9.18",
|
|
71
71
|
"@types/react": "*",
|
|
72
72
|
"react": "^18 || ^19",
|
|
73
|
-
"assistant-cloud": "^0.2.
|
|
73
|
+
"assistant-cloud": "^0.2.1"
|
|
74
74
|
},
|
|
75
75
|
"peerDependenciesMeta": {
|
|
76
76
|
"@types/react": {
|
|
@@ -84,17 +84,17 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@assistant-ui/store": "0.3.
|
|
88
|
-
"@assistant-ui/tap": "0.9.
|
|
89
|
-
"@assistant-ui/vite": "0.0.
|
|
90
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
87
|
+
"@assistant-ui/store": "0.3.14",
|
|
88
|
+
"@assistant-ui/tap": "0.9.18",
|
|
89
|
+
"@assistant-ui/vite": "0.0.18",
|
|
90
|
+
"@assistant-ui/x-buildutils": "0.0.28",
|
|
91
91
|
"@testing-library/react": "^16.3.3",
|
|
92
|
-
"@types/react": "^19.
|
|
93
|
-
"assistant-cloud": "0.2.
|
|
92
|
+
"@types/react": "^19.3.0",
|
|
93
|
+
"assistant-cloud": "0.2.2",
|
|
94
94
|
"jsdom": "^30.0.1",
|
|
95
|
-
"react": "^19.
|
|
96
|
-
"react-dom": "^19.
|
|
97
|
-
"vitest": "^
|
|
95
|
+
"react": "^19.3.0",
|
|
96
|
+
"react-dom": "^19.3.0",
|
|
97
|
+
"vitest": "^5.0.1"
|
|
98
98
|
},
|
|
99
99
|
"publishConfig": {
|
|
100
100
|
"access": "public",
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"scripts": {
|
|
113
113
|
"build": "aui-build",
|
|
114
114
|
"test": "vitest run",
|
|
115
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
|
|
115
116
|
"test:react-compiler": "vitest run --config vitest.react-compiler.config.ts",
|
|
116
117
|
"test:watch": "vitest"
|
|
117
118
|
}
|
|
@@ -83,6 +83,13 @@ export const getFileDataURL = async (file: File): Promise<string> => {
|
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
const escapeAttachmentName = (name: string) =>
|
|
87
|
+
name
|
|
88
|
+
.replaceAll("&", "&")
|
|
89
|
+
.replaceAll('"', """)
|
|
90
|
+
.replaceAll("<", "<")
|
|
91
|
+
.replaceAll(">", ">");
|
|
92
|
+
|
|
86
93
|
export class SimpleTextAttachmentAdapter implements AttachmentAdapter {
|
|
87
94
|
public accept =
|
|
88
95
|
"text/plain,text/html,text/markdown,text/csv,text/xml,text/json,application/json,text/css";
|
|
@@ -107,7 +114,7 @@ export class SimpleTextAttachmentAdapter implements AttachmentAdapter {
|
|
|
107
114
|
content: [
|
|
108
115
|
{
|
|
109
116
|
type: "text",
|
|
110
|
-
text: `<attachment name
|
|
117
|
+
text: `<attachment name="${escapeAttachmentName(attachment.name)}">\n${await getFileText(attachment.file)}\n</attachment>`,
|
|
111
118
|
},
|
|
112
119
|
],
|
|
113
120
|
};
|
package/src/adapters/feedback.ts
CHANGED
|
@@ -7,6 +7,62 @@ afterEach(() => {
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
describe("WebSpeechSynthesisAdapter", () => {
|
|
10
|
+
const stubSpeechSynthesis = () => {
|
|
11
|
+
const utterances: EventTarget[] = [];
|
|
12
|
+
class MockSpeechSynthesisUtterance extends EventTarget {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
utterances.push(this);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const cancel = vi.fn();
|
|
19
|
+
vi.stubGlobal("SpeechSynthesisUtterance", MockSpeechSynthesisUtterance);
|
|
20
|
+
vi.stubGlobal("window", { speechSynthesis: { speak: vi.fn(), cancel } });
|
|
21
|
+
return { utterances, cancel };
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
it.each(["end", "error"])(
|
|
25
|
+
"does not cancel newer playback through a handle that received %s",
|
|
26
|
+
(event) => {
|
|
27
|
+
const { utterances, cancel } = stubSpeechSynthesis();
|
|
28
|
+
const adapter = new WebSpeechSynthesisAdapter();
|
|
29
|
+
const old = adapter.speak("old");
|
|
30
|
+
utterances[0]!.dispatchEvent(new Event(event));
|
|
31
|
+
const endedStatus = old.status;
|
|
32
|
+
const current = adapter.speak("current");
|
|
33
|
+
|
|
34
|
+
old.cancel();
|
|
35
|
+
old.cancel();
|
|
36
|
+
|
|
37
|
+
expect(cancel).not.toHaveBeenCalled();
|
|
38
|
+
expect(old.status).toBe(endedStatus);
|
|
39
|
+
expect(current.status).toEqual({ type: "running" });
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
it("cancels active playback once and leaves later playback alone", () => {
|
|
44
|
+
const { cancel } = stubSpeechSynthesis();
|
|
45
|
+
const adapter = new WebSpeechSynthesisAdapter();
|
|
46
|
+
const old = adapter.speak("old");
|
|
47
|
+
const onChange = vi.fn();
|
|
48
|
+
old.subscribe(onChange);
|
|
49
|
+
|
|
50
|
+
old.cancel();
|
|
51
|
+
|
|
52
|
+
expect(cancel).toHaveBeenCalledOnce();
|
|
53
|
+
expect(old.status).toMatchObject({ type: "ended", reason: "cancelled" });
|
|
54
|
+
expect(onChange).toHaveBeenCalledOnce();
|
|
55
|
+
|
|
56
|
+
const current = adapter.speak("current");
|
|
57
|
+
old.cancel();
|
|
58
|
+
|
|
59
|
+
expect(cancel).toHaveBeenCalledOnce();
|
|
60
|
+
expect(onChange).toHaveBeenCalledOnce();
|
|
61
|
+
expect(current.status).toEqual({ type: "running" });
|
|
62
|
+
current.cancel();
|
|
63
|
+
expect(cancel).toHaveBeenCalledTimes(2);
|
|
64
|
+
});
|
|
65
|
+
|
|
10
66
|
it("isolates a late subscriber that throws after the utterance ended", async () => {
|
|
11
67
|
const listeners = new Map<string, EventListener>();
|
|
12
68
|
class MockSpeechSynthesisUtterance {
|
|
@@ -109,6 +165,186 @@ describe("WebSpeechDictationAdapter", () => {
|
|
|
109
165
|
return listeners;
|
|
110
166
|
};
|
|
111
167
|
|
|
168
|
+
const emitResults = (
|
|
169
|
+
listeners: Map<string, EventListener>,
|
|
170
|
+
results: [transcript: string, isFinal: boolean][],
|
|
171
|
+
resultIndex = 0,
|
|
172
|
+
) => {
|
|
173
|
+
listeners.get("result")!({
|
|
174
|
+
resultIndex,
|
|
175
|
+
results: results.map(([transcript, isFinal]) => ({
|
|
176
|
+
0: { transcript },
|
|
177
|
+
isFinal,
|
|
178
|
+
})),
|
|
179
|
+
} as unknown as Event);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
it("publishes the entire interim suffix when only its last result changes", () => {
|
|
183
|
+
const listeners = stubSpeechRecognition();
|
|
184
|
+
const session = new WebSpeechDictationAdapter().listen();
|
|
185
|
+
const onSpeech = vi.fn();
|
|
186
|
+
session.onSpeech(onSpeech);
|
|
187
|
+
|
|
188
|
+
emitResults(listeners, [
|
|
189
|
+
["hello ", false],
|
|
190
|
+
["world", false],
|
|
191
|
+
]);
|
|
192
|
+
emitResults(
|
|
193
|
+
listeners,
|
|
194
|
+
[
|
|
195
|
+
["hello ", false],
|
|
196
|
+
["there", false],
|
|
197
|
+
],
|
|
198
|
+
1,
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
expect(onSpeech.mock.calls).toEqual([
|
|
202
|
+
[{ transcript: "hello world", isFinal: false }],
|
|
203
|
+
[{ transcript: "hello there", isFinal: false }],
|
|
204
|
+
]);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("publishes partial and complete retractions with no changed results", () => {
|
|
208
|
+
const listeners = stubSpeechRecognition();
|
|
209
|
+
const session = new WebSpeechDictationAdapter().listen();
|
|
210
|
+
const onSpeech = vi.fn();
|
|
211
|
+
session.onSpeech(onSpeech);
|
|
212
|
+
|
|
213
|
+
emitResults(listeners, [
|
|
214
|
+
["hello ", false],
|
|
215
|
+
["world", false],
|
|
216
|
+
]);
|
|
217
|
+
emitResults(listeners, [["hello ", false]], 1);
|
|
218
|
+
emitResults(listeners, []);
|
|
219
|
+
emitResults(listeners, []);
|
|
220
|
+
|
|
221
|
+
expect(onSpeech.mock.calls).toEqual([
|
|
222
|
+
[{ transcript: "hello world", isFinal: false }],
|
|
223
|
+
[{ transcript: "hello ", isFinal: false }],
|
|
224
|
+
[{ transcript: "", isFinal: false }],
|
|
225
|
+
]);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it("delivers changed final results once before the remaining interim suffix", () => {
|
|
229
|
+
const listeners = stubSpeechRecognition();
|
|
230
|
+
const session = new WebSpeechDictationAdapter().listen();
|
|
231
|
+
const onSpeech = vi.fn();
|
|
232
|
+
const onEnd = vi.fn();
|
|
233
|
+
session.onSpeech(onSpeech);
|
|
234
|
+
session.onSpeechEnd(onEnd);
|
|
235
|
+
|
|
236
|
+
emitResults(listeners, [
|
|
237
|
+
["hello ", true],
|
|
238
|
+
["wor", false],
|
|
239
|
+
["ld", false],
|
|
240
|
+
]);
|
|
241
|
+
emitResults(
|
|
242
|
+
listeners,
|
|
243
|
+
[
|
|
244
|
+
["hello ", true],
|
|
245
|
+
["world", true],
|
|
246
|
+
],
|
|
247
|
+
1,
|
|
248
|
+
);
|
|
249
|
+
listeners.get("end")!(new Event("end"));
|
|
250
|
+
|
|
251
|
+
expect(onSpeech.mock.calls).toEqual([
|
|
252
|
+
[{ transcript: "hello ", isFinal: true }],
|
|
253
|
+
[{ transcript: "world", isFinal: false }],
|
|
254
|
+
[{ transcript: "world", isFinal: true }],
|
|
255
|
+
]);
|
|
256
|
+
expect(onEnd).toHaveBeenCalledExactlyOnceWith({
|
|
257
|
+
transcript: "hello world",
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it("clears an interim suffix while retaining earlier final results", () => {
|
|
262
|
+
const listeners = stubSpeechRecognition();
|
|
263
|
+
const session = new WebSpeechDictationAdapter().listen();
|
|
264
|
+
const onSpeech = vi.fn();
|
|
265
|
+
session.onSpeech(onSpeech);
|
|
266
|
+
|
|
267
|
+
emitResults(listeners, [
|
|
268
|
+
["hello ", true],
|
|
269
|
+
["world", false],
|
|
270
|
+
]);
|
|
271
|
+
emitResults(listeners, [["hello ", true]], 1);
|
|
272
|
+
|
|
273
|
+
expect(onSpeech.mock.calls).toEqual([
|
|
274
|
+
[{ transcript: "hello ", isFinal: true }],
|
|
275
|
+
[{ transcript: "world", isFinal: false }],
|
|
276
|
+
[{ transcript: "", isFinal: false }],
|
|
277
|
+
]);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it("keeps final-only delivery free of empty interim updates", () => {
|
|
281
|
+
const listeners = stubSpeechRecognition();
|
|
282
|
+
const session = new WebSpeechDictationAdapter().listen();
|
|
283
|
+
const onSpeech = vi.fn();
|
|
284
|
+
session.onSpeech(onSpeech);
|
|
285
|
+
|
|
286
|
+
emitResults(listeners, [["hello", true]]);
|
|
287
|
+
emitResults(listeners, [["hello", true]], 1);
|
|
288
|
+
|
|
289
|
+
expect(onSpeech).toHaveBeenCalledExactlyOnceWith({
|
|
290
|
+
transcript: "hello",
|
|
291
|
+
isFinal: true,
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it("does not drop an unconsumed final when resultIndex skips it", () => {
|
|
296
|
+
const listeners = stubSpeechRecognition();
|
|
297
|
+
const session = new WebSpeechDictationAdapter().listen();
|
|
298
|
+
const onSpeech = vi.fn();
|
|
299
|
+
const onEnd = vi.fn();
|
|
300
|
+
session.onSpeech(onSpeech);
|
|
301
|
+
session.onSpeechEnd(onEnd);
|
|
302
|
+
|
|
303
|
+
emitResults(listeners, [["hello ", false]]);
|
|
304
|
+
emitResults(
|
|
305
|
+
listeners,
|
|
306
|
+
[
|
|
307
|
+
["hello ", true],
|
|
308
|
+
["world", false],
|
|
309
|
+
],
|
|
310
|
+
1,
|
|
311
|
+
);
|
|
312
|
+
listeners.get("end")!(new Event("end"));
|
|
313
|
+
|
|
314
|
+
expect(onSpeech.mock.calls).toEqual([
|
|
315
|
+
[{ transcript: "hello ", isFinal: false }],
|
|
316
|
+
[{ transcript: "hello ", isFinal: true }],
|
|
317
|
+
[{ transcript: "world", isFinal: false }],
|
|
318
|
+
]);
|
|
319
|
+
expect(onEnd).toHaveBeenCalledExactlyOnceWith({ transcript: "hello " });
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("does not reread historical finalized results during interim updates", () => {
|
|
323
|
+
const listeners = stubSpeechRecognition();
|
|
324
|
+
new WebSpeechDictationAdapter().listen();
|
|
325
|
+
const readFinal = vi.fn(() => ({ transcript: "word " }));
|
|
326
|
+
const finals = Array.from({ length: 1_000 }, () => ({
|
|
327
|
+
get 0() {
|
|
328
|
+
return readFinal();
|
|
329
|
+
},
|
|
330
|
+
isFinal: true,
|
|
331
|
+
}));
|
|
332
|
+
listeners.get("result")!({
|
|
333
|
+
resultIndex: 0,
|
|
334
|
+
results: finals,
|
|
335
|
+
} as unknown as Event);
|
|
336
|
+
expect(readFinal).toHaveBeenCalledTimes(1_000);
|
|
337
|
+
|
|
338
|
+
for (const transcript of ["hel", "hello", "hello world"]) {
|
|
339
|
+
listeners.get("result")!({
|
|
340
|
+
resultIndex: finals.length,
|
|
341
|
+
results: [...finals, { 0: { transcript }, isFinal: false }],
|
|
342
|
+
} as unknown as Event);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
expect(readFinal).toHaveBeenCalledTimes(1_000);
|
|
346
|
+
});
|
|
347
|
+
|
|
112
348
|
it("continues notifying dictation listeners when one throws", () => {
|
|
113
349
|
const listeners = stubSpeechRecognition();
|
|
114
350
|
const listenerError = new Error("listener failed");
|
package/src/adapters/speech.ts
CHANGED
|
@@ -76,6 +76,7 @@ export class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter {
|
|
|
76
76
|
const res: SpeechSynthesisAdapter.Utterance = {
|
|
77
77
|
status: { type: "running" },
|
|
78
78
|
cancel: () => {
|
|
79
|
+
if (res.status.type === "ended") return;
|
|
79
80
|
window.speechSynthesis.cancel();
|
|
80
81
|
handleEnd("cancelled");
|
|
81
82
|
},
|
|
@@ -205,6 +206,8 @@ export class WebSpeechDictationAdapter implements DictationAdapter {
|
|
|
205
206
|
>();
|
|
206
207
|
|
|
207
208
|
let finalTranscript = "";
|
|
209
|
+
let hasInterimTranscript = false;
|
|
210
|
+
let firstInterimIndex = 0;
|
|
208
211
|
|
|
209
212
|
const session: DictationAdapter.Session = {
|
|
210
213
|
status: { type: "starting" },
|
|
@@ -267,32 +270,36 @@ export class WebSpeechDictationAdapter implements DictationAdapter {
|
|
|
267
270
|
|
|
268
271
|
recognition.addEventListener("result", (event) => {
|
|
269
272
|
const speechEvent = event as unknown as SpeechRecognitionEvent;
|
|
273
|
+
let interimTranscript = "";
|
|
270
274
|
|
|
271
|
-
for (
|
|
272
|
-
let i = speechEvent.resultIndex;
|
|
273
|
-
i < speechEvent.results.length;
|
|
274
|
-
i++
|
|
275
|
-
) {
|
|
275
|
+
for (let i = firstInterimIndex; i < speechEvent.results.length; i++) {
|
|
276
276
|
const result = speechEvent.results[i];
|
|
277
277
|
if (!result) continue;
|
|
278
278
|
|
|
279
279
|
const transcript = result[0]?.transcript ?? "";
|
|
280
280
|
|
|
281
281
|
if (result.isFinal) {
|
|
282
|
+
firstInterimIndex = i + 1;
|
|
282
283
|
finalTranscript += transcript;
|
|
284
|
+
hasInterimTranscript = false;
|
|
283
285
|
notifyEventListeners(
|
|
284
286
|
speechCallbacks,
|
|
285
287
|
() => ({ transcript, isFinal: true }),
|
|
286
288
|
"Dictation",
|
|
287
289
|
);
|
|
288
290
|
} else {
|
|
289
|
-
|
|
290
|
-
speechCallbacks,
|
|
291
|
-
() => ({ transcript, isFinal: false }),
|
|
292
|
-
"Dictation",
|
|
293
|
-
);
|
|
291
|
+
interimTranscript += transcript;
|
|
294
292
|
}
|
|
295
293
|
}
|
|
294
|
+
|
|
295
|
+
if (interimTranscript || hasInterimTranscript) {
|
|
296
|
+
hasInterimTranscript = interimTranscript.length > 0;
|
|
297
|
+
notifyEventListeners(
|
|
298
|
+
speechCallbacks,
|
|
299
|
+
() => ({ transcript: interimTranscript, isFinal: false }),
|
|
300
|
+
"Dictation",
|
|
301
|
+
);
|
|
302
|
+
}
|
|
296
303
|
});
|
|
297
304
|
|
|
298
305
|
recognition.addEventListener("speechend", () => {
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
ExportedMessageRepositoryItem,
|
|
8
8
|
} from "../runtime/utils/message-repository";
|
|
9
9
|
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
10
|
+
import type { ThreadMessage } from "../types";
|
|
10
11
|
|
|
11
12
|
export interface MessageStorageEntry<TPayload> {
|
|
12
13
|
id: string;
|
|
@@ -52,6 +53,8 @@ export type GenericThreadHistoryAdapter<TMessage> = {
|
|
|
52
53
|
options?: {
|
|
53
54
|
durationMs?: number;
|
|
54
55
|
stepTimestamps?: { start_ms: number; end_ms: number }[];
|
|
56
|
+
/** The thread message the items were persisted from; its status and timing complete a report the stored format cannot carry. */
|
|
57
|
+
message?: ThreadMessage;
|
|
55
58
|
},
|
|
56
59
|
): void;
|
|
57
60
|
};
|