@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,10 +1,26 @@
1
- import type { TaEvent, TaPackageServer, TaRemoteServer, TaServer, TaSessionInfo, TaSettingsServer, TaTerminalServer, TaWorkspaceServer } from '@celljs/ta-protocol';
1
+ import type { TaEvent, TaPackageServer, TaRemoteServer, TaRoomEvent, TaRoomServer, TaSavedSessionInfo, TaServer, TaSessionInfo, TaSettingsServer, TaTerminalServer, TaWorkspaceServer } from '@celljs/ta-protocol';
2
2
  import type * as React from 'react';
3
3
  import type { Mood } from '../avatar/dino-avatar.js';
4
4
  import type { DeviceState } from '../device/device-protocol.js';
5
5
  import type { TaFiles } from '../files/files-protocol.js';
6
+ import type { GameProps } from '../game/game-protocol.js';
7
+ import type { Game3DProps } from '../game/game3d-protocol.js';
6
8
  import type { Language, Theme } from '../settings/settings-protocol.js';
9
+ import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebSkeletonProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebVoice } from './web-api-components.js';
10
+ import type { WebChatIconSource, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebHomeEntry, WebHomeSource, WebMenuItem, WebSearchSource, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
11
+ import type { WebDesktop, WebFileDrag } from './web-api-desktop.js';
12
+ import type { WebTerminal, WebTerminalOptions } from './web-api-terminal.js';
7
13
  import type { WebPageInfo } from './web-pages.js';
14
+ export type { Mood } from '../avatar/dino-avatar.js';
15
+ export type { DeviceLayout, DeviceState } from '../device/device-protocol.js';
16
+ export type { TaFileBytes, TaFiles } from '../files/files-protocol.js';
17
+ export type { GameColors, GameConfig, GameEngine, GameInstance, GamePage, GameProps } from '../game/game-protocol.js';
18
+ export type { Game3DContext, Game3DEngine, Game3DLoop, Game3DProps } from '../game/game3d-protocol.js';
19
+ export type { Language, Theme } from '../settings/settings-protocol.js';
20
+ export type * from './web-api-components.js';
21
+ export type * from './web-api-contributions.js';
22
+ export type * from './web-api-desktop.js';
23
+ export type * from './web-api-terminal.js';
8
24
  export type { WebPageInfo, WebPageState } from './web-pages.js';
9
25
  /**
10
26
  * What a web extension gets: the web client's side of pi's extension API, with the same names where
@@ -32,6 +48,13 @@ export interface WebExtensionAPI {
32
48
  readonly remote: TaRemoteServer;
33
49
  /** pi's settings of ta (`settings.json`): `getSettings(cwd)` also lists the models with credentials, for a model picker. */
34
50
  readonly settings: TaSettingsServer;
51
+ /**
52
+ * Rooms shared with other Ta through the relay, end to end (docs/design/ta-link.md 3): make one of a `kind` of the
53
+ * extension's own, invite by a link, send messages and keep a shared state with versions; what happens comes by
54
+ * {@link onRoomEvent}. Joining is asked of the owner, who answers in their own Ta: ask the user before `join`, and
55
+ * `answer` only for the user. Newer than some Ta apps: `pi.rooms?.…`.
56
+ */
57
+ readonly rooms: WebRooms;
35
58
  readonly ui: WebExtensionUI;
36
59
  /** A view of its own: a page or a sidebar view, in the navigation on the left, or a tool of the workbench on the right. */
37
60
  registerView(name: string, view: WebView): void;
@@ -39,13 +62,35 @@ export interface WebExtensionAPI {
39
62
  registerMessageRenderer(customType: string, renderer: React.ComponentType<{
40
63
  message: WebCustomMessage;
41
64
  }>): void;
65
+ /**
66
+ * Draws the fenced blocks of a language (` ```name `) in replies and in `ui.Markdown` itself, as Mermaid is drawn:
67
+ * what a model writes to be seen rather than read, a card of its own. It gets the code as it streams (`closed`
68
+ * false until the fence ends); what throws shows as code. Newer than some Ta apps: `pi.registerCodeRenderer?.(…)`.
69
+ */
70
+ registerCodeRenderer(language: string, renderer: React.ComponentType<WebCodeRendererProps>): void;
42
71
  /**
43
72
  * Who answers in the sessions of its group (TaOpenSessionOptions.group, the name of the extension's
44
73
  * package), drawn at the head of each turn in place of ta.
45
74
  */
46
75
  registerAvatar(avatar: React.ComponentType<WebAvatarProps>): void;
76
+ /**
77
+ * An icon for conversations of the extension that are no agent of a group (its brief, its questions), in the lists
78
+ * and on their notices, in place of the letter of their directory. Newer than some Ta apps: `pi.registerChatIcon?.(…)`.
79
+ */
80
+ registerChatIcon(source: WebChatIconSource): void;
81
+ /**
82
+ * Rows of the double's home, under the double, which the page lists with `ui.useHomeItems`: what the user looks at
83
+ * each day (a daily brief). Newer than some Ta apps: `pi.registerHomeItems?.(…)`.
84
+ */
85
+ registerHomeItems(source: WebHomeSource): void;
47
86
  /** A tool of the conversations the page opens, run in the browser. */
48
87
  registerTool(tool: WebTool): void;
88
+ /**
89
+ * How calls of tools read in conversations: a verb and what it is on, in place of the tool's name. As
90
+ * pi's `registerToolRenderer`, for any tool: one of the package's pi extension, of {@link registerTool},
91
+ * or of another; resolvers are asked in the order the extensions loaded.
92
+ */
93
+ registerToolRenderer(resolver: WebToolRendererResolver): void;
49
94
  /**
50
95
  * Work done on the user's behalf, which the double lists with its own tasks (`ui.useTasks`): a team
51
96
  * Ta built in a channel, a job of a schedule. What the user hands to the double they follow there.
@@ -67,7 +112,12 @@ export interface WebExtensionAPI {
67
112
  * Openers are asked in the order they were registered; the first that returns true has opened it.
68
113
  * Without one, a page opens in the browser of the system after the user said so.
69
114
  */
70
- registerOpener(opener: WebOpener): void;
115
+ registerOpener(opener: WebOpener, options?: WebOpenerOptions): void;
116
+ /**
117
+ * Entries of the menu of a conversation where a list shows it (a right click or a held finger on its row), in a
118
+ * section of their own after Ta's: read each time the menu opens.
119
+ */
120
+ registerSessionMenu(menu: WebSessionMenu): void;
71
121
  /** The events of the conversation shown. */
72
122
  on<T extends TaEvent['type']>(type: T, handler: (event: Extract<TaEvent, {
73
123
  type: T;
@@ -84,6 +134,12 @@ export interface WebExtensionAPI {
84
134
  * A session still opening (a promise of its id) is in front at once, as it opens, under `opening`: the user sees the click take.
85
135
  */
86
136
  switchSession(session: string | Promise<string>, opening?: WebSessionOpening): Promise<void>;
137
+ /**
138
+ * Shows the conversation of a session file of Ta as the lists open it: at once as the page or the device has it,
139
+ * opened again in one round trip when it closed; false when no conversation has it. Newer than some Ta apps:
140
+ * `pi.openChat?.(…)`.
141
+ */
142
+ openChat(sessionFile: string): Promise<boolean>;
87
143
  /**
88
144
  * Calls a method of the server side of the extension's package (`pi.host` of its package.json, which
89
145
  * ta serve runs for the packages that come with Ta), with JSON values: what the page cannot do itself.
@@ -103,9 +159,23 @@ export interface WebExtensionAPI {
103
159
  openTemporary(source: string, from: 'market' | 'link' | 'agent'): Promise<string>;
104
160
  /** Small JSON values the package keeps on the server, so they stay across browsers. */
105
161
  readonly storage: WebPackageStorage;
162
+ /**
163
+ * What happens in the rooms: messages, changes of the shared state, who asks to join, `rooms` when the list, members or
164
+ * who is online changed (and after a reconnection: read them again). The page hears them while one listens; with
165
+ * `messages: false`, only `rooms` and `request` (for a list of rooms, not a game), which costs the page nothing while
166
+ * nothing happens; with `state` too, the state of the keys that start with one of them (`['chat:']`), not the
167
+ * messages, for a list that shows what was said last. Stops when the extension unloads. Newer than some Ta apps:
168
+ * `pi.onRoomEvent?.(…)`; a Ta of before `state` hears that state only with `messages`.
169
+ */
170
+ onRoomEvent(listener: (event: TaRoomEvent) => void, options?: {
171
+ messages?: boolean;
172
+ state?: string[];
173
+ }): () => void;
106
174
  /** Output of the terminals this page opened (terminals.openTerminal); with `exitCode`, the terminal ended. Stops when the extension unloads. */
107
175
  onTerminalData(listener: (terminalId: string, data: string, exitCode?: number) => void): () => void;
108
176
  }
177
+ /** The rooms of ta serve (TaRoomServer), which the page watches for the extensions that listen (`onRoomEvent`). */
178
+ export type WebRooms = Omit<TaRoomServer, 'watch' | 'unwatch'>;
109
179
  /** Lines and columns of a file, from 1: a line, a place in it, or a range. */
110
180
  export interface TextSelection {
111
181
  startLine: number;
@@ -132,6 +202,25 @@ export type WebLink = {
132
202
  };
133
203
  /** True when it opened the link; false leaves it to the next opener. */
134
204
  export type WebOpener = (link: WebLink) => boolean | Promise<boolean>;
205
+ export interface WebOpenerOptions {
206
+ /**
207
+ * It opens some links only, of its own (a link of a share): it is asked before the others, and for links that
208
+ * go out of Ta too (one scanned, opened with Cmd or Ctrl, pasted in Quick open), which the others are not.
209
+ */
210
+ specific?: boolean;
211
+ }
212
+ /** A conversation as a list shows it: an open one has its session, one kept on the disk its file only. */
213
+ export interface WebSessionRef {
214
+ sessionId?: string;
215
+ sessionFile?: string;
216
+ cwd: string;
217
+ /** As the list names it. */
218
+ title: string;
219
+ /** TaSessionInfo.group. */
220
+ group?: string;
221
+ }
222
+ /** The entries an extension adds to the menu of a conversation of a list (registerSessionMenu); none for some. */
223
+ export type WebSessionMenu = (session: WebSessionRef) => WebMenuItem[];
135
224
  /** What a session still opening is shown as (`switchSession`): the head of its conversation, till it comes. */
136
225
  export interface WebSessionOpening {
137
226
  title?: string;
@@ -175,6 +264,21 @@ export interface WebExtensionUI {
175
264
  setWidget(key: string, widget: React.ComponentType | undefined, options?: WidgetOptions): void;
176
265
  /** A notice in the corner of the page, as pi's: it goes by itself, an error later than the rest. */
177
266
  notify(message: string, type?: 'info' | 'warning' | 'error'): void;
267
+ /**
268
+ * Tells the user what a conversation said, as a messenger tells of a message: nothing while they look at it
269
+ * (and nothing of a task the double follows, which tells of it, unless it asks); a banner with its face and
270
+ * name, a tap opening it, while the page is in front; a notice of the system otherwise, once the user allowed
271
+ * them, silent for `done`; without one, a banner that waits for the user's return when it asks or failed.
272
+ */
273
+ notifySession(notice: WebSessionNotice): void;
274
+ /** A React hook: the rows extensions add to the double's home (registerHomeItems), in the order they loaded. */
275
+ useHomeItems(): readonly WebHomeEntry[];
276
+ /**
277
+ * Pins a conversation to the top of the lists (or unpins it), by its session file, as the user does with Pin: for
278
+ * one the extension made that the user looks at each day. Pin it once; the user may unpin it. Newer than some Ta
279
+ * apps: `pi.ui.pinChat?.(…)`.
280
+ */
281
+ pinChat(sessionFile: string, pinned?: boolean): void;
178
282
  /**
179
283
  * Asks before going ahead, as pi's `confirm`: resolves with whether the user did. `confirmLabel` names
180
284
  * the button that goes ahead; `danger` makes it red, for what cannot be undone.
@@ -256,6 +360,12 @@ export interface WebExtensionUI {
256
360
  * (`isStreaming`), what was said last. The same array until one changes.
257
361
  */
258
362
  useSessions(): readonly TaSessionInfo[];
363
+ /**
364
+ * A React hook: the saved conversations of the last days (Settings.chatArchiveDays) as the lists of the page have
365
+ * them, read again as sessions close; not those older. The same array until one changes. Rather than reading
366
+ * `server.listSavedSessions()` again and again. Newer than some Ta apps: `pi.ui.useSavedSessions?.()`.
367
+ */
368
+ useSavedSessions(): readonly TaSavedSessionInfo[];
259
369
  /**
260
370
  * Shows a view of any web extension by its id, `<extension name>/<view name>` (`assistant/assistant`
261
371
  * for the double): a page in the main area, a tool of the workbench as its tab; `''` the conversation again.
@@ -293,12 +403,26 @@ export interface WebExtensionUI {
293
403
  * cancelled. Undefined elsewhere (a browser has no scanner of its own).
294
404
  */
295
405
  readonly scanCode?: (instructions: string) => Promise<string | undefined>;
406
+ /**
407
+ * In the Ta app: Scan, as WeChat's, the same as the page's own (Discover, the + of the first list): the camera,
408
+ * then what the code carries opens (a computer to connect to, a link of an extension, a page of the web; other
409
+ * text to copy), asking first. Undefined elsewhere. Use `scanCode` to read a code for yourself.
410
+ */
411
+ readonly scan?: () => Promise<void>;
296
412
  /**
297
413
  * Hands an extension on: a dialog with its link as a QR code, to copy or send. A published one (`source` of npm
298
414
  * or Git) by its source; another of this computer (`packageId`, of listPackages or of a web extension) through
299
415
  * the relay, end to end and kept nowhere, while this computer runs Ta (TaRelayServer.sharePackage).
300
416
  */
301
417
  shareExtension(target: WebShareTarget): void;
418
+ /**
419
+ * Shows a component of the extension over the page, wherever the user is (a list, a page, a conversation), as
420
+ * pi's `ctx.ui.custom` does in its terminal: a dialog it draws with {@link Dialog}. `close`, or the function
421
+ * returned, takes it away; it goes when the extension stops.
422
+ */
423
+ custom(component: React.ComponentType<{
424
+ close(): void;
425
+ }>): () => void;
302
426
  /**
303
427
  * Opens what a link of an extension carries (`ta://open?source=…`, `#open=`, a link of the relay, `npm:<name>`)
304
428
  * without installing it, once the user said so: it runs in the page with the whole of this API. Resolves whether
@@ -324,6 +448,14 @@ export interface WebExtensionUI {
324
448
  size?: number;
325
449
  mark?: string;
326
450
  }>;
451
+ /**
452
+ * The face of one who is not Ta, as the agents of channels have: a coloured shape with eyes that blink, one of 16,
453
+ * by `face` or the same for the same `seed` (an id) on every device; `online` a dot at its corner. Newer than
454
+ * some Ta apps: `pi.ui.Face ?? fallback`.
455
+ */
456
+ readonly Face: React.ComponentType<WebFaceProps>;
457
+ /** A group, as a channel is drawn: the first of `members` in front, the next behind. Newer than some Ta apps. */
458
+ readonly GroupFace: React.ComponentType<WebGroupFaceProps>;
327
459
  /** The lucide icons of the page, by name (extension/icons.ts): a web extension cannot import them. */
328
460
  readonly icons: Readonly<Record<string, WebIcon>>;
329
461
  /** Monaco, the editor of VS Code, on the text of a file; it loads the first time one is shown. */
@@ -335,8 +467,43 @@ export interface WebExtensionUI {
335
467
  * time one is made; what it shows stays while no view shows it (`attach` it to the next one).
336
468
  */
337
469
  createTerminal(options?: WebTerminalOptions): WebTerminal;
470
+ /**
471
+ * A game, drawn by Phaser, the game engine of the page (docs/design/ta-games.md): it fills its parent (a
472
+ * column of flex, or an element with a size), sleeps while out of sight and ends when it unmounts. Phaser
473
+ * loads the first time a game starts; an extension never brings an engine of its own.
474
+ */
475
+ readonly Game: React.ComponentType<GameProps>;
476
+ /**
477
+ * A 3D game, drawn by Three.js, the 3D engine of the page, with its OrbitControls: `setup` puts things in
478
+ * the scene it is given and returns what to do each frame. As `Game`, it fills its parent, sleeps while out
479
+ * of sight and ends when it unmounts, all of its scene disposed; Three.js loads the first time one starts.
480
+ */
481
+ readonly Game3D: React.ComponentType<Game3DProps>;
482
+ /**
483
+ * What covers all of the page while it is mounted: the shell, its head and side columns, under the notch and
484
+ * the home bar (mind `env(safe-area-inset-*)`), below the title bar of the desktop app and above the keyboard.
485
+ * Its touches are all its own, even at an edge; leave the user a button out. For a game held sideways, a world
486
+ * to walk in; its children keep their state if they are always under it (mount it once, not around a toggle).
487
+ * Newer than some Ta apps: `pi.ui.FullScreen ?? fallback`.
488
+ */
489
+ readonly FullScreen: React.ComponentType<WebFullScreenProps>;
490
+ /**
491
+ * A level of the page pushed over it, as a list pushes what was tapped in it (a room over the rooms): `top`
492
+ * slides in from the right while `open`, and the head of the page shows back in place of its own leading button;
493
+ * on a phone the swipe from the left edge and the back of the system close it too. `onClose` sets `open` false;
494
+ * keep `top` while it slides away. Newer than some Ta apps: `pi.ui.Stack ?? fallback`.
495
+ */
496
+ readonly Stack: React.ComponentType<WebStackProps>;
338
497
  /** The message box of the conversations of the page, with its + menu: one look for every conversation. */
339
498
  readonly Composer: React.ComponentType<WebComposerProps>;
499
+ /**
500
+ * A button held to talk, as the bar of the message box on a phone (WeChat's): held, the page dims and listens
501
+ * with the page's recognizer (the app's own on iOS), 取消 and 编辑 to slide onto; let go, `onSend` gets the words.
502
+ * Renders nothing where the page cannot listen (`voice.canListen`). Never a SpeechRecognition of an extension's own.
503
+ */
504
+ readonly HoldToTalk: React.ComponentType<WebHoldToTalkProps>;
505
+ /** Listening and reading aloud as the conversations of the page do: its recognizer, the voice of the settings. */
506
+ readonly voice: WebVoice;
340
507
  /** Markdown as the conversations show it. */
341
508
  readonly Markdown: React.ComponentType<{
342
509
  text: string;
@@ -353,6 +520,21 @@ export interface WebExtensionUI {
353
520
  readonly Empty: React.ComponentType<WebEmptyProps>;
354
521
  /** What a list shows while its rows are on their way (its data not read yet), as the lists of the page show it: after a moment, never for a list that comes at once. */
355
522
  readonly Skeleton: React.ComponentType<WebSkeletonProps>;
523
+ /**
524
+ * A React hook for what waits on something slow (ta serve, code to load), so that the user sees the click
525
+ * took: `[busy, run]`, `run(action)` busy until what `action` returns settles, running nothing else meanwhile
526
+ * (a second click). Mark what waits with the classes of the page, which say so only once it took a moment, so
527
+ * that what is quick does not flash: `ta-busy` on a button (`ta-button`, `ta-icon-button`) with
528
+ * `<span className="ta-spinner ta-busy-mark" />` in it, the spinner over its label; `ta-pending` on a row being
529
+ * taken away, which fades; `<span className="ta-spinner ta-later" />` a spinner of its own. Newer than some
530
+ * Ta apps: `(pi.ui.useBusy ?? fallback)()`.
531
+ */
532
+ useBusy(): [boolean, <T>(action: () => T | PromiseLike<T>) => Promise<T | undefined>];
533
+ /**
534
+ * The switch of the page's settings: an `onChange` that returns a promise shows the new state at once, its
535
+ * knob turning until done, and the old one again if it fails. Newer than some Ta apps: `pi.ui.Switch ?? fallback`.
536
+ */
537
+ readonly Switch: React.ComponentType<WebSwitchProps>;
356
538
  /** The mark of what is on another machine, as the lists of the page show it: its host, short; nothing for a `location` of this machine. */
357
539
  readonly HostTag: React.ComponentType<{
358
540
  location?: string;
@@ -378,8 +560,8 @@ export interface WebExtensionUI {
378
560
  /**
379
561
  * A picture to look at closely, as the viewers of pictures: all of it at first (never larger than its own
380
562
  * pixels), pinched by two fingers or a trackpad, zoomed by a wheel with Ctrl or ⌘ and by a double tap or
381
- * click, dragged or scrolled once zoomed; with − / the scale / + / 1:1 below it. It fills its parent (a
382
- * column of flex).
563
+ * click, dragged or scrolled once zoomed; with − / the scale / + / fit / actual size below it, and the
564
+ * pictures beside it at its sides when given (`onPrevious` / `onNext`). It fills its parent (a column of flex).
383
565
  */
384
566
  readonly ImageViewer: React.ComponentType<WebImageViewerProps>;
385
567
  /** A QR code of a text (a link to scan with a phone), black on white whatever the theme; `label` for a screen reader. */
@@ -394,566 +576,5 @@ export interface WebExtensionUI {
394
576
  /** A field that picks a model, with the list of models of ta: under their providers, narrowed by typing. */
395
577
  readonly ModelPicker: React.ComponentType<WebModelPickerProps>;
396
578
  }
397
- export interface WebDesktop {
398
- /** Node's `process.platform` of the machine (`darwin`, `win32`, `linux`): what its file manager is called. */
399
- readonly platform: string;
400
- /** Opens the folder of an absolute path of this machine in the file manager, the item selected. */
401
- showItemInFolder(path: string): Promise<void>;
402
- /** The sign-ins of the user's browsers taken into the browser of Ta; macOS and Windows only. */
403
- readonly browserData?: WebBrowserData;
404
- }
405
- /** A profile of the user's Chrome, Edge, Brave, Arc, Vivaldi or Chromium. */
406
- export interface WebBrowserProfile {
407
- /** What `import` takes. */
408
- id: string;
409
- /** The name of the browser, `Google Chrome`. */
410
- browser: string;
411
- /** The name of the profile, as the browser shows it. */
412
- name: string;
413
- }
414
- /** The cookies an import took into the browser of Ta. */
415
- export interface WebBrowserImport {
416
- imported: number;
417
- /** Those that could not be read or set. */
418
- skipped: number;
419
- /** Windows: those under Chrome's app-bound encryption, which only Chrome can read: sign in again. */
420
- appBound: number;
421
- }
422
- /**
423
- * Ta Desktop's browser of the workbench keeps its own sign-ins. These take those of the user's browser:
424
- * its cookies, never its passwords or history, once the user said yes in a dialog of the app (on macOS,
425
- * the Keychain asks too).
426
- */
427
- export interface WebBrowserData {
428
- /** The profiles with cookies of the browsers installed. */
429
- profiles(): Promise<WebBrowserProfile[]>;
430
- /** Takes the cookies of a profile; `undefined` when the user said no. */
431
- import(profileId: string): Promise<WebBrowserImport | undefined>;
432
- /** Forgets the cookies, storage and cache of the browser of Ta. */
433
- clear(): Promise<void>;
434
- }
435
- /** Files of a directory on a drag. */
436
- export interface WebDraggedFiles {
437
- /** The directory they are of (`ui.useCwd()` or another): a path of the machine of ta serve, or `ssh://`. */
438
- cwd: string;
439
- /** Relative to `cwd`, with `/`. */
440
- paths: string[];
441
- }
442
- export interface WebFileDrag {
443
- set(dataTransfer: DataTransfer, files: WebDraggedFiles): void;
444
- /** Whether a drag holds files: what `dragover` can tell, before the drop. */
445
- has(dataTransfer: DataTransfer): boolean;
446
- /** The files of a drop; undefined when it holds none. */
447
- get(dataTransfer: DataTransfer): WebDraggedFiles | undefined;
448
- /** Their absolute paths inside their machine. */
449
- paths(files: WebDraggedFiles): string[];
450
- }
451
- export interface WebTerminalOptions {
452
- /** Its size until a view fits it: the size the program started with. Default: 80 × 24. */
453
- cols?: number;
454
- rows?: number;
455
- /**
456
- * The directory of the program: paths of its output (`src/a.ts:10`) are read from there, and from the
457
- * one a shell reports (OSC 7) once it does. URLs and paths are links, opened with Cmd or Ctrl + click
458
- * as the links of a reply are (with Shift, a page in the browser of the system).
459
- */
460
- cwd?: string;
461
- }
462
- /**
463
- * Progress of a terminal's program (OSC 9;4): `value` from 0 to 100 when it knows how far it is;
464
- * `busy` when it does not; `error` or `paused` with the value it stopped at.
465
- */
466
- export interface WebTerminalProgress {
467
- state: 'normal' | 'busy' | 'error' | 'paused';
468
- value?: number;
469
- }
470
- /** Keys a soft keyboard lacks, which a terminal sends as its program expects (arrows in the mode it set). */
471
- export type WebTerminalKey = 'Escape' | 'Tab' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
472
- /**
473
- * A terminal screen; the program behind it is the extension's (`pi.terminals` for a shell of the server).
474
- * Its keys are a terminal's: Cmd + K clears it on macOS; elsewhere Ctrl + Shift + C and V copy and paste,
475
- * and Ctrl + C copies when text is selected.
476
- */
477
- export interface WebTerminal {
478
- /** Its size in characters. */
479
- readonly cols: number;
480
- readonly rows: number;
481
- /** The directory of the program: the one it started in, then the one a shell reports (OSC 7). */
482
- readonly cwd?: string;
483
- /** Output of the program, with its control sequences. */
484
- write(data: string): void;
485
- /** What the user types or pastes, and the mouse reports the program asked for, as a terminal sends them. */
486
- onData(listener: (data: string) => void): () => void;
487
- /** It fitted a view of another size: the program should know it (`resizeTerminal`). */
488
- onResize(listener: (size: {
489
- cols: number;
490
- rows: number;
491
- }) => void): () => void;
492
- /** The shell reported another directory (OSC 7). */
493
- onCwdChange(listener: (cwd: string) => void): () => void;
494
- /**
495
- * The title its program set, as terminals take it (OSC 0 or 2: `\x1b]0;title\x07`), which some
496
- * update as they work (a coding agent's task and progress); undefined until one does, and for an empty one.
497
- */
498
- readonly title?: string;
499
- onTitleChange(listener: (title: string | undefined) => void): () => void;
500
- /** The progress its program reports (OSC 9;4, as Windows Terminal, Ghostty and iTerm2 show it); undefined for none. */
501
- readonly progress?: WebTerminalProgress;
502
- onProgressChange(listener: (progress: WebTerminalProgress | undefined) => void): () => void;
503
- /** Its program rang the bell or sent a notification (OSC 9 or OSC 777;notify), with the text of one. */
504
- onAttention(listener: (message: string | undefined) => void): () => void;
505
- /** Shows it in `element`, which it fills and follows in size; the function returned takes it out again. */
506
- attach(element: HTMLElement): () => void;
507
- focus(): void;
508
- /** The text selected on its screen; empty when none is. */
509
- getSelection(): string;
510
- selectAll(): void;
511
- /** Empties its screen and scrollback but the line of the cursor (the prompt), as Cmd + K does. */
512
- clear(): void;
513
- /** Text as pasted: bracketed for a program that asked for it, its line ends as a terminal sends them. */
514
- paste(text: string): void;
515
- /** A key the program hears as if it were pressed (`onData`). */
516
- sendKey(key: WebTerminalKey): void;
517
- /** Text the program hears as if it were typed, not pasted (`onData`). */
518
- type(text: string): void;
519
- dispose(): void;
520
- }
521
- export interface WebModelPickerProps {
522
- /** The directory whose settings give the models and the default; default: that of ta serve. */
523
- cwd?: string;
524
- /** `<provider>/<model id>`, or `''` for the model of the settings. */
525
- value: string;
526
- onChange(value: string): void;
527
- /** The entry for `''`; default: `Default (<the model of the settings>)`. */
528
- defaultLabel?: string;
529
- /** For a screen reader, when no label is beside it. */
530
- label?: string;
531
- disabled?: boolean;
532
- }
533
- export interface WebFolderPickerProps {
534
- /** Where it opens; default: the directory of ta serve. */
535
- initial?: string;
536
- /** The directory picked; the dialog stays open until it returns, and closes with `onClose`. */
537
- onPick(path: string): void | Promise<void>;
538
- onClose(): void;
539
- }
540
- export interface CodeEditorProps {
541
- /** The path of the file: its name tells the language (`.ts`, `Dockerfile`); another path is another editor. */
542
- path: string;
543
- /** The text shown; a different one replaces it, as an edit the user can undo. */
544
- value: string;
545
- readOnly?: boolean;
546
- /** A line, 1 for the first, shown in the middle with the cursor at its start (at `column`, 1 for the first, when given). */
547
- line?: number;
548
- column?: number;
549
- /** With `line` and `column`: the text up to this column of that line is selected, as a match of a search. */
550
- endColumn?: number;
551
- /** Lines or a place to select, shown in the middle; over `line`. */
552
- selection?: TextSelection;
553
- /** The user changed the text. */
554
- onChange?(value: string): void;
555
- /** Ctrl+S or Cmd+S. */
556
- onSave?(value: string): void;
557
- }
558
- export interface DiffEditorProps {
559
- /** The path of the file: its name tells the language. */
560
- path: string;
561
- /** The text before (left), as HEAD or the index has it. */
562
- original: string;
563
- /** The text after (right). */
564
- modified: string;
565
- /** Default: side by side, inline when it is narrow. */
566
- inline?: boolean;
567
- /** Default true; false lets the user change the right side, `onChange` and `onSave` hear it. */
568
- readOnly?: boolean;
569
- onChange?(value: string): void;
570
- onSave?(value: string): void;
571
- /** How many changes it found once it compared the texts, and how to go to the next or the one before. */
572
- onDiff?(diff: {
573
- changes: number;
574
- next(): void;
575
- previous(): void;
576
- }): void;
577
- }
578
- export interface WebEmptyProps {
579
- /** One short line: what is not there (`No chats yet`), without a full stop. */
580
- title?: React.ReactNode;
581
- /** At most one quieter line under it: how to get some. */
582
- hint?: React.ReactNode;
583
- /** In a menu, a picker or a dialog: a line of its own rather than the middle of the space. */
584
- compact?: boolean;
585
- /** It is there because something failed. */
586
- tone?: 'error';
587
- /** Above the text: a `Picture` of what will be there or how to get it; smaller when `compact`. */
588
- picture?: React.ReactNode;
589
- /** Under the text: a button. */
590
- children?: React.ReactNode;
591
- }
592
- /** An action behind a row a finger swiped (WebExtensionUI.SwipeRow), or for the rows selected (SelectBar): a word, as WeChat's. */
593
- export interface WebSwipeAction {
594
- key: string;
595
- label: string;
596
- /** Red, as Delete. */
597
- danger?: boolean;
598
- run(): void;
599
- }
600
- export interface WebSwipeRowProps {
601
- actions?: WebSwipeAction[];
602
- /** Of the row; its content is `.ta-swipe-content`, which the finger moves. */
603
- className?: string;
604
- children?: React.ReactNode;
605
- }
606
- export interface WebSelectCheckProps {
607
- checked: boolean;
608
- /** A row that cannot be chosen (nothing to do with it): a faint mark. */
609
- disabled?: boolean;
610
- }
611
- export interface WebSelectBarProps {
612
- /** How many are chosen, of how many could be. */
613
- count: number;
614
- total: number;
615
- /** Chooses every row (`true`), or none. */
616
- onSelectAll(all: boolean): void;
617
- /** The list stops selecting. */
618
- onDone(): void;
619
- /** What can be done with those chosen: disabled while none is. */
620
- actions: WebSwipeAction[];
621
- }
622
- export interface WebSkeletonProps {
623
- /** How many rows, at most 6; 6 unless told. */
624
- rows?: number;
625
- }
626
- /**
627
- * A small picture, 160 by 96 unless told: its shapes take the classes of the page so that they follow its
628
- * theme. `ta-pic-pane` a surface, `ta-pic-line` a bar of text, `ta-pic-box` an outline (a field, a box to
629
- * tick), `ta-pic-accent` what the picture is about (green, light), `ta-pic-mark` green, `ta-pic-soft` half
630
- * of that, `ta-pic-dot` a quiet dot, `ta-pic-bad` red, `ta-pic-path` a dashed way between two things,
631
- * `ta-pic-stroke` a green line (`ta-pic-thin` a grey one), `ta-pic-tick` a line drawn on green,
632
- * `ta-pic-text` green letters of code.
633
- */
634
- export interface WebPictureProps {
635
- width?: number;
636
- height?: number;
637
- /** The rounded frame around it, default true; false for a picture that floats, such as a strip of things. */
638
- frame?: boolean;
639
- className?: string;
640
- /** The shapes, in the coordinates of width by height. */
641
- children?: React.ReactNode;
642
- }
643
- export interface WebPictureCard {
644
- key: string;
645
- /** A `Picture`. */
646
- picture: React.ReactNode;
647
- /** Two to six words. */
648
- label: string;
649
- /** A quieter line under the label: when, how. */
650
- hint?: string;
651
- /** Shown on hover: the whole of what picking it does. */
652
- title?: string;
653
- disabled?: boolean;
654
- onPick(): void;
655
- }
656
- export interface WebImageViewerProps {
657
- src: string;
658
- alt?: string;
659
- /** On its root, for the background behind the picture (a checkerboard for transparency). */
660
- className?: string;
661
- /** Once it loaded: its size in pixels. */
662
- onLoad?(size: {
663
- width: number;
664
- height: number;
665
- }): void;
666
- /** A click or tap beside the picture. */
667
- onBackground?(): void;
668
- }
669
- export interface WebPictureCardsProps {
670
- cards: readonly WebPictureCard[];
671
- /** Default as many as there are cards. */
672
- columns?: number;
673
- /** On a phone or a narrow window; default `columns`. */
674
- compactColumns?: number;
675
- }
676
- export interface WebDialogProps {
677
- title: string;
678
- onClose(): void;
679
- children?: React.ReactNode;
680
- }
681
- export interface WebComposerProps {
682
- placeholder?: string;
683
- /** Sends what was typed; when it fails, the text comes back into the box and the reason is a notice of the page. */
684
- onSend(text: string): Promise<void> | void;
685
- /** What `@` lists, by name; and the + menu entry that starts an `@`. */
686
- mentions?: {
687
- name: string;
688
- detail?: string;
689
- }[];
690
- mentionLabel?: string;
691
- /** More sections of the + menu, each set apart by a line. */
692
- actions?: WebComposerAction[][];
693
- /** The directory the conversation will work in, empty for that of ta serve: a button beside the + shows it. */
694
- cwd?: string;
695
- /** With it, the button beside the + picks another directory, as that of a new conversation does. */
696
- onPickCwd?(cwd: string): void | Promise<void>;
697
- }
698
- /** An entry of the + menu of the message box. */
699
- export interface WebComposerAction {
700
- key: string;
701
- label: string;
702
- /** On the left: an icon of 16 pixels, or an avatar. */
703
- icon?: React.ReactNode;
704
- detail?: string;
705
- disabled?: boolean;
706
- /** Text the entry puts where the caret is, as `@name `; else `run` runs. */
707
- insert?: string;
708
- /** A list the menu shows in its place, as the models of a conversation. */
709
- items?: WebComposerAction[];
710
- /** In `items`: the entry picked now, checked on the right. */
711
- checked?: boolean;
712
- /** In `items`: the heading it is under. */
713
- group?: string;
714
- run?(): void;
715
- }
716
- /** A conversation as its message box knows it. */
717
- export interface WebConversation {
718
- sessionId: string;
719
- /** pi's file of it: what stays when it is closed and opened again; none for one not kept. */
720
- sessionFile?: string;
721
- cwd?: string;
722
- /** `double`: the double's own conversation; `chat`: any other, an agent's too (TaSessionInfo.group). */
723
- kind: 'double' | 'chat';
724
- /** The package that opened it for its work (TaOpenSessionOptions.group): `@celljs/ta-channels` for an agent. */
725
- group?: string;
726
- /** As the page names it: the name of the session, or of the double. */
727
- title?: string;
728
- }
729
- /** A section an extension adds to the settings (WebExtensionAPI.registerSettings). */
730
- export interface WebSettingsSection {
731
- title: WebLabel;
732
- /** Beside its title in the list of the sections; default: a puzzle piece. */
733
- icon?: WebIcon;
734
- rows: WebSettingRow[];
735
- }
736
- /** A row of the settings of an extension: a label and a description as Ta's rows have, and its control. */
737
- export interface WebSettingRow {
738
- key: string;
739
- label: WebLabel;
740
- description?: WebLabel;
741
- /** The control, beside the label; with `stacked`, under it, for a wide one (a model picker, a list). */
742
- render: React.ComponentType;
743
- stacked?: boolean;
744
- }
745
- /** What an extension adds to the message box of every conversation (WebExtensionAPI.registerComposerAddon). */
746
- export interface WebComposerAddon {
747
- /** Entries of the + menu, a section of their own; read each time the conversation is drawn, and when `subscribe` says. */
748
- actions?(conversation: WebConversation): WebComposerAction[];
749
- /** What `actions` gives changed (the data it reads came): the message boxes read them again. */
750
- subscribe?(listener: () => void): () => void;
751
- /** Above the box of each conversation: what is connected to it, a dialog its entries opened. Nothing to show: `null`. */
752
- above?: React.ComponentType<{
753
- conversation: WebConversation;
754
- }>;
755
- }
756
- export interface WebEditor {
757
- id: string;
758
- title: WebLabel;
759
- icon?: WebIcon;
760
- render: React.ComponentType;
761
- /** The user closed the tab. */
762
- onClose?(): void;
763
- }
764
- /** Words on the page; a function is read again when the language changes. */
765
- export type WebLabel = string | (() => string);
766
- export interface WidgetOptions {
767
- /** Default: `aboveEditor`, as in pi. `panel`: a card in the cards tab of the workbench on the right, which opens when the first card comes. */
768
- placement?: 'aboveEditor' | 'belowEditor' | 'panel';
769
- /** The title of a card in the workbench. */
770
- title?: WebLabel;
771
- }
772
- export interface WebView {
773
- title: WebLabel;
774
- render: React.ComponentType;
775
- /** Its icon in the navigation or the workbench, drawn at `size` pixels in `currentColor`. */
776
- icon?: WebIcon;
777
- /**
778
- * `page` (default): the main area. `sidebar`: the column beside the navigation, as the list of
779
- * chats. `panel`: a tool of the workbench beside the conversation, as the explorer or the terminal
780
- * of an IDE: its `+` and its empty state list it, and it opens as one of its tabs. `launcher`: a
781
- * section of what a phone pulls down over its first tab (a button of the rail elsewhere), as Recent and
782
- * Mine. `board`: a card of the board a phone brings out with a swipe to the left over its first tab (a
783
- * button of the rail elsewhere), which the user takes off, puts back and orders (ta-launcher.md).
784
- */
785
- location?: 'page' | 'sidebar' | 'panel' | 'launcher' | 'board';
786
- /** Smaller first among those of its location; default 100. */
787
- order?: number;
788
- /**
789
- * A page: its … where a list shows it (the sidebar view that leads to it), in sections set apart by
790
- * a line; read each time the menu opens, so it can say what holds now.
791
- */
792
- menu?(): WebMenuItem[][];
793
- /**
794
- * Its top bar, in place of the title: for a sidebar view, the row above it (a search, a button
795
- * to add); for a page, the middle of the bar that has the menu and the button of the workbench.
796
- */
797
- head?: React.ComponentType;
798
- /**
799
- * A sidebar view: the pages it leads to (`<extension name>/<view name>`, as `ui.showView` takes),
800
- * which the navigation then leaves out, since the view lists them.
801
- */
802
- pages?: string[];
803
- /**
804
- * A page not used every day, as scheduled tasks: under Discover until the user puts it in the
805
- * navigation, instead of taking a place there by itself.
806
- */
807
- discover?: boolean;
808
- /** A page: the line a list shows under its name, as a messenger does — the last thing said there, and when. */
809
- preview?(): WebViewPreview | undefined;
810
- /** A page: whoever is there answers now; a list that shows it marks it so, as a conversation answering. */
811
- busy?(): boolean;
812
- /** What `preview` or `busy` gives changed: the lists read it again. */
813
- subscribe?(listener: () => void): () => void;
814
- }
815
- export interface WebViewPreview {
816
- text: string;
817
- at: number;
818
- }
819
- /** What `ui.shareExtension` hands on. */
820
- export interface WebShareTarget {
821
- /** What the user calls it. */
822
- title: string;
823
- /** Where it comes from: `npm:<name>`, `git:…`; a link of it needs nothing else. */
824
- source?: string;
825
- /** Of a package of this computer (listPackages, or one of its web extensions), handed on through the relay. */
826
- packageId?: string;
827
- }
828
- /** A section of the search of Quick open. */
829
- export interface WebSearchSource {
830
- key: string;
831
- title: WebLabel;
832
- /** Smaller first; the pages of the page are 0. Default 100. */
833
- order?: number;
834
- /**
835
- * Asked after the user paused typing (a quarter of a second), and its answers come in when they do, an older
836
- * one dropped: for what asks a server or the network. Without it, `search` is asked at each key and should
837
- * answer at once.
838
- */
839
- remote?: boolean;
840
- /**
841
- * The entries for `query` (`''` before anything is typed), from `offset`: `more` when there are others
842
- * after them, which the user gets by scrolling to the end of the section.
843
- */
844
- search(query: string, offset: number): WebSearchPage | Promise<WebSearchPage>;
845
- /** Its entries changed (a package installed): the section asks again. */
846
- subscribe?(listener: () => void): () => void;
847
- }
848
- export interface WebSearchPage {
849
- items: readonly WebSearchItem[];
850
- more?: boolean;
851
- }
852
- /** An entry of the search: a row with its icon, title and a quieter line. */
853
- export interface WebSearchItem {
854
- key: string;
855
- title: string;
856
- detail?: string;
857
- icon?: WebIcon;
858
- /** Tints the tile of the icon, the same for the same text (a name). */
859
- tint?: string;
860
- /** A small button at the end: Open, Install. */
861
- action?: {
862
- label: string;
863
- run(): void | Promise<void>;
864
- };
865
- open(): void;
866
- /** Its menu, for a right click or a held finger, in sections. */
867
- menu?(): WebMenuItem[][];
868
- }
869
- /** An entry of the … of a page (WebView.menu). */
870
- export interface WebMenuItem {
871
- key: string;
872
- label: string;
873
- icon?: WebIcon;
874
- disabled?: boolean;
875
- /** Cannot be undone, as delete: drawn in red. */
876
- danger?: boolean;
877
- run(): void;
878
- }
879
- /** A view of any web extension, as `ui.useView` sees it. */
880
- export interface WebViewInfo {
881
- title: string;
882
- location: 'page' | 'sidebar' | 'panel' | 'launcher' | 'board';
883
- /** The page is in the main area, or the tool is the tab shown in the workbench. */
884
- shown: boolean;
885
- /** WebView.menu: the list that shows the page draws a … with it. */
886
- menu?(): WebMenuItem[][];
887
- /** WebView.preview. */
888
- preview?: WebViewPreview;
889
- /** WebView.busy. */
890
- busy: boolean;
891
- }
892
- export interface WebTool {
893
- /** Letters, digits, `_` and `-`, starting with a letter. */
894
- name: string;
895
- description: string;
896
- /** JSON schema of an object. */
897
- parameters: Record<string, unknown>;
898
- /** What the model reads; throwing fails the call with the message. */
899
- execute(toolCallId: string, params: Record<string, unknown>): string | Promise<string>;
900
- }
901
- /**
902
- * A piece of work handed out on the user's behalf. `waiting`: it cannot go on without the user (a question,
903
- * its turn in a channel); what has ended is `done`, `failed` or `stopped`.
904
- */
905
- export interface WebTask {
906
- /** Unique among those of its source. */
907
- id: string;
908
- title: string;
909
- status: 'running' | 'waiting' | 'done' | 'failed' | 'stopped';
910
- /** What goes on now, or how it ended: a few words. */
911
- detail?: string;
912
- startedAt: number;
913
- endedAt?: number;
914
- /** The conversation it was handed out from (TaSessionInfo.sessionFile): the double shows it in the turn that started it. */
915
- origin?: string;
916
- /** Who does it, drawn at `size` pixels: an agent's face, the faces of a channel. */
917
- icon?: React.ComponentType<{
918
- size: number;
919
- }>;
920
- /** Shows where it is done: in the workbench, beside the conversation. */
921
- open(): void;
922
- /** Its …, read each time it opens: stop it, take it over, keep its agents. */
923
- menu?(): WebMenuItem[][];
924
- /**
925
- * Deletes it without asking, a running one stopped first: what its delete in `menu` does once the user
926
- * agreed. The lists ask (`ui.removeTasks`) and call it, for a row swiped on a phone or for many selected.
927
- */
928
- remove?(): Promise<void>;
929
- /** What deleting it does besides, said when the user is asked: what stays, and where. */
930
- removeHint?: string;
931
- }
932
- /** What deleting a task reads of it: its menu deletes it this way too, before it is listed. */
933
- export type WebTaskRemoval = Pick<WebTask, 'title' | 'remove' | 'removeHint'>;
934
- /** The tasks of an extension. `tasks` gives the same objects for what did not change, and is called again after `subscribe`'s listener. */
935
- export interface WebTaskSource {
936
- tasks(): readonly WebTask[];
937
- subscribe(listener: () => void): () => void;
938
- }
939
- /** A task as `ui.useTasks` lists it. */
940
- export interface WebTaskEntry extends WebTask {
941
- /** `<extension name>/<id>`. */
942
- key: string;
943
- /** The name of the extension it is of. */
944
- extension: string;
945
- }
946
- /** pi's custom message, as the conversation holds it. */
947
- export interface WebCustomMessage {
948
- role: 'custom';
949
- customType: string;
950
- content: string | {
951
- type: string;
952
- text?: string;
953
- }[];
954
- display: boolean;
955
- details?: unknown;
956
- timestamp: number;
957
- }
958
579
  /** The default export of a web extension. The function it returns, if any, runs when it unloads. */
959
580
  export type WebExtensionFactory = (pi: WebExtensionAPI) => (() => void) | undefined;