@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,37 +1,35 @@
|
|
|
1
|
-
import { AppendMessage } from "../../types/message.js";
|
|
2
|
-
import { ExternalThreadQueueAdapter } from "./external-thread-queue-adapter.js";
|
|
3
|
-
//#region src/runtime/queue/message-queue.d.ts
|
|
1
|
+
import type { AppendMessage } from "../../types/message.js";
|
|
2
|
+
import type { ExternalThreadQueueAdapter } from "./external-thread-queue-adapter.js";
|
|
4
3
|
export type MessageQueueDriver = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
/**
|
|
5
|
+
* A synchronous throw is treated as a run that never started and restores
|
|
6
|
+
* the message. A driver that already started work must call `notifyBusy`
|
|
7
|
+
* before throwing.
|
|
8
|
+
*/
|
|
9
|
+
run: (message: AppendMessage, options: {
|
|
10
|
+
steer: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
/** When omitted, steering degrades to "process next" instead of interrupting. */
|
|
13
|
+
cancel?: (() => void) | undefined;
|
|
15
14
|
};
|
|
16
15
|
export type MessageQueueController = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
readonly adapter: ExternalThreadQueueAdapter;
|
|
17
|
+
hold: () => void;
|
|
18
|
+
release: () => void;
|
|
19
|
+
/** Mark a run as in flight so concurrent sends buffer; call on the rising edge. */
|
|
20
|
+
notifyBusy: () => void;
|
|
21
|
+
/** Advances to the next pending message; call on the run's falling edge. */
|
|
22
|
+
notifyIdle: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Pauses queue advance for a user-initiated cancel, so the cancelled run's
|
|
25
|
+
* settle keeps the pending items instead of dispatching the next one; the
|
|
26
|
+
* next explicit send or run start re-arms draining. Call before aborting
|
|
27
|
+
* the run.
|
|
28
|
+
*/
|
|
29
|
+
notifyCancelled: () => void;
|
|
30
|
+
/** Empties both lanes without dispatching. */
|
|
31
|
+
clear: () => void;
|
|
32
|
+
subscribe: (callback: () => void) => () => void;
|
|
34
33
|
};
|
|
35
34
|
export declare const createMessageQueue: (driver: MessageQueueDriver) => MessageQueueController;
|
|
36
|
-
//#endregion
|
|
37
35
|
//# sourceMappingURL=message-queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-queue.d.ts","
|
|
1
|
+
{"version":3,"file":"message-queue.d.ts","sourceRoot":"","sources":["../../../src/runtime/queue/message-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAGd,+BAA4B;AAK7B,OAAO,KAAK,EACV,0BAA0B,EAE3B,2CAAwC;AAEzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,GAAG,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,iFAAiF;IACjF,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAC7C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mFAAmF;IACnF,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CACjD,CAAC;AAqCF,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,kBAAkB,KACzB,sBAsSF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { notifyEventListeners } from "../../utils/notify-event-listeners.js";
|
|
2
1
|
import { generateId } from "../../utils/id.js";
|
|
2
|
+
import { notifyEventListeners } from "../../utils/notify-event-listeners.js";
|
|
3
3
|
import { getThreadMessageText } from "../../utils/text.js";
|
|
4
4
|
import { EMPTY_QUEUE_ITEMS } from "./queue-item.js";
|
|
5
5
|
//#region src/runtime/queue/message-queue.ts
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { FileMessagePart, TextMessagePart } from "../../types/message.js";
|
|
2
|
-
//#region src/runtime/queue/queue-item.d.ts
|
|
1
|
+
import type { FileMessagePart, TextMessagePart } from "../../types/message.js";
|
|
3
2
|
export type QueueItemState = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
readonly id: string;
|
|
4
|
+
/** @deprecated Derive from the text parts of `parts` instead. Removal after 2026-11-05. */
|
|
5
|
+
readonly prompt: string;
|
|
6
|
+
readonly parts: readonly (FileMessagePart | TextMessagePart)[];
|
|
8
7
|
};
|
|
9
8
|
export declare const EMPTY_QUEUE_ITEMS: readonly QueueItemState[];
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=queue-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-item.d.ts","
|
|
1
|
+
{"version":3,"file":"queue-item.d.ts","sourceRoot":"","sources":["../../../src/runtime/queue/queue-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,+BAA4B;AAE5E,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,GAAG,eAAe,CAAC,EAAE,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAAsB,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
//#region src/runtime/utils/abortable-thread-load.d.ts
|
|
2
1
|
export type AbortableThreadLoadPurpose = "initial" | "reload";
|
|
3
2
|
type AbortableThreadLoadOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
purpose?: AbortableThreadLoadPurpose;
|
|
4
|
+
load: (signal: AbortSignal) => Promise<void>;
|
|
5
|
+
onSettled: () => void;
|
|
6
|
+
onInitialError: (error: unknown) => void;
|
|
8
7
|
};
|
|
9
8
|
export declare const createAbortableThreadLoad: () => {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
abort(purpose?: AbortableThreadLoadPurpose): void;
|
|
10
|
+
run({ purpose, load, onSettled, onInitialError, }: AbortableThreadLoadOptions): Promise<void>;
|
|
12
11
|
};
|
|
13
|
-
|
|
12
|
+
export {};
|
|
14
13
|
//# sourceMappingURL=abortable-thread-load.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abortable-thread-load.d.ts","
|
|
1
|
+
{"version":3,"file":"abortable-thread-load.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/abortable-thread-load.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D,KAAK,0BAA0B,GAAG;IAChC,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,yBAAyB;oBAQlB,0BAA0B;uDASvC,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BhD,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Attachment } from "../../types/attachment.js";
|
|
2
2
|
export type AttachmentAddOperation = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
cancelled: boolean;
|
|
4
|
+
attachmentIds: Set<string>;
|
|
5
5
|
};
|
|
6
6
|
export declare class AttachmentAddOperations {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
private readonly operations;
|
|
8
|
+
private readonly uploading;
|
|
9
|
+
start(): AttachmentAddOperation;
|
|
10
|
+
accept(operation: AttachmentAddOperation, attachment: Pick<Attachment, "id" | "status">): boolean;
|
|
11
|
+
finish(operation: AttachmentAddOperation): void;
|
|
12
|
+
isCancelled(operation: AttachmentAddOperation): boolean;
|
|
13
|
+
cancel(attachmentId: string): void;
|
|
14
|
+
cancelAll(): void;
|
|
15
|
+
whenSendable(attachmentId: string): Promise<void> | undefined;
|
|
16
|
+
private settle;
|
|
14
17
|
}
|
|
15
18
|
export declare const drainAttachmentAdd: <T>(result: Promise<T> | AsyncIterable<T>, accept: (attachment: T) => boolean) => Promise<void>;
|
|
16
|
-
//#endregion
|
|
17
19
|
//# sourceMappingURL=attachment-add-operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-add-operations.d.ts","
|
|
1
|
+
{"version":3,"file":"attachment-add-operations.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/attachment-add-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kCAA+B;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B,CAAC;AAEF,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAGtB;IAEJ,KAAK;IASL,MAAM,CACJ,SAAS,EAAE,sBAAsB,EACjC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,QAAQ,CAAC;IAoB/C,MAAM,CAAC,SAAS,EAAE,sBAAsB;IAMxC,WAAW,CAAC,SAAS,EAAE,sBAAsB;IAI7C,MAAM,CAAC,YAAY,EAAE,MAAM;IAS3B,SAAS;IAST,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS;IAQ7D,OAAO,CAAC,MAAM;CAOf;AAED,eAAO,MAAM,kBAAkB,GAAU,CAAC,EACxC,QAAQ,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EACrC,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,OAAO,kBASnC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/runtime/utils/attachment-add-operations.ts
|
|
2
2
|
var AttachmentAddOperations = class {
|
|
3
3
|
operations = /* @__PURE__ */ new Set();
|
|
4
|
+
uploading = /* @__PURE__ */ new Map();
|
|
4
5
|
start() {
|
|
5
6
|
const operation = {
|
|
6
7
|
cancelled: false,
|
|
@@ -9,13 +10,20 @@ var AttachmentAddOperations = class {
|
|
|
9
10
|
this.operations.add(operation);
|
|
10
11
|
return operation;
|
|
11
12
|
}
|
|
12
|
-
accept(operation,
|
|
13
|
+
accept(operation, attachment) {
|
|
13
14
|
if (operation.cancelled) return false;
|
|
14
|
-
operation.attachmentIds.add(
|
|
15
|
+
operation.attachmentIds.add(attachment.id);
|
|
16
|
+
const entry = this.uploading.get(attachment.id);
|
|
17
|
+
if (entry?.operation !== operation && (entry || attachment.status.type === "running")) this.uploading.set(attachment.id, {
|
|
18
|
+
operation,
|
|
19
|
+
waiters: entry?.waiters ?? /* @__PURE__ */ new Set()
|
|
20
|
+
});
|
|
21
|
+
if (attachment.status.type !== "running") this.settle(attachment.id, operation);
|
|
15
22
|
return true;
|
|
16
23
|
}
|
|
17
24
|
finish(operation) {
|
|
18
25
|
this.operations.delete(operation);
|
|
26
|
+
for (const attachmentId of operation.attachmentIds) this.settle(attachmentId, operation);
|
|
19
27
|
}
|
|
20
28
|
isCancelled(operation) {
|
|
21
29
|
return operation.cancelled;
|
|
@@ -26,10 +34,24 @@ var AttachmentAddOperations = class {
|
|
|
26
34
|
operation.cancelled = true;
|
|
27
35
|
this.operations.delete(operation);
|
|
28
36
|
}
|
|
37
|
+
this.settle(attachmentId);
|
|
29
38
|
}
|
|
30
39
|
cancelAll() {
|
|
31
40
|
for (const operation of this.operations) operation.cancelled = true;
|
|
32
41
|
this.operations.clear();
|
|
42
|
+
for (const attachmentId of [...this.uploading.keys()]) this.settle(attachmentId);
|
|
43
|
+
}
|
|
44
|
+
whenSendable(attachmentId) {
|
|
45
|
+
const entry = this.uploading.get(attachmentId);
|
|
46
|
+
if (!entry) return void 0;
|
|
47
|
+
return new Promise((resolve) => entry.waiters.add(resolve));
|
|
48
|
+
}
|
|
49
|
+
settle(attachmentId, operation) {
|
|
50
|
+
const entry = this.uploading.get(attachmentId);
|
|
51
|
+
if (!entry) return;
|
|
52
|
+
if (operation && entry.operation !== operation) return;
|
|
53
|
+
this.uploading.delete(attachmentId);
|
|
54
|
+
for (const resolve of entry.waiters) resolve();
|
|
33
55
|
}
|
|
34
56
|
};
|
|
35
57
|
const drainAttachmentAdd = async (result, accept) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-add-operations.js","names":["AttachmentAddOperation","cancelled","attachmentIds","Set","AttachmentAddOperations","operations","
|
|
1
|
+
{"version":3,"file":"attachment-add-operations.js","names":["Attachment","AttachmentAddOperation","cancelled","attachmentIds","Set","AttachmentAddOperations","operations","uploading","Map","operation","waiters","start","add","accept","attachment","Pick","id","entry","get","status","type","set","settle","finish","delete","attachmentId","isCancelled","cancel","has","cancelAll","clear","keys","whenSendable","Promise","undefined","resolve","drainAttachmentAdd","result","T","AsyncIterable","Symbol","asyncIterator"],"sources":["../../../src/runtime/utils/attachment-add-operations.ts"],"sourcesContent":["import type { Attachment } from \"../../types/attachment\";\n\nexport type AttachmentAddOperation = {\n cancelled: boolean;\n attachmentIds: Set<string>;\n};\n\nexport class AttachmentAddOperations {\n private readonly operations = new Set<AttachmentAddOperation>();\n private readonly uploading = new Map<\n string,\n { operation: AttachmentAddOperation; waiters: Set<() => void> }\n >();\n\n start() {\n const operation: AttachmentAddOperation = {\n cancelled: false,\n attachmentIds: new Set(),\n };\n this.operations.add(operation);\n return operation;\n }\n\n accept(\n operation: AttachmentAddOperation,\n attachment: Pick<Attachment, \"id\" | \"status\">,\n ) {\n if (operation.cancelled) return false;\n operation.attachmentIds.add(attachment.id);\n // The composer shows one attachment per id, so the add that updated it\n // last owns its upload; an add that ended earlier no longer speaks for it.\n const entry = this.uploading.get(attachment.id);\n if (\n entry?.operation !== operation &&\n (entry || attachment.status.type === \"running\")\n )\n this.uploading.set(attachment.id, {\n operation,\n waiters: entry?.waiters ?? new Set(),\n });\n if (attachment.status.type !== \"running\")\n this.settle(attachment.id, operation);\n return true;\n }\n\n finish(operation: AttachmentAddOperation) {\n this.operations.delete(operation);\n for (const attachmentId of operation.attachmentIds)\n this.settle(attachmentId, operation);\n }\n\n isCancelled(operation: AttachmentAddOperation) {\n return operation.cancelled;\n }\n\n cancel(attachmentId: string) {\n for (const operation of [...this.operations]) {\n if (!operation.attachmentIds.has(attachmentId)) continue;\n operation.cancelled = true;\n this.operations.delete(operation);\n }\n this.settle(attachmentId);\n }\n\n cancelAll() {\n for (const operation of this.operations) {\n operation.cancelled = true;\n }\n this.operations.clear();\n for (const attachmentId of [...this.uploading.keys()])\n this.settle(attachmentId);\n }\n\n whenSendable(attachmentId: string): Promise<void> | undefined {\n const entry = this.uploading.get(attachmentId);\n if (!entry) return undefined;\n return new Promise((resolve) => entry.waiters.add(resolve));\n }\n\n // An attachment id outlives the add that produced it, so an add that ends\n // after a newer one took the id over must not release its upload.\n private settle(attachmentId: string, operation?: AttachmentAddOperation) {\n const entry = this.uploading.get(attachmentId);\n if (!entry) return;\n if (operation && entry.operation !== operation) return;\n this.uploading.delete(attachmentId);\n for (const resolve of entry.waiters) resolve();\n }\n}\n\nexport const drainAttachmentAdd = async <T>(\n result: Promise<T> | AsyncIterable<T>,\n accept: (attachment: T) => boolean,\n) => {\n if (Symbol.asyncIterator in result) {\n for await (const attachment of result) {\n if (!accept(attachment)) break;\n }\n } else {\n accept(await result);\n }\n};\n"],"mappings":";AAOA,IAAaK,0BAAb,MAAqC;CACnC,6BAA8B,IAAID,IAA4B;CAC9D,4BAA6B,IAAII,IAG/B;CAEFG,QAAQ;EACN,MAAMF,YAAoC;GACxCP,WAAW;GACXC,+BAAe,IAAIC,IAAI;EACzB;EACA,KAAKE,WAAWM,IAAIH,SAAS;EAC7B,OAAOA;CACT;CAEAI,OACEJ,WACAK,YACA;EACA,IAAIL,UAAUP,WAAW,OAAO;EAChCO,UAAUN,cAAcS,IAAIE,WAAWE,EAAE;EAGzC,MAAMC,QAAQ,KAAKV,UAAUW,IAAIJ,WAAWE,EAAE;EAC9C,IACEC,OAAOR,cAAcA,cACpBQ,SAASH,WAAWK,OAAOC,SAAS,YAErC,KAAKb,UAAUc,IAAIP,WAAWE,IAAI;GAChCP;GACAC,SAASO,OAAOP,2BAAW,IAAIN,IAAI;EACrC,CAAC;EACH,IAAIU,WAAWK,OAAOC,SAAS,WAC7B,KAAKE,OAAOR,WAAWE,IAAIP,SAAS;EACtC,OAAO;CACT;CAEAc,OAAOd,WAAmC;EACxC,KAAKH,WAAWkB,OAAOf,SAAS;EAChC,KAAK,MAAMgB,gBAAgBhB,UAAUN,eACnC,KAAKmB,OAAOG,cAAchB,SAAS;CACvC;CAEAiB,YAAYjB,WAAmC;EAC7C,OAAOA,UAAUP;CACnB;CAEAyB,OAAOF,cAAsB;EAC3B,KAAK,MAAMhB,aAAa,CAAC,GAAG,KAAKH,UAAU,GAAG;GAC5C,IAAI,CAACG,UAAUN,cAAcyB,IAAIH,YAAY,GAAG;GAChDhB,UAAUP,YAAY;GACtB,KAAKI,WAAWkB,OAAOf,SAAS;EAClC;EACA,KAAKa,OAAOG,YAAY;CAC1B;CAEAI,YAAY;EACV,KAAK,MAAMpB,aAAa,KAAKH,YAC3BG,UAAUP,YAAY;EAExB,KAAKI,WAAWwB,MAAM;EACtB,KAAK,MAAML,gBAAgB,CAAC,GAAG,KAAKlB,UAAUwB,KAAK,CAAC,GAClD,KAAKT,OAAOG,YAAY;CAC5B;CAEAO,aAAaP,cAAiD;EAC5D,MAAMR,QAAQ,KAAKV,UAAUW,IAAIO,YAAY;EAC7C,IAAI,CAACR,OAAO,OAAOiB,KAAAA;EACnB,OAAO,IAAID,SAASE,YAAYlB,MAAMP,QAAQE,IAAIuB,OAAO,CAAC;CAC5D;CAIA,OAAeV,cAAsBhB,WAAoC;EACvE,MAAMQ,QAAQ,KAAKV,UAAUW,IAAIO,YAAY;EAC7C,IAAI,CAACR,OAAO;EACZ,IAAIR,aAAaQ,MAAMR,cAAcA,WAAW;EAChD,KAAKF,UAAUiB,OAAOC,YAAY;EAClC,KAAK,MAAMU,WAAWlB,MAAMP,SAASyB,QAAQ;CAC/C;AACF;AAEA,MAAaC,qBAAqB,OAChCC,QACAxB,WACG;CACH,IAAI2B,OAAOC,iBAAiBJ,QACf;aAAA,MAAMvB,cAAcuB,QAC7B,IAAI,CAACxB,OAAOC,UAAU,GAAG;CAAA,OAG3BD,OAAO,MAAMwB,MAAM;AAEvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AttachmentAdapter } from "../../adapters/attachment.js";
|
|
2
|
+
import { type Attachment, type CompleteAttachment } from "../../types/attachment.js";
|
|
3
|
+
export declare class AttachmentSendOperations {
|
|
4
|
+
private readonly entries;
|
|
5
|
+
private readonly removed;
|
|
6
|
+
markRemoved(attachment: Attachment): void;
|
|
7
|
+
unmarkRemoved(attachment: Attachment): void;
|
|
8
|
+
isRemoved(attachment: Attachment): boolean;
|
|
9
|
+
send(attachment: Attachment, adapter: AttachmentAdapter | undefined, signal?: AbortSignal): Promise<CompleteAttachment>;
|
|
10
|
+
transfer(original: Attachment, replacement: Attachment): Attachment;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=attachment-send-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-send-operations.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/attachment-send-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,qCAAkC;AACnE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,kCAA+B;AAEhC,qBAAa,wBAAwB;IAEnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAGpB;IAIJ,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,WAAW,CAAC,UAAU,EAAE,UAAU;IAIlC,aAAa,CAAC,UAAU,EAAE,UAAU;IAIpC,SAAS,CAAC,UAAU,EAAE,UAAU;IAI1B,IAAI,CACR,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,kBAAkB,CAAC;IAc9B,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU;CAKvD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isAttachmentComplete } from "../../types/attachment.js";
|
|
2
|
+
//#region src/runtime/utils/attachment-send-operations.ts
|
|
3
|
+
var AttachmentSendOperations = class {
|
|
4
|
+
entries = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
removed = /* @__PURE__ */ new WeakSet();
|
|
6
|
+
markRemoved(attachment) {
|
|
7
|
+
this.removed.add(attachment);
|
|
8
|
+
}
|
|
9
|
+
unmarkRemoved(attachment) {
|
|
10
|
+
this.removed.delete(attachment);
|
|
11
|
+
}
|
|
12
|
+
isRemoved(attachment) {
|
|
13
|
+
return this.removed.has(attachment);
|
|
14
|
+
}
|
|
15
|
+
async send(attachment, adapter, signal) {
|
|
16
|
+
if (isAttachmentComplete(attachment)) return attachment;
|
|
17
|
+
const entry = this.entries.get(attachment) ?? {};
|
|
18
|
+
if (entry.result) return entry.result;
|
|
19
|
+
if (!adapter) throw new Error("Attachments are not supported");
|
|
20
|
+
this.entries.set(attachment, entry);
|
|
21
|
+
const result = await adapter.send(attachment, signal ? { signal } : void 0);
|
|
22
|
+
entry.result = result;
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
transfer(original, replacement) {
|
|
26
|
+
const entry = this.entries.get(original);
|
|
27
|
+
if (entry) this.entries.set(replacement, entry);
|
|
28
|
+
return replacement;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { AttachmentSendOperations };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=attachment-send-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-send-operations.js","names":["AttachmentAdapter","isAttachmentComplete","Attachment","CompleteAttachment","AttachmentSendOperations","entries","WeakMap","result","removed","WeakSet","markRemoved","attachment","add","unmarkRemoved","delete","isRemoved","has","send","adapter","signal","AbortSignal","Promise","entry","get","Error","set","undefined","transfer","original","replacement"],"sources":["../../../src/runtime/utils/attachment-send-operations.ts"],"sourcesContent":["import type { AttachmentAdapter } from \"../../adapters/attachment\";\nimport {\n isAttachmentComplete,\n type Attachment,\n type CompleteAttachment,\n} from \"../../types/attachment\";\n\nexport class AttachmentSendOperations {\n // Draft attachments stay pending so discarding an unsent upload still calls remove.\n private readonly entries = new WeakMap<\n Attachment,\n { result?: CompleteAttachment }\n >();\n // Removal marks are per-object and never bulk-cleared: a removed attachment\n // either leaves the draft or is replaced via transfer with a fresh unmarked\n // object, so a mark cannot leak into a later send's batch.\n private readonly removed = new WeakSet<Attachment>();\n\n markRemoved(attachment: Attachment) {\n this.removed.add(attachment);\n }\n\n unmarkRemoved(attachment: Attachment) {\n this.removed.delete(attachment);\n }\n\n isRemoved(attachment: Attachment) {\n return this.removed.has(attachment);\n }\n\n async send(\n attachment: Attachment,\n adapter: AttachmentAdapter | undefined,\n signal?: AbortSignal,\n ): Promise<CompleteAttachment> {\n if (isAttachmentComplete(attachment)) return attachment;\n const entry = this.entries.get(attachment) ?? {};\n if (entry.result) return entry.result;\n if (!adapter) throw new Error(\"Attachments are not supported\");\n this.entries.set(attachment, entry);\n const result = await adapter.send(\n attachment,\n signal ? { signal } : undefined,\n );\n entry.result = result;\n return result;\n }\n\n transfer(original: Attachment, replacement: Attachment) {\n const entry = this.entries.get(original);\n if (entry) this.entries.set(replacement, entry);\n return replacement;\n }\n}\n"],"mappings":";;AAOA,IAAaI,2BAAb,MAAsC;CAEpC,0BAA2B,IAAIE,QAG7B;CAIF,0BAA2B,IAAIG,QAAoB;CAEnDC,YAAYC,YAAwB;EAClC,KAAKH,QAAQI,IAAID,UAAU;CAC7B;CAEAE,cAAcF,YAAwB;EACpC,KAAKH,QAAQM,OAAOH,UAAU;CAChC;CAEAI,UAAUJ,YAAwB;EAChC,OAAO,KAAKH,QAAQQ,IAAIL,UAAU;CACpC;CAEA,MAAMM,KACJN,YACAO,SACAC,QAC6B;EAC7B,IAAIlB,qBAAqBU,UAAU,GAAG,OAAOA;EAC7C,MAAMW,QAAQ,KAAKjB,QAAQkB,IAAIZ,UAAU,KAAK,CAAC;EAC/C,IAAIW,MAAMf,QAAQ,OAAOe,MAAMf;EAC/B,IAAI,CAACW,SAAS,MAAM,IAAIM,MAAM,+BAA+B;EAC7D,KAAKnB,QAAQoB,IAAId,YAAYW,KAAK;EAClC,MAAMf,SAAS,MAAMW,QAAQD,KAC3BN,YACAQ,SAAS,EAAEA,OAAO,IAAIO,KAAAA,CACxB;EACAJ,MAAMf,SAASA;EACf,OAAOA;CACT;CAEAoB,SAASC,UAAsBC,aAAyB;EACtD,MAAMP,QAAQ,KAAKjB,QAAQkB,IAAIK,QAAQ;EACvC,IAAIN,OAAO,KAAKjB,QAAQoB,IAAII,aAAaP,KAAK;EAC9C,OAAOO;CACT;AACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MessageStatus } from "../../types/message.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region src/runtime/utils/auto-status.d.ts
|
|
1
|
+
import type { MessageStatus } from "../../types/message.js";
|
|
2
|
+
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
3
|
+
import type { ThreadMessageLike } from "./thread-message-like.js";
|
|
5
4
|
type ThreadMessageLikeContentItem = Exclude<ThreadMessageLike["content"], string>[number];
|
|
6
5
|
export declare const isPendingToolCall: (c: ThreadMessageLikeContentItem) => boolean;
|
|
7
6
|
/** A pending tool call whose nested conversation is still streaming; the outer message stays running until the nested run settles. */
|
|
@@ -12,5 +11,5 @@ export declare const getAutoStatus: (isLast: boolean, isRunning: boolean, hasInt
|
|
|
12
11
|
/** Status for a message entering the repository: the nested conversation is not being fed here, so it never keeps the message running. */
|
|
13
12
|
export declare const getRepositoryContentAutoStatus: (content: ThreadMessageLike["content"]) => MessageStatus;
|
|
14
13
|
export declare const getContentAutoStatus: (content: ThreadMessageLike["content"], isLast: boolean, isRunning: boolean) => MessageStatus;
|
|
15
|
-
|
|
14
|
+
export {};
|
|
16
15
|
//# sourceMappingURL=auto-status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-status.d.ts","
|
|
1
|
+
{"version":3,"file":"auto-status.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/auto-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA4B;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA8B;AAG/D,KAAK,4BAA4B,GAAG,OAAO,CACzC,iBAAiB,CAAC,SAAS,CAAC,EAC5B,MAAM,CACP,CAAC,MAAM,CAAC,CAAC;AAEV,eAAO,MAAM,iBAAiB,GAAI,GAAG,4BAA4B,KAAG,OAClB,CAAC;AAEnD,sIAAsI;AACtI,eAAO,MAAM,oBAAoB,GAC/B,GAAG,4BAA4B,KAC9B,OAIF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,GAAG,4BAA4B,KAC9B,OAA4D,CAAC;AA8ChE,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,YACN,CAAC;AAE7C,eAAO,MAAM,aAAa,GACxB,QAAQ,OAAO,EACf,WAAW,OAAO,EAClB,yBAAyB,OAAO,EAChC,qBAAqB,OAAO,EAC5B,QAAQ,iBAAiB,EACzB,cAAc,OAAO,EACrB,yBAAyB,OAAO,KAC/B,aAuBF,CAAC;AAEF,0IAA0I;AAC1I,eAAO,MAAM,8BAA8B,GACzC,SAAS,iBAAiB,CAAC,SAAS,CAAC,KACpC,aAMA,CAAC;AAEJ,eAAO,MAAM,oBAAoB,GAC/B,SAAS,iBAAiB,CAAC,SAAS,CAAC,EACrC,QAAQ,OAAO,EACf,WAAW,OAAO,KACjB,aASA,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasPendingToolAction } from "../../utils/normalizePartStatus.js";
|
|
1
2
|
//#region src/runtime/utils/auto-status.ts
|
|
2
3
|
const isPendingToolCall = (c) => c.type === "tool-call" && c.result === void 0;
|
|
3
4
|
/** A pending tool call whose nested conversation is still streaming; the outer message stays running until the nested run settles. */
|
|
@@ -6,10 +7,7 @@ const isBackgroundToolCall = (c) => {
|
|
|
6
7
|
const last = c.messages?.at(-1);
|
|
7
8
|
return last?.role === "assistant" && last.status.type === "running";
|
|
8
9
|
};
|
|
9
|
-
const isInterruptedToolCall = (c) =>
|
|
10
|
-
if (c.type !== "tool-call" || c.result !== void 0) return false;
|
|
11
|
-
return c.interrupt != null || c.approval != null && c.approval.approved === void 0 && c.approval.resolution === void 0;
|
|
12
|
-
};
|
|
10
|
+
const isInterruptedToolCall = (c) => c.type === "tool-call" && hasPendingToolAction(c);
|
|
13
11
|
const symbolAutoStatus = Symbol("autoStatus");
|
|
14
12
|
const AUTO_STATUS_RUNNING = Object.freeze(Object.assign({ type: "running" }, { [symbolAutoStatus]: true }));
|
|
15
13
|
const AUTO_STATUS_COMPLETE = Object.freeze(Object.assign({
|
|
@@ -30,7 +28,7 @@ const AUTO_STATUS_INTERRUPT = Object.freeze(Object.assign({
|
|
|
30
28
|
}, { [symbolAutoStatus]: true }));
|
|
31
29
|
const isAutoStatus = (status) => status[symbolAutoStatus] === true;
|
|
32
30
|
const getAutoStatus = (isLast, isRunning, hasInterruptedToolCalls, hasPendingToolCalls, error, isCancelled, hasBackgroundToolCalls) => {
|
|
33
|
-
if (isLast && error) return Object.assign({
|
|
31
|
+
if (isLast && error !== void 0 && error !== null) return Object.assign({
|
|
34
32
|
type: "incomplete",
|
|
35
33
|
reason: "error",
|
|
36
34
|
error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-status.js","names":["MessageStatus","ReadonlyJSONValue","ThreadMessageLike","ThreadMessageLikeContentItem","Exclude","isPendingToolCall","c","type","result","undefined","isBackgroundToolCall","last","messages","at","role","status","isInterruptedToolCall","
|
|
1
|
+
{"version":3,"file":"auto-status.js","names":["MessageStatus","ReadonlyJSONValue","ThreadMessageLike","hasPendingToolAction","ThreadMessageLikeContentItem","Exclude","isPendingToolCall","c","type","result","undefined","isBackgroundToolCall","last","messages","at","role","status","isInterruptedToolCall","symbolAutoStatus","Symbol","AUTO_STATUS_RUNNING","Object","freeze","assign","const","AUTO_STATUS_COMPLETE","reason","AUTO_STATUS_CANCELLED","AUTO_STATUS_PENDING","AUTO_STATUS_INTERRUPT","isAutoStatus","getAutoStatus","isLast","isRunning","hasInterruptedToolCalls","hasPendingToolCalls","error","isCancelled","hasBackgroundToolCalls","getRepositoryContentAutoStatus","content","some","getContentAutoStatus"],"sources":["../../../src/runtime/utils/auto-status.ts"],"sourcesContent":["import type { MessageStatus } from \"../../types/message\";\nimport type { ReadonlyJSONValue } from \"assistant-stream/utils\";\nimport type { ThreadMessageLike } from \"./thread-message-like\";\nimport { hasPendingToolAction } from \"../../utils/normalizePartStatus\";\n\ntype ThreadMessageLikeContentItem = Exclude<\n ThreadMessageLike[\"content\"],\n string\n>[number];\n\nexport const isPendingToolCall = (c: ThreadMessageLikeContentItem): boolean =>\n c.type === \"tool-call\" && c.result === undefined;\n\n/** A pending tool call whose nested conversation is still streaming; the outer message stays running until the nested run settles. */\nexport const isBackgroundToolCall = (\n c: ThreadMessageLikeContentItem,\n): boolean => {\n if (c.type !== \"tool-call\" || c.result !== undefined) return false;\n const last = c.messages?.at(-1);\n return last?.role === \"assistant\" && last.status.type === \"running\";\n};\n\nexport const isInterruptedToolCall = (\n c: ThreadMessageLikeContentItem,\n): boolean => c.type === \"tool-call\" && hasPendingToolAction(c);\n\nconst symbolAutoStatus = Symbol(\"autoStatus\");\n\nconst AUTO_STATUS_RUNNING = Object.freeze(\n Object.assign({ type: \"running\" as const }, { [symbolAutoStatus]: true }),\n);\nconst AUTO_STATUS_COMPLETE = Object.freeze(\n Object.assign(\n {\n type: \"complete\" as const,\n reason: \"unknown\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\nconst AUTO_STATUS_CANCELLED = Object.freeze(\n Object.assign(\n {\n type: \"incomplete\" as const,\n reason: \"cancelled\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\n\nconst AUTO_STATUS_PENDING = Object.freeze(\n Object.assign(\n {\n type: \"requires-action\" as const,\n reason: \"tool-calls\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\n\nconst AUTO_STATUS_INTERRUPT = Object.freeze(\n Object.assign(\n {\n type: \"requires-action\" as const,\n reason: \"interrupt\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\n\nexport const isAutoStatus = (status: MessageStatus) =>\n (status as any)[symbolAutoStatus] === true;\n\nexport const getAutoStatus = (\n isLast: boolean,\n isRunning: boolean,\n hasInterruptedToolCalls: boolean,\n hasPendingToolCalls: boolean,\n error?: ReadonlyJSONValue,\n isCancelled?: boolean,\n hasBackgroundToolCalls?: boolean,\n): MessageStatus => {\n if (isLast && error !== undefined && error !== null) {\n return Object.assign(\n {\n type: \"incomplete\" as const,\n reason: \"error\" as const,\n error: error,\n },\n { [symbolAutoStatus]: true },\n );\n }\n\n return isLast && isRunning\n ? AUTO_STATUS_RUNNING\n : hasInterruptedToolCalls\n ? AUTO_STATUS_INTERRUPT\n : hasBackgroundToolCalls && !isCancelled\n ? AUTO_STATUS_RUNNING\n : hasPendingToolCalls\n ? AUTO_STATUS_PENDING\n : isCancelled\n ? AUTO_STATUS_CANCELLED\n : AUTO_STATUS_COMPLETE;\n};\n\n/** Status for a message entering the repository: the nested conversation is not being fed here, so it never keeps the message running. */\nexport const getRepositoryContentAutoStatus = (\n content: ThreadMessageLike[\"content\"],\n): MessageStatus =>\n getAutoStatus(\n false,\n false,\n typeof content !== \"string\" && content.some(isInterruptedToolCall),\n typeof content !== \"string\" && content.some(isPendingToolCall),\n );\n\nexport const getContentAutoStatus = (\n content: ThreadMessageLike[\"content\"],\n isLast: boolean,\n isRunning: boolean,\n): MessageStatus =>\n getAutoStatus(\n isLast,\n isRunning,\n typeof content !== \"string\" && content.some(isInterruptedToolCall),\n typeof content !== \"string\" && content.some(isPendingToolCall),\n undefined,\n undefined,\n typeof content !== \"string\" && content.some(isBackgroundToolCall),\n );\n"],"mappings":";;AAUA,MAAaM,qBAAqBC,MAChCA,EAAEC,SAAS,eAAeD,EAAEE,WAAWC,KAAAA;;AAGzC,MAAaC,wBACXJ,MACY;CACZ,IAAIA,EAAEC,SAAS,eAAeD,EAAEE,WAAWC,KAAAA,GAAW,OAAO;CAC7D,MAAME,OAAOL,EAAEM,UAAUC,GAAG,EAAE;CAC9B,OAAOF,MAAMG,SAAS,eAAeH,KAAKI,OAAOR,SAAS;AAC5D;AAEA,MAAaS,yBACXV,MACYA,EAAEC,SAAS,eAAeL,qBAAqBI,CAAC;AAE9D,MAAMW,mBAAmBC,OAAO,YAAY;AAE5C,MAAMC,sBAAsBC,OAAOC,OACjCD,OAAOE,OAAO,EAAEf,MAAM,UAAmB,GAAG,GAAGU,mBAAmB,KAAK,CAAC,CAC1E;AACA,MAAMO,uBAAuBJ,OAAOC,OAClCD,OAAOE,OACL;CACEf,MAAM;CACNkB,QAAQ;AACV,GACA,GAAGR,mBAAmB,KAAK,CAC7B,CACF;AACA,MAAMS,wBAAwBN,OAAOC,OACnCD,OAAOE,OACL;CACEf,MAAM;CACNkB,QAAQ;AACV,GACA,GAAGR,mBAAmB,KAAK,CAC7B,CACF;AAEA,MAAMU,sBAAsBP,OAAOC,OACjCD,OAAOE,OACL;CACEf,MAAM;CACNkB,QAAQ;AACV,GACA,GAAGR,mBAAmB,KAAK,CAC7B,CACF;AAEA,MAAMW,wBAAwBR,OAAOC,OACnCD,OAAOE,OACL;CACEf,MAAM;CACNkB,QAAQ;AACV,GACA,GAAGR,mBAAmB,KAAK,CAC7B,CACF;AAEA,MAAaY,gBAAgBd,WAC1BA,OAAeE,sBAAsB;AAExC,MAAaa,iBACXC,QACAC,WACAC,yBACAC,qBACAC,OACAC,aACAC,2BACkB;CAClB,IAAIN,UAAUI,UAAU1B,KAAAA,KAAa0B,UAAU,MAC7C,OAAOf,OAAOE,OACZ;EACEf,MAAM;EACNkB,QAAQ;EACDU;CACT,GACA,GAAGlB,mBAAmB,KAAK,CAC7B;CAGF,OAAOc,UAAUC,YACbb,sBACAc,0BACEL,wBACAS,0BAA0B,CAACD,cACzBjB,sBACAe,sBACEP,sBACAS,cACEV,wBACAF;AACd;;AAGA,MAAac,kCACXC,YAEAT,cACE,OACA,OACA,OAAOS,YAAY,YAAYA,QAAQC,KAAKxB,qBAAqB,GACjE,OAAOuB,YAAY,YAAYA,QAAQC,KAAKnC,iBAAiB,CAC/D;AAEF,MAAaoC,wBACXF,SACAR,QACAC,cAEAF,cACEC,QACAC,WACA,OAAOO,YAAY,YAAYA,QAAQC,KAAKxB,qBAAqB,GACjE,OAAOuB,YAAY,YAAYA,QAAQC,KAAKnC,iBAAiB,GAC7DI,KAAAA,GACAA,KAAAA,GACA,OAAO8B,YAAY,YAAYA,QAAQC,KAAK9B,oBAAoB,CAClE"}
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
import { FileMessagePart, MessageStatus,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import type { FileMessagePart, MessageStatus, ReasoningMessagePart, SourceMessagePart, ThreadAssistantMessagePart, ThreadMessage, ThreadStep, ToolCallMessagePart } from "../../types/message.js";
|
|
2
|
+
import type { MessageTiming, RunConfig, TextMessagePart } from "../../types/message.js";
|
|
3
|
+
import type { ModelContext } from "../../model-context/types.js";
|
|
4
|
+
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
5
5
|
export type ChatModelRunUpdate = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
readonly content: readonly ThreadAssistantMessagePart[];
|
|
7
|
+
readonly metadata?: Record<string, unknown>;
|
|
8
8
|
};
|
|
9
9
|
export type ChatModelRunResult = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
readonly content?: readonly ThreadAssistantMessagePart[] | undefined;
|
|
11
|
+
readonly status?: MessageStatus | undefined;
|
|
12
|
+
readonly metadata?: {
|
|
13
|
+
readonly unstable_state?: ReadonlyJSONValue;
|
|
14
|
+
readonly unstable_annotations?: readonly ReadonlyJSONValue[] | undefined;
|
|
15
|
+
readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined;
|
|
16
|
+
readonly steps?: readonly ThreadStep[] | undefined;
|
|
17
|
+
readonly timing?: MessageTiming | undefined;
|
|
18
|
+
readonly custom?: Record<string, unknown> | undefined;
|
|
19
|
+
};
|
|
20
20
|
};
|
|
21
21
|
export type CoreChatModelRunResult = Omit<ChatModelRunResult, "content"> & {
|
|
22
|
-
|
|
22
|
+
readonly content: readonly (TextMessagePart | ReasoningMessagePart | ToolCallMessagePart | SourceMessagePart | FileMessagePart)[];
|
|
23
23
|
};
|
|
24
24
|
export type ChatModelRunOptions = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
readonly messages: readonly ThreadMessage[];
|
|
26
|
+
readonly runConfig: RunConfig;
|
|
27
|
+
readonly abortSignal: AbortSignal;
|
|
28
|
+
readonly context: ModelContext;
|
|
29
|
+
readonly unstable_assistantMessageId?: string | undefined;
|
|
30
|
+
readonly unstable_threadId?: string | undefined;
|
|
31
|
+
readonly unstable_parentId?: string | null | undefined;
|
|
32
|
+
unstable_getMessage(): ThreadMessage;
|
|
33
33
|
};
|
|
34
34
|
export type ChatModelAdapter = {
|
|
35
|
-
|
|
35
|
+
run(options: ChatModelRunOptions): Promise<ChatModelRunResult> | AsyncGenerator<ChatModelRunResult, void>;
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
//# sourceMappingURL=chat-model-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-model-adapter.d.ts","
|
|
1
|
+
{"version":3,"file":"chat-model-adapter.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/chat-model-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC1B,aAAa,EACb,UAAU,EACV,mBAAmB,EACpB,+BAA4B;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,eAAe,EAChB,+BAA4B;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,qCAAkC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,0BAA0B,EAAE,GAAG,SAAS,CAAC;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,cAAc,CAAC,EAAE,iBAAiB,CAAC;QAC5C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;QACzE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;QAClE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;QACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;KACvD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;IACzE,QAAQ,CAAC,OAAO,EAAE,SAAS,CACvB,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,CAClB,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAE/B,QAAQ,CAAC,2BAA2B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD,mBAAmB,IAAI,aAAa,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CACD,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,GAAG,cAAc,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;CAC3E,CAAC"}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ToolExecutionStatus } from "../../runtimes/tool-invocations/ToolInvocationTracker.js";
|
|
1
|
+
import type { ReadonlyJSONValue } from "assistant-stream/utils";
|
|
2
|
+
import type { ToolExecutionStatus } from "../../runtimes/tool-invocations/ToolInvocationTracker.js";
|
|
4
3
|
import { ThreadMessageConverter } from "../../runtimes/external-store/thread-message-converter.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import type { ThreadMessage } from "../../types/message.js";
|
|
5
|
+
import type { MessageTiming } from "../../types/message.js";
|
|
6
|
+
import { type ThreadMessageLike } from "./thread-message-like.js";
|
|
7
7
|
export type JoinStrategy = "concat-content" | "none";
|
|
8
8
|
export type ExternalMessageConverterMessage = (ThreadMessageLike & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
readonly convertConfig?: {
|
|
10
|
+
readonly joinStrategy?: JoinStrategy;
|
|
11
|
+
};
|
|
12
12
|
}) | {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
role: "tool";
|
|
14
|
+
toolCallId: string;
|
|
15
|
+
toolName?: string | undefined;
|
|
16
|
+
result: any;
|
|
17
|
+
artifact?: any;
|
|
18
|
+
isError?: boolean;
|
|
19
|
+
messages?: readonly ThreadMessage[];
|
|
20
20
|
};
|
|
21
21
|
export type ExternalMessageConverterMetadata = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
readonly toolStatuses?: Record<string, ToolExecutionStatus>;
|
|
23
|
+
readonly error?: ReadonlyJSONValue;
|
|
24
|
+
readonly cancelledMessageIds?: ReadonlySet<string>;
|
|
25
|
+
readonly messageTiming?: Record<string, MessageTiming>;
|
|
26
26
|
};
|
|
27
27
|
export type ExternalMessageConverterCallback<T> = (message: T, metadata: ExternalMessageConverterMetadata) => ExternalMessageConverterMessage | ExternalMessageConverterMessage[];
|
|
28
28
|
export type ExternalMessageConverterCallbackResult<T> = {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
input: T;
|
|
30
|
+
outputs: ExternalMessageConverterMessage[];
|
|
31
31
|
};
|
|
32
32
|
export type ExternalMessageConverterChunk<T> = {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
inputs: T[];
|
|
34
|
+
outputs: ExternalMessageConverterMessage[];
|
|
35
35
|
};
|
|
36
36
|
export declare const convertExternalMessageCallback: <T>(input: T, callback: ExternalMessageConverterCallback<T>, metadata: ExternalMessageConverterMetadata) => ExternalMessageConverterCallbackResult<T>;
|
|
37
37
|
export declare const joinExternalMessages: (messages: readonly ExternalMessageConverterMessage[]) => ThreadMessageLike;
|
|
38
38
|
export declare const chunkExternalMessages: <T>(callbackResults: ExternalMessageConverterCallbackResult<T>[], joinStrategy?: JoinStrategy) => ExternalMessageConverterChunk<T>[];
|
|
39
39
|
export declare const shallowArrayEqual: (a: readonly unknown[], b: readonly unknown[]) => boolean;
|
|
40
40
|
type ExternalMessageChunkConversionCache = {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
message: ThreadMessage | undefined;
|
|
42
|
+
generatedFallbackMessages: WeakSet<object>;
|
|
43
43
|
};
|
|
44
44
|
type ExternalMessageConversionCallbackCacheEntry<T> = ExternalMessageConverterCallbackResult<T> & {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
metadata: ExternalMessageConverterMetadata;
|
|
46
|
+
callback: ExternalMessageConverterCallback<T>;
|
|
47
47
|
};
|
|
48
48
|
export type InternalExternalMessageConversionCache<T extends WeakKey = WeakKey> = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
callbackCache: WeakMap<T, ExternalMessageConversionCallbackCacheEntry<T>>;
|
|
50
|
+
chunkCache: WeakMap<ExternalMessageConverterMessage, ExternalMessageConverterChunk<T>>;
|
|
51
|
+
converterCache: ThreadMessageConverter;
|
|
52
|
+
generatedFallbackMessages: WeakSet<object>;
|
|
53
53
|
};
|
|
54
54
|
export declare const createExternalMessageConversionCache: <T extends WeakKey = WeakKey>() => InternalExternalMessageConversionCache<T>;
|
|
55
55
|
export declare const convertExternalMessageChunk: <T>(message: ExternalMessageConverterChunk<T>, idx: number, chunkCount: number, isRunning: boolean, error: ReadonlyJSONValue | undefined, cache?: ExternalMessageChunkConversionCache, cancelledMessageIds?: ReadonlySet<string>) => ThreadMessage;
|
|
56
56
|
export declare const completeExternalMessageConversion: (messages: ThreadMessage[], error: ReadonlyJSONValue | undefined) => ThreadMessage[];
|
|
57
57
|
export declare const convertExternalMessages: <T extends WeakKey>(messages: T[], callback: ExternalMessageConverterCallback<T>, isRunning: boolean, metadata: ExternalMessageConverterMetadata, joinStrategy?: JoinStrategy, cache?: InternalExternalMessageConversionCache<T>) => ThreadMessage[];
|
|
58
|
-
|
|
58
|
+
export {};
|
|
59
59
|
//# sourceMappingURL=external-message-conversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-message-conversion.d.ts","
|
|
1
|
+
{"version":3,"file":"external-message-conversion.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/external-message-conversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iEAA8D;AACjG,OAAO,EAAE,sBAAsB,EAAE,kEAA+D;AAChG,OAAO,KAAK,EAEV,aAAa,EAEd,+BAA4B;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA4B;AAgBzD,OAAO,EAEL,KAAK,iBAAiB,EACvB,iCAA8B;AAE/B,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAErD,MAAM,MAAM,+BAA+B,GACvC,CAAC,iBAAiB,GAAG;IACnB,QAAQ,CAAC,aAAa,CAAC,EAAE;QACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;KACtC,CAAC;CACH,CAAC,GACF;IACE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACrC,CAAC;AAEN,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,CAAC,IAAI,CAChD,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,gCAAgC,KACvC,+BAA+B,GAAG,+BAA+B,EAAE,CAAC;AAEzE,MAAM,MAAM,sCAAsC,CAAC,CAAC,IAAI;IACtD,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,+BAA+B,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,CAAC,CAAC,IAAI;IAC7C,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,OAAO,EAAE,+BAA+B,EAAE,CAAC;CAC5C,CAAC;AAqDF,eAAO,MAAM,8BAA8B,GAAI,CAAC,EAC9C,OAAO,CAAC,EACR,UAAU,gCAAgC,CAAC,CAAC,CAAC,EAC7C,UAAU,gCAAgC,KACzC,sCAAsC,CAAC,CAAC,CAGzC,CAAC;AAYH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,SAAS,+BAA+B,EAAE,KACnD,iBAqLF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,CAAC,EACrC,iBAAiB,sCAAsC,CAAC,CAAC,CAAC,EAAE,EAC5D,eAAe,YAAY,uCAqD5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,GAAG,SAAS,OAAO,EAAE,EACrB,GAAG,SAAS,OAAO,EAAE,YAOtB,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,yBAAyB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5C,CAAC;AAEF,KAAK,2CAA2C,CAAC,CAAC,IAChD,sCAAsC,CAAC,CAAC,CAAC,GAAG;IAC1C,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,QAAQ,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,sCAAsC,CAChD,CAAC,SAAS,OAAO,GAAG,OAAO,IACzB;IACF,aAAa,EAAE,OAAO,CAAC,CAAC,EAAE,2CAA2C,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,UAAU,EAAE,OAAO,CACjB,+BAA+B,EAC/B,6BAA6B,CAAC,CAAC,CAAC,CACjC,CAAC;IACF,cAAc,EAAE,sBAAsB,CAAC;IAEvC,yBAAyB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAC/C,CAAC,SAAS,OAAO,GAAG,OAAO,OACxB,sCAAsC,CAAC,CAAC,CAK3C,CAAC;AAEH,eAAO,MAAM,2BAA2B,GAAI,CAAC,EAC3C,SAAS,6BAA6B,CAAC,CAAC,CAAC,EACzC,KAAK,MAAM,EACX,YAAY,MAAM,EAClB,WAAW,OAAO,EAClB,OAAO,iBAAiB,GAAG,SAAS,EACpC,QAAQ,mCAAmC,EAC3C,sBAAsB,WAAW,CAAC,MAAM,CAAC,kBAuE1C,CAAC;AAuBF,eAAO,MAAM,iCAAiC,GAC5C,UAAU,aAAa,EAAE,EACzB,OAAO,iBAAiB,GAAG,SAAS,oBASrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,OAAO,EACvD,UAAU,CAAC,EAAE,EACb,UAAU,gCAAgC,CAAC,CAAC,CAAC,EAC7C,WAAW,OAAO,EAClB,UAAU,gCAAgC,EAC1C,eAAe,YAAY,EAC3B,QAAQ,sCAAsC,CAAC,CAAC,CAAC,oBA0DlD,CAAC"}
|