@agimon-ai/po-runner 0.0.0-alpha.21 → 0.0.0-alpha.210

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 (332) hide show
  1. package/LICENSE +21 -149
  2. package/README.md +34 -206
  3. package/dist/apiContracts.cjs +45 -2
  4. package/dist/apiContracts.cjs.map +1 -1
  5. package/dist/apiContracts.d.mts +2 -2
  6. package/dist/apiContracts.d.mts.map +1 -1
  7. package/dist/apiContracts.mjs +45 -2
  8. package/dist/apiContracts.mjs.map +1 -1
  9. package/dist/{bashResult-BqDa7sbC.mjs → bashResult-BLCLerXE.mjs} +57 -7
  10. package/dist/bashResult-BLCLerXE.mjs.map +1 -0
  11. package/dist/{bashResult-C2iKhHpD.cjs → bashResult-CZYiyl4p.cjs} +74 -6
  12. package/dist/bashResult-CZYiyl4p.cjs.map +1 -0
  13. package/dist/{bashResult-DcrRaBLv.d.mts → bashResult-CgVS_JpL.d.mts} +8 -3
  14. package/dist/{bashResult-DcrRaBLv.d.mts.map → bashResult-CgVS_JpL.d.mts.map} +1 -1
  15. package/dist/{bashRunService-DjOH5kye.cjs → bashRunService-DmuA1mKL.cjs} +52 -31
  16. package/dist/bashRunService-DmuA1mKL.cjs.map +1 -0
  17. package/dist/{bashRunService-Ci0cGdYO.d.mts → bashRunService-Iotfc_nV.d.mts} +21 -2
  18. package/dist/bashRunService-Iotfc_nV.d.mts.map +1 -0
  19. package/dist/{bashRunService-Cl3pYccr.mjs → bashRunService-Luy2hPMS.mjs} +52 -31
  20. package/dist/bashRunService-Luy2hPMS.mjs.map +1 -0
  21. package/dist/bashRunService.cjs +1 -1
  22. package/dist/bashRunService.d.mts +4 -4
  23. package/dist/bashRunService.d.mts.map +1 -1
  24. package/dist/bashRunService.mjs +1 -1
  25. package/dist/bashSchema.cjs +1 -1
  26. package/dist/bashSchema.d.mts +1 -1
  27. package/dist/bashSchema.mjs +1 -1
  28. package/dist/bashTool-D2ECDAhc.cjs +43 -0
  29. package/dist/bashTool-D2ECDAhc.cjs.map +1 -0
  30. package/dist/{bashTool-B1EwZLo_.d.mts → bashTool-Dc1ld2E3.d.mts} +3 -9
  31. package/dist/bashTool-Dc1ld2E3.d.mts.map +1 -0
  32. package/dist/bashTool-vg8uhbkj.mjs +26 -0
  33. package/dist/bashTool-vg8uhbkj.mjs.map +1 -0
  34. package/dist/bashTool.cjs +3 -3
  35. package/dist/bashTool.cjs.map +1 -1
  36. package/dist/bashTool.d.mts +4 -4
  37. package/dist/bashTool.d.mts.map +1 -1
  38. package/dist/bashTool.mjs +3 -3
  39. package/dist/bashTool.mjs.map +1 -1
  40. package/dist/bin/cli.cjs +372 -9
  41. package/dist/bin/cli.cjs.map +1 -1
  42. package/dist/bin/cli.d.mts.map +1 -1
  43. package/dist/bin/cli.mjs +369 -8
  44. package/dist/bin/cli.mjs.map +1 -1
  45. package/dist/bin/logSink.cjs +27 -24
  46. package/dist/bin/logSink.cjs.map +1 -1
  47. package/dist/bin/logSink.mjs +24 -21
  48. package/dist/bin/logSink.mjs.map +1 -1
  49. package/dist/bin/runnerHost.cjs +141 -53
  50. package/dist/bin/runnerHost.cjs.map +1 -1
  51. package/dist/bin/runnerHost.d.mts.map +1 -1
  52. package/dist/bin/runnerHost.mjs +141 -53
  53. package/dist/bin/runnerHost.mjs.map +1 -1
  54. package/dist/cliApp-7iTUx5KZ.cjs +351 -0
  55. package/dist/cliApp-7iTUx5KZ.cjs.map +1 -0
  56. package/dist/cliApp-S4iEO-fi.mjs +338 -0
  57. package/dist/cliApp-S4iEO-fi.mjs.map +1 -0
  58. package/dist/cliApp.cjs +2 -1
  59. package/dist/cliApp.d.mts +9 -4
  60. package/dist/cliApp.d.mts.map +1 -1
  61. package/dist/cliApp.mjs +1 -1
  62. package/dist/compaction.d.mts +1 -1
  63. package/dist/extensions/mcp-ui.mjs +7 -6
  64. package/dist/extensions/mcp-ui.mjs.map +1 -1
  65. package/dist/extensions/mcp.cjs +37 -17
  66. package/dist/extensions/mcp.cjs.map +1 -1
  67. package/dist/extensions/mcp.d.mts.map +1 -1
  68. package/dist/extensions/mcp.mjs +37 -17
  69. package/dist/extensions/mcp.mjs.map +1 -1
  70. package/dist/extensions/native.mjs +1225 -374
  71. package/dist/extensions/native.mjs.map +1 -1
  72. package/dist/extensions/server.cjs +900 -221
  73. package/dist/extensions/server.cjs.map +1 -1
  74. package/dist/extensions/server.d.mts.map +1 -1
  75. package/dist/extensions/server.mjs +908 -227
  76. package/dist/extensions/server.mjs.map +1 -1
  77. package/dist/extensions/web.mjs +924 -766
  78. package/dist/extensions/web.mjs.map +1 -1
  79. package/dist/headless-CMj9hunm.cjs +237 -0
  80. package/dist/headless-CMj9hunm.cjs.map +1 -0
  81. package/dist/headless-CUJt5Ihx.mjs +226 -0
  82. package/dist/headless-CUJt5Ihx.mjs.map +1 -0
  83. package/dist/{index-DM7yJpMs.d.mts → index-7_nuKoVm.d.mts} +6 -6
  84. package/dist/index-7_nuKoVm.d.mts.map +1 -0
  85. package/dist/index-BCCF1sGD.d.mts.map +1 -1
  86. package/dist/{index-CzCF_OP9.d.mts → index-CH-z0BX3.d.mts} +11 -4
  87. package/dist/index-CH-z0BX3.d.mts.map +1 -0
  88. package/dist/{index-C-IC35d9.d.mts → index-CJNsR-Ir.d.mts} +10 -7
  89. package/dist/index-CJNsR-Ir.d.mts.map +1 -0
  90. package/dist/{index--xF7DvsE.d.mts → index-CNCb1usM.d.mts} +8 -2
  91. package/dist/index-CNCb1usM.d.mts.map +1 -0
  92. package/dist/index-EMbmq9gu.d.mts +45 -0
  93. package/dist/index-EMbmq9gu.d.mts.map +1 -0
  94. package/dist/index-QlfncPRs.d.mts +58 -0
  95. package/dist/index-QlfncPRs.d.mts.map +1 -0
  96. package/dist/index-qSi4-EJW.d.mts +49 -0
  97. package/dist/index-qSi4-EJW.d.mts.map +1 -0
  98. package/dist/index.cjs +4 -4
  99. package/dist/index.d.mts +4 -4
  100. package/dist/index.mjs +4 -4
  101. package/dist/launch.cjs +4 -0
  102. package/dist/launch.d.mts +55 -0
  103. package/dist/launch.d.mts.map +1 -0
  104. package/dist/launch.mjs +1 -0
  105. package/dist/{launcher-CCYsFBM9.mjs → launcher-3xMxw72I.mjs} +45 -31
  106. package/dist/launcher-3xMxw72I.mjs.map +1 -0
  107. package/dist/{launcher-BG5t9nvG.d.mts → launcher-CDDBTvZq.d.mts} +4 -3
  108. package/dist/launcher-CDDBTvZq.d.mts.map +1 -0
  109. package/dist/{launcher-ZgDdyXpq.cjs → launcher-D7qAhSRL.cjs} +47 -33
  110. package/dist/launcher-D7qAhSRL.cjs.map +1 -0
  111. package/dist/launcher.cjs +1 -1
  112. package/dist/launcher.d.mts +5 -5
  113. package/dist/launcher.d.mts.map +1 -1
  114. package/dist/launcher.mjs +1 -1
  115. package/dist/lifeline-26IaW5w7.d.mts +34 -0
  116. package/dist/lifeline-26IaW5w7.d.mts.map +1 -0
  117. package/dist/lifeline-B4cjtrBe.cjs +27 -0
  118. package/dist/lifeline-B4cjtrBe.cjs.map +1 -0
  119. package/dist/lifeline-C1v2ItCY.mjs +214 -0
  120. package/dist/lifeline-C1v2ItCY.mjs.map +1 -0
  121. package/dist/lifeline-D4_ZRAhO.cjs +229 -0
  122. package/dist/lifeline-D4_ZRAhO.cjs.map +1 -0
  123. package/dist/lifeline-nPh3cx5A.mjs +10 -0
  124. package/dist/lifeline-nPh3cx5A.mjs.map +1 -0
  125. package/dist/lifeline.cjs +4 -1
  126. package/dist/lifeline.d.mts +4 -21
  127. package/dist/lifeline.mjs +3 -3
  128. package/dist/logFile-B9FSwmE0.cjs +44 -0
  129. package/dist/logFile-B9FSwmE0.cjs.map +1 -0
  130. package/dist/{logFile-C7oQ_v-g.d.mts → logFile-BirfZtS1.d.mts} +4 -4
  131. package/dist/logFile-BirfZtS1.d.mts.map +1 -0
  132. package/dist/logFile-D1EOKqmL.mjs +39 -0
  133. package/dist/logFile-D1EOKqmL.mjs.map +1 -0
  134. package/dist/logFile.cjs +1 -1
  135. package/dist/logFile.d.mts +3 -3
  136. package/dist/logFile.d.mts.map +1 -1
  137. package/dist/logFile.mjs +1 -1
  138. package/dist/{logReader-mq9uVurh.mjs → logReader-BYKii_s_.mjs} +99 -52
  139. package/dist/logReader-BYKii_s_.mjs.map +1 -0
  140. package/dist/{logReader-MdW9ffvV.d.mts → logReader-Bn3WEdjg.d.mts} +4 -2
  141. package/dist/{logReader-MdW9ffvV.d.mts.map → logReader-Bn3WEdjg.d.mts.map} +1 -1
  142. package/dist/{logReader-DHCK2BEr.cjs → logReader-DpMjBqfn.cjs} +101 -54
  143. package/dist/logReader-DpMjBqfn.cjs.map +1 -0
  144. package/dist/logReader.cjs +1 -1
  145. package/dist/logReader.d.mts +2 -2
  146. package/dist/logReader.mjs +1 -1
  147. package/dist/po-runtime-identity.json +1 -0
  148. package/dist/{ptyHost-D35hNmtd.cjs → ptyHost-C-oWV455.cjs} +20 -14
  149. package/dist/ptyHost-C-oWV455.cjs.map +1 -0
  150. package/dist/{ptyHost-CwbLLr90.mjs → ptyHost-C2zu-ZfO.mjs} +19 -13
  151. package/dist/ptyHost-C2zu-ZfO.mjs.map +1 -0
  152. package/dist/{ptyHost-DWWtRrGn.d.mts → ptyHost-C_6x2xuJ.d.mts} +2 -2
  153. package/dist/{ptyHost-DWWtRrGn.d.mts.map → ptyHost-C_6x2xuJ.d.mts.map} +1 -1
  154. package/dist/ptyHost.cjs +1 -1
  155. package/dist/ptyHost.d.mts +2 -2
  156. package/dist/ptyHost.d.mts.map +1 -1
  157. package/dist/ptyHost.mjs +1 -1
  158. package/dist/{reconcile-wNYQJZF-.mjs → reconcile-DUaX_vKZ.mjs} +2 -2
  159. package/dist/reconcile-DUaX_vKZ.mjs.map +1 -0
  160. package/dist/{reconcile-5cZ11jSD.cjs → reconcile-DjF9T1hN.cjs} +2 -2
  161. package/dist/reconcile-DjF9T1hN.cjs.map +1 -0
  162. package/dist/reconcile.cjs +1 -1
  163. package/dist/reconcile.d.mts +3 -3
  164. package/dist/reconcile.mjs +1 -1
  165. package/dist/responseEnvelope.cjs +5 -2
  166. package/dist/responseEnvelope.d.mts +15 -6
  167. package/dist/responseEnvelope.d.mts.map +1 -1
  168. package/dist/responseEnvelope.mjs +3 -3
  169. package/dist/{rmuxBackend-Dh0CYVAL.cjs → rmuxBackend-9tHTx1vf.cjs} +82 -48
  170. package/dist/rmuxBackend-9tHTx1vf.cjs.map +1 -0
  171. package/dist/{rmuxBackend-rjrVTG6K.mjs → rmuxBackend-BaK-R35I.mjs} +79 -45
  172. package/dist/rmuxBackend-BaK-R35I.mjs.map +1 -0
  173. package/dist/{rmuxBackend-CaEWooWn.d.mts → rmuxBackend-xFzlANM9.d.mts} +4 -4
  174. package/dist/rmuxBackend-xFzlANM9.d.mts.map +1 -0
  175. package/dist/rmuxBackend.cjs +1 -1
  176. package/dist/rmuxBackend.d.mts +2 -2
  177. package/dist/rmuxBackend.mjs +1 -1
  178. package/dist/rolldown-runtime-8H4AJuhK.mjs +14 -0
  179. package/dist/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -0
  180. package/dist/{rtkProcessor-Iw9gP5Xp.mjs → rtkProcessor-DOXcp51z.mjs} +6 -5
  181. package/dist/rtkProcessor-DOXcp51z.mjs.map +1 -0
  182. package/dist/{rtkProcessor-DSGbM-Cm.cjs → rtkProcessor-J2gLQvM4.cjs} +8 -6
  183. package/dist/rtkProcessor-J2gLQvM4.cjs.map +1 -0
  184. package/dist/rtkProcessor.cjs +1 -1
  185. package/dist/rtkProcessor.mjs +1 -1
  186. package/dist/{runnerDependencies-DSun3xO-.cjs → runnerDependencies-CABYjW7H.cjs} +97 -64
  187. package/dist/runnerDependencies-CABYjW7H.cjs.map +1 -0
  188. package/dist/{runnerDependencies-7h_cxOva.mjs → runnerDependencies-DmvIcpZi.mjs} +95 -62
  189. package/dist/runnerDependencies-DmvIcpZi.mjs.map +1 -0
  190. package/dist/runnerDependencies.cjs +1 -1
  191. package/dist/runnerDependencies.d.mts +1 -1
  192. package/dist/runnerDependencies.mjs +1 -1
  193. package/dist/runnerHost-BvNYPMeh.mjs +165 -0
  194. package/dist/runnerHost-BvNYPMeh.mjs.map +1 -0
  195. package/dist/runnerHost-C2F5oxzn.cjs +184 -0
  196. package/dist/runnerHost-C2F5oxzn.cjs.map +1 -0
  197. package/dist/runnerLaunch-BAf7hXMr.cjs +192 -0
  198. package/dist/runnerLaunch-BAf7hXMr.cjs.map +1 -0
  199. package/dist/runnerLaunch-Bimgdh4h.mjs +175 -0
  200. package/dist/runnerLaunch-Bimgdh4h.mjs.map +1 -0
  201. package/dist/runnerNamer.d.mts +1 -1
  202. package/dist/{runnerPaths-B41rMOY6.cjs → runnerPaths-CSkswyjR.cjs} +97 -179
  203. package/dist/runnerPaths-CSkswyjR.cjs.map +1 -0
  204. package/dist/{runnerPaths-Dibbvyx_.mjs → runnerPaths-D3P7_EhW.mjs} +91 -179
  205. package/dist/runnerPaths-D3P7_EhW.mjs.map +1 -0
  206. package/dist/runnerPaths.cjs +1 -1
  207. package/dist/runnerPaths.d.mts +7 -9
  208. package/dist/runnerPaths.d.mts.map +1 -1
  209. package/dist/runnerPaths.mjs +1 -1
  210. package/dist/{runnerRegistry-dQYlMSpQ.cjs → runnerRegistry-B8K1L3lq.cjs} +68 -45
  211. package/dist/runnerRegistry-B8K1L3lq.cjs.map +1 -0
  212. package/dist/{runnerRegistry-V-Ocaf4N.d.mts → runnerRegistry-BlZhS9yL.d.mts} +2 -2
  213. package/dist/{runnerRegistry-V-Ocaf4N.d.mts.map → runnerRegistry-BlZhS9yL.d.mts.map} +1 -1
  214. package/dist/{runnerRegistry-BgaR5O86.mjs → runnerRegistry-Dqca6SD3.mjs} +53 -29
  215. package/dist/runnerRegistry-Dqca6SD3.mjs.map +1 -0
  216. package/dist/runnerRegistry-NW6oAJ71.cjs +60 -0
  217. package/dist/runnerRegistry-NW6oAJ71.cjs.map +1 -0
  218. package/dist/runnerRegistry-l0C_55oO.mjs +13 -0
  219. package/dist/runnerRegistry-l0C_55oO.mjs.map +1 -0
  220. package/dist/runnerRegistry.cjs +1 -1
  221. package/dist/runnerRegistry.d.mts +2 -2
  222. package/dist/runnerRegistry.mjs +1 -1
  223. package/dist/runnerSequence-ZTYgZ_2W.cjs +32 -0
  224. package/dist/runnerSequence-ZTYgZ_2W.cjs.map +1 -0
  225. package/dist/runnerSequence-k-_Fd77y.mjs +9 -0
  226. package/dist/runnerSequence-k-_Fd77y.mjs.map +1 -0
  227. package/dist/runnerSequenceStore-CaY7S_Sd.mjs +76 -0
  228. package/dist/runnerSequenceStore-CaY7S_Sd.mjs.map +1 -0
  229. package/dist/runnerSequenceStore-Ck6M-8r_.cjs +89 -0
  230. package/dist/runnerSequenceStore-Ck6M-8r_.cjs.map +1 -0
  231. package/dist/services/lifeline/client.cjs +88 -4
  232. package/dist/services/lifeline/client.cjs.map +1 -1
  233. package/dist/services/lifeline/client.d.mts +16 -0
  234. package/dist/services/lifeline/client.d.mts.map +1 -1
  235. package/dist/services/lifeline/client.mjs +83 -2
  236. package/dist/services/lifeline/client.mjs.map +1 -1
  237. package/dist/services/runnerSupervisor/index.cjs +36 -22
  238. package/dist/services/runnerSupervisor/index.cjs.map +1 -1
  239. package/dist/services/runnerSupervisor/index.d.mts +7 -5
  240. package/dist/services/runnerSupervisor/index.d.mts.map +1 -1
  241. package/dist/services/runnerSupervisor/index.mjs +35 -21
  242. package/dist/services/runnerSupervisor/index.mjs.map +1 -1
  243. package/dist/session-CdVeSD7F.mjs +8 -0
  244. package/dist/session-CdVeSD7F.mjs.map +1 -0
  245. package/dist/session-DnUj8Q71.cjs +25 -0
  246. package/dist/session-DnUj8Q71.cjs.map +1 -0
  247. package/dist/session-ISEGK4z9.mjs +26 -0
  248. package/dist/session-ISEGK4z9.mjs.map +1 -0
  249. package/dist/session-PQd3azWf.cjs +43 -0
  250. package/dist/session-PQd3azWf.cjs.map +1 -0
  251. package/dist/session.cjs +4 -3
  252. package/dist/session.d.mts +3 -1
  253. package/dist/session.d.mts.map +1 -1
  254. package/dist/session.mjs +3 -3
  255. package/dist/{type-DwMZoINK.d.mts → type-BWY9vvSq.d.mts} +6 -4
  256. package/dist/type-BWY9vvSq.d.mts.map +1 -0
  257. package/dist/{type-Do0YxwVQ.d.mts → type-bZgYQ7hv.d.mts} +11 -11
  258. package/dist/{type-Do0YxwVQ.d.mts.map → type-bZgYQ7hv.d.mts.map} +1 -1
  259. package/dist/types.d.mts +1 -1
  260. package/llms.txt +2 -1
  261. package/locales/vi.json +169 -0
  262. package/locales/zh-CN.json +169 -0
  263. package/package.json +95 -30
  264. package/skills/po-runner/SKILL.md +32 -14
  265. package/src/prompts/codemode-how-to-runner/SKILL.md +85 -0
  266. package/src/prompts/help-how-to-runner/SKILL.md +51 -0
  267. package/dist/bashResult-BqDa7sbC.mjs.map +0 -1
  268. package/dist/bashResult-C2iKhHpD.cjs.map +0 -1
  269. package/dist/bashRunService-Ci0cGdYO.d.mts.map +0 -1
  270. package/dist/bashRunService-Cl3pYccr.mjs.map +0 -1
  271. package/dist/bashRunService-DjOH5kye.cjs.map +0 -1
  272. package/dist/bashTool-B1EwZLo_.d.mts.map +0 -1
  273. package/dist/bashTool-BvC3YOgG.mjs +0 -24
  274. package/dist/bashTool-BvC3YOgG.mjs.map +0 -1
  275. package/dist/bashTool-euL6zMDl.cjs +0 -41
  276. package/dist/bashTool-euL6zMDl.cjs.map +0 -1
  277. package/dist/cliApp-T8Fx_-1j.cjs +0 -244
  278. package/dist/cliApp-T8Fx_-1j.cjs.map +0 -1
  279. package/dist/cliApp-q97eVh4E.mjs +0 -237
  280. package/dist/cliApp-q97eVh4E.mjs.map +0 -1
  281. package/dist/headless-DOlCixyf.mjs +0 -169
  282. package/dist/headless-DOlCixyf.mjs.map +0 -1
  283. package/dist/headless-Dko_yBiy.cjs +0 -180
  284. package/dist/headless-Dko_yBiy.cjs.map +0 -1
  285. package/dist/index--xF7DvsE.d.mts.map +0 -1
  286. package/dist/index-BzeXJk6V.d.mts +0 -12
  287. package/dist/index-BzeXJk6V.d.mts.map +0 -1
  288. package/dist/index-C-IC35d9.d.mts.map +0 -1
  289. package/dist/index-CzCF_OP9.d.mts.map +0 -1
  290. package/dist/index-DM7yJpMs.d.mts.map +0 -1
  291. package/dist/launcher-BG5t9nvG.d.mts.map +0 -1
  292. package/dist/launcher-CCYsFBM9.mjs.map +0 -1
  293. package/dist/launcher-ZgDdyXpq.cjs.map +0 -1
  294. package/dist/lifeline-Bm-bHIjS.mjs +0 -88
  295. package/dist/lifeline-Bm-bHIjS.mjs.map +0 -1
  296. package/dist/lifeline-eJdZV0nN.d.mts +0 -19
  297. package/dist/lifeline-eJdZV0nN.d.mts.map +0 -1
  298. package/dist/lifeline-m7laIzIP.cjs +0 -98
  299. package/dist/lifeline-m7laIzIP.cjs.map +0 -1
  300. package/dist/lifeline.d.mts.map +0 -1
  301. package/dist/logFile-C7oQ_v-g.d.mts.map +0 -1
  302. package/dist/logFile-CnPKtxPy.cjs +0 -67
  303. package/dist/logFile-CnPKtxPy.cjs.map +0 -1
  304. package/dist/logFile-XcDHBwu1.mjs +0 -60
  305. package/dist/logFile-XcDHBwu1.mjs.map +0 -1
  306. package/dist/logReader-DHCK2BEr.cjs.map +0 -1
  307. package/dist/logReader-mq9uVurh.mjs.map +0 -1
  308. package/dist/ptyHost-CwbLLr90.mjs.map +0 -1
  309. package/dist/ptyHost-D35hNmtd.cjs.map +0 -1
  310. package/dist/reconcile-5cZ11jSD.cjs.map +0 -1
  311. package/dist/reconcile-wNYQJZF-.mjs.map +0 -1
  312. package/dist/rmuxBackend-CaEWooWn.d.mts.map +0 -1
  313. package/dist/rmuxBackend-Dh0CYVAL.cjs.map +0 -1
  314. package/dist/rmuxBackend-rjrVTG6K.mjs.map +0 -1
  315. package/dist/rtkProcessor-DSGbM-Cm.cjs.map +0 -1
  316. package/dist/rtkProcessor-Iw9gP5Xp.mjs.map +0 -1
  317. package/dist/runnerDependencies-7h_cxOva.mjs.map +0 -1
  318. package/dist/runnerDependencies-DSun3xO-.cjs.map +0 -1
  319. package/dist/runnerPaths-B41rMOY6.cjs.map +0 -1
  320. package/dist/runnerPaths-Dibbvyx_.mjs.map +0 -1
  321. package/dist/runnerRegistry-BgaR5O86.mjs.map +0 -1
  322. package/dist/runnerRegistry-dQYlMSpQ.cjs.map +0 -1
  323. package/dist/session-BKYnH4R6.mjs +0 -18
  324. package/dist/session-BKYnH4R6.mjs.map +0 -1
  325. package/dist/session-BvqzhXZY.cjs +0 -29
  326. package/dist/session-BvqzhXZY.cjs.map +0 -1
  327. package/dist/session-DE2Acesp.mjs +0 -6
  328. package/dist/session-DE2Acesp.mjs.map +0 -1
  329. package/dist/session-SfIPtdZO.cjs +0 -11
  330. package/dist/session-SfIPtdZO.cjs.map +0 -1
  331. package/dist/type-DwMZoINK.d.mts.map +0 -1
  332. package/src/prompts/po-use-runner/SKILL.md +0 -47
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerRegistry-l0C_55oO.mjs","names":[],"sources":["../src/constants/runnerRegistry.ts"],"sourcesContent":["export const SERVICE_TYPE = 'tool';\nexport const SERVICE_PREFIX = 'po-runner:';\nexport const RUNNER_TAG = 'po-runner';\nexport const REGISTRY_PATH_ENV = 'PROCESS_REGISTRY_PATH';\nexport const JSON_EXTENSION = '.json';\nexport const COMMAND_SIDECAR_SUFFIX = '.command.json';\nexport const EXIT_SIDECAR_SUFFIX = '.exit.json';\nexport const NOT_FOUND_ERROR_CODE = 'ENOENT';\n"],"mappings":";AAAA,MAAa,eAAe;AAC5B,MAAa,iBAAiB;AAC9B,MAAa,aAAa;AAC1B,MAAa,oBAAoB;AACjC,MAAa,iBAAiB;AAC9B,MAAa,yBAAyB;AACtC,MAAa,sBAAsB;AACnC,MAAa,uBAAuB"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_runnerRegistry = require("./runnerRegistry-dQYlMSpQ.cjs");
2
+ const require_runnerRegistry = require("./runnerRegistry-B8K1L3lq.cjs");
3
3
  exports.RunnerRegistry = require_runnerRegistry.RunnerRegistry;
4
4
  exports.createDefaultProcessRegistry = require_runnerRegistry.createDefaultProcessRegistry;
@@ -1,3 +1,3 @@
1
- import { i as RunnerRecord, n as IRunnerRegistry, r as RegisterRunnerInput } from "./runnerRegistry-V-Ocaf4N.mjs";
2
- import { n as RunnerRegistry, r as createDefaultProcessRegistry, t as ProcessRegistryPort } from "./index-CzCF_OP9.mjs";
1
+ import { a as RunnerRecord, n as IRunnerRegistry, r as RegisterRunnerInput } from "./runnerRegistry-BlZhS9yL.mjs";
2
+ import { n as RunnerRegistry, r as createDefaultProcessRegistry, t as ProcessRegistryPort } from "./index-CH-z0BX3.mjs";
3
3
  export { type IRunnerRegistry, type ProcessRegistryPort, type RegisterRunnerInput, type RunnerRecord, RunnerRegistry, createDefaultProcessRegistry };
@@ -1 +1 @@
1
- export { t as RunnerRegistry, n as createDefaultProcessRegistry } from "./runnerRegistry-BgaR5O86.mjs";
1
+ export { t as RunnerRegistry, n as createDefaultProcessRegistry } from "./runnerRegistry-Dqca6SD3.mjs";
@@ -0,0 +1,32 @@
1
+ //#region src/constants/runnerSequence.ts
2
+ const MAX_SEQUENCE_COMMAND_LENGTH = 65536;
3
+ const MAX_SEQUENCE_RECORD_BYTES = 4194304;
4
+ const SEQUENCE_DIRECTORY = "sequences";
5
+ const SEQUENCE_PREFIX = "sequence-";
6
+ //#endregion
7
+ Object.defineProperty(exports, "MAX_SEQUENCE_COMMAND_LENGTH", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return MAX_SEQUENCE_COMMAND_LENGTH;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "MAX_SEQUENCE_RECORD_BYTES", {
14
+ enumerable: true,
15
+ get: function() {
16
+ return MAX_SEQUENCE_RECORD_BYTES;
17
+ }
18
+ });
19
+ Object.defineProperty(exports, "SEQUENCE_DIRECTORY", {
20
+ enumerable: true,
21
+ get: function() {
22
+ return SEQUENCE_DIRECTORY;
23
+ }
24
+ });
25
+ Object.defineProperty(exports, "SEQUENCE_PREFIX", {
26
+ enumerable: true,
27
+ get: function() {
28
+ return SEQUENCE_PREFIX;
29
+ }
30
+ });
31
+
32
+ //# sourceMappingURL=runnerSequence-ZTYgZ_2W.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerSequence-ZTYgZ_2W.cjs","names":[],"sources":["../src/constants/runnerSequence.ts"],"sourcesContent":["export const MAX_SEQUENCE_COMMANDS = 32;\nexport const MAX_SEQUENCE_COMMAND_LENGTH = 65_536;\nexport const MAX_SEQUENCE_RECORD_BYTES = 4 * 1024 * 1024;\nexport const SEQUENCE_DIRECTORY = 'sequences';\nexport const SEQUENCE_PREFIX = 'sequence-';\n"],"mappings":";AACA,MAAa,8BAA8B;AAC3C,MAAa,4BAA4B;AACzC,MAAa,qBAAqB;AAClC,MAAa,kBAAkB"}
@@ -0,0 +1,9 @@
1
+ //#region src/constants/runnerSequence.ts
2
+ const MAX_SEQUENCE_COMMAND_LENGTH = 65536;
3
+ const MAX_SEQUENCE_RECORD_BYTES = 4194304;
4
+ const SEQUENCE_DIRECTORY = "sequences";
5
+ const SEQUENCE_PREFIX = "sequence-";
6
+ //#endregion
7
+ export { SEQUENCE_PREFIX as i, MAX_SEQUENCE_RECORD_BYTES as n, SEQUENCE_DIRECTORY as r, MAX_SEQUENCE_COMMAND_LENGTH as t };
8
+
9
+ //# sourceMappingURL=runnerSequence-k-_Fd77y.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerSequence-k-_Fd77y.mjs","names":[],"sources":["../src/constants/runnerSequence.ts"],"sourcesContent":["export const MAX_SEQUENCE_COMMANDS = 32;\nexport const MAX_SEQUENCE_COMMAND_LENGTH = 65_536;\nexport const MAX_SEQUENCE_RECORD_BYTES = 4 * 1024 * 1024;\nexport const SEQUENCE_DIRECTORY = 'sequences';\nexport const SEQUENCE_PREFIX = 'sequence-';\n"],"mappings":";AACA,MAAa,8BAA8B;AAC3C,MAAa,4BAA4B;AACzC,MAAa,qBAAqB;AAClC,MAAa,kBAAkB"}
@@ -0,0 +1,76 @@
1
+ import { n as MAX_SEQUENCE_RECORD_BYTES, r as SEQUENCE_DIRECTORY } from "./runnerSequence-k-_Fd77y.mjs";
2
+ import path from "node:path";
3
+ import { BACKGROUND_CONTEXT, getOrThrow, readBoundedFile, writeFileAtomic } from "@agimon-ai/po-core/platform";
4
+ //#region src/services/runnerSequenceStore/index.ts
5
+ function isSequenceId(id) {
6
+ return id.startsWith("sequence-") && /^sequence-[A-Za-z0-9_-]+$/.test(id);
7
+ }
8
+ /** One writer owns manifests. Separate stop requests cannot overwrite its progress. */
9
+ function createRunnerSequenceStore(fs, paths, sessionId) {
10
+ const directory = path.join(paths.stateDirectory(sessionId), SEQUENCE_DIRECTORY);
11
+ let writes = Promise.resolve();
12
+ const file = (id, cancellation = false) => {
13
+ if (!isSequenceId(id)) throw new Error("Expected a sequence ID returned by Bash.");
14
+ return path.join(directory, `${id}${cancellation ? ".cancel" : ""}.json`);
15
+ };
16
+ const read = async (filePath) => {
17
+ const info = await fs.fileInfo(filePath, BACKGROUND_CONTEXT);
18
+ if (!info.ok && info.error.code === "not_found") return void 0;
19
+ if (getOrThrow(info).kind !== "file") throw new Error("Sequence metadata is not a regular file.");
20
+ return JSON.parse(new TextDecoder().decode(await readBoundedFile(fs, filePath, MAX_SEQUENCE_RECORD_BYTES, BACKGROUND_CONTEXT)));
21
+ };
22
+ const get = async (id) => {
23
+ const value = await read(file(id));
24
+ if (value === void 0) return void 0;
25
+ if (typeof value !== "object" || value === null || !("id" in value) || value.id !== id || !("sessionId" in value) || value.sessionId !== sessionId || !("stages" in value) || !Array.isArray(value.stages) || !("state" in value) || value.state !== "running" && value.state !== "completed") throw new Error("Invalid or foreign sequence metadata.");
26
+ return value;
27
+ };
28
+ return {
29
+ get,
30
+ async list(all = false) {
31
+ const listed = await fs.listDir(directory, BACKGROUND_CONTEXT);
32
+ if (!listed.ok && listed.error.code === "not_found") return [];
33
+ const records = [];
34
+ for (const entry of getOrThrow(listed)) {
35
+ if (entry.kind !== "file" || !entry.name.endsWith(".json") || entry.name.endsWith(".cancel.json")) continue;
36
+ const id = entry.name.slice(0, -5);
37
+ if (!isSequenceId(id)) continue;
38
+ const record = await get(id);
39
+ if (record && (all || record.state === "running")) records.push(record);
40
+ }
41
+ return records;
42
+ },
43
+ save(record) {
44
+ if (record.sessionId !== sessionId) throw new Error("Sequence belongs to another session.");
45
+ const target = file(record.id);
46
+ const text = JSON.stringify(record);
47
+ const next = writes.then(() => writeFileAtomic(fs, target, text, BACKGROUND_CONTEXT));
48
+ writes = next.catch(() => void 0);
49
+ return next;
50
+ },
51
+ async requestStop(id, reason) {
52
+ const record = await get(id);
53
+ if (!record) throw new Error(`No sequence with id ${id} in this session.`);
54
+ if (record.state !== "running") throw new Error(`Sequence ${id} is already completed.`);
55
+ await writeFileAtomic(fs, file(id, true), JSON.stringify({
56
+ id,
57
+ sessionId,
58
+ reason
59
+ }), BACKGROUND_CONTEXT);
60
+ return {
61
+ id,
62
+ requested: true
63
+ };
64
+ },
65
+ async stopRequested(id) {
66
+ const request = await read(file(id, true));
67
+ if (request === void 0) return false;
68
+ if (typeof request !== "object" || request === null || !("id" in request) || request.id !== id || !("sessionId" in request) || request.sessionId !== sessionId) throw new Error("Invalid sequence stop request.");
69
+ return true;
70
+ }
71
+ };
72
+ }
73
+ //#endregion
74
+ export { isSequenceId as n, createRunnerSequenceStore as t };
75
+
76
+ //# sourceMappingURL=runnerSequenceStore-CaY7S_Sd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerSequenceStore-CaY7S_Sd.mjs","names":[],"sources":["../src/services/runnerSequenceStore/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport {\n BACKGROUND_CONTEXT,\n getOrThrow,\n readBoundedFile,\n writeFileAtomic,\n type FileSystem,\n} from '@agimon-ai/po-core/platform';\n\nimport { MAX_SEQUENCE_RECORD_BYTES, SEQUENCE_DIRECTORY, SEQUENCE_PREFIX } from '../../constants/runnerSequence';\nimport type { RunnerSequenceRecord } from '../../types/runnerSequence';\nimport type { IRunnerPaths } from '../runnerPaths/type';\n\nexport function isSequenceId(id: string): boolean {\n return id.startsWith(SEQUENCE_PREFIX) && /^sequence-[A-Za-z0-9_-]+$/.test(id);\n}\n\n/** One writer owns manifests. Separate stop requests cannot overwrite its progress. */\nexport function createRunnerSequenceStore(fs: FileSystem, paths: IRunnerPaths, sessionId: string) {\n const directory = path.join(paths.stateDirectory(sessionId), SEQUENCE_DIRECTORY);\n let writes = Promise.resolve();\n const file = (id: string, cancellation = false) => {\n if (!isSequenceId(id)) throw new Error('Expected a sequence ID returned by Bash.');\n return path.join(directory, `${id}${cancellation ? '.cancel' : ''}.json`);\n };\n const read = async (filePath: string): Promise<unknown> => {\n const info = await fs.fileInfo(filePath, BACKGROUND_CONTEXT);\n if (!info.ok && info.error.code === 'not_found') return undefined;\n if (getOrThrow(info).kind !== 'file') throw new Error('Sequence metadata is not a regular file.');\n return JSON.parse(\n new TextDecoder().decode(await readBoundedFile(fs, filePath, MAX_SEQUENCE_RECORD_BYTES, BACKGROUND_CONTEXT)),\n );\n };\n const get = async (id: string): Promise<RunnerSequenceRecord | undefined> => {\n const value = await read(file(id));\n if (value === undefined) return undefined;\n if (\n typeof value !== 'object' ||\n value === null ||\n !('id' in value) ||\n value.id !== id ||\n !('sessionId' in value) ||\n value.sessionId !== sessionId ||\n !('stages' in value) ||\n !Array.isArray(value.stages) ||\n !('state' in value) ||\n (value.state !== 'running' && value.state !== 'completed')\n )\n throw new Error('Invalid or foreign sequence metadata.');\n return value as RunnerSequenceRecord;\n };\n return {\n get,\n async list(all = false): Promise<RunnerSequenceRecord[]> {\n const listed = await fs.listDir(directory, BACKGROUND_CONTEXT);\n if (!listed.ok && listed.error.code === 'not_found') return [];\n const records: RunnerSequenceRecord[] = [];\n for (const entry of getOrThrow(listed)) {\n if (entry.kind !== 'file' || !entry.name.endsWith('.json') || entry.name.endsWith('.cancel.json')) continue;\n const id = entry.name.slice(0, -5);\n if (!isSequenceId(id)) continue;\n const record = await get(id);\n if (record && (all || record.state === 'running')) records.push(record);\n }\n return records;\n },\n save(record: RunnerSequenceRecord): Promise<void> {\n if (record.sessionId !== sessionId) throw new Error('Sequence belongs to another session.');\n const target = file(record.id);\n const text = JSON.stringify(record);\n const next = writes.then(() => writeFileAtomic(fs, target, text, BACKGROUND_CONTEXT));\n // A failed write rejects its caller, but does not poison future independent writes.\n writes = next.catch(() => undefined);\n return next;\n },\n async requestStop(id: string, reason?: string): Promise<{ id: string; requested: true }> {\n const record = await get(id);\n if (!record) throw new Error(`No sequence with id ${id} in this session.`);\n if (record.state !== 'running') throw new Error(`Sequence ${id} is already completed.`);\n await writeFileAtomic(fs, file(id, true), JSON.stringify({ id, sessionId, reason }), BACKGROUND_CONTEXT);\n return { id, requested: true };\n },\n async stopRequested(id: string): Promise<boolean> {\n const request = await read(file(id, true));\n if (request === undefined) return false;\n if (\n typeof request !== 'object' ||\n request === null ||\n !('id' in request) ||\n request.id !== id ||\n !('sessionId' in request) ||\n request.sessionId !== sessionId\n )\n throw new Error('Invalid sequence stop request.');\n return true;\n },\n };\n}\n\nexport type RunnerSequenceStore = ReturnType<typeof createRunnerSequenceStore>;\n"],"mappings":";;;;AAcA,SAAgB,aAAa,IAAqB;CAChD,OAAO,GAAG,WAAA,WAA0B,KAAK,4BAA4B,KAAK,EAAE;AAC9E;;AAGA,SAAgB,0BAA0B,IAAgB,OAAqB,WAAmB;CAChG,MAAM,YAAY,KAAK,KAAK,MAAM,eAAe,SAAS,GAAG,kBAAkB;CAC/E,IAAI,SAAS,QAAQ,QAAQ;CAC7B,MAAM,QAAQ,IAAY,eAAe,UAAU;EACjD,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,IAAI,MAAM,0CAA0C;EACjF,OAAO,KAAK,KAAK,WAAW,GAAG,KAAK,eAAe,YAAY,GAAG,MAAM;CAC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AK,MAAM;GACxE;GACA,OAAO;EACT;EACA,KAAK,QAA6C;GAChD,IAAI,OAAO,cAAc,WAAW,MAAM,IAAI,MAAM,sCAAsC;GAC1F,MAAM,SAAS,KAAK,OAAO,EAAE;GAC7B,MAAM,OAAO,KAAK,UAAU,MAAM;GAClC,MAAM,OAAO,OAAO,WAAW,gBAAgB,IAAI,QAAQ,MAAM,kBAAkB,CAAC;GAEpF,SAAS,KAAK,YAAY,KAAA,CAAS;GACnC,OAAO;EACT;EACA,MAAM,YAAY,IAAY,QAA2D;GACvF,MAAM,SAAS,MAAM,IAAI,EAAE;GAC3B,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,uBAAuB,GAAG,kBAAkB;GACzE,IAAI,OAAO,UAAU,WAAW,MAAM,IAAI,MAAM,YAAY,GAAG,uBAAuB;GACtF,MAAM,gBAAgB,IAAI,KAAK,IAAI,IAAI,GAAG,KAAK,UAAU;IAAE;IAAI;IAAW;GAAO,CAAC,GAAG,kBAAkB;GACvG,OAAO;IAAE;IAAI,WAAW;GAAK;EAC/B;EACA,MAAM,cAAc,IAA8B;GAChD,MAAM,UAAU,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC;GACzC,IAAI,YAAY,KAAA,GAAW,OAAO;GAClC,IACE,OAAO,YAAY,YACnB,YAAY,QACZ,EAAE,QAAQ,YACV,QAAQ,OAAO,MACf,EAAE,eAAe,YACjB,QAAQ,cAAc,WAEtB,MAAM,IAAI,MAAM,gCAAgC;GAClD,OAAO;EACT;CACF;AACF"}
@@ -0,0 +1,89 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_runnerSequence = require("./runnerSequence-ZTYgZ_2W.cjs");
3
+ let node_path = require("node:path");
4
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
5
+ let _agimon_ai_po_core_platform = require("@agimon-ai/po-core/platform");
6
+ //#region src/services/runnerSequenceStore/index.ts
7
+ function isSequenceId(id) {
8
+ return id.startsWith("sequence-") && /^sequence-[A-Za-z0-9_-]+$/.test(id);
9
+ }
10
+ /** One writer owns manifests. Separate stop requests cannot overwrite its progress. */
11
+ function createRunnerSequenceStore(fs, paths, sessionId) {
12
+ const directory = node_path.default.join(paths.stateDirectory(sessionId), require_runnerSequence.SEQUENCE_DIRECTORY);
13
+ let writes = Promise.resolve();
14
+ const file = (id, cancellation = false) => {
15
+ if (!isSequenceId(id)) throw new Error("Expected a sequence ID returned by Bash.");
16
+ return node_path.default.join(directory, `${id}${cancellation ? ".cancel" : ""}.json`);
17
+ };
18
+ const read = async (filePath) => {
19
+ const info = await fs.fileInfo(filePath, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
20
+ if (!info.ok && info.error.code === "not_found") return void 0;
21
+ if ((0, _agimon_ai_po_core_platform.getOrThrow)(info).kind !== "file") throw new Error("Sequence metadata is not a regular file.");
22
+ return JSON.parse(new TextDecoder().decode(await (0, _agimon_ai_po_core_platform.readBoundedFile)(fs, filePath, require_runnerSequence.MAX_SEQUENCE_RECORD_BYTES, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT)));
23
+ };
24
+ const get = async (id) => {
25
+ const value = await read(file(id));
26
+ if (value === void 0) return void 0;
27
+ if (typeof value !== "object" || value === null || !("id" in value) || value.id !== id || !("sessionId" in value) || value.sessionId !== sessionId || !("stages" in value) || !Array.isArray(value.stages) || !("state" in value) || value.state !== "running" && value.state !== "completed") throw new Error("Invalid or foreign sequence metadata.");
28
+ return value;
29
+ };
30
+ return {
31
+ get,
32
+ async list(all = false) {
33
+ const listed = await fs.listDir(directory, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
34
+ if (!listed.ok && listed.error.code === "not_found") return [];
35
+ const records = [];
36
+ for (const entry of (0, _agimon_ai_po_core_platform.getOrThrow)(listed)) {
37
+ if (entry.kind !== "file" || !entry.name.endsWith(".json") || entry.name.endsWith(".cancel.json")) continue;
38
+ const id = entry.name.slice(0, -5);
39
+ if (!isSequenceId(id)) continue;
40
+ const record = await get(id);
41
+ if (record && (all || record.state === "running")) records.push(record);
42
+ }
43
+ return records;
44
+ },
45
+ save(record) {
46
+ if (record.sessionId !== sessionId) throw new Error("Sequence belongs to another session.");
47
+ const target = file(record.id);
48
+ const text = JSON.stringify(record);
49
+ const next = writes.then(() => (0, _agimon_ai_po_core_platform.writeFileAtomic)(fs, target, text, _agimon_ai_po_core_platform.BACKGROUND_CONTEXT));
50
+ writes = next.catch(() => void 0);
51
+ return next;
52
+ },
53
+ async requestStop(id, reason) {
54
+ const record = await get(id);
55
+ if (!record) throw new Error(`No sequence with id ${id} in this session.`);
56
+ if (record.state !== "running") throw new Error(`Sequence ${id} is already completed.`);
57
+ await (0, _agimon_ai_po_core_platform.writeFileAtomic)(fs, file(id, true), JSON.stringify({
58
+ id,
59
+ sessionId,
60
+ reason
61
+ }), _agimon_ai_po_core_platform.BACKGROUND_CONTEXT);
62
+ return {
63
+ id,
64
+ requested: true
65
+ };
66
+ },
67
+ async stopRequested(id) {
68
+ const request = await read(file(id, true));
69
+ if (request === void 0) return false;
70
+ if (typeof request !== "object" || request === null || !("id" in request) || request.id !== id || !("sessionId" in request) || request.sessionId !== sessionId) throw new Error("Invalid sequence stop request.");
71
+ return true;
72
+ }
73
+ };
74
+ }
75
+ //#endregion
76
+ Object.defineProperty(exports, "createRunnerSequenceStore", {
77
+ enumerable: true,
78
+ get: function() {
79
+ return createRunnerSequenceStore;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, "isSequenceId", {
83
+ enumerable: true,
84
+ get: function() {
85
+ return isSequenceId;
86
+ }
87
+ });
88
+
89
+ //# sourceMappingURL=runnerSequenceStore-Ck6M-8r_.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerSequenceStore-Ck6M-8r_.cjs","names":["path","SEQUENCE_DIRECTORY","BACKGROUND_CONTEXT","getOrThrow","readBoundedFile","MAX_SEQUENCE_RECORD_BYTES","writeFileAtomic"],"sources":["../src/services/runnerSequenceStore/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport {\n BACKGROUND_CONTEXT,\n getOrThrow,\n readBoundedFile,\n writeFileAtomic,\n type FileSystem,\n} from '@agimon-ai/po-core/platform';\n\nimport { MAX_SEQUENCE_RECORD_BYTES, SEQUENCE_DIRECTORY, SEQUENCE_PREFIX } from '../../constants/runnerSequence';\nimport type { RunnerSequenceRecord } from '../../types/runnerSequence';\nimport type { IRunnerPaths } from '../runnerPaths/type';\n\nexport function isSequenceId(id: string): boolean {\n return id.startsWith(SEQUENCE_PREFIX) && /^sequence-[A-Za-z0-9_-]+$/.test(id);\n}\n\n/** One writer owns manifests. Separate stop requests cannot overwrite its progress. */\nexport function createRunnerSequenceStore(fs: FileSystem, paths: IRunnerPaths, sessionId: string) {\n const directory = path.join(paths.stateDirectory(sessionId), SEQUENCE_DIRECTORY);\n let writes = Promise.resolve();\n const file = (id: string, cancellation = false) => {\n if (!isSequenceId(id)) throw new Error('Expected a sequence ID returned by Bash.');\n return path.join(directory, `${id}${cancellation ? '.cancel' : ''}.json`);\n };\n const read = async (filePath: string): Promise<unknown> => {\n const info = await fs.fileInfo(filePath, BACKGROUND_CONTEXT);\n if (!info.ok && info.error.code === 'not_found') return undefined;\n if (getOrThrow(info).kind !== 'file') throw new Error('Sequence metadata is not a regular file.');\n return JSON.parse(\n new TextDecoder().decode(await readBoundedFile(fs, filePath, MAX_SEQUENCE_RECORD_BYTES, BACKGROUND_CONTEXT)),\n );\n };\n const get = async (id: string): Promise<RunnerSequenceRecord | undefined> => {\n const value = await read(file(id));\n if (value === undefined) return undefined;\n if (\n typeof value !== 'object' ||\n value === null ||\n !('id' in value) ||\n value.id !== id ||\n !('sessionId' in value) ||\n value.sessionId !== sessionId ||\n !('stages' in value) ||\n !Array.isArray(value.stages) ||\n !('state' in value) ||\n (value.state !== 'running' && value.state !== 'completed')\n )\n throw new Error('Invalid or foreign sequence metadata.');\n return value as RunnerSequenceRecord;\n };\n return {\n get,\n async list(all = false): Promise<RunnerSequenceRecord[]> {\n const listed = await fs.listDir(directory, BACKGROUND_CONTEXT);\n if (!listed.ok && listed.error.code === 'not_found') return [];\n const records: RunnerSequenceRecord[] = [];\n for (const entry of getOrThrow(listed)) {\n if (entry.kind !== 'file' || !entry.name.endsWith('.json') || entry.name.endsWith('.cancel.json')) continue;\n const id = entry.name.slice(0, -5);\n if (!isSequenceId(id)) continue;\n const record = await get(id);\n if (record && (all || record.state === 'running')) records.push(record);\n }\n return records;\n },\n save(record: RunnerSequenceRecord): Promise<void> {\n if (record.sessionId !== sessionId) throw new Error('Sequence belongs to another session.');\n const target = file(record.id);\n const text = JSON.stringify(record);\n const next = writes.then(() => writeFileAtomic(fs, target, text, BACKGROUND_CONTEXT));\n // A failed write rejects its caller, but does not poison future independent writes.\n writes = next.catch(() => undefined);\n return next;\n },\n async requestStop(id: string, reason?: string): Promise<{ id: string; requested: true }> {\n const record = await get(id);\n if (!record) throw new Error(`No sequence with id ${id} in this session.`);\n if (record.state !== 'running') throw new Error(`Sequence ${id} is already completed.`);\n await writeFileAtomic(fs, file(id, true), JSON.stringify({ id, sessionId, reason }), BACKGROUND_CONTEXT);\n return { id, requested: true };\n },\n async stopRequested(id: string): Promise<boolean> {\n const request = await read(file(id, true));\n if (request === undefined) return false;\n if (\n typeof request !== 'object' ||\n request === null ||\n !('id' in request) ||\n request.id !== id ||\n !('sessionId' in request) ||\n request.sessionId !== sessionId\n )\n throw new Error('Invalid sequence stop request.');\n return true;\n },\n };\n}\n\nexport type RunnerSequenceStore = ReturnType<typeof createRunnerSequenceStore>;\n"],"mappings":";;;;;;AAcA,SAAgB,aAAa,IAAqB;CAChD,OAAO,GAAG,WAAA,WAA0B,KAAK,4BAA4B,KAAK,EAAE;AAC9E;;AAGA,SAAgB,0BAA0B,IAAgB,OAAqB,WAAmB;CAChG,MAAM,YAAYA,UAAAA,QAAK,KAAK,MAAM,eAAe,SAAS,GAAGC,uBAAAA,kBAAkB;CAC/E,IAAI,SAAS,QAAQ,QAAQ;CAC7B,MAA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AAM,IAAI,MAAM,gCAAgC;GAClD,OAAO;EACT;CACF;AACF"}
@@ -1,7 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../../rolldown-runtime-VH7oDXx4.cjs");
2
+ const require_rolldown_runtime = require("../../rolldown-runtime-C0BPl7ul.cjs");
3
3
  let node_net = require("node:net");
4
4
  node_net = require_rolldown_runtime.__toESM(node_net, 1);
5
+ let node_process = require("node:process");
6
+ node_process = require_rolldown_runtime.__toESM(node_process, 1);
5
7
  //#region src/services/lifeline/client.ts
6
8
  /** Environment variable carrying the lifeline socket path to every runner supervisor. */
7
9
  const LIFELINE_ENV = "PO_RUNNER_LIFELINE";
@@ -21,7 +23,7 @@ const LIFELINE_ENV = "PO_RUNNER_LIFELINE";
21
23
  * Runners run unwatched when no lifeline is armed, so a missing environment
22
24
  * variable can never be mistaken for a dead owner.
23
25
  */
24
- function watchOwner(onOwnerLost, target = process.env[LIFELINE_ENV]) {
26
+ function watchOwner(onOwnerLost, target = node_process.default.env[LIFELINE_ENV]) {
25
27
  if (!target) return () => void 0;
26
28
  let settled = false;
27
29
  const settle = () => {
@@ -31,9 +33,9 @@ function watchOwner(onOwnerLost, target = process.env[LIFELINE_ENV]) {
31
33
  };
32
34
  let connection;
33
35
  try {
34
- connection = node_net.default.connect(target);
36
+ connection = connectLifeline(target);
35
37
  } catch (error) {
36
- process.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);
38
+ node_process.default.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);
37
39
  return () => void 0;
38
40
  }
39
41
  connection.unref();
@@ -45,8 +47,90 @@ function watchOwner(onOwnerLost, target = process.env[LIFELINE_ENV]) {
45
47
  connection.destroy();
46
48
  };
47
49
  }
50
+ /** Long session temp paths use a loopback socket, without creating files outside the session. */
51
+ function connectLifeline(target) {
52
+ if (target.startsWith("tcp://")) {
53
+ const address = new URL(target);
54
+ if (address.hostname !== "127.0.0.1") throw new Error("Runner lifeline must be loopback");
55
+ return node_net.default.connect({
56
+ host: address.hostname,
57
+ port: Number(address.port)
58
+ });
59
+ }
60
+ return node_net.default.connect(target);
61
+ }
62
+ /**
63
+ * Watches every session lifeline of one owner from one observer process.
64
+ *
65
+ * The owner sends a watch per armed session over IPC. While the owner lives, it cleans up its own
66
+ * sessions with its shared services, so a lifeline that closes then is only held back and this
67
+ * process loads nothing. Once the owner is gone, SIGKILL included, the channel disconnects and
68
+ * `cleanup` gets every lifeline held back, then each that closes later; it skips the sessions the
69
+ * owner already cleaned up.
70
+ * The message listener holds the IPC channel, and so this process, open while the owner lives;
71
+ * once the owner is gone it exits after the last lifeline closes and its cleanup settles.
72
+ */
73
+ function observeSessions(cleanup) {
74
+ const closed = [];
75
+ let cleaning = Promise.resolve();
76
+ const drain = () => {
77
+ if (node_process.default.connected || closed.length === 0) return;
78
+ const batch = closed.splice(0);
79
+ cleaning = cleaning.then(() => cleanup(batch).catch((error) => node_process.default.emitWarning(`Could not clean up runner sessions after their owner: ${String(error)}`)));
80
+ };
81
+ node_process.default.on("message", (message) => {
82
+ const watch = readWatch(message);
83
+ if (watch) return observe(watch, (ended) => {
84
+ closed.push(ended);
85
+ drain();
86
+ });
87
+ const generation = message?.generation;
88
+ if (typeof generation === "string") reply({
89
+ generation,
90
+ error: "Invalid runner observer watch"
91
+ });
92
+ });
93
+ node_process.default.once("disconnect", drain);
94
+ reply("ready");
95
+ }
96
+ function observe(watch, onClose) {
97
+ let connection;
98
+ try {
99
+ connection = connectLifeline(watch.target);
100
+ } catch (error) {
101
+ reply({
102
+ generation: watch.generation,
103
+ error: String(error)
104
+ });
105
+ return;
106
+ }
107
+ let admitted = false;
108
+ connection.once("connect", () => {
109
+ admitted = true;
110
+ connection.resume();
111
+ reply({ generation: watch.generation });
112
+ });
113
+ connection.once("error", (error) => {
114
+ if (!admitted) reply({
115
+ generation: watch.generation,
116
+ error: error.message
117
+ });
118
+ });
119
+ connection.once("close", () => onClose(watch));
120
+ }
121
+ /** The owner may already be gone, and a closed channel must not crash the watches still open. */
122
+ function reply(message) {
123
+ if (node_process.default.connected) node_process.default.send?.(message, void 0, void 0, () => void 0);
124
+ }
125
+ function readWatch(value) {
126
+ if (typeof value !== "object" || value === null) return void 0;
127
+ const watch = value;
128
+ return typeof watch.sessionId === "string" && typeof watch.target === "string" && typeof watch.repository === "string" && typeof watch.generation === "string" && typeof watch.marker === "string" && Number.isInteger(watch.ownerPid) && typeof watch.environment === "object" && watch.environment !== null ? watch : void 0;
129
+ }
48
130
  //#endregion
49
131
  exports.LIFELINE_ENV = LIFELINE_ENV;
132
+ exports.connectLifeline = connectLifeline;
133
+ exports.observeSessions = observeSessions;
50
134
  exports.watchOwner = watchOwner;
51
135
 
52
136
  //# sourceMappingURL=client.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.cjs","names":["net"],"sources":["../../../src/services/lifeline/client.ts"],"sourcesContent":["import net from 'node:net';\n\n/** Environment variable carrying the lifeline socket path to every runner supervisor. */\nexport const LIFELINE_ENV = 'PO_RUNNER_LIFELINE';\n\n/**\n * Reports the owning pi process dying to a runner's supervisor.\n *\n * A connected Unix socket drops the moment the owner's descriptors close, which\n * happens on every exit path including SIGKILL, so it is the one death signal a\n * graceful shutdown handler cannot provide. Connecting never blocks, the close\n * edge arrives through the event loop rather than a poll, and an unref'd socket\n * can never keep the supervisor alive: the watcher is therefore incapable of\n * outliving the process that installed it.\n *\n * A refused or missing socket means the owner died before this runner started,\n * which is reported the same way as a later death rather than left to hang.\n *\n * Runners run unwatched when no lifeline is armed, so a missing environment\n * variable can never be mistaken for a dead owner.\n */\nexport function watchOwner(\n onOwnerLost: () => void,\n target: string | undefined = process.env[LIFELINE_ENV],\n): () => void {\n if (!target) return () => undefined;\n\n let settled = false;\n const settle = (): void => {\n if (settled) return;\n settled = true;\n onOwnerLost();\n };\n\n let connection: net.Socket;\n try {\n connection = net.connect(target);\n } catch (error) {\n process.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);\n return () => undefined;\n }\n\n // The supervisor's own exit must never wait on this socket.\n connection.unref();\n // The owner never sends anything, so drain rather than accumulate.\n connection.on('connect', () => connection.resume());\n connection.on('error', settle);\n connection.on('close', settle);\n\n return () => {\n settled = true;\n connection.destroy();\n };\n}\n"],"mappings":";;;;;;AAGA,MAAa,eAAe;;;;;;;;;;;;;;;;;AAkB5B,SAAgB,WACd,aACA,SAA6B,QAAQ,IAAI,eAC7B;CACZ,IAAI,CAAC,QAAQ,aAAa,KAAA;CAE1B,IAAI,UAAU;CACd,MAAM,eAAqB;EACzB,IAAI,SAAS;EACb,UAAU;EACV,YAAY;CACd;CAEA,IAAI;CACJ,IAAI;EACF,aAAaA,SAAAA,QAAI,QAAQ,MAAM;CACjC,SAAS,OAAO;EACd,QAAQ,YAAY,2CAA2C,OAAO,KAAK,GAAG;EAC9E,aAAa,KAAA;CACf;CAGA,WAAW,MAAM;CAEjB,WAAW,GAAG,iBAAiB,WAAW,OAAO,CAAC;CAClD,WAAW,GAAG,SAAS,MAAM;CAC7B,WAAW,GAAG,SAAS,MAAM;CAE7B,aAAa;EACX,UAAU;EACV,WAAW,QAAQ;CACrB;AACF"}
1
+ {"version":3,"file":"client.cjs","names":["process","net"],"sources":["../../../src/services/lifeline/client.ts"],"sourcesContent":["import net from 'node:net';\nimport process from 'node:process';\n\nimport type { LifelineAdmission, LifelineWatch } from '../../types/lifeline';\n\n/** Environment variable carrying the lifeline socket path to every runner supervisor. */\nexport const LIFELINE_ENV = 'PO_RUNNER_LIFELINE';\n\n/**\n * Reports the owning pi process dying to a runner's supervisor.\n *\n * A connected Unix socket drops the moment the owner's descriptors close, which\n * happens on every exit path including SIGKILL, so it is the one death signal a\n * graceful shutdown handler cannot provide. Connecting never blocks, the close\n * edge arrives through the event loop rather than a poll, and an unref'd socket\n * can never keep the supervisor alive: the watcher is therefore incapable of\n * outliving the process that installed it.\n *\n * A refused or missing socket means the owner died before this runner started,\n * which is reported the same way as a later death rather than left to hang.\n *\n * Runners run unwatched when no lifeline is armed, so a missing environment\n * variable can never be mistaken for a dead owner.\n */\nexport function watchOwner(\n onOwnerLost: () => void,\n target: string | undefined = process.env[LIFELINE_ENV],\n): () => void {\n if (!target) return () => undefined;\n\n let settled = false;\n const settle = (): void => {\n if (settled) return;\n settled = true;\n onOwnerLost();\n };\n\n let connection: net.Socket;\n try {\n connection = connectLifeline(target);\n } catch (error) {\n process.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);\n return () => undefined;\n }\n\n // The supervisor's own exit must never wait on this socket.\n connection.unref();\n // The owner never sends anything, so drain rather than accumulate.\n connection.on('connect', () => connection.resume());\n connection.on('error', settle);\n connection.on('close', settle);\n\n return () => {\n settled = true;\n connection.destroy();\n };\n}\n\n/** Long session temp paths use a loopback socket, without creating files outside the session. */\nexport function connectLifeline(target: string): net.Socket {\n if (target.startsWith('tcp://')) {\n const address = new URL(target);\n if (address.hostname !== '127.0.0.1') throw new Error('Runner lifeline must be loopback');\n return net.connect({ host: address.hostname, port: Number(address.port) });\n }\n return net.connect(target);\n}\n\n/**\n * Watches every session lifeline of one owner from one observer process.\n *\n * The owner sends a watch per armed session over IPC. While the owner lives, it cleans up its own\n * sessions with its shared services, so a lifeline that closes then is only held back and this\n * process loads nothing. Once the owner is gone, SIGKILL included, the channel disconnects and\n * `cleanup` gets every lifeline held back, then each that closes later; it skips the sessions the\n * owner already cleaned up.\n * The message listener holds the IPC channel, and so this process, open while the owner lives;\n * once the owner is gone it exits after the last lifeline closes and its cleanup settles.\n */\nexport function observeSessions(cleanup: (watches: readonly LifelineWatch[]) => Promise<void>): void {\n // ponytail: an ended session stays held here until the owner exits, a few KB each; prune the ones\n // whose marker is gone if one owner ever outlives thousands of sessions.\n const closed: LifelineWatch[] = [];\n let cleaning = Promise.resolve();\n const drain = (): void => {\n if (process.connected || closed.length === 0) return;\n const batch = closed.splice(0);\n // Batches run one after another, so no two of them open the same registry at once.\n cleaning = cleaning.then(() =>\n cleanup(batch).catch((error: unknown) =>\n process.emitWarning(`Could not clean up runner sessions after their owner: ${String(error)}`),\n ),\n );\n };\n process.on('message', (message: unknown) => {\n const watch = readWatch(message);\n if (watch)\n return observe(watch, (ended) => {\n closed.push(ended);\n drain();\n });\n const generation = (message as Partial<LifelineWatch> | null)?.generation;\n if (typeof generation === 'string') reply({ generation, error: 'Invalid runner observer watch' });\n });\n process.once('disconnect', drain);\n reply('ready');\n}\n\nfunction observe(watch: LifelineWatch, onClose: (watch: LifelineWatch) => void): void {\n let connection: net.Socket;\n try {\n connection = connectLifeline(watch.target);\n } catch (error) {\n reply({ generation: watch.generation, error: String(error) });\n return;\n }\n let admitted = false;\n connection.once('connect', () => {\n admitted = true;\n // The owner never sends anything, so drain rather than accumulate.\n connection.resume();\n reply({ generation: watch.generation });\n });\n connection.once('error', (error) => {\n if (!admitted) reply({ generation: watch.generation, error: error.message });\n });\n connection.once('close', () => onClose(watch));\n}\n\n/** The owner may already be gone, and a closed channel must not crash the watches still open. */\nfunction reply(message: LifelineAdmission | 'ready'): void {\n if (process.connected) process.send?.(message, undefined, undefined, () => undefined);\n}\n\nfunction readWatch(value: unknown): LifelineWatch | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const watch = value as Partial<LifelineWatch>;\n const valid =\n typeof watch.sessionId === 'string' &&\n typeof watch.target === 'string' &&\n typeof watch.repository === 'string' &&\n typeof watch.generation === 'string' &&\n typeof watch.marker === 'string' &&\n Number.isInteger(watch.ownerPid) &&\n typeof watch.environment === 'object' &&\n watch.environment !== null;\n return valid ? (watch as LifelineWatch) : undefined;\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,eAAe;;;;;;;;;;;;;;;;;AAkB5B,SAAgB,WACd,aACA,SAA6BA,aAAAA,QAAQ,IAAI,eAC7B;CACZ,IAAI,CAAC,QAAQ,aAAa,KAAA;CAE1B,IAAI,UAAU;CACd,MAAM,eAAqB;EACzB,IAAI,SAAS;EACb,UAAU;EACV,YAAY;CACd;CAEA,IAAI;CACJ,IAA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Q,KAAK,cAAc,KAAK;CAChC,MAAM,OAAO;AACf;AAEA,SAAS,QAAQ,OAAsB,SAA+C;CACpF,IAAI;CACJ,IAAI;EACF,aAAa,gBAAgB,MAAM,MAAM;CAC3C,SAAS,OAAO;EACd,MAAM;GAAE,YAAY,MAAM;GAAY,OAAO,OAAO,KAAK;EAAE,CAAC;EAC5D;CACF;CACA,IAAI,WAAW;CACf,WAAW,KAAK,iBAAiB;EAC/B,WAAW;EAEX,WAAW,OAAO;EAClB,MAAM,EAAE,YAAY,MAAM,WAAW,CAAC;CACxC,CAAC;CACD,WAAW,KAAK,UAAU,UAAU;EAClC,IAAI,CAAC,UAAU,MAAM;GAAE,YAAY,MAAM;GAAY,OAAO,MAAM;EAAQ,CAAC;CAC7E,CAAC;CACD,WAAW,KAAK,eAAe,QAAQ,KAAK,CAAC;AAC/C;;AAGA,SAAS,MAAM,SAA4C;CACzD,IAAIA,aAAAA,QAAQ,WAAW,aAAA,QAAQ,OAAO,SAAS,KAAA,GAAW,KAAA,SAAiB,KAAA,CAAS;AACtF;AAEA,SAAS,UAAU,OAA2C;CAC5D,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,QAAQ;CAUd,OARE,OAAO,MAAM,cAAc,YAC3B,OAAO,MAAM,WAAW,YACxB,OAAO,MAAM,eAAe,YAC5B,OAAO,MAAM,eAAe,YAC5B,OAAO,MAAM,WAAW,YACxB,OAAO,UAAU,MAAM,QAAQ,KAC/B,OAAO,MAAM,gBAAgB,YAC7B,MAAM,gBAAgB,OACR,QAA0B,KAAA;AAC5C"}
@@ -1,3 +1,5 @@
1
+ import { n as LifelineWatch } from "../../lifeline-26IaW5w7.mjs";
2
+ import net from "node:net";
1
3
  //#region src/services/lifeline/client.d.ts
2
4
  /** Environment variable carrying the lifeline socket path to every runner supervisor. */
3
5
  export declare const LIFELINE_ENV = "PO_RUNNER_LIFELINE";
@@ -18,5 +20,19 @@ export declare const LIFELINE_ENV = "PO_RUNNER_LIFELINE";
18
20
  * variable can never be mistaken for a dead owner.
19
21
  */
20
22
  export declare function watchOwner(onOwnerLost: () => void, target?: string | undefined): () => void;
23
+ /** Long session temp paths use a loopback socket, without creating files outside the session. */
24
+ export declare function connectLifeline(target: string): net.Socket;
25
+ /**
26
+ * Watches every session lifeline of one owner from one observer process.
27
+ *
28
+ * The owner sends a watch per armed session over IPC. While the owner lives, it cleans up its own
29
+ * sessions with its shared services, so a lifeline that closes then is only held back and this
30
+ * process loads nothing. Once the owner is gone, SIGKILL included, the channel disconnects and
31
+ * `cleanup` gets every lifeline held back, then each that closes later; it skips the sessions the
32
+ * owner already cleaned up.
33
+ * The message listener holds the IPC channel, and so this process, open while the owner lives;
34
+ * once the owner is gone it exits after the last lifeline closes and its cleanup settles.
35
+ */
36
+ export declare function observeSessions(cleanup: (watches: readonly LifelineWatch[]) => Promise<void>): void;
21
37
  //#endregion
22
38
  //# sourceMappingURL=client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","names":[],"sources":["../../../src/services/lifeline/client.ts"],"mappings":";;qBAGa;;;;;;;;;;;;;;;;;wBAkBG,WACd,yBACA"}
1
+ {"version":3,"file":"client.d.mts","names":[],"sources":["../../../src/services/lifeline/client.ts"],"mappings":";;;;qBAMa;;;;;;;;;;;;;;;;;wBAkBG,WACd,yBACA;;wBAiCc,gBAAgB,iBAAiB,IAAI;;;;;;;;;;;;wBAoBrC,gBAAgB,UAAU,kBAAkB,oBAAoB"}
@@ -1,4 +1,5 @@
1
1
  import net from "node:net";
2
+ import process from "node:process";
2
3
  //#region src/services/lifeline/client.ts
3
4
  /** Environment variable carrying the lifeline socket path to every runner supervisor. */
4
5
  const LIFELINE_ENV = "PO_RUNNER_LIFELINE";
@@ -28,7 +29,7 @@ function watchOwner(onOwnerLost, target = process.env[LIFELINE_ENV]) {
28
29
  };
29
30
  let connection;
30
31
  try {
31
- connection = net.connect(target);
32
+ connection = connectLifeline(target);
32
33
  } catch (error) {
33
34
  process.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);
34
35
  return () => void 0;
@@ -42,7 +43,87 @@ function watchOwner(onOwnerLost, target = process.env[LIFELINE_ENV]) {
42
43
  connection.destroy();
43
44
  };
44
45
  }
46
+ /** Long session temp paths use a loopback socket, without creating files outside the session. */
47
+ function connectLifeline(target) {
48
+ if (target.startsWith("tcp://")) {
49
+ const address = new URL(target);
50
+ if (address.hostname !== "127.0.0.1") throw new Error("Runner lifeline must be loopback");
51
+ return net.connect({
52
+ host: address.hostname,
53
+ port: Number(address.port)
54
+ });
55
+ }
56
+ return net.connect(target);
57
+ }
58
+ /**
59
+ * Watches every session lifeline of one owner from one observer process.
60
+ *
61
+ * The owner sends a watch per armed session over IPC. While the owner lives, it cleans up its own
62
+ * sessions with its shared services, so a lifeline that closes then is only held back and this
63
+ * process loads nothing. Once the owner is gone, SIGKILL included, the channel disconnects and
64
+ * `cleanup` gets every lifeline held back, then each that closes later; it skips the sessions the
65
+ * owner already cleaned up.
66
+ * The message listener holds the IPC channel, and so this process, open while the owner lives;
67
+ * once the owner is gone it exits after the last lifeline closes and its cleanup settles.
68
+ */
69
+ function observeSessions(cleanup) {
70
+ const closed = [];
71
+ let cleaning = Promise.resolve();
72
+ const drain = () => {
73
+ if (process.connected || closed.length === 0) return;
74
+ const batch = closed.splice(0);
75
+ cleaning = cleaning.then(() => cleanup(batch).catch((error) => process.emitWarning(`Could not clean up runner sessions after their owner: ${String(error)}`)));
76
+ };
77
+ process.on("message", (message) => {
78
+ const watch = readWatch(message);
79
+ if (watch) return observe(watch, (ended) => {
80
+ closed.push(ended);
81
+ drain();
82
+ });
83
+ const generation = message?.generation;
84
+ if (typeof generation === "string") reply({
85
+ generation,
86
+ error: "Invalid runner observer watch"
87
+ });
88
+ });
89
+ process.once("disconnect", drain);
90
+ reply("ready");
91
+ }
92
+ function observe(watch, onClose) {
93
+ let connection;
94
+ try {
95
+ connection = connectLifeline(watch.target);
96
+ } catch (error) {
97
+ reply({
98
+ generation: watch.generation,
99
+ error: String(error)
100
+ });
101
+ return;
102
+ }
103
+ let admitted = false;
104
+ connection.once("connect", () => {
105
+ admitted = true;
106
+ connection.resume();
107
+ reply({ generation: watch.generation });
108
+ });
109
+ connection.once("error", (error) => {
110
+ if (!admitted) reply({
111
+ generation: watch.generation,
112
+ error: error.message
113
+ });
114
+ });
115
+ connection.once("close", () => onClose(watch));
116
+ }
117
+ /** The owner may already be gone, and a closed channel must not crash the watches still open. */
118
+ function reply(message) {
119
+ if (process.connected) process.send?.(message, void 0, void 0, () => void 0);
120
+ }
121
+ function readWatch(value) {
122
+ if (typeof value !== "object" || value === null) return void 0;
123
+ const watch = value;
124
+ return typeof watch.sessionId === "string" && typeof watch.target === "string" && typeof watch.repository === "string" && typeof watch.generation === "string" && typeof watch.marker === "string" && Number.isInteger(watch.ownerPid) && typeof watch.environment === "object" && watch.environment !== null ? watch : void 0;
125
+ }
45
126
  //#endregion
46
- export { LIFELINE_ENV, watchOwner };
127
+ export { LIFELINE_ENV, connectLifeline, observeSessions, watchOwner };
47
128
 
48
129
  //# sourceMappingURL=client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../../../src/services/lifeline/client.ts"],"sourcesContent":["import net from 'node:net';\n\n/** Environment variable carrying the lifeline socket path to every runner supervisor. */\nexport const LIFELINE_ENV = 'PO_RUNNER_LIFELINE';\n\n/**\n * Reports the owning pi process dying to a runner's supervisor.\n *\n * A connected Unix socket drops the moment the owner's descriptors close, which\n * happens on every exit path including SIGKILL, so it is the one death signal a\n * graceful shutdown handler cannot provide. Connecting never blocks, the close\n * edge arrives through the event loop rather than a poll, and an unref'd socket\n * can never keep the supervisor alive: the watcher is therefore incapable of\n * outliving the process that installed it.\n *\n * A refused or missing socket means the owner died before this runner started,\n * which is reported the same way as a later death rather than left to hang.\n *\n * Runners run unwatched when no lifeline is armed, so a missing environment\n * variable can never be mistaken for a dead owner.\n */\nexport function watchOwner(\n onOwnerLost: () => void,\n target: string | undefined = process.env[LIFELINE_ENV],\n): () => void {\n if (!target) return () => undefined;\n\n let settled = false;\n const settle = (): void => {\n if (settled) return;\n settled = true;\n onOwnerLost();\n };\n\n let connection: net.Socket;\n try {\n connection = net.connect(target);\n } catch (error) {\n process.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);\n return () => undefined;\n }\n\n // The supervisor's own exit must never wait on this socket.\n connection.unref();\n // The owner never sends anything, so drain rather than accumulate.\n connection.on('connect', () => connection.resume());\n connection.on('error', settle);\n connection.on('close', settle);\n\n return () => {\n settled = true;\n connection.destroy();\n };\n}\n"],"mappings":";;;AAGA,MAAa,eAAe;;;;;;;;;;;;;;;;;AAkB5B,SAAgB,WACd,aACA,SAA6B,QAAQ,IAAI,eAC7B;CACZ,IAAI,CAAC,QAAQ,aAAa,KAAA;CAE1B,IAAI,UAAU;CACd,MAAM,eAAqB;EACzB,IAAI,SAAS;EACb,UAAU;EACV,YAAY;CACd;CAEA,IAAI;CACJ,IAAI;EACF,aAAa,IAAI,QAAQ,MAAM;CACjC,SAAS,OAAO;EACd,QAAQ,YAAY,2CAA2C,OAAO,KAAK,GAAG;EAC9E,aAAa,KAAA;CACf;CAGA,WAAW,MAAM;CAEjB,WAAW,GAAG,iBAAiB,WAAW,OAAO,CAAC;CAClD,WAAW,GAAG,SAAS,MAAM;CAC7B,WAAW,GAAG,SAAS,MAAM;CAE7B,aAAa;EACX,UAAU;EACV,WAAW,QAAQ;CACrB;AACF"}
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../../../src/services/lifeline/client.ts"],"sourcesContent":["import net from 'node:net';\nimport process from 'node:process';\n\nimport type { LifelineAdmission, LifelineWatch } from '../../types/lifeline';\n\n/** Environment variable carrying the lifeline socket path to every runner supervisor. */\nexport const LIFELINE_ENV = 'PO_RUNNER_LIFELINE';\n\n/**\n * Reports the owning pi process dying to a runner's supervisor.\n *\n * A connected Unix socket drops the moment the owner's descriptors close, which\n * happens on every exit path including SIGKILL, so it is the one death signal a\n * graceful shutdown handler cannot provide. Connecting never blocks, the close\n * edge arrives through the event loop rather than a poll, and an unref'd socket\n * can never keep the supervisor alive: the watcher is therefore incapable of\n * outliving the process that installed it.\n *\n * A refused or missing socket means the owner died before this runner started,\n * which is reported the same way as a later death rather than left to hang.\n *\n * Runners run unwatched when no lifeline is armed, so a missing environment\n * variable can never be mistaken for a dead owner.\n */\nexport function watchOwner(\n onOwnerLost: () => void,\n target: string | undefined = process.env[LIFELINE_ENV],\n): () => void {\n if (!target) return () => undefined;\n\n let settled = false;\n const settle = (): void => {\n if (settled) return;\n settled = true;\n onOwnerLost();\n };\n\n let connection: net.Socket;\n try {\n connection = connectLifeline(target);\n } catch (error) {\n process.emitWarning(`Could not watch the po-runner lifeline: ${String(error)}`);\n return () => undefined;\n }\n\n // The supervisor's own exit must never wait on this socket.\n connection.unref();\n // The owner never sends anything, so drain rather than accumulate.\n connection.on('connect', () => connection.resume());\n connection.on('error', settle);\n connection.on('close', settle);\n\n return () => {\n settled = true;\n connection.destroy();\n };\n}\n\n/** Long session temp paths use a loopback socket, without creating files outside the session. */\nexport function connectLifeline(target: string): net.Socket {\n if (target.startsWith('tcp://')) {\n const address = new URL(target);\n if (address.hostname !== '127.0.0.1') throw new Error('Runner lifeline must be loopback');\n return net.connect({ host: address.hostname, port: Number(address.port) });\n }\n return net.connect(target);\n}\n\n/**\n * Watches every session lifeline of one owner from one observer process.\n *\n * The owner sends a watch per armed session over IPC. While the owner lives, it cleans up its own\n * sessions with its shared services, so a lifeline that closes then is only held back and this\n * process loads nothing. Once the owner is gone, SIGKILL included, the channel disconnects and\n * `cleanup` gets every lifeline held back, then each that closes later; it skips the sessions the\n * owner already cleaned up.\n * The message listener holds the IPC channel, and so this process, open while the owner lives;\n * once the owner is gone it exits after the last lifeline closes and its cleanup settles.\n */\nexport function observeSessions(cleanup: (watches: readonly LifelineWatch[]) => Promise<void>): void {\n // ponytail: an ended session stays held here until the owner exits, a few KB each; prune the ones\n // whose marker is gone if one owner ever outlives thousands of sessions.\n const closed: LifelineWatch[] = [];\n let cleaning = Promise.resolve();\n const drain = (): void => {\n if (process.connected || closed.length === 0) return;\n const batch = closed.splice(0);\n // Batches run one after another, so no two of them open the same registry at once.\n cleaning = cleaning.then(() =>\n cleanup(batch).catch((error: unknown) =>\n process.emitWarning(`Could not clean up runner sessions after their owner: ${String(error)}`),\n ),\n );\n };\n process.on('message', (message: unknown) => {\n const watch = readWatch(message);\n if (watch)\n return observe(watch, (ended) => {\n closed.push(ended);\n drain();\n });\n const generation = (message as Partial<LifelineWatch> | null)?.generation;\n if (typeof generation === 'string') reply({ generation, error: 'Invalid runner observer watch' });\n });\n process.once('disconnect', drain);\n reply('ready');\n}\n\nfunction observe(watch: LifelineWatch, onClose: (watch: LifelineWatch) => void): void {\n let connection: net.Socket;\n try {\n connection = connectLifeline(watch.target);\n } catch (error) {\n reply({ generation: watch.generation, error: String(error) });\n return;\n }\n let admitted = false;\n connection.once('connect', () => {\n admitted = true;\n // The owner never sends anything, so drain rather than accumulate.\n connection.resume();\n reply({ generation: watch.generation });\n });\n connection.once('error', (error) => {\n if (!admitted) reply({ generation: watch.generation, error: error.message });\n });\n connection.once('close', () => onClose(watch));\n}\n\n/** The owner may already be gone, and a closed channel must not crash the watches still open. */\nfunction reply(message: LifelineAdmission | 'ready'): void {\n if (process.connected) process.send?.(message, undefined, undefined, () => undefined);\n}\n\nfunction readWatch(value: unknown): LifelineWatch | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const watch = value as Partial<LifelineWatch>;\n const valid =\n typeof watch.sessionId === 'string' &&\n typeof watch.target === 'string' &&\n typeof watch.repository === 'string' &&\n typeof watch.generation === 'string' &&\n typeof watch.marker === 'string' &&\n Number.isInteger(watch.ownerPid) &&\n typeof watch.environment === 'object' &&\n watch.environment !== null;\n return valid ? (watch as LifelineWatch) : undefined;\n}\n"],"mappings":";;;;AAMA,MAAa,eAAe;;;;;;;;;;;;;;;;;AAkB5B,SAAgB,WACd,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