@assistant-ui/core 0.3.19 → 0.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/attachment.d.ts +50 -43
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +52 -21
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +2 -5
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +7 -8
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/index.d.ts +14 -9
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/speech.d.ts +63 -65
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +16 -2
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +19 -22
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +60 -58
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +8 -11
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +50 -45
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/adapters/voice.js +17 -3
- package/dist/adapters/voice.js.map +1 -1
- package/dist/index.d.ts +70 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/duplicate-detection.d.ts +1 -4
- package/dist/internal/duplicate-detection.d.ts.map +1 -1
- package/dist/internal.d.ts +27 -58
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +8 -6
- package/dist/model-context/frame/host.d.ts +20 -23
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +3 -1
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +28 -30
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +6 -0
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/frame/types.d.ts +24 -27
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/frame/validate.d.ts +3 -0
- package/dist/model-context/frame/validate.d.ts.map +1 -0
- package/dist/model-context/frame/validate.js +26 -0
- package/dist/model-context/frame/validate.js.map +1 -0
- package/dist/model-context/interactable-composer-metadata.d.ts +51 -39
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +30 -6
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +9 -12
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +15 -18
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +15 -17
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +12 -14
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +40 -43
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +9 -12
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +23 -26
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +4 -8
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +28 -23
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +77 -58
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +4 -7
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +6 -9
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +2 -5
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +9 -12
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +3 -6
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +306 -101
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +34 -37
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +2 -1
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts +10 -12
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +4 -8
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +9 -11
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +32 -22
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +160 -122
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +5 -5
- package/dist/react/interactables-legacy/Interactables.d.ts +2 -5
- package/dist/react/interactables-legacy/Interactables.d.ts.map +1 -1
- package/dist/react/interactables-legacy/Interactables.js +15 -8
- package/dist/react/interactables-legacy/Interactables.js.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.d.ts +6 -9
- package/dist/react/interactables-legacy/interactable-model-context.d.ts.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.js +13 -14
- package/dist/react/interactables-legacy/interactable-model-context.js.map +1 -1
- package/dist/react/interactables-legacy/scopes.d.ts +42 -46
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +8 -11
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +7 -9
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +23 -14
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js +54 -25
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js.map +1 -1
- package/dist/react/model-context/define-mcp-toolkit.d.ts +15 -18
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +13 -6
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +1 -4
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +3 -6
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +26 -29
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +6 -9
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +6 -9
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +6 -9
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +5 -7
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +1 -4
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +44 -32
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +3 -6
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +7 -10
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +3 -6
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +9 -13
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +13 -16
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +3 -5
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +3 -6
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +40 -40
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +10 -9
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +4 -7
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +7 -9
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +7 -10
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +6 -9
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +3 -6
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +3 -6
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +3 -6
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +4 -7
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +3 -6
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +3 -6
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +4 -7
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +2 -5
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +3 -6
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +5 -8
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +1 -4
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +3 -6
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +7 -10
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.js +4 -4
- package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +3 -6
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +1 -4
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +2 -5
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +8 -11
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +27 -29
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +26 -28
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +13 -13
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +13 -17
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +30 -33
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +42 -33
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +30 -28
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +14 -15
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +122 -120
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -3
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +208 -194
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +124 -82
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +8 -11
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +4 -7
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +16 -19
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +61 -64
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +25 -27
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.js +24 -5
- package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +26 -28
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +6 -9
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +5 -8
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +4 -7
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +3 -6
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +3 -6
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +3 -6
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +3 -6
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +4 -7
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +7 -10
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +4 -7
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +4 -7
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.js +5 -1
- package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +4 -7
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +4 -8
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +210 -219
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +70 -46
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +186 -198
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +13 -4
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +17 -23
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.js +3 -1
- package/dist/react/runtimes/RemoteThreadResource.js.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +10 -11
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +11 -14
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +6 -8
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js +9 -2
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.d.ts +9 -12
- package/dist/react/runtimes/assistant-transport/runManager.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.js +4 -1
- package/dist/react/runtimes/assistant-transport/runManager.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/types.d.ts +123 -118
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +7 -10
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js +17 -6
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts +3 -6
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +2 -5
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +7 -10
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +426 -216
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +15 -18
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +8 -4
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +146 -125
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +120 -8
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +13 -15
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +5 -7
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +2 -5
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.js +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +3 -6
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +9 -11
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +15 -19
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.js.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +14 -17
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +17 -21
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-store-history-copy.d.ts +25 -0
- package/dist/react/runtimes/external-store-history-copy.d.ts.map +1 -0
- package/dist/react/runtimes/external-store-history-copy.js +148 -0
- package/dist/react/runtimes/external-store-history-copy.js.map +1 -0
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +3 -6
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.js +72 -35
- package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts +2 -5
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +29 -41
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +142 -34
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +3 -6
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +2 -2
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +5 -7
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +4 -6
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +72 -70
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +11 -15
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +60 -60
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +21 -24
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/types/store-augmentation.d.ts +10 -11
- package/dist/react/types/store-augmentation.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +6 -8
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +35 -37
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +3 -6
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +3 -6
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +28 -31
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +51 -49
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/bindings.d.ts +35 -35
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +215 -201
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +4 -0
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +31 -30
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +25 -2
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +87 -82
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +4 -3
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +54 -57
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +70 -72
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +77 -81
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +306 -308
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +2 -1
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +9 -12
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +150 -101
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +400 -122
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +121 -104
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +174 -62
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +30 -31
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +21 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +28 -31
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +23 -2
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +15 -18
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +8 -11
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +98 -83
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +67 -70
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +225 -211
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +25 -20
- package/dist/runtime/internal.d.ts.map +1 -0
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +37 -40
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +32 -33
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +10 -2
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/queue/queue-item.d.ts +7 -10
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +9 -11
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +16 -15
- package/dist/runtime/utils/attachment-add-operations.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.js +24 -2
- package/dist/runtime/utils/attachment-add-operations.js.map +1 -1
- package/dist/runtime/utils/attachment-send-operations.d.ts +12 -0
- package/dist/runtime/utils/attachment-send-operations.d.ts.map +1 -0
- package/dist/runtime/utils/attachment-send-operations.js +34 -0
- package/dist/runtime/utils/attachment-send-operations.js.map +1 -0
- package/dist/runtime/utils/auto-status.d.ts +11 -13
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +3 -5
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +31 -33
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +47 -48
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +6 -5
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +6 -9
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +24 -27
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +52 -54
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +8 -7
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/pending-tool-calls.d.ts +12 -14
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +7 -10
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +6 -9
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -1
- package/dist/runtime/utils/stored-message-parts.d.ts +21 -0
- package/dist/runtime/utils/stored-message-parts.d.ts.map +1 -0
- package/dist/runtime/utils/stored-message-parts.js +103 -0
- package/dist/runtime/utils/stored-message-parts.js.map +1 -0
- package/dist/runtime/utils/streaming-timing.d.ts +23 -26
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +38 -34
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +16 -6
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts +5 -7
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.js +31 -4
- package/dist/runtime/utils/thread-runtime-lifecycle.js.map +1 -1
- package/dist/runtime/utils/tool-call-tree.d.ts +10 -13
- package/dist/runtime/utils/tool-call-tree.d.ts.map +1 -1
- package/dist/runtime/utils/tool-interactions.d.ts +10 -0
- package/dist/runtime/utils/tool-interactions.d.ts.map +1 -0
- package/dist/runtime/utils/tool-interactions.js +92 -0
- package/dist/runtime/utils/tool-interactions.js.map +1 -0
- package/dist/runtimes/assistant-transport/utils.d.ts +1 -4
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +220 -200
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +6 -8
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js +4 -1
- package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-shared-options.d.ts +3 -6
- package/dist/runtimes/external-store/external-store-shared-options.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +40 -43
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js +2 -2
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +119 -125
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +71 -18
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +5 -8
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +96 -98
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.js +3 -0
- package/dist/runtimes/inert/InertThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/internal.d.ts +20 -16
- package/dist/runtimes/internal.d.ts.map +1 -0
- package/dist/runtimes/local/local-runtime-core.d.ts +7 -10
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +41 -44
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +42 -45
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +94 -93
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +220 -29
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +2 -5
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +77 -55
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +28 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +12 -15
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +3 -6
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts +2 -5
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +34 -31
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.js +8 -3
- package/dist/runtimes/remote-thread-list/optimistic-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +60 -63
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.js +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +31 -33
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +5 -8
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +119 -121
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +147 -149
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +22 -7
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/chain-of-thought-client.d.ts +8 -11
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +56 -58
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +1270 -741
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +2 -5
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +3 -6
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.js +3 -1
- package/dist/store/clients/no-op-composer-client.js.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +2 -5
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +4 -6
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/submission-message.d.ts +8 -0
- package/dist/store/clients/submission-message.d.ts.map +1 -0
- package/dist/store/clients/submission-message.js +22 -0
- package/dist/store/clients/submission-message.js.map +1 -0
- package/dist/store/clients/suggestions.d.ts +8 -11
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +12 -12
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.js +81 -82
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/clients/thread-selection-events.d.ts +1 -4
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +7 -10
- package/dist/store/clients/thread-tasks.d.ts.map +1 -1
- package/dist/store/env.d.ts +1 -4
- package/dist/store/env.d.ts.map +1 -1
- package/dist/store/index.d.ts +33 -36
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -5
- package/dist/store/internal.d.ts +12 -12
- package/dist/store/internal.d.ts.map +1 -0
- package/dist/store/internal.js +2 -2
- package/dist/store/primitive-predicates.d.ts +14 -16
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +10 -5
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +11 -14
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +65 -62
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/handle-runtime-action.d.ts +1 -4
- package/dist/store/runtime-clients/handle-runtime-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts +1 -4
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +2 -5
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.js +26 -16
- package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +10 -11
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +121 -113
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +5 -8
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +6 -9
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +4 -7
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +221 -158
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/useSubscribable.d.ts +3 -6
- package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -1
- package/dist/store/scope-registration.d.ts +28 -29
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/attachment.d.ts +19 -22
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +33 -35
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +147 -135
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +119 -112
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +10 -13
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +53 -50
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +21 -23
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +14 -17
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +18 -21
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +27 -30
- package/dist/store/scopes/task.d.ts.map +1 -1
- package/dist/store/scopes/thread-list-item.d.ts +68 -71
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +197 -200
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +49 -52
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +73 -69
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +35 -7
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/types/attachment.d.ts +35 -37
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +7 -8
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +13 -16
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +15 -17
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/message.d.ts +358 -318
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +3 -6
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +10 -13
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +1 -4
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +2 -5
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +9 -13
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +16 -19
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +19 -21
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/id.d.ts +3 -6
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +1 -4
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +1 -4
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +1 -4
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +5 -8
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +3 -6
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +6 -8
- package/dist/utils/normalizePartStatus.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.js +3 -2
- package/dist/utils/normalizePartStatus.js.map +1 -1
- package/dist/utils/notify-event-listeners.d.ts +2 -4
- package/dist/utils/notify-event-listeners.d.ts.map +1 -1
- package/dist/utils/record.d.ts +1 -4
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +2 -5
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +2 -5
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +3 -6
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/package.json +15 -13
- package/src/adapters/attachment.test.ts +98 -1
- package/src/adapters/attachment.ts +77 -20
- package/src/adapters/feedback.ts +1 -0
- package/src/adapters/speech.test.ts +94 -0
- package/src/adapters/speech.ts +16 -2
- package/src/adapters/thread-history.ts +16 -5
- package/src/adapters/voice.test.ts +169 -0
- package/src/adapters/voice.ts +25 -4
- package/src/index.ts +14 -2
- package/src/internal.ts +7 -0
- package/src/model-context/frame/host.test.ts +51 -1
- package/src/model-context/frame/host.ts +3 -1
- package/src/model-context/frame/provider.test.ts +106 -20
- package/src/model-context/frame/provider.ts +8 -1
- package/src/model-context/frame/validate.ts +57 -0
- package/src/model-context/interactable-composer-metadata.test.ts +82 -0
- package/src/model-context/interactable-composer-metadata.ts +45 -2
- package/src/react/RuntimeAdapter.test.ts +4 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +711 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +125 -109
- package/src/react/client/Interactables.test.ts +865 -8
- package/src/react/client/Interactables.ts +325 -45
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +9 -3
- package/src/react/client/RemoteThreadList.initialize-failure.test.ts +124 -0
- package/src/react/client/RemoteThreadList.test.ts +5 -6
- package/src/react/client/RemoteThreadList.ts +6 -0
- package/src/react/client/Tools.ts +2 -3
- package/src/react/client/interactable-model-context.test.ts +56 -13
- package/src/react/client/interactable-model-context.ts +48 -23
- package/src/react/index.ts +2 -2
- package/src/react/interactables-legacy/Interactables.test.ts +221 -4
- package/src/react/interactables-legacy/Interactables.ts +25 -14
- package/src/react/interactables-legacy/interactable-model-context.ts +26 -24
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +40 -22
- package/src/react/interactables-shared/useInteractablePersistenceQueue.test.tsx +22 -2
- package/src/react/interactables-shared/useInteractablePersistenceQueue.ts +63 -11
- package/src/react/model-context/useInteractable.test.tsx +56 -29
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +5 -5
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +33 -0
- package/src/react/primitive-hooks/useSuggestionTrigger.ts +7 -4
- package/src/react/primitives/generativeUI/GenerativeUI.test.tsx +170 -0
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +43 -28
- package/src/react/primitives/message/MessageAttachments.test.tsx +2 -6
- package/src/react/primitives/message/MessageAttachments.tsx +14 -8
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +155 -8
- package/src/react/primitives/message/MessageGroupedParts.tsx +19 -6
- package/src/react/primitives/message/MessageParts.test.tsx +84 -0
- package/src/react/primitives/message/MessageParts.tool-interaction.test.tsx +69 -0
- package/src/react/primitives/message/MessageParts.tsx +29 -8
- package/src/react/primitives/thread/ThreadMessages.test.tsx +25 -7
- package/src/react/primitives/thread/ThreadSuggestions.test.tsx +97 -0
- package/src/react/primitives/thread/ThreadSuggestions.tsx +29 -6
- package/src/react/providers/ReadonlyThreadProvider.tsx +2 -2
- package/src/react/providers/TextMessagePartProvider.tsx +3 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.layout.test.tsx +62 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.retry.test.tsx +2 -2
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.running.test.tsx +93 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +181 -21
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +62 -17
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +112 -77
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +19 -3
- package/src/react/runtimes/RemoteThreadResource.ts +5 -2
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.test.ts +3 -1
- package/src/react/runtimes/assistant-transport/replayBoundaryStream.ts +10 -2
- package/src/react/runtimes/assistant-transport/runManager.ts +3 -0
- package/src/react/runtimes/assistant-transport/transport-parentid.test.tsx +57 -0
- package/src/react/runtimes/assistant-transport/transport-scheduling.test.ts +73 -46
- package/src/react/runtimes/assistant-transport/transport-thread-id.test.tsx +571 -0
- package/src/react/runtimes/assistant-transport/types.ts +9 -1
- package/src/react/runtimes/assistant-transport/useAssistantTransport.spec.md +10 -0
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.test.tsx +108 -1
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.ts +33 -9
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.integration.test.tsx +289 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.copy.test.tsx +471 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.engagement.test.tsx +330 -0
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +78 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +463 -2
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +595 -227
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +33 -4
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +7 -3
- package/src/react/runtimes/cloud/auiV0.ts +275 -6
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +873 -0
- package/src/react/runtimes/createMessageConverter.ts +9 -3
- package/src/react/runtimes/external-message-converter.test.ts +7 -3
- package/src/react/runtimes/external-store-history-copy.ts +223 -0
- package/src/react/runtimes/remote-thread-hook-on-tap.test.ts +2 -1
- package/src/react/runtimes/useExternalStoreRuntime.history-copy.test.tsx +483 -0
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +84 -3
- package/src/react/runtimes/useExternalStoreRuntime.suggestions.test.tsx +6 -2
- package/src/react/runtimes/useExternalStoreRuntime.ts +25 -5
- package/src/react/runtimes/useLocalRuntime.test.tsx +145 -1
- package/src/react/runtimes/useLocalRuntime.ts +8 -5
- package/src/react/runtimes/useRemoteThreadListRuntime.concurrent.test.tsx +84 -4
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +5 -1
- package/src/react/types/MessagePartComponentTypes.ts +10 -0
- package/src/react/types/scopes/interactables.ts +3 -0
- package/src/runtime/api/attachment-runtime.ts +10 -5
- package/src/runtime/api/bindings.ts +6 -1
- package/src/runtime/api/composer-runtime.ts +29 -6
- package/src/runtime/api/message-part-runtime.test.ts +215 -0
- package/src/runtime/api/message-part-runtime.ts +44 -1
- package/src/runtime/api/message-runtime.test.ts +112 -2
- package/src/runtime/api/message-runtime.ts +25 -7
- package/src/runtime/api/thread-list-item-runtime.ts +5 -5
- package/src/runtime/api/thread-list-runtime.ts +3 -3
- package/src/runtime/api/thread-runtime.test.ts +59 -0
- package/src/runtime/api/thread-runtime.ts +21 -11
- package/src/runtime/base/base-composer-runtime-core.ts +548 -153
- package/src/runtime/base/base-thread-runtime-core.test.ts +1614 -136
- package/src/runtime/base/base-thread-runtime-core.ts +236 -46
- package/src/runtime/base/default-edit-composer-runtime-core.ts +24 -2
- package/src/runtime/base/default-thread-composer-runtime-core.ts +33 -3
- package/src/runtime/interfaces/composer-runtime-core.ts +19 -0
- package/src/runtime/interfaces/thread-runtime-core.ts +24 -1
- package/src/runtime/queue/message-queue.ts +11 -1
- package/src/runtime/utils/attachment-add-operations.ts +45 -2
- package/src/runtime/utils/attachment-send-operations.ts +54 -0
- package/src/runtime/utils/auto-status.test.ts +54 -0
- package/src/runtime/utils/auto-status.ts +3 -10
- package/src/runtime/utils/external-message-conversion.test.ts +91 -0
- package/src/runtime/utils/external-message-conversion.ts +9 -6
- package/src/runtime/utils/message-repository.test.ts +69 -1
- package/src/runtime/utils/message-repository.ts +14 -7
- package/src/runtime/utils/stored-message-parts.ts +216 -0
- package/src/runtime/utils/thread-message-like.test.ts +58 -0
- package/src/runtime/utils/thread-message-like.ts +79 -48
- package/src/runtime/utils/thread-runtime-lifecycle.test.ts +67 -0
- package/src/runtime/utils/thread-runtime-lifecycle.ts +42 -8
- package/src/runtime/utils/tool-interactions.test.ts +193 -0
- package/src/runtime/utils/tool-interactions.ts +147 -0
- package/src/runtimes/external-store/external-store-adapter.ts +25 -0
- package/src/runtimes/external-store/external-store-runtime-core.ts +10 -2
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +2 -2
- package/src/runtimes/external-store/external-store-thread-runtime-core.test.ts +49 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +114 -32
- package/src/runtimes/inert/InertThreadRuntimeCore.test.ts +127 -56
- package/src/runtimes/inert/InertThreadRuntimeCore.ts +10 -1
- package/src/runtimes/local/local-thread-runtime-core.edit-cancellation.test.ts +70 -0
- package/src/runtimes/local/local-thread-runtime-core.test.ts +1866 -169
- package/src/runtimes/local/local-thread-runtime-core.ts +365 -40
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +53 -1
- package/src/runtimes/remote-thread-list/optimistic-state.ts +8 -3
- package/src/runtimes/tool-invocations/EDGE_CASES.md +19 -4
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +392 -39
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +31 -8
- package/src/store/clients/external-thread.test.ts +145 -0
- package/src/store/clients/external-thread.ts +669 -144
- package/src/store/clients/model-context-client.test.ts +8 -8
- package/src/store/clients/no-op-composer-client.ts +2 -0
- package/src/store/clients/submission-message.ts +27 -0
- package/src/store/clients/thread-message-client.test.ts +39 -0
- package/src/store/clients/thread-message-client.ts +13 -6
- package/src/store/index.ts +2 -2
- package/src/store/internal.ts +1 -0
- package/src/store/primitive-predicates.test.ts +119 -0
- package/src/store/primitive-predicates.ts +19 -4
- package/src/store/runtime-clients/composer-runtime-client.ts +4 -3
- package/src/store/runtime-clients/message-part-runtime-client.test.ts +42 -0
- package/src/store/runtime-clients/message-part-runtime-client.ts +4 -0
- package/src/store/runtime-clients/message-runtime-client.ts +5 -0
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +243 -0
- package/src/store/runtime-clients/thread-runtime-client.ts +46 -9
- package/src/store/scopes/composer.ts +22 -4
- package/src/store/scopes/message.ts +12 -1
- package/src/store/scopes/part.ts +8 -0
- package/src/subscribable/subscribable.test.ts +205 -3
- package/src/subscribable/subscribable.ts +49 -7
- package/src/tests/RemoteThreadListThreadListRuntimeCore-errors.test.ts +95 -1
- package/src/tests/attachment-adapters.test.ts +16 -1
- package/src/tests/auiV0Encode.test.ts +412 -1
- package/src/tests/base-composer-runtime-core-addAttachment.test.ts +6 -6
- package/src/tests/base-composer-runtime-core-send.test.ts +722 -29
- package/src/tests/base-composer-runtime-core.test.ts +212 -5
- package/src/tests/composer-can-cancel.test.ts +35 -6
- package/src/tests/composer-can-send.test.ts +120 -1
- package/src/tests/composer-submission.test.tsx +796 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +149 -2
- package/src/tests/external-store-thread-list-runtime-core.test.ts +111 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +810 -28
- package/src/tests/external-store-thread-runtime-core.test.ts +217 -0
- package/src/tests/external-thread-attachments.test.tsx +763 -26
- package/src/tests/external-thread-feedback.test.tsx +20 -7
- package/src/tests/external-thread-isLast.test.tsx +69 -0
- package/src/tests/external-thread-parity.test.tsx +1 -1
- package/src/tests/get-thread-state-isRunning.test.ts +2 -2
- package/src/tests/message-queue.test.ts +45 -10
- package/src/tests/remote-thread-list-adapter-switch.test.ts +45 -1
- package/src/tests/thread-switch-events.test.tsx +11 -7
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +2 -1
- package/src/types/message.test.ts +19 -0
- package/src/types/message.ts +65 -10
- package/src/utils/normalizePartStatus.ts +14 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -16
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +0 -1
- package/dist/tests/remote-thread-list-test-helpers.js +0 -59
- package/dist/tests/remote-thread-list-test-helpers.js.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
TOOL_INTERACTION_LIMITS,
|
|
4
|
+
appendToolInteraction,
|
|
5
|
+
createToolInteraction,
|
|
6
|
+
readToolInteractionLog,
|
|
7
|
+
} from "./tool-interactions";
|
|
8
|
+
|
|
9
|
+
describe("createToolInteraction", () => {
|
|
10
|
+
it("creates action and human-response interactions", () => {
|
|
11
|
+
expect(
|
|
12
|
+
createToolInteraction(
|
|
13
|
+
{ type: "action", payload: { $input: "approved" } },
|
|
14
|
+
10,
|
|
15
|
+
),
|
|
16
|
+
).toEqual({
|
|
17
|
+
type: "action",
|
|
18
|
+
occurredAt: 10,
|
|
19
|
+
payload: { $input: "approved" },
|
|
20
|
+
});
|
|
21
|
+
expect(
|
|
22
|
+
createToolInteraction({ type: "human-response", payload: false }, 11),
|
|
23
|
+
).toEqual({ type: "human-response", occurredAt: 11, payload: false });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it.each([false, 0, "", null])("keeps the human response %j", (payload) => {
|
|
27
|
+
expect(
|
|
28
|
+
createToolInteraction({ type: "human-response", payload }, 10),
|
|
29
|
+
).toHaveProperty("payload", payload);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("returns a JSON clone of the payload", () => {
|
|
33
|
+
const payload = { answer: { value: "yes" } };
|
|
34
|
+
const interaction = createToolInteraction({ type: "action", payload }, 10);
|
|
35
|
+
|
|
36
|
+
payload.answer.value = "no";
|
|
37
|
+
|
|
38
|
+
expect(interaction.payload).toEqual({ answer: { value: "yes" } });
|
|
39
|
+
expect(interaction.payload).not.toBe(payload);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it.each([
|
|
43
|
+
["undefined", undefined],
|
|
44
|
+
["a function", () => {}],
|
|
45
|
+
["a bigint", 1n],
|
|
46
|
+
["a symbol", Symbol("value")],
|
|
47
|
+
["NaN", Number.NaN],
|
|
48
|
+
["Infinity", Number.POSITIVE_INFINITY],
|
|
49
|
+
["a date", new Date()],
|
|
50
|
+
["a map", new Map()],
|
|
51
|
+
[
|
|
52
|
+
"a class instance",
|
|
53
|
+
new (class Payload {
|
|
54
|
+
readonly value = "x";
|
|
55
|
+
})(),
|
|
56
|
+
],
|
|
57
|
+
])("rejects %s", (_label, payload) => {
|
|
58
|
+
expect(() =>
|
|
59
|
+
createToolInteraction({ type: "human-response", payload }, 10),
|
|
60
|
+
).toThrow("plain JSON");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("rejects a cycle", () => {
|
|
64
|
+
const payload: { self?: unknown } = {};
|
|
65
|
+
payload.self = payload;
|
|
66
|
+
|
|
67
|
+
expect(() =>
|
|
68
|
+
createToolInteraction({ type: "human-response", payload }, 10),
|
|
69
|
+
).toThrow("plain JSON");
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("rejects invalid action payloads, interaction types, and large payloads", () => {
|
|
73
|
+
expect(() =>
|
|
74
|
+
createToolInteraction({ type: "action", payload: ["not an object"] }, 10),
|
|
75
|
+
).toThrow("JSON object");
|
|
76
|
+
expect(() =>
|
|
77
|
+
createToolInteraction({ type: "unknown", payload: null } as never, 10),
|
|
78
|
+
).toThrow("Unknown tool interaction type");
|
|
79
|
+
expect(() =>
|
|
80
|
+
createToolInteraction(
|
|
81
|
+
{
|
|
82
|
+
type: "human-response",
|
|
83
|
+
payload: "x".repeat(TOOL_INTERACTION_LIMITS.payloadLength),
|
|
84
|
+
},
|
|
85
|
+
10,
|
|
86
|
+
),
|
|
87
|
+
).toThrow("limited");
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
describe("appendToolInteraction", () => {
|
|
92
|
+
const interaction = (occurredAt: number, payload: unknown = occurredAt) =>
|
|
93
|
+
({
|
|
94
|
+
type: "human-response" as const,
|
|
95
|
+
occurredAt,
|
|
96
|
+
payload,
|
|
97
|
+
}) as ReturnType<typeof createToolInteraction>;
|
|
98
|
+
|
|
99
|
+
it("evicts the oldest entries past the entry limit", () => {
|
|
100
|
+
let log = appendToolInteraction(undefined, interaction(0));
|
|
101
|
+
for (let index = 1; index <= TOOL_INTERACTION_LIMITS.entries; index += 1) {
|
|
102
|
+
log = appendToolInteraction(log, interaction(index));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
expect(log).toMatchObject({ omitted: 1 });
|
|
106
|
+
expect(log.entries).toHaveLength(TOOL_INTERACTION_LIMITS.entries);
|
|
107
|
+
expect(log.entries[0]).toHaveProperty("occurredAt", 1);
|
|
108
|
+
expect(log.entries.at(-1)).toHaveProperty(
|
|
109
|
+
"occurredAt",
|
|
110
|
+
TOOL_INTERACTION_LIMITS.entries,
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("evicts entries past the log length across calls", () => {
|
|
115
|
+
const payload = "x".repeat(16_000);
|
|
116
|
+
let log = appendToolInteraction(undefined, interaction(0, payload));
|
|
117
|
+
for (let index = 1; index < 5; index += 1) {
|
|
118
|
+
log = appendToolInteraction(log, interaction(index, payload));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
expect(log).toMatchObject({ omitted: 1 });
|
|
122
|
+
expect(log.entries.map((entry) => entry.occurredAt)).toEqual([1, 2, 3, 4]);
|
|
123
|
+
|
|
124
|
+
log = appendToolInteraction(log, interaction(5, payload));
|
|
125
|
+
|
|
126
|
+
expect(log).toMatchObject({ omitted: 2 });
|
|
127
|
+
expect(log.entries.map((entry) => entry.occurredAt)).toEqual([2, 3, 4, 5]);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
describe("readToolInteractionLog", () => {
|
|
132
|
+
const interaction = (occurredAt: number, payload: unknown = occurredAt) => ({
|
|
133
|
+
type: "human-response",
|
|
134
|
+
occurredAt,
|
|
135
|
+
payload,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it("keeps readable entries and a positive omitted count", () => {
|
|
139
|
+
const log = readToolInteractionLog({
|
|
140
|
+
entries: [
|
|
141
|
+
{ type: "action", occurredAt: 1, payload: { $input: "yes" } },
|
|
142
|
+
{ type: "human-response", occurredAt: 2, payload: false },
|
|
143
|
+
{ type: "unknown", occurredAt: 3, payload: null },
|
|
144
|
+
{ type: "action", occurredAt: Number.POSITIVE_INFINITY, payload: {} },
|
|
145
|
+
{ type: "human-response", occurredAt: 4, payload: () => {} },
|
|
146
|
+
{ type: "action", occurredAt: 5, payload: [] },
|
|
147
|
+
],
|
|
148
|
+
omitted: 3,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
expect(log).toEqual({
|
|
152
|
+
entries: [
|
|
153
|
+
{ type: "action", occurredAt: 1, payload: { $input: "yes" } },
|
|
154
|
+
{ type: "human-response", occurredAt: 2, payload: false },
|
|
155
|
+
],
|
|
156
|
+
omitted: 3,
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("evicts the oldest readable entries past the entry limit", () => {
|
|
161
|
+
const log = readToolInteractionLog({
|
|
162
|
+
entries: Array.from(
|
|
163
|
+
{ length: TOOL_INTERACTION_LIMITS.entries + 1 },
|
|
164
|
+
(_, index) => interaction(index),
|
|
165
|
+
),
|
|
166
|
+
omitted: 2,
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
expect(log).toMatchObject({ omitted: 3 });
|
|
170
|
+
expect(log?.entries).toHaveLength(TOOL_INTERACTION_LIMITS.entries);
|
|
171
|
+
expect(log?.entries[0]).toHaveProperty("occurredAt", 1);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it("evicts the oldest readable entries past the log length", () => {
|
|
175
|
+
const payload = "x".repeat(16_000);
|
|
176
|
+
const log = readToolInteractionLog({
|
|
177
|
+
entries: Array.from({ length: 5 }, (_, index) =>
|
|
178
|
+
interaction(index, payload),
|
|
179
|
+
),
|
|
180
|
+
omitted: 2,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
expect(log).toMatchObject({ omitted: 3 });
|
|
184
|
+
expect(log?.entries.map((entry) => entry.occurredAt)).toEqual([1, 2, 3, 4]);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it.each([null, "log", [], {}, { entries: [] }])(
|
|
188
|
+
"returns undefined for unreadable logs: %j",
|
|
189
|
+
(value) => {
|
|
190
|
+
expect(readToolInteractionLog(value)).toBeUndefined();
|
|
191
|
+
},
|
|
192
|
+
);
|
|
193
|
+
});
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ReadonlyJSONObject,
|
|
3
|
+
ReadonlyJSONValue,
|
|
4
|
+
} from "assistant-stream/utils";
|
|
5
|
+
import type {
|
|
6
|
+
Unstable_ToolInteraction,
|
|
7
|
+
Unstable_ToolInteractionInput,
|
|
8
|
+
Unstable_ToolInteractionLog,
|
|
9
|
+
} from "../../types/message";
|
|
10
|
+
|
|
11
|
+
export const TOOL_INTERACTION_LIMITS = {
|
|
12
|
+
entries: 32,
|
|
13
|
+
payloadLength: 16_384,
|
|
14
|
+
logLength: 65_536,
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
const MAX_DEPTH = 64;
|
|
18
|
+
|
|
19
|
+
const isPlainObject = (value: object): boolean => {
|
|
20
|
+
const prototype = Object.getPrototypeOf(value);
|
|
21
|
+
return prototype === Object.prototype || prototype === null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const isPlainJSON = (
|
|
25
|
+
value: unknown,
|
|
26
|
+
ancestors: Set<object>,
|
|
27
|
+
depth: number,
|
|
28
|
+
): value is ReadonlyJSONValue => {
|
|
29
|
+
if (value === null) return true;
|
|
30
|
+
switch (typeof value) {
|
|
31
|
+
case "string":
|
|
32
|
+
case "boolean":
|
|
33
|
+
return true;
|
|
34
|
+
case "number":
|
|
35
|
+
return Number.isFinite(value);
|
|
36
|
+
case "object":
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (depth > MAX_DEPTH || ancestors.has(value)) return false;
|
|
42
|
+
ancestors.add(value);
|
|
43
|
+
const valid = Array.isArray(value)
|
|
44
|
+
? value.every((item) => isPlainJSON(item, ancestors, depth + 1))
|
|
45
|
+
: isPlainObject(value) &&
|
|
46
|
+
Object.values(value).every((item) =>
|
|
47
|
+
isPlainJSON(item, ancestors, depth + 1),
|
|
48
|
+
);
|
|
49
|
+
ancestors.delete(value);
|
|
50
|
+
return valid;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const isJSONObjectValue = (value: unknown) =>
|
|
54
|
+
typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55
|
+
|
|
56
|
+
const isInteractionType = (
|
|
57
|
+
value: unknown,
|
|
58
|
+
): value is Unstable_ToolInteraction["type"] =>
|
|
59
|
+
value === "action" || value === "human-response";
|
|
60
|
+
|
|
61
|
+
export function createToolInteraction(
|
|
62
|
+
input: Unstable_ToolInteractionInput,
|
|
63
|
+
occurredAt: number = Date.now(),
|
|
64
|
+
): Unstable_ToolInteraction {
|
|
65
|
+
const { type, payload } = input;
|
|
66
|
+
if (!isInteractionType(type)) {
|
|
67
|
+
throw new Error(`Unknown tool interaction type: ${String(type)}`);
|
|
68
|
+
}
|
|
69
|
+
if (!isPlainJSON(payload, new Set(), 0)) {
|
|
70
|
+
throw new Error("A tool interaction payload must be plain JSON.");
|
|
71
|
+
}
|
|
72
|
+
if (type === "action" && !isJSONObjectValue(payload)) {
|
|
73
|
+
throw new Error("An action interaction payload must be a JSON object.");
|
|
74
|
+
}
|
|
75
|
+
const serialized = JSON.stringify(payload);
|
|
76
|
+
if (serialized.length > TOOL_INTERACTION_LIMITS.payloadLength) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
`A tool interaction payload is limited to ${TOOL_INTERACTION_LIMITS.payloadLength} characters of JSON.`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return { type, occurredAt, payload: JSON.parse(serialized) };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function appendToolInteraction(
|
|
85
|
+
log: Unstable_ToolInteractionLog | undefined,
|
|
86
|
+
interaction: Unstable_ToolInteraction,
|
|
87
|
+
): Unstable_ToolInteractionLog {
|
|
88
|
+
const entries = [...(log?.entries ?? []), interaction];
|
|
89
|
+
let omitted = log?.omitted ?? 0;
|
|
90
|
+
while (
|
|
91
|
+
entries.length > 1 &&
|
|
92
|
+
(entries.length > TOOL_INTERACTION_LIMITS.entries ||
|
|
93
|
+
JSON.stringify(entries).length > TOOL_INTERACTION_LIMITS.logLength)
|
|
94
|
+
) {
|
|
95
|
+
entries.shift();
|
|
96
|
+
omitted += 1;
|
|
97
|
+
}
|
|
98
|
+
return omitted > 0 ? { entries, omitted } : { entries };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const readInteraction = (
|
|
102
|
+
value: unknown,
|
|
103
|
+
): Unstable_ToolInteraction | undefined => {
|
|
104
|
+
if (!isJSONObjectValue(value)) return undefined;
|
|
105
|
+
const { type, occurredAt, payload } = value as Record<string, unknown>;
|
|
106
|
+
if (!isInteractionType(type)) return undefined;
|
|
107
|
+
if (typeof occurredAt !== "number" || !Number.isFinite(occurredAt)) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
if (!isPlainJSON(payload, new Set(), 0)) return undefined;
|
|
111
|
+
if (type === "action") {
|
|
112
|
+
return isJSONObjectValue(payload)
|
|
113
|
+
? { type, occurredAt, payload: payload as ReadonlyJSONObject }
|
|
114
|
+
: undefined;
|
|
115
|
+
}
|
|
116
|
+
return { type, occurredAt, payload };
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export function readToolInteractionLog(
|
|
120
|
+
value: unknown,
|
|
121
|
+
): Unstable_ToolInteractionLog | undefined {
|
|
122
|
+
if (!isJSONObjectValue(value)) return undefined;
|
|
123
|
+
const { entries, omitted } = value as Record<string, unknown>;
|
|
124
|
+
const readable = Array.isArray(entries)
|
|
125
|
+
? entries.flatMap((entry) => {
|
|
126
|
+
const interaction = readInteraction(entry);
|
|
127
|
+
return interaction ? [interaction] : [];
|
|
128
|
+
})
|
|
129
|
+
: [];
|
|
130
|
+
const omittedCount =
|
|
131
|
+
typeof omitted === "number" && Number.isInteger(omitted) && omitted > 0
|
|
132
|
+
? omitted
|
|
133
|
+
: 0;
|
|
134
|
+
let omittedEntries = omittedCount;
|
|
135
|
+
while (
|
|
136
|
+
readable.length > 1 &&
|
|
137
|
+
(readable.length > TOOL_INTERACTION_LIMITS.entries ||
|
|
138
|
+
JSON.stringify(readable).length > TOOL_INTERACTION_LIMITS.logLength)
|
|
139
|
+
) {
|
|
140
|
+
readable.shift();
|
|
141
|
+
omittedEntries += 1;
|
|
142
|
+
}
|
|
143
|
+
if (readable.length === 0 && omittedEntries === 0) return undefined;
|
|
144
|
+
return omittedEntries > 0
|
|
145
|
+
? { entries: readable, omitted: omittedEntries }
|
|
146
|
+
: { entries: readable };
|
|
147
|
+
}
|
|
@@ -14,6 +14,7 @@ import type { FeedbackAdapter } from "../../adapters/feedback";
|
|
|
14
14
|
import type {
|
|
15
15
|
AddToolResultOptions,
|
|
16
16
|
RespondToToolApprovalOptions,
|
|
17
|
+
Unstable_RecordToolInteractionOptions,
|
|
17
18
|
StartRunConfig,
|
|
18
19
|
ResumeRunConfig,
|
|
19
20
|
ThreadSuggestion,
|
|
@@ -84,6 +85,11 @@ type ExternalStoreMessageConverterAdapter<T> = {
|
|
|
84
85
|
};
|
|
85
86
|
|
|
86
87
|
type ExternalStoreAdapterBase<T> = {
|
|
88
|
+
/**
|
|
89
|
+
* The runtime writes its messages to the thread list's history adapter
|
|
90
|
+
* itself, so `useExternalStoreRuntime` does not copy them.
|
|
91
|
+
*/
|
|
92
|
+
unstable_persistsHistory?: boolean | undefined;
|
|
87
93
|
/**
|
|
88
94
|
* Whether the entire thread is disabled. When `true`, the composer's input
|
|
89
95
|
* is also disabled (the user cannot type, attach files, or submit). For a
|
|
@@ -133,6 +139,10 @@ type ExternalStoreAdapterBase<T> = {
|
|
|
133
139
|
* back, because the runtime cannot see a removal it did not make.
|
|
134
140
|
*/
|
|
135
141
|
setMessages?: ((messages: readonly T[]) => void) | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Called with each message a voice session adds to the thread: every finalized transcript, and every text message typed into a session that takes typed text (it carries no `metadata.modality`). The host appends it to its own messages under the same id, which is how the runtime knows the host carries it. A message that finalizes while `isLoading` is true is delivered once loading ends, to the callback on the adapter current at that moment, and is not delivered at all when the conversation changed while it waited. A host that routes conversations through one runtime is recognized by its `unstable_messageRepositoryInstance`; one that swaps only its `messages` cannot be told apart from a load finishing. A host that does not implement this callback keeps these messages for the session only.
|
|
144
|
+
*/
|
|
145
|
+
onVoiceTranscript?: ((message: ThreadMessage) => void) | undefined;
|
|
136
146
|
/**
|
|
137
147
|
* Fires when the user explicitly switches branches via the runtime's
|
|
138
148
|
* `switchToBranch` action (e.g. a BranchPicker click). It does not fire on
|
|
@@ -160,6 +170,13 @@ type ExternalStoreAdapterBase<T> = {
|
|
|
160
170
|
/** Opt in to message queuing. Typically produced by `createMessageQueue`. */
|
|
161
171
|
queue?: ExternalThreadQueueAdapter | undefined;
|
|
162
172
|
onEdit?: ((message: AppendMessage) => Promise<void>) | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Removes a message from the host's store. The runtime drops the message
|
|
175
|
+
* from its branches when `messages` stops carrying the id, and reads a
|
|
176
|
+
* `messages` update that still carries it after every call for it has
|
|
177
|
+
* settled as a declined delete. A host that accepts the delete therefore
|
|
178
|
+
* publishes the removal before the returned promise settles.
|
|
179
|
+
*/
|
|
163
180
|
onDelete?: ((messageId: string) => Promise<void> | void) | undefined;
|
|
164
181
|
onReload?: // TODO: remove parentId in 0.12.0
|
|
165
182
|
| ((parentId: string | null, config: StartRunConfig) => Promise<void>)
|
|
@@ -184,6 +201,14 @@ type ExternalStoreAdapterBase<T> = {
|
|
|
184
201
|
onRespondToToolApproval?:
|
|
185
202
|
| ((options: RespondToToolApprovalOptions) => Promise<void> | void)
|
|
186
203
|
| undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Stores a user interaction on a tool call part of a message this store
|
|
206
|
+
* owns and exposes it on that part's `unstable_interactions`. Without it,
|
|
207
|
+
* recording an interaction rejects and nothing is kept.
|
|
208
|
+
*/
|
|
209
|
+
unstable_onRecordToolInteraction?:
|
|
210
|
+
| ((options: Unstable_RecordToolInteractionOptions) => Promise<void> | void)
|
|
211
|
+
| undefined;
|
|
187
212
|
convertMessage?: ExternalStoreMessageConverter<T> | undefined;
|
|
188
213
|
adapters?:
|
|
189
214
|
| {
|
|
@@ -9,17 +9,25 @@ const getThreadListAdapter = (store: ExternalStoreAdapter<any>) => {
|
|
|
9
9
|
|
|
10
10
|
export class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {
|
|
11
11
|
public readonly threads;
|
|
12
|
+
private _adapter: ExternalStoreAdapter<any>;
|
|
12
13
|
|
|
13
14
|
constructor(adapter: ExternalStoreAdapter<any>) {
|
|
14
15
|
super();
|
|
16
|
+
this._adapter = adapter;
|
|
15
17
|
this.threads = new ExternalStoreThreadListRuntimeCore(
|
|
16
18
|
getThreadListAdapter(adapter),
|
|
17
|
-
() =>
|
|
19
|
+
() =>
|
|
20
|
+
new ExternalStoreThreadRuntimeCore(
|
|
21
|
+
this._contextProvider,
|
|
22
|
+
this._adapter,
|
|
23
|
+
),
|
|
18
24
|
);
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
public setAdapter(adapter: ExternalStoreAdapter<any>) {
|
|
22
|
-
//
|
|
28
|
+
// Before the thread list, whose thread switch builds the new main thread
|
|
29
|
+
// from this adapter.
|
|
30
|
+
this._adapter = adapter;
|
|
23
31
|
this.threads.__internal_setAdapter(getThreadListAdapter(adapter));
|
|
24
32
|
this.threads.getMainThreadRuntimeCore().__internal_setAdapter(adapter);
|
|
25
33
|
}
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
ThreadListRuntimeCore,
|
|
5
5
|
} from "../../runtime/interfaces/thread-list-runtime-core";
|
|
6
6
|
import type { ExternalStoreThreadListAdapter } from "./external-store-adapter";
|
|
7
|
-
import {
|
|
7
|
+
import { disposeThreadRuntime } from "../../runtime/utils/thread-runtime-lifecycle";
|
|
8
8
|
import { BaseSubscribable } from "../../subscribable/subscribable";
|
|
9
9
|
import { nullProtoRecord } from "../../utils/record";
|
|
10
10
|
|
|
@@ -161,7 +161,7 @@ export class ExternalStoreThreadListRuntimeCore
|
|
|
161
161
|
|
|
162
162
|
// `initialLoad ||`: `_mainThread!` must be assigned on construction.
|
|
163
163
|
if (initialLoad || previousThreadId !== newThreadId) {
|
|
164
|
-
if (!initialLoad)
|
|
164
|
+
if (!initialLoad) disposeThreadRuntime(this._mainThread);
|
|
165
165
|
this._mainThreadId = newThreadId;
|
|
166
166
|
this._mainThread = this.threadFactory();
|
|
167
167
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import type { ModelContextProvider } from "../../model-context/types";
|
|
3
|
+
import type { Unstable_RecordToolInteractionOptions } from "../../runtime/interfaces/thread-runtime-core";
|
|
4
|
+
import type { ExternalStoreAdapter } from "./external-store-adapter";
|
|
5
|
+
import { ExternalStoreThreadRuntimeCore } from "./external-store-thread-runtime-core";
|
|
6
|
+
|
|
7
|
+
const modelContextProvider: ModelContextProvider = {
|
|
8
|
+
getModelContext: () => ({}),
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const interaction: Unstable_RecordToolInteractionOptions = {
|
|
12
|
+
messageId: "message-1",
|
|
13
|
+
toolCallId: "call-1",
|
|
14
|
+
interaction: {
|
|
15
|
+
type: "action",
|
|
16
|
+
payload: { action: "toggle" },
|
|
17
|
+
occurredAt: 0,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const createRuntime = (overrides: Partial<ExternalStoreAdapter> = {}) =>
|
|
22
|
+
new ExternalStoreThreadRuntimeCore(modelContextProvider, {
|
|
23
|
+
messages: [],
|
|
24
|
+
onNew: async () => {},
|
|
25
|
+
...overrides,
|
|
26
|
+
} as ExternalStoreAdapter);
|
|
27
|
+
|
|
28
|
+
describe("ExternalStoreThreadRuntimeCore interaction recording", () => {
|
|
29
|
+
it("delegates interaction records to the adapter", async () => {
|
|
30
|
+
const onRecordToolInteraction = vi.fn(async () => {});
|
|
31
|
+
const runtime = createRuntime({
|
|
32
|
+
unstable_onRecordToolInteraction: onRecordToolInteraction,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
await runtime.unstable_recordToolInteraction(interaction);
|
|
36
|
+
|
|
37
|
+
expect(onRecordToolInteraction).toHaveBeenCalledExactlyOnceWith(
|
|
38
|
+
interaction,
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("rejects when the adapter does not record interactions", async () => {
|
|
43
|
+
const runtime = createRuntime();
|
|
44
|
+
|
|
45
|
+
await expect(
|
|
46
|
+
runtime.unstable_recordToolInteraction(interaction),
|
|
47
|
+
).rejects.toThrow("Runtime does not support recording tool interactions.");
|
|
48
|
+
});
|
|
49
|
+
});
|