@convai/web-sdk 0.3.1-beta.3 → 0.3.2-beta.1

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.
Files changed (263) hide show
  1. package/README.md +535 -1077
  2. package/dist/core/AudioManager.d.ts.map +1 -0
  3. package/dist/core/AudioManager.js +262 -0
  4. package/dist/core/AudioManager.js.map +1 -0
  5. package/dist/core/BlendshapeQueue.d.ts +112 -0
  6. package/dist/core/BlendshapeQueue.d.ts.map +1 -0
  7. package/dist/core/BlendshapeQueue.js +172 -0
  8. package/dist/core/BlendshapeQueue.js.map +1 -0
  9. package/dist/{types/core → core}/ConvaiClient.d.ts +5 -15
  10. package/dist/core/ConvaiClient.d.ts.map +1 -0
  11. package/dist/core/ConvaiClient.js +602 -0
  12. package/dist/core/ConvaiClient.js.map +1 -0
  13. package/dist/core/EventEmitter.d.ts.map +1 -0
  14. package/dist/core/EventEmitter.js +68 -0
  15. package/dist/core/EventEmitter.js.map +1 -0
  16. package/dist/{types/core → core}/MessageHandler.d.ts +7 -0
  17. package/dist/core/MessageHandler.d.ts.map +1 -0
  18. package/dist/core/MessageHandler.js +332 -0
  19. package/dist/core/MessageHandler.js.map +1 -0
  20. package/dist/core/ScreenShareManager.d.ts.map +1 -0
  21. package/dist/core/ScreenShareManager.js +207 -0
  22. package/dist/core/ScreenShareManager.js.map +1 -0
  23. package/dist/core/VideoManager.d.ts.map +1 -0
  24. package/dist/core/VideoManager.js +205 -0
  25. package/dist/core/VideoManager.js.map +1 -0
  26. package/dist/{types/core → core}/index.d.ts +1 -0
  27. package/dist/core/index.d.ts.map +1 -0
  28. package/dist/core/index.js +14 -1970
  29. package/dist/core/index.js.map +1 -0
  30. package/dist/{types/core → core}/types.d.ts +9 -23
  31. package/dist/core/types.d.ts.map +1 -0
  32. package/dist/core/types.js +2 -0
  33. package/dist/core/types.js.map +1 -0
  34. package/dist/dev.d.ts +12 -0
  35. package/dist/dev.d.ts.map +1 -0
  36. package/dist/dev.js +12 -0
  37. package/dist/dev.js.map +1 -0
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +6 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/lipsync-helpers/arkitOrder61.d.ts.map +1 -0
  43. package/dist/lipsync-helpers/arkitOrder61.js +287 -0
  44. package/dist/lipsync-helpers/arkitOrder61.js.map +1 -0
  45. package/dist/lipsync-helpers/createBlendshapeQueue.d.ts +86 -0
  46. package/dist/lipsync-helpers/createBlendshapeQueue.d.ts.map +1 -0
  47. package/dist/lipsync-helpers/createBlendshapeQueue.js +126 -0
  48. package/dist/lipsync-helpers/createBlendshapeQueue.js.map +1 -0
  49. package/dist/lipsync-helpers/declarativeMapping.d.ts +93 -0
  50. package/dist/lipsync-helpers/declarativeMapping.d.ts.map +1 -0
  51. package/dist/lipsync-helpers/declarativeMapping.js +228 -0
  52. package/dist/lipsync-helpers/declarativeMapping.js.map +1 -0
  53. package/dist/lipsync-helpers/index.d.ts +15 -0
  54. package/dist/lipsync-helpers/index.d.ts.map +1 -0
  55. package/dist/lipsync-helpers/index.js +31 -1164
  56. package/dist/lipsync-helpers/index.js.map +1 -0
  57. package/dist/lipsync-helpers/mappingTypes.d.ts +64 -0
  58. package/dist/lipsync-helpers/mappingTypes.d.ts.map +1 -0
  59. package/dist/lipsync-helpers/mappingTypes.js +28 -0
  60. package/dist/lipsync-helpers/mappingTypes.js.map +1 -0
  61. package/dist/lipsync-helpers/metahumanOrder251.d.ts +115 -0
  62. package/dist/lipsync-helpers/metahumanOrder251.d.ts.map +1 -0
  63. package/dist/lipsync-helpers/metahumanOrder251.js +432 -0
  64. package/dist/lipsync-helpers/metahumanOrder251.js.map +1 -0
  65. package/dist/lipsync-helpers/presetMappers.d.ts +24 -0
  66. package/dist/lipsync-helpers/presetMappers.d.ts.map +1 -0
  67. package/dist/lipsync-helpers/presetMappers.js +38 -0
  68. package/dist/lipsync-helpers/presetMappers.js.map +1 -0
  69. package/dist/react/components/ConvaiWidget.d.ts +68 -0
  70. package/dist/react/components/ConvaiWidget.d.ts.map +1 -0
  71. package/dist/react/components/ConvaiWidget.js +505 -0
  72. package/dist/react/components/ConvaiWidget.js.map +1 -0
  73. package/dist/react/components/index.d.ts +2 -0
  74. package/dist/react/components/index.d.ts.map +1 -0
  75. package/dist/react/components/index.js +3 -0
  76. package/dist/react/components/index.js.map +1 -0
  77. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +10 -0
  78. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts.map +1 -0
  79. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +316 -0
  80. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js.map +1 -0
  81. package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +36 -0
  82. package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts.map +1 -0
  83. package/dist/react/components/rtc-widget/components/AudioVisualizer.js +259 -0
  84. package/dist/react/components/rtc-widget/components/AudioVisualizer.js.map +1 -0
  85. package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +10 -0
  86. package/dist/react/components/rtc-widget/components/ConviMessage.d.ts.map +1 -0
  87. package/dist/react/components/rtc-widget/components/ConviMessage.js +14 -0
  88. package/dist/react/components/rtc-widget/components/ConviMessage.js.map +1 -0
  89. package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +9 -0
  90. package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts.map +1 -0
  91. package/dist/react/components/rtc-widget/components/FloatingVideo.js +122 -0
  92. package/dist/react/components/rtc-widget/components/FloatingVideo.js.map +1 -0
  93. package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +7 -0
  94. package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts.map +1 -0
  95. package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +68 -0
  96. package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +1 -0
  97. package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +10 -0
  98. package/dist/react/components/rtc-widget/components/MessageBubble.d.ts.map +1 -0
  99. package/dist/react/components/rtc-widget/components/MessageBubble.js +23 -0
  100. package/dist/react/components/rtc-widget/components/MessageBubble.js.map +1 -0
  101. package/dist/react/components/rtc-widget/components/MessageList.d.ts +11 -0
  102. package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +1 -0
  103. package/dist/react/components/rtc-widget/components/MessageList.js +89 -0
  104. package/dist/react/components/rtc-widget/components/MessageList.js.map +1 -0
  105. package/dist/react/components/rtc-widget/components/UserMessage.d.ts +9 -0
  106. package/dist/react/components/rtc-widget/components/UserMessage.d.ts.map +1 -0
  107. package/dist/react/components/rtc-widget/components/UserMessage.js +15 -0
  108. package/dist/react/components/rtc-widget/components/UserMessage.js.map +1 -0
  109. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +6 -0
  110. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts.map +1 -0
  111. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +15 -0
  112. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js.map +1 -0
  113. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +25 -0
  114. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +1 -0
  115. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +172 -0
  116. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js.map +1 -0
  117. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +17 -0
  118. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +1 -0
  119. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +66 -0
  120. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +1 -0
  121. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +12 -0
  122. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +1 -0
  123. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +68 -0
  124. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +1 -0
  125. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +12 -0
  126. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +1 -0
  127. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +255 -0
  128. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +1 -0
  129. package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +6 -0
  130. package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts.map +1 -0
  131. package/dist/react/components/rtc-widget/components/conviComponents/index.js +6 -0
  132. package/dist/react/components/rtc-widget/components/conviComponents/index.js.map +1 -0
  133. package/dist/react/components/rtc-widget/components/index.d.ts +9 -0
  134. package/dist/react/components/rtc-widget/components/index.d.ts.map +1 -0
  135. package/dist/react/components/rtc-widget/components/index.js +15 -0
  136. package/dist/react/components/rtc-widget/components/index.js.map +1 -0
  137. package/dist/react/components/rtc-widget/index.d.ts +6 -0
  138. package/dist/react/components/rtc-widget/index.d.ts.map +1 -0
  139. package/dist/react/components/rtc-widget/index.js +9 -0
  140. package/dist/react/components/rtc-widget/index.js.map +1 -0
  141. package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +116 -0
  142. package/dist/react/components/rtc-widget/styles/framerConfig.d.ts.map +1 -0
  143. package/dist/react/components/rtc-widget/styles/framerConfig.js +73 -0
  144. package/dist/react/components/rtc-widget/styles/framerConfig.js.map +1 -0
  145. package/dist/react/components/rtc-widget/styles/icons.d.ts +28 -0
  146. package/dist/react/components/rtc-widget/styles/icons.d.ts.map +1 -0
  147. package/dist/react/components/rtc-widget/styles/icons.js +257 -0
  148. package/dist/react/components/rtc-widget/styles/icons.js.map +1 -0
  149. package/dist/react/components/rtc-widget/styles/index.d.ts +6 -0
  150. package/dist/react/components/rtc-widget/styles/index.d.ts.map +1 -0
  151. package/dist/react/components/rtc-widget/styles/index.js +9 -0
  152. package/dist/react/components/rtc-widget/styles/index.js.map +1 -0
  153. package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +90 -0
  154. package/dist/react/components/rtc-widget/styles/styledComponents.d.ts.map +1 -0
  155. package/dist/react/components/rtc-widget/styles/styledComponents.js +663 -0
  156. package/dist/react/components/rtc-widget/styles/styledComponents.js.map +1 -0
  157. package/dist/react/components/rtc-widget/styles/theme.d.ts +188 -0
  158. package/dist/react/components/rtc-widget/styles/theme.d.ts.map +1 -0
  159. package/dist/react/components/rtc-widget/styles/theme.js +290 -0
  160. package/dist/react/components/rtc-widget/styles/theme.js.map +1 -0
  161. package/dist/react/components/rtc-widget/types/index.d.ts +60 -0
  162. package/dist/react/components/rtc-widget/types/index.d.ts.map +1 -0
  163. package/dist/react/components/rtc-widget/types/index.js +2 -0
  164. package/dist/react/components/rtc-widget/types/index.js.map +1 -0
  165. package/dist/react/hooks/index.d.ts +4 -0
  166. package/dist/react/hooks/index.d.ts.map +1 -0
  167. package/dist/react/hooks/index.js +6 -0
  168. package/dist/react/hooks/index.js.map +1 -0
  169. package/dist/react/hooks/useCharacterInfo.d.ts +17 -0
  170. package/dist/react/hooks/useCharacterInfo.d.ts.map +1 -0
  171. package/dist/react/hooks/useCharacterInfo.js +60 -0
  172. package/dist/react/hooks/useCharacterInfo.js.map +1 -0
  173. package/dist/react/hooks/useConvaiClient.d.ts +35 -0
  174. package/dist/react/hooks/useConvaiClient.d.ts.map +1 -0
  175. package/dist/react/hooks/useConvaiClient.js +179 -0
  176. package/dist/react/hooks/useConvaiClient.js.map +1 -0
  177. package/dist/react/hooks/useLocalCameraTrack.d.ts +22 -0
  178. package/dist/react/hooks/useLocalCameraTrack.d.ts.map +1 -0
  179. package/dist/react/hooks/useLocalCameraTrack.js +34 -0
  180. package/dist/react/hooks/useLocalCameraTrack.js.map +1 -0
  181. package/dist/react/index.d.ts +7 -0
  182. package/dist/react/index.d.ts.map +1 -0
  183. package/dist/react/index.js +13 -0
  184. package/dist/react/index.js.map +1 -0
  185. package/dist/types/index.d.ts.map +1 -0
  186. package/dist/types/index.js +2 -0
  187. package/dist/types/index.js.map +1 -0
  188. package/dist/utils/LatencyMonitor.d.ts.map +1 -0
  189. package/dist/utils/LatencyMonitor.js +136 -0
  190. package/dist/utils/LatencyMonitor.js.map +1 -0
  191. package/dist/utils/logger.d.ts.map +1 -0
  192. package/dist/utils/logger.js +96 -0
  193. package/dist/utils/logger.js.map +1 -0
  194. package/dist/utils/speakerManagement.d.ts.map +1 -0
  195. package/dist/utils/speakerManagement.js +64 -0
  196. package/dist/utils/speakerManagement.js.map +1 -0
  197. package/dist/{types/vanilla → vanilla}/AudioRenderer.d.ts +5 -0
  198. package/dist/vanilla/AudioRenderer.d.ts.map +1 -0
  199. package/dist/vanilla/AudioRenderer.js +135 -0
  200. package/dist/vanilla/AudioRenderer.js.map +1 -0
  201. package/dist/{types/vanilla → vanilla}/ConvaiWidget.d.ts +13 -6
  202. package/dist/vanilla/ConvaiWidget.d.ts.map +1 -0
  203. package/dist/vanilla/ConvaiWidget.js +1823 -0
  204. package/dist/vanilla/ConvaiWidget.js.map +1 -0
  205. package/dist/vanilla/icons.d.ts.map +1 -0
  206. package/dist/vanilla/icons.js +222 -0
  207. package/dist/vanilla/icons.js.map +1 -0
  208. package/dist/{types/vanilla → vanilla}/index.d.ts +1 -3
  209. package/dist/vanilla/index.d.ts.map +1 -0
  210. package/dist/vanilla/index.js +20 -5509
  211. package/dist/vanilla/index.js.map +1 -0
  212. package/dist/vanilla/styles.d.ts.map +1 -0
  213. package/dist/vanilla/styles.js +287 -0
  214. package/dist/vanilla/styles.js.map +1 -0
  215. package/dist/vanilla/types.d.ts +63 -0
  216. package/dist/vanilla/types.d.ts.map +1 -0
  217. package/dist/vanilla/types.js +2 -0
  218. package/dist/vanilla/types.js.map +1 -0
  219. package/package.json +33 -38
  220. package/CHANGELOG.md +0 -165
  221. package/dist/core/index.cjs +0 -1977
  222. package/dist/lipsync-helpers/index.cjs +0 -1195
  223. package/dist/types/core/AudioManager.d.ts.map +0 -1
  224. package/dist/types/core/ConvaiClient.d.ts.map +0 -1
  225. package/dist/types/core/EventEmitter.d.ts.map +0 -1
  226. package/dist/types/core/MessageHandler.d.ts.map +0 -1
  227. package/dist/types/core/ScreenShareManager.d.ts.map +0 -1
  228. package/dist/types/core/VideoManager.d.ts.map +0 -1
  229. package/dist/types/core/index.d.ts.map +0 -1
  230. package/dist/types/core/types.d.ts.map +0 -1
  231. package/dist/types/lipsync-helpers/arkitBlendshapeHelpers.d.ts +0 -80
  232. package/dist/types/lipsync-helpers/arkitBlendshapeHelpers.d.ts.map +0 -1
  233. package/dist/types/lipsync-helpers/arkitOrder61.d.ts.map +0 -1
  234. package/dist/types/lipsync-helpers/arkitPhonemeReference.d.ts +0 -155
  235. package/dist/types/lipsync-helpers/arkitPhonemeReference.d.ts.map +0 -1
  236. package/dist/types/lipsync-helpers/index.d.ts +0 -9
  237. package/dist/types/lipsync-helpers/index.d.ts.map +0 -1
  238. package/dist/types/lipsync-helpers/neurosyncBlendshapeMapper.d.ts +0 -30
  239. package/dist/types/lipsync-helpers/neurosyncBlendshapeMapper.d.ts.map +0 -1
  240. package/dist/types/types/index.d.ts.map +0 -1
  241. package/dist/types/utils/LatencyMonitor.d.ts.map +0 -1
  242. package/dist/types/utils/logger.d.ts.map +0 -1
  243. package/dist/types/utils/speakerManagement.d.ts.map +0 -1
  244. package/dist/types/vanilla/AudioRenderer.d.ts.map +0 -1
  245. package/dist/types/vanilla/ConvaiWidget.d.ts.map +0 -1
  246. package/dist/types/vanilla/icons.d.ts.map +0 -1
  247. package/dist/types/vanilla/index.d.ts.map +0 -1
  248. package/dist/types/vanilla/styles.d.ts.map +0 -1
  249. package/dist/types/vanilla/types.d.ts +0 -106
  250. package/dist/types/vanilla/types.d.ts.map +0 -1
  251. package/dist/umd/convai.umd.js +0 -1
  252. package/dist/vanilla/index.cjs +0 -5559
  253. /package/dist/{types/core → core}/AudioManager.d.ts +0 -0
  254. /package/dist/{types/core → core}/EventEmitter.d.ts +0 -0
  255. /package/dist/{types/core → core}/ScreenShareManager.d.ts +0 -0
  256. /package/dist/{types/core → core}/VideoManager.d.ts +0 -0
  257. /package/dist/{types/lipsync-helpers → lipsync-helpers}/arkitOrder61.d.ts +0 -0
  258. /package/dist/types/{types/index.d.ts → index.d.ts} +0 -0
  259. /package/dist/{types/utils → utils}/LatencyMonitor.d.ts +0 -0
  260. /package/dist/{types/utils → utils}/logger.d.ts +0 -0
  261. /package/dist/{types/utils → utils}/speakerManagement.d.ts +0 -0
  262. /package/dist/{types/vanilla → vanilla}/icons.d.ts +0 -0
  263. /package/dist/{types/vanilla → vanilla}/styles.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createBlendshapeQueue.js","sourceRoot":"","sources":["../../src/lipsync-helpers/createBlendshapeQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA+B;IACnE,IAAI,MAAoC,CAAC;IAEzC,oCAAoC;IACpC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACzB,CAAC;SAAM,CAAC;QACN,oDAAoD;QACpD,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,IAAI,eAAe,CAAC,0BAA0B,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAwB;IAClE,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC;IAC9C,OAAO,IAAI,eAAe,CAAC,cAAc,CAAC,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CACzB,WAAmD,EACnD,YAAqD;IAErD,6CAA6C;IAC7C,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;QACjC,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;YAC5B,OAAO,sBAAsB,CAAC;QAChC,CAAC;QACD,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,0BAA0B,CAAC;QACpC,CAAC;IACH,CAAC;IAED,4CAA4C;IAC5C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAA+C;IAE/C,MAAM,MAAM,GAAG,gBAAgB,EAAE,MAAM,IAAI,KAAK,CAAC;IAEjD,OAAO;QACL,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM,EAAE,yBAAyB;KAChD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Declarative Blendshape Mapping
3
+ *
4
+ * Create mappers using a simple name-based mapping configuration.
5
+ * This is much easier than writing custom mapper functions!
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const mapping = {
10
+ * "browDownLeft": ["Brow_Drop_L"],
11
+ * "browInnerUp": ["Brow_Raise_Inner_L", "Brow_Raise_Inner_R"],
12
+ * "jawOpen": ["Jaw_Open"],
13
+ * "mouthSmileLeft": ["Mouth_Smile"],
14
+ * "mouthSmileRight": ["Mouth_Smile"], // Both map to same target (averaged)
15
+ * };
16
+ * ```
17
+ */
18
+ import type { BlendshapeMapper } from './mappingTypes';
19
+ /**
20
+ * Declarative mapping configuration
21
+ * Maps source blendshape names to target blendshape names
22
+ *
23
+ * Format: { [sourceBlendshapeName]: [targetBlendshapeName1, targetBlendshapeName2, ...] }
24
+ *
25
+ * - If multiple source names map to same target, they will be averaged
26
+ * - If one source maps to multiple targets, the value will be copied to all
27
+ */
28
+ export type BlendshapeNameMapping = {
29
+ [sourceBlendshapeName: string]: string[];
30
+ };
31
+ /**
32
+ * Optimized output structure for fast morph target updates
33
+ * Designed for maximum performance when applying to 3D models
34
+ *
35
+ * Use this format for fastest application to character:
36
+ * ```typescript
37
+ * const output = queue.getFrameAtTime(time).frame;
38
+ * // Fast iteration - names and values are parallel arrays
39
+ * for (let i = 0; i < output.names.length; i++) {
40
+ * character.setMorphTarget(output.names[i], output.values[i]);
41
+ * }
42
+ * ```
43
+ */
44
+ export interface OptimizedBlendshapeOutput {
45
+ /** Array of blendshape names in order */
46
+ names: readonly string[];
47
+ /** Array of blendshape values (parallel to names) */
48
+ values: Float32Array;
49
+ /** Map from name to index for quick lookups */
50
+ nameToIndex: ReadonlyMap<string, number>;
51
+ /** Total number of blendshapes */
52
+ length: number;
53
+ }
54
+ /**
55
+ * Create a mapper from ARKit format using declarative name mapping
56
+ *
57
+ * @param mapping - Declarative mapping object
58
+ * @param outputFormat - 'object' (default) or 'optimized'
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * const mapper = createARKitNameMapper({
63
+ * "browDownLeft": ["Brow_Drop_L"],
64
+ * "browDownRight": ["Brow_Drop_R"],
65
+ * "browInnerUp": ["Brow_Raise_Inner_L", "Brow_Raise_Inner_R"],
66
+ * "jawOpen": ["Jaw_Open"],
67
+ * "mouthSmileLeft": ["Mouth_Smile"],
68
+ * "mouthSmileRight": ["Mouth_Smile"], // Will be averaged with left
69
+ * });
70
+ * ```
71
+ */
72
+ export declare function createARKitNameMapper(mapping: BlendshapeNameMapping, outputFormat?: 'object' | 'optimized'): BlendshapeMapper;
73
+ /**
74
+ * Create a mapper from MetaHuman format using declarative name mapping
75
+ *
76
+ * @param mapping - Declarative mapping object (uses MetaHuman blendshape names)
77
+ * @param outputFormat - 'object' (default) or 'optimized'
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const mapper = createMetaHumanNameMapper({
82
+ * "CTRL_expressions_browDownL": ["Brow_Drop_L"],
83
+ * "CTRL_expressions_browDownR": ["Brow_Drop_R"],
84
+ * "CTRL_expressions_jawOpen": ["Jaw_Open"],
85
+ * });
86
+ * ```
87
+ */
88
+ export declare function createMetaHumanNameMapper(mapping: BlendshapeNameMapping, outputFormat?: 'object' | 'optimized'): BlendshapeMapper;
89
+ /**
90
+ * Helper to extract blendshape object from mapper output
91
+ */
92
+ export declare function getBlendshapeObject(output: any): Record<string, number>;
93
+ //# sourceMappingURL=declarativeMapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarativeMapping.d.ts","sourceRoot":"","sources":["../../src/lipsync-helpers/declarativeMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,yBAAyB;IACxC,yCAAyC;IACzC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,qDAAqD;IACrD,MAAM,EAAE,YAAY,CAAC;IACrB,+CAA+C;IAC/C,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,qBAAqB,EAC9B,YAAY,GAAE,QAAQ,GAAG,WAAsB,GAC9C,gBAAgB,CAgGlB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,qBAAqB,EAC9B,YAAY,GAAE,QAAQ,GAAG,WAAsB,GAC9C,gBAAgB,CAoFlB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAavE"}
@@ -0,0 +1,228 @@
1
+ /**
2
+ * Declarative Blendshape Mapping
3
+ *
4
+ * Create mappers using a simple name-based mapping configuration.
5
+ * This is much easier than writing custom mapper functions!
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const mapping = {
10
+ * "browDownLeft": ["Brow_Drop_L"],
11
+ * "browInnerUp": ["Brow_Raise_Inner_L", "Brow_Raise_Inner_R"],
12
+ * "jawOpen": ["Jaw_Open"],
13
+ * "mouthSmileLeft": ["Mouth_Smile"],
14
+ * "mouthSmileRight": ["Mouth_Smile"], // Both map to same target (averaged)
15
+ * };
16
+ * ```
17
+ */
18
+ import { ARKIT_ORDER_61 } from './arkitOrder61';
19
+ import { METAHUMAN_ORDER_251 } from './metahumanOrder251';
20
+ /**
21
+ * Create a mapper from ARKit format using declarative name mapping
22
+ *
23
+ * @param mapping - Declarative mapping object
24
+ * @param outputFormat - 'object' (default) or 'optimized'
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const mapper = createARKitNameMapper({
29
+ * "browDownLeft": ["Brow_Drop_L"],
30
+ * "browDownRight": ["Brow_Drop_R"],
31
+ * "browInnerUp": ["Brow_Raise_Inner_L", "Brow_Raise_Inner_R"],
32
+ * "jawOpen": ["Jaw_Open"],
33
+ * "mouthSmileLeft": ["Mouth_Smile"],
34
+ * "mouthSmileRight": ["Mouth_Smile"], // Will be averaged with left
35
+ * });
36
+ * ```
37
+ */
38
+ export function createARKitNameMapper(mapping, outputFormat = 'object') {
39
+ // Build reverse mapping: source index -> target names
40
+ const sourceIndexToTargets = new Map();
41
+ for (const [sourceName, targetNames] of Object.entries(mapping)) {
42
+ // Convert source name to camelCase if needed
43
+ const sourceNameVariations = [
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
+ }
122
+ }
123
+ /**
124
+ * Create a mapper from MetaHuman format using declarative name mapping
125
+ *
126
+ * @param mapping - Declarative mapping object (uses MetaHuman blendshape names)
127
+ * @param outputFormat - 'object' (default) or 'optimized'
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * const mapper = createMetaHumanNameMapper({
132
+ * "CTRL_expressions_browDownL": ["Brow_Drop_L"],
133
+ * "CTRL_expressions_browDownR": ["Brow_Drop_R"],
134
+ * "CTRL_expressions_jawOpen": ["Jaw_Open"],
135
+ * });
136
+ * ```
137
+ */
138
+ export function createMetaHumanNameMapper(mapping, outputFormat = 'object') {
139
+ // Build reverse mapping: source index -> target names
140
+ const sourceIndexToTargets = new Map();
141
+ for (const [sourceName, targetNames] of Object.entries(mapping)) {
142
+ const sourceIndex = METAHUMAN_ORDER_251.indexOf(sourceName);
143
+ if (sourceIndex === -1) {
144
+ console.warn(`[MetaHuman Name Mapper] Source blendshape "${sourceName}" not found in MetaHuman format`);
145
+ continue;
146
+ }
147
+ sourceIndexToTargets.set(sourceIndex, targetNames);
148
+ }
149
+ // Build list of unique target names
150
+ const uniqueTargets = new Set();
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);
163
+ }
164
+ }
165
+ // Pre-allocate output structures
166
+ const outputValues = new Float32Array(targetNames.length);
167
+ const nameToIndex = new Map();
168
+ targetNames.forEach((name, index) => nameToIndex.set(name, index));
169
+ 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
+ return (input) => {
195
+ const output = {};
196
+ for (const targetName of targetNames) {
197
+ const sourceIndices = targetToSources.get(targetName);
198
+ let sum = 0;
199
+ for (const srcIndex of sourceIndices) {
200
+ sum += input[srcIndex] || 0;
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;
208
+ };
209
+ }
210
+ }
211
+ /**
212
+ * Helper to extract blendshape object from mapper output
213
+ */
214
+ export function getBlendshapeObject(output) {
215
+ if (output.__blendshapeObject) {
216
+ return output.__blendshapeObject;
217
+ }
218
+ if (output.names && output.values) {
219
+ // Convert optimized format to object
220
+ const obj = {};
221
+ for (let i = 0; i < output.names.length; i++) {
222
+ obj[output.names[i]] = output.values[i];
223
+ }
224
+ return obj;
225
+ }
226
+ return {};
227
+ }
228
+ //# sourceMappingURL=declarativeMapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarativeMapping.js","sourceRoot":"","sources":["../../src/lipsync-helpers/declarativeMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAwC1D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAA8B,EAC9B,eAAuC,QAAQ;IAE/C,sDAAsD;IACtD,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEzD,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAChE,6CAA6C;QAC7C,MAAM,oBAAoB,GAAG;YAC3B,UAAU;YACV,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;SACzD,CAAC;QAEF,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC;QACrB,KAAK,MAAM,SAAS,IAAI,oBAAoB,EAAE,CAAC;YAC7C,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,SAAgB,CAAC,CAAC;YACvD,IAAI,WAAW,KAAK,CAAC,CAAC;gBAAE,MAAM;QAChC,CAAC;QAED,IAAI,WAAW,KAAK,CAAC,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,CAAC;QAC1C,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Lipsync Helpers
3
+ *
4
+ * Essential blendshape order arrays for ARKit and MetaHuman formats.
5
+ * These define the order in which blendshape values are received from Convai's server.
6
+ */
7
+ export { ARKIT_ORDER_61, STANDARD_ARKIT_ORDER, convertOrder61ToStandard, mapOrder61ToNames, getBlendshapeValueFromOrder61, getHeadRotation, getEyeRotations, getLipSyncValuesFromOrder61, getActiveBlendshapesFromOrder61, formatOrder61ForLogging, } from "./arkitOrder61";
8
+ export { METAHUMAN_ORDER_251, METAHUMAN_CATEGORIES, KEY_METAHUMAN_LIPSYNC, getMetaHumanBlendshapeName, getMetaHumanBlendshapeIndex, getMetaHumanBlendshapesByCategory, formatMetaHumanBlendshapesForLogging, } from "./metahumanOrder251";
9
+ export type { BlendshapeMapper, BlendshapeFormat, BlendshapeMappingConfig, } from "./mappingTypes";
10
+ export { PRESET_MAPPINGS, } from "./mappingTypes";
11
+ export { arkitPassthroughMapper, metahumanPassthroughMapper, identityMapper, } from "./presetMappers";
12
+ export { createBlendshapeQueue, createARKitBlendshapeQueue, createMetaHumanBlendshapeQueue, createCustomBlendshapeQueue, createPassthroughBlendshapeQueue, inferMappingFromConfig, } from "./createBlendshapeQueue";
13
+ export type { BlendshapeNameMapping, OptimizedBlendshapeOutput, } from "./declarativeMapping";
14
+ export { createARKitNameMapper, createMetaHumanNameMapper, getBlendshapeObject, } from "./declarativeMapping";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lipsync-helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAEL,cAAc,EAGd,oBAAoB,EAGpB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,eAAe,EACf,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAEL,mBAAmB,EAGnB,oBAAoB,EAGpB,qBAAqB,EAGrB,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,EACjC,oCAAoC,GACrC,MAAM,qBAAqB,CAAC;AAM7B,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAMjC,YAAY,EACV,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}