@celljs/ta-web 4.48.0 → 4.50.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 (382) 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-recovery-view.d.ts +11 -0
  30. package/esm/browser/components/account-recovery-view.js +81 -0
  31. package/esm/browser/components/account-view.d.ts +1 -2
  32. package/esm/browser/components/account-view.js +10 -1
  33. package/esm/browser/components/app-nav.js +19 -8
  34. package/esm/browser/components/app-shell-hooks.d.ts +5 -0
  35. package/esm/browser/components/app-shell-hooks.js +45 -0
  36. package/esm/browser/components/app-shell-state.js +2 -1
  37. package/esm/browser/components/app-view.js +9 -5
  38. package/esm/browser/components/chat-emoji.d.ts +35 -0
  39. package/esm/browser/components/chat-emoji.js +129 -0
  40. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  41. package/esm/browser/components/composer-attachments.d.ts +6 -0
  42. package/esm/browser/components/composer-attachments.js +12 -1
  43. package/esm/browser/components/composer-box-protocol.d.ts +15 -0
  44. package/esm/browser/components/composer-box.js +110 -87
  45. package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
  46. package/esm/browser/components/composer-drop-hooks.js +36 -0
  47. package/esm/browser/components/composer-emoji.js +1 -1
  48. package/esm/browser/components/composer-faces.d.ts +16 -0
  49. package/esm/browser/components/composer-faces.js +37 -0
  50. package/esm/browser/components/composer-media.d.ts +10 -0
  51. package/esm/browser/components/composer-media.js +12 -1
  52. package/esm/browser/components/composer-target.d.ts +4 -0
  53. package/esm/browser/components/composer-target.js +18 -7
  54. package/esm/browser/components/composer-type-focus.d.ts +24 -0
  55. package/esm/browser/components/composer-type-focus.js +17 -0
  56. package/esm/browser/components/composer-voice.d.ts +24 -0
  57. package/esm/browser/components/composer-voice.js +37 -0
  58. package/esm/browser/components/composer.d.ts +2 -2
  59. package/esm/browser/components/composer.js +39 -8
  60. package/esm/browser/components/context-menu.js +2 -1
  61. package/esm/browser/components/emoji-panel.d.ts +11 -7
  62. package/esm/browser/components/emoji-panel.js +40 -22
  63. package/esm/browser/components/extension-settings.js +2 -2
  64. package/esm/browser/components/folder-new.d.ts +18 -0
  65. package/esm/browser/components/folder-new.js +53 -0
  66. package/esm/browser/components/folder-picker.d.ts +5 -2
  67. package/esm/browser/components/folder-picker.js +18 -6
  68. package/esm/browser/components/host-view.d.ts +1 -1
  69. package/esm/browser/components/image-menu.d.ts +8 -3
  70. package/esm/browser/components/image-menu.js +34 -9
  71. package/esm/browser/components/markdown.js +9 -2
  72. package/esm/browser/components/media.js +3 -2
  73. package/esm/browser/components/message-list.js +2 -2
  74. package/esm/browser/components/message-steps.js +20 -11
  75. package/esm/browser/components/message-user.js +2 -2
  76. package/esm/browser/components/moved-notice.js +2 -1
  77. package/esm/browser/components/nav-places.d.ts +2 -0
  78. package/esm/browser/components/nav-places.js +4 -2
  79. package/esm/browser/components/phone-shell.d.ts +2 -0
  80. package/esm/browser/components/phone-shell.js +5 -1
  81. package/esm/browser/components/secret-text.d.ts +1 -1
  82. package/esm/browser/components/secret-text.js +4 -3
  83. package/esm/browser/components/session-view.js +3 -0
  84. package/esm/browser/components/settings-choices.d.ts +2 -1
  85. package/esm/browser/components/settings-choices.js +13 -5
  86. package/esm/browser/components/settings-more.js +3 -3
  87. package/esm/browser/components/settings-parts.js +13 -2
  88. package/esm/browser/components/share-item-sheet.js +7 -1
  89. package/esm/browser/components/tab-title.d.ts +27 -0
  90. package/esm/browser/components/tab-title.js +35 -0
  91. package/esm/browser/components/use-composer-attachments.d.ts +28 -0
  92. package/esm/browser/components/use-composer-attachments.js +65 -0
  93. package/esm/browser/components/use-composer-files.d.ts +25 -0
  94. package/esm/browser/components/use-composer-files.js +52 -0
  95. package/esm/browser/components/web-composer.d.ts +3 -1
  96. package/esm/browser/components/web-composer.js +3 -2
  97. package/esm/browser/components/workbench-view.js +1 -0
  98. package/esm/browser/components/working-directory.js +2 -1
  99. package/esm/browser/device/drag-move.d.ts +21 -0
  100. package/esm/browser/device/drag-move.js +86 -0
  101. package/esm/browser/extension/icons.js +7 -1
  102. package/esm/browser/extension/web-api-desktop.d.ts +19 -0
  103. package/esm/browser/extension/web-api-menus.d.ts +19 -0
  104. package/esm/browser/extension/web-api-spec.js +2 -0
  105. package/esm/browser/extension/web-extension-api.d.ts +24 -23
  106. package/esm/browser/extension/web-extension-context.d.ts +1 -0
  107. package/esm/browser/extension/web-extension-context.js +12 -5
  108. package/esm/browser/extension/web-extension-run.js +1 -0
  109. package/esm/browser/extension/web-share-ui.d.ts +1 -1
  110. package/esm/browser/extension/web-share-ui.js +2 -0
  111. package/esm/browser/extension/web-share.d.ts +13 -0
  112. package/esm/browser/extension/web-share.js +37 -2
  113. package/esm/browser/i18n/en/account.d.ts +18 -0
  114. package/esm/browser/i18n/en/account.js +18 -0
  115. package/esm/browser/i18n/en/call.js +1 -1
  116. package/esm/browser/i18n/en/chat.d.ts +15 -0
  117. package/esm/browser/i18n/en/chat.js +16 -1
  118. package/esm/browser/i18n/en/common.d.ts +2 -0
  119. package/esm/browser/i18n/en/common.js +2 -0
  120. package/esm/browser/i18n/en/discover.d.ts +2 -0
  121. package/esm/browser/i18n/en/discover.js +2 -0
  122. package/esm/browser/i18n/en/settings.d.ts +17 -0
  123. package/esm/browser/i18n/en/settings.js +17 -0
  124. package/esm/browser/i18n/ja/account.js +18 -0
  125. package/esm/browser/i18n/ja/call.js +1 -1
  126. package/esm/browser/i18n/ja/chat.js +16 -1
  127. package/esm/browser/i18n/ja/common.js +2 -0
  128. package/esm/browser/i18n/ja/discover.js +3 -1
  129. package/esm/browser/i18n/ja/settings.js +17 -0
  130. package/esm/browser/i18n/locales.d.ts +55 -1
  131. package/esm/browser/i18n/messages.d.ts +54 -0
  132. package/esm/browser/i18n/zh/account.js +18 -0
  133. package/esm/browser/i18n/zh/call.js +1 -1
  134. package/esm/browser/i18n/zh/chat.js +16 -1
  135. package/esm/browser/i18n/zh/common.js +2 -0
  136. package/esm/browser/i18n/zh/discover.js +3 -1
  137. package/esm/browser/i18n/zh/settings.js +17 -0
  138. package/esm/browser/i18n/zh-tw/account.js +18 -0
  139. package/esm/browser/i18n/zh-tw/call.js +1 -1
  140. package/esm/browser/i18n/zh-tw/chat.js +16 -1
  141. package/esm/browser/i18n/zh-tw/common.js +2 -0
  142. package/esm/browser/i18n/zh-tw/discover.js +3 -1
  143. package/esm/browser/i18n/zh-tw/settings.js +17 -0
  144. package/esm/browser/offline/kept-chats.d.ts +3 -1
  145. package/esm/browser/offline/kept-chats.js +1 -1
  146. package/esm/browser/partners/group-picker.d.ts +3 -2
  147. package/esm/browser/partners/group-picker.js +8 -3
  148. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  149. package/esm/browser/sandbox/work/work-docs.js +5 -2
  150. package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
  151. package/esm/browser/sandbox/work/work-frame.js +9 -3
  152. package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
  153. package/esm/browser/sandbox/work/work-gates.js +182 -0
  154. package/esm/browser/settings/agent-settings.js +1 -1
  155. package/esm/browser/settings/navigation.d.ts +38 -10
  156. package/esm/browser/settings/navigation.js +73 -17
  157. package/esm/browser/settings/settings-protocol.d.ts +16 -1
  158. package/esm/browser/settings/settings-protocol.js +20 -2
  159. package/esm/browser/settings/settings.js +4 -1
  160. package/esm/browser/style/base.d.ts +1 -1
  161. package/esm/browser/style/base.js +15 -2
  162. package/esm/browser/style/chat-list.d.ts +1 -1
  163. package/esm/browser/style/chat-list.js +6 -3
  164. package/esm/browser/style/conversation-column.d.ts +1 -1
  165. package/esm/browser/style/conversation-column.js +28 -8
  166. package/esm/browser/style/conversation.d.ts +1 -1
  167. package/esm/browser/style/conversation.js +5 -0
  168. package/esm/browser/style/device.js +5 -0
  169. package/esm/browser/style/pages.d.ts +1 -1
  170. package/esm/browser/style/pages.js +3 -3
  171. package/esm/browser/style/shell.d.ts +1 -1
  172. package/esm/browser/style/shell.js +13 -6
  173. package/esm/browser/style/tasks.d.ts +1 -1
  174. package/esm/browser/style/tasks.js +4 -2
  175. package/esm/browser/util/chat-emoji.d.ts +44 -0
  176. package/esm/browser/util/chat-emoji.js +269 -0
  177. package/esm/browser/util/composer-drop.d.ts +26 -0
  178. package/esm/browser/util/composer-drop.js +40 -0
  179. package/esm/browser/util/composer-files.d.ts +48 -0
  180. package/esm/browser/util/composer-files.js +99 -0
  181. package/esm/browser/util/composer.d.ts +13 -1
  182. package/esm/browser/util/composer.js +24 -6
  183. package/esm/browser/util/markdown.d.ts +5 -0
  184. package/esm/browser/util/markdown.js +18 -0
  185. package/esm/browser/util/message.d.ts +6 -1
  186. package/esm/browser/util/message.js +13 -2
  187. package/esm/browser/util/process.d.ts +10 -13
  188. package/esm/browser/util/process.js +31 -83
  189. package/esm/browser/util/turn-join.d.ts +38 -0
  190. package/esm/browser/util/turn-join.js +119 -0
  191. package/esm/browser/workbench-services.js +1 -1
  192. package/lib/browser/account/account-side.js +4 -0
  193. package/lib/browser/account/device-account.d.ts +6 -0
  194. package/lib/browser/account/device-account.js +20 -5
  195. package/lib/browser/assistant/assistant-view.js +2 -0
  196. package/lib/browser/assistant/call-announcing.d.ts +26 -0
  197. package/lib/browser/assistant/call-announcing.js +36 -0
  198. package/lib/browser/assistant/call-answering.d.ts +44 -0
  199. package/lib/browser/assistant/call-answering.js +67 -0
  200. package/lib/browser/assistant/call-hearing.d.ts +54 -0
  201. package/lib/browser/assistant/call-hearing.js +102 -0
  202. package/lib/browser/assistant/call-pausing.d.ts +41 -0
  203. package/lib/browser/assistant/call-pausing.js +86 -0
  204. package/lib/browser/assistant/call-reading.d.ts +33 -0
  205. package/lib/browser/assistant/call-reading.js +39 -0
  206. package/lib/browser/assistant/call-revoicing.d.ts +34 -0
  207. package/lib/browser/assistant/call-revoicing.js +72 -0
  208. package/lib/browser/assistant/call-turns.d.ts +30 -0
  209. package/lib/browser/assistant/call-turns.js +37 -0
  210. package/lib/browser/assistant/spoken-answer.d.ts +22 -0
  211. package/lib/browser/assistant/spoken-answer.js +73 -0
  212. package/lib/browser/assistant/spoken-call.d.ts +8 -0
  213. package/lib/browser/assistant/spoken-call.js +19 -0
  214. package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
  215. package/lib/browser/assistant/voice-call.d.ts +47 -43
  216. package/lib/browser/assistant/voice-call.js +192 -218
  217. package/lib/browser/chat/chat-view.js +2 -1
  218. package/lib/browser/components/account-recovery-view.d.ts +12 -0
  219. package/lib/browser/components/account-recovery-view.js +117 -0
  220. package/lib/browser/components/account-view.d.ts +1 -2
  221. package/lib/browser/components/account-view.js +10 -1
  222. package/lib/browser/components/app-nav.js +19 -8
  223. package/lib/browser/components/app-shell-hooks.d.ts +5 -0
  224. package/lib/browser/components/app-shell-hooks.js +46 -0
  225. package/lib/browser/components/app-shell-state.js +1 -0
  226. package/lib/browser/components/app-view.js +8 -4
  227. package/lib/browser/components/chat-emoji.d.ts +36 -0
  228. package/lib/browser/components/chat-emoji.js +167 -0
  229. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  230. package/lib/browser/components/composer-attachments.d.ts +6 -0
  231. package/lib/browser/components/composer-attachments.js +12 -0
  232. package/lib/browser/components/composer-box-protocol.d.ts +15 -0
  233. package/lib/browser/components/composer-box.js +107 -84
  234. package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
  235. package/lib/browser/components/composer-drop-hooks.js +72 -0
  236. package/lib/browser/components/composer-emoji.js +1 -1
  237. package/lib/browser/components/composer-faces.d.ts +17 -0
  238. package/lib/browser/components/composer-faces.js +73 -0
  239. package/lib/browser/components/composer-media.d.ts +10 -0
  240. package/lib/browser/components/composer-media.js +13 -0
  241. package/lib/browser/components/composer-target.d.ts +4 -0
  242. package/lib/browser/components/composer-target.js +18 -7
  243. package/lib/browser/components/composer-type-focus.d.ts +25 -0
  244. package/lib/browser/components/composer-type-focus.js +20 -0
  245. package/lib/browser/components/composer-voice.d.ts +25 -0
  246. package/lib/browser/components/composer-voice.js +73 -0
  247. package/lib/browser/components/composer.d.ts +2 -2
  248. package/lib/browser/components/composer.js +38 -7
  249. package/lib/browser/components/context-menu.js +2 -1
  250. package/lib/browser/components/emoji-panel.d.ts +11 -7
  251. package/lib/browser/components/emoji-panel.js +40 -22
  252. package/lib/browser/components/extension-settings.js +1 -1
  253. package/lib/browser/components/folder-new.d.ts +19 -0
  254. package/lib/browser/components/folder-new.js +90 -0
  255. package/lib/browser/components/folder-picker.d.ts +5 -2
  256. package/lib/browser/components/folder-picker.js +17 -5
  257. package/lib/browser/components/host-view.d.ts +1 -1
  258. package/lib/browser/components/image-menu.d.ts +8 -3
  259. package/lib/browser/components/image-menu.js +34 -9
  260. package/lib/browser/components/markdown.js +9 -2
  261. package/lib/browser/components/media.js +3 -2
  262. package/lib/browser/components/message-list.js +2 -2
  263. package/lib/browser/components/message-steps.js +20 -11
  264. package/lib/browser/components/message-user.js +1 -1
  265. package/lib/browser/components/moved-notice.js +2 -1
  266. package/lib/browser/components/nav-places.d.ts +2 -0
  267. package/lib/browser/components/nav-places.js +4 -2
  268. package/lib/browser/components/phone-shell.d.ts +2 -0
  269. package/lib/browser/components/phone-shell.js +5 -1
  270. package/lib/browser/components/secret-text.d.ts +1 -1
  271. package/lib/browser/components/secret-text.js +4 -3
  272. package/lib/browser/components/session-view.js +3 -0
  273. package/lib/browser/components/settings-choices.d.ts +2 -1
  274. package/lib/browser/components/settings-choices.js +12 -4
  275. package/lib/browser/components/settings-more.js +2 -2
  276. package/lib/browser/components/settings-parts.js +11 -0
  277. package/lib/browser/components/share-item-sheet.js +7 -1
  278. package/lib/browser/components/tab-title.d.ts +28 -0
  279. package/lib/browser/components/tab-title.js +38 -0
  280. package/lib/browser/components/use-composer-attachments.d.ts +29 -0
  281. package/lib/browser/components/use-composer-attachments.js +101 -0
  282. package/lib/browser/components/use-composer-files.d.ts +26 -0
  283. package/lib/browser/components/use-composer-files.js +88 -0
  284. package/lib/browser/components/web-composer.d.ts +3 -1
  285. package/lib/browser/components/web-composer.js +3 -2
  286. package/lib/browser/components/workbench-view.js +1 -0
  287. package/lib/browser/components/working-directory.js +2 -1
  288. package/lib/browser/device/drag-move.d.ts +22 -0
  289. package/lib/browser/device/drag-move.js +122 -0
  290. package/lib/browser/extension/icons.js +6 -0
  291. package/lib/browser/extension/web-api-desktop.d.ts +19 -0
  292. package/lib/browser/extension/web-api-menus.d.ts +19 -0
  293. package/lib/browser/extension/web-api-spec.js +2 -0
  294. package/lib/browser/extension/web-extension-api.d.ts +24 -23
  295. package/lib/browser/extension/web-extension-context.d.ts +1 -0
  296. package/lib/browser/extension/web-extension-context.js +12 -5
  297. package/lib/browser/extension/web-extension-run.js +1 -0
  298. package/lib/browser/extension/web-share-ui.d.ts +1 -1
  299. package/lib/browser/extension/web-share-ui.js +2 -0
  300. package/lib/browser/extension/web-share.d.ts +13 -0
  301. package/lib/browser/extension/web-share.js +37 -2
  302. package/lib/browser/i18n/en/account.d.ts +18 -0
  303. package/lib/browser/i18n/en/account.js +18 -0
  304. package/lib/browser/i18n/en/call.js +1 -1
  305. package/lib/browser/i18n/en/chat.d.ts +15 -0
  306. package/lib/browser/i18n/en/chat.js +16 -1
  307. package/lib/browser/i18n/en/common.d.ts +2 -0
  308. package/lib/browser/i18n/en/common.js +2 -0
  309. package/lib/browser/i18n/en/discover.d.ts +2 -0
  310. package/lib/browser/i18n/en/discover.js +2 -0
  311. package/lib/browser/i18n/en/settings.d.ts +17 -0
  312. package/lib/browser/i18n/en/settings.js +17 -0
  313. package/lib/browser/i18n/ja/account.js +18 -0
  314. package/lib/browser/i18n/ja/call.js +1 -1
  315. package/lib/browser/i18n/ja/chat.js +16 -1
  316. package/lib/browser/i18n/ja/common.js +2 -0
  317. package/lib/browser/i18n/ja/discover.js +3 -1
  318. package/lib/browser/i18n/ja/settings.js +17 -0
  319. package/lib/browser/i18n/locales.d.ts +55 -1
  320. package/lib/browser/i18n/messages.d.ts +54 -0
  321. package/lib/browser/i18n/zh/account.js +18 -0
  322. package/lib/browser/i18n/zh/call.js +1 -1
  323. package/lib/browser/i18n/zh/chat.js +16 -1
  324. package/lib/browser/i18n/zh/common.js +2 -0
  325. package/lib/browser/i18n/zh/discover.js +3 -1
  326. package/lib/browser/i18n/zh/settings.js +17 -0
  327. package/lib/browser/i18n/zh-tw/account.js +18 -0
  328. package/lib/browser/i18n/zh-tw/call.js +1 -1
  329. package/lib/browser/i18n/zh-tw/chat.js +16 -1
  330. package/lib/browser/i18n/zh-tw/common.js +2 -0
  331. package/lib/browser/i18n/zh-tw/discover.js +3 -1
  332. package/lib/browser/i18n/zh-tw/settings.js +17 -0
  333. package/lib/browser/offline/kept-chats.d.ts +3 -1
  334. package/lib/browser/offline/kept-chats.js +1 -1
  335. package/lib/browser/partners/group-picker.d.ts +3 -2
  336. package/lib/browser/partners/group-picker.js +8 -3
  337. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  338. package/lib/browser/sandbox/work/work-docs.js +5 -2
  339. package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
  340. package/lib/browser/sandbox/work/work-frame.js +9 -3
  341. package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
  342. package/lib/browser/sandbox/work/work-gates.js +185 -0
  343. package/lib/browser/settings/agent-settings.js +1 -1
  344. package/lib/browser/settings/navigation.d.ts +38 -10
  345. package/lib/browser/settings/navigation.js +74 -18
  346. package/lib/browser/settings/settings-protocol.d.ts +16 -1
  347. package/lib/browser/settings/settings-protocol.js +21 -3
  348. package/lib/browser/settings/settings.js +3 -0
  349. package/lib/browser/style/base.d.ts +1 -1
  350. package/lib/browser/style/base.js +15 -2
  351. package/lib/browser/style/chat-list.d.ts +1 -1
  352. package/lib/browser/style/chat-list.js +6 -3
  353. package/lib/browser/style/conversation-column.d.ts +1 -1
  354. package/lib/browser/style/conversation-column.js +28 -8
  355. package/lib/browser/style/conversation.d.ts +1 -1
  356. package/lib/browser/style/conversation.js +5 -0
  357. package/lib/browser/style/device.js +5 -0
  358. package/lib/browser/style/pages.d.ts +1 -1
  359. package/lib/browser/style/pages.js +3 -3
  360. package/lib/browser/style/shell.d.ts +1 -1
  361. package/lib/browser/style/shell.js +13 -6
  362. package/lib/browser/style/tasks.d.ts +1 -1
  363. package/lib/browser/style/tasks.js +4 -2
  364. package/lib/browser/util/chat-emoji.d.ts +45 -0
  365. package/lib/browser/util/chat-emoji.js +272 -0
  366. package/lib/browser/util/composer-drop.d.ts +27 -0
  367. package/lib/browser/util/composer-drop.js +43 -0
  368. package/lib/browser/util/composer-files.d.ts +49 -0
  369. package/lib/browser/util/composer-files.js +102 -0
  370. package/lib/browser/util/composer.d.ts +13 -1
  371. package/lib/browser/util/composer.js +24 -6
  372. package/lib/browser/util/markdown.d.ts +5 -0
  373. package/lib/browser/util/markdown.js +18 -0
  374. package/lib/browser/util/message.d.ts +6 -1
  375. package/lib/browser/util/message.js +13 -2
  376. package/lib/browser/util/process.d.ts +10 -13
  377. package/lib/browser/util/process.js +32 -84
  378. package/lib/browser/util/turn-join.d.ts +39 -0
  379. package/lib/browser/util/turn-join.js +122 -0
  380. package/lib/browser/workbench-services.js +1 -1
  381. package/package.json +7 -7
  382. package/public/emoji/wechat-v1.webp +0 -0
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallAnswering = exports.ANSWER_IDLE_MS = void 0;
4
+ /** How long after the question is answered a work that begins is waited for, before Ta listens again. */
5
+ exports.ANSWER_IDLE_MS = 4000;
6
+ /**
7
+ * What the user says in a call answers the question the conversation waits on (a permission, a choice), rather than
8
+ * going to the model: SpokenAnswer tells whether it does. The question answered, the work goes on with it and its reply
9
+ * is read as any turn; should nothing come of it (a question that ended no work), Ta listens again rather than think
10
+ * for ever, unless the user says more meanwhile, or a turn is at work.
11
+ */
12
+ class CallAnswering {
13
+ constructor(host) {
14
+ this.host = host;
15
+ this.heardIn = 0;
16
+ }
17
+ /** Whether the call answers the question with what is said: true once it took it over. */
18
+ take(said) {
19
+ const taken = this.host.answer(said);
20
+ this.host.set({ phase: 'thinking', heard: said, said, reading: undefined });
21
+ this.heardIn = this.host.round();
22
+ this.waited();
23
+ taken
24
+ .then(answered => {
25
+ if (this.gone()) {
26
+ return;
27
+ }
28
+ if (!answered) {
29
+ this.host.send(said);
30
+ }
31
+ }, () => !this.gone() && this.host.send(said))
32
+ .catch(() => this.host.unsent());
33
+ return true;
34
+ }
35
+ /** The words went on to a conversation that does not answer by voice: set the call to think of them. */
36
+ thinking(said) {
37
+ this.host.set({ phase: 'thinking', heard: said, said, reading: undefined });
38
+ this.host.send(said);
39
+ }
40
+ /** Its call ended or went on: nothing waits any more. */
41
+ stop() {
42
+ clearTimeout(this.idle);
43
+ this.idle = undefined;
44
+ }
45
+ /** The user says more, or the call listens again: what waited is over. */
46
+ moved() {
47
+ this.stop();
48
+ }
49
+ gone() {
50
+ const { state } = this.host;
51
+ return !state.active || state.phase !== 'thinking' || this.heardIn !== this.host.round();
52
+ }
53
+ /** The question answered: the work goes on with it; none begins in a few seconds, Ta listens again. */
54
+ waited() {
55
+ this.stop();
56
+ this.idle = setTimeout(() => {
57
+ this.idle = undefined;
58
+ const { state } = this.host;
59
+ if (!state.active || state.phase !== 'thinking' || this.host.waiting() || this.heardIn !== this.host.round()) {
60
+ return;
61
+ }
62
+ this.host.over();
63
+ }, exports.ANSWER_IDLE_MS);
64
+ }
65
+ }
66
+ exports.CallAnswering = CallAnswering;
67
+ //# sourceMappingURL=call-answering.js.map
@@ -0,0 +1,54 @@
1
+ import { type CallTurnEnd } from './call-turn-end';
2
+ import type { CallEnd, CallState } from './voice-call-protocol';
3
+ /** What a call hearing the user needs of it. */
4
+ export interface CallHearingHost {
5
+ readonly state: CallState;
6
+ /** The voice of the call: one that thinks hears and answers by itself. */
7
+ readonly thinks: boolean;
8
+ /** When the user is done with what they say. */
9
+ readonly turnEnd: CallTurnEnd;
10
+ /** How long nobody may speak before the call ends by itself. */
11
+ silentMs(): number;
12
+ /** A listen goes on, to be stopped or gone on. */
13
+ readonly listening: boolean;
14
+ stopListening(): void;
15
+ listen(announce?: boolean, held?: string): void;
16
+ /** What was heard goes to the partner, or to the conversation. */
17
+ take(said: string): void;
18
+ /** Whether what was said should wait for more (a sound alone), the user still speaking. */
19
+ waits(said: string): boolean;
20
+ set(change: Partial<CallState>): void;
21
+ end(reason: CallEnd): void;
22
+ }
23
+ /**
24
+ * What the call hears of the user between listens: the words heard stay the same a moment (a sound alone, a backchannel,
25
+ * the words that may be all of it), a listen ends with an error, and silence in a row ends the call. What is heard goes
26
+ * to the partner or the conversation, or waits on in the next listen for the rest of the sentence.
27
+ */
28
+ export declare class CallHearing {
29
+ protected readonly host: CallHearingHost;
30
+ protected silent: number;
31
+ /** When someone last spoke (the user, or Ta): the silence that ends the call counts from it. */
32
+ protected spoke: number;
33
+ protected retry?: ReturnType<typeof setTimeout>;
34
+ constructor(host: CallHearingHost);
35
+ /** The user spoke, or Ta did: the silence counts from now. */
36
+ spokeNow(): void;
37
+ /** The user said something that goes: the silences in a row start again. */
38
+ heardWords(): void;
39
+ /** The user says they are done (the mark of the bar tapped): what was heard goes now as it is, sounds alone too. */
40
+ endTurn(): void;
41
+ /** The words heard stayed the same a while, or the turn is at its longest (CallTurnEnd): the user is done. */
42
+ quiet(): void;
43
+ /** What was heard of a listen going on, while Ta listens; undefined else. */
44
+ listened(): string | undefined;
45
+ /**
46
+ * A listen ended: what was said goes to the double; nothing, Ta listens again, a few times. Sounds alone wait on in
47
+ * the next listen until they waited FILLER_MS (`waited`); then a hesitation is dropped and a backchannel goes.
48
+ */
49
+ heard(said: string, error: string | undefined, waited?: boolean): void;
50
+ /** A retry waits, or a listen ends. */
51
+ stop(): void;
52
+ protected listening(): boolean;
53
+ }
54
+ //# sourceMappingURL=call-hearing.d.ts.map
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallHearing = void 0;
4
+ const turn_end_1 = require("../util/turn-end");
5
+ const voice_1 = require("../util/voice");
6
+ const call_turn_end_1 = require("./call-turn-end");
7
+ /**
8
+ * What the call hears of the user between listens: the words heard stay the same a moment (a sound alone, a backchannel,
9
+ * the words that may be all of it), a listen ends with an error, and silence in a row ends the call. What is heard goes
10
+ * to the partner or the conversation, or waits on in the next listen for the rest of the sentence.
11
+ */
12
+ class CallHearing {
13
+ constructor(host) {
14
+ this.host = host;
15
+ this.silent = 0;
16
+ /** When someone last spoke (the user, or Ta): the silence that ends the call counts from it. */
17
+ this.spoke = 0;
18
+ }
19
+ /** The user spoke, or Ta did: the silence counts from now. */
20
+ spokeNow() {
21
+ this.spoke = Date.now();
22
+ }
23
+ /** The user said something that goes: the silences in a row start again. */
24
+ heardWords() {
25
+ this.silent = 0;
26
+ this.spoke = Date.now();
27
+ }
28
+ /** The user says they are done (the mark of the bar tapped): what was heard goes now as it is, sounds alone too. */
29
+ endTurn() {
30
+ if (this.host.thinks) {
31
+ return;
32
+ }
33
+ const said = this.listened();
34
+ if (said) {
35
+ this.host.stopListening();
36
+ this.host.take(said);
37
+ }
38
+ }
39
+ /** The words heard stayed the same a while, or the turn is at its longest (CallTurnEnd): the user is done. */
40
+ quiet() {
41
+ const said = this.listened();
42
+ if (said) {
43
+ this.host.stopListening();
44
+ this.heard(said, undefined, true);
45
+ }
46
+ }
47
+ /** What was heard of a listen going on, while Ta listens; undefined else. */
48
+ listened() {
49
+ const { state } = this.host;
50
+ const said = state.heard.trim();
51
+ return state.active && !state.paused && state.phase === 'listening' && said && this.host.listening ? said : undefined;
52
+ }
53
+ /**
54
+ * A listen ended: what was said goes to the double; nothing, Ta listens again, a few times. Sounds alone wait on in
55
+ * the next listen until they waited FILLER_MS (`waited`); then a hesitation is dropped and a backchannel goes.
56
+ */
57
+ heard(said, error, waited = false) {
58
+ var _a;
59
+ const { host } = this;
60
+ if (error && voice_1.Voice.denied(error)) {
61
+ host.end('denied');
62
+ return;
63
+ }
64
+ if (said && !waited && host.turnEnd.waits(said)) {
65
+ if (error) {
66
+ this.retry = setTimeout(() => this.listening() && host.listen(false, said), call_turn_end_1.RETRY_MS);
67
+ }
68
+ else {
69
+ host.listen(false, said);
70
+ }
71
+ return;
72
+ }
73
+ if (said && turn_end_1.TurnEnd.sounds(said) === 'hesitation') {
74
+ said = '';
75
+ host.set({ heard: '' });
76
+ }
77
+ if (said) {
78
+ host.take(said);
79
+ return;
80
+ }
81
+ if (++this.silent >= call_turn_end_1.SILENT_ROUNDS && Date.now() - this.spoke >= ((_a = host.silentMs()) !== null && _a !== void 0 ? _a : call_turn_end_1.SILENT_MS)) {
82
+ host.end('silent');
83
+ return;
84
+ }
85
+ if (error) {
86
+ this.retry = setTimeout(() => this.listening() && host.listen(), call_turn_end_1.RETRY_MS);
87
+ }
88
+ else {
89
+ host.listen();
90
+ }
91
+ }
92
+ /** A retry waits, or a listen ends. */
93
+ stop() {
94
+ clearTimeout(this.retry);
95
+ }
96
+ listening() {
97
+ const { state } = this.host;
98
+ return state.active && state.phase === 'listening';
99
+ }
100
+ }
101
+ exports.CallHearing = CallHearing;
102
+ //# sourceMappingURL=call-hearing.js.map
@@ -0,0 +1,41 @@
1
+ import type { CallState, CallVoice } from './voice-call-protocol';
2
+ /** What pausing a call needs of it. */
3
+ export interface CallPausingHost {
4
+ readonly state: CallState;
5
+ readonly voice: CallVoice;
6
+ /** Its voice service is opening: what a call paused for a voice is not read before it is there. */
7
+ readonly opening: boolean;
8
+ /** An answer that came while paused: read once the page shows again. */
9
+ readonly pending: string | undefined;
10
+ setPending(pending: string | undefined): void;
11
+ /** What is being read now, to read again after a pause. */
12
+ readonly speaking: string | undefined;
13
+ set(change: Partial<CallState>): void;
14
+ stopListening(): void;
15
+ /** Listens; first says what waits to be said, unless the user cut in to speak (\`announce\` false). */
16
+ listen(announce?: boolean): void;
17
+ read(text: string): void;
18
+ dropDrafts(): void;
19
+ /** A voice that thinks listens and answers by itself: told that the call shows again. */
20
+ conversingResumed(): void;
21
+ /** While Ta speaks: it stops and listens to the user. */
22
+ interrupt(): void;
23
+ }
24
+ /**
25
+ * The call while the page is not there: the device stops its listening and reading in the background, so the call
26
+ * stops them itself and waits rather than look as if it listened; what was being said is said again as it shows.
27
+ * And the user cutting in while Ta reads (bargeIn), or a tap that stops it (interrupt).
28
+ */
29
+ export declare class CallPausing {
30
+ protected readonly host: CallPausingHost;
31
+ constructor(host: CallPausingHost);
32
+ /** The user began to speak while Ta reads: it stops and listens to them. */
33
+ bargeIn(): void;
34
+ /** The page went to the background: the call waits, rather than look as if it listened. */
35
+ pause(): void;
36
+ /** The page shows again: the answer that waits is read, a turn at work is waited for, else Ta listens. */
37
+ resume(): void;
38
+ /** While Ta speaks (an answer, or news it tells by itself): it stops and listens to the user. */
39
+ interrupt(): void;
40
+ }
41
+ //# sourceMappingURL=call-pausing.d.ts.map
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallPausing = void 0;
4
+ /**
5
+ * The call while the page is not there: the device stops its listening and reading in the background, so the call
6
+ * stops them itself and waits rather than look as if it listened; what was being said is said again as it shows.
7
+ * And the user cutting in while Ta reads (bargeIn), or a tap that stops it (interrupt).
8
+ */
9
+ class CallPausing {
10
+ constructor(host) {
11
+ this.host = host;
12
+ }
13
+ /** The user began to speak while Ta reads: it stops and listens to them. */
14
+ bargeIn() {
15
+ const { state } = this.host;
16
+ if (state.active && !state.paused && state.phase === 'speaking') {
17
+ this.host.interrupt();
18
+ }
19
+ }
20
+ /** The page went to the background: the call waits, rather than look as if it listened. */
21
+ pause() {
22
+ var _a, _b;
23
+ const { host } = this;
24
+ const { state } = host;
25
+ if (!state.active || state.paused) {
26
+ return;
27
+ }
28
+ if (host.voice.thinks) {
29
+ (_b = (_a = host.voice).mute) === null || _b === void 0 ? void 0 : _b.call(_a, true);
30
+ host.voice.hush();
31
+ host.set({ paused: true, phase: 'listening', heard: '' });
32
+ return;
33
+ }
34
+ host.stopListening();
35
+ host.dropDrafts();
36
+ if (state.phase === 'speaking') {
37
+ host.voice.hush();
38
+ host.setPending(host.speaking);
39
+ }
40
+ host.set({ paused: true, heard: state.phase === 'thinking' ? state.heard : '' });
41
+ }
42
+ /** The page shows again: the answer that waits is read, a turn at work is waited for, else Ta listens. */
43
+ resume() {
44
+ var _a, _b;
45
+ const { host } = this;
46
+ const { state } = host;
47
+ if (!state.active || !state.paused) {
48
+ return;
49
+ }
50
+ host.set({ paused: false });
51
+ if (host.voice.thinks) {
52
+ host.conversingResumed();
53
+ (_b = (_a = host.voice).mute) === null || _b === void 0 ? void 0 : _b.call(_a, false);
54
+ return;
55
+ }
56
+ const pending = host.pending;
57
+ host.setPending(undefined);
58
+ if (pending) {
59
+ host.read(pending);
60
+ }
61
+ else if (host.opening) {
62
+ // Waiting for its voice service, which reads it when it is there.
63
+ }
64
+ else if (state.phase !== 'thinking' && state.phase !== 'connecting') {
65
+ host.listen();
66
+ }
67
+ }
68
+ /** While Ta speaks (an answer, or news it tells by itself): it stops and listens to the user. */
69
+ interrupt() {
70
+ const { host } = this;
71
+ const { state } = host;
72
+ if (!state.active || state.phase !== 'speaking') {
73
+ return;
74
+ }
75
+ host.voice.hush();
76
+ if (host.voice.thinks) {
77
+ host.set({ phase: 'listening', heard: '' });
78
+ }
79
+ else {
80
+ // The user speaks now: what waited to be said waits for the next silence.
81
+ host.listen(false);
82
+ }
83
+ }
84
+ }
85
+ exports.CallPausing = CallPausing;
86
+ //# sourceMappingURL=call-pausing.js.map
@@ -0,0 +1,33 @@
1
+ import type { CallOptions, CallState, CallVoice } from './voice-call-protocol';
2
+ /** What reading the answer of a call needs of it. */
3
+ export interface CallReadingHost {
4
+ readonly state: CallState;
5
+ readonly voice: CallVoice;
6
+ /** The call's options: its language and voice. */
7
+ options(): CallOptions;
8
+ set(change: Partial<CallState>): void;
9
+ /** The round of the call now: a reading of another round says nothing more. */
10
+ round(): number;
11
+ nextRound(): number;
12
+ /** The partner answers this call and has said goodbye: it ends. */
13
+ ending(): boolean;
14
+ hangUp(): void;
15
+ listen(): void;
16
+ }
17
+ /**
18
+ * What a call says aloud: the answer of the conversation, the news of a partner, or what the user should hear; then Ta
19
+ * listens again, or the call ends when the partner it talks to has said goodbye (CallState.reading, the words read now).
20
+ */
21
+ export declare class CallReading {
22
+ protected readonly host: CallReadingHost;
23
+ /** What is being read now, to read again after a pause. */
24
+ protected speaking?: string;
25
+ constructor(host: CallReadingHost);
26
+ /** What is being read now; undefined when nothing is. */
27
+ get now(): string | undefined;
28
+ /** What was said is over: Ta listens again, or hangs up when the partner ended the call. */
29
+ over(): void;
30
+ /** Reads out `said`; at its end ({@link over}) Ta listens. */
31
+ read(said: string): void;
32
+ }
33
+ //# sourceMappingURL=call-reading.d.ts.map
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallReading = void 0;
4
+ /**
5
+ * What a call says aloud: the answer of the conversation, the news of a partner, or what the user should hear; then Ta
6
+ * listens again, or the call ends when the partner it talks to has said goodbye (CallState.reading, the words read now).
7
+ */
8
+ class CallReading {
9
+ constructor(host) {
10
+ this.host = host;
11
+ }
12
+ /** What is being read now; undefined when nothing is. */
13
+ get now() {
14
+ return this.speaking;
15
+ }
16
+ /** What was said is over: Ta listens again, or hangs up when the partner ended the call. */
17
+ over() {
18
+ if (this.host.ending()) {
19
+ this.host.hangUp();
20
+ }
21
+ else {
22
+ this.host.listen();
23
+ }
24
+ }
25
+ /** Reads out `said`; at its end ({@link over}) Ta listens. */
26
+ read(said) {
27
+ const { host } = this;
28
+ const round = host.nextRound();
29
+ this.speaking = said;
30
+ host.set({ phase: 'speaking', heard: '', reading: undefined });
31
+ host.voice.speak(said, host.options().language(), () => {
32
+ if (host.state.active && round === host.round()) {
33
+ this.over();
34
+ }
35
+ }, host.options().voice(), (pieces, at) => host.state.active && round === host.round() && host.set({ reading: { pieces, at } }));
36
+ }
37
+ }
38
+ exports.CallReading = CallReading;
39
+ //# sourceMappingURL=call-reading.js.map
@@ -0,0 +1,34 @@
1
+ import type { CallOptions, CallPartner, CallState, CallVoice } from './voice-call-protocol';
2
+ import { VoiceReopen } from './voice-reopen';
3
+ /** What reopening the voice of a call needs of it. */
4
+ export interface CallRevoicingHost {
5
+ readonly state: CallState;
6
+ /** Of the call now: an answer of one hung up since is let go. */
7
+ calls(): number;
8
+ /** It answered with the brain of the partner: both open again. */
9
+ thought(): boolean;
10
+ setOpening(opening: boolean): void;
11
+ set(change: Partial<CallState>): void;
12
+ /** Its voice is the one opened: the call hears it, or it answers by itself; the partner, if the brain opened again. */
13
+ takeVoice(voice: CallVoice, partner?: CallPartner): void;
14
+ /** Its voice is there: what waited is read, a turn is waited for, else Ta listens. */
15
+ voiced(): void;
16
+ /** The call's options: the voice service and the partner to open again. */
17
+ options(): CallOptions;
18
+ /** The call failed: it ends, saying why. */
19
+ failed(error: unknown): void;
20
+ }
21
+ /**
22
+ * Its voice service is gone (ta serve restarted, the connection dropped): the call says it connects, and opens it
23
+ * again as the connection comes back (VoiceReopen); a service no longer chosen gives the voice of the device.
24
+ */
25
+ export declare class CallRevoicing {
26
+ protected readonly host: CallRevoicingHost;
27
+ protected reopening?: VoiceReopen;
28
+ constructor(host: CallRevoicingHost);
29
+ /** Opens the voice again; a partner that thought closes and opens with it. */
30
+ run(): void;
31
+ /** The call is over: a voice that opened late is let go. */
32
+ cancel(): void;
33
+ }
34
+ //# sourceMappingURL=call-revoicing.d.ts.map
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallRevoicing = void 0;
4
+ const voice_reopen_1 = require("./voice-reopen");
5
+ /**
6
+ * Its voice service is gone (ta serve restarted, the connection dropped): the call says it connects, and opens it
7
+ * again as the connection comes back (VoiceReopen); a service no longer chosen gives the voice of the device.
8
+ */
9
+ class CallRevoicing {
10
+ constructor(host) {
11
+ this.host = host;
12
+ }
13
+ /** Opens the voice again; a partner that thought closes and opens with it. */
14
+ run() {
15
+ const { host } = this;
16
+ const call = host.calls();
17
+ const thought = host.thought();
18
+ host.setOpening(true);
19
+ host.set({ phase: 'connecting', heard: '', bargeIn: false });
20
+ const options = host.options();
21
+ let opened;
22
+ this.reopening = new voice_reopen_1.VoiceReopen(async () => {
23
+ opened === null || opened === void 0 ? void 0 : opened.close();
24
+ const next = await open(options, thought);
25
+ opened = next;
26
+ return next === null || next === void 0 ? void 0 : next.voice;
27
+ });
28
+ this.reopening.run().then(voice => {
29
+ var _a;
30
+ if (call !== host.calls() || !host.state.active) {
31
+ (_a = voice === null || voice === void 0 ? void 0 : voice.stop) === null || _a === void 0 ? void 0 : _a.call(voice);
32
+ opened === null || opened === void 0 ? void 0 : opened.close();
33
+ return;
34
+ }
35
+ host.setOpening(false);
36
+ if (voice) {
37
+ host.takeVoice(voice, opened === null || opened === void 0 ? void 0 : opened.partner);
38
+ }
39
+ else {
40
+ opened === null || opened === void 0 ? void 0 : opened.close();
41
+ }
42
+ host.voiced();
43
+ }, error => call === host.calls() && host.state.active && host.failed(error));
44
+ }
45
+ /** The call is over: a voice that opened late is let go. */
46
+ cancel() {
47
+ var _a;
48
+ (_a = this.reopening) === null || _a === void 0 ? void 0 : _a.cancel();
49
+ this.reopening = undefined;
50
+ }
51
+ }
52
+ exports.CallRevoicing = CallRevoicing;
53
+ /**
54
+ * The voice service opened again; with the partner's brain too when the call thought with it, as it opened them at
55
+ * first. None when the call opens no voice service (that of the device is the call's).
56
+ */
57
+ async function open(options, thought) {
58
+ var _a, _b, _c, _d;
59
+ var _e;
60
+ if (!thought) {
61
+ const voice = (_a = options.openVoice) === null || _a === void 0 ? void 0 : _a.call(options);
62
+ return voice ? { voice: await voice, close: () => undefined } : undefined;
63
+ }
64
+ const partner = (_e = (_c = (_b = options.openPartner) === null || _b === void 0 ? void 0 : _b.call(options)) === null || _c === void 0 ? void 0 : _c.catch(() => undefined)) !== null && _e !== void 0 ? _e : Promise.resolve(undefined);
65
+ const voice = (_d = options.openVoice) === null || _d === void 0 ? void 0 : _d.call(options, partner);
66
+ if (!voice) {
67
+ return undefined;
68
+ }
69
+ const [opened, brain] = await Promise.all([voice, partner]);
70
+ return { voice: opened, partner: brain, close: () => brain === null || brain === void 0 ? void 0 : brain.close() };
71
+ }
72
+ //# sourceMappingURL=call-revoicing.js.map
@@ -0,0 +1,30 @@
1
+ import type { CallState } from './voice-call-protocol';
2
+ /** What a call's turns need of it. */
3
+ export interface CallTurnsHost {
4
+ readonly state: CallState;
5
+ /** A partner answers in this call: the turns of the conversation are its work, not the call's. */
6
+ readonly partnered: boolean;
7
+ /** The answer of the turn the call asked, if a new one came: read out, or Ta listens again. */
8
+ turnEnded(reply: string | undefined): void;
9
+ }
10
+ /**
11
+ * The turns of the conversation a call asked (VoiceCall.turn): a run that started after what the user said is the
12
+ * call's turn, and once it settles its reply is read. A run already going when the call asked (a follow-up) is its
13
+ * turn too.
14
+ */
15
+ export declare class CallTurns {
16
+ protected readonly host: CallTurnsHost;
17
+ /** The run of the turn the call asked has started: its reply is the first after `before`. */
18
+ protected asked?: {
19
+ before: number | undefined;
20
+ };
21
+ constructor(host: CallTurnsHost);
22
+ /** A turn it asked is at work: its reply is to come. */
23
+ get waiting(): boolean;
24
+ /** How the conversation is, as it changes (VoiceCall.turn). */
25
+ turn(working: boolean, reply: {
26
+ index: number;
27
+ text: string;
28
+ } | undefined): void;
29
+ }
30
+ //# sourceMappingURL=call-turns.d.ts.map
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallTurns = void 0;
4
+ /**
5
+ * The turns of the conversation a call asked (VoiceCall.turn): a run that started after what the user said is the
6
+ * call's turn, and once it settles its reply is read. A run already going when the call asked (a follow-up) is its
7
+ * turn too.
8
+ */
9
+ class CallTurns {
10
+ constructor(host) {
11
+ this.host = host;
12
+ }
13
+ /** A turn it asked is at work: its reply is to come. */
14
+ get waiting() {
15
+ return !!this.asked;
16
+ }
17
+ /** How the conversation is, as it changes (VoiceCall.turn). */
18
+ turn(working, reply) {
19
+ var _a;
20
+ const { active, phase } = this.host.state;
21
+ if (!active || phase !== 'thinking' || this.host.partnered) {
22
+ this.asked = undefined;
23
+ return;
24
+ }
25
+ if (working) {
26
+ (_a = this.asked) !== null && _a !== void 0 ? _a : (this.asked = { before: reply === null || reply === void 0 ? void 0 : reply.index });
27
+ return;
28
+ }
29
+ if (this.asked) {
30
+ const fresh = reply && reply.index !== this.asked.before ? reply.text : undefined;
31
+ this.asked = undefined;
32
+ this.host.turnEnded(fresh);
33
+ }
34
+ }
35
+ }
36
+ exports.CallTurns = CallTurns;
37
+ //# sourceMappingURL=call-turns.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * What a call hears for the dialog its conversation waits on (a permission gate's question, a choice): yes or no, an
3
+ * option's words or its number, as they are said. What does not clearly answer it goes to the conversation, which
4
+ * reads it and asks again; an answer said by a mistake is cancelled as any other.
5
+ */
6
+ export interface SpokenDialog {
7
+ method: string;
8
+ options?: string[];
9
+ }
10
+ /** A reply of the dialog as the page answers it; undefined for words that do not answer it. */
11
+ export type SpokenAnswerResult = {
12
+ confirmed: boolean;
13
+ } | {
14
+ value: string;
15
+ };
16
+ /** The words said, without the punctuation and spaces that a recognizer adds. */
17
+ export declare function plain(said: string): string;
18
+ export declare namespace SpokenAnswer {
19
+ /** What the words answer of the dialog; undefined for words that do not answer it, which go to the conversation. */
20
+ function of(dialog: SpokenDialog | undefined, said: string): SpokenAnswerResult | undefined;
21
+ }
22
+ //# sourceMappingURL=spoken-answer.d.ts.map