@celljs/ta-web 4.49.0 → 4.50.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 (400) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/account/account-side.js +4 -0
  4. package/esm/browser/account/device-account.d.ts +6 -0
  5. package/esm/browser/account/device-account.js +20 -5
  6. package/esm/browser/assistant/assistant-view.js +2 -0
  7. package/esm/browser/assistant/call-announcing.d.ts +25 -0
  8. package/esm/browser/assistant/call-announcing.js +32 -0
  9. package/esm/browser/assistant/call-answering.d.ts +43 -0
  10. package/esm/browser/assistant/call-answering.js +63 -0
  11. package/esm/browser/assistant/call-hearing.d.ts +53 -0
  12. package/esm/browser/assistant/call-hearing.js +98 -0
  13. package/esm/browser/assistant/call-pausing.d.ts +40 -0
  14. package/esm/browser/assistant/call-pausing.js +82 -0
  15. package/esm/browser/assistant/call-reading.d.ts +32 -0
  16. package/esm/browser/assistant/call-reading.js +35 -0
  17. package/esm/browser/assistant/call-revoicing.d.ts +33 -0
  18. package/esm/browser/assistant/call-revoicing.js +68 -0
  19. package/esm/browser/assistant/call-turns.d.ts +29 -0
  20. package/esm/browser/assistant/call-turns.js +33 -0
  21. package/esm/browser/assistant/spoken-answer.d.ts +21 -0
  22. package/esm/browser/assistant/spoken-answer.js +69 -0
  23. package/esm/browser/assistant/spoken-call.d.ts +7 -0
  24. package/esm/browser/assistant/spoken-call.js +16 -0
  25. package/esm/browser/assistant/voice-call-protocol.d.ts +5 -0
  26. package/esm/browser/assistant/voice-call.d.ts +47 -43
  27. package/esm/browser/assistant/voice-call.js +193 -219
  28. package/esm/browser/chat/chat-view.js +2 -1
  29. package/esm/browser/components/account-menu.js +1 -1
  30. package/esm/browser/components/account-recovery-view.d.ts +11 -0
  31. package/esm/browser/components/account-recovery-view.js +81 -0
  32. package/esm/browser/components/account-view.d.ts +1 -2
  33. package/esm/browser/components/account-view.js +10 -1
  34. package/esm/browser/components/app-nav.js +19 -8
  35. package/esm/browser/components/app-shell-hooks.d.ts +5 -0
  36. package/esm/browser/components/app-shell-hooks.js +45 -0
  37. package/esm/browser/components/app-shell-state.js +2 -1
  38. package/esm/browser/components/app-update-view.js +4 -4
  39. package/esm/browser/components/app-view.js +9 -5
  40. package/esm/browser/components/chat-emoji.d.ts +35 -0
  41. package/esm/browser/components/chat-emoji.js +129 -0
  42. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  43. package/esm/browser/components/composer-attachments.d.ts +6 -0
  44. package/esm/browser/components/composer-attachments.js +12 -1
  45. package/esm/browser/components/composer-box-protocol.d.ts +15 -0
  46. package/esm/browser/components/composer-box.js +110 -87
  47. package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
  48. package/esm/browser/components/composer-drop-hooks.js +36 -0
  49. package/esm/browser/components/composer-emoji.js +1 -1
  50. package/esm/browser/components/composer-faces.d.ts +16 -0
  51. package/esm/browser/components/composer-faces.js +37 -0
  52. package/esm/browser/components/composer-media.d.ts +10 -0
  53. package/esm/browser/components/composer-media.js +12 -1
  54. package/esm/browser/components/composer-target.d.ts +4 -0
  55. package/esm/browser/components/composer-target.js +18 -7
  56. package/esm/browser/components/composer-type-focus.d.ts +24 -0
  57. package/esm/browser/components/composer-type-focus.js +17 -0
  58. package/esm/browser/components/composer-voice.d.ts +24 -0
  59. package/esm/browser/components/composer-voice.js +37 -0
  60. package/esm/browser/components/composer.d.ts +2 -2
  61. package/esm/browser/components/composer.js +39 -8
  62. package/esm/browser/components/context-menu.js +2 -1
  63. package/esm/browser/components/emoji-panel.d.ts +11 -7
  64. package/esm/browser/components/emoji-panel.js +40 -22
  65. package/esm/browser/components/extension-settings.js +2 -2
  66. package/esm/browser/components/folder-new.d.ts +18 -0
  67. package/esm/browser/components/folder-new.js +53 -0
  68. package/esm/browser/components/folder-picker.d.ts +5 -2
  69. package/esm/browser/components/folder-picker.js +18 -6
  70. package/esm/browser/components/host-view.d.ts +1 -1
  71. package/esm/browser/components/image-menu.d.ts +8 -3
  72. package/esm/browser/components/image-menu.js +34 -9
  73. package/esm/browser/components/markdown.js +9 -2
  74. package/esm/browser/components/media.js +3 -2
  75. package/esm/browser/components/message-list.js +2 -2
  76. package/esm/browser/components/message-steps.js +20 -11
  77. package/esm/browser/components/message-user.js +2 -2
  78. package/esm/browser/components/moved-notice.js +2 -1
  79. package/esm/browser/components/nav-places.d.ts +2 -0
  80. package/esm/browser/components/nav-places.js +4 -2
  81. package/esm/browser/components/phone-shell.d.ts +2 -0
  82. package/esm/browser/components/phone-shell.js +5 -1
  83. package/esm/browser/components/secret-text.d.ts +1 -1
  84. package/esm/browser/components/secret-text.js +4 -3
  85. package/esm/browser/components/session-view.js +3 -0
  86. package/esm/browser/components/settings-choices.d.ts +2 -1
  87. package/esm/browser/components/settings-choices.js +13 -5
  88. package/esm/browser/components/settings-more.js +3 -3
  89. package/esm/browser/components/settings-parts.js +13 -2
  90. package/esm/browser/components/share-item-sheet.js +7 -1
  91. package/esm/browser/components/tab-title.d.ts +27 -0
  92. package/esm/browser/components/tab-title.js +35 -0
  93. package/esm/browser/components/use-composer-attachments.d.ts +28 -0
  94. package/esm/browser/components/use-composer-attachments.js +65 -0
  95. package/esm/browser/components/use-composer-files.d.ts +25 -0
  96. package/esm/browser/components/use-composer-files.js +52 -0
  97. package/esm/browser/components/web-composer.d.ts +3 -1
  98. package/esm/browser/components/web-composer.js +3 -2
  99. package/esm/browser/components/workbench-view.js +1 -0
  100. package/esm/browser/components/working-directory.js +2 -1
  101. package/esm/browser/device/app-update.d.ts +6 -3
  102. package/esm/browser/device/app-update.js +11 -5
  103. package/esm/browser/device/drag-move.d.ts +21 -0
  104. package/esm/browser/device/drag-move.js +86 -0
  105. package/esm/browser/extension/icons.js +7 -1
  106. package/esm/browser/extension/web-api-desktop.d.ts +19 -0
  107. package/esm/browser/extension/web-api-menus.d.ts +19 -0
  108. package/esm/browser/extension/web-api-spec.js +2 -0
  109. package/esm/browser/extension/web-extension-api.d.ts +24 -23
  110. package/esm/browser/extension/web-extension-context.d.ts +1 -0
  111. package/esm/browser/extension/web-extension-context.js +12 -5
  112. package/esm/browser/extension/web-extension-run.js +1 -0
  113. package/esm/browser/extension/web-share-ui.d.ts +1 -1
  114. package/esm/browser/extension/web-share-ui.js +2 -0
  115. package/esm/browser/extension/web-share.d.ts +13 -0
  116. package/esm/browser/extension/web-share.js +37 -2
  117. package/esm/browser/i18n/en/account.d.ts +18 -0
  118. package/esm/browser/i18n/en/account.js +18 -0
  119. package/esm/browser/i18n/en/call.js +1 -1
  120. package/esm/browser/i18n/en/chat.d.ts +15 -0
  121. package/esm/browser/i18n/en/chat.js +16 -1
  122. package/esm/browser/i18n/en/common.d.ts +2 -0
  123. package/esm/browser/i18n/en/common.js +2 -0
  124. package/esm/browser/i18n/en/discover.d.ts +2 -0
  125. package/esm/browser/i18n/en/discover.js +2 -0
  126. package/esm/browser/i18n/en/service.d.ts +4 -0
  127. package/esm/browser/i18n/en/service.js +4 -0
  128. package/esm/browser/i18n/en/settings.d.ts +17 -0
  129. package/esm/browser/i18n/en/settings.js +17 -0
  130. package/esm/browser/i18n/ja/account.js +18 -0
  131. package/esm/browser/i18n/ja/call.js +1 -1
  132. package/esm/browser/i18n/ja/chat.js +16 -1
  133. package/esm/browser/i18n/ja/common.js +2 -0
  134. package/esm/browser/i18n/ja/discover.js +3 -1
  135. package/esm/browser/i18n/ja/service.js +4 -0
  136. package/esm/browser/i18n/ja/settings.js +17 -0
  137. package/esm/browser/i18n/locales.d.ts +59 -1
  138. package/esm/browser/i18n/messages.d.ts +58 -0
  139. package/esm/browser/i18n/zh/account.js +18 -0
  140. package/esm/browser/i18n/zh/call.js +1 -1
  141. package/esm/browser/i18n/zh/chat.js +16 -1
  142. package/esm/browser/i18n/zh/common.js +2 -0
  143. package/esm/browser/i18n/zh/discover.js +3 -1
  144. package/esm/browser/i18n/zh/service.js +4 -0
  145. package/esm/browser/i18n/zh/settings.js +17 -0
  146. package/esm/browser/i18n/zh-tw/account.js +18 -0
  147. package/esm/browser/i18n/zh-tw/call.js +1 -1
  148. package/esm/browser/i18n/zh-tw/chat.js +16 -1
  149. package/esm/browser/i18n/zh-tw/common.js +2 -0
  150. package/esm/browser/i18n/zh-tw/discover.js +3 -1
  151. package/esm/browser/i18n/zh-tw/service.js +4 -0
  152. package/esm/browser/i18n/zh-tw/settings.js +17 -0
  153. package/esm/browser/offline/kept-chats.d.ts +3 -1
  154. package/esm/browser/offline/kept-chats.js +1 -1
  155. package/esm/browser/partners/group-picker.d.ts +3 -2
  156. package/esm/browser/partners/group-picker.js +8 -3
  157. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  158. package/esm/browser/sandbox/work/work-docs.js +5 -2
  159. package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
  160. package/esm/browser/sandbox/work/work-frame.js +9 -3
  161. package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
  162. package/esm/browser/sandbox/work/work-gates.js +182 -0
  163. package/esm/browser/settings/agent-settings.js +1 -1
  164. package/esm/browser/settings/navigation.d.ts +38 -10
  165. package/esm/browser/settings/navigation.js +73 -17
  166. package/esm/browser/settings/settings-protocol.d.ts +16 -1
  167. package/esm/browser/settings/settings-protocol.js +20 -2
  168. package/esm/browser/settings/settings.js +4 -1
  169. package/esm/browser/style/base.d.ts +1 -1
  170. package/esm/browser/style/base.js +15 -2
  171. package/esm/browser/style/chat-list.d.ts +1 -1
  172. package/esm/browser/style/chat-list.js +6 -3
  173. package/esm/browser/style/conversation-column.d.ts +1 -1
  174. package/esm/browser/style/conversation-column.js +28 -8
  175. package/esm/browser/style/conversation.d.ts +1 -1
  176. package/esm/browser/style/conversation.js +5 -0
  177. package/esm/browser/style/device.js +5 -0
  178. package/esm/browser/style/pages.d.ts +1 -1
  179. package/esm/browser/style/pages.js +3 -3
  180. package/esm/browser/style/shell.d.ts +1 -1
  181. package/esm/browser/style/shell.js +13 -6
  182. package/esm/browser/style/tasks.d.ts +1 -1
  183. package/esm/browser/style/tasks.js +4 -2
  184. package/esm/browser/util/chat-emoji.d.ts +44 -0
  185. package/esm/browser/util/chat-emoji.js +269 -0
  186. package/esm/browser/util/composer-drop.d.ts +26 -0
  187. package/esm/browser/util/composer-drop.js +40 -0
  188. package/esm/browser/util/composer-files.d.ts +48 -0
  189. package/esm/browser/util/composer-files.js +99 -0
  190. package/esm/browser/util/composer.d.ts +13 -1
  191. package/esm/browser/util/composer.js +24 -6
  192. package/esm/browser/util/markdown.d.ts +5 -0
  193. package/esm/browser/util/markdown.js +18 -0
  194. package/esm/browser/util/message.d.ts +6 -1
  195. package/esm/browser/util/message.js +13 -2
  196. package/esm/browser/util/process.d.ts +10 -13
  197. package/esm/browser/util/process.js +31 -83
  198. package/esm/browser/util/turn-join.d.ts +38 -0
  199. package/esm/browser/util/turn-join.js +119 -0
  200. package/esm/browser/workbench-services.js +1 -1
  201. package/lib/browser/account/account-side.js +4 -0
  202. package/lib/browser/account/device-account.d.ts +6 -0
  203. package/lib/browser/account/device-account.js +20 -5
  204. package/lib/browser/assistant/assistant-view.js +2 -0
  205. package/lib/browser/assistant/call-announcing.d.ts +26 -0
  206. package/lib/browser/assistant/call-announcing.js +36 -0
  207. package/lib/browser/assistant/call-answering.d.ts +44 -0
  208. package/lib/browser/assistant/call-answering.js +67 -0
  209. package/lib/browser/assistant/call-hearing.d.ts +54 -0
  210. package/lib/browser/assistant/call-hearing.js +102 -0
  211. package/lib/browser/assistant/call-pausing.d.ts +41 -0
  212. package/lib/browser/assistant/call-pausing.js +86 -0
  213. package/lib/browser/assistant/call-reading.d.ts +33 -0
  214. package/lib/browser/assistant/call-reading.js +39 -0
  215. package/lib/browser/assistant/call-revoicing.d.ts +34 -0
  216. package/lib/browser/assistant/call-revoicing.js +72 -0
  217. package/lib/browser/assistant/call-turns.d.ts +30 -0
  218. package/lib/browser/assistant/call-turns.js +37 -0
  219. package/lib/browser/assistant/spoken-answer.d.ts +22 -0
  220. package/lib/browser/assistant/spoken-answer.js +73 -0
  221. package/lib/browser/assistant/spoken-call.d.ts +8 -0
  222. package/lib/browser/assistant/spoken-call.js +19 -0
  223. package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
  224. package/lib/browser/assistant/voice-call.d.ts +47 -43
  225. package/lib/browser/assistant/voice-call.js +192 -218
  226. package/lib/browser/chat/chat-view.js +2 -1
  227. package/lib/browser/components/account-menu.js +1 -1
  228. package/lib/browser/components/account-recovery-view.d.ts +12 -0
  229. package/lib/browser/components/account-recovery-view.js +117 -0
  230. package/lib/browser/components/account-view.d.ts +1 -2
  231. package/lib/browser/components/account-view.js +10 -1
  232. package/lib/browser/components/app-nav.js +19 -8
  233. package/lib/browser/components/app-shell-hooks.d.ts +5 -0
  234. package/lib/browser/components/app-shell-hooks.js +46 -0
  235. package/lib/browser/components/app-shell-state.js +1 -0
  236. package/lib/browser/components/app-update-view.js +4 -4
  237. package/lib/browser/components/app-view.js +8 -4
  238. package/lib/browser/components/chat-emoji.d.ts +36 -0
  239. package/lib/browser/components/chat-emoji.js +167 -0
  240. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  241. package/lib/browser/components/composer-attachments.d.ts +6 -0
  242. package/lib/browser/components/composer-attachments.js +12 -0
  243. package/lib/browser/components/composer-box-protocol.d.ts +15 -0
  244. package/lib/browser/components/composer-box.js +107 -84
  245. package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
  246. package/lib/browser/components/composer-drop-hooks.js +72 -0
  247. package/lib/browser/components/composer-emoji.js +1 -1
  248. package/lib/browser/components/composer-faces.d.ts +17 -0
  249. package/lib/browser/components/composer-faces.js +73 -0
  250. package/lib/browser/components/composer-media.d.ts +10 -0
  251. package/lib/browser/components/composer-media.js +13 -0
  252. package/lib/browser/components/composer-target.d.ts +4 -0
  253. package/lib/browser/components/composer-target.js +18 -7
  254. package/lib/browser/components/composer-type-focus.d.ts +25 -0
  255. package/lib/browser/components/composer-type-focus.js +20 -0
  256. package/lib/browser/components/composer-voice.d.ts +25 -0
  257. package/lib/browser/components/composer-voice.js +73 -0
  258. package/lib/browser/components/composer.d.ts +2 -2
  259. package/lib/browser/components/composer.js +38 -7
  260. package/lib/browser/components/context-menu.js +2 -1
  261. package/lib/browser/components/emoji-panel.d.ts +11 -7
  262. package/lib/browser/components/emoji-panel.js +40 -22
  263. package/lib/browser/components/extension-settings.js +1 -1
  264. package/lib/browser/components/folder-new.d.ts +19 -0
  265. package/lib/browser/components/folder-new.js +90 -0
  266. package/lib/browser/components/folder-picker.d.ts +5 -2
  267. package/lib/browser/components/folder-picker.js +17 -5
  268. package/lib/browser/components/host-view.d.ts +1 -1
  269. package/lib/browser/components/image-menu.d.ts +8 -3
  270. package/lib/browser/components/image-menu.js +34 -9
  271. package/lib/browser/components/markdown.js +9 -2
  272. package/lib/browser/components/media.js +3 -2
  273. package/lib/browser/components/message-list.js +2 -2
  274. package/lib/browser/components/message-steps.js +20 -11
  275. package/lib/browser/components/message-user.js +1 -1
  276. package/lib/browser/components/moved-notice.js +2 -1
  277. package/lib/browser/components/nav-places.d.ts +2 -0
  278. package/lib/browser/components/nav-places.js +4 -2
  279. package/lib/browser/components/phone-shell.d.ts +2 -0
  280. package/lib/browser/components/phone-shell.js +5 -1
  281. package/lib/browser/components/secret-text.d.ts +1 -1
  282. package/lib/browser/components/secret-text.js +4 -3
  283. package/lib/browser/components/session-view.js +3 -0
  284. package/lib/browser/components/settings-choices.d.ts +2 -1
  285. package/lib/browser/components/settings-choices.js +12 -4
  286. package/lib/browser/components/settings-more.js +2 -2
  287. package/lib/browser/components/settings-parts.js +11 -0
  288. package/lib/browser/components/share-item-sheet.js +7 -1
  289. package/lib/browser/components/tab-title.d.ts +28 -0
  290. package/lib/browser/components/tab-title.js +38 -0
  291. package/lib/browser/components/use-composer-attachments.d.ts +29 -0
  292. package/lib/browser/components/use-composer-attachments.js +101 -0
  293. package/lib/browser/components/use-composer-files.d.ts +26 -0
  294. package/lib/browser/components/use-composer-files.js +88 -0
  295. package/lib/browser/components/web-composer.d.ts +3 -1
  296. package/lib/browser/components/web-composer.js +3 -2
  297. package/lib/browser/components/workbench-view.js +1 -0
  298. package/lib/browser/components/working-directory.js +2 -1
  299. package/lib/browser/device/app-update.d.ts +6 -3
  300. package/lib/browser/device/app-update.js +11 -5
  301. package/lib/browser/device/drag-move.d.ts +22 -0
  302. package/lib/browser/device/drag-move.js +122 -0
  303. package/lib/browser/extension/icons.js +6 -0
  304. package/lib/browser/extension/web-api-desktop.d.ts +19 -0
  305. package/lib/browser/extension/web-api-menus.d.ts +19 -0
  306. package/lib/browser/extension/web-api-spec.js +2 -0
  307. package/lib/browser/extension/web-extension-api.d.ts +24 -23
  308. package/lib/browser/extension/web-extension-context.d.ts +1 -0
  309. package/lib/browser/extension/web-extension-context.js +12 -5
  310. package/lib/browser/extension/web-extension-run.js +1 -0
  311. package/lib/browser/extension/web-share-ui.d.ts +1 -1
  312. package/lib/browser/extension/web-share-ui.js +2 -0
  313. package/lib/browser/extension/web-share.d.ts +13 -0
  314. package/lib/browser/extension/web-share.js +37 -2
  315. package/lib/browser/i18n/en/account.d.ts +18 -0
  316. package/lib/browser/i18n/en/account.js +18 -0
  317. package/lib/browser/i18n/en/call.js +1 -1
  318. package/lib/browser/i18n/en/chat.d.ts +15 -0
  319. package/lib/browser/i18n/en/chat.js +16 -1
  320. package/lib/browser/i18n/en/common.d.ts +2 -0
  321. package/lib/browser/i18n/en/common.js +2 -0
  322. package/lib/browser/i18n/en/discover.d.ts +2 -0
  323. package/lib/browser/i18n/en/discover.js +2 -0
  324. package/lib/browser/i18n/en/service.d.ts +4 -0
  325. package/lib/browser/i18n/en/service.js +4 -0
  326. package/lib/browser/i18n/en/settings.d.ts +17 -0
  327. package/lib/browser/i18n/en/settings.js +17 -0
  328. package/lib/browser/i18n/ja/account.js +18 -0
  329. package/lib/browser/i18n/ja/call.js +1 -1
  330. package/lib/browser/i18n/ja/chat.js +16 -1
  331. package/lib/browser/i18n/ja/common.js +2 -0
  332. package/lib/browser/i18n/ja/discover.js +3 -1
  333. package/lib/browser/i18n/ja/service.js +4 -0
  334. package/lib/browser/i18n/ja/settings.js +17 -0
  335. package/lib/browser/i18n/locales.d.ts +59 -1
  336. package/lib/browser/i18n/messages.d.ts +58 -0
  337. package/lib/browser/i18n/zh/account.js +18 -0
  338. package/lib/browser/i18n/zh/call.js +1 -1
  339. package/lib/browser/i18n/zh/chat.js +16 -1
  340. package/lib/browser/i18n/zh/common.js +2 -0
  341. package/lib/browser/i18n/zh/discover.js +3 -1
  342. package/lib/browser/i18n/zh/service.js +4 -0
  343. package/lib/browser/i18n/zh/settings.js +17 -0
  344. package/lib/browser/i18n/zh-tw/account.js +18 -0
  345. package/lib/browser/i18n/zh-tw/call.js +1 -1
  346. package/lib/browser/i18n/zh-tw/chat.js +16 -1
  347. package/lib/browser/i18n/zh-tw/common.js +2 -0
  348. package/lib/browser/i18n/zh-tw/discover.js +3 -1
  349. package/lib/browser/i18n/zh-tw/service.js +4 -0
  350. package/lib/browser/i18n/zh-tw/settings.js +17 -0
  351. package/lib/browser/offline/kept-chats.d.ts +3 -1
  352. package/lib/browser/offline/kept-chats.js +1 -1
  353. package/lib/browser/partners/group-picker.d.ts +3 -2
  354. package/lib/browser/partners/group-picker.js +8 -3
  355. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  356. package/lib/browser/sandbox/work/work-docs.js +5 -2
  357. package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
  358. package/lib/browser/sandbox/work/work-frame.js +9 -3
  359. package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
  360. package/lib/browser/sandbox/work/work-gates.js +185 -0
  361. package/lib/browser/settings/agent-settings.js +1 -1
  362. package/lib/browser/settings/navigation.d.ts +38 -10
  363. package/lib/browser/settings/navigation.js +74 -18
  364. package/lib/browser/settings/settings-protocol.d.ts +16 -1
  365. package/lib/browser/settings/settings-protocol.js +21 -3
  366. package/lib/browser/settings/settings.js +3 -0
  367. package/lib/browser/style/base.d.ts +1 -1
  368. package/lib/browser/style/base.js +15 -2
  369. package/lib/browser/style/chat-list.d.ts +1 -1
  370. package/lib/browser/style/chat-list.js +6 -3
  371. package/lib/browser/style/conversation-column.d.ts +1 -1
  372. package/lib/browser/style/conversation-column.js +28 -8
  373. package/lib/browser/style/conversation.d.ts +1 -1
  374. package/lib/browser/style/conversation.js +5 -0
  375. package/lib/browser/style/device.js +5 -0
  376. package/lib/browser/style/pages.d.ts +1 -1
  377. package/lib/browser/style/pages.js +3 -3
  378. package/lib/browser/style/shell.d.ts +1 -1
  379. package/lib/browser/style/shell.js +13 -6
  380. package/lib/browser/style/tasks.d.ts +1 -1
  381. package/lib/browser/style/tasks.js +4 -2
  382. package/lib/browser/util/chat-emoji.d.ts +45 -0
  383. package/lib/browser/util/chat-emoji.js +272 -0
  384. package/lib/browser/util/composer-drop.d.ts +27 -0
  385. package/lib/browser/util/composer-drop.js +43 -0
  386. package/lib/browser/util/composer-files.d.ts +49 -0
  387. package/lib/browser/util/composer-files.js +102 -0
  388. package/lib/browser/util/composer.d.ts +13 -1
  389. package/lib/browser/util/composer.js +24 -6
  390. package/lib/browser/util/markdown.d.ts +5 -0
  391. package/lib/browser/util/markdown.js +18 -0
  392. package/lib/browser/util/message.d.ts +6 -1
  393. package/lib/browser/util/message.js +13 -2
  394. package/lib/browser/util/process.d.ts +10 -13
  395. package/lib/browser/util/process.js +32 -84
  396. package/lib/browser/util/turn-join.d.ts +39 -0
  397. package/lib/browser/util/turn-join.js +122 -0
  398. package/lib/browser/workbench-services.js +1 -1
  399. package/package.json +7 -7
  400. package/public/emoji/wechat-v1.webp +0 -0
@@ -1,10 +1,16 @@
1
1
  import { TurnEnd } from '../util/turn-end.js';
2
2
  import { Voice } from '../util/voice.js';
3
+ import { CallAnnouncing } from './call-announcing.js';
4
+ import { CallAnswering } from './call-answering.js';
3
5
  import { CallConversing, CallDrafts } from './call-conversing.js';
6
+ import { CallHearing } from './call-hearing.js';
4
7
  import { CallPartnering } from './call-partnering.js';
5
- import { CallTurnEnd, RETRY_MS, SILENT_MS, SILENT_ROUNDS } from './call-turn-end.js';
8
+ import { CallPausing } from './call-pausing.js';
9
+ import { CallReading } from './call-reading.js';
10
+ import { CallRevoicing } from './call-revoicing.js';
11
+ import { CallTurnEnd, SILENT_MS } from './call-turn-end.js';
12
+ import { CallTurns } from './call-turns.js';
6
13
  import { CallSounds } from './voice-reading.js';
7
- import { VoiceReopen } from './voice-reopen.js';
8
14
  const IDLE = { active: false, phase: 'listening', heard: '' };
9
15
  /**
10
16
  * A call with a conversation (the double's, or any other), by the voice of the page: Ta listens until the user pauses, sends what they said, reads
@@ -20,17 +26,12 @@ export class VoiceCall {
20
26
  this.listeners = new Set();
21
27
  /** Of the listen now: one that ended or was stopped for another says nothing more. */
22
28
  this.round = 0;
23
- this.silent = 0;
24
- /** When someone last spoke (the user, or Ta): the silence that ends the call counts from it. */
25
- this.spoke = 0;
26
29
  /** Of the call now: a voice opened for a call hung up is let go. */
27
30
  this.calls = 0;
28
31
  /** Its voice service is opening: an answer that comes meanwhile waits for it (`waiting`, '' for none). */
29
32
  this.opening = false;
30
33
  /** The answer begun on what the user said so far (CallPartner.draft). */
31
34
  this.drafts = new CallDrafts();
32
- /** What waits to be said that the user did not ask for (a dialog, a task that ended), in order. */
33
- this.announcements = [];
34
35
  /** For the face of the call (CallSounds): Ta's voice, whichever the call has (it opens after the call shows). */
35
36
  this.sounds = new CallSounds(() => this.voice);
36
37
  this.level = this.sounds.level;
@@ -57,6 +58,124 @@ export class VoiceCall {
57
58
  end: reason => this.end(reason),
58
59
  lost: () => this.revoice(),
59
60
  }, options.silentMs);
61
+ this.turns = new CallTurns({
62
+ get state() {
63
+ return call.state;
64
+ },
65
+ get partnered() {
66
+ return !!call.partners.partner;
67
+ },
68
+ turnEnded: reply => this.turnEnded(reply),
69
+ });
70
+ this.pausing = new CallPausing({
71
+ get state() {
72
+ return call.state;
73
+ },
74
+ get voice() {
75
+ return call.voice;
76
+ },
77
+ get opening() {
78
+ return call.opening;
79
+ },
80
+ get pending() {
81
+ return call.pending;
82
+ },
83
+ setPending: pending => {
84
+ call.pending = pending;
85
+ },
86
+ get speaking() {
87
+ return call.speaking;
88
+ },
89
+ set: change => call.set(change),
90
+ stopListening: () => call.stopListening(),
91
+ listen: announce => call.listen(announce),
92
+ read: text => call.read(text),
93
+ dropDrafts: () => call.drafts.drop(),
94
+ conversingResumed: () => call.conversing.resumed(),
95
+ interrupt: () => call.interrupt(),
96
+ });
97
+ this.answering = options.answer
98
+ ? new CallAnswering({
99
+ get state() {
100
+ return call.state;
101
+ },
102
+ answer: said => options.answer(said),
103
+ round: () => call.round,
104
+ waiting: () => call.turns.waiting,
105
+ set: change => call.set(change),
106
+ over: () => call.over(),
107
+ send: said => call.send(said),
108
+ unsent: () => call.unsent(),
109
+ })
110
+ : undefined;
111
+ this.revoicing = new CallRevoicing({
112
+ get state() {
113
+ return call.state;
114
+ },
115
+ calls: () => call.calls,
116
+ thought: () => { var _a; return !!((_a = call.partners.partner) === null || _a === void 0 ? void 0 : _a.brain); },
117
+ setOpening: opening => {
118
+ call.opening = opening;
119
+ },
120
+ set: change => call.set(change),
121
+ takeVoice: (voice, partner) => {
122
+ if (partner) {
123
+ call.partners.adopt(partner);
124
+ }
125
+ call.takeVoice(voice);
126
+ },
127
+ voiced: () => call.voiced(),
128
+ options: () => options,
129
+ failed: error => call.end('failed', error instanceof Error ? error.message : String(error)),
130
+ });
131
+ this.announcing = new CallAnnouncing({
132
+ get state() {
133
+ return call.state;
134
+ },
135
+ get voice() {
136
+ return call.voice;
137
+ },
138
+ get opening() {
139
+ return call.opening;
140
+ },
141
+ listen: () => call.listen(),
142
+ });
143
+ this.reading = new CallReading({
144
+ get state() {
145
+ return call.state;
146
+ },
147
+ get voice() {
148
+ return call.voice;
149
+ },
150
+ options: () => options,
151
+ set: change => call.set(change),
152
+ round: () => call.round,
153
+ nextRound: () => ++call.round,
154
+ ending: () => { var _a, _b; return !!((_b = (_a = call.partners.partner) === null || _a === void 0 ? void 0 : _a.ending) === null || _b === void 0 ? void 0 : _b.call(_a)); },
155
+ hangUp: () => call.hangUp(),
156
+ listen: () => call.listen(),
157
+ });
158
+ this.hearing = new CallHearing({
159
+ get state() {
160
+ return call.state;
161
+ },
162
+ get thinks() {
163
+ return !!call.voice.thinks;
164
+ },
165
+ get turnEnd() {
166
+ return call.turnEnd;
167
+ },
168
+ silentMs: () => { var _a; return (_a = options.silentMs) !== null && _a !== void 0 ? _a : SILENT_MS; },
169
+ get listening() {
170
+ return !!call.listening;
171
+ },
172
+ stopListening: () => call.stopListening(),
173
+ listen: (announce, held) => call.listen(announce, held),
174
+ take: said => call.take(said),
175
+ waits: said => call.turnEnd.waits(said),
176
+ set: change => call.set(change),
177
+ end: reason => call.end(reason),
178
+ });
60
179
  this.turnEnd = new CallTurnEnd(options, () => this.quiet(), text => this.suspect(text));
61
180
  }
62
181
  subscribe(listener) {
@@ -71,9 +190,8 @@ export class VoiceCall {
71
190
  if (this.state.active)
72
191
  return;
73
192
  this.device.hush();
74
- this.silent = 0;
75
- this.spoke = Date.now();
76
- const call = ++this.calls;
193
+ this.hearing.spokeNow();
194
+ this.calls++;
77
195
  const opening = this.open(direct);
78
196
  // Said as they called: the turn is at work already, its answer is read once the voice is there.
79
197
  this.set({
@@ -89,6 +207,11 @@ export class VoiceCall {
89
207
  return;
90
208
  }
91
209
  this.opening = true;
210
+ this.opened(opening);
211
+ }
212
+ /** Its voice service and partner are there, or none is: the call hears it, or says why it failed. */
213
+ opened(opening) {
214
+ const call = this.calls;
92
215
  opening.then(([voice, partner]) => {
93
216
  var _a;
94
217
  if (!this.state.active || call !== this.calls) {
@@ -100,9 +223,9 @@ export class VoiceCall {
100
223
  this.partners.adopt(partner);
101
224
  // Said as they called, to the conversation: the partner answers it, not the turn; a voice that thinks
102
225
  // begins afresh.
103
- if (partner && said && this.state.phase === 'thinking' && !(voice === null || voice === void 0 ? void 0 : voice.thinks)) {
226
+ if (partner && this.state.heard && this.state.phase === 'thinking' && !(voice === null || voice === void 0 ? void 0 : voice.thinks)) {
104
227
  this.waiting = undefined;
105
- this.partners.ask(said.text, true);
228
+ this.partners.ask(this.state.heard, true);
106
229
  }
107
230
  if (voice) {
108
231
  this.takeVoice(voice);
@@ -148,173 +271,72 @@ export class VoiceCall {
148
271
  }
149
272
  /**
150
273
  * Its voice service is gone (ta serve restarted, the connection dropped): the call says it connects, and opens it
151
- * again as the connection comes back (VoiceReopen); a service no longer chosen gives the voice of the device.
274
+ * again as the connection comes back (CallRevoicing); a service no longer chosen gives the voice of the device.
152
275
  */
153
276
  revoice() {
154
277
  var _a, _b, _c, _d;
155
- const call = this.calls;
156
- // A voice that thought had the brain of the partner: both open again.
157
- const thought = !!((_a = this.partners.partner) === null || _a === void 0 ? void 0 : _a.brain);
158
278
  this.conversing.stop();
159
- (_b = this.offSpeech) === null || _b === void 0 ? void 0 : _b.call(this);
279
+ (_a = this.offSpeech) === null || _a === void 0 ? void 0 : _a.call(this);
160
280
  this.offSpeech = undefined;
161
- (_d = (_c = this.voice).stop) === null || _d === void 0 ? void 0 : _d.call(_c);
281
+ (_c = (_b = this.voice).stop) === null || _c === void 0 ? void 0 : _c.call(_b);
162
282
  this.voice = this.device;
163
- if (thought) {
283
+ if ((_d = this.partners.partner) === null || _d === void 0 ? void 0 : _d.brain) {
164
284
  this.partners.close();
165
285
  }
166
- this.opening = true;
167
- this.set({ phase: 'connecting', heard: '', bargeIn: false });
168
- let partner;
169
- this.reopening = new VoiceReopen(async () => {
170
- var _a, _b, _c, _d, _e, _f, _g;
171
- var _h;
172
- if (!thought) {
173
- return (_b = (_a = this.options).openVoice) === null || _b === void 0 ? void 0 : _b.call(_a);
174
- }
175
- partner === null || partner === void 0 ? void 0 : partner.close();
176
- const opening = (_h = (_e = (_d = (_c = this.options).openPartner) === null || _d === void 0 ? void 0 : _d.call(_c)) === null || _e === void 0 ? void 0 : _e.catch(() => undefined)) !== null && _h !== void 0 ? _h : Promise.resolve(undefined);
177
- const voice = await ((_g = (_f = this.options).openVoice) === null || _g === void 0 ? void 0 : _g.call(_f, opening));
178
- partner = await opening;
179
- return voice;
180
- });
181
- this.reopening.run().then(voice => {
182
- var _a;
183
- if (call !== this.calls || !this.state.active) {
184
- (_a = voice === null || voice === void 0 ? void 0 : voice.stop) === null || _a === void 0 ? void 0 : _a.call(voice);
185
- partner === null || partner === void 0 ? void 0 : partner.close();
186
- return;
187
- }
188
- this.opening = false;
189
- if (thought) {
190
- this.partners.adopt(partner);
191
- }
192
- if (voice) {
193
- this.takeVoice(voice);
194
- }
195
- this.voiced();
196
- }, (error) => call === this.calls && this.state.active && this.end('failed', error instanceof Error ? error.message : String(error)));
286
+ this.revoicing.run();
197
287
  }
198
288
  hangUp() {
199
- var _a, _b, _c, _d;
289
+ var _a, _b, _c;
200
290
  if (!this.state.active)
201
291
  return;
202
292
  this.drafts.drop();
203
293
  this.conversing.stop();
204
294
  this.partners.close();
205
295
  this.calls++;
206
- (_a = this.reopening) === null || _a === void 0 ? void 0 : _a.cancel();
207
- this.reopening = undefined;
296
+ this.revoicing.cancel();
208
297
  this.opening = false;
209
298
  this.waiting = undefined;
210
299
  this.stopListening();
211
300
  this.voice.hush();
212
- (_b = this.offSpeech) === null || _b === void 0 ? void 0 : _b.call(this);
301
+ (_a = this.offSpeech) === null || _a === void 0 ? void 0 : _a.call(this);
213
302
  this.offSpeech = undefined;
214
- (_d = (_c = this.voice).stop) === null || _d === void 0 ? void 0 : _d.call(_c);
303
+ (_c = (_b = this.voice).stop) === null || _c === void 0 ? void 0 : _c.call(_b);
215
304
  this.voice = this.device;
216
305
  this.pending = undefined;
217
- this.announcements = [];
306
+ this.announcing.clear();
218
307
  this.set(IDLE);
219
308
  }
220
- /**
221
- * Says something the user did not ask for, which they should hear in a call (Ta waits for them, a task ended):
222
- * at once while Ta listens and the user has said nothing yet, else once what goes on now is over; never over
223
- * the user, nor over an answer.
224
- */
309
+ /** What the user did not ask for, said in a silence (CallAnnouncing). */
225
310
  announce(text) {
226
- const said = text.trim();
227
- // A voice that thinks is told the news of the work by Ta itself (TaVoiceEngine.tell).
228
- if (!this.state.active || !said || this.voice.thinks)
229
- return;
230
- this.announcements.push(said);
231
- if (!this.state.paused && !this.opening && this.state.phase === 'listening' && !this.state.heard.trim()) {
232
- this.listen();
233
- }
311
+ this.announcing.announce(text);
234
312
  }
235
313
  /** The user began to speak while Ta reads: it stops and listens to them. */
236
314
  bargeIn() {
237
- if (this.state.active && !this.state.paused && this.state.phase === 'speaking') {
238
- this.interrupt();
239
- }
315
+ this.pausing.bargeIn();
240
316
  }
241
- /**
242
- * The page went to the background, where the device stops its listening and reading: the call stops them itself
243
- * and waits, rather than look as if it listened. What was being said is said again on resume.
244
- */
317
+ /** The page went to the background: the call waits, rather than look as if it listened (CallPausing). */
245
318
  pause() {
246
- var _a, _b;
247
- if (!this.state.active || this.state.paused) {
248
- return;
249
- }
250
- if (this.voice.thinks) {
251
- (_b = (_a = this.voice).mute) === null || _b === void 0 ? void 0 : _b.call(_a, true);
252
- this.voice.hush();
253
- this.set({ paused: true, phase: 'listening', heard: '' });
254
- return;
255
- }
256
- this.stopListening();
257
- this.drafts.drop();
258
- if (this.state.phase === 'speaking') {
259
- this.voice.hush();
260
- this.pending = this.speaking;
261
- }
262
- this.set({ paused: true, heard: this.state.phase === 'thinking' ? this.state.heard : '' });
319
+ this.pausing.pause();
263
320
  }
264
321
  /** The page shows again: the answer that waits is read, a turn at work is waited for, else Ta listens. */
265
322
  resume() {
266
- var _a, _b;
267
- if (!this.state.active || !this.state.paused) {
268
- return;
269
- }
270
- this.silent = 0;
271
- this.set({ paused: false });
272
- if (this.voice.thinks) {
273
- this.conversing.resumed();
274
- (_b = (_a = this.voice).mute) === null || _b === void 0 ? void 0 : _b.call(_a, false);
275
- return;
276
- }
277
- const pending = this.pending;
278
- this.pending = undefined;
279
- if (pending) {
280
- this.read(pending);
281
- }
282
- else if (this.state.phase !== 'thinking' && this.state.phase !== 'connecting') {
283
- this.listen();
284
- }
323
+ this.pausing.resume();
324
+ }
325
+ /** What was said is over: Ta listens again, or hangs up when the partner ended the call. */
326
+ over() {
327
+ this.reading.over();
328
+ }
329
+ /** What is being read now, to read again after a pause. */
330
+ get speaking() {
331
+ return this.reading.now;
332
+ }
333
+ /** A call says \`said\` aloud, then listens. */
334
+ read(said) {
335
+ this.reading.read(said);
285
336
  }
286
337
  /** While Ta speaks (an answer, or news it tells by itself): it stops and listens to the user, before any more news. */
287
338
  interrupt() {
288
- if (this.state.active && this.state.phase === 'speaking') {
289
- this.voice.hush();
290
- if (this.voice.thinks) {
291
- this.set({ phase: 'listening', heard: '' });
292
- }
293
- else {
294
- this.listen(false);
295
- }
296
- }
297
- }
298
- /**
299
- * How the conversation is, as it changes: a run that started after what the user said is the call's turn, and
300
- * once it settles its reply is read. A run already going when the call asked (a follow-up) is its turn too.
301
- */
302
- turn(working, reply) {
303
- var _a;
304
- // A partner answers in this call: the turns of the conversation are its work, not the call's.
305
- if (!this.state.active || this.state.phase !== 'thinking' || this.partners.partner) {
306
- this.asked = undefined;
307
- return;
308
- }
309
- if (working) {
310
- (_a = this.asked) !== null && _a !== void 0 ? _a : (this.asked = { before: reply === null || reply === void 0 ? void 0 : reply.index });
311
- return;
312
- }
313
- if (this.asked) {
314
- const fresh = reply && reply.index !== this.asked.before ? reply.text : undefined;
315
- this.asked = undefined;
316
- this.turnEnded(fresh);
317
- }
339
+ this.pausing.interrupt();
318
340
  }
319
341
  /**
320
342
  * The conversation's turn settled: its answer, if a new one came, is read out, and Ta listens again. Only for a turn
@@ -341,27 +363,6 @@ export class VoiceCall {
341
363
  }
342
364
  this.read(said);
343
365
  }
344
- /** What was said is over: Ta listens again, or hangs up when the partner ended the call. */
345
- over() {
346
- var _a, _b;
347
- if ((_b = (_a = this.partners.partner) === null || _a === void 0 ? void 0 : _a.ending) === null || _b === void 0 ? void 0 : _b.call(_a)) {
348
- this.hangUp();
349
- }
350
- else {
351
- this.listen();
352
- }
353
- }
354
- read(said) {
355
- const round = ++this.round;
356
- this.speaking = said;
357
- this.spoke = Date.now();
358
- this.set({ phase: 'speaking', heard: '', reading: undefined });
359
- this.voice.speak(said, this.options.language(), () => {
360
- if (this.state.active && round === this.round) {
361
- this.over();
362
- }
363
- }, this.options.voice(), (pieces, at) => this.state.active && round === this.round && this.set({ reading: { pieces, at } }));
364
- }
365
366
  /**
366
367
  * Listens; first says what waits to be said, unless the user just cut in to speak (`announce` false). `held`: sounds
367
368
  * alone a listen ended on, which what is heard now follows, gone or sent once it waited FILLER_MS for words.
@@ -376,7 +377,7 @@ export class VoiceCall {
376
377
  if (this.state.paused) {
377
378
  return;
378
379
  }
379
- const announcement = announce ? this.announcements.shift() : undefined;
380
+ const announcement = this.announcing.next(announce);
380
381
  if (announcement) {
381
382
  this.read(announcement);
382
383
  return;
@@ -421,71 +422,39 @@ export class VoiceCall {
421
422
  }
422
423
  /** The user says they are done (the mark of the bar tapped): what was heard goes now as it is, sounds alone too. */
423
424
  endTurn() {
424
- if (this.voice.thinks) {
425
- return;
426
- }
427
- const said = this.listened();
428
- if (said) {
429
- this.stopListening();
430
- this.take(said);
431
- }
425
+ this.hearing.endTurn();
432
426
  }
433
- /** The words heard stayed the same a while, or the turn is at its longest (CallTurnEnd): the user is done. */
427
+ /** The words heard stayed the same a while: the user is done (CallHearing). */
434
428
  quiet() {
435
- const said = this.listened();
436
- if (said) {
437
- this.stopListening();
438
- this.heard(said, undefined, true);
439
- }
429
+ this.hearing.quiet();
440
430
  }
441
- /** What was heard of a listen going on, while Ta listens; undefined else. */
431
+ /** What was heard of a listen going on (CallHearing). */
442
432
  listened() {
443
- const said = this.state.heard.trim();
444
- return this.state.active && !this.state.paused && this.state.phase === 'listening' && said && this.listening ? said : undefined;
433
+ return this.hearing.listened();
434
+ }
435
+ /** A listen ended (CallHearing). */
436
+ heard(said, error, waited = false) {
437
+ this.hearing.heard(said, error, waited);
445
438
  }
446
439
  /**
447
- * A listen ended: what was said goes to the double; nothing, Ta listens again, a few times. Sounds alone wait on in
448
- * the next listen until they waited FILLER_MS (`waited`); then a hesitation is dropped and a backchannel goes.
440
+ * What the user said goes to the partner, or to the conversation; words that answer the question it waits on answer
441
+ * it, and the work goes on from there (CallAnswering).
449
442
  */
450
- heard(said, error, waited = false) {
451
- var _a;
452
- if (error && Voice.denied(error)) {
453
- this.end('denied');
454
- return;
455
- }
456
- if (said && !waited && this.turnEnd.waits(said)) {
457
- if (error) {
458
- this.retry = setTimeout(() => this.state.active && this.state.phase === 'listening' && this.listen(false, said), RETRY_MS);
459
- }
460
- else {
461
- this.listen(false, said);
462
- }
463
- return;
464
- }
465
- if (said && TurnEnd.sounds(said) === 'hesitation') {
466
- said = '';
467
- this.set({ heard: '' });
468
- }
469
- if (said) {
470
- this.take(said);
471
- return;
472
- }
473
- if (++this.silent >= SILENT_ROUNDS && Date.now() - this.spoke >= ((_a = this.options.silentMs) !== null && _a !== void 0 ? _a : SILENT_MS)) {
474
- this.end('silent');
443
+ take(said) {
444
+ this.hearing.heardWords();
445
+ if (this.answering && !this.partners.partner) {
446
+ this.answering.take(said);
475
447
  return;
476
448
  }
477
- if (error) {
478
- this.retry = setTimeout(() => this.state.active && this.state.phase === 'listening' && this.listen(), RETRY_MS);
479
- }
480
- else {
481
- this.listen();
482
- }
449
+ this.thinking(said);
483
450
  }
484
- /** What the user said goes to the partner, or to the conversation. */
485
- take(said) {
486
- this.silent = 0;
487
- this.spoke = Date.now();
451
+ /** What the user said goes to the conversation: it thinks of it, and its reply is read as any turn. */
452
+ thinking(said) {
488
453
  this.set({ phase: 'thinking', heard: said, said, reading: undefined });
454
+ this.send(said);
455
+ }
456
+ /** What the user said goes to the partner, or to the conversation. */
457
+ send(said) {
489
458
  const draft = this.drafts.take(said);
490
459
  if (this.partners.partner && draft) {
491
460
  this.partners.kept(draft, said);
@@ -526,8 +495,13 @@ export class VoiceCall {
526
495
  this.hangUp();
527
496
  (_b = (_a = this.options).ended) === null || _b === void 0 ? void 0 : _b.call(_a, reason, detail);
528
497
  }
498
+ turn(working, reply) {
499
+ this.turns.turn(working, reply);
500
+ }
529
501
  stopListening() {
530
- clearTimeout(this.retry);
502
+ var _a;
503
+ this.hearing.stop();
504
+ (_a = this.answering) === null || _a === void 0 ? void 0 : _a.stop();
531
505
  this.turnEnd.stop();
532
506
  this.round++;
533
507
  const listening = this.listening;
@@ -64,6 +64,7 @@ function DraftView({ draft, menu, aboveComposer, belowComposer }) {
64
64
  const fail = (cause) => notices.error(cause);
65
65
  const submit = (message, images) => chat.submit(message, images);
66
66
  const list = React.useCallback((directory) => workbench.workspace.listDirectory('.', directory), [workbench]);
67
+ const create = React.useCallback((directory, name) => workbench.workspace.createDirectory(name, directory), [workbench]);
67
68
  const pickModel = React.useCallback((model) => chat.setDraftModel(model), [chat]);
68
69
  const model = useDraftModel(workbench.settings, draft, pickModel, t);
69
70
  const commands = useDirectoryCommands(workbench.server, draft.cwd || undefined);
@@ -94,7 +95,7 @@ function DraftView({ draft, menu, aboveComposer, belowComposer }) {
94
95
  React.createElement("div", { className: "ta-thread" }, sent ? React.createElement(MessageList, { state: sent, outbox: outbox }) : React.createElement(Hero, { cwd: draft.cwd, onPick: text => void submit(text).catch(fail) }))),
95
96
  React.createElement("div", { className: "ta-bottom" },
96
97
  aboveComposer,
97
- React.createElement(Composer, { above: React.createElement(PhoneHint, null), server: workbench.server, workspace: workbench.workspace, working: going, onStop: () => chat.stopDraft(), commands: commands, cwd: draft.cwd || undefined, onSubmit: submit, onError: fail, talkPlace: "draft", draft: DraftPlaces.NEW, recentShots: recentShots, actions: model ? [[model]] : undefined, head: going ? undefined : React.createElement(DirectoryButton, { cwd: draft.cwd, list: list, remote: workbench, onPick: cwd => chat.setDraftCwd(cwd) }) }),
98
+ React.createElement(Composer, { above: React.createElement(PhoneHint, null), server: workbench.server, workspace: workbench.workspace, working: going, onStop: () => chat.stopDraft(), commands: commands, cwd: draft.cwd || undefined, onSubmit: submit, onError: fail, talkPlace: "draft", draft: DraftPlaces.NEW, recentShots: recentShots, actions: model ? [[model]] : undefined, head: going ? undefined : (React.createElement(DirectoryButton, { cwd: draft.cwd, list: list, create: create, remote: workbench, onPick: cwd => chat.setDraftCwd(cwd) })) }),
98
99
  belowComposer)));
99
100
  }
100
101
  /** A conversation picked that is still loading, laid out as it will be: its head, a spinner, a message box that waits. */
@@ -83,7 +83,7 @@ export function useAccountEntries(onSettings, onDialog) {
83
83
  entry('restart', t('ta.update.restartTo', { version: ServeRestartUtil.label(update) }), RotateCw, () => void restartTa.restart(), { action: true });
84
84
  }
85
85
  if (appUpdate) {
86
- entry('appUpdate', t('ta.appUpdate.installTo', { version: appUpdate.version }), Download, () => AppUpdate.install(), { action: true });
86
+ entry('appUpdate', t(appUpdate.back ? 'ta.appUpdate.backTo' : 'ta.appUpdate.installTo', { version: appUpdate.version }), Download, () => AppUpdate.install(), { action: true });
87
87
  }
88
88
  entry('install', t('ta.pwa.install'), Download, () => void pwa.install(), { action: true });
89
89
  // As WeChat's: the account in use kept, with its computers, to come back to in one tap (docs/design/ta-me.md 4).
@@ -0,0 +1,11 @@
1
+ import type { TaAccountInfo } from '@celljs/ta-protocol';
2
+ import * as React from 'react';
3
+ import type { Act } from './account-view.js';
4
+ /**
5
+ * The recovery code of the account (docs/design/ta-account.md 10): made here and written down, or made on another
6
+ * computer, or given on a new one to bring the friends and group chats back. A computer's alone: the app has none.
7
+ */
8
+ export declare function RecoveryPart({ info, act }: {
9
+ info: TaAccountInfo;
10
+ act: Act;
11
+ }): React.JSX.Element;
@@ -0,0 +1,81 @@
1
+ import * as React from 'react';
2
+ import { ConsoleUtil } from '../gateway/console-util.js';
3
+ import { useNotices } from '../hooks.js';
4
+ import { useLanguage, useT } from '../i18n/use-t.js';
5
+ import { BusyMark, useBusy } from './busy.js';
6
+ /**
7
+ * The recovery code of the account (docs/design/ta-account.md 10): made here and written down, or made on another
8
+ * computer, or given on a new one to bring the friends and group chats back. A computer's alone: the app has none.
9
+ */
10
+ export function RecoveryPart({ info, act }) {
11
+ var _a;
12
+ const t = useT();
13
+ const language = useLanguage();
14
+ const [, notices] = useNotices();
15
+ const [busy, run] = useBusy();
16
+ const [entering, setEntering] = React.useState(false);
17
+ const [code, setCode] = React.useState('');
18
+ const recovery = info.recovery;
19
+ React.useEffect(() => {
20
+ if (info.recovered) {
21
+ notices.notify(t('ta.recovery.restored', { friends: info.recovered.friends, rooms: info.recovered.rooms }), { level: 'success' });
22
+ }
23
+ }, [info.recovered, notices, t]);
24
+ const make = async () => {
25
+ await act(one => (one.makeRecovery ? one.makeRecovery() : Promise.resolve(info))).catch((error) => notices.error(error));
26
+ };
27
+ const saved = async () => {
28
+ await act(one => (one.recoverySaved ? one.recoverySaved() : Promise.resolve(info))).catch((error) => notices.error(error));
29
+ };
30
+ const drop = async () => {
31
+ if (!(await notices.confirm({ title: t('ta.recovery.dropConfirm'), confirmLabel: t('ta.recovery.drop'), danger: true }))) {
32
+ return;
33
+ }
34
+ await act(one => (one.dropRecovery ? one.dropRecovery() : Promise.resolve(info))).catch((error) => notices.error(error));
35
+ };
36
+ const restore = async () => {
37
+ try {
38
+ await act(one => (one.recover ? one.recover(code) : Promise.resolve(info)));
39
+ setEntering(false);
40
+ setCode('');
41
+ }
42
+ catch (error) {
43
+ notices.error(error);
44
+ }
45
+ };
46
+ if (entering) {
47
+ return (React.createElement("section", { className: "ta-account-recovery" },
48
+ React.createElement("h2", null, t('ta.recovery.code')),
49
+ React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.hint')),
50
+ React.createElement("form", { className: "ta-host-form", onSubmit: event => {
51
+ event.preventDefault();
52
+ void run(restore);
53
+ } },
54
+ React.createElement("label", { className: "ta-field" },
55
+ React.createElement("input", { autoFocus: true, autoComplete: "off", spellCheck: false, "aria-label": t('ta.recovery.code'), placeholder: t('ta.recovery.placeholder'), value: code, onChange: event => setCode(event.target.value) }))),
56
+ React.createElement("div", { className: "ta-host-actions" },
57
+ React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy || !code.trim(), onClick: () => void run(restore) },
58
+ React.createElement(BusyMark, { busy: busy }),
59
+ t('ta.recovery.restoreNow')),
60
+ React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => setEntering(false) }, t('ta.cancel')))));
61
+ }
62
+ if (info.waiting) {
63
+ // A new computer waiting to be let in: the recovery code lets it in, with no other device at hand.
64
+ return (React.createElement("div", { className: "ta-host-actions" },
65
+ React.createElement("button", { type: "button", className: "ta-button", onClick: () => setEntering(true) }, t('ta.recovery.restore'))));
66
+ }
67
+ return (React.createElement("section", { className: "ta-account-recovery" },
68
+ React.createElement("h2", null, t('ta.recovery.title')),
69
+ (recovery === null || recovery === void 0 ? void 0 : recovery.code) ? (React.createElement(React.Fragment, null,
70
+ React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.show', { code: recovery.code })),
71
+ React.createElement("div", { className: "ta-host-actions" },
72
+ React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy, onClick: () => void run(saved) },
73
+ React.createElement(BusyMark, { busy: busy }),
74
+ t('ta.recovery.saved'))))) : (recovery === null || recovery === void 0 ? void 0 : recovery.made) ? (React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.made', { time: ConsoleUtil.ago((_a = recovery.at) !== null && _a !== void 0 ? _a : Date.now(), language) }))) : (React.createElement("p", { className: "ta-account-hint" }, t('ta.recovery.none'))),
75
+ React.createElement("div", { className: "ta-host-actions" },
76
+ (recovery === null || recovery === void 0 ? void 0 : recovery.made) ? (React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => void run(drop) }, t('ta.recovery.drop'))) : (React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy, onClick: () => void run(make) },
77
+ React.createElement(BusyMark, { busy: busy }),
78
+ t('ta.recovery.make'))),
79
+ React.createElement("button", { type: "button", className: "ta-button", disabled: busy, onClick: () => setEntering(true) }, t('ta.recovery.restore')))));
80
+ }
81
+ //# sourceMappingURL=account-recovery-view.js.map