@celljs/ta-web 4.15.2 → 4.17.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 (601) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-ask-book.d.ts +35 -0
  4. package/esm/browser/assistant/assistant-ask-book.js +96 -0
  5. package/esm/browser/assistant/assistant-conversation.d.ts +110 -0
  6. package/esm/browser/assistant/assistant-conversation.js +351 -0
  7. package/esm/browser/assistant/assistant-export.js +6 -7
  8. package/esm/browser/assistant/assistant-extension.d.ts +3 -2
  9. package/esm/browser/assistant/assistant-extension.js +57 -4
  10. package/esm/browser/assistant/assistant-protocol.d.ts +17 -2
  11. package/esm/browser/assistant/assistant-role.d.ts +22 -4
  12. package/esm/browser/assistant/assistant-role.js +29 -7
  13. package/esm/browser/assistant/assistant-state.d.ts +5 -1
  14. package/esm/browser/assistant/assistant-state.js +11 -0
  15. package/esm/browser/assistant/assistant-task-source.js +7 -1
  16. package/esm/browser/assistant/assistant-task-util.d.ts +19 -7
  17. package/esm/browser/assistant/assistant-task-util.js +73 -20
  18. package/esm/browser/assistant/assistant-tasks.d.ts +0 -7
  19. package/esm/browser/assistant/assistant-tasks.js +0 -2
  20. package/esm/browser/assistant/assistant-thread.d.ts +22 -0
  21. package/esm/browser/assistant/assistant-thread.js +108 -0
  22. package/esm/browser/assistant/assistant-view.js +77 -126
  23. package/esm/browser/assistant/assistant.d.ts +33 -105
  24. package/esm/browser/assistant/assistant.js +103 -356
  25. package/esm/browser/assistant/chat-task-source.d.ts +58 -0
  26. package/esm/browser/assistant/chat-task-source.js +107 -0
  27. package/esm/browser/assistant/read-aloud.d.ts +34 -0
  28. package/esm/browser/assistant/read-aloud.js +98 -0
  29. package/esm/browser/assistant/realtime-voice.d.ts +77 -0
  30. package/esm/browser/assistant/realtime-voice.js +320 -0
  31. package/esm/browser/assistant/task-views.d.ts +2 -3
  32. package/esm/browser/assistant/task-views.js +20 -16
  33. package/esm/browser/assistant/voice-call-bar.d.ts +60 -0
  34. package/esm/browser/assistant/voice-call-bar.js +260 -0
  35. package/esm/browser/assistant/voice-call.d.ts +175 -0
  36. package/esm/browser/assistant/voice-call.js +366 -0
  37. package/esm/browser/chat/chat-shown.d.ts +78 -0
  38. package/esm/browser/chat/chat-shown.js +262 -0
  39. package/esm/browser/chat/chat-view.js +2 -1
  40. package/esm/browser/chat/chat.d.ts +4 -68
  41. package/esm/browser/chat/chat.js +5 -253
  42. package/esm/browser/chat/draft-model.d.ts +1 -1
  43. package/esm/browser/components/access-view.js +1 -1
  44. package/esm/browser/components/account-menu.js +1 -1
  45. package/esm/browser/components/app-nav.d.ts +3 -1
  46. package/esm/browser/components/app-nav.js +7 -7
  47. package/esm/browser/components/app-shell-hooks.d.ts +11 -2
  48. package/esm/browser/components/app-shell-hooks.js +25 -4
  49. package/esm/browser/components/app-shell-state.d.ts +80 -0
  50. package/esm/browser/components/app-shell-state.js +466 -0
  51. package/esm/browser/components/app-view.js +128 -334
  52. package/esm/browser/components/asks-badge.d.ts +6 -2
  53. package/esm/browser/components/asks-badge.js +7 -3
  54. package/esm/browser/components/auth-pictures.d.ts +2 -2
  55. package/esm/browser/components/auth-pictures.js +13 -1
  56. package/esm/browser/components/auth-view.d.ts +4 -3
  57. package/esm/browser/components/auth-view.js +54 -5
  58. package/esm/browser/components/chat-asks.d.ts +2 -0
  59. package/esm/browser/components/chat-asks.js +8 -0
  60. package/esm/browser/components/chat-busy.d.ts +32 -0
  61. package/esm/browser/components/chat-busy.js +49 -0
  62. package/esm/browser/components/chat-icon.d.ts +6 -0
  63. package/esm/browser/components/chat-icon.js +17 -1
  64. package/esm/browser/components/chat-list-row.d.ts +84 -0
  65. package/esm/browser/components/chat-list-row.js +198 -0
  66. package/esm/browser/components/chat-list-util.d.ts +166 -0
  67. package/esm/browser/components/chat-list-util.js +335 -0
  68. package/esm/browser/components/chat-list.d.ts +11 -148
  69. package/esm/browser/components/chat-list.js +280 -511
  70. package/esm/browser/components/chat-seen.d.ts +7 -0
  71. package/esm/browser/components/chat-seen.js +58 -10
  72. package/esm/browser/components/composer-addon-util.d.ts +1 -1
  73. package/esm/browser/components/composer-addons.d.ts +1 -1
  74. package/esm/browser/components/composer-attachments.d.ts +11 -0
  75. package/esm/browser/components/composer-attachments.js +27 -0
  76. package/esm/browser/components/composer-box-hooks.d.ts +9 -0
  77. package/esm/browser/components/composer-box-hooks.js +138 -0
  78. package/esm/browser/components/composer-box-protocol.d.ts +108 -0
  79. package/esm/browser/components/composer-box-protocol.js +2 -0
  80. package/esm/browser/components/composer-box.d.ts +1 -95
  81. package/esm/browser/components/composer-box.js +49 -156
  82. package/esm/browser/components/composer-target.d.ts +21 -0
  83. package/esm/browser/components/composer-target.js +43 -0
  84. package/esm/browser/components/composer.d.ts +7 -1
  85. package/esm/browser/components/composer.js +13 -9
  86. package/esm/browser/components/context-menu.js +4 -0
  87. package/esm/browser/components/conversation-find.d.ts +27 -0
  88. package/esm/browser/components/conversation-find.js +151 -0
  89. package/esm/browser/components/conversation-scroll-hooks.js +2 -1
  90. package/esm/browser/components/conversation-scroll-util.d.ts +73 -0
  91. package/esm/browser/components/conversation-scroll-util.js +80 -0
  92. package/esm/browser/components/conversation-scroll.d.ts +1 -35
  93. package/esm/browser/components/conversation-scroll.js +2 -81
  94. package/esm/browser/components/conversation-view.d.ts +8 -0
  95. package/esm/browser/components/conversation-view.js +41 -0
  96. package/esm/browser/components/discover-view.d.ts +3 -2
  97. package/esm/browser/components/discover-view.js +31 -26
  98. package/esm/browser/components/dismiss.js +2 -0
  99. package/esm/browser/components/earlier-messages.d.ts +2 -0
  100. package/esm/browser/components/earlier-messages.js +2 -1
  101. package/esm/browser/components/environment-view.js +50 -1
  102. package/esm/browser/components/folder-picker.d.ts +7 -0
  103. package/esm/browser/components/folder-picker.js +90 -20
  104. package/esm/browser/components/gallery.d.ts +1 -1
  105. package/esm/browser/components/gallery.js +57 -14
  106. package/esm/browser/components/host-tag.js +2 -2
  107. package/esm/browser/components/host-view.d.ts +1 -1
  108. package/esm/browser/components/host-view.js +3 -1
  109. package/esm/browser/components/image-menu.d.ts +11 -0
  110. package/esm/browser/components/image-menu.js +29 -0
  111. package/esm/browser/components/image-viewer.d.ts +3 -2
  112. package/esm/browser/components/image-viewer.js +29 -4
  113. package/esm/browser/components/lightbox.js +2 -0
  114. package/esm/browser/components/link-dialog.js +2 -0
  115. package/esm/browser/components/list-rows.d.ts +3 -1
  116. package/esm/browser/components/list-rows.js +2 -1
  117. package/esm/browser/components/markdown.js +5 -0
  118. package/esm/browser/components/media.d.ts +2 -0
  119. package/esm/browser/components/media.js +16 -1
  120. package/esm/browser/components/message-actions.d.ts +1 -1
  121. package/esm/browser/components/message-actions.js +9 -0
  122. package/esm/browser/components/message-footer.d.ts +3 -1
  123. package/esm/browser/components/message-footer.js +3 -2
  124. package/esm/browser/components/message-images.d.ts +41 -0
  125. package/esm/browser/components/message-images.js +120 -0
  126. package/esm/browser/components/message-list.d.ts +4 -100
  127. package/esm/browser/components/message-list.js +10 -447
  128. package/esm/browser/components/message-menu.js +4 -0
  129. package/esm/browser/components/message-steps.d.ts +21 -0
  130. package/esm/browser/components/message-steps.js +182 -0
  131. package/esm/browser/components/message-user.d.ts +54 -0
  132. package/esm/browser/components/message-user.js +169 -0
  133. package/esm/browser/components/model-picker.d.ts +1 -1
  134. package/esm/browser/components/model-picker.js +2 -0
  135. package/esm/browser/components/moved-notice.d.ts +14 -0
  136. package/esm/browser/components/moved-notice.js +60 -0
  137. package/esm/browser/components/nav-places.d.ts +12 -1
  138. package/esm/browser/components/nav-places.js +10 -2
  139. package/esm/browser/components/notice-center.js +36 -1
  140. package/esm/browser/components/notice-face.js +2 -1
  141. package/esm/browser/components/phone-shell.d.ts +4 -3
  142. package/esm/browser/components/phone-shell.js +60 -68
  143. package/esm/browser/components/plus-menu.d.ts +1 -1
  144. package/esm/browser/components/relay-services.d.ts +6 -1
  145. package/esm/browser/components/relay-services.js +109 -2
  146. package/esm/browser/components/relay-view.js +2 -0
  147. package/esm/browser/components/remote-hosts.d.ts +10 -0
  148. package/esm/browser/components/remote-hosts.js +67 -5
  149. package/esm/browser/components/remote-prompts.js +2 -0
  150. package/esm/browser/components/scan-screen.js +7 -0
  151. package/esm/browser/components/screen-navigator-util.d.ts +28 -0
  152. package/esm/browser/components/screen-navigator-util.js +33 -0
  153. package/esm/browser/components/screen-navigator.d.ts +30 -0
  154. package/esm/browser/components/screen-navigator.js +47 -0
  155. package/esm/browser/components/session-settings.d.ts +1 -1
  156. package/esm/browser/components/session-view.js +157 -7
  157. package/esm/browser/components/settings-choices.d.ts +6 -0
  158. package/esm/browser/components/settings-choices.js +8 -0
  159. package/esm/browser/components/settings-more.d.ts +7 -0
  160. package/esm/browser/components/settings-more.js +263 -0
  161. package/esm/browser/components/settings-parts.d.ts +8 -3
  162. package/esm/browser/components/settings-parts.js +31 -249
  163. package/esm/browser/components/settings-view.js +43 -15
  164. package/esm/browser/components/stop-times.js +1 -0
  165. package/esm/browser/components/surface-flyout.js +2 -0
  166. package/esm/browser/components/unseen-drop.d.ts +10 -4
  167. package/esm/browser/components/unseen-drop.js +9 -8
  168. package/esm/browser/components/use-seen-chats.js +1 -1
  169. package/esm/browser/components/voice-services.d.ts +6 -0
  170. package/esm/browser/components/voice-services.js +137 -0
  171. package/esm/browser/components/voice-talk.d.ts +23 -6
  172. package/esm/browser/components/voice-talk.js +46 -11
  173. package/esm/browser/components/web-composer.d.ts +1 -1
  174. package/esm/browser/components/web-composer.js +2 -2
  175. package/esm/browser/components/web-dialog.js +2 -0
  176. package/esm/browser/device/back-stack.d.ts +89 -11
  177. package/esm/browser/device/back-stack.js +200 -29
  178. package/esm/browser/device/device-protocol.d.ts +1 -1
  179. package/esm/browser/device/device-protocol.js +1 -1
  180. package/esm/browser/device/own-gestures.d.ts +1 -1
  181. package/esm/browser/device/pull-down.js +3 -1
  182. package/esm/browser/device/row-swipe.js +3 -1
  183. package/esm/browser/device/sheet-swipe.d.ts +1 -179
  184. package/esm/browser/device/sheet-swipe.js +3 -433
  185. package/esm/browser/device/swipe-finger.d.ts +31 -0
  186. package/esm/browser/device/swipe-finger.js +83 -0
  187. package/esm/browser/device/swipe-settle.d.ts +52 -0
  188. package/esm/browser/device/swipe-settle.js +170 -0
  189. package/esm/browser/device/swipe-util.d.ts +97 -0
  190. package/esm/browser/device/swipe-util.js +183 -0
  191. package/esm/browser/drafts/drafts-protocol.d.ts +58 -0
  192. package/esm/browser/drafts/drafts-protocol.js +75 -0
  193. package/esm/browser/drafts/drafts.d.ts +21 -0
  194. package/esm/browser/drafts/drafts.js +91 -0
  195. package/esm/browser/drafts/use-composer-draft.d.ts +20 -0
  196. package/esm/browser/drafts/use-composer-draft.js +108 -0
  197. package/esm/browser/extension/icons.js +25 -4
  198. package/esm/browser/extension/web-api-components.d.ts +13 -0
  199. package/esm/browser/extension/web-api-contributions.d.ts +125 -0
  200. package/esm/browser/extension/web-extension-api.d.ts +88 -5
  201. package/esm/browser/extension/web-extension-context.d.ts +5 -0
  202. package/esm/browser/extension/web-extension-context.js +60 -7
  203. package/esm/browser/extension/web-extension-protocol.d.ts +19 -1
  204. package/esm/browser/extension/web-extension-protocol.js +3 -0
  205. package/esm/browser/extension/web-extension-run.d.ts +5 -2
  206. package/esm/browser/extension/web-extension-run.js +13 -1
  207. package/esm/browser/extension/web-extensions-running.d.ts +93 -0
  208. package/esm/browser/extension/web-extensions-running.js +339 -0
  209. package/esm/browser/extension/web-extensions.d.ts +6 -82
  210. package/esm/browser/extension/web-extensions.js +10 -319
  211. package/esm/browser/extension/web-pages.js +1 -0
  212. package/esm/browser/extension/web-session-notices.js +6 -1
  213. package/esm/browser/extension/web-tasks.d.ts +2 -0
  214. package/esm/browser/extension/web-tasks.js +6 -0
  215. package/esm/browser/extension/web-view-util.d.ts +2 -1
  216. package/esm/browser/extension/web-view-util.js +4 -1
  217. package/esm/browser/gateway/console-parts.d.ts +4 -12
  218. package/esm/browser/gateway/console-parts.js +42 -125
  219. package/esm/browser/gateway/console-tenant.js +3 -2
  220. package/esm/browser/gateway/console-trend.d.ts +11 -0
  221. package/esm/browser/gateway/console-trend.js +115 -0
  222. package/esm/browser/gateway/console-util.js +2 -2
  223. package/esm/browser/gateway/console-view.js +49 -3
  224. package/esm/browser/i18n/locales.d.ts +170 -6
  225. package/esm/browser/i18n/messages-ja.js +171 -7
  226. package/esm/browser/i18n/messages-zh-tw.js +171 -7
  227. package/esm/browser/i18n/messages.d.ts +167 -3
  228. package/esm/browser/i18n/messages.js +342 -14
  229. package/esm/browser/index.d.ts +17 -0
  230. package/esm/browser/index.js +17 -0
  231. package/esm/browser/notices/notices-protocol.d.ts +12 -0
  232. package/esm/browser/notices/notices.js +7 -4
  233. package/esm/browser/offline/device-values.d.ts +2 -0
  234. package/esm/browser/offline/device-values.js +6 -1
  235. package/esm/browser/screen/page-answers.d.ts +42 -0
  236. package/esm/browser/screen/page-answers.js +89 -0
  237. package/esm/browser/screen/screen-protocol.d.ts +112 -0
  238. package/esm/browser/screen/screen-protocol.js +45 -0
  239. package/esm/browser/screen/screen.d.ts +20 -0
  240. package/esm/browser/screen/screen.js +122 -0
  241. package/esm/browser/screen/use-screen-part.d.ts +6 -0
  242. package/esm/browser/screen/use-screen-part.js +14 -0
  243. package/esm/browser/settings/settings-protocol.d.ts +5 -1
  244. package/esm/browser/settings/settings-protocol.js +6 -2
  245. package/esm/browser/share/shared-extensions.d.ts +29 -0
  246. package/esm/browser/share/shared-extensions.js +145 -0
  247. package/esm/browser/share/shared-link.d.ts +11 -0
  248. package/esm/browser/share/shared-link.js +38 -0
  249. package/esm/browser/share/shared-page.d.ts +5 -0
  250. package/esm/browser/share/shared-page.js +137 -0
  251. package/esm/browser/state/state-protocol.d.ts +14 -0
  252. package/esm/browser/state/state-protocol.js +18 -0
  253. package/esm/browser/state/state.d.ts +10 -2
  254. package/esm/browser/state/state.js +19 -3
  255. package/esm/browser/style/base.d.ts +1 -1
  256. package/esm/browser/style/base.js +4 -0
  257. package/esm/browser/style/chat-list.d.ts +2 -0
  258. package/esm/browser/style/chat-list.js +153 -0
  259. package/esm/browser/style/conversation-column.d.ts +2 -0
  260. package/esm/browser/style/conversation-column.js +250 -0
  261. package/esm/browser/style/conversation.d.ts +1 -1
  262. package/esm/browser/style/conversation.js +24 -8
  263. package/esm/browser/style/dialogs.d.ts +2 -0
  264. package/esm/browser/style/dialogs.js +163 -0
  265. package/esm/browser/style/layout.d.ts +2 -2
  266. package/esm/browser/style/layout.js +1 -525
  267. package/esm/browser/style/pages.d.ts +1 -1
  268. package/esm/browser/style/pages.js +10 -3
  269. package/esm/browser/style/phone.d.ts +1 -1
  270. package/esm/browser/style/phone.js +6 -2
  271. package/esm/browser/style/shared.d.ts +2 -0
  272. package/esm/browser/style/shared.js +23 -0
  273. package/esm/browser/style/shell.d.ts +1 -1
  274. package/esm/browser/style/shell.js +47 -0
  275. package/esm/browser/style/tasks.d.ts +1 -1
  276. package/esm/browser/style/tasks.js +13 -8
  277. package/esm/browser/style.js +8 -0
  278. package/esm/browser/util/gallery.d.ts +24 -2
  279. package/esm/browser/util/gallery.js +82 -2
  280. package/esm/browser/util/image-copy.d.ts +16 -0
  281. package/esm/browser/util/image-copy.js +57 -0
  282. package/esm/browser/util/message.d.ts +5 -0
  283. package/esm/browser/util/message.js +14 -0
  284. package/esm/browser/util/process.d.ts +6 -2
  285. package/esm/browser/util/process.js +6 -2
  286. package/esm/browser/util/spoken.d.ts +24 -0
  287. package/esm/browser/util/spoken.js +83 -0
  288. package/esm/browser/util/transcript.d.ts +22 -0
  289. package/esm/browser/util/transcript.js +46 -0
  290. package/esm/browser/util/voice.d.ts +5 -1
  291. package/esm/browser/util/voice.js +6 -1
  292. package/esm/browser/workbench-hosts.d.ts +36 -0
  293. package/esm/browser/workbench-hosts.js +120 -0
  294. package/esm/browser/workbench-lists.d.ts +33 -0
  295. package/esm/browser/workbench-lists.js +128 -0
  296. package/esm/browser/workbench-protocol.d.ts +14 -1
  297. package/esm/browser/workbench-services.d.ts +49 -0
  298. package/esm/browser/workbench-services.js +120 -0
  299. package/esm/browser/workbench-util.d.ts +1 -1
  300. package/esm/browser/workbench.d.ts +6 -89
  301. package/esm/browser/workbench.js +26 -336
  302. package/lib/browser/assistant/assistant-ask-book.d.ts +36 -0
  303. package/lib/browser/assistant/assistant-ask-book.js +100 -0
  304. package/lib/browser/assistant/assistant-conversation.d.ts +111 -0
  305. package/lib/browser/assistant/assistant-conversation.js +355 -0
  306. package/lib/browser/assistant/assistant-export.js +6 -7
  307. package/lib/browser/assistant/assistant-extension.d.ts +3 -2
  308. package/lib/browser/assistant/assistant-extension.js +55 -2
  309. package/lib/browser/assistant/assistant-protocol.d.ts +17 -2
  310. package/lib/browser/assistant/assistant-role.d.ts +22 -4
  311. package/lib/browser/assistant/assistant-role.js +30 -8
  312. package/lib/browser/assistant/assistant-state.d.ts +5 -1
  313. package/lib/browser/assistant/assistant-state.js +11 -0
  314. package/lib/browser/assistant/assistant-task-source.js +7 -1
  315. package/lib/browser/assistant/assistant-task-util.d.ts +19 -7
  316. package/lib/browser/assistant/assistant-task-util.js +73 -20
  317. package/lib/browser/assistant/assistant-tasks.d.ts +0 -7
  318. package/lib/browser/assistant/assistant-tasks.js +1 -3
  319. package/lib/browser/assistant/assistant-thread.d.ts +23 -0
  320. package/lib/browser/assistant/assistant-thread.js +144 -0
  321. package/lib/browser/assistant/assistant-view.js +74 -123
  322. package/lib/browser/assistant/assistant.d.ts +33 -105
  323. package/lib/browser/assistant/assistant.js +100 -353
  324. package/lib/browser/assistant/chat-task-source.d.ts +59 -0
  325. package/lib/browser/assistant/chat-task-source.js +111 -0
  326. package/lib/browser/assistant/read-aloud.d.ts +35 -0
  327. package/lib/browser/assistant/read-aloud.js +102 -0
  328. package/lib/browser/assistant/realtime-voice.d.ts +78 -0
  329. package/lib/browser/assistant/realtime-voice.js +324 -0
  330. package/lib/browser/assistant/task-views.d.ts +2 -3
  331. package/lib/browser/assistant/task-views.js +19 -15
  332. package/lib/browser/assistant/voice-call-bar.d.ts +61 -0
  333. package/lib/browser/assistant/voice-call-bar.js +306 -0
  334. package/lib/browser/assistant/voice-call.d.ts +176 -0
  335. package/lib/browser/assistant/voice-call.js +370 -0
  336. package/lib/browser/chat/chat-shown.d.ts +79 -0
  337. package/lib/browser/chat/chat-shown.js +266 -0
  338. package/lib/browser/chat/chat-view.js +2 -1
  339. package/lib/browser/chat/chat.d.ts +4 -68
  340. package/lib/browser/chat/chat.js +3 -251
  341. package/lib/browser/chat/draft-model.d.ts +1 -1
  342. package/lib/browser/components/access-view.js +2 -2
  343. package/lib/browser/components/account-menu.js +1 -1
  344. package/lib/browser/components/app-nav.d.ts +3 -1
  345. package/lib/browser/components/app-nav.js +7 -7
  346. package/lib/browser/components/app-shell-hooks.d.ts +11 -2
  347. package/lib/browser/components/app-shell-hooks.js +26 -5
  348. package/lib/browser/components/app-shell-state.d.ts +81 -0
  349. package/lib/browser/components/app-shell-state.js +502 -0
  350. package/lib/browser/components/app-view.js +120 -326
  351. package/lib/browser/components/asks-badge.d.ts +6 -2
  352. package/lib/browser/components/asks-badge.js +7 -3
  353. package/lib/browser/components/auth-pictures.d.ts +2 -2
  354. package/lib/browser/components/auth-pictures.js +13 -1
  355. package/lib/browser/components/auth-view.d.ts +4 -3
  356. package/lib/browser/components/auth-view.js +53 -4
  357. package/lib/browser/components/chat-asks.d.ts +2 -0
  358. package/lib/browser/components/chat-asks.js +8 -0
  359. package/lib/browser/components/chat-busy.d.ts +33 -0
  360. package/lib/browser/components/chat-busy.js +52 -0
  361. package/lib/browser/components/chat-icon.d.ts +6 -0
  362. package/lib/browser/components/chat-icon.js +17 -1
  363. package/lib/browser/components/chat-list-row.d.ts +85 -0
  364. package/lib/browser/components/chat-list-row.js +236 -0
  365. package/lib/browser/components/chat-list-util.d.ts +167 -0
  366. package/lib/browser/components/chat-list-util.js +338 -0
  367. package/lib/browser/components/chat-list.d.ts +11 -148
  368. package/lib/browser/components/chat-list.js +297 -530
  369. package/lib/browser/components/chat-seen.d.ts +7 -0
  370. package/lib/browser/components/chat-seen.js +58 -10
  371. package/lib/browser/components/composer-addon-util.d.ts +1 -1
  372. package/lib/browser/components/composer-addons.d.ts +1 -1
  373. package/lib/browser/components/composer-attachments.d.ts +12 -0
  374. package/lib/browser/components/composer-attachments.js +64 -0
  375. package/lib/browser/components/composer-box-hooks.d.ts +10 -0
  376. package/lib/browser/components/composer-box-hooks.js +178 -0
  377. package/lib/browser/components/composer-box-protocol.d.ts +109 -0
  378. package/lib/browser/components/composer-box-protocol.js +3 -0
  379. package/lib/browser/components/composer-box.d.ts +1 -95
  380. package/lib/browser/components/composer-box.js +51 -159
  381. package/lib/browser/components/composer-target.d.ts +22 -0
  382. package/lib/browser/components/composer-target.js +46 -0
  383. package/lib/browser/components/composer.d.ts +7 -1
  384. package/lib/browser/components/composer.js +15 -11
  385. package/lib/browser/components/context-menu.js +4 -0
  386. package/lib/browser/components/conversation-find.d.ts +28 -0
  387. package/lib/browser/components/conversation-find.js +188 -0
  388. package/lib/browser/components/conversation-scroll-hooks.js +3 -2
  389. package/lib/browser/components/conversation-scroll-util.d.ts +73 -0
  390. package/lib/browser/components/conversation-scroll-util.js +85 -1
  391. package/lib/browser/components/conversation-scroll.d.ts +1 -35
  392. package/lib/browser/components/conversation-scroll.js +20 -100
  393. package/lib/browser/components/conversation-view.d.ts +9 -0
  394. package/lib/browser/components/conversation-view.js +77 -0
  395. package/lib/browser/components/discover-view.d.ts +3 -2
  396. package/lib/browser/components/discover-view.js +30 -25
  397. package/lib/browser/components/dismiss.js +2 -0
  398. package/lib/browser/components/earlier-messages.d.ts +2 -0
  399. package/lib/browser/components/earlier-messages.js +2 -1
  400. package/lib/browser/components/environment-view.js +49 -0
  401. package/lib/browser/components/folder-picker.d.ts +7 -0
  402. package/lib/browser/components/folder-picker.js +89 -19
  403. package/lib/browser/components/gallery.d.ts +1 -1
  404. package/lib/browser/components/gallery.js +56 -13
  405. package/lib/browser/components/host-tag.js +1 -1
  406. package/lib/browser/components/host-view.d.ts +1 -1
  407. package/lib/browser/components/host-view.js +4 -2
  408. package/lib/browser/components/image-menu.d.ts +12 -0
  409. package/lib/browser/components/image-menu.js +65 -0
  410. package/lib/browser/components/image-viewer.d.ts +3 -2
  411. package/lib/browser/components/image-viewer.js +28 -3
  412. package/lib/browser/components/lightbox.js +2 -0
  413. package/lib/browser/components/link-dialog.js +2 -0
  414. package/lib/browser/components/list-rows.d.ts +3 -1
  415. package/lib/browser/components/list-rows.js +2 -1
  416. package/lib/browser/components/markdown.js +5 -0
  417. package/lib/browser/components/media.d.ts +2 -0
  418. package/lib/browser/components/media.js +17 -1
  419. package/lib/browser/components/message-actions.d.ts +1 -1
  420. package/lib/browser/components/message-actions.js +9 -0
  421. package/lib/browser/components/message-footer.d.ts +3 -1
  422. package/lib/browser/components/message-footer.js +2 -1
  423. package/lib/browser/components/message-images.d.ts +42 -0
  424. package/lib/browser/components/message-images.js +157 -0
  425. package/lib/browser/components/message-list.d.ts +4 -100
  426. package/lib/browser/components/message-list.js +11 -455
  427. package/lib/browser/components/message-menu.js +4 -0
  428. package/lib/browser/components/message-steps.d.ts +22 -0
  429. package/lib/browser/components/message-steps.js +218 -0
  430. package/lib/browser/components/message-user.d.ts +55 -0
  431. package/lib/browser/components/message-user.js +211 -0
  432. package/lib/browser/components/model-picker.d.ts +1 -1
  433. package/lib/browser/components/model-picker.js +2 -0
  434. package/lib/browser/components/moved-notice.d.ts +15 -0
  435. package/lib/browser/components/moved-notice.js +96 -0
  436. package/lib/browser/components/nav-places.d.ts +12 -1
  437. package/lib/browser/components/nav-places.js +12 -3
  438. package/lib/browser/components/notice-center.js +35 -0
  439. package/lib/browser/components/notice-face.js +7 -6
  440. package/lib/browser/components/phone-shell.d.ts +4 -3
  441. package/lib/browser/components/phone-shell.js +59 -67
  442. package/lib/browser/components/plus-menu.d.ts +1 -1
  443. package/lib/browser/components/relay-services.d.ts +6 -1
  444. package/lib/browser/components/relay-services.js +107 -0
  445. package/lib/browser/components/relay-view.js +2 -0
  446. package/lib/browser/components/remote-hosts.d.ts +10 -0
  447. package/lib/browser/components/remote-hosts.js +67 -4
  448. package/lib/browser/components/remote-prompts.js +2 -0
  449. package/lib/browser/components/scan-screen.js +7 -0
  450. package/lib/browser/components/screen-navigator-util.d.ts +29 -0
  451. package/lib/browser/components/screen-navigator-util.js +36 -0
  452. package/lib/browser/components/screen-navigator.d.ts +31 -0
  453. package/lib/browser/components/screen-navigator.js +83 -0
  454. package/lib/browser/components/session-settings.d.ts +1 -1
  455. package/lib/browser/components/session-view.js +157 -7
  456. package/lib/browser/components/settings-choices.d.ts +7 -1
  457. package/lib/browser/components/settings-choices.js +9 -1
  458. package/lib/browser/components/settings-more.d.ts +8 -0
  459. package/lib/browser/components/settings-more.js +299 -0
  460. package/lib/browser/components/settings-parts.d.ts +8 -3
  461. package/lib/browser/components/settings-parts.js +27 -245
  462. package/lib/browser/components/settings-view.js +43 -15
  463. package/lib/browser/components/stop-times.js +1 -0
  464. package/lib/browser/components/surface-flyout.js +2 -0
  465. package/lib/browser/components/unseen-drop.d.ts +10 -4
  466. package/lib/browser/components/unseen-drop.js +9 -8
  467. package/lib/browser/components/use-seen-chats.js +2 -2
  468. package/lib/browser/components/voice-services.d.ts +7 -0
  469. package/lib/browser/components/voice-services.js +173 -0
  470. package/lib/browser/components/voice-talk.d.ts +23 -6
  471. package/lib/browser/components/voice-talk.js +45 -10
  472. package/lib/browser/components/web-composer.d.ts +1 -1
  473. package/lib/browser/components/web-composer.js +2 -2
  474. package/lib/browser/components/web-dialog.js +2 -0
  475. package/lib/browser/device/back-stack.d.ts +89 -11
  476. package/lib/browser/device/back-stack.js +205 -31
  477. package/lib/browser/device/device-protocol.d.ts +1 -1
  478. package/lib/browser/device/device-protocol.js +1 -1
  479. package/lib/browser/device/own-gestures.d.ts +1 -1
  480. package/lib/browser/device/pull-down.js +8 -6
  481. package/lib/browser/device/row-swipe.js +11 -9
  482. package/lib/browser/device/sheet-swipe.d.ts +1 -179
  483. package/lib/browser/device/sheet-swipe.js +16 -452
  484. package/lib/browser/device/swipe-finger.d.ts +32 -0
  485. package/lib/browser/device/swipe-finger.js +87 -0
  486. package/lib/browser/device/swipe-settle.d.ts +53 -0
  487. package/lib/browser/device/swipe-settle.js +176 -0
  488. package/lib/browser/device/swipe-util.d.ts +98 -0
  489. package/lib/browser/device/swipe-util.js +187 -0
  490. package/lib/browser/drafts/drafts-protocol.d.ts +59 -0
  491. package/lib/browser/drafts/drafts-protocol.js +78 -0
  492. package/lib/browser/drafts/drafts.d.ts +22 -0
  493. package/lib/browser/drafts/drafts.js +94 -0
  494. package/lib/browser/drafts/use-composer-draft.d.ts +21 -0
  495. package/lib/browser/drafts/use-composer-draft.js +146 -0
  496. package/lib/browser/extension/icons.js +24 -3
  497. package/lib/browser/extension/web-api-components.d.ts +13 -0
  498. package/lib/browser/extension/web-api-contributions.d.ts +125 -0
  499. package/lib/browser/extension/web-extension-api.d.ts +88 -5
  500. package/lib/browser/extension/web-extension-context.d.ts +5 -0
  501. package/lib/browser/extension/web-extension-context.js +62 -9
  502. package/lib/browser/extension/web-extension-protocol.d.ts +19 -1
  503. package/lib/browser/extension/web-extension-protocol.js +3 -0
  504. package/lib/browser/extension/web-extension-run.d.ts +5 -2
  505. package/lib/browser/extension/web-extension-run.js +13 -1
  506. package/lib/browser/extension/web-extensions-running.d.ts +94 -0
  507. package/lib/browser/extension/web-extensions-running.js +343 -0
  508. package/lib/browser/extension/web-extensions.d.ts +6 -82
  509. package/lib/browser/extension/web-extensions.js +7 -316
  510. package/lib/browser/extension/web-pages.js +1 -0
  511. package/lib/browser/extension/web-session-notices.js +8 -3
  512. package/lib/browser/extension/web-tasks.d.ts +2 -0
  513. package/lib/browser/extension/web-tasks.js +6 -0
  514. package/lib/browser/extension/web-view-util.d.ts +2 -1
  515. package/lib/browser/extension/web-view-util.js +4 -1
  516. package/lib/browser/gateway/console-parts.d.ts +4 -12
  517. package/lib/browser/gateway/console-parts.js +42 -126
  518. package/lib/browser/gateway/console-tenant.js +3 -2
  519. package/lib/browser/gateway/console-trend.d.ts +12 -0
  520. package/lib/browser/gateway/console-trend.js +151 -0
  521. package/lib/browser/gateway/console-util.js +2 -2
  522. package/lib/browser/gateway/console-view.js +48 -2
  523. package/lib/browser/i18n/locales.d.ts +170 -6
  524. package/lib/browser/i18n/messages-ja.js +171 -7
  525. package/lib/browser/i18n/messages-zh-tw.js +171 -7
  526. package/lib/browser/i18n/messages.d.ts +167 -3
  527. package/lib/browser/i18n/messages.js +342 -14
  528. package/lib/browser/index.d.ts +17 -0
  529. package/lib/browser/index.js +17 -0
  530. package/lib/browser/notices/notices-protocol.d.ts +12 -0
  531. package/lib/browser/notices/notices.js +7 -4
  532. package/lib/browser/offline/device-values.d.ts +2 -0
  533. package/lib/browser/offline/device-values.js +6 -1
  534. package/lib/browser/screen/page-answers.d.ts +43 -0
  535. package/lib/browser/screen/page-answers.js +93 -0
  536. package/lib/browser/screen/screen-protocol.d.ts +113 -0
  537. package/lib/browser/screen/screen-protocol.js +48 -0
  538. package/lib/browser/screen/screen.d.ts +21 -0
  539. package/lib/browser/screen/screen.js +125 -0
  540. package/lib/browser/screen/use-screen-part.d.ts +7 -0
  541. package/lib/browser/screen/use-screen-part.js +50 -0
  542. package/lib/browser/settings/settings-protocol.d.ts +5 -1
  543. package/lib/browser/settings/settings-protocol.js +5 -1
  544. package/lib/browser/share/shared-extensions.d.ts +30 -0
  545. package/lib/browser/share/shared-extensions.js +181 -0
  546. package/lib/browser/share/shared-link.d.ts +12 -0
  547. package/lib/browser/share/shared-link.js +41 -0
  548. package/lib/browser/share/shared-page.d.ts +6 -0
  549. package/lib/browser/share/shared-page.js +173 -0
  550. package/lib/browser/state/state-protocol.d.ts +14 -0
  551. package/lib/browser/state/state-protocol.js +20 -1
  552. package/lib/browser/state/state.d.ts +10 -2
  553. package/lib/browser/state/state.js +18 -2
  554. package/lib/browser/style/base.d.ts +1 -1
  555. package/lib/browser/style/base.js +4 -0
  556. package/lib/browser/style/chat-list.d.ts +3 -0
  557. package/lib/browser/style/chat-list.js +156 -0
  558. package/lib/browser/style/conversation-column.d.ts +3 -0
  559. package/lib/browser/style/conversation-column.js +253 -0
  560. package/lib/browser/style/conversation.d.ts +1 -1
  561. package/lib/browser/style/conversation.js +24 -8
  562. package/lib/browser/style/dialogs.d.ts +3 -0
  563. package/lib/browser/style/dialogs.js +166 -0
  564. package/lib/browser/style/layout.d.ts +2 -2
  565. package/lib/browser/style/layout.js +1 -525
  566. package/lib/browser/style/pages.d.ts +1 -1
  567. package/lib/browser/style/pages.js +10 -3
  568. package/lib/browser/style/phone.d.ts +1 -1
  569. package/lib/browser/style/phone.js +7 -3
  570. package/lib/browser/style/shared.d.ts +3 -0
  571. package/lib/browser/style/shared.js +26 -0
  572. package/lib/browser/style/shell.d.ts +1 -1
  573. package/lib/browser/style/shell.js +47 -0
  574. package/lib/browser/style/tasks.d.ts +1 -1
  575. package/lib/browser/style/tasks.js +13 -8
  576. package/lib/browser/style.js +8 -0
  577. package/lib/browser/util/gallery.d.ts +24 -2
  578. package/lib/browser/util/gallery.js +82 -2
  579. package/lib/browser/util/image-copy.d.ts +17 -0
  580. package/lib/browser/util/image-copy.js +60 -0
  581. package/lib/browser/util/message.d.ts +5 -0
  582. package/lib/browser/util/message.js +14 -0
  583. package/lib/browser/util/process.d.ts +6 -2
  584. package/lib/browser/util/process.js +6 -2
  585. package/lib/browser/util/spoken.d.ts +25 -0
  586. package/lib/browser/util/spoken.js +86 -0
  587. package/lib/browser/util/transcript.d.ts +23 -0
  588. package/lib/browser/util/transcript.js +49 -0
  589. package/lib/browser/util/voice.d.ts +5 -1
  590. package/lib/browser/util/voice.js +6 -1
  591. package/lib/browser/workbench-hosts.d.ts +37 -0
  592. package/lib/browser/workbench-hosts.js +124 -0
  593. package/lib/browser/workbench-lists.d.ts +34 -0
  594. package/lib/browser/workbench-lists.js +132 -0
  595. package/lib/browser/workbench-protocol.d.ts +14 -1
  596. package/lib/browser/workbench-services.d.ts +50 -0
  597. package/lib/browser/workbench-services.js +124 -0
  598. package/lib/browser/workbench-util.d.ts +1 -1
  599. package/lib/browser/workbench.d.ts +6 -89
  600. package/lib/browser/workbench.js +23 -333
  601. package/package.json +7 -7
@@ -1,16 +1,15 @@
1
- import { SessionStore, type SessionStoreOptions, TaConnection } from '@celljs/ta-client';
2
- import { type TaAccessServer, type TaAuthEvent, type TaAuthServer, type TaGatewayServer, type TaPackageServer, type TaRelayServer, type TaRemoteEvent, type TaRemoteServer, type TaRoomEvent, type TaRoomServer, type TaRoomWatch, type TaServer, type TaServerInfo, type TaSessionInfo, type TaSettingsServer, type TaTerminalServer, type TaWorkspaceServer } from '@celljs/ta-protocol';
3
- import { type HostList } from './hosts.js';
1
+ import { TaConnection } from '@celljs/ta-client';
4
2
  import { PresenceReporter } from './presence/presence-reporter.js';
3
+ import { PageAnswers } from './screen/page-answers.js';
5
4
  import { WorkbenchCalls } from './workbench-calls.js';
5
+ import { WorkbenchHosts } from './workbench-hosts.js';
6
6
  import { type Credential, TaWorkbench, type WorkbenchState } from './workbench-protocol.js';
7
- import { type ServiceName } from './workbench-util.js';
8
- export declare class TaWorkbenchImpl implements TaWorkbench {
9
- protected list: HostList;
7
+ export declare class TaWorkbenchImpl extends WorkbenchHosts implements TaWorkbench {
10
8
  protected current: WorkbenchState;
11
- protected connection?: TaConnection;
12
9
  /** On the connection of the time, only while it is open: what it was at goes again once it opens (resend). */
13
10
  readonly presence: PresenceReporter;
11
+ /** What ta serve may ask this page, and what it is told of the page (docs/design/ta-app-use.md 4.1). */
12
+ readonly pages: PageAnswers;
14
13
  protected retryTimer?: ReturnType<typeof setTimeout>;
15
14
  /** A restart asked for: whether a build was installed over the one running, and whether its connection closed yet. */
16
15
  protected restart?: {
@@ -24,10 +23,6 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
24
23
  /** While offline and not shown yet: when it is. */
25
24
  protected graceTimer?: ReturnType<typeof setTimeout>;
26
25
  protected graceMs: number;
27
- /** The ta serve of the sign-in of now, whose lists are kept as they change. */
28
- protected listsOf?: string;
29
- /** What was kept of the computers dropped, being taken off the device. */
30
- protected forgetting: Promise<unknown>;
31
26
  /**
32
27
  * The calls of the services and of the stores, to the connection of the time; answered from the device
33
28
  * while offline, for the computer in use from the start (web extensions started from the device read
@@ -40,48 +35,10 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
40
35
  reject(error: Error): void;
41
36
  }>;
42
37
  protected waking: boolean;
43
- protected refreshing?: Promise<void>;
44
- protected refreshAgain?: Promise<void>;
45
- /** Settings.chatArchiveDays: the saved conversations older are read only by `readArchived`. */
46
- protected archiveDays: number;
47
- /** The read of the archive under way, and from when it was read (WorkbenchUtil.archiveSince). */
48
- protected archiving?: Promise<void>;
49
- protected archivedSince?: number;
50
- /** Counts the lists of open sessions the server told: a read of the lists begun before one does not undo it. */
51
- protected pushes: number;
52
38
  /** Counts sign-ins and sign-outs: an attempt of an earlier one does nothing when it ends. */
53
39
  protected generation: number;
54
40
  protected readonly listeners: Set<(state: WorkbenchState) => void>;
55
- protected readonly terminalListeners: Set<(terminalId: string, data: string, exitCode?: number) => void>;
56
- protected readonly extensionDataListeners: Set<(name: string, keys: string[], cwd?: string) => void>;
57
- protected readonly authListeners: Set<(loginId: string, event: TaAuthEvent) => void>;
58
- protected readonly remoteListeners: Set<(event: TaRemoteEvent) => void>;
59
- /** Those that listen to the rooms, and what they hear: messages and the state too, or the state of some keys. */
60
- protected readonly roomListeners: Map<(event: TaRoomEvent) => void, TaRoomWatch>;
61
- /** How the connection watches the rooms now: undefined not at all. */
62
- protected roomsWatched?: TaRoomWatch;
63
41
  get state(): WorkbenchState;
64
- get server(): TaServer;
65
- get workspace(): TaWorkspaceServer;
66
- get terminals(): TaTerminalServer;
67
- get settings(): TaSettingsServer;
68
- get packages(): TaPackageServer;
69
- get auth(): TaAuthServer;
70
- get access(): TaAccessServer;
71
- get gateway(): TaGatewayServer;
72
- get relay(): TaRelayServer;
73
- get remote(): TaRemoteServer;
74
- get rooms(): TaRoomServer;
75
- protected service<K extends ServiceName>(name: K): TaConnection[K];
76
- protected signedIn(): TaConnection;
77
- onTerminalData(listener: (terminalId: string, data: string, exitCode?: number) => void): () => void;
78
- onExtensionData(listener: (name: string, keys: string[], cwd?: string) => void): () => void;
79
- onAuthEvent(listener: (loginId: string, event: TaAuthEvent) => void): () => void;
80
- onRemoteEvent(listener: (event: TaRemoteEvent) => void): () => void;
81
- onRoomEvent(listener: (event: TaRoomEvent) => void, options?: {
82
- messages?: boolean;
83
- state?: string[];
84
- }): () => void;
85
42
  restartServer(): Promise<void>;
86
43
  /** A restart that failed, or did not come back: no longer waited for. */
87
44
  protected restarted(): void;
@@ -93,23 +50,6 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
93
50
  setWorkingDirectory(cwd: string): Promise<void>;
94
51
  subscribe(listener: (state: WorkbenchState) => void): () => void;
95
52
  start(): Promise<void>;
96
- signIn(text: string): Promise<void>;
97
- switchTo(hostId: string): void;
98
- forget(hostId: string): void;
99
- rename(hostId: string, name: string): void;
100
- /** Whether a computer answers to the credential, and who it is; the connection is closed after. */
101
- protected probe(credential: Credential): Promise<TaServerInfo>;
102
- /**
103
- * Everything the page shows is of one computer, its web extensions too: it loads again for another,
104
- * after a moment that shows which (`switching`). What it kept of that one shows at once.
105
- */
106
- protected load(hostId: string): void;
107
- protected reload(): void;
108
- /** A host off this device, with what the page kept of it. */
109
- protected drop(hostId: string): void;
110
- /** Loads the page again once what was kept of the computers dropped is off the device: a load aborts what IndexedDB has not written. */
111
- protected reloadSoon(): void;
112
- protected keepHosts(list: HostList): void;
113
53
  protected connectWith(credential: Credential): Promise<void>;
114
54
  /** Tries again later while ta serve is not running, until a sign-in or sign-out of later replaces it. */
115
55
  protected connect(credential: Credential): Promise<void>;
@@ -125,28 +65,6 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
125
65
  signOut(): void;
126
66
  connected(): Promise<void>;
127
67
  reconnect(): void;
128
- listOpened(info: TaSessionInfo): void;
129
- /**
130
- * One read of the lists at a time: asked again meanwhile, one more follows it for all who asked, so that
131
- * reads on a slow network do not pile up.
132
- */
133
- refresh(): Promise<void>;
134
- protected readLists(): Promise<void>;
135
- setArchiveDays(days: number): void;
136
- readArchived(): Promise<void>;
137
- createStore(sessionId: string, options?: SessionStoreOptions): SessionStore;
138
- /** The open sessions from now on as they change, on each connection; a Ta service of before has its lists read again every few seconds. */
139
- protected watchSessions(connection: TaConnection): Promise<void>;
140
- /** The open sessions as the server told them; one that closed is among the saved ones now, which are read again. */
141
- protected takeSessions(sessions: TaSessionInfo[]): void;
142
- /** The prompts of ssh that wait for an answer, from now and those already there. */
143
- protected watchRemote(connection: TaConnection): Promise<void>;
144
- /**
145
- * Watches the rooms as the listeners want (messages too if one does), or no more once none listens; on a new
146
- * connection (`opened`) the listeners read them again (`rooms`), for what changed while away.
147
- */
148
- protected watchRooms(connection: TaConnection, opened: boolean): Promise<void>;
149
- protected emitRemote(event: TaRemoteEvent): void;
150
68
  protected stopRetrying(): void;
151
69
  /**
152
70
  * The device woke, came back to the page or to a network: the connection may be gone without a word,
@@ -157,5 +75,4 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
157
75
  /** Whether another build of Ta was installed since (TaServerInfo.update), read while the page is seen. */
158
76
  protected checkUpdate(): Promise<void>;
159
77
  protected update(change: Partial<WorkbenchState>): void;
160
- protected keepLists(of: string): void;
161
78
  }
@@ -5,36 +5,41 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Component } from '@celljs/core';
8
- import { SessionStore, TaConnection, TaRemoteError } from '@celljs/ta-client';
9
- import { TA_WEBSOCKET_PATH, TaErrorCode, TaRoomWatchUtil, } from '@celljs/ta-protocol';
8
+ import { TaConnection } from '@celljs/ta-client';
9
+ import { TA_WEBSOCKET_PATH, TaErrorCode, TaRoomWatchUtil } from '@celljs/ta-protocol';
10
10
  import { RelaySocket } from '@celljs/ta-relay';
11
11
  import { HostUtil } from './hosts.js';
12
- import { deviceValues, OfflineKeys } from './offline/device-values.js';
13
12
  import { PresenceReporter } from './presence/presence-reporter.js';
14
- import { DEFAULT_SETTINGS } from './settings/settings-protocol.js';
15
- import { StateUtil } from './state/state-protocol.js';
13
+ import { PageAnswers } from './screen/page-answers.js';
14
+ import { ScreenUtil } from './screen/screen-protocol.js';
16
15
  import { DesktopUtil } from './util/desktop.js';
17
16
  import { WorkbenchCalls } from './workbench-calls.js';
17
+ import { WorkbenchHosts } from './workbench-hosts.js';
18
18
  import { TaWorkbench } from './workbench-protocol.js';
19
- import { GRACE_MS, PAGE_BYTES, PROBE_MS, pageHost, SWITCH_MS, storage, WorkbenchError, WorkbenchUtil, } from './workbench-util.js';
19
+ import { GRACE_MS, pageHost, storage, WorkbenchUtil } from './workbench-util.js';
20
20
  /** How often a page that is seen reads again which build of Ta is installed (TaServerInfo.update). */
21
21
  const UPDATE_CHECK_MS = 60000;
22
22
  /** A restart not back in this long is no longer waited for: the row of the connection says what is wrong. */
23
23
  const RESTART_WAIT_MS = 120000;
24
- let TaWorkbenchImpl = class TaWorkbenchImpl {
24
+ let TaWorkbenchImpl = class TaWorkbenchImpl extends WorkbenchHosts {
25
25
  constructor() {
26
- this.list = WorkbenchUtil.readHosts(storage());
26
+ super(...arguments);
27
27
  this.current = { status: 'connecting', hosts: this.list.hosts, host: this.list.current, sessions: [], saved: [] };
28
28
  /** On the connection of the time, only while it is open: what it was at goes again once it opens (resend). */
29
29
  this.presence = new PresenceReporter(state => {
30
- if (this.connection && this.current.status === 'online') {
30
+ // Ta's own screen is no page of the user: no one is shown at a conversation for it.
31
+ if (this.connection && this.current.status === 'online' && !this.pages.agent) {
31
32
  this.connection.presence.report(state).catch(() => undefined);
32
33
  }
33
34
  });
35
+ /** What ta serve may ask this page, and what it is told of the page (docs/design/ta-app-use.md 4.1). */
36
+ this.pages = new PageAnswers(info => {
37
+ if (this.connection && this.current.status === 'online') {
38
+ this.connection.pages.attach(info).catch(() => undefined);
39
+ }
40
+ }, { agent: ScreenUtil.agent(), desktop: typeof globalThis.taDesktop === 'object' });
34
41
  this.attempts = 0;
35
42
  this.graceMs = GRACE_MS;
36
- /** What was kept of the computers dropped, being taken off the device. */
37
- this.forgetting = Promise.resolve();
38
43
  /**
39
44
  * The calls of the services and of the stores, to the connection of the time; answered from the device
40
45
  * while offline, for the computer in use from the start (web extensions started from the device read
@@ -54,93 +59,13 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
54
59
  /** Those waiting for the connection (`connected`): `resolve` once online, `reject` once signed out. */
55
60
  this.connectedWaiters = new Set();
56
61
  this.waking = false;
57
- /** Settings.chatArchiveDays: the saved conversations older are read only by `readArchived`. */
58
- this.archiveDays = DEFAULT_SETTINGS.chatArchiveDays;
59
- /** Counts the lists of open sessions the server told: a read of the lists begun before one does not undo it. */
60
- this.pushes = 0;
61
62
  /** Counts sign-ins and sign-outs: an attempt of an earlier one does nothing when it ends. */
62
63
  this.generation = 0;
63
64
  this.listeners = new Set();
64
- this.terminalListeners = new Set();
65
- this.extensionDataListeners = new Set();
66
- this.authListeners = new Set();
67
- this.remoteListeners = new Set();
68
- /** Those that listen to the rooms, and what they hear: messages and the state too, or the state of some keys. */
69
- this.roomListeners = new Map();
70
65
  }
71
66
  get state() {
72
67
  return this.current;
73
68
  }
74
- get server() {
75
- return this.service('server');
76
- }
77
- get workspace() {
78
- return this.service('workspace');
79
- }
80
- get terminals() {
81
- return this.service('terminals');
82
- }
83
- get settings() {
84
- return this.service('settings');
85
- }
86
- get packages() {
87
- return this.service('packages');
88
- }
89
- get auth() {
90
- return this.service('auth');
91
- }
92
- get access() {
93
- return this.service('access');
94
- }
95
- get gateway() {
96
- return this.service('gateway');
97
- }
98
- get relay() {
99
- return this.service('relay');
100
- }
101
- get remote() {
102
- return this.service('remote');
103
- }
104
- get rooms() {
105
- return this.service('rooms');
106
- }
107
- service(name) {
108
- return this.calls.service(name);
109
- }
110
- signedIn() {
111
- if (!this.connection) {
112
- throw new Error('Not signed in to ta serve.');
113
- }
114
- return this.connection;
115
- }
116
- onTerminalData(listener) {
117
- this.terminalListeners.add(listener);
118
- return () => this.terminalListeners.delete(listener);
119
- }
120
- onExtensionData(listener) {
121
- this.extensionDataListeners.add(listener);
122
- return () => this.extensionDataListeners.delete(listener);
123
- }
124
- onAuthEvent(listener) {
125
- this.authListeners.add(listener);
126
- return () => this.authListeners.delete(listener);
127
- }
128
- onRemoteEvent(listener) {
129
- this.remoteListeners.add(listener);
130
- return () => this.remoteListeners.delete(listener);
131
- }
132
- onRoomEvent(listener, options = {}) {
133
- const wrapped = (event) => listener(event);
134
- this.roomListeners.set(wrapped, TaRoomWatchUtil.of(options.messages, options.state));
135
- if (this.connection) {
136
- void this.watchRooms(this.connection, false);
137
- }
138
- return () => {
139
- if (this.roomListeners.delete(wrapped) && this.connection) {
140
- void this.watchRooms(this.connection, false);
141
- }
142
- };
143
- }
144
69
  async restartServer() {
145
70
  var _a;
146
71
  if (this.restart) {
@@ -198,6 +123,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
198
123
  }
199
124
  async start() {
200
125
  this.watchWake();
126
+ this.pages.watch();
201
127
  const fragment = new URLSearchParams(location.hash.slice(1));
202
128
  // A token of `ta serve --web`, or a pairing link: the page of a relay opened for one let in from a browser (docs/design/ta-team.md 8.3).
203
129
  const fromUrl = WorkbenchUtil.fromFragment(fragment);
@@ -214,109 +140,6 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
214
140
  this.update({ status: 'signed-out' });
215
141
  }
216
142
  }
217
- async signIn(text) {
218
- const credential = WorkbenchUtil.credential(text.trim());
219
- const id = WorkbenchUtil.serverOf(credential, pageHost());
220
- if (this.current.status === 'signed-out' || id === this.current.host) {
221
- this.keepHosts(HostUtil.use(this.list, id, credential, Date.now()));
222
- await this.connectWith(credential);
223
- return;
224
- }
225
- // Another computer while one is in use: tried first, so that a wrong or old code leaves the one in use.
226
- const server = await this.probe(credential);
227
- this.keepHosts(HostUtil.use(this.list, id, credential, Date.now(), { user: server.user, host: server.host }));
228
- this.load(id);
229
- }
230
- switchTo(hostId) {
231
- const host = this.list.hosts.find(one => one.id === hostId);
232
- if (!host || (hostId === this.current.host && this.current.status !== 'signed-out')) {
233
- return;
234
- }
235
- this.keepHosts(HostUtil.select(this.list, hostId, Date.now()));
236
- if (this.current.status === 'signed-out') {
237
- // Nothing of another computer is shown yet: signed in to in place.
238
- void this.connectWith(host.credential);
239
- }
240
- else {
241
- this.load(hostId);
242
- }
243
- }
244
- forget(hostId) {
245
- const wasCurrent = hostId === this.current.host;
246
- this.drop(hostId);
247
- if (!wasCurrent) {
248
- return;
249
- }
250
- const next = HostUtil.latest(this.list);
251
- if (next) {
252
- this.keepHosts(HostUtil.select(this.list, next.id, Date.now()));
253
- this.load(next.id);
254
- }
255
- else {
256
- this.signOut();
257
- }
258
- }
259
- rename(hostId, name) {
260
- this.keepHosts(HostUtil.rename(this.list, hostId, name));
261
- }
262
- /** Whether a computer answers to the credential, and who it is; the connection is closed after. */
263
- async probe(credential) {
264
- const { connection, refused } = this.open(credential);
265
- let timer;
266
- try {
267
- const late = new Promise((_, reject) => {
268
- timer = setTimeout(() => reject(new WorkbenchError('unreachable')), PROBE_MS);
269
- });
270
- await Promise.race([connection.connect(), late]);
271
- return await Promise.race([connection.server.getServerInfo(), late]);
272
- }
273
- catch (error) {
274
- throw error instanceof WorkbenchError ? error : new WorkbenchError((await refused()) ? 'refused' : 'unreachable');
275
- }
276
- finally {
277
- clearTimeout(timer);
278
- connection.close();
279
- }
280
- }
281
- /**
282
- * Everything the page shows is of one computer, its web extensions too: it loads again for another,
283
- * after a moment that shows which (`switching`). What it kept of that one shows at once.
284
- */
285
- load(hostId) {
286
- this.update({ switching: hostId });
287
- setTimeout(() => this.reloadSoon(), SWITCH_MS);
288
- }
289
- reload() {
290
- location.reload();
291
- }
292
- /** A host off this device, with what the page kept of it. */
293
- drop(hostId) {
294
- this.keepHosts(HostUtil.remove(this.list, hostId));
295
- const kept = storage();
296
- kept === null || kept === void 0 ? void 0 : kept.removeItem(WorkbenchUtil.listsKey(hostId));
297
- if (kept) {
298
- StateUtil.forgetHost(kept, hostId);
299
- }
300
- this.forgetting = Promise.all([this.forgetting, OfflineKeys.forget(deviceValues(), hostId)]);
301
- if (this.listsOf === hostId) {
302
- this.listsOf = undefined;
303
- }
304
- }
305
- /** Loads the page again once what was kept of the computers dropped is off the device: a load aborts what IndexedDB has not written. */
306
- reloadSoon() {
307
- void this.forgetting.finally(() => this.reload());
308
- }
309
- keepHosts(list) {
310
- var _a;
311
- this.list = list;
312
- try {
313
- (_a = storage()) === null || _a === void 0 ? void 0 : _a.setItem(HostUtil.KEY, JSON.stringify(list));
314
- }
315
- catch (_b) {
316
- // Full: kept for this page.
317
- }
318
- this.update({ hosts: list.hosts, host: list.current });
319
- }
320
143
  async connectWith(credential) {
321
144
  var _a, _b;
322
145
  var _c;
@@ -375,6 +198,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
375
198
  }
376
199
  this.attempts = 0;
377
200
  this.connection = connection;
201
+ connection.onPageAsk((kind, payload) => this.pages.ask(kind, payload));
378
202
  connection.onTerminalData((terminalId, data, exitCode) => {
379
203
  for (const listener of this.terminalListeners) {
380
204
  listener(terminalId, data, exitCode);
@@ -391,6 +215,11 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
391
215
  }
392
216
  });
393
217
  connection.onRemoteEvent(event => this.emitRemote(event));
218
+ connection.onVoiceEvent(event => {
219
+ for (const listener of this.voiceListeners) {
220
+ listener(event);
221
+ }
222
+ });
394
223
  connection.onRoomEvent(event => {
395
224
  for (const [listener, watch] of this.roomListeners) {
396
225
  if (TaRoomWatchUtil.hears(watch, event)) {
@@ -409,6 +238,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
409
238
  }
410
239
  this.update({ status: 'online', retryAt: undefined });
411
240
  this.presence.resend();
241
+ this.pages.tell();
412
242
  void this.refresh();
413
243
  void this.watchRemote(connection);
414
244
  this.roomsWatched = undefined;
@@ -424,6 +254,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
424
254
  // it: the calls of the page go now, with the one that reads who it is, not a round trip after it.
425
255
  this.update({ status: 'online', error: undefined, retryAt: undefined });
426
256
  this.presence.resend();
257
+ this.pages.tell();
427
258
  }
428
259
  let server;
429
260
  try {
@@ -443,6 +274,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
443
274
  this.keepHosts(HostUtil.use(this.list, WorkbenchUtil.serverOf(credential, pageHost()), credential, Date.now(), { user: server.user, host: server.host }));
444
275
  this.update({ status: 'online', error: undefined, retryAt: undefined, server });
445
276
  this.presence.resend();
277
+ this.pages.tell();
446
278
  await this.refresh();
447
279
  }
448
280
  /** A connection to the computer of `credential`, not opened yet, and whether that computer refused it once it failed. */
@@ -498,137 +330,6 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
498
330
  (_a = this.connection) === null || _a === void 0 ? void 0 : _a.reconnect();
499
331
  }
500
332
  }
501
- listOpened(info) {
502
- if (this.current.sessions.some(session => session.sessionId === info.sessionId)) {
503
- return;
504
- }
505
- // Newer than a list read before it, as one the server told.
506
- this.pushes++;
507
- this.update({ sessions: WorkbenchUtil.sorted([...this.current.sessions, info]) });
508
- }
509
- /**
510
- * One read of the lists at a time: asked again meanwhile, one more follows it for all who asked, so that
511
- * reads on a slow network do not pile up.
512
- */
513
- refresh() {
514
- var _a;
515
- if (!this.refreshing) {
516
- this.refreshing = this.readLists().finally(() => {
517
- this.refreshing = undefined;
518
- });
519
- return this.refreshing;
520
- }
521
- (_a = this.refreshAgain) !== null && _a !== void 0 ? _a : (this.refreshAgain = this.refreshing
522
- .catch(() => undefined)
523
- .then(() => {
524
- this.refreshAgain = undefined;
525
- return this.refresh();
526
- }));
527
- return this.refreshAgain;
528
- }
529
- async readLists() {
530
- const pushes = this.pushes;
531
- // A ta serve of before has no saved sessions to list: its list stays the open ones. The default
532
- // directory comes along, as another device may have changed it. The archived are left out: a list
533
- // read every few seconds stays as small as the conversations of the last days, however many there were.
534
- const since = WorkbenchUtil.daysAgo(Date.now(), this.archiveDays);
535
- const [sessions, saved, server] = await Promise.all([
536
- this.server.listSessions(),
537
- this.server.listSavedSessions(since === undefined ? undefined : { since }).catch(() => []),
538
- this.server.getServerInfo().catch(() => this.current.server),
539
- ]);
540
- // A ta serve of before lists them all.
541
- const recent = since === undefined ? saved : saved.filter(session => session.updatedAt >= since);
542
- // Read every few seconds and mostly the same: what shows them is not drawn again for nothing. A list
543
- // the server told meanwhile is newer than this one, read before it.
544
- this.update({
545
- sessions: pushes === this.pushes ? WorkbenchUtil.same(this.current.sessions, WorkbenchUtil.sorted(sessions)) : this.current.sessions,
546
- saved: WorkbenchUtil.same(this.current.saved, recent),
547
- server: WorkbenchUtil.same(this.current.server, server),
548
- });
549
- // A day later, those that just grew old are in the archive read, not lost between the two lists.
550
- if (this.current.archived && this.archivedSince !== since) {
551
- void this.readArchived().catch(() => undefined);
552
- }
553
- }
554
- setArchiveDays(days) {
555
- if (days === this.archiveDays) {
556
- return;
557
- }
558
- this.archiveDays = days;
559
- if (this.current.status === 'online') {
560
- void this.refresh().catch(() => undefined);
561
- }
562
- }
563
- readArchived() {
564
- var _a;
565
- (_a = this.archiving) !== null && _a !== void 0 ? _a : (this.archiving = (async () => {
566
- const since = WorkbenchUtil.daysAgo(Date.now(), this.archiveDays);
567
- const archived = since === undefined ? [] : await this.server.listSavedSessions({ before: since });
568
- this.archivedSince = since;
569
- const old = since === undefined ? [] : archived.filter(session => session.updatedAt < since);
570
- this.update({ archived: WorkbenchUtil.same(this.current.archived, old) });
571
- })().finally(() => {
572
- this.archiving = undefined;
573
- }));
574
- return this.archiving;
575
- }
576
- createStore(sessionId, options) {
577
- return new SessionStore(this.calls.link, sessionId, { pageBytes: PAGE_BYTES, ...options });
578
- }
579
- /** The open sessions from now on as they change, on each connection; a Ta service of before has its lists read again every few seconds. */
580
- async watchSessions(connection) {
581
- try {
582
- const sessions = await connection.server.watchSessions();
583
- if (this.connection === connection) {
584
- this.takeSessions(sessions);
585
- this.update({ sessionsPushed: true });
586
- }
587
- }
588
- catch (error) {
589
- if (this.connection === connection && TaRemoteError.isMethodNotFound(error)) {
590
- this.update({ sessionsPushed: false });
591
- }
592
- }
593
- }
594
- /** The open sessions as the server told them; one that closed is among the saved ones now, which are read again. */
595
- takeSessions(sessions) {
596
- this.pushes++;
597
- const closed = this.current.sessions.some(session => !sessions.some(other => other.sessionId === session.sessionId));
598
- this.update({ sessions: WorkbenchUtil.same(this.current.sessions, WorkbenchUtil.sorted(sessions)) });
599
- if (closed) {
600
- void this.refresh().catch(() => undefined);
601
- }
602
- }
603
- /** The prompts of ssh that wait for an answer, from now and those already there. */
604
- async watchRemote(connection) {
605
- const prompts = await connection.remote.watch().catch(() => []);
606
- for (const prompt of prompts) {
607
- this.emitRemote({ type: 'prompt', prompt });
608
- }
609
- }
610
- /**
611
- * Watches the rooms as the listeners want (messages too if one does), or no more once none listens; on a new
612
- * connection (`opened`) the listeners read them again (`rooms`), for what changed while away.
613
- */
614
- async watchRooms(connection, opened) {
615
- const wanted = this.roomListeners.size === 0 ? undefined : TaRoomWatchUtil.union(this.roomListeners.values());
616
- if (!TaRoomWatchUtil.same(wanted, this.roomsWatched)) {
617
- this.roomsWatched = wanted;
618
- // A ta serve of before has no rooms; one of before the state of some keys hears it only with messages.
619
- await (wanted === undefined ? connection.rooms.unwatch() : connection.rooms.watch(wanted.messages, wanted.state)).catch(() => undefined);
620
- }
621
- if (opened) {
622
- for (const listener of this.roomListeners.keys()) {
623
- listener({ type: 'rooms' });
624
- }
625
- }
626
- }
627
- emitRemote(event) {
628
- for (const listener of this.remoteListeners) {
629
- listener(event);
630
- }
631
- }
632
333
  stopRetrying() {
633
334
  this.generation++;
634
335
  clearTimeout(this.retryTimer);
@@ -723,17 +424,6 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
723
424
  }
724
425
  }
725
426
  }
726
- keepLists(of) {
727
- var _a;
728
- const { server, sessions, saved } = this.current;
729
- const kept = { of, server, sessions, saved };
730
- try {
731
- (_a = storage()) === null || _a === void 0 ? void 0 : _a.setItem(WorkbenchUtil.listsKey(of), JSON.stringify(kept));
732
- }
733
- catch (_b) {
734
- // Full: the next start waits for the server, as it would without.
735
- }
736
- }
737
427
  };
738
428
  TaWorkbenchImpl = __decorate([
739
429
  Component(TaWorkbench)
@@ -0,0 +1,36 @@
1
+ import type { TaState } from '../state/state-protocol';
2
+ import type { AssistantAsk } from './assistant-protocol';
3
+ /**
4
+ * The tasks the double waits to start, as every page of the user keeps them together (AssistantStates.ASKS):
5
+ * the page that runs start_task asks, the user answers on any page (the phone too), and the page that asked
6
+ * starts the task or not. An ask has the id of its call of start_task and shows while that call waits: the ask
7
+ * of a run stopped meanwhile, or of a page that went away (its call then runs again on another page, which asks
8
+ * under the same id), shows no more.
9
+ */
10
+ export declare class AssistantAskBook {
11
+ protected readonly persisted: TaState;
12
+ /** The asks to show changed. */
13
+ protected readonly changed: (asks: AssistantAsk[]) => void;
14
+ /** The answers this page waits for, by ask id. */
15
+ protected readonly waiting: Map<string, (start: boolean) => void>;
16
+ /** The calls of the double's conversation that wait. */
17
+ protected calls: ReadonlySet<string>;
18
+ protected kept?: AssistantAsk[];
19
+ protected shown: AssistantAsk[];
20
+ constructor(persisted: TaState,
21
+ /** The asks to show changed. */
22
+ changed: (asks: AssistantAsk[]) => void);
23
+ /** Follows what other pages write: an ask of another, an answer given on another. */
24
+ watch(): () => void;
25
+ /** The calls that wait now; one this page asked for that stopped waiting (its run was stopped) is not answered any more. */
26
+ waitingCalls(ids: readonly string[]): void;
27
+ /** Waits for the user's go; already answered (on another page, before the page that asked first went away), at once. */
28
+ ask(ask: AssistantAsk): Promise<boolean>;
29
+ /** The user's answer: here, to what this page waits for; else to the page that asked. */
30
+ answer(id: string, start: boolean): void;
31
+ protected settle(id: string, start: boolean): void;
32
+ protected list(): AssistantAsk[];
33
+ protected write(asks: AssistantAsk[]): void;
34
+ protected refresh(): void;
35
+ }
36
+ //# sourceMappingURL=assistant-ask-book.d.ts.map