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,662 @@
1
+ import { execFileSync } from "node:child_process";
2
+ import { mkdirSync, writeFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ const CLAUDE_HOOK_SCRIPT_NAME = "parasor-claude-hook.sh";
5
+ const CODEX_EVENT_SCRIPT_NAME = "parasor-codex-event.sh";
6
+ const CODEX_NOTIFY_SCRIPT_NAME = "parasor-codex-notify.sh";
7
+ export function installShims(configDir) {
8
+ const binDir = join(configDir, "bin");
9
+ const shellDir = join(configDir, "shell");
10
+ const zshDotdir = join(shellDir, "zsh");
11
+ const bashDir = join(shellDir, "bash");
12
+ const bashRcPath = join(bashDir, ".bashrc");
13
+ mkdirSync(binDir, { recursive: true });
14
+ mkdirSync(zshDotdir, { recursive: true });
15
+ mkdirSync(bashDir, { recursive: true });
16
+ const realOpen = resolveRealBinary("open", binDir);
17
+ const realXdgOpen = resolveRealBinary("xdg-open", binDir);
18
+ if (realOpen) {
19
+ writeFileSync(join(binDir, "open"), `#!/bin/sh\nexec parasor shim-open --kind=macos-open -- "$@"\n`, { mode: 0o755 });
20
+ }
21
+ if (realXdgOpen) {
22
+ writeFileSync(join(binDir, "xdg-open"), `#!/bin/sh\nexec parasor shim-open --kind=xdg-open -- "$@"\n`, { mode: 0o755 });
23
+ }
24
+ // Standalone Claude Code hook bridge. The Claude wrapper points its
25
+ // hooks JSON at this script directly instead of `parasor hook claude`,
26
+ // because Node.js cold start (100-300ms per invocation) is the bottleneck
27
+ // for sidebar status latency -- every PreToolUse / PostToolUse / Stop
28
+ // pays the boot cost while Claude Code blocks on hook completion. A
29
+ // posix shell + curl one-shot runs in single-digit milliseconds.
30
+ const claudeHookPath = join(binDir, CLAUDE_HOOK_SCRIPT_NAME);
31
+ writeFileSync(claudeHookPath, buildClaudeHookBridge(), { mode: 0o755 });
32
+ // Claude Code wrapper. Sits in PATH ahead of the real `claude` binary,
33
+ // injects per-invocation `--settings <hooks JSON>` so Claude Code's hook
34
+ // events fire the bridge script for each state transition. We do not
35
+ // touch the user's `~/.claude/settings.json` -- Claude Code's `--settings`
36
+ // flag accepts an inline JSON string and merges additively at runtime.
37
+ writeFileSync(join(binDir, "claude"), buildClaudeWrapper(binDir, claudeHookPath), {
38
+ mode: 0o755,
39
+ });
40
+ // Codex wrapper. Unlike Claude, Codex's native hooks currently require a
41
+ // hooks.json layer, which would either mutate the user's ~/.codex or force
42
+ // us to swap CODEX_HOME (and therefore auth/config) for the whole process.
43
+ // To stay app-contained, we follow a runtime-only path instead:
44
+ // inject a per-process notify command and record the TUI session log, then
45
+ // translate the explicit task/approval events into parasor hook-notify
46
+ // signals.
47
+ const codexEventPath = join(binDir, CODEX_EVENT_SCRIPT_NAME);
48
+ const codexNotifyPath = join(binDir, CODEX_NOTIFY_SCRIPT_NAME);
49
+ writeFileSync(codexEventPath, buildCodexEventBridge(), { mode: 0o755 });
50
+ writeFileSync(codexNotifyPath, buildCodexNotifyBridge(), { mode: 0o755 });
51
+ writeFileSync(join(binDir, "codex"), buildCodexWrapper(binDir, codexEventPath, codexNotifyPath), {
52
+ mode: 0o755,
53
+ });
54
+ writeFileSync(join(zshDotdir, ".zshenv"), buildParasorZshEnv(binDir), {
55
+ mode: 0o644,
56
+ });
57
+ writeFileSync(join(zshDotdir, ".zshrc"), buildParasorZshRc(binDir), {
58
+ mode: 0o644,
59
+ });
60
+ writeFileSync(bashRcPath, buildParasorBashRc(binDir), {
61
+ mode: 0o644,
62
+ });
63
+ return { bashRcPath, binDir, realOpen, realXdgOpen, zshDotdir };
64
+ }
65
+ export function buildCodexEventBridge() {
66
+ return `#!/bin/sh
67
+ # parasor Codex event bridge.
68
+ #
69
+ # Receives a normalized Codex event name as argv[1] and POSTs it directly
70
+ # to parasor's loopback hook endpoint. Used by the Codex wrapper's session
71
+ # log watcher for task_started / task_complete / *_approval_request events.
72
+
73
+ set -u
74
+
75
+ [ -z "\${PARASOR_PORT:-}" ] && exit 0
76
+ [ -z "\${PARASOR_SESSION_ID:-}" ] && exit 0
77
+
78
+ EVENT="\${1:-}"
79
+ [ -z "$EVENT" ] && exit 0
80
+
81
+ BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"agent\\":\\"codex\\",\\"event\\":\\"$EVENT\\"}"
82
+ DEBUG_BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"label\\":\\"codex-session-log\\",\\"detail\\":\\"$EVENT\\"}"
83
+
84
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/debug" \\
85
+ -H "Content-Type: application/json" \\
86
+ -d "$DEBUG_BODY" \\
87
+ --connect-timeout 1 \\
88
+ --max-time 2 \\
89
+ -o /dev/null \\
90
+ >/dev/null 2>&1 || true
91
+
92
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/notify" \\
93
+ -H "Content-Type: application/json" \\
94
+ -d "$BODY" \\
95
+ --connect-timeout 1 \\
96
+ --max-time 2 \\
97
+ -o /dev/null \\
98
+ >/dev/null 2>&1 || true
99
+
100
+ exit 0
101
+ `;
102
+ }
103
+ export function buildCodexNotifyBridge() {
104
+ return `#!/bin/sh
105
+ # parasor Codex notify bridge.
106
+ #
107
+ # Codex's runtime \`notify\` config appends a single JSON payload argument
108
+ # after each completed turn. We extract the payload's event type (usually
109
+ # agent-turn-complete) and forward it to parasor as a high-confidence Codex
110
+ # lifecycle event.
111
+
112
+ set -u
113
+
114
+ [ -z "\${PARASOR_PORT:-}" ] && exit 0
115
+ [ -z "\${PARASOR_SESSION_ID:-}" ] && exit 0
116
+
117
+ PAYLOAD="\${1:-}"
118
+ [ -z "$PAYLOAD" ] && exit 0
119
+
120
+ field() {
121
+ printf '%s' "$PAYLOAD" \\
122
+ | grep -oE "\\"$1\\"[[:space:]]*:[[:space:]]*\\"[^\\"]*\\"" \\
123
+ | head -n1 \\
124
+ | sed -E "s/^\\"$1\\"[[:space:]]*:[[:space:]]*\\"([^\\"]*)\\"$/\\1/"
125
+ }
126
+
127
+ EVENT=$(field type)
128
+ [ -z "$EVENT" ] && EVENT=$(field event)
129
+ [ -z "$EVENT" ] && EVENT=$(field hook_event_name)
130
+ [ -z "$EVENT" ] && exit 0
131
+
132
+ BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"agent\\":\\"codex\\",\\"event\\":\\"$EVENT\\"}"
133
+ DEBUG_BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"label\\":\\"codex-notify\\",\\"detail\\":\\"$EVENT\\"}"
134
+
135
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/debug" \\
136
+ -H "Content-Type: application/json" \\
137
+ -d "$DEBUG_BODY" \\
138
+ --connect-timeout 1 \\
139
+ --max-time 2 \\
140
+ -o /dev/null \\
141
+ >/dev/null 2>&1 || true
142
+
143
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/notify" \\
144
+ -H "Content-Type: application/json" \\
145
+ -d "$BODY" \\
146
+ --connect-timeout 1 \\
147
+ --max-time 2 \\
148
+ -o /dev/null \\
149
+ >/dev/null 2>&1 || true
150
+
151
+ exit 0
152
+ `;
153
+ }
154
+ /**
155
+ * Build the posix-shell source of the Claude Code hook bridge. Reads a
156
+ * Claude Code hook payload on stdin, extracts the event name (plus a
157
+ * payload-driven discriminator for PreToolUse/Notification), and POSTs
158
+ * the normalized {sessionId, agent, event} triple to the loopback
159
+ * /hook/notify endpoint. Always exits 0 so a hook failure never breaks
160
+ * the agent. Returns inline so the script content can be unit-tested.
161
+ *
162
+ * Why this is a separate file and not inlined into the wrapper's hooks
163
+ * JSON: hook commands are a single argv[0], not a shell snippet, and
164
+ * embedding multi-line shell into JSON is illegible. Keeping it in its
165
+ * own file under the shim binDir also lets users inspect what they're
166
+ * running.
167
+ */
168
+ export function buildClaudeHookBridge() {
169
+ // Composed as a string template so the script can grow without
170
+ // fighting JS escape rules. The shell-side variables are all
171
+ // unprefixed identifiers (PAYLOAD, EVENT, ...) so backticks stay free.
172
+ return `#!/bin/sh
173
+ # parasor Claude Code hook bridge.
174
+ #
175
+ # Auto-installed by parasor into its shim binDir. Claude Code invokes
176
+ # this script for each subscribed hook event with a JSON payload on
177
+ # stdin. We extract the event name (plus a payload-driven discriminator
178
+ # where the downstream state mapping needs one) and POST it to the
179
+ # loopback parasor server. Always exits 0 -- a hook failure must never
180
+ # break the agent.
181
+ #
182
+ # Why a shell script and not the typed \`parasor hook claude\` Node CLI:
183
+ # Claude Code blocks on hook completion before advancing the agent loop,
184
+ # and a Node cold start of 100-300ms per hook is enough to make the
185
+ # sidebar's running/idle indicator visibly lag. A posix shell + curl
186
+ # one-shot runs in single-digit milliseconds.
187
+
188
+ set -u
189
+
190
+ # Bail when the parasor server isn't reachable. PARASOR_PORT and
191
+ # PARASOR_SESSION_ID are set on every PTY parasor spawns; if they're
192
+ # missing we're not running under a live parasor session.
193
+ [ -z "\${PARASOR_PORT:-}" ] && exit 0
194
+ [ -z "\${PARASOR_SESSION_ID:-}" ] && exit 0
195
+
196
+ PAYLOAD=$(cat)
197
+ [ -z "$PAYLOAD" ] && exit 0
198
+
199
+ # Extract a single \`"key":"value"\` string field from PAYLOAD by name.
200
+ # Tolerates whitespace around the colon. The fields we actually read
201
+ # (hook_event_name, tool_name, notification_type) are short snake_case
202
+ # identifiers from Claude Code's own enums and never contain escaped
203
+ # quotes, so a regex extractor is safe -- we explicitly accept that this
204
+ # would not survive arbitrary JSON.
205
+ field() {
206
+ printf '%s' "$PAYLOAD" \\
207
+ | grep -oE "\\"$1\\"[[:space:]]*:[[:space:]]*\\"[^\\"]*\\"" \\
208
+ | head -n1 \\
209
+ | sed -E "s/^\\"$1\\"[[:space:]]*:[[:space:]]*\\"([^\\"]*)\\"$/\\1/"
210
+ }
211
+
212
+ EVENT=$(field hook_event_name)
213
+ [ -z "$EVENT" ] && exit 0
214
+
215
+ # Discriminate events whose downstream state mapping depends on a
216
+ # payload field (see agent-detector/event-map.ts). The composite key
217
+ # is parsed in mapEventType() with a fallback to the bare event class,
218
+ # so adding a new tool here just lets future overrides specialize it.
219
+ case "$EVENT" in
220
+ PreToolUse)
221
+ TOOL=$(field tool_name)
222
+ [ -n "$TOOL" ] && EVENT="$EVENT:$TOOL"
223
+ ;;
224
+ Notification)
225
+ NTYPE=$(field notification_type)
226
+ [ -n "$NTYPE" ] && EVENT="$EVENT:$NTYPE"
227
+ ;;
228
+ esac
229
+
230
+ # Hand-built JSON body. Every value comes from a server-set env var
231
+ # or one of Claude Code's enum strings, so there's no quoting hazard.
232
+ BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"agent\\":\\"claude\\",\\"event\\":\\"$EVENT\\"}"
233
+ DEBUG_BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"label\\":\\"claude-hook-bridge\\",\\"detail\\":\\"$EVENT\\"}"
234
+
235
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/debug" \\
236
+ -H "Content-Type: application/json" \\
237
+ -d "$DEBUG_BODY" \\
238
+ --connect-timeout 1 \\
239
+ --max-time 2 \\
240
+ -o /dev/null \\
241
+ >/dev/null 2>&1 || true
242
+
243
+ # Short timeouts so a flaky local server can't stall the agent loop.
244
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/notify" \\
245
+ -H "Content-Type: application/json" \\
246
+ -d "$BODY" \\
247
+ --connect-timeout 1 \\
248
+ --max-time 2 \\
249
+ -o /dev/null \\
250
+ >/dev/null 2>&1 || true
251
+
252
+ if [ "\${PARASOR_HOOK_DEBUG:-}" = "1" ]; then
253
+ printf '[parasor-hook] %s\\n' "$EVENT" >&2
254
+ fi
255
+
256
+ exit 0
257
+ `;
258
+ }
259
+ /**
260
+ * Build the bash source of the claude wrapper. Inline so it can read the
261
+ * shim binDir at install time and avoid self-reference loops.
262
+ */
263
+ export function buildClaudeWrapper(binDir, hookScriptPath) {
264
+ // Hooks JSON. Every event uses the same command (the inline bash hook
265
+ // bridge above), which parses Claude Code's stdin payload and forwards
266
+ // a normalized event to the loopback /hook/notify endpoint.
267
+ //
268
+ // Nine core events are subscribed (server-side normalized via
269
+ // agent-detector/event-map.ts -> AgentState.lifecycle):
270
+ // SessionStart -> noop on the server (no visible status flash)
271
+ // UserPromptSubmit -> running (user typed a prompt)
272
+ // PreToolUse -> usually running; only explicit hand-off tools
273
+ // (AskUserQuestion / ExitPlanMode)
274
+ // are elevated to waiting by the event
275
+ // map after we include tool_name in the
276
+ // forwarded event string.
277
+ // PermissionRequest -> waiting (official Claude permission dialog)
278
+ // PermissionDenied -> running (auto-mode denial; Claude keeps going)
279
+ // PostToolUse -> running (tool finished, agent thinking again)
280
+ // Stop -> completed (assistant finished its turn)
281
+ // Notification -> only specific user-input-required subtypes map
282
+ // to waiting; generic notifications are
283
+ // ignored conservatively.
284
+ // Elicitation -> waiting (MCP asked the user a question)
285
+ // ElicitationResult -> running (user answered; Claude resumes)
286
+ // SessionEnd -> idle (Ctrl+C cleanup -- Stop does not fire)
287
+ const hookEntry = {
288
+ matcher: "",
289
+ hooks: [{ type: "command", command: hookScriptPath, timeout: 5 }],
290
+ };
291
+ const hooksJson = JSON.stringify({
292
+ hooks: {
293
+ SessionStart: [hookEntry],
294
+ UserPromptSubmit: [hookEntry],
295
+ PreToolUse: [hookEntry],
296
+ PermissionRequest: [hookEntry],
297
+ PermissionDenied: [hookEntry],
298
+ PostToolUse: [hookEntry],
299
+ Stop: [hookEntry],
300
+ Notification: [hookEntry],
301
+ Elicitation: [hookEntry],
302
+ ElicitationResult: [hookEntry],
303
+ SessionEnd: [hookEntry],
304
+ },
305
+ });
306
+ // `find_real_claude` walks PATH skipping our own binDir so we never
307
+ // exec ourselves recursively. `inside_parasor` confirms we're still
308
+ // running under a live parasor server before injecting hooks -- if the
309
+ // server crashed mid-session and PARASOR_PORT is stale, fall through
310
+ // to the real claude unmodified rather than silently breaking every
311
+ // prompt.
312
+ return `#!/usr/bin/env bash
313
+ # parasor claude wrapper -- injects --settings hooks JSON so Claude Code's
314
+ # SessionStart / UserPromptSubmit / PreToolUse / PermissionRequest /
315
+ # PermissionDenied / Stop / Notification / Elicitation /
316
+ # ElicitationResult / SessionEnd hooks call back into parasor via the
317
+ # typed \`parasor hook claude\` bridge. Auto-installed by parasor into its
318
+ # shim binDir, which the server prepends to PATH for every PTY it spawns.
319
+ # No global Claude config (~/.claude/settings.json) is modified.
320
+
321
+ set -u
322
+
323
+ SHIM_DIR='${binDir}'
324
+ # HOOKS_JSON is embedded as a bash single-quoted string. Single-quoted
325
+ # strings in bash don't interpret backslashes, so JSON escapes (e.g. \\n)
326
+ # survive intact. The only character that needs escaping is the literal
327
+ # single quote, which we close-quote-escape-reopen with the standard
328
+ # '\\'' trick. The embedded JSON below is produced by JSON.stringify
329
+ # from a fixed object literal in shim-installer.ts, so no user-controlled
330
+ # content lands here -- the escape pass is a future-proofing belt.
331
+ HOOKS_JSON='${hooksJson.replace(/'/g, "'\\''")}'
332
+
333
+ find_real_claude() {
334
+ local IFS=:
335
+ for d in $PATH; do
336
+ [ -z "$d" ] && continue
337
+ [ "$d" = "$SHIM_DIR" ] && continue
338
+ if [ -x "$d/claude" ] && [ "$d/claude" != "$0" ]; then
339
+ printf '%s\\n' "$d/claude"
340
+ return 0
341
+ fi
342
+ done
343
+ return 1
344
+ }
345
+
346
+ inside_parasor() {
347
+ [ -n "\${PARASOR_PORT:-}" ] || return 1
348
+ [ -n "\${PARASOR_SESSION_ID:-}" ] || return 1
349
+ return 0
350
+ }
351
+
352
+ REAL_CLAUDE="$(find_real_claude)" || {
353
+ echo 'parasor claude shim: real claude binary not found in PATH' >&2
354
+ exit 127
355
+ }
356
+
357
+ # Pass through subcommands that don't accept --settings (or where
358
+ # injecting hooks would be meaningless).
359
+ case "\${1:-}" in
360
+ mcp|config|api-key|migrate-installer|update|doctor|help|--help|-h|--version|-v)
361
+ exec "$REAL_CLAUDE" "$@"
362
+ ;;
363
+ esac
364
+
365
+ # Outside parasor: passthrough cleanly.
366
+ if ! inside_parasor; then
367
+ exec "$REAL_CLAUDE" "$@"
368
+ fi
369
+
370
+ DEBUG_BODY="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"label\\":\\"claude-wrapper-exec\\",\\"detail\\":\\"\${1:-}\\"}"
371
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/debug" \\
372
+ -H "Content-Type: application/json" \\
373
+ -d "$DEBUG_BODY" \\
374
+ --connect-timeout 1 \\
375
+ --max-time 2 \\
376
+ -o /dev/null \\
377
+ >/dev/null 2>&1 || true
378
+
379
+ # Parasor active -- inject hooks. \`parasor hook claude\` reads each hook's
380
+ # stdin payload (which Claude Code populates with hook_event_name etc.)
381
+ # and forwards the normalized state via the loopback HTTP endpoint.
382
+ #
383
+ # When PARASOR_UPLOAD_DIR is set (upload staging isolation -- chat composer drops live
384
+ # under $TMPDIR/parasor/uploads/, outside the project tree), extend
385
+ # Claude Code's cwd allowlist with --add-dir so the agent can read files
386
+ # the user just dropped. PARASOR_UPLOAD_DIR is exported by the parasor
387
+ # server for every PTY it spawns; absent on legacy installs, in which case
388
+ # we omit the flag.
389
+ EXTRA_ARGS=()
390
+ if [ -n "\${PARASOR_UPLOAD_DIR:-}" ]; then
391
+ EXTRA_ARGS+=(--add-dir "$PARASOR_UPLOAD_DIR")
392
+ fi
393
+ exec "$REAL_CLAUDE" --settings "$HOOKS_JSON" "\${EXTRA_ARGS[@]}" "$@"
394
+ `;
395
+ }
396
+ export function buildCodexWrapper(binDir, eventScriptPath, notifyScriptPath) {
397
+ const notifyConfig = JSON.stringify(["bash", notifyScriptPath]);
398
+ return `#!/usr/bin/env bash
399
+ # parasor codex wrapper -- injects a per-process notify command and records
400
+ # the Codex TUI session log so task_started / task_complete /
401
+ # *_approval_request can be mirrored into parasor without editing the
402
+ # user's ~/.codex files. This follows the same runtime-only approach
403
+ # the runtime-only wrapper uses when native hooks are unavailable or undesirable.
404
+
405
+ set -u
406
+
407
+ SHIM_DIR='${binDir}'
408
+ CODEX_EVENT_SCRIPT='${eventScriptPath}'
409
+ NOTIFY_ARG='${notifyConfig.replace(/'/g, "'\\''")}'
410
+
411
+ find_real_codex() {
412
+ local IFS=:
413
+ for d in $PATH; do
414
+ [ -z "$d" ] && continue
415
+ [ "$d" = "$SHIM_DIR" ] && continue
416
+ if [ -x "$d/codex" ] && [ "$d/codex" != "$0" ]; then
417
+ printf '%s\\n' "$d/codex"
418
+ return 0
419
+ fi
420
+ done
421
+ return 1
422
+ }
423
+
424
+ inside_parasor() {
425
+ [ -n "\${PARASOR_PORT:-}" ] || return 1
426
+ [ -n "\${PARASOR_SESSION_ID:-}" ] || return 1
427
+ return 0
428
+ }
429
+
430
+ emit_debug() {
431
+ [ -n "\${PARASOR_PORT:-}" ] || return 0
432
+ [ -n "\${PARASOR_SESSION_ID:-}" ] || return 0
433
+ local label
434
+ local detail
435
+ label="\${1:-codex-wrapper-exec}"
436
+ detail="\${2:-}"
437
+ local body
438
+ body="{\\"sessionId\\":\\"$PARASOR_SESSION_ID\\",\\"label\\":\\"$label\\",\\"detail\\":\\"$detail\\"}"
439
+ curl -s -X POST "http://127.0.0.1:$PARASOR_PORT/hook/debug" \\
440
+ -H "Content-Type: application/json" \\
441
+ -d "$body" \\
442
+ --connect-timeout 1 \\
443
+ --max-time 2 \\
444
+ -o /dev/null \\
445
+ >/dev/null 2>&1 || true
446
+ }
447
+
448
+ start_session_log_watcher() {
449
+ export CODEX_TUI_RECORD_SESSION=1
450
+
451
+ if [ -z "\${CODEX_TUI_SESSION_LOG_PATH:-}" ]; then
452
+ local stamp
453
+ stamp="$(date +%s 2>/dev/null || printf '%s' "$$")"
454
+ export CODEX_TUI_SESSION_LOG_PATH="\${TMPDIR:-/tmp}/parasor-codex-session-$PARASOR_SESSION_ID-$stamp.jsonl"
455
+ emit_debug codex-wrapper-session-log-path created
456
+ else
457
+ emit_debug codex-wrapper-session-log-path provided
458
+ fi
459
+ emit_debug codex-wrapper-watcher-start
460
+
461
+ (
462
+ local log_path="$CODEX_TUI_SESSION_LOG_PATH"
463
+ local last_turn_id=""
464
+ local last_completion_id=""
465
+ local last_approval_id=""
466
+ local last_exec_call_id=""
467
+ local fallback_seq=0
468
+ local saw_line=0
469
+ local i=0
470
+
471
+ while [ ! -f "$log_path" ] && [ "$i" -lt 200 ]; do
472
+ i=$((i + 1))
473
+ sleep 0.05
474
+ done
475
+ if [ ! -f "$log_path" ]; then
476
+ emit_debug codex-wrapper-watcher-timeout
477
+ exit 0
478
+ fi
479
+ emit_debug codex-wrapper-watcher-ready "$i"
480
+
481
+ tail -n 0 -F "$log_path" 2>/dev/null | while IFS= read -r line; do
482
+ if [ "$saw_line" -eq 0 ]; then
483
+ saw_line=1
484
+ emit_debug codex-wrapper-session-log-line first
485
+ fi
486
+ case "$line" in
487
+ *'"dir":"from_tui"'*'"kind":"op"'*'"UserTurn"'*)
488
+ emit_debug codex-wrapper-session-log-event task_started_from_tui
489
+ "$CODEX_EVENT_SCRIPT" task_started >/dev/null 2>&1 || true
490
+ ;;
491
+ *'"dir":"to_tui"'*'"kind":"codex_event"'*'"msg":{"type":"task_started"'*)
492
+ turn_id=$(printf '%s\\n' "$line" | awk -F'"turn_id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
493
+ [ -n "$turn_id" ] || turn_id=$(printf '%s\\n' "$line" | awk -F'"id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
494
+ [ -n "$turn_id" ] || turn_id="task_started"
495
+ if [ "$turn_id" != "$last_turn_id" ]; then
496
+ last_turn_id="$turn_id"
497
+ emit_debug codex-wrapper-session-log-event task_started
498
+ "$CODEX_EVENT_SCRIPT" task_started >/dev/null 2>&1 || true
499
+ fi
500
+ ;;
501
+ *'"dir":"to_tui"'*'"kind":"codex_event"'*'"msg":{"type":"task_complete"'*)
502
+ completion_id=$(printf '%s\\n' "$line" | awk -F'"turn_id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
503
+ [ -n "$completion_id" ] || completion_id=$(printf '%s\\n' "$line" | awk -F'"id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
504
+ [ -n "$completion_id" ] || completion_id="task_complete"
505
+ if [ "$completion_id" != "$last_completion_id" ]; then
506
+ last_completion_id="$completion_id"
507
+ emit_debug codex-wrapper-session-log-event task_complete
508
+ "$CODEX_EVENT_SCRIPT" task_complete >/dev/null 2>&1 || true
509
+ fi
510
+ ;;
511
+ *'"dir":"to_tui"'*'"kind":"codex_event"'*'"msg":{"type":"'*'_approval_request"'*)
512
+ approval_event=$(printf '%s\\n' "$line" | awk -F'"type":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
513
+ [ -n "$approval_event" ] || approval_event="request_user_input"
514
+ approval_id=$(printf '%s\\n' "$line" | awk -F'"id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
515
+ [ -n "$approval_id" ] || approval_id=$(printf '%s\\n' "$line" | awk -F'"approval_id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
516
+ [ -n "$approval_id" ] || approval_id=$(printf '%s\\n' "$line" | awk -F'"call_id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
517
+ if [ -z "$approval_id" ]; then
518
+ fallback_seq=$((fallback_seq + 1))
519
+ approval_id="approval_request_$fallback_seq"
520
+ fi
521
+ if [ "$approval_id" != "$last_approval_id" ]; then
522
+ last_approval_id="$approval_id"
523
+ emit_debug codex-wrapper-session-log-event "$approval_event"
524
+ "$CODEX_EVENT_SCRIPT" "$approval_event" >/dev/null 2>&1 || true
525
+ fi
526
+ ;;
527
+ *'"dir":"to_tui"'*'"kind":"codex_event"'*'"msg":{"type":"request_user_input"'*)
528
+ approval_id=$(printf '%s\\n' "$line" | awk -F'"call_id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
529
+ [ -n "$approval_id" ] || approval_id=$(printf '%s\\n' "$line" | awk -F'"id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
530
+ [ -n "$approval_id" ] || approval_id="request_user_input"
531
+ if [ "$approval_id" != "$last_approval_id" ]; then
532
+ last_approval_id="$approval_id"
533
+ emit_debug codex-wrapper-session-log-event request_user_input
534
+ "$CODEX_EVENT_SCRIPT" request_user_input >/dev/null 2>&1 || true
535
+ fi
536
+ ;;
537
+ *'"dir":"to_tui"'*'"kind":"codex_event"'*'"msg":{"type":"exec_command_begin"'*)
538
+ exec_call_id=$(printf '%s\\n' "$line" | awk -F'"call_id":"' 'NF > 1 { sub(/".*/, "", $2); print $2; exit }')
539
+ if [ -n "$exec_call_id" ]; then
540
+ if [ "$exec_call_id" != "$last_exec_call_id" ]; then
541
+ last_exec_call_id="$exec_call_id"
542
+ emit_debug codex-wrapper-session-log-event exec_command_begin
543
+ "$CODEX_EVENT_SCRIPT" exec_command_begin >/dev/null 2>&1 || true
544
+ fi
545
+ else
546
+ emit_debug codex-wrapper-session-log-event exec_command_begin
547
+ "$CODEX_EVENT_SCRIPT" exec_command_begin >/dev/null 2>&1 || true
548
+ fi
549
+ ;;
550
+ esac
551
+ done
552
+ ) &
553
+
554
+ PARASOR_CODEX_WATCHER_PID=$!
555
+ }
556
+
557
+ stop_session_log_watcher() {
558
+ if [ -n "\${PARASOR_CODEX_WATCHER_PID:-}" ]; then
559
+ kill "$PARASOR_CODEX_WATCHER_PID" >/dev/null 2>&1 || true
560
+ wait "$PARASOR_CODEX_WATCHER_PID" 2>/dev/null || true
561
+ fi
562
+ }
563
+
564
+ if inside_parasor; then
565
+ emit_debug codex-wrapper-entry "\${1:-}"
566
+ emit_debug codex-wrapper-realpath-start
567
+ fi
568
+
569
+ REAL_CODEX="$(find_real_codex)" || {
570
+ echo 'parasor codex shim: real codex binary not found in PATH' >&2
571
+ emit_debug codex-wrapper-realpath missing
572
+ exit 127
573
+ }
574
+ emit_debug codex-wrapper-realpath found
575
+
576
+ case "\${1:-}" in
577
+ exec|review|login|logout|mcp|marketplace|mcp-server|app-server|app|completion|sandbox|debug|apply|cloud|exec-server|features|help|--help|-h|--version|-V)
578
+ exec "$REAL_CODEX" "$@"
579
+ ;;
580
+ esac
581
+
582
+ if ! inside_parasor; then
583
+ exec "$REAL_CODEX" "$@"
584
+ fi
585
+
586
+ emit_debug codex-wrapper-exec "\${1:-}"
587
+ start_session_log_watcher
588
+
589
+ emit_debug codex-wrapper-exec-start "\${1:-}"
590
+ "$REAL_CODEX" -c "notify=$NOTIFY_ARG" "$@"
591
+ PARASOR_CODEX_STATUS=$?
592
+ emit_debug codex-wrapper-exit "$PARASOR_CODEX_STATUS"
593
+
594
+ stop_session_log_watcher
595
+ exit "$PARASOR_CODEX_STATUS"
596
+ `;
597
+ }
598
+ export function buildParasorZshEnv(binDir) {
599
+ return `# parasor zsh env overlay
600
+ if [ -f "$HOME/.zshenv" ]; then
601
+ source "$HOME/.zshenv"
602
+ fi
603
+ export PATH='${binDir}':"$PATH"
604
+ `;
605
+ }
606
+ export function buildParasorZshRc(binDir) {
607
+ return `# parasor zsh rc overlay
608
+ if [ -f "$HOME/.zshrc" ]; then
609
+ source "$HOME/.zshrc"
610
+ fi
611
+ export PATH='${binDir}':"$PATH"
612
+ unalias claude 2>/dev/null || true
613
+ unalias codex 2>/dev/null || true
614
+ claude() {
615
+ command '${join(binDir, "claude")}' "$@"
616
+ }
617
+ codex() {
618
+ command '${join(binDir, "codex")}' "$@"
619
+ }
620
+ rehash 2>/dev/null || true
621
+ `;
622
+ }
623
+ export function buildParasorBashRc(binDir) {
624
+ return `# parasor bash rc overlay
625
+ if [ -f "$HOME/.bashrc" ]; then
626
+ source "$HOME/.bashrc"
627
+ fi
628
+ export PATH='${binDir}':"$PATH"
629
+ unalias claude 2>/dev/null || true
630
+ unalias codex 2>/dev/null || true
631
+ claude() {
632
+ command '${join(binDir, "claude")}' "$@"
633
+ }
634
+ codex() {
635
+ command '${join(binDir, "codex")}' "$@"
636
+ }
637
+ hash -r 2>/dev/null || true
638
+ `;
639
+ }
640
+ function resolveRealBinary(name, shimBinDir) {
641
+ try {
642
+ const allPaths = execFileSync("which", ["-a", name], {
643
+ encoding: "utf-8",
644
+ timeout: 3000,
645
+ env: {
646
+ ...process.env,
647
+ PATH: (process.env.PATH ?? "")
648
+ .split(":")
649
+ .filter((p) => p !== shimBinDir)
650
+ .join(":"),
651
+ },
652
+ })
653
+ .trim()
654
+ .split("\n")
655
+ .filter((p) => p && !p.startsWith(shimBinDir));
656
+ return allPaths[0] ?? null;
657
+ }
658
+ catch {
659
+ return null;
660
+ }
661
+ }
662
+ //# sourceMappingURL=shim-installer.js.map
@@ -0,0 +1 @@
1
+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AC;aACC,IAAI,EAAE;aACN,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;QAEjD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function shimOpen(argv: string[]): Promise<void>;
2
+ //# sourceMappingURL=shim-open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shim-open.d.ts","sourceRoot":"","sources":["../../src/cli/shim-open.ts"],"names":[],"mappings":"AA6GA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmD5D"}