@celljs/ta-web 4.49.0 → 4.50.1

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 (400) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/account/account-side.js +4 -0
  4. package/esm/browser/account/device-account.d.ts +6 -0
  5. package/esm/browser/account/device-account.js +20 -5
  6. package/esm/browser/assistant/assistant-view.js +2 -0
  7. package/esm/browser/assistant/call-announcing.d.ts +25 -0
  8. package/esm/browser/assistant/call-announcing.js +32 -0
  9. package/esm/browser/assistant/call-answering.d.ts +43 -0
  10. package/esm/browser/assistant/call-answering.js +63 -0
  11. package/esm/browser/assistant/call-hearing.d.ts +53 -0
  12. package/esm/browser/assistant/call-hearing.js +98 -0
  13. package/esm/browser/assistant/call-pausing.d.ts +40 -0
  14. package/esm/browser/assistant/call-pausing.js +82 -0
  15. package/esm/browser/assistant/call-reading.d.ts +32 -0
  16. package/esm/browser/assistant/call-reading.js +35 -0
  17. package/esm/browser/assistant/call-revoicing.d.ts +33 -0
  18. package/esm/browser/assistant/call-revoicing.js +68 -0
  19. package/esm/browser/assistant/call-turns.d.ts +29 -0
  20. package/esm/browser/assistant/call-turns.js +33 -0
  21. package/esm/browser/assistant/spoken-answer.d.ts +21 -0
  22. package/esm/browser/assistant/spoken-answer.js +69 -0
  23. package/esm/browser/assistant/spoken-call.d.ts +7 -0
  24. package/esm/browser/assistant/spoken-call.js +16 -0
  25. package/esm/browser/assistant/voice-call-protocol.d.ts +5 -0
  26. package/esm/browser/assistant/voice-call.d.ts +47 -43
  27. package/esm/browser/assistant/voice-call.js +193 -219
  28. package/esm/browser/chat/chat-view.js +2 -1
  29. package/esm/browser/components/account-menu.js +1 -1
  30. package/esm/browser/components/account-recovery-view.d.ts +11 -0
  31. package/esm/browser/components/account-recovery-view.js +81 -0
  32. package/esm/browser/components/account-view.d.ts +1 -2
  33. package/esm/browser/components/account-view.js +10 -1
  34. package/esm/browser/components/app-nav.js +19 -8
  35. package/esm/browser/components/app-shell-hooks.d.ts +5 -0
  36. package/esm/browser/components/app-shell-hooks.js +45 -0
  37. package/esm/browser/components/app-shell-state.js +2 -1
  38. package/esm/browser/components/app-update-view.js +4 -4
  39. package/esm/browser/components/app-view.js +9 -5
  40. package/esm/browser/components/chat-emoji.d.ts +35 -0
  41. package/esm/browser/components/chat-emoji.js +129 -0
  42. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  43. package/esm/browser/components/composer-attachments.d.ts +6 -0
  44. package/esm/browser/components/composer-attachments.js +12 -1
  45. package/esm/browser/components/composer-box-protocol.d.ts +15 -0
  46. package/esm/browser/components/composer-box.js +110 -87
  47. package/esm/browser/components/composer-drop-hooks.d.ts +26 -0
  48. package/esm/browser/components/composer-drop-hooks.js +36 -0
  49. package/esm/browser/components/composer-emoji.js +1 -1
  50. package/esm/browser/components/composer-faces.d.ts +16 -0
  51. package/esm/browser/components/composer-faces.js +37 -0
  52. package/esm/browser/components/composer-media.d.ts +10 -0
  53. package/esm/browser/components/composer-media.js +12 -1
  54. package/esm/browser/components/composer-target.d.ts +4 -0
  55. package/esm/browser/components/composer-target.js +18 -7
  56. package/esm/browser/components/composer-type-focus.d.ts +24 -0
  57. package/esm/browser/components/composer-type-focus.js +17 -0
  58. package/esm/browser/components/composer-voice.d.ts +24 -0
  59. package/esm/browser/components/composer-voice.js +37 -0
  60. package/esm/browser/components/composer.d.ts +2 -2
  61. package/esm/browser/components/composer.js +39 -8
  62. package/esm/browser/components/context-menu.js +2 -1
  63. package/esm/browser/components/emoji-panel.d.ts +11 -7
  64. package/esm/browser/components/emoji-panel.js +40 -22
  65. package/esm/browser/components/extension-settings.js +2 -2
  66. package/esm/browser/components/folder-new.d.ts +18 -0
  67. package/esm/browser/components/folder-new.js +53 -0
  68. package/esm/browser/components/folder-picker.d.ts +5 -2
  69. package/esm/browser/components/folder-picker.js +18 -6
  70. package/esm/browser/components/host-view.d.ts +1 -1
  71. package/esm/browser/components/image-menu.d.ts +8 -3
  72. package/esm/browser/components/image-menu.js +34 -9
  73. package/esm/browser/components/markdown.js +9 -2
  74. package/esm/browser/components/media.js +3 -2
  75. package/esm/browser/components/message-list.js +2 -2
  76. package/esm/browser/components/message-steps.js +20 -11
  77. package/esm/browser/components/message-user.js +2 -2
  78. package/esm/browser/components/moved-notice.js +2 -1
  79. package/esm/browser/components/nav-places.d.ts +2 -0
  80. package/esm/browser/components/nav-places.js +4 -2
  81. package/esm/browser/components/phone-shell.d.ts +2 -0
  82. package/esm/browser/components/phone-shell.js +5 -1
  83. package/esm/browser/components/secret-text.d.ts +1 -1
  84. package/esm/browser/components/secret-text.js +4 -3
  85. package/esm/browser/components/session-view.js +3 -0
  86. package/esm/browser/components/settings-choices.d.ts +2 -1
  87. package/esm/browser/components/settings-choices.js +13 -5
  88. package/esm/browser/components/settings-more.js +3 -3
  89. package/esm/browser/components/settings-parts.js +13 -2
  90. package/esm/browser/components/share-item-sheet.js +7 -1
  91. package/esm/browser/components/tab-title.d.ts +27 -0
  92. package/esm/browser/components/tab-title.js +35 -0
  93. package/esm/browser/components/use-composer-attachments.d.ts +28 -0
  94. package/esm/browser/components/use-composer-attachments.js +65 -0
  95. package/esm/browser/components/use-composer-files.d.ts +25 -0
  96. package/esm/browser/components/use-composer-files.js +52 -0
  97. package/esm/browser/components/web-composer.d.ts +3 -1
  98. package/esm/browser/components/web-composer.js +3 -2
  99. package/esm/browser/components/workbench-view.js +1 -0
  100. package/esm/browser/components/working-directory.js +2 -1
  101. package/esm/browser/device/app-update.d.ts +6 -3
  102. package/esm/browser/device/app-update.js +11 -5
  103. package/esm/browser/device/drag-move.d.ts +21 -0
  104. package/esm/browser/device/drag-move.js +86 -0
  105. package/esm/browser/extension/icons.js +7 -1
  106. package/esm/browser/extension/web-api-desktop.d.ts +19 -0
  107. package/esm/browser/extension/web-api-menus.d.ts +19 -0
  108. package/esm/browser/extension/web-api-spec.js +2 -0
  109. package/esm/browser/extension/web-extension-api.d.ts +24 -23
  110. package/esm/browser/extension/web-extension-context.d.ts +1 -0
  111. package/esm/browser/extension/web-extension-context.js +12 -5
  112. package/esm/browser/extension/web-extension-run.js +1 -0
  113. package/esm/browser/extension/web-share-ui.d.ts +1 -1
  114. package/esm/browser/extension/web-share-ui.js +2 -0
  115. package/esm/browser/extension/web-share.d.ts +13 -0
  116. package/esm/browser/extension/web-share.js +37 -2
  117. package/esm/browser/i18n/en/account.d.ts +18 -0
  118. package/esm/browser/i18n/en/account.js +18 -0
  119. package/esm/browser/i18n/en/call.js +1 -1
  120. package/esm/browser/i18n/en/chat.d.ts +15 -0
  121. package/esm/browser/i18n/en/chat.js +16 -1
  122. package/esm/browser/i18n/en/common.d.ts +2 -0
  123. package/esm/browser/i18n/en/common.js +2 -0
  124. package/esm/browser/i18n/en/discover.d.ts +2 -0
  125. package/esm/browser/i18n/en/discover.js +2 -0
  126. package/esm/browser/i18n/en/service.d.ts +4 -0
  127. package/esm/browser/i18n/en/service.js +4 -0
  128. package/esm/browser/i18n/en/settings.d.ts +17 -0
  129. package/esm/browser/i18n/en/settings.js +17 -0
  130. package/esm/browser/i18n/ja/account.js +18 -0
  131. package/esm/browser/i18n/ja/call.js +1 -1
  132. package/esm/browser/i18n/ja/chat.js +16 -1
  133. package/esm/browser/i18n/ja/common.js +2 -0
  134. package/esm/browser/i18n/ja/discover.js +3 -1
  135. package/esm/browser/i18n/ja/service.js +4 -0
  136. package/esm/browser/i18n/ja/settings.js +17 -0
  137. package/esm/browser/i18n/locales.d.ts +59 -1
  138. package/esm/browser/i18n/messages.d.ts +58 -0
  139. package/esm/browser/i18n/zh/account.js +18 -0
  140. package/esm/browser/i18n/zh/call.js +1 -1
  141. package/esm/browser/i18n/zh/chat.js +16 -1
  142. package/esm/browser/i18n/zh/common.js +2 -0
  143. package/esm/browser/i18n/zh/discover.js +3 -1
  144. package/esm/browser/i18n/zh/service.js +4 -0
  145. package/esm/browser/i18n/zh/settings.js +17 -0
  146. package/esm/browser/i18n/zh-tw/account.js +18 -0
  147. package/esm/browser/i18n/zh-tw/call.js +1 -1
  148. package/esm/browser/i18n/zh-tw/chat.js +16 -1
  149. package/esm/browser/i18n/zh-tw/common.js +2 -0
  150. package/esm/browser/i18n/zh-tw/discover.js +3 -1
  151. package/esm/browser/i18n/zh-tw/service.js +4 -0
  152. package/esm/browser/i18n/zh-tw/settings.js +17 -0
  153. package/esm/browser/offline/kept-chats.d.ts +3 -1
  154. package/esm/browser/offline/kept-chats.js +1 -1
  155. package/esm/browser/partners/group-picker.d.ts +3 -2
  156. package/esm/browser/partners/group-picker.js +8 -3
  157. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  158. package/esm/browser/sandbox/work/work-docs.js +5 -2
  159. package/esm/browser/sandbox/work/work-frame.d.ts +3 -0
  160. package/esm/browser/sandbox/work/work-frame.js +9 -3
  161. package/esm/browser/sandbox/work/work-gates.d.ts +77 -0
  162. package/esm/browser/sandbox/work/work-gates.js +182 -0
  163. package/esm/browser/settings/agent-settings.js +1 -1
  164. package/esm/browser/settings/navigation.d.ts +38 -10
  165. package/esm/browser/settings/navigation.js +73 -17
  166. package/esm/browser/settings/settings-protocol.d.ts +16 -1
  167. package/esm/browser/settings/settings-protocol.js +20 -2
  168. package/esm/browser/settings/settings.js +4 -1
  169. package/esm/browser/style/base.d.ts +1 -1
  170. package/esm/browser/style/base.js +15 -2
  171. package/esm/browser/style/chat-list.d.ts +1 -1
  172. package/esm/browser/style/chat-list.js +6 -3
  173. package/esm/browser/style/conversation-column.d.ts +1 -1
  174. package/esm/browser/style/conversation-column.js +28 -8
  175. package/esm/browser/style/conversation.d.ts +1 -1
  176. package/esm/browser/style/conversation.js +5 -0
  177. package/esm/browser/style/device.js +5 -0
  178. package/esm/browser/style/pages.d.ts +1 -1
  179. package/esm/browser/style/pages.js +3 -3
  180. package/esm/browser/style/shell.d.ts +1 -1
  181. package/esm/browser/style/shell.js +13 -6
  182. package/esm/browser/style/tasks.d.ts +1 -1
  183. package/esm/browser/style/tasks.js +4 -2
  184. package/esm/browser/util/chat-emoji.d.ts +44 -0
  185. package/esm/browser/util/chat-emoji.js +269 -0
  186. package/esm/browser/util/composer-drop.d.ts +26 -0
  187. package/esm/browser/util/composer-drop.js +40 -0
  188. package/esm/browser/util/composer-files.d.ts +48 -0
  189. package/esm/browser/util/composer-files.js +99 -0
  190. package/esm/browser/util/composer.d.ts +13 -1
  191. package/esm/browser/util/composer.js +24 -6
  192. package/esm/browser/util/markdown.d.ts +5 -0
  193. package/esm/browser/util/markdown.js +18 -0
  194. package/esm/browser/util/message.d.ts +6 -1
  195. package/esm/browser/util/message.js +13 -2
  196. package/esm/browser/util/process.d.ts +10 -13
  197. package/esm/browser/util/process.js +31 -83
  198. package/esm/browser/util/turn-join.d.ts +38 -0
  199. package/esm/browser/util/turn-join.js +119 -0
  200. package/esm/browser/workbench-services.js +1 -1
  201. package/lib/browser/account/account-side.js +4 -0
  202. package/lib/browser/account/device-account.d.ts +6 -0
  203. package/lib/browser/account/device-account.js +20 -5
  204. package/lib/browser/assistant/assistant-view.js +2 -0
  205. package/lib/browser/assistant/call-announcing.d.ts +26 -0
  206. package/lib/browser/assistant/call-announcing.js +36 -0
  207. package/lib/browser/assistant/call-answering.d.ts +44 -0
  208. package/lib/browser/assistant/call-answering.js +67 -0
  209. package/lib/browser/assistant/call-hearing.d.ts +54 -0
  210. package/lib/browser/assistant/call-hearing.js +102 -0
  211. package/lib/browser/assistant/call-pausing.d.ts +41 -0
  212. package/lib/browser/assistant/call-pausing.js +86 -0
  213. package/lib/browser/assistant/call-reading.d.ts +33 -0
  214. package/lib/browser/assistant/call-reading.js +39 -0
  215. package/lib/browser/assistant/call-revoicing.d.ts +34 -0
  216. package/lib/browser/assistant/call-revoicing.js +72 -0
  217. package/lib/browser/assistant/call-turns.d.ts +30 -0
  218. package/lib/browser/assistant/call-turns.js +37 -0
  219. package/lib/browser/assistant/spoken-answer.d.ts +22 -0
  220. package/lib/browser/assistant/spoken-answer.js +73 -0
  221. package/lib/browser/assistant/spoken-call.d.ts +8 -0
  222. package/lib/browser/assistant/spoken-call.js +19 -0
  223. package/lib/browser/assistant/voice-call-protocol.d.ts +5 -0
  224. package/lib/browser/assistant/voice-call.d.ts +47 -43
  225. package/lib/browser/assistant/voice-call.js +192 -218
  226. package/lib/browser/chat/chat-view.js +2 -1
  227. package/lib/browser/components/account-menu.js +1 -1
  228. package/lib/browser/components/account-recovery-view.d.ts +12 -0
  229. package/lib/browser/components/account-recovery-view.js +117 -0
  230. package/lib/browser/components/account-view.d.ts +1 -2
  231. package/lib/browser/components/account-view.js +10 -1
  232. package/lib/browser/components/app-nav.js +19 -8
  233. package/lib/browser/components/app-shell-hooks.d.ts +5 -0
  234. package/lib/browser/components/app-shell-hooks.js +46 -0
  235. package/lib/browser/components/app-shell-state.js +1 -0
  236. package/lib/browser/components/app-update-view.js +4 -4
  237. package/lib/browser/components/app-view.js +8 -4
  238. package/lib/browser/components/chat-emoji.d.ts +36 -0
  239. package/lib/browser/components/chat-emoji.js +167 -0
  240. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  241. package/lib/browser/components/composer-attachments.d.ts +6 -0
  242. package/lib/browser/components/composer-attachments.js +12 -0
  243. package/lib/browser/components/composer-box-protocol.d.ts +15 -0
  244. package/lib/browser/components/composer-box.js +107 -84
  245. package/lib/browser/components/composer-drop-hooks.d.ts +27 -0
  246. package/lib/browser/components/composer-drop-hooks.js +72 -0
  247. package/lib/browser/components/composer-emoji.js +1 -1
  248. package/lib/browser/components/composer-faces.d.ts +17 -0
  249. package/lib/browser/components/composer-faces.js +73 -0
  250. package/lib/browser/components/composer-media.d.ts +10 -0
  251. package/lib/browser/components/composer-media.js +13 -0
  252. package/lib/browser/components/composer-target.d.ts +4 -0
  253. package/lib/browser/components/composer-target.js +18 -7
  254. package/lib/browser/components/composer-type-focus.d.ts +25 -0
  255. package/lib/browser/components/composer-type-focus.js +20 -0
  256. package/lib/browser/components/composer-voice.d.ts +25 -0
  257. package/lib/browser/components/composer-voice.js +73 -0
  258. package/lib/browser/components/composer.d.ts +2 -2
  259. package/lib/browser/components/composer.js +38 -7
  260. package/lib/browser/components/context-menu.js +2 -1
  261. package/lib/browser/components/emoji-panel.d.ts +11 -7
  262. package/lib/browser/components/emoji-panel.js +40 -22
  263. package/lib/browser/components/extension-settings.js +1 -1
  264. package/lib/browser/components/folder-new.d.ts +19 -0
  265. package/lib/browser/components/folder-new.js +90 -0
  266. package/lib/browser/components/folder-picker.d.ts +5 -2
  267. package/lib/browser/components/folder-picker.js +17 -5
  268. package/lib/browser/components/host-view.d.ts +1 -1
  269. package/lib/browser/components/image-menu.d.ts +8 -3
  270. package/lib/browser/components/image-menu.js +34 -9
  271. package/lib/browser/components/markdown.js +9 -2
  272. package/lib/browser/components/media.js +3 -2
  273. package/lib/browser/components/message-list.js +2 -2
  274. package/lib/browser/components/message-steps.js +20 -11
  275. package/lib/browser/components/message-user.js +1 -1
  276. package/lib/browser/components/moved-notice.js +2 -1
  277. package/lib/browser/components/nav-places.d.ts +2 -0
  278. package/lib/browser/components/nav-places.js +4 -2
  279. package/lib/browser/components/phone-shell.d.ts +2 -0
  280. package/lib/browser/components/phone-shell.js +5 -1
  281. package/lib/browser/components/secret-text.d.ts +1 -1
  282. package/lib/browser/components/secret-text.js +4 -3
  283. package/lib/browser/components/session-view.js +3 -0
  284. package/lib/browser/components/settings-choices.d.ts +2 -1
  285. package/lib/browser/components/settings-choices.js +12 -4
  286. package/lib/browser/components/settings-more.js +2 -2
  287. package/lib/browser/components/settings-parts.js +11 -0
  288. package/lib/browser/components/share-item-sheet.js +7 -1
  289. package/lib/browser/components/tab-title.d.ts +28 -0
  290. package/lib/browser/components/tab-title.js +38 -0
  291. package/lib/browser/components/use-composer-attachments.d.ts +29 -0
  292. package/lib/browser/components/use-composer-attachments.js +101 -0
  293. package/lib/browser/components/use-composer-files.d.ts +26 -0
  294. package/lib/browser/components/use-composer-files.js +88 -0
  295. package/lib/browser/components/web-composer.d.ts +3 -1
  296. package/lib/browser/components/web-composer.js +3 -2
  297. package/lib/browser/components/workbench-view.js +1 -0
  298. package/lib/browser/components/working-directory.js +2 -1
  299. package/lib/browser/device/app-update.d.ts +6 -3
  300. package/lib/browser/device/app-update.js +11 -5
  301. package/lib/browser/device/drag-move.d.ts +22 -0
  302. package/lib/browser/device/drag-move.js +122 -0
  303. package/lib/browser/extension/icons.js +6 -0
  304. package/lib/browser/extension/web-api-desktop.d.ts +19 -0
  305. package/lib/browser/extension/web-api-menus.d.ts +19 -0
  306. package/lib/browser/extension/web-api-spec.js +2 -0
  307. package/lib/browser/extension/web-extension-api.d.ts +24 -23
  308. package/lib/browser/extension/web-extension-context.d.ts +1 -0
  309. package/lib/browser/extension/web-extension-context.js +12 -5
  310. package/lib/browser/extension/web-extension-run.js +1 -0
  311. package/lib/browser/extension/web-share-ui.d.ts +1 -1
  312. package/lib/browser/extension/web-share-ui.js +2 -0
  313. package/lib/browser/extension/web-share.d.ts +13 -0
  314. package/lib/browser/extension/web-share.js +37 -2
  315. package/lib/browser/i18n/en/account.d.ts +18 -0
  316. package/lib/browser/i18n/en/account.js +18 -0
  317. package/lib/browser/i18n/en/call.js +1 -1
  318. package/lib/browser/i18n/en/chat.d.ts +15 -0
  319. package/lib/browser/i18n/en/chat.js +16 -1
  320. package/lib/browser/i18n/en/common.d.ts +2 -0
  321. package/lib/browser/i18n/en/common.js +2 -0
  322. package/lib/browser/i18n/en/discover.d.ts +2 -0
  323. package/lib/browser/i18n/en/discover.js +2 -0
  324. package/lib/browser/i18n/en/service.d.ts +4 -0
  325. package/lib/browser/i18n/en/service.js +4 -0
  326. package/lib/browser/i18n/en/settings.d.ts +17 -0
  327. package/lib/browser/i18n/en/settings.js +17 -0
  328. package/lib/browser/i18n/ja/account.js +18 -0
  329. package/lib/browser/i18n/ja/call.js +1 -1
  330. package/lib/browser/i18n/ja/chat.js +16 -1
  331. package/lib/browser/i18n/ja/common.js +2 -0
  332. package/lib/browser/i18n/ja/discover.js +3 -1
  333. package/lib/browser/i18n/ja/service.js +4 -0
  334. package/lib/browser/i18n/ja/settings.js +17 -0
  335. package/lib/browser/i18n/locales.d.ts +59 -1
  336. package/lib/browser/i18n/messages.d.ts +58 -0
  337. package/lib/browser/i18n/zh/account.js +18 -0
  338. package/lib/browser/i18n/zh/call.js +1 -1
  339. package/lib/browser/i18n/zh/chat.js +16 -1
  340. package/lib/browser/i18n/zh/common.js +2 -0
  341. package/lib/browser/i18n/zh/discover.js +3 -1
  342. package/lib/browser/i18n/zh/service.js +4 -0
  343. package/lib/browser/i18n/zh/settings.js +17 -0
  344. package/lib/browser/i18n/zh-tw/account.js +18 -0
  345. package/lib/browser/i18n/zh-tw/call.js +1 -1
  346. package/lib/browser/i18n/zh-tw/chat.js +16 -1
  347. package/lib/browser/i18n/zh-tw/common.js +2 -0
  348. package/lib/browser/i18n/zh-tw/discover.js +3 -1
  349. package/lib/browser/i18n/zh-tw/service.js +4 -0
  350. package/lib/browser/i18n/zh-tw/settings.js +17 -0
  351. package/lib/browser/offline/kept-chats.d.ts +3 -1
  352. package/lib/browser/offline/kept-chats.js +1 -1
  353. package/lib/browser/partners/group-picker.d.ts +3 -2
  354. package/lib/browser/partners/group-picker.js +8 -3
  355. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  356. package/lib/browser/sandbox/work/work-docs.js +5 -2
  357. package/lib/browser/sandbox/work/work-frame.d.ts +3 -0
  358. package/lib/browser/sandbox/work/work-frame.js +9 -3
  359. package/lib/browser/sandbox/work/work-gates.d.ts +78 -0
  360. package/lib/browser/sandbox/work/work-gates.js +185 -0
  361. package/lib/browser/settings/agent-settings.js +1 -1
  362. package/lib/browser/settings/navigation.d.ts +38 -10
  363. package/lib/browser/settings/navigation.js +74 -18
  364. package/lib/browser/settings/settings-protocol.d.ts +16 -1
  365. package/lib/browser/settings/settings-protocol.js +21 -3
  366. package/lib/browser/settings/settings.js +3 -0
  367. package/lib/browser/style/base.d.ts +1 -1
  368. package/lib/browser/style/base.js +15 -2
  369. package/lib/browser/style/chat-list.d.ts +1 -1
  370. package/lib/browser/style/chat-list.js +6 -3
  371. package/lib/browser/style/conversation-column.d.ts +1 -1
  372. package/lib/browser/style/conversation-column.js +28 -8
  373. package/lib/browser/style/conversation.d.ts +1 -1
  374. package/lib/browser/style/conversation.js +5 -0
  375. package/lib/browser/style/device.js +5 -0
  376. package/lib/browser/style/pages.d.ts +1 -1
  377. package/lib/browser/style/pages.js +3 -3
  378. package/lib/browser/style/shell.d.ts +1 -1
  379. package/lib/browser/style/shell.js +13 -6
  380. package/lib/browser/style/tasks.d.ts +1 -1
  381. package/lib/browser/style/tasks.js +4 -2
  382. package/lib/browser/util/chat-emoji.d.ts +45 -0
  383. package/lib/browser/util/chat-emoji.js +272 -0
  384. package/lib/browser/util/composer-drop.d.ts +27 -0
  385. package/lib/browser/util/composer-drop.js +43 -0
  386. package/lib/browser/util/composer-files.d.ts +49 -0
  387. package/lib/browser/util/composer-files.js +102 -0
  388. package/lib/browser/util/composer.d.ts +13 -1
  389. package/lib/browser/util/composer.js +24 -6
  390. package/lib/browser/util/markdown.d.ts +5 -0
  391. package/lib/browser/util/markdown.js +18 -0
  392. package/lib/browser/util/message.d.ts +6 -1
  393. package/lib/browser/util/message.js +13 -2
  394. package/lib/browser/util/process.d.ts +10 -13
  395. package/lib/browser/util/process.js +32 -84
  396. package/lib/browser/util/turn-join.d.ts +39 -0
  397. package/lib/browser/util/turn-join.js +122 -0
  398. package/lib/browser/workbench-services.js +1 -1
  399. package/package.json +7 -7
  400. package/public/emoji/wechat-v1.webp +0 -0
@@ -1,5 +1,6 @@
1
1
  import { SandboxDocs } from '../sandbox-protocol.js';
2
2
  import { WORK_API } from './work-api.js';
3
+ import { WorkGates } from './work-gates.js';
3
4
  /**
4
5
  * The document of an HTML work (docs/design/ta-works.md 7.6): it reaches nothing but what it carries. No network (a work
5
6
  * cannot send what it was shown anywhere), no forms, no frames; inline scripts and styles, pictures and sounds of data.
@@ -45,7 +46,7 @@ function tap(x,y){var t=document.elementFromPoint(x,y)||document.body;if(!t)retu
45
46
  function blank(){var b=document.body;if(!b)return true;if(document.querySelector('canvas,svg,img,video'))return false;if((b.innerText||'').replace(/\\s/g,'').length)return false;var a=b.getElementsByTagName('*');for(var i=0;i<a.length;i++){var r=a[i].getBoundingClientRect(),s=getComputedStyle(a[i]);if(r.width*r.height>400&&s.visibility!=='hidden'&&(s.backgroundColor!=='rgba(0, 0, 0, 0)'||s.backgroundImage!=='none'))return false}return true}
46
47
  function probe(){var w=innerWidth,h=innerHeight;[[.5,.5],[.33,.5],[.66,.5],[.5,.75]].forEach(function(p,i){setTimeout(function(){tap(w*p[0],h*p[1])},150+i*200)});
47
48
  setTimeout(function(){sw.forEach(function(n){var s=S.senses[n];if(s)fire(n,s.standIn==='pad'?{x:.5,y:-.5}:s.standIn==='sides'?{x:1,y:0,amount:1}:s.standIn==='tap'?{power:1}:.8)})},500);
48
- setTimeout(function(){post({type:'probed',blank:blank()})},1600)}
49
+ setTimeout(function(){var v;try{v=ta.check?ta.check():{level:'none',line:'no test'}}catch(e){v={level:'broken',line:'the test itself failed: '+String(e&&e.message||e)}}post({type:'probed',blank:blank(),verdict:v})},2200)}
49
50
  var asked={},nid=0;function can(){Object.keys(S.asks).forEach(function(n){if((ta.can||[]).indexOf(n)<0)delete ta[n];else ta[n]=function(){var a=[].slice.call(arguments),id=++nid;return new Promise(function(ok,no){asked[id]=[ok,no];post({type:'ask',id:id,name:n,args:a})})}})}can();
50
51
  addEventListener('message',function(e){var m=e.data;if(e.source!==parent||!m||m.ta!=='work')return;
51
52
  if(m.type==='init'){Object.keys(S.values).forEach(function(k){if(m.values&&k in m.values)ta[k]=m.values[k]});can();if(m.words)Object.keys(m.words).forEach(function(k){W[k]=String(m.words[k])});var first=!inited;inited=true;stand();if(first){ready(ta);emit('ready',[ta])}else{emit('players',[ta.players])}}
@@ -83,7 +84,9 @@ window.ta=ta;post({type:'hello'});
83
84
  const zoom = kind === 'game' ? ', user-scalable=no' : '';
84
85
  // In a script: `</` of the spec's JSON would end it.
85
86
  const given = JSON.stringify(spec).replace(/</g, '\\u003c');
86
- return `<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${WorkDocs.CSP}"><meta name="viewport" content="width=device-width, initial-scale=1${zoom}"><style>${STYLE[kind]}</style><script>(${BRIDGE})(${given});</script></head>${html}`;
87
+ // A game is tried by its own rules (WorkGates.FRAME) when the page tries it, before anyone plays it.
88
+ const check = kind === 'game' ? '<script>' + WorkGates.FRAME + '</script>' : '';
89
+ return `<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${WorkDocs.CSP}"><meta name="viewport" content="width=device-width, initial-scale=1${zoom}"><style>${STYLE[kind]}</style><script>(${BRIDGE})(${given});</script>${check}</head>${html}`;
87
90
  }
88
91
  WorkDocs.document = document;
89
92
  })(WorkDocs || (WorkDocs = {}));
@@ -2,6 +2,7 @@ import { TaWorkPoint, type TaWorkSenseName } from '@celljs/ta-protocol';
2
2
  import * as React from 'react';
3
3
  import { type WorkHost } from './work-api.js';
4
4
  import { WorkDocs } from './work-docs.js';
5
+ import type { WorkGates } from './work-gates.js';
5
6
  import type { WorkSenses } from './work-senses.js';
6
7
  /** What a work did as it was played alone for a moment, tapped here and there (WorkFrameProps.probe). */
7
8
  export interface WorkProbe {
@@ -9,6 +10,8 @@ export interface WorkProbe {
9
10
  errors: string[];
10
11
  /** Nothing shows: no text, no picture, no canvas, no box with a colour. */
11
12
  blank: boolean;
13
+ /** For a game: what its own rules said of it (WorkGates; docs/design/ta-game-gates.md), `none` for one without. */
14
+ verdict?: WorkGates.Report;
12
15
  }
13
16
  export interface WorkFrameProps {
14
17
  /** The work's document, as written. */
@@ -2,6 +2,12 @@ import { TaWorkPoint } from '@celljs/ta-protocol';
2
2
  import * as React from 'react';
3
3
  import { WORK_API, WorkCheck, WorkLimits, WorkRate } from './work-api.js';
4
4
  import { WorkDocs } from './work-docs.js';
5
+ /** The verdict a game's frame posts (WorkGates.Report), as far as the page trusts it: of its own from the frame, only the fields. */
6
+ function isVerdict(value) {
7
+ const report = value;
8
+ const levels = ['pass', 'easy', 'hard', 'unwinnable', 'broken', 'none'];
9
+ return !!report && typeof report === 'object' && typeof report.level === 'string' && levels.includes(report.level) && typeof report.line === 'string';
10
+ }
5
11
  /** Errors of a page that are no fault of the work's. */
6
12
  const HARMLESS = /ResizeObserver loop/i;
7
13
  /**
@@ -39,12 +45,12 @@ export function WorkFrame({ html, title, host, kind = 'game', className, style,
39
45
  let load = 0;
40
46
  // Tried (probe): its errors until it answers, then told once.
41
47
  const trying = probed.current ? { errors: [], timer: undefined, told: false } : undefined;
42
- const tell = (blank) => {
48
+ const tell = (blank, verdict) => {
43
49
  var _a;
44
50
  if (trying && !trying.told) {
45
51
  trying.told = true;
46
52
  clearTimeout(trying.timer);
47
- (_a = probed.current) === null || _a === void 0 ? void 0 : _a.call(probed, { errors: [...new Set(trying.errors)].slice(0, 5), blank });
53
+ (_a = probed.current) === null || _a === void 0 ? void 0 : _a.call(probed, { errors: [...new Set(trying.errors)].slice(0, 5), blank, ...(isVerdict(verdict) ? { verdict } : {}) });
48
54
  }
49
55
  };
50
56
  const failed = (message) => {
@@ -123,7 +129,7 @@ export function WorkFrame({ html, title, host, kind = 'game', className, style,
123
129
  failed(String((_c = message.message) !== null && _c !== void 0 ? _c : '').slice(0, WorkLimits.ERROR));
124
130
  }
125
131
  else if (message.type === 'probed') {
126
- tell(message.blank === true);
132
+ tell(message.blank === true, message.verdict);
127
133
  }
128
134
  else if (message.type === 'ask') {
129
135
  const id = typeof message.id === 'number' ? message.id : undefined;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * How a game says what it is, so that it can be tried before anyone plays it (docs/design/ta-game-gates.md): the six
3
+ * shells, the moves of a state, and the end of a round. One contract, tried in the frame of a game of a reply (WorkDocs,
4
+ * below) and of one of the page (ta-games): the logic is ES5 and self-contained, so that it runs inside the frame too.
5
+ */
6
+ export declare namespace WorkGates {
7
+ /** The six shells a game is one of: what it is about, which is also how it is tried. */
8
+ type Shell = 'guess' | 'action' | 'puzzle' | 'runner' | 'board' | 'quiz';
9
+ /** How a round ends. */
10
+ type End = 'win' | 'lose' | 'draw';
11
+ /** What a contract says of itself, for the card and for Ta's next attempt. */
12
+ interface Meta {
13
+ shell: Shell;
14
+ /** The game's name, a few words. */
15
+ name: string;
16
+ /** What the player goes for, one line: "get 100 points before the timer runs out". */
17
+ goal?: string;
18
+ /** Played by turns (board, quiz): how many move, then they take turns in that order. */
19
+ turn?: number;
20
+ }
21
+ /**
22
+ * The rules of a game, apart from what draws it: the state, the moves there are, the state each makes, and how the
23
+ * round ended. Randomness comes from \`start\` alone (the seed it is given) and never from the rest, so that the same
24
+ * seed plays the same round again: a game can be tried, replayed and balanced without being seen.
25
+ */
26
+ interface Logic<S = unknown, A = unknown> {
27
+ /** The state of a round of this seed (a number, or \`{ seed }\`). */
28
+ start(seed?: number): S;
29
+ /** The moves there are in this state; the first is the simplest (none while it waits for the player). */
30
+ actions(state: S): A[];
31
+ /** The state the move makes; it never changes the one given. */
32
+ step(state: S, action: A): S;
33
+ /** How the round ended, or null while it goes on; \`score\` for the card. */
34
+ over(state: S): {
35
+ status: End;
36
+ score?: number;
37
+ } | null;
38
+ /** How a player who knows the game moves (Ta plays by it); without, any move. The middle player (mid) also plays this, wrong now and then. */
39
+ bot?(state: S, random: () => number): A;
40
+ }
41
+ /** \`window.taGame\` of a game of a reply: written as the last script of its document. */
42
+ interface Spec<S = unknown, A = unknown> extends Logic<S, A> {
43
+ meta: Meta;
44
+ }
45
+ /** What trying a game said (WorkProbe.verdict): a line, and what to fix. */
46
+ interface Report {
47
+ /**
48
+ * pass: can be won, and not by chance; easy: pressing at random wins; hard: one who plays it now and then wins
49
+ * less than half the rounds; unwinnable: even its own moves never win it; broken: it throws or never ends; none: a
50
+ * game of a reply that says no rules, which still plays (the games of before, and older apps).
51
+ */
52
+ level: 'pass' | 'easy' | 'hard' | 'unwinnable' | 'broken' | 'none';
53
+ /** One line, for the user's card and Ta's next attempt. */
54
+ line: string;
55
+ /** The numbers behind it. */
56
+ data?: {
57
+ botWin: number;
58
+ midWin: number;
59
+ mashWin: number;
60
+ steps: number;
61
+ seeds: number;
62
+ };
63
+ }
64
+ /**
65
+ * Tries a game without seeing it: the same seed draws the same round, so the moves of one who knows it (bot) and the
66
+ * taps at random (mash) each play a few, and how those end say whether it can be won, and by chance; one who plays
67
+ * it well now and then (mid) says whether it can be won by a person at all.
68
+ */
69
+ function report(spec: unknown): Report;
70
+ /**
71
+ * The same test, written as the ES5 statements a game's frame runs before it is tried: they leave \`ta.check()\`
72
+ * there, one line either way (WorkGates.Report). Kept as statements, not a function, so that both a page and a frame
73
+ * run them as they are, with \`window\`, \`ta\` and \`Date\` around. One test for the games of a reply and of the
74
+ * page is why it is here, not in the frame's bridge alone (WorkDocs).
75
+ */
76
+ const FRAME: string;
77
+ }
@@ -0,0 +1,182 @@
1
+ /**
2
+ * How a game says what it is, so that it can be tried before anyone plays it (docs/design/ta-game-gates.md): the six
3
+ * shells, the moves of a state, and the end of a round. One contract, tried in the frame of a game of a reply (WorkDocs,
4
+ * below) and of one of the page (ta-games): the logic is ES5 and self-contained, so that it runs inside the frame too.
5
+ */
6
+ export var WorkGates;
7
+ (function (WorkGates) {
8
+ /** The rounds of each policy: one for each seed. */
9
+ const SEEDS = [7, 11, 23, 42, 97];
10
+ /** The moves of a round at most: one that goes on longer never ends. */
11
+ const CAP = 2000;
12
+ function random(seed) {
13
+ let s = seed || 1;
14
+ return () => {
15
+ s = (s * 1103515245 + 12345) % 2147483648;
16
+ return s / 2147483648;
17
+ };
18
+ }
19
+ function ended(end) {
20
+ return (end === null || end === void 0 ? void 0 : end.status) === 'win' || (end === null || end === void 0 ? void 0 : end.status) === 'lose' || (end === null || end === void 0 ? void 0 : end.status) === 'draw';
21
+ }
22
+ function message(error) {
23
+ var _a;
24
+ return String((_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error);
25
+ }
26
+ /** Why it cannot be tried, a line; null for one that can. */
27
+ function missing(spec) {
28
+ const given = spec;
29
+ if (!given || typeof given !== 'object') {
30
+ return 'no rules (window.taGame): it can only be tapped, never tried';
31
+ }
32
+ if (!given.meta || typeof given.meta !== 'object') {
33
+ return 'window.taGame has no meta: which shell it is, its name, what the player goes for';
34
+ }
35
+ if (typeof given.meta.shell !== 'string' || !given.meta.shell) {
36
+ return 'window.taGame.meta has no shell (guess, action, puzzle, runner, board, quiz)';
37
+ }
38
+ for (const name of ['start', 'actions', 'step', 'over']) {
39
+ if (typeof given[name] !== 'function') {
40
+ return 'window.taGame lacks ' + name + '()';
41
+ }
42
+ }
43
+ return null;
44
+ }
45
+ /** One round played by a policy: its end, or why it could not be played. */
46
+ function play(spec, seed, policy) {
47
+ let state;
48
+ try {
49
+ state = spec.start.call(null, seed);
50
+ }
51
+ catch (error) {
52
+ return { steps: 0, bad: 'start() failed: ' + message(error) };
53
+ }
54
+ const roll = random(seed);
55
+ for (let step = 0; step < CAP; step++) {
56
+ let end;
57
+ try {
58
+ end = spec.over.call(null, state);
59
+ }
60
+ catch (error) {
61
+ return { steps: step, bad: 'over() failed: ' + message(error) };
62
+ }
63
+ if (ended(end)) {
64
+ return { end: end, steps: step };
65
+ }
66
+ let action;
67
+ try {
68
+ const moves = spec.actions.call(null, state);
69
+ const any = Array.isArray(moves) && moves.length ? moves[Math.floor(roll() * moves.length)] : undefined;
70
+ const knows = policy !== 'mash' && typeof spec.bot === 'function';
71
+ // The middle player plays as one who knows it, but slips once in three: most who play it well do not play it well.
72
+ action = knows && (policy === 'bot' || roll() > 0.3) ? spec.bot.call(null, state, roll) : any;
73
+ }
74
+ catch (error) {
75
+ return { steps: step, bad: 'choosing a move failed: ' + message(error) };
76
+ }
77
+ if (action === undefined || action === null) {
78
+ return { steps: step, bad: 'there is no move at step ' + step + ', and the round goes on' };
79
+ }
80
+ try {
81
+ state = spec.step.call(null, state, action);
82
+ }
83
+ catch (error) {
84
+ return { steps: step, bad: 'step() failed: ' + message(error) };
85
+ }
86
+ }
87
+ return { steps: CAP, bad: 'it never ends: no win and no loss within ' + CAP + ' moves' };
88
+ }
89
+ /**
90
+ * Tries a game without seeing it: the same seed draws the same round, so the moves of one who knows it (bot) and the
91
+ * taps at random (mash) each play a few, and how those end say whether it can be won, and by chance; one who plays
92
+ * it well now and then (mid) says whether it can be won by a person at all.
93
+ */
94
+ function report(spec) {
95
+ var _a;
96
+ const bad = missing(spec);
97
+ if (bad) {
98
+ return { level: 'none', line: bad };
99
+ }
100
+ const game = spec;
101
+ const bots = [];
102
+ const mashed = [];
103
+ const mids = [];
104
+ for (const seed of SEEDS) {
105
+ const byBot = play(game, seed, 'bot');
106
+ if (byBot.bad) {
107
+ return { level: 'broken', line: byBot.bad };
108
+ }
109
+ bots.push({ status: byBot.end.status, steps: byBot.steps, score: byBot.end.score });
110
+ const byMid = play(game, seed, 'mid');
111
+ if (byMid.bad) {
112
+ return { level: 'broken', line: byMid.bad };
113
+ }
114
+ mids.push(byMid.end.status);
115
+ const byMash = play(game, seed, 'mash');
116
+ if (byMash.bad) {
117
+ return { level: 'broken', line: byMash.bad };
118
+ }
119
+ mashed.push(byMash.end.status);
120
+ }
121
+ const share = (ends) => ends.filter(status => status === 'win').length / ends.length;
122
+ const botWin = share(bots.map(one => one.status));
123
+ const midWin = share(mids);
124
+ const mashWin = share(mashed);
125
+ const won = bots.filter(one => one.status === 'win').map(one => one.steps);
126
+ const steps = won.length ? Math.min(...won) : 0;
127
+ const data = { botWin, midWin, mashWin, steps, seeds: SEEDS.length };
128
+ if (botWin === 0) {
129
+ return { level: 'unwinnable', line: 'a player who knows it never wins: no move leads to the win', data };
130
+ }
131
+ if (botWin < 0.5) {
132
+ return { level: 'unwinnable', line: 'a player who knows it never wins: no move leads to the win', data };
133
+ }
134
+ if (midWin < 0.5) {
135
+ return { level: 'hard', line: 'one who plays it now and then wins ' + Math.round(midWin * 100) + '% of the rounds', data };
136
+ }
137
+ if (mashWin >= 0.9) {
138
+ return { level: 'easy', line: 'pressing at random wins ' + Math.round(mashWin * 100) + '%: nothing to choose', data };
139
+ }
140
+ const score = (_a = bots.find(one => one.status === 'win' && one.score !== undefined)) === null || _a === void 0 ? void 0 : _a.score;
141
+ return { level: 'pass', line: 'won in ' + steps + ' moves' + (score === undefined ? '' : ', ' + score + ' points'), data };
142
+ }
143
+ WorkGates.report = report;
144
+ /**
145
+ * The same test, written as the ES5 statements a game's frame runs before it is tried: they leave \`ta.check()\`
146
+ * there, one line either way (WorkGates.Report). Kept as statements, not a function, so that both a page and a frame
147
+ * run them as they are, with \`window\`, \`ta\` and \`Date\` around. One test for the games of a reply and of the
148
+ * page is why it is here, not in the frame's bridge alone (WorkDocs).
149
+ */
150
+ WorkGates.FRAME = 'var SEEDS=[7,11,23,42,97],CAP=600;\n' +
151
+ 'function rnd(s){s=s||1;return function(){s=(s*1103515245+12345)%2147483648;return s/2147483648}}\n' +
152
+ 'function msg(e){return String(e&&e.message||e)}\n' +
153
+ "function over(x){return !!x&&(x.status==='win'||x.status==='lose'||x.status==='draw')}\n" +
154
+ "function missing(g){if(!g||typeof g!=='object')return 'no rules (window.taGame): it can only be tapped, never tried';\n" +
155
+ "if(!g.meta||typeof g.meta!=='object')return 'window.taGame has no meta: which shell it is, its name, what the player goes for';\n" +
156
+ "if(!g.meta.shell)return 'window.taGame.meta has no shell (guess, action, puzzle, runner, board, quiz)';\n" +
157
+ "for(var i=0,n=['start','actions','step','over'];i<n.length;i++)if(typeof g[n[i]]!=='function')return 'window.taGame lacks '+n[i]+'()';return null}\n" +
158
+ 'function play(g,seed,policy){var st,t,e,a,m,roll=rnd(seed),until=Date.now()+60;\n' +
159
+ "try{st=g.start.call(null,seed)}catch(x){return {bad:'start() failed: '+msg(x)}}\n" +
160
+ "for(t=0;t<CAP;t++){if(Date.now()>until)return {bad:'a round takes longer than a moment: step() is too slow'};try{e=g.over.call(null,st)}catch(x){return {bad:'over() failed: '+msg(x)}}\n" +
161
+ 'if(over(e))return {end:{status:e.status,score:e.score,steps:t},steps:t};\n' +
162
+ "try{m=g.actions.call(null,st);a=(policy!=='mash'&&typeof g.bot==='function'&&(policy==='bot'||roll()>0.3))?g.bot.call(null,st,roll):(m&&m.length?m[Math.floor(roll()*m.length)]:undefined)}catch(x){return {bad:'choosing a move failed: '+msg(x)}}\n" +
163
+ "if(a===undefined||a===null)return {bad:'there is no move at step '+t+', and the round goes on'};\n" +
164
+ "try{st=g.step.call(null,st,a)}catch(x){return {bad:'step() failed: '+msg(x)}}}\n" +
165
+ "return {bad:'it never ends: no win and no loss within '+CAP+' moves'}}\n" +
166
+ "function share(l){var i,n=0;for(i=0;i<l.length;i++)if(l[i]==='win')n++;return n/l.length}\n" +
167
+ 'ta.check=function(){var g=window.taGame,bad=missing(g),bots=[],mids=[],mash=[],i,r,w,mid,mw,won=[],steps,score;\n' +
168
+ "if(bad)return {level:'none',line:bad};\n" +
169
+ "for(i=0;i<SEEDS.length;i++){r=play(g,SEEDS[i],'bot');if(r.bad)return {level:'broken',line:r.bad};\n" +
170
+ "bots.push(r.end);r=play(g,SEEDS[i],'mid');if(r.bad)return {level:'broken',line:r.bad};mids.push(r.end.status);\n" +
171
+ "r=play(g,SEEDS[i],'mash');if(r.bad)return {level:'broken',line:r.bad};mash.push(r.end.status)}\n" +
172
+ 'w=share(bots.map(function(o){return o.status}));mid=share(mids);mw=share(mash);\n' +
173
+ "for(i=0;i<bots.length;i++)if(bots[i].status==='win'){won.push(bots[i].steps);if(score===undefined&&bots[i].score!==undefined)score=bots[i].score}\n" +
174
+ 'steps=won.length?Math.min.apply(null,won):0;\n' +
175
+ 'var data={botWin:w,midWin:mid,mashWin:mw,steps:steps,seeds:SEEDS.length};\n' +
176
+ "if(!w)return {level:'unwinnable',line:'a player who knows it never wins: no move leads to the win',data:data};\n" +
177
+ "if(mid<.5)return {level:'hard',line:'one who plays it now and then wins '+Math.round(mid*100)+'% of the rounds',data:data};\n" +
178
+ "if(mw>=.9)return {level:'easy',line:'pressing at random wins '+Math.round(mw*100)+'%: nothing to choose',data:data};\n" +
179
+ "return {level:'pass',line:'won in '+steps+' moves'+(score===undefined?'':', '+score+' points'),data:data}};\n" +
180
+ '';
181
+ })(WorkGates || (WorkGates = {}));
182
+ //# sourceMappingURL=work-gates.js.map
@@ -7,7 +7,7 @@ export const AGENT_SETTINGS_GROUPS = [
7
7
  {
8
8
  id: 'conversation',
9
9
  title: 'ta.settings.group.conversation',
10
- keys: ['steeringMode', 'followUpMode', 'retry.enabled', 'retry.maxRetries', 'retry.untilOnline'],
10
+ keys: ['steeringMode', 'followUpMode', 'asks.ttl', 'retry.enabled', 'retry.maxRetries', 'retry.untilOnline'],
11
11
  },
12
12
  {
13
13
  id: 'context',
@@ -4,31 +4,59 @@
4
4
  * every device; a phone has room for fewer by itself.
5
5
  */
6
6
  export interface NavigationSetting {
7
- /** The pages the user put in the navigation, the others being under Discover. */
8
- pinned: string[];
7
+ /** The pages the user put in the navigation, the others being under Discover; none while never set (DESKTOP_PINNED). */
8
+ pinned?: string[];
9
+ /** The tabs a phone has at the bottom at most, Me among them (PHONE_TABS); DEFAULT_NAVIGATION.tabs unless said. */
10
+ tabs?: number;
11
+ /** The pages of the navigation in the order the user dragged them to; the order of the pages until then. */
12
+ order?: string[];
9
13
  }
10
14
  /** Where each page went, both in the order of the pages. */
11
15
  export interface NavigationLayout<T> {
12
16
  nav: T[];
13
17
  discover: T[];
14
18
  }
19
+ /**
20
+ * The pages a desktop opens with in the navigation, the others under Discover: the ones a desktop has room for and
21
+ * its user comes back to (the tasks scheduled, the extensions, the works, the moments and the games). A phone has
22
+ * room for fewer, and starts with its own tabs alone.
23
+ */
24
+ export declare const DESKTOP_PINNED: readonly string[];
25
+ /** The tabs a phone has at the bottom unless the user chose, Me among them. */
26
+ export declare const DEFAULT_TABS = 4;
15
27
  export declare const DEFAULT_NAVIGATION: NavigationSetting;
16
28
  export declare namespace NavigationUtil {
17
- /** The tabs a phone shows at the bottom at most, as iOS and Android would have them. */
18
- const PHONE_TABS = 5;
29
+ /** How many tabs a phone may have at the bottom, Me among them: as iOS and Android would have them. */
30
+ const PHONE_TABS: readonly number[];
19
31
  /** What was kept, with the defaults for what is missing or wrong. */
20
32
  function parse(value: unknown): NavigationSetting;
33
+ /** The tabs a phone has at the bottom, Me among them, as the user chose. */
34
+ function tabs(setting?: NavigationSetting): number;
35
+ /** The pages in the navigation here, as the user put them or, never asked, as the device comes (DESKTOP_PINNED). */
36
+ function pinned(setting: NavigationSetting, handheld: boolean): readonly string[];
37
+ /** Whether the page is in the navigation in the setting itself: what pin and fold change. */
38
+ function isPinned(setting: NavigationSetting, id: string): boolean;
39
+ /** The ids as the user dragged them, then those it never moved, in the order of the pages. */
40
+ function ordered(pages: readonly {
41
+ id: string;
42
+ }[], ids: readonly string[], order?: readonly string[]): string[];
43
+ /**
44
+ * The page dropped onto the place of another in the navigation: it goes where that one was, the others making
45
+ * room. Only the pages the navigation has are ordered, as the user sees them; those under Discover keep their
46
+ * place in the list.
47
+ */
48
+ function move(setting: NavigationSetting, page: string, target: string | undefined, shown: readonly string[]): NavigationSetting;
21
49
  /**
22
50
  * Where the pages go: those the user put in the navigation there, the others under Discover, which then takes
23
- * a place. `room` bounds the entries of a device (a phone's tabs), Discover among them: the pages put in the
24
- * navigation go under Discover too past it. `own`: Discover has entries of its own (extensions started on
25
- * open), so it takes a place whatever the pages.
51
+ * a place. The room bounds the entries of a device (a phone's tabs), Discover among them: the pages put in the
52
+ * navigation go under Discover too past it. Own: Discover has entries of its own (extensions started on open),
53
+ * so it takes a place whatever the pages. Handheld: the pages the device comes with alone, until the user sets them.
26
54
  */
27
55
  function arrange<T extends {
28
56
  id: string;
29
- }>(pages: T[], setting: NavigationSetting, room?: number, own?: boolean): NavigationLayout<T>;
57
+ }>(pages: T[], setting: NavigationSetting, room?: number, own?: boolean, handheld?: boolean): NavigationLayout<T>;
30
58
  /** The page in the navigation. */
31
- function pin(setting: NavigationSetting, id: string): NavigationSetting;
59
+ function pin(setting: NavigationSetting, id: string, handheld?: boolean): NavigationSetting;
32
60
  /** The page under Discover. */
33
- function fold(setting: NavigationSetting, id: string): NavigationSetting;
61
+ function fold(setting: NavigationSetting, id: string, handheld?: boolean): NavigationSetting;
34
62
  }
@@ -1,8 +1,16 @@
1
- export const DEFAULT_NAVIGATION = { pinned: [] };
1
+ /**
2
+ * The pages a desktop opens with in the navigation, the others under Discover: the ones a desktop has room for and
3
+ * its user comes back to (the tasks scheduled, the extensions, the works, the moments and the games). A phone has
4
+ * room for fewer, and starts with its own tabs alone.
5
+ */
6
+ export const DESKTOP_PINNED = ['tasks', 'extensions', 'works', 'moments', 'games'];
7
+ /** The tabs a phone has at the bottom unless the user chose, Me among them. */
8
+ export const DEFAULT_TABS = 4;
9
+ export const DEFAULT_NAVIGATION = { tabs: DEFAULT_TABS };
2
10
  export var NavigationUtil;
3
11
  (function (NavigationUtil) {
4
- /** The tabs a phone shows at the bottom at most, as iOS and Android would have them. */
5
- NavigationUtil.PHONE_TABS = 5;
12
+ /** How many tabs a phone may have at the bottom, Me among them: as iOS and Android would have them. */
13
+ NavigationUtil.PHONE_TABS = [3, 4, 5];
6
14
  function strings(value) {
7
15
  return Array.isArray(value) ? [...new Set(value.filter((item) => typeof item === 'string'))] : [];
8
16
  }
@@ -11,32 +19,80 @@ export var NavigationUtil;
11
19
  if (!value || typeof value !== 'object' || Array.isArray(value)) {
12
20
  return DEFAULT_NAVIGATION;
13
21
  }
14
- return { pinned: strings(value.pinned) };
22
+ const kept = value;
23
+ return {
24
+ ...(Array.isArray(kept.pinned) ? { pinned: strings(kept.pinned) } : {}),
25
+ tabs: NavigationUtil.PHONE_TABS.includes(kept.tabs) ? kept.tabs : tabs(),
26
+ ...(Array.isArray(kept.order) ? { order: strings(kept.order) } : {}),
27
+ };
15
28
  }
16
29
  NavigationUtil.parse = parse;
30
+ /** The tabs a phone has at the bottom, Me among them, as the user chose. */
31
+ function tabs(setting = {}) {
32
+ var _a;
33
+ return (_a = setting.tabs) !== null && _a !== void 0 ? _a : DEFAULT_TABS;
34
+ }
35
+ NavigationUtil.tabs = tabs;
36
+ /** The pages in the navigation here, as the user put them or, never asked, as the device comes (DESKTOP_PINNED). */
37
+ function pinned(setting, handheld) {
38
+ var _a;
39
+ return (_a = setting.pinned) !== null && _a !== void 0 ? _a : (handheld ? [] : DESKTOP_PINNED);
40
+ }
41
+ NavigationUtil.pinned = pinned;
42
+ /** Whether the page is in the navigation in the setting itself: what pin and fold change. */
43
+ function isPinned(setting, id) {
44
+ var _a;
45
+ return !!((_a = setting.pinned) === null || _a === void 0 ? void 0 : _a.includes(id));
46
+ }
47
+ NavigationUtil.isPinned = isPinned;
48
+ /** The ids as the user dragged them, then those it never moved, in the order of the pages. */
49
+ function ordered(pages, ids, order = []) {
50
+ const rank = (id) => {
51
+ const at = order.indexOf(id);
52
+ return at >= 0 ? at : order.length + pages.findIndex(page => page.id === id);
53
+ };
54
+ return [...ids].sort((a, b) => rank(a) - rank(b));
55
+ }
56
+ NavigationUtil.ordered = ordered;
57
+ /**
58
+ * The page dropped onto the place of another in the navigation: it goes where that one was, the others making
59
+ * room. Only the pages the navigation has are ordered, as the user sees them; those under Discover keep their
60
+ * place in the list.
61
+ */
62
+ function move(setting, page, target, shown) {
63
+ if (page === target) {
64
+ return setting;
65
+ }
66
+ const rest = shown.filter(id => id !== page);
67
+ const at = target === undefined ? rest.length : rest.indexOf(target);
68
+ const order = [...rest.slice(0, at < 0 ? rest.length : at), page, ...rest.slice(at < 0 ? rest.length : at)];
69
+ return order.join() === shown.join() ? setting : { ...setting, order };
70
+ }
71
+ NavigationUtil.move = move;
17
72
  /**
18
73
  * Where the pages go: those the user put in the navigation there, the others under Discover, which then takes
19
- * a place. `room` bounds the entries of a device (a phone's tabs), Discover among them: the pages put in the
20
- * navigation go under Discover too past it. `own`: Discover has entries of its own (extensions started on
21
- * open), so it takes a place whatever the pages.
74
+ * a place. The room bounds the entries of a device (a phone's tabs), Discover among them: the pages put in the
75
+ * navigation go under Discover too past it. Own: Discover has entries of its own (extensions started on open),
76
+ * so it takes a place whatever the pages. Handheld: the pages the device comes with alone, until the user sets them.
22
77
  */
23
- function arrange(pages, setting, room = Number.POSITIVE_INFINITY, own = false) {
24
- const pinned = pages.filter(page => setting.pinned.includes(page.id));
25
- if (!own && pinned.length === pages.length && pages.length <= room) {
26
- return { nav: pages, discover: [] };
78
+ function arrange(pages, setting, room = Number.POSITIVE_INFINITY, own = false, handheld = false) {
79
+ const chosen = ordered(pages, pinned(setting, handheld), setting.order);
80
+ const chosenPages = chosen.flatMap(id => pages.filter(page => page.id === id));
81
+ if (!own && chosenPages.length === pages.length && pages.length <= room) {
82
+ return { nav: chosenPages, discover: [] };
27
83
  }
28
- const shown = new Set(pinned.slice(0, Math.max(0, room - 1)));
29
- return { nav: pages.filter(page => shown.has(page)), discover: pages.filter(page => !shown.has(page)) };
84
+ const shown = new Set(chosenPages.slice(0, Math.max(0, room - 1)));
85
+ return { nav: chosenPages.filter(page => shown.has(page)), discover: pages.filter(page => !shown.has(page)) };
30
86
  }
31
87
  NavigationUtil.arrange = arrange;
32
88
  /** The page in the navigation. */
33
- function pin(setting, id) {
34
- return { ...setting, pinned: [...setting.pinned.filter(other => other !== id), id] };
89
+ function pin(setting, id, handheld = false) {
90
+ return { ...setting, pinned: [...pinned(setting, handheld).filter(other => other !== id), id] };
35
91
  }
36
92
  NavigationUtil.pin = pin;
37
93
  /** The page under Discover. */
38
- function fold(setting, id) {
39
- return { ...setting, pinned: setting.pinned.filter(other => other !== id) };
94
+ function fold(setting, id, handheld = false) {
95
+ return { ...setting, pinned: pinned(setting, handheld).filter(other => other !== id) };
40
96
  }
41
97
  NavigationUtil.fold = fold;
42
98
  })(NavigationUtil || (NavigationUtil = {}));
@@ -31,8 +31,15 @@ export declare const FONT_SCALES: Record<FontSize, number>;
31
31
  * closer by, and its standard is the large of a computer.
32
32
  */
33
33
  export declare const HANDHELD_FONT_SCALE = 1.12;
34
+ /** How wide the content of a page is on a computer (a phone shows it the width of the screen): standard, wide, wider. */
35
+ export type PageWidth = 'standard' | 'wide' | 'wider';
36
+ /** The widths of each (`--ta-page-width` for rows, feeds and forms, `--ta-page-wide` for cards and tiles, see style/base.ts), in px. */
37
+ export declare const PAGE_WIDTHS: Record<PageWidth, {
38
+ page: number;
39
+ wide: number;
40
+ }>;
34
41
  /** What of the settings the page looks like with: SettingsUtil.look. */
35
- export type Look = Pick<Settings, 'theme' | 'language' | 'fontSize' | 'chatFontSize' | 'reduceMotion'>;
42
+ export type Look = Pick<Settings, 'theme' | 'language' | 'fontSize' | 'chatFontSize' | 'pageWidth' | 'reduceMotion'>;
36
43
  /** What the user chose; kept for the user, in every browser (TaState, `user`). */
37
44
  export interface Settings {
38
45
  theme: ThemeSetting;
@@ -41,6 +48,8 @@ export interface Settings {
41
48
  fontSize: FontSize;
42
49
  /** The text of conversations (messages and the message box), on top of `fontSize`. */
43
50
  chatFontSize: FontSize;
51
+ /** How wide the content of the pages (settings, Discover, those of extensions) is. */
52
+ pageWidth: PageWidth;
44
53
  /** Read the replies of ta aloud. */
45
54
  speak: boolean;
46
55
  /** Said to the double by voice (a finger held to talk), its answer is read aloud, even with `speak` off. */
@@ -100,6 +109,10 @@ export interface Settings {
100
109
  * seconds, read when the archive or a search shows them; 0, none.
101
110
  */
102
111
  chatArchiveDays: number;
112
+ /** What the tab of the browser calls this Ta (`Ta` when ''). */
113
+ tabTitle: string;
114
+ /** The tab of the browser says what waits for the user beside the messages unseen: the tasks that go on, those that ask. */
115
+ tabCounts: boolean;
103
116
  /** The screenshot just taken is offered above the message box, once (RecentShots), where Ta can read the screenshots. */
104
117
  recentShots: boolean;
105
118
  /** What a message sent while Ta works does (SendWhileWorking). */
@@ -130,6 +143,8 @@ export declare const CHAT_ARCHIVE_CHOICES: readonly number[];
130
143
  /** What `maxTasks` may be. */
131
144
  export declare const MAX_TASKS_CHOICES: readonly number[];
132
145
  export declare const DEFAULT_SETTINGS: Settings;
146
+ /** How many characters the name on the tab of the browser has at most (Settings.tabTitle). */
147
+ export declare const TAB_TITLE_CHARS = 40;
133
148
  export declare namespace SettingsUtil {
134
149
  /** What was kept, with the defaults for what is missing; undefined for what is not settings. */
135
150
  function parse(value: unknown): Settings | undefined;