@celljs/ta-web 4.34.0 → 4.36.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 (345) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/apps/app-icon.d.ts +23 -0
  4. package/esm/browser/apps/app-icon.js +98 -0
  5. package/esm/browser/apps/app-settings.d.ts +6 -0
  6. package/esm/browser/apps/app-settings.js +67 -0
  7. package/esm/browser/apps/app-window-util.d.ts +23 -0
  8. package/esm/browser/apps/app-window-util.js +27 -0
  9. package/esm/browser/apps/app-window.d.ts +9 -0
  10. package/esm/browser/apps/app-window.js +90 -0
  11. package/esm/browser/apps/web-apps.d.ts +29 -0
  12. package/esm/browser/apps/web-apps.js +57 -0
  13. package/esm/browser/assistant/assistant-thread.js +2 -2
  14. package/esm/browser/assistant/call-keeper.d.ts +2 -5
  15. package/esm/browser/assistant/call-keeper.js +7 -11
  16. package/esm/browser/assistant/mic-capture.d.ts +34 -0
  17. package/esm/browser/assistant/mic-capture.js +87 -0
  18. package/esm/browser/assistant/realtime-voice.d.ts +2 -2
  19. package/esm/browser/assistant/realtime-voice.js +6 -15
  20. package/esm/browser/components/access-settings.d.ts +6 -0
  21. package/esm/browser/components/access-settings.js +52 -0
  22. package/esm/browser/components/app-root.d.ts +6 -0
  23. package/esm/browser/components/app-root.js +34 -0
  24. package/esm/browser/components/app-view.d.ts +8 -2
  25. package/esm/browser/components/app-view.js +1 -25
  26. package/esm/browser/components/board.d.ts +2 -2
  27. package/esm/browser/components/board.js +2 -2
  28. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  29. package/esm/browser/components/composer-box-hooks.d.ts +12 -0
  30. package/esm/browser/components/composer-box-hooks.js +12 -0
  31. package/esm/browser/components/composer-box-protocol.d.ts +12 -1
  32. package/esm/browser/components/composer-box.js +14 -11
  33. package/esm/browser/components/composer.js +69 -3
  34. package/esm/browser/components/extension-settings.d.ts +7 -0
  35. package/esm/browser/components/extension-settings.js +32 -0
  36. package/esm/browser/components/host-view.d.ts +1 -1
  37. package/esm/browser/components/message-list.js +3 -3
  38. package/esm/browser/components/message-steps.js +3 -3
  39. package/esm/browser/components/phone-shell.d.ts +2 -2
  40. package/esm/browser/components/request-error.d.ts +9 -0
  41. package/esm/browser/components/request-error.js +21 -0
  42. package/esm/browser/components/settings-more.js +13 -24
  43. package/esm/browser/components/storage-settings.d.ts +17 -0
  44. package/esm/browser/components/storage-settings.js +145 -0
  45. package/esm/browser/device/screen-awake.d.ts +16 -0
  46. package/esm/browser/device/screen-awake.js +37 -0
  47. package/esm/browser/device/sheet-swipe.js +4 -0
  48. package/esm/browser/extension/icons.js +2 -1
  49. package/esm/browser/extension/web-access.d.ts +16 -0
  50. package/esm/browser/extension/web-access.js +75 -0
  51. package/esm/browser/extension/web-api-contributions.d.ts +6 -7
  52. package/esm/browser/extension/web-api-desktop.d.ts +23 -0
  53. package/esm/browser/extension/web-api-spec.d.ts +70 -0
  54. package/esm/browser/extension/web-api-spec.js +225 -0
  55. package/esm/browser/extension/web-api-targets.d.ts +11 -0
  56. package/esm/browser/extension/web-api-targets.js +2 -0
  57. package/esm/browser/extension/web-extension-api.d.ts +11 -1
  58. package/esm/browser/extension/web-extension-context.d.ts +3 -2
  59. package/esm/browser/extension/web-extension-context.js +22 -17
  60. package/esm/browser/extension/web-extension-run.d.ts +8 -1
  61. package/esm/browser/extension/web-extension-run.js +37 -0
  62. package/esm/browser/extension/web-extensions-running.d.ts +20 -1
  63. package/esm/browser/extension/web-extensions-running.js +107 -9
  64. package/esm/browser/extension/web-extensions.js +1 -0
  65. package/esm/browser/extension/web-pages.d.ts +5 -0
  66. package/esm/browser/extension/web-pages.js +3 -0
  67. package/esm/browser/game/game-control.d.ts +6 -0
  68. package/esm/browser/game/game-control.js +28 -0
  69. package/esm/browser/game/game-host.d.ts +9 -2
  70. package/esm/browser/game/game-host.js +5 -1
  71. package/esm/browser/game/game-protocol.d.ts +8 -0
  72. package/esm/browser/game/game-runner.d.ts +7 -1
  73. package/esm/browser/game/game-runner.js +24 -2
  74. package/esm/browser/game/game-target.d.ts +22 -0
  75. package/esm/browser/game/game-target.js +84 -0
  76. package/esm/browser/game/game-util.d.ts +2 -0
  77. package/esm/browser/game/game-util.js +2 -0
  78. package/esm/browser/game/game-view.d.ts +5 -2
  79. package/esm/browser/game/game-view.js +4 -4
  80. package/esm/browser/game/game3d-protocol.d.ts +3 -1
  81. package/esm/browser/game/game3d-runner.d.ts +6 -1
  82. package/esm/browser/game/game3d-runner.js +26 -2
  83. package/esm/browser/i18n/en/chat.d.ts +4 -0
  84. package/esm/browser/i18n/en/chat.js +4 -0
  85. package/esm/browser/i18n/en/common.d.ts +1 -0
  86. package/esm/browser/i18n/en/common.js +1 -0
  87. package/esm/browser/i18n/en/discover.d.ts +11 -0
  88. package/esm/browser/i18n/en/discover.js +11 -0
  89. package/esm/browser/i18n/en/settings.d.ts +43 -0
  90. package/esm/browser/i18n/en/settings.js +43 -0
  91. package/esm/browser/i18n/ja/chat.js +4 -0
  92. package/esm/browser/i18n/ja/common.js +1 -0
  93. package/esm/browser/i18n/ja/discover.js +11 -0
  94. package/esm/browser/i18n/ja/settings.js +43 -0
  95. package/esm/browser/i18n/locales.d.ts +60 -3
  96. package/esm/browser/i18n/messages.d.ts +59 -2
  97. package/esm/browser/i18n/zh/chat.js +4 -0
  98. package/esm/browser/i18n/zh/common.js +1 -0
  99. package/esm/browser/i18n/zh/discover.js +11 -0
  100. package/esm/browser/i18n/zh/settings.js +43 -0
  101. package/esm/browser/i18n/zh-tw/chat.js +4 -0
  102. package/esm/browser/i18n/zh-tw/common.js +1 -0
  103. package/esm/browser/i18n/zh-tw/discover.js +11 -0
  104. package/esm/browser/i18n/zh-tw/settings.js +43 -0
  105. package/esm/browser/index.d.ts +3 -0
  106. package/esm/browser/index.js +3 -0
  107. package/esm/browser/notices/notices.js +1 -0
  108. package/esm/browser/sandbox/channel/channel.d.ts +56 -0
  109. package/esm/browser/sandbox/channel/channel.js +124 -0
  110. package/esm/browser/sandbox/channel/codec.d.ts +80 -0
  111. package/esm/browser/sandbox/channel/codec.js +251 -0
  112. package/esm/browser/sandbox/hook-host.d.ts +23 -0
  113. package/esm/browser/sandbox/hook-host.js +61 -0
  114. package/esm/browser/sandbox/isolated-host.d.ts +105 -0
  115. package/esm/browser/sandbox/isolated-host.js +395 -0
  116. package/esm/browser/sandbox/remote/remote-copy.d.ts +57 -0
  117. package/esm/browser/sandbox/remote/remote-copy.js +318 -0
  118. package/esm/browser/sandbox/remote/remote-mirror.d.ts +61 -0
  119. package/esm/browser/sandbox/remote/remote-mirror.js +341 -0
  120. package/esm/browser/sandbox/remote/remote-protocol.d.ts +79 -0
  121. package/esm/browser/sandbox/remote/remote-protocol.js +54 -0
  122. package/esm/browser/sandbox/remote/remote-styles.d.ts +10 -0
  123. package/esm/browser/sandbox/remote/remote-styles.js +113 -0
  124. package/esm/browser/sandbox/remote-root.d.ts +11 -0
  125. package/esm/browser/sandbox/remote-root.js +81 -0
  126. package/esm/browser/sandbox/runtime/frame-api.d.ts +28 -0
  127. package/esm/browser/sandbox/runtime/frame-api.js +147 -0
  128. package/esm/browser/sandbox/runtime/frame-features.d.ts +6 -0
  129. package/esm/browser/sandbox/runtime/frame-features.js +50 -0
  130. package/esm/browser/sandbox/runtime/frame-parts.d.ts +36 -0
  131. package/esm/browser/sandbox/runtime/frame-parts.js +69 -0
  132. package/esm/browser/sandbox/runtime/frame-roots.d.ts +26 -0
  133. package/esm/browser/sandbox/runtime/frame-roots.js +76 -0
  134. package/esm/browser/sandbox/runtime/frame-store.d.ts +9 -0
  135. package/esm/browser/sandbox/runtime/frame-store.js +18 -0
  136. package/esm/browser/sandbox/runtime/sandbox-runtime.d.ts +11 -0
  137. package/esm/browser/sandbox/runtime/sandbox-runtime.js +45 -0
  138. package/esm/browser/sandbox/sandbox-features.d.ts +25 -0
  139. package/esm/browser/sandbox/sandbox-features.js +32 -0
  140. package/esm/browser/sandbox/sandbox-frame.d.ts +21 -0
  141. package/esm/browser/sandbox/sandbox-frame.js +75 -0
  142. package/esm/browser/sandbox/sandbox-guards.d.ts +19 -0
  143. package/esm/browser/sandbox/sandbox-guards.js +74 -0
  144. package/esm/browser/sandbox/sandbox-protocol.d.ts +57 -0
  145. package/esm/browser/sandbox/sandbox-protocol.js +49 -0
  146. package/esm/browser/sandbox/sandbox-runtime-code.d.ts +1 -0
  147. package/esm/browser/sandbox/sandbox-runtime-code.js +3 -0
  148. package/esm/browser/sandbox/web-sandbox.d.ts +28 -0
  149. package/esm/browser/sandbox/web-sandbox.js +44 -0
  150. package/esm/browser/settings/agent-settings.js +5 -1
  151. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  152. package/esm/browser/settings/settings-protocol.js +2 -0
  153. package/esm/browser/style/pages.d.ts +1 -1
  154. package/esm/browser/style/pages.js +2 -0
  155. package/esm/browser/style/surfaces.d.ts +1 -1
  156. package/esm/browser/style/surfaces.js +4 -0
  157. package/esm/browser/style/tints.d.ts +2 -0
  158. package/esm/browser/style/tints.js +10 -0
  159. package/esm/browser/targets/targets-protocol.d.ts +54 -0
  160. package/esm/browser/targets/targets-protocol.js +34 -0
  161. package/esm/browser/targets/targets.d.ts +13 -0
  162. package/esm/browser/targets/targets.js +64 -0
  163. package/esm/browser/util/composer.d.ts +4 -2
  164. package/esm/browser/util/composer.js +7 -1
  165. package/esm/browser/util/desktop.d.ts +31 -1
  166. package/esm/browser/util/desktop.js +20 -0
  167. package/esm/browser/util/message.d.ts +6 -0
  168. package/esm/browser/util/message.js +21 -0
  169. package/esm/browser/util/process.d.ts +1 -0
  170. package/esm/browser/util/process.js +6 -1
  171. package/esm/browser/util/progress.d.ts +2 -1
  172. package/esm/browser/util/progress.js +2 -11
  173. package/esm/browser/view.js +1 -1
  174. package/lib/browser/apps/app-icon.d.ts +24 -0
  175. package/lib/browser/apps/app-icon.js +134 -0
  176. package/lib/browser/apps/app-settings.d.ts +7 -0
  177. package/lib/browser/apps/app-settings.js +103 -0
  178. package/lib/browser/apps/app-window-util.d.ts +24 -0
  179. package/lib/browser/apps/app-window-util.js +30 -0
  180. package/lib/browser/apps/app-window.d.ts +10 -0
  181. package/lib/browser/apps/app-window.js +126 -0
  182. package/lib/browser/apps/web-apps.d.ts +30 -0
  183. package/lib/browser/apps/web-apps.js +61 -0
  184. package/lib/browser/assistant/assistant-thread.js +2 -2
  185. package/lib/browser/assistant/call-keeper.d.ts +2 -5
  186. package/lib/browser/assistant/call-keeper.js +6 -10
  187. package/lib/browser/assistant/mic-capture.d.ts +35 -0
  188. package/lib/browser/assistant/mic-capture.js +91 -0
  189. package/lib/browser/assistant/realtime-voice.d.ts +2 -2
  190. package/lib/browser/assistant/realtime-voice.js +6 -15
  191. package/lib/browser/components/access-settings.d.ts +7 -0
  192. package/lib/browser/components/access-settings.js +88 -0
  193. package/lib/browser/components/app-root.d.ts +7 -0
  194. package/lib/browser/components/app-root.js +70 -0
  195. package/lib/browser/components/app-view.d.ts +8 -2
  196. package/lib/browser/components/app-view.js +1 -25
  197. package/lib/browser/components/board.d.ts +2 -2
  198. package/lib/browser/components/board.js +2 -2
  199. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  200. package/lib/browser/components/composer-box-hooks.d.ts +12 -0
  201. package/lib/browser/components/composer-box-hooks.js +13 -0
  202. package/lib/browser/components/composer-box-protocol.d.ts +12 -1
  203. package/lib/browser/components/composer-box.js +13 -10
  204. package/lib/browser/components/composer.js +69 -3
  205. package/lib/browser/components/extension-settings.d.ts +8 -0
  206. package/lib/browser/components/extension-settings.js +69 -0
  207. package/lib/browser/components/host-view.d.ts +1 -1
  208. package/lib/browser/components/message-list.js +3 -3
  209. package/lib/browser/components/message-steps.js +3 -3
  210. package/lib/browser/components/phone-shell.d.ts +2 -2
  211. package/lib/browser/components/request-error.d.ts +10 -0
  212. package/lib/browser/components/request-error.js +57 -0
  213. package/lib/browser/components/settings-more.js +12 -23
  214. package/lib/browser/components/storage-settings.d.ts +18 -0
  215. package/lib/browser/components/storage-settings.js +182 -0
  216. package/lib/browser/device/screen-awake.d.ts +16 -0
  217. package/lib/browser/device/screen-awake.js +39 -1
  218. package/lib/browser/device/sheet-swipe.js +4 -0
  219. package/lib/browser/extension/icons.js +1 -0
  220. package/lib/browser/extension/web-access.d.ts +17 -0
  221. package/lib/browser/extension/web-access.js +78 -0
  222. package/lib/browser/extension/web-api-contributions.d.ts +6 -7
  223. package/lib/browser/extension/web-api-desktop.d.ts +23 -0
  224. package/lib/browser/extension/web-api-spec.d.ts +71 -0
  225. package/lib/browser/extension/web-api-spec.js +228 -0
  226. package/lib/browser/extension/web-api-targets.d.ts +12 -0
  227. package/lib/browser/extension/web-api-targets.js +3 -0
  228. package/lib/browser/extension/web-extension-api.d.ts +11 -1
  229. package/lib/browser/extension/web-extension-context.d.ts +3 -2
  230. package/lib/browser/extension/web-extension-context.js +22 -17
  231. package/lib/browser/extension/web-extension-run.d.ts +8 -1
  232. package/lib/browser/extension/web-extension-run.js +37 -0
  233. package/lib/browser/extension/web-extensions-running.d.ts +20 -1
  234. package/lib/browser/extension/web-extensions-running.js +107 -9
  235. package/lib/browser/extension/web-extensions.js +1 -0
  236. package/lib/browser/extension/web-pages.d.ts +5 -0
  237. package/lib/browser/extension/web-pages.js +3 -0
  238. package/lib/browser/game/game-control.d.ts +6 -0
  239. package/lib/browser/game/game-control.js +28 -0
  240. package/lib/browser/game/game-host.d.ts +9 -2
  241. package/lib/browser/game/game-host.js +5 -1
  242. package/lib/browser/game/game-protocol.d.ts +8 -0
  243. package/lib/browser/game/game-runner.d.ts +7 -1
  244. package/lib/browser/game/game-runner.js +24 -2
  245. package/lib/browser/game/game-target.d.ts +23 -0
  246. package/lib/browser/game/game-target.js +87 -0
  247. package/lib/browser/game/game-util.d.ts +2 -0
  248. package/lib/browser/game/game-util.js +2 -0
  249. package/lib/browser/game/game-view.d.ts +5 -2
  250. package/lib/browser/game/game-view.js +4 -4
  251. package/lib/browser/game/game3d-protocol.d.ts +3 -1
  252. package/lib/browser/game/game3d-runner.d.ts +6 -1
  253. package/lib/browser/game/game3d-runner.js +26 -2
  254. package/lib/browser/i18n/en/chat.d.ts +4 -0
  255. package/lib/browser/i18n/en/chat.js +4 -0
  256. package/lib/browser/i18n/en/common.d.ts +1 -0
  257. package/lib/browser/i18n/en/common.js +1 -0
  258. package/lib/browser/i18n/en/discover.d.ts +11 -0
  259. package/lib/browser/i18n/en/discover.js +11 -0
  260. package/lib/browser/i18n/en/settings.d.ts +43 -0
  261. package/lib/browser/i18n/en/settings.js +43 -0
  262. package/lib/browser/i18n/ja/chat.js +4 -0
  263. package/lib/browser/i18n/ja/common.js +1 -0
  264. package/lib/browser/i18n/ja/discover.js +11 -0
  265. package/lib/browser/i18n/ja/settings.js +43 -0
  266. package/lib/browser/i18n/locales.d.ts +60 -3
  267. package/lib/browser/i18n/messages.d.ts +59 -2
  268. package/lib/browser/i18n/zh/chat.js +4 -0
  269. package/lib/browser/i18n/zh/common.js +1 -0
  270. package/lib/browser/i18n/zh/discover.js +11 -0
  271. package/lib/browser/i18n/zh/settings.js +43 -0
  272. package/lib/browser/i18n/zh-tw/chat.js +4 -0
  273. package/lib/browser/i18n/zh-tw/common.js +1 -0
  274. package/lib/browser/i18n/zh-tw/discover.js +11 -0
  275. package/lib/browser/i18n/zh-tw/settings.js +43 -0
  276. package/lib/browser/index.d.ts +3 -0
  277. package/lib/browser/index.js +3 -0
  278. package/lib/browser/notices/notices.js +1 -0
  279. package/lib/browser/sandbox/channel/channel.d.ts +57 -0
  280. package/lib/browser/sandbox/channel/channel.js +128 -0
  281. package/lib/browser/sandbox/channel/codec.d.ts +81 -0
  282. package/lib/browser/sandbox/channel/codec.js +256 -0
  283. package/lib/browser/sandbox/hook-host.d.ts +24 -0
  284. package/lib/browser/sandbox/hook-host.js +98 -0
  285. package/lib/browser/sandbox/isolated-host.d.ts +106 -0
  286. package/lib/browser/sandbox/isolated-host.js +432 -0
  287. package/lib/browser/sandbox/remote/remote-copy.d.ts +58 -0
  288. package/lib/browser/sandbox/remote/remote-copy.js +322 -0
  289. package/lib/browser/sandbox/remote/remote-mirror.d.ts +62 -0
  290. package/lib/browser/sandbox/remote/remote-mirror.js +345 -0
  291. package/lib/browser/sandbox/remote/remote-protocol.d.ts +80 -0
  292. package/lib/browser/sandbox/remote/remote-protocol.js +57 -0
  293. package/lib/browser/sandbox/remote/remote-styles.d.ts +11 -0
  294. package/lib/browser/sandbox/remote/remote-styles.js +116 -0
  295. package/lib/browser/sandbox/remote-root.d.ts +12 -0
  296. package/lib/browser/sandbox/remote-root.js +117 -0
  297. package/lib/browser/sandbox/runtime/frame-api.d.ts +29 -0
  298. package/lib/browser/sandbox/runtime/frame-api.js +183 -0
  299. package/lib/browser/sandbox/runtime/frame-features.d.ts +7 -0
  300. package/lib/browser/sandbox/runtime/frame-features.js +53 -0
  301. package/lib/browser/sandbox/runtime/frame-parts.d.ts +37 -0
  302. package/lib/browser/sandbox/runtime/frame-parts.js +106 -0
  303. package/lib/browser/sandbox/runtime/frame-roots.d.ts +27 -0
  304. package/lib/browser/sandbox/runtime/frame-roots.js +113 -0
  305. package/lib/browser/sandbox/runtime/frame-store.d.ts +10 -0
  306. package/lib/browser/sandbox/runtime/frame-store.js +22 -0
  307. package/lib/browser/sandbox/runtime/sandbox-runtime.d.ts +12 -0
  308. package/lib/browser/sandbox/runtime/sandbox-runtime.js +47 -0
  309. package/lib/browser/sandbox/sandbox-features.d.ts +26 -0
  310. package/lib/browser/sandbox/sandbox-features.js +35 -0
  311. package/lib/browser/sandbox/sandbox-frame.d.ts +22 -0
  312. package/lib/browser/sandbox/sandbox-frame.js +79 -0
  313. package/lib/browser/sandbox/sandbox-guards.d.ts +20 -0
  314. package/lib/browser/sandbox/sandbox-guards.js +77 -0
  315. package/lib/browser/sandbox/sandbox-protocol.d.ts +58 -0
  316. package/lib/browser/sandbox/sandbox-protocol.js +52 -0
  317. package/lib/browser/sandbox/sandbox-runtime-code.d.ts +2 -0
  318. package/lib/browser/sandbox/sandbox-runtime-code.js +6 -0
  319. package/lib/browser/sandbox/web-sandbox.d.ts +29 -0
  320. package/lib/browser/sandbox/web-sandbox.js +47 -0
  321. package/lib/browser/settings/agent-settings.js +5 -1
  322. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  323. package/lib/browser/settings/settings-protocol.js +2 -0
  324. package/lib/browser/style/pages.d.ts +1 -1
  325. package/lib/browser/style/pages.js +2 -0
  326. package/lib/browser/style/surfaces.d.ts +1 -1
  327. package/lib/browser/style/surfaces.js +4 -0
  328. package/lib/browser/style/tints.d.ts +2 -0
  329. package/lib/browser/style/tints.js +10 -0
  330. package/lib/browser/targets/targets-protocol.d.ts +55 -0
  331. package/lib/browser/targets/targets-protocol.js +37 -0
  332. package/lib/browser/targets/targets.d.ts +14 -0
  333. package/lib/browser/targets/targets.js +67 -0
  334. package/lib/browser/util/composer.d.ts +4 -2
  335. package/lib/browser/util/composer.js +7 -1
  336. package/lib/browser/util/desktop.d.ts +31 -1
  337. package/lib/browser/util/desktop.js +20 -0
  338. package/lib/browser/util/message.d.ts +6 -0
  339. package/lib/browser/util/message.js +21 -0
  340. package/lib/browser/util/process.d.ts +1 -0
  341. package/lib/browser/util/process.js +6 -1
  342. package/lib/browser/util/progress.d.ts +2 -1
  343. package/lib/browser/util/progress.js +2 -11
  344. package/lib/browser/view.js +2 -2
  345. package/package.json +8 -8
@@ -0,0 +1,64 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component } from '@celljs/core';
8
+ import { TargetsUtil, TaTargets } from './targets-protocol.js';
9
+ /** The targets of the page (TaTargets), the latest registered of an id in front. */
10
+ let TaTargetsImpl = class TaTargetsImpl {
11
+ constructor() {
12
+ this.specs = [];
13
+ this.listeners = new Set();
14
+ }
15
+ register(spec) {
16
+ this.specs.push(spec);
17
+ this.changed();
18
+ return () => {
19
+ const at = this.specs.indexOf(spec);
20
+ if (at >= 0) {
21
+ this.specs.splice(at, 1);
22
+ this.changed();
23
+ }
24
+ };
25
+ }
26
+ list() {
27
+ const seen = new Set();
28
+ const list = [];
29
+ for (const spec of [...this.specs].reverse()) {
30
+ if (!seen.has(spec.id)) {
31
+ seen.add(spec.id);
32
+ list.push(TargetsUtil.info(spec));
33
+ }
34
+ }
35
+ return list.reverse();
36
+ }
37
+ get(id) {
38
+ for (let at = this.specs.length - 1; at >= 0; at--) {
39
+ if (this.specs[at].id === id) {
40
+ return this.specs[at];
41
+ }
42
+ }
43
+ return undefined;
44
+ }
45
+ async observe(id) {
46
+ const spec = this.get(id);
47
+ const t = Date.now();
48
+ return spec ? { ...(await spec.observe()), t } : undefined;
49
+ }
50
+ subscribe(listener) {
51
+ this.listeners.add(listener);
52
+ return () => this.listeners.delete(listener);
53
+ }
54
+ changed() {
55
+ for (const listener of this.listeners) {
56
+ listener();
57
+ }
58
+ }
59
+ };
60
+ TaTargetsImpl = __decorate([
61
+ Component(TaTargets)
62
+ ], TaTargetsImpl);
63
+ export { TaTargetsImpl };
64
+ //# sourceMappingURL=targets.js.map
@@ -1,9 +1,11 @@
1
1
  import { type TaSlashCommand } from '@celljs/ta-protocol';
2
2
  import type { MessageId } from '../i18n/messages.js';
3
- /** What the text at the caret asks for: a command after `/` at the start, a file after `@`. */
3
+ /** What the text at the caret asks for: a command after `/` at the start, what follows it after its space, a file after `@`. */
4
4
  export interface ComposerTrigger {
5
- kind: 'command' | 'file';
5
+ kind: 'command' | 'argument' | 'file';
6
6
  query: string;
7
+ /** For an argument: the command it follows, without its `/`. */
8
+ command?: string;
7
9
  /** Where the token starts (at `/` or `@`) and ends (the caret). */
8
10
  start: number;
9
11
  end: number;
@@ -10,6 +10,7 @@ export const MAX_IMAGE_BYTES = 5 * 1024 * 1024;
10
10
  export const MAX_IMAGES = 8;
11
11
  const FILE_TOKEN = /(^|\s)@([^\s@]*)$/;
12
12
  const COMMAND_TOKEN = /^\/(\S*)$/;
13
+ const ARGUMENT_TOKEN = /^\/(\S+) ([^\n]*)$/;
13
14
  /** The logic of the message box, apart from React: what a key does, what the caret is on, what is sent. */
14
15
  export var ComposerUtil;
15
16
  (function (ComposerUtil) {
@@ -33,13 +34,18 @@ export var ComposerUtil;
33
34
  if (file) {
34
35
  return { kind: 'file', query: file[2], start: caret - file[2].length - 1, end: caret };
35
36
  }
37
+ const argument = ARGUMENT_TOKEN.exec(before);
38
+ if (argument) {
39
+ return { kind: 'argument', command: argument[1], query: argument[2], start: caret - argument[2].length, end: caret };
40
+ }
36
41
  return undefined;
37
42
  }
38
43
  ComposerUtil.trigger = trigger;
39
44
  /** The text with the token of `trigger` replaced, and where the caret goes. */
40
45
  function replace(text, trigger, insertion) {
41
46
  const rest = text.slice(trigger.end);
42
- const inserted = rest.startsWith(' ') ? insertion : `${insertion} `;
47
+ // An argument that ends in a space (`login `) asks for the next one at once.
48
+ const inserted = rest.startsWith(' ') || /\s$/.test(insertion) ? insertion : `${insertion} `;
43
49
  return { text: text.slice(0, trigger.start) + inserted + rest, caret: trigger.start + inserted.length };
44
50
  }
45
51
  ComposerUtil.replace = replace;
@@ -3,7 +3,35 @@ export type DesktopFeature = 'webview' | 'debugWebview' | 'showItemInFolder' | '
3
3
  /** It lets the page open the window of a video call (window.open('about:blank', 'ta-video-call')). */
4
4
  | 'callWindow'
5
5
  /** It pins the window of a video call above every window, or not (callWindowPin). */
6
- | 'callWindowPin';
6
+ | 'callWindowPin'
7
+ /** It installs pages as apps of the computer, each with a window of its own (docs/design/ta-install-as-app.md). */
8
+ | 'apps';
9
+ /** A page installed as an app of the computer. */
10
+ export interface DesktopApp {
11
+ /** The id of the page, as `ui.showView` takes it. */
12
+ id: string;
13
+ name: string;
14
+ installedAt: number;
15
+ }
16
+ /** What the page sends to install a page: its name, and its icon, PNGs of 1024 and of 256 pixels (AppIcon). */
17
+ export interface DesktopAppInstall {
18
+ id: string;
19
+ name: string;
20
+ png: Uint8Array;
21
+ small: Uint8Array;
22
+ }
23
+ /** The pages installed as apps of the computer, by Ta Desktop (desktop-apps.ts of apps/ta-desktop). */
24
+ export interface DesktopApps {
25
+ list(): Promise<DesktopApp[]>;
26
+ /** `problem`: its entry of the system could not be written; the app is kept, and opens all the same. */
27
+ install(app: DesktopAppInstall): Promise<DesktopApp & {
28
+ problem?: string;
29
+ }>;
30
+ /** Its entry and icon gone, its window closed. */
31
+ remove(id: string): Promise<void>;
32
+ /** Its window in front, opened when it is not. */
33
+ open(id: string): Promise<void>;
34
+ }
7
35
  /** The file manager of the system, from Ta Desktop: {@link WebDesktop} of the extension API. */
8
36
  export interface DesktopFileManager {
9
37
  /** Node's `process.platform` of the machine: what the file manager is called there. */
@@ -88,6 +116,8 @@ export declare namespace DesktopUtil {
88
116
  * `pinned` is given; it keeps the choice for the next call. None outside Ta Desktop, nor in an older one.
89
117
  */
90
118
  function callWindowPin(scope?: object): ((pinned?: boolean) => Promise<boolean>) | undefined;
119
+ /** The pages installed as apps, where Ta Desktop installs them. */
120
+ function apps(scope?: object): DesktopApps | undefined;
91
121
  function browserData(scope?: object): DesktopBrowserData | undefined;
92
122
  /** `debugWebview` of Ta Desktop; `undefined` elsewhere. */
93
123
  function debugWebview(scope?: object): DebugWebview | undefined;
@@ -52,6 +52,26 @@ export var DesktopUtil;
52
52
  return has('callWindowPin', scope) && typeof pin === 'function' ? async (pinned) => (await pin(pinned)) === true : undefined;
53
53
  }
54
54
  DesktopUtil.callWindowPin = callWindowPin;
55
+ /** The pages installed as apps, where Ta Desktop installs them. */
56
+ function apps(scope = globalThis) {
57
+ var _a;
58
+ var _b;
59
+ const { list, install, remove, open } = (_b = (_a = scope.taDesktop) === null || _a === void 0 ? void 0 : _a.apps) !== null && _b !== void 0 ? _b : {};
60
+ if (!has('apps', scope) || typeof list !== 'function' || typeof install !== 'function' || typeof remove !== 'function' || typeof open !== 'function') {
61
+ return undefined;
62
+ }
63
+ return Object.freeze({
64
+ list: async () => { var _a; return (_a = (await list())) !== null && _a !== void 0 ? _a : []; },
65
+ install: async (app) => (await install(app)),
66
+ remove: async (id) => {
67
+ await remove(id);
68
+ },
69
+ open: async (id) => {
70
+ await open(id);
71
+ },
72
+ });
73
+ }
74
+ DesktopUtil.apps = apps;
55
75
  function browserData(scope = globalThis) {
56
76
  var _a;
57
77
  const data = (_a = scope.taDesktop) === null || _a === void 0 ? void 0 : _a.browserData;
@@ -46,6 +46,12 @@ export declare namespace MessageUtil {
46
46
  /** A call that ended because the user stopped the turn: not a failure. */
47
47
  function cancelled(output: ToolOutput | undefined): boolean;
48
48
  function stopReason(message: unknown): string | undefined;
49
+ /**
50
+ * The last message of the user while nothing came of it yet: after it only thinking, no words and no tool
51
+ * called. Stopped then, it goes back into the box to change and send again (a rewind to it, as pi's
52
+ * `/tree`); one with images does not, since the box would lose them.
53
+ */
54
+ function unanswered(messages: readonly SessionMessage[]): SessionMessage | undefined;
49
55
  function blocks(message: SessionMessage): ContentBlock[];
50
56
  function text(content: ContentBlock[] | string | undefined): string;
51
57
  /**
@@ -23,6 +23,27 @@ export var MessageUtil;
23
23
  return stopReason === 'error' && errorMessage && ABORTED.test(errorMessage.trim()) ? 'aborted' : stopReason;
24
24
  }
25
25
  MessageUtil.stopReason = stopReason;
26
+ /**
27
+ * The last message of the user while nothing came of it yet: after it only thinking, no words and no tool
28
+ * called. Stopped then, it goes back into the box to change and send again (a rewind to it, as pi's
29
+ * `/tree`); one with images does not, since the box would lose them.
30
+ */
31
+ function unanswered(messages) {
32
+ let index = messages.length - 1;
33
+ for (; index >= 0; index--) {
34
+ const { role } = messages[index];
35
+ if (role === 'user') {
36
+ break;
37
+ }
38
+ const done = role !== 'assistant' || blocks(messages[index]).some(block => { var _a; return block.type === 'toolCall' || (block.type === 'text' && !!((_a = block.text) === null || _a === void 0 ? void 0 : _a.trim())); });
39
+ if (done) {
40
+ return undefined;
41
+ }
42
+ }
43
+ const message = messages[index];
44
+ return message && !blocks(message).some(block => block.type === 'image') && text(blocks(message)).trim() ? message : undefined;
45
+ }
46
+ MessageUtil.unanswered = unanswered;
26
47
  function blocks(message) {
27
48
  const content = message.content;
28
49
  if (typeof content === 'string') {
@@ -43,6 +43,7 @@ export type ProcessStep = {
43
43
  | {
44
44
  kind: 'resumed';
45
45
  key: string;
46
+ online?: boolean;
46
47
  };
47
48
  /**
48
49
  * A thing ta did, as one line of the work: a call of a tool, with the thoughts that led to it and, for a script of
@@ -103,6 +103,11 @@ export var ProcessUtil;
103
103
  function resumed(message) {
104
104
  return message.customType === TA_RESUME_MESSAGE;
105
105
  }
106
+ /** The note that the network was back and it went on with the run the network stopped (TaNetworkResume). */
107
+ function resumedOnline(message) {
108
+ var _a;
109
+ return ((_a = message.details) === null || _a === void 0 ? void 0 : _a.reason) === 'network';
110
+ }
106
111
  /** `message`, of the user, was written before `previous`, of the agent, came: while the agent worked. */
107
112
  function writtenBefore(message, previous) {
108
113
  const { role, timestamp } = message;
@@ -123,7 +128,7 @@ export var ProcessUtil;
123
128
  steps.push({ kind: 'said', key: `${start + offset}.u`, message });
124
129
  }
125
130
  if (resumed(message)) {
126
- steps.push({ kind: 'resumed', key: `${start + offset}.r` });
131
+ steps.push({ kind: 'resumed', key: `${start + offset}.r`, ...(resumedOnline(message) ? { online: true } : {}) });
127
132
  }
128
133
  if (role !== 'assistant') {
129
134
  return;
@@ -1,4 +1,5 @@
1
1
  import type { SessionState } from '@celljs/ta-client';
2
+ import { type TaRequestErrorReason } from '@celljs/ta-protocol';
2
3
  import type { WebToolRendererResolver } from '../extension/web-extension-api.js';
3
4
  import type { Translate } from '../i18n/use-t.js';
4
5
  import { type ToolSummary } from './tool.js';
@@ -39,7 +40,7 @@ export type Phase = {
39
40
  error?: string;
40
41
  };
41
42
  /** Why pi retries, read from the error of the provider: what the loading line says before its countdown. */
42
- export type RetryReason = 'rateLimit' | 'overloaded' | 'network' | 'error';
43
+ export type RetryReason = TaRequestErrorReason;
43
44
  /** Tokens of the run of now: sent to the model (each request counts its whole context) and received from it. */
44
45
  export interface RunTokens {
45
46
  input: number;
@@ -1,3 +1,4 @@
1
+ import { TaRequestErrorUtil } from '@celljs/ta-protocol';
1
2
  import { MessageUtil } from './message.js';
2
3
  import { ToolUtil } from './tool.js';
3
4
  /** pi's estimate, for what a model has not counted yet: four characters a token. */
@@ -104,17 +105,7 @@ export var ProgressUtil;
104
105
  ProgressUtil.brief = brief;
105
106
  /** Why a request failed, as the provider said it: a rate limit, a model too busy, the network, or another error. */
106
107
  function retryReason(errorMessage) {
107
- const message = errorMessage !== null && errorMessage !== void 0 ? errorMessage : '';
108
- if (/\b429\b|rate.?limit|too many requests|quota|usage limit/i.test(message)) {
109
- return 'rateLimit';
110
- }
111
- if (/overload|\b529\b|\b503\b|capacity|unavailable/i.test(message)) {
112
- return 'overloaded';
113
- }
114
- if (/fetch failed|network|socket|ECONN|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|timed? ?out|terminated/i.test(message)) {
115
- return 'network';
116
- }
117
- return 'error';
108
+ return TaRequestErrorUtil.reason(errorMessage);
118
109
  }
119
110
  ProgressUtil.retryReason = retryReason;
120
111
  /** The seconds left of a wait of `delayMs` that began at `since`, rounded up: 0 once it is over. */
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { View } from '@celljs/react';
8
- import { AppView } from './components/app-view.js';
8
+ import { AppView } from './components/app-root.js';
9
9
  /** ta on the web: the conversations, and what the web extensions of packages add. */
10
10
  let TaAppPage = class TaAppPage {
11
11
  };
@@ -0,0 +1,24 @@
1
+ import type { WebIcon } from '../extension/web-extension-api';
2
+ /** The colours of the icon of an app, in CSS: the tile of the launcher in the light theme, a little deeper at its foot. */
3
+ export interface AppIconColors {
4
+ top: string;
5
+ bottom: string;
6
+ ink: string;
7
+ edge: string;
8
+ }
9
+ /**
10
+ * The icon of a page installed as an app (docs/design/ta-install-as-app.md): its tile of the launcher (the glyph of the
11
+ * page in its tint, TintUtil) on the grid of the icons of macOS, a rounded square of 824 in 1024 with room for its shadow,
12
+ * which reads as well in the Start menu and the menus of Linux.
13
+ */
14
+ export declare namespace AppIcon {
15
+ const SIZE = 1024;
16
+ /** The most an ICO of Windows holds. */
17
+ const SMALL = 256;
18
+ function colors(tint: number): AppIconColors;
19
+ /** The glyph in an SVG of its own, its strokes in `ink`: drawn by React in a detached element, as the page draws it. */
20
+ function svg(Glyph: WebIcon, ink: string, size: number): string | undefined;
21
+ /** The icon as a PNG of `size` pixels; `fallback` drawn when the page's own glyph draws nothing (one of a sandbox). */
22
+ function draw(Glyph: WebIcon, fallback: WebIcon, tint: number, size?: number): Promise<Uint8Array>;
23
+ }
24
+ //# sourceMappingURL=app-icon.d.ts.map
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AppIcon = void 0;
37
+ const React = __importStar(require("react"));
38
+ const react_dom_1 = require("react-dom");
39
+ const client_1 = require("react-dom/client");
40
+ const tints_1 = require("../style/tints");
41
+ /**
42
+ * The icon of a page installed as an app (docs/design/ta-install-as-app.md): its tile of the launcher (the glyph of the
43
+ * page in its tint, TintUtil) on the grid of the icons of macOS, a rounded square of 824 in 1024 with room for its shadow,
44
+ * which reads as well in the Start menu and the menus of Linux.
45
+ */
46
+ var AppIcon;
47
+ (function (AppIcon) {
48
+ AppIcon.SIZE = 1024;
49
+ /** The most an ICO of Windows holds. */
50
+ AppIcon.SMALL = 256;
51
+ /** The square and its corners, in a canvas of SIZE. */
52
+ const BODY = { at: 100, size: 824, radius: 185 };
53
+ /** How much of the square the glyph takes. */
54
+ const GLYPH = 0.5;
55
+ function colors(tint) {
56
+ const { tile, ink } = tints_1.TintUtil.tint(tints_1.TintUtil.FACES[tint % tints_1.TintUtil.FACES.length], 'light');
57
+ return {
58
+ top: tints_1.TintUtil.css({ ...tile, l: 0.985, c: tile.c * 2 }),
59
+ bottom: tints_1.TintUtil.css({ ...tile, l: 0.92, c: tile.c * 3 }),
60
+ ink: tints_1.TintUtil.css(ink),
61
+ edge: tints_1.TintUtil.css({ ...ink, l: 0.5, c: ink.c * 0.4 }),
62
+ };
63
+ }
64
+ AppIcon.colors = colors;
65
+ /** The glyph in an SVG of its own, its strokes in `ink`: drawn by React in a detached element, as the page draws it. */
66
+ function svg(Glyph, ink, size) {
67
+ const holder = document.createElement('div');
68
+ const root = (0, client_1.createRoot)(holder);
69
+ try {
70
+ (0, react_dom_1.flushSync)(() => root.render(React.createElement(Glyph, { size, strokeWidth: 1.6 })));
71
+ const drawn = holder.querySelector('svg');
72
+ if (!drawn) {
73
+ return undefined;
74
+ }
75
+ drawn.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
76
+ drawn.setAttribute('width', String(size));
77
+ drawn.setAttribute('height', String(size));
78
+ drawn.setAttribute('color', ink);
79
+ return drawn.outerHTML.replace(/currentColor/g, ink);
80
+ }
81
+ finally {
82
+ root.unmount();
83
+ }
84
+ }
85
+ AppIcon.svg = svg;
86
+ /** The icon as a PNG of `size` pixels; `fallback` drawn when the page's own glyph draws nothing (one of a sandbox). */
87
+ async function draw(Glyph, fallback, tint, size = AppIcon.SIZE) {
88
+ var _a;
89
+ const { top, bottom, ink, edge } = colors(tint);
90
+ const canvas = document.createElement('canvas');
91
+ canvas.width = size;
92
+ canvas.height = size;
93
+ const context = canvas.getContext('2d');
94
+ if (!context) {
95
+ throw new Error('This page cannot draw an icon.');
96
+ }
97
+ context.scale(size / AppIcon.SIZE, size / AppIcon.SIZE);
98
+ const { at, size: body, radius } = BODY;
99
+ context.save();
100
+ context.shadowColor = 'rgba(0, 0, 0, 0.22)';
101
+ context.shadowBlur = 28;
102
+ context.shadowOffsetY = 12;
103
+ const fill = context.createLinearGradient(0, at, 0, at + body);
104
+ fill.addColorStop(0, top);
105
+ fill.addColorStop(1, bottom);
106
+ context.fillStyle = fill;
107
+ context.beginPath();
108
+ context.roundRect(at, at, body, body, radius);
109
+ context.fill();
110
+ context.restore();
111
+ context.strokeStyle = edge;
112
+ context.globalAlpha = 0.12;
113
+ context.lineWidth = 3;
114
+ context.beginPath();
115
+ context.roundRect(at + 1.5, at + 1.5, body - 3, body - 3, radius - 1.5);
116
+ context.stroke();
117
+ context.globalAlpha = 1;
118
+ const glyph = Math.round(body * GLYPH);
119
+ const text = (_a = svg(Glyph, ink, glyph)) !== null && _a !== void 0 ? _a : svg(fallback, ink, glyph);
120
+ if (text) {
121
+ const image = new Image();
122
+ image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(text)}`;
123
+ await image.decode();
124
+ context.drawImage(image, at + (body - glyph) / 2, at + (body - glyph) / 2, glyph, glyph);
125
+ }
126
+ const blob = await new Promise(resolve => canvas.toBlob(resolve, 'image/png'));
127
+ if (!blob) {
128
+ throw new Error('This page cannot draw an icon.');
129
+ }
130
+ return new Uint8Array(await blob.arrayBuffer());
131
+ }
132
+ AppIcon.draw = draw;
133
+ })(AppIcon || (exports.AppIcon = AppIcon = {}));
134
+ //# sourceMappingURL=app-icon.js.map
@@ -0,0 +1,7 @@
1
+ import { type RowEntry } from '../components/settings-controls';
2
+ /**
3
+ * The rows of Settings, Extensions, for pages installed as apps (docs/design/ta-install-as-app.md 1): the switch of this
4
+ * device, and those installed, each to open or remove. None where Ta Desktop does not install them.
5
+ */
6
+ export declare function useAppRows(): RowEntry[];
7
+ //# sourceMappingURL=app-settings.d.ts.map
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.useAppRows = useAppRows;
37
+ const lucide_react_1 = require("lucide-react");
38
+ const React = __importStar(require("react"));
39
+ const busy_1 = require("../components/busy");
40
+ const icon_1 = require("../components/icon");
41
+ const settings_controls_1 = require("../components/settings-controls");
42
+ const hooks_1 = require("../hooks");
43
+ const use_t_1 = require("../i18n/use-t");
44
+ const desktop_1 = require("../util/desktop");
45
+ /** The pages installed as apps, read again as the window comes back (one removed from its own window meanwhile). */
46
+ function useInstalledApps() {
47
+ const desktop = React.useMemo(() => desktop_1.DesktopUtil.apps(), []);
48
+ const [apps, setApps] = React.useState([]);
49
+ const [, notices] = (0, hooks_1.useNotices)();
50
+ const read = React.useCallback(() => {
51
+ desktop === null || desktop === void 0 ? void 0 : desktop.list().then(setApps, () => undefined);
52
+ }, [desktop]);
53
+ React.useEffect(() => {
54
+ read();
55
+ window.addEventListener('focus', read);
56
+ return () => window.removeEventListener('focus', read);
57
+ }, [read]);
58
+ const remove = React.useCallback(async (id) => {
59
+ try {
60
+ await (desktop === null || desktop === void 0 ? void 0 : desktop.remove(id));
61
+ }
62
+ catch (error) {
63
+ notices.error(error);
64
+ }
65
+ read();
66
+ }, [desktop, notices, read]);
67
+ return [apps, remove];
68
+ }
69
+ /** Open of an app installed, turning while it runs. */
70
+ function OpenButton({ open }) {
71
+ const t = (0, use_t_1.useT)();
72
+ const [busy, run] = (0, busy_1.useBusy)();
73
+ return (React.createElement("button", { type: "button", className: busy ? 'ta-button ta-busy' : 'ta-button', "aria-busy": busy || undefined, onClick: () => void run(open) },
74
+ t('ta.apps.open'),
75
+ React.createElement(busy_1.BusyMark, { busy: busy })));
76
+ }
77
+ /** Remove of an app installed, turning while it runs. */
78
+ function RemoveButton({ remove }) {
79
+ const t = (0, use_t_1.useT)();
80
+ const [busy, run] = (0, busy_1.useBusy)();
81
+ return React.createElement(icon_1.IconButton, { icon: lucide_react_1.X, label: t('ta.apps.remove'), busy: busy, onClick: () => void run(remove) });
82
+ }
83
+ /**
84
+ * The rows of Settings, Extensions, for pages installed as apps (docs/design/ta-install-as-app.md 1): the switch of this
85
+ * device, and those installed, each to open or remove. None where Ta Desktop does not install them.
86
+ */
87
+ function useAppRows() {
88
+ const t = (0, use_t_1.useT)();
89
+ const [{ settings }, store] = (0, hooks_1.useSettings)();
90
+ const [apps, remove] = useInstalledApps();
91
+ const desktop = React.useMemo(() => desktop_1.DesktopUtil.apps(), []);
92
+ if (!desktop) {
93
+ return [];
94
+ }
95
+ return [
96
+ (0, settings_controls_1.row)('install-apps', [t('ta.settings.installApps'), t('ta.settings.installAppsDescription')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.installApps'), description: t('ta.settings.installAppsDescription') },
97
+ React.createElement(settings_controls_1.Switch, { label: t('ta.settings.installApps'), checked: settings.installApps, onChange: on => store.update({ installApps: on }) }))),
98
+ ...apps.map(app => (0, settings_controls_1.row)(`app:${app.id}`, [app.name, t('ta.settings.apps')], React.createElement(settings_controls_1.Row, { icon: lucide_react_1.AppWindow, label: app.name, description: t('ta.settings.apps') },
99
+ React.createElement(OpenButton, { open: () => desktop.open(app.id) }),
100
+ React.createElement(RemoveButton, { remove: () => remove(app.id) })))),
101
+ ];
102
+ }
103
+ //# sourceMappingURL=app-settings.js.map
@@ -0,0 +1,24 @@
1
+ /** What the window of an app needs to know of the page it shows, pure, for the tests. */
2
+ export declare namespace AppWindowUtil {
3
+ /** How long an extension that is starting (one in a sandbox registers its views late) may take before its page is taken for gone. */
4
+ const START_MS = 10000;
5
+ /** The page a window of Ta Desktop shows alone, installed as an app: `?app=<page id>` of its address. */
6
+ function id(search?: string): string | undefined;
7
+ /** Whether a view is the page of the app: that id, or a page of the extension the id names. */
8
+ function shows(id: string, view: string): boolean;
9
+ /** Whether the page is there to show: a page view of it, or the extension started on open it names. */
10
+ function known(id: string, views: readonly {
11
+ id: string;
12
+ location: string;
13
+ }[], onOpen: readonly {
14
+ info: {
15
+ name: string;
16
+ };
17
+ }[]): boolean;
18
+ /** Whether the extension of the page runs, its views maybe still on their way. */
19
+ function starting(id: string, extensions: readonly {
20
+ name: string;
21
+ error?: string;
22
+ }[]): boolean;
23
+ }
24
+ //# sourceMappingURL=app-window-util.d.ts.map
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppWindowUtil = void 0;
4
+ /** What the window of an app needs to know of the page it shows, pure, for the tests. */
5
+ var AppWindowUtil;
6
+ (function (AppWindowUtil) {
7
+ /** How long an extension that is starting (one in a sandbox registers its views late) may take before its page is taken for gone. */
8
+ AppWindowUtil.START_MS = 10000;
9
+ /** The page a window of Ta Desktop shows alone, installed as an app: `?app=<page id>` of its address. */
10
+ function id(search = typeof location === 'undefined' ? '' : location.search) {
11
+ return new URLSearchParams(search).get('app') || undefined;
12
+ }
13
+ AppWindowUtil.id = id;
14
+ /** Whether a view is the page of the app: that id, or a page of the extension the id names. */
15
+ function shows(id, view) {
16
+ return view === id || view.startsWith(`${id}/`);
17
+ }
18
+ AppWindowUtil.shows = shows;
19
+ /** Whether the page is there to show: a page view of it, or the extension started on open it names. */
20
+ function known(id, views, onOpen) {
21
+ return views.some(view => view.location === 'page' && shows(id, view.id)) || onOpen.some(entry => entry.info.name === id);
22
+ }
23
+ AppWindowUtil.known = known;
24
+ /** Whether the extension of the page runs, its views maybe still on their way. */
25
+ function starting(id, extensions) {
26
+ return extensions.some(extension => !extension.error && shows(extension.name, id));
27
+ }
28
+ AppWindowUtil.starting = starting;
29
+ })(AppWindowUtil || (exports.AppWindowUtil = AppWindowUtil = {}));
30
+ //# sourceMappingURL=app-window-util.js.map
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * The window of a page installed as an app (docs/design/ta-install-as-app.md 2): the web client connected as in the main
4
+ * window, with its extensions loaded, showing that page alone; the notices, dialogs and sharing of the page over it. No
5
+ * conversation, no navigation: what the page opens of those opens in the main window.
6
+ */
7
+ export declare function AppWindow({ id }: {
8
+ id: string;
9
+ }): React.JSX.Element;
10
+ //# sourceMappingURL=app-window.d.ts.map