@assistant-ui/core 0.3.19 → 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 +50 -43
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +52 -21
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +2 -5
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +7 -8
- 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 +63 -65
- 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 +19 -22
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +60 -58
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +8 -11
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +50 -45
- 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 +1 -4
- 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 +20 -23
- 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 +28 -30
- 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 +24 -27
- 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 +51 -39
- 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 +9 -12
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +15 -18
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +15 -17
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +12 -14
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +40 -43
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +9 -12
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +23 -26
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +4 -8
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +28 -23
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +77 -58
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +4 -7
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +6 -9
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +2 -5
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +9 -12
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +3 -6
- 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 +34 -37
- 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 +10 -12
- 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 -11
- 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 +2 -5
- 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 -9
- 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 +42 -46
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +8 -11
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +7 -9
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +23 -14
- 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 +15 -18
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +13 -6
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +1 -4
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +3 -6
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +26 -29
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +6 -9
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +6 -9
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +6 -9
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +5 -7
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +1 -4
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +44 -32
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +3 -6
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +7 -10
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +3 -6
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +9 -13
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +13 -16
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +3 -5
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +3 -6
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +40 -40
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +10 -9
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +4 -7
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +7 -9
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +7 -10
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +6 -9
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +3 -6
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +3 -6
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +4 -7
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +3 -6
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +3 -6
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +4 -7
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +2 -5
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +3 -6
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +5 -8
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +1 -4
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +3 -6
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +7 -10
- 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 +1 -4
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +3 -6
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +8 -11
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +27 -29
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +26 -28
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +13 -13
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +13 -17
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +30 -33
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +42 -33
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +30 -28
- 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 +122 -120
- 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 +208 -194
- 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 +8 -11
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +4 -7
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +16 -19
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +61 -64
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +25 -27
- 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 +26 -28
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +6 -9
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +5 -8
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +4 -7
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +3 -6
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +3 -6
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +3 -6
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +3 -6
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +4 -7
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +7 -10
- 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 +4 -7
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +4 -7
- 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 +4 -7
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +4 -8
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +210 -219
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +70 -46
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +186 -198
- 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 +17 -23
- 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 +10 -11
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +11 -14
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +6 -8
- 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 +9 -12
- 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 +123 -118
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +7 -10
- 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 +3 -6
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +2 -5
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +7 -10
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +426 -216
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +15 -18
- 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 +146 -125
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +120 -8
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +13 -15
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +5 -7
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +2 -5
- 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 +3 -6
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +9 -11
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +15 -19
- 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 +14 -17
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +17 -21
- 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 +3 -6
- 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 +2 -5
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +29 -41
- 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 +3 -6
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +2 -2
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +5 -7
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +4 -6
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +72 -70
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +11 -15
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +60 -60
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +21 -24
- 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 +6 -8
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +35 -37
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +3 -6
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +3 -6
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +28 -31
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +51 -49
- 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 +35 -35
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +215 -201
- 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 +31 -30
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +25 -2
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +87 -82
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +4 -3
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +54 -57
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +70 -72
- 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 +77 -81
- 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 +306 -308
- 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 +9 -12
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +150 -101
- 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 +121 -104
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +174 -62
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +30 -31
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +21 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +28 -31
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +23 -2
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +15 -18
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +8 -11
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +98 -83
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +67 -70
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +225 -211
- 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 +37 -40
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +32 -33
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +10 -2
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/queue/queue-item.d.ts +7 -10
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +9 -11
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +16 -15
- 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 +11 -13
- 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 +31 -33
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +47 -48
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +6 -5
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +6 -9
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +24 -27
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +52 -54
- 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 +12 -14
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +7 -10
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +6 -9
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.d.ts +21 -0
- package/dist/runtime/utils/stored-message-parts.d.ts.map +1 -0
- package/dist/runtime/utils/stored-message-parts.js +103 -0
- package/dist/runtime/utils/stored-message-parts.js.map +1 -0
- package/dist/runtime/utils/streaming-timing.d.ts +23 -26
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +38 -34
- 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 +5 -7
- 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 +10 -13
- 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 +1 -4
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +220 -200
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +6 -8
- 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 +3 -6
- 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 +40 -43
- 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 +119 -125
- 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 +71 -18
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +5 -8
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +96 -98
- 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 +7 -10
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +41 -44
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +42 -45
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +94 -93
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +220 -29
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +2 -5
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +77 -55
- 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 +12 -15
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +3 -6
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +2 -5
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +34 -31
- 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 +60 -63
- 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 +31 -33
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +5 -8
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +119 -121
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +147 -149
- 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 +8 -11
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +56 -58
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +1270 -741
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +2 -5
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +3 -6
- 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 +2 -5
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +4 -6
- 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 +8 -11
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +12 -12
- 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 +1 -4
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +7 -10
- package/dist/store/clients/thread-tasks.d.ts.map +1 -1
- package/dist/store/env.d.ts +1 -4
- 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 +14 -16
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +10 -5
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +11 -14
- 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 +1 -4
- package/dist/store/runtime-clients/handle-runtime-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts +1 -4
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +2 -5
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +4 -7
- 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 +10 -11
- 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 +5 -8
- 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 +6 -9
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +4 -7
- 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 +3 -6
- 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 +19 -22
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +33 -35
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +147 -135
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +119 -112
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +10 -13
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +53 -50
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +21 -23
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +14 -17
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +18 -21
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +27 -30
- package/dist/store/scopes/task.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.d.ts +68 -71
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +197 -200
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +49 -52
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +73 -69
- 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 +35 -37
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +7 -8
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +13 -16
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +15 -17
- 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 +358 -318
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +3 -6
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +10 -13
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +1 -4
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +2 -5
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +9 -13
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +16 -19
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +19 -21
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/id.d.ts +3 -6
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +1 -4
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +1 -4
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +1 -4
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +5 -8
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +3 -6
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +6 -8
- 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 +2 -4
- package/dist/utils/notify-event-listeners.d.ts.map +1 -1
- package/dist/utils/record.d.ts +1 -4
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +2 -5
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +2 -5
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +3 -6
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/package.json +15 -13
- package/src/adapters/attachment.test.ts +98 -1
- package/src/adapters/attachment.ts +77 -20
- package/src/adapters/feedback.ts +1 -0
- 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 +106 -20
- 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/RuntimeAdapter.test.ts +4 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +711 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +125 -109
- package/src/react/client/Interactables.test.ts +865 -8
- package/src/react/client/Interactables.ts +325 -45
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +9 -3
- package/src/react/client/RemoteThreadList.initialize-failure.test.ts +124 -0
- package/src/react/client/RemoteThreadList.test.ts +5 -6
- 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 +221 -4
- package/src/react/interactables-legacy/Interactables.ts +25 -14
- package/src/react/interactables-legacy/interactable-model-context.ts +26 -24
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +40 -22
- package/src/react/interactables-shared/useInteractablePersistenceQueue.test.tsx +22 -2
- package/src/react/interactables-shared/useInteractablePersistenceQueue.ts +63 -11
- package/src/react/model-context/useInteractable.test.tsx +56 -29
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +5 -5
- 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 +170 -0
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +43 -28
- 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 +155 -8
- 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/ThreadMessages.test.tsx +25 -7
- 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.layout.test.tsx +62 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.retry.test.tsx +2 -2
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.running.test.tsx +93 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +181 -21
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +62 -17
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +112 -77
- 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-scheduling.test.ts +73 -46
- 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 +108 -1
- 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 +463 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +595 -227
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +33 -4
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +7 -3
- package/src/react/runtimes/cloud/auiV0.ts +275 -6
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +873 -0
- package/src/react/runtimes/createMessageConverter.ts +9 -3
- package/src/react/runtimes/external-message-converter.test.ts +7 -3
- package/src/react/runtimes/external-store-history-copy.ts +223 -0
- package/src/react/runtimes/remote-thread-hook-on-tap.test.ts +2 -1
- package/src/react/runtimes/useExternalStoreRuntime.history-copy.test.tsx +483 -0
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +84 -3
- package/src/react/runtimes/useExternalStoreRuntime.suggestions.test.tsx +6 -2
- 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/runtimes/useRemoteThreadListRuntime.concurrent.test.tsx +84 -4
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +5 -1
- 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 +44 -1
- package/src/runtime/api/message-runtime.test.ts +112 -2
- package/src/runtime/api/message-runtime.ts +25 -7
- 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 +1614 -136
- package/src/runtime/base/base-thread-runtime-core.ts +236 -46
- package/src/runtime/base/default-edit-composer-runtime-core.ts +24 -2
- package/src/runtime/base/default-thread-composer-runtime-core.ts +33 -3
- package/src/runtime/interfaces/composer-runtime-core.ts +19 -0
- package/src/runtime/interfaces/thread-runtime-core.ts +24 -1
- package/src/runtime/queue/message-queue.ts +11 -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 +91 -0
- package/src/runtime/utils/external-message-conversion.ts +9 -6
- 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 +216 -0
- package/src/runtime/utils/thread-message-like.test.ts +58 -0
- package/src/runtime/utils/thread-message-like.ts +79 -48
- 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 +25 -0
- 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 +114 -32
- 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 +1866 -169
- package/src/runtimes/local/local-thread-runtime-core.ts +365 -40
- 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 +669 -144
- 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 +119 -0
- package/src/store/primitive-predicates.ts +19 -4
- 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 +243 -0
- 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 +12 -1
- package/src/store/scopes/part.ts +8 -0
- package/src/subscribable/subscribable.test.ts +205 -3
- package/src/subscribable/subscribable.ts +49 -7
- package/src/tests/RemoteThreadListThreadListRuntimeCore-errors.test.ts +95 -1
- package/src/tests/attachment-adapters.test.ts +16 -1
- package/src/tests/auiV0Encode.test.ts +412 -1
- package/src/tests/base-composer-runtime-core-addAttachment.test.ts +6 -6
- package/src/tests/base-composer-runtime-core-send.test.ts +722 -29
- package/src/tests/base-composer-runtime-core.test.ts +212 -5
- package/src/tests/composer-can-cancel.test.ts +35 -6
- package/src/tests/composer-can-send.test.ts +120 -1
- package/src/tests/composer-submission.test.tsx +796 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +149 -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 +810 -28
- package/src/tests/external-store-thread-runtime-core.test.ts +217 -0
- package/src/tests/external-thread-attachments.test.tsx +763 -26
- package/src/tests/external-thread-feedback.test.tsx +20 -7
- package/src/tests/external-thread-isLast.test.tsx +69 -0
- package/src/tests/external-thread-parity.test.tsx +1 -1
- package/src/tests/get-thread-state-isRunning.test.ts +2 -2
- package/src/tests/message-queue.test.ts +45 -10
- package/src/tests/remote-thread-list-adapter-switch.test.ts +45 -1
- package/src/tests/thread-switch-events.test.tsx +11 -7
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +2 -1
- package/src/types/message.test.ts +19 -0
- package/src/types/message.ts +65 -10
- package/src/utils/normalizePartStatus.ts +14 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -16
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-interactions.js","names":["ReadonlyJSONObject","ReadonlyJSONValue","Unstable_ToolInteraction","Unstable_ToolInteractionInput","Unstable_ToolInteractionLog","TOOL_INTERACTION_LIMITS","entries","payloadLength","logLength","const","MAX_DEPTH","isPlainObject","value","prototype","Object","getPrototypeOf","isPlainJSON","ancestors","Set","depth","Number","isFinite","has","add","valid","Array","isArray","every","item","values","delete","isJSONObjectValue","isInteractionType","createToolInteraction","input","occurredAt","Date","now","type","payload","Error","String","serialized","JSON","stringify","length","parse","appendToolInteraction","log","interaction","omitted","shift","readInteraction","undefined","Record","readToolInteractionLog","readable","flatMap","entry","omittedCount","isInteger","omittedEntries"],"sources":["../../../src/runtime/utils/tool-interactions.ts"],"sourcesContent":["import type {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"assistant-stream/utils\";\nimport type {\n Unstable_ToolInteraction,\n Unstable_ToolInteractionInput,\n Unstable_ToolInteractionLog,\n} from \"../../types/message\";\n\nexport const TOOL_INTERACTION_LIMITS = {\n entries: 32,\n payloadLength: 16_384,\n logLength: 65_536,\n} as const;\n\nconst MAX_DEPTH = 64;\n\nconst isPlainObject = (value: object): boolean => {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n};\n\nconst isPlainJSON = (\n value: unknown,\n ancestors: Set<object>,\n depth: number,\n): value is ReadonlyJSONValue => {\n if (value === null) return true;\n switch (typeof value) {\n case \"string\":\n case \"boolean\":\n return true;\n case \"number\":\n return Number.isFinite(value);\n case \"object\":\n break;\n default:\n return false;\n }\n if (depth > MAX_DEPTH || ancestors.has(value)) return false;\n ancestors.add(value);\n const valid = Array.isArray(value)\n ? value.every((item) => isPlainJSON(item, ancestors, depth + 1))\n : isPlainObject(value) &&\n Object.values(value).every((item) =>\n isPlainJSON(item, ancestors, depth + 1),\n );\n ancestors.delete(value);\n return valid;\n};\n\nconst isJSONObjectValue = (value: unknown) =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isInteractionType = (\n value: unknown,\n): value is Unstable_ToolInteraction[\"type\"] =>\n value === \"action\" || value === \"human-response\";\n\nexport function createToolInteraction(\n input: Unstable_ToolInteractionInput,\n occurredAt: number = Date.now(),\n): Unstable_ToolInteraction {\n const { type, payload } = input;\n if (!isInteractionType(type)) {\n throw new Error(`Unknown tool interaction type: ${String(type)}`);\n }\n if (!isPlainJSON(payload, new Set(), 0)) {\n throw new Error(\"A tool interaction payload must be plain JSON.\");\n }\n if (type === \"action\" && !isJSONObjectValue(payload)) {\n throw new Error(\"An action interaction payload must be a JSON object.\");\n }\n const serialized = JSON.stringify(payload);\n if (serialized.length > TOOL_INTERACTION_LIMITS.payloadLength) {\n throw new Error(\n `A tool interaction payload is limited to ${TOOL_INTERACTION_LIMITS.payloadLength} characters of JSON.`,\n );\n }\n return { type, occurredAt, payload: JSON.parse(serialized) };\n}\n\nexport function appendToolInteraction(\n log: Unstable_ToolInteractionLog | undefined,\n interaction: Unstable_ToolInteraction,\n): Unstable_ToolInteractionLog {\n const entries = [...(log?.entries ?? []), interaction];\n let omitted = log?.omitted ?? 0;\n while (\n entries.length > 1 &&\n (entries.length > TOOL_INTERACTION_LIMITS.entries ||\n JSON.stringify(entries).length > TOOL_INTERACTION_LIMITS.logLength)\n ) {\n entries.shift();\n omitted += 1;\n }\n return omitted > 0 ? { entries, omitted } : { entries };\n}\n\nconst readInteraction = (\n value: unknown,\n): Unstable_ToolInteraction | undefined => {\n if (!isJSONObjectValue(value)) return undefined;\n const { type, occurredAt, payload } = value as Record<string, unknown>;\n if (!isInteractionType(type)) return undefined;\n if (typeof occurredAt !== \"number\" || !Number.isFinite(occurredAt)) {\n return undefined;\n }\n if (!isPlainJSON(payload, new Set(), 0)) return undefined;\n if (type === \"action\") {\n return isJSONObjectValue(payload)\n ? { type, occurredAt, payload: payload as ReadonlyJSONObject }\n : undefined;\n }\n return { type, occurredAt, payload };\n};\n\nexport function readToolInteractionLog(\n value: unknown,\n): Unstable_ToolInteractionLog | undefined {\n if (!isJSONObjectValue(value)) return undefined;\n const { entries, omitted } = value as Record<string, unknown>;\n const readable = Array.isArray(entries)\n ? entries.flatMap((entry) => {\n const interaction = readInteraction(entry);\n return interaction ? [interaction] : [];\n })\n : [];\n const omittedCount =\n typeof omitted === \"number\" && Number.isInteger(omitted) && omitted > 0\n ? omitted\n : 0;\n let omittedEntries = omittedCount;\n while (\n readable.length > 1 &&\n (readable.length > TOOL_INTERACTION_LIMITS.entries ||\n JSON.stringify(readable).length > TOOL_INTERACTION_LIMITS.logLength)\n ) {\n readable.shift();\n omittedEntries += 1;\n }\n if (readable.length === 0 && omittedEntries === 0) return undefined;\n return omittedEntries > 0\n ? { entries: readable, omitted: omittedEntries }\n : { entries: readable };\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare function createRequestHeaders(headersValue: Record<string, string> | Headers | (() => Promise<Record<string, string> | Headers>)): Promise<Headers>;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { createRequestHeaders };
|
|
1
|
+
export declare function createRequestHeaders(headersValue: Record<string, string> | Headers | (() => Promise<Record<string, string> | Headers>)): Promise<Headers>;
|
|
5
2
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/runtimes/assistant-transport/utils.ts"],"names":[],"mappings":"AAAA,wBAAsB,oBAAoB,CACxC,YAAY,EACR,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,OAAO,GACP,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,GACpD,OAAO,CAAC,OAAO,CAAC,CAOlB"}
|
|
@@ -1,214 +1,234 @@
|
|
|
1
|
-
import { AppendMessage, ThreadMessage, ToolCallMessagePart } from "../../types/message.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { RealtimeVoiceAdapter } from "../../adapters/voice.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ToolExecutionStatus } from "../tool-invocations/ToolInvocationTracker.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
custom?: Record<string, unknown> | undefined;
|
|
1
|
+
import type { AppendMessage, ThreadMessage, ToolCallMessagePart } from "../../types/message.js";
|
|
2
|
+
import type { ThreadMessageLike } from "../../runtime/utils/thread-message-like.js";
|
|
3
|
+
import type { AttachmentAdapter } from "../../adapters/attachment.js";
|
|
4
|
+
import type { SpeechSynthesisAdapter, DictationAdapter } from "../../adapters/speech.js";
|
|
5
|
+
import type { RealtimeVoiceAdapter } from "../../adapters/voice.js";
|
|
6
|
+
import type { FeedbackAdapter } from "../../adapters/feedback.js";
|
|
7
|
+
import type { AddToolResultOptions, RespondToToolApprovalOptions, Unstable_RecordToolInteractionOptions, StartRunConfig, ResumeRunConfig, ThreadSuggestion } from "../../runtime/interfaces/thread-runtime-core.js";
|
|
8
|
+
import type { ExportedMessageRepository, MessageRepository } from "../../runtime/utils/message-repository.js";
|
|
9
|
+
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
10
|
+
import type { ToolExecutionStatus } from "../tool-invocations/ToolInvocationTracker.js";
|
|
11
|
+
import type { ExternalThreadQueueAdapter } from "../../runtime/queue/external-thread-queue-adapter.js";
|
|
12
|
+
export type ExternalStoreThreadData<TState extends "regular" | "archived"> = {
|
|
13
|
+
status: TState;
|
|
14
|
+
id: string;
|
|
15
|
+
remoteId?: string | undefined;
|
|
16
|
+
externalId?: string | undefined;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
custom?: Record<string, unknown> | undefined;
|
|
20
19
|
};
|
|
21
|
-
type ExternalStoreThreadListAdapter = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
export type ExternalStoreThreadListAdapter = {
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated This API is still under active development and might change without notice.
|
|
23
|
+
*/
|
|
24
|
+
threadId?: string | undefined;
|
|
25
|
+
isLoading?: boolean | undefined;
|
|
26
|
+
threads?: readonly ExternalStoreThreadData<"regular">[] | undefined;
|
|
27
|
+
archivedThreads?: readonly ExternalStoreThreadData<"archived">[] | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated This API is still under active development and might change without notice.
|
|
30
|
+
*/
|
|
31
|
+
onSwitchToNewThread?: (() => Promise<void> | void) | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated This API is still under active development and might change without notice.
|
|
34
|
+
*/
|
|
35
|
+
onSwitchToThread?: ((threadId: string) => Promise<void> | void) | undefined;
|
|
36
|
+
onRename?: (threadId: string, newTitle: string) => (Promise<void> | void) | undefined;
|
|
37
|
+
onUpdateCustom?: ((threadId: string, custom: Record<string, unknown> | undefined) => Promise<void> | void) | undefined;
|
|
38
|
+
onArchive?: ((threadId: string) => Promise<void> | void) | undefined;
|
|
39
|
+
onUnarchive?: ((threadId: string) => Promise<void> | void) | undefined;
|
|
40
|
+
onDelete?: ((threadId: string) => Promise<void> | void) | undefined;
|
|
42
41
|
};
|
|
43
|
-
type ExternalStoreMessageConverter<T> = (message: T, idx: number) => ThreadMessageLike;
|
|
42
|
+
export type ExternalStoreMessageConverter<T> = (message: T, idx: number) => ThreadMessageLike;
|
|
44
43
|
/**
|
|
45
44
|
* @deprecated This API is still under active development and might change without notice.
|
|
46
45
|
*/
|
|
47
|
-
type ExternalStoreBranchChange = {
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
export type ExternalStoreBranchChange = {
|
|
47
|
+
headId: string | null;
|
|
48
|
+
visibleMessageIds: readonly string[];
|
|
50
49
|
};
|
|
51
50
|
type ExternalStoreMessageConverterAdapter<T> = {
|
|
52
|
-
|
|
51
|
+
convertMessage: ExternalStoreMessageConverter<T>;
|
|
53
52
|
};
|
|
54
53
|
type ExternalStoreAdapterBase<T> = {
|
|
55
|
-
/**
|
|
56
|
-
* Whether the entire thread is disabled. When `true`, the composer's input
|
|
57
|
-
* is also disabled (the user cannot type, attach files, or submit). For a
|
|
58
|
-
* narrower gate that keeps the input usable but blocks only sending, use
|
|
59
|
-
* `isSendDisabled`.
|
|
60
|
-
*/
|
|
61
|
-
isDisabled?: boolean | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Whether sending new messages is currently disabled. When `true`, the
|
|
64
|
-
* thread composer's input remains usable but `send()` becomes a no-op
|
|
65
|
-
* and the thread composer's `canSend` is `false`. Use this to gate
|
|
66
|
-
* sending on external React state (e.g. while tool config is loading)
|
|
67
|
-
* without disabling the input itself the way `isDisabled` does. Edit
|
|
68
|
-
* composers (saving message edits) intentionally ignore this flag.
|
|
69
|
-
*/
|
|
70
|
-
isSendDisabled?: boolean | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Whether the thread is running. When provided, this value flows directly
|
|
73
|
-
* to `thread.isRunning`, letting the application keep the thread in a
|
|
74
|
-
* running state even after the last assistant message has completed (for
|
|
75
|
-
* example while non-message stream chunks like suggestions or metadata
|
|
76
|
-
* updates are still arriving). When omitted, `thread.isRunning` falls back
|
|
77
|
-
* to the last-message-status heuristic.
|
|
78
|
-
*/
|
|
79
|
-
isRunning?: boolean | undefined;
|
|
80
|
-
isLoading?: boolean | undefined;
|
|
81
|
-
messages?: readonly T[];
|
|
82
|
-
messageRepository?: ExportedMessageRepository;
|
|
83
|
-
/**
|
|
84
|
-
* An externally owned message repository instance. When provided, the
|
|
85
|
-
* thread runtime adopts it as its branch store and swaps to it atomically
|
|
86
|
-
* whenever a different instance is passed, so hosts that route multiple
|
|
87
|
-
* conversations through one runtime keep each conversation's history and
|
|
88
|
-
* branches isolated in its own instance. Omit it to keep the runtime's own
|
|
89
|
-
* repository.
|
|
90
|
-
*/
|
|
91
|
-
unstable_messageRepositoryInstance?: MessageRepository | undefined;
|
|
92
|
-
suggestions?: readonly ThreadSuggestion[] | undefined;
|
|
93
|
-
state?: ReadonlyJSONValue | undefined;
|
|
94
|
-
extras?: unknown;
|
|
95
|
-
/**
|
|
96
|
-
* Applies a message list the runtime rewrote, and is what tells the runtime
|
|
97
|
-
* a removal it makes will survive the next snapshot. Without it, cancelling a
|
|
98
|
-
* run leaves a trailing user message in the thread and the composer
|
|
99
|
-
* untouched; an adapter that removes that message itself owns handing it
|
|
100
|
-
* back, because the runtime cannot see a removal it did not make.
|
|
101
|
-
*/
|
|
102
|
-
setMessages?: ((messages: readonly T[]) => void) | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* Fires when the user explicitly switches branches via the runtime's
|
|
105
|
-
* `switchToBranch` action (e.g. a BranchPicker click). It does not fire on
|
|
106
|
-
* adapter resync, `append`, edit/regenerate, content-only updates, or while
|
|
107
|
-
* the thread is running. Consecutive switches that resolve to the same
|
|
108
|
-
* canonical head are de-duped.
|
|
109
|
-
*
|
|
110
|
-
* `headId` is the canonical (persisted) head of the now-visible branch —
|
|
111
|
-
* optimistic/transient ids are never surfaced. `visibleMessageIds` lists the
|
|
112
|
-
* visible path in order.
|
|
113
|
-
*
|
|
114
|
-
* This complements `setMessages` rather than replacing it: switching still
|
|
115
|
-
* requires `setMessages`, and this callback does not on its own enable branch
|
|
116
|
-
* switching.
|
|
117
|
-
*
|
|
118
|
-
* @deprecated This API is still under active development and might change without notice.
|
|
119
|
-
*/
|
|
120
|
-
unstable_onBranchChange?: ((event: ExternalStoreBranchChange) => void) | undefined;
|
|
121
|
-
onImport?: ((messages: readonly ThreadMessage[]) => void) | undefined;
|
|
122
|
-
onExportExternalState?: (() => any) | undefined;
|
|
123
|
-
onLoadExternalState?: ((state: any) => void) | undefined;
|
|
124
|
-
onNew: (message: AppendMessage) => Promise<void>;
|
|
125
|
-
/** Opt in to message queuing. Typically produced by `createMessageQueue`. */
|
|
126
|
-
queue?: ExternalThreadQueueAdapter | undefined;
|
|
127
|
-
onEdit?: ((message: AppendMessage) => Promise<void>) | undefined;
|
|
128
|
-
onDelete?: ((messageId: string) => Promise<void> | void) | undefined;
|
|
129
|
-
onReload?: ((parentId: string | null, config: StartRunConfig) => Promise<void>) | undefined;
|
|
130
|
-
onResume?: ((config: ResumeRunConfig) => Promise<void>) | undefined;
|
|
131
|
-
onCancel?: (() => Promise<void>) | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* Re-fetches the thread's state from the backing store, in place; a
|
|
134
|
-
* rejection reaches the `threads.reloadMainThread()` caller. Unrelated to
|
|
135
|
-
* `onReload`, which re-generates an assistant message.
|
|
136
|
-
*
|
|
137
|
-
* The caller does not stop a run in progress first, so an adapter that can
|
|
138
|
-
* stream owns whatever coordination one needs.
|
|
139
|
-
*/
|
|
140
|
-
onRefetchThread?: (() => Promise<void>) | undefined;
|
|
141
|
-
onAddToolResult?: ((options: AddToolResultOptions) => Promise<void> | void) | undefined;
|
|
142
|
-
onResumeToolCall?: ((options: {
|
|
143
|
-
toolCallId: string;
|
|
144
|
-
payload: unknown;
|
|
145
|
-
}) => void) | undefined;
|
|
146
|
-
onRespondToToolApproval?: ((options: RespondToToolApprovalOptions) => Promise<void> | void) | undefined;
|
|
147
|
-
convertMessage?: ExternalStoreMessageConverter<T> | undefined;
|
|
148
|
-
adapters?: {
|
|
149
|
-
attachments?: AttachmentAdapter | undefined;
|
|
150
|
-
speech?: SpeechSynthesisAdapter | undefined;
|
|
151
|
-
dictation?: DictationAdapter | undefined;
|
|
152
|
-
voice?: RealtimeVoiceAdapter | undefined;
|
|
153
|
-
feedback?: FeedbackAdapter | undefined;
|
|
154
54
|
/**
|
|
55
|
+
* The runtime writes its messages to the thread list's history adapter
|
|
56
|
+
* itself, so `useExternalStoreRuntime` does not copy them.
|
|
57
|
+
*/
|
|
58
|
+
unstable_persistsHistory?: boolean | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the entire thread is disabled. When `true`, the composer's input
|
|
61
|
+
* is also disabled (the user cannot type, attach files, or submit). For a
|
|
62
|
+
* narrower gate that keeps the input usable but blocks only sending, use
|
|
63
|
+
* `isSendDisabled`.
|
|
64
|
+
*/
|
|
65
|
+
isDisabled?: boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Whether sending new messages is currently disabled. When `true`, the
|
|
68
|
+
* thread composer's input remains usable but `send()` becomes a no-op
|
|
69
|
+
* and the thread composer's `canSend` is `false`. Use this to gate
|
|
70
|
+
* sending on external React state (e.g. while tool config is loading)
|
|
71
|
+
* without disabling the input itself the way `isDisabled` does. Edit
|
|
72
|
+
* composers (saving message edits) intentionally ignore this flag.
|
|
73
|
+
*/
|
|
74
|
+
isSendDisabled?: boolean | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the thread is running. When provided, this value flows directly
|
|
77
|
+
* to `thread.isRunning`, letting the application keep the thread in a
|
|
78
|
+
* running state even after the last assistant message has completed (for
|
|
79
|
+
* example while non-message stream chunks like suggestions or metadata
|
|
80
|
+
* updates are still arriving). When omitted, `thread.isRunning` falls back
|
|
81
|
+
* to the last-message-status heuristic.
|
|
82
|
+
*/
|
|
83
|
+
isRunning?: boolean | undefined;
|
|
84
|
+
isLoading?: boolean | undefined;
|
|
85
|
+
messages?: readonly T[];
|
|
86
|
+
messageRepository?: ExportedMessageRepository;
|
|
87
|
+
/**
|
|
88
|
+
* An externally owned message repository instance. When provided, the
|
|
89
|
+
* thread runtime adopts it as its branch store and swaps to it atomically
|
|
90
|
+
* whenever a different instance is passed, so hosts that route multiple
|
|
91
|
+
* conversations through one runtime keep each conversation's history and
|
|
92
|
+
* branches isolated in its own instance. Omit it to keep the runtime's own
|
|
93
|
+
* repository.
|
|
94
|
+
*/
|
|
95
|
+
unstable_messageRepositoryInstance?: MessageRepository | undefined;
|
|
96
|
+
suggestions?: readonly ThreadSuggestion[] | undefined;
|
|
97
|
+
state?: ReadonlyJSONValue | undefined;
|
|
98
|
+
extras?: unknown;
|
|
99
|
+
/**
|
|
100
|
+
* Applies a message list the runtime rewrote, and is what tells the runtime
|
|
101
|
+
* a removal it makes will survive the next snapshot. Without it, cancelling a
|
|
102
|
+
* run leaves a trailing user message in the thread and the composer
|
|
103
|
+
* untouched; an adapter that removes that message itself owns handing it
|
|
104
|
+
* back, because the runtime cannot see a removal it did not make.
|
|
105
|
+
*/
|
|
106
|
+
setMessages?: ((messages: readonly T[]) => void) | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Called with each message a voice session adds to the thread: every finalized transcript, and every text message typed into a session that takes typed text (it carries no `metadata.modality`). The host appends it to its own messages under the same id, which is how the runtime knows the host carries it. A message that finalizes while `isLoading` is true is delivered once loading ends, to the callback on the adapter current at that moment, and is not delivered at all when the conversation changed while it waited. A host that routes conversations through one runtime is recognized by its `unstable_messageRepositoryInstance`; one that swaps only its `messages` cannot be told apart from a load finishing. A host that does not implement this callback keeps these messages for the session only.
|
|
109
|
+
*/
|
|
110
|
+
onVoiceTranscript?: ((message: ThreadMessage) => void) | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Fires when the user explicitly switches branches via the runtime's
|
|
113
|
+
* `switchToBranch` action (e.g. a BranchPicker click). It does not fire on
|
|
114
|
+
* adapter resync, `append`, edit/regenerate, content-only updates, or while
|
|
115
|
+
* the thread is running. Consecutive switches that resolve to the same
|
|
116
|
+
* canonical head are de-duped.
|
|
117
|
+
*
|
|
118
|
+
* `headId` is the canonical (persisted) head of the now-visible branch —
|
|
119
|
+
* optimistic/transient ids are never surfaced. `visibleMessageIds` lists the
|
|
120
|
+
* visible path in order.
|
|
121
|
+
*
|
|
122
|
+
* This complements `setMessages` rather than replacing it: switching still
|
|
123
|
+
* requires `setMessages`, and this callback does not on its own enable branch
|
|
124
|
+
* switching.
|
|
125
|
+
*
|
|
155
126
|
* @deprecated This API is still under active development and might change without notice.
|
|
156
127
|
*/
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
128
|
+
unstable_onBranchChange?: ((event: ExternalStoreBranchChange) => void) | undefined;
|
|
129
|
+
onImport?: ((messages: readonly ThreadMessage[]) => void) | undefined;
|
|
130
|
+
onExportExternalState?: (() => any) | undefined;
|
|
131
|
+
onLoadExternalState?: ((state: any) => void) | undefined;
|
|
132
|
+
onNew: (message: AppendMessage) => Promise<void>;
|
|
133
|
+
/** Opt in to message queuing. Typically produced by `createMessageQueue`. */
|
|
134
|
+
queue?: ExternalThreadQueueAdapter | undefined;
|
|
135
|
+
onEdit?: ((message: AppendMessage) => Promise<void>) | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Removes a message from the host's store. The runtime drops the message
|
|
138
|
+
* from its branches when `messages` stops carrying the id, and reads a
|
|
139
|
+
* `messages` update that still carries it after every call for it has
|
|
140
|
+
* settled as a declined delete. A host that accepts the delete therefore
|
|
141
|
+
* publishes the removal before the returned promise settles.
|
|
142
|
+
*/
|
|
143
|
+
onDelete?: ((messageId: string) => Promise<void> | void) | undefined;
|
|
144
|
+
onReload?: ((parentId: string | null, config: StartRunConfig) => Promise<void>) | undefined;
|
|
145
|
+
onResume?: ((config: ResumeRunConfig) => Promise<void>) | undefined;
|
|
146
|
+
onCancel?: (() => Promise<void>) | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Re-fetches the thread's state from the backing store, in place; a
|
|
149
|
+
* rejection reaches the `threads.reloadMainThread()` caller. Unrelated to
|
|
150
|
+
* `onReload`, which re-generates an assistant message.
|
|
151
|
+
*
|
|
152
|
+
* The caller does not stop a run in progress first, so an adapter that can
|
|
153
|
+
* stream owns whatever coordination one needs.
|
|
154
|
+
*/
|
|
155
|
+
onRefetchThread?: (() => Promise<void>) | undefined;
|
|
156
|
+
onAddToolResult?: ((options: AddToolResultOptions) => Promise<void> | void) | undefined;
|
|
157
|
+
onResumeToolCall?: ((options: {
|
|
158
|
+
toolCallId: string;
|
|
159
|
+
payload: unknown;
|
|
160
|
+
}) => void) | undefined;
|
|
161
|
+
onRespondToToolApproval?: ((options: RespondToToolApprovalOptions) => Promise<void> | void) | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Stores a user interaction on a tool call part of a message this store
|
|
164
|
+
* owns and exposes it on that part's `unstable_interactions`. Without it,
|
|
165
|
+
* recording an interaction rejects and nothing is kept.
|
|
166
|
+
*/
|
|
167
|
+
unstable_onRecordToolInteraction?: ((options: Unstable_RecordToolInteractionOptions) => Promise<void> | void) | undefined;
|
|
168
|
+
convertMessage?: ExternalStoreMessageConverter<T> | undefined;
|
|
169
|
+
adapters?: {
|
|
170
|
+
attachments?: AttachmentAdapter | undefined;
|
|
171
|
+
speech?: SpeechSynthesisAdapter | undefined;
|
|
172
|
+
dictation?: DictationAdapter | undefined;
|
|
173
|
+
voice?: RealtimeVoiceAdapter | undefined;
|
|
174
|
+
feedback?: FeedbackAdapter | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated This API is still under active development and might change without notice.
|
|
177
|
+
*/
|
|
178
|
+
threadList?: ExternalStoreThreadListAdapter | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
unstable_capabilities?: {
|
|
181
|
+
copy?: boolean | undefined;
|
|
182
|
+
} | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Opt in to the built-in client-side tool-invocations pipeline
|
|
185
|
+
* (`streamCall` / `execute` / tool-status tracking) for this thread.
|
|
186
|
+
*
|
|
187
|
+
* Defaults to `false` — the runtime does *not* drive client-side tool
|
|
188
|
+
* callbacks on its own. Set to `true` to have the runtime construct a
|
|
189
|
+
* `ToolInvocationTracker` and feed every snapshot through it, so tool
|
|
190
|
+
* callbacks fire automatically for tool-call parts in `messages`.
|
|
191
|
+
*
|
|
192
|
+
* Opt-in by default because most external-store runtimes either run
|
|
193
|
+
* tools entirely server-side, or already wire their own client-side
|
|
194
|
+
* dispatch path. Enabling the embedded tracker on top of an existing
|
|
195
|
+
* dispatch path would cause tool callbacks to run twice.
|
|
196
|
+
*
|
|
197
|
+
* When enabled, client-side tool results (from `execute()` returning,
|
|
198
|
+
* or from `streamCall` resolving) flow back through
|
|
199
|
+
* `adapter.onAddToolResult` like any other tool result, with
|
|
200
|
+
* `modelContent` populated when present.
|
|
201
|
+
*/
|
|
202
|
+
unstable_enableToolInvocations?: boolean | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Decides whether a tool call's result is produced on the client. Only
|
|
205
|
+
* consulted when `unstable_enableToolInvocations` is `true`.
|
|
206
|
+
*
|
|
207
|
+
* A provider that runs tools itself answers its own calls, and its result
|
|
208
|
+
* arrives one or more snapshots after the call's arguments complete. In
|
|
209
|
+
* that window the call is complete and result-less, so a registered tool
|
|
210
|
+
* of the same name would otherwise execute locally and produce a result
|
|
211
|
+
* the provider never asked for. An adapter that can tell the two apart
|
|
212
|
+
* supplies this predicate; it is read once per tool call, when the call is
|
|
213
|
+
* first observed live.
|
|
214
|
+
*
|
|
215
|
+
* The predicate is also what licenses running a frontend tool while the
|
|
216
|
+
* provider's run is still open. Without it, ownership is unknown until the
|
|
217
|
+
* run ends, so a registered tool executes only once the run's outcome is
|
|
218
|
+
* known and cannot fire on a call the provider was about to answer or gate.
|
|
219
|
+
*/
|
|
220
|
+
unstable_isClientToolCall?: ((toolCall: ToolCallMessagePart) => boolean) | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Receives the current per-tool-call execution status map whenever it
|
|
223
|
+
* changes. Only invoked when `unstable_enableToolInvocations` is `true`
|
|
224
|
+
* — the runtime maintains the map via the embedded tracker.
|
|
225
|
+
*
|
|
226
|
+
* Wire this into local React state and feed it into the converter's
|
|
227
|
+
* `metadata.toolStatuses` so the UI can render `executing` spinners
|
|
228
|
+
* and human-input prompts.
|
|
229
|
+
*/
|
|
230
|
+
setToolStatuses?: ((statuses: Record<string, ToolExecutionStatus>) => void) | undefined;
|
|
210
231
|
};
|
|
211
|
-
type ExternalStoreAdapter<T = ThreadMessage> = ExternalStoreAdapterBase<T> & (T extends ThreadMessage ? object : ExternalStoreMessageConverterAdapter<T>);
|
|
212
|
-
|
|
213
|
-
export { ExternalStoreAdapter, ExternalStoreBranchChange, ExternalStoreMessageConverter, ExternalStoreThreadData, ExternalStoreThreadListAdapter };
|
|
232
|
+
export type ExternalStoreAdapter<T = ThreadMessage> = ExternalStoreAdapterBase<T> & (T extends ThreadMessage ? object : ExternalStoreMessageConverterAdapter<T>);
|
|
233
|
+
export {};
|
|
214
234
|
//# sourceMappingURL=external-store-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-store-adapter.d.ts","
|
|
1
|
+
{"version":3,"file":"external-store-adapter.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/external-store-adapter.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { BaseAssistantRuntimeCore } from "../../runtime/base/base-assistant-runtime-core.js";
|
|
2
|
-
import { ExternalStoreAdapter } from "./external-store-adapter.js";
|
|
3
2
|
import { ExternalStoreThreadListRuntimeCore } from "./external-store-thread-list-runtime-core.js";
|
|
4
|
-
|
|
5
|
-
declare class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import type { ExternalStoreAdapter } from "./external-store-adapter.js";
|
|
4
|
+
export declare class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {
|
|
5
|
+
readonly threads: ExternalStoreThreadListRuntimeCore;
|
|
6
|
+
private _adapter;
|
|
7
|
+
constructor(adapter: ExternalStoreAdapter<any>);
|
|
8
|
+
setAdapter(adapter: ExternalStoreAdapter<any>): void;
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { ExternalStoreRuntimeCore };
|
|
12
10
|
//# sourceMappingURL=external-store-runtime-core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-store-runtime-core.d.ts","
|
|
1
|
+
{"version":3,"file":"external-store-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/external-store-runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,0DAAuD;AAC1F,OAAO,EAAE,kCAAkC,EAAE,qDAAkD;AAC/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,oCAAiC;AAOrE,qBAAa,wBAAyB,SAAQ,wBAAwB;IACpE,SAAgB,OAAO,qCAAC;IACxB,OAAO,CAAC,QAAQ,CAA4B;gBAEhC,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;IAavC,UAAU,CAAC,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;CAOrD"}
|
|
@@ -7,11 +7,14 @@ const getThreadListAdapter = (store) => {
|
|
|
7
7
|
};
|
|
8
8
|
var ExternalStoreRuntimeCore = class extends BaseAssistantRuntimeCore {
|
|
9
9
|
threads;
|
|
10
|
+
_adapter;
|
|
10
11
|
constructor(adapter) {
|
|
11
12
|
super();
|
|
12
|
-
this.
|
|
13
|
+
this._adapter = adapter;
|
|
14
|
+
this.threads = new ExternalStoreThreadListRuntimeCore(getThreadListAdapter(adapter), () => new ExternalStoreThreadRuntimeCore(this._contextProvider, this._adapter));
|
|
13
15
|
}
|
|
14
16
|
setAdapter(adapter) {
|
|
17
|
+
this._adapter = adapter;
|
|
15
18
|
this.threads.__internal_setAdapter(getThreadListAdapter(adapter));
|
|
16
19
|
this.threads.getMainThreadRuntimeCore().__internal_setAdapter(adapter);
|
|
17
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-store-runtime-core.js","names":["BaseAssistantRuntimeCore","ExternalStoreThreadListRuntimeCore","ExternalStoreAdapter","ExternalStoreThreadRuntimeCore","getThreadListAdapter","store","adapters","threadList","ExternalStoreRuntimeCore","threads","constructor","adapter","_contextProvider","setAdapter","__internal_setAdapter","getMainThreadRuntimeCore"],"sources":["../../../src/runtimes/external-store/external-store-runtime-core.ts"],"sourcesContent":["import { BaseAssistantRuntimeCore } from \"../../runtime/base/base-assistant-runtime-core\";\nimport { ExternalStoreThreadListRuntimeCore } from \"./external-store-thread-list-runtime-core\";\nimport type { ExternalStoreAdapter } from \"./external-store-adapter\";\nimport { ExternalStoreThreadRuntimeCore } from \"./external-store-thread-runtime-core\";\n\nconst getThreadListAdapter = (store: ExternalStoreAdapter<any>) => {\n return store.adapters?.threadList ?? {};\n};\n\nexport class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {\n public readonly threads;\n\n constructor(adapter: ExternalStoreAdapter<any>) {\n super();\n this.threads = new ExternalStoreThreadListRuntimeCore(\n getThreadListAdapter(adapter),\n ()
|
|
1
|
+
{"version":3,"file":"external-store-runtime-core.js","names":["BaseAssistantRuntimeCore","ExternalStoreThreadListRuntimeCore","ExternalStoreAdapter","ExternalStoreThreadRuntimeCore","getThreadListAdapter","store","adapters","threadList","ExternalStoreRuntimeCore","threads","_adapter","constructor","adapter","_contextProvider","setAdapter","__internal_setAdapter","getMainThreadRuntimeCore"],"sources":["../../../src/runtimes/external-store/external-store-runtime-core.ts"],"sourcesContent":["import { BaseAssistantRuntimeCore } from \"../../runtime/base/base-assistant-runtime-core\";\nimport { ExternalStoreThreadListRuntimeCore } from \"./external-store-thread-list-runtime-core\";\nimport type { ExternalStoreAdapter } from \"./external-store-adapter\";\nimport { ExternalStoreThreadRuntimeCore } from \"./external-store-thread-runtime-core\";\n\nconst getThreadListAdapter = (store: ExternalStoreAdapter<any>) => {\n return store.adapters?.threadList ?? {};\n};\n\nexport class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {\n public readonly threads;\n private _adapter: ExternalStoreAdapter<any>;\n\n constructor(adapter: ExternalStoreAdapter<any>) {\n super();\n this._adapter = adapter;\n this.threads = new ExternalStoreThreadListRuntimeCore(\n getThreadListAdapter(adapter),\n () =>\n new ExternalStoreThreadRuntimeCore(\n this._contextProvider,\n this._adapter,\n ),\n );\n }\n\n public setAdapter(adapter: ExternalStoreAdapter<any>) {\n // Before the thread list, whose thread switch builds the new main thread\n // from this adapter.\n this._adapter = adapter;\n this.threads.__internal_setAdapter(getThreadListAdapter(adapter));\n this.threads.getMainThreadRuntimeCore().__internal_setAdapter(adapter);\n }\n}\n"],"mappings":";;;;AAKA,MAAMI,wBAAwBC,UAAqC;CACjE,OAAOA,MAAMC,UAAUC,cAAc,CAAC;AACxC;AAEA,IAAaC,2BAAb,cAA8CR,yBAAyB;CACrE;CACA;CAEAW,YAAYC,SAAoC;EAC9C,MAAM;EACN,KAAKF,WAAWE;EAChB,KAAKH,UAAU,IAAIR,mCACjBG,qBAAqBQ,OAAO,SAE1B,IAAIT,+BACF,KAAKU,kBACL,KAAKH,QACP,CACJ;CACF;CAEA,WAAkBE,SAAoC;EAGpD,KAAKF,WAAWE;EAChB,KAAKH,QAAQM,sBAAsBX,qBAAqBQ,OAAO,CAAC;EAChE,KAAKH,QAAQO,yBAAyB,CAAC,CAACD,sBAAsBH,OAAO;CACvE;AACF"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { ExternalStoreAdapter } from "./external-store-adapter.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const pickExternalStoreSharedOptions: (options: ExternalStoreSharedOptions) => ExternalStoreSharedOptions;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { ExternalStoreSharedOptions, pickExternalStoreSharedOptions };
|
|
1
|
+
import type { ExternalStoreAdapter } from "./external-store-adapter.js";
|
|
2
|
+
export type ExternalStoreSharedOptions = Pick<ExternalStoreAdapter, "isDisabled" | "isSendDisabled" | "unstable_capabilities" | "suggestions">;
|
|
3
|
+
export declare const pickExternalStoreSharedOptions: (options: ExternalStoreSharedOptions) => ExternalStoreSharedOptions;
|
|
7
4
|
//# sourceMappingURL=external-store-shared-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-store-shared-options.d.ts","
|
|
1
|
+
{"version":3,"file":"external-store-shared-options.d.ts","sourceRoot":"","sources":["../../../src/runtimes/external-store/external-store-shared-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oCAAiC;AAErE,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,oBAAoB,EACpB,YAAY,GAAG,gBAAgB,GAAG,uBAAuB,GAAG,aAAa,CAC1E,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,SAAS,0BAA0B,KAClC,0BAUA,CAAC"}
|