@celljs/ta-web 4.9.0 → 4.10.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 (376) hide show
  1. package/README.en.md +4 -3
  2. package/README.md +4 -3
  3. package/esm/browser/assistant/assistant-chat-list.js +8 -2
  4. package/esm/browser/assistant/assistant-extension.d.ts +8 -1
  5. package/esm/browser/assistant/assistant-extension.js +33 -5
  6. package/esm/browser/assistant/assistant-protocol.d.ts +3 -1
  7. package/esm/browser/assistant/assistant-task-source.d.ts +2 -0
  8. package/esm/browser/assistant/assistant-task-source.js +2 -0
  9. package/esm/browser/assistant/assistant-task-util.d.ts +8 -0
  10. package/esm/browser/assistant/assistant-task-util.js +13 -3
  11. package/esm/browser/assistant/assistant-tasks.js +3 -2
  12. package/esm/browser/assistant/assistant-view.js +81 -56
  13. package/esm/browser/assistant/assistant.d.ts +30 -1
  14. package/esm/browser/assistant/assistant.js +89 -6
  15. package/esm/browser/assistant/task-views.d.ts +40 -6
  16. package/esm/browser/assistant/task-views.js +73 -21
  17. package/esm/browser/avatar/dino-avatar.d.ts +3 -4
  18. package/esm/browser/avatar/dino-avatar.js +4 -178
  19. package/esm/browser/avatar/dino-face.d.ts +19 -0
  20. package/esm/browser/avatar/dino-face.js +142 -0
  21. package/esm/browser/avatar/dino-geometry.d.ts +11 -0
  22. package/esm/browser/avatar/dino-geometry.js +38 -0
  23. package/esm/browser/avatar/dino-kinds.d.ts +15 -0
  24. package/esm/browser/avatar/dino-kinds.js +544 -0
  25. package/esm/browser/avatar/dino-motion.js +1 -1
  26. package/esm/browser/avatar/dino-shape.d.ts +80 -0
  27. package/esm/browser/avatar/dino-shape.js +113 -0
  28. package/esm/browser/avatar/dino-species.d.ts +1 -61
  29. package/esm/browser/avatar/dino-species.js +2 -653
  30. package/esm/browser/chat/chat-packages.d.ts +39 -0
  31. package/esm/browser/chat/chat-packages.js +70 -0
  32. package/esm/browser/chat/chat-protocol.d.ts +23 -1
  33. package/esm/browser/chat/chat-stores.d.ts +59 -0
  34. package/esm/browser/chat/chat-stores.js +121 -0
  35. package/esm/browser/chat/chat-util.d.ts +17 -0
  36. package/esm/browser/chat/chat-util.js +61 -0
  37. package/esm/browser/chat/chat-view.js +33 -12
  38. package/esm/browser/chat/chat.d.ts +31 -39
  39. package/esm/browser/chat/chat.js +226 -175
  40. package/esm/browser/components/access-view.js +1 -1
  41. package/esm/browser/components/account-menu.js +1 -1
  42. package/esm/browser/components/app-nav.d.ts +6 -3
  43. package/esm/browser/components/app-nav.js +19 -10
  44. package/esm/browser/components/app-shell-hooks.d.ts +47 -0
  45. package/esm/browser/components/app-shell-hooks.js +169 -0
  46. package/esm/browser/components/app-view.js +81 -172
  47. package/esm/browser/components/auth-view.js +1 -1
  48. package/esm/browser/components/chat-list.d.ts +20 -2
  49. package/esm/browser/components/chat-list.js +138 -22
  50. package/esm/browser/components/composer-box.d.ts +5 -5
  51. package/esm/browser/components/composer-box.js +111 -4
  52. package/esm/browser/components/composer.d.ts +7 -0
  53. package/esm/browser/components/composer.js +22 -14
  54. package/esm/browser/components/connection-bar.js +50 -17
  55. package/esm/browser/components/context-menu.d.ts +30 -4
  56. package/esm/browser/components/context-menu.js +199 -37
  57. package/esm/browser/components/conversation-scroll.d.ts +129 -6
  58. package/esm/browser/components/conversation-scroll.js +429 -109
  59. package/esm/browser/components/dino.js +1 -1
  60. package/esm/browser/components/earlier-messages.d.ts +2 -1
  61. package/esm/browser/components/earlier-messages.js +2 -17
  62. package/esm/browser/components/editor-area.d.ts +3 -1
  63. package/esm/browser/components/editor-area.js +6 -5
  64. package/esm/browser/components/empty-pictures.d.ts +0 -2
  65. package/esm/browser/components/empty-pictures.js +0 -16
  66. package/esm/browser/components/folder-picker.d.ts +5 -2
  67. package/esm/browser/components/folder-picker.js +30 -9
  68. package/esm/browser/components/held-talk.d.ts +28 -0
  69. package/esm/browser/components/held-talk.js +76 -0
  70. package/esm/browser/components/host-view.d.ts +1 -1
  71. package/esm/browser/components/host-view.js +1 -1
  72. package/esm/browser/components/icon.d.ts +2 -2
  73. package/esm/browser/components/icon.js +5 -6
  74. package/esm/browser/components/image-viewer.d.ts +124 -0
  75. package/esm/browser/components/image-viewer.js +397 -0
  76. package/esm/browser/components/lightbox.d.ts +11 -0
  77. package/esm/browser/components/lightbox.js +24 -0
  78. package/esm/browser/components/markdown.d.ts +6 -2
  79. package/esm/browser/components/markdown.js +24 -10
  80. package/esm/browser/components/media.js +1 -10
  81. package/esm/browser/components/message-footer.d.ts +16 -2
  82. package/esm/browser/components/message-footer.js +29 -12
  83. package/esm/browser/components/message-list.d.ts +24 -3
  84. package/esm/browser/components/message-list.js +149 -20
  85. package/esm/browser/components/message-menu.d.ts +3 -1
  86. package/esm/browser/components/message-menu.js +18 -3
  87. package/esm/browser/components/nav-places.d.ts +16 -1
  88. package/esm/browser/components/nav-places.js +12 -3
  89. package/esm/browser/components/phone-shell.d.ts +4 -1
  90. package/esm/browser/components/phone-shell.js +3 -1
  91. package/esm/browser/components/run-status.js +3 -3
  92. package/esm/browser/components/select-bar.d.ts +9 -0
  93. package/esm/browser/components/select-bar.js +24 -0
  94. package/esm/browser/components/session-settings.d.ts +6 -0
  95. package/esm/browser/components/session-settings.js +14 -1
  96. package/esm/browser/components/session-view.js +8 -4
  97. package/esm/browser/components/settings-choices.d.ts +35 -0
  98. package/esm/browser/components/settings-choices.js +117 -0
  99. package/esm/browser/components/settings-parts.d.ts +21 -0
  100. package/esm/browser/components/settings-parts.js +323 -0
  101. package/esm/browser/components/settings-view.d.ts +0 -6
  102. package/esm/browser/components/settings-view.js +4 -406
  103. package/esm/browser/components/swipe-row.d.ts +2 -2
  104. package/esm/browser/components/swipe-row.js +7 -3
  105. package/esm/browser/components/tool-view.js +14 -12
  106. package/esm/browser/components/voice-button.d.ts +1 -1
  107. package/esm/browser/components/voice-button.js +1 -1
  108. package/esm/browser/components/voice-talk.d.ts +43 -0
  109. package/esm/browser/components/voice-talk.js +222 -0
  110. package/esm/browser/components/workbench-view.js +1 -1
  111. package/esm/browser/device/device.d.ts +3 -0
  112. package/esm/browser/device/device.js +11 -1
  113. package/esm/browser/device/hold.d.ts +42 -0
  114. package/esm/browser/device/hold.js +136 -0
  115. package/esm/browser/device/launch-screen.d.ts +1 -1
  116. package/esm/browser/device/launch-screen.js +1 -1
  117. package/esm/browser/device/long-press.d.ts +2 -0
  118. package/esm/browser/device/long-press.js +16 -1
  119. package/esm/browser/device/pull-down.d.ts +4 -2
  120. package/esm/browser/device/pull-down.js +64 -76
  121. package/esm/browser/device/row-swipe.d.ts +35 -10
  122. package/esm/browser/device/row-swipe.js +149 -71
  123. package/esm/browser/device/shake-undo.d.ts +16 -0
  124. package/esm/browser/device/shake-undo.js +59 -0
  125. package/esm/browser/device/sheet-swipe.d.ts +118 -18
  126. package/esm/browser/device/sheet-swipe.js +406 -107
  127. package/esm/browser/extension/icons.js +2 -1
  128. package/esm/browser/extension/web-extension-api.d.ts +135 -2
  129. package/esm/browser/extension/web-extension-code.d.ts +6 -0
  130. package/esm/browser/extension/web-extension-code.js +24 -0
  131. package/esm/browser/extension/web-extension-protocol.d.ts +23 -1
  132. package/esm/browser/extension/web-extension-protocol.js +8 -0
  133. package/esm/browser/extension/web-extensions.d.ts +14 -1
  134. package/esm/browser/extension/web-extensions.js +128 -24
  135. package/esm/browser/extension/web-tasks.d.ts +9 -1
  136. package/esm/browser/extension/web-tasks.js +24 -0
  137. package/esm/browser/files/files-protocol.d.ts +25 -0
  138. package/esm/browser/files/files-protocol.js +2 -0
  139. package/esm/browser/files/files.d.ts +35 -0
  140. package/esm/browser/files/files.js +119 -0
  141. package/esm/browser/hooks.d.ts +3 -1
  142. package/esm/browser/hooks.js +8 -0
  143. package/esm/browser/i18n/locales.d.ts +29 -2
  144. package/esm/browser/i18n/messages.d.ts +28 -1
  145. package/esm/browser/i18n/messages.js +58 -4
  146. package/esm/browser/index.d.ts +6 -0
  147. package/esm/browser/index.js +6 -0
  148. package/esm/browser/notices/notices-protocol.d.ts +9 -1
  149. package/esm/browser/notices/notices.d.ts +2 -0
  150. package/esm/browser/notices/notices.js +20 -10
  151. package/esm/browser/offline/device-values.d.ts +55 -0
  152. package/esm/browser/offline/device-values.js +142 -0
  153. package/esm/browser/offline/kept-chats-protocol.d.ts +17 -0
  154. package/esm/browser/offline/kept-chats-protocol.js +2 -0
  155. package/esm/browser/offline/kept-chats.d.ts +47 -0
  156. package/esm/browser/offline/kept-chats.js +146 -0
  157. package/esm/browser/offline/offline-reads.d.ts +44 -0
  158. package/esm/browser/offline/offline-reads.js +107 -0
  159. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  160. package/esm/browser/settings/settings-protocol.js +2 -0
  161. package/esm/browser/style/conversation.d.ts +1 -1
  162. package/esm/browser/style/conversation.js +57 -17
  163. package/esm/browser/style/device.js +43 -4
  164. package/esm/browser/style/layout.d.ts +1 -1
  165. package/esm/browser/style/layout.js +67 -15
  166. package/esm/browser/style/pages.d.ts +1 -1
  167. package/esm/browser/style/pages.js +2 -1
  168. package/esm/browser/style/shell.d.ts +1 -1
  169. package/esm/browser/style/shell.js +47 -3
  170. package/esm/browser/style/tasks.d.ts +1 -1
  171. package/esm/browser/style/tasks.js +2 -0
  172. package/esm/browser/util/frame.d.ts +5 -4
  173. package/esm/browser/util/frame.js +5 -4
  174. package/esm/browser/util/markdown.d.ts +18 -1
  175. package/esm/browser/util/markdown.js +119 -5
  176. package/esm/browser/util/process.d.ts +21 -0
  177. package/esm/browser/util/process.js +45 -1
  178. package/esm/browser/util/voice.d.ts +5 -2
  179. package/esm/browser/util/voice.js +6 -3
  180. package/esm/browser/util/zoom.d.ts +46 -0
  181. package/esm/browser/util/zoom.js +96 -0
  182. package/esm/browser/workbench-calls.d.ts +59 -0
  183. package/esm/browser/workbench-calls.js +141 -0
  184. package/esm/browser/workbench-protocol.d.ts +5 -1
  185. package/esm/browser/workbench-util.d.ts +68 -0
  186. package/esm/browser/workbench-util.js +145 -0
  187. package/esm/browser/workbench.d.ts +15 -42
  188. package/esm/browser/workbench.js +53 -167
  189. package/lib/browser/assistant/assistant-chat-list.js +8 -2
  190. package/lib/browser/assistant/assistant-extension.d.ts +8 -1
  191. package/lib/browser/assistant/assistant-extension.js +33 -5
  192. package/lib/browser/assistant/assistant-protocol.d.ts +3 -1
  193. package/lib/browser/assistant/assistant-task-source.d.ts +2 -0
  194. package/lib/browser/assistant/assistant-task-source.js +2 -0
  195. package/lib/browser/assistant/assistant-task-util.d.ts +8 -0
  196. package/lib/browser/assistant/assistant-task-util.js +13 -3
  197. package/lib/browser/assistant/assistant-tasks.js +2 -1
  198. package/lib/browser/assistant/assistant-view.js +78 -53
  199. package/lib/browser/assistant/assistant.d.ts +30 -1
  200. package/lib/browser/assistant/assistant.js +89 -6
  201. package/lib/browser/assistant/task-views.d.ts +40 -6
  202. package/lib/browser/assistant/task-views.js +74 -21
  203. package/lib/browser/avatar/dino-avatar.d.ts +3 -4
  204. package/lib/browser/avatar/dino-avatar.js +27 -202
  205. package/lib/browser/avatar/dino-face.d.ts +20 -0
  206. package/lib/browser/avatar/dino-face.js +148 -0
  207. package/lib/browser/avatar/dino-geometry.d.ts +12 -0
  208. package/lib/browser/avatar/dino-geometry.js +47 -0
  209. package/lib/browser/avatar/dino-kinds.d.ts +16 -0
  210. package/lib/browser/avatar/dino-kinds.js +547 -0
  211. package/lib/browser/avatar/dino-motion.js +2 -2
  212. package/lib/browser/avatar/dino-shape.d.ts +81 -0
  213. package/lib/browser/avatar/dino-shape.js +126 -0
  214. package/lib/browser/avatar/dino-species.d.ts +1 -61
  215. package/lib/browser/avatar/dino-species.js +34 -687
  216. package/lib/browser/chat/chat-packages.d.ts +40 -0
  217. package/lib/browser/chat/chat-packages.js +74 -0
  218. package/lib/browser/chat/chat-protocol.d.ts +23 -1
  219. package/lib/browser/chat/chat-stores.d.ts +60 -0
  220. package/lib/browser/chat/chat-stores.js +125 -0
  221. package/lib/browser/chat/chat-util.d.ts +18 -0
  222. package/lib/browser/chat/chat-util.js +64 -0
  223. package/lib/browser/chat/chat-view.js +33 -12
  224. package/lib/browser/chat/chat.d.ts +31 -39
  225. package/lib/browser/chat/chat.js +227 -176
  226. package/lib/browser/components/access-view.js +2 -2
  227. package/lib/browser/components/account-menu.js +2 -2
  228. package/lib/browser/components/app-nav.d.ts +6 -3
  229. package/lib/browser/components/app-nav.js +17 -8
  230. package/lib/browser/components/app-shell-hooks.d.ts +48 -0
  231. package/lib/browser/components/app-shell-hooks.js +211 -0
  232. package/lib/browser/components/app-view.js +89 -180
  233. package/lib/browser/components/auth-view.js +3 -3
  234. package/lib/browser/components/chat-list.d.ts +20 -2
  235. package/lib/browser/components/chat-list.js +137 -21
  236. package/lib/browser/components/composer-box.d.ts +5 -5
  237. package/lib/browser/components/composer-box.js +111 -4
  238. package/lib/browser/components/composer.d.ts +7 -0
  239. package/lib/browser/components/composer.js +22 -14
  240. package/lib/browser/components/connection-bar.js +48 -15
  241. package/lib/browser/components/context-menu.d.ts +30 -4
  242. package/lib/browser/components/context-menu.js +198 -36
  243. package/lib/browser/components/conversation-scroll.d.ts +129 -6
  244. package/lib/browser/components/conversation-scroll.js +431 -110
  245. package/lib/browser/components/dino.js +3 -3
  246. package/lib/browser/components/earlier-messages.d.ts +2 -1
  247. package/lib/browser/components/earlier-messages.js +2 -17
  248. package/lib/browser/components/editor-area.d.ts +3 -1
  249. package/lib/browser/components/editor-area.js +5 -4
  250. package/lib/browser/components/empty-pictures.d.ts +0 -2
  251. package/lib/browser/components/empty-pictures.js +0 -17
  252. package/lib/browser/components/folder-picker.d.ts +5 -2
  253. package/lib/browser/components/folder-picker.js +30 -9
  254. package/lib/browser/components/held-talk.d.ts +29 -0
  255. package/lib/browser/components/held-talk.js +79 -0
  256. package/lib/browser/components/host-view.d.ts +1 -1
  257. package/lib/browser/components/host-view.js +5 -5
  258. package/lib/browser/components/icon.d.ts +2 -2
  259. package/lib/browser/components/icon.js +7 -6
  260. package/lib/browser/components/image-viewer.d.ts +125 -0
  261. package/lib/browser/components/image-viewer.js +435 -0
  262. package/lib/browser/components/lightbox.d.ts +12 -0
  263. package/lib/browser/components/lightbox.js +60 -0
  264. package/lib/browser/components/markdown.d.ts +6 -2
  265. package/lib/browser/components/markdown.js +24 -10
  266. package/lib/browser/components/media.js +2 -11
  267. package/lib/browser/components/message-footer.d.ts +16 -2
  268. package/lib/browser/components/message-footer.js +31 -12
  269. package/lib/browser/components/message-list.d.ts +24 -3
  270. package/lib/browser/components/message-list.js +146 -16
  271. package/lib/browser/components/message-menu.d.ts +3 -1
  272. package/lib/browser/components/message-menu.js +17 -2
  273. package/lib/browser/components/nav-places.d.ts +16 -1
  274. package/lib/browser/components/nav-places.js +13 -3
  275. package/lib/browser/components/phone-shell.d.ts +4 -1
  276. package/lib/browser/components/phone-shell.js +3 -1
  277. package/lib/browser/components/run-status.js +3 -3
  278. package/lib/browser/components/select-bar.d.ts +10 -0
  279. package/lib/browser/components/select-bar.js +61 -0
  280. package/lib/browser/components/session-settings.d.ts +6 -0
  281. package/lib/browser/components/session-settings.js +14 -1
  282. package/lib/browser/components/session-view.js +7 -3
  283. package/lib/browser/components/settings-choices.d.ts +36 -0
  284. package/lib/browser/components/settings-choices.js +156 -0
  285. package/lib/browser/components/settings-parts.d.ts +22 -0
  286. package/lib/browser/components/settings-parts.js +359 -0
  287. package/lib/browser/components/settings-view.d.ts +0 -6
  288. package/lib/browser/components/settings-view.js +2 -405
  289. package/lib/browser/components/swipe-row.d.ts +2 -2
  290. package/lib/browser/components/swipe-row.js +7 -3
  291. package/lib/browser/components/tool-view.js +14 -12
  292. package/lib/browser/components/voice-button.d.ts +1 -1
  293. package/lib/browser/components/voice-button.js +1 -1
  294. package/lib/browser/components/voice-talk.d.ts +44 -0
  295. package/lib/browser/components/voice-talk.js +260 -0
  296. package/lib/browser/components/workbench-view.js +3 -3
  297. package/lib/browser/device/device.d.ts +3 -0
  298. package/lib/browser/device/device.js +11 -1
  299. package/lib/browser/device/hold.d.ts +43 -0
  300. package/lib/browser/device/hold.js +173 -0
  301. package/lib/browser/device/launch-screen.d.ts +1 -1
  302. package/lib/browser/device/launch-screen.js +1 -1
  303. package/lib/browser/device/long-press.d.ts +2 -0
  304. package/lib/browser/device/long-press.js +16 -1
  305. package/lib/browser/device/pull-down.d.ts +4 -2
  306. package/lib/browser/device/pull-down.js +63 -75
  307. package/lib/browser/device/row-swipe.d.ts +35 -10
  308. package/lib/browser/device/row-swipe.js +148 -70
  309. package/lib/browser/device/shake-undo.d.ts +17 -0
  310. package/lib/browser/device/shake-undo.js +63 -0
  311. package/lib/browser/device/sheet-swipe.d.ts +118 -18
  312. package/lib/browser/device/sheet-swipe.js +410 -108
  313. package/lib/browser/extension/icons.js +1 -0
  314. package/lib/browser/extension/web-extension-api.d.ts +135 -2
  315. package/lib/browser/extension/web-extension-code.d.ts +6 -0
  316. package/lib/browser/extension/web-extension-code.js +24 -0
  317. package/lib/browser/extension/web-extension-protocol.d.ts +23 -1
  318. package/lib/browser/extension/web-extension-protocol.js +9 -1
  319. package/lib/browser/extension/web-extensions.d.ts +14 -1
  320. package/lib/browser/extension/web-extensions.js +125 -21
  321. package/lib/browser/extension/web-tasks.d.ts +9 -1
  322. package/lib/browser/extension/web-tasks.js +24 -0
  323. package/lib/browser/files/files-protocol.d.ts +26 -0
  324. package/lib/browser/files/files-protocol.js +5 -0
  325. package/lib/browser/files/files.d.ts +36 -0
  326. package/lib/browser/files/files.js +122 -0
  327. package/lib/browser/hooks.d.ts +3 -1
  328. package/lib/browser/hooks.js +9 -0
  329. package/lib/browser/i18n/locales.d.ts +29 -2
  330. package/lib/browser/i18n/messages.d.ts +28 -1
  331. package/lib/browser/i18n/messages.js +58 -4
  332. package/lib/browser/index.d.ts +6 -0
  333. package/lib/browser/index.js +6 -0
  334. package/lib/browser/notices/notices-protocol.d.ts +9 -1
  335. package/lib/browser/notices/notices.d.ts +2 -0
  336. package/lib/browser/notices/notices.js +20 -10
  337. package/lib/browser/offline/device-values.d.ts +56 -0
  338. package/lib/browser/offline/device-values.js +148 -0
  339. package/lib/browser/offline/kept-chats-protocol.d.ts +18 -0
  340. package/lib/browser/offline/kept-chats-protocol.js +5 -0
  341. package/lib/browser/offline/kept-chats.d.ts +48 -0
  342. package/lib/browser/offline/kept-chats.js +149 -0
  343. package/lib/browser/offline/offline-reads.d.ts +45 -0
  344. package/lib/browser/offline/offline-reads.js +111 -0
  345. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  346. package/lib/browser/settings/settings-protocol.js +2 -0
  347. package/lib/browser/style/conversation.d.ts +1 -1
  348. package/lib/browser/style/conversation.js +57 -17
  349. package/lib/browser/style/device.js +43 -4
  350. package/lib/browser/style/layout.d.ts +1 -1
  351. package/lib/browser/style/layout.js +67 -15
  352. package/lib/browser/style/pages.d.ts +1 -1
  353. package/lib/browser/style/pages.js +2 -1
  354. package/lib/browser/style/shell.d.ts +1 -1
  355. package/lib/browser/style/shell.js +47 -3
  356. package/lib/browser/style/tasks.d.ts +1 -1
  357. package/lib/browser/style/tasks.js +2 -0
  358. package/lib/browser/util/frame.d.ts +5 -4
  359. package/lib/browser/util/frame.js +5 -4
  360. package/lib/browser/util/markdown.d.ts +18 -1
  361. package/lib/browser/util/markdown.js +119 -5
  362. package/lib/browser/util/process.d.ts +21 -0
  363. package/lib/browser/util/process.js +46 -2
  364. package/lib/browser/util/voice.d.ts +5 -2
  365. package/lib/browser/util/voice.js +6 -3
  366. package/lib/browser/util/zoom.d.ts +47 -0
  367. package/lib/browser/util/zoom.js +99 -0
  368. package/lib/browser/workbench-calls.d.ts +60 -0
  369. package/lib/browser/workbench-calls.js +145 -0
  370. package/lib/browser/workbench-protocol.d.ts +5 -1
  371. package/lib/browser/workbench-util.d.ts +69 -0
  372. package/lib/browser/workbench-util.js +151 -0
  373. package/lib/browser/workbench.d.ts +15 -42
  374. package/lib/browser/workbench.js +74 -189
  375. package/package.json +10 -10
  376. package/public/launch.svg +46 -42
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProcessUtil = exports.VISIBLE_STEPS = void 0;
3
+ exports.ProcessUtil = exports.TIME_BREAK_MS = exports.VISIBLE_STEPS = void 0;
4
+ const ta_protocol_1 = require("@celljs/ta-protocol");
4
5
  const message_1 = require("./message");
5
6
  /** While the agent works, only the latest steps show; the earlier ones fold into one row. */
6
7
  exports.VISIBLE_STEPS = 8;
8
+ /** A time shows between two items of the conversation this long apart, as in WeChat. */
9
+ exports.TIME_BREAK_MS = 5 * 60000;
7
10
  const TURN_ROLES = new Set(['assistant', 'toolResult']);
8
11
  /**
9
12
  * How the conversation is laid out (thinking and tool calls folded into steps): pure functions over pi's
@@ -55,7 +58,8 @@ var ProcessUtil;
55
58
  steps.push({ kind: 'thinking', key, text: block.thinking });
56
59
  }
57
60
  else if (block.type === 'text' && ((_b = block.text) === null || _b === void 0 ? void 0 : _b.trim())) {
58
- steps.push({ kind: 'text', key, text: block.text });
61
+ const summary = ta_protocol_1.TaAgentSummary.read(block.text);
62
+ steps.push(summary === undefined ? { kind: 'text', key, text: block.text } : { kind: 'summary', key, text: summary });
59
63
  }
60
64
  else if (block.type === 'toolCall') {
61
65
  steps.push({ kind: 'tool', key: block.id || key, call: block });
@@ -126,6 +130,46 @@ var ProcessUtil;
126
130
  return last && stopReason !== 'aborted' ? 'done' : 'idle';
127
131
  }
128
132
  ProcessUtil.mood = mood;
133
+ /** When each item began: its first message; one still empty (a turn about to come), when the one before did. */
134
+ function starts(items) {
135
+ let last = Number.NEGATIVE_INFINITY;
136
+ return items.map(item => {
137
+ const first = item.kind === 'turn' ? item.messages[0] : item.message;
138
+ const at = first === null || first === void 0 ? void 0 : first.timestamp;
139
+ last = typeof at === 'number' ? at : last;
140
+ return last;
141
+ });
142
+ }
143
+ ProcessUtil.starts = starts;
144
+ /**
145
+ * The item draws something: not a custom message the model sees and the user does not (`display`
146
+ * false), unless a web extension registered a renderer for its type (`renderers`).
147
+ */
148
+ function shown(item, renderers) {
149
+ if (item.kind === 'turn' || item.message.role !== 'custom') {
150
+ return true;
151
+ }
152
+ const { display, customType } = item.message;
153
+ return !!display || (customType !== undefined && renderers[customType] !== undefined);
154
+ }
155
+ ProcessUtil.shown = shown;
156
+ /**
157
+ * The time to show above each item, as WeChat does between messages: above the first item with a time,
158
+ * and above one that began `TIME_BREAK_MS` or more after the one shown before it; else undefined. An
159
+ * item not `shown` has none and is not the one before: two times would else stand one on the other.
160
+ */
161
+ function timeBreaks(starts, shown = () => true) {
162
+ let before = Number.NEGATIVE_INFINITY;
163
+ return starts.map((at, index) => {
164
+ if (!shown(index)) {
165
+ return undefined;
166
+ }
167
+ const time = Number.isFinite(at) && (!Number.isFinite(before) || at - before >= exports.TIME_BREAK_MS) ? at : undefined;
168
+ before = at;
169
+ return time;
170
+ });
171
+ }
172
+ ProcessUtil.timeBreaks = timeBreaks;
129
173
  /** The two items show the same: their messages are the same objects, and so is whether it works. */
130
174
  function same(a, b) {
131
175
  if (a.kind === 'message' || b.kind === 'message') {
@@ -7,8 +7,11 @@ export declare namespace Voice {
7
7
  interface Listening {
8
8
  stop(): void;
9
9
  }
10
- /** Listens for one utterance: `onText` gets the words so far, then the final ones with `final` set. */
11
- function listen(language: string, onText: (text: string, final: boolean) => void, onEnd: (error?: string) => void): Listening | undefined;
10
+ /**
11
+ * Listens for one utterance: `onText` gets the words so far, then the final ones with `final` set. `continuous`
12
+ * goes on past a pause, until it is stopped: what a finger held on the box says, not one thing said to it.
13
+ */
14
+ function listen(language: string, onText: (text: string, final: boolean) => void, onEnd: (error?: string) => void, continuous?: boolean): Listening | undefined;
12
15
  /** Text for the ear: no markdown marks, no code. */
13
16
  function spoken(markdown: string): string;
14
17
  function speak(markdown: string, language: string, onEnd: () => void): void;
@@ -22,8 +22,11 @@ var Voice;
22
22
  return typeof speechSynthesis !== 'undefined';
23
23
  }
24
24
  Voice.canSpeak = canSpeak;
25
- /** Listens for one utterance: `onText` gets the words so far, then the final ones with `final` set. */
26
- function listen(language, onText, onEnd) {
25
+ /**
26
+ * Listens for one utterance: `onText` gets the words so far, then the final ones with `final` set. `continuous`
27
+ * goes on past a pause, until it is stopped: what a finger held on the box says, not one thing said to it.
28
+ */
29
+ function listen(language, onText, onEnd, continuous = false) {
27
30
  const Recognition = recognitionClass();
28
31
  if (!Recognition) {
29
32
  return undefined;
@@ -31,7 +34,7 @@ var Voice;
31
34
  const recognition = new Recognition();
32
35
  recognition.lang = language;
33
36
  recognition.interimResults = true;
34
- recognition.continuous = false;
37
+ recognition.continuous = continuous;
35
38
  let text = '';
36
39
  recognition.onresult = event => {
37
40
  let final = false;
@@ -0,0 +1,47 @@
1
+ /** The size of a picture or of the box it is shown in, in CSS pixels. */
2
+ export interface ZoomSize {
3
+ width: number;
4
+ height: number;
5
+ }
6
+ /** How far a picture may be zoomed in its box: `base` it shows at first, between `min` and `max`. */
7
+ export interface ZoomLimits {
8
+ base: number;
9
+ min: number;
10
+ max: number;
11
+ }
12
+ /**
13
+ * A picture zoomed in a box that scrolls: how big it is drawn, where it is in what scrolls, and how far that
14
+ * scrolls so that a point of the picture stays under the fingers or the pointer. Pure, for the tests.
15
+ */
16
+ export declare namespace ZoomUtil {
17
+ /** Space around the picture at every scale, so that its edges never touch the box. */
18
+ const PAD = 16;
19
+ /** The steps of the + and − buttons and keys. */
20
+ const STOPS: number[];
21
+ /** At this scale and over, its pixels are drawn as squares, as the viewers of pictures do. */
22
+ const PIXELATED = 4;
23
+ /** The scale at which all of the picture shows in the box: what it shows at first unless that is larger than its own pixels. */
24
+ function contain(image: ZoomSize, box: ZoomSize): number;
25
+ /** All of it in the box, never larger than its own pixels; no smaller than that, and in to at least LEAST_MAX. */
26
+ function limits(image: ZoomSize, box: ZoomSize): ZoomLimits;
27
+ function clamp(scale: number, limits: ZoomLimits): number;
28
+ /** What a pinch past the limits draws: it goes on, ever less far. */
29
+ function rubber(scale: number, limits: ZoomLimits): number;
30
+ /** Where the picture starts along an axis of `box` pixels, `size` pixels drawn: centred while smaller, else after PAD. */
31
+ function offset(size: number, box: number): number;
32
+ /** How long what scrolls is along an axis: the box, or the picture and PAD on both sides. */
33
+ function extent(size: number, box: number): number;
34
+ /** Where in the picture (its own pixels) a point of the box is, along an axis, the picture `natural` pixels long at `scale`. */
35
+ function at(point: number, scroll: number, natural: number, scale: number, box: number): number;
36
+ /** How far to scroll along an axis so that `spot` of the picture (its own pixels) is under `point` of the box, at `scale`. */
37
+ function scrollTo(spot: number, point: number, natural: number, scale: number, box: number): number;
38
+ /** The next step in (`way` 1) or out (-1) from `scale`; `base` is a step too. */
39
+ function step(scale: number, way: 1 | -1, limits: ZoomLimits): number;
40
+ /** Whether it shows as at first. */
41
+ function fitted(scale: number, limits: ZoomLimits): boolean;
42
+ /** A double tap or click: back to `base` when zoomed, else in, to its own pixels when that is a few times nearer. */
43
+ function toggle(scale: number, limits: ZoomLimits): number;
44
+ /** How much a turn of the wheel or a pinch of the trackpad (a wheel with Ctrl) zooms: `deltaY` in `deltaMode`'s unit. */
45
+ function wheel(deltaY: number, deltaMode: number): number;
46
+ }
47
+ //# sourceMappingURL=zoom.d.ts.map
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZoomUtil = void 0;
4
+ /**
5
+ * A picture zoomed in a box that scrolls: how big it is drawn, where it is in what scrolls, and how far that
6
+ * scrolls so that a point of the picture stays under the fingers or the pointer. Pure, for the tests.
7
+ */
8
+ var ZoomUtil;
9
+ (function (ZoomUtil) {
10
+ /** Space around the picture at every scale, so that its edges never touch the box. */
11
+ ZoomUtil.PAD = 16;
12
+ /** The steps of the + and − buttons and keys. */
13
+ ZoomUtil.STOPS = [0.05, 0.1, 0.15, 0.25, 0.33, 0.5, 0.67, 0.75, 1, 1.25, 1.5, 2, 3, 4, 6, 8, 12, 16, 24, 32];
14
+ /** At least this far in, however big the picture. */
15
+ const LEAST_MAX = 8;
16
+ /** At this scale and over, its pixels are drawn as squares, as the viewers of pictures do. */
17
+ ZoomUtil.PIXELATED = 4;
18
+ /** A pinch past the limits goes on this much less far (a rubber band), then comes back. */
19
+ const RUBBER = 0.35;
20
+ /** The scale at which all of the picture shows in the box: what it shows at first unless that is larger than its own pixels. */
21
+ function contain(image, box) {
22
+ const width = Math.max(1, box.width - 2 * ZoomUtil.PAD);
23
+ const height = Math.max(1, box.height - 2 * ZoomUtil.PAD);
24
+ return Math.min(width / Math.max(1, image.width), height / Math.max(1, image.height));
25
+ }
26
+ ZoomUtil.contain = contain;
27
+ /** All of it in the box, never larger than its own pixels; no smaller than that, and in to at least LEAST_MAX. */
28
+ function limits(image, box) {
29
+ const whole = contain(image, box);
30
+ const base = Math.min(1, whole);
31
+ return { base, min: base, max: Math.max(LEAST_MAX, whole * 2) };
32
+ }
33
+ ZoomUtil.limits = limits;
34
+ function clamp(scale, limits) {
35
+ return Math.min(limits.max, Math.max(limits.min, scale));
36
+ }
37
+ ZoomUtil.clamp = clamp;
38
+ /** What a pinch past the limits draws: it goes on, ever less far. */
39
+ function rubber(scale, limits) {
40
+ if (scale < limits.min) {
41
+ return limits.min * (scale / limits.min) ** RUBBER;
42
+ }
43
+ if (scale > limits.max) {
44
+ return limits.max * (scale / limits.max) ** RUBBER;
45
+ }
46
+ return scale;
47
+ }
48
+ ZoomUtil.rubber = rubber;
49
+ /** Where the picture starts along an axis of `box` pixels, `size` pixels drawn: centred while smaller, else after PAD. */
50
+ function offset(size, box) {
51
+ return Math.max(ZoomUtil.PAD, (box - size) / 2);
52
+ }
53
+ ZoomUtil.offset = offset;
54
+ /** How long what scrolls is along an axis: the box, or the picture and PAD on both sides. */
55
+ function extent(size, box) {
56
+ return Math.max(box, size + 2 * ZoomUtil.PAD);
57
+ }
58
+ ZoomUtil.extent = extent;
59
+ /** Where in the picture (its own pixels) a point of the box is, along an axis, the picture `natural` pixels long at `scale`. */
60
+ function at(point, scroll, natural, scale, box) {
61
+ return (scroll + point - offset(natural * scale, box)) / scale;
62
+ }
63
+ ZoomUtil.at = at;
64
+ /** How far to scroll along an axis so that `spot` of the picture (its own pixels) is under `point` of the box, at `scale`. */
65
+ function scrollTo(spot, point, natural, scale, box) {
66
+ const size = natural * scale;
67
+ const most = extent(size, box) - box;
68
+ return Math.min(most, Math.max(0, spot * scale + offset(size, box) - point));
69
+ }
70
+ ZoomUtil.scrollTo = scrollTo;
71
+ /** The next step in (`way` 1) or out (-1) from `scale`; `base` is a step too. */
72
+ function step(scale, way, limits) {
73
+ const stops = [...ZoomUtil.STOPS, limits.base].sort((a, b) => a - b);
74
+ const next = way > 0 ? stops.find(stop => stop > scale * 1.01) : [...stops].reverse().find(stop => stop < scale * 0.99);
75
+ return clamp(next !== null && next !== void 0 ? next : (way > 0 ? limits.max : limits.min), limits);
76
+ }
77
+ ZoomUtil.step = step;
78
+ /** Whether it shows as at first. */
79
+ function fitted(scale, limits) {
80
+ return Math.abs(scale - limits.base) < limits.base * 0.01;
81
+ }
82
+ ZoomUtil.fitted = fitted;
83
+ /** A double tap or click: back to `base` when zoomed, else in, to its own pixels when that is a few times nearer. */
84
+ function toggle(scale, limits) {
85
+ if (!fitted(scale, limits)) {
86
+ return limits.base;
87
+ }
88
+ const target = limits.base < 1 ? Math.max(limits.base * 2, Math.min(1, limits.base * 4)) : limits.base * 2.5;
89
+ return clamp(target, limits);
90
+ }
91
+ ZoomUtil.toggle = toggle;
92
+ /** How much a turn of the wheel or a pinch of the trackpad (a wheel with Ctrl) zooms: `deltaY` in `deltaMode`'s unit. */
93
+ function wheel(deltaY, deltaMode) {
94
+ const pixels = deltaY * (deltaMode === 1 ? 16 : deltaMode === 2 ? 400 : 1);
95
+ return Math.exp(-Math.min(40, Math.max(-40, pixels)) * 0.01);
96
+ }
97
+ ZoomUtil.wheel = wheel;
98
+ })(ZoomUtil || (exports.ZoomUtil = ZoomUtil = {}));
99
+ //# sourceMappingURL=zoom.js.map
@@ -0,0 +1,60 @@
1
+ import { type SessionConnection, type TaConnection } from '@celljs/ta-client';
2
+ import { OfflineReads } from './offline/offline-reads';
3
+ import type { ConnectionStatus, WorkbenchState } from './workbench-protocol';
4
+ import { type ServiceName } from './workbench-util';
5
+ /** What the calls need of the workbench. */
6
+ export interface CallsOwner {
7
+ status(): ConnectionStatus;
8
+ /** The connection of now, if there is one. */
9
+ connection(): TaConnection | undefined;
10
+ connected(): Promise<void>;
11
+ subscribe(listener: (state: WorkbenchState) => void): () => void;
12
+ /** Tells web extensions that keys of their data changed. */
13
+ dataChanged(name: string, keys: string[], cwd?: string): void;
14
+ }
15
+ /**
16
+ * The calls of the page to its computer: those of the workbench's services, and those of its stores
17
+ * (`link`). Each goes to the connection of the time; before there is one, it waits for it. A call that
18
+ * reads (OFFLINE_READS) answers as it did last time while the computer cannot be reached, rather than
19
+ * waiting: what was shown shows again, web extensions started from the device too.
20
+ */
21
+ export declare class WorkbenchCalls {
22
+ protected readonly owner: CallsOwner;
23
+ /** The answers of the calls that read, of the computer in use. */
24
+ readonly reads: OfflineReads;
25
+ /** The services, the same across connections. */
26
+ protected readonly services: Map<ServiceName, object>;
27
+ /**
28
+ * The data of web extensions answered from the device (by call): read again once online, as the server
29
+ * tells of changes only to what a connection read, and it may have changed meanwhile.
30
+ */
31
+ protected readonly keptData: Map<string, {
32
+ name: string;
33
+ key: string;
34
+ cwd?: string;
35
+ }>;
36
+ constructor(owner: CallsOwner, host: string | undefined);
37
+ /** A service of the page, its methods the same each time too: what is given them is not drawn again for nothing. */
38
+ service<K extends ServiceName>(name: K): TaConnection[K];
39
+ /**
40
+ * What stores use of the connection, there before it is (a conversation kept on the device shows without
41
+ * one): their calls wait for it as on a connection that dropped, then fail; they attach once connected.
42
+ */
43
+ readonly link: SessionConnection;
44
+ /** As `connected`, failing as a call on a connection that dropped does once it is not back within `ms`. */
45
+ connectedWithin(ms: number): Promise<void>;
46
+ /** Online again: the web extensions that were given kept data hear that it changed, and read it from the computer. */
47
+ online(): void;
48
+ protected call(name: ServiceName, method: string, params: unknown[]): Promise<unknown>;
49
+ /**
50
+ * The answer kept of a call, once the connection is not there to give it: at once while offline, after a
51
+ * moment while connecting (a start through a relay is online within it); none online, or with none kept.
52
+ */
53
+ protected keptAnswer(name: ServiceName, method: string, params: unknown[]): Promise<{
54
+ value: unknown;
55
+ } | undefined>;
56
+ /** Resolves once the status is no longer `connecting`, or after `ms`. */
57
+ protected leavesConnecting(ms: number): Promise<void>;
58
+ protected signedIn(): TaConnection;
59
+ }
60
+ //# sourceMappingURL=workbench-calls.d.ts.map
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkbenchCalls = void 0;
4
+ const ta_client_1 = require("@celljs/ta-client");
5
+ const device_values_1 = require("./offline/device-values");
6
+ const offline_reads_1 = require("./offline/offline-reads");
7
+ const workbench_util_1 = require("./workbench-util");
8
+ /**
9
+ * The calls of the page to its computer: those of the workbench's services, and those of its stores
10
+ * (`link`). Each goes to the connection of the time; before there is one, it waits for it. A call that
11
+ * reads (OFFLINE_READS) answers as it did last time while the computer cannot be reached, rather than
12
+ * waiting: what was shown shows again, web extensions started from the device too.
13
+ */
14
+ class WorkbenchCalls {
15
+ constructor(owner, host) {
16
+ this.owner = owner;
17
+ /** The services, the same across connections. */
18
+ this.services = new Map();
19
+ /**
20
+ * The data of web extensions answered from the device (by call): read again once online, as the server
21
+ * tells of changes only to what a connection read, and it may have changed meanwhile.
22
+ */
23
+ this.keptData = new Map();
24
+ /**
25
+ * What stores use of the connection, there before it is (a conversation kept on the device shows without
26
+ * one): their calls wait for it as on a connection that dropped, then fail; they attach once connected.
27
+ */
28
+ this.link = {
29
+ server: new Proxy({}, {
30
+ get: (_target, method) => typeof method !== 'string' || method === 'then'
31
+ ? undefined
32
+ : async (...params) => {
33
+ if (!this.owner.connection()) {
34
+ await this.connectedWithin(workbench_util_1.STORE_WAIT_MS);
35
+ }
36
+ return this.signedIn().server[method](...params);
37
+ },
38
+ }),
39
+ onEvents: listener => this.signedIn().onEvents(listener),
40
+ onOpen: listener => this.signedIn().onOpen(listener),
41
+ };
42
+ this.reads = new offline_reads_1.OfflineReads((0, device_values_1.deviceValues)()).use(host);
43
+ }
44
+ /** A service of the page, its methods the same each time too: what is given them is not drawn again for nothing. */
45
+ service(name) {
46
+ const known = this.services.get(name);
47
+ if (known) {
48
+ return known;
49
+ }
50
+ const methods = new Map();
51
+ const service = new Proxy({}, {
52
+ get: (_target, method) => {
53
+ // Not a promise itself.
54
+ if (typeof method !== 'string' || method === 'then') {
55
+ return undefined;
56
+ }
57
+ let call = methods.get(method);
58
+ if (!call) {
59
+ call = (...params) => this.call(name, method, params);
60
+ methods.set(method, call);
61
+ }
62
+ return call;
63
+ },
64
+ });
65
+ this.services.set(name, service);
66
+ return service;
67
+ }
68
+ /** As `connected`, failing as a call on a connection that dropped does once it is not back within `ms`. */
69
+ connectedWithin(ms) {
70
+ let timer;
71
+ const late = new Promise((_, reject) => {
72
+ timer = setTimeout(() => reject(ta_client_1.TaRemoteError.notConnected()), ms);
73
+ });
74
+ return Promise.race([this.owner.connected(), late]).finally(() => clearTimeout(timer));
75
+ }
76
+ /** Online again: the web extensions that were given kept data hear that it changed, and read it from the computer. */
77
+ online() {
78
+ var _a;
79
+ const changed = new Map();
80
+ for (const { name, key, cwd } of this.keptData.values()) {
81
+ const of = `${name}\n${cwd !== null && cwd !== void 0 ? cwd : ''}`;
82
+ const entry = (_a = changed.get(of)) !== null && _a !== void 0 ? _a : { name, keys: [], cwd };
83
+ entry.keys.push(key);
84
+ changed.set(of, entry);
85
+ }
86
+ this.keptData.clear();
87
+ for (const { name, keys, cwd } of changed.values()) {
88
+ this.owner.dataChanged(name, keys, cwd);
89
+ }
90
+ }
91
+ async call(name, method, params) {
92
+ const reads = offline_reads_1.OfflineReads.reads(name, method);
93
+ if (reads && this.owner.status() !== 'online') {
94
+ const kept = await this.keptAnswer(name, method, params);
95
+ if (kept) {
96
+ if (name === 'packages' && method === 'getExtensionData') {
97
+ const [extension, key, cwd] = params;
98
+ this.keptData.set(offline_reads_1.OfflineReads.call(name, method, params), { name: extension, key, cwd });
99
+ }
100
+ return kept.value;
101
+ }
102
+ }
103
+ if (!this.owner.connection()) {
104
+ await this.owner.connected();
105
+ }
106
+ const answer = await this.signedIn()[name][method](...params);
107
+ if (reads) {
108
+ this.reads.keep(name, method, params, answer);
109
+ }
110
+ return answer;
111
+ }
112
+ /**
113
+ * The answer kept of a call, once the connection is not there to give it: at once while offline, after a
114
+ * moment while connecting (a start through a relay is online within it); none online, or with none kept.
115
+ */
116
+ async keptAnswer(name, method, params) {
117
+ const kept = await this.reads.answer(name, method, params);
118
+ if (kept && this.owner.status() === 'connecting') {
119
+ await this.leavesConnecting(workbench_util_1.KEPT_AFTER_MS);
120
+ }
121
+ const status = this.owner.status();
122
+ return status === 'offline' || status === 'connecting' ? kept : undefined;
123
+ }
124
+ /** Resolves once the status is no longer `connecting`, or after `ms`. */
125
+ leavesConnecting(ms) {
126
+ return new Promise(resolve => {
127
+ const done = () => {
128
+ clearTimeout(timer);
129
+ unsubscribe();
130
+ resolve();
131
+ };
132
+ const timer = setTimeout(done, ms);
133
+ const unsubscribe = this.owner.subscribe(state => state.status !== 'connecting' && done());
134
+ });
135
+ }
136
+ signedIn() {
137
+ const connection = this.owner.connection();
138
+ if (!connection) {
139
+ throw new Error('Not signed in to ta serve.');
140
+ }
141
+ return connection;
142
+ }
143
+ }
144
+ exports.WorkbenchCalls = WorkbenchCalls;
145
+ //# sourceMappingURL=workbench-calls.js.map
@@ -99,7 +99,11 @@ export interface TaWorkbench {
99
99
  * what names no directory opens. Open conversations stay in theirs.
100
100
  */
101
101
  setWorkingDirectory(cwd: string): Promise<void>;
102
- /** A store of a session on this connection; the caller attaches and detaches it. */
102
+ /**
103
+ * A store of a session on this connection; the caller attaches and detaches it. It can be made before
104
+ * there is a connection, to show a conversation kept on the device (SessionStoreOptions.initial): it is
105
+ * attached once connected, and its calls meanwhile fail as on a connection that dropped.
106
+ */
103
107
  createStore(sessionId: string, options?: SessionStoreOptions): SessionStore;
104
108
  /** Output of the terminals of this connection; the listener stays across reconnections and sign-ins. */
105
109
  onTerminalData(listener: (terminalId: string, data: string, exitCode?: number) => void): () => void;
@@ -0,0 +1,69 @@
1
+ import type { TaSavedSessionInfo, TaServerInfo, TaSessionInfo } from '@celljs/ta-protocol';
2
+ import { type RelayPairing } from '@celljs/ta-relay';
3
+ import { type HostList } from './hosts';
4
+ import type { Credential, WorkbenchState } from './workbench-protocol';
5
+ /** How long a computer added while another is in use has to answer before it counts as unreachable. */
6
+ export declare const PROBE_MS = 15000;
7
+ /**
8
+ * How long the connection is down, while the page is seen, before the user is told (`offlineShown`):
9
+ * the first tries to connect again are within it, so a short drop shows nothing.
10
+ */
11
+ export declare const GRACE_MS = 2500;
12
+ /**
13
+ * While the page connects, how long a call that reads waits for the connection before it answers as it did
14
+ * last time (OfflineReads): through a relay the page is mostly online within it, and gets what is new.
15
+ */
16
+ export declare const KEPT_AFTER_MS = 1000;
17
+ /** How long a call of a conversation waits for a connection the page never had, as TaConnection's `waitForOpenMs`. */
18
+ export declare const STORE_WAIT_MS = 5000;
19
+ /** How long the page shows which computer it switches to before it loads again for it. */
20
+ export declare const SWITCH_MS = 160;
21
+ export interface KeptLists {
22
+ /** The ta serve they are of (WorkbenchUtil.serverOf). */
23
+ of: string;
24
+ server?: TaServerInfo;
25
+ sessions: TaSessionInfo[];
26
+ saved: TaSavedSessionInfo[];
27
+ }
28
+ export type ServiceName = 'server' | 'workspace' | 'terminals' | 'settings' | 'packages' | 'auth' | 'access' | 'gateway' | 'relay' | 'remote';
29
+ /** A conversation opens with about this much of its latest messages, its earlier ones loaded as much at a time when scrolled to. */
30
+ export declare const PAGE_BYTES: number;
31
+ /** Why a computer added while another is in use was not switched to. */
32
+ export declare class WorkbenchError extends Error {
33
+ readonly reason: 'refused' | 'unreachable';
34
+ constructor(reason: 'refused' | 'unreachable');
35
+ }
36
+ export declare namespace WorkbenchUtil {
37
+ /** A pairing link (`ta pair`) or else a token. */
38
+ function credential(text: string): Credential;
39
+ /**
40
+ * Whether the ta serve in use runs on another machine than this browser: reached through a relay, from
41
+ * the app, or at an address that is not this machine's. A sign-in there cannot come back to it by itself.
42
+ */
43
+ function elsewhere(hostId: string | undefined, hostname?: string): boolean;
44
+ /** In the Ta app on a phone, where no ta serve serves the page: it reaches one through a relay. */
45
+ function isApp(): boolean;
46
+ function readPairing(text: string | null): RelayPairing | undefined;
47
+ /**
48
+ * Whether the server of the page answers at all. A WebSocket that does not open cannot say why: a
49
+ * server that answers refused the token; none means ta serve is not running (the installed app opens
50
+ * from its service worker then).
51
+ */
52
+ function reachable(base: string, fetcher?: typeof fetch): Promise<boolean>;
53
+ /** The hosts kept in `storage`; the token or pairing an older version kept becomes the first. */
54
+ function readHosts(storage: Storage | undefined, now?: number): HostList;
55
+ /** Which ta serve a credential reaches, to know whose lists were kept. */
56
+ function serverOf(credential: Credential, host: string): string;
57
+ /** Where the lists of `of` are kept: each computer has its own, to show at once when switched to. */
58
+ function listsKey(of: string): string;
59
+ /** The lists kept for `of`, none running: whether one runs is known once connected. */
60
+ function readLists(text: string | null, of: string): Pick<WorkbenchState, 'server' | 'sessions' | 'saved'> | undefined;
61
+ /** `previous` if `next` is the same, so that what shows it is not drawn again. */
62
+ function same<T>(previous: T, next: T): T;
63
+ function retryDelay(attempt: number): number;
64
+ }
65
+ /** None where the page is not in a browser (tests). */
66
+ export declare function storage(): Storage | undefined;
67
+ /** The ta serve that serves the page, whose token a sign-in without a pairing is for. */
68
+ export declare function pageHost(): string;
69
+ //# sourceMappingURL=workbench-util.d.ts.map