@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,225 @@
1
+ const B = 'browser';
2
+ const A = 'app';
3
+ const page = { form: 'page', access: 'full' };
4
+ const local = (access) => ({ form: 'local', access });
5
+ const value = (access) => ({ form: 'value', access });
6
+ const read = (access) => ({ form: 'read', access });
7
+ const component = (access) => ({ form: 'component', access });
8
+ const call = (access, args) => ({ form: 'call', access, ...(args ? { args } : {}) });
9
+ const fire = (access, args) => ({ form: 'fire', access, ...(args ? { args } : {}) });
10
+ const hold = (access, args) => ({ form: 'hold', access, ...(args ? { args } : {}) });
11
+ const hook = (access, args) => ({ form: 'hook', access, ...(args ? { args } : {}) });
12
+ const peek = (access) => ({ form: 'hook', access, peek: true });
13
+ const group = (access, members) => ({ form: 'group', access, members });
14
+ /** A view, an editor tab: its components, its labels, and what the page reads of it without waiting. */
15
+ const VIEW = { fields: { title: 'L', render: 'C', head: 'C', mark: 'C', icon: 'C' }, live: ['menu', 'preview', 'busy'] };
16
+ const EDITOR = { fields: { title: 'L', tooltip: 'L', icon: 'C', render: 'C' } };
17
+ const SETTINGS = {
18
+ fields: {
19
+ title: 'L',
20
+ icon: 'C',
21
+ rows: { each: { fields: { label: 'L', search: 'L', description: 'L', render: 'C' } } },
22
+ signIn: { fields: { hint: 'L' } },
23
+ },
24
+ };
25
+ const STORAGE = {
26
+ get: call(B),
27
+ set: call(B),
28
+ onChange: hold(B),
29
+ directory: page,
30
+ };
31
+ const APPS = {
32
+ installable: value(A),
33
+ list: call(A),
34
+ install: call(A),
35
+ remove: call(A),
36
+ open: call(A),
37
+ };
38
+ const VOICE = {
39
+ canListen: read(A),
40
+ canSpeak: read(A),
41
+ speak: fire(A),
42
+ hush: fire(A),
43
+ transcribe: call(A),
44
+ };
45
+ /**
46
+ * What each member of `pi.ui` needs and how it crosses. `browser`: what any page draws and asks. `app`: what Ta does
47
+ * for the extension as an app, in sight of the user. `full`: the computer, the conversations, the people, the other
48
+ * extensions, and what only the page can give (a page object, an element, an engine).
49
+ */
50
+ export const WEB_UI_SPEC = {
51
+ confirm: call(B),
52
+ input: call(B),
53
+ editor: call(B),
54
+ theme: value(B),
55
+ language: value(B),
56
+ supportsWebview: value(B),
57
+ doubleInChats: value(B),
58
+ useDevice: peek(B),
59
+ showView: call(B),
60
+ openSettings: fire(B),
61
+ showChats: fire(B),
62
+ custom: hold(B, ['C']),
63
+ openEditor: fire(B, [EDITOR]),
64
+ closeEditor: fire(B),
65
+ pinEditor: fire(B),
66
+ setEditorDirty: fire(B),
67
+ EditorActions: component(B),
68
+ Avatar: component(B),
69
+ Face: component(B),
70
+ GroupFace: component(B),
71
+ icons: { form: 'components', access: B },
72
+ CodeEditor: component(B),
73
+ DiffEditor: component(B),
74
+ FullScreen: component(B),
75
+ Stack: component(B),
76
+ Markdown: component(B),
77
+ Empty: component(B),
78
+ Loading: component(B),
79
+ Skeleton: component(B),
80
+ useBusy: local(B),
81
+ useBackLayer: hook(B),
82
+ Switch: component(B),
83
+ HostTag: component(B),
84
+ SwipeRow: component(B),
85
+ SelectCheck: component(B),
86
+ SelectBar: component(B),
87
+ TaskIcon: component(B),
88
+ Picture: component(B),
89
+ PictureCards: component(B),
90
+ ImageViewer: component(B),
91
+ ChatImages: component(B),
92
+ QrCode: component(B),
93
+ Dialog: component(B),
94
+ setWidget: fire(A, [null, 'C', { fields: { title: 'L' } }]),
95
+ notify: fire(A),
96
+ notifySession: fire(A),
97
+ usePages: peek(A),
98
+ scanCode: call(A),
99
+ scan: call(A),
100
+ saveFile: call(A),
101
+ shareExtension: fire(A),
102
+ stopExtension: fire(A),
103
+ forgetPage: fire(A),
104
+ useView: hook(A),
105
+ useScreenPart: hook(A),
106
+ useHomeShown: peek(A),
107
+ useActiveEditor: peek(A),
108
+ HoldToTalk: component(A),
109
+ voice: group(A, VOICE),
110
+ keepAwake: hold(A),
111
+ apps: group(A, APPS),
112
+ // An element, a node to draw, an answer at once, an engine: only in the page.
113
+ useContextMenu: page,
114
+ attachMenu: page,
115
+ useChatScroll: page,
116
+ fileDrag: page,
117
+ addToComposer: page,
118
+ Game: page,
119
+ Game3D: page,
120
+ // The computer, the conversations, the people, the other extensions.
121
+ useRoomAddons: page,
122
+ fileMenu: page,
123
+ pinChat: page,
124
+ desktop: page,
125
+ debugWebview: page,
126
+ useCwd: page,
127
+ useSessionId: page,
128
+ useSessions: page,
129
+ useSavedSessions: page,
130
+ useAsks: page,
131
+ answer: page,
132
+ screen: page,
133
+ openShared: page,
134
+ connect: page,
135
+ useTasks: page,
136
+ removeTasks: page,
137
+ createTerminal: page,
138
+ Composer: page,
139
+ Conversation: page,
140
+ ShareSheet: page,
141
+ FolderPicker: page,
142
+ ModelPicker: page,
143
+ useHomeItems: page,
144
+ openHome: page,
145
+ startGroup: page,
146
+ openPartner: page,
147
+ };
148
+ /** What each member of `pi` needs and how it crosses: one entry each, the only place it is said (3.2). */
149
+ export const WEB_API_SPEC = {
150
+ React: local(B),
151
+ ui: group(B, WEB_UI_SPEC),
152
+ storage: group(B, STORAGE),
153
+ fileUrl: { form: 'call', access: B, returns: 'url' },
154
+ openLink: call(B),
155
+ registerView: fire(B, [null, VIEW]),
156
+ registerMessageRenderer: fire(B, [null, 'C']),
157
+ registerCodeRenderer: fire(A, [null, 'C', { fields: { spoken: 'X' } }]),
158
+ registerAvatar: fire(A, ['C']),
159
+ registerHomeItems: fire(A, [{ live: ['items'] }]),
160
+ registerTasks: fire(A, [{ live: ['tasks'] }]),
161
+ registerSettings: fire(A, [SETTINGS]),
162
+ reloadExtensions: call(A),
163
+ // Drawn or answered at once, frame by frame: only in the page.
164
+ registerCallPartner: page,
165
+ registerCallMouth: page,
166
+ registerCallMoves: page,
167
+ registerChatIcon: page,
168
+ registerChatTag: page,
169
+ registerInitiative: page,
170
+ registerTool: page,
171
+ registerToolRenderer: page,
172
+ registerComposerAddon: page,
173
+ registerRoomAddon: page,
174
+ registerOpener: page,
175
+ registerSearch: page,
176
+ registerPartners: page,
177
+ registerSessionMenu: page,
178
+ registerFileMenu: page,
179
+ on: page,
180
+ sendUserMessage: page,
181
+ switchSession: page,
182
+ openChat: page,
183
+ callHost: page,
184
+ openTemporary: page,
185
+ onRoomEvent: page,
186
+ onTerminalData: page,
187
+ server: page,
188
+ workspace: page,
189
+ terminals: page,
190
+ packages: page,
191
+ files: page,
192
+ remote: page,
193
+ screenShare: page,
194
+ targets: page,
195
+ onScreenShareEvent: page,
196
+ settings: page,
197
+ rooms: page,
198
+ };
199
+ /** A member of the API by its path (`ui.voice.speak`), and every member with its path. */
200
+ export var WebApiSpecUtil;
201
+ (function (WebApiSpecUtil) {
202
+ function find(path) {
203
+ let members = WEB_API_SPEC;
204
+ let found;
205
+ for (const key of path.split('.')) {
206
+ found = Object.keys(members).includes(key) ? members[key] : undefined;
207
+ if (!found) {
208
+ return undefined;
209
+ }
210
+ members = found.form === 'group' ? found.members : {};
211
+ }
212
+ return found;
213
+ }
214
+ WebApiSpecUtil.find = find;
215
+ function each(visit, members = WEB_API_SPEC, prefix = '') {
216
+ for (const [key, entry] of Object.entries(members)) {
217
+ visit(prefix + key, entry);
218
+ if (entry.form === 'group') {
219
+ each(visit, entry.members, `${prefix}${key}.`);
220
+ }
221
+ }
222
+ }
223
+ WebApiSpecUtil.each = each;
224
+ })(WebApiSpecUtil || (WebApiSpecUtil = {}));
225
+ //# sourceMappingURL=web-api-spec.js.map
@@ -0,0 +1,11 @@
1
+ /** Part of the web extension API (web-extension-api.ts, which exports it all): what a program may work on the page. */
2
+ import type { WebTargets } from '../targets/targets-protocol.js';
3
+ export type { TargetEvent, TargetSpec, WebTargets } from '../targets/targets-protocol.js';
4
+ export interface WebTargetsAPI {
5
+ /**
6
+ * What a program may work on its own clock (docs/design/ta-reflex.md): register a canvas, an editor, anything that
7
+ * says what is on it (`observe`) and takes actions (`act`), while it is there; the games of `ui.Game` and
8
+ * `ui.Game3D` are registered by the page. Newer than some Ta apps: `pi.targets?.…`.
9
+ */
10
+ readonly targets?: WebTargets;
11
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=web-api-targets.js.map
@@ -14,6 +14,7 @@ import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js
14
14
  import type { WebFileRef, WebMenus } from './web-api-menus.js';
15
15
  import type { WebServices } from './web-api-services.js';
16
16
  import type { WebPackageStorage } from './web-api-storage.js';
17
+ import type { WebTargetsAPI } from './web-api-targets.js';
17
18
  import type { WebTerminal, WebTerminalOptions } from './web-api-terminal.js';
18
19
  import type { WebPageInfo } from './web-pages.js';
19
20
  export type { Mood } from '../avatar/dino-avatar.js';
@@ -30,13 +31,14 @@ export type * from './web-api-home.js';
30
31
  export type * from './web-api-menus.js';
31
32
  export type * from './web-api-services.js';
32
33
  export type * from './web-api-storage.js';
34
+ export type * from './web-api-targets.js';
33
35
  export type * from './web-api-terminal.js';
34
36
  export type { WebPageInfo, WebPageState } from './web-pages.js';
35
37
  /**
36
38
  * What a web extension gets: the web client's side of pi's extension API, its names where they mean the same. A web
37
39
  * extension is one ES module without imports, the `web` part of a pi package (TaWebExtensionInfo): a {@link WebExtensionFactory}.
38
40
  */
39
- export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus, WebCallsAPI, WebChatTagsAPI {
41
+ export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus, WebCallsAPI, WebChatTagsAPI, WebTargetsAPI {
40
42
  /** The React of the page: an extension brings no React of its own. */
41
43
  readonly React: typeof React;
42
44
  readonly ui: WebExtensionUI;
@@ -316,6 +318,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
316
318
  * The name of an extension alone opens its first page. Resolves whether there was such a view.
317
319
  */
318
320
  showView(id: string): Promise<boolean>;
321
+ /** Opens the settings at a section of Ta's (`storage`, `navigation`) or none. Newer than some Ta apps: `pi.ui.openSettings?.(…)`. */
322
+ openSettings?(section?: string): void;
319
323
  /**
320
324
  * Shows the list of chats (on a phone its tab); with `busy`, only the conversations of the user's own going on
321
325
  * (those that wait for them, answer now, or said something unseen), until the user clears it; on a phone these are
@@ -480,6 +484,12 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
480
484
  readonly HoldToTalk: React.ComponentType<WebHoldToTalkProps>;
481
485
  /** Listening and reading aloud as the conversations of the page do: its recognizer, the voice of the settings. */
482
486
  readonly voice: WebVoice;
487
+ /**
488
+ * Keeps the device awake till the function it returns is called, as a call does: the screen does not lock (locked,
489
+ * a phone stops hearing), and Ta Desktop keeps the display on and does not restart. For what listens long (a
490
+ * meeting written down); let it go when it stops. Newer than some Ta apps: `pi.ui.keepAwake?.()`.
491
+ */
492
+ readonly keepAwake?: () => () => void;
483
493
  /** As the conversations show it; `inline`: in a line; `send`, `answer`: a group chat's, for taps in cards (newer). */
484
494
  readonly Markdown: React.ComponentType<{
485
495
  text: string;
@@ -7,6 +7,7 @@ import type { TaSessionNotices } from '../notices/session-notices.js';
7
7
  import { type TaScreen } from '../screen/screen-protocol.js';
8
8
  import type { TaSettings } from '../settings/settings-protocol.js';
9
9
  import type { TaState } from '../state/state-protocol.js';
10
+ import { type TaTargets } from '../targets/targets-protocol.js';
10
11
  import type { TaWorkbench } from '../workbench-protocol.js';
11
12
  import type { WebCodeRendererProps } from './web-api-contributions.js';
12
13
  import type { WebEditorTabs } from './web-editor-tabs.js';
@@ -29,6 +30,8 @@ export interface WebExtensionContextHost {
29
30
  readonly persisted: TaState;
30
31
  /** The parts of the screen and where the shell is (docs/design/ta-app-use.md 3). */
31
32
  readonly screen: TaScreen;
33
+ /** What programs may work on the page (docs/design/ta-reflex.md 4). */
34
+ readonly targets: TaTargets;
32
35
  /** What the extensions registered changed: the page shows it. */
33
36
  publish(): void;
34
37
  /** Runs what the extension gave, its failure logged rather than thrown. */
@@ -50,8 +53,6 @@ export declare class WebExtensionContext {
50
53
  static marked(server: TaServer, mark: (text: string) => string): TaServer;
51
54
  /** A renderer of code whose `send` (a choice tapped in it) says it came from the extension. */
52
55
  static replying(Renderer: React.ComponentType<WebCodeRendererProps>, mark: (text: string) => string): React.ComponentType<WebCodeRendererProps>;
53
- /** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
54
- static packagePath(path: string): string;
55
56
  /** Monaco and the games in the theme and language of the settings, the same component for every extension. */
56
57
  protected readonly codeEditor: (props: CodeEditorProps) => React.FunctionComponentElement<CodeEditorProps & {
57
58
  settings: TaSettings;
@@ -1,5 +1,6 @@
1
1
  import { TaMessageSource, } from '@celljs/ta-protocol';
2
2
  import * as React from 'react';
3
+ import { TaWebApps } from '../apps/web-apps.js';
3
4
  import { TaskIcon } from '../assistant/task-views.js';
4
5
  import { webVoice } from '../assistant/web-voice.js';
5
6
  import { useBusy } from '../components/busy.js';
@@ -37,15 +38,18 @@ import { useBackLayer } from '../device/back-stack.js';
37
38
  import { CodeScan } from '../device/code-scan.js';
38
39
  import { useDevice } from '../device/device.js';
39
40
  import { FileSave } from '../device/file-save.js';
41
+ import { KeepAwake } from '../device/screen-awake.js';
40
42
  import { DraftPlaces } from '../drafts/drafts-protocol.js';
41
43
  import { Game3DView, GameView } from '../game/game-view.js';
42
44
  import { message as messageOf } from '../i18n/messages.js';
43
45
  import { translator } from '../i18n/use-t.js';
44
46
  import { ScreenUtil } from '../screen/screen-protocol.js';
47
+ import { TargetsUtil } from '../targets/targets-protocol.js';
45
48
  import { DefaultWebTerminal } from '../terminal/web-terminal.js';
46
49
  import { DesktopUtil } from '../util/desktop.js';
47
50
  import { FileDragUtil } from '../util/file-drag.js';
48
51
  import { WEB_ICONS } from './icons.js';
52
+ import { WebAccessUtil } from './web-access.js';
49
53
  import { WebCwdUtil, WebLabelUtil } from './web-extension-protocol.js';
50
54
  import { WebExtensionRunUtil } from './web-extension-run.js';
51
55
  import { WebHomeUtil } from './web-home.js';
@@ -105,24 +109,13 @@ export class WebExtensionContext {
105
109
  return React.createElement(Renderer, { ...props, send: marked });
106
110
  };
107
111
  }
108
- /** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
109
- static packagePath(path) {
110
- const parts = path
111
- .replace(/\\/g, '/')
112
- .split('/')
113
- .filter(part => part !== '' && part !== '.');
114
- if (/^([a-z]:)?[\\/]/i.test(path) || parts.length === 0 || parts.includes('..')) {
115
- throw new Error(`Not a file inside the package: ${path}`);
116
- }
117
- return parts.join('/');
118
- }
119
112
  /** The games of an extension, which Ta calls by its package's title on the screen unless they are given one. */
120
113
  gamesOf(run) {
121
- const { settings, screen } = this.host;
114
+ const { settings, screen, targets } = this.host;
122
115
  const title = () => (run.loaded.info ? WebPagesUtil.title(run.loaded.info, settings.state.language) : run.loaded.name);
123
116
  return {
124
- Game: (props) => { var _a; return React.createElement(GameView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen }); },
125
- Game3D: (props) => { var _a; return React.createElement(Game3DView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen }); },
117
+ Game: (props) => { var _a; return React.createElement(GameView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen, targets }); },
118
+ Game3D: (props) => { var _a; return React.createElement(Game3DView, { ...props, title: (_a = props.title) !== null && _a !== void 0 ? _a : title(), settings, screen, targets }); },
126
119
  };
127
120
  }
128
121
  /** The message box of an extension: its drafts under its name, apart from those of the others. */
@@ -131,6 +124,7 @@ export class WebExtensionContext {
131
124
  return props => this.composer({ ...props, draft: props.draft === undefined ? undefined : DraftPlaces.extension(name, props.draft) });
132
125
  }
133
126
  create(run) {
127
+ var _a;
134
128
  const { host } = this;
135
129
  const { workbench, files } = host;
136
130
  const register = (change) => {
@@ -148,7 +142,7 @@ export class WebExtensionContext {
148
142
  let server;
149
143
  /** Listens while the extension runs, what it hears guarded as all it runs. */
150
144
  const hear = (on, listener) => WebExtensionRunUtil.track(run, () => on((...args) => host.guard(run, () => listener(...args))));
151
- return {
145
+ const api = {
152
146
  React,
153
147
  get server() {
154
148
  if ((server === null || server === void 0 ? void 0 : server.of) !== workbench.server) {
@@ -174,7 +168,7 @@ export class WebExtensionContext {
174
168
  if (!root) {
175
169
  throw new Error(`The web extension ${run.loaded.name} has no files of its own here.`);
176
170
  }
177
- return files.loadable(await workbench.workspace.fileUrl(WebExtensionContext.packagePath(path), root));
171
+ return files.loadable(await workbench.workspace.fileUrl(WebExtensionRunUtil.packagePath(path), root));
178
172
  }),
179
173
  get remote() {
180
174
  return workbench.remote;
@@ -182,6 +176,7 @@ export class WebExtensionContext {
182
176
  get screenShare() {
183
177
  return workbench.screenShare;
184
178
  },
179
+ targets: TargetsUtil.forExtension(host.targets, () => run.stopped, subscribe => WebExtensionRunUtil.track(run, subscribe)),
185
180
  onScreenShareEvent: listener => hear(workbench.onScreenShareEvent.bind(workbench), listener),
186
181
  get settings() {
187
182
  return workbench.settings;
@@ -256,6 +251,8 @@ export class WebExtensionContext {
256
251
  callHost: (method, ...params) => live(() => workbench.packages.callPackageHost(run.loaded.name, method, params)),
257
252
  reloadExtensions: () => live(() => host.extensions.reloadPackages()),
258
253
  };
254
+ // As far as the user allowed this version of its package (docs/design/ta-extension-access.md); only an allowed one starts.
255
+ return WebAccessUtil.limit(api, (_a = WebAccessUtil.granted(run.loaded.info)) !== null && _a !== void 0 ? _a : 'browser', run.loaded.name);
259
256
  }
260
257
  ui(run, register) {
261
258
  const { host } = this;
@@ -337,6 +334,11 @@ export class WebExtensionContext {
337
334
  },
338
335
  useDevice,
339
336
  showView: id => (run.stopped ? Promise.resolve(false) : host.extensions.showView(id)),
337
+ openSettings: section => {
338
+ if (!run.stopped) {
339
+ host.extensions.openSettings(section);
340
+ }
341
+ },
340
342
  showChats: options => {
341
343
  if (!run.stopped) {
342
344
  host.extensions.showChats(!!(options === null || options === void 0 ? void 0 : options.busy));
@@ -417,7 +419,10 @@ export class WebExtensionContext {
417
419
  GroupFace,
418
420
  Composer: this.composerOf(run),
419
421
  HoldToTalk: this.holdToTalk,
420
- voice: this.voice,
422
+ voice: WebExtensionRunUtil.voice(run, this.voice),
423
+ // Let go as the extension stops, whether or not it did; nothing held once stopped.
424
+ keepAwake: () => WebExtensionRunUtil.track(run, () => KeepAwake.shared.hold()),
425
+ apps: TaWebApps.of({ pages: () => host.extensions.pages(), settings, notices, fallbackIcon: WEB_ICONS.Puzzle }),
421
426
  Markdown,
422
427
  Conversation: ConversationView,
423
428
  useChatScroll: (sent, key) => useConversationScroll(sent, { sentTo: 'bottom', key }),
@@ -1,6 +1,6 @@
1
1
  import type { TaEvent } from '@celljs/ta-protocol';
2
2
  import type * as React from 'react';
3
- import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WidgetOptions } from './web-extension-api.js';
3
+ import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebComposerAddon, WebFileMenu, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api.js';
4
4
  import type { LoadedWebExtension, WebExtensionsState } from './web-extension-protocol.js';
5
5
  /** What an extension registered through its API: all of it goes when it stops. */
6
6
  export interface WebRegistrations {
@@ -58,8 +58,15 @@ export declare namespace WebExtensionRunUtil {
58
58
  function create(loaded: LoadedWebExtension, hash?: string): WebExtensionRun;
59
59
  /** Stops what it registered and subscribed to; it registers nothing more. */
60
60
  function clear(run: WebExtensionRun): void;
61
+ /** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
62
+ function packagePath(path: string): string;
61
63
  /** Subscribes for the extension: undone when it stops, or by the function returned. */
62
64
  function track(run: WebExtensionRun, subscribe: () => () => void): () => void;
65
+ /**
66
+ * `ui.voice` of one extension: what it writes down ends as it stops, and once stopped it opens no microphone, as
67
+ * `ui.scanCode` opens no camera. Reading aloud stays: it does nothing for the user.
68
+ */
69
+ function voice(run: WebExtensionRun, voice: WebVoice): WebVoice;
63
70
  /** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
64
71
  function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'sessionMenus' | 'fileMenus' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
65
72
  }
@@ -59,6 +59,18 @@ export var WebExtensionRunUtil;
59
59
  }
60
60
  }
61
61
  WebExtensionRunUtil.clear = clear;
62
+ /** A path of a file of a package, relative to it and inside it (`./models/rex.glb`, `models\rex.glb`: `models/rex.glb`). */
63
+ function packagePath(path) {
64
+ const parts = path
65
+ .replace(/\\/g, '/')
66
+ .split('/')
67
+ .filter(part => part !== '' && part !== '.');
68
+ if (/^([a-z]:)?[\\/]/i.test(path) || parts.length === 0 || parts.includes('..')) {
69
+ throw new Error(`Not a file inside the package: ${path}`);
70
+ }
71
+ return parts.join('/');
72
+ }
73
+ WebExtensionRunUtil.packagePath = packagePath;
62
74
  /** Subscribes for the extension: undone when it stops, or by the function returned. */
63
75
  function track(run, subscribe) {
64
76
  if (run.stopped) {
@@ -72,6 +84,31 @@ export var WebExtensionRunUtil;
72
84
  };
73
85
  }
74
86
  WebExtensionRunUtil.track = track;
87
+ /**
88
+ * `ui.voice` of one extension: what it writes down ends as it stops, and once stopped it opens no microphone, as
89
+ * `ui.scanCode` opens no camera. Reading aloud stays: it does nothing for the user.
90
+ */
91
+ function voice(run, voice) {
92
+ return {
93
+ ...voice,
94
+ transcribe: async (listener) => {
95
+ const transcribing = run.stopped ? undefined : await voice.transcribe(listener);
96
+ if (!transcribing || run.stopped) {
97
+ transcribing === null || transcribing === void 0 ? void 0 : transcribing.stop();
98
+ return undefined;
99
+ }
100
+ let stopped = false;
101
+ const stop = () => {
102
+ if (!stopped) {
103
+ stopped = true;
104
+ transcribing.stop();
105
+ }
106
+ };
107
+ return { service: transcribing.service, stop: track(run, () => stop) };
108
+ },
109
+ };
110
+ }
111
+ WebExtensionRunUtil.voice = voice;
75
112
  /** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
76
113
  function collect(runs, onOpen) {
77
114
  var _a;
@@ -6,6 +6,7 @@ import { TaSessionNotices } from '../notices/session-notices.js';
6
6
  import { TaScreen } from '../screen/screen-protocol.js';
7
7
  import { TaSettings } from '../settings/settings-protocol.js';
8
8
  import { TaState } from '../state/state-protocol.js';
9
+ import { TaTargets } from '../targets/targets-protocol.js';
9
10
  import { TaWorkbench } from '../workbench-protocol.js';
10
11
  import { WebEditorTabs } from './web-editor-tabs.js';
11
12
  import type { WebExtensionFactory } from './web-extension-api.js';
@@ -33,6 +34,7 @@ export declare abstract class WebExtensionsRunning {
33
34
  protected readonly persisted: TaState;
34
35
  protected readonly sessionNotices: TaSessionNotices;
35
36
  protected readonly screen: TaScreen;
37
+ protected readonly targets: TaTargets;
36
38
  readonly builtins: BuiltinWebExtension[];
37
39
  readonly tasks: WebTaskBoard;
38
40
  readonly home: WebHomeBoard;
@@ -55,6 +57,9 @@ export declare abstract class WebExtensionsRunning {
55
57
  protected placeholders?: WebViewEntry[];
56
58
  protected started?: WebOnDemand;
57
59
  protected readonly pageList: WebPageList;
60
+ /** Versions the user did not allow in this page (`<id>:<hash>`): not asked again until it loads again or they change. */
61
+ protected readonly refused: Set<string>;
62
+ protected readonly asking: Map<string, Promise<boolean>>;
58
63
  get state(): WebExtensionsState;
59
64
  protected init(): void;
60
65
  /** The extensions started on open (ta-launcher.md). */
@@ -62,7 +67,7 @@ export declare abstract class WebExtensionsRunning {
62
67
  /** The kinds the pages of the extensions there are list (TaWebExtensionInfo.lists), started or not. */
63
68
  protected listedKinds(): Set<string>;
64
69
  /** Loads and starts an extension started on open, as reconcile starts the others. */
65
- protected launch(info: TaWebExtensionInfo): Promise<void>;
70
+ protected launch(asked: TaWebExtensionInfo): Promise<void>;
66
71
  /** Stops one started on open: it is still listed, to start again; its page, if shown, gives way to the conversation. */
67
72
  protected stopOnDemand(id: string): void;
68
73
  protected reconcile(): Promise<boolean>;
@@ -73,6 +78,14 @@ export declare abstract class WebExtensionsRunning {
73
78
  * still the same and stops the others.
74
79
  */
75
80
  protected startKept(host: string | undefined): Promise<boolean>;
81
+ /** Whether what runs is that of the list: the same code, allowed as much. */
82
+ protected same(run: WebExtensionRun | undefined, info: TaWebExtensionInfo): boolean;
83
+ /**
84
+ * It as it may start: allowed already, or allowed by the user now (docs/design/ta-extension-access.md); undefined
85
+ * when they did not allow it. Asked once at a time, and not again in this page once refused.
86
+ */
87
+ protected allow(info: TaWebExtensionInfo): Promise<TaWebExtensionInfo | undefined>;
88
+ protected askAccess(info: TaWebExtensionInfo): Promise<boolean>;
76
89
  /** Stops and forgets the extensions running that `keep` does not keep; whether there were any. */
77
90
  protected stopUnless(keep: (run: WebExtensionRun) => boolean): boolean;
78
91
  protected loadPackage(info: TaWebExtensionInfo): Promise<{
@@ -81,6 +94,11 @@ export declare abstract class WebExtensionsRunning {
81
94
  } | {
82
95
  error: string;
83
96
  }>;
97
+ /**
98
+ * What starts an extension: its module, imported into the page; or, for one the user allowed less than all, its code
99
+ * to run in a sandbox, never imported here (docs/design/ta-extension-access.md 3).
100
+ */
101
+ protected factoryOf(info: TaWebExtensionInfo, code: string): Promise<WebExtensionFactory>;
84
102
  protected startPackage(info: TaWebExtensionInfo, load: {
85
103
  factory: WebExtensionFactory;
86
104
  hash: string;
@@ -92,6 +110,7 @@ export declare abstract class WebExtensionsRunning {
92
110
  protected guard(run: WebExtensionRun, action: () => void): void;
93
111
  protected publish(): void;
94
112
  protected update(change: Partial<WebExtensionsState>): void;
113
+ abstract refresh(): Promise<boolean>;
95
114
  abstract openView(id: string, preserveFocus?: boolean): void;
96
115
  abstract showView(id: string): Promise<boolean>;
97
116
  protected abstract get context(): WebExtensionContext;