@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
@@ -73,6 +73,19 @@ exports.SETTINGS_ZH = {
73
73
  'ta.settings.server': '服务',
74
74
  'ta.settings.version': '版本',
75
75
  'ta.settings.files': '配置文件',
76
+ 'ta.storage.title': '存储空间',
77
+ 'ta.storage.hint': 'Ta 在这台电脑上存的东西;超过保留天数或大小上限时,自动先删最早的。',
78
+ 'ta.storage.total': '共占用 {size}',
79
+ 'ta.storage.usage': '占用 {size}',
80
+ 'ta.storage.keep': '保留 {days} 天',
81
+ 'ta.storage.keepAll': '一直保留',
82
+ 'ta.storage.max': '最多 {size}',
83
+ 'ta.storage.maxNone': '不限大小',
84
+ 'ta.storage.keepLabel': '保留天数',
85
+ 'ta.storage.maxLabel': '大小上限',
86
+ 'ta.storage.clear': '清除',
87
+ 'ta.storage.clearConfirm': '清除“{name}”?',
88
+ 'ta.storage.freed': '已释放 {size}',
76
89
  'ta.settings.files.checking': '正在检查配置文件…',
77
90
  'ta.settings.files.ok': '{count} 个配置文件都能正常读取',
78
91
  'ta.settings.files.problems': '{count} 个文件读不了,里面的设置不会生效',
@@ -107,6 +120,22 @@ exports.SETTINGS_ZH = {
107
120
  'ta.settings.keepAliveDescription': '打开时才启动的扩展,离开后在后台保留这么久再停止,期间再打开还在原来的位置',
108
121
  'ta.settings.retention': '清除不用的临时扩展',
109
122
  'ta.settings.retentionDescription': '没有安装的扩展,这么多天没用就清除;收进“我的”的不清除',
123
+ 'ta.settings.trust': '别人分享的扩展',
124
+ 'ta.settings.trustDescription': '别人分享给你的扩展能用到哪一步:只像网页、每个版本问你,或者 Ta 的全部能力',
125
+ 'ta.settings.trust.off': '关闭',
126
+ 'ta.settings.trust.browser': '只给网页',
127
+ 'ta.settings.trust.ask': '逐版询问',
128
+ 'ta.settings.trust.all': '完全信任',
129
+ 'ta.settings.trust.offHint': '别人分享的扩展都不运行,也不再询问',
130
+ 'ta.settings.trust.browserHint': '只能用自己的页面和数据,和网页一样;申请更多的不运行',
131
+ 'ta.settings.trust.askHint': '每个扩展申请什么由你允许,更新后再问;不到完全访问的和 Ta 隔开运行',
132
+ 'ta.settings.trust.allHint': '不再询问,直接拥有 Ta 的全部能力(你的文件、对话)。只在信任分享给你的人时选',
133
+ 'ta.settings.sandbox': '在这台设备上隔离运行',
134
+ 'ta.settings.sandboxDescription': '关掉后,需要和 Ta 隔开运行的扩展在这台设备上不运行',
135
+ 'ta.settings.sandboxLocal': '保存它们的本地数据',
136
+ 'ta.settings.sandboxLocalDescription': '它们存在本地的数据跟着扩展数据保存,每个最多 1 MB',
137
+ 'ta.settings.sandboxParts': '允许使用 Ta 的组件',
138
+ 'ta.settings.sandboxPartsDescription': '关掉后只显示它们自己画的内容,没有 Ta 的文字排版、对话框和图标',
110
139
  'ta.settings.minutes': '{count} 分钟',
111
140
  'ta.settings.days': '{count} 天',
112
141
  'ta.settings.never': '从不',
@@ -211,6 +240,8 @@ exports.SETTINGS_ZH = {
211
240
  'ta.setting.retry.enabled': '失败自动重试',
212
241
  'ta.setting.retry.enabled.hint': '遇到限流或模型服务错误时。',
213
242
  'ta.setting.retry.maxRetries': '最多重试次数',
243
+ 'ta.setting.retry.untilOnline': '网络恢复后接着做',
244
+ 'ta.setting.retry.untilOnline.hint': '干到一半断网(合上屏幕、换地方、隔夜)时,连上后自动接着做。',
214
245
  'ta.setting.codemode.mode': '代码模式',
215
246
  'ta.setting.codemode.mode.hint': 'Ta 调用工具的方式:只通过脚本,还是也可以逐个直接调用。',
216
247
  'ta.setting.codemode.mode.only': '仅脚本',
@@ -238,5 +269,17 @@ exports.SETTINGS_ZH = {
238
269
  'ta.settings.cwdChange': '更改…',
239
270
  'ta.settings.cwdDescription': '新对话、终端和分身派出的任务在这里打开;已有的对话留在各自的目录:{path}',
240
271
  'ta.workingDirectory.changed': '默认目录已改为 {path}',
272
+ 'ta.settings.installApps': '可以装成应用',
273
+ 'ta.settings.installAppsDescription': '在快捷打开里长按页面,装成这台电脑上的一个应用,有自己的窗口。关掉后,已装的照样能打开',
274
+ 'ta.settings.apps': '装成的应用',
275
+ 'ta.apps.install': '装成应用',
276
+ 'ta.apps.remove': '从应用里移除',
277
+ 'ta.apps.open': '打开',
278
+ 'ta.apps.installed': '{name} 已装成应用,以后可以从电脑的应用里打开',
279
+ 'ta.apps.noEntry': '{name} 的窗口已打开,但没能放进电脑的应用里',
280
+ 'ta.apps.removed': '已从应用里移除 {name}',
281
+ 'ta.apps.off': '设置里关掉了“可以装成应用”',
282
+ 'ta.apps.gone': '这个页面已经不在了',
283
+ 'ta.apps.goneHint': '它的扩展可能已被移除或关闭。',
241
284
  };
242
285
  //# sourceMappingURL=settings.js.map
@@ -66,6 +66,9 @@ exports.CHAT_ZH_TW = {
66
66
  'ta.message.interrupted': '這一輪中途斷了:Ta 服務停止,或智慧體沒做完就結束了這一輪。',
67
67
  'ta.message.silent': '這一輪沒有回覆就結束了:智慧體可能和模型斷了連線。',
68
68
  'ta.message.failedUnknown': '請求失敗,沒有給出原因。',
69
+ 'ta.message.failed.network': '網路斷了,請求沒有發出去',
70
+ 'ta.message.failed.rateLimit': '模型服務限流了',
71
+ 'ta.message.failed.overloaded': '模型正忙',
69
72
  'ta.message.resume': '繼續',
70
73
  'ta.message.resumeText': '繼續',
71
74
  'ta.message.thinking': '思考',
@@ -99,6 +102,7 @@ exports.CHAT_ZH_TW = {
99
102
  'ta.message.used': '共消耗',
100
103
  'ta.message.modelSwitched': '已切換到 {model}',
101
104
  'ta.message.resumed': 'Ta 重啟後接著做',
105
+ 'ta.message.resumedOnline': '網路恢復後接著做',
102
106
  'ta.message.usageTitle': '傳送 {input} token,接收 {output} token',
103
107
  'ta.chats.busyFilter': '進行中',
104
108
  'ta.chats.busyClear': '顯示全部對話',
@@ -73,6 +73,7 @@ exports.COMMON_ZH_TW = {
73
73
  'ta.error.forbiddenHint': '這台 Ta 的所有者或管理員可以給你這個權限',
74
74
  'ta.error.forbiddenAsk': '申請',
75
75
  'ta.error.limit': '這台 Ta 同時在跑的協作任務已滿,請稍後再試',
76
+ 'ta.error.deviceNotWaiting': '這台裝置沒有在等待允許,可能已被允許或移除',
76
77
  'ta.error.forbiddenNever': '這裡對所有協作者都不開放',
77
78
  'ta.notices': '通知',
78
79
  'ta.notice.picture': '擴充功能給出的影像,如要掃描的QR 碼',
@@ -60,6 +60,17 @@ exports.DISCOVER_ZH_TW = {
60
60
  'ta.open.open': '開啟',
61
61
  'ta.open.notALink': '這不是擴充功能連結',
62
62
  'ta.open.failed': '沒能開啟',
63
+ 'ta.access.ask': '允許「{name}」執行?',
64
+ 'ta.access.new': '它不是你自己做的,允許後才會執行。',
65
+ 'ta.access.updated': '它更新了,新版本要你再允許一次才會執行。',
66
+ 'ta.access.full': '它申請 Ta 的全部能力:讀寫這台電腦上的檔案、執行命令、讀你的對話。只允許你信任的來源。',
67
+ 'ta.access.app': '它只申請自己的頁面,以及 Ta 的通知、小工具和語音,不申請你的檔案和對話。',
68
+ 'ta.access.browser': '它只申請自己的頁面和資料,和網頁一樣,不申請你的檔案和對話。',
69
+ 'ta.access.from': '來源:{source}。',
70
+ 'ta.access.fromLink': '別人分享的連結',
71
+ 'ta.access.fromMarket': '擴充功能市場',
72
+ 'ta.access.allow': '允許',
73
+ 'ta.access.failed': '沒能允許',
63
74
  'ta.search.pages': '頁面',
64
75
  'ta.search.all': '顯示全部 {count} 個',
65
76
  'ta.search.more': '檢視更多',
@@ -73,6 +73,19 @@ exports.SETTINGS_ZH_TW = {
73
73
  'ta.settings.server': '服務',
74
74
  'ta.settings.version': '版本',
75
75
  'ta.settings.files': '設定檔',
76
+ 'ta.storage.title': '儲存空間',
77
+ 'ta.storage.hint': 'Ta 在這台電腦上存的東西;超過保留天數或大小上限時,自動先刪最早的。',
78
+ 'ta.storage.total': '共佔用 {size}',
79
+ 'ta.storage.usage': '佔用 {size}',
80
+ 'ta.storage.keep': '保留 {days} 天',
81
+ 'ta.storage.keepAll': '一直保留',
82
+ 'ta.storage.max': '最多 {size}',
83
+ 'ta.storage.maxNone': '不限大小',
84
+ 'ta.storage.keepLabel': '保留天數',
85
+ 'ta.storage.maxLabel': '大小上限',
86
+ 'ta.storage.clear': '清除',
87
+ 'ta.storage.clearConfirm': '清除「{name}」?',
88
+ 'ta.storage.freed': '已釋放 {size}',
76
89
  'ta.settings.files.checking': '正在檢查設定檔…',
77
90
  'ta.settings.files.ok': '{count} 個設定檔都能正常讀取',
78
91
  'ta.settings.files.problems': '{count} 個檔案讀不了,裡面的設定不會生效',
@@ -107,6 +120,22 @@ exports.SETTINGS_ZH_TW = {
107
120
  'ta.settings.keepAliveDescription': '開啟時才啟動的擴充功能,離開後在後台保留這麼久再停止,期間再開啟還在原來的位置',
108
121
  'ta.settings.retention': '清除不用的臨時擴充功能',
109
122
  'ta.settings.retentionDescription': '沒有安裝的擴充功能,這麼多天沒用就清除;收進「我的」的不清除',
123
+ 'ta.settings.trust': '別人分享的擴充功能',
124
+ 'ta.settings.trustDescription': '別人分享給你的擴充功能能用到哪一步:只像網頁、每個版本問你,或者 Ta 的全部能力',
125
+ 'ta.settings.trust.off': '關閉',
126
+ 'ta.settings.trust.browser': '只給網頁',
127
+ 'ta.settings.trust.ask': '逐版詢問',
128
+ 'ta.settings.trust.all': '完全信任',
129
+ 'ta.settings.trust.offHint': '別人分享的擴充功能都不執行,也不再詢問',
130
+ 'ta.settings.trust.browserHint': '只能用自己的頁面和資料,和網頁一樣;申請更多的不執行',
131
+ 'ta.settings.trust.askHint': '每個擴充功能申請什麼由你允許,更新後再問;不到完全存取的和 Ta 隔開執行',
132
+ 'ta.settings.trust.allHint': '不再詢問,直接擁有 Ta 的全部能力(你的檔案、對話)。只在信任分享給你的人時選',
133
+ 'ta.settings.sandbox': '在這台裝置上隔離執行',
134
+ 'ta.settings.sandboxDescription': '關掉後,需要和 Ta 隔開執行的擴充功能在這台裝置上不執行',
135
+ 'ta.settings.sandboxLocal': '保存它們的本機資料',
136
+ 'ta.settings.sandboxLocalDescription': '它們存在本機的資料跟著擴充功能資料保存,每個最多 1 MB',
137
+ 'ta.settings.sandboxParts': '允許使用 Ta 的元件',
138
+ 'ta.settings.sandboxPartsDescription': '關掉後只顯示它們自己畫的內容,沒有 Ta 的文字排版、對話框和圖示',
110
139
  'ta.settings.minutes': '{count} 分鐘',
111
140
  'ta.settings.days': '{count} 天',
112
141
  'ta.settings.never': '從不',
@@ -211,6 +240,8 @@ exports.SETTINGS_ZH_TW = {
211
240
  'ta.setting.retry.enabled': '失敗自動重試',
212
241
  'ta.setting.retry.enabled.hint': '遇到限流或模型服務錯誤時。',
213
242
  'ta.setting.retry.maxRetries': '最多重試次數',
243
+ 'ta.setting.retry.untilOnline': '網路恢復後接著做',
244
+ 'ta.setting.retry.untilOnline.hint': '做到一半斷網(闔上螢幕、換地方、隔夜)時,連上後自動接著做。',
214
245
  'ta.setting.codemode.mode': '程式碼模式',
215
246
  'ta.setting.codemode.mode.hint': 'Ta 呼叫工具的方式:只通過指令碼,還是也可以逐個直接呼叫。',
216
247
  'ta.setting.codemode.mode.only': '僅指令碼',
@@ -238,5 +269,17 @@ exports.SETTINGS_ZH_TW = {
238
269
  'ta.settings.cwdChange': '更改…',
239
270
  'ta.settings.cwdDescription': '新對話、終端機和分身派出的任務在這裡開啟;已有的對話留在各自的目錄:{path}',
240
271
  'ta.workingDirectory.changed': '預設目錄已改為 {path}',
272
+ 'ta.settings.installApps': '可以裝成應用程式',
273
+ 'ta.settings.installAppsDescription': '在快捷開啟裡長按頁面,裝成這台電腦上的一個應用程式,有自己的視窗。關掉後,已裝的照樣能開啟',
274
+ 'ta.settings.apps': '裝成的應用程式',
275
+ 'ta.apps.install': '裝成應用程式',
276
+ 'ta.apps.remove': '從應用程式移除',
277
+ 'ta.apps.open': '開啟',
278
+ 'ta.apps.installed': '{name} 已裝成應用程式,以後可以從電腦的應用程式裡開啟',
279
+ 'ta.apps.noEntry': '{name} 的視窗已開啟,但沒能放進電腦的應用程式裡',
280
+ 'ta.apps.removed': '已從應用程式移除 {name}',
281
+ 'ta.apps.off': '設定裡關掉了「可以裝成應用程式」',
282
+ 'ta.apps.gone': '這個頁面已經不在了',
283
+ 'ta.apps.goneHint': '它的擴充功能可能已被移除或關閉。',
241
284
  };
242
285
  //# sourceMappingURL=settings.js.map
@@ -13,6 +13,7 @@ export * from './chat/chat-shown';
13
13
  export * from './chat/chat-util';
14
14
  export * from './chat/chat-view';
15
15
  export * from './components/account-menu';
16
+ export * from './components/app-root';
16
17
  export * from './components/app-view';
17
18
  export * from './components/callout';
18
19
  export * from './components/chat-list';
@@ -84,6 +85,8 @@ export * from './settings/settings';
84
85
  export * from './settings/settings-protocol';
85
86
  export * from './state/state';
86
87
  export * from './state/state-protocol';
88
+ export * from './targets/targets';
89
+ export * from './targets/targets-protocol';
87
90
  export * from './util/composer';
88
91
  export * from './util/diff';
89
92
  export * from './util/layout';
@@ -29,6 +29,7 @@ __exportStar(require("./chat/chat-shown"), exports);
29
29
  __exportStar(require("./chat/chat-util"), exports);
30
30
  __exportStar(require("./chat/chat-view"), exports);
31
31
  __exportStar(require("./components/account-menu"), exports);
32
+ __exportStar(require("./components/app-root"), exports);
32
33
  __exportStar(require("./components/app-view"), exports);
33
34
  __exportStar(require("./components/callout"), exports);
34
35
  __exportStar(require("./components/chat-list"), exports);
@@ -100,6 +101,8 @@ __exportStar(require("./settings/settings"), exports);
100
101
  __exportStar(require("./settings/settings-protocol"), exports);
101
102
  __exportStar(require("./state/state"), exports);
102
103
  __exportStar(require("./state/state-protocol"), exports);
104
+ __exportStar(require("./targets/targets"), exports);
105
+ __exportStar(require("./targets/targets-protocol"), exports);
103
106
  __exportStar(require("./util/composer"), exports);
104
107
  __exportStar(require("./util/diff"), exports);
105
108
  __exportStar(require("./util/layout"), exports);
@@ -76,6 +76,7 @@ var NoticesUtil;
76
76
  [ta_protocol_1.TaErrorCode.ALREADY_COMPACTED]: 'ta.error.alreadyCompacted',
77
77
  [ta_protocol_1.TaErrorCode.SESSION_BUSY]: 'ta.error.sessionBusy',
78
78
  [ta_protocol_1.TaErrorCode.LIMIT]: 'ta.error.limit',
79
+ [ta_protocol_1.TaErrorCode.DEVICE_NOT_WAITING]: 'ta.error.deviceNotWaiting',
79
80
  };
80
81
  /** What an error says: its message, and for a failure ta serve names (TaRemoteError) its hint. */
81
82
  function describe(cause) {
@@ -0,0 +1,57 @@
1
+ /** What one end of a channel sends the other (docs/design/ta-extension-access.md 3.3). */
2
+ export type ChannelMessage = {
3
+ t: 'q';
4
+ id: number;
5
+ op: string;
6
+ body: unknown;
7
+ } | {
8
+ t: 'a';
9
+ id: number;
10
+ body?: unknown;
11
+ error?: string;
12
+ } | {
13
+ t: 'x';
14
+ id: number;
15
+ } | {
16
+ t: 'n';
17
+ op: string;
18
+ body: unknown;
19
+ };
20
+ /** A MessagePort, or anything that sends and hears as one does. */
21
+ export interface ChannelPort {
22
+ postMessage(message: unknown): void;
23
+ onmessage: ((event: MessageEvent) => void) | null;
24
+ close?(): void;
25
+ }
26
+ /** Answers a request: what it returns, or resolves to, is the answer; what it throws, the error. */
27
+ export type ChannelHandler = (body: unknown, signal: AbortSignal) => unknown;
28
+ export declare namespace ChannelLimits {
29
+ /** Requests of the other end answered at once, at most: more are refused, so that a sandbox cannot flood the page. */
30
+ const RUNNING = 256;
31
+ }
32
+ /**
33
+ * One end of the channel between the page and a sandbox: requests answered by their id, cancelled with a signal,
34
+ * and notices that want no answer. It knows nothing of what the operations mean; both ends are this class.
35
+ */
36
+ export declare class Channel {
37
+ protected readonly port: ChannelPort;
38
+ protected nextId: number;
39
+ protected readonly waiting: Map<number, {
40
+ resolve(value: unknown): void;
41
+ reject(error: Error): void;
42
+ }>;
43
+ protected readonly running: Map<number, AbortController>;
44
+ protected readonly handlers: Map<string, ChannelHandler>;
45
+ protected readonly listeners: Map<string, (body: unknown) => void>;
46
+ protected closed: boolean;
47
+ constructor(port: ChannelPort);
48
+ request<T = unknown>(op: string, body?: unknown, signal?: AbortSignal): Promise<T>;
49
+ notify(op: string, body?: unknown): void;
50
+ handle(op: string, handler: ChannelHandler): void;
51
+ on(op: string, listener: (body: unknown) => void): void;
52
+ close(): void;
53
+ protected send(message: ChannelMessage): void;
54
+ protected heard(message: ChannelMessage | null): void;
55
+ protected answer(id: number, op: string, body: unknown): void;
56
+ }
57
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Channel = exports.ChannelLimits = void 0;
4
+ var ChannelLimits;
5
+ (function (ChannelLimits) {
6
+ /** Requests of the other end answered at once, at most: more are refused, so that a sandbox cannot flood the page. */
7
+ ChannelLimits.RUNNING = 256;
8
+ })(ChannelLimits || (exports.ChannelLimits = ChannelLimits = {}));
9
+ /**
10
+ * One end of the channel between the page and a sandbox: requests answered by their id, cancelled with a signal,
11
+ * and notices that want no answer. It knows nothing of what the operations mean; both ends are this class.
12
+ */
13
+ class Channel {
14
+ constructor(port) {
15
+ this.port = port;
16
+ this.nextId = 1;
17
+ this.waiting = new Map();
18
+ this.running = new Map();
19
+ this.handlers = new Map();
20
+ this.listeners = new Map();
21
+ this.closed = false;
22
+ port.onmessage = event => this.heard(event.data);
23
+ }
24
+ request(op, body, signal) {
25
+ if (this.closed) {
26
+ return Promise.reject(new Error('The channel is closed.'));
27
+ }
28
+ const id = this.nextId++;
29
+ return new Promise((resolve, reject) => {
30
+ this.waiting.set(id, { resolve: resolve, reject });
31
+ signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', () => {
32
+ if (this.waiting.delete(id)) {
33
+ this.send({ t: 'x', id });
34
+ reject(new DOMException('Cancelled.', 'AbortError'));
35
+ }
36
+ }, { once: true });
37
+ this.send({ t: 'q', id, op, body });
38
+ });
39
+ }
40
+ notify(op, body) {
41
+ if (!this.closed) {
42
+ this.send({ t: 'n', op, body });
43
+ }
44
+ }
45
+ handle(op, handler) {
46
+ this.handlers.set(op, handler);
47
+ }
48
+ on(op, listener) {
49
+ this.listeners.set(op, listener);
50
+ }
51
+ close() {
52
+ var _a, _b;
53
+ if (this.closed) {
54
+ return;
55
+ }
56
+ this.closed = true;
57
+ for (const waiting of this.waiting.values())
58
+ waiting.reject(new Error('The channel is closed.'));
59
+ this.waiting.clear();
60
+ for (const running of this.running.values())
61
+ running.abort();
62
+ this.running.clear();
63
+ this.port.onmessage = null;
64
+ (_b = (_a = this.port).close) === null || _b === void 0 ? void 0 : _b.call(_a);
65
+ }
66
+ send(message) {
67
+ try {
68
+ this.port.postMessage(message);
69
+ }
70
+ catch (error) {
71
+ // What cannot be cloned fails the request that carried it, not the channel.
72
+ if (message.t === 'q') {
73
+ const waiting = this.waiting.get(message.id);
74
+ this.waiting.delete(message.id);
75
+ waiting === null || waiting === void 0 ? void 0 : waiting.reject(error instanceof Error ? error : new Error(String(error)));
76
+ }
77
+ else if (message.t === 'a') {
78
+ this.port.postMessage({ t: 'a', id: message.id, error: error instanceof Error ? error.message : String(error) });
79
+ }
80
+ else {
81
+ console.error(error);
82
+ }
83
+ }
84
+ }
85
+ heard(message) {
86
+ var _a, _b;
87
+ if (this.closed || !message || typeof message !== 'object') {
88
+ return;
89
+ }
90
+ switch (message.t) {
91
+ case 'a': {
92
+ const waiting = this.waiting.get(message.id);
93
+ this.waiting.delete(message.id);
94
+ if (message.error !== undefined) {
95
+ waiting === null || waiting === void 0 ? void 0 : waiting.reject(new Error(String(message.error)));
96
+ }
97
+ else {
98
+ waiting === null || waiting === void 0 ? void 0 : waiting.resolve(message.body);
99
+ }
100
+ return;
101
+ }
102
+ case 'x':
103
+ (_a = this.running.get(message.id)) === null || _a === void 0 ? void 0 : _a.abort();
104
+ this.running.delete(message.id);
105
+ return;
106
+ case 'n':
107
+ (_b = this.listeners.get(String(message.op))) === null || _b === void 0 ? void 0 : _b(message.body);
108
+ return;
109
+ case 'q':
110
+ this.answer(message.id, String(message.op), message.body);
111
+ return;
112
+ }
113
+ }
114
+ answer(id, op, body) {
115
+ const handler = this.handlers.get(op);
116
+ if (!handler || this.running.size >= ChannelLimits.RUNNING) {
117
+ this.send({ t: 'a', id, error: handler ? 'Too many requests at once.' : `Nothing here answers ${op}.` });
118
+ return;
119
+ }
120
+ const controller = new AbortController();
121
+ this.running.set(id, controller);
122
+ new Promise(resolve => resolve(handler(body, controller.signal)))
123
+ .then(value => this.running.has(id) && this.send({ t: 'a', id, body: value }), error => this.running.has(id) && this.send({ t: 'a', id, error: error instanceof Error ? error.message : String(error) }))
124
+ .finally(() => this.running.delete(id));
125
+ }
126
+ }
127
+ exports.Channel = Channel;
128
+ //# sourceMappingURL=channel.js.map
@@ -0,0 +1,81 @@
1
+ import type { WebApiShape } from '../../extension/web-api-spec';
2
+ import type { Channel } from './channel';
3
+ /** The key of what stands for a function, a component, a part of Ta or a live object as it crosses. */
4
+ export declare const MARK = "#ta";
5
+ export type CodecMark = {
6
+ [MARK]: 'f';
7
+ id: number;
8
+ } | {
9
+ [MARK]: 'c';
10
+ id: number;
11
+ } | {
12
+ [MARK]: 'part';
13
+ path: string;
14
+ } | {
15
+ [MARK]: 'live';
16
+ id: number;
17
+ values: Record<string, unknown>;
18
+ rest: unknown;
19
+ };
20
+ /** What a side of the channel makes of what only it can: the components of the other's, and the parts of Ta. */
21
+ export interface CodecSide {
22
+ /** What to draw for a component of the other side (the page: a remote root of it). */
23
+ component?(id: number): unknown;
24
+ /** The part of Ta of that path (the page: the component itself, as far as access reaches). */
25
+ part?(path: string): unknown;
26
+ /** The path of a part of Ta this side stands in for (the sandbox: its stand-ins), else undefined. */
27
+ partOf?(value: unknown): string | undefined;
28
+ }
29
+ /** Handles given out together, let go together: the props of a part, the registration of a view. */
30
+ export declare class CodecScope {
31
+ protected readonly codec: Codec;
32
+ readonly ids: Set<number>;
33
+ readonly stops: (() => void)[];
34
+ constructor(codec: Codec);
35
+ release(): void;
36
+ }
37
+ /**
38
+ * Turns what crosses into what a structured clone carries, and back (docs/design/ta-extension-access.md 3.2): a
39
+ * function becomes a handle the other side calls through the channel (its result a promise), a component one the
40
+ * other side draws, a part of Ta its path, the live methods of an object a snapshot sent again as it changes. Both
41
+ * ends have one; neither knows what the values mean.
42
+ */
43
+ export declare class Codec {
44
+ protected readonly channel: Channel;
45
+ protected readonly side: CodecSide;
46
+ protected nextId: number;
47
+ protected readonly own: Map<number, {
48
+ value: unknown;
49
+ uses: number;
50
+ kind: 'f' | 'c';
51
+ }>;
52
+ protected readonly ids: WeakMap<object, number>;
53
+ protected readonly proxies: Map<number, (...args: unknown[]) => Promise<unknown>>;
54
+ protected readonly lives: Map<number, {
55
+ values: Record<string, unknown>;
56
+ listeners: Set<() => void>;
57
+ }>;
58
+ /** What lives as long as the channel: the handles of calls, whose callbacks the other side may call any time. */
59
+ readonly forever: CodecScope;
60
+ constructor(channel: Channel, side?: CodecSide);
61
+ scope(): CodecScope;
62
+ /** A component this side handed out, by its handle. */
63
+ component(id: number): unknown;
64
+ /** The arguments of a call, each by its shape. */
65
+ encodeArgs(args: readonly unknown[], shapes: readonly (WebApiShape | null)[] | undefined, scope?: CodecScope): unknown[];
66
+ encode(value: unknown, shape?: WebApiShape, scope?: CodecScope, seen?: Set<object>): unknown;
67
+ decode(value: unknown): unknown;
68
+ release(scope: CodecScope): void;
69
+ protected componentMark(value: unknown, scope: CodecScope): unknown;
70
+ protected fields(value: Record<string, unknown>, shape: WebApiShape | undefined, scope: CodecScope, seen: Set<object>, skip?: readonly string[]): Record<string, unknown>;
71
+ /** Its live methods read now and again whenever its own `subscribe` says, the rest as fields. */
72
+ protected liveMark(value: Record<string, unknown>, shape: WebApiShape & object, scope: CodecScope, seen: Set<object>): unknown;
73
+ protected live(mark: Extract<CodecMark, {
74
+ [MARK]: 'live';
75
+ }>): unknown;
76
+ protected hold(value: unknown, kind: 'f' | 'c', scope: CodecScope): number;
77
+ protected proxy(id: number): (...args: unknown[]) => Promise<unknown>;
78
+ /** What a structured clone carries as it is. */
79
+ static cloned(value: object): boolean;
80
+ }
81
+ //# sourceMappingURL=codec.d.ts.map