@convai/web-sdk 1.9.0-beta.6 → 1.9.0
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/README.md +44 -13
- package/dist/core/AudioManager.d.ts +0 -1
- package/dist/core/AudioManager.js +0 -1
- package/dist/core/BlendshapeQueue.d.ts +0 -1
- package/dist/core/BlendshapeQueue.js +20 -6
- package/dist/core/CharacterRoster.d.ts +0 -1
- package/dist/core/CharacterRoster.js +0 -1
- package/dist/core/CharacterVersionManager.d.ts +0 -1
- package/dist/core/CharacterVersionManager.js +0 -1
- package/dist/core/ConnectionStateHandler.d.ts +0 -1
- package/dist/core/ConnectionStateHandler.js +5 -2
- package/dist/core/ConvaiClient.d.ts +31 -3
- package/dist/core/ConvaiClient.js +136 -14
- package/dist/core/ConvaiRoomError.d.ts +0 -1
- package/dist/core/ConvaiRoomError.js +20 -2
- package/dist/core/EventEmitter.d.ts +0 -1
- package/dist/core/EventEmitter.js +0 -1
- package/dist/core/MemoryManager.d.ts +0 -1
- package/dist/core/MemoryManager.js +0 -1
- package/dist/core/MessageHandler.d.ts +0 -1
- package/dist/core/MessageHandler.js +41 -10
- package/dist/core/SSESession.d.ts +0 -1
- package/dist/core/SSESession.js +0 -1
- package/dist/core/ScreenShareManager.d.ts +0 -1
- package/dist/core/ScreenShareManager.js +0 -1
- package/dist/core/VideoManager.d.ts +0 -1
- package/dist/core/VideoManager.js +0 -1
- package/dist/core/characterInfo.d.ts +45 -0
- package/dist/core/characterInfo.js +55 -0
- package/dist/core/characterReference.d.ts +0 -1
- package/dist/core/characterReference.js +0 -1
- package/dist/core/connectRequest.d.ts +0 -1
- package/dist/core/connectRequest.js +0 -1
- package/dist/core/contextUpdateRequest.d.ts +0 -1
- package/dist/core/contextUpdateRequest.js +0 -1
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.js +20 -3
- package/dist/core/logicalTurn.d.ts +0 -1
- package/dist/core/logicalTurn.js +0 -1
- package/dist/core/modelOutput.d.ts +0 -1
- package/dist/core/modelOutput.js +0 -1
- package/dist/core/publishedChat.d.ts +0 -1
- package/dist/core/publishedChat.js +0 -1
- package/dist/core/rosterRequest.d.ts +0 -1
- package/dist/core/rosterRequest.js +0 -1
- package/dist/core/rtviEnvelope.d.ts +0 -1
- package/dist/core/rtviEnvelope.js +0 -1
- package/dist/core/types.d.ts +112 -10
- package/dist/core/types.js +0 -1
- package/dist/core/videoSourceState.d.ts +0 -1
- package/dist/core/videoSourceState.js +0 -1
- package/dist/core/visionRequest.d.ts +0 -1
- package/dist/core/visionRequest.js +0 -1
- package/dist/embed/index.d.ts +11 -1
- package/dist/embed/index.js +11 -1
- package/dist/embed/publicationApi.d.ts +0 -1
- package/dist/embed/publicationApi.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/lipsync-helpers/arkitOrder61.d.ts +0 -1
- package/dist/lipsync-helpers/arkitOrder61.js +5 -3
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts +0 -1
- package/dist/lipsync-helpers/createBlendshapeQueue.js +7 -1
- package/dist/lipsync-helpers/declarativeMapping.d.ts +2 -1
- package/dist/lipsync-helpers/declarativeMapping.js +72 -146
- package/dist/lipsync-helpers/index.d.ts +0 -1
- package/dist/lipsync-helpers/index.js +0 -1
- package/dist/lipsync-helpers/mappingTypes.d.ts +6 -5
- package/dist/lipsync-helpers/mappingTypes.js +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.d.ts +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.js +8 -9
- package/dist/lipsync-helpers/mhaLimitDrivers.d.ts +0 -1
- package/dist/lipsync-helpers/mhaLimitDrivers.js +0 -1
- package/dist/lipsync-helpers/naturalness/processor.d.ts +0 -1
- package/dist/lipsync-helpers/naturalness/processor.js +6 -4
- package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts +0 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.js +0 -1
- package/dist/lipsync-helpers/naturalness/types.d.ts +0 -1
- package/dist/lipsync-helpers/naturalness/types.js +0 -1
- package/dist/lipsync-helpers/presetMappers.d.ts +0 -1
- package/dist/lipsync-helpers/presetMappers.js +0 -1
- package/dist/react/components/ConvaiWidget.d.ts +0 -1
- package/dist/react/components/ConvaiWidget.js +16 -8
- package/dist/react/components/index.d.ts +0 -1
- package/dist/react/components/index.js +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.js +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +0 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.js +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.js +0 -1
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/SiteCard.js +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.js +0 -1
- package/dist/react/components/rtc-widget/components/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/index.js +0 -1
- package/dist/react/components/rtc-widget/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/index.js +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.js +0 -1
- package/dist/react/components/rtc-widget/styles/icons.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/icons.js +0 -1
- package/dist/react/components/rtc-widget/styles/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/index.js +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.js +0 -1
- package/dist/react/components/rtc-widget/styles/theme.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/theme.js +0 -1
- package/dist/react/components/rtc-widget/types/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/types/index.js +0 -1
- package/dist/react/hooks/index.d.ts +0 -1
- package/dist/react/hooks/index.js +0 -1
- package/dist/react/hooks/useCharacterInfo.d.ts +12 -11
- package/dist/react/hooks/useCharacterInfo.js +49 -50
- package/dist/react/hooks/useConvaiClient.d.ts +0 -1
- package/dist/react/hooks/useConvaiClient.js +6 -5
- package/dist/react/hooks/useLocalCameraTrack.d.ts +0 -1
- package/dist/react/hooks/useLocalCameraTrack.js +0 -1
- package/dist/react/icons.d.ts +0 -1
- package/dist/react/icons.js +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +0 -1
- package/dist/utils/inlineMarkdown.d.ts +0 -1
- package/dist/utils/inlineMarkdown.js +0 -1
- package/dist/utils/lightbox.d.ts +0 -1
- package/dist/utils/lightbox.js +0 -1
- package/dist/utils/linkPresentation.d.ts +0 -1
- package/dist/utils/linkPresentation.js +0 -1
- package/dist/utils/linkPreview.d.ts +0 -1
- package/dist/utils/linkPreview.js +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/vanilla/AudioRenderer.d.ts +0 -1
- package/dist/vanilla/AudioRenderer.js +0 -1
- package/dist/vanilla/ConvaiWidget.d.ts +0 -1
- package/dist/vanilla/ConvaiWidget.js +18 -30
- package/dist/vanilla/WebSocketSession.d.ts +0 -1
- package/dist/vanilla/WebSocketSession.js +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.d.ts +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.js +0 -1
- package/dist/vanilla/icons.d.ts +0 -1
- package/dist/vanilla/icons.js +0 -1
- package/dist/vanilla/index.d.ts +0 -1
- package/dist/vanilla/index.js +0 -1
- package/dist/vanilla/styles.d.ts +0 -1
- package/dist/vanilla/styles.js +0 -1
- package/dist/vanilla/types.d.ts +0 -1
- package/dist/vanilla/types.js +0 -1
- package/dist/vanilla/websocket.d.ts +0 -1
- package/dist/vanilla/websocket.js +0 -1
- package/dist/version.d.ts +1 -2
- package/dist/version.js +1 -2
- package/package.json +4 -4
- package/dist/core/AudioManager.d.ts.map +0 -1
- package/dist/core/AudioManager.js.map +0 -1
- package/dist/core/BlendshapeQueue.d.ts.map +0 -1
- package/dist/core/BlendshapeQueue.js.map +0 -1
- package/dist/core/CharacterRoster.d.ts.map +0 -1
- package/dist/core/CharacterRoster.js.map +0 -1
- package/dist/core/CharacterVersionManager.d.ts.map +0 -1
- package/dist/core/CharacterVersionManager.js.map +0 -1
- package/dist/core/ConnectionStateHandler.d.ts.map +0 -1
- package/dist/core/ConnectionStateHandler.js.map +0 -1
- package/dist/core/ConvaiClient.d.ts.map +0 -1
- package/dist/core/ConvaiClient.js.map +0 -1
- package/dist/core/ConvaiRoomError.d.ts.map +0 -1
- package/dist/core/ConvaiRoomError.js.map +0 -1
- package/dist/core/EventEmitter.d.ts.map +0 -1
- package/dist/core/EventEmitter.js.map +0 -1
- package/dist/core/MemoryManager.d.ts.map +0 -1
- package/dist/core/MemoryManager.js.map +0 -1
- package/dist/core/MessageHandler.d.ts.map +0 -1
- package/dist/core/MessageHandler.js.map +0 -1
- package/dist/core/SSESession.d.ts.map +0 -1
- package/dist/core/SSESession.js.map +0 -1
- package/dist/core/ScreenShareManager.d.ts.map +0 -1
- package/dist/core/ScreenShareManager.js.map +0 -1
- package/dist/core/VideoManager.d.ts.map +0 -1
- package/dist/core/VideoManager.js.map +0 -1
- package/dist/core/characterReference.d.ts.map +0 -1
- package/dist/core/characterReference.js.map +0 -1
- package/dist/core/connectRequest.d.ts.map +0 -1
- package/dist/core/connectRequest.js.map +0 -1
- package/dist/core/contextUpdateRequest.d.ts.map +0 -1
- package/dist/core/contextUpdateRequest.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/logicalTurn.d.ts.map +0 -1
- package/dist/core/logicalTurn.js.map +0 -1
- package/dist/core/modelOutput.d.ts.map +0 -1
- package/dist/core/modelOutput.js.map +0 -1
- package/dist/core/publishedChat.d.ts.map +0 -1
- package/dist/core/publishedChat.js.map +0 -1
- package/dist/core/rosterRequest.d.ts.map +0 -1
- package/dist/core/rosterRequest.js.map +0 -1
- package/dist/core/rtviEnvelope.d.ts.map +0 -1
- package/dist/core/rtviEnvelope.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/core/videoSourceState.d.ts.map +0 -1
- package/dist/core/videoSourceState.js.map +0 -1
- package/dist/core/visionRequest.d.ts.map +0 -1
- package/dist/core/visionRequest.js.map +0 -1
- package/dist/embed/index.d.ts.map +0 -1
- package/dist/embed/index.js.map +0 -1
- package/dist/embed/publicationApi.d.ts.map +0 -1
- package/dist/embed/publicationApi.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lipsync-helpers/arkitOrder61.d.ts.map +0 -1
- package/dist/lipsync-helpers/arkitOrder61.js.map +0 -1
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts.map +0 -1
- package/dist/lipsync-helpers/createBlendshapeQueue.js.map +0 -1
- package/dist/lipsync-helpers/declarativeMapping.d.ts.map +0 -1
- package/dist/lipsync-helpers/declarativeMapping.js.map +0 -1
- package/dist/lipsync-helpers/index.d.ts.map +0 -1
- package/dist/lipsync-helpers/index.js.map +0 -1
- package/dist/lipsync-helpers/mappingTypes.d.ts.map +0 -1
- package/dist/lipsync-helpers/mappingTypes.js.map +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.d.ts.map +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.js.map +0 -1
- package/dist/lipsync-helpers/mhaLimitDrivers.d.ts.map +0 -1
- package/dist/lipsync-helpers/mhaLimitDrivers.js.map +0 -1
- package/dist/lipsync-helpers/naturalness/processor.d.ts.map +0 -1
- package/dist/lipsync-helpers/naturalness/processor.js.map +0 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts.map +0 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.js.map +0 -1
- package/dist/lipsync-helpers/naturalness/types.d.ts.map +0 -1
- package/dist/lipsync-helpers/naturalness/types.js.map +0 -1
- package/dist/lipsync-helpers/presetMappers.d.ts.map +0 -1
- package/dist/lipsync-helpers/presetMappers.js.map +0 -1
- package/dist/react/components/ConvaiWidget.d.ts.map +0 -1
- package/dist/react/components/ConvaiWidget.js.map +0 -1
- package/dist/react/components/index.d.ts.map +0 -1
- package/dist/react/components/index.js.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js.map +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.js.map +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js.map +0 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.js.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.js.map +0 -1
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/SiteCard.js.map +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.js.map +0 -1
- package/dist/react/components/rtc-widget/components/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/index.js.map +0 -1
- package/dist/react/components/rtc-widget/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/index.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/icons.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/icons.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/index.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/theme.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/theme.js.map +0 -1
- package/dist/react/components/rtc-widget/types/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/types/index.js.map +0 -1
- package/dist/react/hooks/index.d.ts.map +0 -1
- package/dist/react/hooks/index.js.map +0 -1
- package/dist/react/hooks/useCharacterInfo.d.ts.map +0 -1
- package/dist/react/hooks/useCharacterInfo.js.map +0 -1
- package/dist/react/hooks/useConvaiClient.d.ts.map +0 -1
- package/dist/react/hooks/useConvaiClient.js.map +0 -1
- package/dist/react/hooks/useLocalCameraTrack.d.ts.map +0 -1
- package/dist/react/hooks/useLocalCameraTrack.js.map +0 -1
- package/dist/react/icons.d.ts.map +0 -1
- package/dist/react/icons.js.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js.map +0 -1
- package/dist/utils/inlineMarkdown.d.ts.map +0 -1
- package/dist/utils/inlineMarkdown.js.map +0 -1
- package/dist/utils/lightbox.d.ts.map +0 -1
- package/dist/utils/lightbox.js.map +0 -1
- package/dist/utils/linkPresentation.d.ts.map +0 -1
- package/dist/utils/linkPresentation.js.map +0 -1
- package/dist/utils/linkPreview.d.ts.map +0 -1
- package/dist/utils/linkPreview.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/vanilla/AudioRenderer.d.ts.map +0 -1
- package/dist/vanilla/AudioRenderer.js.map +0 -1
- package/dist/vanilla/ConvaiWidget.d.ts.map +0 -1
- package/dist/vanilla/ConvaiWidget.js.map +0 -1
- package/dist/vanilla/WebSocketSession.d.ts.map +0 -1
- package/dist/vanilla/WebSocketSession.js.map +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.d.ts.map +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.js.map +0 -1
- package/dist/vanilla/icons.d.ts.map +0 -1
- package/dist/vanilla/icons.js.map +0 -1
- package/dist/vanilla/index.d.ts.map +0 -1
- package/dist/vanilla/index.js.map +0 -1
- package/dist/vanilla/styles.d.ts.map +0 -1
- package/dist/vanilla/styles.js.map +0 -1
- package/dist/vanilla/types.d.ts.map +0 -1
- package/dist/vanilla/types.js.map +0 -1
- package/dist/vanilla/websocket.d.ts.map +0 -1
- package/dist/vanilla/websocket.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
|
@@ -695,6 +695,13 @@ export class MessageHandler extends EventEmitter {
|
|
|
695
695
|
if (messageData.data) {
|
|
696
696
|
const serverData = messageData.data;
|
|
697
697
|
switch (serverData.type) {
|
|
698
|
+
// How production delivers usage: wrapped in a server-message,
|
|
699
|
+
// the record's fields beside `type`. Strip the envelope's type.
|
|
700
|
+
case "usage-update": {
|
|
701
|
+
const { type: _envelope, ...usage } = serverData;
|
|
702
|
+
this.emit("usageUpdate", usage);
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
698
705
|
case "bot-llm-text-raw":
|
|
699
706
|
this._handleBotLlmTextRaw(serverData.data ?? serverData);
|
|
700
707
|
break;
|
|
@@ -912,9 +919,15 @@ export class MessageHandler extends EventEmitter {
|
|
|
912
919
|
this.emit("messagesChange", this.chatMessages);
|
|
913
920
|
}
|
|
914
921
|
_handleServerResponse(envelope, request) {
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
922
|
+
// `data` is the response only when it is one — when it carries its own
|
|
923
|
+
// event_type. A roster ack carries event_type and extras *and* a `data`
|
|
924
|
+
// object that is the member it switched to; reading that as the response
|
|
925
|
+
// emitted { event_type: "unknown", status: "error" }, so every
|
|
926
|
+
// setInteractionTarget() timed out though Core had succeeded.
|
|
927
|
+
const nested = envelope.data;
|
|
928
|
+
const response = nested !== null && typeof nested === "object" && !Array.isArray(nested)
|
|
929
|
+
&& (typeof nested.event_type === "string" || envelope.event_type === undefined)
|
|
930
|
+
? nested
|
|
918
931
|
: envelope;
|
|
919
932
|
// client-ready is an internal RTVI handshake whose rejection is harmless.
|
|
920
933
|
if (response.event_type === "client-ready")
|
|
@@ -1074,6 +1087,19 @@ export class MessageHandler extends EventEmitter {
|
|
|
1074
1087
|
* Reset message state
|
|
1075
1088
|
*/
|
|
1076
1089
|
reset() {
|
|
1090
|
+
// A disconnect resets three times (the Disconnected state change,
|
|
1091
|
+
// handleDisconnected, resetConnectionState). Emitting unconditionally made
|
|
1092
|
+
// every one a fresh speakingChange(false) — which the client turns into a
|
|
1093
|
+
// turnEnd — so each disconnect after a conversation fired three phantom
|
|
1094
|
+
// turns. Emit only what actually changed.
|
|
1095
|
+
const had = {
|
|
1096
|
+
messages: this.chatMessages.length > 0,
|
|
1097
|
+
transcription: this.userTranscription !== "",
|
|
1098
|
+
responding: this.isBotResponding,
|
|
1099
|
+
speaking: this.isSpeaking,
|
|
1100
|
+
listening: this.isListening,
|
|
1101
|
+
emotion: this._currentEmotion !== null,
|
|
1102
|
+
};
|
|
1077
1103
|
this.chatMessages = [];
|
|
1078
1104
|
this.activeBotLlmMessageId = null;
|
|
1079
1105
|
this.userTranscription = "";
|
|
@@ -1085,12 +1111,17 @@ export class MessageHandler extends EventEmitter {
|
|
|
1085
1111
|
this.seenBotOutputSegments.clear();
|
|
1086
1112
|
this._clearModelOutputReplayLedger();
|
|
1087
1113
|
this.blendshapeQueue.reset();
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1114
|
+
if (had.messages)
|
|
1115
|
+
this.emit("messagesChange", this.chatMessages);
|
|
1116
|
+
if (had.transcription)
|
|
1117
|
+
this.emit("userTranscriptionChange", "");
|
|
1118
|
+
if (had.responding)
|
|
1119
|
+
this.emit("botRespondingChange", false);
|
|
1120
|
+
if (had.speaking)
|
|
1121
|
+
this.emit("speakingChange", false);
|
|
1122
|
+
if (had.listening)
|
|
1123
|
+
this.emit("listeningChange", false);
|
|
1124
|
+
if (had.emotion)
|
|
1125
|
+
this.emit("emotionChange", null);
|
|
1094
1126
|
}
|
|
1095
1127
|
}
|
|
1096
|
-
//# sourceMappingURL=MessageHandler.js.map
|
package/dist/core/SSESession.js
CHANGED
|
@@ -724,4 +724,3 @@ function withSseRequestErrorContext(error, messages, workspaceRequest = false) {
|
|
|
724
724
|
// failures. Personal primitive payloads keep their preexisting value/type.
|
|
725
725
|
return workspaceRequest ? { error, ...context } : error;
|
|
726
726
|
}
|
|
727
|
-
//# sourceMappingURL=SSESession.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat widget's character name and avatar lookup.
|
|
3
|
+
*
|
|
4
|
+
* One copy, because there were two: `useCharacterInfo` and the vanilla
|
|
5
|
+
* widget's inline version, the latter carrying the comment "matches React
|
|
6
|
+
* useCharacterInfo hook" — a sync kept by hand, which is how they came to
|
|
7
|
+
* share a hardcoded host nobody could override.
|
|
8
|
+
*
|
|
9
|
+
* This is cosmetic. The result decorates the widget header and nothing else:
|
|
10
|
+
* no connection, credential or message depends on it, so a failure degrades
|
|
11
|
+
* to the fallback name and no image rather than breaking the chat.
|
|
12
|
+
*/
|
|
13
|
+
/** Origin that serves `POST /character/get`. Not `api2.convai.com`, which does not. */
|
|
14
|
+
export declare const DEFAULT_CHARACTER_INFO_URL = "https://api.convai.com";
|
|
15
|
+
/** The two fields the widget header reads. */
|
|
16
|
+
export interface CharacterInfo {
|
|
17
|
+
name: string;
|
|
18
|
+
image: string | null;
|
|
19
|
+
}
|
|
20
|
+
/** Shown when the character has no name of its own, or the lookup fails. */
|
|
21
|
+
export declare const FALLBACK_CHARACTER_NAME = "Convi";
|
|
22
|
+
export interface FetchCharacterInfoOptions {
|
|
23
|
+
characterId: string;
|
|
24
|
+
/** Sent as `X-API-Key`. Ignored when `authToken` is present. */
|
|
25
|
+
apiKey?: string | null;
|
|
26
|
+
/** Sent as `API-AUTH-TOKEN`, and preferred over `apiKey`. */
|
|
27
|
+
authToken?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Origin to ask, for a deployment that is not Convai's SaaS. Defaults to
|
|
30
|
+
* {@link DEFAULT_CHARACTER_INFO_URL}. An on-prem deployment must set this,
|
|
31
|
+
* or the lookup leaves its network — carrying the API key with it.
|
|
32
|
+
*/
|
|
33
|
+
baseUrl?: string | null;
|
|
34
|
+
/** Lets a caller abort in flight; the widget drops it on unmount. */
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}
|
|
37
|
+
/** Pick the name and avatar out of a `/character/get` body, with the widget's fallbacks. */
|
|
38
|
+
export declare function readCharacterInfo(data: unknown): CharacterInfo;
|
|
39
|
+
/**
|
|
40
|
+
* Fetch a character's display name and avatar.
|
|
41
|
+
*
|
|
42
|
+
* Throws on a non-OK response so a caller can report it; callers that only
|
|
43
|
+
* decorate a header should catch and keep the fallback.
|
|
44
|
+
*/
|
|
45
|
+
export declare function fetchCharacterInfo(options: FetchCharacterInfoOptions): Promise<CharacterInfo>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat widget's character name and avatar lookup.
|
|
3
|
+
*
|
|
4
|
+
* One copy, because there were two: `useCharacterInfo` and the vanilla
|
|
5
|
+
* widget's inline version, the latter carrying the comment "matches React
|
|
6
|
+
* useCharacterInfo hook" — a sync kept by hand, which is how they came to
|
|
7
|
+
* share a hardcoded host nobody could override.
|
|
8
|
+
*
|
|
9
|
+
* This is cosmetic. The result decorates the widget header and nothing else:
|
|
10
|
+
* no connection, credential or message depends on it, so a failure degrades
|
|
11
|
+
* to the fallback name and no image rather than breaking the chat.
|
|
12
|
+
*/
|
|
13
|
+
/** Origin that serves `POST /character/get`. Not `api2.convai.com`, which does not. */
|
|
14
|
+
export const DEFAULT_CHARACTER_INFO_URL = "https://api.convai.com";
|
|
15
|
+
/** Shown when the character has no name of its own, or the lookup fails. */
|
|
16
|
+
export const FALLBACK_CHARACTER_NAME = "Convi";
|
|
17
|
+
/** Pick the name and avatar out of a `/character/get` body, with the widget's fallbacks. */
|
|
18
|
+
export function readCharacterInfo(data) {
|
|
19
|
+
const body = (data ?? {});
|
|
20
|
+
const str = (v) => typeof v === "string" && v.length > 0 ? v : null;
|
|
21
|
+
const details = body.model_details;
|
|
22
|
+
return {
|
|
23
|
+
name: str(body.character_name) ?? FALLBACK_CHARACTER_NAME,
|
|
24
|
+
image: str(details?.METAHUMAN?.avatar_image_square) ??
|
|
25
|
+
str(details?.METAHUMAN?.avatar_image) ??
|
|
26
|
+
str(details?.modelPlaceholder),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a character's display name and avatar.
|
|
31
|
+
*
|
|
32
|
+
* Throws on a non-OK response so a caller can report it; callers that only
|
|
33
|
+
* decorate a header should catch and keep the fallback.
|
|
34
|
+
*/
|
|
35
|
+
export async function fetchCharacterInfo(options) {
|
|
36
|
+
const { characterId, apiKey, authToken, baseUrl, signal } = options;
|
|
37
|
+
const headers = {
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
};
|
|
40
|
+
if (authToken)
|
|
41
|
+
headers["API-AUTH-TOKEN"] = authToken;
|
|
42
|
+
else if (apiKey)
|
|
43
|
+
headers["X-API-Key"] = apiKey;
|
|
44
|
+
const origin = (baseUrl || DEFAULT_CHARACTER_INFO_URL).replace(/\/+$/, "");
|
|
45
|
+
const response = await fetch(`${origin}/character/get`, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers,
|
|
48
|
+
body: JSON.stringify({ charID: characterId }),
|
|
49
|
+
signal,
|
|
50
|
+
});
|
|
51
|
+
if (!response.ok) {
|
|
52
|
+
throw new Error(`Failed to fetch character info: ${response.status}`);
|
|
53
|
+
}
|
|
54
|
+
return readCharacterInfo(await response.json());
|
|
55
|
+
}
|
|
@@ -37,4 +37,3 @@ export declare function parseCharacterReference(value: string): CharacterReferen
|
|
|
37
37
|
export declare function resolveCharacterReference(characterId: string, characterVersion?: CharacterVersionSelector | null): CharacterReference;
|
|
38
38
|
/** True when `value` is a bare character UUID. */
|
|
39
39
|
export declare function isCharacterUuid(value: string): boolean;
|
|
40
|
-
//# sourceMappingURL=characterReference.d.ts.map
|
|
@@ -57,4 +57,3 @@ export interface ActionConnectRequestConfig {
|
|
|
57
57
|
tools?: ClientToolConnectRequestDeclaration[];
|
|
58
58
|
}
|
|
59
59
|
export declare function buildActionConnectConfig(config: Pick<ConvaiConfig, "actionConfig">): ActionConnectRequestConfig | undefined;
|
|
60
|
-
//# sourceMappingURL=connectRequest.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ContextUpdateOptions, RespondMode } from "./types.js";
|
|
2
2
|
export declare function shouldPreemptForContextUpdateResponse(options: Pick<ContextUpdateOptions, "run_llm" | "respond_mode">): boolean;
|
|
3
3
|
export declare function shouldPreemptForExplicitRespondMode(respondMode: RespondMode | undefined): boolean;
|
|
4
|
-
//# sourceMappingURL=contextUpdateRequest.d.ts.map
|
package/dist/core/index.d.ts
CHANGED
|
@@ -15,12 +15,13 @@ export { parseCharacterReference, resolveCharacterReference, isCharacterVersionS
|
|
|
15
15
|
export { BlendshapeQueue } from './BlendshapeQueue.js';
|
|
16
16
|
export type { TurnStats, BlendshapeChunkMetadata } from './BlendshapeQueue.js';
|
|
17
17
|
export { EventEmitter } from './EventEmitter.js';
|
|
18
|
+
export { fetchCharacterInfo, readCharacterInfo, DEFAULT_CHARACTER_INFO_URL, FALLBACK_CHARACTER_NAME, } from './characterInfo.js';
|
|
19
|
+
export type { CharacterInfo, FetchCharacterInfoOptions } from './characterInfo.js';
|
|
18
20
|
export { parseInlineMarkdown, mediaKindForUrl, isSafeHref, compactUrl } from '../utils/inlineMarkdown.js';
|
|
19
21
|
export type { InlineNode, MediaKind } from '../utils/inlineMarkdown.js';
|
|
20
|
-
export { linkKindForUrl, describeUrl } from '../utils/linkPresentation.js';
|
|
22
|
+
export { linkKindForUrl, describeUrl, fileNameOf, documentBadge, contactLabel, hoverTitle, isMixedContent, } from '../utils/linkPresentation.js';
|
|
21
23
|
export type { LinkKind } from '../utils/linkPresentation.js';
|
|
22
|
-
export { resolveLinkPreviewCached, isCardWorthy, LINK_PREVIEW_TIMEOUT_MS } from '../utils/linkPreview.js';
|
|
24
|
+
export { resolveLinkPreviewCached, isCardWorthy, LINK_PREVIEW_TIMEOUT_MS, safeHttpUrl, siteNameFor, faviconFor, resetLinkPreviewCache, } from '../utils/linkPreview.js';
|
|
23
25
|
export type { LinkPreviewMeta, LinkPreviewResolver } from '../utils/linkPreview.js';
|
|
24
26
|
export { ModelOutputExtensionRegistry, isJsonObject, isJsonValue, parseModelOutputMessage, } from './modelOutput.js';
|
|
25
27
|
export type { ExtensionRenderResult, ModelOutputExtensionRenderer, } from './modelOutput.js';
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.js
CHANGED
|
@@ -20,13 +20,30 @@ export { parseCharacterReference, resolveCharacterReference, isCharacterVersionS
|
|
|
20
20
|
export { BlendshapeQueue } from './BlendshapeQueue.js';
|
|
21
21
|
// Event Emitter (for advanced usage)
|
|
22
22
|
export { EventEmitter } from './EventEmitter.js';
|
|
23
|
+
// The widget header's character name/avatar lookup. Public so any UI —
|
|
24
|
+
// including @convai/web-widget once the chat UI moves there, and anyone
|
|
25
|
+
// building their own — reuses the one implementation and honours
|
|
26
|
+
// `characterInfoUrl`, rather than hardcoding a host the way two hand-synced
|
|
27
|
+
// copies used to.
|
|
28
|
+
export { fetchCharacterInfo, readCharacterInfo, DEFAULT_CHARACTER_INFO_URL, FALLBACK_CHARACTER_NAME, } from './characterInfo.js';
|
|
23
29
|
// Inline markdown tokenizer. `bot-llm-text` arrives as a plain string, so a
|
|
24
30
|
// custom chat UI — anything not using ConvaiWidget — needs this to turn one
|
|
25
31
|
// line of it into links, images and bare URLs. Only the scheme allowlist in
|
|
26
32
|
// `isSafeHref` becomes a link, so a renderer built on these nodes cannot emit
|
|
27
33
|
// a javascript: href however the server framed it.
|
|
28
34
|
export { parseInlineMarkdown, mediaKindForUrl, isSafeHref, compactUrl } from '../utils/inlineMarkdown.js';
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
// Pure functions for labelling a link: URL in, string out. Public so a UI
|
|
36
|
+
// rendering links — the bundled widgets, @convai/web-widget, or your own —
|
|
37
|
+
// derives the same file name, badge, contact label and hover text. The
|
|
38
|
+
// styling half of that module (glyph SVGs, CSS objects, card-count policy) is
|
|
39
|
+
// rendering, and stays with the UI.
|
|
40
|
+
export { linkKindForUrl, describeUrl, fileNameOf, documentBadge, contactLabel, hoverTitle, isMixedContent, } from '../utils/linkPresentation.js';
|
|
41
|
+
// `safeHttpUrl` is a sanitiser — http and https only — and a sanitiser should
|
|
42
|
+
// have exactly one implementation, so it is public rather than re-derived by
|
|
43
|
+
// each UI that renders a preview's favicon.
|
|
44
|
+
export { resolveLinkPreviewCached, isCardWorthy, LINK_PREVIEW_TIMEOUT_MS, safeHttpUrl, siteNameFor, faviconFor,
|
|
45
|
+
// The preview cache is module-level and shared by every card on the page,
|
|
46
|
+
// so a consumer had no way to drop it — on sign-out, say, or between tests
|
|
47
|
+
// of a UI that lives outside this package and so cannot reach it by path.
|
|
48
|
+
resetLinkPreviewCache, } from '../utils/linkPreview.js';
|
|
31
49
|
export { ModelOutputExtensionRegistry, isJsonObject, isJsonValue, parseModelOutputMessage, } from './modelOutput.js';
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -5,4 +5,3 @@ export declare const OUTPUT_ID_MAX_UTF8_BYTES = 128;
|
|
|
5
5
|
export declare function isValidLogicalTurnId(value: unknown): value is string;
|
|
6
6
|
/** Return whether a Core model invocation id is safe to retain and expose. */
|
|
7
7
|
export declare function isValidOutputId(value: unknown): value is string;
|
|
8
|
-
//# sourceMappingURL=logicalTurn.d.ts.map
|
package/dist/core/logicalTurn.js
CHANGED
package/dist/core/modelOutput.js
CHANGED
|
@@ -6,4 +6,3 @@ import type { PublishedChatConnectOptions } from "./types.js";
|
|
|
6
6
|
* omit any caller-supplied id at this higher-level session boundary.
|
|
7
7
|
*/
|
|
8
8
|
export declare function freshPublicationGrantOptions(options?: PublishedChatConnectOptions): PublishedChatConnectOptions | undefined;
|
|
9
|
-
//# sourceMappingURL=publishedChat.d.ts.map
|
package/dist/core/types.d.ts
CHANGED
|
@@ -120,6 +120,10 @@ export interface ServerResponseExtras {
|
|
|
120
120
|
content?: string;
|
|
121
121
|
enabled?: boolean;
|
|
122
122
|
muted?: boolean;
|
|
123
|
+
/** Whether the server applied the state of mind; false for an unknown value. */
|
|
124
|
+
applied?: boolean;
|
|
125
|
+
/** The state of mind the server received. */
|
|
126
|
+
state_of_mind?: string | null;
|
|
123
127
|
trigger_name?: string;
|
|
124
128
|
has_speak_tag?: boolean;
|
|
125
129
|
text?: string;
|
|
@@ -428,6 +432,8 @@ export interface VisionInputConfig {
|
|
|
428
432
|
}
|
|
429
433
|
export interface VisionBufferStatus {
|
|
430
434
|
enabled?: boolean;
|
|
435
|
+
/** Buffer state as Core reports it, e.g. `"vision_not_enabled"`. */
|
|
436
|
+
status?: string;
|
|
431
437
|
first_frame_pts?: number | null;
|
|
432
438
|
last_frame_pts?: number | null;
|
|
433
439
|
first_frame_index?: number | null;
|
|
@@ -574,6 +580,33 @@ export interface ConvaiConfig {
|
|
|
574
580
|
* `https://api2-stg.convai.com` to author against staging.
|
|
575
581
|
*/
|
|
576
582
|
characterApiUrl?: string;
|
|
583
|
+
/**
|
|
584
|
+
* Origin serving `POST /character/get`, which the bundled chat widget uses
|
|
585
|
+
* for the character's display name and avatar (optional, defaults to
|
|
586
|
+
* `https://api.convai.com`).
|
|
587
|
+
*
|
|
588
|
+
* Deliberately separate from {@link ConvaiConfig.characterApiUrl}: that one
|
|
589
|
+
* addresses the Character REST platform on `api2.convai.com`, which does not
|
|
590
|
+
* serve this route. A deployment that is not Convai's SaaS — on-prem above
|
|
591
|
+
* all — should set both, to its own gateway.
|
|
592
|
+
*
|
|
593
|
+
* It matters more than a header decoration suggests. Left unset off-SaaS,
|
|
594
|
+
* the lookup goes to `api.convai.com` and takes the API key with it: on a
|
|
595
|
+
* restricted network that is a failed request and a credential crossing a
|
|
596
|
+
* boundary it should not. The widget degrades gracefully either way, showing
|
|
597
|
+
* the fallback name and no avatar.
|
|
598
|
+
*
|
|
599
|
+
* @example
|
|
600
|
+
* ```ts
|
|
601
|
+
* const client = new ConvaiClient({
|
|
602
|
+
* apiKey: '…',
|
|
603
|
+
* characterId: '…',
|
|
604
|
+
* url: 'https://realtime-api.example-onprem.com', // core-service
|
|
605
|
+
* characterInfoUrl: 'https://api.example-onprem.com', // name + avatar
|
|
606
|
+
* });
|
|
607
|
+
* ```
|
|
608
|
+
*/
|
|
609
|
+
characterInfoUrl?: string;
|
|
577
610
|
/**
|
|
578
611
|
* Ordered roster of character instances for a multi-character room. Pass this
|
|
579
612
|
* *instead of* `characterId` -- exactly one of the two is valid.
|
|
@@ -630,8 +663,11 @@ export interface ConvaiConfig {
|
|
|
630
663
|
* and retry in application code.
|
|
631
664
|
*/
|
|
632
665
|
rosterProvisioningRetry?: RosterProvisioningRetry | false;
|
|
633
|
-
/**
|
|
634
|
-
|
|
666
|
+
/**
|
|
667
|
+
* Temporary character state of mind sent as `state_of_mind` on connect.
|
|
668
|
+
* One of the {@link StateOfMind} values; the server ignores anything else.
|
|
669
|
+
*/
|
|
670
|
+
stateOfMind?: StateOfMindInput;
|
|
635
671
|
/**
|
|
636
672
|
* Stable identifier for the end user (optional).
|
|
637
673
|
*
|
|
@@ -865,7 +901,8 @@ export interface ConvaiConfig {
|
|
|
865
901
|
* When true:
|
|
866
902
|
* - Dynamic info behaves as a static prompt sent to the LLM for that WebRTC connection
|
|
867
903
|
* - Dynamic info persists throughout the session
|
|
868
|
-
* -
|
|
904
|
+
* - `reconnect()` sends it again; a `disconnect()` followed by a new
|
|
905
|
+
* `connect(config)` only has it if that config does
|
|
869
906
|
*
|
|
870
907
|
* When false:
|
|
871
908
|
* - Allows resetting and updating via updateContext() or updateDynamicInfo()
|
|
@@ -925,12 +962,24 @@ export interface ConvaiConfig {
|
|
|
925
962
|
extraMetadata?: Record<string, unknown>;
|
|
926
963
|
};
|
|
927
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* The states of mind the server applies: Plutchik's eight primary emotions.
|
|
967
|
+
* Verified against realtime-api.convai.com — any other value (`"happy"`,
|
|
968
|
+
* `"calm"`, `"sad"`, ...) is acknowledged but ignored.
|
|
969
|
+
*/
|
|
970
|
+
export type StateOfMind = "joy" | "trust" | "fear" | "surprise" | "sadness" | "disgust" | "anger" | "anticipation";
|
|
971
|
+
/**
|
|
972
|
+
* What `stateOfMind` / `updateEmotion` accept: a {@link StateOfMind}, or
|
|
973
|
+
* `null` / `"neutral"` / `""` to clear. Typed open (`string & {}`) so editors
|
|
974
|
+
* suggest the valid values without breaking code that passes a `string`.
|
|
975
|
+
*/
|
|
976
|
+
export type StateOfMindInput = StateOfMind | "neutral" | (string & {}) | null;
|
|
928
977
|
/** Optional metadata for a text interaction. */
|
|
929
978
|
export interface SendUserTextMessageOptions {
|
|
930
979
|
/** Stable logical-turn identity used by clients that correlate responses. */
|
|
931
980
|
logicalTurnId?: string;
|
|
932
981
|
/** User-selected temporary emotion to apply before processing the text. */
|
|
933
|
-
stateOfMind?:
|
|
982
|
+
stateOfMind?: StateOfMindInput;
|
|
934
983
|
/** Latest request-scoped dynamic context to include in this same interaction. */
|
|
935
984
|
dynamicInfo?: DynamicInfo;
|
|
936
985
|
}
|
|
@@ -1214,9 +1263,9 @@ export interface ConvaiEventMap {
|
|
|
1214
1263
|
blendshapeCancel: [data: Record<string, unknown>];
|
|
1215
1264
|
blendshapeStatsReceived: [stats: Record<string, unknown>];
|
|
1216
1265
|
botAudioTrack: [track: MediaStreamTrack];
|
|
1217
|
-
audioStateChange: [
|
|
1218
|
-
videoStateChange: [
|
|
1219
|
-
screenShareStateChange: [
|
|
1266
|
+
audioStateChange: [state: AudioStateChange];
|
|
1267
|
+
videoStateChange: [state: VideoStateChange];
|
|
1268
|
+
screenShareStateChange: [state: ScreenShareStateChange];
|
|
1220
1269
|
characterReady: [instance: ConvaiCharacterInstance | undefined];
|
|
1221
1270
|
characterStatus: [status: CharacterStatusEvent];
|
|
1222
1271
|
activeCharacterChange: [change: ActiveCharacterChange];
|
|
@@ -1432,6 +1481,36 @@ export interface ConvaiClientState {
|
|
|
1432
1481
|
*/
|
|
1433
1482
|
activeMembershipId: string | null;
|
|
1434
1483
|
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Payload of `audioControls.on('audioStateChange')`.
|
|
1486
|
+
*
|
|
1487
|
+
* Every field is optional because the emitters report only what moved: a
|
|
1488
|
+
* microphone mute sends `isAudioMuted` and `isAudioEnabled` and leaves
|
|
1489
|
+
* `audioLevel` out entirely. Read each one with an `!== undefined` check
|
|
1490
|
+
* rather than treating absence as `false`.
|
|
1491
|
+
*/
|
|
1492
|
+
export interface AudioStateChange {
|
|
1493
|
+
/** True while the microphone is muted. */
|
|
1494
|
+
isAudioMuted?: boolean;
|
|
1495
|
+
/** True while a microphone track is published. */
|
|
1496
|
+
isAudioEnabled?: boolean;
|
|
1497
|
+
/** Input level, 0–1, when level monitoring is running. */
|
|
1498
|
+
audioLevel?: number;
|
|
1499
|
+
}
|
|
1500
|
+
/** Payload of `videoControls.on('videoStateChange')`. Partial, like {@link AudioStateChange}. */
|
|
1501
|
+
export interface VideoStateChange {
|
|
1502
|
+
/** True while a camera track is published. */
|
|
1503
|
+
isVideoEnabled?: boolean;
|
|
1504
|
+
/** True while the camera is published but hidden (a soft mute). */
|
|
1505
|
+
isVideoHidden?: boolean;
|
|
1506
|
+
}
|
|
1507
|
+
/** Payload of `screenShareControls.on('screenShareStateChange')`. Partial, like {@link AudioStateChange}. */
|
|
1508
|
+
export interface ScreenShareStateChange {
|
|
1509
|
+
/** True while a screen-share track is live. */
|
|
1510
|
+
isScreenShareActive?: boolean;
|
|
1511
|
+
/** True while screen sharing is enabled, whether or not a track is live yet. */
|
|
1512
|
+
isScreenShareEnabled?: boolean;
|
|
1513
|
+
}
|
|
1435
1514
|
/**
|
|
1436
1515
|
* Narrows {@link IConvaiClient.setCharacterMuted} to one roster member.
|
|
1437
1516
|
*/
|
|
@@ -1908,6 +1987,12 @@ export interface IConvaiClient {
|
|
|
1908
1987
|
readonly isBotReady: boolean;
|
|
1909
1988
|
/** Audio control methods for managing microphone mute/unmute */
|
|
1910
1989
|
readonly audioControls: AudioControls;
|
|
1990
|
+
/**
|
|
1991
|
+
* The configured origin for the widget's character name/avatar lookup, or
|
|
1992
|
+
* `null` when it was not set and the default applies. Read by the bundled
|
|
1993
|
+
* widgets so they ask the same host the rest of the client was pointed at.
|
|
1994
|
+
*/
|
|
1995
|
+
readonly characterInfoUrl?: string | null;
|
|
1911
1996
|
/**
|
|
1912
1997
|
* Silence the character's voice, or bring it back.
|
|
1913
1998
|
*
|
|
@@ -2082,8 +2167,15 @@ export interface IConvaiClient {
|
|
|
2082
2167
|
* Opt in or out of `usageUpdate` events -- the server's per-turn usage and
|
|
2083
2168
|
* cost breakdown. Informational only; billing is unaffected.
|
|
2084
2169
|
*
|
|
2170
|
+
* **Requires connecting with `debug: true`.** The server only registers the
|
|
2171
|
+
* usage stream for debug sessions; otherwise it answers this toggle with a
|
|
2172
|
+
* `serverResponse` error ("Usage-update publisher not available") and no
|
|
2173
|
+
* `usageUpdate` ever fires.
|
|
2174
|
+
*
|
|
2085
2175
|
* @example
|
|
2086
2176
|
* ```ts
|
|
2177
|
+
* const client = new ConvaiClient({ apiKey, characterId, debug: true })
|
|
2178
|
+
* await client.connect()
|
|
2087
2179
|
* client.toggleUsageUpdates(true)
|
|
2088
2180
|
* client.on('usageUpdate', (u) => console.log(u))
|
|
2089
2181
|
* ```
|
|
@@ -2114,7 +2206,14 @@ export interface IConvaiClient {
|
|
|
2114
2206
|
updateCharacterRoster: (options: UpdateCharacterRosterOptions) => Promise<CharacterRosterChange>;
|
|
2115
2207
|
/** Disconnect from the current character session */
|
|
2116
2208
|
disconnect: () => Promise<void>;
|
|
2117
|
-
/**
|
|
2209
|
+
/**
|
|
2210
|
+
* Disconnect and connect again with the stored config. The stored config
|
|
2211
|
+
* includes the runtime changes made since connecting —
|
|
2212
|
+
* `updateDynamicInfo()`, `updateEmotion()`, `updateTemplateKeys()`,
|
|
2213
|
+
* `toggleTts()` and `respondModeUpdate()` — so a reconnect does not revert
|
|
2214
|
+
* them. The session id is kept; call `resetSession()` first for a fresh
|
|
2215
|
+
* conversation.
|
|
2216
|
+
*/
|
|
2118
2217
|
reconnect: () => Promise<void>;
|
|
2119
2218
|
/** Reset the session ID to start a new conversation (clears history) */
|
|
2120
2219
|
resetSession: () => void;
|
|
@@ -2211,8 +2310,12 @@ export interface IConvaiClient {
|
|
|
2211
2310
|
/**
|
|
2212
2311
|
* Set or clear the character's temporary state of mind without triggering a response.
|
|
2213
2312
|
* Pass `null` (or `"neutral"`) to clear it.
|
|
2313
|
+
*
|
|
2314
|
+
* Accepted values are the eight {@link StateOfMind} emotions; the server
|
|
2315
|
+
* acknowledges anything else with `extras.applied: false` ("Invalid emotion
|
|
2316
|
+
* ignored") and the SDK logs a warning.
|
|
2214
2317
|
*/
|
|
2215
|
-
updateEmotion: (stateOfMind:
|
|
2318
|
+
updateEmotion: (stateOfMind: StateOfMindInput) => void;
|
|
2216
2319
|
/**
|
|
2217
2320
|
* Send descriptive scene updates so the bot knows what is visible or nearby.
|
|
2218
2321
|
* Does not modify actionConfig.
|
|
@@ -2268,4 +2371,3 @@ export interface IConvaiClient {
|
|
|
2268
2371
|
*/
|
|
2269
2372
|
off: <E extends string>(event: E, callback: ConvaiEventCallback<E>) => void;
|
|
2270
2373
|
}
|
|
2271
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { VisionSourceKind } from "./types.js";
|
|
2
2
|
export declare function isWebcamVisionSource(source?: VisionSourceKind | null): boolean;
|
|
3
3
|
export declare function shouldKeepExistingVisionSource(currentSource: VisionSourceKind, nextSource: VisionSourceKind, hasReplacementTrack: boolean): boolean;
|
|
4
|
-
//# sourceMappingURL=videoSourceState.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ConvaiConfig, VisionInputConfig } from "./types.js";
|
|
2
2
|
export declare function resolveVisionInputConfig(config: Pick<ConvaiConfig, "enableVideo" | "visionInputConfig">): VisionInputConfig | undefined;
|
|
3
3
|
export declare function serializeVisionInputConfig(config: VisionInputConfig): Record<string, unknown>;
|
|
4
|
-
//# sourceMappingURL=visionRequest.d.ts.map
|