parasor 0.1.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 (633) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +208 -0
  3. package/THIRD-PARTY-NOTICES.md +138 -0
  4. package/bin/parasor.mjs +3 -0
  5. package/node_modules/@parasor/shared/dist/client.d.ts +8 -0
  6. package/node_modules/@parasor/shared/dist/client.d.ts.map +1 -0
  7. package/node_modules/@parasor/shared/dist/client.js +2 -0
  8. package/node_modules/@parasor/shared/dist/client.js.map +1 -0
  9. package/node_modules/@parasor/shared/dist/drops.d.ts +24 -0
  10. package/node_modules/@parasor/shared/dist/drops.d.ts.map +1 -0
  11. package/node_modules/@parasor/shared/dist/drops.js +2 -0
  12. package/node_modules/@parasor/shared/dist/drops.js.map +1 -0
  13. package/node_modules/@parasor/shared/dist/file-uploads.d.ts +56 -0
  14. package/node_modules/@parasor/shared/dist/file-uploads.d.ts.map +1 -0
  15. package/node_modules/@parasor/shared/dist/file-uploads.js +13 -0
  16. package/node_modules/@parasor/shared/dist/file-uploads.js.map +1 -0
  17. package/node_modules/@parasor/shared/dist/ide-commands.d.ts +8 -0
  18. package/node_modules/@parasor/shared/dist/ide-commands.d.ts.map +1 -0
  19. package/node_modules/@parasor/shared/dist/ide-commands.js +59 -0
  20. package/node_modules/@parasor/shared/dist/ide-commands.js.map +1 -0
  21. package/node_modules/@parasor/shared/dist/pane-commands.d.ts +7 -0
  22. package/node_modules/@parasor/shared/dist/pane-commands.d.ts.map +1 -0
  23. package/node_modules/@parasor/shared/dist/pane-commands.js +47 -0
  24. package/node_modules/@parasor/shared/dist/pane-commands.js.map +1 -0
  25. package/node_modules/@parasor/shared/dist/pane-model.d.ts +63 -0
  26. package/node_modules/@parasor/shared/dist/pane-model.d.ts.map +1 -0
  27. package/node_modules/@parasor/shared/dist/pane-model.js +89 -0
  28. package/node_modules/@parasor/shared/dist/pane-model.js.map +1 -0
  29. package/node_modules/@parasor/shared/dist/panes.d.ts +33 -0
  30. package/node_modules/@parasor/shared/dist/panes.d.ts.map +1 -0
  31. package/node_modules/@parasor/shared/dist/panes.js +2 -0
  32. package/node_modules/@parasor/shared/dist/panes.js.map +1 -0
  33. package/node_modules/@parasor/shared/dist/runtime.d.ts +180 -0
  34. package/node_modules/@parasor/shared/dist/runtime.d.ts.map +1 -0
  35. package/node_modules/@parasor/shared/dist/runtime.js +2 -0
  36. package/node_modules/@parasor/shared/dist/runtime.js.map +1 -0
  37. package/node_modules/@parasor/shared/dist/state.d.ts +192 -0
  38. package/node_modules/@parasor/shared/dist/state.d.ts.map +1 -0
  39. package/node_modules/@parasor/shared/dist/state.js +10 -0
  40. package/node_modules/@parasor/shared/dist/state.js.map +1 -0
  41. package/node_modules/@parasor/shared/dist/terminal.d.ts +191 -0
  42. package/node_modules/@parasor/shared/dist/terminal.d.ts.map +1 -0
  43. package/node_modules/@parasor/shared/dist/terminal.js +174 -0
  44. package/node_modules/@parasor/shared/dist/terminal.js.map +1 -0
  45. package/node_modules/@parasor/shared/dist/types.d.ts +13 -0
  46. package/node_modules/@parasor/shared/dist/types.d.ts.map +1 -0
  47. package/node_modules/@parasor/shared/dist/types.js +13 -0
  48. package/node_modules/@parasor/shared/dist/types.js.map +1 -0
  49. package/node_modules/@parasor/shared/dist/worktree-local-files.d.ts +14 -0
  50. package/node_modules/@parasor/shared/dist/worktree-local-files.d.ts.map +1 -0
  51. package/node_modules/@parasor/shared/dist/worktree-local-files.js +41 -0
  52. package/node_modules/@parasor/shared/dist/worktree-local-files.js.map +1 -0
  53. package/node_modules/@parasor/shared/dist/ws-events.d.ts +152 -0
  54. package/node_modules/@parasor/shared/dist/ws-events.d.ts.map +1 -0
  55. package/node_modules/@parasor/shared/dist/ws-events.js +2 -0
  56. package/node_modules/@parasor/shared/dist/ws-events.js.map +1 -0
  57. package/node_modules/@parasor/shared/package.json +13 -0
  58. package/package.json +61 -0
  59. package/server/agent-detector/agent-state-store.d.ts +23 -0
  60. package/server/agent-detector/agent-state-store.d.ts.map +1 -0
  61. package/server/agent-detector/agent-state-store.js +110 -0
  62. package/server/agent-detector/agent-state-store.js.map +1 -0
  63. package/server/agent-detector/detector.d.ts +80 -0
  64. package/server/agent-detector/detector.d.ts.map +1 -0
  65. package/server/agent-detector/detector.js +219 -0
  66. package/server/agent-detector/detector.js.map +1 -0
  67. package/server/agent-detector/event-map.d.ts +25 -0
  68. package/server/agent-detector/event-map.d.ts.map +1 -0
  69. package/server/agent-detector/event-map.js +136 -0
  70. package/server/agent-detector/event-map.js.map +1 -0
  71. package/server/agent-detector/manual-agent-tracker.d.ts +19 -0
  72. package/server/agent-detector/manual-agent-tracker.d.ts.map +1 -0
  73. package/server/agent-detector/manual-agent-tracker.js +123 -0
  74. package/server/agent-detector/manual-agent-tracker.js.map +1 -0
  75. package/server/agent-detector/output-eligibility.d.ts +3 -0
  76. package/server/agent-detector/output-eligibility.d.ts.map +1 -0
  77. package/server/agent-detector/output-eligibility.js +39 -0
  78. package/server/agent-detector/output-eligibility.js.map +1 -0
  79. package/server/application/files/errors.d.ts +28 -0
  80. package/server/application/files/errors.d.ts.map +1 -0
  81. package/server/application/files/errors.js +55 -0
  82. package/server/application/files/errors.js.map +1 -0
  83. package/server/application/files/local-filesystem.d.ts +36 -0
  84. package/server/application/files/local-filesystem.d.ts.map +1 -0
  85. package/server/application/files/local-filesystem.js +171 -0
  86. package/server/application/files/local-filesystem.js.map +1 -0
  87. package/server/application/files/project-file-queries.d.ts +16 -0
  88. package/server/application/files/project-file-queries.d.ts.map +1 -0
  89. package/server/application/files/project-file-queries.js +126 -0
  90. package/server/application/files/project-file-queries.js.map +1 -0
  91. package/server/application/integrations/errors.d.ts +16 -0
  92. package/server/application/integrations/errors.d.ts.map +1 -0
  93. package/server/application/integrations/errors.js +31 -0
  94. package/server/application/integrations/errors.js.map +1 -0
  95. package/server/application/integrations/hook-notify.d.ts +32 -0
  96. package/server/application/integrations/hook-notify.d.ts.map +1 -0
  97. package/server/application/integrations/hook-notify.js +118 -0
  98. package/server/application/integrations/hook-notify.js.map +1 -0
  99. package/server/application/integrations/open-url.d.ts +11 -0
  100. package/server/application/integrations/open-url.d.ts.map +1 -0
  101. package/server/application/integrations/open-url.js +23 -0
  102. package/server/application/integrations/open-url.js.map +1 -0
  103. package/server/application/ports.d.ts +11 -0
  104. package/server/application/ports.d.ts.map +1 -0
  105. package/server/application/ports.js +2 -0
  106. package/server/application/ports.js.map +1 -0
  107. package/server/application/workspace/errors.d.ts +21 -0
  108. package/server/application/workspace/errors.d.ts.map +1 -0
  109. package/server/application/workspace/errors.js +21 -0
  110. package/server/application/workspace/errors.js.map +1 -0
  111. package/server/application/workspace/pane-commands.d.ts +47 -0
  112. package/server/application/workspace/pane-commands.d.ts.map +1 -0
  113. package/server/application/workspace/pane-commands.js +193 -0
  114. package/server/application/workspace/pane-commands.js.map +1 -0
  115. package/server/application/workspace/project-commands.d.ts +34 -0
  116. package/server/application/workspace/project-commands.d.ts.map +1 -0
  117. package/server/application/workspace/project-commands.js +81 -0
  118. package/server/application/workspace/project-commands.js.map +1 -0
  119. package/server/application/workspace/project-queries.d.ts +21 -0
  120. package/server/application/workspace/project-queries.d.ts.map +1 -0
  121. package/server/application/workspace/project-queries.js +216 -0
  122. package/server/application/workspace/project-queries.js.map +1 -0
  123. package/server/application/workspace/session-commands.d.ts +24 -0
  124. package/server/application/workspace/session-commands.d.ts.map +1 -0
  125. package/server/application/workspace/session-commands.js +123 -0
  126. package/server/application/workspace/session-commands.js.map +1 -0
  127. package/server/application/workspace/session-queries.d.ts +14 -0
  128. package/server/application/workspace/session-queries.d.ts.map +1 -0
  129. package/server/application/workspace/session-queries.js +47 -0
  130. package/server/application/workspace/session-queries.js.map +1 -0
  131. package/server/application/workspace/worktree-commands.d.ts +98 -0
  132. package/server/application/workspace/worktree-commands.d.ts.map +1 -0
  133. package/server/application/workspace/worktree-commands.js +323 -0
  134. package/server/application/workspace/worktree-commands.js.map +1 -0
  135. package/server/application/workspace/worktree-local-files.d.ts +11 -0
  136. package/server/application/workspace/worktree-local-files.d.ts.map +1 -0
  137. package/server/application/workspace/worktree-local-files.js +223 -0
  138. package/server/application/workspace/worktree-local-files.js.map +1 -0
  139. package/server/application/workspace/worktree-reconcile.d.ts +21 -0
  140. package/server/application/workspace/worktree-reconcile.d.ts.map +1 -0
  141. package/server/application/workspace/worktree-reconcile.js +49 -0
  142. package/server/application/workspace/worktree-reconcile.js.map +1 -0
  143. package/server/auth/origin.d.ts +17 -0
  144. package/server/auth/origin.d.ts.map +1 -0
  145. package/server/auth/origin.js +93 -0
  146. package/server/auth/origin.js.map +1 -0
  147. package/server/auth/pairing-token.d.ts +28 -0
  148. package/server/auth/pairing-token.d.ts.map +1 -0
  149. package/server/auth/pairing-token.js +46 -0
  150. package/server/auth/pairing-token.js.map +1 -0
  151. package/server/auth/token-exchange.d.ts +11 -0
  152. package/server/auth/token-exchange.d.ts.map +1 -0
  153. package/server/auth/token-exchange.js +27 -0
  154. package/server/auth/token-exchange.js.map +1 -0
  155. package/server/auth/token.d.ts +18 -0
  156. package/server/auth/token.d.ts.map +1 -0
  157. package/server/auth/token.js +115 -0
  158. package/server/auth/token.js.map +1 -0
  159. package/server/bootstrap/create-app-server.d.ts +49 -0
  160. package/server/bootstrap/create-app-server.d.ts.map +1 -0
  161. package/server/bootstrap/create-app-server.js +154 -0
  162. package/server/bootstrap/create-app-server.js.map +1 -0
  163. package/server/bootstrap/project-runtime.d.ts +29 -0
  164. package/server/bootstrap/project-runtime.d.ts.map +1 -0
  165. package/server/bootstrap/project-runtime.js +253 -0
  166. package/server/bootstrap/project-runtime.js.map +1 -0
  167. package/server/bootstrap/pty-env.d.ts +3 -0
  168. package/server/bootstrap/pty-env.d.ts.map +1 -0
  169. package/server/bootstrap/pty-env.js +15 -0
  170. package/server/bootstrap/pty-env.js.map +1 -0
  171. package/server/bootstrap/reconcile-state.d.ts +16 -0
  172. package/server/bootstrap/reconcile-state.d.ts.map +1 -0
  173. package/server/bootstrap/reconcile-state.js +73 -0
  174. package/server/bootstrap/reconcile-state.js.map +1 -0
  175. package/server/bootstrap/runtime-loops.d.ts +51 -0
  176. package/server/bootstrap/runtime-loops.d.ts.map +1 -0
  177. package/server/bootstrap/runtime-loops.js +189 -0
  178. package/server/bootstrap/runtime-loops.js.map +1 -0
  179. package/server/bootstrap/runtime-port.d.ts +4 -0
  180. package/server/bootstrap/runtime-port.d.ts.map +1 -0
  181. package/server/bootstrap/runtime-port.js +52 -0
  182. package/server/bootstrap/runtime-port.js.map +1 -0
  183. package/server/bootstrap/safety-gate.d.ts +22 -0
  184. package/server/bootstrap/safety-gate.d.ts.map +1 -0
  185. package/server/bootstrap/safety-gate.js +43 -0
  186. package/server/bootstrap/safety-gate.js.map +1 -0
  187. package/server/bootstrap/shutdown-marker.d.ts +35 -0
  188. package/server/bootstrap/shutdown-marker.d.ts.map +1 -0
  189. package/server/bootstrap/shutdown-marker.js +100 -0
  190. package/server/bootstrap/shutdown-marker.js.map +1 -0
  191. package/server/bootstrap/shutdown-runtime.d.ts +62 -0
  192. package/server/bootstrap/shutdown-runtime.d.ts.map +1 -0
  193. package/server/bootstrap/shutdown-runtime.js +66 -0
  194. package/server/bootstrap/shutdown-runtime.js.map +1 -0
  195. package/server/bootstrap/startup-banner.d.ts +34 -0
  196. package/server/bootstrap/startup-banner.d.ts.map +1 -0
  197. package/server/bootstrap/startup-banner.js +114 -0
  198. package/server/bootstrap/startup-banner.js.map +1 -0
  199. package/server/bootstrap/wire-runtime.d.ts +42 -0
  200. package/server/bootstrap/wire-runtime.d.ts.map +1 -0
  201. package/server/bootstrap/wire-runtime.js +205 -0
  202. package/server/bootstrap/wire-runtime.js.map +1 -0
  203. package/server/cli/help.d.ts +3 -0
  204. package/server/cli/help.d.ts.map +1 -0
  205. package/server/cli/help.js +39 -0
  206. package/server/cli/help.js.map +1 -0
  207. package/server/cli/hook-client.d.ts +12 -0
  208. package/server/cli/hook-client.d.ts.map +1 -0
  209. package/server/cli/hook-client.js +81 -0
  210. package/server/cli/hook-client.js.map +1 -0
  211. package/server/cli/hook.d.ts +3 -0
  212. package/server/cli/hook.d.ts.map +1 -0
  213. package/server/cli/hook.js +152 -0
  214. package/server/cli/hook.js.map +1 -0
  215. package/server/cli/main.d.ts +2 -0
  216. package/server/cli/main.d.ts.map +1 -0
  217. package/server/cli/main.js +133 -0
  218. package/server/cli/main.js.map +1 -0
  219. package/server/cli/notify.d.ts +19 -0
  220. package/server/cli/notify.d.ts.map +1 -0
  221. package/server/cli/notify.js +77 -0
  222. package/server/cli/notify.js.map +1 -0
  223. package/server/cli/open.d.ts +2 -0
  224. package/server/cli/open.d.ts.map +1 -0
  225. package/server/cli/open.js +47 -0
  226. package/server/cli/open.js.map +1 -0
  227. package/server/cli/probe-daemon-version.d.ts +46 -0
  228. package/server/cli/probe-daemon-version.d.ts.map +1 -0
  229. package/server/cli/probe-daemon-version.js +167 -0
  230. package/server/cli/probe-daemon-version.js.map +1 -0
  231. package/server/cli/pty-host.d.ts +36 -0
  232. package/server/cli/pty-host.d.ts.map +1 -0
  233. package/server/cli/pty-host.js +390 -0
  234. package/server/cli/pty-host.js.map +1 -0
  235. package/server/cli/qr.d.ts +2 -0
  236. package/server/cli/qr.d.ts.map +1 -0
  237. package/server/cli/qr.js +70 -0
  238. package/server/cli/qr.js.map +1 -0
  239. package/server/cli/restart-confirm.d.ts +33 -0
  240. package/server/cli/restart-confirm.d.ts.map +1 -0
  241. package/server/cli/restart-confirm.js +107 -0
  242. package/server/cli/restart-confirm.js.map +1 -0
  243. package/server/cli/restart.d.ts +17 -0
  244. package/server/cli/restart.d.ts.map +1 -0
  245. package/server/cli/restart.js +145 -0
  246. package/server/cli/restart.js.map +1 -0
  247. package/server/cli/service-darwin.d.ts +70 -0
  248. package/server/cli/service-darwin.d.ts.map +1 -0
  249. package/server/cli/service-darwin.js +562 -0
  250. package/server/cli/service-darwin.js.map +1 -0
  251. package/server/cli/service-linux.d.ts +81 -0
  252. package/server/cli/service-linux.d.ts.map +1 -0
  253. package/server/cli/service-linux.js +412 -0
  254. package/server/cli/service-linux.js.map +1 -0
  255. package/server/cli/service.d.ts +33 -0
  256. package/server/cli/service.d.ts.map +1 -0
  257. package/server/cli/service.js +133 -0
  258. package/server/cli/service.js.map +1 -0
  259. package/server/cli/shim-installer.d.ts +35 -0
  260. package/server/cli/shim-installer.d.ts.map +1 -0
  261. package/server/cli/shim-installer.js +662 -0
  262. package/server/cli/shim-installer.js.map +1 -0
  263. package/server/cli/shim-open.d.ts +2 -0
  264. package/server/cli/shim-open.d.ts.map +1 -0
  265. package/server/cli/shim-open.js +128 -0
  266. package/server/cli/shim-open.js.map +1 -0
  267. package/server/cli/shutdown-deps.d.ts +41 -0
  268. package/server/cli/shutdown-deps.d.ts.map +1 -0
  269. package/server/cli/shutdown-deps.js +158 -0
  270. package/server/cli/shutdown-deps.js.map +1 -0
  271. package/server/cli/stop.d.ts +11 -0
  272. package/server/cli/stop.d.ts.map +1 -0
  273. package/server/cli/stop.js +123 -0
  274. package/server/cli/stop.js.map +1 -0
  275. package/server/cli/unknown-command.d.ts +8 -0
  276. package/server/cli/unknown-command.d.ts.map +1 -0
  277. package/server/cli/unknown-command.js +14 -0
  278. package/server/cli/unknown-command.js.map +1 -0
  279. package/server/debug/agent-status-recorder.d.ts +57 -0
  280. package/server/debug/agent-status-recorder.d.ts.map +1 -0
  281. package/server/debug/agent-status-recorder.js +209 -0
  282. package/server/debug/agent-status-recorder.js.map +1 -0
  283. package/server/debug/terminal-trace-recorder.d.ts +41 -0
  284. package/server/debug/terminal-trace-recorder.d.ts.map +1 -0
  285. package/server/debug/terminal-trace-recorder.js +112 -0
  286. package/server/debug/terminal-trace-recorder.js.map +1 -0
  287. package/server/fonts/catalog.d.ts +35 -0
  288. package/server/fonts/catalog.d.ts.map +1 -0
  289. package/server/fonts/catalog.js +76 -0
  290. package/server/fonts/catalog.js.map +1 -0
  291. package/server/fonts/installer.d.ts +45 -0
  292. package/server/fonts/installer.d.ts.map +1 -0
  293. package/server/fonts/installer.js +201 -0
  294. package/server/fonts/installer.js.map +1 -0
  295. package/server/fonts/routes.d.ts +4 -0
  296. package/server/fonts/routes.d.ts.map +1 -0
  297. package/server/fonts/routes.js +91 -0
  298. package/server/fonts/routes.js.map +1 -0
  299. package/server/fs/drops.d.ts +50 -0
  300. package/server/fs/drops.d.ts.map +1 -0
  301. package/server/fs/drops.js +137 -0
  302. package/server/fs/drops.js.map +1 -0
  303. package/server/fs/file-uploads.d.ts +57 -0
  304. package/server/fs/file-uploads.d.ts.map +1 -0
  305. package/server/fs/file-uploads.js +214 -0
  306. package/server/fs/file-uploads.js.map +1 -0
  307. package/server/fs/file-watcher.d.ts +22 -0
  308. package/server/fs/file-watcher.d.ts.map +1 -0
  309. package/server/fs/file-watcher.js +105 -0
  310. package/server/fs/file-watcher.js.map +1 -0
  311. package/server/fs/git-watcher.d.ts +76 -0
  312. package/server/fs/git-watcher.d.ts.map +1 -0
  313. package/server/fs/git-watcher.js +356 -0
  314. package/server/fs/git-watcher.js.map +1 -0
  315. package/server/fs/media.d.ts +35 -0
  316. package/server/fs/media.d.ts.map +1 -0
  317. package/server/fs/media.js +271 -0
  318. package/server/fs/media.js.map +1 -0
  319. package/server/fs/service.d.ts +97 -0
  320. package/server/fs/service.d.ts.map +1 -0
  321. package/server/fs/service.js +306 -0
  322. package/server/fs/service.js.map +1 -0
  323. package/server/fs/upload-staging.d.ts +76 -0
  324. package/server/fs/upload-staging.d.ts.map +1 -0
  325. package/server/fs/upload-staging.js +283 -0
  326. package/server/fs/upload-staging.js.map +1 -0
  327. package/server/fs/watcher-lifecycle.d.ts +24 -0
  328. package/server/fs/watcher-lifecycle.d.ts.map +1 -0
  329. package/server/fs/watcher-lifecycle.js +105 -0
  330. package/server/fs/watcher-lifecycle.js.map +1 -0
  331. package/server/index.d.ts +17 -0
  332. package/server/index.d.ts.map +1 -0
  333. package/server/index.js +510 -0
  334. package/server/index.js.map +1 -0
  335. package/server/ipc/socket-server.d.ts +28 -0
  336. package/server/ipc/socket-server.d.ts.map +1 -0
  337. package/server/ipc/socket-server.js +206 -0
  338. package/server/ipc/socket-server.js.map +1 -0
  339. package/server/lib/git-exec.d.ts +38 -0
  340. package/server/lib/git-exec.d.ts.map +1 -0
  341. package/server/lib/git-exec.js +96 -0
  342. package/server/lib/git-exec.js.map +1 -0
  343. package/server/lib/open-in-ide.d.ts +22 -0
  344. package/server/lib/open-in-ide.d.ts.map +1 -0
  345. package/server/lib/open-in-ide.js +90 -0
  346. package/server/lib/open-in-ide.js.map +1 -0
  347. package/server/lib/open-in-os.d.ts +20 -0
  348. package/server/lib/open-in-os.d.ts.map +1 -0
  349. package/server/lib/open-in-os.js +51 -0
  350. package/server/lib/open-in-os.js.map +1 -0
  351. package/server/lib/path.d.ts +2 -0
  352. package/server/lib/path.d.ts.map +1 -0
  353. package/server/lib/path.js +10 -0
  354. package/server/lib/path.js.map +1 -0
  355. package/server/lib/promise-mutex.d.ts +7 -0
  356. package/server/lib/promise-mutex.d.ts.map +1 -0
  357. package/server/lib/promise-mutex.js +26 -0
  358. package/server/lib/promise-mutex.js.map +1 -0
  359. package/server/lib/sd-notify.d.ts +8 -0
  360. package/server/lib/sd-notify.d.ts.map +1 -0
  361. package/server/lib/sd-notify.js +27 -0
  362. package/server/lib/sd-notify.js.map +1 -0
  363. package/server/net/local-machine.d.ts +7 -0
  364. package/server/net/local-machine.d.ts.map +1 -0
  365. package/server/net/local-machine.js +79 -0
  366. package/server/net/local-machine.js.map +1 -0
  367. package/server/net/reachable-host.d.ts +12 -0
  368. package/server/net/reachable-host.d.ts.map +1 -0
  369. package/server/net/reachable-host.js +25 -0
  370. package/server/net/reachable-host.js.map +1 -0
  371. package/server/network/endpoints.d.ts +14 -0
  372. package/server/network/endpoints.d.ts.map +1 -0
  373. package/server/network/endpoints.js +104 -0
  374. package/server/network/endpoints.js.map +1 -0
  375. package/server/network/qr.d.ts +16 -0
  376. package/server/network/qr.d.ts.map +1 -0
  377. package/server/network/qr.js +89 -0
  378. package/server/network/qr.js.map +1 -0
  379. package/server/port-forwarder/forwarder.d.ts +47 -0
  380. package/server/port-forwarder/forwarder.d.ts.map +1 -0
  381. package/server/port-forwarder/forwarder.js +159 -0
  382. package/server/port-forwarder/forwarder.js.map +1 -0
  383. package/server/port-scanner/scanner.d.ts +24 -0
  384. package/server/port-scanner/scanner.d.ts.map +1 -0
  385. package/server/port-scanner/scanner.js +193 -0
  386. package/server/port-scanner/scanner.js.map +1 -0
  387. package/server/pty/connection-lifecycle.d.ts +50 -0
  388. package/server/pty/connection-lifecycle.d.ts.map +1 -0
  389. package/server/pty/connection-lifecycle.js +113 -0
  390. package/server/pty/connection-lifecycle.js.map +1 -0
  391. package/server/pty/daemon-connect.d.ts +52 -0
  392. package/server/pty/daemon-connect.d.ts.map +1 -0
  393. package/server/pty/daemon-connect.js +62 -0
  394. package/server/pty/daemon-connect.js.map +1 -0
  395. package/server/pty/handshake-timeout-race.d.ts +22 -0
  396. package/server/pty/handshake-timeout-race.d.ts.map +1 -0
  397. package/server/pty/handshake-timeout-race.js +23 -0
  398. package/server/pty/handshake-timeout-race.js.map +1 -0
  399. package/server/pty/headless-replay-snapshot.d.ts +28 -0
  400. package/server/pty/headless-replay-snapshot.d.ts.map +1 -0
  401. package/server/pty/headless-replay-snapshot.js +285 -0
  402. package/server/pty/headless-replay-snapshot.js.map +1 -0
  403. package/server/pty/headless-terminal-state-cache.d.ts +31 -0
  404. package/server/pty/headless-terminal-state-cache.d.ts.map +1 -0
  405. package/server/pty/headless-terminal-state-cache.js +119 -0
  406. package/server/pty/headless-terminal-state-cache.js.map +1 -0
  407. package/server/pty/hello-ack-validator.d.ts +15 -0
  408. package/server/pty/hello-ack-validator.d.ts.map +1 -0
  409. package/server/pty/hello-ack-validator.js +30 -0
  410. package/server/pty/hello-ack-validator.js.map +1 -0
  411. package/server/pty/host-daemon/bootstrap.d.ts +100 -0
  412. package/server/pty/host-daemon/bootstrap.d.ts.map +1 -0
  413. package/server/pty/host-daemon/bootstrap.js +611 -0
  414. package/server/pty/host-daemon/bootstrap.js.map +1 -0
  415. package/server/pty/host-daemon/daemon.d.ts +111 -0
  416. package/server/pty/host-daemon/daemon.d.ts.map +1 -0
  417. package/server/pty/host-daemon/daemon.js +648 -0
  418. package/server/pty/host-daemon/daemon.js.map +1 -0
  419. package/server/pty/host-daemon/entry.d.ts +3 -0
  420. package/server/pty/host-daemon/entry.d.ts.map +1 -0
  421. package/server/pty/host-daemon/entry.js +72 -0
  422. package/server/pty/host-daemon/entry.js.map +1 -0
  423. package/server/pty/host-daemon/lockfile.d.ts +12 -0
  424. package/server/pty/host-daemon/lockfile.d.ts.map +1 -0
  425. package/server/pty/host-daemon/lockfile.js +120 -0
  426. package/server/pty/host-daemon/lockfile.js.map +1 -0
  427. package/server/pty/host-daemon/mode-marker.d.ts +77 -0
  428. package/server/pty/host-daemon/mode-marker.d.ts.map +1 -0
  429. package/server/pty/host-daemon/mode-marker.js +228 -0
  430. package/server/pty/host-daemon/mode-marker.js.map +1 -0
  431. package/server/pty/host-daemon/orphan-cleanup.d.ts +42 -0
  432. package/server/pty/host-daemon/orphan-cleanup.d.ts.map +1 -0
  433. package/server/pty/host-daemon/orphan-cleanup.js +84 -0
  434. package/server/pty/host-daemon/orphan-cleanup.js.map +1 -0
  435. package/server/pty/host-daemon/paths.d.ts +10 -0
  436. package/server/pty/host-daemon/paths.d.ts.map +1 -0
  437. package/server/pty/host-daemon/paths.js +56 -0
  438. package/server/pty/host-daemon/paths.js.map +1 -0
  439. package/server/pty/host-daemon/server-connection.d.ts +44 -0
  440. package/server/pty/host-daemon/server-connection.d.ts.map +1 -0
  441. package/server/pty/host-daemon/server-connection.js +100 -0
  442. package/server/pty/host-daemon/server-connection.js.map +1 -0
  443. package/server/pty/host-daemon/service-detection.d.ts +24 -0
  444. package/server/pty/host-daemon/service-detection.d.ts.map +1 -0
  445. package/server/pty/host-daemon/service-detection.js +16 -0
  446. package/server/pty/host-daemon/service-detection.js.map +1 -0
  447. package/server/pty/host-daemon/socket-ready.d.ts +22 -0
  448. package/server/pty/host-daemon/socket-ready.d.ts.map +1 -0
  449. package/server/pty/host-daemon/socket-ready.js +33 -0
  450. package/server/pty/host-daemon/socket-ready.js.map +1 -0
  451. package/server/pty/host-daemon/spawn-daemon.d.ts +45 -0
  452. package/server/pty/host-daemon/spawn-daemon.d.ts.map +1 -0
  453. package/server/pty/host-daemon/spawn-daemon.js +155 -0
  454. package/server/pty/host-daemon/spawn-daemon.js.map +1 -0
  455. package/server/pty/host-daemon/terminate-daemon.d.ts +16 -0
  456. package/server/pty/host-daemon/terminate-daemon.d.ts.map +1 -0
  457. package/server/pty/host-daemon/terminate-daemon.js +128 -0
  458. package/server/pty/host-daemon/terminate-daemon.js.map +1 -0
  459. package/server/pty/host-protocol/frames.d.ts +110 -0
  460. package/server/pty/host-protocol/frames.d.ts.map +1 -0
  461. package/server/pty/host-protocol/frames.js +255 -0
  462. package/server/pty/host-protocol/frames.js.map +1 -0
  463. package/server/pty/host-protocol/messages.d.ts +140 -0
  464. package/server/pty/host-protocol/messages.d.ts.map +1 -0
  465. package/server/pty/host-protocol/messages.js +117 -0
  466. package/server/pty/host-protocol/messages.js.map +1 -0
  467. package/server/pty/host.d.ts +273 -0
  468. package/server/pty/host.d.ts.map +1 -0
  469. package/server/pty/host.js +184 -0
  470. package/server/pty/host.js.map +1 -0
  471. package/server/pty/in-process-host.d.ts +224 -0
  472. package/server/pty/in-process-host.d.ts.map +1 -0
  473. package/server/pty/in-process-host.js +1183 -0
  474. package/server/pty/in-process-host.js.map +1 -0
  475. package/server/pty/osc7-lifecycle.d.ts +8 -0
  476. package/server/pty/osc7-lifecycle.d.ts.map +1 -0
  477. package/server/pty/osc7-lifecycle.js +22 -0
  478. package/server/pty/osc7-lifecycle.js.map +1 -0
  479. package/server/pty/osc7-parser.d.ts +23 -0
  480. package/server/pty/osc7-parser.d.ts.map +1 -0
  481. package/server/pty/osc7-parser.js +91 -0
  482. package/server/pty/osc7-parser.js.map +1 -0
  483. package/server/pty/remote-host.d.ts +188 -0
  484. package/server/pty/remote-host.d.ts.map +1 -0
  485. package/server/pty/remote-host.js +810 -0
  486. package/server/pty/remote-host.js.map +1 -0
  487. package/server/pty/request-correlator.d.ts +59 -0
  488. package/server/pty/request-correlator.d.ts.map +1 -0
  489. package/server/pty/request-correlator.js +75 -0
  490. package/server/pty/request-correlator.js.map +1 -0
  491. package/server/pty/scrollback-log.d.ts +130 -0
  492. package/server/pty/scrollback-log.d.ts.map +1 -0
  493. package/server/pty/scrollback-log.js +344 -0
  494. package/server/pty/scrollback-log.js.map +1 -0
  495. package/server/pty/scrollback-sanitize.d.ts +2 -0
  496. package/server/pty/scrollback-sanitize.d.ts.map +1 -0
  497. package/server/pty/scrollback-sanitize.js +54 -0
  498. package/server/pty/scrollback-sanitize.js.map +1 -0
  499. package/server/pty/session-mirror.d.ts +67 -0
  500. package/server/pty/session-mirror.d.ts.map +1 -0
  501. package/server/pty/session-mirror.js +112 -0
  502. package/server/pty/session-mirror.js.map +1 -0
  503. package/server/pty/session-policy.d.ts +85 -0
  504. package/server/pty/session-policy.d.ts.map +1 -0
  505. package/server/pty/session-policy.js +186 -0
  506. package/server/pty/session-policy.js.map +1 -0
  507. package/server/pty/version-mismatch-recovery.d.ts +71 -0
  508. package/server/pty/version-mismatch-recovery.d.ts.map +1 -0
  509. package/server/pty/version-mismatch-recovery.js +63 -0
  510. package/server/pty/version-mismatch-recovery.js.map +1 -0
  511. package/server/routes/debug-agent-status.d.ts +5 -0
  512. package/server/routes/debug-agent-status.d.ts.map +1 -0
  513. package/server/routes/debug-agent-status.js +22 -0
  514. package/server/routes/debug-agent-status.js.map +1 -0
  515. package/server/routes/debug-diagnostics.d.ts +8 -0
  516. package/server/routes/debug-diagnostics.d.ts.map +1 -0
  517. package/server/routes/debug-diagnostics.js +34 -0
  518. package/server/routes/debug-diagnostics.js.map +1 -0
  519. package/server/routes/debug-terminal-trace.d.ts +16 -0
  520. package/server/routes/debug-terminal-trace.d.ts.map +1 -0
  521. package/server/routes/debug-terminal-trace.js +545 -0
  522. package/server/routes/debug-terminal-trace.js.map +1 -0
  523. package/server/routes/drops.d.ts +13 -0
  524. package/server/routes/drops.d.ts.map +1 -0
  525. package/server/routes/drops.js +126 -0
  526. package/server/routes/drops.js.map +1 -0
  527. package/server/routes/file-uploads.d.ts +9 -0
  528. package/server/routes/file-uploads.d.ts.map +1 -0
  529. package/server/routes/file-uploads.js +119 -0
  530. package/server/routes/file-uploads.js.map +1 -0
  531. package/server/routes/files.d.ts +9 -0
  532. package/server/routes/files.d.ts.map +1 -0
  533. package/server/routes/files.js +441 -0
  534. package/server/routes/files.js.map +1 -0
  535. package/server/routes/filesystem.d.ts +6 -0
  536. package/server/routes/filesystem.d.ts.map +1 -0
  537. package/server/routes/filesystem.js +76 -0
  538. package/server/routes/filesystem.js.map +1 -0
  539. package/server/routes/git.d.ts +38 -0
  540. package/server/routes/git.d.ts.map +1 -0
  541. package/server/routes/git.js +585 -0
  542. package/server/routes/git.js.map +1 -0
  543. package/server/routes/healthz.d.ts +8 -0
  544. package/server/routes/healthz.d.ts.map +1 -0
  545. package/server/routes/healthz.js +24 -0
  546. package/server/routes/healthz.js.map +1 -0
  547. package/server/routes/hook.d.ts +14 -0
  548. package/server/routes/hook.d.ts.map +1 -0
  549. package/server/routes/hook.js +86 -0
  550. package/server/routes/hook.js.map +1 -0
  551. package/server/routes/ide-commands.d.ts +9 -0
  552. package/server/routes/ide-commands.d.ts.map +1 -0
  553. package/server/routes/ide-commands.js +23 -0
  554. package/server/routes/ide-commands.js.map +1 -0
  555. package/server/routes/lib/resolve-worktree.d.ts +30 -0
  556. package/server/routes/lib/resolve-worktree.d.ts.map +1 -0
  557. package/server/routes/lib/resolve-worktree.js +35 -0
  558. package/server/routes/lib/resolve-worktree.js.map +1 -0
  559. package/server/routes/open.d.ts +4 -0
  560. package/server/routes/open.d.ts.map +1 -0
  561. package/server/routes/open.js +21 -0
  562. package/server/routes/open.js.map +1 -0
  563. package/server/routes/pane-commands.d.ts +9 -0
  564. package/server/routes/pane-commands.d.ts.map +1 -0
  565. package/server/routes/pane-commands.js +23 -0
  566. package/server/routes/pane-commands.js.map +1 -0
  567. package/server/routes/projects.d.ts +15 -0
  568. package/server/routes/projects.d.ts.map +1 -0
  569. package/server/routes/projects.js +363 -0
  570. package/server/routes/projects.js.map +1 -0
  571. package/server/routes/server-notices.d.ts +4 -0
  572. package/server/routes/server-notices.d.ts.map +1 -0
  573. package/server/routes/server-notices.js +29 -0
  574. package/server/routes/server-notices.js.map +1 -0
  575. package/server/routes/service-config.d.ts +11 -0
  576. package/server/routes/service-config.d.ts.map +1 -0
  577. package/server/routes/service-config.js +64 -0
  578. package/server/routes/service-config.js.map +1 -0
  579. package/server/routes/sessions.d.ts +7 -0
  580. package/server/routes/sessions.d.ts.map +1 -0
  581. package/server/routes/sessions.js +218 -0
  582. package/server/routes/sessions.js.map +1 -0
  583. package/server/service/caffeinate.d.ts +33 -0
  584. package/server/service/caffeinate.d.ts.map +1 -0
  585. package/server/service/caffeinate.js +72 -0
  586. package/server/service/caffeinate.js.map +1 -0
  587. package/server/state/app-state.d.ts +167 -0
  588. package/server/state/app-state.d.ts.map +1 -0
  589. package/server/state/app-state.js +335 -0
  590. package/server/state/app-state.js.map +1 -0
  591. package/server/state/project-manager.d.ts +30 -0
  592. package/server/state/project-manager.d.ts.map +1 -0
  593. package/server/state/project-manager.js +128 -0
  594. package/server/state/project-manager.js.map +1 -0
  595. package/server/state/server-notices.d.ts +12 -0
  596. package/server/state/server-notices.d.ts.map +1 -0
  597. package/server/state/server-notices.js +32 -0
  598. package/server/state/server-notices.js.map +1 -0
  599. package/server/state/worktree-cache.d.ts +25 -0
  600. package/server/state/worktree-cache.d.ts.map +1 -0
  601. package/server/state/worktree-cache.js +53 -0
  602. package/server/state/worktree-cache.js.map +1 -0
  603. package/server/ws/events.d.ts +45 -0
  604. package/server/ws/events.d.ts.map +1 -0
  605. package/server/ws/events.js +134 -0
  606. package/server/ws/events.js.map +1 -0
  607. package/server/ws/keepalive.d.ts +27 -0
  608. package/server/ws/keepalive.d.ts.map +1 -0
  609. package/server/ws/keepalive.js +63 -0
  610. package/server/ws/keepalive.js.map +1 -0
  611. package/server/ws/terminal-attach.d.ts +13 -0
  612. package/server/ws/terminal-attach.d.ts.map +1 -0
  613. package/server/ws/terminal-attach.js +233 -0
  614. package/server/ws/terminal-attach.js.map +1 -0
  615. package/server/ws/terminal-flow.d.ts +17 -0
  616. package/server/ws/terminal-flow.d.ts.map +1 -0
  617. package/server/ws/terminal-flow.js +64 -0
  618. package/server/ws/terminal-flow.js.map +1 -0
  619. package/server/ws/terminal.d.ts +69 -0
  620. package/server/ws/terminal.d.ts.map +1 -0
  621. package/server/ws/terminal.js +311 -0
  622. package/server/ws/terminal.js.map +1 -0
  623. package/web/assets/EditorPane-CzzT3iYY.js +123 -0
  624. package/web/assets/SymbolsNerdFontMono-Regular-CwEZqMeU.woff2 +0 -0
  625. package/web/assets/TerminalPane-CjbYzePr.js +68 -0
  626. package/web/assets/TerminalPane-DkTCHfhq.css +1 -0
  627. package/web/assets/file-icons-JBi09j0r.js +6 -0
  628. package/web/assets/index-CTTkRpnn.css +2 -0
  629. package/web/assets/index-CmhewzMp.js +34 -0
  630. package/web/assets/session-resume-7f-tB-ZU.js +2 -0
  631. package/web/assets/terminal-trace-PuuFRybC.js +2803 -0
  632. package/web/assets/useVirtualKeyboard-DgJb9u9d.js +1 -0
  633. package/web/index.html +52 -0
@@ -0,0 +1,193 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { ensureSingletons, makeBrowserPane, makeTerminalPane, } from "@parasor/shared";
3
+ import { WorkspaceNotFoundError } from "./errors.js";
4
+ export function createPaneCommands({ appStateStore, eventBus, projectManager, }) {
5
+ function broadcastPanes(projectId) {
6
+ const state = appStateStore.get();
7
+ const ps = state.projectStates[projectId];
8
+ if (!ps)
9
+ return;
10
+ eventBus.broadcast({
11
+ type: "panes-updated",
12
+ projectId,
13
+ worktrees: ps.worktrees,
14
+ focusedPaneId: ps.focusedPaneId,
15
+ });
16
+ }
17
+ function requireProject(id) {
18
+ const project = projectManager.get(id);
19
+ if (!project)
20
+ throw new WorkspaceNotFoundError();
21
+ return project;
22
+ }
23
+ return {
24
+ /**
25
+ * Replace the worktree list. Preserves existing terminal/browser panes
26
+ * for worktrees whose path remains, drops panes for removed paths, and
27
+ * re-ensures `files` + `git` singletons per worktree.
28
+ */
29
+ setWorktrees(projectId, paths) {
30
+ requireProject(projectId);
31
+ appStateStore.mutateProjectStates((state) => {
32
+ const ps = state.projectStates[projectId];
33
+ if (!ps)
34
+ return;
35
+ const prev = new Map(ps.worktrees.map((w) => [w.path, w.panes]));
36
+ ps.worktrees = paths.map((path) => ({
37
+ path,
38
+ panes: ensureSingletons(path, prev.get(path) ?? []),
39
+ }));
40
+ const validIds = new Set(ps.worktrees.flatMap((w) => w.panes.map((p) => p.id)));
41
+ if (ps.focusedPaneId && !validIds.has(ps.focusedPaneId)) {
42
+ ps.focusedPaneId = null;
43
+ }
44
+ });
45
+ broadcastPanes(projectId);
46
+ },
47
+ addTerminalPane(projectId, worktreePath, sessionId) {
48
+ requireProject(projectId);
49
+ const id = `terminal:${randomUUID()}`;
50
+ const pane = makeTerminalPane(id, worktreePath, sessionId);
51
+ appStateStore.mutateProjectStates((state) => {
52
+ const ps = state.projectStates[projectId];
53
+ if (!ps)
54
+ return;
55
+ const wt = ps.worktrees.find((w) => w.path === worktreePath);
56
+ if (!wt)
57
+ return;
58
+ // Insert after existing terminals, before browsers/git.
59
+ const lastTermIdx = lastIndex(wt.panes, (p) => p.kind === "terminal");
60
+ const firstBrowserIdx = wt.panes.findIndex((p) => p.kind === "browser");
61
+ const insertAt = lastTermIdx >= 0
62
+ ? lastTermIdx + 1
63
+ : firstBrowserIdx >= 0
64
+ ? firstBrowserIdx
65
+ : Math.max(0, wt.panes.findIndex((p) => p.kind === "git"));
66
+ wt.panes.splice(insertAt, 0, pane);
67
+ ps.focusedPaneId = pane.id;
68
+ });
69
+ broadcastPanes(projectId);
70
+ return pane;
71
+ },
72
+ addBrowserPane(projectId, worktreePath, url) {
73
+ requireProject(projectId);
74
+ const id = `browser:${randomUUID()}`;
75
+ const pane = makeBrowserPane(id, worktreePath, url);
76
+ appStateStore.mutateProjectStates((state) => {
77
+ const ps = state.projectStates[projectId];
78
+ if (!ps)
79
+ return;
80
+ const wt = ps.worktrees.find((w) => w.path === worktreePath);
81
+ if (!wt)
82
+ return;
83
+ const gitIdx = wt.panes.findIndex((p) => p.kind === "git");
84
+ const insertAt = gitIdx >= 0 ? gitIdx : wt.panes.length;
85
+ wt.panes.splice(insertAt, 0, pane);
86
+ ps.focusedPaneId = pane.id;
87
+ });
88
+ broadcastPanes(projectId);
89
+ return pane;
90
+ },
91
+ /**
92
+ * Close a terminal or browser pane. Singletons (`files`/`git`) cannot
93
+ * be closed; the call is a no-op for those ids to keep callers simple.
94
+ */
95
+ closePane(projectId, paneId) {
96
+ requireProject(projectId);
97
+ appStateStore.mutateProjectStates((state) => {
98
+ const ps = state.projectStates[projectId];
99
+ if (!ps)
100
+ return;
101
+ for (const wt of ps.worktrees) {
102
+ const idx = wt.panes.findIndex((p) => p.id === paneId);
103
+ if (idx === -1)
104
+ continue;
105
+ const target = wt.panes[idx];
106
+ if (target.kind === "files" || target.kind === "git")
107
+ return;
108
+ wt.panes.splice(idx, 1);
109
+ if (ps.focusedPaneId === paneId) {
110
+ ps.focusedPaneId = wt.panes[0]?.id ?? null;
111
+ }
112
+ return;
113
+ }
114
+ });
115
+ broadcastPanes(projectId);
116
+ },
117
+ focusPane(projectId, paneId) {
118
+ requireProject(projectId);
119
+ appStateStore.mutateProjectStates((state) => {
120
+ const ps = state.projectStates[projectId];
121
+ if (!ps)
122
+ return;
123
+ if (paneId === null) {
124
+ ps.focusedPaneId = null;
125
+ return;
126
+ }
127
+ const exists = ps.worktrees.some((w) => w.panes.some((p) => p.id === paneId));
128
+ if (exists)
129
+ ps.focusedPaneId = paneId;
130
+ });
131
+ broadcastPanes(projectId);
132
+ },
133
+ updateFilesPaneState(projectId, paneId, partial) {
134
+ requireProject(projectId);
135
+ appStateStore.mutateProjectStates((state) => {
136
+ const ps = state.projectStates[projectId];
137
+ if (!ps)
138
+ return;
139
+ const pane = findPane(ps.worktrees, paneId);
140
+ if (!pane || pane.state.kind !== "files")
141
+ return;
142
+ if (partial.selectedFilePath !== undefined) {
143
+ pane.state.selectedFilePath = partial.selectedFilePath;
144
+ }
145
+ });
146
+ broadcastPanes(projectId);
147
+ },
148
+ updateGitPaneState(projectId, paneId, partial) {
149
+ requireProject(projectId);
150
+ appStateStore.mutateProjectStates((state) => {
151
+ const ps = state.projectStates[projectId];
152
+ if (!ps)
153
+ return;
154
+ const pane = findPane(ps.worktrees, paneId);
155
+ if (!pane || pane.state.kind !== "git")
156
+ return;
157
+ if (partial.selectedCommitSha !== undefined) {
158
+ pane.state.selectedCommitSha = partial.selectedCommitSha;
159
+ }
160
+ });
161
+ broadcastPanes(projectId);
162
+ },
163
+ updateBrowserPaneState(projectId, paneId, url) {
164
+ requireProject(projectId);
165
+ appStateStore.mutateProjectStates((state) => {
166
+ const ps = state.projectStates[projectId];
167
+ if (!ps)
168
+ return;
169
+ const pane = findPane(ps.worktrees, paneId);
170
+ if (!pane || pane.state.kind !== "browser")
171
+ return;
172
+ pane.state.url = url;
173
+ });
174
+ broadcastPanes(projectId);
175
+ },
176
+ };
177
+ }
178
+ function findPane(worktrees, paneId) {
179
+ for (const wt of worktrees) {
180
+ const found = wt.panes.find((p) => p.id === paneId);
181
+ if (found)
182
+ return found;
183
+ }
184
+ return undefined;
185
+ }
186
+ function lastIndex(arr, pred) {
187
+ for (let i = arr.length - 1; i >= 0; i--) {
188
+ if (pred(arr[i]))
189
+ return i;
190
+ }
191
+ return -1;
192
+ }
193
+ //# sourceMappingURL=pane-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pane-commands.js","sourceRo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PtyHost } from "../../pty/host.js";
3
+ import type { AppStateStore } from "../../state/app-state.js";
4
+ import type { ProjectManager } from "../../state/project-manager.js";
5
+ import type { EventPublisher } from "../ports.js";
6
+ interface CreateProjectCommandsDeps {
7
+ appStateStore: AppStateStore;
8
+ eventBus: EventPublisher;
9
+ projectManager: ProjectManager;
10
+ ptyManager: PtyHost;
11
+ }
12
+ export declare function createProjectCommands({ appStateStore, eventBus, projectManager, ptyManager, }: CreateProjectCommandsDeps): {
13
+ createProject(input: {
14
+ path: string;
15
+ name?: string;
16
+ }): import("@parasor/shared").Project;
17
+ updateProject(id: string, input: {
18
+ name?: string;
19
+ pinned?: boolean;
20
+ readOnly?: boolean;
21
+ }): import("@parasor/shared").Project;
22
+ deleteProject(id: string, force: boolean): Promise<void>;
23
+ reorderProjects(ids: string[]): boolean;
24
+ /**
25
+ * Persist the worktree local-file copy selection as the project's
26
+ * allowlist. `copyLocalFiles` is the raw request value; non-array or
27
+ * non-string members are dropped (empty list otherwise), mirroring the
28
+ * normalization that the worktree-creation route applied inline.
29
+ */
30
+ rememberWorktreeLocalFiles(projectId: string, copyLocalFiles: unknown): void;
31
+ updateLayout(id: string, layout: PaneNode | null): void;
32
+ };
33
+ export {};
34
+ //# sourceMappingURL=project-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-commands.d.ts","sourceRoot":"","sources":["../../../src/application/workspace/project-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,UAAU,yBAAyB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,aAAa,EACb,QAAQ,EACR,cAAc,EACd,UAAU,GACX,EAAE,yBAAyB;yBAEH;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;sBAW9C,MAAM,SACH;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;sBAgBxC,MAAM,SAAS,OAAO;yBAuBzB,MAAM,EAAE,GAAG,OAAO;IASvC;;;;;OAKG;0CACmC,MAAM,kBAAkB,OAAO;qBAUpD,MAAM,UAAU,QAAQ,GAAG,IAAI;EAgBnD"}
@@ -0,0 +1,81 @@
1
+ import { WorkspaceConflictError, WorkspaceNotFoundError } from "./errors.js";
2
+ export function createProjectCommands({ appStateStore, eventBus, projectManager, ptyManager, }) {
3
+ return {
4
+ createProject(input) {
5
+ const project = projectManager.create({
6
+ path: input.path,
7
+ ...(input.name !== undefined && { name: input.name }),
8
+ });
9
+ eventBus.broadcast({ type: "project-created", project });
10
+ return project;
11
+ },
12
+ updateProject(id, input) {
13
+ const project = projectManager.update(id, {
14
+ ...(input.name !== undefined && { name: input.name }),
15
+ ...(input.pinned !== undefined && { pinned: input.pinned }),
16
+ ...(input.readOnly !== undefined && { readOnly: input.readOnly }),
17
+ });
18
+ if (!project) {
19
+ throw new WorkspaceNotFoundError();
20
+ }
21
+ eventBus.broadcast({ type: "project-updated", project });
22
+ return project;
23
+ },
24
+ async deleteProject(id, force) {
25
+ const project = projectManager.get(id);
26
+ if (!project) {
27
+ throw new WorkspaceNotFoundError();
28
+ }
29
+ if (project.pinned && !force) {
30
+ throw new WorkspaceConflictError("Project is pinned; use ?force=true");
31
+ }
32
+ const sessions = ptyManager.listByProject(id);
33
+ for (const session of sessions) {
34
+ await ptyManager.dispose(session.id);
35
+ eventBus.broadcast({
36
+ type: "session-closed",
37
+ sessionId: session.id,
38
+ projectId: id,
39
+ });
40
+ }
41
+ projectManager.delete(id, force);
42
+ eventBus.broadcast({ type: "project-deleted", projectId: id });
43
+ },
44
+ reorderProjects(ids) {
45
+ const result = projectManager.reorder(ids);
46
+ if (!result)
47
+ return false;
48
+ for (const project of result) {
49
+ eventBus.broadcast({ type: "project-updated", project });
50
+ }
51
+ return true;
52
+ },
53
+ /**
54
+ * Persist the worktree local-file copy selection as the project's
55
+ * allowlist. `copyLocalFiles` is the raw request value; non-array or
56
+ * non-string members are dropped (empty list otherwise), mirroring the
57
+ * normalization that the worktree-creation route applied inline.
58
+ */
59
+ rememberWorktreeLocalFiles(projectId, copyLocalFiles) {
60
+ projectManager.update(projectId, {
61
+ worktreeLocalFileAllowlist: Array.isArray(copyLocalFiles)
62
+ ? copyLocalFiles.filter((item) => typeof item === "string")
63
+ : [],
64
+ });
65
+ },
66
+ updateLayout(id, layout) {
67
+ const project = projectManager.get(id);
68
+ if (!project) {
69
+ throw new WorkspaceNotFoundError();
70
+ }
71
+ appStateStore.mutateProjectStates((state) => {
72
+ const projectState = state.projectStates[id];
73
+ if (projectState) {
74
+ projectState.layout = layout;
75
+ }
76
+ });
77
+ eventBus.broadcast({ type: "layout-updated", projectId: id, layout });
78
+ },
79
+ };
80
+ }
81
+ //# sourceMappingURL=project-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-commands.js","sourceRoot":"","sources":["../../../src/application/workspace/project-commands.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAS7E,MAAM,UAAU,qBAAqB,CAAC,EACpC,aAAa,EACb,QAAQ,EACR,cAAc,EACd,UAAU,GACgB;IAC1B,OAAO;QACL,aAAa,CAAC,KAAsC;YAClD,MAAM,OAAO,GAAG,cAAc,CAAC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,GAAG,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,sBAAsB,EAAE,CAAC;YACrC,CAAC;YAED,aAAa,CAAC,mBAAmB,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC1C,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBAC7C,IAAI,YAAY,EAAE,CAAC;oBACjB,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC;gBAC/B,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACxE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { Worktree } from "@parasor/shared";
2
+ import type { ProjectManager } from "../../state/project-manager.js";
3
+ export declare function parseWorktreeList(porcelain: string): Worktree[];
4
+ interface CreateProjectQueriesDeps {
5
+ projectManager: ProjectManager;
6
+ runGit?: (projectPath: string, args: string[]) => Promise<string>;
7
+ }
8
+ export declare function defaultRunGit(projectPath: string, args: string[]): Promise<string>;
9
+ export declare function createProjectQueries({ projectManager, runGit, }: CreateProjectQueriesDeps): {
10
+ listProjects(): import("@parasor/shared").Project[];
11
+ getWorktreeLocalFiles(id: string): Promise<{
12
+ candidates: import("@parasor/shared").WorktreeLocalFileCandidate[];
13
+ rememberedPaths: string[];
14
+ }>;
15
+ getProjectDiff(id: string, worktreePath: string): Promise<string>;
16
+ getProjectCommitDiff(id: string, sha: string, worktreePath: string): Promise<string>;
17
+ getProjectWorktrees(id: string): Promise<Worktree[]>;
18
+ listAllWorktrees(): Promise<Record<string, Worktree[]>>;
19
+ };
20
+ export {};
21
+ //# sourceMappingURL=project-queries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-queries.d.ts","sourceRoot":"","sources":["../../../src/application/workspace/project-queries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAmCrE,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,CAoB/D;AAED,UAAU,wBAAwB;IAChC,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE;AAED,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAoED,wBAAgB,oBAAoB,CAAC,EACnC,cAAc,EACd,MAAsB,GACvB,EAAE,wBAAwB;;8BAYS,MAAM;;;;uBASb,MAAM,gBAAgB,MAAM;6BAatB,MAAM,OAAO,MAAM,gBAAgB,MAAM;4BAc1C,MAAM;wBAgBV,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;EAuBhE"}
@@ -0,0 +1,216 @@
1
+ import { execFile } from "node:child_process";
2
+ import { homedir } from "node:os";
3
+ import { promisify } from "node:util";
4
+ import { parseGitStatusV2 } from "../../fs/git-watcher.js";
5
+ import { WorkspaceNotFoundError } from "./errors.js";
6
+ import { listWorktreeLocalFileCandidates } from "./worktree-local-files.js";
7
+ const execFileAsync = promisify(execFile);
8
+ /**
9
+ * Path-prefix tags identifying worktrees created by Agent Team isolation.
10
+ * Each entry below pairs the human-readable origin (`"agent"`) with the
11
+ * directory roots used by the orchestration tooling we ship.
12
+ * - `<home>/.parasor/worktrees/` -- parasor multi-issue isolation roots
13
+ * - `<home>/.claude/teams/` -- claude-code team scratch dirs
14
+ * - `/private/tmp/parasor-issue-*` -- macOS-resolved temp staging
15
+ * - `/tmp/parasor-issue-*` -- Linux temp staging
16
+ * Path matching is purely lexical (no fs probes) so classification stays
17
+ * cheap and deterministic -- a worktree at `/tmp/parasor-issue-300/x` still
18
+ * counts as agent-spawned even after the issue closes.
19
+ */
20
+ function agentPathPrefixes() {
21
+ const home = homedir();
22
+ return [
23
+ `${home}/.parasor/worktrees/`,
24
+ `${home}/.claude/teams/`,
25
+ "/private/tmp/parasor-issue-",
26
+ "/tmp/parasor-issue-",
27
+ ];
28
+ }
29
+ function classifyOrigin(path) {
30
+ for (const prefix of agentPathPrefixes()) {
31
+ if (path.startsWith(prefix))
32
+ return "agent";
33
+ }
34
+ return undefined;
35
+ }
36
+ export function parseWorktreeList(porcelain) {
37
+ const entries = [];
38
+ let current = null;
39
+ for (const line of porcelain.split("\n")) {
40
+ if (line.startsWith("worktree ")) {
41
+ if (current)
42
+ entries.push(current);
43
+ const path = line.slice(9);
44
+ const origin = classifyOrigin(path);
45
+ current = { path, head: "", branch: "" };
46
+ if (origin)
47
+ current.origin = origin;
48
+ }
49
+ else if (line.startsWith("HEAD ") && current) {
50
+ current.head = line.slice(5);
51
+ }
52
+ else if (line.startsWith("branch ") && current) {
53
+ current.branch = line.slice(7).replace("refs/heads/", "");
54
+ }
55
+ }
56
+ if (current)
57
+ entries.push(current);
58
+ return entries;
59
+ }
60
+ export async function defaultRunGit(projectPath, args) {
61
+ // `cwd` (not `git -C path`) so spawn-time `chdir(projectPath)` is what
62
+ // fails when the directory is gone. That fork-level failure surfaces as
63
+ // `err.code === "ENOENT"` to the caller -- `isMissingPathError` keys on
64
+ // exactly that signal to flip the orphan flag. With `git -C` the binary
65
+ // exits 128 with a localized stderr, which we cannot match safely.
66
+ const { stdout } = await execFileAsync("git", args, {
67
+ cwd: projectPath,
68
+ timeout: 5000,
69
+ // Node default is 1MiB. `git status --porcelain=v2 -b` on a repo with
70
+ // thousands of untracked / renamed entries blows past it and rejects;
71
+ // the catch then silently zeroes counters. Bump to 16MiB so the
72
+ // counter pipeline degrades only on truly pathological repos.
73
+ maxBuffer: 16 * 1024 * 1024,
74
+ });
75
+ return stdout;
76
+ }
77
+ /**
78
+ * Cap on parallel `git status` invocations. A repo with many worktrees would
79
+ * otherwise fan out to N child processes at once; large N starves the event
80
+ * loop and the OS process table. 8 is comfortably above sequential without
81
+ * pegging the host on realistic parasor installs.
82
+ */
83
+ const ENRICH_CONCURRENCY = 8;
84
+ async function mapWithLimit(items, limit, fn) {
85
+ const out = new Array(items.length);
86
+ let cursor = 0;
87
+ const workerCount = Math.min(limit, items.length);
88
+ const workers = Array.from({ length: workerCount }, async () => {
89
+ while (true) {
90
+ const i = cursor++;
91
+ if (i >= items.length)
92
+ return;
93
+ out[i] = await fn(items[i]);
94
+ }
95
+ });
96
+ await Promise.all(workers);
97
+ return out;
98
+ }
99
+ /**
100
+ * Treat only `execFile`'s ENOENT as "the worktree directory is gone".
101
+ * That is the signal Node emits when `cwd` itself can't be resolved.
102
+ * A regex on stderr/message would false-positive on `.git` file
103
+ * corruption (`fatal: Not a git repository: '/path/to/wt/.git'`,
104
+ * `unable to read tree …: No such file or directory`) and silently
105
+ * mark live worktrees as orphans, which the UI then offers to prune.
106
+ */
107
+ function isMissingPathError(err) {
108
+ if (!err || typeof err !== "object")
109
+ return false;
110
+ const e = err;
111
+ return e.code === "ENOENT";
112
+ }
113
+ /**
114
+ * Enrich each worktree with ahead/behind/dirtyCount via
115
+ * `git status --porcelain=v2 -b` per worktree path. Failures are non-fatal:
116
+ * the worktree is returned with counter fields omitted (treated as 0 in UI).
117
+ * A failure that looks like the path itself is gone flips the orphan flag
118
+ * so the sidebar can offer a force-prune affordance.
119
+ */
120
+ async function enrichWithCounters(entries, runGit) {
121
+ return mapWithLimit(entries, ENRICH_CONCURRENCY, async (wt) => {
122
+ try {
123
+ const raw = await runGit(wt.path, ["status", "--porcelain=v2", "-b"]);
124
+ const { ahead, behind, dirtyCount } = parseGitStatusV2(raw);
125
+ return { ...wt, ahead, behind, dirtyCount };
126
+ }
127
+ catch (err) {
128
+ if (isMissingPathError(err)) {
129
+ return { ...wt, orphan: true };
130
+ }
131
+ return wt;
132
+ }
133
+ });
134
+ }
135
+ export function createProjectQueries({ projectManager, runGit = defaultRunGit, }) {
136
+ function getProjectOrThrow(id) {
137
+ const project = projectManager.get(id);
138
+ if (!project)
139
+ throw new WorkspaceNotFoundError();
140
+ return project;
141
+ }
142
+ return {
143
+ listProjects() {
144
+ return projectManager.list();
145
+ },
146
+ async getWorktreeLocalFiles(id) {
147
+ const project = getProjectOrThrow(id);
148
+ const candidates = await listWorktreeLocalFileCandidates(project.path);
149
+ return {
150
+ candidates,
151
+ rememberedPaths: project.worktreeLocalFileAllowlist ?? [],
152
+ };
153
+ },
154
+ async getProjectDiff(id, worktreePath) {
155
+ getProjectOrThrow(id);
156
+ // `diff HEAD` returns working-tree + index combined, so a file with only
157
+ // staged changes still appears. Plain `diff` (= unstaged) would silently
158
+ // drop those entries from the uncommitted/diff panes.
159
+ try {
160
+ return await runGit(worktreePath, ["diff", "HEAD", "--no-color"]);
161
+ }
162
+ catch {
163
+ return "";
164
+ }
165
+ },
166
+ async getProjectCommitDiff(id, sha, worktreePath) {
167
+ getProjectOrThrow(id);
168
+ try {
169
+ return await runGit(worktreePath, [
170
+ "show",
171
+ "--no-color",
172
+ "--format=",
173
+ sha,
174
+ ]);
175
+ }
176
+ catch {
177
+ return "";
178
+ }
179
+ },
180
+ async getProjectWorktrees(id) {
181
+ const project = getProjectOrThrow(id);
182
+ try {
183
+ const porcelain = await runGit(project.path, [
184
+ "worktree",
185
+ "list",
186
+ "--porcelain",
187
+ ]);
188
+ const list = parseWorktreeList(porcelain);
189
+ return enrichWithCounters(list, runGit);
190
+ }
191
+ catch {
192
+ return [];
193
+ }
194
+ },
195
+ async listAllWorktrees() {
196
+ const projects = projectManager.list();
197
+ const entries = await mapWithLimit(projects, ENRICH_CONCURRENCY, async (project) => {
198
+ try {
199
+ const porcelain = await runGit(project.path, [
200
+ "worktree",
201
+ "list",
202
+ "--porcelain",
203
+ ]);
204
+ const list = parseWorktreeList(porcelain);
205
+ const enriched = await enrichWithCounters(list, runGit);
206
+ return [project.id, enriched];
207
+ }
208
+ catch {
209
+ return [project.id, []];
210
+ }
211
+ });
212
+ return Object.fromEntries(entries);
213
+ },
214
+ };
215
+ }
216
+ //# sourceMappingURL=project-queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-queries.js","sourceRoot":"","sources":["../../../src/application/workspace/project-queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,SAAS,iBAAiB;IACxB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,OAAO;QACL,GAAG,IAAI,sBAAsB;QAC7B,GAAG,IAAI,iBAAiB;QACxB,6BAA6B;QAC7B,qBAAqB;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,EAAE,CAAC;QACzC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,OAAO,CAAC;IAC9C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,MAAM,OAAO,GAAe,EAAE,CAAC;IAC/B,IAAI,OAAO,GAAoB,IAAI,CAAC;IAEpC,KAAK,MAAM,I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BACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;wBAC3C,UAAU;wBACV,MAAM;wBACN,aAAa;qBACd,CAAC,CAAC;oBACH,MAAM,IAAI,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;oBAC1C,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBACxD,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAU,CAAC;gBACzC,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAU,CAAC;gBACnC,CAAC;YACH,CAAC,CACF,CAAC;YACF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { SessionCommand } from "@parasor/shared";
2
+ import type { PtyHost } from "../../pty/host.js";
3
+ import type { AppStateStore } from "../../state/app-state.js";
4
+ import type { EventPublisher } from "../ports.js";
5
+ interface CreateSessionCommandsDeps {
6
+ appStateStore: AppStateStore;
7
+ eventBus: EventPublisher;
8
+ ptyManager: PtyHost;
9
+ }
10
+ export declare function createSessionCommands({ appStateStore, eventBus, ptyManager, }: CreateSessionCommandsDeps): {
11
+ createSession(input: {
12
+ projectId: string;
13
+ command?: SessionCommand;
14
+ cwd?: string;
15
+ title?: string;
16
+ bootstrapInput?: string;
17
+ }): Promise<import("@parasor/shared").Session>;
18
+ setSessionPinned(id: string, pinned: boolean): Promise<import("@parasor/shared").Session>;
19
+ setSessionTitle(id: string, rawTitle: string): Promise<import("@parasor/shared").Session>;
20
+ restartSession(id: string): Promise<import("@parasor/shared").Session>;
21
+ deleteSession(id: string): Promise<void>;
22
+ };
23
+ export {};
24
+ //# sourceMappingURL=session-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-commands.d.ts","sourceRoot":"","sources":["../../../src/application/workspace/session-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA6BlD,UAAU,yBAAyB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,aAAa,EACb,QAAQ,EACR,UAAU,GACX,EAAE,yBAAyB;yBAEG;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,cAAc,CAAC;QACzB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;yBAsB0B,MAAM,UAAU,OAAO;wBAiBxB,MAAM,YAAY,MAAM;uBAoBzB,MAAM;sBAkBP,MAAM;EA4BjC"}