@celljs/ta-web 4.9.1 → 4.11.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 (614) hide show
  1. package/README.en.md +8 -7
  2. package/README.md +8 -7
  3. package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
  4. package/esm/browser/assistant/assistant-chat-list.js +20 -2
  5. package/esm/browser/assistant/assistant-extension.d.ts +8 -1
  6. package/esm/browser/assistant/assistant-extension.js +25 -0
  7. package/esm/browser/assistant/assistant-protocol.d.ts +5 -2
  8. package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
  9. package/esm/browser/assistant/assistant-task-book.js +23 -4
  10. package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
  11. package/esm/browser/assistant/assistant-task-source.js +5 -10
  12. package/esm/browser/assistant/assistant-task-util.d.ts +14 -2
  13. package/esm/browser/assistant/assistant-task-util.js +62 -13
  14. package/esm/browser/assistant/assistant-view.js +117 -71
  15. package/esm/browser/assistant/assistant.d.ts +28 -5
  16. package/esm/browser/assistant/assistant.js +96 -22
  17. package/esm/browser/avatar/dino-face.js +1 -2
  18. package/esm/browser/chat/chat-packages.d.ts +39 -0
  19. package/esm/browser/chat/chat-packages.js +70 -0
  20. package/esm/browser/chat/chat-protocol.d.ts +28 -1
  21. package/esm/browser/chat/chat-stores.d.ts +62 -0
  22. package/esm/browser/chat/chat-stores.js +129 -0
  23. package/esm/browser/chat/chat-util.d.ts +17 -0
  24. package/esm/browser/chat/chat-util.js +61 -0
  25. package/esm/browser/chat/chat-view.js +45 -17
  26. package/esm/browser/chat/chat.d.ts +41 -41
  27. package/esm/browser/chat/chat.js +276 -190
  28. package/esm/browser/components/account-menu.d.ts +0 -2
  29. package/esm/browser/components/account-menu.js +1 -27
  30. package/esm/browser/components/agent-settings-view.d.ts +3 -2
  31. package/esm/browser/components/agent-settings-view.js +2 -1
  32. package/esm/browser/components/app-nav.d.ts +11 -5
  33. package/esm/browser/components/app-nav.js +39 -17
  34. package/esm/browser/components/app-shell-hooks.d.ts +2 -2
  35. package/esm/browser/components/app-shell-hooks.js +12 -6
  36. package/esm/browser/components/app-view.js +150 -36
  37. package/esm/browser/components/busy.d.ts +25 -0
  38. package/esm/browser/components/busy.js +52 -0
  39. package/esm/browser/components/chat-icon.d.ts +29 -0
  40. package/esm/browser/components/chat-icon.js +78 -0
  41. package/esm/browser/components/chat-list.d.ts +93 -8
  42. package/esm/browser/components/chat-list.js +411 -60
  43. package/esm/browser/components/chat-seen.d.ts +53 -0
  44. package/esm/browser/components/chat-seen.js +101 -0
  45. package/esm/browser/components/composer-box.d.ts +18 -8
  46. package/esm/browser/components/composer-box.js +199 -52
  47. package/esm/browser/components/composer.d.ts +13 -6
  48. package/esm/browser/components/composer.js +8 -5
  49. package/esm/browser/components/connection-bar.js +50 -17
  50. package/esm/browser/components/context-menu.d.ts +30 -4
  51. package/esm/browser/components/context-menu.js +199 -37
  52. package/esm/browser/components/conversation-scroll.d.ts +136 -6
  53. package/esm/browser/components/conversation-scroll.js +467 -108
  54. package/esm/browser/components/custom-host.d.ts +3 -0
  55. package/esm/browser/components/custom-host.js +14 -0
  56. package/esm/browser/components/directory-commands.d.ts +6 -0
  57. package/esm/browser/components/directory-commands.js +34 -0
  58. package/esm/browser/components/discover-view.d.ts +11 -4
  59. package/esm/browser/components/discover-view.js +20 -11
  60. package/esm/browser/components/dismiss.d.ts +3 -0
  61. package/esm/browser/components/dismiss.js +29 -0
  62. package/esm/browser/components/earlier-messages.d.ts +34 -2
  63. package/esm/browser/components/earlier-messages.js +42 -23
  64. package/esm/browser/components/editor-area.d.ts +6 -20
  65. package/esm/browser/components/editor-area.js +10 -96
  66. package/esm/browser/components/empty-pictures.d.ts +0 -2
  67. package/esm/browser/components/empty-pictures.js +0 -16
  68. package/esm/browser/components/fold-text.d.ts +20 -0
  69. package/esm/browser/components/fold-text.js +66 -0
  70. package/esm/browser/components/folder-picker.d.ts +6 -3
  71. package/esm/browser/components/folder-picker.js +27 -9
  72. package/esm/browser/components/full-screen.d.ts +9 -0
  73. package/esm/browser/components/full-screen.js +26 -0
  74. package/esm/browser/components/grow-box.d.ts +9 -0
  75. package/esm/browser/components/grow-box.js +50 -0
  76. package/esm/browser/components/held-talk.d.ts +28 -0
  77. package/esm/browser/components/held-talk.js +76 -0
  78. package/esm/browser/components/hold-to-talk.d.ts +22 -0
  79. package/esm/browser/components/hold-to-talk.js +29 -0
  80. package/esm/browser/components/host-view.d.ts +1 -1
  81. package/esm/browser/components/icon.d.ts +5 -3
  82. package/esm/browser/components/icon.js +9 -9
  83. package/esm/browser/components/image-viewer.d.ts +132 -0
  84. package/esm/browser/components/image-viewer.js +434 -0
  85. package/esm/browser/components/launcher-search-util.d.ts +4 -3
  86. package/esm/browser/components/launcher-search-util.js +12 -4
  87. package/esm/browser/components/lightbox.d.ts +14 -0
  88. package/esm/browser/components/lightbox.js +25 -0
  89. package/esm/browser/components/list-rows.d.ts +9 -1
  90. package/esm/browser/components/list-rows.js +17 -3
  91. package/esm/browser/components/markdown.d.ts +6 -2
  92. package/esm/browser/components/markdown.js +60 -14
  93. package/esm/browser/components/media.js +20 -12
  94. package/esm/browser/components/message-actions.js +2 -0
  95. package/esm/browser/components/message-footer.d.ts +22 -2
  96. package/esm/browser/components/message-footer.js +47 -13
  97. package/esm/browser/components/message-list.d.ts +78 -6
  98. package/esm/browser/components/message-list.js +281 -36
  99. package/esm/browser/components/message-menu.d.ts +3 -1
  100. package/esm/browser/components/message-menu.js +24 -4
  101. package/esm/browser/components/model-picker.js +1 -0
  102. package/esm/browser/components/nav-places.d.ts +37 -3
  103. package/esm/browser/components/nav-places.js +32 -7
  104. package/esm/browser/components/notice-center.js +34 -0
  105. package/esm/browser/components/notice-face.d.ts +10 -0
  106. package/esm/browser/components/notice-face.js +28 -0
  107. package/esm/browser/components/phone-shell.d.ts +27 -2
  108. package/esm/browser/components/phone-shell.js +98 -9
  109. package/esm/browser/components/picture.d.ts +8 -1
  110. package/esm/browser/components/picture.js +12 -1
  111. package/esm/browser/components/plus-menu.d.ts +23 -0
  112. package/esm/browser/components/plus-menu.js +90 -0
  113. package/esm/browser/components/recent-shot.d.ts +15 -0
  114. package/esm/browser/components/recent-shot.js +174 -0
  115. package/esm/browser/components/relay-view.js +10 -3
  116. package/esm/browser/components/run-status.d.ts +1 -1
  117. package/esm/browser/components/run-status.js +17 -29
  118. package/esm/browser/components/said-text.d.ts +6 -0
  119. package/esm/browser/components/said-text.js +14 -0
  120. package/esm/browser/components/scan-screen.d.ts +10 -0
  121. package/esm/browser/components/scan-screen.js +230 -0
  122. package/esm/browser/components/search-page.js +10 -6
  123. package/esm/browser/components/session-settings.d.ts +8 -3
  124. package/esm/browser/components/session-settings.js +15 -1
  125. package/esm/browser/components/session-view.js +36 -22
  126. package/esm/browser/components/settings-choices.d.ts +1 -0
  127. package/esm/browser/components/settings-choices.js +3 -2
  128. package/esm/browser/components/settings-controls.d.ts +5 -3
  129. package/esm/browser/components/settings-controls.js +10 -1
  130. package/esm/browser/components/settings-parts.d.ts +2 -2
  131. package/esm/browser/components/settings-parts.js +69 -15
  132. package/esm/browser/components/swipe-row.d.ts +2 -2
  133. package/esm/browser/components/swipe-row.js +7 -3
  134. package/esm/browser/components/tool-view.js +21 -14
  135. package/esm/browser/components/unseen-drop.d.ts +39 -0
  136. package/esm/browser/components/unseen-drop.js +219 -0
  137. package/esm/browser/components/use-seen-chats.d.ts +8 -0
  138. package/esm/browser/components/use-seen-chats.js +49 -0
  139. package/esm/browser/components/voice-button.d.ts +7 -1
  140. package/esm/browser/components/voice-button.js +15 -2
  141. package/esm/browser/components/voice-picker.d.ts +6 -0
  142. package/esm/browser/components/voice-picker.js +53 -0
  143. package/esm/browser/components/voice-talk.d.ts +51 -0
  144. package/esm/browser/components/voice-talk.js +242 -0
  145. package/esm/browser/components/web-composer.d.ts +4 -2
  146. package/esm/browser/components/web-composer.js +8 -4
  147. package/esm/browser/components/workbench-tabs.d.ts +41 -0
  148. package/esm/browser/components/workbench-tabs.js +193 -0
  149. package/esm/browser/components/workbench-toggle.d.ts +0 -13
  150. package/esm/browser/components/workbench-toggle.js +1 -28
  151. package/esm/browser/device/code-scan.d.ts +55 -0
  152. package/esm/browser/device/code-scan.js +137 -0
  153. package/esm/browser/device/code-vision.d.ts +51 -0
  154. package/esm/browser/device/code-vision.js +100 -0
  155. package/esm/browser/device/device.d.ts +3 -0
  156. package/esm/browser/device/device.js +11 -1
  157. package/esm/browser/device/hold.d.ts +42 -0
  158. package/esm/browser/device/hold.js +134 -0
  159. package/esm/browser/device/launch-screen.d.ts +1 -1
  160. package/esm/browser/device/launch-screen.js +1 -1
  161. package/esm/browser/device/long-press.d.ts +12 -0
  162. package/esm/browser/device/long-press.js +44 -13
  163. package/esm/browser/device/own-gestures.d.ts +25 -0
  164. package/esm/browser/device/own-gestures.js +39 -0
  165. package/esm/browser/device/pull-down.d.ts +4 -2
  166. package/esm/browser/device/pull-down.js +67 -78
  167. package/esm/browser/device/recent-shots.d.ts +45 -0
  168. package/esm/browser/device/recent-shots.js +142 -0
  169. package/esm/browser/device/row-swipe.d.ts +35 -10
  170. package/esm/browser/device/row-swipe.js +154 -71
  171. package/esm/browser/device/shake-undo.d.ts +16 -0
  172. package/esm/browser/device/shake-undo.js +59 -0
  173. package/esm/browser/device/sheet-swipe.d.ts +118 -18
  174. package/esm/browser/device/sheet-swipe.js +414 -108
  175. package/esm/browser/extension/extension-view.d.ts +10 -0
  176. package/esm/browser/extension/extension-view.js +6 -0
  177. package/esm/browser/extension/icons.js +15 -2
  178. package/esm/browser/extension/web-api-components.d.ts +269 -0
  179. package/esm/browser/extension/web-api-components.js +2 -0
  180. package/esm/browser/extension/web-api-contributions.d.ts +385 -0
  181. package/esm/browser/extension/web-api-contributions.js +2 -0
  182. package/esm/browser/extension/web-api-desktop.d.ts +55 -0
  183. package/esm/browser/extension/web-api-desktop.js +2 -0
  184. package/esm/browser/extension/web-api-terminal.d.ts +71 -0
  185. package/esm/browser/extension/web-api-terminal.js +2 -0
  186. package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
  187. package/esm/browser/extension/web-editor-tabs.js +137 -0
  188. package/esm/browser/extension/web-extension-api.d.ts +218 -521
  189. package/esm/browser/extension/web-extension-code.d.ts +6 -0
  190. package/esm/browser/extension/web-extension-code.js +24 -0
  191. package/esm/browser/extension/web-extension-context.d.ts +78 -0
  192. package/esm/browser/extension/web-extension-context.js +346 -0
  193. package/esm/browser/extension/web-extension-protocol.d.ts +66 -6
  194. package/esm/browser/extension/web-extension-protocol.js +41 -0
  195. package/esm/browser/extension/web-extension-run.d.ts +54 -0
  196. package/esm/browser/extension/web-extension-run.js +120 -0
  197. package/esm/browser/extension/web-extensions.d.ts +41 -68
  198. package/esm/browser/extension/web-extensions.js +188 -487
  199. package/esm/browser/extension/web-home.d.ts +19 -0
  200. package/esm/browser/extension/web-home.js +72 -0
  201. package/esm/browser/extension/web-pages.d.ts +13 -3
  202. package/esm/browser/extension/web-pages.js +23 -3
  203. package/esm/browser/extension/web-session-notices.d.ts +36 -0
  204. package/esm/browser/extension/web-session-notices.js +174 -0
  205. package/esm/browser/extension/web-sharing.d.ts +2 -0
  206. package/esm/browser/extension/web-sharing.js +4 -0
  207. package/esm/browser/files/files-protocol.d.ts +25 -0
  208. package/esm/browser/files/files-protocol.js +2 -0
  209. package/esm/browser/files/files.d.ts +35 -0
  210. package/esm/browser/files/files.js +119 -0
  211. package/esm/browser/game/game-host.d.ts +27 -0
  212. package/esm/browser/game/game-host.js +127 -0
  213. package/esm/browser/game/game-loader.d.ts +10 -0
  214. package/esm/browser/game/game-loader.js +28 -0
  215. package/esm/browser/game/game-protocol.d.ts +49 -0
  216. package/esm/browser/game/game-protocol.js +2 -0
  217. package/esm/browser/game/game-runner.d.ts +27 -0
  218. package/esm/browser/game/game-runner.js +60 -0
  219. package/esm/browser/game/game-util.d.ts +29 -0
  220. package/esm/browser/game/game-util.js +180 -0
  221. package/esm/browser/game/game-view.d.ts +12 -0
  222. package/esm/browser/game/game-view.js +31 -0
  223. package/esm/browser/game/game3d-protocol.d.ts +51 -0
  224. package/esm/browser/game/game3d-protocol.js +2 -0
  225. package/esm/browser/game/game3d-runner.d.ts +27 -0
  226. package/esm/browser/game/game3d-runner.js +149 -0
  227. package/esm/browser/hooks.d.ts +5 -1
  228. package/esm/browser/hooks.js +13 -2
  229. package/esm/browser/i18n/locales.d.ts +105 -3
  230. package/esm/browser/i18n/messages.d.ts +104 -2
  231. package/esm/browser/i18n/messages.js +215 -11
  232. package/esm/browser/index.d.ts +15 -0
  233. package/esm/browser/index.js +15 -0
  234. package/esm/browser/links/links-protocol.d.ts +5 -0
  235. package/esm/browser/links/links.d.ts +19 -7
  236. package/esm/browser/links/links.js +57 -11
  237. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  238. package/esm/browser/markdown/code-renderers.js +4 -0
  239. package/esm/browser/notices/notices-protocol.d.ts +26 -1
  240. package/esm/browser/notices/notices.d.ts +3 -1
  241. package/esm/browser/notices/notices.js +26 -12
  242. package/esm/browser/notices/session-notices.d.ts +69 -0
  243. package/esm/browser/notices/session-notices.js +92 -0
  244. package/esm/browser/offline/device-values.d.ts +55 -0
  245. package/esm/browser/offline/device-values.js +151 -0
  246. package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
  247. package/esm/browser/offline/kept-chats-protocol.js +2 -0
  248. package/esm/browser/offline/kept-chats.d.ts +47 -0
  249. package/esm/browser/offline/kept-chats.js +146 -0
  250. package/esm/browser/offline/offline-reads.d.ts +44 -0
  251. package/esm/browser/offline/offline-reads.js +109 -0
  252. package/esm/browser/settings/navigation.d.ts +3 -2
  253. package/esm/browser/settings/navigation.js +4 -3
  254. package/esm/browser/settings/settings-protocol.d.ts +17 -0
  255. package/esm/browser/settings/settings-protocol.js +20 -4
  256. package/esm/browser/state/state-protocol.d.ts +8 -1
  257. package/esm/browser/state/state.d.ts +2 -0
  258. package/esm/browser/state/state.js +21 -2
  259. package/esm/browser/style/base.d.ts +1 -1
  260. package/esm/browser/style/base.js +27 -1
  261. package/esm/browser/style/conversation.d.ts +1 -1
  262. package/esm/browser/style/conversation.js +95 -17
  263. package/esm/browser/style/device.js +42 -5
  264. package/esm/browser/style/layout.d.ts +1 -1
  265. package/esm/browser/style/layout.js +252 -67
  266. package/esm/browser/style/pages.d.ts +1 -1
  267. package/esm/browser/style/pages.js +38 -2
  268. package/esm/browser/style/phone.d.ts +1 -1
  269. package/esm/browser/style/phone.js +15 -0
  270. package/esm/browser/style/shell.d.ts +1 -1
  271. package/esm/browser/style/shell.js +76 -9
  272. package/esm/browser/style/surfaces.d.ts +1 -1
  273. package/esm/browser/style/surfaces.js +2 -2
  274. package/esm/browser/style/tints.d.ts +27 -0
  275. package/esm/browser/style/tints.js +56 -0
  276. package/esm/browser/style.js +13 -1
  277. package/esm/browser/util/composer.d.ts +6 -0
  278. package/esm/browser/util/composer.js +16 -0
  279. package/esm/browser/util/desktop.d.ts +19 -1
  280. package/esm/browser/util/desktop.js +15 -0
  281. package/esm/browser/util/frame.d.ts +5 -4
  282. package/esm/browser/util/frame.js +5 -4
  283. package/esm/browser/util/link.d.ts +18 -0
  284. package/esm/browser/util/link.js +66 -1
  285. package/esm/browser/util/markdown.d.ts +22 -2
  286. package/esm/browser/util/markdown.js +120 -6
  287. package/esm/browser/util/message.d.ts +5 -0
  288. package/esm/browser/util/message.js +30 -0
  289. package/esm/browser/util/process.d.ts +35 -2
  290. package/esm/browser/util/process.js +79 -4
  291. package/esm/browser/util/progress.d.ts +19 -1
  292. package/esm/browser/util/progress.js +57 -4
  293. package/esm/browser/util/quote.d.ts +19 -0
  294. package/esm/browser/util/quote.js +58 -0
  295. package/esm/browser/util/tool.d.ts +19 -2
  296. package/esm/browser/util/tool.js +70 -2
  297. package/esm/browser/util/voice.d.ts +49 -6
  298. package/esm/browser/util/voice.js +271 -26
  299. package/esm/browser/util/zoom.d.ts +46 -0
  300. package/esm/browser/util/zoom.js +96 -0
  301. package/esm/browser/workbench-calls.d.ts +61 -0
  302. package/esm/browser/workbench-calls.js +146 -0
  303. package/esm/browser/workbench-protocol.d.ts +36 -3
  304. package/esm/browser/workbench-util.d.ts +22 -4
  305. package/esm/browser/workbench-util.js +37 -7
  306. package/esm/browser/workbench.d.ts +47 -6
  307. package/esm/browser/workbench.js +191 -43
  308. package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
  309. package/lib/browser/assistant/assistant-chat-list.js +21 -2
  310. package/lib/browser/assistant/assistant-extension.d.ts +8 -1
  311. package/lib/browser/assistant/assistant-extension.js +25 -0
  312. package/lib/browser/assistant/assistant-protocol.d.ts +5 -2
  313. package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
  314. package/lib/browser/assistant/assistant-task-book.js +23 -4
  315. package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
  316. package/lib/browser/assistant/assistant-task-source.js +5 -10
  317. package/lib/browser/assistant/assistant-task-util.d.ts +14 -2
  318. package/lib/browser/assistant/assistant-task-util.js +62 -13
  319. package/lib/browser/assistant/assistant-view.js +113 -67
  320. package/lib/browser/assistant/assistant.d.ts +28 -5
  321. package/lib/browser/assistant/assistant.js +96 -22
  322. package/lib/browser/avatar/dino-face.js +1 -2
  323. package/lib/browser/chat/chat-packages.d.ts +40 -0
  324. package/lib/browser/chat/chat-packages.js +74 -0
  325. package/lib/browser/chat/chat-protocol.d.ts +28 -1
  326. package/lib/browser/chat/chat-stores.d.ts +63 -0
  327. package/lib/browser/chat/chat-stores.js +133 -0
  328. package/lib/browser/chat/chat-util.d.ts +18 -0
  329. package/lib/browser/chat/chat-util.js +64 -0
  330. package/lib/browser/chat/chat-view.js +44 -16
  331. package/lib/browser/chat/chat.d.ts +41 -41
  332. package/lib/browser/chat/chat.js +277 -191
  333. package/lib/browser/components/account-menu.d.ts +0 -2
  334. package/lib/browser/components/account-menu.js +2 -29
  335. package/lib/browser/components/agent-settings-view.d.ts +3 -2
  336. package/lib/browser/components/agent-settings-view.js +2 -1
  337. package/lib/browser/components/app-nav.d.ts +11 -5
  338. package/lib/browser/components/app-nav.js +35 -13
  339. package/lib/browser/components/app-shell-hooks.d.ts +2 -2
  340. package/lib/browser/components/app-shell-hooks.js +12 -6
  341. package/lib/browser/components/app-view.js +145 -31
  342. package/lib/browser/components/busy.d.ts +26 -0
  343. package/lib/browser/components/busy.js +91 -0
  344. package/lib/browser/components/chat-icon.d.ts +30 -0
  345. package/lib/browser/components/chat-icon.js +117 -0
  346. package/lib/browser/components/chat-list.d.ts +93 -8
  347. package/lib/browser/components/chat-list.js +412 -60
  348. package/lib/browser/components/chat-seen.d.ts +54 -0
  349. package/lib/browser/components/chat-seen.js +104 -0
  350. package/lib/browser/components/composer-box.d.ts +18 -8
  351. package/lib/browser/components/composer-box.js +198 -51
  352. package/lib/browser/components/composer.d.ts +13 -6
  353. package/lib/browser/components/composer.js +7 -4
  354. package/lib/browser/components/connection-bar.js +48 -15
  355. package/lib/browser/components/context-menu.d.ts +30 -4
  356. package/lib/browser/components/context-menu.js +198 -36
  357. package/lib/browser/components/conversation-scroll.d.ts +136 -6
  358. package/lib/browser/components/conversation-scroll.js +469 -109
  359. package/lib/browser/components/custom-host.d.ts +4 -0
  360. package/lib/browser/components/custom-host.js +50 -0
  361. package/lib/browser/components/directory-commands.d.ts +7 -0
  362. package/lib/browser/components/directory-commands.js +70 -0
  363. package/lib/browser/components/discover-view.d.ts +11 -4
  364. package/lib/browser/components/discover-view.js +19 -10
  365. package/lib/browser/components/dismiss.d.ts +4 -0
  366. package/lib/browser/components/dismiss.js +65 -0
  367. package/lib/browser/components/earlier-messages.d.ts +34 -2
  368. package/lib/browser/components/earlier-messages.js +44 -24
  369. package/lib/browser/components/editor-area.d.ts +6 -20
  370. package/lib/browser/components/editor-area.js +11 -97
  371. package/lib/browser/components/empty-pictures.d.ts +0 -2
  372. package/lib/browser/components/empty-pictures.js +0 -17
  373. package/lib/browser/components/fold-text.d.ts +21 -0
  374. package/lib/browser/components/fold-text.js +103 -0
  375. package/lib/browser/components/folder-picker.d.ts +6 -3
  376. package/lib/browser/components/folder-picker.js +27 -9
  377. package/lib/browser/components/full-screen.d.ts +10 -0
  378. package/lib/browser/components/full-screen.js +62 -0
  379. package/lib/browser/components/grow-box.d.ts +10 -0
  380. package/lib/browser/components/grow-box.js +86 -0
  381. package/lib/browser/components/held-talk.d.ts +29 -0
  382. package/lib/browser/components/held-talk.js +79 -0
  383. package/lib/browser/components/hold-to-talk.d.ts +23 -0
  384. package/lib/browser/components/hold-to-talk.js +65 -0
  385. package/lib/browser/components/host-view.d.ts +1 -1
  386. package/lib/browser/components/icon.d.ts +5 -3
  387. package/lib/browser/components/icon.js +11 -9
  388. package/lib/browser/components/image-viewer.d.ts +133 -0
  389. package/lib/browser/components/image-viewer.js +472 -0
  390. package/lib/browser/components/launcher-search-util.d.ts +4 -3
  391. package/lib/browser/components/launcher-search-util.js +12 -4
  392. package/lib/browser/components/lightbox.d.ts +15 -0
  393. package/lib/browser/components/lightbox.js +61 -0
  394. package/lib/browser/components/list-rows.d.ts +9 -1
  395. package/lib/browser/components/list-rows.js +18 -3
  396. package/lib/browser/components/markdown.d.ts +6 -2
  397. package/lib/browser/components/markdown.js +60 -14
  398. package/lib/browser/components/media.js +21 -13
  399. package/lib/browser/components/message-actions.js +2 -0
  400. package/lib/browser/components/message-footer.d.ts +22 -2
  401. package/lib/browser/components/message-footer.js +49 -12
  402. package/lib/browser/components/message-list.d.ts +78 -6
  403. package/lib/browser/components/message-list.js +281 -32
  404. package/lib/browser/components/message-menu.d.ts +3 -1
  405. package/lib/browser/components/message-menu.js +23 -3
  406. package/lib/browser/components/model-picker.js +1 -0
  407. package/lib/browser/components/nav-places.d.ts +37 -3
  408. package/lib/browser/components/nav-places.js +35 -7
  409. package/lib/browser/components/notice-center.js +34 -0
  410. package/lib/browser/components/notice-face.d.ts +11 -0
  411. package/lib/browser/components/notice-face.js +64 -0
  412. package/lib/browser/components/phone-shell.d.ts +27 -2
  413. package/lib/browser/components/phone-shell.js +99 -10
  414. package/lib/browser/components/picture.d.ts +8 -1
  415. package/lib/browser/components/picture.js +13 -1
  416. package/lib/browser/components/plus-menu.d.ts +24 -0
  417. package/lib/browser/components/plus-menu.js +126 -0
  418. package/lib/browser/components/recent-shot.d.ts +16 -0
  419. package/lib/browser/components/recent-shot.js +210 -0
  420. package/lib/browser/components/relay-view.js +10 -3
  421. package/lib/browser/components/run-status.d.ts +1 -1
  422. package/lib/browser/components/run-status.js +17 -29
  423. package/lib/browser/components/said-text.d.ts +7 -0
  424. package/lib/browser/components/said-text.js +50 -0
  425. package/lib/browser/components/scan-screen.d.ts +11 -0
  426. package/lib/browser/components/scan-screen.js +266 -0
  427. package/lib/browser/components/search-page.js +10 -6
  428. package/lib/browser/components/session-settings.d.ts +8 -3
  429. package/lib/browser/components/session-settings.js +15 -1
  430. package/lib/browser/components/session-view.js +32 -18
  431. package/lib/browser/components/settings-choices.d.ts +1 -0
  432. package/lib/browser/components/settings-choices.js +2 -1
  433. package/lib/browser/components/settings-controls.d.ts +5 -3
  434. package/lib/browser/components/settings-controls.js +10 -1
  435. package/lib/browser/components/settings-parts.d.ts +2 -2
  436. package/lib/browser/components/settings-parts.js +67 -13
  437. package/lib/browser/components/swipe-row.d.ts +2 -2
  438. package/lib/browser/components/swipe-row.js +7 -3
  439. package/lib/browser/components/tool-view.js +21 -14
  440. package/lib/browser/components/unseen-drop.d.ts +40 -0
  441. package/lib/browser/components/unseen-drop.js +256 -0
  442. package/lib/browser/components/use-seen-chats.d.ts +9 -0
  443. package/lib/browser/components/use-seen-chats.js +85 -0
  444. package/lib/browser/components/voice-button.d.ts +7 -1
  445. package/lib/browser/components/voice-button.js +16 -2
  446. package/lib/browser/components/voice-picker.d.ts +7 -0
  447. package/lib/browser/components/voice-picker.js +89 -0
  448. package/lib/browser/components/voice-talk.d.ts +52 -0
  449. package/lib/browser/components/voice-talk.js +281 -0
  450. package/lib/browser/components/web-composer.d.ts +4 -2
  451. package/lib/browser/components/web-composer.js +7 -3
  452. package/lib/browser/components/workbench-tabs.d.ts +42 -0
  453. package/lib/browser/components/workbench-tabs.js +232 -0
  454. package/lib/browser/components/workbench-toggle.d.ts +0 -13
  455. package/lib/browser/components/workbench-toggle.js +1 -29
  456. package/lib/browser/device/code-scan.d.ts +56 -0
  457. package/lib/browser/device/code-scan.js +141 -0
  458. package/lib/browser/device/code-vision.d.ts +52 -0
  459. package/lib/browser/device/code-vision.js +103 -0
  460. package/lib/browser/device/device.d.ts +3 -0
  461. package/lib/browser/device/device.js +11 -1
  462. package/lib/browser/device/hold.d.ts +43 -0
  463. package/lib/browser/device/hold.js +171 -0
  464. package/lib/browser/device/launch-screen.d.ts +1 -1
  465. package/lib/browser/device/launch-screen.js +1 -1
  466. package/lib/browser/device/long-press.d.ts +12 -0
  467. package/lib/browser/device/long-press.js +44 -13
  468. package/lib/browser/device/own-gestures.d.ts +26 -0
  469. package/lib/browser/device/own-gestures.js +42 -0
  470. package/lib/browser/device/pull-down.d.ts +4 -2
  471. package/lib/browser/device/pull-down.js +66 -77
  472. package/lib/browser/device/recent-shots.d.ts +46 -0
  473. package/lib/browser/device/recent-shots.js +145 -0
  474. package/lib/browser/device/row-swipe.d.ts +35 -10
  475. package/lib/browser/device/row-swipe.js +153 -70
  476. package/lib/browser/device/shake-undo.d.ts +17 -0
  477. package/lib/browser/device/shake-undo.js +63 -0
  478. package/lib/browser/device/sheet-swipe.d.ts +118 -18
  479. package/lib/browser/device/sheet-swipe.js +418 -109
  480. package/lib/browser/extension/extension-view.d.ts +10 -0
  481. package/lib/browser/extension/extension-view.js +7 -1
  482. package/lib/browser/extension/icons.js +14 -1
  483. package/lib/browser/extension/web-api-components.d.ts +270 -0
  484. package/lib/browser/extension/web-api-components.js +3 -0
  485. package/lib/browser/extension/web-api-contributions.d.ts +386 -0
  486. package/lib/browser/extension/web-api-contributions.js +3 -0
  487. package/lib/browser/extension/web-api-desktop.d.ts +56 -0
  488. package/lib/browser/extension/web-api-desktop.js +3 -0
  489. package/lib/browser/extension/web-api-terminal.d.ts +72 -0
  490. package/lib/browser/extension/web-api-terminal.js +3 -0
  491. package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
  492. package/lib/browser/extension/web-editor-tabs.js +141 -0
  493. package/lib/browser/extension/web-extension-api.d.ts +218 -521
  494. package/lib/browser/extension/web-extension-code.d.ts +6 -0
  495. package/lib/browser/extension/web-extension-code.js +24 -0
  496. package/lib/browser/extension/web-extension-context.d.ts +79 -0
  497. package/lib/browser/extension/web-extension-context.js +383 -0
  498. package/lib/browser/extension/web-extension-protocol.d.ts +66 -6
  499. package/lib/browser/extension/web-extension-protocol.js +42 -1
  500. package/lib/browser/extension/web-extension-run.d.ts +55 -0
  501. package/lib/browser/extension/web-extension-run.js +123 -0
  502. package/lib/browser/extension/web-extensions.d.ts +41 -68
  503. package/lib/browser/extension/web-extensions.js +184 -516
  504. package/lib/browser/extension/web-home.d.ts +20 -0
  505. package/lib/browser/extension/web-home.js +76 -0
  506. package/lib/browser/extension/web-pages.d.ts +13 -3
  507. package/lib/browser/extension/web-pages.js +23 -3
  508. package/lib/browser/extension/web-session-notices.d.ts +37 -0
  509. package/lib/browser/extension/web-session-notices.js +177 -0
  510. package/lib/browser/extension/web-sharing.d.ts +2 -0
  511. package/lib/browser/extension/web-sharing.js +4 -0
  512. package/lib/browser/files/files-protocol.d.ts +26 -0
  513. package/lib/browser/files/files-protocol.js +5 -0
  514. package/lib/browser/files/files.d.ts +36 -0
  515. package/lib/browser/files/files.js +122 -0
  516. package/lib/browser/game/game-host.d.ts +28 -0
  517. package/lib/browser/game/game-host.js +163 -0
  518. package/lib/browser/game/game-loader.d.ts +11 -0
  519. package/lib/browser/game/game-loader.js +31 -0
  520. package/lib/browser/game/game-protocol.d.ts +50 -0
  521. package/lib/browser/game/game-protocol.js +3 -0
  522. package/lib/browser/game/game-runner.d.ts +28 -0
  523. package/lib/browser/game/game-runner.js +64 -0
  524. package/lib/browser/game/game-util.d.ts +30 -0
  525. package/lib/browser/game/game-util.js +183 -0
  526. package/lib/browser/game/game-view.d.ts +13 -0
  527. package/lib/browser/game/game-view.js +68 -0
  528. package/lib/browser/game/game3d-protocol.d.ts +52 -0
  529. package/lib/browser/game/game3d-protocol.js +3 -0
  530. package/lib/browser/game/game3d-runner.d.ts +28 -0
  531. package/lib/browser/game/game3d-runner.js +153 -0
  532. package/lib/browser/hooks.d.ts +5 -1
  533. package/lib/browser/hooks.js +14 -2
  534. package/lib/browser/i18n/locales.d.ts +105 -3
  535. package/lib/browser/i18n/messages.d.ts +104 -2
  536. package/lib/browser/i18n/messages.js +215 -11
  537. package/lib/browser/index.d.ts +15 -0
  538. package/lib/browser/index.js +15 -0
  539. package/lib/browser/links/links-protocol.d.ts +5 -0
  540. package/lib/browser/links/links.d.ts +19 -7
  541. package/lib/browser/links/links.js +57 -11
  542. package/lib/browser/markdown/code-renderers.d.ts +5 -0
  543. package/lib/browser/markdown/code-renderers.js +40 -0
  544. package/lib/browser/notices/notices-protocol.d.ts +26 -1
  545. package/lib/browser/notices/notices.d.ts +3 -1
  546. package/lib/browser/notices/notices.js +26 -12
  547. package/lib/browser/notices/session-notices.d.ts +70 -0
  548. package/lib/browser/notices/session-notices.js +96 -0
  549. package/lib/browser/offline/device-values.d.ts +56 -0
  550. package/lib/browser/offline/device-values.js +157 -0
  551. package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
  552. package/lib/browser/offline/kept-chats-protocol.js +5 -0
  553. package/lib/browser/offline/kept-chats.d.ts +48 -0
  554. package/lib/browser/offline/kept-chats.js +149 -0
  555. package/lib/browser/offline/offline-reads.d.ts +45 -0
  556. package/lib/browser/offline/offline-reads.js +113 -0
  557. package/lib/browser/settings/navigation.d.ts +3 -2
  558. package/lib/browser/settings/navigation.js +4 -3
  559. package/lib/browser/settings/settings-protocol.d.ts +17 -0
  560. package/lib/browser/settings/settings-protocol.js +21 -5
  561. package/lib/browser/state/state-protocol.d.ts +8 -1
  562. package/lib/browser/state/state.d.ts +2 -0
  563. package/lib/browser/state/state.js +21 -2
  564. package/lib/browser/style/base.d.ts +1 -1
  565. package/lib/browser/style/base.js +27 -1
  566. package/lib/browser/style/conversation.d.ts +1 -1
  567. package/lib/browser/style/conversation.js +95 -17
  568. package/lib/browser/style/device.js +42 -5
  569. package/lib/browser/style/layout.d.ts +1 -1
  570. package/lib/browser/style/layout.js +252 -67
  571. package/lib/browser/style/pages.d.ts +1 -1
  572. package/lib/browser/style/pages.js +38 -2
  573. package/lib/browser/style/phone.d.ts +1 -1
  574. package/lib/browser/style/phone.js +15 -0
  575. package/lib/browser/style/shell.d.ts +1 -1
  576. package/lib/browser/style/shell.js +76 -9
  577. package/lib/browser/style/surfaces.d.ts +1 -1
  578. package/lib/browser/style/surfaces.js +2 -2
  579. package/lib/browser/style/tints.d.ts +28 -0
  580. package/lib/browser/style/tints.js +59 -0
  581. package/lib/browser/style.js +13 -1
  582. package/lib/browser/util/composer.d.ts +6 -0
  583. package/lib/browser/util/composer.js +16 -0
  584. package/lib/browser/util/desktop.d.ts +19 -1
  585. package/lib/browser/util/desktop.js +15 -0
  586. package/lib/browser/util/frame.d.ts +5 -4
  587. package/lib/browser/util/frame.js +5 -4
  588. package/lib/browser/util/link.d.ts +18 -0
  589. package/lib/browser/util/link.js +66 -1
  590. package/lib/browser/util/markdown.d.ts +22 -2
  591. package/lib/browser/util/markdown.js +120 -6
  592. package/lib/browser/util/message.d.ts +5 -0
  593. package/lib/browser/util/message.js +30 -0
  594. package/lib/browser/util/process.d.ts +35 -2
  595. package/lib/browser/util/process.js +80 -5
  596. package/lib/browser/util/progress.d.ts +19 -1
  597. package/lib/browser/util/progress.js +57 -4
  598. package/lib/browser/util/quote.d.ts +20 -0
  599. package/lib/browser/util/quote.js +61 -0
  600. package/lib/browser/util/tool.d.ts +19 -2
  601. package/lib/browser/util/tool.js +70 -2
  602. package/lib/browser/util/voice.d.ts +49 -6
  603. package/lib/browser/util/voice.js +271 -26
  604. package/lib/browser/util/zoom.d.ts +47 -0
  605. package/lib/browser/util/zoom.js +99 -0
  606. package/lib/browser/workbench-calls.d.ts +62 -0
  607. package/lib/browser/workbench-calls.js +150 -0
  608. package/lib/browser/workbench-protocol.d.ts +36 -3
  609. package/lib/browser/workbench-util.d.ts +22 -4
  610. package/lib/browser/workbench-util.js +38 -8
  611. package/lib/browser/workbench.d.ts +47 -6
  612. package/lib/browser/workbench.js +189 -41
  613. package/package.json +14 -11
  614. package/public/launch.svg +46 -42
@@ -28,19 +28,25 @@ let TaLinksImpl = class TaLinksImpl {
28
28
  this.listeners.add(listener);
29
29
  return () => this.listeners.delete(listener);
30
30
  }
31
- async open(target, { cwd, external = false } = {}) {
32
- var _a;
31
+ async open(link, { cwd, paths = [], external = false } = {}) {
32
+ var _a, _b;
33
+ // `~/…` is in the home of the computer of the conversation; that of another machine (ssh://) is not known here.
34
+ const target = link.type === 'path' && !(cwd === null || cwd === void 0 ? void 0 : cwd.includes('://')) ? { ...link, path: LinkUtil.expandHome(link.path, (_a = this.workbench.state.server) === null || _a === void 0 ? void 0 : _a.home) } : link;
33
35
  try {
34
36
  if (target.type === 'mail') {
35
37
  this.openExternal(target.url);
36
38
  }
37
39
  else if (target.type === 'url') {
38
- if (external || !(await this.dispatch({ type: 'url', url: target.url }))) {
40
+ // Out of Ta, but for a link that an opener of its own kind takes (a link of a share).
41
+ if (!(await this.dispatch({ type: 'url', url: target.url }, external))) {
39
42
  this.askExternal(target.url);
40
43
  }
41
44
  }
45
+ else if (LinkUtil.isSessionFile(target.path) && (await this.openConversation(target.path))) {
46
+ // A session file of Ta: its conversation, wherever the conversation of the link works.
47
+ }
42
48
  else {
43
- const link = await this.locate(target, cwd || ((_a = this.workbench.state.server) === null || _a === void 0 ? void 0 : _a.cwd) || '/');
49
+ const link = await this.locate(target, cwd || ((_b = this.workbench.state.server) === null || _b === void 0 ? void 0 : _b.cwd) || '/', paths);
44
50
  if (link && !(await this.dispatch(link))) {
45
51
  this.notices.notify(this.text('ta.link.noOpener'), { level: 'warning' });
46
52
  }
@@ -71,9 +77,28 @@ let TaLinksImpl = class TaLinksImpl {
71
77
  this.openExternal(request.url);
72
78
  }
73
79
  }
74
- /** A file or a directory as the openers take it: whether it is either, read from its directory. */
75
- async locate(target, conversationCwd) {
76
- const { cwd, path } = LinkUtil.resolve(conversationCwd, target.path);
80
+ /**
81
+ * A file or a directory as the openers take it. A relative path is looked for first where the tools
82
+ * named it and in the directory of the conversation, then near where they worked (LinkUtil.places): an
83
+ * agent in a git worktree writes paths of the worktree.
84
+ */
85
+ async locate(target, conversationCwd, paths) {
86
+ var _a;
87
+ const { named, nearby } = LinkUtil.places(target.path, conversationCwd, paths);
88
+ const link = (_a = (await this.find(target, [...named, conversationCwd]))) !== null && _a !== void 0 ? _a : (await this.find(target, nearby));
89
+ if (!link) {
90
+ this.notices.notify(this.text('ta.link.notFound', LinkUtil.label(target)), { level: 'warning' });
91
+ }
92
+ return link;
93
+ }
94
+ /** The path in the first of `dirs` that has it, each read at once. */
95
+ async find(target, dirs) {
96
+ const links = await Promise.all(dirs.map(dir => this.lookUp(target, dir)));
97
+ return links.find(link => link);
98
+ }
99
+ /** The path in `dir`, whether a file or a directory, read from its directory; undefined when it is not there. */
100
+ async lookUp(target, dir) {
101
+ const { cwd, path } = LinkUtil.resolve(dir, target.path);
77
102
  if (!path) {
78
103
  return { type: 'directory', cwd, path };
79
104
  }
@@ -81,14 +106,35 @@ let TaLinksImpl = class TaLinksImpl {
81
106
  const entries = await this.workbench.workspace.listDirectory(LinkUtil.dirname(path), cwd).catch(() => []);
82
107
  const entry = entries.find(candidate => candidate.name === name);
83
108
  if (!entry) {
84
- this.notices.notify(this.text('ta.link.notFound', LinkUtil.label(target)), { level: 'warning' });
85
109
  return undefined;
86
110
  }
87
111
  return entry.kind === 'directory' ? { type: 'directory', cwd, path } : { type: 'file', cwd, path, selection: target.selection };
88
112
  }
89
- /** The first opener of the web extensions that opens it. */
90
- async dispatch(link) {
91
- for (const opener of this.extensions.state.openers) {
113
+ /** Shows the conversation of a session file, opened again when it closed; false when no conversation has it. */
114
+ async openConversation(file) {
115
+ var _a, _b, _c;
116
+ var _d, _e;
117
+ const switcher = this.extensions.sessionSwitcher();
118
+ if (!switcher) {
119
+ return false;
120
+ }
121
+ const open = this.workbench.state.sessions.find(session => session.sessionFile === file);
122
+ const saved = open ? undefined : (await this.workbench.server.listSavedSessions()).find(session => session.sessionFile === file);
123
+ if (!open && !saved) {
124
+ return false;
125
+ }
126
+ const session = (_d = open === null || open === void 0 ? void 0 : open.sessionId) !== null && _d !== void 0 ? _d : this.workbench.server
127
+ .openSession({ cwd: (_e = saved === null || saved === void 0 ? void 0 : saved.cwd) !== null && _e !== void 0 ? _e : '.', sessionFile: file, ...((saved === null || saved === void 0 ? void 0 : saved.group) ? { group: saved.group } : {}) })
128
+ .then(info => info.sessionId);
129
+ const shown = switcher(session, { title: ((_a = (open !== null && open !== void 0 ? open : saved)) === null || _a === void 0 ? void 0 : _a.sessionName) || ((_b = (open !== null && open !== void 0 ? open : saved)) === null || _b === void 0 ? void 0 : _b.firstMessage), cwd: (_c = (open !== null && open !== void 0 ? open : saved)) === null || _c === void 0 ? void 0 : _c.cwd, sessionFile: file });
130
+ this.extensions.showPage('');
131
+ await shown;
132
+ return true;
133
+ }
134
+ /** The first opener of the web extensions that opens it; of those of some links only, with `specific`. */
135
+ async dispatch(link, specific = false) {
136
+ const { openers, specificOpeners } = this.extensions.state;
137
+ for (const opener of specific ? specificOpeners : openers) {
92
138
  if (await opener(link)) {
93
139
  return true;
94
140
  }
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { WebCodeRendererProps } from '../extension/web-api-contributions.js';
3
+ /** What web extensions draw fenced blocks of their languages with (WebExtensionAPI.registerCodeRenderer), by language in lower case. */
4
+ export declare const CodeRenderers: React.Context<Readonly<Record<string, React.ComponentType<WebCodeRendererProps>>>>;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ /** What web extensions draw fenced blocks of their languages with (WebExtensionAPI.registerCodeRenderer), by language in lower case. */
3
+ export const CodeRenderers = React.createContext({});
4
+ //# sourceMappingURL=code-renderers.js.map
@@ -8,11 +8,26 @@ export interface NoticeAction {
8
8
  label: string;
9
9
  run(): void;
10
10
  }
11
+ /** A conversation that said what a notice says (TaNotices.notify `from`): drawn with its face and name. */
12
+ export interface NoticeFrom {
13
+ sessionId?: string;
14
+ sessionFile?: string;
15
+ /** Its name, as the lists show it. */
16
+ title: string;
17
+ /** What it asks of the user, beside its name: it waits for them, or its run failed. */
18
+ status?: 'ask' | 'failed';
19
+ /** Shows the conversation: a tap on the notice. */
20
+ open(): void;
21
+ }
11
22
  export interface NoticeOptions {
12
23
  level?: NoticeLevel;
13
24
  /** A second, quieter line: what to do about it. */
14
25
  detail?: string;
15
26
  action?: NoticeAction;
27
+ /** Buttons side by side under the message (answers to pick); `action` is the last of them. */
28
+ actions?: NoticeAction[];
29
+ /** Said by a conversation. */
30
+ from?: NoticeFrom;
16
31
  /** Notices of one key replace each other and count how often they came, instead of piling up. */
17
32
  key?: string;
18
33
  /** Stays until the user closes it. */
@@ -26,6 +41,8 @@ export interface Notice {
26
41
  message: string;
27
42
  detail?: string;
28
43
  action?: NoticeAction;
44
+ actions?: NoticeAction[];
45
+ from?: NoticeFrom;
29
46
  key?: string;
30
47
  sticky?: boolean;
31
48
  art?: boolean[][];
@@ -61,6 +78,11 @@ export interface NoticesState {
61
78
  confirm?: ConfirmRequest;
62
79
  /** Or the text asked for, in the same line of questions. */
63
80
  input?: InputRequest;
81
+ /**
82
+ * When something the user did last did not happen only because the connection was lost: no notice for
83
+ * that, the row of the connection says it for a moment (ConnectionBar, ConnectionBanner).
84
+ */
85
+ notDoneAt?: number;
64
86
  }
65
87
  /**
66
88
  * The notices of the page, from ta and its web extensions alike: short-lived messages in a corner, and
@@ -71,7 +93,10 @@ export interface TaNotices {
71
93
  subscribe(listener: (state: NoticesState) => void): () => void;
72
94
  /** Returns its id. */
73
95
  notify(message: string, options?: NoticeOptions): number;
74
- /** A failed action: the message of the error, and its hint for a failure ta serve names. */
96
+ /**
97
+ * A failed action: the message of the error, and its hint for a failure ta serve names. A connection
98
+ * lost is no notice (`notDoneAt`), nor is an error notified in words that only say so.
99
+ */
75
100
  error(cause: unknown, options?: Omit<NoticeOptions, 'level'>): number;
76
101
  dismiss(id: number): void;
77
102
  /** Resolves with whether the user went ahead. */
@@ -14,7 +14,7 @@ type Question = {
14
14
  };
15
15
  export declare namespace NoticesUtil {
16
16
  /** How long a notice stays, or `undefined` until it is closed. */
17
- function duration(notice: Pick<Notice, 'level' | 'sticky' | 'action'>): number | undefined;
17
+ function duration(notice: Pick<Notice, 'level' | 'sticky' | 'action' | 'actions'>): number | undefined;
18
18
  /** Notices of the same key are one, which came `count` times: the same failure ten times is one notice. */
19
19
  function key(level: NoticeLevel, text: string, options: NoticeOptions): string;
20
20
  /** At most MAX_NOTICES, the newest kept; a sticky one goes only when there is nothing else to drop. */
@@ -38,6 +38,8 @@ export declare class TaNoticesImpl implements TaNotices {
38
38
  subscribe(listener: (state: NoticesState) => void): () => void;
39
39
  notify(text: string, options?: NoticeOptions): number;
40
40
  error(cause: unknown, options?: Omit<NoticeOptions, 'level'>): number;
41
+ /** Not a notice over the page: the row of the connection says that it did not happen, and why. */
42
+ protected notDone(): number;
41
43
  dismiss(id: number): void;
42
44
  confirm(options: ConfirmOptions): Promise<boolean>;
43
45
  answer(id: number, confirmed: boolean): void;
@@ -8,6 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Autowired, Component } from '@celljs/core';
11
+ import { TaRemoteError } from '@celljs/ta-client';
11
12
  import { TaErrorCode } from '@celljs/ta-protocol';
12
13
  import { message } from '../i18n/messages.js';
13
14
  import { TaSettings } from '../settings/settings-protocol.js';
@@ -24,7 +25,8 @@ export var NoticesUtil;
24
25
  (function (NoticesUtil) {
25
26
  /** How long a notice stays, or `undefined` until it is closed. */
26
27
  function duration(notice) {
27
- return notice.sticky ? undefined : DURATIONS_MS[notice.level] + (notice.action ? ACTION_MS : 0);
28
+ var _a;
29
+ return notice.sticky ? undefined : DURATIONS_MS[notice.level] + (notice.action || ((_a = notice.actions) === null || _a === void 0 ? void 0 : _a.length) ? ACTION_MS : 0);
28
30
  }
29
31
  NoticesUtil.duration = duration;
30
32
  /** Notices of the same key are one, which came `count` times: the same failure ten times is one notice. */
@@ -50,6 +52,9 @@ export var NoticesUtil;
50
52
  [TaErrorCode.TOO_MANY_SESSIONS]: 'ta.error.tooManySessions',
51
53
  [TaErrorCode.MESSAGE_CONFLICT]: 'ta.error.messageConflict',
52
54
  [TaErrorCode.MODEL_NOT_FOUND]: 'ta.error.modelNotFound',
55
+ [TaErrorCode.NOTHING_TO_COMPACT]: 'ta.error.nothingToCompact',
56
+ [TaErrorCode.ALREADY_COMPACTED]: 'ta.error.alreadyCompacted',
57
+ [TaErrorCode.SESSION_BUSY]: 'ta.error.sessionBusy',
53
58
  };
54
59
  /** What an error says: its message, and for a failure ta serve names (TaRemoteError) its hint. */
55
60
  function describe(cause) {
@@ -76,8 +81,12 @@ let TaNoticesImpl = class TaNoticesImpl {
76
81
  return () => this.listeners.delete(listener);
77
82
  }
78
83
  notify(text, options = {}) {
79
- var _a;
84
+ var _a, _b;
80
85
  const level = (_a = options.level) !== null && _a !== void 0 ? _a : 'info';
86
+ if (level === 'error' && TaRemoteError.isConnectionLost(`${text}\n${(_b = options.detail) !== null && _b !== void 0 ? _b : ''}`)) {
87
+ // A web extension saying a call failed, in words: only the connection, which mends itself.
88
+ return this.notDone();
89
+ }
81
90
  const key = NoticesUtil.key(level, text, options);
82
91
  const same = this.current.notices.find(notice => notice.key === key);
83
92
  const notice = {
@@ -86,10 +95,13 @@ let TaNoticesImpl = class TaNoticesImpl {
86
95
  message: text,
87
96
  detail: options.detail,
88
97
  action: options.action,
98
+ actions: options.actions,
99
+ from: options.from,
89
100
  key,
90
101
  sticky: options.sticky,
91
102
  art: options.art,
92
- count: same && same.message === text ? same.count + 1 : 1,
103
+ // A conversation's newer message takes the place of its last one, not counted.
104
+ count: same && same.message === text && !options.from ? same.count + 1 : 1,
93
105
  };
94
106
  this.update({ notices: NoticesUtil.keep([...this.current.notices.filter(other => other !== same), notice]) });
95
107
  return notice.id;
@@ -101,15 +113,12 @@ let TaNoticesImpl = class TaNoticesImpl {
101
113
  window.dispatchEvent(new Event(SIGN_IN_EVENT));
102
114
  return 0;
103
115
  }
104
- if (code === TaErrorCode.CONNECTION_LOST) {
105
- // The bar of the connection says why; this says what did not happen, once however many calls failed.
106
- const language = this.settings.state.language;
107
- return this.notify(message(language, 'ta.connection.notDone'), {
108
- ...options,
109
- level: 'error',
110
- key: 'connection-lost',
111
- detail: message(language, 'ta.connection.notDoneHint'),
112
- });
116
+ if (code === TaErrorCode.CANCELLED) {
117
+ // The user stopped it (or an extension did, and says why itself): nothing went wrong.
118
+ return 0;
119
+ }
120
+ if (TaRemoteError.isConnectionLost(cause)) {
121
+ return this.notDone();
113
122
  }
114
123
  const known = code ? NoticesUtil.LOCALIZED[code] : undefined;
115
124
  if (known) {
@@ -119,6 +128,11 @@ let TaNoticesImpl = class TaNoticesImpl {
119
128
  }
120
129
  return this.notify(text, { detail, ...options, level: 'error' });
121
130
  }
131
+ /** Not a notice over the page: the row of the connection says that it did not happen, and why. */
132
+ notDone() {
133
+ this.update({ notDoneAt: Date.now() });
134
+ return 0;
135
+ }
122
136
  dismiss(id) {
123
137
  if (this.current.notices.some(notice => notice.id === id)) {
124
138
  this.update({ notices: this.current.notices.filter(notice => notice.id !== id) });
@@ -0,0 +1,69 @@
1
+ import type { WebSessionNotice } from '../extension/web-api-contributions.js';
2
+ import type { NoticeAction, NoticeLevel, TaNotices } from './notices-protocol.js';
3
+ export declare const TaSessionNotices: unique symbol;
4
+ /** What conversations tell the user (WebExtensionUI.notifySession), one for every extension of the page: each key told once. */
5
+ export interface TaSessionNotices {
6
+ notify(notice: WebSessionNotice): SessionNoticeWay;
7
+ }
8
+ /** How a page tells of a notice of a conversation (SessionNoticeUtil.way). */
9
+ export type SessionNoticeWay = 'none' | 'banner' | 'system' | 'waiting';
10
+ /** What the page is at when a notice comes. */
11
+ export interface SessionNoticeScene {
12
+ /** The page is in front and has the focus: the user is on it. */
13
+ focused: boolean;
14
+ /** The user looks at that conversation: it is shown, or it is the double's and its page is. */
15
+ looking: boolean;
16
+ /** It is a task the double follows, which tells the user of it. */
17
+ task: boolean;
18
+ /** Notices of the system can be shown: the browser has them and the user allowed them. */
19
+ system: boolean;
20
+ /**
21
+ * A phone or a tablet: nothing floats over the page, as a messenger in front tells of a message only by
22
+ * the unread of its list and its tab; the question is answered in its conversation.
23
+ */
24
+ quiet: boolean;
25
+ }
26
+ /** What the page asks of the shell to tell of a conversation; SessionNotices decides how. */
27
+ export interface SessionNoticeHost {
28
+ readonly notices: TaNotices;
29
+ scene(notice: WebSessionNotice): SessionNoticeScene;
30
+ /** Its name, as the lists show it. */
31
+ title(notice: WebSessionNotice): string;
32
+ /** Shows the conversation. */
33
+ open(notice: WebSessionNotice): Promise<void>;
34
+ /** Sends an answer the user picked, as their message. */
35
+ answer(notice: WebSessionNotice, text: string, clientMessageId: string): Promise<void>;
36
+ /** A notice of the system; `onClick` brings the page to the front first. */
37
+ system(title: string, body: string, options: {
38
+ tag: string;
39
+ silent: boolean;
40
+ onClick(): void;
41
+ }): void;
42
+ }
43
+ export declare namespace SessionNoticeUtil {
44
+ /** How many of a page's keys it remembers having told: a notice read again after it does not come twice. */
45
+ const TOLD = 200;
46
+ /**
47
+ * How to tell of it: not of what the user looks at, nor of a task the double tells of unless it asks; a
48
+ * banner while the user is on the page; a notice of the system while not, if there are any; else a banner
49
+ * that waits for them, only when it asks or failed (an answer the lists mark unread anyway). On a phone or a
50
+ * tablet never a banner: the unread of the list and its tab tell, a notice of the system while away.
51
+ */
52
+ function way(notice: Pick<WebSessionNotice, 'level'>, scene: SessionNoticeScene): SessionNoticeWay;
53
+ function level(notice: Pick<WebSessionNotice, 'level'>): NoticeLevel;
54
+ /** The banners of one conversation take each other's place. */
55
+ function bannerKey(notice: Pick<WebSessionNotice, 'key' | 'sessionId' | 'sessionFile'>): string;
56
+ /** The id of the message of an answer: the same on every page, so that it is sent once. */
57
+ function answerId(notice: Pick<WebSessionNotice, 'key'>, index: number): string;
58
+ }
59
+ /**
60
+ * Tells the user what conversations say, as a messenger does (WebExtensionUI.notifySession): each key once,
61
+ * the way SessionNoticeUtil.way picks.
62
+ */
63
+ export declare class SessionNotices implements TaSessionNotices {
64
+ protected readonly host: SessionNoticeHost;
65
+ protected readonly told: Set<string>;
66
+ constructor(host: SessionNoticeHost);
67
+ notify(notice: WebSessionNotice): SessionNoticeWay;
68
+ protected actions(notice: WebSessionNotice): NoticeAction[];
69
+ }
@@ -0,0 +1,92 @@
1
+ export const TaSessionNotices = Symbol('TaSessionNotices');
2
+ export var SessionNoticeUtil;
3
+ (function (SessionNoticeUtil) {
4
+ /** How many of a page's keys it remembers having told: a notice read again after it does not come twice. */
5
+ SessionNoticeUtil.TOLD = 200;
6
+ /**
7
+ * How to tell of it: not of what the user looks at, nor of a task the double tells of unless it asks; a
8
+ * banner while the user is on the page; a notice of the system while not, if there are any; else a banner
9
+ * that waits for them, only when it asks or failed (an answer the lists mark unread anyway). On a phone or a
10
+ * tablet never a banner: the unread of the list and its tab tell, a notice of the system while away.
11
+ */
12
+ function way(notice, scene) {
13
+ if (scene.task && notice.level !== 'ask') {
14
+ return 'none';
15
+ }
16
+ if (scene.focused) {
17
+ return scene.looking || scene.quiet ? 'none' : 'banner';
18
+ }
19
+ if (scene.system) {
20
+ return 'system';
21
+ }
22
+ return notice.level === 'done' || scene.quiet ? 'none' : 'waiting';
23
+ }
24
+ SessionNoticeUtil.way = way;
25
+ function level(notice) {
26
+ return notice.level === 'ask' ? 'warning' : notice.level === 'failed' ? 'error' : 'info';
27
+ }
28
+ SessionNoticeUtil.level = level;
29
+ /** The banners of one conversation take each other's place. */
30
+ function bannerKey(notice) {
31
+ var _a, _b;
32
+ return `session:${(_b = (_a = notice.sessionFile) !== null && _a !== void 0 ? _a : notice.sessionId) !== null && _b !== void 0 ? _b : notice.key}`;
33
+ }
34
+ SessionNoticeUtil.bannerKey = bannerKey;
35
+ /** The id of the message of an answer: the same on every page, so that it is sent once. */
36
+ function answerId(notice, index) {
37
+ return `notice:${notice.key}:${index}`;
38
+ }
39
+ SessionNoticeUtil.answerId = answerId;
40
+ })(SessionNoticeUtil || (SessionNoticeUtil = {}));
41
+ /**
42
+ * Tells the user what conversations say, as a messenger does (WebExtensionUI.notifySession): each key once,
43
+ * the way SessionNoticeUtil.way picks.
44
+ */
45
+ export class SessionNotices {
46
+ constructor(host) {
47
+ this.host = host;
48
+ this.told = new Set();
49
+ }
50
+ notify(notice) {
51
+ if (this.told.has(notice.key)) {
52
+ return 'none';
53
+ }
54
+ this.told.add(notice.key);
55
+ if (this.told.size > SessionNoticeUtil.TOLD) {
56
+ this.told.delete(this.told.values().next().value);
57
+ }
58
+ const way = SessionNoticeUtil.way(notice, this.host.scene(notice));
59
+ const title = way === 'none' ? '' : this.host.title(notice);
60
+ const open = () => void this.host.open(notice).catch(error => this.host.notices.error(error));
61
+ if (way === 'system') {
62
+ this.host.system(title, notice.text, { tag: SessionNoticeUtil.bannerKey(notice), silent: notice.level === 'done', onClick: open });
63
+ }
64
+ else if (way === 'banner' || way === 'waiting') {
65
+ const from = {
66
+ sessionId: notice.sessionId,
67
+ sessionFile: notice.sessionFile,
68
+ title,
69
+ status: notice.level === 'done' ? undefined : notice.level,
70
+ open,
71
+ };
72
+ this.host.notices.notify(notice.text, {
73
+ level: SessionNoticeUtil.level(notice),
74
+ key: SessionNoticeUtil.bannerKey(notice),
75
+ from,
76
+ actions: this.actions(notice),
77
+ // What waits for the user stays until they see it.
78
+ sticky: way === 'waiting' || notice.level === 'ask',
79
+ });
80
+ }
81
+ return way;
82
+ }
83
+ actions(notice) {
84
+ var _a, _b;
85
+ const answers = ((_a = notice.options) !== null && _a !== void 0 ? _a : []).map((option, index) => ({
86
+ label: option,
87
+ run: () => void this.host.answer(notice, option, SessionNoticeUtil.answerId(notice, index)).catch(error => this.host.notices.error(error)),
88
+ }));
89
+ return [...answers, ...((_b = notice.actions) !== null && _b !== void 0 ? _b : [])];
90
+ }
91
+ }
92
+ //# sourceMappingURL=session-notices.js.map
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Values this device keeps across starts, for what the page shows while it cannot reach the computer: more
3
+ * than localStorage holds (a conversation is up to about a megabyte), and read without holding up a frame.
4
+ */
5
+ export interface DeviceValues {
6
+ get<T>(key: string): Promise<T | undefined>;
7
+ /** The values whose key starts with `prefix`. */
8
+ entries<T>(prefix: string): Promise<[string, T][]>;
9
+ set(key: string, value: unknown): Promise<void>;
10
+ delete(key: string): Promise<void>;
11
+ /** Every value whose key starts with `prefix`. */
12
+ deleteAll(prefix: string): Promise<void>;
13
+ }
14
+ /** The keys of what is kept, each with the computer it is of: what one computer showed is not shown for another. */
15
+ export declare namespace OfflineKeys {
16
+ /** The answer of a call that reads (OfflineReads). */
17
+ function read(host: string, call: string): string;
18
+ /** The conversation of a session file (KeptChats). */
19
+ function chat(host: string, sessionFile: string): string;
20
+ /** Which conversations are kept, the one seen last at the end. */
21
+ function chats(host: string): string;
22
+ /** Takes off the device all that was kept of a computer. */
23
+ function forget(values: DeviceValues, host: string): Promise<void>;
24
+ }
25
+ /** In memory: where there is no IndexedDB (a test, a browser that has it off), kept for the page only. */
26
+ export declare class MemoryValues implements DeviceValues {
27
+ protected readonly values: Map<string, unknown>;
28
+ get<T>(key: string): Promise<T | undefined>;
29
+ entries<T>(prefix: string): Promise<[string, T][]>;
30
+ set(key: string, value: unknown): Promise<void>;
31
+ delete(key: string): Promise<void>;
32
+ deleteAll(prefix: string): Promise<void>;
33
+ }
34
+ /**
35
+ * In IndexedDB, one store of keys and values. What fails (no room, the database closed under it) is as if
36
+ * nothing were kept: the page then waits for the computer, as it would without.
37
+ */
38
+ export declare class IndexedValues implements DeviceValues {
39
+ protected readonly factory: IDBFactory;
40
+ static readonly DATABASE = "ta";
41
+ static readonly STORE = "kept";
42
+ protected database?: Promise<IDBDatabase | undefined>;
43
+ constructor(factory: IDBFactory);
44
+ get<T>(key: string): Promise<T | undefined>;
45
+ entries<T>(prefix: string): Promise<[string, T][]>;
46
+ set(key: string, value: unknown): Promise<void>;
47
+ delete(key: string): Promise<void>;
48
+ deleteAll(prefix: string): Promise<void>;
49
+ /** The keys that start with `prefix`. */
50
+ protected static range(prefix: string): IDBKeyRange;
51
+ protected open(): Promise<IDBDatabase | undefined>;
52
+ protected run<T>(mode: IDBTransactionMode, work: (store: IDBObjectStore) => IDBRequest | Promise<T>, otherwise: T): Promise<T>;
53
+ }
54
+ /** The values of this device: in IndexedDB when the browser has it. */
55
+ export declare function deviceValues(): DeviceValues;
@@ -0,0 +1,151 @@
1
+ /** The keys of what is kept, each with the computer it is of: what one computer showed is not shown for another. */
2
+ export var OfflineKeys;
3
+ (function (OfflineKeys) {
4
+ /** The answer of a call that reads (OfflineReads). */
5
+ function read(host, call) {
6
+ return `read|${host}|${call}`;
7
+ }
8
+ OfflineKeys.read = read;
9
+ /** The conversation of a session file (KeptChats). */
10
+ function chat(host, sessionFile) {
11
+ return `chat|${host}|${sessionFile}`;
12
+ }
13
+ OfflineKeys.chat = chat;
14
+ /** Which conversations are kept, the one seen last at the end. */
15
+ function chats(host) {
16
+ return `chats|${host}`;
17
+ }
18
+ OfflineKeys.chats = chats;
19
+ /** Takes off the device all that was kept of a computer. */
20
+ async function forget(values, host) {
21
+ await Promise.all([values.deleteAll(read(host, '')), values.deleteAll(chat(host, '')), values.delete(chats(host))]);
22
+ }
23
+ OfflineKeys.forget = forget;
24
+ })(OfflineKeys || (OfflineKeys = {}));
25
+ /** In memory: where there is no IndexedDB (a test, a browser that has it off), kept for the page only. */
26
+ export class MemoryValues {
27
+ constructor() {
28
+ this.values = new Map();
29
+ }
30
+ async get(key) {
31
+ return this.values.get(key);
32
+ }
33
+ async entries(prefix) {
34
+ return [...this.values].filter(([key]) => key.startsWith(prefix));
35
+ }
36
+ async set(key, value) {
37
+ this.values.set(key, value);
38
+ }
39
+ async delete(key) {
40
+ this.values.delete(key);
41
+ }
42
+ async deleteAll(prefix) {
43
+ for (const key of [...this.values.keys()]) {
44
+ if (key.startsWith(prefix)) {
45
+ this.values.delete(key);
46
+ }
47
+ }
48
+ }
49
+ }
50
+ /**
51
+ * In IndexedDB, one store of keys and values. What fails (no room, the database closed under it) is as if
52
+ * nothing were kept: the page then waits for the computer, as it would without.
53
+ */
54
+ export class IndexedValues {
55
+ constructor(factory) {
56
+ this.factory = factory;
57
+ }
58
+ get(key) {
59
+ return this.run('readonly', store => store.get(key), undefined);
60
+ }
61
+ entries(prefix) {
62
+ return this.run('readonly', store => new Promise((resolve, reject) => {
63
+ const found = [];
64
+ const cursor = store.openCursor(IndexedValues.range(prefix));
65
+ cursor.onsuccess = () => {
66
+ const at = cursor.result;
67
+ if (!at) {
68
+ resolve(found);
69
+ return;
70
+ }
71
+ found.push([String(at.key), at.value]);
72
+ at.continue();
73
+ };
74
+ cursor.onerror = () => reject(cursor.error);
75
+ }), []);
76
+ }
77
+ set(key, value) {
78
+ return this.run('readwrite', store => store.put(value, key), undefined);
79
+ }
80
+ delete(key) {
81
+ return this.run('readwrite', store => store.delete(key), undefined);
82
+ }
83
+ deleteAll(prefix) {
84
+ return this.run('readwrite', store => store.delete(IndexedValues.range(prefix)), undefined);
85
+ }
86
+ /** The keys that start with `prefix`. */
87
+ static range(prefix) {
88
+ return IDBKeyRange.bound(prefix, `${prefix}\uffff`);
89
+ }
90
+ open() {
91
+ var _a;
92
+ (_a = this.database) !== null && _a !== void 0 ? _a : (this.database = new Promise(resolve => {
93
+ try {
94
+ const request = this.factory.open(IndexedValues.DATABASE, 1);
95
+ request.onupgradeneeded = () => request.result.createObjectStore(IndexedValues.STORE);
96
+ request.onsuccess = () => {
97
+ const database = request.result;
98
+ // Closed by the browser (storage cleared): opened again next time.
99
+ database.onclose = () => {
100
+ this.database = undefined;
101
+ };
102
+ resolve(database);
103
+ };
104
+ request.onerror = () => resolve(undefined);
105
+ request.onblocked = () => resolve(undefined);
106
+ }
107
+ catch (_a) {
108
+ resolve(undefined);
109
+ }
110
+ }));
111
+ return this.database;
112
+ }
113
+ async run(mode, work, otherwise) {
114
+ const database = await this.open();
115
+ if (!database) {
116
+ return otherwise;
117
+ }
118
+ try {
119
+ const transaction = database.transaction(IndexedValues.STORE, mode);
120
+ const request = work(transaction.objectStore(IndexedValues.STORE));
121
+ if (request instanceof Promise) {
122
+ return await request;
123
+ }
124
+ // A write is done once its transaction committed, not when its request succeeded: a load of the page in between aborts it.
125
+ return await new Promise((resolve, reject) => {
126
+ request.onsuccess = () => {
127
+ if (mode === 'readonly') {
128
+ resolve(request.result);
129
+ }
130
+ };
131
+ request.onerror = () => reject(request.error);
132
+ if (mode !== 'readonly') {
133
+ transaction.oncomplete = () => resolve(request.result);
134
+ transaction.onabort = () => reject(transaction.error);
135
+ }
136
+ });
137
+ }
138
+ catch (_a) {
139
+ return otherwise;
140
+ }
141
+ }
142
+ }
143
+ IndexedValues.DATABASE = 'ta';
144
+ IndexedValues.STORE = 'kept';
145
+ let shared;
146
+ /** The values of this device: in IndexedDB when the browser has it. */
147
+ export function deviceValues() {
148
+ shared !== null && shared !== void 0 ? shared : (shared = typeof indexedDB === 'undefined' ? new MemoryValues() : new IndexedValues(indexedDB));
149
+ return shared;
150
+ }
151
+ //# sourceMappingURL=device-values.js.map