@assistant-ui/core 0.3.19 → 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/suggestion.d.ts +5 -6
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +6 -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/internal/duplicate-detection.d.ts +1 -2
- package/dist/internal/duplicate-detection.d.ts.map +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/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/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 +20 -34
- 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/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/RemoteThreadList.d.ts +2 -3
- package/dist/react/client/RemoteThreadList.d.ts.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/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/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/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/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 +2 -3
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.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 +3 -4
- package/dist/react/primitives/part/PartMessages.d.ts.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/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/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 +2 -3
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +17 -4
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +1 -2
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +11 -3
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +63 -2
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +4 -5
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.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 +1 -2
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.js +1 -1
- 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 +6 -6
- package/dist/react/runtimes/external-message-converter.d.ts.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 +2 -2
- 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 +7 -8
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +2 -3
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +1 -2
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -1
- 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/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 +1 -2
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +8 -3
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +71 -27
- 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 +17 -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 +5 -4
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +9 -1
- 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 +7 -8
- package/dist/runtime/utils/auto-status.d.ts.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 +15 -16
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +3 -2
- 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/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 +5 -5
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/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 +29 -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/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 +9 -4
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +53 -9
- 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/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 +15 -11
- 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 +3 -4
- package/dist/store/clients/thread-tasks.d.ts.map +1 -1
- package/dist/store/env.d.ts +1 -2
- package/dist/store/env.d.ts.map +1 -1
- 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 +2 -2
- 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/useSubscribable.d.ts +1 -2
- package/dist/store/runtime-clients/useSubscribable.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 +4 -5
- package/dist/store/scopes/task.d.ts.map +1 -1
- 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 +5 -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 -16
- package/dist/subscribable/subscribable.d.ts.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/message.d.ts +48 -46
- 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/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 +2 -3
- package/dist/utils/getGroupStatus.d.ts.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/package.json +14 -13
- package/src/adapters/attachment.ts +8 -1
- package/src/adapters/feedback.ts +1 -0
- package/src/model-context/frame/provider.test.ts +45 -20
- package/src/react/RuntimeAdapter.test.ts +4 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +117 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +27 -74
- package/src/react/client/Interactables.test.ts +12 -7
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +9 -3
- package/src/react/client/RemoteThreadList.test.ts +5 -6
- package/src/react/interactables-legacy/Interactables.test.ts +9 -3
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +40 -22
- package/src/react/model-context/useInteractable.test.tsx +56 -29
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +5 -5
- 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 +4 -1
- package/src/react/primitives/thread/ThreadMessages.test.tsx +25 -7
- 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/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.tsx +102 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +24 -11
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +8 -4
- package/src/react/runtimes/cloud/auiV0.ts +121 -1
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +522 -0
- package/src/react/runtimes/external-message-converter.test.ts +7 -3
- 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 +5 -1
- package/src/runtime/api/message-part-runtime.ts +4 -1
- package/src/runtime/api/message-runtime.ts +15 -2
- package/src/runtime/base/base-thread-runtime-core.test.ts +761 -18
- package/src/runtime/base/base-thread-runtime-core.ts +89 -26
- 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 +2 -0
- package/src/runtime/queue/message-queue.ts +11 -1
- package/src/runtime/utils/external-message-conversion.test.ts +43 -0
- package/src/runtime/utils/external-message-conversion.ts +6 -2
- package/src/runtime/utils/stored-message-parts.ts +174 -0
- package/src/runtime/utils/thread-message-like.ts +7 -2
- package/src/runtimes/external-store/external-store-adapter.ts +4 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +44 -9
- package/src/runtimes/local/local-thread-runtime-core.test.ts +168 -12
- package/src/runtimes/local/local-thread-runtime-core.ts +80 -9
- package/src/store/clients/external-thread.ts +34 -13
- package/src/store/primitive-predicates.test.ts +16 -0
- package/src/store/primitive-predicates.ts +4 -1
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +110 -0
- package/src/store/scopes/message.ts +4 -1
- package/src/subscribable/subscribable.test.ts +7 -2
- package/src/tests/attachment-adapters.test.ts +16 -1
- package/src/tests/auiV0Encode.test.ts +4 -0
- package/src/tests/base-composer-runtime-core-addAttachment.test.ts +6 -6
- package/src/tests/base-composer-runtime-core.test.ts +16 -5
- 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 +229 -27
- package/src/tests/external-store-thread-runtime-core.test.ts +31 -0
- package/src/tests/external-thread-attachments.test.tsx +22 -23
- package/src/tests/external-thread-feedback.test.tsx +20 -7
- package/src/tests/external-thread-parity.test.tsx +1 -1
- package/src/tests/message-queue.test.ts +45 -10
- package/src/tests/thread-switch-events.test.tsx +11 -7
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +2 -1
- package/src/types/message.test.ts +19 -0
- package/src/types/message.ts +16 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGroupStatus.d.ts","names":[],"sources":["../../src/utils/getGroupStatus.ts"],"mappings":";;KAMK;WACM,QAAQ,oBAAoB;;
|
|
1
|
+
{"version":3,"file":"getGroupStatus.d.ts","names":[],"sources":["../../src/utils/getGroupStatus.ts"],"mappings":";;KAMK;WACM,QAAQ,oBAAoB;;qBAG1B,iBACX,iBAAiB,kCAChB,oBAAoB;qBAQV,kBACX,iBAAiB,+BACjB;UADiB"}
|
package/dist/utils/id.d.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated This API is experimental and may change without notice.
|
|
4
4
|
*/
|
|
5
|
-
declare const generateId: (size?: number) => string;
|
|
6
|
-
declare const generateErrorMessageId: () => string;
|
|
7
|
-
declare const isErrorMessageId: (id: string) => boolean;
|
|
5
|
+
export declare const generateId: (size?: number) => string;
|
|
6
|
+
export declare const generateErrorMessageId: () => string;
|
|
7
|
+
export declare const isErrorMessageId: (id: string) => boolean;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { generateErrorMessageId, generateId, isErrorMessageId };
|
|
10
9
|
//# sourceMappingURL=id.d.ts.map
|
package/dist/utils/id.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.d.ts","names":[],"sources":["../../src/utils/id.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"id.d.ts","names":[],"sources":["../../src/utils/id.ts"],"mappings":";;;;qBAKa,aAAU;qBAMV;qBACA,mBAAoB"}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* one on the wire reads it from the bytes rather than assuming a format. Never
|
|
8
8
|
* throws: the input is whatever a caller put on the part.
|
|
9
9
|
*/
|
|
10
|
-
declare function detectImageMediaType(base64: string): string | undefined;
|
|
10
|
+
export declare function detectImageMediaType(base64: string): string | undefined;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { detectImageMediaType };
|
|
13
12
|
//# sourceMappingURL=image-media-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-media-type.d.ts","names":[],"sources":["../../src/utils/image-media-type.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"image-media-type.d.ts","names":[],"sources":["../../src/utils/image-media-type.ts"],"mappings":";;;;;;;;;wBA4GgB,qBAAqB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/utils/invoke-user-callback.d.ts
|
|
2
|
-
declare function invokeUserCallback<TArgs extends readonly unknown[]>(tag: string, name: string, callback: ((...args: TArgs) => unknown) | undefined, ...args: TArgs): void | Promise<void>;
|
|
2
|
+
export declare function invokeUserCallback<TArgs extends readonly unknown[]>(tag: string, name: string, callback: ((...args: TArgs) => unknown) | undefined, ...args: TArgs): void | Promise<void>;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { invokeUserCallback };
|
|
5
4
|
//# sourceMappingURL=invoke-user-callback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke-user-callback.d.ts","names":[],"sources":["../../src/utils/invoke-user-callback.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"invoke-user-callback.d.ts","names":[],"sources":["../../src/utils/invoke-user-callback.ts"],"mappings":";wBAAgB,mBAAmB,kCACjC,aACA,cACA,eAAe,MAAM,mCAClB,MAAM,eACD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/utils/json/is-json-equal.d.ts
|
|
2
|
-
declare const isJSONValueEqual: (a: unknown, b: unknown) => boolean;
|
|
2
|
+
export declare const isJSONValueEqual: (a: unknown, b: unknown) => boolean;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { isJSONValueEqual };
|
|
5
4
|
//# sourceMappingURL=is-json-equal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-json-equal.d.ts","names":[],"sources":["../../../src/utils/json/is-json-equal.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"is-json-equal.d.ts","names":[],"sources":["../../../src/utils/json/is-json-equal.ts"],"mappings":";qBA4Ca,mBAAoB,YAAY"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReadonlyJSONArray, ReadonlyJSONObject, ReadonlyJSONValue } from "assistant-stream/utils";
|
|
2
2
|
//#region src/utils/json/is-json.d.ts
|
|
3
|
-
declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
4
|
-
declare function isJSONValue(value: unknown, currentDepth?: number): value is ReadonlyJSONValue;
|
|
5
|
-
declare function isJSONArray(value: unknown): value is ReadonlyJSONArray;
|
|
6
|
-
declare function isJSONObject(value: unknown): value is ReadonlyJSONObject;
|
|
3
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
4
|
+
export declare function isJSONValue(value: unknown, currentDepth?: number): value is ReadonlyJSONValue;
|
|
5
|
+
export declare function isJSONArray(value: unknown): value is ReadonlyJSONArray;
|
|
6
|
+
export declare function isJSONObject(value: unknown): value is ReadonlyJSONObject;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { isJSONArray, isJSONObject, isJSONValue, isRecord };
|
|
9
8
|
//# sourceMappingURL=is-json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-json.d.ts","names":[],"sources":["../../../src/utils/json/is-json.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"is-json.d.ts","names":[],"sources":["../../../src/utils/json/is-json.ts"],"mappings":";;wBAMgB,SAAS,iBAAiB,SAAS;wBAInC,YACd,gBACA,wBACC,SAAS;wBAiCI,YAAY,iBAAiB,SAAS;wBAItC,aAAa,iBAAiB,SAAS"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReadonlyJSONObject } from "assistant-stream/utils";
|
|
2
2
|
//#region src/utils/json/stable-stringify-tool-args.d.ts
|
|
3
|
-
declare const trackToolArgsKeyOrder: (keyOrderCache: Map<string, Map<string, string[]>> | undefined, cacheKey: string, args: ReadonlyJSONObject) => void;
|
|
4
|
-
declare const stableStringifyToolArgs: (keyOrderCache: Map<string, Map<string, string[]>> | undefined, cacheKey: string, args: ReadonlyJSONObject) => string;
|
|
3
|
+
export declare const trackToolArgsKeyOrder: (keyOrderCache: Map<string, Map<string, string[]>> | undefined, cacheKey: string, args: ReadonlyJSONObject) => void;
|
|
4
|
+
export declare const stableStringifyToolArgs: (keyOrderCache: Map<string, Map<string, string[]>> | undefined, cacheKey: string, args: ReadonlyJSONObject) => string;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { stableStringifyToolArgs, trackToolArgsKeyOrder };
|
|
7
6
|
//# sourceMappingURL=stable-stringify-tool-args.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stable-stringify-tool-args.d.ts","names":[],"sources":["../../../src/utils/json/stable-stringify-tool-args.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"stable-stringify-tool-args.d.ts","names":[],"sources":["../../../src/utils/json/stable-stringify-tool-args.ts"],"mappings":";;qBAgDa,wBACX,eAAe,YAAY,oCAC3B,kBACA,MAAM;qBAMK,0BACX,eAAe,YAAY,oCAC3B,kBACA,MAAM"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { MessagePartStatus, ThreadAssistantMessagePart, ThreadMessage, ThreadUserMessagePart, ToolCallMessagePartStatus } from "../types/message.js";
|
|
2
2
|
//#region src/utils/normalizePartStatus.d.ts
|
|
3
|
-
declare const COMPLETE_STATUS: MessagePartStatus;
|
|
4
|
-
declare const RUNNING_STATUS: MessagePartStatus;
|
|
5
|
-
declare const normalizePartStatus: (part: ThreadUserMessagePart | ThreadAssistantMessagePart) => MessagePartStatus | undefined;
|
|
6
|
-
declare const toMessagePartStatus: (message: ThreadMessage, partIndex: number, part: ThreadUserMessagePart | ThreadAssistantMessagePart) => ToolCallMessagePartStatus;
|
|
3
|
+
export declare const COMPLETE_STATUS: MessagePartStatus;
|
|
4
|
+
export declare const RUNNING_STATUS: MessagePartStatus;
|
|
5
|
+
export declare const normalizePartStatus: (part: ThreadUserMessagePart | ThreadAssistantMessagePart) => MessagePartStatus | undefined;
|
|
6
|
+
export declare const toMessagePartStatus: (message: ThreadMessage, partIndex: number, part: ThreadUserMessagePart | ThreadAssistantMessagePart) => ToolCallMessagePartStatus;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { COMPLETE_STATUS, RUNNING_STATUS, normalizePartStatus, toMessagePartStatus };
|
|
9
8
|
//# sourceMappingURL=normalizePartStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePartStatus.d.ts","names":[],"sources":["../../src/utils/normalizePartStatus.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"normalizePartStatus.d.ts","names":[],"sources":["../../src/utils/normalizePartStatus.ts"],"mappings":";;qBASa,iBAAiB;qBAGjB,gBAAgB;qBAoBhB,sBACX,MAAM,wBAAwB,+BAC7B;qBAwBU,sBACX,SAAS,eACT,mBACA,MAAM,wBAAwB,+BAC7B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/utils/notify-event-listeners.d.ts
|
|
2
2
|
type EventListener<T> = (payload: T) => unknown;
|
|
3
|
-
declare const notifyEventListeners: <T>(listeners: Iterable<EventListener<T>>, payloadOrFactory: T | (() => T), errorContext: string) => void;
|
|
3
|
+
export declare const notifyEventListeners: <T>(listeners: Iterable<EventListener<T>>, payloadOrFactory: T | (() => T), errorContext: string) => void;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { notifyEventListeners };
|
|
6
5
|
//# sourceMappingURL=notify-event-listeners.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify-event-listeners.d.ts","names":[],"sources":["../../src/utils/notify-event-listeners.ts"],"mappings":";KAAK,cAAc,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"notify-event-listeners.d.ts","names":[],"sources":["../../src/utils/notify-event-listeners.ts"],"mappings":";KAAK,cAAc,MAAM,SAAS;qBAGrB,uBAAwB,GACnC,WAAW,SAAS,cAAc,KAClC,kBAAkB,WAAW,IAC7B"}
|
package/dist/utils/record.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* `Object.prototype` setter instead of defining an own property, so a record
|
|
6
6
|
* assigned into by a key the app does not control is built this way.
|
|
7
7
|
*/
|
|
8
|
-
declare const nullProtoRecord: <T>(base?: Readonly<Record<string, T>>, ...rest: readonly (Readonly<Record<string, NoInfer<T>>> | undefined)[]) => Record<string, T>;
|
|
8
|
+
export declare const nullProtoRecord: <T>(base?: Readonly<Record<string, T>>, ...rest: readonly (Readonly<Record<string, NoInfer<T>>> | undefined)[]) => Record<string, T>;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { nullProtoRecord };
|
|
11
10
|
//# sourceMappingURL=record.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","names":[],"sources":["../../src/utils/record.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"record.d.ts","names":[],"sources":["../../src/utils/record.ts"],"mappings":";;;;;;;qBAMa,kBAAmB,GAC9B,OAAO,SAAS,eAAe,QAC5B,gBAAgB,SAAS,eAAe,QAAQ,wBAClD,eAAe"}
|
|
@@ -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/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,15 +59,15 @@
|
|
|
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
73
|
"assistant-cloud": "^0.2.1"
|
|
@@ -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": "^5.0.
|
|
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
|
@@ -2,9 +2,24 @@
|
|
|
2
2
|
* @vitest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import type { Tool } from "assistant-stream";
|
|
5
6
|
import { AssistantFrameProvider } from "./provider";
|
|
6
7
|
import { FRAME_MESSAGE_CHANNEL } from "./types";
|
|
7
8
|
|
|
9
|
+
const createTool = <TResult>(
|
|
10
|
+
execute: NonNullable<
|
|
11
|
+
Extract<
|
|
12
|
+
Tool<Record<string, unknown>, TResult>,
|
|
13
|
+
{ type: "frontend" }
|
|
14
|
+
>["execute"]
|
|
15
|
+
>,
|
|
16
|
+
) =>
|
|
17
|
+
({
|
|
18
|
+
type: "frontend",
|
|
19
|
+
parameters: { type: "object", properties: {} },
|
|
20
|
+
execute,
|
|
21
|
+
}) satisfies Tool<Record<string, unknown>, TResult>;
|
|
22
|
+
|
|
8
23
|
describe("AssistantFrameProvider", () => {
|
|
9
24
|
let messageHandler: ((event: MessageEvent) => void) | undefined;
|
|
10
25
|
let parentWindow: Window;
|
|
@@ -80,7 +95,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
80
95
|
{
|
|
81
96
|
getModelContext: () => ({
|
|
82
97
|
tools: {
|
|
83
|
-
sensitiveTool:
|
|
98
|
+
sensitiveTool: createTool(execute),
|
|
84
99
|
},
|
|
85
100
|
}),
|
|
86
101
|
},
|
|
@@ -104,7 +119,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
104
119
|
const execute = vi.fn(async () => "result");
|
|
105
120
|
AssistantFrameProvider.addModelContextProvider({
|
|
106
121
|
getModelContext: () => ({
|
|
107
|
-
tools: { sensitiveTool:
|
|
122
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
108
123
|
}),
|
|
109
124
|
});
|
|
110
125
|
|
|
@@ -163,7 +178,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
163
178
|
AssistantFrameProvider.addModelContextProvider({
|
|
164
179
|
getModelContext: () => ({
|
|
165
180
|
tools: {
|
|
166
|
-
sensitiveTool:
|
|
181
|
+
sensitiveTool: createTool(execute),
|
|
167
182
|
},
|
|
168
183
|
}),
|
|
169
184
|
});
|
|
@@ -192,7 +207,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
192
207
|
});
|
|
193
208
|
AssistantFrameProvider.addModelContextProvider({
|
|
194
209
|
getModelContext: () => ({
|
|
195
|
-
tools: { sensitiveTool:
|
|
210
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
196
211
|
}),
|
|
197
212
|
});
|
|
198
213
|
|
|
@@ -233,7 +248,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
233
248
|
);
|
|
234
249
|
AssistantFrameProvider.addModelContextProvider({
|
|
235
250
|
getModelContext: () => ({
|
|
236
|
-
tools: { sensitiveTool:
|
|
251
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
237
252
|
}),
|
|
238
253
|
});
|
|
239
254
|
|
|
@@ -270,7 +285,9 @@ describe("AssistantFrameProvider", () => {
|
|
|
270
285
|
},
|
|
271
286
|
);
|
|
272
287
|
AssistantFrameProvider.addModelContextProvider({
|
|
273
|
-
getModelContext: () => ({
|
|
288
|
+
getModelContext: () => ({
|
|
289
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
290
|
+
}),
|
|
274
291
|
});
|
|
275
292
|
|
|
276
293
|
dispatchToolCall(window.location.origin, parentWindow, "tool-a");
|
|
@@ -298,7 +315,9 @@ describe("AssistantFrameProvider", () => {
|
|
|
298
315
|
},
|
|
299
316
|
);
|
|
300
317
|
AssistantFrameProvider.addModelContextProvider({
|
|
301
|
-
getModelContext: () => ({
|
|
318
|
+
getModelContext: () => ({
|
|
319
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
320
|
+
}),
|
|
302
321
|
});
|
|
303
322
|
|
|
304
323
|
dispatchToolCall(window.location.origin, parentWindow, "duplicate");
|
|
@@ -325,7 +344,9 @@ describe("AssistantFrameProvider", () => {
|
|
|
325
344
|
},
|
|
326
345
|
);
|
|
327
346
|
AssistantFrameProvider.addModelContextProvider({
|
|
328
|
-
getModelContext: () => ({
|
|
347
|
+
getModelContext: () => ({
|
|
348
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
349
|
+
}),
|
|
329
350
|
});
|
|
330
351
|
|
|
331
352
|
dispatchToolCall(window.location.origin);
|
|
@@ -371,7 +392,9 @@ describe("AssistantFrameProvider", () => {
|
|
|
371
392
|
},
|
|
372
393
|
);
|
|
373
394
|
const removeProvider = AssistantFrameProvider.addModelContextProvider({
|
|
374
|
-
getModelContext: () => ({
|
|
395
|
+
getModelContext: () => ({
|
|
396
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
397
|
+
}),
|
|
375
398
|
});
|
|
376
399
|
|
|
377
400
|
dispatchToolCall(window.location.origin);
|
|
@@ -417,7 +440,9 @@ describe("AssistantFrameProvider", () => {
|
|
|
417
440
|
},
|
|
418
441
|
);
|
|
419
442
|
const provider = {
|
|
420
|
-
getModelContext: () => ({
|
|
443
|
+
getModelContext: () => ({
|
|
444
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
445
|
+
}),
|
|
421
446
|
};
|
|
422
447
|
const removeFirst =
|
|
423
448
|
AssistantFrameProvider.addModelContextProvider(provider);
|
|
@@ -438,7 +463,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
438
463
|
const shadowedExecute = vi.fn(async () => "shadowed");
|
|
439
464
|
const removeShadowed = AssistantFrameProvider.addModelContextProvider({
|
|
440
465
|
getModelContext: () => ({
|
|
441
|
-
tools: { sensitiveTool:
|
|
466
|
+
tools: { sensitiveTool: createTool(shadowedExecute) },
|
|
442
467
|
}),
|
|
443
468
|
});
|
|
444
469
|
|
|
@@ -457,7 +482,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
457
482
|
);
|
|
458
483
|
const removeOwner = AssistantFrameProvider.addModelContextProvider({
|
|
459
484
|
getModelContext: () => ({
|
|
460
|
-
tools: { sensitiveTool:
|
|
485
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
461
486
|
}),
|
|
462
487
|
});
|
|
463
488
|
|
|
@@ -490,10 +515,10 @@ describe("AssistantFrameProvider", () => {
|
|
|
490
515
|
},
|
|
491
516
|
);
|
|
492
517
|
const removeFirst = AssistantFrameProvider.addModelContextProvider({
|
|
493
|
-
getModelContext: () => ({ tools: { firstTool:
|
|
518
|
+
getModelContext: () => ({ tools: { firstTool: createTool(execute) } }),
|
|
494
519
|
});
|
|
495
520
|
const removeSecond = AssistantFrameProvider.addModelContextProvider({
|
|
496
|
-
getModelContext: () => ({ tools: { secondTool:
|
|
521
|
+
getModelContext: () => ({ tools: { secondTool: createTool(execute) } }),
|
|
497
522
|
});
|
|
498
523
|
|
|
499
524
|
dispatchToolCall(
|
|
@@ -540,7 +565,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
540
565
|
{
|
|
541
566
|
getModelContext: () => ({
|
|
542
567
|
tools: {
|
|
543
|
-
sensitiveTool:
|
|
568
|
+
sensitiveTool: createTool(execute),
|
|
544
569
|
},
|
|
545
570
|
}),
|
|
546
571
|
},
|
|
@@ -567,7 +592,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
567
592
|
{
|
|
568
593
|
getModelContext: () => ({
|
|
569
594
|
tools: {
|
|
570
|
-
sensitiveTool:
|
|
595
|
+
sensitiveTool: createTool(execute),
|
|
571
596
|
},
|
|
572
597
|
}),
|
|
573
598
|
},
|
|
@@ -609,7 +634,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
609
634
|
AssistantFrameProvider.addModelContextProvider(
|
|
610
635
|
{
|
|
611
636
|
getModelContext: () => ({
|
|
612
|
-
tools: { sensitiveTool:
|
|
637
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
613
638
|
}),
|
|
614
639
|
subscribe: () => {
|
|
615
640
|
throw new Error("subscribe failed");
|
|
@@ -648,7 +673,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
648
673
|
expect(() =>
|
|
649
674
|
AssistantFrameProvider.addModelContextProvider({
|
|
650
675
|
getModelContext: () => ({
|
|
651
|
-
tools: { sensitiveTool:
|
|
676
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
652
677
|
}),
|
|
653
678
|
subscribe: () => {
|
|
654
679
|
dispatchToolCall(window.location.origin);
|
|
@@ -678,7 +703,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
678
703
|
let subscriptionCount = 0;
|
|
679
704
|
const provider = {
|
|
680
705
|
getModelContext: () => ({
|
|
681
|
-
tools: { sensitiveTool:
|
|
706
|
+
tools: { sensitiveTool: createTool(execute) },
|
|
682
707
|
}),
|
|
683
708
|
subscribe: () => {
|
|
684
709
|
subscriptionCount += 1;
|
|
@@ -934,7 +959,7 @@ describe("AssistantFrameProvider", () => {
|
|
|
934
959
|
{
|
|
935
960
|
getModelContext: () => ({
|
|
936
961
|
tools: {
|
|
937
|
-
sensitiveTool:
|
|
962
|
+
sensitiveTool: createTool(execute),
|
|
938
963
|
},
|
|
939
964
|
}),
|
|
940
965
|
},
|
|
@@ -5,13 +5,16 @@ import { RuntimeAdapter } from "../store";
|
|
|
5
5
|
import { ExternalStoreRuntimeCore } from "../runtimes/internal";
|
|
6
6
|
import { AssistantRuntimeImpl } from "../runtime/internal";
|
|
7
7
|
import type { ExternalStoreAdapter } from "../runtimes/external-store/external-store-adapter";
|
|
8
|
+
import type { AppendMessage } from "../types/message";
|
|
8
9
|
|
|
9
10
|
type DemoMessage = { role: "user" | "assistant"; text: string };
|
|
10
11
|
|
|
11
12
|
const createRuntime = (
|
|
12
13
|
overrides?: Partial<ExternalStoreAdapter<DemoMessage>>,
|
|
13
14
|
) => {
|
|
14
|
-
const onNew = vi.fn(
|
|
15
|
+
const onNew = vi.fn<(message: AppendMessage) => Promise<void>>(
|
|
16
|
+
async () => {},
|
|
17
|
+
);
|
|
15
18
|
const adapter: ExternalStoreAdapter<DemoMessage> = {
|
|
16
19
|
messages: [{ role: "user", text: "hi" }],
|
|
17
20
|
convertMessage: (message) => ({
|