@assistant-ui/core 0.3.20 → 0.3.21
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 +42 -34
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +51 -21
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +1 -3
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +6 -7
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/index.d.ts +14 -9
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/speech.d.ts +57 -58
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +16 -2
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +14 -16
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +54 -51
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +7 -9
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +46 -40
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/adapters/voice.js +17 -3
- package/dist/adapters/voice.js.map +1 -1
- package/dist/index.d.ts +70 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/duplicate-detection.d.ts +0 -2
- package/dist/internal/duplicate-detection.d.ts.map +1 -1
- package/dist/internal.d.ts +27 -58
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +8 -6
- package/dist/model-context/frame/host.d.ts +19 -21
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +3 -1
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +27 -28
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +6 -0
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/frame/types.d.ts +19 -21
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/frame/validate.d.ts +3 -0
- package/dist/model-context/frame/validate.d.ts.map +1 -0
- package/dist/model-context/frame/validate.js +26 -0
- package/dist/model-context/frame/validate.js.map +1 -0
- package/dist/model-context/interactable-composer-metadata.d.ts +42 -29
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +30 -6
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +6 -8
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +14 -16
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +13 -14
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +10 -11
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +32 -34
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +6 -8
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +23 -25
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +2 -5
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +24 -18
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +58 -25
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +2 -4
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +5 -7
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +1 -3
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +6 -8
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +2 -4
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +306 -101
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +32 -34
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +2 -1
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts +9 -11
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +4 -8
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +9 -10
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +32 -22
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +160 -122
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +5 -5
- package/dist/react/interactables-legacy/Interactables.d.ts +1 -3
- package/dist/react/interactables-legacy/Interactables.d.ts.map +1 -1
- package/dist/react/interactables-legacy/Interactables.js +15 -8
- package/dist/react/interactables-legacy/Interactables.js.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.d.ts +6 -8
- package/dist/react/interactables-legacy/interactable-model-context.d.ts.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.js +13 -14
- package/dist/react/interactables-legacy/interactable-model-context.js.map +1 -1
- package/dist/react/interactables-legacy/scopes.d.ts +33 -36
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +6 -8
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +6 -7
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +23 -13
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js +54 -25
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js.map +1 -1
- package/dist/react/model-context/define-mcp-toolkit.d.ts +11 -13
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +12 -4
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +0 -2
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +0 -2
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +23 -25
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +4 -6
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +4 -6
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +4 -6
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +3 -4
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +0 -2
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +37 -24
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +2 -5
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +5 -7
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +2 -5
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +8 -11
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +11 -13
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +2 -3
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +2 -4
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +37 -36
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +10 -8
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +3 -5
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +5 -6
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +6 -8
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +4 -6
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +2 -4
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +2 -4
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +3 -5
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +2 -4
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +2 -4
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +3 -5
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +1 -3
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +2 -4
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +4 -6
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +0 -2
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +2 -4
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +6 -8
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.js +4 -4
- package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +0 -2
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +0 -2
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +2 -4
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +0 -2
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +5 -7
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +25 -26
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +22 -23
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +10 -9
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +11 -14
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +26 -28
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +16 -6
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +26 -23
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +14 -15
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +120 -117
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -3
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +199 -185
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +124 -82
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +6 -8
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +2 -4
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +13 -15
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +54 -56
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +20 -21
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.js +24 -5
- package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +22 -23
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +4 -6
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +3 -5
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +3 -5
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +2 -4
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +2 -4
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +2 -4
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +2 -4
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +2 -4
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +5 -7
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +2 -4
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +3 -5
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.js +5 -1
- package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +3 -5
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +3 -6
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +209 -219
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +53 -39
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +185 -196
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +13 -4
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +14 -19
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.js +3 -1
- package/dist/react/runtimes/RemoteThreadResource.js.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +8 -9
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +9 -11
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +4 -5
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js +9 -2
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.d.ts +7 -9
- package/dist/react/runtimes/assistant-transport/runManager.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.js +4 -1
- package/dist/react/runtimes/assistant-transport/runManager.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/types.d.ts +106 -100
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +3 -5
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js +17 -6
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts +2 -4
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +1 -3
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +5 -7
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +410 -213
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +14 -16
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +8 -4
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +136 -123
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +60 -9
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +9 -10
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +4 -5
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +1 -3
- 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 +2 -4
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +8 -9
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +14 -17
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.js.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +11 -13
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +14 -18
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-store-history-copy.d.ts +25 -0
- package/dist/react/runtimes/external-store-history-copy.d.ts.map +1 -0
- package/dist/react/runtimes/external-store-history-copy.js +148 -0
- package/dist/react/runtimes/external-store-history-copy.js.map +1 -0
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +2 -4
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.js +72 -35
- package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts +1 -3
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +26 -37
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +142 -34
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +2 -4
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +1 -3
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +3 -5
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +46 -43
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +8 -11
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +50 -49
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +17 -19
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/types/store-augmentation.d.ts +10 -11
- package/dist/react/types/store-augmentation.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +5 -6
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +28 -29
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +1 -3
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +2 -4
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +26 -28
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +46 -43
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/bindings.d.ts +31 -30
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +207 -193
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +4 -0
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +28 -26
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +22 -0
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +87 -84
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +1 -1
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +48 -50
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +64 -66
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +73 -76
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +299 -300
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +2 -1
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +8 -10
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +149 -99
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +400 -122
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +120 -108
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +109 -41
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +29 -29
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +10 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +27 -29
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +21 -6
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +14 -16
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +7 -9
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +88 -72
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +63 -65
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +210 -197
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +25 -20
- package/dist/runtime/internal.d.ts.map +1 -0
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +35 -37
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +29 -31
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +1 -1
- package/dist/runtime/queue/queue-item.d.ts +5 -7
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +7 -8
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +13 -11
- package/dist/runtime/utils/attachment-add-operations.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.js +24 -2
- package/dist/runtime/utils/attachment-add-operations.js.map +1 -1
- package/dist/runtime/utils/attachment-send-operations.d.ts +12 -0
- package/dist/runtime/utils/attachment-send-operations.d.ts.map +1 -0
- package/dist/runtime/utils/attachment-send-operations.js +34 -0
- package/dist/runtime/utils/attachment-send-operations.js.map +1 -0
- package/dist/runtime/utils/auto-status.d.ts +4 -5
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +3 -5
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +26 -27
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +32 -32
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +3 -3
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +2 -4
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +21 -23
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +50 -51
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +8 -7
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/pending-tool-calls.d.ts +10 -11
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +6 -8
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +4 -6
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.d.ts +5 -5
- package/dist/runtime/utils/stored-message-parts.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.js +22 -2
- package/dist/runtime/utils/stored-message-parts.js.map +1 -1
- package/dist/runtime/utils/streaming-timing.d.ts +19 -21
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +36 -32
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +16 -6
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts +4 -5
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.js +31 -4
- package/dist/runtime/utils/thread-runtime-lifecycle.js.map +1 -1
- package/dist/runtime/utils/tool-call-tree.d.ts +6 -8
- package/dist/runtime/utils/tool-call-tree.d.ts.map +1 -1
- package/dist/runtime/utils/tool-interactions.d.ts +10 -0
- package/dist/runtime/utils/tool-interactions.d.ts.map +1 -0
- package/dist/runtime/utils/tool-interactions.js +92 -0
- package/dist/runtime/utils/tool-interactions.js.map +1 -0
- package/dist/runtimes/assistant-transport/utils.d.ts +0 -2
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +215 -198
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +5 -6
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js +4 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-shared-options.d.ts +1 -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 +38 -40
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js +2 -2
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +117 -124
- 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 +44 -14
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +3 -5
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +94 -95
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.js +3 -0
- package/dist/runtimes/inert/InertThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/internal.d.ts +20 -16
- package/dist/runtimes/internal.d.ts.map +1 -0
- package/dist/runtimes/local/local-runtime-core.d.ts +6 -8
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +40 -42
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +40 -42
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +93 -97
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +178 -31
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +1 -3
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +76 -53
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +28 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +11 -13
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +2 -4
- 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 -3
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +33 -29
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.js +8 -3
- package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +44 -46
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.js +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +25 -26
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +3 -5
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +111 -112
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +144 -145
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +22 -7
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/chain-of-thought-client.d.ts +7 -9
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +53 -54
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +1256 -731
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +1 -3
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +2 -4
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.js +3 -1
- package/dist/store/clients/no-op-composer-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +1 -3
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +3 -4
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/submission-message.d.ts +8 -0
- package/dist/store/clients/submission-message.d.ts.map +1 -0
- package/dist/store/clients/submission-message.js +22 -0
- package/dist/store/clients/submission-message.js.map +1 -0
- package/dist/store/clients/suggestions.d.ts +5 -7
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +10 -9
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.js +81 -82
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/clients/thread-selection-events.d.ts +0 -2
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +4 -6
- package/dist/store/clients/thread-tasks.d.ts.map +1 -1
- package/dist/store/env.d.ts +0 -2
- package/dist/store/env.d.ts.map +1 -1
- package/dist/store/index.d.ts +33 -36
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -5
- package/dist/store/internal.d.ts +12 -12
- package/dist/store/internal.d.ts.map +1 -0
- package/dist/store/internal.js +2 -2
- package/dist/store/primitive-predicates.d.ts +3 -4
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +9 -4
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +3 -5
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +10 -12
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +65 -62
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/handle-runtime-action.d.ts +0 -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 +0 -2
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +1 -3
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +3 -5
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.js +26 -16
- package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +9 -9
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +121 -113
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +4 -6
- 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 +5 -7
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +3 -5
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +221 -158
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/useSubscribable.d.ts +2 -4
- package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -1
- package/dist/store/scope-registration.d.ts +28 -29
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/attachment.d.ts +15 -17
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +28 -29
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +141 -128
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +114 -107
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +7 -9
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +49 -45
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +18 -20
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +10 -12
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +13 -15
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +23 -25
- package/dist/store/scopes/task.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.d.ts +63 -65
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +192 -194
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +45 -47
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +58 -53
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +35 -7
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/types/attachment.d.ts +26 -27
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +4 -4
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +11 -13
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +7 -8
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/message.d.ts +322 -284
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +2 -4
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +8 -10
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +0 -2
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +0 -2
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +8 -11
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +10 -12
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +17 -18
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/id.d.ts +0 -2
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +0 -2
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +0 -2
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +0 -2
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +1 -3
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +1 -3
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +2 -3
- package/dist/utils/normalizePartStatus.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.js +3 -2
- package/dist/utils/normalizePartStatus.js.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 +0 -2
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +0 -2
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +1 -3
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +0 -2
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/adapters/attachment.test.ts +98 -1
- package/src/adapters/attachment.ts +70 -20
- package/src/adapters/speech.test.ts +94 -0
- package/src/adapters/speech.ts +16 -2
- package/src/adapters/thread-history.ts +16 -5
- package/src/adapters/voice.test.ts +169 -0
- package/src/adapters/voice.ts +25 -4
- package/src/index.ts +14 -2
- package/src/internal.ts +7 -0
- package/src/model-context/frame/host.test.ts +51 -1
- package/src/model-context/frame/host.ts +3 -1
- package/src/model-context/frame/provider.test.ts +61 -0
- package/src/model-context/frame/provider.ts +8 -1
- package/src/model-context/frame/validate.ts +57 -0
- package/src/model-context/interactable-composer-metadata.test.ts +82 -0
- package/src/model-context/interactable-composer-metadata.ts +45 -2
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +594 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +98 -35
- package/src/react/client/Interactables.test.ts +853 -1
- package/src/react/client/Interactables.ts +325 -45
- package/src/react/client/RemoteThreadList.initialize-failure.test.ts +124 -0
- package/src/react/client/RemoteThreadList.ts +6 -0
- package/src/react/client/Tools.ts +2 -3
- package/src/react/client/interactable-model-context.test.ts +56 -13
- package/src/react/client/interactable-model-context.ts +48 -23
- package/src/react/index.ts +2 -2
- package/src/react/interactables-legacy/Interactables.test.ts +212 -1
- package/src/react/interactables-legacy/Interactables.ts +25 -14
- package/src/react/interactables-legacy/interactable-model-context.ts +26 -24
- package/src/react/interactables-shared/useInteractablePersistenceQueue.test.tsx +22 -2
- package/src/react/interactables-shared/useInteractablePersistenceQueue.ts +63 -11
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +33 -0
- package/src/react/primitive-hooks/useSuggestionTrigger.ts +7 -4
- package/src/react/primitives/generativeUI/GenerativeUI.test.tsx +124 -8
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +35 -15
- package/src/react/primitives/message/MessageAttachments.test.tsx +2 -6
- package/src/react/primitives/message/MessageAttachments.tsx +14 -8
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +151 -7
- package/src/react/primitives/message/MessageGroupedParts.tsx +19 -6
- package/src/react/primitives/message/MessageParts.test.tsx +84 -0
- package/src/react/primitives/message/MessageParts.tool-interaction.test.tsx +69 -0
- package/src/react/primitives/message/MessageParts.tsx +29 -8
- package/src/react/primitives/thread/ThreadSuggestions.test.tsx +97 -0
- package/src/react/primitives/thread/ThreadSuggestions.tsx +29 -6
- package/src/react/providers/ReadonlyThreadProvider.tsx +2 -2
- package/src/react/providers/TextMessagePartProvider.tsx +3 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.running.test.tsx +93 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +160 -3
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +38 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +73 -53
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +19 -3
- package/src/react/runtimes/RemoteThreadResource.ts +5 -2
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.test.ts +3 -1
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.ts +10 -2
- package/src/react/runtimes/assistant-transport/runManager.ts +3 -0
- package/src/react/runtimes/assistant-transport/transport-parentid.test.tsx +57 -0
- package/src/react/runtimes/assistant-transport/transport-thread-id.test.tsx +571 -0
- package/src/react/runtimes/assistant-transport/types.ts +9 -1
- package/src/react/runtimes/assistant-transport/useAssistantTransport.spec.md +10 -0
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.test.tsx +42 -0
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.ts +33 -9
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.integration.test.tsx +289 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.test.tsx +471 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.engagement.test.tsx +330 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +78 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +361 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +571 -216
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +25 -0
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +7 -3
- package/src/react/runtimes/cloud/auiV0.ts +158 -9
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +352 -1
- package/src/react/runtimes/createMessageConverter.ts +9 -3
- package/src/react/runtimes/external-store-history-copy.ts +223 -0
- package/src/react/runtimes/useExternalStoreRuntime.history-copy.test.tsx +483 -0
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +76 -1
- package/src/react/runtimes/useExternalStoreRuntime.ts +25 -5
- package/src/react/runtimes/useLocalRuntime.test.tsx +145 -1
- package/src/react/runtimes/useLocalRuntime.ts +8 -5
- package/src/react/types/MessagePartComponentTypes.ts +10 -0
- package/src/react/types/scopes/interactables.ts +3 -0
- package/src/runtime/api/attachment-runtime.ts +10 -5
- package/src/runtime/api/bindings.ts +6 -1
- package/src/runtime/api/composer-runtime.ts +29 -6
- package/src/runtime/api/message-part-runtime.test.ts +215 -0
- package/src/runtime/api/message-part-runtime.ts +40 -0
- package/src/runtime/api/message-runtime.test.ts +112 -2
- package/src/runtime/api/message-runtime.ts +10 -5
- package/src/runtime/api/thread-list-item-runtime.ts +5 -5
- package/src/runtime/api/thread-list-runtime.ts +3 -3
- package/src/runtime/api/thread-runtime.test.ts +59 -0
- package/src/runtime/api/thread-runtime.ts +21 -11
- package/src/runtime/base/base-composer-runtime-core.ts +548 -153
- package/src/runtime/base/base-thread-runtime-core.test.ts +744 -9
- package/src/runtime/base/base-thread-runtime-core.ts +154 -27
- package/src/runtime/base/default-edit-composer-runtime-core.ts +13 -1
- package/src/runtime/base/default-thread-composer-runtime-core.ts +29 -10
- package/src/runtime/interfaces/composer-runtime-core.ts +19 -0
- package/src/runtime/interfaces/thread-runtime-core.ts +22 -1
- package/src/runtime/utils/attachment-add-operations.ts +45 -2
- package/src/runtime/utils/attachment-send-operations.ts +54 -0
- package/src/runtime/utils/auto-status.test.ts +54 -0
- package/src/runtime/utils/auto-status.ts +3 -10
- package/src/runtime/utils/external-message-conversion.test.ts +48 -0
- package/src/runtime/utils/external-message-conversion.ts +3 -4
- package/src/runtime/utils/message-repository.test.ts +69 -1
- package/src/runtime/utils/message-repository.ts +14 -7
- package/src/runtime/utils/stored-message-parts.ts +43 -1
- package/src/runtime/utils/thread-message-like.test.ts +58 -0
- package/src/runtime/utils/thread-message-like.ts +72 -46
- package/src/runtime/utils/thread-runtime-lifecycle.test.ts +67 -0
- package/src/runtime/utils/thread-runtime-lifecycle.ts +42 -8
- package/src/runtime/utils/tool-interactions.test.ts +193 -0
- package/src/runtime/utils/tool-interactions.ts +147 -0
- package/src/runtimes/external-store/external-store-adapter.ts +22 -1
- package/src/runtimes/external-store/external-store-runtime-core.ts +10 -2
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +2 -2
- package/src/runtimes/external-store/external-store-thread-runtime-core.test.ts +49 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +76 -29
- package/src/runtimes/inert/InertThreadRuntimeCore.test.ts +127 -56
- package/src/runtimes/inert/InertThreadRuntimeCore.ts +10 -1
- package/src/runtimes/local/local-thread-runtime-core.edit-cancellation.test.ts +70 -0
- package/src/runtimes/local/local-thread-runtime-core.test.ts +1649 -108
- package/src/runtimes/local/local-thread-runtime-core.ts +301 -47
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +53 -1
- package/src/runtimes/remote-thread-list/optimistic-state.ts +8 -3
- package/src/runtimes/tool-invocations/EDGE_CASES.md +19 -4
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +392 -39
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +31 -8
- package/src/store/clients/external-thread.test.ts +145 -0
- package/src/store/clients/external-thread.ts +635 -131
- package/src/store/clients/model-context-client.test.ts +8 -8
- package/src/store/clients/no-op-composer-client.ts +2 -0
- package/src/store/clients/submission-message.ts +27 -0
- package/src/store/clients/thread-message-client.test.ts +39 -0
- package/src/store/clients/thread-message-client.ts +13 -6
- package/src/store/index.ts +2 -2
- package/src/store/internal.ts +1 -0
- package/src/store/primitive-predicates.test.ts +103 -0
- package/src/store/primitive-predicates.ts +15 -3
- package/src/store/runtime-clients/composer-runtime-client.ts +4 -3
- package/src/store/runtime-clients/message-part-runtime-client.test.ts +42 -0
- package/src/store/runtime-clients/message-part-runtime-client.ts +4 -0
- package/src/store/runtime-clients/message-runtime-client.ts +5 -0
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +138 -5
- package/src/store/runtime-clients/thread-runtime-client.ts +46 -9
- package/src/store/scopes/composer.ts +22 -4
- package/src/store/scopes/message.ts +8 -0
- package/src/store/scopes/part.ts +8 -0
- package/src/subscribable/subscribable.test.ts +198 -1
- package/src/subscribable/subscribable.ts +49 -7
- package/src/tests/RemoteThreadListThreadListRuntimeCore-errors.test.ts +95 -1
- package/src/tests/auiV0Encode.test.ts +408 -1
- package/src/tests/base-composer-runtime-core-send.test.ts +722 -29
- package/src/tests/base-composer-runtime-core.test.ts +196 -0
- package/src/tests/composer-can-send.test.ts +98 -1
- package/src/tests/composer-submission.test.tsx +796 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +102 -2
- package/src/tests/external-store-thread-list-runtime-core.test.ts +111 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +581 -1
- package/src/tests/external-store-thread-runtime-core.test.ts +186 -0
- package/src/tests/external-thread-attachments.test.tsx +741 -3
- package/src/tests/external-thread-isLast.test.tsx +69 -0
- package/src/tests/get-thread-state-isRunning.test.ts +2 -2
- package/src/tests/remote-thread-list-adapter-switch.test.ts +45 -1
- package/src/types/message.ts +49 -2
- package/src/utils/normalizePartStatus.ts +14 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -15
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +0 -1
- package/dist/tests/remote-thread-list-test-helpers.js +0 -59
- package/dist/tests/remote-thread-list-test-helpers.js.map +0 -1
package/dist/react/index.js
CHANGED
|
@@ -3,6 +3,11 @@ import { Tools } from "./client/Tools.js";
|
|
|
3
3
|
import { RuntimeAdapter } from "./RuntimeAdapter.js";
|
|
4
4
|
import { AssistantProviderBase, getRenderComponent } from "./AssistantProvider.js";
|
|
5
5
|
import { AssistantRuntimeProvider } from "./AssistantRuntimeProvider.js";
|
|
6
|
+
import { useRuntimeAdapters } from "./runtimes/useRuntimeAdapters.js";
|
|
7
|
+
import { RuntimeAdapterProvider } from "./runtimes/RuntimeAdapterProvider.js";
|
|
8
|
+
import { createLocalStorageAdapter } from "./adapters/LocalStorageThreadListAdapter.js";
|
|
9
|
+
import { createSimpleTitleAdapter } from "./adapters/TitleGenerationAdapter.js";
|
|
10
|
+
import { unstable_Interactables } from "./client/Interactables.js";
|
|
6
11
|
import { useAssistantTool } from "./model-context/useAssistantTool.js";
|
|
7
12
|
import { makeAssistantTool } from "./model-context/makeAssistantTool.js";
|
|
8
13
|
import { useAssistantToolUI } from "./model-context/useAssistantToolUI.js";
|
|
@@ -26,11 +31,9 @@ import { unstable_useInteractable } from "./model-context/useInteractable.js";
|
|
|
26
31
|
import { unstable_useInteractableVersions } from "./model-context/useInteractableVersions.js";
|
|
27
32
|
import { unstable_interactableTool } from "./model-context/interactableTool.js";
|
|
28
33
|
import { useToolArgsStatus } from "./model-context/useToolArgsStatus.js";
|
|
29
|
-
import { useRuntimeAdapters } from "./runtimes/useRuntimeAdapters.js";
|
|
30
34
|
import { convertExternalMessages, createExternalMessageConversionCache, useExternalMessageConverter } from "./runtimes/external-message-converter.js";
|
|
31
35
|
import { useStreamingTiming } from "./runtimes/useStreamingTiming.js";
|
|
32
36
|
import { Interactables } from "./interactables-legacy/Interactables.js";
|
|
33
|
-
import { unstable_Interactables } from "./client/Interactables.js";
|
|
34
37
|
import { ComposerAttachmentByIndexProvider, MessageAttachmentByIndexProvider } from "./providers/AttachmentByIndexProvider.js";
|
|
35
38
|
import { ThreadListItemRuntimeProvider } from "./providers/ThreadListItemRuntimeProvider.js";
|
|
36
39
|
import { MessageByIndexProvider } from "./providers/MessageByIndexProvider.js";
|
|
@@ -42,7 +45,6 @@ import { ChainOfThoughtPartByIndexProvider } from "./providers/ChainOfThoughtPar
|
|
|
42
45
|
import { SuggestionByIndexProvider } from "./providers/SuggestionByIndexProvider.js";
|
|
43
46
|
import { QueueItemByIndexProvider } from "./providers/QueueItemByIndexProvider.js";
|
|
44
47
|
import { ReadonlyThreadProvider } from "./providers/ReadonlyThreadProvider.js";
|
|
45
|
-
import { RuntimeAdapterProvider } from "./runtimes/RuntimeAdapterProvider.js";
|
|
46
48
|
import { useExternalStoreRuntime } from "./runtimes/useExternalStoreRuntime.js";
|
|
47
49
|
import { useExternalStoreSharedOptions } from "./runtimes/useExternalStoreSharedOptions.js";
|
|
48
50
|
import { createMessageConverter } from "./runtimes/createMessageConverter.js";
|
|
@@ -56,8 +58,6 @@ import { createCloudThreadListAdapter } from "./runtimes/cloud/createCloudThread
|
|
|
56
58
|
import { useCloudThreadListAdapter } from "./runtimes/cloud/useCloudThreadListAdapter.js";
|
|
57
59
|
import { useCloudThreadListRuntime } from "./runtimes/cloud/useCloudThreadListRuntime.js";
|
|
58
60
|
import { useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState } from "./runtimes/assistant-transport/useAssistantTransportRuntime.js";
|
|
59
|
-
import { createLocalStorageAdapter } from "./adapters/LocalStorageThreadListAdapter.js";
|
|
60
|
-
import { createSimpleTitleAdapter } from "./adapters/TitleGenerationAdapter.js";
|
|
61
61
|
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveUnstable_MessageById } from "./primitives/thread/ThreadMessages.js";
|
|
62
62
|
import { getMessageQuote } from "./utils/getMessageQuote.js";
|
|
63
63
|
import { GenerativeUIRender, GenerativeUIRenderError, MessagePrimitiveGenerativeUI } from "./primitives/generativeUI/GenerativeUI.js";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ClientOutput } from "@assistant-ui/store";
|
|
2
|
-
//#region src/react/interactables-legacy/Interactables.d.ts
|
|
1
|
+
import { type ClientOutput } from "@assistant-ui/store";
|
|
3
2
|
/**
|
|
4
3
|
* @deprecated Since 2026-06-14 — migrate to the Unstable / Experimental API.
|
|
5
4
|
* Scheduled for removal on/after 2026-09-14. See
|
|
6
5
|
* {@link https://www.assistant-ui.com/docs/tools/interactables#migrating-from-the-previous-api | Interactables migration guide}.
|
|
7
6
|
*/
|
|
8
7
|
export declare const Interactables: import("@assistant-ui/tap").Resource<ClientOutput<"interactables">, []>;
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=Interactables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Interactables.d.ts","
|
|
1
|
+
{"version":3,"file":"Interactables.d.ts","sourceRoot":"","sources":["../../../src/react/interactables-legacy/Interactables.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,qBAAqB,CAAC;AAoP7B;;;;GAIG;AACH,eAAO,MAAM,aAAa,yEAA6B,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { nullProtoRecord } from "../../utils/record.js";
|
|
2
2
|
import { notifySubscribers } from "../../subscribable/subscribable.js";
|
|
3
3
|
import { ModelContext } from "../../store/clients/model-context-client.js";
|
|
4
|
-
import { buildInteractableModelContext } from "./interactable-model-context.js";
|
|
5
4
|
import { useInteractablePersistenceQueue } from "../interactables-shared/useInteractablePersistenceQueue.js";
|
|
5
|
+
import { buildInteractableModelContext } from "./interactable-model-context.js";
|
|
6
6
|
import { useAssistantScopeEffect } from "@assistant-ui/store/client";
|
|
7
|
-
import { toJSONSchema
|
|
7
|
+
import { toJSONSchema } from "assistant-stream";
|
|
8
8
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
9
9
|
import { useEffect, useRef, useState } from "@assistant-ui/tap/react-shim";
|
|
10
10
|
import { attachTransformScopes as attachTransformScopes$1, useAssistantClientRef as useAssistantClientRef$1 } from "@assistant-ui/store";
|
|
@@ -36,7 +36,7 @@ const useInteractables = () => {
|
|
|
36
36
|
t2 = /* @__PURE__ */ new Map();
|
|
37
37
|
$[2] = t2;
|
|
38
38
|
} else t2 = $[2];
|
|
39
|
-
const
|
|
39
|
+
const schemaCacheRef = useRef(t2);
|
|
40
40
|
let t3;
|
|
41
41
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
42
|
t3 = /* @__PURE__ */ new Map();
|
|
@@ -44,6 +44,8 @@ const useInteractables = () => {
|
|
|
44
44
|
} else t3 = $[3];
|
|
45
45
|
const detachedStateRef = useRef(t3);
|
|
46
46
|
const adapterRef = useRef(void 0);
|
|
47
|
+
const adapterGenerationRef = useRef(0);
|
|
48
|
+
const lastAttachedAdapterRef = useRef(void 0);
|
|
47
49
|
let t4;
|
|
48
50
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
49
51
|
t4 = () => {
|
|
@@ -75,6 +77,7 @@ const useInteractables = () => {
|
|
|
75
77
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
78
|
t6 = {
|
|
77
79
|
adapterRef,
|
|
80
|
+
adapterGenerationRef,
|
|
78
81
|
snapshot: exportState,
|
|
79
82
|
updatePersistenceStatus
|
|
80
83
|
};
|
|
@@ -109,6 +112,10 @@ const useInteractables = () => {
|
|
|
109
112
|
t8 = (adapter) => {
|
|
110
113
|
if (adapterRef.current !== adapter) flushIfPending();
|
|
111
114
|
adapterRef.current = adapter;
|
|
115
|
+
if (!adapter) return;
|
|
116
|
+
const lastAttached = lastAttachedAdapterRef.current;
|
|
117
|
+
lastAttachedAdapterRef.current = adapter;
|
|
118
|
+
if (lastAttached !== void 0 && lastAttached !== adapter) adapterGenerationRef.current = adapterGenerationRef.current + 1;
|
|
112
119
|
};
|
|
113
120
|
$[8] = flushIfPending;
|
|
114
121
|
$[9] = t8;
|
|
@@ -156,7 +163,7 @@ const useInteractables = () => {
|
|
|
156
163
|
if ($[13] !== setDefState) {
|
|
157
164
|
t11 = () => {
|
|
158
165
|
const defs = stateRef.current.definitions;
|
|
159
|
-
return buildInteractableModelContext(defs,
|
|
166
|
+
return buildInteractableModelContext(defs, schemaCacheRef.current, setDefState) ?? {};
|
|
160
167
|
};
|
|
161
168
|
$[13] = setDefState;
|
|
162
169
|
$[14] = t11;
|
|
@@ -212,12 +219,12 @@ const useInteractables = () => {
|
|
|
212
219
|
let t18;
|
|
213
220
|
if ($[26] !== flushIfPending) {
|
|
214
221
|
t18 = (def_0) => {
|
|
222
|
+
schemaCacheRef.current.delete(def_0.id);
|
|
215
223
|
try {
|
|
216
|
-
|
|
217
|
-
partialSchemaCacheRef.current.set(def_0.id, toPartialJSONSchema(jsonSchema));
|
|
224
|
+
schemaCacheRef.current.set(def_0.id, toJSONSchema(def_0.stateSchema));
|
|
218
225
|
} catch (t19) {
|
|
219
226
|
const e = t19;
|
|
220
|
-
console.warn(`[Interactables] Failed to
|
|
227
|
+
console.warn(`[Interactables] Failed to convert the state schema of "${def_0.name}" to JSON Schema. The update tool will require all fields.`, e);
|
|
221
228
|
}
|
|
222
229
|
const detached = detachedStateRef.current.get(def_0.id);
|
|
223
230
|
detachedStateRef.current.delete(def_0.id);
|
|
@@ -237,7 +244,7 @@ const useInteractables = () => {
|
|
|
237
244
|
setStateAndRef((prev_4) => {
|
|
238
245
|
const existing_1 = prev_4.definitions[def_0.id];
|
|
239
246
|
if (existing_1) detachedStateRef.current.set(def_0.id, existing_1.state);
|
|
240
|
-
|
|
247
|
+
schemaCacheRef.current.delete(def_0.id);
|
|
241
248
|
const definitions_0 = nullProtoRecord(prev_4.definitions);
|
|
242
249
|
const persistence_0 = nullProtoRecord(prev_4.persistence);
|
|
243
250
|
delete definitions_0[def_0.id];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Interactables.js","names":["useState","useEffect","useCallback","useRef","useMemo","resource","useAssistantClientRef","ClientOutput","attachTransformScopes","useAssistantScopeEffect","InteractablesState","InteractableRegistration","InteractableStateSchema","InteractablePersistedState","InteractablePersistenceAdapter","toJSONSchema","toPartialJSONSchema","ModelContext","buildInteractableModelContext","notifySubscribers","notifyStateSubscribers","useInteractablePersistenceQueue","nullProtoRecord","useInteractables","$","_c","state","setState","_temp","clientRef","stateRef","t0","Symbol","for","updater","next","current","setStateAndRef","t1","Set","subscribersRef","t2","Map","partialSchemaCacheRef","t3","detachedStateRef","adapterRef","undefined","t4","result","id","def","Object","entries","definitions","name","exportState","t5","updater_0","prev","persistence","updatePersistenceStatus","t6","snapshot","flushIfPending","schedulePersistence","flush","t7","saved","id_0","entry","set","prev_0","changed","id_1","entry_0","importState","t8","adapter","setPersistenceAdapter","t9","id_2","updater_1","prev_1","existing","setDefState","t10","id_3","selected","prev_2","existing_0","setDefSelected","t11","defs","t12","callback","add","delete","t13","getModelContext","subscribe","provider","t14","t15","t16","modelContext","register","t17","t18","def_0","jsonSchema","stateSchema","t19","e","console","warn","detached","get","prev_3","description","initialState","prev_4","existing_1","definitions_0","persistence_0","t20","getState","setSelected","Interactables","scopes","parent","source"],"sources":["../../../src/react/interactables-legacy/Interactables.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from \"react\";\nimport { resource } from \"@assistant-ui/tap\";\nimport {\n useAssistantClientRef,\n type ClientOutput,\n attachTransformScopes,\n} from \"@assistant-ui/store\";\nimport { useAssistantScopeEffect } from \"@assistant-ui/store/client\";\nimport type {\n InteractablesState,\n InteractableRegistration,\n InteractableStateSchema,\n InteractablePersistedState,\n InteractablePersistenceAdapter,\n} from \"./scopes\";\nimport { toJSONSchema, toPartialJSONSchema } from \"assistant-stream\";\nimport { ModelContext } from \"../../store\";\nimport { buildInteractableModelContext } from \"./interactable-model-context\";\nimport { notifySubscribers as notifyStateSubscribers } from \"../../subscribable/subscribable\";\nimport { useInteractablePersistenceQueue } from \"../interactables-shared/useInteractablePersistenceQueue\";\nimport { nullProtoRecord } from \"../../utils/record\";\n\nconst useInteractables = (): ClientOutput<\"interactables\"> => {\n const [state, setState] = useState<InteractablesState>(() => ({\n definitions: nullProtoRecord(),\n persistence: nullProtoRecord(),\n }));\n\n const clientRef = useAssistantClientRef();\n\n const stateRef = useRef(state);\n\n const setStateAndRef = useCallback(\n (updater: (prev: InteractablesState) => InteractablesState) => {\n const next = updater(stateRef.current);\n stateRef.current = next;\n setState(next);\n },\n [],\n );\n\n const subscribersRef = useRef(new Set<() => void>());\n const partialSchemaCacheRef = useRef(\n new Map<string, InteractableStateSchema>(),\n );\n const detachedStateRef = useRef(new Map<string, unknown>());\n\n const adapterRef = useRef<InteractablePersistenceAdapter | undefined>(\n undefined,\n );\n\n const exportState = useCallback((): InteractablePersistedState => {\n const result = nullProtoRecord<InteractablePersistedState[string]>();\n for (const [id, def] of Object.entries(stateRef.current.definitions)) {\n result[id] = { name: def.name, state: def.state };\n }\n return result;\n }, []);\n\n const updatePersistenceStatus = useCallback(\n (\n updater: (\n prev: InteractablesState[\"persistence\"],\n ) => InteractablesState[\"persistence\"],\n ) => {\n setStateAndRef((prev) => {\n const persistence = updater(prev.persistence);\n return persistence === prev.persistence\n ? prev\n : { ...prev, persistence };\n });\n },\n [setStateAndRef],\n );\n\n const { flushIfPending, schedulePersistence, flush } =\n useInteractablePersistenceQueue({\n adapterRef,\n snapshot: exportState,\n updatePersistenceStatus,\n });\n\n const importState = useCallback(\n (saved: InteractablePersistedState) => {\n for (const [id, entry] of Object.entries(saved)) {\n detachedStateRef.current.set(id, entry.state);\n }\n setStateAndRef((prev) => {\n let changed = false;\n const definitions = nullProtoRecord(prev.definitions);\n for (const [id, entry] of Object.entries(saved)) {\n if (definitions[id]) {\n definitions[id] = { ...definitions[id], state: entry.state };\n changed = true;\n }\n }\n return changed ? { ...prev, definitions } : prev;\n });\n },\n [setStateAndRef],\n );\n\n const setPersistenceAdapter = useCallback(\n (adapter: InteractablePersistenceAdapter | undefined) => {\n if (adapterRef.current !== adapter) flushIfPending();\n adapterRef.current = adapter;\n },\n [flushIfPending],\n );\n\n const setDefState = useCallback(\n (id: string, updater: (prev: unknown) => unknown) => {\n setStateAndRef((prev) => {\n const existing = prev.definitions[id];\n if (!existing) return prev;\n return {\n ...prev,\n definitions: nullProtoRecord(prev.definitions, {\n [id]: { ...existing, state: updater(existing.state) },\n }),\n };\n });\n if (stateRef.current.definitions[id]) schedulePersistence(id);\n },\n [schedulePersistence, setStateAndRef],\n );\n\n const setDefSelected = useCallback(\n (id: string, selected: boolean) => {\n setStateAndRef((prev) => {\n const existing = prev.definitions[id];\n if (!existing) return prev;\n return {\n ...prev,\n definitions: nullProtoRecord(prev.definitions, {\n [id]: { ...existing, selected },\n }),\n };\n });\n },\n [setStateAndRef],\n );\n\n const provider = useMemo(\n () => ({\n getModelContext: () => {\n const defs = stateRef.current.definitions;\n return (\n buildInteractableModelContext(\n defs,\n partialSchemaCacheRef.current,\n setDefState,\n ) ?? {}\n );\n },\n subscribe: (callback: () => void) => {\n subscribersRef.current.add(callback);\n return () => {\n subscribersRef.current.delete(callback);\n };\n },\n }),\n [setDefState],\n );\n\n useEffect(() => {\n notifyStateSubscribers(subscribersRef.current);\n }, [state]);\n\n useAssistantScopeEffect(\n \"modelContext\",\n () => clientRef.current!.modelContext().register(provider),\n [provider],\n );\n\n const register = useCallback(\n (def: InteractableRegistration) => {\n try {\n const jsonSchema = toJSONSchema(def.stateSchema);\n partialSchemaCacheRef.current.set(\n def.id,\n toPartialJSONSchema(jsonSchema),\n );\n } catch (e) {\n console.warn(\n `[Interactables] Failed to create partial schema for \"${def.name}\". The update tool will require all fields.`,\n e,\n );\n }\n\n const detached = detachedStateRef.current.get(def.id);\n detachedStateRef.current.delete(def.id);\n\n setStateAndRef((prev) => ({\n ...prev,\n definitions: nullProtoRecord(prev.definitions, {\n [def.id]: {\n id: def.id,\n name: def.name,\n description: def.description,\n stateSchema: def.stateSchema,\n state:\n prev.definitions[def.id]?.state ?? detached ?? def.initialState,\n selected: def.selected,\n },\n }),\n }));\n\n return () => {\n flushIfPending();\n setStateAndRef((prev) => {\n const existing = prev.definitions[def.id];\n if (existing) {\n detachedStateRef.current.set(def.id, existing.state);\n }\n partialSchemaCacheRef.current.delete(def.id);\n const definitions = nullProtoRecord(prev.definitions);\n const persistence = nullProtoRecord(prev.persistence);\n delete definitions[def.id];\n delete persistence[def.id];\n return { ...prev, definitions, persistence };\n });\n };\n },\n [flushIfPending, setStateAndRef],\n );\n\n return {\n getState: () => state,\n register,\n setState: setDefState,\n setSelected: setDefSelected,\n exportState,\n importState,\n setPersistenceAdapter,\n flush,\n };\n};\n\n/**\n * @deprecated Since 2026-06-14 — migrate to the Unstable / Experimental API.\n * Scheduled for removal on/after 2026-09-14. See\n * {@link https://www.assistant-ui.com/docs/tools/interactables#migrating-from-the-previous-api | Interactables migration guide}.\n */\nexport const Interactables = resource(useInteractables);\n\nattachTransformScopes(useInteractables, (scopes, parent) => {\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n});\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAMuB,yBAAmB;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACvB,MAAA,CAAAC,OAAAC,YAA0B3B,SAA6B4B,KAGrD;CAEF,MAAAC,YAAkBvB,wBAAsB;CAExC,MAAAwB,WAAiB3B,OAAOuB,KAAK;CAAE,IAAAK;CAAA,IAAAP,EAAA,OAAAQ,OAAAC,IAAA,2BAAA,GAAA;EAG7BF,MAAAG,YAAA;GACE,MAAAC,OAAaD,QAAQJ,SAAQM,OAAQ;GACrCN,SAAQM,UAAWD;GACnBR,SAASQ,IAAI;EAAC;EACfX,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CALH,MAAAa,iBAAuBN;CAOrB,IAAAO;CAAA,IAAAd,EAAA,OAAAQ,OAAAC,IAAA,2BAAA,GAAA;EAE4BK,qBAAA,IAAIC,IAAgB;EAACf,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAnD,MAAAgB,iBAAuBrC,OAAOmC,EAAqB;CAAE,IAAAG;CAAA,IAAAjB,EAAA,OAAAQ,OAAAC,IAAA,2BAAA,GAAA;EAEnDQ,qBAAA,IAAIC,IAAqC;EAAClB,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAD5C,MAAAmB,wBAA8BxC,OAC5BsC,EACF;CAAE,IAAAG;CAAA,IAA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A;CAAA,OATMqG;AASN;;;;;;AAQH,MAAaG,gBAAgB3H,SAASkB,gBAAgB;AAEtDf,wBAAsBe,mBAAmB0G,QAAQC,WAAW;CAC1D,IAAI,CAACD,OAAOxB,gBAAgByB,OAAOzB,aAAa0B,WAAW,MACzDF,OAAOxB,eAAexF,aAAa;AAEvC,CAAC;AApOwB,SAAAW,QAAA;CAAA,OACuC;EAAA0B,aAC/ChC,gBAAgB;EAACsC,aACjBtC,gBAAgB;CAC/B;AAAC"}
|
|
1
|
+
{"version":3,"file":"Interactables.js","names":["useState","useEffect","useCallback","useRef","useMemo","resource","useAssistantClientRef","ClientOutput","attachTransformScopes","useAssistantScopeEffect","InteractablesState","InteractableRegistration","InteractablePersistedState","InteractablePersistenceAdapter","toJSONSchema","ModelContext","buildInteractableModelContext","StateJSONSchema","notifySubscribers","notifyStateSubscribers","useInteractablePersistenceQueue","nullProtoRecord","useInteractables","$","_c","state","setState","_temp","clientRef","stateRef","t0","Symbol","for","updater","next","current","setStateAndRef","t1","Set","subscribersRef","t2","Map","schemaCacheRef","t3","detachedStateRef","adapterRef","undefined","adapterGenerationRef","lastAttachedAdapterRef","t4","result","id","def","Object","entries","definitions","name","exportState","t5","updater_0","prev","persistence","updatePersistenceStatus","t6","snapshot","flushIfPending","schedulePersistence","flush","t7","saved","id_0","entry","set","prev_0","changed","id_1","entry_0","importState","t8","adapter","lastAttached","setPersistenceAdapter","t9","id_2","updater_1","prev_1","existing","setDefState","t10","id_3","selected","prev_2","existing_0","setDefSelected","t11","defs","t12","callback","add","delete","t13","getModelContext","subscribe","provider","t14","t15","t16","modelContext","register","t17","t18","def_0","stateSchema","t19","e","console","warn","detached","get","prev_3","description","initialState","prev_4","existing_1","definitions_0","persistence_0","t20","getState","setSelected","Interactables","scopes","parent","source"],"sources":["../../../src/react/interactables-legacy/Interactables.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from \"react\";\nimport { resource } from \"@assistant-ui/tap\";\nimport {\n useAssistantClientRef,\n type ClientOutput,\n attachTransformScopes,\n} from \"@assistant-ui/store\";\nimport { useAssistantScopeEffect } from \"@assistant-ui/store/client\";\nimport type {\n InteractablesState,\n InteractableRegistration,\n InteractablePersistedState,\n InteractablePersistenceAdapter,\n} from \"./scopes\";\nimport { toJSONSchema } from \"assistant-stream\";\nimport { ModelContext } from \"../../store\";\nimport {\n buildInteractableModelContext,\n type StateJSONSchema,\n} from \"./interactable-model-context\";\nimport { notifySubscribers as notifyStateSubscribers } from \"../../subscribable/subscribable\";\nimport { useInteractablePersistenceQueue } from \"../interactables-shared/useInteractablePersistenceQueue\";\nimport { nullProtoRecord } from \"../../utils/record\";\n\nconst useInteractables = (): ClientOutput<\"interactables\"> => {\n const [state, setState] = useState<InteractablesState>(() => ({\n definitions: nullProtoRecord(),\n persistence: nullProtoRecord(),\n }));\n\n const clientRef = useAssistantClientRef();\n\n const stateRef = useRef(state);\n\n const setStateAndRef = useCallback(\n (updater: (prev: InteractablesState) => InteractablesState) => {\n const next = updater(stateRef.current);\n stateRef.current = next;\n setState(next);\n },\n [],\n );\n\n const subscribersRef = useRef(new Set<() => void>());\n const schemaCacheRef = useRef(new Map<string, StateJSONSchema>());\n const detachedStateRef = useRef(new Map<string, unknown>());\n\n const adapterRef = useRef<InteractablePersistenceAdapter | undefined>(\n undefined,\n );\n const adapterGenerationRef = useRef(0);\n const lastAttachedAdapterRef = useRef<\n InteractablePersistenceAdapter | undefined\n >(undefined);\n\n const exportState = useCallback((): InteractablePersistedState => {\n const result = nullProtoRecord<InteractablePersistedState[string]>();\n for (const [id, def] of Object.entries(stateRef.current.definitions)) {\n result[id] = { name: def.name, state: def.state };\n }\n return result;\n }, []);\n\n const updatePersistenceStatus = useCallback(\n (\n updater: (\n prev: InteractablesState[\"persistence\"],\n ) => InteractablesState[\"persistence\"],\n ) => {\n setStateAndRef((prev) => {\n const persistence = updater(prev.persistence);\n return persistence === prev.persistence\n ? prev\n : { ...prev, persistence };\n });\n },\n [setStateAndRef],\n );\n\n const { flushIfPending, schedulePersistence, flush } =\n useInteractablePersistenceQueue({\n adapterRef,\n adapterGenerationRef,\n snapshot: exportState,\n updatePersistenceStatus,\n });\n\n const importState = useCallback(\n (saved: InteractablePersistedState) => {\n for (const [id, entry] of Object.entries(saved)) {\n detachedStateRef.current.set(id, entry.state);\n }\n setStateAndRef((prev) => {\n let changed = false;\n const definitions = nullProtoRecord(prev.definitions);\n for (const [id, entry] of Object.entries(saved)) {\n if (definitions[id]) {\n definitions[id] = { ...definitions[id], state: entry.state };\n changed = true;\n }\n }\n return changed ? { ...prev, definitions } : prev;\n });\n },\n [setStateAndRef],\n );\n\n const setPersistenceAdapter = useCallback(\n (adapter: InteractablePersistenceAdapter | undefined) => {\n if (adapterRef.current !== adapter) flushIfPending();\n adapterRef.current = adapter;\n if (!adapter) return;\n\n // Only a genuine replacement opens a new scope, so a detach and reattach\n // of the same adapter keeps an in-flight save's failure in its own scope.\n const lastAttached = lastAttachedAdapterRef.current;\n lastAttachedAdapterRef.current = adapter;\n if (lastAttached !== undefined && lastAttached !== adapter) {\n adapterGenerationRef.current += 1;\n }\n },\n [flushIfPending],\n );\n\n const setDefState = useCallback(\n (id: string, updater: (prev: unknown) => unknown) => {\n setStateAndRef((prev) => {\n const existing = prev.definitions[id];\n if (!existing) return prev;\n return {\n ...prev,\n definitions: nullProtoRecord(prev.definitions, {\n [id]: { ...existing, state: updater(existing.state) },\n }),\n };\n });\n if (stateRef.current.definitions[id]) schedulePersistence(id);\n },\n [schedulePersistence, setStateAndRef],\n );\n\n const setDefSelected = useCallback(\n (id: string, selected: boolean) => {\n setStateAndRef((prev) => {\n const existing = prev.definitions[id];\n if (!existing) return prev;\n return {\n ...prev,\n definitions: nullProtoRecord(prev.definitions, {\n [id]: { ...existing, selected },\n }),\n };\n });\n },\n [setStateAndRef],\n );\n\n const provider = useMemo(\n () => ({\n getModelContext: () => {\n const defs = stateRef.current.definitions;\n return (\n buildInteractableModelContext(\n defs,\n schemaCacheRef.current,\n setDefState,\n ) ?? {}\n );\n },\n subscribe: (callback: () => void) => {\n subscribersRef.current.add(callback);\n return () => {\n subscribersRef.current.delete(callback);\n };\n },\n }),\n [setDefState],\n );\n\n useEffect(() => {\n notifyStateSubscribers(subscribersRef.current);\n }, [state]);\n\n useAssistantScopeEffect(\n \"modelContext\",\n () => clientRef.current!.modelContext().register(provider),\n [provider],\n );\n\n const register = useCallback(\n (def: InteractableRegistration) => {\n schemaCacheRef.current.delete(def.id);\n try {\n schemaCacheRef.current.set(def.id, toJSONSchema(def.stateSchema));\n } catch (e) {\n console.warn(\n `[Interactables] Failed to convert the state schema of \"${def.name}\" to JSON Schema. The update tool will require all fields.`,\n e,\n );\n }\n\n const detached = detachedStateRef.current.get(def.id);\n detachedStateRef.current.delete(def.id);\n\n setStateAndRef((prev) => ({\n ...prev,\n definitions: nullProtoRecord(prev.definitions, {\n [def.id]: {\n id: def.id,\n name: def.name,\n description: def.description,\n stateSchema: def.stateSchema,\n state:\n prev.definitions[def.id]?.state ?? detached ?? def.initialState,\n selected: def.selected,\n },\n }),\n }));\n\n return () => {\n flushIfPending();\n setStateAndRef((prev) => {\n const existing = prev.definitions[def.id];\n if (existing) {\n detachedStateRef.current.set(def.id, existing.state);\n }\n schemaCacheRef.current.delete(def.id);\n const definitions = nullProtoRecord(prev.definitions);\n const persistence = nullProtoRecord(prev.persistence);\n delete definitions[def.id];\n delete persistence[def.id];\n return { ...prev, definitions, persistence };\n });\n };\n },\n [flushIfPending, setStateAndRef],\n );\n\n return {\n getState: () => state,\n register,\n setState: setDefState,\n setSelected: setDefSelected,\n exportState,\n importState,\n setPersistenceAdapter,\n flush,\n };\n};\n\n/**\n * @deprecated Since 2026-06-14 — migrate to the Unstable / Experimental API.\n * Scheduled for removal on/after 2026-09-14. See\n * {@link https://www.assistant-ui.com/docs/tools/interactables#migrating-from-the-previous-api | Interactables migration guide}.\n */\nexport const Interactables = resource(useInteractables);\n\nattachTransformScopes(useInteractables, (scopes, parent) => {\n if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BAAgB;AAEtDd,wBAAsBc,mBAAmB4G,QAAQC,WAAW;CAC1D,IAAI,CAACD,OAAOvB,gBAAgBwB,OAAOxB,aAAayB,WAAW,MACzDF,OAAOvB,eAAe5F,aAAa;AAEvC,CAAC;AA7OwB,SAAAY,QAAA;CAAA,OACuC;EAAA4B,aAC/ClC,gBAAgB;EAACwC,aACjBxC,gBAAgB;CAC/B;AAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
tools: Record<string, Tool<any, any>>;
|
|
1
|
+
import type { Tool, toJSONSchema } from "assistant-stream";
|
|
2
|
+
import type { InteractableDefinition } from "./scopes.js";
|
|
3
|
+
export type StateJSONSchema = ReturnType<typeof toJSONSchema>;
|
|
4
|
+
export declare function buildInteractableModelContext(definitions: Record<string, InteractableDefinition>, schemaCache: Map<string, StateJSONSchema>, setDefState: (id: string, updater: (prev: unknown) => unknown) => void): {
|
|
5
|
+
system: string;
|
|
6
|
+
tools: Record<string, Tool<any, any>>;
|
|
8
7
|
} | undefined;
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=interactable-model-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactable-model-context.d.ts","
|
|
1
|
+
{"version":3,"file":"interactable-model-context.d.ts","sourceRoot":"","sources":["../../../src/react/interactables-legacy/interactable-model-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAiB;AAEvD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAU9D,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,EACnD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,EACzC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,KAAK,IAAI,GACrE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;CAAE,GAAG,SAAS,CA8DvE"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { overlayPartialPath } from "../../model-context/interactable-composer-metadata.js";
|
|
2
|
+
import { getPartialJsonObjectMeta } from "assistant-stream/utils";
|
|
1
3
|
//#region src/react/interactables-legacy/interactable-model-context.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return {
|
|
5
|
-
...prev,
|
|
6
|
-
...partial
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function buildInteractableModelContext(definitions, partialSchemaCache, setDefState) {
|
|
4
|
+
const withoutRootRequired = ({ required: _required, ...schema }) => schema;
|
|
5
|
+
function buildInteractableModelContext(definitions, schemaCache, setDefState) {
|
|
10
6
|
const entries = Object.values(definitions);
|
|
11
7
|
if (entries.length === 0) return void 0;
|
|
12
8
|
const byName = /* @__PURE__ */ new Map();
|
|
@@ -26,18 +22,21 @@ function buildInteractableModelContext(definitions, partialSchemaCache, setDefSt
|
|
|
26
22
|
const safeName = name.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
27
23
|
const safeId = def.id.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
28
24
|
const toolName = isMulti ? `update_${safeName}_${safeId}` : `update_${safeName}`;
|
|
29
|
-
const
|
|
25
|
+
const jsonSchema = schemaCache.get(def.id);
|
|
30
26
|
tools[toolName] = {
|
|
31
27
|
type: "frontend",
|
|
32
|
-
description: `Update the state of interactable component "${name}"${isMulti ? ` (id: ${def.id})` : ""}. Only include the fields you want to change; omitted fields keep their current values. ${def.description}`,
|
|
33
|
-
parameters:
|
|
28
|
+
description: `Update the state of interactable component "${name}"${isMulti ? ` (id: ${def.id})` : ""}. Only include the fields you want to change; omitted fields keep their current values. A nested object replaces the existing one, so send it complete. ${def.description}`,
|
|
29
|
+
parameters: jsonSchema ? withoutRootRequired(jsonSchema) : def.stateSchema,
|
|
34
30
|
streamCall: async (reader) => {
|
|
35
31
|
try {
|
|
36
|
-
for await (const partialArgs of reader.args.streamValues())
|
|
32
|
+
for await (const partialArgs of reader.args.streamValues()) {
|
|
33
|
+
const partialPath = getPartialJsonObjectMeta(partialArgs)?.partialPath;
|
|
34
|
+
setDefState(def.id, (prev) => overlayPartialPath(prev, partialArgs, partialPath));
|
|
35
|
+
}
|
|
37
36
|
} catch {}
|
|
38
37
|
},
|
|
39
38
|
execute: async (partialState) => {
|
|
40
|
-
setDefState(def.id, (prev) =>
|
|
39
|
+
setDefState(def.id, (prev) => overlayPartialPath(prev, partialState));
|
|
41
40
|
return { success: true };
|
|
42
41
|
}
|
|
43
42
|
};
|
|
@@ -49,6 +48,6 @@ function buildInteractableModelContext(definitions, partialSchemaCache, setDefSt
|
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
50
|
//#endregion
|
|
52
|
-
export { buildInteractableModelContext
|
|
51
|
+
export { buildInteractableModelContext };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=interactable-model-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactable-model-context.js","names":["Tool","
|
|
1
|
+
{"version":3,"file":"interactable-model-context.js","names":["Tool","toJSONSchema","getPartialJsonObjectMeta","overlayPartialPath","InteractableDefinition","StateJSONSchema","ReturnType","withoutRootRequired","required","_required","schema","buildInteractableModelContext","definitions","Record","schemaCache","Map","setDefState","id","updater","prev","system","tools","entries","Object","values","length","undefined","byName","def","list","get","name","push","set","systemParts","instances","isMulti","selectedTag","selected","idTag","description","JSON","stringify","state","safeName","replace","safeId","toolName","jsonSchema","type","const","parameters","stateSchema","streamCall","reader","partialArgs","args","streamValues","partialPath","execute","partialState","success","join"],"sources":["../../../src/react/interactables-legacy/interactable-model-context.ts"],"sourcesContent":["import type { Tool, toJSONSchema } from \"assistant-stream\";\nimport { getPartialJsonObjectMeta } from \"assistant-stream/utils\";\nimport { overlayPartialPath } from \"../../model-context/interactable-composer-metadata\";\nimport type { InteractableDefinition } from \"./scopes\";\n\nexport type StateJSONSchema = ReturnType<typeof toJSONSchema>;\n\n// The spread also drops the non-enumerable `~standard` zod attaches to its\n// JSON Schema output; carried over, the tool runtime would validate every\n// partial update against the full state schema.\nconst withoutRootRequired = ({\n required: _required,\n ...schema\n}: StateJSONSchema) => schema;\n\nexport function buildInteractableModelContext(\n definitions: Record<string, InteractableDefinition>,\n schemaCache: Map<string, StateJSONSchema>,\n setDefState: (id: string, updater: (prev: unknown) => unknown) => void,\n): { system: string; tools: Record<string, Tool<any, any>> } | undefined {\n const entries = Object.values(definitions);\n if (entries.length === 0) return undefined;\n\n const byName = new Map<string, InteractableDefinition[]>();\n for (const def of entries) {\n const list = byName.get(def.name) ?? [];\n list.push(def);\n byName.set(def.name, list);\n }\n\n const systemParts: string[] = [];\n const tools: Record<string, Tool<any, any>> = {};\n\n for (const [name, instances] of byName) {\n const isMulti = instances.length > 1;\n\n for (const def of instances) {\n const selectedTag = def.selected ? \" (SELECTED)\" : \"\";\n const idTag = isMulti ? ` [id=\"${def.id}\"]` : \"\";\n\n systemParts.push(\n `Interactable component \"${name}\"${idTag}${selectedTag} (${def.description}). Current state: ${JSON.stringify(def.state)}`,\n );\n\n const safeName = name.replace(/[^a-zA-Z0-9_-]/g, \"_\");\n const safeId = def.id.replace(/[^a-zA-Z0-9_-]/g, \"_\");\n const toolName = isMulti\n ? `update_${safeName}_${safeId}`\n : `update_${safeName}`;\n\n const jsonSchema = schemaCache.get(def.id);\n\n tools[toolName] = {\n type: \"frontend\" as const,\n description: `Update the state of interactable component \"${name}\"${isMulti ? ` (id: ${def.id})` : \"\"}. Only include the fields you want to change; omitted fields keep their current values. A nested object replaces the existing one, so send it complete. ${def.description}`,\n parameters: jsonSchema\n ? withoutRootRequired(jsonSchema)\n : def.stateSchema,\n streamCall: async (reader) => {\n try {\n for await (const partialArgs of reader.args.streamValues()) {\n const partialPath = getPartialJsonObjectMeta(\n partialArgs as Record<symbol, unknown>,\n )?.partialPath;\n setDefState(def.id, (prev) =>\n overlayPartialPath(prev, partialArgs, partialPath),\n );\n }\n } catch {\n // Non-fatal: execute handles the final state\n }\n },\n execute: async (partialState: unknown) => {\n setDefState(def.id, (prev) => overlayPartialPath(prev, partialState));\n return { success: true };\n },\n };\n }\n }\n\n return { system: systemParts.join(\"\\n\"), tools };\n}\n"],"mappings":";;;AAUA,MAAMO,uBAAuB,EAC3BC,UAAUC,WACV,GAAGC,aACkBA;AAEvB,SAAgBC,8BACdC,aACAE,aACAE,aACuE;CACvE,MAAMM,UAAUC,OAAOC,OAAOZ,WAAW;CACzC,IAAIU,QAAQG,WAAW,GAAG,OAAOC,KAAAA;CAEjC,MAAMC,yBAAS,IAAIZ,IAAsC;CACzD,KAAK,MAAMa,OAAON,SAAS;EACzB,MAAMO,OAAOF,OAAOG,IAAIF,IAAIG,IAAI,KAAK,CAAA;EACrCF,KAAKG,KAAKJ,GAAG;EACbD,OAAOM,IAAIL,IAAIG,MAAMF,IAAI;CAC3B;CAEA,MAAMK,cAAwB,CAAA;CAC9B,MAAMb,QAAwC,CAAC;CAE/C,KAAK,MAAM,CAACU,MAAMI,cAAcR,QAAQ;EACtC,MAAMS,UAAUD,UAAUV,SAAS;EAEnC,KAAK,MAAMG,OAAOO,WAAW;GAC3B,MAAME,cAAcT,IAAIU,WAAW,gBAAgB;GACnD,MAAMC,QAAQH,UAAU,SAASR,IAAIX,GAAE,MAAO;GAE9CiB,YAAYF,KACV,2BAA2BD,KAAI,GAAIQ,QAAQF,YAAW,IAAKT,IAAIY,YAAW,oBAAqBC,KAAKC,UAAUd,IAAIe,KAAK,GACzH;GAEA,MAAMC,WAAWb,KAAKc,QAAQ,mBAAmB,GAAG;GACpD,MAAMC,SAASlB,IAAIX,GAAG4B,QAAQ,mBAAmB,GAAG;GACpD,MAAME,WAAWX,UACb,UAAUQ,SAAQ,GAAIE,WACtB,UAAUF;GAEd,MAAMI,aAAalC,YAAYgB,IAAIF,IAAIX,EAAE;GAEzCI,MAAM0B,YAAY;IAChBE,MAAM;IACNT,aAAa,+CAA+CT,KAAI,GAAIK,UAAU,SAASR,IAAIX,GAAE,KAAM,GAAE,0JAA2JW,IAAIY;IACpQW,YAAYH,aACRzC,oBAAoByC,UAAU,IAC9BpB,IAAIwB;IACRC,YAAY,OAAOC,WAAW;KAC5B,IAAI;MACF,WAAW,MAAMC,eAAeD,OAAOE,KAAKC,aAAa,GAAG;OAC1D,MAAMC,cAAcxD,yBAClBqD,WACF,CAAC,EAAEG;OACH1C,YAAYY,IAAIX,KAAKE,SACnBhB,mBAAmBgB,MAAMoC,aAAaG,WAAW,CACnD;MACF;KACF,QAAQ,CACN;IAEJ;IACAC,SAAS,OAAOC,iBAA0B;KACxC5C,YAAYY,IAAIX,KAAKE,SAAShB,mBAAmBgB,MAAMyC,YAAY,CAAC;KACpE,OAAO,EAAEC,SAAS,KAAK;IACzB;GACF;EACF;CACF;CAEA,OAAO;EAAEzC,QAAQc,YAAY4B,KAAK,IAAI;EAAGzC;CAAM;AACjD"}
|
|
@@ -1,59 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../index.js";
|
|
3
|
-
import { Tool } from "assistant-stream";
|
|
4
|
-
//#region src/react/interactables-legacy/scopes.d.ts
|
|
1
|
+
import type { Tool } from "assistant-stream";
|
|
2
|
+
import type { Unsubscribe } from "../../index.js";
|
|
5
3
|
/**
|
|
6
4
|
* Schema type matching Tool["parameters"] from assistant-stream.
|
|
7
5
|
* Accepts both StandardSchemaV1 and JSONSchema7.
|
|
8
6
|
*/
|
|
9
7
|
export type InteractableStateSchema = NonNullable<Extract<Tool, {
|
|
10
|
-
|
|
8
|
+
parameters: unknown;
|
|
11
9
|
}>["parameters"]>;
|
|
12
10
|
export type InteractableDefinition = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
stateSchema: InteractableStateSchema;
|
|
15
|
+
state: unknown;
|
|
16
|
+
selected?: boolean | undefined;
|
|
19
17
|
};
|
|
20
18
|
export type InteractableRegistration = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
stateSchema: InteractableStateSchema;
|
|
23
|
+
initialState: unknown;
|
|
24
|
+
selected?: boolean | undefined;
|
|
27
25
|
};
|
|
28
26
|
export type InteractablePersistenceStatus = {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
error: unknown;
|
|
31
29
|
};
|
|
32
30
|
export type InteractablesState = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
/** Keyed by instance id */
|
|
32
|
+
definitions: Record<string, InteractableDefinition>;
|
|
33
|
+
/** Per-id persistence sync status */
|
|
34
|
+
persistence: Record<string, InteractablePersistenceStatus>;
|
|
37
35
|
};
|
|
38
36
|
export type InteractablePersistedState = Record<string, {
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
name: string;
|
|
38
|
+
state: unknown;
|
|
41
39
|
}>;
|
|
42
40
|
export type InteractablePersistenceAdapter = {
|
|
43
|
-
|
|
41
|
+
save(state: InteractablePersistedState): void | Promise<void>;
|
|
44
42
|
};
|
|
45
43
|
export type InteractablesMethods = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
getState(): InteractablesState;
|
|
45
|
+
register(def: InteractableRegistration): Unsubscribe;
|
|
46
|
+
setState(id: string, updater: (prev: unknown) => unknown): void;
|
|
47
|
+
setSelected(id: string, selected: boolean): void;
|
|
48
|
+
exportState(): InteractablePersistedState;
|
|
49
|
+
importState(saved: InteractablePersistedState): void;
|
|
50
|
+
setPersistenceAdapter(adapter: InteractablePersistenceAdapter | undefined): void;
|
|
51
|
+
flush(): Promise<void>;
|
|
54
52
|
};
|
|
55
53
|
export type InteractablesClientSchema = {
|
|
56
|
-
|
|
54
|
+
methods: InteractablesMethods;
|
|
57
55
|
};
|
|
58
|
-
//#endregion
|
|
59
56
|
//# sourceMappingURL=scopes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopes.d.ts","
|
|
1
|
+
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../src/react/interactables-legacy/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAc;AAEzC;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,OAAO,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,YAAY,CAAC,CACrD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,uBAAuB,CAAC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,uBAAuB,CAAC;IAC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IACtC,OAAO,EAAE,oBAAoB,CAAC;CAC/B,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { InteractableStateSchema } from "./scopes.js";
|
|
2
|
-
//#region src/react/interactables-legacy/useAssistantInteractable.d.ts
|
|
1
|
+
import type { InteractableStateSchema } from "./scopes.js";
|
|
3
2
|
/**
|
|
4
3
|
* @deprecated Since 2026-06-14 — migrate to the Unstable / Experimental API.
|
|
5
4
|
* Scheduled for removal on/after 2026-09-14. See
|
|
6
5
|
* {@link https://www.assistant-ui.com/docs/tools/interactables#migrating-from-the-previous-api | Interactables migration guide}.
|
|
7
6
|
*/
|
|
8
7
|
export type AssistantInteractableProps = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
description: string;
|
|
9
|
+
stateSchema: InteractableStateSchema;
|
|
10
|
+
initialState: unknown;
|
|
11
|
+
id?: string;
|
|
12
|
+
selected?: boolean;
|
|
14
13
|
};
|
|
15
14
|
/**
|
|
16
15
|
* @deprecated Since 2026-06-14 — migrate to the Unstable / Experimental API.
|
|
@@ -25,5 +24,4 @@ export type AssistantInteractableProps = {
|
|
|
25
24
|
* @returns The interactable instance id.
|
|
26
25
|
*/
|
|
27
26
|
export declare const useAssistantInteractable: (name: string, config: AssistantInteractableProps) => string;
|
|
28
|
-
//#endregion
|
|
29
27
|
//# sourceMappingURL=useAssistantInteractable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAssistantInteractable.d.ts","
|
|
1
|
+
{"version":3,"file":"useAssistantInteractable.d.ts","sourceRoot":"","sources":["../../../src/react/interactables-legacy/useAssistantInteractable.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAiB;AAExD;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,uBAAuB,CAAC;IACrC,YAAY,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,MAAM,MAAM,EACZ,QAAQ,0BAA0B,KACjC,MA+BF,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/react/interactables-legacy/useInteractableState.d.ts
|
|
2
1
|
type StateUpdater<TState> = TState | ((prev: TState) => TState);
|
|
3
2
|
/**
|
|
4
3
|
* Reads and writes the state of a registered interactable.
|
|
@@ -10,11 +9,11 @@ type StateUpdater<TState> = TState | ((prev: TState) => TState);
|
|
|
10
9
|
* {@link https://www.assistant-ui.com/docs/tools/interactables#migrating-from-the-previous-api | Interactables migration guide}.
|
|
11
10
|
*/
|
|
12
11
|
export declare const useInteractableState: <TState>(id: string, fallback: TState) => [TState, {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
setState: (updater: StateUpdater<TState>) => void;
|
|
13
|
+
setSelected: (selected: boolean) => void;
|
|
14
|
+
isPending: boolean;
|
|
15
|
+
error: unknown;
|
|
16
|
+
flush: () => Promise<void>;
|
|
18
17
|
}];
|
|
19
|
-
|
|
18
|
+
export {};
|
|
20
19
|
//# sourceMappingURL=useInteractableState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractableState.d.ts","
|
|
1
|
+
{"version":3,"file":"useInteractableState.d.ts","sourceRoot":"","sources":["../../../src/react/interactables-legacy/useInteractableState.ts"],"names":[],"mappings":"AAGA,KAAK,YAAY,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AAEhE;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,EACzC,IAAI,MAAM,EACV,UAAU,MAAM,KACf,CACD,MAAM,EACN;IACE,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAClD,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAyCF,CAAC"}
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
export declare const PERSISTENCE_DEBOUNCE_MS = 500;
|
|
3
|
+
/**
|
|
4
|
+
* `load` is caller code with no settling contract, so an awaited `flush` bounds
|
|
5
|
+
* the wait rather than inheriting it. Past this the edit stays queued for the
|
|
6
|
+
* next successful snapshot, which is the same shape a failed load already has.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FLUSH_LOAD_TIMEOUT_MS = 5000;
|
|
3
9
|
type PersistenceAdapter<State> = {
|
|
4
|
-
|
|
10
|
+
save(state: State): void | Promise<void>;
|
|
5
11
|
};
|
|
6
12
|
type PersistenceStatus = {
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
isPending: boolean;
|
|
14
|
+
error: unknown;
|
|
9
15
|
};
|
|
10
16
|
type PersistenceStatusMap = Record<string, PersistenceStatus>;
|
|
11
17
|
type PersistenceStatusUpdater = (updater: (prev: PersistenceStatusMap) => PersistenceStatusMap) => void;
|
|
12
18
|
type UseInteractablePersistenceQueueOptions<State> = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
adapterRef: RefObject<PersistenceAdapter<State> | undefined>;
|
|
20
|
+
adapterGenerationRef: RefObject<number>;
|
|
21
|
+
snapshot: () => State;
|
|
22
|
+
updatePersistenceStatus: PersistenceStatusUpdater;
|
|
23
|
+
retainDirtyWithoutAdapter?: boolean;
|
|
16
24
|
};
|
|
17
|
-
export declare const useInteractablePersistenceQueue: <State>({ adapterRef, snapshot, updatePersistenceStatus }: UseInteractablePersistenceQueueOptions<State>) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
export declare const useInteractablePersistenceQueue: <State>({ adapterRef, adapterGenerationRef, snapshot, updatePersistenceStatus, retainDirtyWithoutAdapter, }: UseInteractablePersistenceQueueOptions<State>) => {
|
|
26
|
+
discardPending: () => void;
|
|
27
|
+
flushIfPending: () => void;
|
|
28
|
+
getDirtyIds: () => Set<string>;
|
|
29
|
+
schedulePersistence: (id: string) => void;
|
|
30
|
+
flush: () => Promise<void>;
|
|
21
31
|
};
|
|
22
|
-
|
|
32
|
+
export {};
|
|
23
33
|
//# sourceMappingURL=useInteractablePersistenceQueue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractablePersistenceQueue.d.ts","
|
|
1
|
+
{"version":3,"file":"useInteractablePersistenceQueue.d.ts","sourceRoot":"","sources":["../../../src/react/interactables-shared/useInteractablePersistenceQueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5D,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAE3C,KAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,KAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE9D,KAAK,wBAAwB,GAAG,CAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,oBAAoB,KAC1D,IAAI,CAAC;AAEV,KAAK,sCAAsC,CAAC,KAAK,IAAI;IACnD,UAAU,EAAE,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC7D,oBAAoB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,KAAK,CAAC;IACtB,uBAAuB,EAAE,wBAAwB,CAAC;IAClD,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,KAAK,EAAE,qGAMpD,sCAAsC,CAAC,KAAK,CAAC;;;;8BAwJvC,MAAM;;CA+Dd,CAAC"}
|