@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
@@ -10,6 +10,8 @@ export interface TaWorkspace {
10
10
  listDirectory(cwd: string, path: string): Promise<TaDirEntry[]>;
11
11
  readFile(cwd: string, path: string): Promise<TaFileContent>;
12
12
  writeFile(cwd: string, path: string, text: string): Promise<void>;
13
+ /** Bytes to a file, the folders on its way made; with `append`, after what it holds. */
14
+ uploadFile(cwd: string, path: string, data: Uint8Array, append: boolean): Promise<void>;
13
15
  findFiles(cwd: string, query: string, limit?: number): Promise<string[]>;
14
16
  runCommand(cwd: string, command: string, args: string[], options?: TaRunCommandOptions): Promise<TaCommandOutput>;
15
17
  }
@@ -1,5 +1,5 @@
1
1
  import { ExecEnvironmentFactory } from '@celljs/ta-exec';
2
- import { type TaCommandOutput, type TaDirEntry, type TaFileContent, type TaOpenTerminalOptions, type TaRunCommandOptions, type TaTerminalInfo, TaTerminalServer, TaWorkspaceServer } from '@celljs/ta-protocol';
2
+ import { type TaCommandOutput, type TaDirEntry, type TaFileContent, type TaOpenTerminalOptions, type TaRunCommandOptions, type TaTerminalInfo, TaTerminalServer, type TaUploadOptions, TaWorkspaceServer } from '@celljs/ta-protocol';
3
3
  import { TaTerminals } from './terminal-protocol.js';
4
4
  import { TaWorkspace, WorkspaceFiles } from './workspace-protocol.js';
5
5
  /** The files and programs of a directory, for the web client; `cwd` defaults to the server's directory. */
@@ -10,6 +10,7 @@ export declare class TaWorkspaceServerImpl implements TaWorkspaceServer {
10
10
  listDirectory(path: string, cwd?: string): Promise<TaDirEntry[]>;
11
11
  readFile(path: string, cwd?: string): Promise<TaFileContent>;
12
12
  writeFile(path: string, text: string, cwd?: string): Promise<void>;
13
+ uploadFile(path: string, data: string, options?: TaUploadOptions): Promise<void>;
13
14
  fileUrl(path: string, cwd?: string): Promise<string>;
14
15
  findFiles(query: string, cwd?: string, limit?: number): Promise<string[]>;
15
16
  runCommand(command: string, args: string[], options?: TaRunCommandOptions): Promise<TaCommandOutput>;
@@ -11,7 +11,7 @@ import { Autowired } from '@celljs/core';
11
11
  import { Rpc } from '@celljs/rpc';
12
12
  import { RpcContext } from '@celljs/rpc/lib/node';
13
13
  import { ExecEnvironmentFactory } from '@celljs/ta-exec';
14
- import { TaTerminalServer, TaWorkspaceServer, } from '@celljs/ta-protocol';
14
+ import { TA_UPLOAD_PART_BYTES, TaTerminalServer, TaWorkspaceServer, } from '@celljs/ta-protocol';
15
15
  import { TaErrors } from './ta-errors.js';
16
16
  import { TaTerminals } from './terminal-protocol.js';
17
17
  import { TaWorkspace, WorkspaceFiles } from './workspace-protocol.js';
@@ -26,6 +26,18 @@ let TaWorkspaceServerImpl = class TaWorkspaceServerImpl {
26
26
  writeFile(path, text, cwd) {
27
27
  return TaErrors.guard(async () => this.workspace.writeFile(await this.cwd(cwd), path, text));
28
28
  }
29
+ uploadFile(path, data, options = {}) {
30
+ return TaErrors.guard(async () => {
31
+ if (typeof data !== 'string') {
32
+ throw TaErrors.invalidArgument('No bytes to write.', 'Pass the bytes of the file in base64.');
33
+ }
34
+ const bytes = Buffer.from(data, 'base64');
35
+ if (bytes.length > TA_UPLOAD_PART_BYTES) {
36
+ throw TaErrors.invalidArgument('The part is too large.', `Send the file in parts of at most ${TA_UPLOAD_PART_BYTES} bytes, each after the first with append.`);
37
+ }
38
+ await this.workspace.uploadFile(await this.cwd(options.cwd), path, bytes, options.append === true);
39
+ });
40
+ }
29
41
  fileUrl(path, cwd) {
30
42
  return TaErrors.guard(async () => this.files.url(await this.cwd(cwd), path));
31
43
  }
@@ -15,6 +15,7 @@ export declare class DefaultTaWorkspace implements TaWorkspace {
15
15
  listDirectory(cwd: string, path: string): Promise<TaDirEntry[]>;
16
16
  readFile(cwd: string, path: string): Promise<TaFileContent>;
17
17
  writeFile(cwd: string, path: string, text: string): Promise<void>;
18
+ uploadFile(cwd: string, path: string, data: Uint8Array, append: boolean): Promise<void>;
18
19
  findFiles(cwd: string, query: string, limit?: number): Promise<string[]>;
19
20
  /**
20
21
  * Without a shell: the program gets its arguments as they are. `/bin/sh` only closes the standard
@@ -53,7 +53,7 @@ let DefaultTaWorkspace = class DefaultTaWorkspace {
53
53
  if (!(stat === null || stat === void 0 ? void 0 : stat.isDirectory)) {
54
54
  throw TaErrors.invalidArgument(`${path} is not a directory.`, 'Pass the path of a directory inside the workspace.');
55
55
  }
56
- const entries = (await env.readdir(target.absolute)).filter(entry => entry.name !== '.git');
56
+ const entries = await env.readdir(target.absolute);
57
57
  const listed = await Promise.all(entries.map(async (entry) => {
58
58
  const entryPath = WorkspaceUtil.join(target.relative, entry.name);
59
59
  if (entry.isDirectory) {
@@ -94,6 +94,18 @@ let DefaultTaWorkspace = class DefaultTaWorkspace {
94
94
  }
95
95
  await env.writeFile(target.absolute, text);
96
96
  }
97
+ async uploadFile(cwd, path, data, append) {
98
+ var _a;
99
+ const env = this.environments.create(cwd);
100
+ const target = WorkspaceUtil.inside(env.cwd, path);
101
+ if (!target.relative || ((_a = (await env.stat(target.absolute))) === null || _a === void 0 ? void 0 : _a.isDirectory)) {
102
+ throw TaErrors.invalidArgument(`${path || '.'} is a directory.`, 'Pass the path of a file inside the workspace.');
103
+ }
104
+ if (!append) {
105
+ await env.mkdir(dirname(target.absolute));
106
+ }
107
+ await env.writeFile(target.absolute, data, { append });
108
+ }
97
109
  async findFiles(cwd, query, limit = DEFAULT_FIND_LIMIT) {
98
110
  const env = this.environments.create(cwd);
99
111
  return WorkspaceUtil.fuzzyFind(await this.listFiles(env), query, Math.max(1, limit));
@@ -1,6 +1,7 @@
1
1
  import { type CodingAgentOptions, ModelRuntimeProvider } from '@celljs/ai-coding-agent';
2
2
  import { type RpcConnection } from '@celljs/rpc/lib/node';
3
3
  import { type TaAuthEvent, type TaAuthProvider, TaAuthServer, type TaAuthType } from '@celljs/ta-protocol';
4
+ import { ExtensionProviders } from './extension-providers';
4
5
  import { TaSessionRegistry } from './host-protocol';
5
6
  type ModelRuntime = import('@earendil-works/pi-coding-agent', { with: { 'resolution-mode': 'import' } }).ModelRuntime;
6
7
  type AuthInteraction = Parameters<ModelRuntime['login']>[2];
@@ -37,6 +38,7 @@ export declare namespace AuthServerUtil {
37
38
  export declare class TaAuthServerImpl implements TaAuthServer {
38
39
  protected readonly modelRuntimeProvider: ModelRuntimeProvider;
39
40
  protected readonly sessions: TaSessionRegistry;
41
+ protected readonly extensionProviders: ExtensionProviders;
40
42
  protected readonly codingAgentOptions?: CodingAgentOptions;
41
43
  protected readonly logins: Map<string, Login>;
42
44
  protected readonly watched: WeakSet<RpcConnection>;
@@ -16,6 +16,7 @@ const core_1 = require("@celljs/core");
16
16
  const rpc_1 = require("@celljs/rpc");
17
17
  const node_1 = require("@celljs/rpc/lib/node");
18
18
  const ta_protocol_1 = require("@celljs/ta-protocol");
19
+ const extension_providers_1 = require("./extension-providers");
19
20
  const host_protocol_1 = require("./host-protocol");
20
21
  const ta_errors_1 = require("./ta-errors");
21
22
  /** pi's message when a sign-in is cancelled; the client says so in its own words. */
@@ -129,6 +130,8 @@ let TaAuthServerImpl = class TaAuthServerImpl {
129
130
  listProviders() {
130
131
  return ta_errors_1.TaErrors.guard(async () => {
131
132
  const runtime = await this.modelRuntimeProvider.provide();
133
+ // Those of pi packages count, as in a session: an agent of ta-agents needs no sign-in here.
134
+ await this.extensionProviders.ensure();
132
135
  const stored = new Set((await runtime.listCredentials()).map(credential => credential.providerId));
133
136
  return AuthServerUtil.providers(runtime, stored);
134
137
  });
@@ -240,6 +243,10 @@ __decorate([
240
243
  (0, core_1.Autowired)(host_protocol_1.TaSessionRegistry),
241
244
  __metadata("design:type", Object)
242
245
  ], TaAuthServerImpl.prototype, "sessions", void 0);
246
+ __decorate([
247
+ (0, core_1.Autowired)(extension_providers_1.ExtensionProviders),
248
+ __metadata("design:type", Object)
249
+ ], TaAuthServerImpl.prototype, "extensionProviders", void 0);
243
250
  __decorate([
244
251
  (0, core_1.Value)(ai_coding_agent_1.CODING_AGENT_OPTIONS),
245
252
  __metadata("design:type", Object)
@@ -3,12 +3,16 @@ type ToolDefinition = import('@earendil-works/pi-coding-agent', { with: { 'resol
3
3
  interface PendingCall {
4
4
  request: TaClientToolRequest;
5
5
  settle(result: TaClientToolResult | undefined): void;
6
+ /** The client that took it to run (claim). */
7
+ runner?: object;
6
8
  }
7
9
  /**
8
10
  * The tools a session's clients run. Each is a tool of pi whose `execute` publishes the call and waits
9
- * for a client's answer: the model, codemode and extensions see it like any other tool. As with
10
- * dialogs, the call goes to every attached client and the first answer counts. A call ends without a
11
- * result when the run is aborted or the session closes.
11
+ * for a client's answer: the model, codemode and extensions see it like any other tool. The call goes to
12
+ * every attached client, and the first that claims it runs it: a tool that does something (opens a
13
+ * session) runs once, not once per page. A client that leaves before it answers lets the call go: it is
14
+ * published again for the others. A call ends without a result when the run is aborted or the session
15
+ * closes.
12
16
  */
13
17
  export declare class ClientToolBroker {
14
18
  protected readonly definitions: TaClientToolDefinition[];
@@ -21,6 +25,10 @@ export declare class ClientToolBroker {
21
25
  connect(publish: (event: TaEvent) => void): void;
22
26
  /** The tools for pi. */
23
27
  tools(): ToolDefinition[];
28
+ /** Whether `runner` runs the call: the first to ask does, and nobody else while it is there. */
29
+ claim(id: string, runner: object): boolean;
30
+ /** `runner` left the session: the calls it took and did not answer go to the others again. */
31
+ release(runner: object): void;
24
32
  /** False when nobody waits for this call. */
25
33
  respond(result: TaClientToolResult): boolean;
26
34
  cancelAll(): void;
@@ -5,9 +5,11 @@ const ta_errors_1 = require("./ta-errors");
5
5
  const TOOL_NAME = /^[A-Za-z][\w-]*$/;
6
6
  /**
7
7
  * The tools a session's clients run. Each is a tool of pi whose `execute` publishes the call and waits
8
- * for a client's answer: the model, codemode and extensions see it like any other tool. As with
9
- * dialogs, the call goes to every attached client and the first answer counts. A call ends without a
10
- * result when the run is aborted or the session closes.
8
+ * for a client's answer: the model, codemode and extensions see it like any other tool. The call goes to
9
+ * every attached client, and the first that claims it runs it: a tool that does something (opens a
10
+ * session) runs once, not once per page. A client that leaves before it answers lets the call go: it is
11
+ * published again for the others. A call ends without a result when the run is aborted or the session
12
+ * closes.
11
13
  */
12
14
  class ClientToolBroker {
13
15
  /** Throws CELL_TA_INVALID_ARGUMENT for a definition pi could not take. */
@@ -43,6 +45,24 @@ class ClientToolBroker {
43
45
  execute: (toolCallId, input, signal) => this.call(definition.name, toolCallId, input, signal),
44
46
  }));
45
47
  }
48
+ /** Whether `runner` runs the call: the first to ask does, and nobody else while it is there. */
49
+ claim(id, runner) {
50
+ const call = this.pending.get(id);
51
+ if (!call || (call.runner && call.runner !== runner)) {
52
+ return false;
53
+ }
54
+ call.runner = runner;
55
+ return true;
56
+ }
57
+ /** `runner` left the session: the calls it took and did not answer go to the others again. */
58
+ release(runner) {
59
+ for (const call of this.pending.values()) {
60
+ if (call.runner === runner) {
61
+ call.runner = undefined;
62
+ this.publish(call.request);
63
+ }
64
+ }
65
+ }
46
66
  /** False when nobody waits for this call. */
47
67
  respond(result) {
48
68
  const call = this.pending.get(result.id);
@@ -0,0 +1,23 @@
1
+ import { type CodingAgentOptions, ModelRuntimeProvider } from '@celljs/ai-coding-agent';
2
+ export declare const ExtensionProviders: unique symbol;
3
+ /**
4
+ * The model providers that pi packages register (`pi.registerProvider`), before any session: pi registers
5
+ * them in the model runtime that the sessions of ta serve share when it loads a session's extensions, so
6
+ * until a session opened, a client would see none of them (no sign-in, no model to pick).
7
+ */
8
+ export interface ExtensionProviders {
9
+ /** Loads the extensions of the user once, for the providers they register; later calls wait for that. */
10
+ ensure(): Promise<void>;
11
+ }
12
+ export declare class ExtensionProvidersImpl implements ExtensionProviders {
13
+ protected readonly codingAgentOptions?: CodingAgentOptions;
14
+ protected readonly modelRuntimeProvider: ModelRuntimeProvider;
15
+ protected loading?: Promise<void>;
16
+ ensure(): Promise<void>;
17
+ /**
18
+ * pi's services of a directory without a project (the home directory, its project resources not
19
+ * trusted): the built-in packages and those of the user's settings, as a session loads them.
20
+ */
21
+ protected load(): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=extension-providers.d.ts.map
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ExtensionProvidersImpl = exports.ExtensionProviders = void 0;
13
+ const node_os_1 = require("node:os");
14
+ const ai_coding_agent_1 = require("@celljs/ai-coding-agent");
15
+ const core_1 = require("@celljs/core");
16
+ const ta_harness_1 = require("@celljs/ta-harness");
17
+ exports.ExtensionProviders = Symbol('ExtensionProviders');
18
+ let ExtensionProvidersImpl = class ExtensionProvidersImpl {
19
+ ensure() {
20
+ var _a;
21
+ (_a = this.loading) !== null && _a !== void 0 ? _a : (this.loading = this.load().catch(() => undefined));
22
+ return this.loading;
23
+ }
24
+ /**
25
+ * pi's services of a directory without a project (the home directory, its project resources not
26
+ * trusted): the built-in packages and those of the user's settings, as a session loads them.
27
+ */
28
+ async load() {
29
+ var _a;
30
+ var _b;
31
+ const sdk = await ai_coding_agent_1.PiSdkUtil.load();
32
+ const agentDir = (_b = (_a = this.codingAgentOptions) === null || _a === void 0 ? void 0 : _a.agentDir) !== null && _b !== void 0 ? _b : sdk.getAgentDir();
33
+ const cwd = (0, node_os_1.homedir)();
34
+ await sdk.createAgentSessionServices({
35
+ cwd,
36
+ agentDir,
37
+ settingsManager: sdk.SettingsManager.create(cwd, agentDir, { projectTrusted: false }),
38
+ modelRuntime: await this.modelRuntimeProvider.provide(),
39
+ resourceLoaderOptions: ta_harness_1.TaPackages.loaderOptions(agentDir),
40
+ });
41
+ }
42
+ };
43
+ exports.ExtensionProvidersImpl = ExtensionProvidersImpl;
44
+ __decorate([
45
+ (0, core_1.Value)(ai_coding_agent_1.CODING_AGENT_OPTIONS),
46
+ __metadata("design:type", Object)
47
+ ], ExtensionProvidersImpl.prototype, "codingAgentOptions", void 0);
48
+ __decorate([
49
+ (0, core_1.Autowired)(ai_coding_agent_1.ModelRuntimeProvider),
50
+ __metadata("design:type", Object)
51
+ ], ExtensionProvidersImpl.prototype, "modelRuntimeProvider", void 0);
52
+ exports.ExtensionProvidersImpl = ExtensionProvidersImpl = __decorate([
53
+ (0, core_1.Component)(exports.ExtensionProviders)
54
+ ], ExtensionProvidersImpl);
55
+ //# sourceMappingURL=extension-providers.js.map
@@ -1,9 +1,10 @@
1
1
  import type { RpcConnection } from '@celljs/rpc/lib/node';
2
- import type { TaOpenSessionOptions, TaPackageInfo, TaSettingsScope, TaWebExtensionInfo, TaWebExtensionSource } from '@celljs/ta-protocol';
2
+ import type { TaOpenSessionOptions, TaPackageInfo, TaSavedSessionInfo, TaSettingsScope, TaTemporaryFrom, TaWebExtensionInfo, TaWebExtensionSource } from '@celljs/ta-protocol';
3
3
  import type { ClientChannel } from './client-channel';
4
4
  import type { TaSession } from './ta-session';
5
5
  export declare const TaSessionFactory: unique symbol;
6
6
  export declare const TaSessionRegistry: unique symbol;
7
+ export declare const TaSessionCatalog: unique symbol;
7
8
  export declare const WebExtensionCatalog: unique symbol;
8
9
  export declare const TA_HOST_OPTIONS = "ta.host";
9
10
  export declare const TA_EXEC_OPTIONS = "ta.exec";
@@ -11,6 +12,8 @@ export declare const TA_EXEC_OPTIONS = "ta.exec";
11
12
  export interface TaHostOptions {
12
13
  maxSessions: number;
13
14
  idleTimeoutMs: number;
15
+ /** How long a closing session waits for its run to stop and its extensions to shut down. */
16
+ closeTimeoutMs: number;
14
17
  eventBufferBytes: number;
15
18
  clientBacklogBytes: number;
16
19
  }
@@ -35,6 +38,11 @@ export interface TaSessionRegistry {
35
38
  closeAll(): Promise<void>;
36
39
  channel(connection: RpcConnection): ClientChannel;
37
40
  }
41
+ /** The conversations pi keeps in its session files, open or not. */
42
+ export interface TaSessionCatalog {
43
+ /** The latest first. */
44
+ list(): Promise<TaSavedSessionInfo[]>;
45
+ }
38
46
  /** The packages pi loads in a directory, and their web extensions. */
39
47
  export interface WebExtensionCatalog {
40
48
  packages(cwd: string): Promise<TaPackageInfo[]>;
@@ -52,5 +60,18 @@ export interface WebExtensionCatalog {
52
60
  * id, in pi's settings as `pi config` does (PackageSwitch), or in ta's when pi loads nothing of it.
53
61
  */
54
62
  setEnabled(cwd: string, nameOrId: string, enabled: boolean): Promise<void>;
63
+ /** A package of {@link packages} by its id, or the id of one of its web extensions. */
64
+ packageOf(cwd: string, id: string): Promise<TaPackageInfo>;
65
+ /** Opens a package without installing it (TemporaryStore); its web extensions. */
66
+ openTemporary(cwd: string, source: string, from: TaTemporaryFrom): Promise<TaWebExtensionInfo[]>;
67
+ updateTemporary(cwd: string, id: string, change: {
68
+ used?: boolean;
69
+ kept?: boolean;
70
+ }): Promise<void>;
71
+ installTemporary(cwd: string, id: string): Promise<void>;
72
+ /** Removes the temporary packages unused too long; how many went. */
73
+ purgeTemporary(cwd: string): Promise<number>;
74
+ readonly temporaryRetention: number;
75
+ setTemporaryRetention(days: number): void;
55
76
  }
56
77
  //# sourceMappingURL=host-protocol.d.ts.map
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TA_EXEC_OPTIONS = exports.TA_HOST_OPTIONS = exports.WebExtensionCatalog = exports.TaSessionRegistry = exports.TaSessionFactory = void 0;
3
+ exports.TA_EXEC_OPTIONS = exports.TA_HOST_OPTIONS = exports.WebExtensionCatalog = exports.TaSessionCatalog = exports.TaSessionRegistry = exports.TaSessionFactory = void 0;
4
4
  exports.TaSessionFactory = Symbol('TaSessionFactory');
5
5
  exports.TaSessionRegistry = Symbol('TaSessionRegistry');
6
+ exports.TaSessionCatalog = Symbol('TaSessionCatalog');
6
7
  exports.WebExtensionCatalog = Symbol('WebExtensionCatalog');
7
8
  exports.TA_HOST_OPTIONS = 'ta.host';
8
9
  exports.TA_EXEC_OPTIONS = 'ta.exec';
@@ -5,6 +5,7 @@ export * from './event-log';
5
5
  export * from './exec-environment-factory';
6
6
  export * from './extension-data';
7
7
  export * from './extension-data-notifier';
8
+ export * from './extension-providers';
8
9
  export * from './host-protocol';
9
10
  export * from './package-host-extension';
10
11
  export * from './package-hosts';
@@ -13,10 +14,13 @@ export * from './receipt-book';
13
14
  export * from './relay-bridge';
14
15
  export * from './remote';
15
16
  export * from './remote-ui-context';
17
+ export * from './session-catalog';
18
+ export * from './session-files';
16
19
  export * from './session-info-util';
17
20
  export * from './session-storage';
18
21
  export * from './settings-server-impl';
19
22
  export * from './settings-store';
23
+ export * from './sign-in';
20
24
  export * from './ta-access';
21
25
  export * from './ta-errors';
22
26
  export * from './ta-event-util';
@@ -24,6 +28,8 @@ export * from './ta-server-impl';
24
28
  export * from './ta-session';
25
29
  export * from './ta-session-factory';
26
30
  export * from './ta-session-registry';
31
+ export * from './temporary-packages';
32
+ export * from './temporary-purge';
27
33
  export * from './terminal-protocol';
28
34
  export * from './terminal-service';
29
35
  export * from './terminal-util';
package/lib/node/index.js CHANGED
@@ -21,6 +21,7 @@ __exportStar(require("./event-log"), exports);
21
21
  __exportStar(require("./exec-environment-factory"), exports);
22
22
  __exportStar(require("./extension-data"), exports);
23
23
  __exportStar(require("./extension-data-notifier"), exports);
24
+ __exportStar(require("./extension-providers"), exports);
24
25
  __exportStar(require("./host-protocol"), exports);
25
26
  __exportStar(require("./package-host-extension"), exports);
26
27
  __exportStar(require("./package-hosts"), exports);
@@ -29,10 +30,13 @@ __exportStar(require("./receipt-book"), exports);
29
30
  __exportStar(require("./relay-bridge"), exports);
30
31
  __exportStar(require("./remote"), exports);
31
32
  __exportStar(require("./remote-ui-context"), exports);
33
+ __exportStar(require("./session-catalog"), exports);
34
+ __exportStar(require("./session-files"), exports);
32
35
  __exportStar(require("./session-info-util"), exports);
33
36
  __exportStar(require("./session-storage"), exports);
34
37
  __exportStar(require("./settings-server-impl"), exports);
35
38
  __exportStar(require("./settings-store"), exports);
39
+ __exportStar(require("./sign-in"), exports);
36
40
  __exportStar(require("./ta-access"), exports);
37
41
  __exportStar(require("./ta-errors"), exports);
38
42
  __exportStar(require("./ta-event-util"), exports);
@@ -40,6 +44,8 @@ __exportStar(require("./ta-server-impl"), exports);
40
44
  __exportStar(require("./ta-session"), exports);
41
45
  __exportStar(require("./ta-session-factory"), exports);
42
46
  __exportStar(require("./ta-session-registry"), exports);
47
+ __exportStar(require("./temporary-packages"), exports);
48
+ __exportStar(require("./temporary-purge"), exports);
43
49
  __exportStar(require("./terminal-protocol"), exports);
44
50
  __exportStar(require("./terminal-service"), exports);
45
51
  __exportStar(require("./terminal-util"), exports);
@@ -0,0 +1,23 @@
1
+ import type { TaConversation, TaMessage, TaToolRun } from '@celljs/ta-protocol';
2
+ type AgentSessionEvent = import('@earendil-works/pi-coding-agent', { with: { 'resolution-mode': 'import' } }).AgentSessionEvent;
3
+ /**
4
+ * The run of now as the events sent so far left it, for a client that attaches without them. pi's
5
+ * messages lack the one the model is writing, and run ahead of the events by the one pi is delivering:
6
+ * pi updates its state first, then waits for the extensions before it emits. So this keeps, from the
7
+ * events as they go out, the messages they ended, the message they started, and the calls of tools.
8
+ */
9
+ export declare class LiveRun {
10
+ /** How many of pi's messages the events sent have ended. */
11
+ protected ended: number;
12
+ /** The message being written, as its last event had it. */
13
+ protected writing?: TaMessage;
14
+ protected tools: Record<string, TaToolRun>;
15
+ /** pi's messages are those of the events sent: at the start, and when the conversation is another or compacted. */
16
+ reset(messages: readonly TaMessage[]): void;
17
+ /** An event of pi as it is sent, with pi's messages of that moment. */
18
+ observe(event: AgentSessionEvent, messages: readonly TaMessage[]): void;
19
+ /** The conversation of the events sent; idle, pi's messages are all sent. */
20
+ conversation(messages: readonly TaMessage[], running: boolean): TaConversation;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=live-run.d.ts.map
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiveRun = void 0;
4
+ /**
5
+ * The run of now as the events sent so far left it, for a client that attaches without them. pi's
6
+ * messages lack the one the model is writing, and run ahead of the events by the one pi is delivering:
7
+ * pi updates its state first, then waits for the extensions before it emits. So this keeps, from the
8
+ * events as they go out, the messages they ended, the message they started, and the calls of tools.
9
+ */
10
+ class LiveRun {
11
+ constructor() {
12
+ /** How many of pi's messages the events sent have ended. */
13
+ this.ended = 0;
14
+ this.tools = {};
15
+ }
16
+ /** pi's messages are those of the events sent: at the start, and when the conversation is another or compacted. */
17
+ reset(messages) {
18
+ this.ended = messages.length;
19
+ this.writing = undefined;
20
+ this.tools = {};
21
+ }
22
+ /** An event of pi as it is sent, with pi's messages of that moment. */
23
+ observe(event, messages) {
24
+ switch (event.type) {
25
+ case 'agent_start':
26
+ case 'agent_settled':
27
+ case 'compaction_end':
28
+ this.reset(messages);
29
+ break;
30
+ case 'message_start':
31
+ case 'message_update':
32
+ this.writing = event.message;
33
+ break;
34
+ case 'message_end':
35
+ this.writing = undefined;
36
+ this.ended = messages.length;
37
+ break;
38
+ case 'tool_execution_start': {
39
+ const { parentToolCallId } = event;
40
+ const run = { toolName: event.toolName, args: event.args, status: 'running' };
41
+ this.tools[event.toolCallId] = parentToolCallId ? { ...run, parentToolCallId } : run;
42
+ break;
43
+ }
44
+ case 'tool_execution_update':
45
+ this.tools[event.toolCallId] = { ...this.tools[event.toolCallId], result: event.partialResult };
46
+ break;
47
+ case 'tool_execution_end':
48
+ this.tools[event.toolCallId] = { ...this.tools[event.toolCallId], result: event.result, status: event.isError ? 'error' : 'done' };
49
+ break;
50
+ }
51
+ }
52
+ /** The conversation of the events sent; idle, pi's messages are all sent. */
53
+ conversation(messages, running) {
54
+ if (!running) {
55
+ return { messages: [...messages], tools: {} };
56
+ }
57
+ const ended = messages.slice(0, this.ended);
58
+ return { messages: this.writing ? [...ended, this.writing] : ended, tools: { ...this.tools } };
59
+ }
60
+ }
61
+ exports.LiveRun = LiveRun;
62
+ //# sourceMappingURL=live-run.js.map
@@ -0,0 +1,18 @@
1
+ import type { TaConversation, TaMessage, TaMessagePage } from '@celljs/ta-protocol';
2
+ /**
3
+ * The parts of a long conversation a client loads one at a time, the latest first: about so many bytes
4
+ * of JSON each, as the client gets them.
5
+ */
6
+ export declare namespace MessagePage {
7
+ function size(message: TaMessage): number;
8
+ /**
9
+ * Where the messages before `end` that fit in `budget` start: at least one; back to the message that
10
+ * asked for their turn if that takes no more than twice the budget, so that a turn shows whole.
11
+ */
12
+ function start(messages: readonly TaMessage[], end: number, budget: number): number;
13
+ /** The latest part of a conversation, or all of it without a budget. */
14
+ function recent(conversation: TaConversation, budget: number | undefined): TaConversation;
15
+ /** The part before message `before`, found again by its timestamp if messages came or went before it. */
16
+ function before(messages: readonly TaMessage[], before: number | undefined, stamp: number | undefined, budget: number): TaMessagePage;
17
+ }
18
+ //# sourceMappingURL=message-page.d.ts.map
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessagePage = void 0;
4
+ /** The roles of the messages of one turn of the model, after the message that asked. */
5
+ const TURN_ROLES = new Set(['assistant', 'toolResult']);
6
+ /** Sizes of the messages already measured: they do not change once written. */
7
+ const sizes = new WeakMap();
8
+ /**
9
+ * The parts of a long conversation a client loads one at a time, the latest first: about so many bytes
10
+ * of JSON each, as the client gets them.
11
+ */
12
+ var MessagePage;
13
+ (function (MessagePage) {
14
+ function size(message) {
15
+ let known = sizes.get(message);
16
+ if (known === undefined) {
17
+ known = JSON.stringify(message).length;
18
+ sizes.set(message, known);
19
+ }
20
+ return known;
21
+ }
22
+ MessagePage.size = size;
23
+ function role(message) {
24
+ return message === null || message === void 0 ? void 0 : message.role;
25
+ }
26
+ function timestamp(message) {
27
+ return message === null || message === void 0 ? void 0 : message.timestamp;
28
+ }
29
+ /**
30
+ * Where the messages before `end` that fit in `budget` start: at least one; back to the message that
31
+ * asked for their turn if that takes no more than twice the budget, so that a turn shows whole.
32
+ */
33
+ function start(messages, end, budget) {
34
+ var _a;
35
+ let start = end;
36
+ let used = 0;
37
+ while (start > 0 && (start === end || used + size(messages[start - 1]) <= budget)) {
38
+ start--;
39
+ used += size(messages[start]);
40
+ }
41
+ while (start > 0 && TURN_ROLES.has((_a = role(messages[start])) !== null && _a !== void 0 ? _a : '') && used + size(messages[start - 1]) <= budget * 2) {
42
+ start--;
43
+ used += size(messages[start]);
44
+ }
45
+ return start;
46
+ }
47
+ MessagePage.start = start;
48
+ /** The latest part of a conversation, or all of it without a budget. */
49
+ function recent(conversation, budget) {
50
+ if (!budget || budget <= 0) {
51
+ return conversation;
52
+ }
53
+ const from = start(conversation.messages, conversation.messages.length, budget);
54
+ return from === 0 ? conversation : { ...conversation, messages: conversation.messages.slice(from), start: from };
55
+ }
56
+ MessagePage.recent = recent;
57
+ /** The part before message `before`, found again by its timestamp if messages came or went before it. */
58
+ function before(messages, before, stamp, budget) {
59
+ let end = before !== null && before !== void 0 ? before : messages.length;
60
+ if (before !== undefined && (before > messages.length || timestamp(messages[before]) !== stamp)) {
61
+ end = messages.length - 1;
62
+ while (end >= 0 && (stamp === undefined || timestamp(messages[end]) !== stamp)) {
63
+ end--;
64
+ }
65
+ if (end < 0) {
66
+ return { messages: [], start: 0, found: false };
67
+ }
68
+ }
69
+ const from = start(messages, end, Math.max(1, budget));
70
+ return { messages: messages.slice(from, end), start: from, found: true };
71
+ }
72
+ MessagePage.before = before;
73
+ })(MessagePage || (exports.MessagePage = MessagePage = {}));
74
+ //# sourceMappingURL=message-page.js.map
@@ -1,10 +1,12 @@
1
1
  import type { ExtensionAPI, TaExtension } from '@celljs/ta-harness';
2
+ import { type TaSessionFiles } from '@celljs/ta-protocol';
2
3
  import type { PackageHosts } from './package-hosts';
3
- /** Answers the pi extensions of a session that ask for the host of their package (TA_HOST_EVENT). */
4
+ /** Answers the pi extensions of a session that ask for the host of their package (TA_HOST_EVENT), with the session's files. */
4
5
  export declare class PackageHostExtension implements TaExtension {
5
6
  protected readonly hosts: PackageHosts;
7
+ protected readonly files: TaSessionFiles;
6
8
  readonly name = "ta-package-host";
7
- constructor(hosts: PackageHosts);
9
+ constructor(hosts: PackageHosts, files: TaSessionFiles);
8
10
  register(pi: ExtensionAPI): void;
9
11
  }
10
12
  //# sourceMappingURL=package-host-extension.d.ts.map
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PackageHostExtension = void 0;
4
4
  const ta_protocol_1 = require("@celljs/ta-protocol");
5
- /** Answers the pi extensions of a session that ask for the host of their package (TA_HOST_EVENT). */
5
+ /** Answers the pi extensions of a session that ask for the host of their package (TA_HOST_EVENT), with the session's files. */
6
6
  class PackageHostExtension {
7
- constructor(hosts) {
7
+ constructor(hosts, files) {
8
8
  this.hosts = hosts;
9
+ this.files = files;
9
10
  this.name = 'ta-package-host';
10
11
  }
11
12
  register(pi) {
@@ -13,7 +14,7 @@ class PackageHostExtension {
13
14
  const request = data;
14
15
  if (typeof (request === null || request === void 0 ? void 0 : request.name) === 'string' && typeof request.resolve === 'function') {
15
16
  const resolve = request.resolve;
16
- void this.hosts.answer(request.name).then(answer => resolve(answer));
17
+ void this.hosts.answer(request.name).then(answer => resolve({ ...answer, files: this.files }));
17
18
  }
18
19
  });
19
20
  }