@assistant-ui/core 0.3.18 → 0.3.20
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 +9 -10
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +2 -1
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/directive-formatter.d.ts +1 -2
- package/dist/adapters/directive-formatter.d.ts.map +1 -1
- package/dist/adapters/feedback.d.ts +2 -2
- package/dist/adapters/feedback.d.ts.map +1 -1
- package/dist/adapters/speech.d.ts +6 -7
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +13 -3
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/suggestion.d.ts +5 -6
- package/dist/adapters/suggestion.d.ts.map +1 -1
- package/dist/adapters/thread-history.d.ts +10 -7
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +1 -2
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/adapters/voice.d.ts +5 -6
- package/dist/adapters/voice.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/duplicate-detection.d.ts +1 -2
- package/dist/internal/duplicate-detection.d.ts.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/model-context/frame/host.d.ts +1 -2
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +26 -11
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +1 -2
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/types.d.ts +5 -6
- package/dist/model-context/frame/types.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.d.ts +9 -10
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +11 -9
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry-handles.d.ts +3 -4
- package/dist/model-context/registry-handles.d.ts.map +1 -1
- package/dist/model-context/registry.d.ts +1 -2
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool-call-text.d.ts +2 -3
- package/dist/model-context/tool-call-text.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +2 -3
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +8 -9
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/react/AssistantProvider.d.ts +3 -4
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +1 -2
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/RuntimeAdapter.d.ts +2 -3
- package/dist/react/RuntimeAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts +4 -5
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +43 -19
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/adapters/TitleGenerationAdapter.d.ts +2 -3
- package/dist/react/adapters/TitleGenerationAdapter.d.ts.map +1 -1
- package/dist/react/client/AdaptedRemoteThread.d.ts +1 -2
- package/dist/react/client/AdaptedRemoteThread.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +1 -2
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.js +20 -15
- package/dist/react/client/DataRenderers.js.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts +3 -4
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/Interactables.d.ts +1 -2
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +11 -5
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +2 -3
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +3 -2
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts +2 -2
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts +2 -3
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +3 -2
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/interactables-legacy/Interactables.d.ts +1 -2
- package/dist/react/interactables-legacy/Interactables.d.ts.map +1 -1
- package/dist/react/interactables-legacy/interactable-model-context.d.ts +2 -3
- package/dist/react/interactables-legacy/interactable-model-context.d.ts.map +1 -1
- package/dist/react/interactables-legacy/scopes.d.ts +9 -10
- package/dist/react/interactables-legacy/scopes.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts +2 -3
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.js +3 -0
- package/dist/react/interactables-legacy/useAssistantInteractable.js.map +1 -1
- package/dist/react/interactables-legacy/useInteractableState.d.ts +1 -2
- package/dist/react/interactables-legacy/useInteractableState.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts +1 -2
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/model-context/define-mcp-toolkit.d.ts +4 -5
- package/dist/react/model-context/define-mcp-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/define-toolkit.d.ts +2 -3
- package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
- package/dist/react/model-context/external-tool.d.ts +1 -2
- package/dist/react/model-context/external-tool.d.ts.map +1 -1
- package/dist/react/model-context/human-tool.d.ts +3 -4
- package/dist/react/model-context/human-tool.d.ts.map +1 -1
- package/dist/react/model-context/interactableTool.d.ts +3 -4
- package/dist/react/model-context/interactableTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantDataUI.d.ts +2 -3
- package/dist/react/model-context/makeAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +2 -3
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +2 -3
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/provider-tool.d.ts +2 -3
- package/dist/react/model-context/provider-tool.d.ts.map +1 -1
- package/dist/react/model-context/stub-tool.d.ts +1 -2
- package/dist/react/model-context/stub-tool.d.ts.map +1 -1
- package/dist/react/model-context/toolbox.d.ts +9 -10
- package/dist/react/model-context/toolbox.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantContext.d.ts +2 -2
- package/dist/react/model-context/useAssistantContext.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantDataUI.d.ts +2 -3
- package/dist/react/model-context/useAssistantDataUI.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantInstructions.d.ts +2 -2
- package/dist/react/model-context/useAssistantInstructions.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +2 -3
- package/dist/react/model-context/useAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/useAssistantToolUI.d.ts +2 -3
- package/dist/react/model-context/useAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useAuiToolOverrides.d.ts +1 -2
- package/dist/react/model-context/useAuiToolOverrides.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +1 -2
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts +4 -5
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.js +4 -1
- package/dist/react/model-context/useInteractable.js.map +1 -1
- package/dist/react/model-context/useInteractableState.d.ts +1 -2
- package/dist/react/model-context/useInteractableState.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.d.ts +1 -2
- package/dist/react/model-context/useInteractableVersions.d.ts.map +1 -1
- package/dist/react/model-context/useInteractableVersions.js +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts +2 -3
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts +2 -3
- package/dist/react/primitive-hooks/useActionBarCopy.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarEdit.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts +2 -3
- package/dist/react/primitive-hooks/useActionBarFeedback.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarReload.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarSpeak.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts +1 -2
- package/dist/react/primitive-hooks/useActionBarStopSpeaking.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts +1 -2
- package/dist/react/primitive-hooks/useBranchPickerNext.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts +1 -2
- package/dist/react/primitive-hooks/useBranchPickerPrevious.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerCancel.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerDictate.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerDictate.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useComposerSend.d.ts +1 -2
- package/dist/react/primitive-hooks/useComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts +1 -2
- package/dist/react/primitive-hooks/useEditComposerCancel.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts +1 -2
- package/dist/react/primitive-hooks/useEditComposerSend.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageBranching.d.ts +1 -2
- package/dist/react/primitive-hooks/useMessageBranching.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageError.d.ts +1 -2
- package/dist/react/primitive-hooks/useMessageError.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useMessageReload.d.ts +1 -2
- package/dist/react/primitive-hooks/useMessageReload.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts +2 -3
- package/dist/react/primitive-hooks/useSuggestionTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadIsEmpty.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadIsRunning.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemArchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemDelete.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemTrigger.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListLoadMore.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadListNew.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadListNew.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadMessageIds.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useThreadMessages.d.ts +1 -2
- package/dist/react/primitive-hooks/useThreadMessages.d.ts.map +1 -1
- package/dist/react/primitive-hooks/useVoice.d.ts +3 -4
- package/dist/react/primitive-hooks/useVoice.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +2 -3
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +4 -5
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerIf.d.ts +4 -5
- package/dist/react/primitives/composer/ComposerIf.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerQueue.d.ts +2 -3
- package/dist/react/primitives/composer/ComposerQueue.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts +4 -5
- package/dist/react/primitives/generativeUI/GenerativeUI.d.ts.map +1 -1
- package/dist/react/primitives/generativeUI/GenerativeUI.js +27 -28
- package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +4 -5
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +13 -5
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -2
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +10 -10
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageQuote.d.ts +2 -3
- package/dist/react/primitives/message/MessageQuote.d.ts.map +1 -1
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts +2 -3
- package/dist/react/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +4 -4
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.js +1 -0
- package/dist/react/primitives/part/PartMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +7 -8
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.js +6 -5
- package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts +5 -6
- package/dist/react/primitives/thread/ThreadSuggestions.d.ts.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +4 -5
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts +2 -3
- package/dist/react/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +2 -3
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +1 -2
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +1 -2
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIdProvider.d.ts +1 -2
- package/dist/react/providers/MessageByIdProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +1 -2
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +1 -2
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +2 -3
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.d.ts +2 -3
- package/dist/react/providers/ReadonlyThreadProvider.d.ts.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +2 -3
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +1 -2
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +1 -2
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +1 -2
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +3 -2
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +17 -7
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +1 -2
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +2 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +4 -5
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +3 -3
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts +2 -3
- package/dist/react/runtimes/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts +3 -4
- package/dist/react/runtimes/assistant-transport/replayBoundaryStream.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/runManager.d.ts +2 -3
- package/dist/react/runtimes/assistant-transport/runManager.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/types.d.ts +17 -18
- package/dist/react/runtimes/assistant-transport/types.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts +4 -5
- package/dist/react/runtimes/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts +1 -2
- package/dist/react/runtimes/assistant-transport/useConvertedState.d.ts.map +1 -1
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts +1 -2
- package/dist/react/runtimes/assistant-transport/useLatestRef.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +3 -26
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +152 -378
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +2 -2
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +22 -2
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +51 -18
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +125 -17
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +6 -6
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.js +4 -0
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts +1 -2
- package/dist/react/runtimes/cloud/createCloudThreadListAdapterCreateFallback.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +5 -0
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -0
- package/dist/react/runtimes/cloud/sdkIdentity.js +9 -0
- package/dist/react/runtimes/cloud/sdkIdentity.js.map +1 -0
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts +1 -2
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts +1 -2
- package/dist/react/runtimes/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +1 -2
- package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +3 -4
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.d.ts +14 -4
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.js +26 -61
- package/dist/react/runtimes/external-message-converter.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts +1 -2
- package/dist/react/runtimes/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts +1 -2
- package/dist/react/runtimes/useExternalStoreSharedOptions.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +3 -4
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts +1 -2
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +3 -3
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useRuntimeAdapters.d.ts +4 -4
- package/dist/react/runtimes/useRuntimeAdapters.d.ts.map +1 -1
- package/dist/react/runtimes/useStreamingTiming.d.ts +2 -2
- package/dist/react/runtimes/useStreamingTiming.d.ts.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +26 -27
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +3 -4
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/react/types/scopes/interactables.d.ts +10 -11
- package/dist/react/types/scopes/interactables.d.ts.map +1 -1
- package/dist/react/types/scopes/tools.d.ts +4 -5
- package/dist/react/types/scopes/tools.d.ts.map +1 -1
- package/dist/react/utils/getMessageQuote.d.ts +1 -2
- package/dist/react/utils/getMessageQuote.d.ts.map +1 -1
- package/dist/react/utils/groupParts.d.ts +13 -9
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/groupParts.js +6 -0
- package/dist/react/utils/groupParts.js.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +3 -2
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.js +6 -1
- package/dist/react/utils/useJSONEqual.js.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +6 -0
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -0
- package/dist/react/utils/useJSONSchemaDependency.js +20 -0
- package/dist/react/utils/useJSONSchemaDependency.js.map +1 -0
- package/dist/runtime/api/assistant-runtime.d.ts +2 -3
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +6 -7
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/bindings.d.ts +5 -6
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +10 -10
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.d.ts +3 -4
- package/dist/runtime/api/message-part-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-part-runtime.js +3 -2
- package/dist/runtime/api/message-part-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +8 -6
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/message-runtime.js +3 -2
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/paths.d.ts +6 -7
- package/dist/runtime/api/paths.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.d.ts +8 -8
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +4 -5
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +10 -11
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +2 -5
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-assistant-runtime-core.d.ts +1 -2
- package/dist/runtime/base/base-assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +2 -2
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +46 -10
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +10 -3
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +212 -77
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +1 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +12 -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 +1 -2
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +7 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts +1 -2
- package/dist/runtime/branch/external-thread-branch-adapter.d.ts.map +1 -1
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts +1 -2
- package/dist/runtime/interfaces/assistant-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +10 -11
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +4 -5
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +23 -16
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +2 -3
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +10 -4
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +70 -7
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/queue/queue-item.d.ts +2 -3
- package/dist/runtime/queue/queue-item.d.ts.map +1 -1
- package/dist/runtime/utils/abortable-thread-load.d.ts +2 -3
- package/dist/runtime/utils/abortable-thread-load.d.ts.map +1 -1
- package/dist/runtime/utils/attachment-add-operations.d.ts +3 -4
- package/dist/runtime/utils/attachment-add-operations.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.d.ts +9 -6
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +12 -4
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +5 -6
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +26 -15
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +51 -14
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/external-store-message.d.ts +4 -5
- package/dist/runtime/utils/external-store-message.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository-session.d.ts +3 -4
- package/dist/runtime/utils/message-repository-session.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +4 -5
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +3 -3
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/pending-tool-calls.d.ts +2 -3
- package/dist/runtime/utils/pending-tool-calls.d.ts.map +1 -1
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts +1 -2
- package/dist/runtime/utils/resolveToolApprovalResponse.d.ts.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +2 -3
- 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 +83 -0
- package/dist/runtime/utils/stored-message-parts.js.map +1 -0
- package/dist/runtime/utils/streaming-timing.d.ts +4 -5
- package/dist/runtime/utils/streaming-timing.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +7 -6
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +4 -2
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts +3 -4
- package/dist/runtime/utils/thread-runtime-lifecycle.d.ts.map +1 -1
- package/dist/runtime/utils/tool-call-tree.d.ts +4 -5
- package/dist/runtime/utils/tool-call-tree.d.ts.map +1 -1
- package/dist/runtimes/assistant-transport/utils.d.ts +1 -2
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +9 -6
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts +1 -2
- package/dist/runtimes/external-store/external-store-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-shared-options.d.ts +2 -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 +2 -3
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +4 -3
- 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 +36 -6
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/thread-message-converter.d.ts +2 -3
- package/dist/runtimes/external-store/thread-message-converter.d.ts.map +1 -1
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts +2 -3
- package/dist/runtimes/inert/InertThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/internal.d.ts +1 -1
- package/dist/runtimes/local/local-runtime-core.d.ts +1 -2
- package/dist/runtimes/local/local-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +1 -2
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts +2 -3
- package/dist/runtimes/local/local-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +10 -5
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +57 -10
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/should-continue.d.ts +1 -2
- package/dist/runtimes/local/should-continue.d.ts.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +1 -2
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +1 -2
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter-changed.d.ts +1 -2
- 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 -2
- package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts +1 -2
- package/dist/runtimes/remote-thread-list/optimistic-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +16 -17
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +7 -8
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.d.ts +2 -3
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +8 -9
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts +4 -5
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +2 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/chain-of-thought-client.d.ts +1 -2
- package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
- package/dist/store/clients/external-thread.d.ts +3 -4
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +256 -211
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts +1 -2
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/no-op-composer-client.d.ts +1 -2
- package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts +1 -2
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts +1 -2
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/suggestions.d.ts +3 -4
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/thread-message-client.d.ts +2 -3
- package/dist/store/clients/thread-message-client.d.ts.map +1 -1
- package/dist/store/clients/thread-selection-events.d.ts +1 -2
- package/dist/store/clients/thread-selection-events.d.ts.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +12 -0
- package/dist/store/clients/thread-tasks.d.ts.map +1 -0
- package/dist/store/clients/thread-tasks.js +69 -0
- package/dist/store/clients/thread-tasks.js.map +1 -0
- package/dist/store/env.d.ts +1 -2
- package/dist/store/env.d.ts.map +1 -1
- package/dist/store/index.d.ts +3 -2
- package/dist/store/index.js +3 -3
- package/dist/store/primitive-predicates.d.ts +11 -12
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +4 -4
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/handle-runtime-action.d.ts +1 -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 +1 -2
- package/dist/store/runtime-clients/handle-thread-list-action.d.ts.map +1 -1
- package/dist/store/runtime-clients/liveRef.d.ts +1 -2
- package/dist/store/runtime-clients/liveRef.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +1 -2
- 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 +1 -2
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +1 -2
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +176 -128
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/useSubscribable.d.ts +1 -2
- package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -1
- package/dist/store/scope-registration.d.ts +2 -0
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/attachment.d.ts +4 -5
- package/dist/store/scopes/attachment.d.ts.map +1 -1
- package/dist/store/scopes/chain-of-thought.d.ts +5 -6
- package/dist/store/scopes/chain-of-thought.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +6 -7
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +6 -6
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/model-context.d.ts +3 -4
- package/dist/store/scopes/model-context.d.ts.map +1 -1
- package/dist/store/scopes/part.d.ts +4 -5
- package/dist/store/scopes/part.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +4 -4
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/suggestion.d.ts +4 -5
- package/dist/store/scopes/suggestion.d.ts.map +1 -1
- package/dist/store/scopes/suggestions.d.ts +5 -6
- package/dist/store/scopes/suggestions.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +35 -0
- package/dist/store/scopes/task.d.ts.map +1 -0
- package/dist/store/scopes/task.js +0 -0
- package/dist/store/scopes/thread-list-item.d.ts +5 -6
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +25 -6
- package/dist/store/scopes/thread.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +4 -5
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts +15 -15
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +23 -15
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +5 -6
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +1 -1
- package/dist/types/attachment.d.ts +9 -10
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/augmentations.d.ts +3 -4
- package/dist/types/augmentations.d.ts.map +1 -1
- package/dist/types/directive.d.ts +2 -3
- package/dist/types/directive.d.ts.map +1 -1
- package/dist/types/error.d.ts +8 -9
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/message.d.ts +53 -44
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/types/quote.d.ts +1 -2
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +2 -3
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/types/unsubscribe.d.ts +1 -2
- package/dist/types/unsubscribe.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +2 -3
- package/dist/utils/abortable-iterable.d.ts.map +1 -1
- package/dist/utils/abortable-iterable.js +30 -14
- package/dist/utils/abortable-iterable.js.map +1 -1
- package/dist/utils/composite-context-provider.d.ts +1 -2
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/data-url.d.ts +6 -7
- package/dist/utils/data-url.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +17 -2
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.js +32 -7
- package/dist/utils/getGroupStatus.js.map +1 -1
- package/dist/utils/id.d.ts +3 -4
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/image-media-type.d.ts +1 -2
- package/dist/utils/image-media-type.d.ts.map +1 -1
- package/dist/utils/invoke-user-callback.d.ts +1 -2
- package/dist/utils/invoke-user-callback.d.ts.map +1 -1
- package/dist/utils/json/is-json-equal.d.ts +1 -2
- package/dist/utils/json/is-json-equal.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +4 -5
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/dist/utils/json/stable-stringify-tool-args.d.ts +2 -3
- package/dist/utils/json/stable-stringify-tool-args.d.ts.map +1 -1
- package/dist/utils/normalizePartStatus.d.ts +4 -5
- package/dist/utils/normalizePartStatus.d.ts.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 +1 -2
- package/dist/utils/record.d.ts.map +1 -1
- package/dist/utils/silent-runtime-action.d.ts +2 -3
- package/dist/utils/silent-runtime-action.d.ts.map +1 -1
- package/dist/utils/text.d.ts +1 -2
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/wire-media.d.ts +3 -4
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/dist/utils/wire-media.js +2 -2
- package/dist/utils/wire-media.js.map +1 -1
- package/package.json +15 -14
- package/src/adapters/attachment.ts +8 -1
- package/src/adapters/feedback.ts +1 -0
- package/src/adapters/speech.test.ts +236 -0
- package/src/adapters/speech.ts +17 -10
- package/src/adapters/thread-history.ts +3 -0
- package/src/index.ts +1 -0
- package/src/model-context/frame/host.test.ts +113 -1
- package/src/model-context/frame/host.ts +39 -12
- package/src/model-context/frame/provider.test.ts +45 -20
- package/src/model-context/interactable-composer-metadata.test.ts +30 -0
- package/src/model-context/interactable-composer-metadata.ts +10 -10
- package/src/react/RuntimeAdapter.test.ts +4 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +361 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +69 -19
- package/src/react/client/DataRenderers.test.tsx +45 -0
- package/src/react/client/DataRenderers.ts +13 -9
- package/src/react/client/Interactables.test.ts +52 -4
- package/src/react/client/Interactables.ts +7 -1
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +9 -3
- package/src/react/client/RemoteThreadList.test.ts +46 -7
- package/src/react/client/RemoteThreadList.ts +15 -2
- package/src/react/client/interactable-model-context.test.ts +44 -0
- package/src/react/client/interactable-model-context.ts +3 -2
- package/src/react/index.ts +5 -1
- package/src/react/interactables-legacy/Interactables.test.ts +9 -3
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +150 -0
- package/src/react/interactables-legacy/useAssistantInteractable.ts +10 -1
- package/src/react/model-context/useInteractable.test.tsx +204 -0
- package/src/react/model-context/useInteractable.ts +3 -0
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +5 -6
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +0 -1
- package/src/react/primitives/generativeUI/GenerativeUI.test.tsx +54 -0
- package/src/react/primitives/generativeUI/GenerativeUI.tsx +13 -18
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +99 -0
- package/src/react/primitives/message/MessageGroupedParts.tsx +15 -4
- package/src/react/primitives/part/PartMessages.test.tsx +104 -1
- package/src/react/primitives/part/PartMessages.tsx +1 -0
- package/src/react/primitives/thread/ThreadMessages.test.tsx +160 -0
- package/src/react/primitives/thread/ThreadMessages.tsx +8 -5
- package/src/react/providers/ReadonlyThreadProvider.test.tsx +56 -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.test.tsx +23 -20
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.title.test.tsx +24 -17
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +39 -24
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +7 -1
- package/src/react/runtimes/assistant-transport/transport-scheduling.test.ts +73 -46
- package/src/react/runtimes/assistant-transport/useAssistantTransportRuntime.test.tsx +66 -1
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +20 -14
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +323 -1
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +190 -523
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +81 -0
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +27 -1
- package/src/react/runtimes/cloud/auiV0.ts +281 -26
- package/src/react/runtimes/cloud/auiV0DecodeSafely.test.ts +522 -0
- package/src/react/runtimes/cloud/createCloudThreadListAdapter.test.ts +21 -0
- package/src/react/runtimes/cloud/createCloudThreadListAdapter.ts +7 -1
- package/src/react/runtimes/cloud/sdkIdentity.ts +9 -0
- package/src/react/runtimes/cloud/useCloudThreadListAdapter.test.tsx +18 -4
- package/src/react/runtimes/external-message-converter.test.ts +143 -4
- package/src/react/runtimes/external-message-converter.ts +39 -93
- package/src/react/runtimes/remote-thread-hook-on-tap.test.ts +2 -1
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +8 -2
- package/src/react/runtimes/useExternalStoreRuntime.suggestions.test.tsx +6 -2
- package/src/react/runtimes/useRemoteThreadListRuntime.concurrent.test.tsx +84 -4
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +6 -2
- package/src/react/utils/groupParts.ts +12 -1
- package/src/react/utils/useJSONEqual.ts +9 -0
- package/src/react/utils/useJSONSchemaDependency.ts +22 -0
- package/src/runtime/api/message-part-runtime.ts +4 -1
- package/src/runtime/api/message-runtime.ts +15 -2
- package/src/runtime/api/thread-runtime.test.ts +58 -0
- package/src/runtime/api/thread-runtime.ts +2 -4
- package/src/runtime/base/base-composer-runtime-core.ts +69 -16
- package/src/runtime/base/base-thread-runtime-core.test.ts +1799 -49
- package/src/runtime/base/base-thread-runtime-core.ts +296 -94
- package/src/runtime/base/default-edit-composer-runtime-core.ts +12 -2
- package/src/runtime/base/default-thread-composer-runtime-core.ts +12 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +8 -0
- package/src/runtime/queue/message-queue.ts +79 -7
- package/src/runtime/utils/auto-status.test.ts +112 -1
- package/src/runtime/utils/auto-status.ts +31 -5
- package/src/runtime/utils/external-message-conversion.test.ts +177 -0
- package/src/runtime/utils/external-message-conversion.ts +128 -33
- package/src/runtime/utils/message-repository.test.ts +49 -0
- package/src/runtime/utils/message-repository.ts +3 -3
- package/src/runtime/utils/stored-message-parts.ts +174 -0
- package/src/runtime/utils/thread-message-like.test.ts +52 -0
- package/src/runtime/utils/thread-message-like.ts +11 -2
- package/src/runtimes/external-store/external-store-adapter.ts +4 -0
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +74 -9
- package/src/runtimes/local/local-thread-runtime-core.test.ts +189 -12
- package/src/runtimes/local/local-thread-runtime-core.ts +91 -10
- package/src/runtimes/tool-invocations/EDGE_CASES.md +2 -6
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +133 -0
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +10 -6
- package/src/store/clients/external-thread.ts +53 -14
- package/src/store/clients/thread-tasks.test.ts +274 -0
- package/src/store/clients/thread-tasks.ts +138 -0
- package/src/store/index.ts +8 -0
- package/src/store/primitive-predicates.test.ts +64 -5
- package/src/store/primitive-predicates.ts +10 -2
- package/src/store/runtime-clients/thread-runtime-client.test.tsx +110 -0
- package/src/store/runtime-clients/thread-runtime-client.ts +31 -1
- package/src/store/scope-registration.ts +2 -0
- package/src/store/scopes/message.ts +4 -1
- package/src/store/scopes/task.ts +34 -0
- package/src/store/scopes/thread.ts +16 -0
- package/src/store/thread-tasks.test.tsx +209 -0
- package/src/subscribable/subscribable.test.ts +161 -1
- package/src/subscribable/subscribable.ts +25 -15
- package/src/tests/MessageRepository.test.ts +1 -5
- package/src/tests/attachment-adapters.test.ts +16 -1
- package/src/tests/auiV0Encode.test.ts +304 -0
- package/src/tests/base-composer-runtime-core-addAttachment.test.ts +6 -6
- package/src/tests/base-composer-runtime-core-send.test.ts +51 -0
- package/src/tests/base-composer-runtime-core.test.ts +329 -6
- package/src/tests/composer-can-cancel.test.ts +35 -6
- package/src/tests/composer-can-send.test.ts +22 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +47 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +369 -16
- package/src/tests/external-store-thread-runtime-core.test.ts +31 -0
- package/src/tests/external-thread-attachments.test.tsx +91 -23
- package/src/tests/external-thread-feedback.test.tsx +20 -7
- package/src/tests/external-thread-parity.test.tsx +35 -1
- package/src/tests/groupParts.test.ts +71 -0
- package/src/tests/message-queue.test.ts +290 -2
- package/src/tests/remote-thread-list-reactive-threadId.test.ts +51 -0
- package/src/tests/thread-switch-events.test.tsx +11 -7
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +45 -1
- package/src/types/index.ts +1 -0
- package/src/types/message.test.ts +19 -0
- package/src/types/message.ts +23 -7
- package/src/utils/abortable-iterable.test.ts +115 -0
- package/src/utils/abortable-iterable.ts +34 -23
- package/src/utils/getGroupStatus.test.ts +70 -4
- package/src/utils/getGroupStatus.ts +35 -12
- package/src/utils/wire-media.test.ts +10 -0
- package/src/utils/wire-media.ts +6 -2
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { auiV0DecodeSafely, auiV0Encode } from "./auiV0.js";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
3
|
import { useEffect, useRef, useState } from "@assistant-ui/tap/react-shim";
|
|
4
4
|
import { getClientId, useAui } from "@assistant-ui/store";
|
|
5
|
-
import { CloudMessagePersistence,
|
|
5
|
+
import { CloudEngagementReporter, CloudMessagePersistence, CloudRunReporter, createFormattedPersistence, createRunTelemetryToolCall, deriveRunOutcome, describeRunError, extractRunTelemetryModelId, normalizeRunTelemetryUsage, truncateRunTelemetryText } from "assistant-cloud";
|
|
6
|
+
import { extractAISDKRunTelemetry } from "assistant-cloud/ai-sdk";
|
|
6
7
|
//#region src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts
|
|
7
8
|
const globalPersistence = /* @__PURE__ */ new WeakMap();
|
|
8
9
|
var AssistantCloudThreadHistoryAdapter = class {
|
|
9
10
|
cloudRef;
|
|
10
11
|
getAui;
|
|
12
|
+
runReporter;
|
|
13
|
+
engagementReporter;
|
|
11
14
|
constructor(cloudRef, getAui) {
|
|
12
15
|
this.cloudRef = cloudRef;
|
|
13
16
|
this.getAui = getAui;
|
|
17
|
+
this.runReporter = new CloudRunReporter(() => this.cloudRef.current);
|
|
18
|
+
this.engagementReporter = new CloudEngagementReporter(() => this.cloudRef.current, (threadId, messageId, options) => this.resolveEngagementEventIds(threadId, messageId, options));
|
|
14
19
|
}
|
|
15
20
|
get aui() {
|
|
16
21
|
return this.getAui();
|
|
@@ -40,7 +45,7 @@ var AssistantCloudThreadHistoryAdapter = class {
|
|
|
40
45
|
...remoteMessageId ? { message_id: remoteMessageId } : void 0
|
|
41
46
|
};
|
|
42
47
|
}
|
|
43
|
-
feedback = { submit: ({ message, type }) => {
|
|
48
|
+
feedback = { submit: ({ message, type, comment }) => {
|
|
44
49
|
(async () => {
|
|
45
50
|
const threadListItem = this.tryGetKeyedThreadListItem();
|
|
46
51
|
const remoteThreadId = threadListItem?.getState().remoteId;
|
|
@@ -53,7 +58,10 @@ var AssistantCloudThreadHistoryAdapter = class {
|
|
|
53
58
|
console.warn(`[assistant-ui] Skipping feedback for message ${message.id}: no cloud message id is mapped.`);
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
|
-
await this.cloudRef.current.threads.messages.feedback(remoteThreadId, cloudMessageId, {
|
|
61
|
+
await this.cloudRef.current.threads.messages.feedback(remoteThreadId, cloudMessageId, {
|
|
62
|
+
type,
|
|
63
|
+
...comment ? { comment } : void 0
|
|
64
|
+
});
|
|
57
65
|
})().catch((error) => {
|
|
58
66
|
console.error("[assistant-ui] Cloud feedback submission failed:", error);
|
|
59
67
|
});
|
|
@@ -103,7 +111,7 @@ var AssistantCloudThreadHistoryAdapter = class {
|
|
|
103
111
|
},
|
|
104
112
|
reportTelemetry(items, options) {
|
|
105
113
|
const encodedRunMessages = items.map((item) => formatAdapter.encode(item));
|
|
106
|
-
adapter._reportRunTelemetry(formatAdapter.format, encodedRunMessages, options, resolvePinned(), extractLastRunMessageInfo(items, formatAdapter));
|
|
114
|
+
adapter._reportRunTelemetry(formatAdapter.format, encodedRunMessages, options, resolvePinned(), mergeRunMessageInfo(extractLastRunMessageInfo(items, formatAdapter), options?.message ? extractRunMessageInfo(options.message, "aui/v0") : void 0));
|
|
107
115
|
},
|
|
108
116
|
async load() {
|
|
109
117
|
const pinned = pinCurrent();
|
|
@@ -135,14 +143,23 @@ var AssistantCloudThreadHistoryAdapter = class {
|
|
|
135
143
|
async load() {
|
|
136
144
|
const remoteId = this.aui.threadListItem.getState().remoteId;
|
|
137
145
|
if (!remoteId) return { messages: [] };
|
|
138
|
-
|
|
146
|
+
const rows = (await this._persistence.load(remoteId, "aui/v0")).filter((m) => m.format === "aui/v0").reverse();
|
|
147
|
+
const loaded = [];
|
|
148
|
+
const loadedIds = /* @__PURE__ */ new Set();
|
|
149
|
+
for (const row of rows) {
|
|
150
|
+
const item = auiV0DecodeSafely(row);
|
|
151
|
+
if (!item) continue;
|
|
152
|
+
if (item.parentId && !loadedIds.has(item.parentId)) continue;
|
|
153
|
+
loadedIds.add(item.message.id);
|
|
154
|
+
loaded.push(item);
|
|
155
|
+
}
|
|
156
|
+
return { messages: loaded };
|
|
139
157
|
}
|
|
140
158
|
_reportRunTelemetry(format, runMessages, options, threadListItem, messageInfo) {
|
|
141
|
-
if (!this.cloudRef.current.telemetry.enabled) return;
|
|
142
159
|
const item = threadListItem ?? this.aui.threadListItem;
|
|
143
160
|
const remoteId = item.getState().remoteId;
|
|
144
161
|
if (!remoteId) return;
|
|
145
|
-
const extracted = extractRunTelemetry(format, runMessages);
|
|
162
|
+
const extracted = extractRunTelemetry(format, runMessages) ?? (messageInfo?.status !== void 0 ? { status: "incomplete" } : void 0);
|
|
146
163
|
if (!extracted) return;
|
|
147
164
|
this._sendReport(remoteId, extracted, options?.durationMs, options?.stepTimestamps, messageInfo, this.getPersistence(item));
|
|
148
165
|
}
|
|
@@ -154,7 +171,7 @@ var AssistantCloudThreadHistoryAdapter = class {
|
|
|
154
171
|
_sendReport(remoteId, data, durationMs, stepTimestamps, messageInfo, persistence = this._persistence) {
|
|
155
172
|
const mergedSteps = mergeStepTimestamps(data.steps, stepTimestamps);
|
|
156
173
|
const messageId = messageInfo?.localMessageId ? persistence.getResolvedRemoteId(messageInfo.localMessageId) : void 0;
|
|
157
|
-
|
|
174
|
+
this.runReporter.report({
|
|
158
175
|
threadId: remoteId,
|
|
159
176
|
status: messageInfo?.status ?? data.status,
|
|
160
177
|
outcome: messageInfo?.outcomeType,
|
|
@@ -164,48 +181,30 @@ var AssistantCloudThreadHistoryAdapter = class {
|
|
|
164
181
|
traceId: messageInfo?.traceId,
|
|
165
182
|
modelId: data.modelId,
|
|
166
183
|
provider: messageInfo?.provider,
|
|
167
|
-
usage:
|
|
168
|
-
|
|
169
|
-
outputTokens: data.outputTokens,
|
|
170
|
-
reasoningTokens: data.reasoningTokens,
|
|
171
|
-
cachedInputTokens: data.cachedInputTokens
|
|
172
|
-
},
|
|
173
|
-
steps: toRunReportSteps(mergedSteps),
|
|
184
|
+
usage: data.usage,
|
|
185
|
+
steps: mergedSteps,
|
|
174
186
|
totalSteps: data.totalSteps,
|
|
175
187
|
toolCalls: data.toolCalls,
|
|
176
188
|
durationMs,
|
|
177
189
|
firstTokenMs: messageInfo?.firstTokenMs,
|
|
178
190
|
outputText: data.outputText,
|
|
179
|
-
metadata: data.metadata
|
|
180
|
-
telemetry: this.cloudRef.current.telemetry
|
|
191
|
+
metadata: data.metadata
|
|
181
192
|
});
|
|
182
|
-
const { beforeReport } = this.cloudRef.current.telemetry;
|
|
183
|
-
const report = beforeReport ? beforeReport(initial) : initial;
|
|
184
|
-
if (!report) return;
|
|
185
|
-
this.cloudRef.current.runs.report(report).catch(() => {});
|
|
186
193
|
}
|
|
187
194
|
};
|
|
188
|
-
function toRunReportSteps(steps) {
|
|
189
|
-
if (!steps) return void 0;
|
|
190
|
-
return steps.map((step) => ({
|
|
191
|
-
usage: {
|
|
192
|
-
inputTokens: step.input_tokens,
|
|
193
|
-
outputTokens: step.output_tokens,
|
|
194
|
-
reasoningTokens: step.reasoning_tokens,
|
|
195
|
-
cachedInputTokens: step.cached_input_tokens
|
|
196
|
-
},
|
|
197
|
-
toolCalls: step.tool_calls,
|
|
198
|
-
startMs: step.start_ms,
|
|
199
|
-
endMs: step.end_ms
|
|
200
|
-
}));
|
|
201
|
-
}
|
|
202
195
|
function mergeStepTimestamps(steps, timestamps) {
|
|
203
196
|
if (!timestamps) return steps;
|
|
204
|
-
if (!steps) return timestamps.map((
|
|
197
|
+
if (!steps) return timestamps.map(({ start_ms, end_ms }) => ({
|
|
198
|
+
startMs: start_ms,
|
|
199
|
+
endMs: end_ms
|
|
200
|
+
}));
|
|
205
201
|
const len = Math.min(steps.length, timestamps.length);
|
|
206
|
-
return steps.map((
|
|
207
|
-
...
|
|
208
|
-
...
|
|
202
|
+
return steps.map((step, index) => ({
|
|
203
|
+
...step,
|
|
204
|
+
...index < len ? {
|
|
205
|
+
startMs: timestamps[index].start_ms,
|
|
206
|
+
endMs: timestamps[index].end_ms
|
|
207
|
+
} : void 0
|
|
209
208
|
}));
|
|
210
209
|
}
|
|
211
210
|
function extractLastRunMessageInfo(items, formatAdapter) {
|
|
@@ -215,29 +214,36 @@ function extractLastRunMessageInfo(items, formatAdapter) {
|
|
|
215
214
|
if (info) return info;
|
|
216
215
|
}
|
|
217
216
|
}
|
|
217
|
+
function mergeRunMessageInfo(stored, observed) {
|
|
218
|
+
if (!observed) return stored;
|
|
219
|
+
const { localMessageId: _observedId, ...outcome } = observed;
|
|
220
|
+
return {
|
|
221
|
+
...stored,
|
|
222
|
+
...outcome
|
|
223
|
+
};
|
|
224
|
+
}
|
|
218
225
|
function extractRunMessageInfo(message, format, localMessageId) {
|
|
219
226
|
if (!isRecord(message) || message.role !== "assistant") return void 0;
|
|
220
227
|
const status = isRecord(message.status) ? message.status : void 0;
|
|
221
228
|
const metadata = isRecord(message.metadata) ? message.metadata : void 0;
|
|
222
229
|
const custom = isRecord(metadata?.custom) ? metadata.custom : void 0;
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
const firstTokenMs = typeof streamStartTime === "number" && Number.isFinite(streamStartTime) && typeof firstTokenTime === "number" && Number.isFinite(firstTokenTime) ? Math.round(firstTokenTime - streamStartTime) : void 0;
|
|
227
|
-
const finishReason = status?.type === "incomplete" ? status.reason : typeof metadata?.finishReason === "string" ? metadata.finishReason : void 0;
|
|
230
|
+
const firstTokenTime = (isRecord(metadata?.timing) ? metadata.timing : void 0)?.firstTokenTime;
|
|
231
|
+
const firstTokenMs = typeof firstTokenTime === "number" && Number.isFinite(firstTokenTime) ? Math.round(firstTokenTime) : void 0;
|
|
232
|
+
const finishReason = status?.type === "incomplete" ? typeof status.reason === "string" ? status.reason : void 0 : typeof metadata?.finishReason === "string" ? metadata.finishReason : void 0;
|
|
228
233
|
const failed = status?.type === "incomplete" && status.reason === "error";
|
|
229
234
|
const outcome = deriveRunOutcome({
|
|
230
|
-
finishReason
|
|
235
|
+
finishReason,
|
|
231
236
|
isError: failed
|
|
232
237
|
});
|
|
233
238
|
const outcomeType = outcome.outcome;
|
|
239
|
+
const runStatus = outcome.status === "error" ? "error" : status?.type === "incomplete" ? "incomplete" : finishReason !== void 0 ? outcome.status : void 0;
|
|
234
240
|
const failure = failed ? describeRunError(status.error) : {};
|
|
235
241
|
const messageId = localMessageId ?? (typeof message.id === "string" ? message.id : void 0);
|
|
236
242
|
const traceId = format === "aui/v0" ? custom?.traceId : format === "ai-sdk/v6" ? metadata?.traceId : void 0;
|
|
237
243
|
const provider = typeof custom?.provider === "string" ? custom.provider : typeof metadata?.provider === "string" ? metadata.provider : void 0;
|
|
238
244
|
return {
|
|
239
245
|
...messageId ? { localMessageId: messageId } : void 0,
|
|
240
|
-
...
|
|
246
|
+
...runStatus !== void 0 ? { status: runStatus } : void 0,
|
|
241
247
|
...outcomeType ? { outcomeType } : void 0,
|
|
242
248
|
...failure,
|
|
243
249
|
...firstTokenMs != null && firstTokenMs >= 0 ? { firstTokenMs } : void 0,
|
|
@@ -251,22 +257,18 @@ function isRecord(value) {
|
|
|
251
257
|
function extractTelemetry(format, content) {
|
|
252
258
|
switch (format) {
|
|
253
259
|
case "aui/v0": return extractAuiV0(content);
|
|
254
|
-
case "ai-sdk/v6": return
|
|
260
|
+
case "ai-sdk/v6": return extractAISDKRunTelemetry([content]);
|
|
255
261
|
default: return null;
|
|
256
262
|
}
|
|
257
263
|
}
|
|
258
264
|
function extractRunTelemetry(format, runMessages) {
|
|
259
|
-
if (format === "ai-sdk/v6") return
|
|
265
|
+
if (format === "ai-sdk/v6") return extractAISDKRunTelemetry(runMessages);
|
|
260
266
|
for (let i = runMessages.length - 1; i >= 0; i--) {
|
|
261
267
|
const result = extractTelemetry(format, runMessages[i]);
|
|
262
268
|
if (result) return result;
|
|
263
269
|
}
|
|
264
270
|
return null;
|
|
265
271
|
}
|
|
266
|
-
const AUI_STATUS_MAP = {
|
|
267
|
-
error: "error",
|
|
268
|
-
incomplete: "incomplete"
|
|
269
|
-
};
|
|
270
272
|
function extractAuiV0(content) {
|
|
271
273
|
const msg = content;
|
|
272
274
|
if (msg.role !== "assistant") return null;
|
|
@@ -320,196 +322,26 @@ function extractAuiV0(content) {
|
|
|
320
322
|
reasoningTokens = hasReasoning ? totalReasoning : void 0;
|
|
321
323
|
cachedInputTokens = hasCachedInput ? totalCachedInput : void 0;
|
|
322
324
|
}
|
|
323
|
-
const
|
|
324
|
-
const status = statusType === "incomplete" && msg.status?.reason === "error" ? "error" : statusType && AUI_STATUS_MAP[statusType] || "completed";
|
|
325
|
+
const status = msg.status?.type === "incomplete" ? "incomplete" : "completed";
|
|
325
326
|
const metadata = msg.metadata?.custom;
|
|
326
327
|
const modelId = extractRunTelemetryModelId(msg.metadata);
|
|
327
|
-
const telemetrySteps = steps && steps.length >
|
|
328
|
-
const usage = s.usage ? normalizeRunTelemetryUsage(s.usage) : void 0;
|
|
329
|
-
return {
|
|
330
|
-
...usage?.inputTokens != null ? { input_tokens: usage.inputTokens } : void 0,
|
|
331
|
-
...usage?.outputTokens != null ? { output_tokens: usage.outputTokens } : void 0,
|
|
332
|
-
...usage?.reasoningTokens != null ? { reasoning_tokens: usage.reasoningTokens } : void 0,
|
|
333
|
-
...usage?.cachedInputTokens != null ? { cached_input_tokens: usage.cachedInputTokens } : void 0
|
|
334
|
-
};
|
|
335
|
-
}) : void 0;
|
|
328
|
+
const telemetrySteps = steps && steps.length > 0 ? steps.map((step) => step.usage ? { usage: step.usage } : {}) : void 0;
|
|
336
329
|
return {
|
|
337
330
|
status,
|
|
338
331
|
...toolCalls && toolCalls.length > 0 ? { toolCalls } : void 0,
|
|
339
332
|
...steps?.length ? { totalSteps: steps.length } : void 0,
|
|
340
|
-
...inputTokens != null ? {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
333
|
+
...inputTokens != null || outputTokens != null || reasoningTokens != null || cachedInputTokens != null ? { usage: {
|
|
334
|
+
...inputTokens != null ? { inputTokens } : void 0,
|
|
335
|
+
...outputTokens != null ? { outputTokens } : void 0,
|
|
336
|
+
...reasoningTokens != null ? { reasoningTokens } : void 0,
|
|
337
|
+
...cachedInputTokens != null ? { cachedInputTokens } : void 0
|
|
338
|
+
} } : void 0,
|
|
344
339
|
...outputText != null ? { outputText } : void 0,
|
|
345
340
|
...metadata ? { metadata } : void 0,
|
|
346
341
|
...telemetrySteps ? { steps: telemetrySteps } : void 0,
|
|
347
342
|
...modelId ? { modelId } : void 0
|
|
348
343
|
};
|
|
349
344
|
}
|
|
350
|
-
function isToolCallPart(p) {
|
|
351
|
-
if (!p.toolCallId) return false;
|
|
352
|
-
if (p.type === "tool-call" || p.type === "dynamic-tool") return !!p.toolName;
|
|
353
|
-
return p.type.startsWith("tool-") || p.type.startsWith("dynamic-tool-");
|
|
354
|
-
}
|
|
355
|
-
function isDynamicToolPart(p) {
|
|
356
|
-
return p.type === "dynamic-tool" || p.type.startsWith("dynamic-tool-");
|
|
357
|
-
}
|
|
358
|
-
function partToToolCall(p) {
|
|
359
|
-
const toolSource = isDynamicToolPart(p) ? "mcp" : "frontend";
|
|
360
|
-
return createRunTelemetryToolCall({
|
|
361
|
-
toolName: p.toolName ?? p.type.slice(5),
|
|
362
|
-
toolCallId: p.toolCallId,
|
|
363
|
-
args: p.args ?? p.input,
|
|
364
|
-
result: p.result ?? p.output,
|
|
365
|
-
toolSource
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
function collectAiSdkV6Parts(parts) {
|
|
369
|
-
const textParts = [];
|
|
370
|
-
const toolCalls = [];
|
|
371
|
-
const stepsData = [];
|
|
372
|
-
let currentStepToolCalls = null;
|
|
373
|
-
for (const p of parts) if (p.type === "step-start") {
|
|
374
|
-
if (currentStepToolCalls !== null) stepsData.push({ tool_calls: currentStepToolCalls });
|
|
375
|
-
currentStepToolCalls = [];
|
|
376
|
-
} else if (p.type === "text" && p.text) textParts.push(p.text);
|
|
377
|
-
else if (isToolCallPart(p)) {
|
|
378
|
-
const tc = partToToolCall(p);
|
|
379
|
-
toolCalls.push(tc);
|
|
380
|
-
if (currentStepToolCalls !== null) currentStepToolCalls.push(tc);
|
|
381
|
-
}
|
|
382
|
-
if (currentStepToolCalls !== null) stepsData.push({ tool_calls: currentStepToolCalls });
|
|
383
|
-
return {
|
|
384
|
-
textParts,
|
|
385
|
-
toolCalls,
|
|
386
|
-
stepsData
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function buildAiSdkV6Result(textParts, toolCalls, totalSteps, metadata, stepsData, usage) {
|
|
390
|
-
const hasText = textParts.length > 0;
|
|
391
|
-
const outputText = hasText ? truncateRunTelemetryText(textParts.join("")) : void 0;
|
|
392
|
-
const modelId = extractRunTelemetryModelId(metadata);
|
|
393
|
-
const steps = stepsData && stepsData.length > 1 ? stepsData.map((s) => ({ ...s.tool_calls.length > 0 ? { tool_calls: s.tool_calls } : void 0 })) : void 0;
|
|
394
|
-
return {
|
|
395
|
-
status: hasText ? "completed" : "incomplete",
|
|
396
|
-
...toolCalls.length > 0 ? { toolCalls } : void 0,
|
|
397
|
-
...totalSteps > 0 ? { totalSteps } : void 0,
|
|
398
|
-
...usage?.inputTokens != null ? { inputTokens: usage.inputTokens } : void 0,
|
|
399
|
-
...usage?.outputTokens != null ? { outputTokens: usage.outputTokens } : void 0,
|
|
400
|
-
...usage?.reasoningTokens != null ? { reasoningTokens: usage.reasoningTokens } : void 0,
|
|
401
|
-
...usage?.cachedInputTokens != null ? { cachedInputTokens: usage.cachedInputTokens } : void 0,
|
|
402
|
-
...outputText != null ? { outputText } : void 0,
|
|
403
|
-
...metadata ? { metadata } : void 0,
|
|
404
|
-
...steps ? { steps } : void 0,
|
|
405
|
-
...modelId ? { modelId } : void 0
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
function extractAiSdkV6Usage(metadata) {
|
|
409
|
-
const usage = metadata?.usage;
|
|
410
|
-
if (usage) {
|
|
411
|
-
const normalized = normalizeRunTelemetryUsage(usage);
|
|
412
|
-
if (normalized) return normalized;
|
|
413
|
-
}
|
|
414
|
-
const steps = metadata?.steps;
|
|
415
|
-
if (steps && steps.length > 0) {
|
|
416
|
-
let inputTokens = 0;
|
|
417
|
-
let outputTokens = 0;
|
|
418
|
-
let reasoningTokens = 0;
|
|
419
|
-
let cachedInputTokens = 0;
|
|
420
|
-
let hasInput = false;
|
|
421
|
-
let hasOutput = false;
|
|
422
|
-
let hasReasoning = false;
|
|
423
|
-
let hasCachedInput = false;
|
|
424
|
-
let hasAny = false;
|
|
425
|
-
for (const s of steps) {
|
|
426
|
-
if (!s.usage) continue;
|
|
427
|
-
const n = normalizeRunTelemetryUsage(s.usage);
|
|
428
|
-
if (n) {
|
|
429
|
-
if (n.inputTokens != null) {
|
|
430
|
-
inputTokens += n.inputTokens;
|
|
431
|
-
hasInput = true;
|
|
432
|
-
}
|
|
433
|
-
if (n.outputTokens != null) {
|
|
434
|
-
outputTokens += n.outputTokens;
|
|
435
|
-
hasOutput = true;
|
|
436
|
-
}
|
|
437
|
-
if (n.reasoningTokens != null) {
|
|
438
|
-
reasoningTokens += n.reasoningTokens;
|
|
439
|
-
hasReasoning = true;
|
|
440
|
-
}
|
|
441
|
-
if (n.cachedInputTokens != null) {
|
|
442
|
-
cachedInputTokens += n.cachedInputTokens;
|
|
443
|
-
hasCachedInput = true;
|
|
444
|
-
}
|
|
445
|
-
hasAny = true;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
if (hasAny) return {
|
|
449
|
-
...hasInput ? { inputTokens } : void 0,
|
|
450
|
-
...hasOutput ? { outputTokens } : void 0,
|
|
451
|
-
...hasReasoning ? { reasoningTokens } : void 0,
|
|
452
|
-
...hasCachedInput ? { cachedInputTokens } : void 0
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
function extractAiSdkV6(content) {
|
|
457
|
-
const msg = content;
|
|
458
|
-
if (msg.role !== "assistant") return null;
|
|
459
|
-
const { textParts, toolCalls, stepsData } = collectAiSdkV6Parts(msg.parts ?? []);
|
|
460
|
-
return buildAiSdkV6Result(textParts, toolCalls, stepsData.length, msg.metadata, stepsData, extractAiSdkV6Usage(msg.metadata));
|
|
461
|
-
}
|
|
462
|
-
function aggregateAiSdkV6RunSteps(stepMessages) {
|
|
463
|
-
const allTextParts = [];
|
|
464
|
-
const allToolCalls = [];
|
|
465
|
-
const allStepsData = [];
|
|
466
|
-
let hasAssistant = false;
|
|
467
|
-
let metadata;
|
|
468
|
-
let inputTokens = 0;
|
|
469
|
-
let outputTokens = 0;
|
|
470
|
-
let reasoningTokens = 0;
|
|
471
|
-
let cachedInputTokens = 0;
|
|
472
|
-
let hasInput = false;
|
|
473
|
-
let hasOutput = false;
|
|
474
|
-
let hasReasoning = false;
|
|
475
|
-
let hasCachedInput = false;
|
|
476
|
-
for (const content of stepMessages) {
|
|
477
|
-
const msg = content;
|
|
478
|
-
if (msg.role !== "assistant") continue;
|
|
479
|
-
hasAssistant = true;
|
|
480
|
-
const { textParts, toolCalls, stepsData } = collectAiSdkV6Parts(msg.parts ?? []);
|
|
481
|
-
allTextParts.push(...textParts);
|
|
482
|
-
allToolCalls.push(...toolCalls);
|
|
483
|
-
allStepsData.push(...stepsData);
|
|
484
|
-
if (msg.metadata) metadata = msg.metadata;
|
|
485
|
-
const usage = extractAiSdkV6Usage(msg.metadata);
|
|
486
|
-
if (usage) {
|
|
487
|
-
if (usage.inputTokens != null) {
|
|
488
|
-
inputTokens += usage.inputTokens;
|
|
489
|
-
hasInput = true;
|
|
490
|
-
}
|
|
491
|
-
if (usage.outputTokens != null) {
|
|
492
|
-
outputTokens += usage.outputTokens;
|
|
493
|
-
hasOutput = true;
|
|
494
|
-
}
|
|
495
|
-
if (usage.reasoningTokens != null) {
|
|
496
|
-
reasoningTokens += usage.reasoningTokens;
|
|
497
|
-
hasReasoning = true;
|
|
498
|
-
}
|
|
499
|
-
if (usage.cachedInputTokens != null) {
|
|
500
|
-
cachedInputTokens += usage.cachedInputTokens;
|
|
501
|
-
hasCachedInput = true;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
if (!hasAssistant) return null;
|
|
506
|
-
return buildAiSdkV6Result(allTextParts, allToolCalls, allStepsData.length, metadata, allStepsData, {
|
|
507
|
-
...hasInput ? { inputTokens } : void 0,
|
|
508
|
-
...hasOutput ? { outputTokens } : void 0,
|
|
509
|
-
...hasReasoning ? { reasoningTokens } : void 0,
|
|
510
|
-
...hasCachedInput ? { cachedInputTokens } : void 0
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
345
|
function useAssistantCloudThreadHistoryAdapter(cloudRef) {
|
|
514
346
|
const aui = useAui();
|
|
515
347
|
const auiRef = useRef(aui);
|
|
@@ -517,7 +349,7 @@ function useAssistantCloudThreadHistoryAdapter(cloudRef) {
|
|
|
517
349
|
auiRef.current = aui;
|
|
518
350
|
});
|
|
519
351
|
const [adapter] = useState(() => new AssistantCloudThreadHistoryAdapter(cloudRef, () => auiRef.current));
|
|
520
|
-
useAssistantCloudEngagementEvents(
|
|
352
|
+
useAssistantCloudEngagementEvents(adapter, aui);
|
|
521
353
|
return adapter;
|
|
522
354
|
}
|
|
523
355
|
const rootEngagementTrackers = /* @__PURE__ */ new WeakMap();
|
|
@@ -526,38 +358,29 @@ const rootEngagementTrackers = /* @__PURE__ */ new WeakMap();
|
|
|
526
358
|
* client reports them; every thread runtime mounted under it shares the
|
|
527
359
|
* subscription and the last one to unmount removes it.
|
|
528
360
|
*/
|
|
529
|
-
const useRootEngagementEvents = (
|
|
530
|
-
const $ = c(
|
|
361
|
+
const useRootEngagementEvents = (adapter, aui) => {
|
|
362
|
+
const $ = c(6);
|
|
531
363
|
let t0;
|
|
532
|
-
|
|
533
|
-
if ($[0] !== adapter || $[1] !== aui || $[2] !== cloudRef) {
|
|
364
|
+
if ($[0] !== adapter.engagementReporter || $[1] !== aui) {
|
|
534
365
|
t0 = () => {
|
|
535
366
|
let tracker = rootEngagementTrackers.get(aui);
|
|
536
367
|
if (!tracker) {
|
|
537
368
|
const created = {
|
|
538
369
|
count: 0,
|
|
539
|
-
adapter,
|
|
540
|
-
cloudRef,
|
|
370
|
+
engagementReporter: adapter.engagementReporter,
|
|
541
371
|
dispose: _temp
|
|
542
372
|
};
|
|
543
373
|
created.dispose = aui.on({
|
|
544
374
|
scope: "*",
|
|
545
375
|
event: "threads.selectionChanged"
|
|
546
376
|
}, (payload) => {
|
|
547
|
-
created.
|
|
548
|
-
if (!ids.thread_id) return;
|
|
549
|
-
created.cloudRef.current.events?.track({
|
|
550
|
-
kind: "thread_switched",
|
|
551
|
-
...ids
|
|
552
|
-
});
|
|
553
|
-
}).catch(_temp2);
|
|
377
|
+
created.engagementReporter.threadSwitched(payload.threadId);
|
|
554
378
|
});
|
|
555
379
|
rootEngagementTrackers.set(aui, created);
|
|
556
380
|
tracker = created;
|
|
557
381
|
}
|
|
558
382
|
const active = tracker;
|
|
559
|
-
active.
|
|
560
|
-
active.cloudRef = cloudRef;
|
|
383
|
+
active.engagementReporter = adapter.engagementReporter;
|
|
561
384
|
active.count = active.count + 1;
|
|
562
385
|
return () => {
|
|
563
386
|
active.count = active.count - 1;
|
|
@@ -567,222 +390,173 @@ const useRootEngagementEvents = (cloudRef, adapter, aui) => {
|
|
|
567
390
|
}
|
|
568
391
|
};
|
|
569
392
|
};
|
|
570
|
-
|
|
571
|
-
adapter,
|
|
572
|
-
aui,
|
|
573
|
-
cloudRef
|
|
574
|
-
];
|
|
575
|
-
$[0] = adapter;
|
|
393
|
+
$[0] = adapter.engagementReporter;
|
|
576
394
|
$[1] = aui;
|
|
577
|
-
$[2] =
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
395
|
+
$[2] = t0;
|
|
396
|
+
} else t0 = $[2];
|
|
397
|
+
let t1;
|
|
398
|
+
if ($[3] !== adapter || $[4] !== aui) {
|
|
399
|
+
t1 = [adapter, aui];
|
|
400
|
+
$[3] = adapter;
|
|
401
|
+
$[4] = aui;
|
|
402
|
+
$[5] = t1;
|
|
403
|
+
} else t1 = $[5];
|
|
584
404
|
useEffect(t0, t1);
|
|
585
405
|
};
|
|
586
|
-
const useAssistantCloudEngagementEvents = (
|
|
587
|
-
const $ = c(
|
|
588
|
-
useRootEngagementEvents(
|
|
406
|
+
const useAssistantCloudEngagementEvents = (adapter, aui) => {
|
|
407
|
+
const $ = c(12);
|
|
408
|
+
useRootEngagementEvents(adapter, aui);
|
|
589
409
|
let t0;
|
|
590
|
-
if ($[0]
|
|
591
|
-
t0 =
|
|
592
|
-
|
|
593
|
-
} else t0 = $[0];
|
|
594
|
-
const runStartedAt = useRef(t0);
|
|
595
|
-
let t1;
|
|
596
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
597
|
-
t1 = /* @__PURE__ */ new Map();
|
|
598
|
-
$[1] = t1;
|
|
599
|
-
} else t1 = $[1];
|
|
600
|
-
const runEndedAt = useRef(t1);
|
|
601
|
-
let t2;
|
|
602
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
603
|
-
t2 = /* @__PURE__ */ new Set();
|
|
604
|
-
$[2] = t2;
|
|
605
|
-
} else t2 = $[2];
|
|
606
|
-
const shownSuggestions = useRef(t2);
|
|
607
|
-
let t3;
|
|
608
|
-
let t4;
|
|
609
|
-
if ($[3] !== adapter || $[4] !== aui || $[5] !== cloudRef) {
|
|
610
|
-
t3 = () => {
|
|
611
|
-
const track = (event, threadId, messageId, options) => {
|
|
612
|
-
adapter.resolveEngagementEventIds(threadId, messageId, options).then((ids) => {
|
|
613
|
-
cloudRef.current.events?.track({
|
|
614
|
-
...event,
|
|
615
|
-
...ids
|
|
616
|
-
});
|
|
617
|
-
}).catch(_temp3);
|
|
618
|
-
};
|
|
619
|
-
const trackRunStopped = (threadId_0) => {
|
|
620
|
-
const startedAt = runStartedAt.current.get(threadId_0);
|
|
621
|
-
if (startedAt === void 0) return;
|
|
622
|
-
runStartedAt.current.delete(threadId_0);
|
|
623
|
-
track({
|
|
624
|
-
kind: "run_stopped",
|
|
625
|
-
value: Math.max(0, Date.now() - startedAt)
|
|
626
|
-
}, threadId_0);
|
|
627
|
-
};
|
|
410
|
+
if ($[0] !== adapter.engagementReporter || $[1] !== aui) {
|
|
411
|
+
t0 = () => {
|
|
412
|
+
const reporter = adapter.engagementReporter;
|
|
628
413
|
const unsubscribers = [
|
|
629
414
|
aui.on({
|
|
630
415
|
scope: "thread",
|
|
631
416
|
event: "composer.send"
|
|
632
417
|
}, (payload) => {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
if (payload.suggestion) track({ kind: "suggestion_clicked" }, payload.threadId);
|
|
418
|
+
if (payload.messageId) reporter.messageEdited(payload.threadId, {
|
|
419
|
+
messageId: payload.messageId,
|
|
420
|
+
chars: payload.chars
|
|
421
|
+
});
|
|
422
|
+
else reporter.messageSent(payload.threadId, {
|
|
423
|
+
chars: payload.chars,
|
|
424
|
+
attachments: payload.attachments
|
|
425
|
+
});
|
|
426
|
+
if (payload.suggestion) reporter.suggestionClicked(payload.threadId);
|
|
643
427
|
}),
|
|
644
428
|
aui.on({
|
|
645
429
|
scope: "thread",
|
|
646
430
|
event: "composer.attachmentAdd"
|
|
647
431
|
}, (payload_0) => {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
432
|
+
reporter.attachmentAdded(payload_0.threadId, {
|
|
433
|
+
messageId: payload_0.messageId,
|
|
434
|
+
contentType: payload_0.contentType
|
|
435
|
+
});
|
|
652
436
|
}),
|
|
653
437
|
aui.on({
|
|
654
438
|
scope: "thread",
|
|
655
439
|
event: "composer.attachmentAddError"
|
|
656
440
|
}, (payload_1) => {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
}
|
|
441
|
+
reporter.attachmentFailed(payload_1.threadId, {
|
|
442
|
+
messageId: payload_1.messageId,
|
|
443
|
+
contentType: payload_1.contentType
|
|
444
|
+
});
|
|
661
445
|
}),
|
|
662
446
|
aui.on({
|
|
663
447
|
scope: "thread",
|
|
664
448
|
event: "composer.cancel"
|
|
665
449
|
}, (payload_2) => {
|
|
666
|
-
|
|
450
|
+
reporter.runStopped(payload_2.threadId);
|
|
667
451
|
}),
|
|
668
452
|
aui.on({
|
|
669
453
|
scope: "thread",
|
|
670
454
|
event: "thread.runStart"
|
|
671
455
|
}, (payload_3) => {
|
|
672
|
-
|
|
456
|
+
reporter.runStarted(payload_3.threadId);
|
|
673
457
|
}),
|
|
674
458
|
aui.on({
|
|
675
459
|
scope: "thread",
|
|
676
460
|
event: "thread.runEnd"
|
|
677
461
|
}, (payload_4) => {
|
|
678
|
-
|
|
679
|
-
runEndedAt.current.set(payload_4.threadId, Date.now());
|
|
462
|
+
reporter.runEnded(payload_4.threadId);
|
|
680
463
|
}),
|
|
681
464
|
aui.on({
|
|
682
465
|
scope: "thread",
|
|
683
466
|
event: "thread.cancelRun"
|
|
684
467
|
}, (payload_5) => {
|
|
685
|
-
|
|
468
|
+
reporter.runStopped(payload_5.threadId);
|
|
686
469
|
}),
|
|
687
470
|
aui.on({
|
|
688
471
|
scope: "thread",
|
|
689
472
|
event: "thread.voiceStarted"
|
|
690
473
|
}, (payload_6) => {
|
|
691
|
-
|
|
474
|
+
reporter.voiceStarted(payload_6.threadId);
|
|
692
475
|
}),
|
|
693
476
|
aui.on({
|
|
694
477
|
scope: "thread",
|
|
695
478
|
event: "message.reload"
|
|
696
479
|
}, (payload_7) => {
|
|
697
|
-
|
|
480
|
+
reporter.messageRegenerated(payload_7.threadId, payload_7.messageId);
|
|
698
481
|
}),
|
|
699
482
|
aui.on({
|
|
700
483
|
scope: "thread",
|
|
701
484
|
event: "message.branchSwitched"
|
|
702
485
|
}, (payload_8) => {
|
|
703
|
-
|
|
486
|
+
reporter.branchSwitched(payload_8.threadId, payload_8.messageId);
|
|
704
487
|
}),
|
|
705
488
|
aui.on({
|
|
706
489
|
scope: "thread",
|
|
707
490
|
event: "message.copied"
|
|
708
491
|
}, (payload_9) => {
|
|
709
|
-
|
|
492
|
+
reporter.messageCopied(payload_9.threadId, payload_9.messageId);
|
|
710
493
|
}),
|
|
711
494
|
aui.on({
|
|
712
495
|
scope: "thread",
|
|
713
|
-
event: "
|
|
496
|
+
event: "thread.toolApprovalAnswered"
|
|
714
497
|
}, (payload_10) => {
|
|
715
|
-
|
|
498
|
+
if (payload_10.approved) reporter.toolApproved(payload_10.threadId, payload_10.messageId, payload_10.toolCallId, payload_10.toolName);
|
|
499
|
+
else reporter.toolRejected(payload_10.threadId, payload_10.messageId, payload_10.toolCallId, payload_10.toolName);
|
|
716
500
|
}),
|
|
717
501
|
aui.on({
|
|
718
502
|
scope: "thread",
|
|
719
|
-
event: "message.
|
|
503
|
+
event: "message.speak"
|
|
720
504
|
}, (payload_11) => {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
505
|
+
reporter.speechStarted(payload_11.threadId, payload_11.messageId);
|
|
506
|
+
}),
|
|
507
|
+
aui.on({
|
|
508
|
+
scope: "thread",
|
|
509
|
+
event: "message.error"
|
|
510
|
+
}, (payload_12) => {
|
|
511
|
+
reporter.errorShown(payload_12.threadId, {
|
|
512
|
+
messageId: payload_12.messageId,
|
|
513
|
+
reason: payload_12.reason
|
|
514
|
+
});
|
|
725
515
|
})
|
|
726
516
|
];
|
|
727
517
|
return () => {
|
|
728
518
|
for (const unsubscribe of unsubscribers) unsubscribe();
|
|
729
519
|
};
|
|
730
520
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
521
|
+
$[0] = adapter.engagementReporter;
|
|
522
|
+
$[1] = aui;
|
|
523
|
+
$[2] = t0;
|
|
524
|
+
} else t0 = $[2];
|
|
525
|
+
let t1;
|
|
526
|
+
if ($[3] !== adapter || $[4] !== aui) {
|
|
527
|
+
t1 = [adapter, aui];
|
|
736
528
|
$[3] = adapter;
|
|
737
529
|
$[4] = aui;
|
|
738
|
-
$[5] =
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
}
|
|
745
|
-
useEffect(t3, t4);
|
|
746
|
-
let t5;
|
|
747
|
-
let t6;
|
|
748
|
-
if ($[8] !== adapter || $[9] !== aui || $[10] !== cloudRef) {
|
|
749
|
-
t5 = () => {
|
|
530
|
+
$[5] = t1;
|
|
531
|
+
} else t1 = $[5];
|
|
532
|
+
useEffect(t0, t1);
|
|
533
|
+
let t2;
|
|
534
|
+
if ($[6] !== adapter.engagementReporter || $[7] !== aui) {
|
|
535
|
+
t2 = () => {
|
|
750
536
|
const reportSuggestions = () => {
|
|
751
537
|
const { mainThreadId } = aui.threads.getState();
|
|
752
538
|
if (aui.threadListItem.getState().id !== mainThreadId) return;
|
|
753
539
|
const { isEmpty, suggestions } = aui.thread.getState();
|
|
754
|
-
if (!isEmpty || suggestions.length === 0
|
|
755
|
-
|
|
756
|
-
adapter.resolveEngagementEventIds(mainThreadId).then((ids_0) => {
|
|
757
|
-
cloudRef.current.events?.track({
|
|
758
|
-
kind: "suggestions_shown",
|
|
759
|
-
value: suggestions.length,
|
|
760
|
-
...ids_0
|
|
761
|
-
});
|
|
762
|
-
});
|
|
540
|
+
if (!isEmpty || suggestions.length === 0) return;
|
|
541
|
+
adapter.engagementReporter.suggestionsShown(mainThreadId, suggestions.length);
|
|
763
542
|
};
|
|
764
543
|
reportSuggestions();
|
|
765
544
|
return aui.subscribe(reportSuggestions);
|
|
766
545
|
};
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
$[
|
|
775
|
-
$[
|
|
776
|
-
$[
|
|
777
|
-
} else
|
|
778
|
-
|
|
779
|
-
t6 = $[12];
|
|
780
|
-
}
|
|
781
|
-
useEffect(t5, t6);
|
|
546
|
+
$[6] = adapter.engagementReporter;
|
|
547
|
+
$[7] = aui;
|
|
548
|
+
$[8] = t2;
|
|
549
|
+
} else t2 = $[8];
|
|
550
|
+
let t3;
|
|
551
|
+
if ($[9] !== adapter || $[10] !== aui) {
|
|
552
|
+
t3 = [adapter, aui];
|
|
553
|
+
$[9] = adapter;
|
|
554
|
+
$[10] = aui;
|
|
555
|
+
$[11] = t3;
|
|
556
|
+
} else t3 = $[11];
|
|
557
|
+
useEffect(t2, t3);
|
|
782
558
|
};
|
|
783
559
|
function _temp() {}
|
|
784
|
-
function _temp2() {}
|
|
785
|
-
function _temp3() {}
|
|
786
560
|
//#endregion
|
|
787
561
|
export { extractAuiV0, useAssistantCloudThreadHistoryAdapter };
|
|
788
562
|
|