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 @@
1
+ {"version":3,"file":"project-runtime.js","sourceRoot":"","sources":["../../src/bootstrap/project-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,M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../cli/shim-installer.js";
2
+ export declare function buildStaticPtyEnv(shims: ShimPaths, configDir: string): Record<string, string>;
3
+ //# sourceMappingURL=pty-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty-env.d.ts","sourceRoot":"","sources":["../../src/bootstrap/pty-env.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB"}
@@ -0,0 +1,15 @@
1
+ import { join } from "node:path";
2
+ export function buildStaticPtyEnv(shims, configDir) {
3
+ return {
4
+ PARASOR_BASH_RC: shims.bashRcPath,
5
+ PARASOR_SOCKET: join(configDir, "parasor.sock"),
6
+ ...(shims.realOpen ? { PARASOR_REAL_OPEN: shims.realOpen } : {}),
7
+ ...(shims.realXdgOpen ? { PARASOR_REAL_XDG_OPEN: shims.realXdgOpen } : {}),
8
+ PATH: `${shims.binDir}:${process.env.PATH ?? ""}`,
9
+ ZDOTDIR: shims.zshDotdir,
10
+ TERM: "xterm-256color",
11
+ COLORTERM: "truecolor",
12
+ TERM_PROGRAM: "parasor",
13
+ };
14
+ }
15
+ //# sourceMappingURL=pty-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty-env.js","sourceRoot":"","sources":["../../src/bootstrap/pty-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,UAAU,iBAAiB,CAC/B,KAAgB,EAChB,SAAiB;IAEjB,OAAO;QACL,eAAe,EAAE,KAAK,CAAC,UAAU;QACjC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC;QAC/C,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE;QACjD,OAAO,EAAE,KAAK,CAAC,SAAS;QACxB,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,WAAW;QACtB,YAAY,EAAE,SAAS;KACxB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { PaneNode } from "@parasor/shared";
2
+ import type { AppStateStore } from "../state/app-state.js";
3
+ /**
4
+ * Reconcile persisted state at server boot. Only safe to call from the
5
+ * in-process branch (remote daemon mode pivots the session domain into
6
+ * read-only mirror BEFORE the server-side reconcile would run; the
7
+ * daemon owns its own boot-time reconciliation in that path).
8
+ *
9
+ * Split into per-domain mutator calls so the typed ownership boundary
10
+ * in `AppStateStore` stays honest. Persistence is debounced under the
11
+ * hood, so the writes coalesce into a single state.json flush via the
12
+ * awaited `flush()` at the end.
13
+ */
14
+ export declare function reconcileStartupState(store: AppStateStore, now?: number): Promise<void>;
15
+ export declare function pruneOrphanPanes(node: PaneNode, validIds: Set<string>): PaneNode | null;
16
+ //# sourceMappingURL=reconcile-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile-state.d.ts","sourceRoot":"","sources":["../../src/bootstrap/reconcile-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,aAAa,EACpB,GAAG,SAAa,GACf,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GACpB,QAAQ,GAAG,IAAI,CAgCjB"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Reconcile persisted state at server boot. Only safe to call from the
3
+ * in-process branch (remote daemon mode pivots the session domain into
4
+ * read-only mirror BEFORE the server-side reconcile would run; the
5
+ * daemon owns its own boot-time reconciliation in that path).
6
+ *
7
+ * Split into per-domain mutator calls so the typed ownership boundary
8
+ * in `AppStateStore` stays honest. Persistence is debounced under the
9
+ * hood, so the writes coalesce into a single state.json flush via the
10
+ * awaited `flush()` at the end.
11
+ */
12
+ export async function reconcileStartupState(store, now = Date.now()) {
13
+ // Sessions: mark any "running" survivors as ended (their PIDs are gone),
14
+ // and drop sessions whose project is gone (orphan filter).
15
+ store.mutateSessions((state) => {
16
+ const projectIds = new Set(state.projects.map((project) => project.id));
17
+ for (const session of state.sessions) {
18
+ if (session.state === "running") {
19
+ session.state = "ended";
20
+ session.pid = null;
21
+ session.endedAt = now;
22
+ session.generation += 1;
23
+ }
24
+ }
25
+ state.sessions = state.sessions.filter((session) => projectIds.has(session.projectId));
26
+ });
27
+ // ProjectStates: drop entries whose project is gone and prune orphan
28
+ // panes pointing at sessions that no longer exist.
29
+ store.mutateProjectStates((state) => {
30
+ const projectIds = new Set(state.projects.map((project) => project.id));
31
+ for (const key of Object.keys(state.projectStates)) {
32
+ if (!projectIds.has(key)) {
33
+ delete state.projectStates[key];
34
+ }
35
+ }
36
+ const validSessionIds = new Set(state.sessions.map((session) => session.id));
37
+ for (const projectState of Object.values(state.projectStates)) {
38
+ if (projectState.layout) {
39
+ projectState.layout = pruneOrphanPanes(projectState.layout, validSessionIds);
40
+ }
41
+ }
42
+ });
43
+ await store.flush();
44
+ }
45
+ export function pruneOrphanPanes(node, validIds) {
46
+ if (node.type === "terminal") {
47
+ return validIds.has(node.sessionId) ? node : null;
48
+ }
49
+ if (node.type === "browser" ||
50
+ node.type === "filetree" ||
51
+ node.type === "empty" ||
52
+ node.type === "diff") {
53
+ return node;
54
+ }
55
+ if (node.type === "split") {
56
+ const children = [];
57
+ const sizes = [];
58
+ for (let i = 0; i < node.children.length; i++) {
59
+ const child = pruneOrphanPanes(node.children[i], validIds);
60
+ if (child !== null) {
61
+ children.push(child);
62
+ sizes.push(node.sizes[i]);
63
+ }
64
+ }
65
+ if (children.length === 0)
66
+ return null;
67
+ if (children.length === 1)
68
+ return children[0];
69
+ return { ...node, children, sizes };
70
+ }
71
+ return null;
72
+ }
73
+ //# sourceMappingURL=reconcile-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile-state.js","sourceRoot":"","sources":["../../src/bootstrap/reconcile-state.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,KAAoB,EACpB,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;IAEhB,yEAAyE;IACzE,2DAA2D;IAC3D,KAAK,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACxE,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACrC,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAChC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;gBACxB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC;gBACnB,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;gBACtB,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE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C,CAAC,IAAI,CAAC;IACpD,CAAC;IAED,IACE,IAAI,CAAC,IAAI,KAAK,SAAS;QACvB,IAAI,CAAC,IAAI,KAAK,UAAU;QACxB,IAAI,CAAC,IAAI,KAAK,OAAO;QACrB,IAAI,CAAC,IAAI,KAAK,MAAM,EACpB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAe,EAAE,CAAC;QAChC,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC3D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC9C,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { Notification, PortInfo, ServiceConfig } from "@parasor/shared";
2
+ import type { UploadStaging } from "../fs/upload-staging.js";
3
+ import { PortForwarder } from "../port-forwarder/forwarder.js";
4
+ import type { PortScanner } from "../port-scanner/scanner.js";
5
+ import type { PtyHost } from "../pty/host.js";
6
+ import type { AppStateStore } from "../state/app-state.js";
7
+ import type { EventBus } from "../ws/events.js";
8
+ import type { ProjectRuntime } from "./project-runtime.js";
9
+ export interface StartRuntimeLoopsDeps {
10
+ appStateStore: AppStateStore;
11
+ eventBus: EventBus;
12
+ portScanner: PortScanner;
13
+ ptyManager: PtyHost;
14
+ projectRuntime: ProjectRuntime;
15
+ uploadStaging: UploadStaging;
16
+ reconcileWorktrees?: (projectId: string, prefetched?: import("@parasor/shared").Worktree[]) => Promise<void>;
17
+ /**
18
+ * The address parasor's own HTTP server is bound to (`hostname` from
19
+ * `selectBindAddress` in `index.ts`). Used to derive the per-port TCP
20
+ * forwarder's bind address via `resolveForwarderBindHost` -- loopback ⇒
21
+ * no forwarder. Defaults to `0.0.0.0` for callers that don't pass it.
22
+ * Ignored when `portForwarder` is supplied.
23
+ */
24
+ bindHost?: string;
25
+ /** Injectable for tests; defaults to one built from `bindHost`. */
26
+ portForwarder?: PortForwarder;
27
+ titlePollIntervalMs?: number;
28
+ gitPollIntervalMs?: number;
29
+ uploadSweepIntervalMs?: number;
30
+ }
31
+ export declare function createPortDetectedNotification(projectId: string, projectName: string, port: PortInfo, now?: number): Notification;
32
+ /**
33
+ * Annotate each port with `reachable` (does the viewer device need nothing
34
+ * extra: dev server binds all interfaces, parasor is loopback-bound, or a TCP
35
+ * forwarder is up) and `reachablePort` (the forwarder's OS-assigned listen
36
+ * port when one fronts this dev port).
37
+ */
38
+ export declare function enrichPorts(ports: PortInfo[], projectId: string, forwarder: PortForwarder): PortInfo[];
39
+ export declare function broadcastForegroundTitles(ptyManager: PtyHost, eventBus: EventBus): void;
40
+ export declare function startRuntimeLoops({ appStateStore, eventBus, portScanner, ptyManager, projectRuntime, uploadStaging, reconcileWorktrees, bindHost, portForwarder, titlePollIntervalMs, gitPollIntervalMs, uploadSweepIntervalMs, }: StartRuntimeLoopsDeps): {
41
+ stop(): void;
42
+ /**
43
+ * React to a `serviceConfig` change. On a `portDetection` transition,
44
+ * re-sync the forwarder for every known project (`off` ⇒ tear all
45
+ * forwarders down; back to `all-interfaces` ⇒ recreate them for the
46
+ * currently-known ports) and re-emit so clients see the updated
47
+ * `reachable`/`reachablePort`. Other fields are no-ops here.
48
+ */
49
+ onServiceConfigChanged(config: ServiceConfig): void;
50
+ };
51
+ //# sourceMappingURL=runtime-loops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loops.d.ts","sourceRoot":"","sources":["../../src/bootstrap/runtime-loops.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAiB3D,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;IAC7B,kBAAkB,CAAC,EAAE,CACnB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,OAAO,iBAAiB,EAAE,QAAQ,EAAE,KAC9C,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,QAAQ,EACd,GAAG,SAAa,GACf,YAAY,CAgBd;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,EAAE,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,aAAa,GACvB,QAAQ,EAAE,CAWZ;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,QAAQ,GACjB,IAAI,CAcN;AAED,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,QAAQ,EACR,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,QAAoB,EACpB,aAAa,EACb,mBAAoD,EACpD,iBAAgD,EAChD,qBAAwD,GACzD,EAAE,qBAAqB;;IAkHpB;;;;;;OAMG;mCAC4B,aAAa;EAU/C"}
@@ -0,0 +1,189 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { resolveForwarderBindHost } from "../net/reachable-host.js";
3
+ import { PortForwarder } from "../port-forwarder/forwarder.js";
4
+ const DEFAULT_TITLE_POLL_INTERVAL_MS = 1000;
5
+ /**
6
+ * git-state poll cadence. Runs across every worktree of every active
7
+ * project so it scales linearly with worktree count. FileWatcher events
8
+ * remain the primary diff signal -- this loop is the safety net for cases
9
+ * the watcher misses (network filesystems, timer-coalesced events).
10
+ */
11
+ const DEFAULT_GIT_POLL_INTERVAL_MS = 10_000;
12
+ /**
13
+ * L3 upload-staging sweep cadence (upload staging isolation). 60 minutes is enough to
14
+ * keep the cleanup obligation off the critical path while still bounding
15
+ * worst-case dir age to ttl + 1h on a long-running server.
16
+ */
17
+ const DEFAULT_UPLOAD_SWEEP_INTERVAL_MS = 60 * 60 * 1000;
18
+ export function createPortDetectedNotification(projectId, projectName, port, now = Date.now()) {
19
+ return {
20
+ id: randomUUID(),
21
+ projectId,
22
+ type: "port-detected",
23
+ title: "Port detected",
24
+ message: `Port ${port.port} is listening in ${projectName}`,
25
+ timestamp: now,
26
+ read: false,
27
+ port: port.port,
28
+ bindsAll: port.bindsAll,
29
+ reachable: port.reachable ?? port.bindsAll,
30
+ ...(port.reachablePort !== undefined
31
+ ? { reachablePort: port.reachablePort }
32
+ : {}),
33
+ };
34
+ }
35
+ /**
36
+ * Annotate each port with `reachable` (does the viewer device need nothing
37
+ * extra: dev server binds all interfaces, parasor is loopback-bound, or a TCP
38
+ * forwarder is up) and `reachablePort` (the forwarder's OS-assigned listen
39
+ * port when one fronts this dev port).
40
+ */
41
+ export function enrichPorts(ports, projectId, forwarder) {
42
+ return ports.map((info) => {
43
+ const reachablePort = forwarder.getReachablePort(projectId, info.port);
44
+ const reachable = info.bindsAll || forwarder.isInert() || reachablePort !== null;
45
+ return {
46
+ ...info,
47
+ reachable,
48
+ ...(reachablePort !== null ? { reachablePort } : {}),
49
+ };
50
+ });
51
+ }
52
+ export function broadcastForegroundTitles(ptyManager, eventBus) {
53
+ for (const session of ptyManager.list()) {
54
+ if (session.state !== "running")
55
+ continue;
56
+ if (session.titleManual === true)
57
+ continue;
58
+ const name = ptyManager.getForegroundProcess(session.id);
59
+ if (!name || name === session.title)
60
+ continue;
61
+ if (!ptyManager.setTitle(session.id, name))
62
+ continue;
63
+ eventBus.broadcast({
64
+ type: "session-title-changed",
65
+ sessionId: session.id,
66
+ title: name,
67
+ titleManual: false,
68
+ });
69
+ }
70
+ }
71
+ export function startRuntimeLoops({ appStateStore, eventBus, portScanner, ptyManager, projectRuntime, uploadStaging, reconcileWorktrees, bindHost = "0.0.0.0", portForwarder, titlePollIntervalMs = DEFAULT_TITLE_POLL_INTERVAL_MS, gitPollIntervalMs = DEFAULT_GIT_POLL_INTERVAL_MS, uploadSweepIntervalMs = DEFAULT_UPLOAD_SWEEP_INTERVAL_MS, }) {
72
+ // Tracks the last-seen `reachable` value for each port per project so we can
73
+ // re-notify when a port becomes reachable from the viewer device -- either it
74
+ // flips from loopback-only to public, or the TCP forwarder finishes binding
75
+ // (the forwarder's `listen` is async, so a freshly-detected loopback port is
76
+ // not yet reachable on the tick it first appears) -- without spamming on
77
+ // every tick.
78
+ const knownPorts = new Map();
79
+ // Last raw `PortInfo[]` per project (no `reachable`/`reachablePort`) so we
80
+ // can re-derive the enriched view when the forwarder changes out-of-band
81
+ // (async bind completes/errors) or the `portDetection` setting flips.
82
+ const lastPorts = new Map();
83
+ const forwarder = portForwarder ?? new PortForwarder(resolveForwarderBindHost(bindHost));
84
+ // Derive the enriched ports for `projectId` from `ports`, broadcast
85
+ // `ports-updated`, update the seen-reachability bookkeeping, and emit a
86
+ // `port-detected` notification for any port that just became reachable.
87
+ function reemitPorts(projectId, ports) {
88
+ const mode = appStateStore.get().serviceConfig.portDetection;
89
+ const enriched = enrichPorts(ports, projectId, forwarder);
90
+ eventBus.broadcast({ type: "ports-updated", projectId, ports: enriched });
91
+ const previous = knownPorts.get(projectId) ?? new Map();
92
+ const next = new Map(enriched.map((p) => [p.port, p.reachable === true]));
93
+ if (next.size === 0)
94
+ knownPorts.delete(projectId);
95
+ else
96
+ knownPorts.set(projectId, next);
97
+ if (mode === "off")
98
+ return;
99
+ const project = appStateStore
100
+ .get()
101
+ .projects.find((p) => p.id === projectId);
102
+ if (!project)
103
+ return;
104
+ for (const info of enriched) {
105
+ // mode === "all-interfaces" is the only notify-mode left (see local notify-mode cleanup).
106
+ // Notify only for ports the viewer can actually open.
107
+ if (!info.reachable)
108
+ continue;
109
+ const wasReachable = previous.get(info.port) === true;
110
+ if (wasReachable)
111
+ continue;
112
+ const notification = createPortDetectedNotification(projectId, project.name, info);
113
+ eventBus.addNotification(notification);
114
+ eventBus.broadcast({ type: "notification", notification });
115
+ }
116
+ }
117
+ // The forwarder's listen is async -- re-emit when it finishes binding (or its
118
+ // bind errored) so the now-reachable port reaches clients (and fires the
119
+ // toast). Registered unconditionally so it works for an injected test
120
+ // forwarder too.
121
+ forwarder.setOnChange((projectId) => {
122
+ const ports = lastPorts.get(projectId);
123
+ if (ports)
124
+ reemitPorts(projectId, ports);
125
+ });
126
+ portScanner.onPortsChanged((projectId, ports) => {
127
+ const mode = appStateStore.get().serviceConfig.portDetection;
128
+ // `portDetection === "off"` ⇒ no forwarder ever started (the user opted
129
+ // out of port detection entirely). The next non-"off" tick will sync.
130
+ forwarder.sync(projectId, mode === "off" ? [] : ports);
131
+ if (ports.length === 0)
132
+ lastPorts.delete(projectId);
133
+ else
134
+ lastPorts.set(projectId, ports);
135
+ reemitPorts(projectId, ports);
136
+ });
137
+ portScanner.start(() => ptyManager.list());
138
+ const titlePollTimer = setInterval(() => {
139
+ broadcastForegroundTitles(ptyManager, eventBus);
140
+ }, titlePollIntervalMs);
141
+ const gitPollTimer = setInterval(() => {
142
+ void projectRuntime.pollGitChanges();
143
+ if (reconcileWorktrees) {
144
+ for (const project of appStateStore.get().projects) {
145
+ void reconcileWorktrees(project.id);
146
+ }
147
+ }
148
+ }, gitPollIntervalMs);
149
+ const uploadSweepTimer = setInterval(() => {
150
+ uploadStaging.sweepStale().then(({ swept }) => {
151
+ if (swept.length > 0) {
152
+ console.log(`[upload-staging] L3 periodic sweep: removed ${swept.length} stale entries`);
153
+ }
154
+ }, (err) => {
155
+ console.error("[upload-staging] L3 periodic sweep failed:", err);
156
+ });
157
+ }, uploadSweepIntervalMs);
158
+ // Same idiom as startupCheckTimer in other loops -- `unref()` so a
159
+ // pending tick never holds the event loop open during graceful exit.
160
+ uploadSweepTimer.unref();
161
+ let lastPortDetection = appStateStore.get().serviceConfig.portDetection;
162
+ return {
163
+ stop() {
164
+ clearInterval(titlePollTimer);
165
+ clearInterval(gitPollTimer);
166
+ clearInterval(uploadSweepTimer);
167
+ portScanner.stop();
168
+ forwarder.stop();
169
+ },
170
+ /**
171
+ * React to a `serviceConfig` change. On a `portDetection` transition,
172
+ * re-sync the forwarder for every known project (`off` ⇒ tear all
173
+ * forwarders down; back to `all-interfaces` ⇒ recreate them for the
174
+ * currently-known ports) and re-emit so clients see the updated
175
+ * `reachable`/`reachablePort`. Other fields are no-ops here.
176
+ */
177
+ onServiceConfigChanged(config) {
178
+ if (config.portDetection === lastPortDetection)
179
+ return;
180
+ lastPortDetection = config.portDetection;
181
+ for (const projectId of new Set(lastPorts.keys())) {
182
+ const ports = lastPorts.get(projectId) ?? [];
183
+ forwarder.sync(projectId, config.portDetection === "off" ? [] : ports);
184
+ reemitPorts(projectId, ports);
185
+ }
186
+ },
187
+ };
188
+ }
189
+ //# sourceMappingURL=runtime-loops.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loops.js","sourceRoot":"","sources":["../../src/bootstrap/runtime-loops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAO/D,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAC5C;;;;;GAKG;AACH,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAC5C;;;;GAIG;AACH,MAAM,gCAAgC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AA4BxD,MAAM,UAAU,8BAA8B,CAC5C,SAAiB,EACjB,WAAmB,EACnB,IAAc,EACd,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;IAEhB,OAAO;QACL,EAAE,EAAE,UAAU,EAAE;QAChB,SAAS;QACT,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE,QAAQ,IAAI,CAAC,IAAI,oBAAoB,WAAW,EAAE;QAC3D,SAAS,EAAE,GAAG;QACd,IA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AAK,CAAC,CAAC;gBACvE,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function probePort(from: number, attempts: number, hostname: string): Promise<number>;
2
+ export declare function writeRuntimeFile(runtimeFile: string, hostname: string, actualPort: number): void;
3
+ export declare function removeRuntimeFile(runtimeFile: string): void;
4
+ //# sourceMappingURL=runtime-port.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-port.d.ts","sourceRoot":"","sources":["../../src/bootstrap/runtime-port.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAqBjB;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,IAAI,CA0BN;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAM3D"}
@@ -0,0 +1,52 @@
1
+ import { unlinkSync } from "node:fs";
2
+ import { createServer } from "node:net";
3
+ import writeFileAtomic from "write-file-atomic";
4
+ export async function probePort(from, attempts, hostname) {
5
+ for (let offset = 0; offset < attempts; offset++) {
6
+ const candidate = from + offset;
7
+ const available = await new Promise((resolve) => {
8
+ const tester = createServer();
9
+ tester.once("error", (err) => {
10
+ tester.close();
11
+ resolve(err.code !== "EADDRINUSE");
12
+ });
13
+ tester.once("listening", () => {
14
+ tester.close(() => resolve(true));
15
+ });
16
+ tester.listen(candidate, hostname);
17
+ });
18
+ if (available)
19
+ return candidate;
20
+ }
21
+ throw new Error(`No free port found in range ${from}..${from + attempts - 1} on ${hostname}`);
22
+ }
23
+ export function writeRuntimeFile(runtimeFile, hostname, actualPort) {
24
+ /*
25
+ * Atomic tmp-file-then-rename: previous implementation used a plain
26
+ * writeFileSync which could produce a partially-written file that
27
+ * readers (`parasor qr`, service wrappers) would parse as invalid JSON
28
+ * if they raced the server's startup. write-file-atomic's sync path
29
+ * writes to <file>.<randomsuffix>, fsyncs, then renames -- either
30
+ * readers see the old bytes or the new bytes, never a torn write.
31
+ */
32
+ try {
33
+ writeFileAtomic.sync(runtimeFile, JSON.stringify({
34
+ port: actualPort,
35
+ bindHost: hostname,
36
+ pid: process.pid,
37
+ startedAt: Date.now(),
38
+ }, null, 2));
39
+ }
40
+ catch (error) {
41
+ console.warn(`Failed to write runtime.json: ${error.message}`);
42
+ }
43
+ }
44
+ export function removeRuntimeFile(runtimeFile) {
45
+ try {
46
+ unlinkSync(runtimeFile);
47
+ }
48
+ catch {
49
+ // Already gone or never written -- nothing to clean up.
50
+ }
51
+ }
52
+ //# sourceMappingURL=runtime-port.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-port.js","sourceRoot":"","sources":["../../src/bootstrap/runtime-port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,IAAY,EACZ,QAAgB,EAChB,QAAgB;IAEhB,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;QAChC,MAAM,SAAS,GAAG,MAAM,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;YACvD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAA0B,EAAE,EAAE;gBAClD,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC5B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,IAAI,SAAS;YAAE,OAAO,SAAS,CAAC;IAClC,CAAC;IAED,MAAM,IAAI,KAAK,CACb,+BAA+B,IAAI,KAAK,IAAI,GAAG,QAAQ,GAAG,CAAC,OAAO,QAAQ,EAAE,CAC7E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,WAAmB,EACnB,QAAgB,EAChB,UAAkB;IAElB;;;;;;;OAOG;IACH,IAAI,CAAC;QACH,eAAe,CAAC,IAAI,CAClB,WAAW,EACX,IAAI,CAAC,SAAS,CACZ;YACE,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,QAAQ;YAClB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,iCAAkC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,IAAI,CAAC;QACH,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,wDAAwD;IAC1D,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { AuthMode } from "./create-app-server.js";
2
+ export interface SelectBindAddressOptions {
3
+ explicit: string | undefined;
4
+ }
5
+ /**
6
+ * Default bind = `0.0.0.0` (all IPv4 interfaces). Matches the dominant
7
+ * pattern across self-hosted dev/web-terminal tools (ttyd / gotty / wetty /
8
+ * Next.js dev / Vite + `--host`). Auth (token + Origin) is the primary
9
+ * defense; restricting the bind is opt-in via `--host 127.0.0.1` for
10
+ * loopback-only or `--host <specific-ip>` for a single interface.
11
+ */
12
+ export declare function selectBindAddress({ explicit, }: SelectBindAddressOptions): string;
13
+ export declare function isLoopback(host: string): boolean;
14
+ export interface EnforceSafetyGateOptions {
15
+ authMode: AuthMode;
16
+ bindHost: string;
17
+ allowUnsafe: boolean;
18
+ exit?: (code?: number) => never;
19
+ error?: (line: string) => void;
20
+ }
21
+ export declare function enforceSafetyGate({ authMode, bindHost, allowUnsafe, exit, error, }: EnforceSafetyGateOptions): void;
22
+ //# sourceMappingURL=safety-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safety-gate.d.ts","sourceRoot":"","sources":["../../src/bootstrap/safety-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,GACT,EAAE,wBAAwB,GAAG,MAAM,CAGnC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAYhD;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC;IAChC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAUD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,IAAmB,EACnB,KAAqB,GACtB,EAAE,wBAAwB,GAAG,IAAI,CAMjC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Default bind = `0.0.0.0` (all IPv4 interfaces). Matches the dominant
3
+ * pattern across self-hosted dev/web-terminal tools (ttyd / gotty / wetty /
4
+ * Next.js dev / Vite + `--host`). Auth (token + Origin) is the primary
5
+ * defense; restricting the bind is opt-in via `--host 127.0.0.1` for
6
+ * loopback-only or `--host <specific-ip>` for a single interface.
7
+ */
8
+ export function selectBindAddress({ explicit, }) {
9
+ if (explicit && explicit.length > 0)
10
+ return explicit;
11
+ return "0.0.0.0";
12
+ }
13
+ export function isLoopback(host) {
14
+ if (host === "localhost")
15
+ return true;
16
+ if (host === "::1")
17
+ return true;
18
+ const parts = host.split(".").map(Number);
19
+ if (parts.length === 4 &&
20
+ parts.every((n) => Number.isInteger(n) && n >= 0 && n <= 255) &&
21
+ parts[0] === 127) {
22
+ return true;
23
+ }
24
+ return false;
25
+ }
26
+ const UNSAFE_MESSAGE = [
27
+ "Refusing to start: PARASOR_AUTH=none with non-loopback bind is unsafe.",
28
+ "Either:",
29
+ " - Keep auth enabled (remove PARASOR_AUTH=none), or",
30
+ " - Bind to loopback: HOST=127.0.0.1 (or --host 127.0.0.1)",
31
+ "Override for integration tests only: PARASOR_ALLOW_UNSAFE=1",
32
+ ].join("\n");
33
+ export function enforceSafetyGate({ authMode, bindHost, allowUnsafe, exit = process.exit, error = console.error, }) {
34
+ if (authMode !== "none")
35
+ return;
36
+ if (isLoopback(bindHost))
37
+ return;
38
+ if (allowUnsafe)
39
+ return;
40
+ error(UNSAFE_MESSAGE);
41
+ exit(1);
42
+ }
43
+ //# sourceMappingURL=safety-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safety-gate.js","sourceRoot":"","sources":["../../src/bootstrap/safety-gate.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB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end of a graceful shutdown. On next startup
3
+ * the absence of this file means the previous run crashed, which in turn
4
+ * means child PTY processes may be orphaned and unsafe to respawn with
5
+ * the same command (potential double-run).
6
+ *
7
+ * The default filename `shutdown.marker` belongs to the in-process
8
+ * server. Daemon-mode passes `daemon-shutdown.marker` so the two writers
9
+ * never collide on the same `state.json` directory -- a graceful
10
+ * server-side shutdown does not imply the daemon (which owns the PTY
11
+ * children in remote mode) also exited gracefully.
12
+ *
13
+ * The write is open->write->fsync(file)->close->fsync(dir) so a kernel
14
+ * panic between the graceful-exit code path and the next boot does not
15
+ * let the marker "exist" only in dirty page-cache while the post-panic
16
+ * boot reads its absence as graceful. The directory fsync is essential
17
+ * because the marker's *existence* (not its content) is what subsequent
18
+ * boots check -- without it, the directory entry created by `openSync`
19
+ * may live in dirty inode cache only (). Both fsyncs
20
+ * are best-effort: if either fails we still close the fd; worst case the
21
+ * marker is read as absent on the next boot, which is the conservative
22
+ * "treat as crash" side.
23
+ */
24
+ export declare function writeShutdownMarker(configDir: string, filename?: string): void;
25
+ /**
26
+ * Read the marker on startup. Returns true if the previous shutdown was
27
+ * graceful. The marker is always cleared so that a subsequent crash is
28
+ * correctly detected.
29
+ */
30
+ export declare function readAndClearShutdownMarker(configDir: string, filename?: string): boolean;
31
+ /** Convenience wrappers -- daemon-side callers should prefer these to keep
32
+ * the marker filename centralised here. */
33
+ export declare function writeDaemonShutdownMarker(stateDir: string): void;
34
+ export declare function readAndClearDaemonShutdownMarker(stateDir: string): boolean;
35
+ //# sourceMappingURL=shutdown-marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shutdown-marker.d.ts","sourceRoot":"","sources":["../../src/bootstrap/shutdown-marker.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAA+B,GACxC,IAAI,CAwCN;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAA+B,GACxC,OAAO,CAWT;AAED;4CAC4C;AAC5C,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEhE;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE1E"}