@assistant-ui/core 0.3.20 → 0.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/attachment.d.ts +42 -34
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +51 -21
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +1 -3
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +6 -7
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/index.d.ts +14 -9
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/speech.d.ts +57 -58
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +16 -2
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +14 -16
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +54 -51
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +7 -9
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +46 -40
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/adapters/voice.js +17 -3
- package/dist/adapters/voice.js.map +1 -1
- package/dist/index.d.ts +70 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/duplicate-detection.d.ts +0 -2
- package/dist/internal/duplicate-detection.d.ts.map +1 -1
- package/dist/internal.d.ts +27 -58
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +8 -6
- package/dist/model-context/frame/host.d.ts +19 -21
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +3 -1
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +27 -28
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +6 -0
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/frame/types.d.ts +19 -21
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/frame/validate.d.ts +3 -0
- package/dist/model-context/frame/validate.d.ts.map +1 -0
- package/dist/model-context/frame/validate.js +26 -0
- package/dist/model-context/frame/validate.js.map +1 -0
- package/dist/model-context/interactable-composer-metadata.d.ts +42 -29
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +30 -6
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +6 -8
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +14 -16
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +13 -14
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +10 -11
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +32 -34
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +6 -8
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +23 -25
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +2 -5
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +24 -18
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +58 -25
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +2 -4
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +5 -7
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +1 -3
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +6 -8
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +2 -4
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +306 -101
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +32 -34
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +2 -1
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts +9 -11
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +4 -8
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +9 -10
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +32 -22
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +160 -122
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +5 -5
- package/dist/react/interactables-legacy/Interactables.d.ts +1 -3
- package/dist/react/interactables-legacy/Interactables.d.ts.map +1 -1
- package/dist/react/interactables-legacy/Interactables.js +15 -8
- package/dist/react/interactables-legacy/Interactables.js.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.d.ts +6 -8
- package/dist/react/interactables-legacy/interactable-model-context.d.ts.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.js +13 -14
- package/dist/react/interactables-legacy/interactable-model-context.js.map +1 -1
- package/dist/react/interactables-legacy/scopes.d.ts +33 -36
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +6 -8
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +6 -7
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +23 -13
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js +54 -25
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js.map +1 -1
- package/dist/react/model-context/define-mcp-toolkit.d.ts +11 -13
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +12 -4
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +0 -2
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +0 -2
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +23 -25
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +4 -6
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +4 -6
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +4 -6
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +3 -4
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +0 -2
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +37 -24
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +2 -5
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +5 -7
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +2 -5
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +8 -11
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +11 -13
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +2 -3
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +2 -4
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +37 -36
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +10 -8
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +3 -5
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +5 -6
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +6 -8
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +4 -6
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +2 -4
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +2 -4
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +2 -4
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +3 -5
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +2 -4
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +2 -4
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +3 -5
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +1 -3
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +2 -4
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +4 -6
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +0 -2
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +2 -4
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +6 -8
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.js +4 -4
- package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +0 -2
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +0 -2
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +2 -4
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +0 -2
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +1 -3
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +5 -7
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +25 -26
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +22 -23
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +10 -9
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +11 -14
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +26 -28
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +16 -6
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +26 -23
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +14 -15
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +120 -117
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -3
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +199 -185
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +124 -82
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +6 -8
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +2 -4
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +13 -15
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +54 -56
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +20 -21
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.js +24 -5
- package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +22 -23
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +4 -6
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +3 -5
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +3 -5
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +2 -4
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +2 -4
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +2 -4
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +2 -4
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +2 -4
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +5 -7
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +2 -4
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +3 -5
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.js +5 -1
- package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +3 -5
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +3 -6
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +209 -219
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +53 -39
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +185 -196
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +13 -4
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +14 -19
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.js +3 -1
- package/dist/react/runtimes/RemoteThreadResource.js.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +8 -9
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +9 -11
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +4 -5
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js +9 -2
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.d.ts +7 -9
- package/dist/react/runtimes/assistant-transport/runManager.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.js +4 -1
- package/dist/react/runtimes/assistant-transport/runManager.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/types.d.ts +106 -100
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +3 -5
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js +17 -6
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts +2 -4
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +1 -3
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +5 -7
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +410 -213
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +14 -16
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +8 -4
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +136 -123
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +60 -9
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +9 -10
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +4 -5
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +1 -3
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.js +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +2 -4
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +8 -9
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +14 -17
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.js.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +11 -13
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +14 -18
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-store-history-copy.d.ts +25 -0
- package/dist/react/runtimes/external-store-history-copy.d.ts.map +1 -0
- package/dist/react/runtimes/external-store-history-copy.js +148 -0
- package/dist/react/runtimes/external-store-history-copy.js.map +1 -0
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +2 -4
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.js +72 -35
- package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts +1 -3
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +26 -37
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +142 -34
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +2 -4
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +1 -3
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +3 -5
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +46 -43
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +8 -11
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +50 -49
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +17 -19
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/types/store-augmentation.d.ts +10 -11
- package/dist/react/types/store-augmentation.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +5 -6
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +28 -29
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +1 -3
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +2 -4
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +26 -28
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +46 -43
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/bindings.d.ts +31 -30
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +207 -193
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +4 -0
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +28 -26
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +22 -0
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +87 -84
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +1 -1
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +48 -50
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +64 -66
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +73 -76
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +299 -300
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +2 -1
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +8 -10
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +149 -99
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +400 -122
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +120 -108
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +109 -41
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +29 -29
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +10 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +27 -29
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +21 -6
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +14 -16
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +7 -9
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +88 -72
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +63 -65
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +210 -197
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +25 -20
- package/dist/runtime/internal.d.ts.map +1 -0
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +35 -37
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +29 -31
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +1 -1
- package/dist/runtime/queue/queue-item.d.ts +5 -7
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +7 -8
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +13 -11
- package/dist/runtime/utils/attachment-add-operations.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.js +24 -2
- package/dist/runtime/utils/attachment-add-operations.js.map +1 -1
- package/dist/runtime/utils/attachment-send-operations.d.ts +12 -0
- package/dist/runtime/utils/attachment-send-operations.d.ts.map +1 -0
- package/dist/runtime/utils/attachment-send-operations.js +34 -0
- package/dist/runtime/utils/attachment-send-operations.js.map +1 -0
- package/dist/runtime/utils/auto-status.d.ts +4 -5
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +3 -5
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +26 -27
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +32 -32
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +3 -3
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +2 -4
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +21 -23
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +50 -51
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +8 -7
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/pending-tool-calls.d.ts +10 -11
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +6 -8
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +4 -6
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.d.ts +5 -5
- package/dist/runtime/utils/stored-message-parts.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.js +22 -2
- package/dist/runtime/utils/stored-message-parts.js.map +1 -1
- package/dist/runtime/utils/streaming-timing.d.ts +19 -21
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +36 -32
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +16 -6
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts +4 -5
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.js +31 -4
- package/dist/runtime/utils/thread-runtime-lifecycle.js.map +1 -1
- package/dist/runtime/utils/tool-call-tree.d.ts +6 -8
- package/dist/runtime/utils/tool-call-tree.d.ts.map +1 -1
- package/dist/runtime/utils/tool-interactions.d.ts +10 -0
- package/dist/runtime/utils/tool-interactions.d.ts.map +1 -0
- package/dist/runtime/utils/tool-interactions.js +92 -0
- package/dist/runtime/utils/tool-interactions.js.map +1 -0
- package/dist/runtimes/assistant-transport/utils.d.ts +0 -2
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +215 -198
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +5 -6
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js +4 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-shared-options.d.ts +1 -3
- package/dist/runtimes/external-store/external-store-shared-options.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +38 -40
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js +2 -2
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +117 -124
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +44 -14
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +3 -5
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +94 -95
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.js +3 -0
- package/dist/runtimes/inert/InertThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/internal.d.ts +20 -16
- package/dist/runtimes/internal.d.ts.map +1 -0
- package/dist/runtimes/local/local-runtime-core.d.ts +6 -8
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +40 -42
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +40 -42
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +93 -97
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +178 -31
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +1 -3
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +76 -53
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +28 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +11 -13
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +2 -4
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +1 -3
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +33 -29
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.js +8 -3
- package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +44 -46
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.js +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +25 -26
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +3 -5
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +111 -112
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +144 -145
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +22 -7
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/chain-of-thought-client.d.ts +7 -9
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +53 -54
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +1256 -731
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +1 -3
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +2 -4
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.js +3 -1
- package/dist/store/clients/no-op-composer-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +1 -3
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +3 -4
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/submission-message.d.ts +8 -0
- package/dist/store/clients/submission-message.d.ts.map +1 -0
- package/dist/store/clients/submission-message.js +22 -0
- package/dist/store/clients/submission-message.js.map +1 -0
- package/dist/store/clients/suggestions.d.ts +5 -7
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +10 -9
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.js +81 -82
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/clients/thread-selection-events.d.ts +0 -2
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +4 -6
- package/dist/store/clients/thread-tasks.d.ts.map +1 -1
- package/dist/store/env.d.ts +0 -2
- package/dist/store/env.d.ts.map +1 -1
- package/dist/store/index.d.ts +33 -36
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -5
- package/dist/store/internal.d.ts +12 -12
- package/dist/store/internal.d.ts.map +1 -0
- package/dist/store/internal.js +2 -2
- package/dist/store/primitive-predicates.d.ts +3 -4
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +9 -4
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +3 -5
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +10 -12
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +65 -62
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/handle-runtime-action.d.ts +0 -2
- package/dist/store/runtime-clients/handle-runtime-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts +0 -2
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +1 -3
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +3 -5
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.js +26 -16
- package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +9 -9
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +121 -113
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +4 -6
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +5 -7
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +3 -5
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +221 -158
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/useSubscribable.d.ts +2 -4
- package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -1
- package/dist/store/scope-registration.d.ts +28 -29
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/attachment.d.ts +15 -17
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +28 -29
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +141 -128
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +114 -107
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +7 -9
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +49 -45
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +18 -20
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +10 -12
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +13 -15
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +23 -25
- package/dist/store/scopes/task.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.d.ts +63 -65
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +192 -194
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +45 -47
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +58 -53
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +35 -7
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/types/attachment.d.ts +26 -27
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +4 -4
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +11 -13
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +7 -8
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/message.d.ts +322 -284
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +2 -4
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +8 -10
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +0 -2
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +0 -2
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +8 -11
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +10 -12
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +17 -18
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/id.d.ts +0 -2
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +0 -2
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +0 -2
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +0 -2
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +1 -3
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +1 -3
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +2 -3
- package/dist/utils/normalizePartStatus.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.js +3 -2
- package/dist/utils/normalizePartStatus.js.map +1 -1
- package/dist/utils/notify-event-listeners.d.ts +1 -2
- package/dist/utils/notify-event-listeners.d.ts.map +1 -1
- package/dist/utils/record.d.ts +0 -2
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +0 -2
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +1 -3
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +0 -2
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/adapters/attachment.test.ts +98 -1
- package/src/adapters/attachment.ts +70 -20
- package/src/adapters/speech.test.ts +94 -0
- package/src/adapters/speech.ts +16 -2
- package/src/adapters/thread-history.ts +16 -5
- package/src/adapters/voice.test.ts +169 -0
- package/src/adapters/voice.ts +25 -4
- package/src/index.ts +14 -2
- package/src/internal.ts +7 -0
- package/src/model-context/frame/host.test.ts +51 -1
- package/src/model-context/frame/host.ts +3 -1
- package/src/model-context/frame/provider.test.ts +61 -0
- package/src/model-context/frame/provider.ts +8 -1
- package/src/model-context/frame/validate.ts +57 -0
- package/src/model-context/interactable-composer-metadata.test.ts +82 -0
- package/src/model-context/interactable-composer-metadata.ts +45 -2
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +594 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +98 -35
- package/src/react/client/Interactables.test.ts +853 -1
- package/src/react/client/Interactables.ts +325 -45
- package/src/react/client/RemoteThreadList.initialize-failure.test.ts +124 -0
- package/src/react/client/RemoteThreadList.ts +6 -0
- package/src/react/client/Tools.ts +2 -3
- package/src/react/client/interactable-model-context.test.ts +56 -13
- package/src/react/client/interactable-model-context.ts +48 -23
- package/src/react/index.ts +2 -2
- package/src/react/interactables-legacy/Interactables.test.ts +212 -1
- package/src/react/interactables-legacy/Interactables.ts +25 -14
- package/src/react/interactables-legacy/interactable-model-context.ts +26 -24
- package/src/react/interactables-shared/useInteractablePersistenceQueue.test.tsx +22 -2
- package/src/react/interactables-shared/useInteractablePersistenceQueue.ts +63 -11
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +33 -0
- package/src/react/primitive-hooks/useSuggestionTrigger.ts +7 -4
- package/src/react/primitives/generativeUI/GenerativeUI.test.tsx +124 -8
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +35 -15
- package/src/react/primitives/message/MessageAttachments.test.tsx +2 -6
- package/src/react/primitives/message/MessageAttachments.tsx +14 -8
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +151 -7
- package/src/react/primitives/message/MessageGroupedParts.tsx +19 -6
- package/src/react/primitives/message/MessageParts.test.tsx +84 -0
- package/src/react/primitives/message/MessageParts.tool-interaction.test.tsx +69 -0
- package/src/react/primitives/message/MessageParts.tsx +29 -8
- package/src/react/primitives/thread/ThreadSuggestions.test.tsx +97 -0
- package/src/react/primitives/thread/ThreadSuggestions.tsx +29 -6
- package/src/react/providers/ReadonlyThreadProvider.tsx +2 -2
- package/src/react/providers/TextMessagePartProvider.tsx +3 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.running.test.tsx +93 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +160 -3
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +38 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +73 -53
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +19 -3
- package/src/react/runtimes/RemoteThreadResource.ts +5 -2
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.test.ts +3 -1
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.ts +10 -2
- package/src/react/runtimes/assistant-transport/runManager.ts +3 -0
- package/src/react/runtimes/assistant-transport/transport-parentid.test.tsx +57 -0
- package/src/react/runtimes/assistant-transport/transport-thread-id.test.tsx +571 -0
- package/src/react/runtimes/assistant-transport/types.ts +9 -1
- package/src/react/runtimes/assistant-transport/useAssistantTransport.spec.md +10 -0
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.test.tsx +42 -0
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.ts +33 -9
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.integration.test.tsx +289 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.test.tsx +471 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.engagement.test.tsx +330 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +78 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +361 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +571 -216
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +25 -0
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +7 -3
- package/src/react/runtimes/cloud/auiV0.ts +158 -9
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +352 -1
- package/src/react/runtimes/createMessageConverter.ts +9 -3
- package/src/react/runtimes/external-store-history-copy.ts +223 -0
- package/src/react/runtimes/useExternalStoreRuntime.history-copy.test.tsx +483 -0
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +76 -1
- package/src/react/runtimes/useExternalStoreRuntime.ts +25 -5
- package/src/react/runtimes/useLocalRuntime.test.tsx +145 -1
- package/src/react/runtimes/useLocalRuntime.ts +8 -5
- package/src/react/types/MessagePartComponentTypes.ts +10 -0
- package/src/react/types/scopes/interactables.ts +3 -0
- package/src/runtime/api/attachment-runtime.ts +10 -5
- package/src/runtime/api/bindings.ts +6 -1
- package/src/runtime/api/composer-runtime.ts +29 -6
- package/src/runtime/api/message-part-runtime.test.ts +215 -0
- package/src/runtime/api/message-part-runtime.ts +40 -0
- package/src/runtime/api/message-runtime.test.ts +112 -2
- package/src/runtime/api/message-runtime.ts +10 -5
- package/src/runtime/api/thread-list-item-runtime.ts +5 -5
- package/src/runtime/api/thread-list-runtime.ts +3 -3
- package/src/runtime/api/thread-runtime.test.ts +59 -0
- package/src/runtime/api/thread-runtime.ts +21 -11
- package/src/runtime/base/base-composer-runtime-core.ts +548 -153
- package/src/runtime/base/base-thread-runtime-core.test.ts +744 -9
- package/src/runtime/base/base-thread-runtime-core.ts +154 -27
- package/src/runtime/base/default-edit-composer-runtime-core.ts +13 -1
- package/src/runtime/base/default-thread-composer-runtime-core.ts +29 -10
- package/src/runtime/interfaces/composer-runtime-core.ts +19 -0
- package/src/runtime/interfaces/thread-runtime-core.ts +22 -1
- package/src/runtime/utils/attachment-add-operations.ts +45 -2
- package/src/runtime/utils/attachment-send-operations.ts +54 -0
- package/src/runtime/utils/auto-status.test.ts +54 -0
- package/src/runtime/utils/auto-status.ts +3 -10
- package/src/runtime/utils/external-message-conversion.test.ts +48 -0
- package/src/runtime/utils/external-message-conversion.ts +3 -4
- package/src/runtime/utils/message-repository.test.ts +69 -1
- package/src/runtime/utils/message-repository.ts +14 -7
- package/src/runtime/utils/stored-message-parts.ts +43 -1
- package/src/runtime/utils/thread-message-like.test.ts +58 -0
- package/src/runtime/utils/thread-message-like.ts +72 -46
- package/src/runtime/utils/thread-runtime-lifecycle.test.ts +67 -0
- package/src/runtime/utils/thread-runtime-lifecycle.ts +42 -8
- package/src/runtime/utils/tool-interactions.test.ts +193 -0
- package/src/runtime/utils/tool-interactions.ts +147 -0
- package/src/runtimes/external-store/external-store-adapter.ts +22 -1
- package/src/runtimes/external-store/external-store-runtime-core.ts +10 -2
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +2 -2
- package/src/runtimes/external-store/external-store-thread-runtime-core.test.ts +49 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +76 -29
- package/src/runtimes/inert/InertThreadRuntimeCore.test.ts +127 -56
- package/src/runtimes/inert/InertThreadRuntimeCore.ts +10 -1
- package/src/runtimes/local/local-thread-runtime-core.edit-cancellation.test.ts +70 -0
- package/src/runtimes/local/local-thread-runtime-core.test.ts +1649 -108
- package/src/runtimes/local/local-thread-runtime-core.ts +301 -47
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +53 -1
- package/src/runtimes/remote-thread-list/optimistic-state.ts +8 -3
- package/src/runtimes/tool-invocations/EDGE_CASES.md +19 -4
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +392 -39
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +31 -8
- package/src/store/clients/external-thread.test.ts +145 -0
- package/src/store/clients/external-thread.ts +635 -131
- package/src/store/clients/model-context-client.test.ts +8 -8
- package/src/store/clients/no-op-composer-client.ts +2 -0
- package/src/store/clients/submission-message.ts +27 -0
- package/src/store/clients/thread-message-client.test.ts +39 -0
- package/src/store/clients/thread-message-client.ts +13 -6
- package/src/store/index.ts +2 -2
- package/src/store/internal.ts +1 -0
- package/src/store/primitive-predicates.test.ts +103 -0
- package/src/store/primitive-predicates.ts +15 -3
- package/src/store/runtime-clients/composer-runtime-client.ts +4 -3
- package/src/store/runtime-clients/message-part-runtime-client.test.ts +42 -0
- package/src/store/runtime-clients/message-part-runtime-client.ts +4 -0
- package/src/store/runtime-clients/message-runtime-client.ts +5 -0
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +138 -5
- package/src/store/runtime-clients/thread-runtime-client.ts +46 -9
- package/src/store/scopes/composer.ts +22 -4
- package/src/store/scopes/message.ts +8 -0
- package/src/store/scopes/part.ts +8 -0
- package/src/subscribable/subscribable.test.ts +198 -1
- package/src/subscribable/subscribable.ts +49 -7
- package/src/tests/RemoteThreadListThreadListRuntimeCore-errors.test.ts +95 -1
- package/src/tests/auiV0Encode.test.ts +408 -1
- package/src/tests/base-composer-runtime-core-send.test.ts +722 -29
- package/src/tests/base-composer-runtime-core.test.ts +196 -0
- package/src/tests/composer-can-send.test.ts +98 -1
- package/src/tests/composer-submission.test.tsx +796 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +102 -2
- package/src/tests/external-store-thread-list-runtime-core.test.ts +111 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +581 -1
- package/src/tests/external-store-thread-runtime-core.test.ts +186 -0
- package/src/tests/external-thread-attachments.test.tsx +741 -3
- package/src/tests/external-thread-isLast.test.tsx +69 -0
- package/src/tests/get-thread-state-isRunning.test.ts +2 -2
- package/src/tests/remote-thread-list-adapter-switch.test.ts +45 -1
- package/src/types/message.ts +49 -2
- package/src/utils/normalizePartStatus.ts +14 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -15
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +0 -1
- package/dist/tests/remote-thread-list-test-helpers.js +0 -59
- package/dist/tests/remote-thread-list-test-helpers.js.map +0 -1
|
@@ -1,101 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { RealtimeVoiceAdapter } from "../../adapters/voice.js";
|
|
6
|
-
import { ModelContextProvider } from "../../model-context/types.js";
|
|
7
|
-
import { ChatModelAdapter } from "../../runtime/utils/chat-model-adapter.js";
|
|
8
|
-
import { ExportedMessageRepository } from "../../runtime/utils/message-repository.js";
|
|
9
|
-
import { QueueItemState } from "../../runtime/queue/queue-item.js";
|
|
10
|
-
import { QueuePlacement } from "../../runtime/queue/external-thread-queue-adapter.js";
|
|
11
|
-
import { AddToolResultOptions, RespondToToolApprovalOptions, ResumeRunConfig, ResumeToolCallOptions, StartRunConfig, ThreadRuntimeCore, ThreadSuggestion } from "../../runtime/interfaces/thread-runtime-core.js";
|
|
12
|
-
import { SuggestionAdapter } from "../../adapters/suggestion.js";
|
|
13
|
-
import { ThreadHistoryAdapter } from "../../adapters/thread-history.js";
|
|
1
|
+
import type { ChatModelAdapter } from "../../runtime/utils/chat-model-adapter.js";
|
|
2
|
+
import type { ExportedMessageRepository } from "../../runtime/utils/message-repository.js";
|
|
3
|
+
import type { LocalRuntimeOptionsBase } from "./local-runtime-options.js";
|
|
4
|
+
import type { AddToolResultOptions, ResumeToolCallOptions, RespondToToolApprovalOptions, ThreadSuggestion, ThreadRuntimeCore, Unstable_RecordToolInteractionOptions, StartRunConfig, ResumeRunConfig } from "../../runtime/interfaces/thread-runtime-core.js";
|
|
14
5
|
import { BaseThreadRuntimeCore } from "../../runtime/base/base-thread-runtime-core.js";
|
|
15
|
-
import {
|
|
16
|
-
import "../../
|
|
17
|
-
|
|
6
|
+
import type { AppendMessage, ThreadAssistantMessage } from "../../types/message.js";
|
|
7
|
+
import type { ThreadMessage } from "../../types/message.js";
|
|
8
|
+
import type { ModelContextProvider } from "../../model-context/types.js";
|
|
9
|
+
import type { QueuePlacement } from "../../runtime/queue/external-thread-queue-adapter.js";
|
|
10
|
+
import { type QueueItemState } from "../../runtime/queue/queue-item.js";
|
|
18
11
|
export declare class LocalThreadRuntimeCore extends BaseThreadRuntimeCore implements ThreadRuntimeCore {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
12
|
+
readonly capabilities: {
|
|
13
|
+
switchToBranch: boolean;
|
|
14
|
+
switchBranchDuringRun: boolean;
|
|
15
|
+
edit: boolean;
|
|
16
|
+
delete: boolean;
|
|
17
|
+
reload: boolean;
|
|
18
|
+
refetchThread: boolean;
|
|
19
|
+
cancel: boolean;
|
|
20
|
+
unstable_copy: boolean;
|
|
21
|
+
speech: boolean;
|
|
22
|
+
dictation: boolean;
|
|
23
|
+
voice: boolean;
|
|
24
|
+
attachments: boolean;
|
|
25
|
+
feedback: boolean;
|
|
26
|
+
queue: boolean;
|
|
27
|
+
};
|
|
28
|
+
private abortController;
|
|
29
|
+
private _queue;
|
|
30
|
+
private _queueRunInFlight;
|
|
31
|
+
private _activeRun;
|
|
32
|
+
private _runGeneration;
|
|
33
|
+
private _messageReplacements;
|
|
34
|
+
private _historyWrites;
|
|
35
|
+
private _chainHistoryWrite;
|
|
36
|
+
private _persistMessageUpdate;
|
|
37
|
+
readonly isDisabled = false;
|
|
38
|
+
readonly isSendDisabled = false;
|
|
39
|
+
private _isLoading;
|
|
40
|
+
get isLoading(): boolean;
|
|
41
|
+
private _suggestions;
|
|
42
|
+
private _suggestionsController;
|
|
43
|
+
get suggestions(): readonly ThreadSuggestion[];
|
|
44
|
+
get adapters(): {
|
|
45
|
+
chatModel: ChatModelAdapter;
|
|
46
|
+
history?: import("../../index.js").ThreadHistoryAdapter | undefined;
|
|
47
|
+
attachments?: import("../../index.js").AttachmentAdapter | undefined;
|
|
48
|
+
speech?: import("../../index.js").SpeechSynthesisAdapter | undefined;
|
|
49
|
+
dictation?: import("../../index.js").DictationAdapter | undefined;
|
|
50
|
+
voice?: import("../../index.js").RealtimeVoiceAdapter | undefined;
|
|
51
|
+
feedback?: import("../../index.js").FeedbackAdapter | undefined;
|
|
52
|
+
suggestion?: import("../../index.js").SuggestionAdapter | undefined;
|
|
53
|
+
};
|
|
54
|
+
constructor(contextProvider: ModelContextProvider, options: LocalRuntimeOptionsBase);
|
|
55
|
+
private _options;
|
|
56
|
+
private _lastRunConfig;
|
|
57
|
+
private _getThreadId?;
|
|
58
|
+
__internal_setGetThreadId(getThreadId: () => string | undefined): void;
|
|
59
|
+
private _getInitializePromise?;
|
|
60
|
+
__internal_setGetInitializePromise(getPromise: () => Promise<unknown> | undefined): void;
|
|
61
|
+
get extras(): undefined;
|
|
62
|
+
__internal_setOptions(options: LocalRuntimeOptionsBase): void;
|
|
63
|
+
private _loadPromise;
|
|
64
|
+
private _loadRequested;
|
|
65
|
+
__internal_load(): Promise<void>;
|
|
66
|
+
private _getHistoryLoadBarrier;
|
|
67
|
+
append(message: AppendMessage): Promise<void>;
|
|
68
|
+
protected _commitVoiceMessage(message: ThreadMessage): void | Promise<void>;
|
|
69
|
+
protected _onVoiceConnected(): void;
|
|
70
|
+
protected _onVoiceDisconnected(): void;
|
|
71
|
+
getQueueItems(): readonly QueueItemState[];
|
|
72
|
+
getSteerQueueItems(): readonly QueueItemState[];
|
|
73
|
+
moveQueueItem(queueItemId: string, placement: QueuePlacement): void;
|
|
74
|
+
removeQueueItem(queueItemId: string): void;
|
|
75
|
+
private _rollbackAppend;
|
|
76
|
+
private _pendingAppends;
|
|
77
|
+
protected _isRunActive(): boolean;
|
|
78
|
+
private _runAppend;
|
|
79
|
+
private _runAppendInner;
|
|
80
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
81
|
+
resumeRun({ stream, ...startConfig }: ResumeRunConfig): Promise<void>;
|
|
82
|
+
exportExternalState(): any;
|
|
83
|
+
import(data: ExportedMessageRepository): void;
|
|
84
|
+
importExternalState(): void;
|
|
85
|
+
unstable_notifySessionReset(): void;
|
|
86
|
+
startRun({ parentId, sourceId, runConfig }: StartRunConfig, runCallback?: ChatModelAdapter["run"]): Promise<void>;
|
|
87
|
+
private _runLoop;
|
|
88
|
+
private performRoundtrip;
|
|
89
|
+
detach(): void;
|
|
90
|
+
cancelRun(): void;
|
|
91
|
+
protected _onMessageMetadataChanged(previousMessage: ThreadAssistantMessage, message: ThreadAssistantMessage): void;
|
|
92
|
+
addToolResult({ messageId, toolCallId, result, isError, artifact, modelContent, }: AddToolResultOptions): void;
|
|
93
|
+
resumeToolCall(_options: ResumeToolCallOptions): void;
|
|
94
|
+
unstable_recordToolInteraction({ messageId, toolCallId, interaction, }: Unstable_RecordToolInteractionOptions): Promise<void>;
|
|
95
|
+
respondToToolApproval({ approvalId, approved, optionId, text, reason, }: RespondToToolApprovalOptions): Promise<void>;
|
|
99
96
|
}
|
|
100
|
-
//#endregion
|
|
101
97
|
//# sourceMappingURL=local-thread-runtime-core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-thread-runtime-core.d.ts","
|
|
1
|
+
{"version":3,"file":"local-thread-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtimes/local/local-thread-runtime-core.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAEjB,kDAA+C;AAGhD,OAAO,KAAK,EAAE,yBAAyB,EAAE,kDAA+C;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,mCAAgC;AAEvE,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,qCAAqC,EACrC,cAAc,EACd,eAAe,EAChB,wDAAqD;AACtD,OAAO,EAAE,qBAAqB,EAAE,uDAAoD;AACpF,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EAGvB,+BAA4B;AAC7B,OAAO,KAAK,EAAa,aAAa,EAAE,+BAA4B;AAEpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,qCAAkC;AAKtE,OAAO,KAAK,EAAE,cAAc,EAAE,6DAA0D;AACxF,OAAO,EAEL,KAAK,cAAc,EACpB,0CAAuC;AA+ExC,qBAAa,sBACX,SAAQ,qBACR,YAAW,iBAAiB;IAE5B,SAAgB,YAAY;;;;;;;;;;;;;;;MAe1B;IAEF,OAAO,CAAC,eAAe,CAAgC;IAEvD,OAAO,CAAC,MAAM,CAAuC;IAIrD,OAAO,CAAC,iBAAiB,CAAuB;IAChD,OAAO,CAAC,UAAU,CAAuC;IACzD,OAAO,CAAC,cAAc,CAAK;IAE3B,OAAO,CAAC,oBAAoB,CAGxB;IAEJ,OAAO,CAAC,cAAc,CAAoC;IAI1D,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,qBAAqB;IAiB7B,SAAgB,UAAU,SAAS;IACnC,SAAgB,cAAc,SAAS;IAEvC,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,YAEnB;IAED,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,sBAAsB,CAAgC;IAC9D,IAAW,WAAW,IAAI,SAAS,gBAAgB,EAAE,CAEpD;IAED,IAAW,QAAQ;;;;;;;;;MAElB;gBAGC,eAAe,EAAE,oBAAoB,EACrC,OAAO,EAAE,uBAAuB;IAMlC,OAAO,CAAC,QAAQ,CAA2B;IAE3C,OAAO,CAAC,cAAc,CAAiB;IAEvC,OAAO,CAAC,YAAY,CAAC,CAA2B;IAEzC,yBAAyB,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS;IAItE,OAAO,CAAC,qBAAqB,CAAC,CAAqC;IAE5D,kCAAkC,CACvC,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS;IAKhD,IAAW,MAAM,cAEhB;IAEM,qBAAqB,CAAC,OAAO,EAAE,uBAAuB;IAoG7D,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,cAAc,CAAS;IACxB,eAAe;IAiDtB,OAAO,CAAC,sBAAsB;IAKjB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;cAyBvC,mBAAmB,CACpC,OAAO,EAAE,aAAa,GACrB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;cA0BJ,iBAAiB,IAAI,IAAI;cAIzB,oBAAoB,IAAI,IAAI;IAIxC,aAAa,IAAI,SAAS,cAAc,EAAE;IAM1C,kBAAkB,IAAI,SAAS,cAAc,EAAE;IAI/C,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,IAAI;IAInE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIjD,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,eAAe,CAAK;cAET,YAAY,IAAI,OAAO;YAI5B,UAAU;YASV,eAAe;IA6EhB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBrD,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrE,mBAAmB,IAAI,GAAG;IAIjB,MAAM,CAAC,IAAI,EAAE,yBAAyB;IAI/C,mBAAmB,IAAI,IAAI;IAI3B,2BAA2B,IAAI,IAAI;IAI7B,QAAQ,CACnB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,EACjD,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC;YA2BF,QAAQ;YAqFR,gBAAgB;IAyTvB,MAAM;IAWN,SAAS;cAgBG,yBAAyB,CAC1C,eAAe,EAAE,sBAAsB,EACvC,OAAO,EAAE,sBAAsB,GAC9B,IAAI;IAKA,aAAa,CAAC,EACnB,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,GACb,EAAE,oBAAoB;IAiEhB,cAAc,CAAC,QAAQ,EAAE,qBAAqB;IAMxC,8BAA8B,CAAC,EAC1C,SAAS,EACT,UAAU,EACV,WAAW,GACZ,EAAE,qCAAqC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmDjD,qBAAqB,CAAC,EAC3B,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,MAAM,GACP,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC;CAqFhD"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { generateId } from "../../utils/id.js";
|
|
2
2
|
import { consumeSuggestionResult } from "../../adapters/suggestion.js";
|
|
3
3
|
import { MessageNotSentError, toAssistantError } from "../../types/error.js";
|
|
4
|
+
import { appendToolInteraction } from "../../runtime/utils/tool-interactions.js";
|
|
4
5
|
import { fromThreadMessageLike } from "../../runtime/utils/thread-message-like.js";
|
|
5
6
|
import { getAutoStatus } from "../../runtime/utils/auto-status.js";
|
|
6
7
|
import { EMPTY_QUEUE_ITEMS } from "../../runtime/queue/queue-item.js";
|
|
7
8
|
import { createMessageQueue } from "../../runtime/queue/message-queue.js";
|
|
9
|
+
import { captureThreadRuntimeGeneration, invalidateThreadRuntime } from "../../runtime/utils/thread-runtime-lifecycle.js";
|
|
8
10
|
import { BaseThreadRuntimeCore } from "../../runtime/base/base-thread-runtime-core.js";
|
|
9
11
|
import { shouldContinue } from "./should-continue.js";
|
|
10
|
-
import { captureThreadRuntimeGeneration, invalidateThreadRuntime, isThreadRuntimeGenerationCurrent } from "../../runtime/utils/thread-runtime-lifecycle.js";
|
|
11
12
|
//#region src/runtimes/local/local-thread-runtime-core.ts
|
|
12
13
|
var AbortError = class extends Error {
|
|
13
14
|
name = "AbortError";
|
|
@@ -31,6 +32,26 @@ const withLocalPauseReasons = (data) => ({
|
|
|
31
32
|
message: withLocalPauseReason(item.message)
|
|
32
33
|
}))
|
|
33
34
|
});
|
|
35
|
+
const withoutToolInteractions = (message) => {
|
|
36
|
+
if (message.role !== "assistant") return message;
|
|
37
|
+
let hasInteractions = false;
|
|
38
|
+
const content = message.content.map((part) => {
|
|
39
|
+
if (part.type !== "tool-call") return part;
|
|
40
|
+
const nestedMessages = part.messages?.map(withoutToolInteractions);
|
|
41
|
+
const hasNestedInteractions = nestedMessages?.some((nestedMessage, index) => nestedMessage !== part.messages?.[index]);
|
|
42
|
+
if (part.unstable_interactions === void 0 && hasNestedInteractions !== true) return part;
|
|
43
|
+
hasInteractions = true;
|
|
44
|
+
const { unstable_interactions: _, ...withoutInteractions } = part;
|
|
45
|
+
return hasNestedInteractions ? {
|
|
46
|
+
...withoutInteractions,
|
|
47
|
+
messages: nestedMessages
|
|
48
|
+
} : withoutInteractions;
|
|
49
|
+
});
|
|
50
|
+
return hasInteractions ? {
|
|
51
|
+
...message,
|
|
52
|
+
content
|
|
53
|
+
} : message;
|
|
54
|
+
};
|
|
34
55
|
var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
35
56
|
capabilities = {
|
|
36
57
|
switchToBranch: true,
|
|
@@ -53,6 +74,7 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
53
74
|
_queueRunInFlight = null;
|
|
54
75
|
_activeRun = null;
|
|
55
76
|
_runGeneration = 0;
|
|
77
|
+
_messageReplacements = /* @__PURE__ */ new WeakMap();
|
|
56
78
|
_historyWrites = /* @__PURE__ */ new Map();
|
|
57
79
|
_chainHistoryWrite(id, write) {
|
|
58
80
|
const next = (this._historyWrites.get(id) ?? Promise.resolve()).then(write, write);
|
|
@@ -63,10 +85,17 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
63
85
|
});
|
|
64
86
|
return next;
|
|
65
87
|
}
|
|
66
|
-
|
|
67
|
-
if (message.status?.type !== "requires-action") return;
|
|
88
|
+
_persistMessageUpdate(messageId) {
|
|
68
89
|
const history = this._options.adapters.history;
|
|
69
90
|
if (!history?.update) return;
|
|
91
|
+
let entry;
|
|
92
|
+
try {
|
|
93
|
+
entry = this.repository.getMessage(messageId);
|
|
94
|
+
} catch {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const { parentId, message } = entry;
|
|
98
|
+
if (message.role !== "assistant" || message.status.type === "running") return;
|
|
70
99
|
const update = history.update.bind(history);
|
|
71
100
|
const item = {
|
|
72
101
|
parentId,
|
|
@@ -175,7 +204,6 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
175
204
|
if (!this.adapters.history) return Promise.resolve();
|
|
176
205
|
const promise = this.adapters.history.load();
|
|
177
206
|
this._isLoading = true;
|
|
178
|
-
this._notifySubscribers();
|
|
179
207
|
this._loadPromise = promise.then((repo) => {
|
|
180
208
|
if (!repo) return;
|
|
181
209
|
this.repository.import(withLocalPauseReasons(repo));
|
|
@@ -191,14 +219,19 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
191
219
|
this._isLoading = false;
|
|
192
220
|
this._notifySubscribers();
|
|
193
221
|
});
|
|
222
|
+
this._notifySubscribers();
|
|
194
223
|
return this._loadPromise;
|
|
195
224
|
}
|
|
225
|
+
_getHistoryLoadBarrier() {
|
|
226
|
+
if (!this._isLoading || !this._loadPromise) return void 0;
|
|
227
|
+
return this._loadPromise.catch(() => {});
|
|
228
|
+
}
|
|
196
229
|
async append(message) {
|
|
197
230
|
message = {
|
|
198
231
|
...message,
|
|
199
232
|
parentId: this._resolveAppendParent(message.parentId)
|
|
200
233
|
};
|
|
201
|
-
if (this.voice)
|
|
234
|
+
if (this.voice) return this._appendToVoiceSession(message);
|
|
202
235
|
if (this._isVoiceMessage(message.sourceId)) throw new Error("Voice transcript messages cannot be edited");
|
|
203
236
|
const isTail = message.parentId === (this.messages.at(-1)?.id ?? null);
|
|
204
237
|
const willRun = message.startRun ?? message.role === "user";
|
|
@@ -211,16 +244,26 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
211
244
|
return this._runAppend(message);
|
|
212
245
|
}
|
|
213
246
|
_commitVoiceMessage(message) {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
247
|
+
const generation = captureThreadRuntimeGeneration(this);
|
|
248
|
+
const commit = (notify) => {
|
|
249
|
+
if (generation.aborted) {
|
|
250
|
+
this._dropVoiceMessage(message.id, notify);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const parentId = this.repository.headId;
|
|
254
|
+
this.repository.addOrUpdateMessage(parentId, message);
|
|
255
|
+
this.repository.resetHead(message.id);
|
|
256
|
+
const historyWrite = this._options.adapters.history?.append({
|
|
257
|
+
parentId,
|
|
258
|
+
message
|
|
259
|
+
});
|
|
260
|
+
historyWrite?.catch(() => {});
|
|
261
|
+
this._dropVoiceMessage(message.id, false);
|
|
262
|
+
if (notify) this._notifySubscribers();
|
|
263
|
+
return historyWrite;
|
|
264
|
+
};
|
|
265
|
+
const barrier = this._getVoiceCommitBarrier();
|
|
266
|
+
return barrier ? barrier.then(() => commit(true)) : commit(false);
|
|
224
267
|
}
|
|
225
268
|
_onVoiceConnected() {
|
|
226
269
|
this._queue?.hold();
|
|
@@ -262,6 +305,16 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
262
305
|
}
|
|
263
306
|
async _runAppendInner(rawMessage) {
|
|
264
307
|
const generation = captureThreadRuntimeGeneration(this);
|
|
308
|
+
const loadBarrier = this._getHistoryLoadBarrier();
|
|
309
|
+
if (loadBarrier) {
|
|
310
|
+
const wasAtTail = rawMessage.parentId === (this.messages.at(-1)?.id ?? null);
|
|
311
|
+
await loadBarrier;
|
|
312
|
+
if (generation.aborted) return;
|
|
313
|
+
if (wasAtTail) rawMessage = {
|
|
314
|
+
...rawMessage,
|
|
315
|
+
parentId: this._resolveAppendParent(this.messages.at(-1)?.id ?? null)
|
|
316
|
+
};
|
|
317
|
+
}
|
|
265
318
|
const message = this.enrichAppendMetadata(rawMessage);
|
|
266
319
|
this.ensureInitialized();
|
|
267
320
|
const newMessage = fromThreadMessageLike(message, generateId(), {
|
|
@@ -275,12 +328,12 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
275
328
|
if (initPromise) await initPromise;
|
|
276
329
|
} catch (error) {
|
|
277
330
|
this._rollbackAppend(newMessage.id);
|
|
278
|
-
if (
|
|
331
|
+
if (generation.aborted) return;
|
|
279
332
|
const notSent = new MessageNotSentError();
|
|
280
333
|
notSent.cause = error;
|
|
281
334
|
throw notSent;
|
|
282
335
|
}
|
|
283
|
-
if (
|
|
336
|
+
if (generation.aborted) {
|
|
284
337
|
this._rollbackAppend(newMessage.id);
|
|
285
338
|
return;
|
|
286
339
|
}
|
|
@@ -373,6 +426,12 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
373
426
|
message = await this.performRoundtrip(parentId, message, runConfig, alreadyPersisted, run, runCallback);
|
|
374
427
|
runCallback = void 0;
|
|
375
428
|
if (this._activeRun !== run) break;
|
|
429
|
+
let replacement = this._messageReplacements.get(message);
|
|
430
|
+
while (replacement) {
|
|
431
|
+
message = replacement.message;
|
|
432
|
+
replacement = this._messageReplacements.get(message);
|
|
433
|
+
}
|
|
434
|
+
if (this.getMessageById(message.id)?.message !== message) break;
|
|
376
435
|
} while (shouldContinue(message, this._options.unstable_humanToolNames));
|
|
377
436
|
} finally {
|
|
378
437
|
this._notifyEventSubscribers("runEnd", {});
|
|
@@ -402,7 +461,7 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
402
461
|
}
|
|
403
462
|
}
|
|
404
463
|
async performRoundtrip(parentId, message, runConfig, alreadyPersisted, run, runCallback) {
|
|
405
|
-
const
|
|
464
|
+
const modelMessages = (parentId ? this.repository.getMessages(parentId) : []).map(withoutToolInteractions);
|
|
406
465
|
this.abortController?.abort();
|
|
407
466
|
const abortController = new AbortController();
|
|
408
467
|
this.abortController = abortController;
|
|
@@ -411,31 +470,79 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
411
470
|
const initialData = message.metadata?.unstable_data;
|
|
412
471
|
const initialSteps = message.metadata?.steps;
|
|
413
472
|
const initialCustom = message.metadata?.custom;
|
|
473
|
+
const externalToolCallIds = /* @__PURE__ */ new Set();
|
|
414
474
|
let hasStoredMessage = true;
|
|
415
475
|
try {
|
|
416
476
|
this.repository.getMessage(message.id);
|
|
417
477
|
} catch {
|
|
418
478
|
hasStoredMessage = false;
|
|
419
479
|
}
|
|
420
|
-
const
|
|
480
|
+
const syncOwnedMessage = () => {
|
|
421
481
|
if (!hasStoredMessage) return this._activeRun === run;
|
|
422
482
|
try {
|
|
423
|
-
|
|
483
|
+
let ownedMessage = message;
|
|
484
|
+
let replacement = this._messageReplacements.get(ownedMessage);
|
|
485
|
+
while (replacement) {
|
|
486
|
+
if (replacement.toolCallId !== void 0) externalToolCallIds.add(replacement.toolCallId);
|
|
487
|
+
ownedMessage = replacement.message;
|
|
488
|
+
replacement = this._messageReplacements.get(ownedMessage);
|
|
489
|
+
}
|
|
490
|
+
if (this.repository.getMessage(message.id).message !== ownedMessage) return false;
|
|
491
|
+
message = ownedMessage;
|
|
492
|
+
return true;
|
|
424
493
|
} catch {
|
|
425
494
|
return false;
|
|
426
495
|
}
|
|
427
496
|
};
|
|
497
|
+
const withExternalResults = (parts) => {
|
|
498
|
+
const interactions = /* @__PURE__ */ new Map();
|
|
499
|
+
for (const part of message.content) if (part.type === "tool-call" && part.unstable_interactions !== void 0) interactions.set(part.toolCallId, part.unstable_interactions);
|
|
500
|
+
const withInteractions = parts.map((part) => {
|
|
501
|
+
if (part.type !== "tool-call" || part.unstable_interactions !== void 0) return part;
|
|
502
|
+
const unstable_interactions = interactions.get(part.toolCallId);
|
|
503
|
+
return unstable_interactions === void 0 ? part : {
|
|
504
|
+
...part,
|
|
505
|
+
unstable_interactions
|
|
506
|
+
};
|
|
507
|
+
});
|
|
508
|
+
if (externalToolCallIds.size === 0) return withInteractions;
|
|
509
|
+
const previousToolCalls = /* @__PURE__ */ new Map();
|
|
510
|
+
for (const part of message.content) {
|
|
511
|
+
if (part.type !== "tool-call" || !externalToolCallIds.has(part.toolCallId)) continue;
|
|
512
|
+
const occurrences = previousToolCalls.get(part.toolCallId) ?? [];
|
|
513
|
+
occurrences.push(part);
|
|
514
|
+
previousToolCalls.set(part.toolCallId, occurrences);
|
|
515
|
+
}
|
|
516
|
+
const incomingOccurrences = /* @__PURE__ */ new Map();
|
|
517
|
+
return withInteractions.map((part) => {
|
|
518
|
+
if (part.type !== "tool-call") return part;
|
|
519
|
+
const occurrence = incomingOccurrences.get(part.toolCallId) ?? 0;
|
|
520
|
+
incomingOccurrences.set(part.toolCallId, occurrence + 1);
|
|
521
|
+
if (part.result !== void 0 && part.isPreliminary !== true) return part;
|
|
522
|
+
const completed = previousToolCalls.get(part.toolCallId)?.[occurrence];
|
|
523
|
+
if (!completed || completed.result === void 0 || completed.isPreliminary === true) return part;
|
|
524
|
+
const { isPreliminary: _, artifact: _artifact, modelContent: _modelContent, ...settledPart } = part;
|
|
525
|
+
return {
|
|
526
|
+
...settledPart,
|
|
527
|
+
result: completed.result,
|
|
528
|
+
isError: completed.isError,
|
|
529
|
+
...completed.artifact !== void 0 && { artifact: completed.artifact },
|
|
530
|
+
...completed.modelContent !== void 0 && { modelContent: completed.modelContent }
|
|
531
|
+
};
|
|
532
|
+
});
|
|
533
|
+
};
|
|
428
534
|
const updateMessage = (m) => {
|
|
429
|
-
if (!
|
|
535
|
+
if (!syncOwnedMessage()) return;
|
|
430
536
|
const newSteps = m.metadata?.steps;
|
|
431
537
|
const steps = newSteps ? [...initialSteps ?? [], ...newSteps] : void 0;
|
|
432
538
|
const newAnnotations = m.metadata?.unstable_annotations;
|
|
433
539
|
const newData = m.metadata?.unstable_data;
|
|
434
540
|
const annotations = newAnnotations ? [...initialAnnotations ?? [], ...newAnnotations] : void 0;
|
|
435
541
|
const data = newData ? [...initialData ?? [], ...newData] : void 0;
|
|
542
|
+
const content = m.content ? withExternalResults([...initialContent, ...m.content]) : void 0;
|
|
436
543
|
message = {
|
|
437
544
|
...message,
|
|
438
|
-
...
|
|
545
|
+
...content ? { content } : void 0,
|
|
439
546
|
status: m.status ?? message.status,
|
|
440
547
|
...m.metadata ? { metadata: {
|
|
441
548
|
...message.metadata,
|
|
@@ -473,7 +580,7 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
473
580
|
const shouldCancelMessage = () => abortSignal.aborted && (message.status.type === "running" || message.status.type === "requires-action" && (this._activeRun !== run || shouldContinue(message, this._options.unstable_humanToolNames)));
|
|
474
581
|
const threadId = this._getThreadId?.();
|
|
475
582
|
const promiseOrGenerator = runCallback({
|
|
476
|
-
messages,
|
|
583
|
+
messages: modelMessages,
|
|
477
584
|
runConfig: this._lastRunConfig,
|
|
478
585
|
abortSignal,
|
|
479
586
|
context,
|
|
@@ -481,7 +588,8 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
481
588
|
unstable_threadId: threadId,
|
|
482
589
|
unstable_parentId: parentId,
|
|
483
590
|
unstable_getMessage() {
|
|
484
|
-
|
|
591
|
+
syncOwnedMessage();
|
|
592
|
+
return withoutToolInteractions(message);
|
|
485
593
|
}
|
|
486
594
|
});
|
|
487
595
|
if (Symbol.asyncIterator in promiseOrGenerator) for await (const r of promiseOrGenerator) {
|
|
@@ -523,6 +631,7 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
523
631
|
} finally {
|
|
524
632
|
if (this.abortController === abortController) this.abortController = null;
|
|
525
633
|
const history = this._options.adapters.history;
|
|
634
|
+
const ownsCurrentMessage = syncOwnedMessage();
|
|
526
635
|
const item = {
|
|
527
636
|
parentId,
|
|
528
637
|
message,
|
|
@@ -530,7 +639,7 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
530
639
|
};
|
|
531
640
|
const isTerminal = message.status.type === "complete" || message.status.type === "incomplete";
|
|
532
641
|
const isPausing = message.status.type === "requires-action" && !shouldContinue(message, this._options.unstable_humanToolNames);
|
|
533
|
-
if (
|
|
642
|
+
if (ownsCurrentMessage && (isTerminal || isPausing && history?.update)) {
|
|
534
643
|
const write = alreadyPersisted && history?.update ? history.update.bind(history) : history?.append.bind(history);
|
|
535
644
|
if (write) await this._chainHistoryWrite(message.id, () => write(item));
|
|
536
645
|
}
|
|
@@ -560,6 +669,10 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
560
669
|
this._suggestionsController?.abort();
|
|
561
670
|
this._suggestionsController = null;
|
|
562
671
|
}
|
|
672
|
+
_onMessageMetadataChanged(previousMessage, message) {
|
|
673
|
+
this._messageReplacements.set(previousMessage, { message });
|
|
674
|
+
this._persistMessageUpdate(message.id);
|
|
675
|
+
}
|
|
563
676
|
addToolResult({ messageId, toolCallId, result, isError, artifact, modelContent }) {
|
|
564
677
|
if (this.voice) throw new Error("Cannot add a tool result while a voice session is connected");
|
|
565
678
|
const messageData = this.repository.getMessage(messageId);
|
|
@@ -572,9 +685,10 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
572
685
|
if (c.type !== "tool-call") return c;
|
|
573
686
|
if (c.toolCallId !== toolCallId) return c;
|
|
574
687
|
found = true;
|
|
575
|
-
if (c.result === void 0) added = true;
|
|
688
|
+
if (c.result === void 0 || c.isPreliminary === true) added = true;
|
|
689
|
+
const { isPreliminary: _isPreliminary, ...part } = c;
|
|
576
690
|
return {
|
|
577
|
-
...
|
|
691
|
+
...part,
|
|
578
692
|
result,
|
|
579
693
|
isError,
|
|
580
694
|
...artifact !== void 0 && { artifact },
|
|
@@ -582,18 +696,50 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
582
696
|
};
|
|
583
697
|
});
|
|
584
698
|
if (!found) throw new Error("Tried to add tool result to non-existing tool call");
|
|
699
|
+
const previousMessage = message;
|
|
585
700
|
message = {
|
|
586
701
|
...message,
|
|
587
702
|
content: newContent
|
|
588
703
|
};
|
|
704
|
+
if (previousMessage.status.type === "running") this._messageReplacements.set(previousMessage, {
|
|
705
|
+
message,
|
|
706
|
+
toolCallId
|
|
707
|
+
});
|
|
589
708
|
this.repository.addOrUpdateMessage(parentId, message);
|
|
590
709
|
this._notifySubscribers();
|
|
591
|
-
if (added
|
|
592
|
-
|
|
710
|
+
if (!added) return;
|
|
711
|
+
const stored = this.getMessageById(messageId);
|
|
712
|
+
if (stored?.message.role === "assistant" && shouldContinue(stored.message, this._options.unstable_humanToolNames)) this._runLoop(stored.parentId, stored.message, this._lastRunConfig).catch(() => {});
|
|
713
|
+
else this._persistMessageUpdate(messageId);
|
|
593
714
|
}
|
|
594
715
|
resumeToolCall(_options) {
|
|
595
716
|
throw new Error("Local runtime does not support resuming tool calls. For human-in-the-loop tools, list the tool in unstable_humanToolNames and complete the call with addToolResult.");
|
|
596
717
|
}
|
|
718
|
+
async unstable_recordToolInteraction({ messageId, toolCallId, interaction }) {
|
|
719
|
+
let messageData;
|
|
720
|
+
try {
|
|
721
|
+
messageData = this.repository.getMessage(messageId);
|
|
722
|
+
} catch {
|
|
723
|
+
throw new Error("Tried to record a tool interaction on a non-existing message");
|
|
724
|
+
}
|
|
725
|
+
const { parentId, message: previousMessage } = messageData;
|
|
726
|
+
if (previousMessage.role !== "assistant") throw new Error("Tried to record a tool interaction on a non-assistant message");
|
|
727
|
+
const toolCallIndex = previousMessage.content.findIndex((part) => part.type === "tool-call" && part.toolCallId === toolCallId);
|
|
728
|
+
if (toolCallIndex === -1) throw new Error("Tried to record a tool interaction on a non-existing tool call");
|
|
729
|
+
const target = previousMessage.content[toolCallIndex];
|
|
730
|
+
if (target.type !== "tool-call") throw new Error("Tried to record a tool interaction on a non-existing tool call");
|
|
731
|
+
const message = {
|
|
732
|
+
...previousMessage,
|
|
733
|
+
content: previousMessage.content.map((part, index) => index === toolCallIndex ? {
|
|
734
|
+
...part,
|
|
735
|
+
unstable_interactions: appendToolInteraction(target.unstable_interactions, interaction)
|
|
736
|
+
} : part)
|
|
737
|
+
};
|
|
738
|
+
if (previousMessage.status.type === "running") this._messageReplacements.set(previousMessage, { message });
|
|
739
|
+
this.repository.addOrUpdateMessage(parentId, message);
|
|
740
|
+
this._notifySubscribers();
|
|
741
|
+
this._persistMessageUpdate(message.id);
|
|
742
|
+
}
|
|
597
743
|
respondToToolApproval({ approvalId, approved, optionId, text, reason }) {
|
|
598
744
|
if (this.voice) throw new Error("Cannot respond to a tool approval while a voice session is connected");
|
|
599
745
|
let message = this.repository.getMessages().findLast((m) => m.role === "assistant" && m.content.some((c) => c.type === "tool-call" && c.approval?.id === approvalId));
|
|
@@ -633,8 +779,9 @@ var LocalThreadRuntimeCore = class extends BaseThreadRuntimeCore {
|
|
|
633
779
|
this.repository.addOrUpdateMessage(parentId, message);
|
|
634
780
|
this._notifySubscribers();
|
|
635
781
|
this._notifyToolApprovalAnswered(message.id, target.toolCallId, target.toolName, approved);
|
|
636
|
-
|
|
637
|
-
|
|
782
|
+
const stored = this.getMessageById(message.id);
|
|
783
|
+
if (this.repository.headId === message.id && stored?.message.role === "assistant" && shouldContinue(stored.message, this._options.unstable_humanToolNames)) this._runLoop(stored.parentId, stored.message, this._lastRunConfig).catch(() => {});
|
|
784
|
+
else this._persistMessageUpdate(message.id);
|
|
638
785
|
return Promise.resolve();
|
|
639
786
|
}
|
|
640
787
|
};
|