@celljs/ta-web 4.10.0 → 4.12.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 (559) hide show
  1. package/README.en.md +7 -7
  2. package/README.md +7 -7
  3. package/esm/browser/assistant/assistant-chat-list.d.ts +11 -0
  4. package/esm/browser/assistant/assistant-chat-list.js +12 -0
  5. package/esm/browser/assistant/assistant-extension.js +5 -0
  6. package/esm/browser/assistant/assistant-protocol.d.ts +2 -1
  7. package/esm/browser/assistant/assistant-task-book.d.ts +12 -2
  8. package/esm/browser/assistant/assistant-task-book.js +23 -4
  9. package/esm/browser/assistant/assistant-task-source.d.ts +1 -1
  10. package/esm/browser/assistant/assistant-task-source.js +5 -10
  11. package/esm/browser/assistant/assistant-task-util.d.ts +13 -3
  12. package/esm/browser/assistant/assistant-task-util.js +59 -12
  13. package/esm/browser/assistant/assistant-view.js +48 -24
  14. package/esm/browser/assistant/assistant.d.ts +18 -4
  15. package/esm/browser/assistant/assistant.js +52 -17
  16. package/esm/browser/avatar/dino-face.js +1 -2
  17. package/esm/browser/chat/chat-protocol.d.ts +5 -0
  18. package/esm/browser/chat/chat-stores.d.ts +8 -5
  19. package/esm/browser/chat/chat-stores.js +17 -9
  20. package/esm/browser/chat/chat-view.js +23 -15
  21. package/esm/browser/chat/chat.d.ts +16 -8
  22. package/esm/browser/chat/chat.js +86 -51
  23. package/esm/browser/components/account-menu.d.ts +0 -2
  24. package/esm/browser/components/account-menu.js +1 -27
  25. package/esm/browser/components/agent-settings-view.d.ts +3 -2
  26. package/esm/browser/components/agent-settings-view.js +2 -1
  27. package/esm/browser/components/app-nav.d.ts +5 -2
  28. package/esm/browser/components/app-nav.js +22 -9
  29. package/esm/browser/components/app-shell-hooks.js +5 -3
  30. package/esm/browser/components/app-view.js +84 -20
  31. package/esm/browser/components/busy.d.ts +25 -0
  32. package/esm/browser/components/busy.js +52 -0
  33. package/esm/browser/components/chat-icon.d.ts +29 -0
  34. package/esm/browser/components/chat-icon.js +78 -0
  35. package/esm/browser/components/chat-list.d.ts +73 -6
  36. package/esm/browser/components/chat-list.js +295 -60
  37. package/esm/browser/components/chat-seen.d.ts +53 -0
  38. package/esm/browser/components/chat-seen.js +101 -0
  39. package/esm/browser/components/composer-box.d.ts +15 -4
  40. package/esm/browser/components/composer-box.js +139 -77
  41. package/esm/browser/components/composer.d.ts +9 -6
  42. package/esm/browser/components/composer.js +32 -4
  43. package/esm/browser/components/conversation-scroll-hooks.d.ts +16 -0
  44. package/esm/browser/components/conversation-scroll-hooks.js +98 -0
  45. package/esm/browser/components/conversation-scroll-util.d.ts +30 -0
  46. package/esm/browser/components/conversation-scroll-util.js +56 -0
  47. package/esm/browser/components/conversation-scroll.d.ts +52 -31
  48. package/esm/browser/components/conversation-scroll.js +170 -129
  49. package/esm/browser/components/custom-host.d.ts +3 -0
  50. package/esm/browser/components/custom-host.js +14 -0
  51. package/esm/browser/components/directory-commands.d.ts +6 -0
  52. package/esm/browser/components/directory-commands.js +34 -0
  53. package/esm/browser/components/discover-view.d.ts +11 -4
  54. package/esm/browser/components/discover-view.js +20 -11
  55. package/esm/browser/components/dismiss.d.ts +3 -0
  56. package/esm/browser/components/dismiss.js +29 -0
  57. package/esm/browser/components/earlier-messages.d.ts +34 -3
  58. package/esm/browser/components/earlier-messages.js +42 -8
  59. package/esm/browser/components/editor-area.d.ts +6 -22
  60. package/esm/browser/components/editor-area.js +10 -97
  61. package/esm/browser/components/face.d.ts +24 -0
  62. package/esm/browser/components/face.js +42 -0
  63. package/esm/browser/components/fold-text.d.ts +20 -0
  64. package/esm/browser/components/fold-text.js +66 -0
  65. package/esm/browser/components/folder-picker.d.ts +1 -1
  66. package/esm/browser/components/folder-picker.js +1 -1
  67. package/esm/browser/components/full-screen.d.ts +9 -0
  68. package/esm/browser/components/full-screen.js +26 -0
  69. package/esm/browser/components/grow-box.d.ts +9 -0
  70. package/esm/browser/components/grow-box.js +50 -0
  71. package/esm/browser/components/hold-to-talk.d.ts +22 -0
  72. package/esm/browser/components/hold-to-talk.js +29 -0
  73. package/esm/browser/components/host-view.d.ts +1 -1
  74. package/esm/browser/components/icon.d.ts +3 -1
  75. package/esm/browser/components/icon.js +4 -3
  76. package/esm/browser/components/image-viewer.d.ts +10 -2
  77. package/esm/browser/components/image-viewer.js +48 -11
  78. package/esm/browser/components/launcher-search-util.d.ts +4 -3
  79. package/esm/browser/components/launcher-search-util.js +12 -4
  80. package/esm/browser/components/lightbox.d.ts +5 -2
  81. package/esm/browser/components/lightbox.js +4 -3
  82. package/esm/browser/components/list-rows.d.ts +9 -1
  83. package/esm/browser/components/list-rows.js +17 -3
  84. package/esm/browser/components/markdown.js +36 -4
  85. package/esm/browser/components/media.js +73 -7
  86. package/esm/browser/components/message-actions.js +3 -0
  87. package/esm/browser/components/message-footer.d.ts +8 -0
  88. package/esm/browser/components/message-footer.js +20 -3
  89. package/esm/browser/components/message-list.d.ts +60 -7
  90. package/esm/browser/components/message-list.js +206 -58
  91. package/esm/browser/components/message-menu.js +6 -1
  92. package/esm/browser/components/model-picker.js +1 -0
  93. package/esm/browser/components/nav-places.d.ts +21 -2
  94. package/esm/browser/components/nav-places.js +20 -4
  95. package/esm/browser/components/notice-center.js +34 -0
  96. package/esm/browser/components/notice-face.d.ts +10 -0
  97. package/esm/browser/components/notice-face.js +28 -0
  98. package/esm/browser/components/phone-shell.d.ts +23 -1
  99. package/esm/browser/components/phone-shell.js +98 -9
  100. package/esm/browser/components/picture.d.ts +8 -1
  101. package/esm/browser/components/picture.js +12 -1
  102. package/esm/browser/components/plus-menu.d.ts +23 -0
  103. package/esm/browser/components/plus-menu.js +90 -0
  104. package/esm/browser/components/recent-shot.d.ts +15 -0
  105. package/esm/browser/components/recent-shot.js +174 -0
  106. package/esm/browser/components/relay-view.js +10 -3
  107. package/esm/browser/components/run-status.d.ts +1 -1
  108. package/esm/browser/components/run-status.js +17 -29
  109. package/esm/browser/components/said-text.d.ts +6 -0
  110. package/esm/browser/components/said-text.js +14 -0
  111. package/esm/browser/components/scan-screen.d.ts +10 -0
  112. package/esm/browser/components/scan-screen.js +230 -0
  113. package/esm/browser/components/search-page.js +10 -6
  114. package/esm/browser/components/session-settings.d.ts +2 -3
  115. package/esm/browser/components/session-settings.js +1 -0
  116. package/esm/browser/components/session-view.d.ts +3 -1
  117. package/esm/browser/components/session-view.js +35 -21
  118. package/esm/browser/components/settings-choices.d.ts +1 -0
  119. package/esm/browser/components/settings-choices.js +3 -2
  120. package/esm/browser/components/settings-controls.d.ts +5 -3
  121. package/esm/browser/components/settings-controls.js +10 -1
  122. package/esm/browser/components/settings-parts.js +45 -14
  123. package/esm/browser/components/stop-times.d.ts +47 -0
  124. package/esm/browser/components/stop-times.js +81 -0
  125. package/esm/browser/components/tool-view.js +7 -2
  126. package/esm/browser/components/unseen-drop.d.ts +39 -0
  127. package/esm/browser/components/unseen-drop.js +219 -0
  128. package/esm/browser/components/use-seen-chats.d.ts +8 -0
  129. package/esm/browser/components/use-seen-chats.js +49 -0
  130. package/esm/browser/components/use-stop-times.d.ts +3 -0
  131. package/esm/browser/components/use-stop-times.js +17 -0
  132. package/esm/browser/components/voice-button.d.ts +7 -1
  133. package/esm/browser/components/voice-button.js +15 -2
  134. package/esm/browser/components/voice-picker.d.ts +6 -0
  135. package/esm/browser/components/voice-picker.js +53 -0
  136. package/esm/browser/components/voice-talk.d.ts +11 -3
  137. package/esm/browser/components/voice-talk.js +24 -4
  138. package/esm/browser/components/web-composer.d.ts +4 -2
  139. package/esm/browser/components/web-composer.js +8 -4
  140. package/esm/browser/components/workbench-tabs.d.ts +41 -0
  141. package/esm/browser/components/workbench-tabs.js +193 -0
  142. package/esm/browser/components/workbench-toggle.d.ts +0 -13
  143. package/esm/browser/components/workbench-toggle.js +1 -28
  144. package/esm/browser/device/code-scan.d.ts +55 -0
  145. package/esm/browser/device/code-scan.js +137 -0
  146. package/esm/browser/device/code-vision.d.ts +51 -0
  147. package/esm/browser/device/code-vision.js +100 -0
  148. package/esm/browser/device/hold.js +4 -6
  149. package/esm/browser/device/long-press.d.ts +10 -0
  150. package/esm/browser/device/long-press.js +28 -12
  151. package/esm/browser/device/own-gestures.d.ts +25 -0
  152. package/esm/browser/device/own-gestures.js +39 -0
  153. package/esm/browser/device/photo-picker.d.ts +14 -0
  154. package/esm/browser/device/photo-picker.js +48 -0
  155. package/esm/browser/device/pull-down.js +3 -2
  156. package/esm/browser/device/recent-shots.d.ts +45 -0
  157. package/esm/browser/device/recent-shots.js +142 -0
  158. package/esm/browser/device/row-swipe.d.ts +2 -0
  159. package/esm/browser/device/row-swipe.js +14 -3
  160. package/esm/browser/device/sheet-swipe.d.ts +1 -1
  161. package/esm/browser/device/sheet-swipe.js +25 -4
  162. package/esm/browser/extension/extension-view.d.ts +10 -0
  163. package/esm/browser/extension/extension-view.js +6 -0
  164. package/esm/browser/extension/icons.js +16 -2
  165. package/esm/browser/extension/web-api-components.d.ts +287 -0
  166. package/esm/browser/extension/web-api-components.js +2 -0
  167. package/esm/browser/extension/web-api-contributions.d.ts +394 -0
  168. package/esm/browser/extension/web-api-contributions.js +2 -0
  169. package/esm/browser/extension/web-api-desktop.d.ts +55 -0
  170. package/esm/browser/extension/web-api-desktop.js +2 -0
  171. package/esm/browser/extension/web-api-terminal.d.ts +71 -0
  172. package/esm/browser/extension/web-api-terminal.js +2 -0
  173. package/esm/browser/extension/web-editor-tabs.d.ts +42 -0
  174. package/esm/browser/extension/web-editor-tabs.js +137 -0
  175. package/esm/browser/extension/web-extension-api.d.ts +186 -565
  176. package/esm/browser/extension/web-extension-context.d.ts +78 -0
  177. package/esm/browser/extension/web-extension-context.js +354 -0
  178. package/esm/browser/extension/web-extension-protocol.d.ts +57 -7
  179. package/esm/browser/extension/web-extension-protocol.js +34 -0
  180. package/esm/browser/extension/web-extension-run.d.ts +54 -0
  181. package/esm/browser/extension/web-extension-run.js +120 -0
  182. package/esm/browser/extension/web-extensions.d.ts +29 -69
  183. package/esm/browser/extension/web-extensions.js +121 -516
  184. package/esm/browser/extension/web-home.d.ts +19 -0
  185. package/esm/browser/extension/web-home.js +72 -0
  186. package/esm/browser/extension/web-pages.d.ts +13 -3
  187. package/esm/browser/extension/web-pages.js +23 -3
  188. package/esm/browser/extension/web-session-notices.d.ts +36 -0
  189. package/esm/browser/extension/web-session-notices.js +174 -0
  190. package/esm/browser/extension/web-sharing.d.ts +2 -0
  191. package/esm/browser/extension/web-sharing.js +4 -0
  192. package/esm/browser/game/game-host.d.ts +27 -0
  193. package/esm/browser/game/game-host.js +127 -0
  194. package/esm/browser/game/game-loader.d.ts +10 -0
  195. package/esm/browser/game/game-loader.js +28 -0
  196. package/esm/browser/game/game-protocol.d.ts +49 -0
  197. package/esm/browser/game/game-protocol.js +2 -0
  198. package/esm/browser/game/game-runner.d.ts +27 -0
  199. package/esm/browser/game/game-runner.js +60 -0
  200. package/esm/browser/game/game-util.d.ts +29 -0
  201. package/esm/browser/game/game-util.js +180 -0
  202. package/esm/browser/game/game-view.d.ts +12 -0
  203. package/esm/browser/game/game-view.js +31 -0
  204. package/esm/browser/game/game3d-protocol.d.ts +51 -0
  205. package/esm/browser/game/game3d-protocol.js +2 -0
  206. package/esm/browser/game/game3d-runner.d.ts +27 -0
  207. package/esm/browser/game/game3d-runner.js +149 -0
  208. package/esm/browser/hooks.d.ts +5 -1
  209. package/esm/browser/hooks.js +13 -2
  210. package/esm/browser/i18n/locales.d.ts +92 -2
  211. package/esm/browser/i18n/messages.d.ts +91 -1
  212. package/esm/browser/i18n/messages.js +187 -7
  213. package/esm/browser/index.d.ts +9 -0
  214. package/esm/browser/index.js +9 -0
  215. package/esm/browser/links/links-protocol.d.ts +7 -0
  216. package/esm/browser/links/links.d.ts +24 -7
  217. package/esm/browser/links/links.js +64 -11
  218. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  219. package/esm/browser/markdown/code-renderers.js +4 -0
  220. package/esm/browser/notices/notices-protocol.d.ts +17 -0
  221. package/esm/browser/notices/notices.d.ts +1 -1
  222. package/esm/browser/notices/notices.js +6 -2
  223. package/esm/browser/notices/session-notices.d.ts +69 -0
  224. package/esm/browser/notices/session-notices.js +92 -0
  225. package/esm/browser/offline/device-values.js +12 -3
  226. package/esm/browser/offline/offline-reads.js +3 -1
  227. package/esm/browser/settings/navigation.d.ts +3 -2
  228. package/esm/browser/settings/navigation.js +4 -3
  229. package/esm/browser/settings/settings-protocol.d.ts +15 -0
  230. package/esm/browser/settings/settings-protocol.js +18 -4
  231. package/esm/browser/state/state-protocol.d.ts +8 -1
  232. package/esm/browser/state/state.d.ts +2 -0
  233. package/esm/browser/state/state.js +21 -2
  234. package/esm/browser/style/base.d.ts +1 -1
  235. package/esm/browser/style/base.js +27 -1
  236. package/esm/browser/style/conversation.d.ts +1 -1
  237. package/esm/browser/style/conversation.js +45 -5
  238. package/esm/browser/style/device.js +15 -1
  239. package/esm/browser/style/layout.d.ts +1 -1
  240. package/esm/browser/style/layout.js +192 -56
  241. package/esm/browser/style/pages.d.ts +1 -1
  242. package/esm/browser/style/pages.js +39 -1
  243. package/esm/browser/style/phone.d.ts +1 -1
  244. package/esm/browser/style/phone.js +15 -0
  245. package/esm/browser/style/shell.d.ts +1 -1
  246. package/esm/browser/style/shell.js +32 -6
  247. package/esm/browser/style/surfaces.d.ts +1 -1
  248. package/esm/browser/style/surfaces.js +21 -2
  249. package/esm/browser/style/tints.d.ts +27 -0
  250. package/esm/browser/style/tints.js +56 -0
  251. package/esm/browser/style.js +13 -1
  252. package/esm/browser/util/composer.d.ts +6 -0
  253. package/esm/browser/util/composer.js +16 -0
  254. package/esm/browser/util/desktop.d.ts +19 -1
  255. package/esm/browser/util/desktop.js +15 -0
  256. package/esm/browser/util/frame.d.ts +2 -0
  257. package/esm/browser/util/frame.js +2 -0
  258. package/esm/browser/util/link.d.ts +18 -0
  259. package/esm/browser/util/link.js +66 -1
  260. package/esm/browser/util/markdown.d.ts +4 -1
  261. package/esm/browser/util/markdown.js +1 -1
  262. package/esm/browser/util/message.d.ts +5 -0
  263. package/esm/browser/util/message.js +30 -0
  264. package/esm/browser/util/process.d.ts +57 -3
  265. package/esm/browser/util/process.js +123 -11
  266. package/esm/browser/util/progress.d.ts +19 -1
  267. package/esm/browser/util/progress.js +57 -4
  268. package/esm/browser/util/quote.d.ts +19 -0
  269. package/esm/browser/util/quote.js +58 -0
  270. package/esm/browser/util/tool.d.ts +19 -2
  271. package/esm/browser/util/tool.js +70 -2
  272. package/esm/browser/util/voice.d.ts +47 -7
  273. package/esm/browser/util/voice.js +269 -27
  274. package/esm/browser/workbench-calls.d.ts +6 -4
  275. package/esm/browser/workbench-calls.js +15 -10
  276. package/esm/browser/workbench-protocol.d.ts +31 -2
  277. package/esm/browser/workbench-util.d.ts +15 -4
  278. package/esm/browser/workbench-util.js +28 -5
  279. package/esm/browser/workbench.d.ts +33 -1
  280. package/esm/browser/workbench.js +142 -14
  281. package/lib/browser/assistant/assistant-chat-list.d.ts +11 -0
  282. package/lib/browser/assistant/assistant-chat-list.js +13 -0
  283. package/lib/browser/assistant/assistant-extension.js +5 -0
  284. package/lib/browser/assistant/assistant-protocol.d.ts +2 -1
  285. package/lib/browser/assistant/assistant-task-book.d.ts +12 -2
  286. package/lib/browser/assistant/assistant-task-book.js +23 -4
  287. package/lib/browser/assistant/assistant-task-source.d.ts +1 -1
  288. package/lib/browser/assistant/assistant-task-source.js +5 -10
  289. package/lib/browser/assistant/assistant-task-util.d.ts +13 -3
  290. package/lib/browser/assistant/assistant-task-util.js +59 -12
  291. package/lib/browser/assistant/assistant-view.js +46 -22
  292. package/lib/browser/assistant/assistant.d.ts +18 -4
  293. package/lib/browser/assistant/assistant.js +52 -17
  294. package/lib/browser/avatar/dino-face.js +1 -2
  295. package/lib/browser/chat/chat-protocol.d.ts +5 -0
  296. package/lib/browser/chat/chat-stores.d.ts +8 -5
  297. package/lib/browser/chat/chat-stores.js +17 -9
  298. package/lib/browser/chat/chat-view.js +22 -14
  299. package/lib/browser/chat/chat.d.ts +16 -8
  300. package/lib/browser/chat/chat.js +86 -51
  301. package/lib/browser/components/account-menu.d.ts +0 -2
  302. package/lib/browser/components/account-menu.js +2 -29
  303. package/lib/browser/components/agent-settings-view.d.ts +3 -2
  304. package/lib/browser/components/agent-settings-view.js +2 -1
  305. package/lib/browser/components/app-nav.d.ts +5 -2
  306. package/lib/browser/components/app-nav.js +18 -5
  307. package/lib/browser/components/app-shell-hooks.js +5 -3
  308. package/lib/browser/components/app-view.js +80 -16
  309. package/lib/browser/components/busy.d.ts +26 -0
  310. package/lib/browser/components/busy.js +91 -0
  311. package/lib/browser/components/chat-icon.d.ts +30 -0
  312. package/lib/browser/components/chat-icon.js +117 -0
  313. package/lib/browser/components/chat-list.d.ts +73 -6
  314. package/lib/browser/components/chat-list.js +295 -59
  315. package/lib/browser/components/chat-seen.d.ts +54 -0
  316. package/lib/browser/components/chat-seen.js +104 -0
  317. package/lib/browser/components/composer-box.d.ts +15 -4
  318. package/lib/browser/components/composer-box.js +136 -74
  319. package/lib/browser/components/composer.d.ts +9 -6
  320. package/lib/browser/components/composer.js +31 -3
  321. package/lib/browser/components/conversation-scroll-hooks.d.ts +17 -0
  322. package/lib/browser/components/conversation-scroll-hooks.js +135 -0
  323. package/lib/browser/components/conversation-scroll-util.d.ts +31 -0
  324. package/lib/browser/components/conversation-scroll-util.js +60 -0
  325. package/lib/browser/components/conversation-scroll.d.ts +52 -31
  326. package/lib/browser/components/conversation-scroll.js +171 -164
  327. package/lib/browser/components/custom-host.d.ts +4 -0
  328. package/lib/browser/components/custom-host.js +50 -0
  329. package/lib/browser/components/directory-commands.d.ts +7 -0
  330. package/lib/browser/components/directory-commands.js +70 -0
  331. package/lib/browser/components/discover-view.d.ts +11 -4
  332. package/lib/browser/components/discover-view.js +19 -10
  333. package/lib/browser/components/dismiss.d.ts +4 -0
  334. package/lib/browser/components/dismiss.js +65 -0
  335. package/lib/browser/components/earlier-messages.d.ts +34 -3
  336. package/lib/browser/components/earlier-messages.js +44 -9
  337. package/lib/browser/components/editor-area.d.ts +6 -22
  338. package/lib/browser/components/editor-area.js +11 -98
  339. package/lib/browser/components/face.d.ts +25 -0
  340. package/lib/browser/components/face.js +79 -0
  341. package/lib/browser/components/fold-text.d.ts +21 -0
  342. package/lib/browser/components/fold-text.js +103 -0
  343. package/lib/browser/components/folder-picker.d.ts +1 -1
  344. package/lib/browser/components/folder-picker.js +1 -1
  345. package/lib/browser/components/full-screen.d.ts +10 -0
  346. package/lib/browser/components/full-screen.js +62 -0
  347. package/lib/browser/components/grow-box.d.ts +10 -0
  348. package/lib/browser/components/grow-box.js +86 -0
  349. package/lib/browser/components/hold-to-talk.d.ts +23 -0
  350. package/lib/browser/components/hold-to-talk.js +65 -0
  351. package/lib/browser/components/host-view.d.ts +1 -1
  352. package/lib/browser/components/icon.d.ts +3 -1
  353. package/lib/browser/components/icon.js +4 -3
  354. package/lib/browser/components/image-viewer.d.ts +10 -2
  355. package/lib/browser/components/image-viewer.js +47 -10
  356. package/lib/browser/components/launcher-search-util.d.ts +4 -3
  357. package/lib/browser/components/launcher-search-util.js +12 -4
  358. package/lib/browser/components/lightbox.d.ts +5 -2
  359. package/lib/browser/components/lightbox.js +4 -3
  360. package/lib/browser/components/list-rows.d.ts +9 -1
  361. package/lib/browser/components/list-rows.js +18 -3
  362. package/lib/browser/components/markdown.js +36 -4
  363. package/lib/browser/components/media.js +73 -7
  364. package/lib/browser/components/message-actions.js +3 -0
  365. package/lib/browser/components/message-footer.d.ts +8 -0
  366. package/lib/browser/components/message-footer.js +20 -2
  367. package/lib/browser/components/message-list.d.ts +60 -7
  368. package/lib/browser/components/message-list.js +206 -55
  369. package/lib/browser/components/message-menu.js +6 -1
  370. package/lib/browser/components/model-picker.js +1 -0
  371. package/lib/browser/components/nav-places.d.ts +21 -2
  372. package/lib/browser/components/nav-places.js +22 -4
  373. package/lib/browser/components/notice-center.js +34 -0
  374. package/lib/browser/components/notice-face.d.ts +11 -0
  375. package/lib/browser/components/notice-face.js +64 -0
  376. package/lib/browser/components/phone-shell.d.ts +23 -1
  377. package/lib/browser/components/phone-shell.js +99 -10
  378. package/lib/browser/components/picture.d.ts +8 -1
  379. package/lib/browser/components/picture.js +13 -1
  380. package/lib/browser/components/plus-menu.d.ts +24 -0
  381. package/lib/browser/components/plus-menu.js +126 -0
  382. package/lib/browser/components/recent-shot.d.ts +16 -0
  383. package/lib/browser/components/recent-shot.js +210 -0
  384. package/lib/browser/components/relay-view.js +10 -3
  385. package/lib/browser/components/run-status.d.ts +1 -1
  386. package/lib/browser/components/run-status.js +17 -29
  387. package/lib/browser/components/said-text.d.ts +7 -0
  388. package/lib/browser/components/said-text.js +50 -0
  389. package/lib/browser/components/scan-screen.d.ts +11 -0
  390. package/lib/browser/components/scan-screen.js +266 -0
  391. package/lib/browser/components/search-page.js +10 -6
  392. package/lib/browser/components/session-settings.d.ts +2 -3
  393. package/lib/browser/components/session-settings.js +1 -0
  394. package/lib/browser/components/session-view.d.ts +3 -1
  395. package/lib/browser/components/session-view.js +32 -18
  396. package/lib/browser/components/settings-choices.d.ts +1 -0
  397. package/lib/browser/components/settings-choices.js +2 -1
  398. package/lib/browser/components/settings-controls.d.ts +5 -3
  399. package/lib/browser/components/settings-controls.js +10 -1
  400. package/lib/browser/components/settings-parts.js +43 -12
  401. package/lib/browser/components/stop-times.d.ts +48 -0
  402. package/lib/browser/components/stop-times.js +85 -0
  403. package/lib/browser/components/tool-view.js +7 -2
  404. package/lib/browser/components/unseen-drop.d.ts +40 -0
  405. package/lib/browser/components/unseen-drop.js +256 -0
  406. package/lib/browser/components/use-seen-chats.d.ts +9 -0
  407. package/lib/browser/components/use-seen-chats.js +85 -0
  408. package/lib/browser/components/use-stop-times.d.ts +4 -0
  409. package/lib/browser/components/use-stop-times.js +53 -0
  410. package/lib/browser/components/voice-button.d.ts +7 -1
  411. package/lib/browser/components/voice-button.js +16 -2
  412. package/lib/browser/components/voice-picker.d.ts +7 -0
  413. package/lib/browser/components/voice-picker.js +89 -0
  414. package/lib/browser/components/voice-talk.d.ts +11 -3
  415. package/lib/browser/components/voice-talk.js +25 -4
  416. package/lib/browser/components/web-composer.d.ts +4 -2
  417. package/lib/browser/components/web-composer.js +7 -3
  418. package/lib/browser/components/workbench-tabs.d.ts +42 -0
  419. package/lib/browser/components/workbench-tabs.js +232 -0
  420. package/lib/browser/components/workbench-toggle.d.ts +0 -13
  421. package/lib/browser/components/workbench-toggle.js +1 -29
  422. package/lib/browser/device/code-scan.d.ts +56 -0
  423. package/lib/browser/device/code-scan.js +141 -0
  424. package/lib/browser/device/code-vision.d.ts +52 -0
  425. package/lib/browser/device/code-vision.js +103 -0
  426. package/lib/browser/device/hold.js +4 -6
  427. package/lib/browser/device/long-press.d.ts +10 -0
  428. package/lib/browser/device/long-press.js +28 -12
  429. package/lib/browser/device/own-gestures.d.ts +26 -0
  430. package/lib/browser/device/own-gestures.js +42 -0
  431. package/lib/browser/device/photo-picker.d.ts +15 -0
  432. package/lib/browser/device/photo-picker.js +51 -0
  433. package/lib/browser/device/pull-down.js +3 -2
  434. package/lib/browser/device/recent-shots.d.ts +46 -0
  435. package/lib/browser/device/recent-shots.js +145 -0
  436. package/lib/browser/device/row-swipe.d.ts +2 -0
  437. package/lib/browser/device/row-swipe.js +14 -3
  438. package/lib/browser/device/sheet-swipe.d.ts +1 -1
  439. package/lib/browser/device/sheet-swipe.js +25 -4
  440. package/lib/browser/extension/extension-view.d.ts +10 -0
  441. package/lib/browser/extension/extension-view.js +7 -1
  442. package/lib/browser/extension/icons.js +15 -1
  443. package/lib/browser/extension/web-api-components.d.ts +288 -0
  444. package/lib/browser/extension/web-api-components.js +3 -0
  445. package/lib/browser/extension/web-api-contributions.d.ts +395 -0
  446. package/lib/browser/extension/web-api-contributions.js +3 -0
  447. package/lib/browser/extension/web-api-desktop.d.ts +56 -0
  448. package/lib/browser/extension/web-api-desktop.js +3 -0
  449. package/lib/browser/extension/web-api-terminal.d.ts +72 -0
  450. package/lib/browser/extension/web-api-terminal.js +3 -0
  451. package/lib/browser/extension/web-editor-tabs.d.ts +43 -0
  452. package/lib/browser/extension/web-editor-tabs.js +141 -0
  453. package/lib/browser/extension/web-extension-api.d.ts +186 -565
  454. package/lib/browser/extension/web-extension-context.d.ts +79 -0
  455. package/lib/browser/extension/web-extension-context.js +391 -0
  456. package/lib/browser/extension/web-extension-protocol.d.ts +57 -7
  457. package/lib/browser/extension/web-extension-protocol.js +35 -1
  458. package/lib/browser/extension/web-extension-run.d.ts +55 -0
  459. package/lib/browser/extension/web-extension-run.js +123 -0
  460. package/lib/browser/extension/web-extensions.d.ts +29 -69
  461. package/lib/browser/extension/web-extensions.js +117 -545
  462. package/lib/browser/extension/web-home.d.ts +20 -0
  463. package/lib/browser/extension/web-home.js +76 -0
  464. package/lib/browser/extension/web-pages.d.ts +13 -3
  465. package/lib/browser/extension/web-pages.js +23 -3
  466. package/lib/browser/extension/web-session-notices.d.ts +37 -0
  467. package/lib/browser/extension/web-session-notices.js +177 -0
  468. package/lib/browser/extension/web-sharing.d.ts +2 -0
  469. package/lib/browser/extension/web-sharing.js +4 -0
  470. package/lib/browser/game/game-host.d.ts +28 -0
  471. package/lib/browser/game/game-host.js +163 -0
  472. package/lib/browser/game/game-loader.d.ts +11 -0
  473. package/lib/browser/game/game-loader.js +31 -0
  474. package/lib/browser/game/game-protocol.d.ts +50 -0
  475. package/lib/browser/game/game-protocol.js +3 -0
  476. package/lib/browser/game/game-runner.d.ts +28 -0
  477. package/lib/browser/game/game-runner.js +64 -0
  478. package/lib/browser/game/game-util.d.ts +30 -0
  479. package/lib/browser/game/game-util.js +183 -0
  480. package/lib/browser/game/game-view.d.ts +13 -0
  481. package/lib/browser/game/game-view.js +68 -0
  482. package/lib/browser/game/game3d-protocol.d.ts +52 -0
  483. package/lib/browser/game/game3d-protocol.js +3 -0
  484. package/lib/browser/game/game3d-runner.d.ts +28 -0
  485. package/lib/browser/game/game3d-runner.js +153 -0
  486. package/lib/browser/hooks.d.ts +5 -1
  487. package/lib/browser/hooks.js +14 -2
  488. package/lib/browser/i18n/locales.d.ts +92 -2
  489. package/lib/browser/i18n/messages.d.ts +91 -1
  490. package/lib/browser/i18n/messages.js +187 -7
  491. package/lib/browser/index.d.ts +9 -0
  492. package/lib/browser/index.js +9 -0
  493. package/lib/browser/links/links-protocol.d.ts +7 -0
  494. package/lib/browser/links/links.d.ts +24 -7
  495. package/lib/browser/links/links.js +64 -11
  496. package/lib/browser/markdown/code-renderers.d.ts +5 -0
  497. package/lib/browser/markdown/code-renderers.js +40 -0
  498. package/lib/browser/notices/notices-protocol.d.ts +17 -0
  499. package/lib/browser/notices/notices.d.ts +1 -1
  500. package/lib/browser/notices/notices.js +6 -2
  501. package/lib/browser/notices/session-notices.d.ts +70 -0
  502. package/lib/browser/notices/session-notices.js +96 -0
  503. package/lib/browser/offline/device-values.js +12 -3
  504. package/lib/browser/offline/offline-reads.js +3 -1
  505. package/lib/browser/settings/navigation.d.ts +3 -2
  506. package/lib/browser/settings/navigation.js +4 -3
  507. package/lib/browser/settings/settings-protocol.d.ts +15 -0
  508. package/lib/browser/settings/settings-protocol.js +19 -5
  509. package/lib/browser/state/state-protocol.d.ts +8 -1
  510. package/lib/browser/state/state.d.ts +2 -0
  511. package/lib/browser/state/state.js +21 -2
  512. package/lib/browser/style/base.d.ts +1 -1
  513. package/lib/browser/style/base.js +27 -1
  514. package/lib/browser/style/conversation.d.ts +1 -1
  515. package/lib/browser/style/conversation.js +45 -5
  516. package/lib/browser/style/device.js +15 -1
  517. package/lib/browser/style/layout.d.ts +1 -1
  518. package/lib/browser/style/layout.js +192 -56
  519. package/lib/browser/style/pages.d.ts +1 -1
  520. package/lib/browser/style/pages.js +39 -1
  521. package/lib/browser/style/phone.d.ts +1 -1
  522. package/lib/browser/style/phone.js +15 -0
  523. package/lib/browser/style/shell.d.ts +1 -1
  524. package/lib/browser/style/shell.js +32 -6
  525. package/lib/browser/style/surfaces.d.ts +1 -1
  526. package/lib/browser/style/surfaces.js +21 -2
  527. package/lib/browser/style/tints.d.ts +28 -0
  528. package/lib/browser/style/tints.js +59 -0
  529. package/lib/browser/style.js +13 -1
  530. package/lib/browser/util/composer.d.ts +6 -0
  531. package/lib/browser/util/composer.js +16 -0
  532. package/lib/browser/util/desktop.d.ts +19 -1
  533. package/lib/browser/util/desktop.js +15 -0
  534. package/lib/browser/util/frame.d.ts +2 -0
  535. package/lib/browser/util/frame.js +2 -0
  536. package/lib/browser/util/link.d.ts +18 -0
  537. package/lib/browser/util/link.js +66 -1
  538. package/lib/browser/util/markdown.d.ts +4 -1
  539. package/lib/browser/util/markdown.js +1 -1
  540. package/lib/browser/util/message.d.ts +5 -0
  541. package/lib/browser/util/message.js +30 -0
  542. package/lib/browser/util/process.d.ts +57 -3
  543. package/lib/browser/util/process.js +125 -12
  544. package/lib/browser/util/progress.d.ts +19 -1
  545. package/lib/browser/util/progress.js +57 -4
  546. package/lib/browser/util/quote.d.ts +20 -0
  547. package/lib/browser/util/quote.js +61 -0
  548. package/lib/browser/util/tool.d.ts +19 -2
  549. package/lib/browser/util/tool.js +70 -2
  550. package/lib/browser/util/voice.d.ts +47 -7
  551. package/lib/browser/util/voice.js +269 -27
  552. package/lib/browser/workbench-calls.d.ts +6 -4
  553. package/lib/browser/workbench-calls.js +15 -10
  554. package/lib/browser/workbench-protocol.d.ts +31 -2
  555. package/lib/browser/workbench-util.d.ts +15 -4
  556. package/lib/browser/workbench-util.js +28 -5
  557. package/lib/browser/workbench.d.ts +33 -1
  558. package/lib/browser/workbench.js +140 -12
  559. package/package.json +11 -8
@@ -1,19 +1,22 @@
1
- import { TaImageNote, TaMessageContext, TaSkillUse } from '@celljs/ta-protocol';
1
+ import { TaImageNote, TaImageSize, TaMessageContext, TaSkillUse } from '@celljs/ta-protocol';
2
2
  import { ChevronRight, CircleAlert, Sparkles } from 'lucide-react';
3
3
  import * as React from 'react';
4
4
  import { CustomMessage, ExtensionBoundary, MessageRenderers, SessionAvatars } from '../extension/extension-view.js';
5
5
  import { useT } from '../i18n/use-t.js';
6
+ import { CodeRenderers } from '../markdown/code-renderers.js';
7
+ import { Recent } from '../markdown/lazy.js';
6
8
  import { MessageUtil } from '../util/message.js';
7
- import { ProcessUtil } from '../util/process.js';
9
+ import { FreshRows, ProcessUtil } from '../util/process.js';
8
10
  import { ToolUtil } from '../util/tool.js';
9
11
  import { Callout } from './callout.js';
10
12
  import { ASK_CLASS } from './conversation-scroll.js';
11
13
  import { Icon } from './icon.js';
12
14
  import { Lightbox } from './lightbox.js';
13
15
  import { Markdown } from './markdown.js';
14
- import { TimeBreak, TurnFooter, UserFooter } from './message-footer.js';
16
+ import { MessageActions, ModelBreak, TimeBreak, TurnFooter, UserFooter } from './message-footer.js';
15
17
  import { useMessageMenu } from './message-menu.js';
16
18
  import { RunStatus } from './run-status.js';
19
+ import { SaidText } from './said-text.js';
17
20
  import { TaAvatar } from './ta-avatar.js';
18
21
  import { ToolView } from './tool-view.js';
19
22
  /** The session of the conversation: who answers in it may be drawn by the extension of its group. */
@@ -44,6 +47,8 @@ export function TurnAvatar({ mood }) {
44
47
  React.createElement(Avatar, { session: session, mood: mood, size: 24 })));
45
48
  }
46
49
  const TASK_UPDATE = /^<task_update id="[^"]+" title="([^"]*)" status="(\w+)">\n?([\s\S]*?)\n?<\/task_update>$/;
50
+ /** AssistantTaskUtil.renamedNote. */
51
+ const TASK_RENAMED = /^<task_renamed id="[^"]+" was="[^"]+"/;
47
52
  /** What the double of the web client told ta about a task that ended: a note, not something the user said. */
48
53
  function TaskUpdate({ title, status, result }) {
49
54
  const t = useT();
@@ -54,58 +59,153 @@ function TaskUpdate({ title, status, result }) {
54
59
  t(`ta.task.${status}`)),
55
60
  React.createElement(Markdown, { text: result })));
56
61
  }
57
- /** The images of a message: those the page can show. */
58
- function imagesOf(blocks) {
59
- return blocks.filter(block => { var _a; return block.type === 'image' && block.data && ((_a = block.mimeType) === null || _a === void 0 ? void 0 : _a.startsWith('image/')); });
62
+ /**
63
+ * Where the images of the messages of the user come from that the conversation gave without their bytes
64
+ * (TaShownImage): by the timestamp of the message and the index of the block. Without it they show as their place.
65
+ */
66
+ export const MessageImages = React.createContext(undefined);
67
+ /** The images shown lately, by message and block: drawn again at once, in this conversation or another view of it. */
68
+ const shownImages = new Recent(48);
69
+ /** The size of the images with their bytes, read once. */
70
+ const sizes = new WeakMap();
71
+ /** How large one image of a message is drawn, at most. */
72
+ const ONE_IMAGE = { width: 220, height: 280 };
73
+ export var UserImageUtil;
74
+ (function (UserImageUtil) {
75
+ /** The images of a message the page can show, with their index among its blocks: with their bytes, or without (TaShownImage). */
76
+ function images(blocks) {
77
+ return blocks.flatMap((block, index) => { var _a; return block.type === 'image' && ((_a = block.mimeType) === null || _a === void 0 ? void 0 : _a.startsWith('image/')) && typeof block.data === 'string' ? [{ block: block, index }] : []; });
78
+ }
79
+ UserImageUtil.images = images;
80
+ /** Its size in pixels: given (TaShownImage), or read from its bytes. */
81
+ function size(block) {
82
+ if (block.width && block.height) {
83
+ return { width: block.width, height: block.height };
84
+ }
85
+ if (!block.data) {
86
+ return undefined;
87
+ }
88
+ if (!sizes.has(block)) {
89
+ sizes.set(block, TaImageSize.of(block.data));
90
+ }
91
+ return sizes.get(block);
92
+ }
93
+ UserImageUtil.size = size;
94
+ /** The box of one image alone, its shape kept, before it loads: nothing moves when it comes. */
95
+ function box(size) {
96
+ if (!size) {
97
+ return undefined;
98
+ }
99
+ const scale = Math.min(1, ONE_IMAGE.width / size.width, ONE_IMAGE.height / size.height);
100
+ return { width: Math.max(1, Math.round(size.width * scale)), aspectRatio: `${size.width} / ${size.height}` };
101
+ }
102
+ UserImageUtil.box = box;
103
+ })(UserImageUtil || (UserImageUtil = {}));
104
+ /** The URLs of the images of a message: those with their bytes at once, the others as `MessageImages` gives them. */
105
+ function useImageSources(images, timestamp) {
106
+ const load = React.useContext(MessageImages);
107
+ const keyOf = (index) => (timestamp === undefined ? undefined : `${timestamp}:${index}`);
108
+ const own = images.map(({ block, index }) => {
109
+ const key = keyOf(index);
110
+ return block.data ? `data:${block.mimeType};base64,${block.data}` : key ? shownImages.get(key) : undefined;
111
+ });
112
+ const [loaded, setLoaded] = React.useState({});
113
+ const wanted = images.filter((image, at) => !own[at] && !loaded[image.index]).map(image => image.index);
114
+ const missing = wanted.join(',');
115
+ // Asked again only for other images: `missing` says which.
116
+ React.useEffect(() => {
117
+ if (!load || timestamp === undefined || !missing) {
118
+ return;
119
+ }
120
+ let live = true;
121
+ for (const index of missing.split(',').map(Number)) {
122
+ load(timestamp, index).then(image => {
123
+ if (image === null || image === void 0 ? void 0 : image.data) {
124
+ const url = `data:${image.mimeType};base64,${image.data}`;
125
+ shownImages.set(`${timestamp}:${index}`, url);
126
+ if (live) {
127
+ setLoaded(current => ({ ...current, [index]: url }));
128
+ }
129
+ }
130
+ }, () => undefined);
131
+ }
132
+ return () => {
133
+ live = false;
134
+ };
135
+ }, [load, timestamp, missing]);
136
+ // Those with their bytes are kept too: the same message given again without them (the conversation read again) shows them at once.
137
+ React.useEffect(() => {
138
+ images.forEach(({ block, index }, at) => {
139
+ const key = keyOf(index);
140
+ if (block.data && key && own[at]) {
141
+ shownImages.set(key, own[at]);
142
+ }
143
+ });
144
+ });
145
+ return images.map(({ index }, at) => { var _a; return (_a = own[at]) !== null && _a !== void 0 ? _a : loaded[index]; });
60
146
  }
61
147
  /**
62
148
  * The images of a message of the user: one keeps its own shape at the size of a bubble, a few stand as
63
- * squares of one size, and a click on any of them opens it full size over the page.
149
+ * squares of one size, and a click on any of them opens it full size over the page. Each has its place
150
+ * before it loads (its size is known), so that nothing moves as it comes. `timestamp`: of the message,
151
+ * for those given without their bytes (MessageImages).
64
152
  */
65
- export function UserImages({ blocks }) {
153
+ export function UserImages({ blocks, timestamp }) {
66
154
  const t = useT();
67
155
  const [open, setOpen] = React.useState();
68
- const images = imagesOf(blocks);
156
+ const images = UserImageUtil.images(blocks);
157
+ const sources = useImageSources(images, timestamp);
69
158
  if (images.length === 0) {
70
159
  return null;
71
160
  }
72
- const src = (block) => `data:${block.mimeType};base64,${block.data}`;
161
+ const single = images.length === 1 ? UserImageUtil.box(UserImageUtil.size(images[0].block)) : undefined;
162
+ const shown = open !== undefined ? sources[open] : undefined;
73
163
  return (React.createElement("div", { className: "ta-user-images", "data-count": Math.min(images.length, 3) },
74
- images.map((block, index) => (React.createElement("button", { key: index, type: "button", className: "ta-user-image", title: t('ta.markdown.enlarge'), onClick: () => setOpen(index) },
75
- React.createElement("img", { className: "ta-thumb", src: src(block), alt: "" })))),
76
- open !== undefined && images[open] && React.createElement(Lightbox, { src: src(images[open]), alt: "", onClose: () => setOpen(undefined) })));
164
+ images.map(({ index }, at) => (React.createElement("button", { key: index, type: "button", className: "ta-user-image", title: t('ta.markdown.enlarge'), disabled: !sources[at], onClick: () => setOpen(at) }, sources[at] ? (React.createElement("img", { className: "ta-thumb", src: sources[at], alt: "", style: single })) : (React.createElement("span", { className: "ta-thumb ta-thumb-waiting", style: single }))))),
165
+ open !== undefined && shown && (React.createElement(Lightbox, { src: shown, alt: "", onClose: () => setOpen(undefined), onPrevious: open > 0 && sources[open - 1] ? () => setOpen(open - 1) : undefined, onNext: open < images.length - 1 && sources[open + 1] ? () => setOpen(open + 1) : undefined }))));
77
166
  }
78
167
  /**
79
168
  * What the user said, in the bubble of a message of theirs, with the pictures they sent with it in the same
80
169
  * bubble: the pictures first, the words under them. A message of pictures alone has no bubble of its own.
81
170
  * `bubble` is the class of that bubble, which a conversation and the double have of their own.
82
171
  */
83
- export function UserSaid({ blocks, text, bubble = 'ta-bubble' }) {
84
- if (imagesOf(blocks).length === 0) {
85
- return text ? React.createElement("div", { className: bubble }, text) : null;
172
+ export function UserSaid({ blocks, text, bubble = 'ta-bubble', timestamp }) {
173
+ if (UserImageUtil.images(blocks).length === 0) {
174
+ return text ? (React.createElement("div", { className: bubble },
175
+ React.createElement(SaidText, { text: text }))) : null;
86
176
  }
87
177
  return (React.createElement("div", { className: `${bubble} ta-bubble-media${text ? '' : ' ta-bubble-bare'}` },
88
- React.createElement(UserImages, { blocks: blocks }),
89
- text && React.createElement("div", { className: "ta-bubble-text" }, text)));
178
+ React.createElement(UserImages, { blocks: blocks, timestamp: timestamp }),
179
+ text && React.createElement(SaidText, { text: text, className: "ta-bubble-text" })));
90
180
  }
91
181
  function UserMessage({ message }) {
92
- var _a;
93
182
  const blocks = MessageUtil.blocks(message);
94
- const update = TASK_UPDATE.exec(MessageUtil.text(blocks).trim());
183
+ const said = MessageUtil.text(blocks).trim();
184
+ if (TASK_RENAMED.test(said)) {
185
+ // The double's conversation opened as a conversation: what told it a task's new id is for it only.
186
+ return null;
187
+ }
188
+ const update = TASK_UPDATE.exec(said);
95
189
  if (update) {
96
190
  return React.createElement(TaskUpdate, { title: update[1], status: update[2], result: update[3] });
97
191
  }
98
- const said = TaImageNote.strip(TaMessageContext.strip(MessageUtil.text(blocks)));
192
+ const { text, copied, skill } = userWords(blocks);
193
+ return React.createElement(UserBubble, { message: message, blocks: blocks, text: text, copied: copied, skill: skill });
194
+ }
195
+ /**
196
+ * What a message of the user's shows, in a conversation and the double alike: without the context and the notes of
197
+ * pictures sent with it, a skill they ran (`/skill:name`) taken out of the words as the skill; `copied` is what they typed.
198
+ */
199
+ export function userWords(blocks) {
200
+ var _a;
201
+ const said = TaImageNote.strip(TaMessageContext.strip(MessageUtil.text(blocks))).trim();
99
202
  const skill = TaSkillUse.parse(said);
100
- if (skill) {
101
- return React.createElement(UserBubble, { message: message, blocks: blocks, text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: TaSkillUse.command(skill), skill: skill });
102
- }
103
- return React.createElement(UserBubble, { message: message, blocks: blocks, text: said, copied: said });
203
+ return skill ? { text: (_a = skill.message) !== null && _a !== void 0 ? _a : '', copied: TaSkillUse.command(skill), skill } : { text: said, copied: said };
104
204
  }
105
205
  /** pi's first line of a skill it read, for the model: the path is in the title of the skill's line. */
106
206
  const SKILL_BASE = /^References are relative to [^\n]*\n+/;
107
207
  /** A skill the user ran: one line with its name, which opens to the skill's file, as a tool call opens. */
108
- function SkillUse({ skill }) {
208
+ export function SkillUse({ skill }) {
109
209
  const t = useT();
110
210
  const [open, setOpen] = React.useState(false);
111
211
  return (React.createElement("div", { className: "ta-skill-use" },
@@ -124,12 +224,12 @@ function UserBubble({ message, blocks, text, copied, skill, }) {
124
224
  if (sent) {
125
225
  // Not in the session yet: nothing to branch from or rewind to.
126
226
  return (React.createElement("div", { className: `ta-message ta-user ${sent.failed ? 'ta-user-failed' : 'ta-user-sending'}` },
127
- React.createElement(UserSaid, { blocks: blocks, text: text }),
227
+ React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
128
228
  sent.failed ? React.createElement(SendFailed, { sent: sent, actions: outbox.actions }) : React.createElement("div", { className: "ta-footer" })));
129
229
  }
130
230
  return (React.createElement("div", { className: "ta-message ta-user", onContextMenu: onContextMenu },
131
231
  skill && React.createElement(SkillUse, { skill: skill }),
132
- React.createElement(UserSaid, { blocks: blocks, text: text }),
232
+ React.createElement(UserSaid, { blocks: blocks, text: text, timestamp: message.timestamp }),
133
233
  React.createElement(UserFooter, { message: message, text: copied }),
134
234
  menu));
135
235
  }
@@ -155,20 +255,33 @@ const SummaryStep = React.memo(function SummaryStep({ text }) {
155
255
  React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-step-chevron" })),
156
256
  open && React.createElement("div", { className: "ta-thinking-text" }, text)));
157
257
  });
158
- const TextStep = React.memo(function TextStep({ text }) {
258
+ /** A request that failed on the way, the work going on after it: one quiet line, which opens to the error. */
259
+ const ErrorStep = React.memo(function ErrorStep({ text }) {
260
+ const t = useT();
261
+ const [open, setOpen] = React.useState(false);
262
+ return (React.createElement("div", { className: "ta-step-thinking ta-step-error" },
263
+ React.createElement("button", { type: "button", className: "ta-step-toggle", "aria-expanded": open, onClick: () => setOpen(!open) },
264
+ React.createElement("span", { className: "ta-status ta-status-error" }),
265
+ React.createElement("span", { className: "ta-step-tag" }, t('ta.process.retried')),
266
+ !open && text && React.createElement("span", { className: "ta-step-preview" }, ProcessUtil.preview(text))),
267
+ open && text && React.createElement("div", { className: "ta-thinking-text" }, text)));
268
+ });
269
+ const TextStep = React.memo(function TextStep({ text, streaming }) {
159
270
  return (React.createElement("div", { className: "ta-step-text" },
160
271
  React.createElement("span", { className: "ta-status ta-status-thought" }),
161
- React.createElement(Markdown, { text: text })));
272
+ React.createElement(Markdown, { text: text, streaming: streaming })));
162
273
  });
163
- function Step({ step, results, tools, tagged }) {
274
+ function Step({ step, results, tools, tagged, streaming, }) {
164
275
  var _a;
165
276
  switch (step.kind) {
166
277
  case 'thinking':
167
278
  return React.createElement(ThinkingStep, { text: step.text, tagged: tagged });
168
279
  case 'text':
169
- return React.createElement(TextStep, { text: step.text });
280
+ return React.createElement(TextStep, { text: step.text, streaming: streaming });
170
281
  case 'summary':
171
282
  return React.createElement(SummaryStep, { text: step.text });
283
+ case 'error':
284
+ return React.createElement(ErrorStep, { text: step.text });
172
285
  default: {
173
286
  const { id = '', name = '', arguments: args } = step.call;
174
287
  return (React.createElement(ToolView, { id: id, name: name, args: (_a = args) !== null && _a !== void 0 ? _a : {}, run: id ? tools[id] : undefined, message: id ? results.get(id) : undefined, runs: tools }));
@@ -234,17 +347,24 @@ function useFold(open, ref, slideOpen) {
234
347
  * so that a long conversation reads as what was asked and what came of it. Before the first step the
235
348
  * line says what ta does. The avatar stays the same element from the turn's first frame to its last.
236
349
  */
237
- export function Process({ steps, active, results, tools, leading, status, }) {
350
+ export function Process({ steps, active, results, tools, leading, status, stopped, }) {
238
351
  const t = useT();
239
352
  const [manual, setManual] = React.useState();
240
353
  const [showAll, setShowAll] = React.useState(false);
241
354
  const id = React.useId();
242
355
  const stepsRef = React.useRef(null);
243
356
  const { steps: count, failed } = ToolUtil.count(ProcessUtil.tools(steps), results, tools);
244
- // Open while it works, then folded; a failed step says so on the head, quietly.
245
- const open = manual !== null && manual !== void 0 ? manual : active;
357
+ // Open while it works, then folded; a failed step says so on the head, quietly. A turn that stopped short keeps
358
+ // its work open: there is no reply, and its last steps say where it stopped.
359
+ const open = manual !== null && manual !== void 0 ? manual : (active || !!stopped);
246
360
  const shown = useFold(open && steps.length > 0, stepsRef, !active);
247
- const folded = ProcessUtil.fold(steps, active, showAll);
361
+ const folded = ProcessUtil.fold(steps, active || !!stopped, showAll);
362
+ // Folded, the cards on the way stay under the head: a choice asked in the middle is not hidden with the work.
363
+ const renderers = React.useContext(CodeRenderers);
364
+ const pinned = open ? [] : steps.filter(step => ProcessUtil.pinned(step, renderers));
365
+ const inline = pinned.length ? folded.steps.filter(step => !ProcessUtil.pinned(step, renderers)) : folded.steps;
366
+ // The earlier steps count as the head does: the calls among them, not the thoughts.
367
+ const earlier = folded.hidden ? ToolUtil.count(ProcessUtil.tools(steps.slice(0, folded.hidden)), results, tools).steps : 0;
248
368
  // Only thoughts: the head already says so, the steps need not say it again.
249
369
  const thoughtOnly = steps.every(step => step.kind === 'thinking');
250
370
  const title = count ? t(active ? 'ta.process.running' : 'ta.process.done', { count }) : t(active ? 'ta.process.thinking' : 'ta.process.thought');
@@ -258,21 +378,31 @@ export function Process({ steps, active, results, tools, leading, status, }) {
258
378
  t('ta.process.failed', { count: failed })),
259
379
  React.createElement(Icon, { icon: ChevronRight, size: 14, className: "ta-process-chevron" }))) : (status)),
260
380
  shown && (React.createElement("div", { id: id, ref: stepsRef, className: "ta-process-steps" },
261
- folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, t('ta.process.earlier', { count: folded.hidden }))),
262
- folded.steps.map(step => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly })))))));
381
+ folded.hidden > 0 && (React.createElement("button", { type: "button", className: "ta-link ta-more", onClick: () => setShowAll(true) }, earlier ? t('ta.process.earlier', { count: earlier }) : t('ta.process.showAll'))),
382
+ inline.map((step, index) => (React.createElement(Step, { key: step.key, step: step, results: results, tools: tools, tagged: !thoughtOnly, streaming: active && index === inline.length - 1 }))))),
383
+ pinned.map(step => (React.createElement(Markdown, { key: step.key, text: step.text })))));
263
384
  }
264
385
  /** A turn that has shown nothing yet: what ta does goes on its head. */
265
386
  export function quiet(item) {
266
387
  return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.active && !item.steps.length && !item.reply.some(text => text.trim());
267
388
  }
389
+ /**
390
+ * A turn that ends with its steps, no words after them: the line of what ta does is one more of its steps
391
+ * (.ta-run-steps). Said by the class, not by `:last-child` in `:has()`: WebKit does not style the line
392
+ * again when the words under the steps go into them, and it stayed out of line until something else drew.
393
+ */
394
+ export function endsInSteps(item) {
395
+ return (item === null || item === void 0 ? void 0 : item.kind) === 'turn' && item.steps.length > 0 && !item.reply.length;
396
+ }
268
397
  function Turn({ item, tools, mood, status, latest, }) {
269
398
  var _a;
270
399
  const t = useT();
271
400
  const session = React.useContext(ConversationSession);
272
401
  const results = MessageUtil.results(item.messages);
273
402
  const { errorMessage } = ((_a = item.last) !== null && _a !== void 0 ? _a : {});
274
- const stopReason = MessageUtil.stopReason(item.last);
403
+ const ending = ProcessUtil.ending(item);
275
404
  const reply = item.reply.join('\n\n').trim();
405
+ const actions = React.useContext(MessageActions);
276
406
  const [menu, onContextMenu] = useMessageMenu({
277
407
  kind: 'turn',
278
408
  last: item.active ? undefined : item.last,
@@ -281,13 +411,25 @@ function Turn({ item, tools, mood, status, latest, }) {
281
411
  messages: item.messages,
282
412
  });
283
413
  return (React.createElement("div", { className: `ta-message ta-assistant ${item.active ? 'ta-turn-live' : ''}`, onContextMenu: onContextMenu },
284
- React.createElement(Process, { steps: item.steps, active: item.active, results: results, tools: tools, leading: React.createElement(TurnAvatar, { mood: mood }), status: status }),
414
+ React.createElement(Process, { steps: item.steps, active: item.active, stopped: ending !== undefined && ending !== 'aborted', results: results, tools: tools, leading: React.createElement(TurnAvatar, { mood: mood }), status: status }),
285
415
  item.reply.map((text, index) => (React.createElement(Markdown, { key: index, text: text, streaming: item.active && index === item.reply.length - 1 }))),
286
- !item.active && stopReason === 'error' && errorMessage && React.createElement(Callout, { level: "error" }, errorMessage),
287
- !item.active && stopReason === 'aborted' && React.createElement("div", { className: "ta-muted ta-small" }, t('ta.message.stopped')),
416
+ ending && ending !== 'aborted' && (React.createElement(TurnEnd, { ending: ending, error: errorMessage, retries: item.steps.filter(step => step.kind === 'error').length, resume: latest && !(actions === null || actions === void 0 ? void 0 : actions.working) ? actions === null || actions === void 0 ? void 0 : actions.resume : undefined })),
417
+ ending === 'aborted' && React.createElement("div", { className: "ta-muted ta-small" }, t('ta.message.stopped')),
288
418
  !item.active && React.createElement(TurnFooter, { messages: item.messages, last: item.last, reply: reply, session: session, latest: latest }),
289
419
  menu));
290
420
  }
421
+ /**
422
+ * Why a turn stopped short, under it: the error (and that pi retried it, how many times), or that it was cut off,
423
+ * or ended without a word; the last turn has a button to go on, which says so to the agent.
424
+ */
425
+ function TurnEnd({ ending, error, retries, resume }) {
426
+ const t = useT();
427
+ const action = resume && (React.createElement("button", { type: "button", className: "ta-button", onClick: resume }, t('ta.message.resume')));
428
+ if (ending === 'error') {
429
+ return (React.createElement(Callout, { level: "error", detail: retries ? t('ta.message.retriedFailed', { count: retries }) : undefined, action: action }, (error === null || error === void 0 ? void 0 : error.trim()) || t('ta.message.failedUnknown')));
430
+ }
431
+ return (React.createElement(Callout, { level: "warning", action: action }, t(ending === 'interrupted' ? 'ta.message.interrupted' : 'ta.message.silent')));
432
+ }
291
433
  /** `!command` of a user, which pi records as its own kind of message. */
292
434
  function BashMessage({ message }) {
293
435
  const { command, output, exitCode } = message;
@@ -337,28 +479,33 @@ const ThreadRow = React.memo(function ThreadRow({ item, tools, mood, status, lat
337
479
  (next.item.kind === 'message' || !next.item.active || previous.tools === next.tools));
338
480
  /** The last rows, which change and are in view, are always laid out. */
339
481
  const SETTLED_AFTER = 4;
340
- /** The conversation; tool results show with the calls they answer. */
341
- export function MessageList({ state, outbox }) {
482
+ /** The conversation; tool results show with the calls they answer. `rows`: only its latest rows are drawn, more as asked. */
483
+ export function MessageList({ state, outbox, rows }) {
342
484
  var _a;
343
- const items = React.useMemo(() => ProcessUtil.items(state.messages, state.working, state.start), [state.messages, state.working, state.start]);
485
+ var _b;
344
486
  const renderers = React.useContext(MessageRenderers);
487
+ const items = React.useMemo(() => ProcessUtil.items(state.messages, state.working, state.start, renderers), [state.messages, state.working, state.start, renderers]);
345
488
  const breaks = React.useMemo(() => ProcessUtil.timeBreaks(ProcessUtil.starts(items), index => ProcessUtil.shown(items[index], renderers)), [items, renderers]);
489
+ const models = React.useMemo(() => ProcessUtil.modelBreaks(items), [items]);
346
490
  const sent = React.useMemo(() => { var _a; return ({ of: new Map(((_a = state.outbox) !== null && _a !== void 0 ? _a : []).map(message => [message.message, message])), actions: outbox }); }, [state.outbox, outbox]);
491
+ // The rows held back: those before the latest `rows.rows`.
492
+ const from = rows ? Math.max(0, items.length - rows.rows) : 0;
493
+ if (rows) {
494
+ rows.hidden.current = from;
495
+ }
347
496
  // Rows of earlier messages put in front are laid out once before they may skip it (content-visibility):
348
497
  // their height is then known, and the view does not move as they come near it.
349
- const firstKey = React.useRef((_a = items[0]) === null || _a === void 0 ? void 0 : _a.key);
350
- const front = Math.max(0, items.findIndex(item => item.key === firstKey.current));
498
+ const firstKey = React.useRef((_a = items[from]) === null || _a === void 0 ? void 0 : _a.key);
499
+ const front = Math.max(from, items.findIndex(item => item.key === firstKey.current));
351
500
  React.useLayoutEffect(() => {
352
501
  var _a;
353
- firstKey.current = (_a = items[0]) === null || _a === void 0 ? void 0 : _a.key;
502
+ firstKey.current = (_a = items[from]) === null || _a === void 0 ? void 0 : _a.key;
354
503
  });
355
- // Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again, still.
356
- const still = React.useRef(items.length);
357
- const count = React.useRef(items.length);
358
- if (items.length < still.current || items.length > count.current + 2) {
359
- still.current = items.length;
360
- }
361
- count.current = items.length;
504
+ // Rows that come after the list is drawn come in with a motion; those of a conversation opened or loaded again,
505
+ // and those already there when earlier messages come in front of them, still: by key, not by index.
506
+ const freshRows = React.useRef(undefined);
507
+ (_b = freshRows.current) !== null && _b !== void 0 ? _b : (freshRows.current = new FreshRows(items));
508
+ const fresh = freshRows.current.from(items);
362
509
  let lastTurn = items.length - 1;
363
510
  while (lastTurn >= 0 && items[lastTurn].kind !== 'turn') {
364
511
  lastTurn--;
@@ -369,17 +516,18 @@ export function MessageList({ state, outbox }) {
369
516
  const status = state.working || state.compacting ? React.createElement(RunStatus, { state: state }) : undefined;
370
517
  const onHead = status && quiet(last);
371
518
  return (React.createElement(Outbox.Provider, { value: sent },
372
- items.map((item, index) => (React.createElement("div", { key: item.key, className: [
519
+ items.map((item, index) => index < from ? null : (React.createElement("div", { key: item.key, className: [
373
520
  'ta-thread-item',
374
521
  index >= front && index < items.length - SETTLED_AFTER && 'ta-settled',
375
522
  index === items.length - 1 && 'ta-thread-last',
376
- index >= still.current && 'ta-thread-new',
523
+ index >= fresh && 'ta-thread-new',
377
524
  item.kind === 'message' && item.message.role === 'user' && ASK_CLASS,
378
525
  ]
379
526
  .filter(Boolean)
380
527
  .join(' ') },
381
528
  breaks[index] !== undefined && React.createElement(TimeBreak, { timestamp: breaks[index] }),
529
+ models[index] && React.createElement(ModelBreak, { model: models[index] }),
382
530
  React.createElement(ThreadRow, { item: item, tools: state.tools, mood: item.kind === 'turn' ? ProcessUtil.mood(item, index === lastTurn, waiting) : 'idle', status: onHead && item === last ? status : undefined, latest: index === lastTurn })))),
383
- status && !onHead && React.createElement("div", { className: "ta-run-line" }, status)));
531
+ status && !onHead && React.createElement("div", { className: `ta-run-line ${endsInSteps(last) ? 'ta-run-steps' : ''}` }, status)));
384
532
  }
385
533
  //# sourceMappingURL=message-list.js.map
@@ -37,7 +37,12 @@ export function useMessageMenu(subject) {
37
37
  const items = [];
38
38
  const text = subject.kind === 'user' ? subject.text : subject.reply;
39
39
  if (text) {
40
- items.push({ label: t('ta.copy'), run: () => copy(text) }, { label: t('ta.message.selectText'), run: () => setSelecting(text) });
40
+ items.push({ label: t('ta.copy'), run: () => copy(text) });
41
+ if (actions === null || actions === void 0 ? void 0 : actions.quote) {
42
+ const quote = actions.quote;
43
+ items.push({ label: t('ta.message.quote'), run: () => quote(text) });
44
+ }
45
+ items.push({ label: t('ta.message.selectText'), run: () => setSelecting(text) });
41
46
  }
42
47
  if (subject.kind === 'user' && branches) {
43
48
  items.push('-', { label: t('ta.message.forkBefore'), run: () => actions.fork(subject.message, 'before') }, { label: t('ta.message.rewind'), run: () => actions.rewind(subject.message) });
@@ -60,6 +60,7 @@ export var ModelPickerUtil;
60
60
  key: 'model',
61
61
  label: t('ta.session.model'),
62
62
  icon: React.createElement(Icon, { icon: Box, size: 16 }),
63
+ setting: true,
63
64
  detail: value ? name(source, value) : t('ta.session.noModel'),
64
65
  searchLabel: t('ta.model.search'),
65
66
  items: options(source, value).map(option => ({ ...option, run: () => pick(option.key) })),
@@ -1,5 +1,7 @@
1
+ import type { TaWebExtensionInfo } from '@celljs/ta-protocol';
1
2
  import type { Hold } from '../device/hold.js';
2
3
  import { type WebViewEntry } from '../extension/web-extension-protocol.js';
4
+ import { type WebPageInfo } from '../extension/web-pages.js';
3
5
  import { type NavigationSetting } from '../settings/navigation.js';
4
6
  import type { ContextMenuItem } from './context-menu.js';
5
7
  import type { PhoneTab } from './phone-shell.js';
@@ -37,13 +39,30 @@ export interface Navigation {
37
39
  /** Those in the navigation, and those under Discover (NavigationUtil.arrange). */
38
40
  nav: WebViewEntry[];
39
41
  discover: WebViewEntry[];
42
+ /**
43
+ * The pages of installed extensions started on open (ta-launcher.md): under Discover after `discover`,
44
+ * never in the navigation, their extensions loaded only when opened.
45
+ */
46
+ onOpen: WebPageInfo[];
40
47
  setting: NavigationSetting;
41
48
  pin(id: string): void;
42
49
  fold(id: string): void;
43
50
  update(setting: NavigationSetting): void;
44
51
  }
45
- /** Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them in the room there is. */
46
- export declare function places(views: WebViewEntry[], setting: NavigationSetting, handheld: boolean): Pick<Navigation, 'home' | 'pages' | 'nav' | 'discover'>;
52
+ /**
53
+ * Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them
54
+ * in the room there is. `own`: Discover lists pages of extensions started on open, so it is there in any case.
55
+ */
56
+ export declare function places(views: WebViewEntry[], setting: NavigationSetting, handheld: boolean, own?: boolean): Pick<Navigation, 'home' | 'pages' | 'nav' | 'discover'>;
57
+ /**
58
+ * Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
59
+ * in a list; the pages of a kind that a page lists (the Games page) are only there.
60
+ */
61
+ export declare function arrangeViews(views: readonly WebViewEntry[], onOpen: readonly {
62
+ info: TaWebExtensionInfo;
63
+ }[], setting: NavigationSetting, handheld: boolean, infoOf: (extensionId: string) => TaWebExtensionInfo | undefined, kinds: ReadonlySet<string>): (view: WebViewEntry) => 'navigation' | 'discover' | 'list';
64
+ /** Discover is in the navigation: some pages are under it. */
65
+ export declare function hasDiscover(navigation: Pick<Navigation, 'discover' | 'onOpen'>): boolean;
47
66
  export interface PhoneTabLabels {
48
67
  discover: string;
49
68
  me: string;
@@ -1,5 +1,6 @@
1
1
  import { Compass, PanelTop, User } from 'lucide-react';
2
2
  import { WebLabelUtil } from '../extension/web-extension-protocol.js';
3
+ import { WebPagesUtil } from '../extension/web-pages.js';
3
4
  import { NavigationUtil } from '../settings/navigation.js';
4
5
  import { DOUBLE_PAGE } from './side-lists.js';
5
6
  /* The places of the navigation, the same on the rail and in the tabs of a phone: which pages, in what order. */
@@ -26,13 +27,28 @@ export const ME_TAB = 'ta/me';
26
27
  export function fixedTabs(views) {
27
28
  return views.filter(view => view.location === 'sidebar').length + 2;
28
29
  }
29
- /** Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them in the room there is. */
30
- export function places(views, setting, handheld) {
30
+ /**
31
+ * Where the pages of the rail go: the double's first when no sidebar view lists it, the rest as the user put them
32
+ * in the room there is. `own`: Discover lists pages of extensions started on open, so it is there in any case.
33
+ */
34
+ export function places(views, setting, handheld, own = false) {
31
35
  const all = railPages(views);
32
36
  const home = all.find(view => view.id === DOUBLE_PAGE);
33
37
  const pages = home ? all.filter(view => view !== home) : all;
34
38
  const room = handheld ? Math.max(1, NavigationUtil.PHONE_TABS - fixedTabs(views) - (home ? 1 : 0)) : undefined;
35
- return { home, pages, ...NavigationUtil.arrange(pages, setting, room) };
39
+ return { home, pages, ...NavigationUtil.arrange(pages, setting, room, own) };
40
+ }
41
+ /**
42
+ * Where each page of the extensions is on this device (WebPageInfo.place): in the navigation, under Discover, or
43
+ * in a list; the pages of a kind that a page lists (the Games page) are only there.
44
+ */
45
+ export function arrangeViews(views, onOpen, setting, handheld, infoOf, kinds) {
46
+ const arranged = places(views.filter(view => !WebPagesUtil.listed(infoOf(view.extension), kinds)), setting, handheld, onOpen.some(entry => !entry.info.temporary && !WebPagesUtil.listed(entry.info, kinds)));
47
+ return view => (view === arranged.home || arranged.nav.includes(view) ? 'navigation' : arranged.discover.includes(view) ? 'discover' : 'list');
48
+ }
49
+ /** Discover is in the navigation: some pages are under it. */
50
+ export function hasDiscover(navigation) {
51
+ return navigation.discover.length > 0 || navigation.onOpen.length > 0;
36
52
  }
37
53
  /**
38
54
  * The tabs at the bottom of a phone, as a messaging app has them: the lists of the sidebar, the chats, the pages
@@ -51,7 +67,7 @@ export function phoneTabs(lists, navigation, labels) {
51
67
  ...(navigation.home ? [{ ...tab(navigation.home), double: true, hold: labels.holds.double }] : []),
52
68
  ...lists.map(list),
53
69
  ...navigation.nav.map(view => tab(view, [{ label: labels.fold, run: () => navigation.fold(view.id) }, '-', labels.settings])),
54
- ...(navigation.discover.length > 0 ? [{ id: DISCOVER, label: labels.discover, icon: Compass, menu: [labels.settings] }] : []),
70
+ ...(hasDiscover(navigation) ? [{ id: DISCOVER, label: labels.discover, icon: Compass, menu: [labels.settings] }] : []),
55
71
  { id: ME_TAB, label: labels.me, icon: User },
56
72
  ];
57
73
  }
@@ -6,6 +6,7 @@ import { useT } from '../i18n/use-t.js';
6
6
  import { NoticesUtil } from '../notices/notices.js';
7
7
  import { LEVEL_ICONS } from './callout.js';
8
8
  import { Icon, IconButton } from './icon.js';
9
+ import { NoticeFace } from './notice-face.js';
9
10
  import { TerminalArt } from './terminal-art.js';
10
11
  /** How long a notice takes to go, in style.ts. */
11
12
  const LEAVE_MS = 160;
@@ -42,6 +43,36 @@ function useLifetime(notice, leave) {
42
43
  onBlur: () => setHeld(false),
43
44
  };
44
45
  }
46
+ /**
47
+ * What a conversation said, as a messenger's banner: its face and name, what it asks beside it, the message in two
48
+ * lines; a tap opens it, its answers are buttons under it.
49
+ */
50
+ function SessionToast({ notice, leaving, leave, hold, }) {
51
+ var _a;
52
+ const t = useT();
53
+ const { from } = notice;
54
+ const actions = [...((_a = notice.actions) !== null && _a !== void 0 ? _a : []), ...(notice.action ? [notice.action] : [])];
55
+ const open = () => {
56
+ from.open();
57
+ leave();
58
+ };
59
+ return (React.createElement("div", { className: `ta-toast ta-toast-session${leaving ? ' ta-leaving' : ''}`, role: from.status ? 'alert' : 'status', ...hold },
60
+ React.createElement("button", { type: "button", className: "ta-toast-open", onClick: open },
61
+ React.createElement("span", { className: "ta-toast-face" },
62
+ React.createElement(NoticeFace, { from: from, size: 38 })),
63
+ React.createElement("span", { className: "ta-toast-text" },
64
+ React.createElement("span", { className: "ta-toast-head" },
65
+ React.createElement("span", { className: "ta-toast-title" }, from.title),
66
+ from.status && (React.createElement("span", { className: `ta-chat-state ${from.status === 'ask' ? 'ta-waiting' : 'ta-failed'}` },
67
+ React.createElement("span", { className: `ta-status ${from.status === 'ask' ? 'ta-status-waiting' : 'ta-status-error'}` }),
68
+ t(from.status === 'ask' ? 'ta.task.waiting' : 'ta.task.failed')))),
69
+ React.createElement("span", { className: "ta-toast-message" }, notice.message))),
70
+ actions.length > 0 && (React.createElement("div", { className: "ta-toast-actions" }, actions.map(action => (React.createElement("button", { key: action.label, type: "button", className: "ta-toast-action", onClick: () => {
71
+ action.run();
72
+ leave();
73
+ } }, action.label))))),
74
+ React.createElement(IconButton, { icon: X, label: t('ta.dismiss'), className: "ta-toast-close", onClick: leave })));
75
+ }
45
76
  function Toast({ notice, notices }) {
46
77
  const t = useT();
47
78
  const [leaving, setLeaving] = React.useState(false);
@@ -50,6 +81,9 @@ function Toast({ notice, notices }) {
50
81
  setTimeout(() => notices.dismiss(notice.id), LEAVE_MS);
51
82
  }, [notices, notice.id]);
52
83
  const hold = useLifetime(notice, leave);
84
+ if (notice.from) {
85
+ return React.createElement(SessionToast, { notice: notice, leaving: leaving, leave: leave, hold: hold });
86
+ }
53
87
  return (React.createElement("div", { className: `ta-toast ta-level-${notice.level}${notice.art ? ' ta-toast-with-art' : ''}${leaving ? ' ta-leaving' : ''}`, role: notice.level === 'error' ? 'alert' : 'status', ...hold },
54
88
  React.createElement(Icon, { icon: LEVEL_ICONS[notice.level], size: 16, className: "ta-level-icon" }),
55
89
  React.createElement("div", { className: "ta-toast-text" },
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import type { NoticeFrom } from '../notices/notices-protocol.js';
3
+ /**
4
+ * The face a conversation has in the lists, for a notice it gave (NoticeFrom): the double's, an agent's, else the
5
+ * letter of its directory in its color. Nothing while the lists do not have it.
6
+ */
7
+ export declare function NoticeFace({ from, size }: {
8
+ from: NoticeFrom;
9
+ size: number;
10
+ }): React.JSX.Element | null;