@convai/web-sdk 1.9.0-beta.1 → 1.9.0-beta.12
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 +35 -43
- 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 +66 -3
- package/dist/core/ConvaiClient.js +253 -20
- 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 +5 -3
- package/dist/core/MessageHandler.js +125 -47
- package/dist/core/SSESession.d.ts +13 -9
- package/dist/core/SSESession.js +240 -13
- 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 +5 -2
- package/dist/core/index.js +20 -2
- 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 +5 -0
- package/dist/core/rtviEnvelope.js +9 -0
- package/dist/core/types.d.ts +241 -17
- 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 +20 -3
- package/dist/embed/index.js +20 -3
- 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 +9 -1
- package/dist/react/components/ConvaiWidget.js +23 -28
- 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 +4 -2
- package/dist/react/components/rtc-widget/components/ConviMessage.js +2 -3
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +1 -3
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +7 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +9 -6
- 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 +4 -2
- package/dist/react/components/rtc-widget/components/MessageList.js +2 -3
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts +14 -0
- package/dist/react/components/rtc-widget/components/SiteCard.js +34 -0
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js +1 -2
- 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 +1 -3
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +1 -3
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +1 -4
- 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 +8 -5
- package/dist/react/hooks/useLocalCameraTrack.d.ts +0 -1
- package/dist/react/hooks/useLocalCameraTrack.js +0 -1
- package/dist/react/icons.d.ts +37 -0
- package/dist/react/icons.js +53 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +1 -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 +7 -1
- package/dist/utils/linkPresentation.js +57 -1
- package/dist/utils/linkPreview.d.ts +45 -0
- package/dist/utils/linkPreview.js +71 -0
- 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 +89 -40
- 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 +2 -1
- package/dist/vanilla/index.js +1 -1
- package/dist/vanilla/styles.d.ts +0 -1
- package/dist/vanilla/styles.js +0 -1
- package/dist/vanilla/types.d.ts +9 -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 +22 -27
- 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/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/ConvaiChatElement.d.ts +0 -103
- package/dist/embed/ConvaiChatElement.d.ts.map +0 -1
- package/dist/embed/ConvaiChatElement.js +0 -679
- package/dist/embed/ConvaiChatElement.js.map +0 -1
- package/dist/embed/browser.d.ts +0 -3
- package/dist/embed/browser.d.ts.map +0 -1
- package/dist/embed/browser.js +0 -5
- package/dist/embed/browser.js.map +0 -1
- package/dist/embed/chat-embed-v1.js +0 -200
- package/dist/embed/chat-embed-v1.js.map +0 -7
- 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/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/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/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
|
@@ -36,89 +36,11 @@ import { METAHUMAN_ORDER_251 } from './metahumanOrder251.js';
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
export function createARKitNameMapper(mapping, outputFormat = 'object') {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
sourceName,
|
|
45
|
-
sourceName.charAt(0).toUpperCase() + sourceName.slice(1),
|
|
46
|
-
sourceName.charAt(0).toLowerCase() + sourceName.slice(1),
|
|
47
|
-
];
|
|
48
|
-
let sourceIndex = -1;
|
|
49
|
-
for (const variation of sourceNameVariations) {
|
|
50
|
-
sourceIndex = ARKIT_ORDER_61.indexOf(variation);
|
|
51
|
-
if (sourceIndex !== -1)
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
if (sourceIndex === -1) {
|
|
55
|
-
console.warn(`[ARKit Name Mapper] Source blendshape "${sourceName}" not found in ARKit format`);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
sourceIndexToTargets.set(sourceIndex, targetNames);
|
|
59
|
-
}
|
|
60
|
-
// Build list of unique target names
|
|
61
|
-
const uniqueTargets = new Set();
|
|
62
|
-
for (const targets of sourceIndexToTargets.values()) {
|
|
63
|
-
targets.forEach(t => uniqueTargets.add(t));
|
|
64
|
-
}
|
|
65
|
-
const targetNames = Array.from(uniqueTargets);
|
|
66
|
-
// Build accumulation structure: target name -> [source indices]
|
|
67
|
-
const targetToSources = new Map();
|
|
68
|
-
for (const targetName of targetNames) {
|
|
69
|
-
targetToSources.set(targetName, []);
|
|
70
|
-
}
|
|
71
|
-
for (const [sourceIndex, targets] of sourceIndexToTargets.entries()) {
|
|
72
|
-
for (const targetName of targets) {
|
|
73
|
-
targetToSources.get(targetName)?.push(sourceIndex);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Pre-allocate output structures
|
|
77
|
-
const outputValues = new Float32Array(targetNames.length);
|
|
78
|
-
const nameToIndex = new Map();
|
|
79
|
-
targetNames.forEach((name, index) => nameToIndex.set(name, index));
|
|
80
|
-
if (outputFormat === 'optimized') {
|
|
81
|
-
// Optimized format: return structured object for fast iteration
|
|
82
|
-
const optimizedOutput = {
|
|
83
|
-
names: targetNames,
|
|
84
|
-
values: outputValues,
|
|
85
|
-
nameToIndex,
|
|
86
|
-
length: targetNames.length,
|
|
87
|
-
};
|
|
88
|
-
return (input) => {
|
|
89
|
-
outputValues.fill(0);
|
|
90
|
-
// Accumulate values for each target
|
|
91
|
-
for (let i = 0; i < targetNames.length; i++) {
|
|
92
|
-
const sourceIndices = targetToSources.get(targetNames[i]);
|
|
93
|
-
let sum = 0;
|
|
94
|
-
for (const srcIndex of sourceIndices) {
|
|
95
|
-
sum += input[srcIndex] || 0;
|
|
96
|
-
}
|
|
97
|
-
outputValues[i] = sum / sourceIndices.length; // Average if multiple sources
|
|
98
|
-
}
|
|
99
|
-
// Return same object reference (values are updated in place)
|
|
100
|
-
return optimizedOutput;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
// Object format: return key-value object
|
|
105
|
-
return (input) => {
|
|
106
|
-
const output = {};
|
|
107
|
-
for (const targetName of targetNames) {
|
|
108
|
-
const sourceIndices = targetToSources.get(targetName);
|
|
109
|
-
let sum = 0;
|
|
110
|
-
for (const srcIndex of sourceIndices) {
|
|
111
|
-
sum += input[srcIndex] || 0;
|
|
112
|
-
}
|
|
113
|
-
output[targetName] = sum / sourceIndices.length;
|
|
114
|
-
}
|
|
115
|
-
// Convert to Float32Array representation (for compatibility)
|
|
116
|
-
// Store as object in the array's properties (hack but works)
|
|
117
|
-
const result = new Float32Array(0);
|
|
118
|
-
result.__blendshapeObject = output;
|
|
119
|
-
return result;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
39
|
+
return buildNameMapper(mapping, outputFormat, (name) => firstIndexOf(ARKIT_ORDER_61, [
|
|
40
|
+
name,
|
|
41
|
+
name.charAt(0).toUpperCase() + name.slice(1),
|
|
42
|
+
name.charAt(0).toLowerCase() + name.slice(1),
|
|
43
|
+
]), 'ARKit');
|
|
122
44
|
}
|
|
123
45
|
/**
|
|
124
46
|
* Create a mapper from MetaHuman format using declarative name mapping
|
|
@@ -136,82 +58,87 @@ export function createARKitNameMapper(mapping, outputFormat = 'object') {
|
|
|
136
58
|
* ```
|
|
137
59
|
*/
|
|
138
60
|
export function createMetaHumanNameMapper(mapping, outputFormat = 'object') {
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
61
|
+
// Full CTRL_expressions_* names, or the short form the ARKit mapper also
|
|
62
|
+
// accepts ("jawOpen").
|
|
63
|
+
return buildNameMapper(mapping, outputFormat, (name) => firstIndexOf(METAHUMAN_ORDER_251, [
|
|
64
|
+
name,
|
|
65
|
+
`CTRL_expressions_${name}`,
|
|
66
|
+
`CTRL_expressions_${name.charAt(0).toLowerCase()}${name.slice(1)}`,
|
|
67
|
+
]), 'MetaHuman');
|
|
68
|
+
}
|
|
69
|
+
/** Hidden on 'object' frames: the target name for each value, in order. */
|
|
70
|
+
const NAMES = '__blendshapeNames';
|
|
71
|
+
function firstIndexOf(order, candidates) {
|
|
72
|
+
for (const candidate of candidates) {
|
|
73
|
+
const index = order.indexOf(candidate);
|
|
74
|
+
if (index !== -1)
|
|
75
|
+
return index;
|
|
76
|
+
}
|
|
77
|
+
return -1;
|
|
78
|
+
}
|
|
79
|
+
/** Attach target names to a frame without making them iterable values. */
|
|
80
|
+
export function withBlendshapeNames(values, names) {
|
|
81
|
+
Object.defineProperty(values, NAMES, { value: names, enumerable: false });
|
|
82
|
+
return values;
|
|
83
|
+
}
|
|
84
|
+
function buildNameMapper(mapping, outputFormat, indexOf, label) {
|
|
85
|
+
// target name -> source indices it averages
|
|
86
|
+
const targetToSources = new Map();
|
|
87
|
+
for (const [sourceName, targets] of Object.entries(mapping)) {
|
|
88
|
+
const sourceIndex = indexOf(sourceName);
|
|
143
89
|
if (sourceIndex === -1) {
|
|
144
|
-
console.warn(`[
|
|
90
|
+
console.warn(`[${label} Name Mapper] Source blendshape "${sourceName}" not found in ${label} format`);
|
|
145
91
|
continue;
|
|
146
92
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
for (const targets of sourceIndexToTargets.values()) {
|
|
152
|
-
targets.forEach(t => uniqueTargets.add(t));
|
|
153
|
-
}
|
|
154
|
-
const targetNames = Array.from(uniqueTargets);
|
|
155
|
-
// Build accumulation structure: target name -> [source indices]
|
|
156
|
-
const targetToSources = new Map();
|
|
157
|
-
for (const targetName of targetNames) {
|
|
158
|
-
targetToSources.set(targetName, []);
|
|
159
|
-
}
|
|
160
|
-
for (const [sourceIndex, targets] of sourceIndexToTargets.entries()) {
|
|
161
|
-
for (const targetName of targets) {
|
|
162
|
-
targetToSources.get(targetName)?.push(sourceIndex);
|
|
93
|
+
for (const target of targets) {
|
|
94
|
+
if (!targetToSources.has(target))
|
|
95
|
+
targetToSources.set(target, []);
|
|
96
|
+
targetToSources.get(target).push(sourceIndex);
|
|
163
97
|
}
|
|
164
98
|
}
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
const nameToIndex = new Map();
|
|
168
|
-
|
|
99
|
+
const names = Array.from(targetToSources.keys());
|
|
100
|
+
const sources = names.map((name) => targetToSources.get(name));
|
|
101
|
+
const nameToIndex = new Map(names.map((name, i) => [name, i]));
|
|
102
|
+
// Fresh values for every frame. The queue keeps each frame until it is
|
|
103
|
+
// played, so a shared buffer made every queued frame read as the newest.
|
|
104
|
+
const compute = (input) => {
|
|
105
|
+
const values = new Float32Array(names.length);
|
|
106
|
+
for (let i = 0; i < names.length; i++) {
|
|
107
|
+
let sum = 0;
|
|
108
|
+
for (const srcIndex of sources[i])
|
|
109
|
+
sum += input[srcIndex] || 0;
|
|
110
|
+
values[i] = sum / sources[i].length; // average when several sources share a target
|
|
111
|
+
}
|
|
112
|
+
return values;
|
|
113
|
+
};
|
|
169
114
|
if (outputFormat === 'optimized') {
|
|
170
|
-
// Optimized format: return structured object for fast iteration
|
|
171
|
-
const optimizedOutput = {
|
|
172
|
-
names: targetNames,
|
|
173
|
-
values: outputValues,
|
|
174
|
-
nameToIndex,
|
|
175
|
-
length: targetNames.length,
|
|
176
|
-
};
|
|
177
|
-
return (input) => {
|
|
178
|
-
outputValues.fill(0);
|
|
179
|
-
// Accumulate values for each target
|
|
180
|
-
for (let i = 0; i < targetNames.length; i++) {
|
|
181
|
-
const sourceIndices = targetToSources.get(targetNames[i]);
|
|
182
|
-
let sum = 0;
|
|
183
|
-
for (const srcIndex of sourceIndices) {
|
|
184
|
-
sum += input[srcIndex] || 0;
|
|
185
|
-
}
|
|
186
|
-
outputValues[i] = sum / sourceIndices.length; // Average if multiple sources
|
|
187
|
-
}
|
|
188
|
-
// Return same object reference (values are updated in place)
|
|
189
|
-
return optimizedOutput;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
// Object format: return key-value object
|
|
194
115
|
return (input) => {
|
|
195
|
-
const output = {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
output[targetName] = sum / sourceIndices.length;
|
|
203
|
-
}
|
|
204
|
-
// Convert to Float32Array representation (for compatibility)
|
|
205
|
-
const result = new Float32Array(0);
|
|
206
|
-
result.__blendshapeObject = output;
|
|
207
|
-
return result;
|
|
116
|
+
const output = {
|
|
117
|
+
names,
|
|
118
|
+
values: compute(input),
|
|
119
|
+
nameToIndex,
|
|
120
|
+
length: names.length,
|
|
121
|
+
};
|
|
122
|
+
return output;
|
|
208
123
|
};
|
|
209
124
|
}
|
|
125
|
+
// 'object': a real numeric frame — so fades and any numeric consumer work —
|
|
126
|
+
// with the names attached for getBlendshapeObject().
|
|
127
|
+
return (input) => withBlendshapeNames(compute(input), names);
|
|
210
128
|
}
|
|
211
129
|
/**
|
|
212
130
|
* Helper to extract blendshape object from mapper output
|
|
213
131
|
*/
|
|
214
132
|
export function getBlendshapeObject(output) {
|
|
133
|
+
if (!output)
|
|
134
|
+
return {};
|
|
135
|
+
const names = output[NAMES];
|
|
136
|
+
if (names) {
|
|
137
|
+
const obj = {};
|
|
138
|
+
for (let i = 0; i < names.length; i++)
|
|
139
|
+
obj[names[i]] = output[i];
|
|
140
|
+
return obj;
|
|
141
|
+
}
|
|
215
142
|
if (output.__blendshapeObject) {
|
|
216
143
|
return output.__blendshapeObject;
|
|
217
144
|
}
|
|
@@ -225,4 +152,3 @@ export function getBlendshapeObject(output) {
|
|
|
225
152
|
}
|
|
226
153
|
return {};
|
|
227
154
|
}
|
|
228
|
-
//# sourceMappingURL=declarativeMapping.js.map
|
|
@@ -16,4 +16,3 @@ export { createLipsyncProcessor, getLipsyncProfile, } from "./naturalness/proces
|
|
|
16
16
|
export type { LipsyncFormat, LipsyncFormatProfile, LipsyncProcessorOptions, LipsyncEnvelopeOptions, LipsyncMeshBinding, } from "./naturalness/types.js";
|
|
17
17
|
export { MHA_PROFILE, mhaChannelIndex } from "./naturalness/profiles/mha.js";
|
|
18
18
|
export { MHA_LIMIT_DRIVERS, applyMhaLimits, MHA_RECOMMENDED_GAINS, createMhaGainMask, MHA_EYE_CHANNEL_INDICES, symmetrizeMhaMouth, } from "./mhaLimitDrivers.js";
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -37,4 +37,3 @@ export { createLipsyncProcessor, getLipsyncProfile, } from "./naturalness/proces
|
|
|
37
37
|
export { MHA_PROFILE, mhaChannelIndex } from "./naturalness/profiles/mha.js";
|
|
38
38
|
// Flat MHA convenience wrappers over the profile (piecemeal use)
|
|
39
39
|
export { MHA_LIMIT_DRIVERS, applyMhaLimits, MHA_RECOMMENDED_GAINS, createMhaGainMask, MHA_EYE_CHANNEL_INDICES, symmetrizeMhaMouth, } from "./mhaLimitDrivers.js";
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -28,10 +28,12 @@ export interface BlendshapeMappingConfig {
|
|
|
28
28
|
*/
|
|
29
29
|
inputFormat: BlendshapeFormat;
|
|
30
30
|
/**
|
|
31
|
-
* Output format for application
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* -
|
|
31
|
+
* Output format for application. Without a `mapper`, only a passthrough of
|
|
32
|
+
* the same format is built in (arkit -> arkit, mha -> mha); any other pair
|
|
33
|
+
* throws. There is no built-in ARKit <-> MetaHuman conversion.
|
|
34
|
+
* - arkit: 61-element ARKit format
|
|
35
|
+
* - mha: 251-element MetaHuman format
|
|
36
|
+
* - custom: your `mapper` decides
|
|
35
37
|
*/
|
|
36
38
|
outputFormat: BlendshapeFormat;
|
|
37
39
|
/**
|
|
@@ -61,4 +63,3 @@ export declare const PRESET_MAPPINGS: {
|
|
|
61
63
|
readonly outputFormat: "mha";
|
|
62
64
|
};
|
|
63
65
|
};
|
|
64
|
-
//# sourceMappingURL=mappingTypes.d.ts.map
|
|
@@ -30,7 +30,7 @@ export const METAHUMAN_ORDER_251 = [
|
|
|
30
30
|
"CTRL_expressions_earUpL", // 8
|
|
31
31
|
"CTRL_expressions_earUpR", // 9
|
|
32
32
|
// ============================================================================
|
|
33
|
-
// EYES (
|
|
33
|
+
// EYES (33 blendshapes)
|
|
34
34
|
// ============================================================================
|
|
35
35
|
"CTRL_expressions_eyeBlinkL", // 10 - 🔑 KEY
|
|
36
36
|
"CTRL_expressions_eyeBlinkR", // 11 - 🔑 KEY
|
|
@@ -77,7 +77,7 @@ export const METAHUMAN_ORDER_251 = [
|
|
|
77
77
|
"CTRL_expressions_eyelashesUpOUTL", // 49
|
|
78
78
|
"CTRL_expressions_eyelashesUpOUTR", // 50
|
|
79
79
|
// ============================================================================
|
|
80
|
-
// JAW (
|
|
80
|
+
// JAW (14 blendshapes)
|
|
81
81
|
// ============================================================================
|
|
82
82
|
"CTRL_expressions_jawBack", // 51
|
|
83
83
|
"CTRL_expressions_jawChinCompressL", // 52
|
|
@@ -94,7 +94,7 @@ export const METAHUMAN_ORDER_251 = [
|
|
|
94
94
|
"CTRL_expressions_jawOpenExtreme", // 63
|
|
95
95
|
"CTRL_expressions_jawRight", // 64 - 🔑 KEY
|
|
96
96
|
// ============================================================================
|
|
97
|
-
// MOUTH (
|
|
97
|
+
// MOUTH (128 blendshapes) - Most important for lipsync!
|
|
98
98
|
// ============================================================================
|
|
99
99
|
"CTRL_expressions_mouthCheekBlowL", // 65
|
|
100
100
|
"CTRL_expressions_mouthCheekBlowR", // 66
|
|
@@ -242,7 +242,7 @@ export const METAHUMAN_ORDER_251 = [
|
|
|
242
242
|
"CTRL_expressions_neckThroatInhale", // 205
|
|
243
243
|
"CTRL_expressions_neckThroatUp", // 206
|
|
244
244
|
// ============================================================================
|
|
245
|
-
// NOSE (
|
|
245
|
+
// NOSE (12 blendshapes)
|
|
246
246
|
// ============================================================================
|
|
247
247
|
"CTRL_expressions_noseNasolabialDeepenL", // 207
|
|
248
248
|
"CTRL_expressions_noseNasolabialDeepenR", // 208
|
|
@@ -311,8 +311,8 @@ export const METAHUMAN_CATEGORIES = {
|
|
|
311
311
|
},
|
|
312
312
|
eyes: {
|
|
313
313
|
start: 10,
|
|
314
|
-
end:
|
|
315
|
-
count:
|
|
314
|
+
end: 42,
|
|
315
|
+
count: 33,
|
|
316
316
|
},
|
|
317
317
|
eyelashes: {
|
|
318
318
|
start: 43,
|
|
@@ -326,8 +326,8 @@ export const METAHUMAN_CATEGORIES = {
|
|
|
326
326
|
},
|
|
327
327
|
mouth: {
|
|
328
328
|
start: 65,
|
|
329
|
-
end:
|
|
330
|
-
count:
|
|
329
|
+
end: 192,
|
|
330
|
+
count: 128,
|
|
331
331
|
},
|
|
332
332
|
neck: {
|
|
333
333
|
start: 193,
|
|
@@ -429,4 +429,3 @@ export function formatMetaHumanBlendshapesForLogging(values, threshold = 0.01, m
|
|
|
429
429
|
activeCount: activeList.length,
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
|
-
//# sourceMappingURL=metahumanOrder251.js.map
|
|
@@ -21,4 +21,3 @@ export interface LipsyncProcessor {
|
|
|
21
21
|
tick(frame: Float32Array | null, deltaSeconds: number, bindings: LipsyncMeshBinding[]): void;
|
|
22
22
|
}
|
|
23
23
|
export declare function createLipsyncProcessor(formatOrProfile: LipsyncFormat | LipsyncFormatProfile, options?: LipsyncProcessorOptions): LipsyncProcessor;
|
|
24
|
-
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -53,6 +53,10 @@ export function createLipsyncProcessor(formatOrProfile, options = {}) {
|
|
|
53
53
|
const releaseTau = envelope === false ? 0 : envelope.release ?? 0.18;
|
|
54
54
|
// Scratch state
|
|
55
55
|
const work = new Float32Array(dim);
|
|
56
|
+
// Envelope-weighted output. Kept apart from `work` (the shaped frame) so a
|
|
57
|
+
// silent tick scales the stored frame once, not the previous output again —
|
|
58
|
+
// which compounded and closed the mouth ~5x faster than `release`.
|
|
59
|
+
const out = new Float32Array(dim);
|
|
56
60
|
let last = null;
|
|
57
61
|
let env = envelope === false ? 1 : 0;
|
|
58
62
|
const shape = (src) => {
|
|
@@ -90,10 +94,9 @@ export function createLipsyncProcessor(formatOrProfile, options = {}) {
|
|
|
90
94
|
if (!last)
|
|
91
95
|
return null;
|
|
92
96
|
if (envelope !== false && env < 1) {
|
|
93
|
-
// weight the scratch in place (last === work)
|
|
94
97
|
for (let i = 0; i < dim; i++)
|
|
95
|
-
|
|
96
|
-
return
|
|
98
|
+
out[i] = last[i] * env;
|
|
99
|
+
return out;
|
|
97
100
|
}
|
|
98
101
|
return last;
|
|
99
102
|
};
|
|
@@ -159,4 +162,3 @@ export function createLipsyncProcessor(formatOrProfile, options = {}) {
|
|
|
159
162
|
},
|
|
160
163
|
};
|
|
161
164
|
}
|
|
162
|
-
//# sourceMappingURL=processor.js.map
|
|
@@ -4,4 +4,3 @@ export declare const MHA_RECOMMENDED_GAIN_TABLE: Record<string, number>;
|
|
|
4
4
|
export declare const MHA_PROFILE: LipsyncFormatProfile;
|
|
5
5
|
/** Short channel name → MHA-251 frame index (e.g. "jawOpen" → 62). */
|
|
6
6
|
export declare function mhaChannelIndex(shortName: string): number | undefined;
|
|
7
|
-
//# sourceMappingURL=mha.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LinkPreviewResolver } from "../../utils/linkPreview.js";
|
|
1
2
|
import type { IConvaiClient, PublishedChatConnectOptions } from "../../core/types.js";
|
|
2
3
|
import type { PublishedChatDescriptor } from "../../embed/publicationApi.js";
|
|
3
4
|
interface ConvaiWidgetProps {
|
|
@@ -30,6 +31,14 @@ interface ConvaiWidgetProps {
|
|
|
30
31
|
requestPublicationGrant?: () => Promise<string>;
|
|
31
32
|
/** Core endpoint override used with requestPublicationGrant. */
|
|
32
33
|
publishedChatConnectOptions?: PublishedChatConnectOptions;
|
|
34
|
+
/**
|
|
35
|
+
* Open Graph lookup for plain web links the character sends. Supply a
|
|
36
|
+
* function that asks your backend for a page's metadata and each such link
|
|
37
|
+
* gets a site card (favicon, site name, title, description, image) once it
|
|
38
|
+
* resolves. Omit it and links render as before. See
|
|
39
|
+
* docs/convai_link_previews.md, "Site cards".
|
|
40
|
+
*/
|
|
41
|
+
linkPreviewResolver?: LinkPreviewResolver;
|
|
33
42
|
/** Public descriptor used to label a credential-free published session. */
|
|
34
43
|
publishedChatDescriptor?: Pick<PublishedChatDescriptor, "display_name" | "image_url">;
|
|
35
44
|
}
|
|
@@ -75,4 +84,3 @@ interface ConvaiWidgetProps {
|
|
|
75
84
|
*/
|
|
76
85
|
export declare const ConvaiWidget: React.FC<ConvaiWidgetProps>;
|
|
77
86
|
export {};
|
|
78
|
-
//# sourceMappingURL=ConvaiWidget.d.ts.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
3
|
import { motion, AnimatePresence } from "framer-motion";
|
|
4
|
-
import { FiMoreVertical, FiSend,
|
|
5
|
-
import { IoVolumeMute, IoVolumeHigh } from "react-icons/io5";
|
|
6
|
-
import { PiWaveform } from "react-icons/pi";
|
|
4
|
+
import { FiMoreVertical, FiPhoneOff, FiSend, IoVolumeHigh, IoVolumeMute, PiWaveform } from "../icons.js";
|
|
7
5
|
import { RoomContext } from "@livekit/components-react";
|
|
8
6
|
import { useCharacterInfo } from "../hooks/useCharacterInfo.js";
|
|
9
7
|
import { AudioRenderer } from "../../vanilla/AudioRenderer.js";
|
|
@@ -52,10 +50,10 @@ import { MessageList, SettingsTray, VoiceModeOverlay, FloatingVideo, } from "./r
|
|
|
52
50
|
* }
|
|
53
51
|
* ```
|
|
54
52
|
*/
|
|
55
|
-
export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare = true, defaultVoiceMode = true, requestPublicationGrant, publishedChatConnectOptions, publishedChatDescriptor, }) => {
|
|
53
|
+
export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare = true, defaultVoiceMode = true, requestPublicationGrant, publishedChatConnectOptions, publishedChatDescriptor, linkPreviewResolver, }) => {
|
|
56
54
|
const isTextOnly = Boolean(requestPublicationGrant) || convaiClient.connectionType === "text";
|
|
57
55
|
// Fetch character information dynamically from client's stored values
|
|
58
|
-
const { name: fetchedCharacterName, image: fetchedCharacterImage, isLoading: isFetchedCharacterLoading, } = useCharacterInfo(convaiClient.characterId || undefined, convaiClient.apiKey || undefined, convaiClient.authToken || undefined);
|
|
56
|
+
const { name: fetchedCharacterName, image: fetchedCharacterImage, isLoading: isFetchedCharacterLoading, } = useCharacterInfo(convaiClient.characterId || undefined, convaiClient.apiKey || undefined, convaiClient.authToken || undefined, convaiClient.characterInfoUrl);
|
|
59
57
|
const characterName = publishedChatDescriptor?.display_name || fetchedCharacterName;
|
|
60
58
|
const characterImage = publishedChatDescriptor?.image_url ?? fetchedCharacterImage;
|
|
61
59
|
const isCharacterLoading = publishedChatDescriptor
|
|
@@ -188,22 +186,11 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
188
186
|
};
|
|
189
187
|
const handleToggleMute = () => {
|
|
190
188
|
const newMutedState = !isMuted;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (publication.track) {
|
|
197
|
-
publication.track.setMuted(newMutedState);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
// WebSocket: mute/unmute the hidden <audio> element added by useConvaiClient
|
|
204
|
-
const wsAudioEls = document.querySelectorAll("audio[data-convai-ws]");
|
|
205
|
-
wsAudioEls.forEach((el) => { el.muted = newMutedState; });
|
|
206
|
-
}
|
|
189
|
+
// The client owns this now. It replaces a branch that reached for
|
|
190
|
+
// LiveKit's `@internal` RemoteTrack.setMuted on one transport and a DOM
|
|
191
|
+
// query on the other, and it holds the state so tracks arriving later —
|
|
192
|
+
// a reconnect, a joining roster member — honour it too.
|
|
193
|
+
convaiClient.setCharacterMuted(newMutedState);
|
|
207
194
|
setIsMuted(newMutedState);
|
|
208
195
|
};
|
|
209
196
|
const handleReset = async () => {
|
|
@@ -292,6 +279,13 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
292
279
|
};
|
|
293
280
|
ensureMicState();
|
|
294
281
|
}, [isVoiceMode, convaiClient]);
|
|
282
|
+
// While default voice mode is still pending, render the voice view rather
|
|
283
|
+
// than the text input. Otherwise the panel opens in text mode (the
|
|
284
|
+
// disconnect reset below also runs on mount), the user starts typing, and
|
|
285
|
+
// the moment the connection lands the input is swapped out and the mic goes
|
|
286
|
+
// live under them.
|
|
287
|
+
const showVoiceMode = isVoiceMode ||
|
|
288
|
+
(defaultVoiceMode && !isTextOnly && !hasEnteredDefaultVoiceMode);
|
|
295
289
|
// Handle default voice mode when widget opens (only once)
|
|
296
290
|
useEffect(() => {
|
|
297
291
|
if (isOpen &&
|
|
@@ -386,7 +380,7 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
386
380
|
}, style: {
|
|
387
381
|
pointerEvents: isOpen ? "auto" : "none",
|
|
388
382
|
minHeight: "3.5rem", // Ensure consistent height
|
|
389
|
-
}, children: [_jsx(CloseButton, { onClick: handleClose, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, transition: iosTransitions.snappy, style: { cursor: "pointer", pointerEvents: "auto" }, children: _jsx(ChevronDown, { size: "md" }) }), _jsxs(Title, { children: [selectedCharacter.image && !
|
|
383
|
+
}, children: [_jsx(CloseButton, { onClick: handleClose, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, transition: iosTransitions.snappy, style: { cursor: "pointer", pointerEvents: "auto" }, children: _jsx(ChevronDown, { size: "md" }) }), _jsxs(Title, { children: [selectedCharacter.image && !showVoiceMode && (_jsx(motion.img, { src: selectedCharacter.image, alt: selectedCharacter.name, initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.8, opacity: 0 }, transition: iosTransitions.fadePop, style: {
|
|
390
384
|
width: "1.5rem",
|
|
391
385
|
height: "1.5rem",
|
|
392
386
|
borderRadius: "50%",
|
|
@@ -409,7 +403,7 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
409
403
|
alignItems: "center",
|
|
410
404
|
marginLeft: "0.5rem",
|
|
411
405
|
outline: "none",
|
|
412
|
-
}, "aria-label": isMuted ? "Unmute" : "Mute", title: isMuted ? "Unmute" : "Mute", children: isMuted ? (_jsx(IoVolumeMute, { size: 16, color: "#919EABA6" })) : (_jsx(IoVolumeHigh, { size: 16, color: "#0E7360" })) }),
|
|
406
|
+
}, "aria-label": isMuted ? "Unmute" : "Mute", title: isMuted ? "Unmute" : "Mute", children: isMuted ? (_jsx(IoVolumeMute, { size: 16, color: "#919EABA6" })) : (_jsx(IoVolumeHigh, { size: 16, color: "#0E7360" })) }), showVoiceMode && (_jsx("span", { style: {
|
|
413
407
|
fontSize: "10px",
|
|
414
408
|
color: aeroTheme.colors.convai.light,
|
|
415
409
|
fontWeight: 500,
|
|
@@ -473,7 +467,7 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
473
467
|
gap: "0.5rem",
|
|
474
468
|
position: "relative",
|
|
475
469
|
}, children: _jsx(SettingsButton, { ref: settingsButtonRef, onClick: handleSettingsToggle, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, transition: iosTransitions.snappy, style: { cursor: "pointer" }, children: _jsx(FiMoreVertical, { size: 20 }) }) })] }), _jsxs(Content, { style: {
|
|
476
|
-
background:
|
|
470
|
+
background: showVoiceMode
|
|
477
471
|
? "rgba(255, 255, 255, 0.98)"
|
|
478
472
|
: "transparent",
|
|
479
473
|
filter: isSettingsOpen ? "blur(3px)" : "none",
|
|
@@ -507,7 +501,7 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
507
501
|
fontSize: "14px",
|
|
508
502
|
fontWeight: 500,
|
|
509
503
|
color: aeroTheme.colors.text.secondary,
|
|
510
|
-
}, children: ["Connecting to ", selectedCharacter.name, "..."] })] })) }),
|
|
504
|
+
}, children: ["Connecting to ", selectedCharacter.name, "..."] })] })) }), showVoiceMode && (_jsx(VoiceModeOverlay, { isActive: !convaiClient.isAudioMuted, isTalking: convaiClient.state.isSpeaking, isListening: convaiClient.state.isListening, convaiClient: null, characterImage: characterImage || undefined, characterName: characterName || undefined, room: convaiClient.room?.state === "connected" ? convaiClient.room : null })), !showVoiceMode && (_jsx(MessageList, { messages: formatMessages(), isStreaming: convaiClient.state.isSpeaking, forceToBottomToken: `${isOpen}-${convaiClient.chatMessages.length}`, linkPreviewResolver: linkPreviewResolver }))] }), _jsx(Footer, { initial: { y: 20, opacity: 0 }, animate: { y: 0, opacity: 1 }, transition: {
|
|
511
505
|
delay: 0.7,
|
|
512
506
|
...iosTransitions.modalSlide,
|
|
513
507
|
}, style: {
|
|
@@ -517,9 +511,9 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
517
511
|
gap: "0.5rem",
|
|
518
512
|
alignItems: "center",
|
|
519
513
|
position: "relative",
|
|
520
|
-
justifyContent:
|
|
514
|
+
justifyContent: showVoiceMode ? "center" : "flex-start",
|
|
521
515
|
minHeight: "3.5rem", // Ensure consistent height
|
|
522
|
-
}, children:
|
|
516
|
+
}, children: showVoiceMode ? (_jsx(motion.button, { initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.8, opacity: 0 }, transition: {
|
|
523
517
|
duration: 0.3,
|
|
524
518
|
ease: "easeOut",
|
|
525
519
|
}, onClick: async () => {
|
|
@@ -531,6 +525,8 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
531
525
|
convaiClient.toggleStt(false);
|
|
532
526
|
}
|
|
533
527
|
setIsVoiceMode(false);
|
|
528
|
+
// Leaving early also cancels a still-pending default.
|
|
529
|
+
setHasEnteredDefaultVoiceMode(true);
|
|
534
530
|
}, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, style: {
|
|
535
531
|
cursor: "pointer",
|
|
536
532
|
backgroundColor: "#ef4444",
|
|
@@ -612,4 +608,3 @@ export const ConvaiWidget = ({ convaiClient, showVideo = true, showScreenShare =
|
|
|
612
608
|
await convaiClient.videoControls.disableVideo();
|
|
613
609
|
}, mirror: true }))] }));
|
|
614
610
|
};
|
|
615
|
-
//# sourceMappingURL=ConvaiWidget.js.map
|
|
@@ -313,4 +313,3 @@ export const AudioSettingsPanel = ({ currentSettings, onUpdateSettings, isConnec
|
|
|
313
313
|
};
|
|
314
314
|
return (_jsxs(Panel, { isOpen: true, children: [_jsxs(Title, { children: ["Audio Sensitivity Settings", _jsx(StatusIndicator, { isConnected: isConnected, children: isConnected ? "LIVE" : "OFFLINE" })] }), _jsx(Subtitle, { children: "Adjust these settings to reduce interruptions and find the optimal balance for your environment." }), isConnected && (_jsx(InfoBox, { children: "Warning: Changing settings will briefly restart your microphone. Changes apply immediately." })), _jsxs(SettingGroup, { children: [_jsxs(SettingLabel, { children: [_jsx("span", { children: "Echo Cancellation" }), _jsx(Toggle, { enabled: localSettings.echoCancellation || false, onClick: () => handleToggle("echoCancellation", !localSettings.echoCancellation) })] }), _jsx(SettingDescription, { children: "Prevents feedback loops from speakers. Recommended ON." })] }), _jsxs(SettingGroup, { children: [_jsxs(SettingLabel, { children: [_jsx("span", { children: "Noise Suppression" }), _jsx(Toggle, { enabled: localSettings.noiseSuppression || false, onClick: () => handleToggle("noiseSuppression", !localSettings.noiseSuppression) })] }), _jsx(SettingDescription, { children: "Filters out background noise. Turn ON to reduce false interruptions." })] }), _jsxs(SettingGroup, { children: [_jsxs(SettingLabel, { children: [_jsx("span", { children: "Auto Gain Control" }), _jsx(Toggle, { enabled: localSettings.autoGainControl || false, onClick: () => handleToggle("autoGainControl", !localSettings.autoGainControl) })] }), _jsx(SettingDescription, { children: "Automatically adjusts microphone volume. Turn ON in noisy environments to prevent unwanted interruptions." })] }), _jsxs(SliderGroup, { children: [_jsxs(SliderLabel, { children: [_jsx("span", { children: "Sample Rate" }), _jsxs(SliderValue, { children: [localSettings.sampleRate || 48000, " Hz"] })] }), _jsx(Slider, { type: "range", min: "8000", max: "48000", step: "8000", value: localSettings.sampleRate || 48000, onChange: (e) => handleSliderChange("sampleRate", parseInt(e.target.value)), onMouseUp: (e) => handleSliderRelease("sampleRate", parseInt(e.target.value)), onTouchEnd: (e) => handleSliderRelease("sampleRate", parseInt(e.target.value)) }), _jsx(SettingDescription, { children: "Higher = better quality, lower = less data. 48000 Hz recommended." })] }), _jsxs(PresetButtons, { children: [_jsx(PresetButton, { onClick: () => applyPreset("quiet"), active: getCurrentPreset() === "quiet", disabled: isUpdating, children: "\uD83D\uDD07 Quiet" }), _jsx(PresetButton, { onClick: () => applyPreset("balanced"), active: getCurrentPreset() === "balanced", disabled: isUpdating, children: "Balanced" }), _jsx(PresetButton, { onClick: () => applyPreset("noisy"), active: getCurrentPreset() === "noisy", disabled: isUpdating, children: "\uD83D\uDD0A Noisy" })] })] }));
|
|
315
315
|
};
|
|
316
|
-
//# sourceMappingURL=AudioSettingsPanel.js.map
|
|
@@ -283,4 +283,3 @@ export const AudioVisualizer = ({ room, size = 350, color = '#10b981', opacity =
|
|
|
283
283
|
}, [room, size, color, opacity, avatarRadius, barCount, onSpeakingChange]);
|
|
284
284
|
return (_jsx(VisualizerContainer, { style: { width: size, height: size }, children: _jsx(Canvas, { ref: canvasRef }) }));
|
|
285
285
|
};
|
|
286
|
-
//# sourceMappingURL=AudioVisualizer.js.map
|