@celljs/ta-host 4.7.0 → 4.9.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 (466) hide show
  1. package/README.en.md +34 -4
  2. package/README.md +33 -3
  3. package/cell.schema.json +4 -0
  4. package/cell.yml +2 -0
  5. package/esm/node/auth-server-impl.d.ts +2 -0
  6. package/esm/node/auth-server-impl.js +7 -0
  7. package/esm/node/client-tool-broker.d.ts +11 -3
  8. package/esm/node/client-tool-broker.js +23 -3
  9. package/esm/node/extension-providers.d.ts +22 -0
  10. package/esm/node/extension-providers.js +52 -0
  11. package/esm/node/host-protocol.d.ts +22 -1
  12. package/esm/node/host-protocol.js +1 -0
  13. package/esm/node/index.d.ts +6 -0
  14. package/esm/node/index.js +6 -0
  15. package/esm/node/live-run.d.ts +22 -0
  16. package/esm/node/live-run.js +58 -0
  17. package/esm/node/message-page.d.ts +17 -0
  18. package/esm/node/message-page.js +71 -0
  19. package/esm/node/package-host-extension.d.ts +4 -2
  20. package/esm/node/package-host-extension.js +4 -3
  21. package/esm/node/package-hosts.d.ts +2 -2
  22. package/esm/node/package-hosts.js +2 -0
  23. package/esm/node/package-server-impl.d.ts +9 -1
  24. package/esm/node/package-server-impl.js +16 -1
  25. package/esm/node/relay-bridge.d.ts +9 -1
  26. package/esm/node/relay-bridge.js +44 -4
  27. package/esm/node/remote-ui-context.d.ts +6 -1
  28. package/esm/node/remote-ui-context.js +31 -3
  29. package/esm/node/session-catalog.d.ts +69 -0
  30. package/esm/node/session-catalog.js +211 -0
  31. package/esm/node/session-files.d.ts +18 -0
  32. package/esm/node/session-files.js +32 -0
  33. package/esm/node/session-info-util.d.ts +4 -1
  34. package/esm/node/session-info-util.js +8 -3
  35. package/esm/node/settings-server-impl.d.ts +1 -0
  36. package/esm/node/settings-server-impl.js +8 -0
  37. package/esm/node/settings-store.d.ts +3 -1
  38. package/esm/node/settings-store.js +25 -3
  39. package/esm/node/sign-in/access-server-impl.d.ts +19 -0
  40. package/esm/node/sign-in/access-server-impl.js +82 -0
  41. package/esm/node/sign-in/access-store.d.ts +65 -0
  42. package/esm/node/sign-in/access-store.js +175 -0
  43. package/esm/node/sign-in/index.d.ts +7 -0
  44. package/esm/node/sign-in/index.js +8 -0
  45. package/esm/node/sign-in/sign-in-flow.d.ts +58 -0
  46. package/esm/node/sign-in/sign-in-flow.js +104 -0
  47. package/esm/node/sign-in/sign-in-middleware.d.ts +10 -0
  48. package/esm/node/sign-in/sign-in-middleware.js +48 -0
  49. package/esm/node/sign-in/sign-in-pages.d.ts +31 -0
  50. package/esm/node/sign-in/sign-in-pages.js +118 -0
  51. package/esm/node/sign-in/sign-in-provider.d.ts +135 -0
  52. package/esm/node/sign-in/sign-in-provider.js +225 -0
  53. package/esm/node/sign-in/ta-sign-in.d.ts +10 -0
  54. package/esm/node/sign-in/ta-sign-in.js +32 -0
  55. package/esm/node/ta-access.d.ts +7 -0
  56. package/esm/node/ta-access.js +30 -1
  57. package/esm/node/ta-server-impl.d.ts +8 -3
  58. package/esm/node/ta-server-impl.js +25 -6
  59. package/esm/node/ta-session-factory.d.ts +4 -1
  60. package/esm/node/ta-session-factory.js +30 -7
  61. package/esm/node/ta-session-registry.d.ts +2 -0
  62. package/esm/node/ta-session-registry.js +23 -3
  63. package/esm/node/ta-session.d.ts +24 -2
  64. package/esm/node/ta-session.js +84 -6
  65. package/esm/node/temporary-packages.d.ts +46 -0
  66. package/esm/node/temporary-packages.js +114 -0
  67. package/esm/node/temporary-purge.d.ts +13 -0
  68. package/esm/node/temporary-purge.js +51 -0
  69. package/esm/node/terminal-service.d.ts +18 -2
  70. package/esm/node/terminal-service.js +45 -9
  71. package/esm/node/terminal-util.d.ts +14 -0
  72. package/esm/node/terminal-util.js +30 -1
  73. package/esm/node/web-extension-catalog.d.ts +28 -1
  74. package/esm/node/web-extension-catalog.js +173 -5
  75. package/esm/node/web-extension-util.d.ts +5 -1
  76. package/esm/node/web-extension-util.js +36 -5
  77. package/esm/node/workspace-protocol.d.ts +2 -0
  78. package/esm/node/workspace-server-impl.d.ts +2 -1
  79. package/esm/node/workspace-server-impl.js +13 -1
  80. package/esm/node/workspace-service.d.ts +1 -0
  81. package/esm/node/workspace-service.js +13 -1
  82. package/lib/node/auth-server-impl.d.ts +2 -0
  83. package/lib/node/auth-server-impl.js +7 -0
  84. package/lib/node/client-tool-broker.d.ts +11 -3
  85. package/lib/node/client-tool-broker.js +23 -3
  86. package/lib/node/extension-providers.d.ts +23 -0
  87. package/lib/node/extension-providers.js +55 -0
  88. package/lib/node/host-protocol.d.ts +22 -1
  89. package/lib/node/host-protocol.js +2 -1
  90. package/lib/node/index.d.ts +6 -0
  91. package/lib/node/index.js +6 -0
  92. package/lib/node/live-run.d.ts +23 -0
  93. package/lib/node/live-run.js +62 -0
  94. package/lib/node/message-page.d.ts +18 -0
  95. package/lib/node/message-page.js +74 -0
  96. package/lib/node/package-host-extension.d.ts +4 -2
  97. package/lib/node/package-host-extension.js +4 -3
  98. package/lib/node/package-hosts.d.ts +2 -2
  99. package/lib/node/package-hosts.js +2 -0
  100. package/lib/node/package-server-impl.d.ts +9 -1
  101. package/lib/node/package-server-impl.js +15 -0
  102. package/lib/node/relay-bridge.d.ts +9 -1
  103. package/lib/node/relay-bridge.js +43 -3
  104. package/lib/node/remote-ui-context.d.ts +6 -1
  105. package/lib/node/remote-ui-context.js +31 -3
  106. package/lib/node/session-catalog.d.ts +70 -0
  107. package/lib/node/session-catalog.js +214 -0
  108. package/lib/node/session-files.d.ts +19 -0
  109. package/lib/node/session-files.js +36 -0
  110. package/lib/node/session-info-util.d.ts +4 -1
  111. package/lib/node/session-info-util.js +7 -2
  112. package/lib/node/settings-server-impl.d.ts +1 -0
  113. package/lib/node/settings-server-impl.js +8 -0
  114. package/lib/node/settings-store.d.ts +3 -1
  115. package/lib/node/settings-store.js +25 -3
  116. package/lib/node/sign-in/access-server-impl.d.ts +20 -0
  117. package/lib/node/sign-in/access-server-impl.js +85 -0
  118. package/lib/node/sign-in/access-store.d.ts +66 -0
  119. package/lib/node/sign-in/access-store.js +179 -0
  120. package/lib/node/sign-in/index.d.ts +8 -0
  121. package/lib/node/sign-in/index.js +24 -0
  122. package/lib/node/sign-in/sign-in-flow.d.ts +59 -0
  123. package/lib/node/sign-in/sign-in-flow.js +108 -0
  124. package/lib/node/sign-in/sign-in-middleware.d.ts +11 -0
  125. package/lib/node/sign-in/sign-in-middleware.js +51 -0
  126. package/lib/node/sign-in/sign-in-pages.d.ts +32 -0
  127. package/lib/node/sign-in/sign-in-pages.js +121 -0
  128. package/lib/node/sign-in/sign-in-provider.d.ts +136 -0
  129. package/lib/node/sign-in/sign-in-provider.js +232 -0
  130. package/lib/node/sign-in/ta-sign-in.d.ts +11 -0
  131. package/lib/node/sign-in/ta-sign-in.js +35 -0
  132. package/lib/node/ta-access.d.ts +7 -0
  133. package/lib/node/ta-access.js +30 -1
  134. package/lib/node/ta-server-impl.d.ts +8 -3
  135. package/lib/node/ta-server-impl.js +24 -5
  136. package/lib/node/ta-session-factory.d.ts +4 -1
  137. package/lib/node/ta-session-factory.js +30 -7
  138. package/lib/node/ta-session-registry.d.ts +2 -0
  139. package/lib/node/ta-session-registry.js +23 -3
  140. package/lib/node/ta-session.d.ts +24 -2
  141. package/lib/node/ta-session.js +84 -6
  142. package/lib/node/temporary-packages.d.ts +47 -0
  143. package/lib/node/temporary-packages.js +118 -0
  144. package/lib/node/temporary-purge.d.ts +14 -0
  145. package/lib/node/temporary-purge.js +54 -0
  146. package/lib/node/terminal-service.d.ts +18 -2
  147. package/lib/node/terminal-service.js +44 -8
  148. package/lib/node/terminal-util.d.ts +14 -0
  149. package/lib/node/terminal-util.js +30 -1
  150. package/lib/node/web-extension-catalog.d.ts +28 -1
  151. package/lib/node/web-extension-catalog.js +172 -4
  152. package/lib/node/web-extension-util.d.ts +5 -1
  153. package/lib/node/web-extension-util.js +36 -5
  154. package/lib/node/workspace-protocol.d.ts +2 -0
  155. package/lib/node/workspace-server-impl.d.ts +2 -1
  156. package/lib/node/workspace-server-impl.js +12 -0
  157. package/lib/node/workspace-service.d.ts +1 -0
  158. package/lib/node/workspace-service.js +13 -1
  159. package/package.json +17 -12
  160. package/esm/node/auth-server-impl.js.map +0 -1
  161. package/esm/node/client-channel.js.map +0 -1
  162. package/esm/node/client-tool-broker.js.map +0 -1
  163. package/esm/node/event-log.js.map +0 -1
  164. package/esm/node/exec-environment-factory.js.map +0 -1
  165. package/esm/node/extension-data-notifier.js.map +0 -1
  166. package/esm/node/extension-data.js.map +0 -1
  167. package/esm/node/host-protocol.js.map +0 -1
  168. package/esm/node/index.js.map +0 -1
  169. package/esm/node/module.js.map +0 -1
  170. package/esm/node/package-host-extension.js.map +0 -1
  171. package/esm/node/package-hosts.js.map +0 -1
  172. package/esm/node/package-server-impl.js.map +0 -1
  173. package/esm/node/package-switch.js.map +0 -1
  174. package/esm/node/receipt-book.js.map +0 -1
  175. package/esm/node/relay-bridge.js.map +0 -1
  176. package/esm/node/remote/index.js.map +0 -1
  177. package/esm/node/remote/pi-directories.js.map +0 -1
  178. package/esm/node/remote/port-forwards.js.map +0 -1
  179. package/esm/node/remote/remote-hosts.js.map +0 -1
  180. package/esm/node/remote/remote-protocol.js.map +0 -1
  181. package/esm/node/remote/remote-server-impl.js.map +0 -1
  182. package/esm/node/remote-ui-context.js.map +0 -1
  183. package/esm/node/session-info-util.js.map +0 -1
  184. package/esm/node/session-storage/file-session-storage.js.map +0 -1
  185. package/esm/node/session-storage/index.js.map +0 -1
  186. package/esm/node/session-storage/session-storage-protocol.js.map +0 -1
  187. package/esm/node/session-storage/stored-session.js.map +0 -1
  188. package/esm/node/settings-server-impl.js.map +0 -1
  189. package/esm/node/settings-store.js.map +0 -1
  190. package/esm/node/ta-access.js.map +0 -1
  191. package/esm/node/ta-errors.js.map +0 -1
  192. package/esm/node/ta-event-util.js.map +0 -1
  193. package/esm/node/ta-server-impl.js.map +0 -1
  194. package/esm/node/ta-session-factory.js.map +0 -1
  195. package/esm/node/ta-session-registry.js.map +0 -1
  196. package/esm/node/ta-session.js.map +0 -1
  197. package/esm/node/terminal-protocol.js.map +0 -1
  198. package/esm/node/terminal-service.js.map +0 -1
  199. package/esm/node/terminal-util.js.map +0 -1
  200. package/esm/node/web-extension-catalog.js.map +0 -1
  201. package/esm/node/web-extension-util.js.map +0 -1
  202. package/esm/node/working-directory.js.map +0 -1
  203. package/esm/node/workspace-files.js.map +0 -1
  204. package/esm/node/workspace-protocol.js.map +0 -1
  205. package/esm/node/workspace-server-impl.js.map +0 -1
  206. package/esm/node/workspace-service.js.map +0 -1
  207. package/esm/node/workspace-util.js.map +0 -1
  208. package/lib/node/auth-server-impl.d.ts.map +0 -1
  209. package/lib/node/auth-server-impl.js.map +0 -1
  210. package/lib/node/auth-server-impl.spec.d.ts +0 -2
  211. package/lib/node/auth-server-impl.spec.d.ts.map +0 -1
  212. package/lib/node/auth-server-impl.spec.js +0 -47
  213. package/lib/node/auth-server-impl.spec.js.map +0 -1
  214. package/lib/node/client-channel.d.ts.map +0 -1
  215. package/lib/node/client-channel.js.map +0 -1
  216. package/lib/node/client-channel.spec.d.ts +0 -2
  217. package/lib/node/client-channel.spec.d.ts.map +0 -1
  218. package/lib/node/client-channel.spec.js +0 -106
  219. package/lib/node/client-channel.spec.js.map +0 -1
  220. package/lib/node/client-tool-broker.d.ts.map +0 -1
  221. package/lib/node/client-tool-broker.js.map +0 -1
  222. package/lib/node/client-tool-broker.spec.d.ts +0 -2
  223. package/lib/node/client-tool-broker.spec.d.ts.map +0 -1
  224. package/lib/node/client-tool-broker.spec.js +0 -49
  225. package/lib/node/client-tool-broker.spec.js.map +0 -1
  226. package/lib/node/event-log.d.ts.map +0 -1
  227. package/lib/node/event-log.js.map +0 -1
  228. package/lib/node/event-log.spec.d.ts +0 -2
  229. package/lib/node/event-log.spec.d.ts.map +0 -1
  230. package/lib/node/event-log.spec.js +0 -48
  231. package/lib/node/event-log.spec.js.map +0 -1
  232. package/lib/node/exec-environment-factory.d.ts.map +0 -1
  233. package/lib/node/exec-environment-factory.js.map +0 -1
  234. package/lib/node/extension-data-notifier.d.ts.map +0 -1
  235. package/lib/node/extension-data-notifier.js.map +0 -1
  236. package/lib/node/extension-data-notifier.spec.d.ts +0 -2
  237. package/lib/node/extension-data-notifier.spec.d.ts.map +0 -1
  238. package/lib/node/extension-data-notifier.spec.js +0 -35
  239. package/lib/node/extension-data-notifier.spec.js.map +0 -1
  240. package/lib/node/extension-data.d.ts.map +0 -1
  241. package/lib/node/extension-data.js.map +0 -1
  242. package/lib/node/extension-data.spec.d.ts +0 -2
  243. package/lib/node/extension-data.spec.d.ts.map +0 -1
  244. package/lib/node/extension-data.spec.js +0 -99
  245. package/lib/node/extension-data.spec.js.map +0 -1
  246. package/lib/node/host-protocol.d.ts.map +0 -1
  247. package/lib/node/host-protocol.js.map +0 -1
  248. package/lib/node/index.d.ts.map +0 -1
  249. package/lib/node/index.js.map +0 -1
  250. package/lib/node/module.d.ts.map +0 -1
  251. package/lib/node/module.js.map +0 -1
  252. package/lib/node/package-host-extension.d.ts.map +0 -1
  253. package/lib/node/package-host-extension.js.map +0 -1
  254. package/lib/node/package-hosts.d.ts.map +0 -1
  255. package/lib/node/package-hosts.js.map +0 -1
  256. package/lib/node/package-hosts.spec.d.ts +0 -2
  257. package/lib/node/package-hosts.spec.d.ts.map +0 -1
  258. package/lib/node/package-hosts.spec.js +0 -53
  259. package/lib/node/package-hosts.spec.js.map +0 -1
  260. package/lib/node/package-server-impl.d.ts.map +0 -1
  261. package/lib/node/package-server-impl.js.map +0 -1
  262. package/lib/node/package-switch.d.ts.map +0 -1
  263. package/lib/node/package-switch.js.map +0 -1
  264. package/lib/node/receipt-book.d.ts.map +0 -1
  265. package/lib/node/receipt-book.js.map +0 -1
  266. package/lib/node/receipt-book.spec.d.ts +0 -2
  267. package/lib/node/receipt-book.spec.d.ts.map +0 -1
  268. package/lib/node/receipt-book.spec.js +0 -39
  269. package/lib/node/receipt-book.spec.js.map +0 -1
  270. package/lib/node/relay-bridge.d.ts.map +0 -1
  271. package/lib/node/relay-bridge.js.map +0 -1
  272. package/lib/node/remote/index.d.ts.map +0 -1
  273. package/lib/node/remote/index.js.map +0 -1
  274. package/lib/node/remote/pi-directories.d.ts.map +0 -1
  275. package/lib/node/remote/pi-directories.js.map +0 -1
  276. package/lib/node/remote/port-forwards.d.ts.map +0 -1
  277. package/lib/node/remote/port-forwards.js.map +0 -1
  278. package/lib/node/remote/remote-hosts.d.ts.map +0 -1
  279. package/lib/node/remote/remote-hosts.js.map +0 -1
  280. package/lib/node/remote/remote-protocol.d.ts.map +0 -1
  281. package/lib/node/remote/remote-protocol.js.map +0 -1
  282. package/lib/node/remote/remote-server-impl.d.ts.map +0 -1
  283. package/lib/node/remote/remote-server-impl.js.map +0 -1
  284. package/lib/node/remote/remote.spec.d.ts +0 -2
  285. package/lib/node/remote/remote.spec.d.ts.map +0 -1
  286. package/lib/node/remote/remote.spec.js +0 -130
  287. package/lib/node/remote/remote.spec.js.map +0 -1
  288. package/lib/node/remote-ui-context.d.ts.map +0 -1
  289. package/lib/node/remote-ui-context.js.map +0 -1
  290. package/lib/node/remote-ui-context.spec.d.ts +0 -2
  291. package/lib/node/remote-ui-context.spec.d.ts.map +0 -1
  292. package/lib/node/remote-ui-context.spec.js +0 -62
  293. package/lib/node/remote-ui-context.spec.js.map +0 -1
  294. package/lib/node/session-info-util.d.ts.map +0 -1
  295. package/lib/node/session-info-util.js.map +0 -1
  296. package/lib/node/session-info-util.spec.d.ts +0 -2
  297. package/lib/node/session-info-util.spec.d.ts.map +0 -1
  298. package/lib/node/session-info-util.spec.js +0 -22
  299. package/lib/node/session-info-util.spec.js.map +0 -1
  300. package/lib/node/session-storage/file-session-storage.d.ts.map +0 -1
  301. package/lib/node/session-storage/file-session-storage.js.map +0 -1
  302. package/lib/node/session-storage/file-session-storage.spec.d.ts +0 -2
  303. package/lib/node/session-storage/file-session-storage.spec.d.ts.map +0 -1
  304. package/lib/node/session-storage/file-session-storage.spec.js +0 -70
  305. package/lib/node/session-storage/file-session-storage.spec.js.map +0 -1
  306. package/lib/node/session-storage/index.d.ts.map +0 -1
  307. package/lib/node/session-storage/index.js.map +0 -1
  308. package/lib/node/session-storage/session-storage-protocol.d.ts.map +0 -1
  309. package/lib/node/session-storage/session-storage-protocol.js.map +0 -1
  310. package/lib/node/session-storage/stored-session.d.ts.map +0 -1
  311. package/lib/node/session-storage/stored-session.js.map +0 -1
  312. package/lib/node/session-storage/stored-session.spec.d.ts +0 -2
  313. package/lib/node/session-storage/stored-session.spec.d.ts.map +0 -1
  314. package/lib/node/session-storage/stored-session.spec.js +0 -73
  315. package/lib/node/session-storage/stored-session.spec.js.map +0 -1
  316. package/lib/node/settings-server-impl.d.ts.map +0 -1
  317. package/lib/node/settings-server-impl.js.map +0 -1
  318. package/lib/node/settings-store.d.ts.map +0 -1
  319. package/lib/node/settings-store.js.map +0 -1
  320. package/lib/node/settings-store.spec.d.ts +0 -2
  321. package/lib/node/settings-store.spec.d.ts.map +0 -1
  322. package/lib/node/settings-store.spec.js +0 -146
  323. package/lib/node/settings-store.spec.js.map +0 -1
  324. package/lib/node/ta-access.d.ts.map +0 -1
  325. package/lib/node/ta-access.js.map +0 -1
  326. package/lib/node/ta-access.spec.d.ts +0 -2
  327. package/lib/node/ta-access.spec.d.ts.map +0 -1
  328. package/lib/node/ta-access.spec.js +0 -33
  329. package/lib/node/ta-access.spec.js.map +0 -1
  330. package/lib/node/ta-errors.d.ts.map +0 -1
  331. package/lib/node/ta-errors.js.map +0 -1
  332. package/lib/node/ta-errors.spec.d.ts +0 -2
  333. package/lib/node/ta-errors.spec.d.ts.map +0 -1
  334. package/lib/node/ta-errors.spec.js +0 -25
  335. package/lib/node/ta-errors.spec.js.map +0 -1
  336. package/lib/node/ta-event-util.d.ts.map +0 -1
  337. package/lib/node/ta-event-util.js.map +0 -1
  338. package/lib/node/ta-event-util.spec.d.ts +0 -2
  339. package/lib/node/ta-event-util.spec.d.ts.map +0 -1
  340. package/lib/node/ta-event-util.spec.js +0 -28
  341. package/lib/node/ta-event-util.spec.js.map +0 -1
  342. package/lib/node/ta-server-impl.d.ts.map +0 -1
  343. package/lib/node/ta-server-impl.js.map +0 -1
  344. package/lib/node/ta-session-factory.d.ts.map +0 -1
  345. package/lib/node/ta-session-factory.js.map +0 -1
  346. package/lib/node/ta-session-registry.d.ts.map +0 -1
  347. package/lib/node/ta-session-registry.js.map +0 -1
  348. package/lib/node/ta-session.d.ts.map +0 -1
  349. package/lib/node/ta-session.js.map +0 -1
  350. package/lib/node/terminal-protocol.d.ts.map +0 -1
  351. package/lib/node/terminal-protocol.js.map +0 -1
  352. package/lib/node/terminal-service.d.ts.map +0 -1
  353. package/lib/node/terminal-service.js.map +0 -1
  354. package/lib/node/terminal-service.spec.d.ts +0 -2
  355. package/lib/node/terminal-service.spec.d.ts.map +0 -1
  356. package/lib/node/terminal-service.spec.js +0 -79
  357. package/lib/node/terminal-service.spec.js.map +0 -1
  358. package/lib/node/terminal-util.d.ts.map +0 -1
  359. package/lib/node/terminal-util.js.map +0 -1
  360. package/lib/node/terminal-util.spec.d.ts +0 -2
  361. package/lib/node/terminal-util.spec.d.ts.map +0 -1
  362. package/lib/node/terminal-util.spec.js +0 -71
  363. package/lib/node/terminal-util.spec.js.map +0 -1
  364. package/lib/node/web-extension-catalog.d.ts.map +0 -1
  365. package/lib/node/web-extension-catalog.js.map +0 -1
  366. package/lib/node/web-extension-catalog.spec.d.ts +0 -2
  367. package/lib/node/web-extension-catalog.spec.d.ts.map +0 -1
  368. package/lib/node/web-extension-catalog.spec.js +0 -157
  369. package/lib/node/web-extension-catalog.spec.js.map +0 -1
  370. package/lib/node/web-extension-util.d.ts.map +0 -1
  371. package/lib/node/web-extension-util.js.map +0 -1
  372. package/lib/node/working-directory.d.ts.map +0 -1
  373. package/lib/node/working-directory.js.map +0 -1
  374. package/lib/node/workspace-files.d.ts.map +0 -1
  375. package/lib/node/workspace-files.js.map +0 -1
  376. package/lib/node/workspace-files.spec.d.ts +0 -2
  377. package/lib/node/workspace-files.spec.d.ts.map +0 -1
  378. package/lib/node/workspace-files.spec.js +0 -133
  379. package/lib/node/workspace-files.spec.js.map +0 -1
  380. package/lib/node/workspace-protocol.d.ts.map +0 -1
  381. package/lib/node/workspace-protocol.js.map +0 -1
  382. package/lib/node/workspace-server-impl.d.ts.map +0 -1
  383. package/lib/node/workspace-server-impl.js.map +0 -1
  384. package/lib/node/workspace-service.d.ts.map +0 -1
  385. package/lib/node/workspace-service.js.map +0 -1
  386. package/lib/node/workspace-service.spec.d.ts +0 -2
  387. package/lib/node/workspace-service.spec.d.ts.map +0 -1
  388. package/lib/node/workspace-service.spec.js +0 -104
  389. package/lib/node/workspace-service.spec.js.map +0 -1
  390. package/lib/node/workspace-util.d.ts.map +0 -1
  391. package/lib/node/workspace-util.js.map +0 -1
  392. package/lib/node/workspace-util.spec.d.ts +0 -2
  393. package/lib/node/workspace-util.spec.d.ts.map +0 -1
  394. package/lib/node/workspace-util.spec.js +0 -44
  395. package/lib/node/workspace-util.spec.js.map +0 -1
  396. package/src/node/auth-server-impl.spec.ts +0 -49
  397. package/src/node/auth-server-impl.ts +0 -252
  398. package/src/node/client-channel.spec.ts +0 -117
  399. package/src/node/client-channel.ts +0 -94
  400. package/src/node/client-tool-broker.spec.ts +0 -53
  401. package/src/node/client-tool-broker.ts +0 -106
  402. package/src/node/event-log.spec.ts +0 -52
  403. package/src/node/event-log.ts +0 -59
  404. package/src/node/exec-environment-factory.ts +0 -66
  405. package/src/node/extension-data-notifier.spec.ts +0 -34
  406. package/src/node/extension-data-notifier.ts +0 -124
  407. package/src/node/extension-data.spec.ts +0 -105
  408. package/src/node/extension-data.ts +0 -180
  409. package/src/node/host-protocol.ts +0 -62
  410. package/src/node/index.ts +0 -37
  411. package/src/node/module.ts +0 -4
  412. package/src/node/package-host-extension.ts +0 -20
  413. package/src/node/package-hosts.spec.ts +0 -54
  414. package/src/node/package-hosts.ts +0 -202
  415. package/src/node/package-server-impl.ts +0 -87
  416. package/src/node/package-switch.ts +0 -80
  417. package/src/node/receipt-book.spec.ts +0 -41
  418. package/src/node/receipt-book.ts +0 -40
  419. package/src/node/relay-bridge.ts +0 -94
  420. package/src/node/remote/index.ts +0 -5
  421. package/src/node/remote/pi-directories.ts +0 -49
  422. package/src/node/remote/port-forwards.ts +0 -148
  423. package/src/node/remote/remote-hosts.ts +0 -170
  424. package/src/node/remote/remote-protocol.ts +0 -57
  425. package/src/node/remote/remote-server-impl.ts +0 -60
  426. package/src/node/remote/remote.spec.ts +0 -142
  427. package/src/node/remote-ui-context.spec.ts +0 -68
  428. package/src/node/remote-ui-context.ts +0 -168
  429. package/src/node/session-info-util.spec.ts +0 -23
  430. package/src/node/session-info-util.ts +0 -55
  431. package/src/node/session-storage/file-session-storage.spec.ts +0 -72
  432. package/src/node/session-storage/file-session-storage.ts +0 -145
  433. package/src/node/session-storage/index.ts +0 -3
  434. package/src/node/session-storage/session-storage-protocol.ts +0 -81
  435. package/src/node/session-storage/stored-session.spec.ts +0 -80
  436. package/src/node/session-storage/stored-session.ts +0 -149
  437. package/src/node/settings-server-impl.ts +0 -33
  438. package/src/node/settings-store.spec.ts +0 -156
  439. package/src/node/settings-store.ts +0 -314
  440. package/src/node/ta-access.spec.ts +0 -36
  441. package/src/node/ta-access.ts +0 -156
  442. package/src/node/ta-errors.spec.ts +0 -25
  443. package/src/node/ta-errors.ts +0 -75
  444. package/src/node/ta-event-util.spec.ts +0 -29
  445. package/src/node/ta-event-util.ts +0 -23
  446. package/src/node/ta-server-impl.ts +0 -341
  447. package/src/node/ta-session-factory.ts +0 -203
  448. package/src/node/ta-session-registry.ts +0 -75
  449. package/src/node/ta-session.ts +0 -240
  450. package/src/node/terminal-protocol.ts +0 -18
  451. package/src/node/terminal-service.spec.ts +0 -84
  452. package/src/node/terminal-service.ts +0 -259
  453. package/src/node/terminal-util.spec.ts +0 -78
  454. package/src/node/terminal-util.ts +0 -166
  455. package/src/node/web-extension-catalog.spec.ts +0 -172
  456. package/src/node/web-extension-catalog.ts +0 -177
  457. package/src/node/web-extension-util.ts +0 -144
  458. package/src/node/working-directory.ts +0 -71
  459. package/src/node/workspace-files.spec.ts +0 -145
  460. package/src/node/workspace-files.ts +0 -256
  461. package/src/node/workspace-protocol.ts +0 -22
  462. package/src/node/workspace-server-impl.ts +0 -90
  463. package/src/node/workspace-service.spec.ts +0 -113
  464. package/src/node/workspace-service.ts +0 -223
  465. package/src/node/workspace-util.spec.ts +0 -47
  466. package/src/node/workspace-util.ts +0 -103
@@ -1,36 +0,0 @@
1
- import { describe, expect, it } from 'bun:test';
2
- import type { IncomingMessage } from 'node:http';
3
- import { TaAccessUtil } from './ta-access';
4
-
5
- const request = (url: string, headers: Record<string, string> = {}) => ({ url, headers }) as unknown as IncomingMessage;
6
-
7
- describe('TaAccessUtil', () => {
8
- it('reads the token from the header or the query', () => {
9
- expect(TaAccessUtil.tokenOf(request('/api/ws', { authorization: 'Bearer abc' }))).toBe('abc');
10
- expect(TaAccessUtil.tokenOf(request('/api/ws?token=abc'))).toBe('abc');
11
- expect(TaAccessUtil.tokenOf(request('/api/ws'))).toBeUndefined();
12
- });
13
-
14
- it('compares tokens of any length', () => {
15
- expect(TaAccessUtil.equals('abc', 'abc')).toBe(true);
16
- expect(TaAccessUtil.equals('abc', 'abd')).toBe(false);
17
- expect(TaAccessUtil.equals('abc', 'abcd')).toBe(false);
18
- });
19
-
20
- it('knows the names of this machine', () => {
21
- expect(TaAccessUtil.isLoopbackHost('127.0.0.1:3000')).toBe(true);
22
- expect(TaAccessUtil.isLoopbackHost('localhost')).toBe(true);
23
- expect(TaAccessUtil.isLoopbackHost('[::1]:3000')).toBe(true);
24
- expect(TaAccessUtil.isLoopbackHost('evil.example:3000')).toBe(false);
25
- expect(TaAccessUtil.isLoopbackHost(undefined)).toBe(false);
26
- });
27
-
28
- it('tells calls over plain HTTP from the files and the pages', () => {
29
- const call = (method: string, url: string) => ({ method, url, headers: {} }) as unknown as IncomingMessage;
30
- expect(TaAccessUtil.isHttpCall(call('POST', '/api/TaServer'))).toBe(true);
31
- expect(TaAccessUtil.isHttpCall(call('POST', '/api/TaWorkspaceServer?token=abc'))).toBe(true);
32
- expect(TaAccessUtil.isHttpCall(call('GET', '/api/files/x/a.png'))).toBe(false);
33
- expect(TaAccessUtil.isHttpCall(call('GET', '/api/ws'))).toBe(false);
34
- expect(TaAccessUtil.isHttpCall(call('POST', '/index.html'))).toBe(false);
35
- });
36
- });
@@ -1,156 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import { randomBytes, timingSafeEqual } from 'node:crypto';
3
- import { chmodSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
4
- import type { IncomingMessage, Server } from 'node:http';
5
- import type { AddressInfo } from 'node:net';
6
- import { join } from 'node:path';
7
- import { type Application, ApplicationLifecycle, Autowired, Component, Value } from '@celljs/core';
8
- import { RpcContext, RpcWebSocketGuard } from '@celljs/rpc/lib/node';
9
- import { TaServeStateUtil } from '@celljs/ta-harness/lib/node/serve-state';
10
- import { TaBrand } from '@celljs/ta-harness/lib/node/ta-brand';
11
- import { TA_SERVE_FILE, TA_WEBSOCKET_PATH, type TaServeInfo } from '@celljs/ta-protocol';
12
- import { type Context, Middleware, ServerAware } from '@celljs/web/lib/node';
13
- import { TaSessionRegistry } from './host-protocol';
14
-
15
- const LOOPBACK_NAMES = new Set(['127.0.0.1', 'localhost', '[::1]']);
16
-
17
- /** Where the calls go (`rpc.path`); everything else is the web client, if it is installed. */
18
- const API_PATH = '/api';
19
-
20
- /** The id of {@link TaAccess}, for what needs the token, as RelayBridge does. */
21
- export const TA_ACCESS = Symbol('TaAccess');
22
-
23
- /** Runs before everything else that handles a request. */
24
- export const ACCESS_MIDDLEWARE_PRIORITY = 10000;
25
-
26
- export namespace TaAccessUtil {
27
- /** From `Authorization: Bearer`, or `?token=` for browsers, whose WebSocket API cannot set headers. */
28
- export function tokenOf(request: IncomingMessage): string | undefined {
29
- const header = request.headers.authorization;
30
- if (header?.startsWith('Bearer ')) {
31
- return header.slice('Bearer '.length);
32
- }
33
- return new URL(request.url ?? '/', 'http://localhost').searchParams.get('token') ?? undefined;
34
- }
35
-
36
- export function equals(a: string, b: string): boolean {
37
- const [left, right] = [Buffer.from(a), Buffer.from(b)];
38
- return left.length === right.length && timingSafeEqual(left, right);
39
- }
40
-
41
- /** A page that rebinds its domain to 127.0.0.1 reaches the server with its own name in `Host`. */
42
- export function isLoopbackHost(host: string | undefined): boolean {
43
- return LOOPBACK_NAMES.has((host ?? '').replace(/:\d+$/, ''));
44
- }
45
-
46
- /** The files of the web client are the same for everyone: they hold no data, so they need no token. */
47
- export function isPublic(request: IncomingMessage): boolean {
48
- const path = (request.url ?? '/').split('?')[0];
49
- return (request.method === 'GET' || request.method === 'HEAD') && path !== API_PATH && !path.startsWith(`${API_PATH}/`);
50
- }
51
-
52
- /**
53
- * A JSON-RPC call over plain HTTP (`POST /api/<service>`), which @celljs/rpc answers too: ta serve takes
54
- * calls on its WebSocket only, where a call knows its connection (attach, terminals) and gets pushes.
55
- */
56
- export function isHttpCall(request: IncomingMessage): boolean {
57
- const path = (request.url ?? '/').split('?')[0];
58
- return request.method === 'POST' && path.startsWith(`${API_PATH}/`);
59
- }
60
-
61
- /** The token goes in the fragment, which the browser does not send to the server or in `Referer`. */
62
- export function webUrl(httpUrl: string, token: string): string {
63
- return `${httpUrl}/#token=${token}`;
64
- }
65
-
66
- /** Opens a URL in the user's browser. */
67
- export function openBrowser(url: string): void {
68
- const [command, ...args] =
69
- process.platform === 'darwin' ? ['open', url] : process.platform === 'win32' ? ['cmd', '/c', 'start', '""', url] : ['xdg-open', url];
70
- const child = spawn(command, args, { stdio: 'ignore', detached: true });
71
- child.on('error', () => console.log(`ta serve: open ${url} in a browser`));
72
- child.unref();
73
- }
74
- }
75
-
76
- /**
77
- * The token of this server: `TA_SERVE_TOKEN`, which a parent process (the desktop app) can choose, or the
78
- * one of the last start, or a random one. It lets in connections and requests, and is published in a file
79
- * only this user can read. It stays across restarts with the port (TaServeStateUtil), so that the web app
80
- * installed from this address, which remembers both, signs in again by itself.
81
- */
82
- @Component([TA_ACCESS, RpcWebSocketGuard, Middleware, ServerAware, ApplicationLifecycle])
83
- export class TaAccess implements RpcWebSocketGuard, Middleware, ServerAware, ApplicationLifecycle<Application> {
84
- readonly priority = ACCESS_MIDDLEWARE_PRIORITY;
85
- readonly token = process.env.TA_SERVE_TOKEN || TaServeStateUtil.read().token || randomBytes(32).toString('base64url');
86
-
87
- @Value('server.host')
88
- protected readonly host?: string;
89
-
90
- @Autowired(TaSessionRegistry)
91
- protected readonly sessions: TaSessionRegistry;
92
-
93
- protected readonly infoFile = join(TaBrand.agentDir(), TA_SERVE_FILE);
94
-
95
- allows(request: IncomingMessage): boolean {
96
- const token = TaAccessUtil.tokenOf(request);
97
- return token !== undefined && TaAccessUtil.equals(token, this.token) && this.acceptsHost(request);
98
- }
99
-
100
- /** Calls over a WebSocket were checked when it opened; this covers plain HTTP. */
101
- async handle(ctx: Context, next: () => Promise<void>): Promise<void> {
102
- const request = ctx.request as unknown as IncomingMessage;
103
- if (RpcContext.connection()) {
104
- await next();
105
- return;
106
- }
107
- if (this.allows(request) && TaAccessUtil.isHttpCall(request)) {
108
- ctx.response.statusCode = 404;
109
- ctx.response.end(`Call ta serve over its WebSocket, ${TA_WEBSOCKET_PATH}.`);
110
- return;
111
- }
112
- if (this.allows(request) || (TaAccessUtil.isPublic(request) && this.acceptsHost(request))) {
113
- await next();
114
- return;
115
- }
116
- ctx.response.statusCode = 401;
117
- ctx.response.end('Unauthorized');
118
- }
119
-
120
- async setServer(server: Server): Promise<void> {
121
- const publish = () => this.publish(server);
122
- if (server.listening) {
123
- publish();
124
- } else {
125
- server.once('listening', publish);
126
- }
127
- }
128
-
129
- async onStop(): Promise<void> {
130
- rmSync(this.infoFile, { force: true });
131
- await this.sessions.closeAll();
132
- }
133
-
134
- protected acceptsHost(request: IncomingMessage): boolean {
135
- return !TaAccessUtil.isLoopbackHost(this.host) || TaAccessUtil.isLoopbackHost(request.headers.host);
136
- }
137
-
138
- protected publish(server: Server): void {
139
- const { port } = server.address() as AddressInfo;
140
- const origin = `${this.host ?? '127.0.0.1'}:${port}`;
141
- const info: TaServeInfo = { url: `ws://${origin}${TA_WEBSOCKET_PATH}`, token: this.token, pid: process.pid };
142
- mkdirSync(join(this.infoFile, '..'), { recursive: true });
143
- writeFileSync(this.infoFile, JSON.stringify(info), { mode: 0o600 });
144
- // The mode above only applies to a new file.
145
- chmodSync(this.infoFile, 0o600);
146
- // A token that a parent process chose is its to keep.
147
- const kept = TaServeStateUtil.read().token;
148
- TaServeStateUtil.write({ port, token: process.env.TA_SERVE_TOKEN ? kept : this.token });
149
- console.log(`ta serve: ${info.url} (token in ${this.infoFile})`);
150
- if (process.env.TA_SERVE_OPEN_WEB) {
151
- const url = TaAccessUtil.webUrl(`http://${origin}`, this.token);
152
- console.log(`ta serve: web client at ${url}`);
153
- TaAccessUtil.openBrowser(url);
154
- }
155
- }
156
- }
@@ -1,25 +0,0 @@
1
- import { describe, expect, it } from 'bun:test';
2
- import { TaErrorCode } from '@celljs/ta-protocol';
3
- import { TaErrors } from './ta-errors';
4
-
5
- const dataOf = (error: Error) => (error as unknown as { data: { code: string; hint: string } }).data;
6
-
7
- describe('TaErrors', () => {
8
- it("names pi's failures for want of a sign-in, without its talk of /login and its paths", () => {
9
- for (const text of [
10
- 'No API key found for anthropic.\n\nUse /login to log into a provider via OAuth or API key. See:\n /x/docs/providers.md',
11
- 'No model selected.\n\nUse /login…',
12
- 'No models available. Use /login…',
13
- ]) {
14
- const error = TaErrors.commandFailed(new Error(text));
15
- expect(dataOf(error).code).toBe(TaErrorCode.NOT_SIGNED_IN);
16
- expect(error.message).not.toContain('/login');
17
- }
18
- });
19
-
20
- it('passes on other failures of pi with their message', () => {
21
- const error = TaErrors.commandFailed(new Error('Agent is already processing.'));
22
- expect(dataOf(error).code).toBe(TaErrorCode.COMMAND_FAILED);
23
- expect(error.message).toBe('Agent is already processing.');
24
- });
25
- });
@@ -1,75 +0,0 @@
1
- import { ApplicationError } from '@celljs/core';
2
- import { TA_RPC_ERROR_CODE, TaErrorCode, type TaErrorData } from '@celljs/ta-protocol';
3
-
4
- const TaError = ApplicationError.declare<number, TaErrorData>(TA_RPC_ERROR_CODE, (code: TaErrorCode, message: string, hint: string) => ({
5
- message,
6
- data: { code, hint },
7
- }));
8
-
9
- /** What pi says when no provider is signed in for the model, or no model can be used. */
10
- const NOT_SIGNED_IN = /^No (API key found for|model selected|models available)\b/;
11
-
12
- /** The failures of calls of the services of ta serve ({@link TaServer} and the others), which reach the client with their message and code. */
13
- export namespace TaErrors {
14
- export function sessionNotFound(sessionId: string): Error {
15
- return TaError(
16
- TaErrorCode.SESSION_NOT_FOUND,
17
- `No open session has the id ${sessionId}.`,
18
- 'Open it again with openSession and its session file: idle sessions are closed, their files stay.',
19
- );
20
- }
21
-
22
- export function sessionLocked(sessionFile: string): Error {
23
- return TaError(TaErrorCode.SESSION_LOCKED, `The session ${sessionFile} is open elsewhere.`, 'Close it there first: a session has one writer.');
24
- }
25
-
26
- export function tooManySessions(max: number): Error {
27
- return TaError(TaErrorCode.TOO_MANY_SESSIONS, `${max} sessions are open, the limit of this server.`, 'Close a session, or raise ta.host.maxSessions.');
28
- }
29
-
30
- export function messageConflict(clientMessageId: string): Error {
31
- return TaError(
32
- TaErrorCode.MESSAGE_CONFLICT,
33
- `The message id ${clientMessageId} was used for a different message.`,
34
- 'Use a new clientMessageId for each message.',
35
- );
36
- }
37
-
38
- export function modelNotFound(model: string): Error {
39
- return TaError(
40
- TaErrorCode.MODEL_NOT_FOUND,
41
- `The model ${model} is not known or has no credentials.`,
42
- 'Use <provider>/<model id>; getAvailableModels lists the ones that work.',
43
- );
44
- }
45
-
46
- export function invalidArgument(message: string, hint: string): Error {
47
- return TaError(TaErrorCode.INVALID_ARGUMENT, message, hint);
48
- }
49
-
50
- /** Runs a call of a service of ta serve, so that what it throws reaches the client with its message (commandFailed). */
51
- export async function guard<T>(command: () => T | Promise<T>): Promise<T> {
52
- try {
53
- return await command();
54
- } catch (error) {
55
- throw commandFailed(error);
56
- }
57
- }
58
-
59
- /** A command that pi refused or that failed. Other errors would lose their message on the way out. */
60
- export function commandFailed(cause: unknown): Error {
61
- if (ApplicationError.is(cause as object)) {
62
- return cause as Error;
63
- }
64
- const message = cause instanceof Error ? cause.message : String(cause);
65
- if (NOT_SIGNED_IN.test(message)) {
66
- // pi's own words go on about its /login and the paths of its documents, which a client does not have.
67
- return TaError(
68
- TaErrorCode.NOT_SIGNED_IN,
69
- message.split(/\n| Use \/login/)[0].trim(),
70
- 'Sign in to a provider of models (TaAuthServer.login), then send it again.',
71
- );
72
- }
73
- return TaError(TaErrorCode.COMMAND_FAILED, message, 'The message comes from the agent; fix what it says and send the command again.');
74
- }
75
- }
@@ -1,29 +0,0 @@
1
- import { describe, expect, it } from 'bun:test';
2
- import { TaEventUtil } from './ta-event-util';
3
-
4
- const toWire = (event: unknown) => TaEventUtil.toWire(event as never) as any;
5
-
6
- describe('TaEventUtil', () => {
7
- it('leaves other events as they are', () => {
8
- const event = { type: 'agent_start' };
9
- expect(toWire(event)).toBe(event);
10
- });
11
-
12
- it('sends a delta without the whole message', () => {
13
- const wire = toWire({
14
- type: 'message_update',
15
- message: { role: 'assistant', usage: { input: 1 } },
16
- assistantMessageEvent: { type: 'text_delta', contentIndex: 0, delta: 'x', partial: { content: ['a very long message'] } },
17
- });
18
- expect(wire).toEqual({ type: 'message_update', usage: { input: 1 }, assistantMessageEvent: { type: 'text_delta', contentIndex: 0, delta: 'x' } });
19
- });
20
-
21
- it('names the tool when a tool call starts', () => {
22
- const wire = toWire({
23
- type: 'message_update',
24
- message: { role: 'assistant' },
25
- assistantMessageEvent: { type: 'toolcall_start', contentIndex: 0, partial: { content: [{ type: 'toolCall', id: 'c1', name: 'bash' }] } },
26
- });
27
- expect(wire.assistantMessageEvent).toEqual({ type: 'toolcall_start', contentIndex: 0, id: 'c1', toolName: 'bash' });
28
- });
29
- });
@@ -1,23 +0,0 @@
1
- import type { TaEvent } from '@celljs/ta-protocol';
2
-
3
- type AgentSessionEvent = import('@earendil-works/pi-coding-agent', { with: { 'resolution-mode': 'import' }}).AgentSessionEvent;
4
-
5
- export namespace TaEventUtil {
6
- /**
7
- * An event of pi as it goes on the wire, the JSON form of pi's RPC and JSON modes (pi does not export
8
- * its function). pi's `message_update` holds the whole message so far: sent as is, a reply would cost
9
- * the square of its length.
10
- */
11
- export function toWire(event: AgentSessionEvent): TaEvent {
12
- if (event.type !== 'message_update') {
13
- return event as TaEvent;
14
- }
15
- const { partial, ...delta } = event.assistantMessageEvent as typeof event.assistantMessageEvent & {
16
- partial?: { content: { id?: string; name?: string }[] };
17
- contentIndex?: number;
18
- };
19
- const block = delta.type === 'toolcall_start' ? partial?.content[delta.contentIndex ?? -1] : undefined;
20
- const assistantMessageEvent = block ? { ...delta, id: block.id, toolName: block.name } : delta;
21
- return { type: 'message_update', usage: (event.message as { usage?: unknown }).usage, assistantMessageEvent } as TaEvent;
22
- }
23
- }