@celljs/ta-web 4.41.0 → 4.43.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 (318) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/apps/web-apps.d.ts +4 -0
  4. package/esm/browser/apps/web-apps.js +14 -3
  5. package/esm/browser/assistant/ta-hearing.d.ts +85 -0
  6. package/esm/browser/assistant/ta-hearing.js +272 -0
  7. package/esm/browser/components/auth-view.js +1 -1
  8. package/esm/browser/components/board.js +9 -1
  9. package/esm/browser/components/clipboard-link-host.d.ts +2 -0
  10. package/esm/browser/components/clipboard-link-host.js +27 -0
  11. package/esm/browser/components/cloud-network.js +1 -1
  12. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  13. package/esm/browser/components/custom-provider-advanced.js +8 -8
  14. package/esm/browser/components/custom-provider-view.js +12 -12
  15. package/esm/browser/components/empty-state.d.ts +2 -1
  16. package/esm/browser/components/empty-state.js +6 -2
  17. package/esm/browser/components/folder-picker.js +2 -2
  18. package/esm/browser/components/gallery.js +8 -9
  19. package/esm/browser/components/hearing-host.d.ts +5 -0
  20. package/esm/browser/components/hearing-host.js +58 -0
  21. package/esm/browser/components/host-view.d.ts +1 -1
  22. package/esm/browser/components/link-dialog.js +4 -0
  23. package/esm/browser/components/loading.d.ts +3 -2
  24. package/esm/browser/components/loading.js +7 -3
  25. package/esm/browser/components/markdown.d.ts +3 -1
  26. package/esm/browser/components/markdown.js +55 -10
  27. package/esm/browser/components/media.d.ts +10 -4
  28. package/esm/browser/components/media.js +60 -14
  29. package/esm/browser/components/people-picker.d.ts +17 -0
  30. package/esm/browser/components/people-picker.js +129 -0
  31. package/esm/browser/components/relay-view.js +1 -1
  32. package/esm/browser/components/settings-parts.js +2 -0
  33. package/esm/browser/components/share-dialog.d.ts +2 -2
  34. package/esm/browser/components/share-dialog.js +7 -4
  35. package/esm/browser/components/share-friends.js +3 -10
  36. package/esm/browser/components/share-item-sheet.d.ts +12 -0
  37. package/esm/browser/components/share-item-sheet.js +39 -0
  38. package/esm/browser/components/share-sheet.d.ts +9 -2
  39. package/esm/browser/components/share-sheet.js +5 -4
  40. package/esm/browser/components/sign-in-setup.js +4 -4
  41. package/esm/browser/components/trusted-domains.js +1 -1
  42. package/esm/browser/components/view-room.d.ts +25 -0
  43. package/esm/browser/components/view-room.js +136 -0
  44. package/esm/browser/components/voice-services.js +6 -6
  45. package/esm/browser/device/device-protocol.d.ts +9 -6
  46. package/esm/browser/device/device-protocol.js +7 -4
  47. package/esm/browser/device/launch-screen.d.ts +11 -1
  48. package/esm/browser/device/launch-screen.js +22 -4
  49. package/esm/browser/extension/share-sheet-compat.d.ts +2 -0
  50. package/esm/browser/extension/share-sheet-compat.js +12 -2
  51. package/esm/browser/extension/web-api-code.d.ts +11 -0
  52. package/esm/browser/extension/web-api-components.d.ts +8 -1
  53. package/esm/browser/extension/web-api-contributions.d.ts +30 -1
  54. package/esm/browser/extension/web-api-desktop.d.ts +2 -1
  55. package/esm/browser/extension/web-api-file-views.d.ts +38 -0
  56. package/esm/browser/extension/web-api-file-views.js +2 -0
  57. package/esm/browser/extension/web-api-host.d.ts +47 -0
  58. package/esm/browser/extension/web-api-host.js +3 -0
  59. package/esm/browser/extension/web-api-menus.d.ts +46 -0
  60. package/esm/browser/extension/web-api-partners.d.ts +58 -1
  61. package/esm/browser/extension/web-api-spec.js +7 -0
  62. package/esm/browser/extension/web-extension-api.d.ts +10 -10
  63. package/esm/browser/extension/web-extension-context.d.ts +2 -8
  64. package/esm/browser/extension/web-extension-context.js +14 -39
  65. package/esm/browser/extension/web-extension-marks.d.ts +10 -0
  66. package/esm/browser/extension/web-extension-marks.js +29 -0
  67. package/esm/browser/extension/web-extension-protocol.d.ts +11 -1
  68. package/esm/browser/extension/web-extension-protocol.js +3 -0
  69. package/esm/browser/extension/web-extension-run.d.ts +15 -2
  70. package/esm/browser/extension/web-extension-run.js +77 -0
  71. package/esm/browser/extension/web-extensions-running.d.ts +5 -1
  72. package/esm/browser/extension/web-extensions-running.js +16 -0
  73. package/esm/browser/extension/web-extensions.d.ts +2 -1
  74. package/esm/browser/extension/web-extensions.js +3 -0
  75. package/esm/browser/extension/web-home.js +3 -1
  76. package/esm/browser/extension/web-host-values.d.ts +66 -0
  77. package/esm/browser/extension/web-host-values.js +191 -0
  78. package/esm/browser/extension/web-hosts.d.ts +7 -2
  79. package/esm/browser/extension/web-hosts.js +16 -4
  80. package/esm/browser/extension/web-share-ui.d.ts +7 -0
  81. package/esm/browser/extension/web-share-ui.js +15 -0
  82. package/esm/browser/extension/web-share.d.ts +18 -0
  83. package/esm/browser/extension/web-share.js +42 -0
  84. package/esm/browser/i18n/en/chat.d.ts +10 -0
  85. package/esm/browser/i18n/en/chat.js +10 -0
  86. package/esm/browser/i18n/en/common.d.ts +23 -0
  87. package/esm/browser/i18n/en/common.js +23 -0
  88. package/esm/browser/i18n/en/discover.d.ts +7 -0
  89. package/esm/browser/i18n/en/discover.js +7 -0
  90. package/esm/browser/i18n/en/settings.d.ts +2 -0
  91. package/esm/browser/i18n/en/settings.js +2 -0
  92. package/esm/browser/i18n/ja/chat.js +10 -0
  93. package/esm/browser/i18n/ja/common.js +23 -0
  94. package/esm/browser/i18n/ja/discover.js +7 -0
  95. package/esm/browser/i18n/ja/settings.js +2 -0
  96. package/esm/browser/i18n/locales.d.ts +43 -1
  97. package/esm/browser/i18n/messages.d.ts +42 -0
  98. package/esm/browser/i18n/zh/chat.js +10 -0
  99. package/esm/browser/i18n/zh/common.js +23 -0
  100. package/esm/browser/i18n/zh/discover.js +7 -0
  101. package/esm/browser/i18n/zh/settings.js +2 -0
  102. package/esm/browser/i18n/zh-tw/chat.js +10 -0
  103. package/esm/browser/i18n/zh-tw/common.js +23 -0
  104. package/esm/browser/i18n/zh-tw/discover.js +7 -0
  105. package/esm/browser/i18n/zh-tw/settings.js +2 -0
  106. package/esm/browser/launch-art/art-palette.d.ts +41 -0
  107. package/esm/browser/launch-art/art-palette.js +72 -0
  108. package/esm/browser/launch-art/cyclic-automaton.d.ts +45 -0
  109. package/esm/browser/launch-art/cyclic-automaton.js +176 -0
  110. package/esm/browser/launch-art/fractal-tree.d.ts +43 -0
  111. package/esm/browser/launch-art/fractal-tree.js +48 -0
  112. package/esm/browser/launch-art/launch-art.d.ts +98 -0
  113. package/esm/browser/launch-art/launch-art.js +420 -0
  114. package/esm/browser/launch-art/launch-sky.d.ts +66 -0
  115. package/esm/browser/launch-art/launch-sky.js +153 -0
  116. package/esm/browser/links/clipboard-links.d.ts +89 -0
  117. package/esm/browser/links/clipboard-links.js +303 -0
  118. package/esm/browser/links/link-text.d.ts +29 -0
  119. package/esm/browser/links/link-text.js +97 -0
  120. package/esm/browser/links/links-protocol.d.ts +12 -1
  121. package/esm/browser/links/links.d.ts +8 -2
  122. package/esm/browser/links/links.js +33 -3
  123. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  124. package/esm/browser/markdown/code-renderers.js +4 -0
  125. package/esm/browser/partners/group-picker.js +23 -29
  126. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  127. package/esm/browser/sandbox/work/work-senses.js +1 -1
  128. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  129. package/esm/browser/settings/settings-protocol.js +2 -0
  130. package/esm/browser/style/base.d.ts +1 -1
  131. package/esm/browser/style/base.js +10 -6
  132. package/esm/browser/style/chat-list.d.ts +1 -1
  133. package/esm/browser/style/chat-list.js +28 -15
  134. package/esm/browser/style/conversation-column.d.ts +1 -1
  135. package/esm/browser/style/conversation.d.ts +1 -1
  136. package/esm/browser/style/conversation.js +29 -2
  137. package/esm/browser/style/dialogs.d.ts +1 -1
  138. package/esm/browser/style/dialogs.js +2 -5
  139. package/esm/browser/style/forms.d.ts +5 -0
  140. package/esm/browser/style/forms.js +65 -0
  141. package/esm/browser/style/layout.d.ts +1 -1
  142. package/esm/browser/style/pages.d.ts +1 -1
  143. package/esm/browser/style/pages.js +14 -24
  144. package/esm/browser/style/phone.d.ts +1 -1
  145. package/esm/browser/style/shared.d.ts +1 -1
  146. package/esm/browser/style/shell.d.ts +1 -1
  147. package/esm/browser/style/shell.js +1 -6
  148. package/esm/browser/style/surfaces.d.ts +1 -1
  149. package/esm/browser/style/surfaces.js +0 -6
  150. package/esm/browser/style/tasks.d.ts +1 -1
  151. package/esm/browser/style.js +2 -0
  152. package/esm/browser/util/markdown.d.ts +45 -3
  153. package/esm/browser/util/markdown.js +67 -11
  154. package/esm/browser/util/voice.d.ts +18 -0
  155. package/esm/browser/util/voice.js +111 -3
  156. package/esm/browser/workbench-protocol.d.ts +2 -0
  157. package/esm/browser/workbench-services.d.ts +2 -0
  158. package/esm/browser/workbench-services.js +5 -0
  159. package/esm/browser/workbench.js +5 -0
  160. package/lib/browser/apps/web-apps.d.ts +4 -0
  161. package/lib/browser/apps/web-apps.js +14 -3
  162. package/lib/browser/assistant/ta-hearing.d.ts +86 -0
  163. package/lib/browser/assistant/ta-hearing.js +277 -0
  164. package/lib/browser/components/auth-view.js +1 -1
  165. package/lib/browser/components/board.js +9 -1
  166. package/lib/browser/components/clipboard-link-host.d.ts +3 -0
  167. package/lib/browser/components/clipboard-link-host.js +63 -0
  168. package/lib/browser/components/cloud-network.js +1 -1
  169. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  170. package/lib/browser/components/custom-provider-advanced.js +8 -8
  171. package/lib/browser/components/custom-provider-view.js +12 -12
  172. package/lib/browser/components/empty-state.d.ts +2 -1
  173. package/lib/browser/components/empty-state.js +6 -2
  174. package/lib/browser/components/folder-picker.js +2 -2
  175. package/lib/browser/components/gallery.js +7 -8
  176. package/lib/browser/components/hearing-host.d.ts +6 -0
  177. package/lib/browser/components/hearing-host.js +94 -0
  178. package/lib/browser/components/host-view.d.ts +1 -1
  179. package/lib/browser/components/link-dialog.js +4 -0
  180. package/lib/browser/components/loading.d.ts +3 -2
  181. package/lib/browser/components/loading.js +7 -3
  182. package/lib/browser/components/markdown.d.ts +3 -1
  183. package/lib/browser/components/markdown.js +53 -8
  184. package/lib/browser/components/media.d.ts +10 -4
  185. package/lib/browser/components/media.js +61 -14
  186. package/lib/browser/components/people-picker.d.ts +18 -0
  187. package/lib/browser/components/people-picker.js +166 -0
  188. package/lib/browser/components/relay-view.js +1 -1
  189. package/lib/browser/components/settings-parts.js +2 -0
  190. package/lib/browser/components/share-dialog.d.ts +2 -2
  191. package/lib/browser/components/share-dialog.js +7 -4
  192. package/lib/browser/components/share-friends.js +3 -10
  193. package/lib/browser/components/share-item-sheet.d.ts +13 -0
  194. package/lib/browser/components/share-item-sheet.js +75 -0
  195. package/lib/browser/components/share-sheet.d.ts +9 -2
  196. package/lib/browser/components/share-sheet.js +5 -3
  197. package/lib/browser/components/sign-in-setup.js +4 -4
  198. package/lib/browser/components/trusted-domains.js +1 -1
  199. package/lib/browser/components/view-room.d.ts +26 -0
  200. package/lib/browser/components/view-room.js +173 -0
  201. package/lib/browser/components/voice-services.js +6 -6
  202. package/lib/browser/device/device-protocol.d.ts +9 -6
  203. package/lib/browser/device/device-protocol.js +7 -4
  204. package/lib/browser/device/launch-screen.d.ts +11 -1
  205. package/lib/browser/device/launch-screen.js +22 -4
  206. package/lib/browser/extension/share-sheet-compat.d.ts +2 -0
  207. package/lib/browser/extension/share-sheet-compat.js +13 -2
  208. package/lib/browser/extension/web-api-code.d.ts +11 -0
  209. package/lib/browser/extension/web-api-components.d.ts +8 -1
  210. package/lib/browser/extension/web-api-contributions.d.ts +30 -1
  211. package/lib/browser/extension/web-api-desktop.d.ts +2 -1
  212. package/lib/browser/extension/web-api-file-views.d.ts +39 -0
  213. package/lib/browser/extension/web-api-file-views.js +3 -0
  214. package/lib/browser/extension/web-api-host.d.ts +48 -0
  215. package/lib/browser/extension/web-api-host.js +4 -0
  216. package/lib/browser/extension/web-api-menus.d.ts +46 -0
  217. package/lib/browser/extension/web-api-partners.d.ts +58 -1
  218. package/lib/browser/extension/web-api-spec.js +7 -0
  219. package/lib/browser/extension/web-extension-api.d.ts +10 -10
  220. package/lib/browser/extension/web-extension-context.d.ts +2 -8
  221. package/lib/browser/extension/web-extension-context.js +14 -39
  222. package/lib/browser/extension/web-extension-marks.d.ts +11 -0
  223. package/lib/browser/extension/web-extension-marks.js +65 -0
  224. package/lib/browser/extension/web-extension-protocol.d.ts +11 -1
  225. package/lib/browser/extension/web-extension-protocol.js +3 -0
  226. package/lib/browser/extension/web-extension-run.d.ts +15 -2
  227. package/lib/browser/extension/web-extension-run.js +77 -0
  228. package/lib/browser/extension/web-extensions-running.d.ts +5 -1
  229. package/lib/browser/extension/web-extensions-running.js +16 -0
  230. package/lib/browser/extension/web-extensions.d.ts +2 -1
  231. package/lib/browser/extension/web-extensions.js +3 -0
  232. package/lib/browser/extension/web-home.js +3 -1
  233. package/lib/browser/extension/web-host-values.d.ts +67 -0
  234. package/lib/browser/extension/web-host-values.js +229 -0
  235. package/lib/browser/extension/web-hosts.d.ts +7 -2
  236. package/lib/browser/extension/web-hosts.js +16 -4
  237. package/lib/browser/extension/web-share-ui.d.ts +8 -0
  238. package/lib/browser/extension/web-share-ui.js +51 -0
  239. package/lib/browser/extension/web-share.d.ts +19 -0
  240. package/lib/browser/extension/web-share.js +45 -0
  241. package/lib/browser/i18n/en/chat.d.ts +10 -0
  242. package/lib/browser/i18n/en/chat.js +10 -0
  243. package/lib/browser/i18n/en/common.d.ts +23 -0
  244. package/lib/browser/i18n/en/common.js +23 -0
  245. package/lib/browser/i18n/en/discover.d.ts +7 -0
  246. package/lib/browser/i18n/en/discover.js +7 -0
  247. package/lib/browser/i18n/en/settings.d.ts +2 -0
  248. package/lib/browser/i18n/en/settings.js +2 -0
  249. package/lib/browser/i18n/ja/chat.js +10 -0
  250. package/lib/browser/i18n/ja/common.js +23 -0
  251. package/lib/browser/i18n/ja/discover.js +7 -0
  252. package/lib/browser/i18n/ja/settings.js +2 -0
  253. package/lib/browser/i18n/locales.d.ts +43 -1
  254. package/lib/browser/i18n/messages.d.ts +42 -0
  255. package/lib/browser/i18n/zh/chat.js +10 -0
  256. package/lib/browser/i18n/zh/common.js +23 -0
  257. package/lib/browser/i18n/zh/discover.js +7 -0
  258. package/lib/browser/i18n/zh/settings.js +2 -0
  259. package/lib/browser/i18n/zh-tw/chat.js +10 -0
  260. package/lib/browser/i18n/zh-tw/common.js +23 -0
  261. package/lib/browser/i18n/zh-tw/discover.js +7 -0
  262. package/lib/browser/i18n/zh-tw/settings.js +2 -0
  263. package/lib/browser/launch-art/art-palette.d.ts +42 -0
  264. package/lib/browser/launch-art/art-palette.js +76 -0
  265. package/lib/browser/launch-art/cyclic-automaton.d.ts +46 -0
  266. package/lib/browser/launch-art/cyclic-automaton.js +180 -0
  267. package/lib/browser/launch-art/fractal-tree.d.ts +44 -0
  268. package/lib/browser/launch-art/fractal-tree.js +52 -0
  269. package/lib/browser/launch-art/launch-art.d.ts +99 -0
  270. package/lib/browser/launch-art/launch-art.js +424 -0
  271. package/lib/browser/launch-art/launch-sky.d.ts +67 -0
  272. package/lib/browser/launch-art/launch-sky.js +157 -0
  273. package/lib/browser/links/clipboard-links.d.ts +90 -0
  274. package/lib/browser/links/clipboard-links.js +308 -0
  275. package/lib/browser/links/link-text.d.ts +30 -0
  276. package/lib/browser/links/link-text.js +100 -0
  277. package/lib/browser/links/links-protocol.d.ts +12 -1
  278. package/lib/browser/links/links.d.ts +8 -2
  279. package/lib/browser/links/links.js +33 -3
  280. package/lib/browser/markdown/code-renderers.d.ts +4 -0
  281. package/lib/browser/markdown/code-renderers.js +5 -1
  282. package/lib/browser/partners/group-picker.js +23 -29
  283. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  284. package/lib/browser/sandbox/work/work-senses.js +1 -1
  285. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  286. package/lib/browser/settings/settings-protocol.js +2 -0
  287. package/lib/browser/style/base.d.ts +1 -1
  288. package/lib/browser/style/base.js +10 -6
  289. package/lib/browser/style/chat-list.d.ts +1 -1
  290. package/lib/browser/style/chat-list.js +28 -15
  291. package/lib/browser/style/conversation-column.d.ts +1 -1
  292. package/lib/browser/style/conversation.d.ts +1 -1
  293. package/lib/browser/style/conversation.js +29 -2
  294. package/lib/browser/style/dialogs.d.ts +1 -1
  295. package/lib/browser/style/dialogs.js +2 -5
  296. package/lib/browser/style/forms.d.ts +6 -0
  297. package/lib/browser/style/forms.js +68 -0
  298. package/lib/browser/style/layout.d.ts +1 -1
  299. package/lib/browser/style/pages.d.ts +1 -1
  300. package/lib/browser/style/pages.js +14 -24
  301. package/lib/browser/style/phone.d.ts +1 -1
  302. package/lib/browser/style/shared.d.ts +1 -1
  303. package/lib/browser/style/shell.d.ts +1 -1
  304. package/lib/browser/style/shell.js +1 -6
  305. package/lib/browser/style/surfaces.d.ts +1 -1
  306. package/lib/browser/style/surfaces.js +0 -6
  307. package/lib/browser/style/tasks.d.ts +1 -1
  308. package/lib/browser/style.js +2 -0
  309. package/lib/browser/util/markdown.d.ts +45 -3
  310. package/lib/browser/util/markdown.js +68 -12
  311. package/lib/browser/util/voice.d.ts +18 -0
  312. package/lib/browser/util/voice.js +111 -3
  313. package/lib/browser/workbench-protocol.d.ts +2 -0
  314. package/lib/browser/workbench-services.d.ts +2 -0
  315. package/lib/browser/workbench-services.js +5 -0
  316. package/lib/browser/workbench.js +5 -0
  317. package/package.json +8 -8
  318. package/public/launch.svg +3 -3
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MarkdownUtil = void 0;
3
+ exports.MarkdownUtil = exports.MARKDOWN_TINTS = exports.CALLOUT_KINDS = void 0;
4
4
  const link_1 = require("./link");
5
+ exports.CALLOUT_KINDS = ['note', 'tip', 'important', 'warning', 'caution'];
6
+ exports.MARKDOWN_TINTS = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'gray'];
5
7
  const FENCE = /^\s*(`{3,}|~{3,})\s*([\w+-]*)/;
6
8
  const HEADING = /^(#{1,6})\s+(.*)$/;
7
9
  const RULE = /^\s*([-*_])(\s*\1){2,}\s*$/;
@@ -38,6 +40,11 @@ const IMAGE = /^!\[([^\]]*)\]\(\s*(?:<([^>]+)>|([^)\s]+))(?:\s+"[^"]*")?\s*\)/;
38
40
  /** A target may hold parentheses in pairs, as `https://en.wikipedia.org/wiki/A_(b)`. */
39
41
  const LINK = /^\[([^\]]+)\]\(\s*(?:<([^>]+)>|((?:[^()\s]|\([^()\s]*\))+))(?:\s+"[^"]*")?\s*\)/;
40
42
  const AUTOLINK = /^<(https?:\/\/[^>\s]+)>/i;
43
+ const TINTED = /^\[([^\]]+)\]\{\.([a-z]+)\}/;
44
+ const NOTE_MARK = /^\[\^([^\]\s]{1,24})\](?!:)/;
45
+ const FOOTNOTE = /^\[\^([^\]\s]{1,24})\]:\s+(.*)$/;
46
+ const CALLOUT = /^\[!(note|tip|important|warning|caution)\][ \t]*(.*)$/i;
47
+ const TASK = /^\[( |x|X)\]\s+/;
41
48
  /** What may come right before a bare URL: not a letter, a digit or a part of a path. */
42
49
  const BEFORE_URL = /[\w/.@:-]/;
43
50
  /** `$x$`: no space inside the dollars, no digit after the closing one, so that `$5 and $10` stays text. */
@@ -55,8 +62,8 @@ const PENDING_MATH = /(?:(?<![\\$])\$(?=[^\s$\d])[^$]*|\\\((?![\s\S]*\\\)).*)$/;
55
62
  /** Cells of a table longer than this (a CJK character counts twice) wrap; shorter ones keep to one line. */
56
63
  const LONG_CELL = 24;
57
64
  /**
58
- * The markdown models write: fenced code, headings, lists, quotes, tables, emphasis, code spans, links,
59
- * images and videos, and TeX between `$`, `$$`, `\\(\\)` or `\\[\\]`. Its output is data for React to
65
+ * The markdown models write: fenced code, headings, lists (of tasks too), quotes (boxes of a kind too), tables,
66
+ * footnotes, emphasis, struck out and highlighted words, words in a colour, code spans, links, images and videos, and TeX between `$`, `$$`, `\\(\\)` or `\\[\\]`. Its output is data for React to
60
67
  * render, never HTML, so text from the model cannot inject markup; links keep only http(s) and mailto
61
68
  * URLs and paths of files (LinkUtil.parse), and URLs in the text are links too. An unclosed fence or
62
69
  * formula, as while a reply streams, runs to the end.
@@ -64,7 +71,7 @@ const LONG_CELL = 24;
64
71
  var MarkdownUtil;
65
72
  (function (MarkdownUtil) {
66
73
  function blocks(source) {
67
- var _a, _b;
74
+ var _a, _b, _c;
68
75
  const lines = source.replace(/\r\n?/g, '\n').split('\n');
69
76
  const blocks = [];
70
77
  let paragraph = [];
@@ -120,10 +127,27 @@ var MarkdownUtil;
120
127
  quote.push(lines[i].trimStart().replace(/^>\s?/, ''));
121
128
  }
122
129
  i--;
123
- blocks.push({ type: 'quote', text: quote.join('\n') });
130
+ const callout = CALLOUT.exec((_a = quote[0]) !== null && _a !== void 0 ? _a : '');
131
+ blocks.push(callout
132
+ ? {
133
+ type: 'quote',
134
+ text: quote.slice(1).join('\n'),
135
+ callout: callout[1].toLowerCase(),
136
+ ...(callout[2].trim() ? { title: callout[2].trim() } : {}),
137
+ }
138
+ : { type: 'quote', text: quote.join('\n') });
139
+ continue;
140
+ }
141
+ const footnote = paragraph.length ? null : FOOTNOTE.exec(line.trim());
142
+ if (footnote) {
143
+ let text = footnote[2];
144
+ for (; i + 1 < lines.length && /^\s{2,}\S/.test(lines[i + 1]); i++) {
145
+ text += `\n${lines[i + 1].trim()}`;
146
+ }
147
+ blocks.push({ type: 'footnote', label: footnote[1], text });
124
148
  continue;
125
149
  }
126
- const item = (_a = BULLET.exec(line)) !== null && _a !== void 0 ? _a : NUMBERED.exec(line);
150
+ const item = (_b = BULLET.exec(line)) !== null && _b !== void 0 ? _b : NUMBERED.exec(line);
127
151
  if (item) {
128
152
  flush();
129
153
  const ordered = !BULLET.test(line);
@@ -145,7 +169,7 @@ var MarkdownUtil;
145
169
  blocks.push({ type: 'list', ordered, items });
146
170
  continue;
147
171
  }
148
- if (line.includes('|') && TABLE_SEPARATOR.test((_b = lines[i + 1]) !== null && _b !== void 0 ? _b : '') && !paragraph.length) {
172
+ if (line.includes('|') && TABLE_SEPARATOR.test((_c = lines[i + 1]) !== null && _c !== void 0 ? _c : '') && !paragraph.length) {
149
173
  const header = cells(line);
150
174
  const marks = cells(lines[i + 1]);
151
175
  const align = header.map((_, column) => { var _a; return alignOf((_a = marks[column]) !== null && _a !== void 0 ? _a : ''); });
@@ -186,8 +210,8 @@ var MarkdownUtil;
186
210
  }
187
211
  MarkdownUtil.streaming = streaming;
188
212
  function settled(text) {
189
- var _a, _b;
190
- var _c, _d;
213
+ var _a;
214
+ var _b;
191
215
  if (openFence(text)) {
192
216
  return text;
193
217
  }
@@ -199,11 +223,13 @@ var MarkdownUtil;
199
223
  line = line.replace(PENDING_LINK, '').replace(PENDING_MATH, '');
200
224
  // A mark cut in two at the end (one `*` of `**`): as if it had not come.
201
225
  line = line.replace(/[*`]+$/, '');
202
- if (((_c = (_a = line.match(/`/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _c !== void 0 ? _c : 0) % 2) {
226
+ if (((_b = (_a = line.match(/`/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) % 2) {
203
227
  line += '`';
204
228
  }
205
- if (((_d = (_b = line.replace(/`[^`]*`/g, '').match(/\*\*/g)) === null || _b === void 0 ? void 0 : _b.length) !== null && _d !== void 0 ? _d : 0) % 2) {
206
- line += '**';
229
+ for (const mark of ['**', '~~', '==']) {
230
+ if ((line.replace(/`[^`]*`/g, '').split(mark).length - 1) % 2) {
231
+ line += mark;
232
+ }
207
233
  }
208
234
  return text.slice(0, start) + line;
209
235
  }
@@ -328,6 +354,30 @@ var MarkdownUtil;
328
354
  i += em[0].length;
329
355
  continue;
330
356
  }
357
+ const struck = rest.startsWith('~~') ? /^~~(?=\S)([\s\S]*?\S)~~/.exec(rest) : null;
358
+ if (struck) {
359
+ push({ type: 'del', children: inline(struck[1]) });
360
+ i += struck[0].length;
361
+ continue;
362
+ }
363
+ const marked = rest.startsWith('==') ? /^==(?=[^\s=])([\s\S]*?[^\s=])==/.exec(rest) : null;
364
+ if (marked) {
365
+ push({ type: 'mark', children: inline(marked[1]) });
366
+ i += marked[0].length;
367
+ continue;
368
+ }
369
+ const note = text[i] === '[' ? NOTE_MARK.exec(rest) : null;
370
+ if (note) {
371
+ push({ type: 'note', label: note[1] });
372
+ i += note[0].length;
373
+ continue;
374
+ }
375
+ const tinted = text[i] === '[' ? TINTED.exec(rest) : null;
376
+ if (tinted && exports.MARKDOWN_TINTS.includes(tinted[2])) {
377
+ push({ type: 'tint', tint: tinted[2], children: inline(tinted[1]) });
378
+ i += tinted[0].length;
379
+ continue;
380
+ }
331
381
  const link = text[i] === '[' ? LINK.exec(rest) : null;
332
382
  if (link) {
333
383
  const href = (_d = link[2]) !== null && _d !== void 0 ? _d : link[3];
@@ -365,6 +415,12 @@ var MarkdownUtil;
365
415
  return out;
366
416
  }
367
417
  MarkdownUtil.inline = inline;
418
+ /** An item of a list of tasks (`[ ] to do`, `[x] done`): whether it is done, and its words; undefined for another item. */
419
+ function task(item) {
420
+ const mark = TASK.exec(item);
421
+ return mark ? { done: mark[1] !== ' ', text: item.slice(mark[0].length) } : undefined;
422
+ }
423
+ MarkdownUtil.task = task;
368
424
  /**
369
425
  * What a target of an image shows: by the type of a data URL, else by the extension of its path; an
370
426
  * http(s) URL or a path without a known extension is taken for an image. Undefined for targets that
@@ -26,6 +26,24 @@ export declare namespace Voice {
26
26
  * At most 100 are taken, with the directory and the names a box adds.
27
27
  */
28
28
  const VOCABULARY: readonly string[];
29
+ /**
30
+ * Where the recognizer of the device cannot listen (there is none, as in the web-view of Android, or it is not
31
+ * allowed: speech recognition refused, Siri and dictation off), Ta does: a voice service of Settings, or the
32
+ * model of the computer (TaHearing, docs/design/ta-voice.md 11). It only needs the microphone.
33
+ */
34
+ interface Fallback {
35
+ /** It may listen now: the page is connected and has a microphone. */
36
+ available(): boolean;
37
+ listen(language: string, onText: (text: string, final: boolean) => void, onEnd: (error?: string) => void, options: ListenOptions): Listening | undefined;
38
+ }
39
+ /** A recognizer of the device that ends this soon, unasked and having heard nothing, cannot listen. */
40
+ const QUICK_END_MS = 700;
41
+ /** A recognizer of the device that did not take the microphone this soon, nor said why, cannot listen. */
42
+ const AUDIO_START_MS = 2500;
43
+ /** Sets what listens where the device cannot; returns what takes it away. */
44
+ function setFallback(given: Fallback): () => void;
45
+ /** A failure of the device's recognizer that trying again would not mend, where Ta listens instead. */
46
+ function fallsBack(error: string): boolean;
29
47
  /**
30
48
  * Whether the page can listen. Not in WeChat's mini program, on a phone or a computer: its web-view has the
31
49
  * recognition of WebKit or Chromium, and always refuses it (`not-allowed`), with nowhere for the user to allow it.
@@ -87,6 +87,29 @@ var Voice;
87
87
  }
88
88
  return desktop_1.DesktopUtil.speech();
89
89
  }
90
+ let fallback;
91
+ /** A recognizer of the device that ends this soon, unasked and having heard nothing, cannot listen. */
92
+ Voice.QUICK_END_MS = 700;
93
+ /** A recognizer of the device that did not take the microphone this soon, nor said why, cannot listen. */
94
+ Voice.AUDIO_START_MS = 2500;
95
+ /** The device's recognizer failed so that it will again: Ta listens from then on, till the page loads again. */
96
+ let deviceFails = false;
97
+ /** Sets what listens where the device cannot; returns what takes it away. */
98
+ function setFallback(given) {
99
+ fallback = given;
100
+ deviceFails = false;
101
+ return () => {
102
+ if (fallback === given) {
103
+ fallback = undefined;
104
+ }
105
+ };
106
+ }
107
+ Voice.setFallback = setFallback;
108
+ /** A failure of the device's recognizer that trying again would not mend, where Ta listens instead. */
109
+ function fallsBack(error) {
110
+ return ['not-allowed', 'service-not-allowed', 'network', 'language-not-supported', 'unavailable'].includes(error);
111
+ }
112
+ Voice.fallsBack = fallsBack;
90
113
  /**
91
114
  * Whether the page can listen. Not in WeChat's mini program, on a phone or a computer: its web-view has the
92
115
  * recognition of WebKit or Chromium, and always refuses it (`not-allowed`), with nowhere for the user to allow it.
@@ -95,7 +118,7 @@ var Voice;
95
118
  if (mini_program_1.MiniProgram.inside()) {
96
119
  return false;
97
120
  }
98
- return nativeSpeech() !== undefined || recognitionClass() !== undefined;
121
+ return nativeSpeech() !== undefined || recognitionClass() !== undefined || (fallback === null || fallback === void 0 ? void 0 : fallback.available()) === true;
99
122
  }
100
123
  Voice.canListen = canListen;
101
124
  /** The user, the system or the browser does not let the page listen: the microphone or speech recognition is not allowed. */
@@ -157,8 +180,86 @@ var Voice;
157
180
  * and the words to expect; elsewhere the browser's.
158
181
  */
159
182
  function listen(language, onText, onEnd, options = {}) {
183
+ const ta = (fallback === null || fallback === void 0 ? void 0 : fallback.available()) ? fallback : undefined;
184
+ if (ta && (deviceFails || !canDeviceListen())) {
185
+ return ta.listen(language, onText, onEnd, options);
186
+ }
187
+ if (!ta) {
188
+ return listenOnDevice(language, onText, onEnd, options);
189
+ }
190
+ // The device first; failing before it heard a word, in a way it would again, Ta listens in its place.
191
+ let heard = false;
192
+ let current;
193
+ let stopped = false;
194
+ /** The device's listening was given up for Ta's: what it says after is not heard. */
195
+ let replaced = false;
196
+ let waiting;
197
+ let audio = false;
198
+ const started = Date.now();
199
+ const takeOver = (error) => {
200
+ replaced = true;
201
+ clearTimeout(waiting);
202
+ deviceFails = true;
203
+ current = ta.listen(language, onText, onEnd, options);
204
+ if (!current) {
205
+ onEnd(error);
206
+ }
207
+ };
208
+ const device = listenOnDevice(language, (text, final) => {
209
+ if (replaced) {
210
+ return;
211
+ }
212
+ heard || (heard = text.trim() !== '');
213
+ onText(text, final);
214
+ }, given => {
215
+ if (replaced) {
216
+ return;
217
+ }
218
+ clearTimeout(waiting);
219
+ // Ended at once having heard nothing, unasked: a recognizer that is there but cannot (a web-view's).
220
+ const error = given !== null && given !== void 0 ? given : (!heard && !stopped && Date.now() - started < Voice.QUICK_END_MS ? 'unavailable' : undefined);
221
+ if (error && !heard && !stopped && fallsBack(error) && ta.available()) {
222
+ takeOver(error);
223
+ return;
224
+ }
225
+ onEnd(given);
226
+ }, options, () => {
227
+ audio = true;
228
+ clearTimeout(waiting);
229
+ });
230
+ current = device;
231
+ if (audio) {
232
+ return device;
233
+ }
234
+ // Nor did it take the microphone in a while: the web-view of an Android with no service of recognition waits
235
+ // for one without end, saying nothing.
236
+ waiting = setTimeout(() => {
237
+ var _a;
238
+ if (!audio && !heard && !stopped && !replaced && ta.available()) {
239
+ (_a = device === null || device === void 0 ? void 0 : device.abort) === null || _a === void 0 ? void 0 : _a.call(device);
240
+ takeOver('unavailable');
241
+ }
242
+ }, Voice.AUDIO_START_MS);
243
+ return current
244
+ ? {
245
+ stop: () => {
246
+ stopped = true;
247
+ clearTimeout(waiting);
248
+ current === null || current === void 0 ? void 0 : current.stop();
249
+ },
250
+ }
251
+ : ta.listen(language, onText, onEnd, options);
252
+ }
253
+ Voice.listen = listen;
254
+ function canDeviceListen() {
255
+ return !mini_program_1.MiniProgram.inside() && (nativeSpeech() !== undefined || recognitionClass() !== undefined);
256
+ }
257
+ /** Listens with the recognizer of the device alone. */
258
+ function listenOnDevice(language, onText, onEnd, options, onAudio) {
160
259
  const native = nativeSpeech();
161
260
  if (native) {
261
+ // Apple's recognizer of the app says why it cannot listen at once.
262
+ onAudio === null || onAudio === void 0 ? void 0 : onAudio();
162
263
  return listenNatively(native, language, onText, onEnd, options);
163
264
  }
164
265
  const Recognition = recognitionClass();
@@ -185,10 +286,17 @@ var Voice;
185
286
  };
186
287
  recognition.onerror = event => end(event.error === 'no-speech' ? undefined : event.error);
187
288
  recognition.onend = () => end();
289
+ recognition.onaudiostart = () => onAudio === null || onAudio === void 0 ? void 0 : onAudio();
188
290
  recognition.start();
189
- return { stop: () => recognition.stop() };
291
+ return {
292
+ stop: () => recognition.stop(),
293
+ abort: () => {
294
+ var _a;
295
+ ended = true;
296
+ (_a = recognition.abort) === null || _a === void 0 ? void 0 : _a.call(recognition);
297
+ },
298
+ };
190
299
  }
191
- Voice.listen = listen;
192
300
  function listenNatively(native, language, onText, onEnd, options) {
193
301
  const id = crypto.randomUUID();
194
302
  let ended = false;
@@ -199,6 +199,8 @@ export interface TaWorkbench {
199
199
  onReconnect(listener: () => void): () => void;
200
200
  /** Keys of the data of a package that changed (TaClient.onExtensionData), `cwd` for those of a directory; the listener stays across reconnections. */
201
201
  onExtensionData(listener: (name: string, keys: string[], cwd?: string) => void): () => void;
202
+ /** What the server side of a package says changed (TaClient.onHostChanged); the listener stays across reconnections. */
203
+ onHostChanged(listener: (name: string, topics: string[]) => void): () => void;
202
204
  /** What happens during the sign-ins of this page (TaAuthServer.login); the listener stays across reconnections. */
203
205
  onAuthEvent(listener: (loginId: string, event: TaAuthEvent) => void): () => void;
204
206
  /**
@@ -9,6 +9,7 @@ export declare abstract class WorkbenchServices {
9
9
  protected readonly terminalListeners: Set<(terminalId: string, data: string, exitCode?: number) => void>;
10
10
  protected readonly reconnectListeners: Set<() => void>;
11
11
  protected readonly extensionDataListeners: Set<(name: string, keys: string[], cwd?: string) => void>;
12
+ protected readonly hostChangedListeners: Set<(name: string, topics: string[]) => void>;
12
13
  protected readonly authListeners: Set<(loginId: string, event: TaAuthEvent) => void>;
13
14
  protected readonly remoteListeners: Set<(event: TaRemoteEvent) => void>;
14
15
  protected readonly voiceListeners: Set<(event: TaVoiceEvent) => void>;
@@ -43,6 +44,7 @@ export declare abstract class WorkbenchServices {
43
44
  onTerminalData(listener: (terminalId: string, data: string, exitCode?: number) => void): () => void;
44
45
  onReconnect(listener: () => void): () => void;
45
46
  onExtensionData(listener: (name: string, keys: string[], cwd?: string) => void): () => void;
47
+ onHostChanged(listener: (name: string, topics: string[]) => void): () => void;
46
48
  onAuthEvent(listener: (loginId: string, event: TaAuthEvent) => void): () => void;
47
49
  onRemoteEvent(listener: (event: TaRemoteEvent) => void): () => void;
48
50
  onRoomEvent(listener: (event: TaRoomEvent) => void, options?: {
@@ -8,6 +8,7 @@ class WorkbenchServices {
8
8
  this.terminalListeners = new Set();
9
9
  this.reconnectListeners = new Set();
10
10
  this.extensionDataListeners = new Set();
11
+ this.hostChangedListeners = new Set();
11
12
  this.authListeners = new Set();
12
13
  this.remoteListeners = new Set();
13
14
  this.voiceListeners = new Set();
@@ -116,6 +117,10 @@ class WorkbenchServices {
116
117
  this.extensionDataListeners.add(listener);
117
118
  return () => this.extensionDataListeners.delete(listener);
118
119
  }
120
+ onHostChanged(listener) {
121
+ this.hostChangedListeners.add(listener);
122
+ return () => this.hostChangedListeners.delete(listener);
123
+ }
119
124
  onAuthEvent(listener) {
120
125
  this.authListeners.add(listener);
121
126
  return () => this.authListeners.delete(listener);
@@ -253,6 +253,11 @@ let TaWorkbenchImpl = class TaWorkbenchImpl extends workbench_hosts_1.WorkbenchH
253
253
  listener(name, keys, cwd);
254
254
  }
255
255
  });
256
+ connection.onHostChanged((name, topics) => {
257
+ for (const listener of this.hostChangedListeners) {
258
+ listener(name, topics);
259
+ }
260
+ });
256
261
  connection.onAuthEvent((loginId, event) => {
257
262
  for (const listener of this.authListeners) {
258
263
  listener(loginId, event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-web",
3
- "version": "4.41.0",
3
+ "version": "4.43.0",
4
4
  "description": "The web client of ta serve: sessions, streaming messages, tool runs with diffs, and dialogs",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -33,19 +33,19 @@
33
33
  "watch": "tsc -b -w --preserveWatchOutput"
34
34
  },
35
35
  "dependencies": {
36
- "@celljs/core": "4.41.0",
37
- "@celljs/react": "4.41.0",
38
- "@celljs/ta-client": "4.41.0",
39
- "@celljs/ta-protocol": "4.41.0",
40
- "@celljs/ta-relay": "4.41.0",
41
- "@celljs/widget": "4.41.0",
36
+ "@celljs/core": "4.43.0",
37
+ "@celljs/react": "4.43.0",
38
+ "@celljs/ta-client": "4.43.0",
39
+ "@celljs/ta-protocol": "4.43.0",
40
+ "@celljs/ta-relay": "4.43.0",
41
+ "@celljs/widget": "4.43.0",
42
42
  "@types/three": "^0.187.0",
43
43
  "@xterm/addon-fit": "^0.11.0",
44
44
  "@xterm/addon-unicode11": "^0.9.0",
45
45
  "@xterm/addon-webgl": "^0.19.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
47
  "katex": "^0.18.11",
48
- "lucide-react": "^1.83.0",
48
+ "lucide-react": "^1.84.0",
49
49
  "mermaid": "^12.4.0",
50
50
  "monaco-editor": "^0.57.0",
51
51
  "phaser": "^4.2.1",
package/public/launch.svg CHANGED
@@ -17,7 +17,7 @@
17
17
  <linearGradient id="limb" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#A7F3D0" stop-opacity="0.12"/><stop offset="0.76" stop-color="#ECFDF5"/><stop offset="1" stop-color="#A7F3D0" stop-opacity="0.25"/></linearGradient>
18
18
  <linearGradient id="bowl" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#010202" stop-opacity="0.75"/><stop offset="1" stop-color="#0B1311" stop-opacity="0.35"/></linearGradient>
19
19
  <linearGradient id="shadow" x1="1" y1="0" x2="0" y2="0"><stop offset="0" stop-color="#000" stop-opacity="0.85"/><stop offset="1" stop-color="#000" stop-opacity="0"/></linearGradient>
20
- <linearGradient id="skin" x1="1" y1="0.15" x2="0" y2="0.85"><stop offset="0" stop-color="#34D399"/><stop offset="0.45" stop-color="#10B981"/><stop offset="1" stop-color="#065F46"/></linearGradient>
20
+ <linearGradient id="skin" x1="1" y1="0.05" x2="0" y2="1"><stop offset="0" stop-color="#0F6B52"/><stop offset="0.5" stop-color="#0A4A39"/><stop offset="1" stop-color="#04241B"/></linearGradient>
21
21
  <mask id="crescent"><circle cx="76" cy="170" r="12" fill="#fff"/><circle cx="82" cy="166" r="11" fill="#000"/></mask>
22
22
  <filter id="grain" x="0" y="380" width="360" height="260" filterUnits="userSpaceOnUse"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" seed="4"/><feColorMatrix values="0 0 0 0 0.7 0 0 0 0 0.95 0 0 0 0 0.85 0 0 0 -1.3 0.7"/></filter>
23
23
  <filter id="haze" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3"/></filter>
@@ -45,8 +45,8 @@
45
45
  <ellipse cx="276" cy="407.24" rx="230" ry="96.6" fill="url(#dawn)"/>
46
46
  <rect x="156" y="406.64" width="240" height="1.2" fill="url(#streak)"/>
47
47
  <g transform="translate(124 402.85) rotate(-5.02) scale(0.27) translate(-124 -245)">
48
- <use href="#dino" fill="#D1FAE5"/>
49
- <g clip-path="url(#body)"><use href="#dino" fill="url(#skin)" transform="translate(-7 1.5)"/></g>
48
+ <use href="#dino" fill="#A7F3D0" fill-opacity="0.95"/>
49
+ <g clip-path="url(#body)"><use href="#dino" fill="url(#skin)" transform="translate(-5.5 2)"/></g>
50
50
  </g>
51
51
  <rect width="360" height="640" fill="url(#edge)"/>
52
52
  </g>