@celljs/ta-web 4.27.0 → 4.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-role.d.ts +9 -4
  4. package/esm/browser/assistant/assistant-role.js +17 -5
  5. package/esm/browser/assistant/assistant-task-util.d.ts +6 -0
  6. package/esm/browser/assistant/assistant-task-util.js +12 -1
  7. package/esm/browser/assistant/assistant-thread.js +15 -2
  8. package/esm/browser/assistant/assistant-view.js +4 -1
  9. package/esm/browser/assistant/assistant.d.ts +2 -1
  10. package/esm/browser/assistant/assistant.js +9 -7
  11. package/esm/browser/assistant/call-conversing.d.ts +45 -0
  12. package/esm/browser/assistant/call-conversing.js +91 -0
  13. package/esm/browser/assistant/call-face.d.ts +13 -0
  14. package/esm/browser/assistant/call-face.js +81 -0
  15. package/esm/browser/assistant/call-keeper.d.ts +8 -4
  16. package/esm/browser/assistant/call-keeper.js +32 -11
  17. package/esm/browser/assistant/call-partnering.d.ts +37 -0
  18. package/esm/browser/assistant/call-partnering.js +79 -0
  19. package/esm/browser/assistant/call-scenes.d.ts +26 -0
  20. package/esm/browser/assistant/call-scenes.js +85 -0
  21. package/esm/browser/assistant/call-screen.d.ts +3 -0
  22. package/esm/browser/assistant/call-screen.js +15 -0
  23. package/esm/browser/assistant/mic-sense.d.ts +31 -0
  24. package/esm/browser/assistant/mic-sense.js +119 -0
  25. package/esm/browser/assistant/noise-gate.d.ts +32 -0
  26. package/esm/browser/assistant/noise-gate.js +66 -0
  27. package/esm/browser/assistant/pcm-util.d.ts +10 -0
  28. package/esm/browser/assistant/pcm-util.js +55 -0
  29. package/esm/browser/assistant/read-aloud.d.ts +2 -1
  30. package/esm/browser/assistant/realtime-voice-protocol.d.ts +84 -0
  31. package/esm/browser/assistant/realtime-voice-protocol.js +40 -0
  32. package/esm/browser/assistant/realtime-voice.d.ts +50 -62
  33. package/esm/browser/assistant/realtime-voice.js +213 -134
  34. package/esm/browser/assistant/spoken-timeline.d.ts +27 -0
  35. package/esm/browser/assistant/spoken-timeline.js +49 -0
  36. package/esm/browser/assistant/voice-call-bar.d.ts +9 -2
  37. package/esm/browser/assistant/voice-call-bar.js +81 -31
  38. package/esm/browser/assistant/voice-call-protocol.d.ts +61 -4
  39. package/esm/browser/assistant/voice-call.d.ts +16 -23
  40. package/esm/browser/assistant/voice-call.js +134 -117
  41. package/esm/browser/assistant/voice-reading.d.ts +83 -0
  42. package/esm/browser/assistant/voice-reading.js +150 -0
  43. package/esm/browser/avatar/dino-talk.d.ts +15 -0
  44. package/esm/browser/avatar/dino-talk.js +34 -0
  45. package/esm/browser/chat/chat-protocol.d.ts +2 -0
  46. package/esm/browser/chat/chat-shown.d.ts +3 -1
  47. package/esm/browser/chat/chat-shown.js +25 -3
  48. package/esm/browser/chat/chat.d.ts +5 -1
  49. package/esm/browser/chat/chat.js +32 -16
  50. package/esm/browser/components/account-menu.d.ts +6 -16
  51. package/esm/browser/components/account-menu.js +47 -101
  52. package/esm/browser/components/app-contexts.js +3 -2
  53. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  54. package/esm/browser/components/composer-box-protocol.d.ts +2 -0
  55. package/esm/browser/components/composer-box.js +20 -1
  56. package/esm/browser/components/composer-emoji.d.ts +22 -0
  57. package/esm/browser/components/composer-emoji.js +50 -0
  58. package/esm/browser/components/conversation-scroll-util.d.ts +8 -1
  59. package/esm/browser/components/conversation-scroll-util.js +21 -0
  60. package/esm/browser/components/conversation-scroll.js +10 -11
  61. package/esm/browser/components/discover-view.d.ts +4 -3
  62. package/esm/browser/components/discover-view.js +5 -4
  63. package/esm/browser/components/emoji-panel.d.ts +22 -0
  64. package/esm/browser/components/emoji-panel.js +54 -0
  65. package/esm/browser/components/gallery.js +28 -7
  66. package/esm/browser/components/host-view.d.ts +1 -1
  67. package/esm/browser/components/image-pull.d.ts +64 -0
  68. package/esm/browser/components/image-pull.js +202 -0
  69. package/esm/browser/components/kept-call-bar.js +2 -1
  70. package/esm/browser/components/lightbox.d.ts +1 -1
  71. package/esm/browser/components/lightbox.js +57 -2
  72. package/esm/browser/components/markdown.d.ts +8 -1
  73. package/esm/browser/components/markdown.js +12 -4
  74. package/esm/browser/components/me-rows.d.ts +24 -0
  75. package/esm/browser/components/me-rows.js +19 -0
  76. package/esm/browser/components/me-view.d.ts +2 -1
  77. package/esm/browser/components/me-view.js +3 -2
  78. package/esm/browser/components/message-list.js +47 -7
  79. package/esm/browser/components/message-steps.js +13 -0
  80. package/esm/browser/components/nav-places.js +1 -1
  81. package/esm/browser/components/partner-row.js +2 -1
  82. package/esm/browser/components/relay-services.d.ts +9 -3
  83. package/esm/browser/components/relay-services.js +73 -35
  84. package/esm/browser/components/session-view.js +4 -2
  85. package/esm/browser/components/settings-choices.js +3 -0
  86. package/esm/browser/components/settings-controls.d.ts +13 -0
  87. package/esm/browser/components/settings-controls.js +19 -0
  88. package/esm/browser/components/settings-more.d.ts +1 -1
  89. package/esm/browser/components/settings-more.js +28 -39
  90. package/esm/browser/components/settings-parts.d.ts +4 -2
  91. package/esm/browser/components/settings-parts.js +16 -9
  92. package/esm/browser/components/settings-view.js +2 -6
  93. package/esm/browser/components/ta-avatar.d.ts +15 -1
  94. package/esm/browser/components/ta-avatar.js +38 -5
  95. package/esm/browser/components/voice-services.js +6 -1
  96. package/esm/browser/components/web-composer.d.ts +1 -1
  97. package/esm/browser/components/web-composer.js +2 -2
  98. package/esm/browser/device/file-save.d.ts +31 -0
  99. package/esm/browser/device/file-save.js +80 -0
  100. package/esm/browser/extension/extension-view.d.ts +2 -0
  101. package/esm/browser/extension/extension-view.js +2 -0
  102. package/esm/browser/extension/web-api-call.d.ts +109 -2
  103. package/esm/browser/extension/web-api-components.d.ts +4 -0
  104. package/esm/browser/extension/web-api-contributions.d.ts +14 -14
  105. package/esm/browser/extension/web-api-desktop.d.ts +16 -1
  106. package/esm/browser/extension/web-api-desktop.js +1 -0
  107. package/esm/browser/extension/web-api-partners.d.ts +2 -0
  108. package/esm/browser/extension/web-extension-api.d.ts +8 -10
  109. package/esm/browser/extension/web-extension-code.d.ts +15 -8
  110. package/esm/browser/extension/web-extension-code.js +25 -27
  111. package/esm/browser/extension/web-extension-context.js +4 -0
  112. package/esm/browser/extension/web-extension-protocol.d.ts +10 -1
  113. package/esm/browser/extension/web-extension-protocol.js +1 -0
  114. package/esm/browser/extension/web-extension-run.d.ts +4 -2
  115. package/esm/browser/extension/web-extension-run.js +10 -4
  116. package/esm/browser/extension/web-extensions-running.js +7 -6
  117. package/esm/browser/extension/web-pages.d.ts +2 -0
  118. package/esm/browser/extension/web-pages.js +2 -0
  119. package/esm/browser/i18n/en/account.d.ts +202 -0
  120. package/esm/browser/i18n/en/account.js +205 -0
  121. package/esm/browser/i18n/en/assistant.d.ts +129 -0
  122. package/esm/browser/i18n/en/assistant.js +130 -0
  123. package/esm/browser/i18n/en/call.d.ts +86 -0
  124. package/esm/browser/i18n/en/call.js +87 -0
  125. package/esm/browser/i18n/en/chat.d.ts +213 -0
  126. package/esm/browser/i18n/en/chat.js +214 -0
  127. package/esm/browser/i18n/en/common.d.ts +99 -0
  128. package/esm/browser/i18n/en/common.js +101 -0
  129. package/esm/browser/i18n/en/console.d.ts +230 -0
  130. package/esm/browser/i18n/en/console.js +232 -0
  131. package/esm/browser/i18n/en/discover.d.ts +117 -0
  132. package/esm/browser/i18n/en/discover.js +119 -0
  133. package/esm/browser/i18n/en/service.d.ts +242 -0
  134. package/esm/browser/i18n/en/service.js +245 -0
  135. package/esm/browser/i18n/en/settings.d.ts +213 -0
  136. package/esm/browser/i18n/en/settings.js +214 -0
  137. package/esm/browser/i18n/en/tools.d.ts +85 -0
  138. package/esm/browser/i18n/en/tools.js +87 -0
  139. package/esm/browser/i18n/ja/account.d.ts +2 -0
  140. package/esm/browser/i18n/ja/account.js +202 -0
  141. package/esm/browser/i18n/ja/assistant.d.ts +2 -0
  142. package/esm/browser/i18n/ja/assistant.js +129 -0
  143. package/esm/browser/i18n/ja/call.d.ts +2 -0
  144. package/esm/browser/i18n/ja/call.js +86 -0
  145. package/esm/browser/i18n/ja/chat.d.ts +2 -0
  146. package/esm/browser/i18n/ja/chat.js +213 -0
  147. package/esm/browser/i18n/ja/common.d.ts +2 -0
  148. package/esm/browser/i18n/ja/common.js +99 -0
  149. package/esm/browser/i18n/ja/console.d.ts +2 -0
  150. package/esm/browser/i18n/ja/console.js +230 -0
  151. package/esm/browser/i18n/ja/discover.d.ts +2 -0
  152. package/esm/browser/i18n/ja/discover.js +117 -0
  153. package/esm/browser/i18n/ja/service.d.ts +2 -0
  154. package/esm/browser/i18n/ja/service.js +242 -0
  155. package/esm/browser/i18n/ja/settings.d.ts +2 -0
  156. package/esm/browser/i18n/ja/settings.js +213 -0
  157. package/esm/browser/i18n/ja/tools.d.ts +2 -0
  158. package/esm/browser/i18n/ja/tools.js +85 -0
  159. package/esm/browser/i18n/locales.d.ts +1150 -1131
  160. package/esm/browser/i18n/messages-ja.js +20 -1567
  161. package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
  162. package/esm/browser/i18n/messages-zh-tw.js +20 -1568
  163. package/esm/browser/i18n/messages.d.ts +1153 -1131
  164. package/esm/browser/i18n/messages.js +44 -3145
  165. package/esm/browser/i18n/zh/account.d.ts +2 -0
  166. package/esm/browser/i18n/zh/account.js +203 -0
  167. package/esm/browser/i18n/zh/assistant.d.ts +2 -0
  168. package/esm/browser/i18n/zh/assistant.js +129 -0
  169. package/esm/browser/i18n/zh/call.d.ts +2 -0
  170. package/esm/browser/i18n/zh/call.js +86 -0
  171. package/esm/browser/i18n/zh/chat.d.ts +2 -0
  172. package/esm/browser/i18n/zh/chat.js +213 -0
  173. package/esm/browser/i18n/zh/common.d.ts +2 -0
  174. package/esm/browser/i18n/zh/common.js +99 -0
  175. package/esm/browser/i18n/zh/console.d.ts +2 -0
  176. package/esm/browser/i18n/zh/console.js +230 -0
  177. package/esm/browser/i18n/zh/discover.d.ts +2 -0
  178. package/esm/browser/i18n/zh/discover.js +117 -0
  179. package/esm/browser/i18n/zh/service.d.ts +2 -0
  180. package/esm/browser/i18n/zh/service.js +242 -0
  181. package/esm/browser/i18n/zh/settings.d.ts +2 -0
  182. package/esm/browser/i18n/zh/settings.js +213 -0
  183. package/esm/browser/i18n/zh/tools.d.ts +2 -0
  184. package/esm/browser/i18n/zh/tools.js +86 -0
  185. package/esm/browser/i18n/zh-tw/account.d.ts +2 -0
  186. package/esm/browser/i18n/zh-tw/account.js +202 -0
  187. package/esm/browser/i18n/zh-tw/assistant.d.ts +2 -0
  188. package/esm/browser/i18n/zh-tw/assistant.js +129 -0
  189. package/esm/browser/i18n/zh-tw/call.d.ts +2 -0
  190. package/esm/browser/i18n/zh-tw/call.js +86 -0
  191. package/esm/browser/i18n/zh-tw/chat.d.ts +2 -0
  192. package/esm/browser/i18n/zh-tw/chat.js +213 -0
  193. package/esm/browser/i18n/zh-tw/common.d.ts +2 -0
  194. package/esm/browser/i18n/zh-tw/common.js +99 -0
  195. package/esm/browser/i18n/zh-tw/console.d.ts +2 -0
  196. package/esm/browser/i18n/zh-tw/console.js +230 -0
  197. package/esm/browser/i18n/zh-tw/discover.d.ts +2 -0
  198. package/esm/browser/i18n/zh-tw/discover.js +117 -0
  199. package/esm/browser/i18n/zh-tw/service.d.ts +2 -0
  200. package/esm/browser/i18n/zh-tw/service.js +242 -0
  201. package/esm/browser/i18n/zh-tw/settings.d.ts +2 -0
  202. package/esm/browser/i18n/zh-tw/settings.js +213 -0
  203. package/esm/browser/i18n/zh-tw/tools.d.ts +2 -0
  204. package/esm/browser/i18n/zh-tw/tools.js +85 -0
  205. package/esm/browser/markdown/code-renderers.d.ts +2 -0
  206. package/esm/browser/markdown/code-renderers.js +2 -0
  207. package/esm/browser/offline/device-values.d.ts +4 -0
  208. package/esm/browser/offline/device-values.js +10 -0
  209. package/esm/browser/pwa/page-build.d.ts +15 -0
  210. package/esm/browser/pwa/page-build.js +45 -0
  211. package/esm/browser/screen/page-answers.d.ts +2 -1
  212. package/esm/browser/screen/page-answers.js +7 -4
  213. package/esm/browser/settings/settings-protocol.d.ts +4 -0
  214. package/esm/browser/settings/settings-protocol.js +4 -0
  215. package/esm/browser/style/base.d.ts +1 -1
  216. package/esm/browser/style/base.js +3 -0
  217. package/esm/browser/style/chat-list.d.ts +1 -1
  218. package/esm/browser/style/chat-list.js +1 -1
  219. package/esm/browser/style/conversation-column.d.ts +1 -1
  220. package/esm/browser/style/conversation-column.js +17 -0
  221. package/esm/browser/style/conversation.d.ts +1 -1
  222. package/esm/browser/style/conversation.js +11 -1
  223. package/esm/browser/style/device.js +1 -0
  224. package/esm/browser/style/dialogs.d.ts +1 -1
  225. package/esm/browser/style/dialogs.js +1 -1
  226. package/esm/browser/style/layout.d.ts +1 -1
  227. package/esm/browser/style/layout.js +135 -57
  228. package/esm/browser/style/pages.d.ts +1 -1
  229. package/esm/browser/style/pages.js +0 -7
  230. package/esm/browser/style/shell.d.ts +1 -1
  231. package/esm/browser/style/shell.js +8 -0
  232. package/esm/browser/style/video-call.d.ts +2 -0
  233. package/esm/browser/style/video-call.js +63 -0
  234. package/esm/browser/style.js +2 -0
  235. package/esm/browser/util/call-transcript.d.ts +16 -0
  236. package/esm/browser/util/call-transcript.js +110 -0
  237. package/esm/browser/util/desktop.d.ts +10 -1
  238. package/esm/browser/util/desktop.js +10 -0
  239. package/esm/browser/util/image-pull.d.ts +61 -0
  240. package/esm/browser/util/image-pull.js +88 -0
  241. package/esm/browser/util/process.d.ts +6 -0
  242. package/esm/browser/util/process.js +18 -5
  243. package/esm/browser/util/spoken.d.ts +3 -3
  244. package/esm/browser/util/spoken.js +4 -4
  245. package/esm/browser/video-call/call-camera.d.ts +59 -0
  246. package/esm/browser/video-call/call-camera.js +188 -0
  247. package/esm/browser/video-call/call-people.d.ts +21 -0
  248. package/esm/browser/video-call/call-people.js +29 -0
  249. package/esm/browser/video-call/call-window.d.ts +19 -0
  250. package/esm/browser/video-call/call-window.js +80 -0
  251. package/esm/browser/video-call/clip-plan.d.ts +56 -0
  252. package/esm/browser/video-call/clip-plan.js +76 -0
  253. package/esm/browser/video-call/face-camera.d.ts +93 -0
  254. package/esm/browser/video-call/face-camera.js +192 -0
  255. package/esm/browser/video-call/face-files.d.ts +69 -0
  256. package/esm/browser/video-call/face-files.js +132 -0
  257. package/esm/browser/video-call/face-moves.d.ts +68 -0
  258. package/esm/browser/video-call/face-moves.js +180 -0
  259. package/esm/browser/video-call/face-stage.d.ts +139 -0
  260. package/esm/browser/video-call/face-stage.js +219 -0
  261. package/esm/browser/video-call/mouth-layer.d.ts +81 -0
  262. package/esm/browser/video-call/mouth-layer.js +241 -0
  263. package/esm/browser/video-call/video-call-view.d.ts +19 -0
  264. package/esm/browser/video-call/video-call-view.js +254 -0
  265. package/esm/browser/video-call/video-face.d.ts +19 -0
  266. package/esm/browser/video-call/video-face.js +471 -0
  267. package/esm/browser/workbench-hosts.d.ts +1 -0
  268. package/esm/browser/workbench-protocol.d.ts +2 -0
  269. package/esm/browser/workbench-util.d.ts +5 -0
  270. package/esm/browser/workbench-util.js +18 -0
  271. package/esm/browser/workbench.d.ts +14 -0
  272. package/esm/browser/workbench.js +73 -6
  273. package/lib/browser/assistant/assistant-role.d.ts +9 -4
  274. package/lib/browser/assistant/assistant-role.js +17 -5
  275. package/lib/browser/assistant/assistant-task-util.d.ts +6 -0
  276. package/lib/browser/assistant/assistant-task-util.js +11 -0
  277. package/lib/browser/assistant/assistant-thread.js +15 -2
  278. package/lib/browser/assistant/assistant-view.js +3 -0
  279. package/lib/browser/assistant/assistant.d.ts +2 -1
  280. package/lib/browser/assistant/assistant.js +9 -7
  281. package/lib/browser/assistant/call-conversing.d.ts +46 -0
  282. package/lib/browser/assistant/call-conversing.js +96 -0
  283. package/lib/browser/assistant/call-face.d.ts +14 -0
  284. package/lib/browser/assistant/call-face.js +117 -0
  285. package/lib/browser/assistant/call-keeper.d.ts +8 -4
  286. package/lib/browser/assistant/call-keeper.js +32 -11
  287. package/lib/browser/assistant/call-partnering.d.ts +38 -0
  288. package/lib/browser/assistant/call-partnering.js +83 -0
  289. package/lib/browser/assistant/call-scenes.d.ts +27 -0
  290. package/lib/browser/assistant/call-scenes.js +88 -0
  291. package/lib/browser/assistant/call-screen.d.ts +3 -0
  292. package/lib/browser/assistant/call-screen.js +15 -0
  293. package/lib/browser/assistant/mic-sense.d.ts +32 -0
  294. package/lib/browser/assistant/mic-sense.js +123 -0
  295. package/lib/browser/assistant/noise-gate.d.ts +33 -0
  296. package/lib/browser/assistant/noise-gate.js +71 -0
  297. package/lib/browser/assistant/pcm-util.d.ts +11 -0
  298. package/lib/browser/assistant/pcm-util.js +58 -0
  299. package/lib/browser/assistant/read-aloud.d.ts +2 -1
  300. package/lib/browser/assistant/realtime-voice-protocol.d.ts +85 -0
  301. package/lib/browser/assistant/realtime-voice-protocol.js +43 -0
  302. package/lib/browser/assistant/realtime-voice.d.ts +50 -62
  303. package/lib/browser/assistant/realtime-voice.js +217 -138
  304. package/lib/browser/assistant/spoken-timeline.d.ts +28 -0
  305. package/lib/browser/assistant/spoken-timeline.js +53 -0
  306. package/lib/browser/assistant/voice-call-bar.d.ts +9 -2
  307. package/lib/browser/assistant/voice-call-bar.js +81 -30
  308. package/lib/browser/assistant/voice-call-protocol.d.ts +61 -4
  309. package/lib/browser/assistant/voice-call.d.ts +16 -23
  310. package/lib/browser/assistant/voice-call.js +134 -117
  311. package/lib/browser/assistant/voice-reading.d.ts +84 -0
  312. package/lib/browser/assistant/voice-reading.js +156 -0
  313. package/lib/browser/avatar/dino-talk.d.ts +16 -0
  314. package/lib/browser/avatar/dino-talk.js +37 -0
  315. package/lib/browser/chat/chat-protocol.d.ts +2 -0
  316. package/lib/browser/chat/chat-shown.d.ts +3 -1
  317. package/lib/browser/chat/chat-shown.js +25 -3
  318. package/lib/browser/chat/chat.d.ts +5 -1
  319. package/lib/browser/chat/chat.js +32 -16
  320. package/lib/browser/components/account-menu.d.ts +6 -16
  321. package/lib/browser/components/account-menu.js +45 -99
  322. package/lib/browser/components/app-contexts.js +2 -1
  323. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  324. package/lib/browser/components/composer-box-protocol.d.ts +2 -0
  325. package/lib/browser/components/composer-box.js +20 -1
  326. package/lib/browser/components/composer-emoji.d.ts +23 -0
  327. package/lib/browser/components/composer-emoji.js +87 -0
  328. package/lib/browser/components/conversation-scroll-util.d.ts +8 -1
  329. package/lib/browser/components/conversation-scroll-util.js +21 -0
  330. package/lib/browser/components/conversation-scroll.js +10 -11
  331. package/lib/browser/components/discover-view.d.ts +4 -3
  332. package/lib/browser/components/discover-view.js +5 -4
  333. package/lib/browser/components/emoji-panel.d.ts +23 -0
  334. package/lib/browser/components/emoji-panel.js +90 -0
  335. package/lib/browser/components/gallery.js +28 -7
  336. package/lib/browser/components/host-view.d.ts +1 -1
  337. package/lib/browser/components/image-pull.d.ts +65 -0
  338. package/lib/browser/components/image-pull.js +206 -0
  339. package/lib/browser/components/kept-call-bar.js +2 -1
  340. package/lib/browser/components/lightbox.d.ts +1 -1
  341. package/lib/browser/components/lightbox.js +57 -2
  342. package/lib/browser/components/markdown.d.ts +8 -1
  343. package/lib/browser/components/markdown.js +11 -3
  344. package/lib/browser/components/me-rows.d.ts +25 -0
  345. package/lib/browser/components/me-rows.js +22 -0
  346. package/lib/browser/components/me-view.d.ts +2 -1
  347. package/lib/browser/components/me-view.js +3 -2
  348. package/lib/browser/components/message-list.js +46 -6
  349. package/lib/browser/components/message-steps.js +13 -0
  350. package/lib/browser/components/nav-places.js +1 -1
  351. package/lib/browser/components/partner-row.js +2 -1
  352. package/lib/browser/components/relay-services.d.ts +9 -3
  353. package/lib/browser/components/relay-services.js +71 -33
  354. package/lib/browser/components/session-view.js +3 -1
  355. package/lib/browser/components/settings-choices.js +3 -0
  356. package/lib/browser/components/settings-controls.d.ts +13 -0
  357. package/lib/browser/components/settings-controls.js +19 -0
  358. package/lib/browser/components/settings-more.d.ts +1 -1
  359. package/lib/browser/components/settings-more.js +27 -38
  360. package/lib/browser/components/settings-parts.d.ts +4 -2
  361. package/lib/browser/components/settings-parts.js +15 -8
  362. package/lib/browser/components/settings-view.js +2 -6
  363. package/lib/browser/components/ta-avatar.d.ts +15 -1
  364. package/lib/browser/components/ta-avatar.js +38 -5
  365. package/lib/browser/components/voice-services.js +5 -0
  366. package/lib/browser/components/web-composer.d.ts +1 -1
  367. package/lib/browser/components/web-composer.js +2 -2
  368. package/lib/browser/device/file-save.d.ts +32 -0
  369. package/lib/browser/device/file-save.js +83 -0
  370. package/lib/browser/extension/extension-view.d.ts +2 -0
  371. package/lib/browser/extension/extension-view.js +3 -1
  372. package/lib/browser/extension/web-api-call.d.ts +109 -2
  373. package/lib/browser/extension/web-api-components.d.ts +4 -0
  374. package/lib/browser/extension/web-api-contributions.d.ts +14 -14
  375. package/lib/browser/extension/web-api-desktop.d.ts +16 -1
  376. package/lib/browser/extension/web-api-desktop.js +1 -0
  377. package/lib/browser/extension/web-api-partners.d.ts +2 -0
  378. package/lib/browser/extension/web-extension-api.d.ts +8 -10
  379. package/lib/browser/extension/web-extension-code.d.ts +15 -8
  380. package/lib/browser/extension/web-extension-code.js +25 -27
  381. package/lib/browser/extension/web-extension-context.js +4 -0
  382. package/lib/browser/extension/web-extension-protocol.d.ts +10 -1
  383. package/lib/browser/extension/web-extension-protocol.js +1 -0
  384. package/lib/browser/extension/web-extension-run.d.ts +4 -2
  385. package/lib/browser/extension/web-extension-run.js +10 -4
  386. package/lib/browser/extension/web-extensions-running.js +7 -6
  387. package/lib/browser/extension/web-pages.d.ts +2 -0
  388. package/lib/browser/extension/web-pages.js +2 -0
  389. package/lib/browser/i18n/en/account.d.ts +203 -0
  390. package/lib/browser/i18n/en/account.js +208 -0
  391. package/lib/browser/i18n/en/assistant.d.ts +130 -0
  392. package/lib/browser/i18n/en/assistant.js +133 -0
  393. package/lib/browser/i18n/en/call.d.ts +87 -0
  394. package/lib/browser/i18n/en/call.js +90 -0
  395. package/lib/browser/i18n/en/chat.d.ts +214 -0
  396. package/lib/browser/i18n/en/chat.js +217 -0
  397. package/lib/browser/i18n/en/common.d.ts +100 -0
  398. package/lib/browser/i18n/en/common.js +104 -0
  399. package/lib/browser/i18n/en/console.d.ts +231 -0
  400. package/lib/browser/i18n/en/console.js +235 -0
  401. package/lib/browser/i18n/en/discover.d.ts +118 -0
  402. package/lib/browser/i18n/en/discover.js +122 -0
  403. package/lib/browser/i18n/en/service.d.ts +243 -0
  404. package/lib/browser/i18n/en/service.js +248 -0
  405. package/lib/browser/i18n/en/settings.d.ts +214 -0
  406. package/lib/browser/i18n/en/settings.js +217 -0
  407. package/lib/browser/i18n/en/tools.d.ts +86 -0
  408. package/lib/browser/i18n/en/tools.js +90 -0
  409. package/lib/browser/i18n/ja/account.d.ts +3 -0
  410. package/lib/browser/i18n/ja/account.js +205 -0
  411. package/lib/browser/i18n/ja/assistant.d.ts +3 -0
  412. package/lib/browser/i18n/ja/assistant.js +132 -0
  413. package/lib/browser/i18n/ja/call.d.ts +3 -0
  414. package/lib/browser/i18n/ja/call.js +89 -0
  415. package/lib/browser/i18n/ja/chat.d.ts +3 -0
  416. package/lib/browser/i18n/ja/chat.js +216 -0
  417. package/lib/browser/i18n/ja/common.d.ts +3 -0
  418. package/lib/browser/i18n/ja/common.js +102 -0
  419. package/lib/browser/i18n/ja/console.d.ts +3 -0
  420. package/lib/browser/i18n/ja/console.js +233 -0
  421. package/lib/browser/i18n/ja/discover.d.ts +3 -0
  422. package/lib/browser/i18n/ja/discover.js +120 -0
  423. package/lib/browser/i18n/ja/service.d.ts +3 -0
  424. package/lib/browser/i18n/ja/service.js +245 -0
  425. package/lib/browser/i18n/ja/settings.d.ts +3 -0
  426. package/lib/browser/i18n/ja/settings.js +216 -0
  427. package/lib/browser/i18n/ja/tools.d.ts +3 -0
  428. package/lib/browser/i18n/ja/tools.js +88 -0
  429. package/lib/browser/i18n/locales.d.ts +1150 -1131
  430. package/lib/browser/i18n/messages-ja.js +20 -1567
  431. package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
  432. package/lib/browser/i18n/messages-zh-tw.js +20 -1568
  433. package/lib/browser/i18n/messages.d.ts +1153 -1131
  434. package/lib/browser/i18n/messages.js +44 -3145
  435. package/lib/browser/i18n/zh/account.d.ts +3 -0
  436. package/lib/browser/i18n/zh/account.js +206 -0
  437. package/lib/browser/i18n/zh/assistant.d.ts +3 -0
  438. package/lib/browser/i18n/zh/assistant.js +132 -0
  439. package/lib/browser/i18n/zh/call.d.ts +3 -0
  440. package/lib/browser/i18n/zh/call.js +89 -0
  441. package/lib/browser/i18n/zh/chat.d.ts +3 -0
  442. package/lib/browser/i18n/zh/chat.js +216 -0
  443. package/lib/browser/i18n/zh/common.d.ts +3 -0
  444. package/lib/browser/i18n/zh/common.js +102 -0
  445. package/lib/browser/i18n/zh/console.d.ts +3 -0
  446. package/lib/browser/i18n/zh/console.js +233 -0
  447. package/lib/browser/i18n/zh/discover.d.ts +3 -0
  448. package/lib/browser/i18n/zh/discover.js +120 -0
  449. package/lib/browser/i18n/zh/service.d.ts +3 -0
  450. package/lib/browser/i18n/zh/service.js +245 -0
  451. package/lib/browser/i18n/zh/settings.d.ts +3 -0
  452. package/lib/browser/i18n/zh/settings.js +216 -0
  453. package/lib/browser/i18n/zh/tools.d.ts +3 -0
  454. package/lib/browser/i18n/zh/tools.js +89 -0
  455. package/lib/browser/i18n/zh-tw/account.d.ts +3 -0
  456. package/lib/browser/i18n/zh-tw/account.js +205 -0
  457. package/lib/browser/i18n/zh-tw/assistant.d.ts +3 -0
  458. package/lib/browser/i18n/zh-tw/assistant.js +132 -0
  459. package/lib/browser/i18n/zh-tw/call.d.ts +3 -0
  460. package/lib/browser/i18n/zh-tw/call.js +89 -0
  461. package/lib/browser/i18n/zh-tw/chat.d.ts +3 -0
  462. package/lib/browser/i18n/zh-tw/chat.js +216 -0
  463. package/lib/browser/i18n/zh-tw/common.d.ts +3 -0
  464. package/lib/browser/i18n/zh-tw/common.js +102 -0
  465. package/lib/browser/i18n/zh-tw/console.d.ts +3 -0
  466. package/lib/browser/i18n/zh-tw/console.js +233 -0
  467. package/lib/browser/i18n/zh-tw/discover.d.ts +3 -0
  468. package/lib/browser/i18n/zh-tw/discover.js +120 -0
  469. package/lib/browser/i18n/zh-tw/service.d.ts +3 -0
  470. package/lib/browser/i18n/zh-tw/service.js +245 -0
  471. package/lib/browser/i18n/zh-tw/settings.d.ts +3 -0
  472. package/lib/browser/i18n/zh-tw/settings.js +216 -0
  473. package/lib/browser/i18n/zh-tw/tools.d.ts +3 -0
  474. package/lib/browser/i18n/zh-tw/tools.js +88 -0
  475. package/lib/browser/markdown/code-renderers.d.ts +2 -0
  476. package/lib/browser/markdown/code-renderers.js +3 -1
  477. package/lib/browser/offline/device-values.d.ts +4 -0
  478. package/lib/browser/offline/device-values.js +10 -0
  479. package/lib/browser/pwa/page-build.d.ts +16 -0
  480. package/lib/browser/pwa/page-build.js +48 -0
  481. package/lib/browser/screen/page-answers.d.ts +2 -1
  482. package/lib/browser/screen/page-answers.js +7 -4
  483. package/lib/browser/settings/settings-protocol.d.ts +4 -0
  484. package/lib/browser/settings/settings-protocol.js +4 -0
  485. package/lib/browser/style/base.d.ts +1 -1
  486. package/lib/browser/style/base.js +3 -0
  487. package/lib/browser/style/chat-list.d.ts +1 -1
  488. package/lib/browser/style/chat-list.js +1 -1
  489. package/lib/browser/style/conversation-column.d.ts +1 -1
  490. package/lib/browser/style/conversation-column.js +17 -0
  491. package/lib/browser/style/conversation.d.ts +1 -1
  492. package/lib/browser/style/conversation.js +11 -1
  493. package/lib/browser/style/device.js +1 -0
  494. package/lib/browser/style/dialogs.d.ts +1 -1
  495. package/lib/browser/style/dialogs.js +1 -1
  496. package/lib/browser/style/layout.d.ts +1 -1
  497. package/lib/browser/style/layout.js +135 -57
  498. package/lib/browser/style/pages.d.ts +1 -1
  499. package/lib/browser/style/pages.js +0 -7
  500. package/lib/browser/style/shell.d.ts +1 -1
  501. package/lib/browser/style/shell.js +8 -0
  502. package/lib/browser/style/video-call.d.ts +3 -0
  503. package/lib/browser/style/video-call.js +66 -0
  504. package/lib/browser/style.js +2 -0
  505. package/lib/browser/util/call-transcript.d.ts +17 -0
  506. package/lib/browser/util/call-transcript.js +113 -0
  507. package/lib/browser/util/desktop.d.ts +10 -1
  508. package/lib/browser/util/desktop.js +10 -0
  509. package/lib/browser/util/image-pull.d.ts +62 -0
  510. package/lib/browser/util/image-pull.js +91 -0
  511. package/lib/browser/util/process.d.ts +6 -0
  512. package/lib/browser/util/process.js +17 -4
  513. package/lib/browser/util/spoken.d.ts +3 -3
  514. package/lib/browser/util/spoken.js +4 -4
  515. package/lib/browser/video-call/call-camera.d.ts +60 -0
  516. package/lib/browser/video-call/call-camera.js +192 -0
  517. package/lib/browser/video-call/call-people.d.ts +22 -0
  518. package/lib/browser/video-call/call-people.js +32 -0
  519. package/lib/browser/video-call/call-window.d.ts +20 -0
  520. package/lib/browser/video-call/call-window.js +83 -0
  521. package/lib/browser/video-call/clip-plan.d.ts +57 -0
  522. package/lib/browser/video-call/clip-plan.js +80 -0
  523. package/lib/browser/video-call/face-camera.d.ts +94 -0
  524. package/lib/browser/video-call/face-camera.js +197 -0
  525. package/lib/browser/video-call/face-files.d.ts +70 -0
  526. package/lib/browser/video-call/face-files.js +137 -0
  527. package/lib/browser/video-call/face-moves.d.ts +69 -0
  528. package/lib/browser/video-call/face-moves.js +184 -0
  529. package/lib/browser/video-call/face-stage.d.ts +140 -0
  530. package/lib/browser/video-call/face-stage.js +223 -0
  531. package/lib/browser/video-call/mouth-layer.d.ts +82 -0
  532. package/lib/browser/video-call/mouth-layer.js +245 -0
  533. package/lib/browser/video-call/video-call-view.d.ts +20 -0
  534. package/lib/browser/video-call/video-call-view.js +290 -0
  535. package/lib/browser/video-call/video-face.d.ts +20 -0
  536. package/lib/browser/video-call/video-face.js +507 -0
  537. package/lib/browser/workbench-hosts.d.ts +1 -0
  538. package/lib/browser/workbench-protocol.d.ts +2 -0
  539. package/lib/browser/workbench-util.d.ts +5 -0
  540. package/lib/browser/workbench-util.js +18 -0
  541. package/lib/browser/workbench.d.ts +14 -0
  542. package/lib/browser/workbench.js +71 -4
  543. package/package.json +7 -7
  544. package/public/faces/README.md +40 -0
  545. package/public/faces/blonde/clap.mp4 +0 -0
  546. package/public/faces/blonde/dance.mp4 +0 -0
  547. package/public/faces/blonde/face.jpg +0 -0
  548. package/public/faces/blonde/happy.mp4 +0 -0
  549. package/public/faces/blonde/heart.mp4 +0 -0
  550. package/public/faces/blonde/idle-1.mp4 +0 -0
  551. package/public/faces/blonde/idle-2.mp4 +0 -0
  552. package/public/faces/blonde/idle-3.mp4 +0 -0
  553. package/public/faces/blonde/laugh.mp4 +0 -0
  554. package/public/faces/blonde/listening.mp4 +0 -0
  555. package/public/faces/blonde/poster.jpg +0 -0
  556. package/public/faces/blonde/shy.mp4 +0 -0
  557. package/public/faces/blonde/sorry.mp4 +0 -0
  558. package/public/faces/blonde/stretch.mp4 +0 -0
  559. package/public/faces/blonde/surprised.mp4 +0 -0
  560. package/public/faces/blonde/talk-1.mp4 +0 -0
  561. package/public/faces/blonde/talk-2.mp4 +0 -0
  562. package/public/faces/blonde/think-2.mp4 +0 -0
  563. package/public/faces/blonde/thinking.mp4 +0 -0
  564. package/public/faces/blonde/wave.mp4 +0 -0
  565. package/public/faces/clap.mp4 +0 -0
  566. package/public/faces/dance.mp4 +0 -0
  567. package/public/faces/face.jpg +0 -0
  568. package/public/faces/framing.json +1 -0
  569. package/public/faces/happy.mp4 +0 -0
  570. package/public/faces/heart.mp4 +0 -0
  571. package/public/faces/idle-1.mp4 +0 -0
  572. package/public/faces/idle-2.mp4 +0 -0
  573. package/public/faces/idle-3.mp4 +0 -0
  574. package/public/faces/laugh.mp4 +0 -0
  575. package/public/faces/lips.json +1 -0
  576. package/public/faces/listening.mp4 +0 -0
  577. package/public/faces/poster.jpg +0 -0
  578. package/public/faces/shy.mp4 +0 -0
  579. package/public/faces/sorry.mp4 +0 -0
  580. package/public/faces/stretch.mp4 +0 -0
  581. package/public/faces/surprised.mp4 +0 -0
  582. package/public/faces/talk-1.mp4 +0 -0
  583. package/public/faces/talk-2.mp4 +0 -0
  584. package/public/faces/think-2.mp4 +0 -0
  585. package/public/faces/thinking.mp4 +0 -0
  586. package/public/faces/wave.mp4 +0 -0
package/README.en.md CHANGED
@@ -66,7 +66,7 @@ As WeChat pulls its mini programs down over its chats (design record docs/design
66
66
  - **Widgets** (views at `location: 'board'`): on a phone, a swipe to the right over the first tab brings the board in from the left (from the left edge over a row swiped open); elsewhere a button of the rail. Edit takes cards off, puts them back and orders them by their handles, kept for the user (`board`). Built in: the double's tasks, Quick open, and Next up of the scheduled tasks.
67
67
  - **Started on open**: a package with `pi.webActivation: 'open'`, or one opened without installing (`origin: 'temporary'`), loads when one of its pages opens; left, it keeps running in the background with its page as it was (`KeptPages`), shown again at once; it stops after the time of Settings, Extensions (5 minutes by default) in the background, or when more than three are there. Its pages are not in the navigation: Quick open lists them.
68
68
  - **Sharing**: `ui.shareExtension` opens the dialog that hands an extension on (QR code, copy, the share of the system): the source of a published one, else end to end through the relay and kept nowhere (`TaRelayServer.sharePackage`); `ui.openShared` opens a link of an extension, asked first.
69
- - For web extensions: `ui.usePages()` (every page, with its state, place, last use and temporary package), `ui.showView` (starts one started on open first; its name opens its first page), `ui.stopExtension`, `ui.forgetPage`, `pi.openTemporary(source, from)`, `ui.useContextMenu()` (the menu of the page, right click or long press), `ui.QrCode`, `ui.scanCode` and `ui.scan` (in the Ta app only; `ui.scan` is the Scan of the page, which opens what the code carries), `ui.connect(link)` (connects to another Ta by a pairing link, of `ta pair` or the device a Ta that let the user in gave them, and switches to it once it answered, the page loading again; false, said in a notice, when it did not answer or refused).
69
+ - For web extensions: `ui.usePages()` (every page, with its state, place, last use and temporary package), `ui.showView` (starts one started on open first; its name opens its first page), `ui.stopExtension`, `ui.forgetPage`, `pi.openTemporary(source, from)`, `ui.useContextMenu()` (the menu of the page, right click or long press), `ui.QrCode`, `ui.scanCode` and `ui.scan` (in the Ta app only; `ui.scan` is the Scan of the page, which opens what the code carries), `ui.saveFile(file, name)` (in the Ta app only, whose web view downloads nothing: iOS keeps pictures and videos in Photos and other files in Files, Android in Downloads), `ui.connect(link)` (connects to another Ta by a pairing link, of `ta pair` or the device a Ta that let the user in gave them, and switches to it once it answered, the page loading again; false, said in a notice, when it did not answer or refused).
70
70
 
71
71
  ## Phones and tablets
72
72
 
package/README.md CHANGED
@@ -66,7 +66,7 @@ Web 客户端可以装成桌面或手机上的应用:Chrome / Edge 地址栏
66
66
  - **小组件**(`location: 'board'` 的视图):手机上在第一个标签上从左往右划,小组件面板从左侧滑入(已经划开的列表行上从左边缘开始);电脑和平板上是导轨底部的按钮。"编辑"里可以移除、加回卡片,拖动右侧把手排序,排列存在用户数据里(`board`)。内置的卡片有分身的任务、快捷打开和定时任务的"接下来"。
67
67
  - **按需启动**:包的 `pi.webActivation: 'open'`,或免安装打开的临时扩展(`origin: 'temporary'`),在打开它的页面时才加载;离开后在后台继续运行、页面原样保留(`KeptPages`),再次打开没有等待;在后台超过保留时间(设置 → 扩展,默认 5 分钟)或后台超过 3 个时停止。这类扩展的页面不进导航栏,在快捷打开里找到。
68
68
  - **分享**:`ui.shareExtension` 打开分享弹窗(二维码、复制、系统分享),已发布的扩展给来源,本机的经中继端到端发送、不存储(`TaRelayServer.sharePackage`);`ui.openShared` 打开扩展链接,先确认。
69
- - 扩展接口:`ui.usePages()`(所有页面及其状态、位置、最近使用时间、临时扩展信息)、`ui.showView`(按需启动的先启动,扩展名打开它的第一个页面)、`ui.stopExtension`、`ui.forgetPage`、`pi.openTemporary(source, from)`、`ui.useContextMenu()`(和页面一样的右键/长按菜单)、`ui.QrCode`、`ui.scanCode` 和 `ui.scan`(只在 Ta 手机应用里;`ui.scan` 就是页面自己的“扫一扫”,扫完打开二维码里的内容)、`ui.connect(link)`(按配对链接连到另一个 Ta,`ta pair` 或让你进入的 Ta 给的设备,对方回答后切过去、页面重新加载;没回答或被拒绝时返回 false 并提示原因)。
69
+ - 扩展接口:`ui.usePages()`(所有页面及其状态、位置、最近使用时间、临时扩展信息)、`ui.showView`(按需启动的先启动,扩展名打开它的第一个页面)、`ui.stopExtension`、`ui.forgetPage`、`pi.openTemporary(source, from)`、`ui.useContextMenu()`(和页面一样的右键/长按菜单)、`ui.QrCode`、`ui.scanCode` 和 `ui.scan`(只在 Ta 手机应用里;`ui.scan` 就是页面自己的“扫一扫”,扫完打开二维码里的内容)、`ui.saveFile(file, name)`(只在 Ta 手机应用里,它的网页视图不会下载:iOS 上图片和视频存进相册、其他文件存到“文件”,Android 存到“下载”)、`ui.connect(link)`(按配对链接连到另一个 Ta,`ta pair` 或让你进入的 Ta 给的设备,对方回答后切过去、页面重新加载;没回答或被拒绝时返回 false 并提示原因)。
70
70
 
71
71
  ## 手机与平板
72
72
 
@@ -1,12 +1,13 @@
1
1
  import { type TaDelegateLevel } from '@celljs/ta-protocol';
2
2
  /** The role of ta in its conversation with the user. */
3
- export declare const ASSISTANT_PROMPT = "You are Ta, the user's personal agent: a little green dinosaur they talk to by voice or text in a web page. The user hands you work and mostly does not care how it gets done: you talk with them and hand the work out to tasks, which do it.\n- To hand out work, call start_task with a short title and complete, self-contained instructions: a task runs in its own session that cannot see this conversation. Say in them what to do and what to answer, never how the answer looks (its length, its format): Ta shows every answer as the user reads it. Start independent tasks in parallel. Then tell the user in one sentence what you started.\n- A task opens in the user's default directory, which they may change at any time; start_task says which it was. Give a cwd only when the user names a directory.\n- When tasks change code in parallel, or a change should not touch the user's working copy until they agree, start them with isolate: each works in a git worktree of its own, on a branch of its own, and its update says which; merging is for the user to ask.\n- Give verify only for a change a second look may catch out: code changed across several files, or behavior the user relies on. Not for documents, a small fix of a file or two, research, or what the task checks well itself. verify is one check (a command such as \"bun test\", or one thing to look at), not a list; and when you give it, add no steps of checking again to the instructions: the check does that. When such a task ends, its update asks you to start a check: do it with start_task and verifies, with the instructions it gives as they are, and tell the user what the check found.\n- When the user asks what goes on, list_tasks has your tasks and the conversations they have going on themselves. You cannot write to those or stop them: tell the user, and if they want you to follow one, they hand it to you from the list of chats.\n- When a <task_update> message arrives, the user already sees that the task ended and what it said, its cards too: tell them in one or two sentences what was done and what was not, and whether they need to decide anything. Do not repeat the numbers, lists of files, comparisons or tests it already shows, and write no card of your own for it. With nothing to decide, suggest nothing; with something, name that one thing alone. get_task has the details.\n- Ask before anything risky or irreversible the user did not clearly ask for.\n- Your replies are read aloud: short plain sentences, no tables, no code unless asked. Reply in the user's language.";
3
+ export declare const ASSISTANT_PROMPT = "You are Ta, the user's personal agent: a little green dinosaur they talk to by voice or text in a web page. The user hands you work and mostly does not care how it gets done: you talk with them and hand the work out to tasks, which do it.\n- To hand out work, call start_task with a short title and complete, self-contained instructions: a task runs in its own session that cannot see this conversation. Say in them what to do and what to answer, never how the answer looks (its length, its format): Ta shows every answer as the user reads it. Start independent tasks in parallel. Then tell the user in one sentence what you started.\n- A task opens in the user's default directory, which they may change at any time; start_task says which it was. Give a cwd only when the user names a directory.\n- When tasks change code in parallel, or a change should not touch the user's working copy until they agree, start them with isolate: each works in a git worktree of its own, on a branch of its own, and its update says which; merging is for the user to ask.\n- Give verify only for a change a second look may catch out: code changed across several files, or behavior the user relies on. Not for documents, a small fix of a file or two, research, or what the task checks well itself. verify is one check (a command such as \"bun test\", or one thing to look at), not a list; and when you give it, add no steps of checking again to the instructions: the check does that. When such a task ends, its update asks you to start a check: do it with start_task and verifies, with the instructions it gives as they are, and tell the user what the check found.\n- When the user asks what goes on, list_tasks has your tasks and the conversations they have going on themselves. You cannot write to those or stop them: tell the user, and if they want you to follow one, they hand it to you from the list of chats.\n- When a <task_update> message arrives, the user already sees that the task ended and what it said, its cards too: tell them in one or two sentences what was done and what was not, and whether they need to decide anything. Do not repeat the numbers, lists of files, comparisons or tests it already shows, and write no card of your own for it. With nothing to decide, suggest nothing; with something, name that one thing alone. get_task has the details.\n- What the user says is often spoken and transcribed, with wrong words and sentences cut off: read it for what they mean, with what was said before. A message from a call ([ta:from @celljs/ta-call \u2026]) is the user's own request, retold by the call: \"the user wants X\" means they ask you for X.\n- When they ask for something to be done (\"\u5E2E\u6211\u5F04\", \"\u5E2E\u6211\u6539\", \"\u6362\u4E00\u4E2A\", \"\u88C5\u4E0A\", \"\u6253\u5F00\u2026\"), that is their go: start it now, in this turn, then say in one sentence what you started, with asked: true. Do not ask first whether to start, nor offer to, nor stop at saying what you would do.\n- A short go (\"\u6765\", \"\u597D\", \"\u5F00\u59CB\", \"\u884C\", \"\u55EF\") answers what you said last: do what you proposed, or the most likely of what waits for them (the step they usually take next, as installing what was just changed, before what needs their taste), with asked: true, and say in one sentence which you took. Ask only when two are as likely, and then one yes-or-no question with your best guess (\"\u88C5\u5230\u624B\u673A\u4E0A\uFF0C\u5BF9\u5427\uFF1F\"), never a card of choices.\n- What a task can find out (which voices a service has, where a setting is, which file) is no question for the user: the task finds it, picks what fits, does it and tries it. A taste they did not say (a man's or a woman's voice) is yours to pick: say what you picked, so they can change it.\n- Instructions of a task say to get it done and checked: the result the user wants, how the task shows it works (it tries it, as the user would), and that it asks them only before what is risky or cannot be undone.\n- What the user asks of their screen (open a page, look at what is wrong, press something) is done on the page in front of them, on the device they use, a phone's on a phone: do it yourself, with app_look, app_go and app_do; a message from a call says which device. Never the computer's desktop (screenshots, tools that drive the computer) unless they name the computer.\n- When you cannot tell what they want at all (words that ask for nothing, a sentence cut off), say in one short sentence what you heard and ask them to say it again; never answer nothing.\n- Ask first only before what is risky or cannot be undone (deleting, publishing, sending or paying for them) that they did not clearly ask for.\n- Your replies are read aloud: short plain sentences, no tables, no code unless asked. Short is not vague: say what you started, picked or found. Reply in the user's language.";
4
4
  /**
5
- * In the role while the user wants to be asked first (Settings.confirmTasks). The team tools of ta-channels
6
- * read the same words in the system prompt to ask before they build a team: keep them as they are.
5
+ * In the role while the user wants to be asked first (Settings.confirmTasks): of what the double starts of its own
6
+ * accord only, never twice (docs/design/ta-double.md, 听懂与派活). The team tools of ta-channels read the same words in the
7
+ * system prompt to ask before they build a team: keep them as they are.
7
8
  */
8
9
  export declare const ASK_FIRST_MARK = "Ask the user before you hand out work";
9
- export declare const ASK_FIRST_PROMPT = "- Ask the user before you hand out work: say in a few short lines what you would start (the tasks, or the agents of a team and what each does) and wait for their go. They confirm each start besides; a start they turn down is not to be tried again unasked.";
10
+ export declare const ASK_FIRST_PROMPT = "- Ask the user before you hand out work you start of your own accord (a next step, a check, a guess the user did not ask for): start it without asked, and the user agrees to it on their screen; you need not ask in words first. Work they asked for in their message (asked: true) starts at once. A start they turn down is not to be tried again unasked.";
10
11
  /**
11
12
  * How much the double hands out (Settings.delegate), each with its mark (TaDelegateUtil.mark), which the guard of ta
12
13
  * serve reads to turn down what the level leaves to tasks.
@@ -45,6 +46,10 @@ export declare const ASSISTANT_TOOLS: {
45
46
  readonly type: 'string';
46
47
  readonly description: "The id of the task this one checks: its first line, PASS or FAIL, is that task's verdict.";
47
48
  };
49
+ readonly asked: {
50
+ readonly type: 'boolean';
51
+ readonly description: "The user asked for this very work in their last message (in so many words, or a short go to what you proposed): it starts at once, without the card the user's settings show for work you start of your own accord.";
52
+ };
48
53
  };
49
54
  readonly required: readonly ['title', 'instructions'];
50
55
  };
@@ -7,14 +7,22 @@ export const ASSISTANT_PROMPT = `You are Ta, the user's personal agent: a little
7
7
  - Give verify only for a change a second look may catch out: code changed across several files, or behavior the user relies on. Not for documents, a small fix of a file or two, research, or what the task checks well itself. verify is one check (a command such as "bun test", or one thing to look at), not a list; and when you give it, add no steps of checking again to the instructions: the check does that. When such a task ends, its update asks you to start a check: do it with start_task and verifies, with the instructions it gives as they are, and tell the user what the check found.
8
8
  - When the user asks what goes on, list_tasks has your tasks and the conversations they have going on themselves. You cannot write to those or stop them: tell the user, and if they want you to follow one, they hand it to you from the list of chats.
9
9
  - When a <task_update> message arrives, the user already sees that the task ended and what it said, its cards too: tell them in one or two sentences what was done and what was not, and whether they need to decide anything. Do not repeat the numbers, lists of files, comparisons or tests it already shows, and write no card of your own for it. With nothing to decide, suggest nothing; with something, name that one thing alone. get_task has the details.
10
- - Ask before anything risky or irreversible the user did not clearly ask for.
11
- - Your replies are read aloud: short plain sentences, no tables, no code unless asked. Reply in the user's language.`;
10
+ - What the user says is often spoken and transcribed, with wrong words and sentences cut off: read it for what they mean, with what was said before. A message from a call ([ta:from @celljs/ta-call …]) is the user's own request, retold by the call: "the user wants X" means they ask you for X.
11
+ - When they ask for something to be done ("帮我弄", "帮我改", "换一个", "装上", "打开…"), that is their go: start it now, in this turn, then say in one sentence what you started, with asked: true. Do not ask first whether to start, nor offer to, nor stop at saying what you would do.
12
+ - A short go ("来", "好", "开始", "行", "嗯") answers what you said last: do what you proposed, or the most likely of what waits for them (the step they usually take next, as installing what was just changed, before what needs their taste), with asked: true, and say in one sentence which you took. Ask only when two are as likely, and then one yes-or-no question with your best guess ("装到手机上,对吧?"), never a card of choices.
13
+ - What a task can find out (which voices a service has, where a setting is, which file) is no question for the user: the task finds it, picks what fits, does it and tries it. A taste they did not say (a man's or a woman's voice) is yours to pick: say what you picked, so they can change it.
14
+ - Instructions of a task say to get it done and checked: the result the user wants, how the task shows it works (it tries it, as the user would), and that it asks them only before what is risky or cannot be undone.
15
+ - What the user asks of their screen (open a page, look at what is wrong, press something) is done on the page in front of them, on the device they use, a phone's on a phone: do it yourself, with app_look, app_go and app_do; a message from a call says which device. Never the computer's desktop (screenshots, tools that drive the computer) unless they name the computer.
16
+ - When you cannot tell what they want at all (words that ask for nothing, a sentence cut off), say in one short sentence what you heard and ask them to say it again; never answer nothing.
17
+ - Ask first only before what is risky or cannot be undone (deleting, publishing, sending or paying for them) that they did not clearly ask for.
18
+ - Your replies are read aloud: short plain sentences, no tables, no code unless asked. Short is not vague: say what you started, picked or found. Reply in the user's language.`;
12
19
  /**
13
- * In the role while the user wants to be asked first (Settings.confirmTasks). The team tools of ta-channels
14
- * read the same words in the system prompt to ask before they build a team: keep them as they are.
20
+ * In the role while the user wants to be asked first (Settings.confirmTasks): of what the double starts of its own
21
+ * accord only, never twice (docs/design/ta-double.md, 听懂与派活). The team tools of ta-channels read the same words in the
22
+ * system prompt to ask before they build a team: keep them as they are.
15
23
  */
16
24
  export const ASK_FIRST_MARK = 'Ask the user before you hand out work';
17
- export const ASK_FIRST_PROMPT = `- ${ASK_FIRST_MARK}: say in a few short lines what you would start (the tasks, or the agents of a team and what each does) and wait for their go. They confirm each start besides; a start they turn down is not to be tried again unasked.`;
25
+ export const ASK_FIRST_PROMPT = `- ${ASK_FIRST_MARK} you start of your own accord (a next step, a check, a guess the user did not ask for): start it without asked, and the user agrees to it on their screen; you need not ask in words first. Work they asked for in their message (asked: true) starts at once. A start they turn down is not to be tried again unasked.`;
18
26
  /**
19
27
  * How much the double hands out (Settings.delegate), each with its mark (TaDelegateUtil.mark), which the guard of ta
20
28
  * serve reads to turn down what the level leaves to tasks.
@@ -49,6 +57,10 @@ export const ASSISTANT_TOOLS = {
49
57
  description: 'Only for a risky change: the one check to run once it ends, a command or one thing to look at. Its update then asks for a check.',
50
58
  },
51
59
  verifies: { type: 'string', description: "The id of the task this one checks: its first line, PASS or FAIL, is that task's verdict." },
60
+ asked: {
61
+ type: 'boolean',
62
+ description: "The user asked for this very work in their last message (in so many words, or a short go to what you proposed): it starts at once, without the card the user's settings show for work you start of your own accord.",
63
+ },
52
64
  },
53
65
  required: ['title', 'instructions'],
54
66
  },
@@ -68,6 +68,12 @@ export declare namespace AssistantTaskUtil {
68
68
  path: string;
69
69
  branch: string;
70
70
  };
71
+ /**
72
+ * Whether the run going on answers the user: the last message of the user's role is theirs (typed, said, or sent
73
+ * for them with TaMessageSource.mark, a call's among them), not a note of a task nor a notice of Ta. Only then may
74
+ * the double start what it says they asked for without the card of Settings.confirmTasks (docs/design/ta-double.md, 听懂与派活).
75
+ */
76
+ function askedByUser(messages: readonly SessionMessage[]): boolean;
71
77
  /** The note of a task `text` is (updateNote, adoptedNote, renamedNote), if it is one. */
72
78
  function noteOf(text: string): TaTaskNote | undefined;
73
79
  /**
@@ -1,4 +1,4 @@
1
- import { TaTaskNote } from '@celljs/ta-protocol';
1
+ import { TaMessageSource, TaTaskNote } from '@celljs/ta-protocol';
2
2
  import { MessageUtil } from '../util/message.js';
3
3
  /** The tasks kept: the last ones, those taken off the list among them. */
4
4
  export const MAX_TASKS = 50;
@@ -179,6 +179,17 @@ export var AssistantTaskUtil;
179
179
  return { path: `${root.replace(/\/+$/, '')}-ta-${name}`, branch: `ta/${name}${words ? `-${words}` : ''}` };
180
180
  }
181
181
  AssistantTaskUtil.worktreeOf = worktreeOf;
182
+ /**
183
+ * Whether the run going on answers the user: the last message of the user's role is theirs (typed, said, or sent
184
+ * for them with TaMessageSource.mark, a call's among them), not a note of a task nor a notice of Ta. Only then may
185
+ * the double start what it says they asked for without the card of Settings.confirmTasks (docs/design/ta-double.md, 听懂与派活).
186
+ */
187
+ function askedByUser(messages) {
188
+ const last = [...messages].reverse().find(message => role(message) === 'user');
189
+ const text = last ? MessageUtil.text(MessageUtil.blocks(last)) : '';
190
+ return !!text.trim() && !noteOf(text) && !TaMessageSource.isNotice(text);
191
+ }
192
+ AssistantTaskUtil.askedByUser = askedByUser;
182
193
  /** The note of a task `text` is (updateNote, adoptedNote, renamedNote), if it is one. */
183
194
  function noteOf(text) {
184
195
  return TaTaskNote.parse(text);
@@ -38,7 +38,7 @@ function DoubleTurn({ item, latest, children }) {
38
38
  function DoubleUserMessage({ message, blocks }) {
39
39
  const { text, copied, skill } = userWords(blocks);
40
40
  const [menu, onContextMenu] = useMessageMenu({ kind: 'user', message, text: copied });
41
- return (React.createElement("div", { className: `ta-msg-user ${ASK_CLASS}`, onContextMenu: onContextMenu },
41
+ return (React.createElement("div", { className: "ta-msg-user", onContextMenu: onContextMenu },
42
42
  React.createElement(UserMarks, { blocks: blocks }),
43
43
  skill && React.createElement(SkillUse, { skill: skill }),
44
44
  React.createElement(UserSaid, { blocks: blocks, text: text, bubble: "ta-msg-bubble", timestamp: message.timestamp }),
@@ -82,6 +82,18 @@ function DoubleRowView({ item, tools, mood, status, latest, started, onTask, t }
82
82
  }
83
83
  return React.createElement(DoubleUserMessage, { message: item.message, blocks: blocks });
84
84
  }
85
+ /**
86
+ * Whether the row of `item` is what the user said (DoubleUserMessage), not a task's note nor a notice: marked on the
87
+ * row itself (ASK_CLASS), as in any conversation. Marked inside it, the view would go by the place of the message in its
88
+ * row while the row comes in with a motion (its transform makes it the offsetParent), to the top of the thread first.
89
+ */
90
+ function isAskRow(item) {
91
+ if (item.kind !== 'message' || item.message.role !== 'user') {
92
+ return false;
93
+ }
94
+ const text = MessageUtil.text(MessageUtil.blocks(item.message)).trim();
95
+ return !AssistantTaskUtil.noteOf(text) && !TaMessageSource.isNotice(text);
96
+ }
85
97
  function sameTasks(a, b) {
86
98
  return a.length === b.length && a.every((task, index) => task === b[index]);
87
99
  }
@@ -103,6 +115,7 @@ export const AssistantThread = React.memo(function AssistantThread({ state, repl
103
115
  const renderers = React.useContext(MessageRenderers);
104
116
  const items = React.useMemo(() => ProcessUtil.items(state.messages, state.working, state.start, renderers, state.head), [state.messages, state.working, state.start, renderers, state.head]);
105
117
  const starts = React.useMemo(() => ProcessUtil.starts(items), [items]);
118
+ const asks = React.useMemo(() => items.map(isAskRow), [items]);
106
119
  const breaks = React.useMemo(() => ProcessUtil.timeBreaks(starts, index => ProcessUtil.shown(items[index], renderers)), [starts, items, renderers]);
107
120
  // A turn's cards know what the user said after it: a choice they asked for is made (message-list.tsx).
108
121
  const answers = React.useMemo(() => ProcessUtil.answers(items, message => userWords(MessageUtil.blocks(message)).copied), [items]);
@@ -126,7 +139,7 @@ export const AssistantThread = React.memo(function AssistantThread({ state, repl
126
139
  }
127
140
  const turn = item.kind === 'turn';
128
141
  const started = turn ? WebTaskUtil.startedIn(own, origin, starts[index], (_a = starts[index + 1]) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY) : NO_TASKS;
129
- return (React.createElement("div", { key: item.key, "data-row": item.key, className: shown.className(index) },
142
+ return (React.createElement("div", { key: item.key, "data-row": item.key, className: shown.className(index, asks[index] && ASK_CLASS) },
130
143
  breaks[index] !== undefined && React.createElement(TimeBreak, { timestamp: breaks[index] }),
131
144
  React.createElement(CodeAnswer.Provider, { value: answers[index] },
132
145
  React.createElement(DoubleRow, { item: item, tools: state.tools, mood: turn ? ProcessUtil.mood(item, index === lastTurn, waiting) : 'idle', status: onHead && item === last ? status : undefined, latest: index === lastTurn, started: started, onTask: onTask, t: t }))));
@@ -28,8 +28,9 @@ import { ASSISTANT_NAME_STATE } from './assistant-state.js';
28
28
  import { AssistantTaskUtil } from './assistant-task-util.js';
29
29
  import { ASSISTANT_TASKS_VIEW } from './assistant-tasks.js';
30
30
  import { AssistantThread } from './assistant-thread.js';
31
+ import { CallFace } from './call-face.js';
31
32
  import { AskCard, TasksChip } from './task-views.js';
32
- import { CallBar, callAction, callEndedNotice, dialogAnnouncements, talkCall, useCallAnnouncements, useCallTurns, useSpokenReply, useTalkCalls, useVoiceCall, } from './voice-call-bar.js';
33
+ import { CallBar, callAction, callEndedNotice, dialogAnnouncements, talkCall, useCallAnnouncements, useCallTurns, useSpokenReply, useTalkCalls, useVoiceCall, videoCallAction, } from './voice-call-bar.js';
33
34
  export { ASSISTANT_TASKS_VIEW, AssistantTasks, AssistantTaskView } from './assistant-tasks.js';
34
35
  /** The name of the built-in web extension of the double. */
35
36
  export const ASSISTANT_NAME = 'assistant';
@@ -246,6 +247,7 @@ function Chat({ store, tasks, taskStates, onTask, onMood, onTasks }) {
246
247
  ...(Voice.canSpeak() && Voice.canListen()
247
248
  ? [
248
249
  callAction(callState, call, t),
250
+ videoCallAction(callState, call, t),
249
251
  {
250
252
  key: 'speakTalk',
251
253
  label: t('ta.assistant.speakTalkShort'),
@@ -295,6 +297,7 @@ function Chat({ store, tasks, taskStates, onTask, onMood, onTasks }) {
295
297
  ...addons.actions,
296
298
  ];
297
299
  return (React.createElement(React.Fragment, null,
300
+ React.createElement(CallFace, { state: callState, call: call }),
298
301
  React.createElement("div", { className: "ta-chat-scroll ta-conversation", ref: scroller },
299
302
  React.createElement("div", { className: "ta-chat-col" }, state.messages.length === 0 ? (React.createElement("div", { className: "ta-hero" },
300
303
  React.createElement(TaAvatar, { mood: mood, size: 112, className: "ta-hero-avatar", roam: true }),
@@ -64,13 +64,14 @@ export declare class TaAssistantImpl extends AssistantConversation implements Ta
64
64
  cwd: string;
65
65
  }[];
66
66
  /** `call`: the id of the call of start_task, which an ask of it has. */
67
- protected startTask({ title, instructions, cwd, isolate, verify, verifies, }: {
67
+ protected startTask({ title, instructions, cwd, isolate, verify, verifies, asked, }: {
68
68
  title: string;
69
69
  instructions: string;
70
70
  cwd?: string;
71
71
  isolate?: boolean;
72
72
  verify?: string;
73
73
  verifies?: string;
74
+ asked?: boolean;
74
75
  }, call: string): Promise<string>;
75
76
  /**
76
77
  * A git worktree for a task, beside the repository of `where`, on a branch of its own from what the repository
@@ -287,16 +287,18 @@ let TaAssistantImpl = class TaAssistantImpl extends AssistantConversation {
287
287
  });
288
288
  }
289
289
  /** `call`: the id of the call of start_task, which an ask of it has. */
290
- async startTask({ title, instructions, cwd, isolate, verify, verifies, }, call) {
291
- var _a;
292
- var _b;
290
+ async startTask({ title, instructions, cwd, isolate, verify, verifies, asked, }, call) {
291
+ var _a, _b;
292
+ var _c, _d;
293
293
  const { confirmTasks, maxTasks } = this.settings.state.settings;
294
294
  const running = this.current.tasks.filter(task => task.status === 'running').length;
295
295
  if (maxTasks > 0 && running >= maxTasks) {
296
296
  throw new Error(`${running} tasks run already, as many as the user lets run at once: wait for one to end (a <task_update> comes), or stop one.`);
297
297
  }
298
298
  const where = cwd || ((_a = this.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '.';
299
- if (confirmTasks) {
299
+ // Work the user asked for in the message this run answers is started at once: the card is for what the double
300
+ // starts of its own accord (docs/design/ta-double.md, 听懂与派活), never a second question after their go.
301
+ if (confirmTasks && !(asked === true && AssistantTaskUtil.askedByUser((_c = (_b = this.store()) === null || _b === void 0 ? void 0 : _b.state.messages) !== null && _c !== void 0 ? _c : []))) {
300
302
  const started = await this.asks.ask({ id: call, title, instructions, cwd: where, at: Date.now() });
301
303
  this.initiative.record(started ? 'accepted' : 'declined', title);
302
304
  if (!started) {
@@ -309,7 +311,7 @@ let TaAssistantImpl = class TaAssistantImpl extends AssistantConversation {
309
311
  }
310
312
  const id = this.book.nextId();
311
313
  const worktree = isolate ? await this.makeWorktree(where, id, title) : undefined;
312
- const info = await this.server.openSession({ cwd: (_b = worktree === null || worktree === void 0 ? void 0 : worktree.cwd) !== null && _b !== void 0 ? _b : where });
314
+ const info = await this.server.openSession({ cwd: (_d = worktree === null || worktree === void 0 ? void 0 : worktree.cwd) !== null && _d !== void 0 ? _d : where });
313
315
  await this.server.setSessionName(info.sessionId, title);
314
316
  await this.setModel(info.sessionId, this.settings.state.settings.taskModel).catch(error => {
315
317
  throw new Error(`The model of the tasks (${this.settings.state.settings.taskModel}) cannot be used: ${error instanceof Error ? error.message : String(error)}`);
@@ -328,8 +330,8 @@ let TaAssistantImpl = class TaAssistantImpl extends AssistantConversation {
328
330
  };
329
331
  this.book.add(task);
330
332
  const store = await this.follow(task);
331
- const asked = verifies && !instructions.includes(AssistantTaskUtil.CHECK_ANSWER) ? `${instructions}\n\n${AssistantTaskUtil.CHECK_ANSWER}` : instructions;
332
- await store.prompt(TaMessageSource.mark(asked, TaMessageSource.DOUBLE));
333
+ const told = verifies && !instructions.includes(AssistantTaskUtil.CHECK_ANSWER) ? `${instructions}\n\n${AssistantTaskUtil.CHECK_ANSWER}` : instructions;
334
+ await store.prompt(TaMessageSource.mark(told, TaMessageSource.DOUBLE));
333
335
  const { sessionFile } = await this.server.getState(info.sessionId);
334
336
  this.book.change(task, { sessionFile });
335
337
  const apart = worktree ? ` (a git worktree on the branch ${worktree.worktree.branch})` : '';
@@ -0,0 +1,45 @@
1
+ import type { CallDraft, CallEnd, CallPartner, CallState, CallTalk } from './voice-call-protocol.js';
2
+ /** What of a call (VoiceCall) a voice that thinks changes as it talks. */
3
+ export interface ConversingCall {
4
+ readonly state: CallState;
5
+ set(change: Partial<CallState>): void;
6
+ hangUp(): void;
7
+ end(reason: CallEnd): void;
8
+ /** Its voice is gone: it opens again. */
9
+ lost(): void;
10
+ }
11
+ /**
12
+ * A call the voice service's own model answers (docs/design/ta-voice.md 8): it hears the user, thinks, speaks and
13
+ * reaches the work by its tools; the call shows what goes on, the user's voice always cuts in, and a call nobody spoke
14
+ * in for `silentMs` ends.
15
+ */
16
+ export declare class CallConversing {
17
+ protected readonly call: ConversingCall;
18
+ protected readonly silentMs: number;
19
+ protected spoke: number;
20
+ protected timer?: ReturnType<typeof setInterval>;
21
+ constructor(call: ConversingCall, silentMs?: number);
22
+ /** What the voice tells of the call; `live` while it is the call going on. */
23
+ talk(live: () => boolean): CallTalk;
24
+ /** The page shows again: the silence counts from now. */
25
+ resumed(): void;
26
+ stop(): void;
27
+ }
28
+ /**
29
+ * The answer a partner began on what the user said so far (CallPartner.draft, docs/design/ta-call.md 10), and the
30
+ * partners whose drafts failed (an older Ta), which answer once the user is done only.
31
+ */
32
+ export declare class CallDrafts {
33
+ protected drafted?: {
34
+ text: string;
35
+ draft: CallDraft;
36
+ };
37
+ protected failed?: CallPartner;
38
+ /** Begins one on `said`, unless one is on these words already or the partner cannot. */
39
+ begin(partner: CallPartner | undefined, said: string): void;
40
+ /** The user said more than its words: it goes. */
41
+ heard(text: string): void;
42
+ /** The user is done with `said`: the draft on these words, to keep; another goes. */
43
+ take(said: string): CallDraft | undefined;
44
+ drop(): void;
45
+ }
@@ -0,0 +1,91 @@
1
+ import { RETRY_MS, SILENT_MS } from './call-turn-end.js';
2
+ /**
3
+ * A call the voice service's own model answers (docs/design/ta-voice.md 8): it hears the user, thinks, speaks and
4
+ * reaches the work by its tools; the call shows what goes on, the user's voice always cuts in, and a call nobody spoke
5
+ * in for `silentMs` ends.
6
+ */
7
+ export class CallConversing {
8
+ constructor(call, silentMs = SILENT_MS) {
9
+ this.call = call;
10
+ this.silentMs = silentMs;
11
+ this.spoke = 0;
12
+ }
13
+ /** What the voice tells of the call; `live` while it is the call going on. */
14
+ talk(live) {
15
+ const { call } = this;
16
+ this.stop();
17
+ this.spoke = Date.now();
18
+ call.set({ phase: 'listening', heard: '', bargeIn: true });
19
+ this.timer = setInterval(() => {
20
+ if (live() && !call.state.paused && Date.now() - this.spoke >= this.silentMs) {
21
+ call.end('silent');
22
+ }
23
+ }, RETRY_MS * 5);
24
+ const spoke = () => {
25
+ this.spoke = Date.now();
26
+ return true;
27
+ };
28
+ return {
29
+ heard: (text, final) => live() &&
30
+ text.trim() &&
31
+ spoke() &&
32
+ call.set(final
33
+ ? { phase: 'thinking', heard: '', said: text, reading: undefined }
34
+ : { phase: 'listening', heard: text, said: undefined, reading: undefined }),
35
+ replying: (text, paced) => live() && spoke() && call.set(paced ? { phase: 'speaking', heard: '' } : { phase: 'speaking', heard: '', reading: { pieces: [text], at: 0 } }),
36
+ reading: (pieces, at) => live() && call.set({ reading: { pieces, at } }),
37
+ replied: end => live() && spoke() && (end ? call.hangUp() : call.set({ phase: 'listening' })),
38
+ cut: () => live() && call.set({ phase: 'listening', heard: '' }),
39
+ lost: () => live() && call.lost(),
40
+ };
41
+ }
42
+ /** The page shows again: the silence counts from now. */
43
+ resumed() {
44
+ this.spoke = Date.now();
45
+ }
46
+ stop() {
47
+ clearInterval(this.timer);
48
+ this.timer = undefined;
49
+ }
50
+ }
51
+ /**
52
+ * The answer a partner began on what the user said so far (CallPartner.draft, docs/design/ta-call.md 10), and the
53
+ * partners whose drafts failed (an older Ta), which answer once the user is done only.
54
+ */
55
+ export class CallDrafts {
56
+ /** Begins one on `said`, unless one is on these words already or the partner cannot. */
57
+ begin(partner, said) {
58
+ var _a;
59
+ if (!(partner === null || partner === void 0 ? void 0 : partner.draft) || this.failed === partner || ((_a = this.drafted) === null || _a === void 0 ? void 0 : _a.text) === said) {
60
+ return;
61
+ }
62
+ this.drop();
63
+ const draft = partner.draft(said);
64
+ draft.reply.catch(() => {
65
+ this.failed = partner;
66
+ });
67
+ this.drafted = { text: said, draft };
68
+ }
69
+ /** The user said more than its words: it goes. */
70
+ heard(text) {
71
+ if (this.drafted && this.drafted.text !== text.trim()) {
72
+ this.drop();
73
+ }
74
+ }
75
+ /** The user is done with `said`: the draft on these words, to keep; another goes. */
76
+ take(said) {
77
+ const drafted = this.drafted;
78
+ this.drafted = undefined;
79
+ if ((drafted === null || drafted === void 0 ? void 0 : drafted.text) === said) {
80
+ return drafted.draft;
81
+ }
82
+ drafted === null || drafted === void 0 ? void 0 : drafted.draft.drop();
83
+ return undefined;
84
+ }
85
+ drop() {
86
+ const drafted = this.drafted;
87
+ this.drafted = undefined;
88
+ drafted === null || drafted === void 0 ? void 0 : drafted.draft.drop();
89
+ }
90
+ }
91
+ //# sourceMappingURL=call-conversing.js.map
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import type { VoiceCall } from './voice-call.js';
3
+ import type { CallState } from './voice-call-protocol.js';
4
+ /**
5
+ * Ta's face in a call (docs/design/ta-call.md 11): a small window at a top corner of the conversation, as the other side
6
+ * of a video call is. Drawn here on the device from what plays, nothing of video goes over the connection: its mouth
7
+ * moves by the sound of Ta's voice, it nods to the user's words, listens, thinks and dozes as the call does. Dragged, it
8
+ * keeps to the nearer side; tapped while Ta speaks, Ta stops for the user.
9
+ */
10
+ export declare function CallFace({ state, call }: {
11
+ state: CallState;
12
+ call: VoiceCall;
13
+ }): React.JSX.Element | null;
@@ -0,0 +1,81 @@
1
+ import * as React from 'react';
2
+ import { DinoFace } from '../components/ta-avatar.js';
3
+ import { useSettings } from '../hooks.js';
4
+ import { useT } from '../i18n/use-t.js';
5
+ import { CallScreen } from './call-screen.js';
6
+ /** How far a finger or the mouse moves before the window of the face is dragged rather than tapped, in pixels. */
7
+ const DRAG_PX = 6;
8
+ /** The side of the conversation the face of a call keeps to, as the user last dragged it: the same in every call. */
9
+ let side = 'right';
10
+ /**
11
+ * Ta's face in a call (docs/design/ta-call.md 11): a small window at a top corner of the conversation, as the other side
12
+ * of a video call is. Drawn here on the device from what plays, nothing of video goes over the connection: its mouth
13
+ * moves by the sound of Ta's voice, it nods to the user's words, listens, thinks and dozes as the call does. Dragged, it
14
+ * keeps to the nearer side; tapped while Ta speaks, Ta stops for the user.
15
+ */
16
+ export function CallFace({ state, call }) {
17
+ const t = useT();
18
+ const [{ settings }] = useSettings();
19
+ const [at, setAt] = React.useState(side);
20
+ const [drag, setDrag] = React.useState(undefined);
21
+ const start = React.useRef(undefined);
22
+ const box = React.useRef(null);
23
+ // The user's words as they come: each change may be a nod.
24
+ const nods = state.phase === 'listening' ? state.heard.length : 0;
25
+ const talk = React.useMemo(() => ({ level: () => call.level(), nods }), [call, nods]);
26
+ if (!state.active || state.video || !settings.callFace) {
27
+ return null;
28
+ }
29
+ const mood = CallScreen.mood(state);
30
+ const cut = !state.paused && state.phase === 'speaking';
31
+ const label = CallScreen.phase(t, { phase: state.phase, paused: state.paused, heard: !!state.heard.trim() });
32
+ const down = (event) => {
33
+ var _a, _b;
34
+ start.current = { x: event.clientX, id: event.pointerId, moved: false };
35
+ // Its moves are its own until it is let go, though the pointer leaves it as it drags.
36
+ (_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
37
+ };
38
+ const move = (event) => {
39
+ const begun = start.current;
40
+ if (!begun || begun.id !== event.pointerId) {
41
+ return;
42
+ }
43
+ const dx = event.clientX - begun.x;
44
+ if (!begun.moved && Math.abs(dx) < DRAG_PX) {
45
+ return;
46
+ }
47
+ begun.moved = true;
48
+ setDrag(dx);
49
+ };
50
+ const up = (event) => {
51
+ const begun = start.current;
52
+ start.current = undefined;
53
+ if (!begun || begun.id !== event.pointerId) {
54
+ return;
55
+ }
56
+ if (!begun.moved) {
57
+ if (cut) {
58
+ call.interrupt();
59
+ }
60
+ return;
61
+ }
62
+ // It goes to the side its middle is nearer.
63
+ const element = box.current;
64
+ const parent = element === null || element === void 0 ? void 0 : element.offsetParent;
65
+ if (element && parent) {
66
+ const rect = element.getBoundingClientRect();
67
+ const room = parent.getBoundingClientRect();
68
+ const next = rect.left + rect.width / 2 < room.left + room.width / 2 ? 'left' : 'right';
69
+ side = next;
70
+ setAt(next);
71
+ }
72
+ setDrag(undefined);
73
+ };
74
+ return (React.createElement("div", { ref: box, className: `ta-call-face ta-call-face-${at}${drag === undefined ? '' : ' ta-dragging'}`, style: drag === undefined ? undefined : { transform: `translate3d(${drag}px, 0, 0)` }, role: "img", "aria-label": label, title: cut ? t('ta.call.interrupt') : label, onPointerDown: down, onPointerMove: move, onPointerUp: up, onPointerCancel: () => {
75
+ start.current = undefined;
76
+ setDrag(undefined);
77
+ } },
78
+ React.createElement(DinoFace, { mood: mood, size: 160, talk: talk, fill: true, className: "ta-call-face-dino" }),
79
+ React.createElement("span", { className: "ta-call-face-phase" }, label)));
80
+ }
81
+ //# sourceMappingURL=call-face.js.map
@@ -14,6 +14,8 @@ export interface CallSpot {
14
14
  sessionId: string;
15
15
  double?: boolean;
16
16
  title: string;
17
+ /** A video call: called again as one. */
18
+ video?: boolean;
17
19
  }
18
20
  /** The call going on, noted as it changes: the page that loads again (the app restarted) calls again. */
19
21
  export interface NotedCall extends CallSpot {
@@ -82,10 +84,10 @@ export interface TaCallKeeper {
82
84
  */
83
85
  readonly resuming: CallSpot | undefined;
84
86
  /**
85
- * The view of a conversation showed: whether to call it again, as its call went on as the page went away; asked
86
- * once. The double's is called again by whichever conversation is the double's now.
87
+ * The view of a conversation showed: the call to make again (a video call as one), as its call went on as the page
88
+ * went away; undefined when none. Asked once. The double's is called again by whichever conversation is the double's now.
87
89
  */
88
- resume(sessionId: string, double?: boolean): boolean;
90
+ resume(sessionId: string, double?: boolean): CallSpot | undefined;
89
91
  hangUp(): void;
90
92
  /**
91
93
  * The call going on in another page of the user (on their phone, another computer), as it says of itself
@@ -123,11 +125,13 @@ export declare class TaCallKeeperImpl implements TaCallKeeper {
123
125
  keep(call: KeptCall): void;
124
126
  take(sessionId: string): HeldCall | undefined;
125
127
  get resuming(): CallSpot | undefined;
126
- resume(sessionId: string, double?: boolean): boolean;
128
+ resume(sessionId: string, double?: boolean): CallSpot | undefined;
127
129
  hangUp(): void;
128
130
  subscribe(listener: () => void): () => void;
129
131
  /** The call going on now: the one before, of another conversation, hangs up. */
130
132
  protected watch(call: KeptCall): void;
133
+ /** Notes the call going on now, as it is. */
134
+ protected noteKept(): void;
131
135
  /** Notes the call going on, for the page that loads next (resuming); undefined once it is over. */
132
136
  protected note(spot: CallSpot | undefined): void;
133
137
  /** Tells the user's other pages how the call going on is: as it changes, and every SHARE_MS. */