@celljs/ta-web 4.27.0 → 4.29.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.
Files changed (586) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-role.d.ts +9 -4
  4. package/esm/browser/assistant/assistant-role.js +17 -5
  5. package/esm/browser/assistant/assistant-task-util.d.ts +6 -0
  6. package/esm/browser/assistant/assistant-task-util.js +12 -1
  7. package/esm/browser/assistant/assistant-thread.js +15 -2
  8. package/esm/browser/assistant/assistant-view.js +4 -1
  9. package/esm/browser/assistant/assistant.d.ts +2 -1
  10. package/esm/browser/assistant/assistant.js +9 -7
  11. package/esm/browser/assistant/call-conversing.d.ts +45 -0
  12. package/esm/browser/assistant/call-conversing.js +91 -0
  13. package/esm/browser/assistant/call-face.d.ts +13 -0
  14. package/esm/browser/assistant/call-face.js +81 -0
  15. package/esm/browser/assistant/call-keeper.d.ts +8 -4
  16. package/esm/browser/assistant/call-keeper.js +32 -11
  17. package/esm/browser/assistant/call-partnering.d.ts +37 -0
  18. package/esm/browser/assistant/call-partnering.js +79 -0
  19. package/esm/browser/assistant/call-scenes.d.ts +26 -0
  20. package/esm/browser/assistant/call-scenes.js +85 -0
  21. package/esm/browser/assistant/call-screen.d.ts +3 -0
  22. package/esm/browser/assistant/call-screen.js +15 -0
  23. package/esm/browser/assistant/mic-sense.d.ts +31 -0
  24. package/esm/browser/assistant/mic-sense.js +119 -0
  25. package/esm/browser/assistant/noise-gate.d.ts +32 -0
  26. package/esm/browser/assistant/noise-gate.js +66 -0
  27. package/esm/browser/assistant/pcm-util.d.ts +10 -0
  28. package/esm/browser/assistant/pcm-util.js +55 -0
  29. package/esm/browser/assistant/read-aloud.d.ts +2 -1
  30. package/esm/browser/assistant/realtime-voice-protocol.d.ts +84 -0
  31. package/esm/browser/assistant/realtime-voice-protocol.js +40 -0
  32. package/esm/browser/assistant/realtime-voice.d.ts +50 -62
  33. package/esm/browser/assistant/realtime-voice.js +213 -134
  34. package/esm/browser/assistant/spoken-timeline.d.ts +27 -0
  35. package/esm/browser/assistant/spoken-timeline.js +49 -0
  36. package/esm/browser/assistant/voice-call-bar.d.ts +9 -2
  37. package/esm/browser/assistant/voice-call-bar.js +81 -31
  38. package/esm/browser/assistant/voice-call-protocol.d.ts +61 -4
  39. package/esm/browser/assistant/voice-call.d.ts +16 -23
  40. package/esm/browser/assistant/voice-call.js +134 -117
  41. package/esm/browser/assistant/voice-reading.d.ts +83 -0
  42. package/esm/browser/assistant/voice-reading.js +150 -0
  43. package/esm/browser/avatar/dino-talk.d.ts +15 -0
  44. package/esm/browser/avatar/dino-talk.js +34 -0
  45. package/esm/browser/chat/chat-protocol.d.ts +2 -0
  46. package/esm/browser/chat/chat-shown.d.ts +3 -1
  47. package/esm/browser/chat/chat-shown.js +25 -3
  48. package/esm/browser/chat/chat.d.ts +5 -1
  49. package/esm/browser/chat/chat.js +32 -16
  50. package/esm/browser/components/account-menu.d.ts +6 -16
  51. package/esm/browser/components/account-menu.js +47 -101
  52. package/esm/browser/components/app-contexts.js +3 -2
  53. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  54. package/esm/browser/components/composer-box-protocol.d.ts +2 -0
  55. package/esm/browser/components/composer-box.js +20 -1
  56. package/esm/browser/components/composer-emoji.d.ts +22 -0
  57. package/esm/browser/components/composer-emoji.js +50 -0
  58. package/esm/browser/components/conversation-scroll-util.d.ts +8 -1
  59. package/esm/browser/components/conversation-scroll-util.js +21 -0
  60. package/esm/browser/components/conversation-scroll.js +10 -11
  61. package/esm/browser/components/discover-view.d.ts +4 -3
  62. package/esm/browser/components/discover-view.js +5 -4
  63. package/esm/browser/components/emoji-panel.d.ts +22 -0
  64. package/esm/browser/components/emoji-panel.js +54 -0
  65. package/esm/browser/components/gallery.js +28 -7
  66. package/esm/browser/components/host-view.d.ts +1 -1
  67. package/esm/browser/components/image-pull.d.ts +64 -0
  68. package/esm/browser/components/image-pull.js +202 -0
  69. package/esm/browser/components/kept-call-bar.js +2 -1
  70. package/esm/browser/components/lightbox.d.ts +1 -1
  71. package/esm/browser/components/lightbox.js +57 -2
  72. package/esm/browser/components/markdown.d.ts +8 -1
  73. package/esm/browser/components/markdown.js +12 -4
  74. package/esm/browser/components/me-rows.d.ts +24 -0
  75. package/esm/browser/components/me-rows.js +19 -0
  76. package/esm/browser/components/me-view.d.ts +2 -1
  77. package/esm/browser/components/me-view.js +3 -2
  78. package/esm/browser/components/message-list.js +47 -7
  79. package/esm/browser/components/message-steps.js +13 -0
  80. package/esm/browser/components/nav-places.js +1 -1
  81. package/esm/browser/components/partner-row.js +2 -1
  82. package/esm/browser/components/relay-services.d.ts +9 -3
  83. package/esm/browser/components/relay-services.js +73 -35
  84. package/esm/browser/components/session-view.js +4 -2
  85. package/esm/browser/components/settings-choices.js +3 -0
  86. package/esm/browser/components/settings-controls.d.ts +13 -0
  87. package/esm/browser/components/settings-controls.js +19 -0
  88. package/esm/browser/components/settings-more.d.ts +1 -1
  89. package/esm/browser/components/settings-more.js +28 -39
  90. package/esm/browser/components/settings-parts.d.ts +4 -2
  91. package/esm/browser/components/settings-parts.js +16 -9
  92. package/esm/browser/components/settings-view.js +2 -6
  93. package/esm/browser/components/ta-avatar.d.ts +15 -1
  94. package/esm/browser/components/ta-avatar.js +38 -5
  95. package/esm/browser/components/voice-services.js +6 -1
  96. package/esm/browser/components/web-composer.d.ts +1 -1
  97. package/esm/browser/components/web-composer.js +2 -2
  98. package/esm/browser/device/file-save.d.ts +31 -0
  99. package/esm/browser/device/file-save.js +80 -0
  100. package/esm/browser/extension/extension-view.d.ts +2 -0
  101. package/esm/browser/extension/extension-view.js +2 -0
  102. package/esm/browser/extension/web-api-call.d.ts +109 -2
  103. package/esm/browser/extension/web-api-components.d.ts +4 -0
  104. package/esm/browser/extension/web-api-contributions.d.ts +14 -14
  105. package/esm/browser/extension/web-api-desktop.d.ts +16 -1
  106. package/esm/browser/extension/web-api-desktop.js +1 -0
  107. package/esm/browser/extension/web-api-partners.d.ts +2 -0
  108. package/esm/browser/extension/web-extension-api.d.ts +8 -10
  109. package/esm/browser/extension/web-extension-code.d.ts +15 -8
  110. package/esm/browser/extension/web-extension-code.js +25 -27
  111. package/esm/browser/extension/web-extension-context.js +4 -0
  112. package/esm/browser/extension/web-extension-protocol.d.ts +10 -1
  113. package/esm/browser/extension/web-extension-protocol.js +1 -0
  114. package/esm/browser/extension/web-extension-run.d.ts +4 -2
  115. package/esm/browser/extension/web-extension-run.js +10 -4
  116. package/esm/browser/extension/web-extensions-running.js +7 -6
  117. package/esm/browser/extension/web-pages.d.ts +2 -0
  118. package/esm/browser/extension/web-pages.js +2 -0
  119. package/esm/browser/i18n/en/account.d.ts +202 -0
  120. package/esm/browser/i18n/en/account.js +205 -0
  121. package/esm/browser/i18n/en/assistant.d.ts +129 -0
  122. package/esm/browser/i18n/en/assistant.js +130 -0
  123. package/esm/browser/i18n/en/call.d.ts +86 -0
  124. package/esm/browser/i18n/en/call.js +87 -0
  125. package/esm/browser/i18n/en/chat.d.ts +213 -0
  126. package/esm/browser/i18n/en/chat.js +214 -0
  127. package/esm/browser/i18n/en/common.d.ts +99 -0
  128. package/esm/browser/i18n/en/common.js +101 -0
  129. package/esm/browser/i18n/en/console.d.ts +230 -0
  130. package/esm/browser/i18n/en/console.js +232 -0
  131. package/esm/browser/i18n/en/discover.d.ts +117 -0
  132. package/esm/browser/i18n/en/discover.js +119 -0
  133. package/esm/browser/i18n/en/service.d.ts +242 -0
  134. package/esm/browser/i18n/en/service.js +245 -0
  135. package/esm/browser/i18n/en/settings.d.ts +213 -0
  136. package/esm/browser/i18n/en/settings.js +214 -0
  137. package/esm/browser/i18n/en/tools.d.ts +85 -0
  138. package/esm/browser/i18n/en/tools.js +87 -0
  139. package/esm/browser/i18n/ja/account.d.ts +2 -0
  140. package/esm/browser/i18n/ja/account.js +202 -0
  141. package/esm/browser/i18n/ja/assistant.d.ts +2 -0
  142. package/esm/browser/i18n/ja/assistant.js +129 -0
  143. package/esm/browser/i18n/ja/call.d.ts +2 -0
  144. package/esm/browser/i18n/ja/call.js +86 -0
  145. package/esm/browser/i18n/ja/chat.d.ts +2 -0
  146. package/esm/browser/i18n/ja/chat.js +213 -0
  147. package/esm/browser/i18n/ja/common.d.ts +2 -0
  148. package/esm/browser/i18n/ja/common.js +99 -0
  149. package/esm/browser/i18n/ja/console.d.ts +2 -0
  150. package/esm/browser/i18n/ja/console.js +230 -0
  151. package/esm/browser/i18n/ja/discover.d.ts +2 -0
  152. package/esm/browser/i18n/ja/discover.js +117 -0
  153. package/esm/browser/i18n/ja/service.d.ts +2 -0
  154. package/esm/browser/i18n/ja/service.js +242 -0
  155. package/esm/browser/i18n/ja/settings.d.ts +2 -0
  156. package/esm/browser/i18n/ja/settings.js +213 -0
  157. package/esm/browser/i18n/ja/tools.d.ts +2 -0
  158. package/esm/browser/i18n/ja/tools.js +85 -0
  159. package/esm/browser/i18n/locales.d.ts +1150 -1131
  160. package/esm/browser/i18n/messages-ja.js +20 -1567
  161. package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
  162. package/esm/browser/i18n/messages-zh-tw.js +20 -1568
  163. package/esm/browser/i18n/messages.d.ts +1153 -1131
  164. package/esm/browser/i18n/messages.js +44 -3145
  165. package/esm/browser/i18n/zh/account.d.ts +2 -0
  166. package/esm/browser/i18n/zh/account.js +203 -0
  167. package/esm/browser/i18n/zh/assistant.d.ts +2 -0
  168. package/esm/browser/i18n/zh/assistant.js +129 -0
  169. package/esm/browser/i18n/zh/call.d.ts +2 -0
  170. package/esm/browser/i18n/zh/call.js +86 -0
  171. package/esm/browser/i18n/zh/chat.d.ts +2 -0
  172. package/esm/browser/i18n/zh/chat.js +213 -0
  173. package/esm/browser/i18n/zh/common.d.ts +2 -0
  174. package/esm/browser/i18n/zh/common.js +99 -0
  175. package/esm/browser/i18n/zh/console.d.ts +2 -0
  176. package/esm/browser/i18n/zh/console.js +230 -0
  177. package/esm/browser/i18n/zh/discover.d.ts +2 -0
  178. package/esm/browser/i18n/zh/discover.js +117 -0
  179. package/esm/browser/i18n/zh/service.d.ts +2 -0
  180. package/esm/browser/i18n/zh/service.js +242 -0
  181. package/esm/browser/i18n/zh/settings.d.ts +2 -0
  182. package/esm/browser/i18n/zh/settings.js +213 -0
  183. package/esm/browser/i18n/zh/tools.d.ts +2 -0
  184. package/esm/browser/i18n/zh/tools.js +86 -0
  185. package/esm/browser/i18n/zh-tw/account.d.ts +2 -0
  186. package/esm/browser/i18n/zh-tw/account.js +202 -0
  187. package/esm/browser/i18n/zh-tw/assistant.d.ts +2 -0
  188. package/esm/browser/i18n/zh-tw/assistant.js +129 -0
  189. package/esm/browser/i18n/zh-tw/call.d.ts +2 -0
  190. package/esm/browser/i18n/zh-tw/call.js +86 -0
  191. package/esm/browser/i18n/zh-tw/chat.d.ts +2 -0
  192. package/esm/browser/i18n/zh-tw/chat.js +213 -0
  193. package/esm/browser/i18n/zh-tw/common.d.ts +2 -0
  194. package/esm/browser/i18n/zh-tw/common.js +99 -0
  195. package/esm/browser/i18n/zh-tw/console.d.ts +2 -0
  196. package/esm/browser/i18n/zh-tw/console.js +230 -0
  197. package/esm/browser/i18n/zh-tw/discover.d.ts +2 -0
  198. package/esm/browser/i18n/zh-tw/discover.js +117 -0
  199. package/esm/browser/i18n/zh-tw/service.d.ts +2 -0
  200. package/esm/browser/i18n/zh-tw/service.js +242 -0
  201. package/esm/browser/i18n/zh-tw/settings.d.ts +2 -0
  202. package/esm/browser/i18n/zh-tw/settings.js +213 -0
  203. package/esm/browser/i18n/zh-tw/tools.d.ts +2 -0
  204. package/esm/browser/i18n/zh-tw/tools.js +85 -0
  205. package/esm/browser/markdown/code-renderers.d.ts +2 -0
  206. package/esm/browser/markdown/code-renderers.js +2 -0
  207. package/esm/browser/offline/device-values.d.ts +4 -0
  208. package/esm/browser/offline/device-values.js +10 -0
  209. package/esm/browser/pwa/page-build.d.ts +15 -0
  210. package/esm/browser/pwa/page-build.js +45 -0
  211. package/esm/browser/screen/page-answers.d.ts +2 -1
  212. package/esm/browser/screen/page-answers.js +7 -4
  213. package/esm/browser/settings/settings-protocol.d.ts +4 -0
  214. package/esm/browser/settings/settings-protocol.js +4 -0
  215. package/esm/browser/style/base.d.ts +1 -1
  216. package/esm/browser/style/base.js +3 -0
  217. package/esm/browser/style/chat-list.d.ts +1 -1
  218. package/esm/browser/style/chat-list.js +1 -1
  219. package/esm/browser/style/conversation-column.d.ts +1 -1
  220. package/esm/browser/style/conversation-column.js +17 -0
  221. package/esm/browser/style/conversation.d.ts +1 -1
  222. package/esm/browser/style/conversation.js +11 -1
  223. package/esm/browser/style/device.js +1 -0
  224. package/esm/browser/style/dialogs.d.ts +1 -1
  225. package/esm/browser/style/dialogs.js +1 -1
  226. package/esm/browser/style/layout.d.ts +1 -1
  227. package/esm/browser/style/layout.js +135 -57
  228. package/esm/browser/style/pages.d.ts +1 -1
  229. package/esm/browser/style/pages.js +0 -7
  230. package/esm/browser/style/shell.d.ts +1 -1
  231. package/esm/browser/style/shell.js +8 -0
  232. package/esm/browser/style/video-call.d.ts +2 -0
  233. package/esm/browser/style/video-call.js +63 -0
  234. package/esm/browser/style.js +2 -0
  235. package/esm/browser/util/call-transcript.d.ts +16 -0
  236. package/esm/browser/util/call-transcript.js +110 -0
  237. package/esm/browser/util/desktop.d.ts +10 -1
  238. package/esm/browser/util/desktop.js +10 -0
  239. package/esm/browser/util/image-pull.d.ts +61 -0
  240. package/esm/browser/util/image-pull.js +88 -0
  241. package/esm/browser/util/process.d.ts +6 -0
  242. package/esm/browser/util/process.js +18 -5
  243. package/esm/browser/util/spoken.d.ts +3 -3
  244. package/esm/browser/util/spoken.js +4 -4
  245. package/esm/browser/video-call/call-camera.d.ts +59 -0
  246. package/esm/browser/video-call/call-camera.js +188 -0
  247. package/esm/browser/video-call/call-people.d.ts +21 -0
  248. package/esm/browser/video-call/call-people.js +29 -0
  249. package/esm/browser/video-call/call-window.d.ts +19 -0
  250. package/esm/browser/video-call/call-window.js +80 -0
  251. package/esm/browser/video-call/clip-plan.d.ts +56 -0
  252. package/esm/browser/video-call/clip-plan.js +76 -0
  253. package/esm/browser/video-call/face-camera.d.ts +93 -0
  254. package/esm/browser/video-call/face-camera.js +192 -0
  255. package/esm/browser/video-call/face-files.d.ts +69 -0
  256. package/esm/browser/video-call/face-files.js +132 -0
  257. package/esm/browser/video-call/face-moves.d.ts +68 -0
  258. package/esm/browser/video-call/face-moves.js +180 -0
  259. package/esm/browser/video-call/face-stage.d.ts +139 -0
  260. package/esm/browser/video-call/face-stage.js +219 -0
  261. package/esm/browser/video-call/mouth-layer.d.ts +81 -0
  262. package/esm/browser/video-call/mouth-layer.js +241 -0
  263. package/esm/browser/video-call/video-call-view.d.ts +19 -0
  264. package/esm/browser/video-call/video-call-view.js +254 -0
  265. package/esm/browser/video-call/video-face.d.ts +19 -0
  266. package/esm/browser/video-call/video-face.js +471 -0
  267. package/esm/browser/workbench-hosts.d.ts +1 -0
  268. package/esm/browser/workbench-protocol.d.ts +2 -0
  269. package/esm/browser/workbench-util.d.ts +5 -0
  270. package/esm/browser/workbench-util.js +18 -0
  271. package/esm/browser/workbench.d.ts +14 -0
  272. package/esm/browser/workbench.js +73 -6
  273. package/lib/browser/assistant/assistant-role.d.ts +9 -4
  274. package/lib/browser/assistant/assistant-role.js +17 -5
  275. package/lib/browser/assistant/assistant-task-util.d.ts +6 -0
  276. package/lib/browser/assistant/assistant-task-util.js +11 -0
  277. package/lib/browser/assistant/assistant-thread.js +15 -2
  278. package/lib/browser/assistant/assistant-view.js +3 -0
  279. package/lib/browser/assistant/assistant.d.ts +2 -1
  280. package/lib/browser/assistant/assistant.js +9 -7
  281. package/lib/browser/assistant/call-conversing.d.ts +46 -0
  282. package/lib/browser/assistant/call-conversing.js +96 -0
  283. package/lib/browser/assistant/call-face.d.ts +14 -0
  284. package/lib/browser/assistant/call-face.js +117 -0
  285. package/lib/browser/assistant/call-keeper.d.ts +8 -4
  286. package/lib/browser/assistant/call-keeper.js +32 -11
  287. package/lib/browser/assistant/call-partnering.d.ts +38 -0
  288. package/lib/browser/assistant/call-partnering.js +83 -0
  289. package/lib/browser/assistant/call-scenes.d.ts +27 -0
  290. package/lib/browser/assistant/call-scenes.js +88 -0
  291. package/lib/browser/assistant/call-screen.d.ts +3 -0
  292. package/lib/browser/assistant/call-screen.js +15 -0
  293. package/lib/browser/assistant/mic-sense.d.ts +32 -0
  294. package/lib/browser/assistant/mic-sense.js +123 -0
  295. package/lib/browser/assistant/noise-gate.d.ts +33 -0
  296. package/lib/browser/assistant/noise-gate.js +71 -0
  297. package/lib/browser/assistant/pcm-util.d.ts +11 -0
  298. package/lib/browser/assistant/pcm-util.js +58 -0
  299. package/lib/browser/assistant/read-aloud.d.ts +2 -1
  300. package/lib/browser/assistant/realtime-voice-protocol.d.ts +85 -0
  301. package/lib/browser/assistant/realtime-voice-protocol.js +43 -0
  302. package/lib/browser/assistant/realtime-voice.d.ts +50 -62
  303. package/lib/browser/assistant/realtime-voice.js +217 -138
  304. package/lib/browser/assistant/spoken-timeline.d.ts +28 -0
  305. package/lib/browser/assistant/spoken-timeline.js +53 -0
  306. package/lib/browser/assistant/voice-call-bar.d.ts +9 -2
  307. package/lib/browser/assistant/voice-call-bar.js +81 -30
  308. package/lib/browser/assistant/voice-call-protocol.d.ts +61 -4
  309. package/lib/browser/assistant/voice-call.d.ts +16 -23
  310. package/lib/browser/assistant/voice-call.js +134 -117
  311. package/lib/browser/assistant/voice-reading.d.ts +84 -0
  312. package/lib/browser/assistant/voice-reading.js +156 -0
  313. package/lib/browser/avatar/dino-talk.d.ts +16 -0
  314. package/lib/browser/avatar/dino-talk.js +37 -0
  315. package/lib/browser/chat/chat-protocol.d.ts +2 -0
  316. package/lib/browser/chat/chat-shown.d.ts +3 -1
  317. package/lib/browser/chat/chat-shown.js +25 -3
  318. package/lib/browser/chat/chat.d.ts +5 -1
  319. package/lib/browser/chat/chat.js +32 -16
  320. package/lib/browser/components/account-menu.d.ts +6 -16
  321. package/lib/browser/components/account-menu.js +45 -99
  322. package/lib/browser/components/app-contexts.js +2 -1
  323. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  324. package/lib/browser/components/composer-box-protocol.d.ts +2 -0
  325. package/lib/browser/components/composer-box.js +20 -1
  326. package/lib/browser/components/composer-emoji.d.ts +23 -0
  327. package/lib/browser/components/composer-emoji.js +87 -0
  328. package/lib/browser/components/conversation-scroll-util.d.ts +8 -1
  329. package/lib/browser/components/conversation-scroll-util.js +21 -0
  330. package/lib/browser/components/conversation-scroll.js +10 -11
  331. package/lib/browser/components/discover-view.d.ts +4 -3
  332. package/lib/browser/components/discover-view.js +5 -4
  333. package/lib/browser/components/emoji-panel.d.ts +23 -0
  334. package/lib/browser/components/emoji-panel.js +90 -0
  335. package/lib/browser/components/gallery.js +28 -7
  336. package/lib/browser/components/host-view.d.ts +1 -1
  337. package/lib/browser/components/image-pull.d.ts +65 -0
  338. package/lib/browser/components/image-pull.js +206 -0
  339. package/lib/browser/components/kept-call-bar.js +2 -1
  340. package/lib/browser/components/lightbox.d.ts +1 -1
  341. package/lib/browser/components/lightbox.js +57 -2
  342. package/lib/browser/components/markdown.d.ts +8 -1
  343. package/lib/browser/components/markdown.js +11 -3
  344. package/lib/browser/components/me-rows.d.ts +25 -0
  345. package/lib/browser/components/me-rows.js +22 -0
  346. package/lib/browser/components/me-view.d.ts +2 -1
  347. package/lib/browser/components/me-view.js +3 -2
  348. package/lib/browser/components/message-list.js +46 -6
  349. package/lib/browser/components/message-steps.js +13 -0
  350. package/lib/browser/components/nav-places.js +1 -1
  351. package/lib/browser/components/partner-row.js +2 -1
  352. package/lib/browser/components/relay-services.d.ts +9 -3
  353. package/lib/browser/components/relay-services.js +71 -33
  354. package/lib/browser/components/session-view.js +3 -1
  355. package/lib/browser/components/settings-choices.js +3 -0
  356. package/lib/browser/components/settings-controls.d.ts +13 -0
  357. package/lib/browser/components/settings-controls.js +19 -0
  358. package/lib/browser/components/settings-more.d.ts +1 -1
  359. package/lib/browser/components/settings-more.js +27 -38
  360. package/lib/browser/components/settings-parts.d.ts +4 -2
  361. package/lib/browser/components/settings-parts.js +15 -8
  362. package/lib/browser/components/settings-view.js +2 -6
  363. package/lib/browser/components/ta-avatar.d.ts +15 -1
  364. package/lib/browser/components/ta-avatar.js +38 -5
  365. package/lib/browser/components/voice-services.js +5 -0
  366. package/lib/browser/components/web-composer.d.ts +1 -1
  367. package/lib/browser/components/web-composer.js +2 -2
  368. package/lib/browser/device/file-save.d.ts +32 -0
  369. package/lib/browser/device/file-save.js +83 -0
  370. package/lib/browser/extension/extension-view.d.ts +2 -0
  371. package/lib/browser/extension/extension-view.js +3 -1
  372. package/lib/browser/extension/web-api-call.d.ts +109 -2
  373. package/lib/browser/extension/web-api-components.d.ts +4 -0
  374. package/lib/browser/extension/web-api-contributions.d.ts +14 -14
  375. package/lib/browser/extension/web-api-desktop.d.ts +16 -1
  376. package/lib/browser/extension/web-api-desktop.js +1 -0
  377. package/lib/browser/extension/web-api-partners.d.ts +2 -0
  378. package/lib/browser/extension/web-extension-api.d.ts +8 -10
  379. package/lib/browser/extension/web-extension-code.d.ts +15 -8
  380. package/lib/browser/extension/web-extension-code.js +25 -27
  381. package/lib/browser/extension/web-extension-context.js +4 -0
  382. package/lib/browser/extension/web-extension-protocol.d.ts +10 -1
  383. package/lib/browser/extension/web-extension-protocol.js +1 -0
  384. package/lib/browser/extension/web-extension-run.d.ts +4 -2
  385. package/lib/browser/extension/web-extension-run.js +10 -4
  386. package/lib/browser/extension/web-extensions-running.js +7 -6
  387. package/lib/browser/extension/web-pages.d.ts +2 -0
  388. package/lib/browser/extension/web-pages.js +2 -0
  389. package/lib/browser/i18n/en/account.d.ts +203 -0
  390. package/lib/browser/i18n/en/account.js +208 -0
  391. package/lib/browser/i18n/en/assistant.d.ts +130 -0
  392. package/lib/browser/i18n/en/assistant.js +133 -0
  393. package/lib/browser/i18n/en/call.d.ts +87 -0
  394. package/lib/browser/i18n/en/call.js +90 -0
  395. package/lib/browser/i18n/en/chat.d.ts +214 -0
  396. package/lib/browser/i18n/en/chat.js +217 -0
  397. package/lib/browser/i18n/en/common.d.ts +100 -0
  398. package/lib/browser/i18n/en/common.js +104 -0
  399. package/lib/browser/i18n/en/console.d.ts +231 -0
  400. package/lib/browser/i18n/en/console.js +235 -0
  401. package/lib/browser/i18n/en/discover.d.ts +118 -0
  402. package/lib/browser/i18n/en/discover.js +122 -0
  403. package/lib/browser/i18n/en/service.d.ts +243 -0
  404. package/lib/browser/i18n/en/service.js +248 -0
  405. package/lib/browser/i18n/en/settings.d.ts +214 -0
  406. package/lib/browser/i18n/en/settings.js +217 -0
  407. package/lib/browser/i18n/en/tools.d.ts +86 -0
  408. package/lib/browser/i18n/en/tools.js +90 -0
  409. package/lib/browser/i18n/ja/account.d.ts +3 -0
  410. package/lib/browser/i18n/ja/account.js +205 -0
  411. package/lib/browser/i18n/ja/assistant.d.ts +3 -0
  412. package/lib/browser/i18n/ja/assistant.js +132 -0
  413. package/lib/browser/i18n/ja/call.d.ts +3 -0
  414. package/lib/browser/i18n/ja/call.js +89 -0
  415. package/lib/browser/i18n/ja/chat.d.ts +3 -0
  416. package/lib/browser/i18n/ja/chat.js +216 -0
  417. package/lib/browser/i18n/ja/common.d.ts +3 -0
  418. package/lib/browser/i18n/ja/common.js +102 -0
  419. package/lib/browser/i18n/ja/console.d.ts +3 -0
  420. package/lib/browser/i18n/ja/console.js +233 -0
  421. package/lib/browser/i18n/ja/discover.d.ts +3 -0
  422. package/lib/browser/i18n/ja/discover.js +120 -0
  423. package/lib/browser/i18n/ja/service.d.ts +3 -0
  424. package/lib/browser/i18n/ja/service.js +245 -0
  425. package/lib/browser/i18n/ja/settings.d.ts +3 -0
  426. package/lib/browser/i18n/ja/settings.js +216 -0
  427. package/lib/browser/i18n/ja/tools.d.ts +3 -0
  428. package/lib/browser/i18n/ja/tools.js +88 -0
  429. package/lib/browser/i18n/locales.d.ts +1150 -1131
  430. package/lib/browser/i18n/messages-ja.js +20 -1567
  431. package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
  432. package/lib/browser/i18n/messages-zh-tw.js +20 -1568
  433. package/lib/browser/i18n/messages.d.ts +1153 -1131
  434. package/lib/browser/i18n/messages.js +44 -3145
  435. package/lib/browser/i18n/zh/account.d.ts +3 -0
  436. package/lib/browser/i18n/zh/account.js +206 -0
  437. package/lib/browser/i18n/zh/assistant.d.ts +3 -0
  438. package/lib/browser/i18n/zh/assistant.js +132 -0
  439. package/lib/browser/i18n/zh/call.d.ts +3 -0
  440. package/lib/browser/i18n/zh/call.js +89 -0
  441. package/lib/browser/i18n/zh/chat.d.ts +3 -0
  442. package/lib/browser/i18n/zh/chat.js +216 -0
  443. package/lib/browser/i18n/zh/common.d.ts +3 -0
  444. package/lib/browser/i18n/zh/common.js +102 -0
  445. package/lib/browser/i18n/zh/console.d.ts +3 -0
  446. package/lib/browser/i18n/zh/console.js +233 -0
  447. package/lib/browser/i18n/zh/discover.d.ts +3 -0
  448. package/lib/browser/i18n/zh/discover.js +120 -0
  449. package/lib/browser/i18n/zh/service.d.ts +3 -0
  450. package/lib/browser/i18n/zh/service.js +245 -0
  451. package/lib/browser/i18n/zh/settings.d.ts +3 -0
  452. package/lib/browser/i18n/zh/settings.js +216 -0
  453. package/lib/browser/i18n/zh/tools.d.ts +3 -0
  454. package/lib/browser/i18n/zh/tools.js +89 -0
  455. package/lib/browser/i18n/zh-tw/account.d.ts +3 -0
  456. package/lib/browser/i18n/zh-tw/account.js +205 -0
  457. package/lib/browser/i18n/zh-tw/assistant.d.ts +3 -0
  458. package/lib/browser/i18n/zh-tw/assistant.js +132 -0
  459. package/lib/browser/i18n/zh-tw/call.d.ts +3 -0
  460. package/lib/browser/i18n/zh-tw/call.js +89 -0
  461. package/lib/browser/i18n/zh-tw/chat.d.ts +3 -0
  462. package/lib/browser/i18n/zh-tw/chat.js +216 -0
  463. package/lib/browser/i18n/zh-tw/common.d.ts +3 -0
  464. package/lib/browser/i18n/zh-tw/common.js +102 -0
  465. package/lib/browser/i18n/zh-tw/console.d.ts +3 -0
  466. package/lib/browser/i18n/zh-tw/console.js +233 -0
  467. package/lib/browser/i18n/zh-tw/discover.d.ts +3 -0
  468. package/lib/browser/i18n/zh-tw/discover.js +120 -0
  469. package/lib/browser/i18n/zh-tw/service.d.ts +3 -0
  470. package/lib/browser/i18n/zh-tw/service.js +245 -0
  471. package/lib/browser/i18n/zh-tw/settings.d.ts +3 -0
  472. package/lib/browser/i18n/zh-tw/settings.js +216 -0
  473. package/lib/browser/i18n/zh-tw/tools.d.ts +3 -0
  474. package/lib/browser/i18n/zh-tw/tools.js +88 -0
  475. package/lib/browser/markdown/code-renderers.d.ts +2 -0
  476. package/lib/browser/markdown/code-renderers.js +3 -1
  477. package/lib/browser/offline/device-values.d.ts +4 -0
  478. package/lib/browser/offline/device-values.js +10 -0
  479. package/lib/browser/pwa/page-build.d.ts +16 -0
  480. package/lib/browser/pwa/page-build.js +48 -0
  481. package/lib/browser/screen/page-answers.d.ts +2 -1
  482. package/lib/browser/screen/page-answers.js +7 -4
  483. package/lib/browser/settings/settings-protocol.d.ts +4 -0
  484. package/lib/browser/settings/settings-protocol.js +4 -0
  485. package/lib/browser/style/base.d.ts +1 -1
  486. package/lib/browser/style/base.js +3 -0
  487. package/lib/browser/style/chat-list.d.ts +1 -1
  488. package/lib/browser/style/chat-list.js +1 -1
  489. package/lib/browser/style/conversation-column.d.ts +1 -1
  490. package/lib/browser/style/conversation-column.js +17 -0
  491. package/lib/browser/style/conversation.d.ts +1 -1
  492. package/lib/browser/style/conversation.js +11 -1
  493. package/lib/browser/style/device.js +1 -0
  494. package/lib/browser/style/dialogs.d.ts +1 -1
  495. package/lib/browser/style/dialogs.js +1 -1
  496. package/lib/browser/style/layout.d.ts +1 -1
  497. package/lib/browser/style/layout.js +135 -57
  498. package/lib/browser/style/pages.d.ts +1 -1
  499. package/lib/browser/style/pages.js +0 -7
  500. package/lib/browser/style/shell.d.ts +1 -1
  501. package/lib/browser/style/shell.js +8 -0
  502. package/lib/browser/style/video-call.d.ts +3 -0
  503. package/lib/browser/style/video-call.js +66 -0
  504. package/lib/browser/style.js +2 -0
  505. package/lib/browser/util/call-transcript.d.ts +17 -0
  506. package/lib/browser/util/call-transcript.js +113 -0
  507. package/lib/browser/util/desktop.d.ts +10 -1
  508. package/lib/browser/util/desktop.js +10 -0
  509. package/lib/browser/util/image-pull.d.ts +62 -0
  510. package/lib/browser/util/image-pull.js +91 -0
  511. package/lib/browser/util/process.d.ts +6 -0
  512. package/lib/browser/util/process.js +17 -4
  513. package/lib/browser/util/spoken.d.ts +3 -3
  514. package/lib/browser/util/spoken.js +4 -4
  515. package/lib/browser/video-call/call-camera.d.ts +60 -0
  516. package/lib/browser/video-call/call-camera.js +192 -0
  517. package/lib/browser/video-call/call-people.d.ts +22 -0
  518. package/lib/browser/video-call/call-people.js +32 -0
  519. package/lib/browser/video-call/call-window.d.ts +20 -0
  520. package/lib/browser/video-call/call-window.js +83 -0
  521. package/lib/browser/video-call/clip-plan.d.ts +57 -0
  522. package/lib/browser/video-call/clip-plan.js +80 -0
  523. package/lib/browser/video-call/face-camera.d.ts +94 -0
  524. package/lib/browser/video-call/face-camera.js +197 -0
  525. package/lib/browser/video-call/face-files.d.ts +70 -0
  526. package/lib/browser/video-call/face-files.js +137 -0
  527. package/lib/browser/video-call/face-moves.d.ts +69 -0
  528. package/lib/browser/video-call/face-moves.js +184 -0
  529. package/lib/browser/video-call/face-stage.d.ts +140 -0
  530. package/lib/browser/video-call/face-stage.js +223 -0
  531. package/lib/browser/video-call/mouth-layer.d.ts +82 -0
  532. package/lib/browser/video-call/mouth-layer.js +245 -0
  533. package/lib/browser/video-call/video-call-view.d.ts +20 -0
  534. package/lib/browser/video-call/video-call-view.js +290 -0
  535. package/lib/browser/video-call/video-face.d.ts +20 -0
  536. package/lib/browser/video-call/video-face.js +507 -0
  537. package/lib/browser/workbench-hosts.d.ts +1 -0
  538. package/lib/browser/workbench-protocol.d.ts +2 -0
  539. package/lib/browser/workbench-util.d.ts +5 -0
  540. package/lib/browser/workbench-util.js +18 -0
  541. package/lib/browser/workbench.d.ts +14 -0
  542. package/lib/browser/workbench.js +71 -4
  543. package/package.json +7 -7
  544. package/public/faces/README.md +40 -0
  545. package/public/faces/blonde/clap.mp4 +0 -0
  546. package/public/faces/blonde/dance.mp4 +0 -0
  547. package/public/faces/blonde/face.jpg +0 -0
  548. package/public/faces/blonde/happy.mp4 +0 -0
  549. package/public/faces/blonde/heart.mp4 +0 -0
  550. package/public/faces/blonde/idle-1.mp4 +0 -0
  551. package/public/faces/blonde/idle-2.mp4 +0 -0
  552. package/public/faces/blonde/idle-3.mp4 +0 -0
  553. package/public/faces/blonde/laugh.mp4 +0 -0
  554. package/public/faces/blonde/listening.mp4 +0 -0
  555. package/public/faces/blonde/poster.jpg +0 -0
  556. package/public/faces/blonde/shy.mp4 +0 -0
  557. package/public/faces/blonde/sorry.mp4 +0 -0
  558. package/public/faces/blonde/stretch.mp4 +0 -0
  559. package/public/faces/blonde/surprised.mp4 +0 -0
  560. package/public/faces/blonde/talk-1.mp4 +0 -0
  561. package/public/faces/blonde/talk-2.mp4 +0 -0
  562. package/public/faces/blonde/think-2.mp4 +0 -0
  563. package/public/faces/blonde/thinking.mp4 +0 -0
  564. package/public/faces/blonde/wave.mp4 +0 -0
  565. package/public/faces/clap.mp4 +0 -0
  566. package/public/faces/dance.mp4 +0 -0
  567. package/public/faces/face.jpg +0 -0
  568. package/public/faces/framing.json +1 -0
  569. package/public/faces/happy.mp4 +0 -0
  570. package/public/faces/heart.mp4 +0 -0
  571. package/public/faces/idle-1.mp4 +0 -0
  572. package/public/faces/idle-2.mp4 +0 -0
  573. package/public/faces/idle-3.mp4 +0 -0
  574. package/public/faces/laugh.mp4 +0 -0
  575. package/public/faces/lips.json +1 -0
  576. package/public/faces/listening.mp4 +0 -0
  577. package/public/faces/poster.jpg +0 -0
  578. package/public/faces/shy.mp4 +0 -0
  579. package/public/faces/sorry.mp4 +0 -0
  580. package/public/faces/stretch.mp4 +0 -0
  581. package/public/faces/surprised.mp4 +0 -0
  582. package/public/faces/talk-1.mp4 +0 -0
  583. package/public/faces/talk-2.mp4 +0 -0
  584. package/public/faces/think-2.mp4 +0 -0
  585. package/public/faces/thinking.mp4 +0 -0
  586. package/public/faces/wave.mp4 +0 -0
@@ -0,0 +1,139 @@
1
+ /** The parts of a layer of video the stage uses (HTMLVideoElement), so that a check can play it without a browser. */
2
+ export interface StageVideo {
3
+ src: string;
4
+ currentTime: number;
5
+ playbackRate: number;
6
+ readonly paused: boolean;
7
+ readonly readyState: number;
8
+ readonly dataset: DOMStringMap;
9
+ readonly style: {
10
+ opacity: string;
11
+ zIndex: string;
12
+ };
13
+ readonly classList: {
14
+ toggle(name: string, on: boolean): unknown;
15
+ };
16
+ play(): Promise<void>;
17
+ pause(): void;
18
+ requestVideoFrameCallback?(callback: () => void): number;
19
+ }
20
+ /** How long a clip fades in over the one before at a seam (both on the seated frame), in ms. */
21
+ export declare const SEAM_MS = 120;
22
+ /** How long it fades in when it cuts into a clip midway: the more her pose differs, the longer, in ms. */
23
+ export declare const BLEND_MS: {
24
+ min: number;
25
+ max: number;
26
+ unknown: number;
27
+ };
28
+ /** A clip asked for: its name, from where, how long it fades in. */
29
+ interface Wanted {
30
+ clip: string;
31
+ at: number;
32
+ ms: number;
33
+ }
34
+ /**
35
+ * The two layers of video of the person of a video call (docs/design/ta-call.md 16), as players switch streams without
36
+ * a black frame: the next clip loads in the layer behind, hidden, and only once its first frame is on the screen
37
+ * (requestVideoFrameCallback) does it come over the one in front, fading in from nothing while that one stays whole
38
+ * under it; then the one under is hidden and paused. So the picture is whole at every moment: no empty layer, no
39
+ * room behind showing through. While a clip fades in, the next waits (the last asked), never taking the layer that
40
+ * shows. A clip known to come next is loaded and decoded ahead in the layer behind (prime).
41
+ */
42
+ export declare class FaceStage {
43
+ protected readonly videos: StageVideo[];
44
+ /** The URL a clip plays from. */
45
+ protected readonly urlOf: (clip: string) => string;
46
+ /** Now, in ms. */
47
+ protected readonly now: () => number;
48
+ protected readonly events: {
49
+ /** A clip is whole in front. */
50
+ shown?(clip: string): void;
51
+ /** A clip could not play. */
52
+ failed?(clip: string, error: unknown): void;
53
+ };
54
+ /** The layer in front, whole. */
55
+ protected front: number;
56
+ /** The clip each layer plays, by name (what the cameras frame). */
57
+ readonly names: (string | undefined)[];
58
+ /** The layer behind loading a clip, hidden until its first frame shows. */
59
+ protected loading?: Wanted & {
60
+ index: number;
61
+ token: number;
62
+ };
63
+ /** The layer behind fading in over the one in front. */
64
+ protected coming?: Wanted & {
65
+ index: number;
66
+ since: number;
67
+ };
68
+ /** The clip asked for while one faded in: it comes next. */
69
+ protected pending?: Wanted;
70
+ /** The clip loaded ahead in the layer behind. */
71
+ protected primed?: {
72
+ index: number;
73
+ clip: string;
74
+ at: number;
75
+ };
76
+ protected token: number;
77
+ protected closed: boolean;
78
+ constructor(videos: StageVideo[],
79
+ /** The URL a clip plays from. */
80
+ urlOf: (clip: string) => string,
81
+ /** Now, in ms. */
82
+ now: () => number, events?: {
83
+ /** A clip is whole in front. */
84
+ shown?(clip: string): void;
85
+ /** A clip could not play. */
86
+ failed?(clip: string, error: unknown): void;
87
+ });
88
+ /** The clip that shows, or comes to: the last asked for. */
89
+ get wanted(): string | undefined;
90
+ /** The layer that plays the clip on top, fading in or whole, with its clip. */
91
+ playing(): {
92
+ video: StageVideo;
93
+ clip: string | undefined;
94
+ };
95
+ /** While a clip fades in: the layer under it, and how much of the one on top shows (0 to 1). */
96
+ under(): {
97
+ video: StageVideo;
98
+ alpha: number;
99
+ } | undefined;
100
+ /**
101
+ * Plays `clip` from `at` seconds, fading in over `ms` once its first frame shows; `again`: though it is the clip
102
+ * that shows (another moment of it, as she hurries back to where she sits down).
103
+ */
104
+ show(clip: string, at?: number, ms?: number, again?: boolean): void;
105
+ /** Whether a clip loads or fades in: one asked for is on its way. */
106
+ busy(): boolean;
107
+ /** Whether the clip asked for last comes from `at` seconds (a show `again` on its way). */
108
+ jumping(at: number): boolean;
109
+ /** Loads `clip` ahead in the layer behind, decoded at `at`, so that it shows at once when asked for. */
110
+ prime(clip: string, at?: number): void;
111
+ /** Each frame of the screen: the clip fading in shows a little more; done, the one under goes. */
112
+ frame(): void;
113
+ close(): void;
114
+ protected load(wanted: Wanted): void;
115
+ /** Its first frame is on the screen (or it is late): the clip comes in. */
116
+ protected firstFrame(video: StageVideo, token: number): void;
117
+ protected come(token: number): void;
118
+ protected progress(coming: {
119
+ since: number;
120
+ ms: number;
121
+ }): number;
122
+ /** Smooth at both ends: the clip on top comes in without a step. */
123
+ static ease(part: number): number;
124
+ /** A layer whole in front (0), fading in over it (1), or hidden behind (-1). */
125
+ protected static layer(video: StageVideo, place: -1 | 0 | 1): void;
126
+ }
127
+ /** Where her face is in a frame (x1, y1, x2, y2); undefined where it is not known. */
128
+ type FaceBox = readonly number[] | undefined;
129
+ /**
130
+ * How long a clip fades in over another, by how far apart her pose is in the two frames (docs/design/ta-call.md 16):
131
+ * all clips begin and end on the same seated frame, so at a seam the fade only hides the step of decoding; cutting in
132
+ * midway, the farther her face moved, the slower it fades, so that the two poses blend rather than jump.
133
+ */
134
+ export declare namespace FaceBlend {
135
+ function ms(from: FaceBox, to: FaceBox, seam: boolean): number;
136
+ /** Whether a frame is on the seated frame every clip begins and ends on: its first or last few. */
137
+ function seated(frame: number, frames: number): boolean;
138
+ }
139
+ export {};
@@ -0,0 +1,219 @@
1
+ /** How long a clip fades in over the one before at a seam (both on the seated frame), in ms. */
2
+ export const SEAM_MS = 120;
3
+ /** How long it fades in when it cuts into a clip midway: the more her pose differs, the longer, in ms. */
4
+ export const BLEND_MS = { min: 200, max: 450, unknown: 300 };
5
+ /** How long a layer may take to show its first frame before it comes in anyway, in ms. */
6
+ const FIRST_FRAME_MS = 1500;
7
+ /**
8
+ * The two layers of video of the person of a video call (docs/design/ta-call.md 16), as players switch streams without
9
+ * a black frame: the next clip loads in the layer behind, hidden, and only once its first frame is on the screen
10
+ * (requestVideoFrameCallback) does it come over the one in front, fading in from nothing while that one stays whole
11
+ * under it; then the one under is hidden and paused. So the picture is whole at every moment: no empty layer, no
12
+ * room behind showing through. While a clip fades in, the next waits (the last asked), never taking the layer that
13
+ * shows. A clip known to come next is loaded and decoded ahead in the layer behind (prime).
14
+ */
15
+ export class FaceStage {
16
+ constructor(videos,
17
+ /** The URL a clip plays from. */
18
+ urlOf,
19
+ /** Now, in ms. */
20
+ now, events = {}) {
21
+ this.videos = videos;
22
+ this.urlOf = urlOf;
23
+ this.now = now;
24
+ this.events = events;
25
+ /** The layer in front, whole. */
26
+ this.front = 0;
27
+ /** The clip each layer plays, by name (what the cameras frame). */
28
+ this.names = [undefined, undefined];
29
+ this.token = 0;
30
+ this.closed = false;
31
+ videos.forEach((video, index) => {
32
+ FaceStage.layer(video, index === 0 ? 0 : -1);
33
+ });
34
+ }
35
+ /** The clip that shows, or comes to: the last asked for. */
36
+ get wanted() {
37
+ var _a;
38
+ var _b, _c, _d;
39
+ return (_d = (_a = ((_c = (_b = this.pending) !== null && _b !== void 0 ? _b : this.coming) !== null && _c !== void 0 ? _c : this.loading)) === null || _a === void 0 ? void 0 : _a.clip) !== null && _d !== void 0 ? _d : this.names[this.front];
40
+ }
41
+ /** The layer that plays the clip on top, fading in or whole, with its clip. */
42
+ playing() {
43
+ var _a;
44
+ var _b;
45
+ const index = (_b = (_a = this.coming) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : this.front;
46
+ return { video: this.videos[index], clip: this.names[index] };
47
+ }
48
+ /** While a clip fades in: the layer under it, and how much of the one on top shows (0 to 1). */
49
+ under() {
50
+ const coming = this.coming;
51
+ return coming && { video: this.videos[this.front], alpha: FaceStage.ease(this.progress(coming)) };
52
+ }
53
+ /**
54
+ * Plays `clip` from `at` seconds, fading in over `ms` once its first frame shows; `again`: though it is the clip
55
+ * that shows (another moment of it, as she hurries back to where she sits down).
56
+ */
57
+ show(clip, at = 0, ms = SEAM_MS, again = false) {
58
+ if (this.closed || (clip === this.wanted && !again)) {
59
+ return;
60
+ }
61
+ const wanted = { clip, at, ms };
62
+ if (this.coming) {
63
+ this.pending = wanted;
64
+ return;
65
+ }
66
+ this.pending = undefined;
67
+ this.load(wanted);
68
+ }
69
+ /** Whether a clip loads or fades in: one asked for is on its way. */
70
+ busy() {
71
+ return !!(this.loading || this.coming || this.pending);
72
+ }
73
+ /** Whether the clip asked for last comes from `at` seconds (a show `again` on its way). */
74
+ jumping(at) {
75
+ var _a, _b;
76
+ const wanted = (_b = (_a = this.pending) !== null && _a !== void 0 ? _a : this.coming) !== null && _b !== void 0 ? _b : this.loading;
77
+ return !!wanted && Math.abs(wanted.at - at) < 0.05;
78
+ }
79
+ /** Loads `clip` ahead in the layer behind, decoded at `at`, so that it shows at once when asked for. */
80
+ prime(clip, at = 0) {
81
+ var _a;
82
+ if (this.closed || this.loading || this.coming || clip === this.names[this.front]) {
83
+ return;
84
+ }
85
+ const index = 1 - this.front;
86
+ if (((_a = this.primed) === null || _a === void 0 ? void 0 : _a.index) === index && this.primed.clip === clip) {
87
+ return;
88
+ }
89
+ const video = this.videos[index];
90
+ video.pause();
91
+ video.src = this.urlOf(clip);
92
+ video.currentTime = at;
93
+ this.primed = { index, clip, at };
94
+ }
95
+ /** Each frame of the screen: the clip fading in shows a little more; done, the one under goes. */
96
+ frame() {
97
+ var _a, _b;
98
+ const coming = this.coming;
99
+ if (!coming) {
100
+ return;
101
+ }
102
+ const part = this.progress(coming);
103
+ this.videos[coming.index].style.opacity = FaceStage.ease(part).toFixed(3);
104
+ if (part < 1) {
105
+ return;
106
+ }
107
+ const old = this.videos[this.front];
108
+ this.front = coming.index;
109
+ this.coming = undefined;
110
+ FaceStage.layer(this.videos[this.front], 0);
111
+ FaceStage.layer(old, -1);
112
+ old.pause();
113
+ (_b = (_a = this.events).shown) === null || _b === void 0 ? void 0 : _b.call(_a, coming.clip);
114
+ const next = this.pending;
115
+ this.pending = undefined;
116
+ if (next && next.clip !== this.names[this.front]) {
117
+ this.load(next);
118
+ }
119
+ }
120
+ close() {
121
+ this.closed = true;
122
+ this.token++;
123
+ }
124
+ load(wanted) {
125
+ const index = 1 - this.front;
126
+ const video = this.videos[index];
127
+ const token = ++this.token;
128
+ const primed = this.primed;
129
+ this.primed = undefined;
130
+ this.loading = { ...wanted, index, token };
131
+ this.names[index] = wanted.clip;
132
+ video.dataset.clip = wanted.clip;
133
+ const src = this.urlOf(wanted.clip);
134
+ if (!((primed === null || primed === void 0 ? void 0 : primed.index) === index && primed.clip === wanted.clip && video.src === src && Math.abs(primed.at - wanted.at) < 0.05)) {
135
+ if (video.src !== src) {
136
+ video.src = src;
137
+ }
138
+ video.currentTime = wanted.at;
139
+ }
140
+ video.playbackRate = 1;
141
+ video.play().then(() => this.firstFrame(video, token), error => {
142
+ var _a, _b;
143
+ if (token === this.token && !this.closed) {
144
+ this.loading = undefined;
145
+ this.names[index] = undefined;
146
+ (_b = (_a = this.events).failed) === null || _b === void 0 ? void 0 : _b.call(_a, wanted.clip, error);
147
+ }
148
+ });
149
+ }
150
+ /** Its first frame is on the screen (or it is late): the clip comes in. */
151
+ firstFrame(video, token) {
152
+ let done = false;
153
+ const come = () => {
154
+ if (!done) {
155
+ done = true;
156
+ this.come(token);
157
+ }
158
+ };
159
+ if (typeof video.requestVideoFrameCallback === 'function') {
160
+ video.requestVideoFrameCallback(come);
161
+ }
162
+ else if (video.readyState >= 2) {
163
+ come();
164
+ }
165
+ setTimeout(come, FIRST_FRAME_MS);
166
+ }
167
+ come(token) {
168
+ const loading = this.loading;
169
+ if (!loading || loading.token !== token || this.closed) {
170
+ return;
171
+ }
172
+ this.loading = undefined;
173
+ this.coming = { ...loading, since: this.now() };
174
+ const video = this.videos[loading.index];
175
+ FaceStage.layer(video, 1);
176
+ video.style.opacity = '0';
177
+ this.frame();
178
+ }
179
+ progress(coming) {
180
+ return coming.ms <= 0 ? 1 : Math.max(0, Math.min(1, (this.now() - coming.since) / coming.ms));
181
+ }
182
+ /** Smooth at both ends: the clip on top comes in without a step. */
183
+ static ease(part) {
184
+ return part * part * (3 - 2 * part);
185
+ }
186
+ /** A layer whole in front (0), fading in over it (1), or hidden behind (-1). */
187
+ static layer(video, place) {
188
+ video.style.zIndex = place === 1 ? '2' : place === 0 ? '1' : '0';
189
+ video.style.opacity = place === -1 ? '0' : place === 0 ? '1' : video.style.opacity;
190
+ video.classList.toggle('ta-front', place !== -1);
191
+ }
192
+ }
193
+ /**
194
+ * How long a clip fades in over another, by how far apart her pose is in the two frames (docs/design/ta-call.md 16):
195
+ * all clips begin and end on the same seated frame, so at a seam the fade only hides the step of decoding; cutting in
196
+ * midway, the farther her face moved, the slower it fades, so that the two poses blend rather than jump.
197
+ */
198
+ export var FaceBlend;
199
+ (function (FaceBlend) {
200
+ function ms(from, to, seam) {
201
+ if (seam) {
202
+ return SEAM_MS;
203
+ }
204
+ if (!from || !to || from.length < 4 || to.length < 4) {
205
+ return BLEND_MS.unknown;
206
+ }
207
+ const width = Math.max(1, from[2] - from[0], to[2] - to[0]);
208
+ const moved = Math.hypot((from[0] + from[2] - to[0] - to[2]) / 2, (from[1] + from[3] - to[1] - to[3]) / 2) / width;
209
+ const scaled = Math.abs((to[2] - to[0]) / Math.max(1, from[2] - from[0]) - 1);
210
+ return Math.round(Math.min(BLEND_MS.max, BLEND_MS.min + 500 * (moved + scaled)));
211
+ }
212
+ FaceBlend.ms = ms;
213
+ /** Whether a frame is on the seated frame every clip begins and ends on: its first or last few. */
214
+ function seated(frame, frames) {
215
+ return frame <= 1 || frame >= frames - 2;
216
+ }
217
+ FaceBlend.seated = seated;
218
+ })(FaceBlend || (FaceBlend = {}));
219
+ //# sourceMappingURL=face-stage.js.map
@@ -0,0 +1,81 @@
1
+ import type { VoiceCall } from '../assistant/voice-call.js';
2
+ import type { CallReading } from '../assistant/voice-call-protocol.js';
3
+ import type { WebCallMouth, WebMouthFrame, WebMouthSession } from '../extension/web-api-call.js';
4
+ import { type ClipPlan } from './clip-plan.js';
5
+ import { type Placement } from './face-camera.js';
6
+ import type { FaceFiles } from './face-files.js';
7
+ /**
8
+ * What a video call shows at a frame: the reading that drives it, the layer of video on top and its clip, and while that
9
+ * clip fades in (FaceStage) the layer under it and how much of the one on top shows.
10
+ */
11
+ export interface Showing {
12
+ reading: CallReading;
13
+ video: HTMLVideoElement;
14
+ clip: string;
15
+ under?: {
16
+ video: HTMLVideoElement;
17
+ alpha: number;
18
+ };
19
+ }
20
+ /**
21
+ * The mouth an extension draws for what Ta reads (WebCallMouth), laid over the clip: told the sound of each reading as
22
+ * it comes with the frame of the clip at each moment of it (ClipPlan), it gives that frame's lower face drawn again
23
+ * for that sound. As each frame of the clip is shown (requestVideoFrameCallback), that frame and the mouth of that
24
+ * moment of the sound are drawn together, the mouth moved with her face when it was drawn for a frame near it: the
25
+ * clip and the sound keep their own clocks a little apart. The reading waits for it as long as it asks (holdMs).
26
+ */
27
+ export declare class MouthLayer {
28
+ protected readonly call: VoiceCall;
29
+ protected readonly planOf: (say: number) => ClipPlan;
30
+ protected readonly canvas: HTMLCanvasElement | null;
31
+ protected readonly view: Window;
32
+ protected readonly faces: FaceFiles;
33
+ /** Where the clip of a layer of video goes in a view `width` wide, as its camera aims. */
34
+ protected readonly placeOf: (video: HTMLVideoElement, width: number) => Placement | undefined;
35
+ protected readonly showing: () => Showing | undefined;
36
+ protected session?: WebMouthSession;
37
+ protected offSound?: () => void;
38
+ protected closed: boolean;
39
+ /** Of each reading: the seconds of its sound that came, and the slots told. */
40
+ protected readonly sounds: Map<number, {
41
+ seconds: number;
42
+ told: number;
43
+ }>;
44
+ protected say?: number;
45
+ protected atSlot: number;
46
+ /** The reading that played as the mouth opened: its sound came in part, so its frames would not fit. */
47
+ protected missed?: number;
48
+ /** The canvas shows the frames of the clip now, not the layers of video under it. */
49
+ protected drawing: boolean;
50
+ protected offFrames?: () => void;
51
+ protected fading?: ReturnType<typeof setTimeout>;
52
+ constructor(call: VoiceCall, planOf: (say: number) => ClipPlan, canvas: HTMLCanvasElement | null, view: Window, faces: FaceFiles,
53
+ /** Where the clip of a layer of video goes in a view `width` wide, as its camera aims. */
54
+ placeOf: (video: HTMLVideoElement, width: number) => Placement | undefined, showing: () => Showing | undefined);
55
+ open(mouth: WebCallMouth | undefined): Promise<void>;
56
+ protected sound(say: number, pcm: Uint8Array | undefined, rate: number): void;
57
+ /** The reading plays at `seconds` of its sound: the extension knows what it need not draw any more. */
58
+ follow(reading: CallReading, seconds: number): void;
59
+ /** Draws as each frame of the layers of video is shown, the one in front. */
60
+ watch(videos: HTMLVideoElement[]): void;
61
+ /** A frame of `video` is shown, `mediaTime` into its clip: it is drawn, with the mouth of the moment over it. */
62
+ protected shown(video: HTMLVideoElement, mediaTime: number): void;
63
+ /**
64
+ * The mouth of the moment of the sound, or of the slot just before or after it if that one was drawn for a frame
65
+ * nearer the one shown (the frame comes to the screen a little after its moment): a mouth a slot early or late is
66
+ * not seen, one laid over a frame it was not drawn for is.
67
+ */
68
+ protected nearest(session: WebMouthSession, say: number, slot: number, clip: string, frame: number): WebMouthFrame | undefined;
69
+ /**
70
+ * Where the mouth drawn goes over `frame` of `clip`: its place in the frame it was drawn for, moved and scaled as her
71
+ * face is from that frame to this one; undefined when it is of another clip, or of a frame too far.
72
+ */
73
+ protected place(drawn: WebMouthFrame | undefined, clip: string, frame: number): [number, number, number, number] | undefined;
74
+ /** Nothing over the clip: Ta is not reading with its voice service now. */
75
+ clear(): void;
76
+ /** The canvas shows the frames of the clip now. */
77
+ protected show(canvas: HTMLCanvasElement): void;
78
+ /** The canvas the size it shows at, cleared. */
79
+ protected fit(canvas: HTMLCanvasElement): CanvasRenderingContext2D | null;
80
+ close(): void;
81
+ }
@@ -0,0 +1,241 @@
1
+ import { CLIP_FPS } from './clip-plan.js';
2
+ import { FaceCamera } from './face-camera.js';
3
+ /** How much longer a reading may wait while the mouth starts, at most, in ms. */
4
+ const STARTING_MS = 6000;
5
+ /** How many frames the clip shown may be from the one a mouth was drawn for, laid over it moved with the face. */
6
+ const NEAR_FRAMES = 3;
7
+ /** How long the mouth fades out once Ta stops reading, in ms (as .ta-video-mouth's transition). */
8
+ const FADE_OUT_MS = 160;
9
+ /**
10
+ * The mouth an extension draws for what Ta reads (WebCallMouth), laid over the clip: told the sound of each reading as
11
+ * it comes with the frame of the clip at each moment of it (ClipPlan), it gives that frame's lower face drawn again
12
+ * for that sound. As each frame of the clip is shown (requestVideoFrameCallback), that frame and the mouth of that
13
+ * moment of the sound are drawn together, the mouth moved with her face when it was drawn for a frame near it: the
14
+ * clip and the sound keep their own clocks a little apart. The reading waits for it as long as it asks (holdMs).
15
+ */
16
+ export class MouthLayer {
17
+ constructor(call, planOf, canvas, view, faces,
18
+ /** Where the clip of a layer of video goes in a view `width` wide, as its camera aims. */
19
+ placeOf, showing) {
20
+ this.call = call;
21
+ this.planOf = planOf;
22
+ this.canvas = canvas;
23
+ this.view = view;
24
+ this.faces = faces;
25
+ this.placeOf = placeOf;
26
+ this.showing = showing;
27
+ this.closed = false;
28
+ /** Of each reading: the seconds of its sound that came, and the slots told. */
29
+ this.sounds = new Map();
30
+ this.atSlot = -1;
31
+ /** The canvas shows the frames of the clip now, not the layers of video under it. */
32
+ this.drawing = false;
33
+ }
34
+ async open(mouth) {
35
+ var _a;
36
+ const session = await (mouth === null || mouth === void 0 ? void 0 : mouth.open().catch(() => undefined));
37
+ if (!session) {
38
+ return;
39
+ }
40
+ if (this.closed) {
41
+ session.close();
42
+ return;
43
+ }
44
+ this.session = session;
45
+ this.missed = (_a = this.call.sounds.nowReading()) === null || _a === void 0 ? void 0 : _a.say;
46
+ this.call.sounds.hold(session.holdMs);
47
+ this.offSound = this.call.sounds.on((say, pcm, rate) => this.sound(say, pcm, rate));
48
+ }
49
+ sound(say, pcm, rate) {
50
+ var _a;
51
+ var _b, _c;
52
+ const session = this.session;
53
+ if (!session || say === this.missed) {
54
+ return;
55
+ }
56
+ if (!this.sounds.has(say)) {
57
+ // A reading begins: it waits as long as the mouth asks, more while the mouth starts.
58
+ this.call.sounds.hold(session.holdMs + Math.min(STARTING_MS, (_b = (_a = session.readyIn) === null || _a === void 0 ? void 0 : _a.call(session)) !== null && _b !== void 0 ? _b : 0));
59
+ }
60
+ const heard = (_c = this.sounds.get(say)) !== null && _c !== void 0 ? _c : { seconds: 0, told: 0 };
61
+ this.sounds.set(say, heard);
62
+ for (const old of this.sounds.keys()) {
63
+ if (old < say - 1) {
64
+ this.sounds.delete(old);
65
+ }
66
+ }
67
+ if (pcm) {
68
+ heard.seconds += pcm.byteLength / 2 / rate;
69
+ }
70
+ const upto = pcm ? Math.floor(heard.seconds * session.fps) : Math.ceil(heard.seconds * session.fps);
71
+ const plan = this.planOf(say);
72
+ const slots = [];
73
+ for (let slot = heard.told; slot < upto; slot++) {
74
+ const { clip, frame } = plan.at(slot / session.fps);
75
+ // By the name of its file (FaceFiles.full): of the person of the call.
76
+ slots.push([this.faces.full(clip), frame]);
77
+ }
78
+ const first = heard.told;
79
+ heard.told = Math.max(heard.told, upto);
80
+ session.sound(say, pcm, rate, slots, first);
81
+ }
82
+ /** The reading plays at `seconds` of its sound: the extension knows what it need not draw any more. */
83
+ follow(reading, seconds) {
84
+ const session = this.session;
85
+ if (!session) {
86
+ return;
87
+ }
88
+ if (this.say !== undefined && this.say !== reading.say) {
89
+ session.cut(this.say);
90
+ }
91
+ this.say = reading.say;
92
+ const slot = Math.floor(seconds * session.fps);
93
+ if (slot !== this.atSlot) {
94
+ this.atSlot = slot;
95
+ session.at(reading.say, slot);
96
+ }
97
+ }
98
+ /** Draws as each frame of the layers of video is shown, the one in front. */
99
+ watch(videos) {
100
+ const offs = videos.map(video => {
101
+ if (typeof video.requestVideoFrameCallback !== 'function') {
102
+ return () => undefined;
103
+ }
104
+ const shown = (_now, frame) => {
105
+ handle = video.requestVideoFrameCallback(shown);
106
+ this.shown(video, frame.mediaTime);
107
+ };
108
+ let handle = video.requestVideoFrameCallback(shown);
109
+ return () => video.cancelVideoFrameCallback(handle);
110
+ });
111
+ this.offFrames = () => {
112
+ for (const off of offs) {
113
+ off();
114
+ }
115
+ };
116
+ }
117
+ /** A frame of `video` is shown, `mediaTime` into its clip: it is drawn, with the mouth of the moment over it. */
118
+ shown(video, mediaTime) {
119
+ var _a, _b, _c;
120
+ const session = this.session;
121
+ const canvas = this.canvas;
122
+ const now = this.showing();
123
+ if (!session || !canvas || !now || now.video !== video || !video.videoWidth) {
124
+ return;
125
+ }
126
+ const context = this.fit(canvas);
127
+ if (!context) {
128
+ return;
129
+ }
130
+ const width = canvas.width;
131
+ const height = canvas.height;
132
+ // Where each layer of video shows it, so that nothing moves as the canvas comes over it.
133
+ const where = (layer) => { var _a; return (_a = this.placeOf(layer, width)) !== null && _a !== void 0 ? _a : FaceCamera.place(FaceCamera.close(width / height, { x: 0, y: 0, w: layer.videoWidth, h: layer.videoHeight }), width); };
134
+ // A clip fading in: the one under it first, whole, and this one over it as much as it shows, its mouth with it.
135
+ const under = now.under;
136
+ if (under === null || under === void 0 ? void 0 : under.video.videoWidth) {
137
+ const at = where(under.video);
138
+ context.drawImage(under.video, at.left, at.top, under.video.videoWidth * at.scale, under.video.videoHeight * at.scale);
139
+ context.globalAlpha = under.alpha;
140
+ }
141
+ const { scale, left, top } = where(video);
142
+ context.drawImage(video, left, top, video.videoWidth * scale, video.videoHeight * scale);
143
+ this.show(canvas);
144
+ const shownFrame = Math.round(mediaTime * CLIP_FPS);
145
+ const drawn = this.nearest(session, now.reading.say, Math.floor(now.reading.now() * session.fps), this.faces.full(now.clip), shownFrame);
146
+ const at = this.place(drawn, this.faces.full(now.clip), shownFrame);
147
+ if (drawn && at) {
148
+ context.drawImage(drawn.image, left + at[0] * scale, top + at[1] * scale, at[2] * scale, at[3] * scale);
149
+ }
150
+ context.globalAlpha = 1;
151
+ // How many frames showed while Ta read, and how many with her mouth: read by checks of the call (and by anyone curious).
152
+ canvas.dataset.frames = String(Number((_a = canvas.dataset.frames) !== null && _a !== void 0 ? _a : 0) + 1);
153
+ canvas.dataset.mouths = String(Number((_b = canvas.dataset.mouths) !== null && _b !== void 0 ? _b : 0) + (drawn && at ? 1 : 0));
154
+ if (drawn && at) {
155
+ canvas.dataset.apart = String(Number((_c = canvas.dataset.apart) !== null && _c !== void 0 ? _c : 0) + Math.abs(drawn.frame - shownFrame));
156
+ }
157
+ }
158
+ /**
159
+ * The mouth of the moment of the sound, or of the slot just before or after it if that one was drawn for a frame
160
+ * nearer the one shown (the frame comes to the screen a little after its moment): a mouth a slot early or late is
161
+ * not seen, one laid over a frame it was not drawn for is.
162
+ */
163
+ nearest(session, say, slot, clip, frame) {
164
+ let best;
165
+ for (const near of [slot, slot - 1, slot + 1]) {
166
+ const drawn = session.frame(say, near);
167
+ if ((drawn === null || drawn === void 0 ? void 0 : drawn.clip) === clip && (!best || Math.abs(drawn.frame - frame) < Math.abs(best.frame - frame))) {
168
+ best = drawn;
169
+ }
170
+ }
171
+ return best !== null && best !== void 0 ? best : session.frame(say, slot);
172
+ }
173
+ /**
174
+ * Where the mouth drawn goes over `frame` of `clip`: its place in the frame it was drawn for, moved and scaled as her
175
+ * face is from that frame to this one; undefined when it is of another clip, or of a frame too far.
176
+ */
177
+ place(drawn, clip, frame) {
178
+ if (!drawn || drawn.clip !== clip || Math.abs(drawn.frame - frame) > NEAR_FRAMES) {
179
+ return undefined;
180
+ }
181
+ const boxes = this.faces.boxes(clip);
182
+ const from = boxes === null || boxes === void 0 ? void 0 : boxes[drawn.frame];
183
+ const to = boxes === null || boxes === void 0 ? void 0 : boxes[Math.min(frame, boxes.length - 1)];
184
+ const [x, y, w, h] = drawn.box;
185
+ if (!from || !to || drawn.frame === frame) {
186
+ return [x, y, w, h];
187
+ }
188
+ const sx = (to[2] - to[0]) / Math.max(1, from[2] - from[0]);
189
+ const sy = (to[3] - to[1]) / Math.max(1, from[3] - from[1]);
190
+ return [to[0] + (x - from[0]) * sx, to[1] + (y - from[1]) * sy, w * sx, h * sy];
191
+ }
192
+ /** Nothing over the clip: Ta is not reading with its voice service now. */
193
+ clear() {
194
+ var _a;
195
+ if (this.say !== undefined) {
196
+ (_a = this.session) === null || _a === void 0 ? void 0 : _a.cut(this.say);
197
+ this.say = undefined;
198
+ this.atSlot = -1;
199
+ }
200
+ const canvas = this.canvas;
201
+ if (this.drawing && canvas) {
202
+ // It fades out over the clip under it (the same frame, without the mouth drawn), then is cleared.
203
+ this.drawing = false;
204
+ canvas.style.opacity = '0';
205
+ clearTimeout(this.fading);
206
+ this.fading = setTimeout(() => !this.drawing && this.fit(canvas), FADE_OUT_MS);
207
+ }
208
+ }
209
+ /** The canvas shows the frames of the clip now. */
210
+ show(canvas) {
211
+ if (!this.drawing) {
212
+ this.drawing = true;
213
+ clearTimeout(this.fading);
214
+ canvas.style.opacity = '1';
215
+ }
216
+ }
217
+ /** The canvas the size it shows at, cleared. */
218
+ fit(canvas) {
219
+ const ratio = Math.min(2, this.view.devicePixelRatio || 1);
220
+ const width = Math.round(canvas.clientWidth * ratio);
221
+ const height = Math.round(canvas.clientHeight * ratio);
222
+ if (canvas.width !== width || canvas.height !== height) {
223
+ canvas.width = width;
224
+ canvas.height = height;
225
+ }
226
+ const context = canvas.getContext('2d');
227
+ context === null || context === void 0 ? void 0 : context.clearRect(0, 0, width, height);
228
+ return context;
229
+ }
230
+ close() {
231
+ var _a, _b, _c;
232
+ this.closed = true;
233
+ clearTimeout(this.fading);
234
+ (_a = this.offSound) === null || _a === void 0 ? void 0 : _a.call(this);
235
+ (_b = this.offFrames) === null || _b === void 0 ? void 0 : _b.call(this);
236
+ (_c = this.session) === null || _c === void 0 ? void 0 : _c.close();
237
+ this.session = undefined;
238
+ this.call.sounds.hold(0);
239
+ }
240
+ }
241
+ //# sourceMappingURL=mouth-layer.js.map