@ensocode/server 0.3.11 → 0.3.12

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 (185) hide show
  1. package/LICENSE +679 -19
  2. package/out/phone/assets/{abnfDiagram-VCTEODGH-DeKO4j9Y.js → abnfDiagram-VCTEODGH-D-9apHOZ.js} +1 -1
  3. package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +1 -0
  4. package/out/phone/assets/{architectureDiagram-5GKGNRK7-DhPgDhMQ.js → architectureDiagram-5GKGNRK7-B7ti5Yuy.js} +1 -1
  5. package/out/phone/assets/{blockDiagram-I7D4REHJ-CHjEV4S2.js → blockDiagram-I7D4REHJ-CMg6PHJB.js} +1 -1
  6. package/out/phone/assets/{c4Diagram-7LVT6UL2-C_w2ZiGg.js → c4Diagram-7LVT6UL2-YtDbC01g.js} +1 -1
  7. package/out/phone/assets/channel-BQsoblXW.js +1 -0
  8. package/out/phone/assets/{chunk-4HAMMTFA-DsFB5306.js → chunk-4HAMMTFA-Djg6ctlZ.js} +1 -1
  9. package/out/phone/assets/{chunk-75Z2AOVW-D-GYq_Mf.js → chunk-75Z2AOVW-Be2kq0FP.js} +1 -1
  10. package/out/phone/assets/{chunk-DU6HZSFF-CfnOn1uu.js → chunk-DU6HZSFF-d5JZiOMy.js} +1 -1
  11. package/out/phone/assets/{chunk-F27PBJKO-DFQr9a2N.js → chunk-F27PBJKO-DHBQ6nrV.js} +1 -1
  12. package/out/phone/assets/{chunk-GMAD6QVW--AoHkXxN.js → chunk-GMAD6QVW-BatU6uXC.js} +1 -1
  13. package/out/phone/assets/{chunk-GVQU2GXP-CzbFqhoi.js → chunk-GVQU2GXP-CiyvoRIy.js} +1 -1
  14. package/out/phone/assets/{chunk-IMKFNOWR-DT26rqUA.js → chunk-IMKFNOWR-vOQaK90i.js} +1 -1
  15. package/out/phone/assets/{chunk-L3NEJ4N5-CvadXD9U.js → chunk-L3NEJ4N5-CPykFzBy.js} +1 -1
  16. package/out/phone/assets/{chunk-OSK3NFVY-DROHZT6z.js → chunk-OSK3NFVY-q4NiGH59.js} +1 -1
  17. package/out/phone/assets/{chunk-P2QGCYS3-BcsvTFQT.js → chunk-P2QGCYS3-DUV9S_qP.js} +1 -1
  18. package/out/phone/assets/{chunk-POPQ4Y6H-Bib7YUpn.js → chunk-POPQ4Y6H-CjycswNE.js} +1 -1
  19. package/out/phone/assets/{chunk-PWAF6VOD-CrsdfQvi.js → chunk-PWAF6VOD-Dben6plA.js} +1 -1
  20. package/out/phone/assets/{chunk-SHT3W25Y-BSSsjkbn.js → chunk-SHT3W25Y-D2hK_jmb.js} +1 -1
  21. package/out/phone/assets/{chunk-SVP7TREG-BorYBfcS.js → chunk-SVP7TREG-DLtgLN89.js} +1 -1
  22. package/out/phone/assets/{chunk-TICWLB2K-DwWprz_z.js → chunk-TICWLB2K-BeBB0_0w.js} +1 -1
  23. package/out/phone/assets/classDiagram-ZZMXUADV-rwnxFDXp.js +1 -0
  24. package/out/phone/assets/classDiagram-v2-VYDZK3BY-rwnxFDXp.js +1 -0
  25. package/out/phone/assets/{cynefin-OW5HDTMX-UxW1ctBn.js → cynefin-OW5HDTMX-CsDdLZPP.js} +1 -1
  26. package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-3xyjt_Zk.js → cynefinDiagram-5FMLGOSQ-BcaPty-s.js} +1 -1
  27. package/out/phone/assets/{dagre-GXQ25YYZ-BA8g5sNo.js → dagre-GXQ25YYZ-o7dqm5ri.js} +1 -1
  28. package/out/phone/assets/desk-DNf6lCoq.js +2 -0
  29. package/out/phone/assets/{diagram-S7CK7UJ4-CqaAk0xY.js → diagram-S7CK7UJ4-B5m8q3yP.js} +1 -1
  30. package/out/phone/assets/{diagram-UQ7AKVKN-BJs2alr_.js → diagram-UQ7AKVKN-_lP617OW.js} +1 -1
  31. package/out/phone/assets/{diagram-VSXAHHWV-goFBlClH.js → diagram-VSXAHHWV-D16twHR0.js} +1 -1
  32. package/out/phone/assets/{diagram-VX7I27RA-NC_soOMz.js → diagram-VX7I27RA-BT8YSil1.js} +1 -1
  33. package/out/phone/assets/{diagram-Z3DM3KII-CPBmdhd-.js → diagram-Z3DM3KII-CiSuhrxd.js} +1 -1
  34. package/out/phone/assets/{ebnfDiagram-PWID7BFC-e_KXtWp1.js → ebnfDiagram-PWID7BFC-BbCXn4HA.js} +1 -1
  35. package/out/phone/assets/{erDiagram-RLTQ6QDP-BV3oU6Yk.js → erDiagram-RLTQ6QDP-5-xE_bP2.js} +1 -1
  36. package/out/phone/assets/eventmodeling-NTZA5JFV-BVS2RGt-.js +1 -0
  37. package/out/phone/assets/flowDiagram-HODETNUW-BSlxj9Uk.js +1 -0
  38. package/out/phone/assets/{ganttDiagram-EL5Y4UJY-DOtr1Ilh.js → ganttDiagram-EL5Y4UJY-Rqgggqg_.js} +1 -1
  39. package/out/phone/assets/{gitGraph-4MIJSDKK-D0CbVtzh.js → gitGraph-4MIJSDKK-Drt18ZKK.js} +1 -1
  40. package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-C6wXAX8a.js → gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js} +1 -1
  41. package/out/phone/assets/{info-A6RAGUB7-BLbppMXJ.js → info-A6RAGUB7-CpPeSHE0.js} +1 -1
  42. package/out/phone/assets/{infoDiagram-27XIBGKW-DOlhaNYG.js → infoDiagram-27XIBGKW-D3d9S0Y6.js} +1 -1
  43. package/out/phone/assets/{ishikawaDiagram-5VMMS53U-BtaSUSnr.js → ishikawaDiagram-5VMMS53U-plFMqx62.js} +1 -1
  44. package/out/phone/assets/{journeyDiagram-3NMN7TZE-C6DElK_Y.js → journeyDiagram-3NMN7TZE-CX-n-XXx.js} +1 -1
  45. package/out/phone/assets/{kanban-definition-UXKFOSKX-WqCAwlkm.js → kanban-definition-UXKFOSKX-DrdTzKIc.js} +1 -1
  46. package/out/phone/assets/{line-CvY1fizC.js → line-CqyaArNm.js} +1 -1
  47. package/out/phone/assets/main-BGlFv7yA.js +1658 -0
  48. package/out/phone/assets/main-BS1SSCau.css +1 -0
  49. package/out/phone/assets/{mermaid-parser.core-BNyl33x8.js → mermaid-parser.core-CERMa6fg.js} +3 -3
  50. package/out/phone/assets/{mermaid.core-BnUF0ZCX.js → mermaid.core-CbGP2wFn.js} +4 -4
  51. package/out/phone/assets/{mindmap-definition-YA3MSWOX-CsORTLIm.js → mindmap-definition-YA3MSWOX-BxaIrov6.js} +1 -1
  52. package/out/phone/assets/{packet-AYTQ26CC-CoxwVVdp.js → packet-AYTQ26CC-DguFQxPm.js} +1 -1
  53. package/out/phone/assets/{pegDiagram-XKGWAZYB-BI2W6aLH.js → pegDiagram-XKGWAZYB-t3td03dz.js} +1 -1
  54. package/out/phone/assets/{pie-WAS4IAKB-CQD3JNcj.js → pie-WAS4IAKB-DoFu2rhu.js} +1 -1
  55. package/out/phone/assets/{pieDiagram-E7YTZNPT-aLnzVgco.js → pieDiagram-E7YTZNPT-DctHLSL8.js} +1 -1
  56. package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Cbl0x-Id.js → quadrantDiagram-AXDQQJYC-Br7-ImNr.js} +1 -1
  57. package/out/phone/assets/{radar-RG4KPBEZ-Bu2EN1RM.js → radar-RG4KPBEZ-BDjTOHD8.js} +1 -1
  58. package/out/phone/assets/{railroad-74A4TZTK-DiiOMWSM.js → railroad-74A4TZTK-v8vsrpxb.js} +1 -1
  59. package/out/phone/assets/railroad-abnf-HS5TGJTU-CUELjEtC.js +1 -0
  60. package/out/phone/assets/railroad-ebnf-LZEXJU2U-DdIokM4i.js +1 -0
  61. package/out/phone/assets/railroad-peg-WCYAUIDC-DYyy0B-_.js +1 -0
  62. package/out/phone/assets/{railroadDiagram-O6MQD6OU-r5JJp9nP.js → railroadDiagram-O6MQD6OU-DtH4qQrr.js} +1 -1
  63. package/out/phone/assets/{requirementDiagram-BXWQKSXE-Bh86zb_w.js → requirementDiagram-BXWQKSXE-BSqejjZP.js} +1 -1
  64. package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CykRlthT.js → sankeyDiagram-P5KCCOFB-DsTWuNtL.js} +1 -1
  65. package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BPLcD6MF.js → sequenceDiagram-WJ2MYXX4-zLMvPyPC.js} +1 -1
  66. package/out/phone/assets/{stateDiagram-D77RDMKH-DWXApcUM.js → stateDiagram-D77RDMKH-DrBC05BN.js} +1 -1
  67. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-DT7BlwvF.js +1 -0
  68. package/out/phone/assets/storage-BeJvYXAx.js +36 -0
  69. package/out/phone/assets/{swimlanes-42K2YHIH-BVi6IPTq.js → swimlanes-42K2YHIH-B27-qSm5.js} +1 -1
  70. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CWnm4v0A.js +8 -0
  71. package/out/phone/assets/{timeline-definition-24CTP7MA-xf--BXjO.js → timeline-definition-24CTP7MA-8NDkGf5U.js} +1 -1
  72. package/out/phone/assets/{treeView-Q6P3EWNA-DzJs7PRI.js → treeView-Q6P3EWNA-B9BXwCDC.js} +1 -1
  73. package/out/phone/assets/{treemap-WGGIJYW6-AXb7EeRP.js → treemap-WGGIJYW6-B0IqbwdT.js} +1 -1
  74. package/out/phone/assets/{vennDiagram-4TSXK5OY-CXDX5KG5.js → vennDiagram-4TSXK5OY-Dp-aKgNa.js} +1 -1
  75. package/out/phone/assets/{wardley-WFR3VGLG-DrSIz3RL.js → wardley-WFR3VGLG-B7FlADZf.js} +1 -1
  76. package/out/phone/assets/{wardleyDiagram-VM6X3IG4-DFL8ndUf.js → wardleyDiagram-VM6X3IG4-BVntjQNl.js} +1 -1
  77. package/out/phone/assets/{xychartDiagram-S5SC5T6Z-CZZX0maW.js → xychartDiagram-S5SC5T6Z-kgVJvkgO.js} +1 -1
  78. package/out/phone/desk.html +2 -2
  79. package/out/phone/index.html +3 -3
  80. package/out/renderer/assets/{abnfDiagram-VCTEODGH-C03tURh9.js → abnfDiagram-VCTEODGH-Bp0r3dKm.js} +1 -1
  81. package/out/renderer/assets/{arc-B9ePZBoh.js → arc-BD5HnhIt.js} +1 -1
  82. package/out/renderer/assets/{architectureDiagram-5GKGNRK7-xqG-LPqx.js → architectureDiagram-5GKGNRK7-CgJHjETB.js} +1 -1
  83. package/out/renderer/assets/{blockDiagram-I7D4REHJ-BJCB1uWW.js → blockDiagram-I7D4REHJ-5le9vk4G.js} +1 -1
  84. package/out/renderer/assets/{c4Diagram-7LVT6UL2-B8YiLE3O.js → c4Diagram-7LVT6UL2-B4DCe-qN.js} +1 -1
  85. package/out/renderer/assets/channel-D-HltTAP.js +1 -0
  86. package/out/renderer/assets/{chunk-2Q5K7J3B-BfCgzuF1.js → chunk-2Q5K7J3B-DIxWfJHE.js} +1 -1
  87. package/out/renderer/assets/{chunk-5VM5RSS4-j2RDggaS.js → chunk-5VM5RSS4-D9j4om1l.js} +1 -1
  88. package/out/renderer/assets/{chunk-F27PBJKO-D1w1G98C.js → chunk-F27PBJKO-B_tGbKyc.js} +1 -1
  89. package/out/renderer/assets/{chunk-IMKFNOWR-HX7TqjEn.js → chunk-IMKFNOWR-Cfffd1p9.js} +1 -1
  90. package/out/renderer/assets/{chunk-JWPE2WC7-Ee_2ucfe.js → chunk-JWPE2WC7-BABZOPGb.js} +1 -1
  91. package/out/renderer/assets/{chunk-POPQ4Y6H-DuxBT9GV.js → chunk-POPQ4Y6H-D-QyVpSn.js} +1 -1
  92. package/out/renderer/assets/{chunk-SVP7TREG-DFjkSsO8.js → chunk-SVP7TREG-BghyPSd6.js} +1 -1
  93. package/out/renderer/assets/{chunk-TICWLB2K-1B31w-4D.js → chunk-TICWLB2K-CQmthy6z.js} +1 -1
  94. package/out/renderer/assets/{chunk-XXDRQBXY-DZ7nGbEc.js → chunk-XXDRQBXY-CDKsbyR7.js} +1 -1
  95. package/out/renderer/assets/classDiagram-ZZMXUADV-BCWhgMul.js +1 -0
  96. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BCWhgMul.js +1 -0
  97. package/out/renderer/assets/{cose-bilkent-JH36ORCC-k2aKhVw_.js → cose-bilkent-JH36ORCC-oajViFnN.js} +1 -1
  98. package/out/renderer/assets/{cynefin-OW5HDTMX-xPUo1qjT.js → cynefin-OW5HDTMX-DMH1CUmI.js} +1 -1
  99. package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-KbWg9eRv.js → cynefinDiagram-5FMLGOSQ-DVUJf9t0.js} +1 -1
  100. package/out/renderer/assets/{cytoscape-fcose-CLBXU3_O.js → cytoscape-fcose-adTZ191M.js} +1 -1
  101. package/out/renderer/assets/{dagre-GXQ25YYZ-ilq61to2.js → dagre-GXQ25YYZ-BXRWWNje.js} +1 -1
  102. package/out/renderer/assets/{diagram-S7CK7UJ4-DsRzYvTT.js → diagram-S7CK7UJ4-Dg7f2Dan.js} +1 -1
  103. package/out/renderer/assets/{diagram-UQ7AKVKN-nE6Ly2i6.js → diagram-UQ7AKVKN-DsLRyZAt.js} +1 -1
  104. package/out/renderer/assets/{diagram-VSXAHHWV-B9Crbma_.js → diagram-VSXAHHWV-3_LoodSS.js} +1 -1
  105. package/out/renderer/assets/{diagram-VX7I27RA-Bm5JhnFh.js → diagram-VX7I27RA-DQeZp2Cz.js} +1 -1
  106. package/out/renderer/assets/{diagram-Z3DM3KII-ZD7ANoYg.js → diagram-Z3DM3KII-Dwil6g5m.js} +1 -1
  107. package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CT3pW9tk.js → ebnfDiagram-PWID7BFC-DecVNxpu.js} +1 -1
  108. package/out/renderer/assets/{erDiagram-RLTQ6QDP-D0ikskdu.js → erDiagram-RLTQ6QDP-D2rmo2nP.js} +1 -1
  109. package/out/renderer/assets/{flowDiagram-HODETNUW-BOF_JMXY.js → flowDiagram-HODETNUW-_SF2dRBl.js} +1 -1
  110. package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BCEnP39-.js → ganttDiagram-EL5Y4UJY-BoYWs5Ev.js} +1 -1
  111. package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-WpPHHkc3.js → gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js} +1 -1
  112. package/out/renderer/assets/globals-BEwCf508.css +1 -0
  113. package/out/renderer/assets/{globals-DWAN16wT.js → globals-C3zxoqqH.js} +223 -223
  114. package/out/renderer/assets/index-9vqh4wxi.js +133 -0
  115. package/out/renderer/assets/{infoDiagram-27XIBGKW-nRW-sje9.js → infoDiagram-27XIBGKW-CFt6xyuD.js} +1 -1
  116. package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CEfZo_k8.js → ishikawaDiagram-5VMMS53U-CZB8G4dD.js} +1 -1
  117. package/out/renderer/assets/{journeyDiagram-3NMN7TZE-C5hopb9Y.js → journeyDiagram-3NMN7TZE-CO2VRmpx.js} +1 -1
  118. package/out/renderer/assets/{kanban-definition-UXKFOSKX-D9XV2n-x.js → kanban-definition-UXKFOSKX-DIqEnfMM.js} +1 -1
  119. package/out/renderer/assets/{layout-t2tiRL7x.js → layout-DXRKfO_Y.js} +1 -1
  120. package/out/renderer/assets/{linear-DJLwPmUz.js → linear-Cdx1AdZJ.js} +1 -1
  121. package/out/renderer/assets/{mermaid.core-C0XHWibr.js → mermaid.core-DuIO2jsm.js} +5 -5
  122. package/out/renderer/assets/{mindmap-definition-YA3MSWOX-DD-erShR.js → mindmap-definition-YA3MSWOX-B5lvxG2M.js} +1 -1
  123. package/out/renderer/assets/{pegDiagram-XKGWAZYB-DZ0Jk0gq.js → pegDiagram-XKGWAZYB-DCwHp-K3.js} +1 -1
  124. package/out/renderer/assets/{pieDiagram-E7YTZNPT-E7wG7xIV.js → pieDiagram-E7YTZNPT-Dq048Wh7.js} +1 -1
  125. package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-iyjmw417.js → quadrantDiagram-AXDQQJYC-DwkFkAi_.js} +1 -1
  126. package/out/renderer/assets/{railroadDiagram-O6MQD6OU-vCkzrMpv.js → railroadDiagram-O6MQD6OU-2NKvwLP-.js} +1 -1
  127. package/out/renderer/assets/{requirementDiagram-BXWQKSXE-DJ7nU4ps.js → requirementDiagram-BXWQKSXE-Bp44tNQ0.js} +1 -1
  128. package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-1TKFsYjQ.js → sankeyDiagram-P5KCCOFB-C3TFp1NK.js} +1 -1
  129. package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-C3ajyWo7.js → sequenceDiagram-WJ2MYXX4-BTPoYQeW.js} +1 -1
  130. package/out/renderer/assets/settings-DlDHkOe2.js +25 -0
  131. package/out/renderer/assets/{sizeCapture-INFHLROL-BKripAfM.js → sizeCapture-INFHLROL-DvNj5TDT.js} +1 -1
  132. package/out/renderer/assets/{stateDiagram-D77RDMKH-DSqc4avN.js → stateDiagram-D77RDMKH-DC8YykNp.js} +1 -1
  133. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +1 -0
  134. package/out/renderer/assets/{swimlanes-42K2YHIH-C2Jeg683.js → swimlanes-42K2YHIH-0yL1nNkg.js} +1 -1
  135. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +8 -0
  136. package/out/renderer/assets/{timeline-definition-24CTP7MA-rvOKRLqz.js → timeline-definition-24CTP7MA-Pg-2roGv.js} +1 -1
  137. package/out/renderer/assets/{vennDiagram-4TSXK5OY-Cig1eOav.js → vennDiagram-4TSXK5OY-D0af5K4E.js} +1 -1
  138. package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-C8spX5XL.js → wardleyDiagram-VM6X3IG4-CB_nIy_l.js} +1 -1
  139. package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DHQsGiFY.js → xychartDiagram-S5SC5T6Z-A26Yld8R.js} +1 -1
  140. package/out/renderer/index.html +3 -3
  141. package/out/renderer/settings.html +4 -4
  142. package/out/renderer/web-preload.js +39 -39
  143. package/out/server/agent.js +276 -506
  144. package/out/server/chunks/{agent-BbLTL3oo.js → agent-D33nI7fP.js} +176 -195
  145. package/out/server/chunks/dispatchModel-CsfmL396.js +20 -0
  146. package/out/server/chunks/gpuBackendInstall-CRzfB150.js +237 -0
  147. package/out/server/chunks/{loadProvider-ff0h4G9y.js → loadProvider-4Y15KP7W.js} +2 -2
  148. package/out/server/chunks/{manifest-DjsZzZuh.js → manifest-wlfh-NN5.js} +2 -2
  149. package/out/server/chunks/{resources-DmaKIeBc.js → resources-DzUshg1j.js} +3 -3
  150. package/out/server/chunks/{storageScanWorker-BQ1LXUu7.js → storageScanWorker-CX8O_DlF.js} +2 -2
  151. package/out/server/chunks/{storageScanWorker-Bebego8l.js → storageScanWorker-CuttDIGS.js} +2 -2
  152. package/out/server/chunks/{workflowPresets-XbQNDJh1.js → workflowPresets-CAA0AY6f.js} +1091 -287
  153. package/out/server/index.js +2376 -3358
  154. package/out/server/plugin-host.js +2 -2
  155. package/package.json +2 -3
  156. package/out/phone/assets/architecture-7GRP2DOG-C-qor9pl.js +0 -1
  157. package/out/phone/assets/channel-X_IbcoWa.js +0 -1
  158. package/out/phone/assets/classDiagram-ZZMXUADV-BM8gYXGQ.js +0 -1
  159. package/out/phone/assets/classDiagram-v2-VYDZK3BY-BM8gYXGQ.js +0 -1
  160. package/out/phone/assets/desk-BNoyCelL.js +0 -2
  161. package/out/phone/assets/eventmodeling-NTZA5JFV-BdEBApKV.js +0 -1
  162. package/out/phone/assets/flowDiagram-HODETNUW-OPg41_ia.js +0 -1
  163. package/out/phone/assets/main-BU1pbfVw.css +0 -1
  164. package/out/phone/assets/main-ZLMPRLjZ.js +0 -1658
  165. package/out/phone/assets/railroad-abnf-HS5TGJTU-BoQXwOPL.js +0 -1
  166. package/out/phone/assets/railroad-ebnf-LZEXJU2U-1G126duh.js +0 -1
  167. package/out/phone/assets/railroad-peg-WCYAUIDC-C7pIuHge.js +0 -1
  168. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-BMZswIYt.js +0 -1
  169. package/out/phone/assets/storage-dUWOZ2xo.js +0 -36
  170. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-RYt3eASc.js +0 -8
  171. package/out/renderer/assets/channel-DwCSANyp.js +0 -1
  172. package/out/renderer/assets/classDiagram-ZZMXUADV-BT-9dtRl.js +0 -1
  173. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BT-9dtRl.js +0 -1
  174. package/out/renderer/assets/globals-DoPyZAQo.css +0 -1
  175. package/out/renderer/assets/index-DOUivox4.js +0 -133
  176. package/out/renderer/assets/settings-BmMFkVO5.js +0 -27
  177. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-JOz8ISDT.js +0 -1
  178. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-Km8IGI0J.js +0 -8
  179. package/out/server/chunks/engine-IZbRceya.js +0 -70
  180. package/out/server/chunks/engineWorker-CQxNRdLD.js +0 -6
  181. package/out/server/chunks/engineWorker-CrUIcXCt.js +0 -73
  182. package/out/server/chunks/gpuBackendInstall-COO4pT2M.js +0 -158
  183. package/out/server/chunks/hanbao-_aDjow_f.js +0 -187
  184. package/out/server/chunks/speech-CqK6_tIR.js +0 -25
  185. package/out/server/chunks/wetype-CR0YLhHP.js +0 -677
@@ -1,15 +1,15 @@
1
- import { T as THINKING_LEVELS$1, a8 as APPROVAL_MODES, g as MODEL_REASONING_OVERRIDES, h as MODEL_THINKING_LEVEL_OVERRIDES, Z as splitPlanPrefix, bE as DEFAULT_BASE_URLS, a0 as isClassifierOnlyProvider, bJ as PROJECTED_FILE_TEXT_LIMIT, by as SHELL_LIMITS, bK as imageGenerationPreviewPaths, bL as parseGeneratedImagePaths, bM as parseMaskReport, P as PLUGIN_MESSAGE_TYPE, bN as parsePluginMessageSource, bO as parseRtkToolStats, bP as isBackgroundTaskId, bQ as parseShellFailure, as as parsePluginToolName, bR as pluginArtifactsFromToolDetails, bS as parseApprovalReviewRecord, bT as PROJECTED_FILE_CHANGE_LIMIT, bU as PROJECTED_APPLY_PATCH_PATH_TEXT_LIMIT, bV as PROJECTED_APPLY_PATCH_PATH_COUNT_LIMIT, a5 as PRIVACY_MASK_ENTRY, aF as parsePrivacyMaskRecord, a4 as mergeMaskReports, bW as foldPlanState, bX as PLAN_MODE_ON_NOTE, bY as PLAN_MODE_OFF_NOTE, bZ as planFeedbackText, b_ as planKickoffText, b$ as activePlanNote, c0 as PLAN_TITLE_MAX, c1 as PLAN_TEXT_MAX, c2 as planPhase, L as PLAN_ENTRY_TYPE, c3 as parsePlanEntry, aY as AGENT_WAIT_DEFAULT_MS, aZ as AGENT_WAIT_MAX_MS, c4 as parseAgentControlToolRequest, c5 as nativeSearchKindFor, c6 as isWorkflowPresetId } from "./agent-BbLTL3oo.js";
2
- import fs, { statSync, writeFileSync, appendFileSync, existsSync, readFileSync, mkdirSync, realpathSync, constants, lstatSync, createWriteStream, renameSync, readdirSync } from "node:fs";
1
+ import fs, { existsSync, renameSync, readFileSync, writeFileSync, statSync, appendFileSync, mkdirSync, realpathSync, constants, lstatSync, readdirSync, openSync, closeSync, rmSync, readSync, truncateSync, createWriteStream } from "node:fs";
2
+ import { T as THINKING_LEVELS$1, a8 as APPROVAL_MODES, g as MODEL_REASONING_OVERRIDES, h as MODEL_THINKING_LEVEL_OVERRIDES, Z as splitPlanPrefix, bD as DEFAULT_BASE_URLS, a0 as isClassifierOnlyProvider, bI as PROJECTED_FILE_TEXT_LIMIT, bx as SHELL_LIMITS, bJ as imageGenerationPreviewPaths, bK as parseGeneratedImagePaths, bL as parseMaskReport, P as PLUGIN_MESSAGE_TYPE, bM as parsePluginMessageSource, bN as parseRtkToolStats, bO as isBackgroundTaskId, bP as parseShellFailure, aq as parsePluginToolName, bQ as pluginArtifactsFromToolDetails, bR as parseApprovalReviewRecord, bS as PROJECTED_FILE_CHANGE_LIMIT, bT as PROJECTED_APPLY_PATCH_PATH_TEXT_LIMIT, bU as PROJECTED_APPLY_PATCH_PATH_COUNT_LIMIT, a5 as PRIVACY_MASK_ENTRY, aD as parsePrivacyMaskRecord, a4 as mergeMaskReports, bV as foldPlanState, bW as PLAN_MODE_ON_NOTE, bX as PLAN_MODE_OFF_NOTE, bY as planFeedbackText, bZ as planKickoffText, b_ as activePlanNote, b$ as PLAN_TITLE_MAX, c0 as PLAN_TEXT_MAX, c1 as planPhase, L as PLAN_ENTRY_TYPE, c2 as parsePlanEntry, aW as AGENT_WAIT_DEFAULT_MS, aX as AGENT_WAIT_MAX_MS, c3 as parseAgentControlToolRequest, b0 as TURN_REPORT_MAX_CHARS, c4 as nativeSearchKindFor, c5 as isWorkflowPresetId } from "./agent-D33nI7fP.js";
3
3
  import { readFile, writeFile, rename, rm, unlink, open, lstat, chmod, realpath, access, mkdir } from "node:fs/promises";
4
- import os, { homedir } from "node:os";
4
+ import os, { constants as constants$1, homedir } from "node:os";
5
5
  import path, { join, dirname } from "node:path";
6
6
  import crypto, { randomBytes, createHash, randomUUID } from "node:crypto";
7
7
  import { gzipSync, gunzipSync } from "node:zlib";
8
8
  import * as PiAi from "@earendil-works/pi-ai";
9
9
  import { getCurrentSystemPrompt, getCurrentTools, clampThinkingLevel } from "@earendil-works/pi-ai";
10
- import { withFileMutationQueue, getPowerShellConfig, createCodemodeExtension, createToolSearchExtension, sessionEntryToContextMessages, SettingsManager } from "@earendil-works/pi-coding-agent";
10
+ import { withFileMutationQueue, getShellConfig, getPowerShellConfig, createCodemodeExtension, createToolSearchExtension, sessionEntryToContextMessages, SettingsManager } from "@earendil-works/pi-coding-agent";
11
11
  import { parse, stringify } from "yaml";
12
- import { spawn } from "node:child_process";
12
+ import { spawn, execFileSync } from "node:child_process";
13
13
  import { StringDecoder } from "node:string_decoder";
14
14
  import { stripVTControlCharacters } from "node:util";
15
15
  import { fileURLToPath } from "node:url";
@@ -22,6 +22,57 @@ import TurndownService from "turndown";
22
22
  import { ProxyAgent, fetch as fetch$1, Agent } from "undici";
23
23
  import { transformMessages } from "@earendil-works/pi-ai/api/transform-messages";
24
24
  import http from "node:http";
25
+ const RESTART_CHECKPOINT_FILE = "restart-checkpoint.json";
26
+ const RESTART_CHECKPOINT_ARCHIVE = "restart-checkpoint.consumed.json";
27
+ const RESTART_CHECKPOINT_ENV = "ENSO_AGENT_RESTART_CHECKPOINT";
28
+ function restartGate(input) {
29
+ if (input.toolsInFlight.length > 0) return { ready: false, reason: "tool-in-flight" };
30
+ if (input.atModelRequestBoundary) return { ready: true, nextStep: "model-request" };
31
+ if (input.turnActive) return { ready: false, reason: "turn-in-progress" };
32
+ return { ready: true, nextStep: "await-user" };
33
+ }
34
+ const isString = (value) => typeof value === "string";
35
+ const isNonEmpty = (value) => isString(value) && value.length > 0;
36
+ const isCount = (value) => Number.isInteger(value) && value >= 0;
37
+ const ENTRY_KEYS = [
38
+ "sessionId",
39
+ "generation",
40
+ "sessionFile",
41
+ "seq",
42
+ "nextStep",
43
+ "turnId",
44
+ "lastCompletedToolCallId",
45
+ "messageCount",
46
+ "toolsInFlight"
47
+ ];
48
+ function parseEntry$1(value) {
49
+ if (typeof value !== "object" || value === null) return null;
50
+ const entry = value;
51
+ const keys = Object.keys(entry);
52
+ if (keys.length !== ENTRY_KEYS.length || !ENTRY_KEYS.every((key) => key in entry)) return null;
53
+ return isNonEmpty(entry.sessionId) && isNonEmpty(entry.generation) && isNonEmpty(entry.sessionFile) && isCount(entry.seq) && (entry.nextStep === "model-request" || entry.nextStep === "await-user") && (entry.turnId === null || isNonEmpty(entry.turnId)) && (entry.lastCompletedToolCallId === null || isNonEmpty(entry.lastCompletedToolCallId)) && isCount(entry.messageCount) && Array.isArray(entry.toolsInFlight) && entry.toolsInFlight.every(isNonEmpty) ? entry : null;
54
+ }
55
+ function parseRestartCheckpoint(value) {
56
+ if (typeof value !== "object" || value === null) return null;
57
+ const record = value;
58
+ if (record.version !== 1 || !isCount(record.pid) || !isCount(record.writtenAt)) return null;
59
+ if (!Array.isArray(record.sessions)) return null;
60
+ const sessions = record.sessions.map(parseEntry$1);
61
+ return sessions.every((entry) => entry !== null) ? record : null;
62
+ }
63
+ function writeRestartCheckpoint(file, checkpoint) {
64
+ writeFileSync(`${file}.tmp`, JSON.stringify(checkpoint));
65
+ renameSync(`${file}.tmp`, file);
66
+ }
67
+ function takeRestartCheckpoint(file, archive) {
68
+ if (!existsSync(file)) return null;
69
+ renameSync(file, archive);
70
+ try {
71
+ return parseRestartCheckpoint(JSON.parse(readFileSync(archive, "utf8")));
72
+ } catch {
73
+ return null;
74
+ }
75
+ }
25
76
  const OAUTH_LABEL_MAX_LENGTH = 32;
26
77
  function sanitizeOauthLabel(value) {
27
78
  let out = "";
@@ -995,7 +1046,7 @@ function parseAntigravityApiKey(apiKeyRaw) {
995
1046
  };
996
1047
  }
997
1048
  const UPSTREAM_BODY_LIMIT = 2e3;
998
- const SECRET_PATTERNS = [
1049
+ const SECRET_PATTERNS$1 = [
999
1050
  [/\b(Bearer|Basic)\s+[\w\-._~+/]+=*/gi, "$1 [已脱敏]"],
1000
1051
  [
1001
1052
  /"(access_token|refresh_token|id_token|client_secret|authorization|api_key|apikey)"\s*:\s*"[^"]*"/gi,
@@ -1014,7 +1065,7 @@ function sanitizeUpstreamBody(text2) {
1014
1065
  }
1015
1066
  function redactUpstreamBody(text2) {
1016
1067
  let safe = text2;
1017
- for (const [pattern, replacement] of SECRET_PATTERNS) safe = safe.replace(pattern, replacement);
1068
+ for (const [pattern, replacement] of SECRET_PATTERNS$1) safe = safe.replace(pattern, replacement);
1018
1069
  return safe.replace(/\s+/g, " ").trim();
1019
1070
  }
1020
1071
  async function fetchWithTimeout(url, init, signal, timeoutMs = REQUEST_TIMEOUT_MS) {
@@ -6804,12 +6855,12 @@ function qoderProviderConfig(mode = "global") {
6804
6855
  }
6805
6856
  };
6806
6857
  }
6807
- function shellQuote(value) {
6858
+ function shellQuote$1(value) {
6808
6859
  return `'${value.replaceAll("'", `'\\''`)}'`;
6809
6860
  }
6810
6861
  function buildRemoteCommand(command, options = {}) {
6811
- const body = Array.isArray(command) ? command.map(shellQuote).join(" ") : `bash -lc ${shellQuote(command)}`;
6812
- return options.cwd ? `cd ${shellQuote(options.cwd)} && ${body}` : body;
6862
+ const body = Array.isArray(command) ? command.map(shellQuote$1).join(" ") : `bash -lc ${shellQuote$1(command)}`;
6863
+ return options.cwd ? `cd ${shellQuote$1(options.cwd)} && ${body}` : body;
6813
6864
  }
6814
6865
  function resolveSshTarget(conn) {
6815
6866
  return conn.user ? `${conn.user}@${conn.host}` : conn.host;
@@ -6817,11 +6868,11 @@ function resolveSshTarget(conn) {
6817
6868
  function buildSshShellCommand(host, script, options = {}) {
6818
6869
  const remoteCommand = buildRemoteCommand(script, { cwd: options.cwd });
6819
6870
  const args = buildSshExecArgs(host, remoteCommand, options);
6820
- return `ssh ${args.map(shellQuote).join(" ")}`;
6871
+ return `ssh ${args.map(shellQuote$1).join(" ")}`;
6821
6872
  }
6822
6873
  function buildSshPtyRemoteCommand(cwd) {
6823
6874
  const shell = 'exec "${SHELL:-/bin/bash}" -l';
6824
- return cwd ? `cd ${shellQuote(cwd)} && ${shell}` : shell;
6875
+ return cwd ? `cd ${shellQuote$1(cwd)} && ${shell}` : shell;
6825
6876
  }
6826
6877
  function buildSshPtyArgs(host, options = {}) {
6827
6878
  return ["-tt", ...buildSshExecArgs(host, buildSshPtyRemoteCommand(options.cwd), options)];
@@ -9373,6 +9424,548 @@ function createAskTool(manager) {
9373
9424
  const SHELL_READ_HINT = "Shell read-only shortcut: prefer read (offset/limit) for files, grep for content, find for paths — the dedicated tools handle line ranges and stream far less output.";
9374
9425
  const SHELL_SLEEP_HINT = "Sleep-waiting in a foreground command costs a model round per check. Put the whole wait in one command that exits when the condition holds (e.g. `until <check>; do sleep 10; done; <report>`) and run it with background: true — you are notified when it finishes, then end your turn.";
9375
9426
  const SHELL_TIMEOUT_HINT = "timeout only kills the process; it does not keep this call in the foreground. If the command may outlast the yield, set background: true and end your turn — completion wakes you. Do not poll with sleep, ps, pgrep, or task_output loops.";
9427
+ const SECRET_PATTERNS = [
9428
+ /\bBearer\s+[A-Za-z0-9._~+/-]+=*/gi,
9429
+ /\b(?:api[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)\s*[:=]\s*[^\s,;]+/gi,
9430
+ /https?:\/\/[^\s/@:]+:[^\s/@]+@/gi,
9431
+ /\b(?:sk|ghp|xox[baprs])-[-A-Za-z0-9_]{12,}\b/g
9432
+ ];
9433
+ function redactSafeText(text2) {
9434
+ return SECRET_PATTERNS.reduce(
9435
+ (value, pattern) => value.replace(pattern, "[REDACTED]"),
9436
+ text2
9437
+ ).slice(0, 1e5);
9438
+ }
9439
+ class EnsoSafeJournal {
9440
+ sessionFile;
9441
+ constructor(sessionDir, child, cwd, resumeFile) {
9442
+ mkdirSync(sessionDir, { recursive: true });
9443
+ this.sessionFile = resumeFile ?? path.join(
9444
+ sessionDir,
9445
+ `enso-${child.sessionId.replace(/[^A-Za-z0-9._-]/g, "_")}-${child.generation}.jsonl`
9446
+ );
9447
+ if (!resumeFile) {
9448
+ const header = {
9449
+ type: "enso-safe-session",
9450
+ version: 1,
9451
+ child,
9452
+ cwd,
9453
+ createdAt: Date.now()
9454
+ };
9455
+ writeFileSync(this.sessionFile, `${JSON.stringify(header)}
9456
+ `, {
9457
+ encoding: "utf8",
9458
+ mode: 384,
9459
+ flag: "wx"
9460
+ });
9461
+ }
9462
+ }
9463
+ append(record) {
9464
+ appendFileSync(this.sessionFile, `${JSON.stringify(this.sanitize(record))}
9465
+ `, "utf8");
9466
+ }
9467
+ appendUserText(text2) {
9468
+ this.append({ type: "safe-user-text", text: redactSafeText(text2), at: Date.now() });
9469
+ }
9470
+ appendAssistantText(text2) {
9471
+ this.append({ type: "safe-assistant-text", text: redactSafeText(text2), at: Date.now() });
9472
+ }
9473
+ appendCapabilityResult(toolCallId, envelope) {
9474
+ this.append({
9475
+ type: "safe-model-result",
9476
+ toolCallId,
9477
+ modelResult: envelope.modelResult,
9478
+ at: Date.now()
9479
+ });
9480
+ this.append({ type: "capability-receipt", receipt: envelope.receipt, at: Date.now() });
9481
+ }
9482
+ static async restore(sessionFile) {
9483
+ const records2 = [];
9484
+ let partial = false;
9485
+ let lines;
9486
+ try {
9487
+ lines = (await readFile(sessionFile, "utf8")).split("\n").filter(Boolean);
9488
+ } catch {
9489
+ return { records: records2, partial: true };
9490
+ }
9491
+ for (let index = 0; index < lines.length; index += 1) {
9492
+ try {
9493
+ const value = JSON.parse(lines[index]);
9494
+ if (index === 0 && value.type === "enso-safe-session" && value.version === 1) continue;
9495
+ const parsed = parseRecord(value);
9496
+ if (parsed) records2.push(parsed);
9497
+ else partial = true;
9498
+ } catch {
9499
+ partial = true;
9500
+ }
9501
+ }
9502
+ return { records: records2, partial };
9503
+ }
9504
+ sanitize(record) {
9505
+ if (record.type === "safe-user-text" || record.type === "safe-assistant-text") {
9506
+ return { ...record, text: redactSafeText(record.text) };
9507
+ }
9508
+ return record;
9509
+ }
9510
+ }
9511
+ function parseRecord(value) {
9512
+ if ((value.type === "safe-user-text" || value.type === "safe-assistant-text") && typeof value.text === "string" && typeof value.at === "number") {
9513
+ return value;
9514
+ }
9515
+ if (value.type === "enso-operation" && typeof value.operationId === "string" && typeof value.capabilityId === "string" && typeof value.toolCallId === "string" && typeof value.at === "number") {
9516
+ return value;
9517
+ }
9518
+ if (value.type === "safe-model-result" && typeof value.toolCallId === "string" && value.modelResult && typeof value.modelResult === "object" && typeof value.at === "number") {
9519
+ return value;
9520
+ }
9521
+ if (value.type === "capability-receipt" && value.receipt && typeof value.receipt === "object" && typeof value.at === "number") {
9522
+ return value;
9523
+ }
9524
+ return null;
9525
+ }
9526
+ const RUN_ID_ENV = "ENSO_RUN_ID";
9527
+ const START_TOLERANCE_MS = 3e3;
9528
+ const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
9529
+ const LIVE_POLL_MIN_MS = 15;
9530
+ const LIVE_POLL_MAX_MS = 250;
9531
+ const ATTACH_POLL_MS = 250;
9532
+ const IDENTITY_EVERY = 40;
9533
+ const READ_CHUNK = 64 * 1024;
9534
+ const TRUNCATE_AT = 8 * 1024 * 1024;
9535
+ function isRunId(value) {
9536
+ return typeof value === "string" && RUN_ID.test(value);
9537
+ }
9538
+ function runFiles(dir, runId) {
9539
+ return {
9540
+ outputFile: path.join(dir, `run-${runId}.out`),
9541
+ exitFile: path.join(dir, `run-${runId}.exit`),
9542
+ metaFile: path.join(dir, `run-${runId}.json`)
9543
+ };
9544
+ }
9545
+ function removeRunFiles(dir, runId) {
9546
+ for (const file of Object.values(runFiles(dir, runId))) rmSync(file, { force: true });
9547
+ }
9548
+ function shellQuote(value) {
9549
+ return `'${value.replace(/'/g, `'\\''`)}'`;
9550
+ }
9551
+ function withExitTrap(command, exitFile) {
9552
+ return `trap ${shellQuote(`printf %s "$?" > ${shellQuote(exitFile)}`)} EXIT; ${command}`;
9553
+ }
9554
+ function readExitCode(file) {
9555
+ try {
9556
+ const text2 = readFileSync(file, "utf8").trim();
9557
+ return /^\d{1,3}$/.test(text2) ? Number(text2) : null;
9558
+ } catch {
9559
+ return null;
9560
+ }
9561
+ }
9562
+ function processAlive(pid) {
9563
+ if (!Number.isInteger(pid) || pid <= 0) return false;
9564
+ try {
9565
+ process.kill(pid, 0);
9566
+ return true;
9567
+ } catch (error) {
9568
+ return error.code !== "ESRCH";
9569
+ }
9570
+ }
9571
+ function processCommandLine(pid) {
9572
+ if (!Number.isInteger(pid) || pid <= 0) return null;
9573
+ try {
9574
+ if (process.platform === "linux") {
9575
+ return readFileSync(`/proc/${pid}/cmdline`, "utf8").replace(/\0/g, " ");
9576
+ }
9577
+ return execFileSync(
9578
+ existsSync("/bin/ps") ? "/bin/ps" : "ps",
9579
+ ["-ww", "-o", "command=", "-p", String(pid)],
9580
+ {
9581
+ encoding: "utf8",
9582
+ timeout: 2e3,
9583
+ stdio: ["ignore", "pipe", "ignore"]
9584
+ }
9585
+ );
9586
+ } catch {
9587
+ return null;
9588
+ }
9589
+ }
9590
+ function parseElapsed(text2) {
9591
+ const match = /^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/.exec(text2.trim());
9592
+ if (!match) return null;
9593
+ const [, days, hours, minutes, seconds] = match;
9594
+ return (((Number(days ?? 0) * 24 + Number(hours ?? 0)) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3;
9595
+ }
9596
+ function processStartedAt(pid) {
9597
+ if (!Number.isInteger(pid) || pid <= 0) return null;
9598
+ try {
9599
+ const elapsed = parseElapsed(
9600
+ execFileSync(existsSync("/bin/ps") ? "/bin/ps" : "ps", ["-o", "etime=", "-p", String(pid)], {
9601
+ encoding: "utf8",
9602
+ timeout: 2e3,
9603
+ stdio: ["ignore", "pipe", "ignore"]
9604
+ })
9605
+ );
9606
+ return elapsed === null ? null : Date.now() - elapsed;
9607
+ } catch {
9608
+ return null;
9609
+ }
9610
+ }
9611
+ function environHas(pid, entry) {
9612
+ try {
9613
+ return readFileSync(`/proc/${pid}/environ`, "utf8").split("\0").includes(entry);
9614
+ } catch {
9615
+ return false;
9616
+ }
9617
+ }
9618
+ function runIdentityMatches(pid, run) {
9619
+ if (processCommandLine(pid)?.includes(run.runId)) return true;
9620
+ if (process.platform === "linux" && environHas(pid, `${RUN_ID_ENV}=${run.runId}`)) return true;
9621
+ const startedAt = processStartedAt(pid);
9622
+ return startedAt !== null && Math.abs(startedAt - run.startedAt) <= START_TOLERANCE_MS;
9623
+ }
9624
+ const defaultRunProbe = {
9625
+ alive: processAlive,
9626
+ matches: runIdentityMatches
9627
+ };
9628
+ function killRunGroup(pid, signal) {
9629
+ if (process.platform === "darwin" && signal === "SIGKILL") {
9630
+ try {
9631
+ process.kill(-pid, "SIGSTOP");
9632
+ } catch {
9633
+ }
9634
+ }
9635
+ try {
9636
+ process.kill(-pid, signal);
9637
+ } catch {
9638
+ try {
9639
+ process.kill(pid, signal);
9640
+ } catch {
9641
+ }
9642
+ }
9643
+ }
9644
+ class FileTail {
9645
+ constructor(file, offset) {
9646
+ this.file = file;
9647
+ this.offset = offset;
9648
+ try {
9649
+ this.fd = openSync(file, "r");
9650
+ if (statSync(file).size < offset) this.offset = 0;
9651
+ } catch {
9652
+ this.fd = null;
9653
+ }
9654
+ }
9655
+ file;
9656
+ offset;
9657
+ fd = null;
9658
+ onData = () => {
9659
+ };
9660
+ sink(onData) {
9661
+ this.onData = onData;
9662
+ }
9663
+ /** 读到末尾;返回这次有没有读到新输出 */
9664
+ drain() {
9665
+ if (this.fd === null) return false;
9666
+ const buffer = Buffer.allocUnsafe(READ_CHUNK);
9667
+ let any = false;
9668
+ for (; ; ) {
9669
+ let read;
9670
+ try {
9671
+ read = readSync(this.fd, buffer, 0, READ_CHUNK, this.offset);
9672
+ } catch {
9673
+ return any;
9674
+ }
9675
+ if (read <= 0) break;
9676
+ any = true;
9677
+ this.offset += read;
9678
+ this.onData(Buffer.from(buffer.subarray(0, read)));
9679
+ }
9680
+ if (this.offset >= TRUNCATE_AT) {
9681
+ try {
9682
+ truncateSync(this.file, 0);
9683
+ this.offset = 0;
9684
+ } catch {
9685
+ }
9686
+ }
9687
+ return any;
9688
+ }
9689
+ close() {
9690
+ if (this.fd !== null) closeSync(this.fd);
9691
+ this.fd = null;
9692
+ }
9693
+ }
9694
+ function writeRunMeta(dir, run) {
9695
+ try {
9696
+ writeFileSync(
9697
+ runFiles(dir, run.runId).metaFile,
9698
+ JSON.stringify({
9699
+ version: 1,
9700
+ runId: run.runId,
9701
+ ownerPid: process.pid,
9702
+ pid: run.pid,
9703
+ startedAt: run.startedAt
9704
+ })
9705
+ );
9706
+ } catch {
9707
+ }
9708
+ }
9709
+ function spawnFileBacked(input) {
9710
+ mkdirSync(input.dir, { recursive: true });
9711
+ const runId = randomUUID();
9712
+ const { outputFile, exitFile } = runFiles(input.dir, runId);
9713
+ const out = openSync(outputFile, "a");
9714
+ let child;
9715
+ try {
9716
+ child = spawn(input.shell, [...input.args, withExitTrap(input.command, exitFile)], {
9717
+ cwd: input.cwd,
9718
+ detached: true,
9719
+ env: { ...input.env ?? process.env, [RUN_ID_ENV]: runId },
9720
+ stdio: ["ignore", out, out]
9721
+ });
9722
+ } finally {
9723
+ closeSync(out);
9724
+ }
9725
+ const files = {
9726
+ runId,
9727
+ pid: child.pid ?? -1,
9728
+ startedAt: Date.now(),
9729
+ cwd: input.cwd,
9730
+ outputFile,
9731
+ exitFile
9732
+ };
9733
+ if (child.pid !== void 0) writeRunMeta(input.dir, files);
9734
+ const tail = new FileTail(outputFile, 0);
9735
+ let released = false;
9736
+ let stopped = false;
9737
+ let timer;
9738
+ const poll = (delay) => {
9739
+ timer = setTimeout(() => {
9740
+ if (stopped) return;
9741
+ poll(tail.drain() ? LIVE_POLL_MIN_MS : Math.min(LIVE_POLL_MAX_MS, delay * 2));
9742
+ }, delay);
9743
+ timer.unref?.();
9744
+ };
9745
+ poll(LIVE_POLL_MIN_MS);
9746
+ const finish = () => {
9747
+ stopped = true;
9748
+ clearTimeout(timer);
9749
+ tail.drain();
9750
+ tail.close();
9751
+ removeRunFiles(input.dir, runId);
9752
+ };
9753
+ const done = new Promise(
9754
+ (resolve, reject) => {
9755
+ child.once("error", (error) => {
9756
+ if (released) return;
9757
+ finish();
9758
+ reject(error);
9759
+ });
9760
+ child.once("exit", (code, signal) => {
9761
+ if (released) return;
9762
+ finish();
9763
+ resolve({ code, signal });
9764
+ });
9765
+ }
9766
+ );
9767
+ return {
9768
+ ...files,
9769
+ sink: (onData) => tail.sink(onData),
9770
+ flush: () => {
9771
+ if (!stopped) tail.drain();
9772
+ },
9773
+ done,
9774
+ kill: (signal) => {
9775
+ if (child.pid !== void 0) killRunGroup(child.pid, signal);
9776
+ },
9777
+ release: () => {
9778
+ if (!released) {
9779
+ released = true;
9780
+ stopped = true;
9781
+ clearTimeout(timer);
9782
+ tail.drain();
9783
+ tail.close();
9784
+ child.unref();
9785
+ }
9786
+ return tail.offset;
9787
+ }
9788
+ };
9789
+ }
9790
+ function attachFileBacked(dir, run, offset, probe = defaultRunProbe) {
9791
+ const tail = new FileTail(run.outputFile, offset);
9792
+ writeRunMeta(dir, run);
9793
+ let released = false;
9794
+ let ticks = 0;
9795
+ let timer;
9796
+ let ended = false;
9797
+ const done = new Promise((resolve) => {
9798
+ const check = () => {
9799
+ tail.drain();
9800
+ ticks += 1;
9801
+ ended = readExitCode(run.exitFile) !== null || !probe.alive(run.pid) || ticks % IDENTITY_EVERY === 0 && !probe.matches(run.pid, run);
9802
+ if (!ended) return;
9803
+ clearInterval(timer);
9804
+ tail.drain();
9805
+ tail.close();
9806
+ const code = readExitCode(run.exitFile);
9807
+ removeRunFiles(dir, run.runId);
9808
+ resolve({ code, signal: null });
9809
+ };
9810
+ timer = setInterval(() => {
9811
+ if (!released) check();
9812
+ }, ATTACH_POLL_MS);
9813
+ timer.unref?.();
9814
+ });
9815
+ return {
9816
+ ...run,
9817
+ sink: (onData) => tail.sink(onData),
9818
+ flush: () => {
9819
+ if (!released && !ended) tail.drain();
9820
+ },
9821
+ done,
9822
+ kill: (signal) => {
9823
+ if (probe.matches(run.pid, run)) killRunGroup(run.pid, signal);
9824
+ },
9825
+ release: () => {
9826
+ if (!released) {
9827
+ released = true;
9828
+ clearInterval(timer);
9829
+ tail.drain();
9830
+ tail.close();
9831
+ }
9832
+ return tail.offset;
9833
+ }
9834
+ };
9835
+ }
9836
+ function readRunOutput(file, offset) {
9837
+ const chunks = [];
9838
+ const tail = new FileTail(file, offset);
9839
+ tail.sink((chunk) => chunks.push(chunk));
9840
+ tail.drain();
9841
+ tail.close();
9842
+ return Buffer.concat(chunks);
9843
+ }
9844
+ function sweepOrphanRuns(dir, keep, probe = defaultRunProbe) {
9845
+ let names;
9846
+ try {
9847
+ names = readdirSync(dir);
9848
+ } catch {
9849
+ return [];
9850
+ }
9851
+ const killed = [];
9852
+ for (const name of names) {
9853
+ const match = /^run-(.+)\.json$/.exec(name);
9854
+ const runId = match?.[1];
9855
+ if (!runId || !isRunId(runId) || keep.has(runId)) continue;
9856
+ let meta;
9857
+ try {
9858
+ meta = JSON.parse(readFileSync(path.join(dir, name), "utf8"));
9859
+ } catch {
9860
+ continue;
9861
+ }
9862
+ const ownerPid = typeof meta.ownerPid === "number" ? meta.ownerPid : -1;
9863
+ const pid = typeof meta.pid === "number" ? meta.pid : -1;
9864
+ const startedAt = typeof meta.startedAt === "number" ? meta.startedAt : Number.NaN;
9865
+ if (ownerPid === process.pid || probe.alive(ownerPid)) continue;
9866
+ if (probe.alive(pid)) {
9867
+ if (!probe.matches(pid, { runId, startedAt })) {
9868
+ removeRunFiles(dir, runId);
9869
+ continue;
9870
+ }
9871
+ killRunGroup(pid, "SIGKILL");
9872
+ killed.push(runId);
9873
+ }
9874
+ removeRunFiles(dir, runId);
9875
+ }
9876
+ return killed;
9877
+ }
9878
+ const requests = /* @__PURE__ */ new WeakMap();
9879
+ function requestFileBackedRun(signal, request) {
9880
+ requests.set(signal, request);
9881
+ }
9882
+ function withFileBackedExec(inner, resolveShell = () => getShellConfig()) {
9883
+ return {
9884
+ async exec(command, cwd, options) {
9885
+ const request = options.signal ? requests.get(options.signal) : void 0;
9886
+ const shell = request ? resolveShell() : void 0;
9887
+ if (!request || !shell || shell.commandTransport === "stdin" || options.timeout !== void 0)
9888
+ return inner.exec(command, cwd, options);
9889
+ const { onData, signal, env } = options;
9890
+ if (signal?.aborted) throw new Error("aborted");
9891
+ try {
9892
+ await access(cwd);
9893
+ } catch {
9894
+ throw new Error(`Working directory does not exist: ${cwd}
9895
+ Cannot execute bash commands.`);
9896
+ }
9897
+ const run = spawnFileBacked({
9898
+ shell: shell.shell,
9899
+ args: shell.args,
9900
+ command,
9901
+ cwd,
9902
+ env,
9903
+ dir: request.dir
9904
+ });
9905
+ run.sink(onData);
9906
+ request.onSpawn(run);
9907
+ const onAbort = () => run.kill("SIGKILL");
9908
+ signal?.addEventListener("abort", onAbort, { once: true });
9909
+ try {
9910
+ const result2 = await run.done;
9911
+ if (signal?.aborted) throw new Error("aborted");
9912
+ const exitCode = result2.code ?? (result2.signal ? 128 + (constants$1.signals[result2.signal] ?? 0) : 1);
9913
+ return { exitCode };
9914
+ } finally {
9915
+ signal?.removeEventListener("abort", onAbort);
9916
+ }
9917
+ }
9918
+ };
9919
+ }
9920
+ const DETACHED_TASKS_FILE = "restart-background-tasks.json";
9921
+ const COMMAND_SUMMARY_LIMIT = 300;
9922
+ const TASK_ID = /^task-\d+-[0-9a-z]+$/;
9923
+ const SECRET_ASSIGNMENT = /\b([A-Za-z0-9_]*?(?:key|token|secret|passw(?:or)?d|pwd|auth|credential)[A-Za-z0-9_]*)=("[^"]*"|'[^']*'|\S+)/gi;
9924
+ const SECRET_FLAG = /(--?[A-Za-z0-9-]*?(?:key|token|secret|passw(?:or)?d|auth|credential)[A-Za-z0-9-]*)(=|\s+)("[^"]*"|'[^']*'|[^\s-]\S*)/gi;
9925
+ function commandSummary(command) {
9926
+ const redacted = redactSafeText(
9927
+ command.replace(SECRET_ASSIGNMENT, "$1=[REDACTED]").replace(SECRET_FLAG, "$1$2[REDACTED]")
9928
+ ).trim();
9929
+ return redacted.length > COMMAND_SUMMARY_LIMIT ? `${redacted.slice(0, COMMAND_SUMMARY_LIMIT)}…` : redacted;
9930
+ }
9931
+ function commandKey(command, cwd) {
9932
+ return createHash("sha256").update(`${path.resolve(cwd)}\0${command.trim()}`).digest("hex");
9933
+ }
9934
+ function writeDetachedTasksManifest(file, manifest) {
9935
+ if (manifest.tasks.length === 0) {
9936
+ rmSync(file, { force: true });
9937
+ return;
9938
+ }
9939
+ mkdirSync(path.dirname(file), { recursive: true });
9940
+ const tmp = `${file}.${process.pid}.tmp`;
9941
+ writeFileSync(tmp, JSON.stringify(manifest, null, 2));
9942
+ renameSync(tmp, file);
9943
+ }
9944
+ const isNum = (value) => typeof value === "number" && Number.isFinite(value);
9945
+ const isStr = (value) => typeof value === "string" && value.length > 0;
9946
+ const numOrNull = (value) => value === null || isNum(value);
9947
+ function takeDetachedTasksManifest(file, logDir) {
9948
+ let raw;
9949
+ try {
9950
+ raw = readFileSync(file, "utf8");
9951
+ } catch {
9952
+ return [];
9953
+ }
9954
+ rmSync(file, { force: true });
9955
+ let parsed;
9956
+ try {
9957
+ parsed = JSON.parse(raw);
9958
+ } catch {
9959
+ return [];
9960
+ }
9961
+ const record = parsed;
9962
+ if (record?.version !== 1 || !Array.isArray(record.tasks)) return [];
9963
+ const same = (a, b) => path.resolve(a) === path.resolve(b);
9964
+ return record.tasks.filter((task) => {
9965
+ const t = task;
9966
+ return !!t && isStr(t.taskId) && TASK_ID.test(t.taskId) && isStr(t.sessionId) && typeof t.command === "string" && (t.commandKey === null || isStr(t.commandKey)) && isStr(t.cwd) && isNum(t.pid) && Number.isInteger(t.pid) && t.pid > 0 && isRunId(t.runId) && isNum(t.startedAt) && (t.runStartedAt === void 0 || isNum(t.runStartedAt)) && numOrNull(t.yieldedAt) && numOrNull(t.deadlineAt) && isNum(t.outputOffset) && t.outputOffset >= 0 && isStr(t.outputFile) && same(t.outputFile, path.join(logDir, `run-${t.runId}.out`)) && isStr(t.exitCodeFile) && same(t.exitCodeFile, path.join(logDir, `run-${t.runId}.exit`)) && isStr(t.logPath) && same(t.logPath, path.join(logDir, `${t.taskId}.log`));
9967
+ });
9968
+ }
9376
9969
  class ForegroundDetachedError extends Error {
9377
9970
  constructor(taskId, reason, output, owner) {
9378
9971
  super(`Command moved to background task ${taskId}`);
@@ -9407,12 +10000,14 @@ class ForegroundYieldError extends Error {
9407
10000
  }
9408
10001
  const MAX_TIMER_MS = 2147483647;
9409
10002
  class ForegroundCommand {
9410
- constructor(owner, yieldMs) {
10003
+ constructor(owner, yieldMs, spawnDir) {
9411
10004
  this.owner = owner;
9412
10005
  this.yieldMs = yieldMs;
10006
+ this.spawnDir = spawnDir;
9413
10007
  }
9414
10008
  owner;
9415
10009
  yieldMs;
10010
+ spawnDir;
9416
10011
  running;
9417
10012
  adoptError;
9418
10013
  /** 本次调用被截止时间(模型显式 timeout)杀掉 */
@@ -9433,6 +10028,15 @@ class ForegroundCommand {
9433
10028
  run(inner, command, cwd, options, timeoutMs, yieldMs) {
9434
10029
  const { onData, signal, env, timeout } = options;
9435
10030
  const controller = new AbortController();
10031
+ let detachable;
10032
+ if (this.spawnDir) {
10033
+ requestFileBackedRun(controller.signal, {
10034
+ dir: this.spawnDir,
10035
+ onSpawn: (run) => {
10036
+ detachable = run;
10037
+ }
10038
+ });
10039
+ }
9436
10040
  let sink = onData;
9437
10041
  let capture = true;
9438
10042
  let output = "";
@@ -9445,13 +10049,18 @@ class ForegroundCommand {
9445
10049
  env
9446
10050
  }).then((result2) => result2.exitCode);
9447
10051
  const proc = {
9448
- output: () => output,
10052
+ // 文件直写的进程按间隔跟读:取输出前先把已落盘的读进来
10053
+ output: () => {
10054
+ if (capture) detachable?.flush();
10055
+ return output;
10056
+ },
9449
10057
  pipe: (next) => {
9450
10058
  capture = false;
9451
10059
  sink = next;
9452
10060
  },
9453
10061
  done,
9454
- kill: () => controller.abort()
10062
+ kill: () => controller.abort(),
10063
+ detachable: () => detachable
9455
10064
  };
9456
10065
  return new Promise((resolve, reject) => {
9457
10066
  let timedOut = false;
@@ -9945,6 +10554,10 @@ class BackgroundTaskManager {
9945
10554
  foreground = /* @__PURE__ */ new Map();
9946
10555
  counter = 0;
9947
10556
  timer = null;
10557
+ /** 任务日志与文件直写输出所在目录 */
10558
+ get outputDir() {
10559
+ return this.logDir;
10560
+ }
9948
10561
  /** 当前生效的命令时限;全局 settings.shell 变更时由 setLimits 整体替换,执行路径每次现读 */
9949
10562
  get limits() {
9950
10563
  return this.currentLimits;
@@ -9954,6 +10567,36 @@ class BackgroundTaskManager {
9954
10567
  }
9955
10568
  start(sessionId, command, cwd, spawnOpts) {
9956
10569
  const taskId = this.reserveId(sessionId);
10570
+ const run = spawnOpts?.detachable && !spawnOpts.file && process.platform !== "win32" ? spawnFileBacked({
10571
+ // 与 spawn(command, { shell: true }) 同一个 shell
10572
+ shell: "/bin/sh",
10573
+ args: ["-c"],
10574
+ command,
10575
+ cwd,
10576
+ env: spawnOpts.env,
10577
+ dir: this.logDir
10578
+ }) : void 0;
10579
+ if (run) {
10580
+ const task2 = this.register(sessionId, taskId, spawnOpts?.displayCommand ?? command, {
10581
+ details: spawnOpts?.details,
10582
+ finalize: spawnOpts?.finalize,
10583
+ kill: (signal) => run.kill(signal)
10584
+ });
10585
+ task2.run = run;
10586
+ task2.cwd = cwd;
10587
+ task2.commandKey = spawnOpts?.commandKey;
10588
+ run.sink((chunk) => this.append(task2, chunk));
10589
+ run.done.then(
10590
+ ({ code, signal }) => this.exited(task2, code, signal),
10591
+ (error) => {
10592
+ task2.output += `
10593
+ [spawn error] ${error instanceof Error ? error.message : String(error)}`;
10594
+ if (task2.info.status === "running" && !task2.settling) void this.settle(task2, "failed");
10595
+ }
10596
+ );
10597
+ this.announce(task2);
10598
+ return taskId;
10599
+ }
9957
10600
  const child = spawnBackground(command, cwd, spawnOpts);
9958
10601
  const task = this.register(sessionId, taskId, spawnOpts?.displayCommand ?? command, {
9959
10602
  details: spawnOpts?.details,
@@ -9980,6 +10623,11 @@ class BackgroundTaskManager {
9980
10623
  kill: () => proc.kill()
9981
10624
  });
9982
10625
  task.yieldedAt = Date.now();
10626
+ task.run = proc.detachable?.();
10627
+ if (opts.cwd !== void 0) {
10628
+ task.cwd = opts.cwd;
10629
+ task.commandKey = commandKey(opts.command, opts.cwd);
10630
+ }
9983
10631
  this.append(task, Buffer.from(proc.output()));
9984
10632
  this.takeUnread(task);
9985
10633
  proc.pipe((chunk) => this.append(task, chunk));
@@ -10074,9 +10722,16 @@ class BackgroundTaskManager {
10074
10722
  register(sessionId, taskId, command, opts) {
10075
10723
  const logPath = path.join(this.logDir, `${taskId}.log`);
10076
10724
  let logStream = null;
10725
+ let logBytes = 0;
10077
10726
  try {
10078
10727
  mkdirSync(this.logDir, { recursive: true });
10079
- logStream = createWriteStream(logPath);
10728
+ if (opts.appendLog) {
10729
+ try {
10730
+ logBytes = statSync(logPath).size;
10731
+ } catch {
10732
+ }
10733
+ }
10734
+ logStream = createWriteStream(logPath, { flags: opts.appendLog ? "a" : "w" });
10080
10735
  } catch {
10081
10736
  }
10082
10737
  const task = {
@@ -10091,7 +10746,7 @@ class BackgroundTaskManager {
10091
10746
  dirty: false,
10092
10747
  logPath,
10093
10748
  logStream,
10094
- logBytes: 0,
10749
+ logBytes,
10095
10750
  logDroppedBytes: 0,
10096
10751
  decoder: new StringDecoder("utf8"),
10097
10752
  consumed: false,
@@ -10221,7 +10876,9 @@ class BackgroundTaskManager {
10221
10876
  this.events.onEnded(task.sessionId, task.info.taskId, status, exitCode);
10222
10877
  this.emitLevel(task.sessionId);
10223
10878
  if (!task.consumed) {
10224
- this.events.onCompletionNotify(task.sessionId, this.completionText(task));
10879
+ const text2 = this.completionText(task);
10880
+ if (task.recovered) this.events.onCompletionNotify(task.sessionId, text2, { durable: true });
10881
+ else this.events.onCompletionNotify(task.sessionId, text2);
10225
10882
  }
10226
10883
  }
10227
10884
  async settle(task, status, exitCode) {
@@ -10375,11 +11032,123 @@ class BackgroundTaskManager {
10375
11032
  snapshot(sessionId) {
10376
11033
  return [...this.tasks.values()].filter((task) => task.sessionId === sessionId).map((task) => ({ ...task.info, tail: task.output.slice(-8e3) }));
10377
11034
  }
11035
+ /**
11036
+ * 前台命令转后台(adopt,有 yieldedAt)后还没结束的任务:优雅重启把它们当作在跑的工具。
11037
+ * exceptDetachable:重启会把能脱离的交给下一代,只剩脱离不了的需要等
11038
+ */
11039
+ runningYielded(sessionId, opts) {
11040
+ return [...this.tasks.values()].filter(
11041
+ (task) => task.sessionId === sessionId && task.yieldedAt !== void 0 && task.info.status === "running" && !(opts?.exceptDetachable && task.run)
11042
+ ).map((task) => task.info.taskId);
11043
+ }
10378
11044
  stopAll() {
10379
11045
  for (const task of this.tasks.values()) {
10380
11046
  if (task.info.status === "running") this.stop(task.info.taskId, true);
10381
11047
  }
10382
11048
  }
11049
+ /**
11050
+ * 重启前把能脱离的在跑任务交出去:读完已有输出、停止跟读,进程不动,从本代移除,返回恢复清单条目。
11051
+ * 脱离不了的(管道进程)留在原处,worker 收尾时照常停掉。
11052
+ */
11053
+ detachForRestart() {
11054
+ const records2 = [];
11055
+ for (const task of [...this.tasks.values()]) {
11056
+ const run = task.run;
11057
+ if (!run || task.info.status !== "running" || task.settling) continue;
11058
+ const outputOffset = run.release();
11059
+ if (task.deadlineTimer) clearTimeout(task.deadlineTimer);
11060
+ task.logStream?.end();
11061
+ this.tasks.delete(task.info.taskId);
11062
+ records2.push({
11063
+ taskId: task.info.taskId,
11064
+ sessionId: task.sessionId,
11065
+ command: commandSummary(task.info.command),
11066
+ commandKey: task.commandKey ?? null,
11067
+ cwd: task.cwd ?? run.cwd,
11068
+ pid: run.pid,
11069
+ runId: run.runId,
11070
+ startedAt: task.info.startedAt,
11071
+ runStartedAt: run.startedAt,
11072
+ yieldedAt: task.yieldedAt ?? null,
11073
+ deadlineAt: task.info.deadlineAt ?? null,
11074
+ outputFile: run.outputFile,
11075
+ outputOffset,
11076
+ exitCodeFile: run.exitFile,
11077
+ logPath: task.logPath
11078
+ });
11079
+ }
11080
+ return records2;
11081
+ }
11082
+ /**
11083
+ * 冷启动认回上一代交出的任务,同一个 taskId 重新登记:
11084
+ * - pid 在、认得出是原进程(命令行 / 环境变量带着 runId,或启动时间对得上):running,按偏移接着读输出文件;
11085
+ * - pid 不在:读完剩余输出,按退出码文件标 done / failed,照常发完成通知;
11086
+ * - pid 在但对不上(被复用):不认、不发任何信号,标 failed 并说明找不到原进程。
11087
+ * 返回处理过的 runId(孤儿清理跳过它们)。
11088
+ */
11089
+ recover(records2, probe = defaultRunProbe) {
11090
+ const handled = /* @__PURE__ */ new Set();
11091
+ for (const record of records2) {
11092
+ if (this.tasks.has(record.taskId)) continue;
11093
+ handled.add(record.runId);
11094
+ const files = runFiles(this.logDir, record.runId);
11095
+ const identity = { runId: record.runId, startedAt: record.runStartedAt ?? record.startedAt };
11096
+ const state = !probe.alive(record.pid) ? "gone" : probe.matches(record.pid, identity) ? "alive" : "reused";
11097
+ const task = this.register(record.sessionId, record.taskId, record.command, {
11098
+ startedAt: record.startedAt,
11099
+ kill: () => {
11100
+ },
11101
+ appendLog: true
11102
+ });
11103
+ task.recovered = true;
11104
+ task.cwd = record.cwd;
11105
+ if (record.commandKey) task.commandKey = record.commandKey;
11106
+ if (record.yieldedAt !== null) task.yieldedAt = record.yieldedAt;
11107
+ if (state === "alive") {
11108
+ const run = attachFileBacked(
11109
+ this.logDir,
11110
+ {
11111
+ runId: record.runId,
11112
+ pid: record.pid,
11113
+ startedAt: identity.startedAt,
11114
+ cwd: record.cwd,
11115
+ outputFile: files.outputFile,
11116
+ exitFile: files.exitFile
11117
+ },
11118
+ record.outputOffset,
11119
+ probe
11120
+ );
11121
+ task.run = run;
11122
+ task.kill = (signal) => run.kill(signal);
11123
+ run.sink((chunk) => this.append(task, chunk));
11124
+ void run.done.then(({ code: code2 }) => {
11125
+ if (code2 === null) task.output += "\n[process ended; exit code unavailable]";
11126
+ this.exited(task, code2, null);
11127
+ });
11128
+ this.announce(task);
11129
+ if (record.deadlineAt !== null)
11130
+ this.armDeadline(task, (record.deadlineAt - Date.now()) / 1e3);
11131
+ continue;
11132
+ }
11133
+ this.append(task, readRunOutput(files.outputFile, record.outputOffset));
11134
+ const code = state === "gone" ? readExitCode(files.exitFile) : null;
11135
+ removeRunFiles(this.logDir, record.runId);
11136
+ task.output += state === "gone" ? code === null ? "\n[process ended while the app was restarting; exit code unavailable]" : "" : `
11137
+ [original process not found after restart: pid ${record.pid} now belongs to another process; the task was not reattached and nothing was killed]`;
11138
+ this.announce(task);
11139
+ this.exited(task, code, null);
11140
+ }
11141
+ return handled;
11142
+ }
11143
+ /** 认回的、同一会话树里还在跑的同一命令(同 cwd);没有返回 undefined */
11144
+ recoveredDuplicate(sessionId, key) {
11145
+ const root = sessionId.split("::")[0] ?? sessionId;
11146
+ for (const task of this.tasks.values()) {
11147
+ if (task.recovered && task.info.status === "running" && !task.settling && task.commandKey === key && inSessionTree(task.sessionId, root))
11148
+ return task.info.taskId;
11149
+ }
11150
+ return void 0;
11151
+ }
10383
11152
  }
10384
11153
  const QUOTED_SEGMENT = /'[^']*'|"(?:[^"\\]|\\.)*"/g;
10385
11154
  const HEREDOC_BODY = /<<-?\s*(['"]?)([A-Za-z_]\w*)\1[ \t]*\n[\s\S]*?\n[ \t]*\2[ \t]*(?=\n|$)/g;
@@ -10447,15 +11216,6 @@ function spawnBackground(command, cwd, spawnOpts) {
10447
11216
  }
10448
11217
  return spawn(command, { shell: true, cwd, env, ...mode, stdio });
10449
11218
  }
10450
- function processAlive(pid) {
10451
- if (!Number.isInteger(pid) || pid <= 0) return false;
10452
- try {
10453
- process.kill(pid, 0);
10454
- return true;
10455
- } catch (error) {
10456
- return error.code !== "ESRCH";
10457
- }
10458
- }
10459
11219
  function resolveBackgroundLaunch(toolName2, command, cwd, transform, resolvePowerShell) {
10460
11220
  if (transform) return transform(command, cwd);
10461
11221
  if (toolName2 === "powershell") {
@@ -10575,6 +11335,18 @@ function withBackground(definition, manager, sessionId, cwd, transform, foregrou
10575
11335
  ],
10576
11336
  async execute(toolCallId, params, signal, onUpdate, ctx) {
10577
11337
  const record = params;
11338
+ const duplicate = typeof record.command === "string" && !transform ? manager.recoveredDuplicate(sessionId, commandKey(record.command, cwd)) : void 0;
11339
+ if (duplicate) {
11340
+ return {
11341
+ content: [
11342
+ {
11343
+ type: "text",
11344
+ text: `Not started: this command is already running as background task ${duplicate}. It kept running through the app restart and was reattached, so starting it again would collide with it (ports, files). task_output("${duplicate}") shows its output; task_stop("${duplicate}") stops it if a fresh run is really needed.`
11345
+ }
11346
+ ],
11347
+ details: { backgroundTaskId: duplicate }
11348
+ };
11349
+ }
10578
11350
  if (record.background && typeof record.command === "string") {
10579
11351
  const hooks = definition[BACKGROUND_COMMAND_HOOKS];
10580
11352
  const prepared = hooks ? await hooks.prepare(toolCallId, record.command, signal) : { command: record.command };
@@ -10592,7 +11364,9 @@ function withBackground(definition, manager, sessionId, cwd, transform, foregrou
10592
11364
  ...transform ? {} : {
10593
11365
  env: hardenedEnv(process.env, {
10594
11366
  shell: definition.name === "powershell" ? "powershell" : "bash"
10595
- })
11367
+ }),
11368
+ detachable: definition.name === "bash",
11369
+ commandKey: commandKey(record.command, cwd)
10596
11370
  }
10597
11371
  });
10598
11372
  } catch (error) {
@@ -10631,11 +11405,13 @@ function withBackground(definition, manager, sessionId, cwd, transform, foregrou
10631
11405
  adopt: (proc) => manager.adopt(sessionId, proc, {
10632
11406
  command,
10633
11407
  startedAt,
11408
+ cwd,
10634
11409
  ...deadlineSec === void 0 ? {} : { deadlineSec: Math.max(0, deadlineSec - (Date.now() - startedAt) / 1e3) }
10635
11410
  }),
10636
11411
  attachFinalize: (taskId, details, finalize) => manager.attachFinalize(taskId, details, finalize)
10637
11412
  },
10638
- policy.yieldMs
11413
+ policy.yieldMs,
11414
+ transform ? void 0 : manager.outputDir
10639
11415
  );
10640
11416
  bindForegroundCommand(callSignal, foreground);
10641
11417
  const untrack = manager.trackForeground(foregroundSessionId, toolCallId, foreground);
@@ -11423,7 +12199,7 @@ function parseDirectoryProvider(value) {
11423
12199
  }
11424
12200
  return provider;
11425
12201
  }
11426
- const version = "0.3.11";
12202
+ const version = "0.3.12";
11427
12203
  function readModelsDevCache(file) {
11428
12204
  try {
11429
12205
  if (!existsSync(file)) return void 0;
@@ -12245,7 +13021,7 @@ const ELEVATE_UNAVAILABLE_MARKER = "ENSO_ELEVATE_UNAVAILABLE";
12245
13021
  const ELEVATE_TIMEOUT_MS = 12e4;
12246
13022
  const ELEVATE_ASKPASS_ENV = "ENSO_ELEVATE_ASKPASS";
12247
13023
  function buildElevatedCommand(command, options) {
12248
- return `SUDO_ASKPASS=${shellQuote(options.askpassPath)} ${shellQuote(options.sudoPath)} -k -A -- /bin/bash -c ${shellQuote(command)}`;
13024
+ return `SUDO_ASKPASS=${shellQuote$1(options.askpassPath)} ${shellQuote$1(options.sudoPath)} -k -A -- /bin/bash -c ${shellQuote$1(command)}`;
12249
13025
  }
12250
13026
  const SUDO_ARGS = /^\S*sudo -k -A -- \/bin\/bash -c /;
12251
13027
  function elevatedCommandOf(sudoArgs) {
@@ -13157,13 +13933,23 @@ function buildTurnDigest(messages, fromIndex) {
13157
13933
  userParts = fallback ? [fallback] : [];
13158
13934
  }
13159
13935
  const userText = userParts.join("\n").slice(0, TURN_DIGEST_USER_MAX);
13160
- const conclusion = [...turn].reverse().find(
13161
- (message) => message.role === "assistant" && message.stopReason !== "error" && message.stopReason !== "aborted" && textOf(message).length > 0
13162
- );
13936
+ const conclusion = turnConclusion(turn);
13163
13937
  const assistantText = conclusion ? textOf(conclusion).slice(-1500) : "";
13164
13938
  if (!userText && !assistantText) return null;
13165
13939
  return { firstUserText, userText, assistantText };
13166
13940
  }
13941
+ function turnConclusion(turn) {
13942
+ return [...turn].reverse().find(
13943
+ (message) => message.role === "assistant" && message.stopReason !== "error" && message.stopReason !== "aborted" && textOf(message).length > 0
13944
+ );
13945
+ }
13946
+ function buildTurnReport(messages, fromIndex) {
13947
+ const conclusion = turnConclusion(messages.slice(Math.max(0, fromIndex)));
13948
+ if (!conclusion) return void 0;
13949
+ const text2 = textOf(conclusion);
13950
+ const omitted = text2.length - TURN_REPORT_MAX_CHARS;
13951
+ return omitted > 0 ? { text: text2.slice(-TURN_REPORT_MAX_CHARS), omitted } : { text: text2 };
13952
+ }
13167
13953
  const SPECIAL_TOKEN = /<\|[^|>]*\|>/g;
13168
13954
  const QUOTE_PAIRS = [
13169
13955
  ['"', '"'],
@@ -14454,6 +15240,7 @@ const MMR_LAMBDA = 0.7;
14454
15240
  const DEDUP_VECTOR = 0.8;
14455
15241
  const DEDUP_MAX = 3;
14456
15242
  const DEDUP_MIN_CHARS = 100;
15243
+ const EVOLVES_MIN_CONF = 0.7;
14457
15244
  const EVOLVES_RELATIONS = ["replaces", "enriches", "confirms", "challenges"];
14458
15245
  function isEvolvesRelation(value) {
14459
15246
  return EVOLVES_RELATIONS.includes(value);
@@ -14467,6 +15254,7 @@ const DISTILL_CONSOLIDATE_MAX_TOKENS = 1536;
14467
15254
  const DISTILL_MAX_OUTPUT_TOKENS = 3072;
14468
15255
  const DISTILL_MIN_IMPORTANCE = 0.5;
14469
15256
  const DISTILL_MAX_ATTEMPTS = 3;
15257
+ const DISTILL_BATCH_MAX_CHARS = DISTILL_MAX_CHUNK_CHARS * 3;
14470
15258
  const KG_MAX_ENTITIES = 10;
14471
15259
  const KG_MAX_RELATIONS = 20;
14472
15260
  const KG_MAX_ENTITY_NAME_CHARS = 100;
@@ -15989,73 +16777,73 @@ function builtinPresets() {
15989
16777
  return builtinCache;
15990
16778
  }
15991
16779
  export {
15992
- ensureAccountProvider as $,
16780
+ replacePersonaParagraph as $,
15993
16781
  AGENT_WORKER_CRASH_FILE as A,
15994
- buildObservationsRecordedData as B,
15995
- buildReflectionsRecordedData as C,
15996
- buildReflectionsConsolidatedData as D,
15997
- buildObservationsDroppedData as E,
15998
- readModelsDevCache as F,
15999
- version as G,
16000
- parseModelDirectorySnapshot as H,
16001
- findCatalogModelById as I,
16002
- findModelsDevModel as J,
16003
- mergeCatalogEntry as K,
16004
- resolveCustomModelCapabilities as L,
16005
- closestMatchHint as M,
16006
- mcpTimeoutMsOrDefault as N,
16782
+ buildReflectionsRecordedData as B,
16783
+ buildReflectionsConsolidatedData as C,
16784
+ buildObservationsDroppedData as D,
16785
+ readModelsDevCache as E,
16786
+ version as F,
16787
+ parseModelDirectorySnapshot as G,
16788
+ findCatalogModelById as H,
16789
+ findModelsDevModel as I,
16790
+ mergeCatalogEntry as J,
16791
+ resolveCustomModelCapabilities as K,
16792
+ closestMatchHint as L,
16793
+ mcpTimeoutMsOrDefault as M,
16794
+ oneLine as N,
16007
16795
  OM_OBSERVATIONS_RECORDED as O,
16008
16796
  PatchMutationUncertainError as P,
16009
- oneLine as Q,
16010
- mcpNamespaceName as R,
16011
- assignMcpToolNames as S,
16012
- MCP_OAUTH_REFRESH_SKEW_MS as T,
16013
- mcpOAuthFingerprint as U,
16797
+ mcpNamespaceName as Q,
16798
+ assignMcpToolNames as R,
16799
+ MCP_OAUTH_REFRESH_SKEW_MS as S,
16800
+ mcpOAuthFingerprint as T,
16801
+ DEFAULT_MCP_CONNECT_TIMEOUT_MS as U,
16014
16802
  VIRTUAL_PROVIDER_ID as V,
16015
- DEFAULT_MCP_CONNECT_TIMEOUT_MS as W,
16016
- DEFAULT_MCP_CALL_TIMEOUT_MS as X,
16017
- isXaiChatModelId as Y,
16018
- transcriptMessages as Z,
16019
- projectMessage as _,
16803
+ DEFAULT_MCP_CALL_TIMEOUT_MS as W,
16804
+ isXaiChatModelId as X,
16805
+ transcriptMessages as Y,
16806
+ projectMessage as Z,
16807
+ ensureAccountProvider as _,
16020
16808
  APPLY_PATCH_PROMPT_GUIDELINES as a,
16021
- parseJsonFromAssistant as a$,
16022
- replacePersonaParagraph as a0,
16023
- takeSnapshotTail as a1,
16024
- attachBackgroundCommandHooks as a2,
16025
- ForegroundDetachedError as a3,
16809
+ snapshotMainConversation as a$,
16810
+ takeSnapshotTail as a0,
16811
+ attachBackgroundCommandHooks as a1,
16812
+ ForegroundDetachedError as a2,
16813
+ withFileBackedExec as a3,
16026
16814
  withHardenedEnv as a4,
16027
16815
  withDetachableExec as a5,
16028
16816
  ELEVATE_ASKPASS_ENV as a6,
16029
16817
  buildElevatedCommand as a7,
16030
16818
  ELEVATE_DECLINED_MARKER as a8,
16031
16819
  ELEVATE_TIMED_OUT_MARKER as a9,
16032
- CodemodeHost as aA,
16033
- ApprovalGate as aB,
16034
- HUMAN_REQUEST_TIMEOUT_MS as aC,
16035
- TodoStaleReminder as aD,
16036
- CoworkerIdleReminder as aE,
16037
- createUnifiedSubagentTool as aF,
16038
- workflowPresetRoots as aG,
16039
- withMandatoryApproval as aH,
16040
- createBrowserTools as aI,
16041
- withNavigateApproval as aJ,
16042
- createMemoryTools as aK,
16043
- withComputerApproval as aL,
16044
- createComputerTool as aM,
16045
- withApproval as aN,
16046
- listWorkflowPresets as aO,
16047
- createTaskTools as aP,
16048
- BrowserInvoker as aQ,
16049
- MemoryInvoker as aR,
16050
- PlanController as aS,
16051
- ComputerInvoker as aT,
16052
- AskManager as aU,
16053
- createAskTool as aV,
16054
- snapshotMainConversation as aW,
16055
- lastAssistantText as aX,
16056
- positiveContextWindow as aY,
16057
- foregroundCommandTimeoutMs as aZ,
16058
- buildTurnDigest as a_,
16820
+ isDeferredMcp as aA,
16821
+ providerIdOfAccountKey as aB,
16822
+ resolveOauthCatalogModel as aC,
16823
+ createSshExecutor as aD,
16824
+ partitionMcpNamespaces as aE,
16825
+ CodemodeHost as aF,
16826
+ ApprovalGate as aG,
16827
+ HUMAN_REQUEST_TIMEOUT_MS as aH,
16828
+ TodoStaleReminder as aI,
16829
+ CoworkerIdleReminder as aJ,
16830
+ createUnifiedSubagentTool as aK,
16831
+ workflowPresetRoots as aL,
16832
+ withMandatoryApproval as aM,
16833
+ createBrowserTools as aN,
16834
+ withNavigateApproval as aO,
16835
+ createMemoryTools as aP,
16836
+ withComputerApproval as aQ,
16837
+ createComputerTool as aR,
16838
+ withApproval as aS,
16839
+ listWorkflowPresets as aT,
16840
+ createTaskTools as aU,
16841
+ BrowserInvoker as aV,
16842
+ MemoryInvoker as aW,
16843
+ PlanController as aX,
16844
+ ComputerInvoker as aY,
16845
+ AskManager as aZ,
16846
+ createAskTool as a_,
16059
16847
  ELEVATE_TIMEOUT_MS as aa,
16060
16848
  ELEVATE_UNAVAILABLE_MARKER as ab,
16061
16849
  expandSkillCommands as ac,
@@ -16076,213 +16864,229 @@ export {
16076
16864
  resolveWorkflowPresetArgs as ar,
16077
16865
  extractWriteTargetPaths as as,
16078
16866
  programTokens as at,
16079
- BackgroundTaskManager as au,
16080
- isDeferredMcp as av,
16081
- providerIdOfAccountKey as aw,
16082
- resolveOauthCatalogModel as ax,
16083
- createSshExecutor as ay,
16084
- partitionMcpNamespaces as az,
16867
+ RESTART_CHECKPOINT_ARCHIVE as au,
16868
+ takeRestartCheckpoint as av,
16869
+ BackgroundTaskManager as aw,
16870
+ takeDetachedTasksManifest as ax,
16871
+ DETACHED_TASKS_FILE as ay,
16872
+ sweepOrphanRuns as az,
16085
16873
  emptyUsage as b,
16086
- DEFAULT_PERSONA_PROMPT as b$,
16087
- validateAgainstSchema as b0,
16088
- appendYieldJson as b1,
16089
- appendCappedLog as b2,
16090
- AGENT_COMPACTION_LOG as b3,
16091
- describeTitleModel as b4,
16092
- buildRollingTitleUserText as b5,
16093
- buildInitialTitleUserText as b6,
16094
- ROLLING_TITLE_SYSTEM_PROMPT as b7,
16095
- TITLE_SYSTEM_PROMPT as b8,
16096
- extractTitle as b9,
16097
- loadWorkflowPreset as bA,
16098
- cloneModelsDevOauthModel as bB,
16099
- withWriteScope as bC,
16100
- withWritePreflight as bD,
16101
- validateApplyPatchTargets as bE,
16102
- withAgentRead as bF,
16103
- extractEditTargetPath as bG,
16104
- buildSshShellCommand as bH,
16105
- resolveSshControlPath as bI,
16106
- sshPasswordEnv as bJ,
16107
- getApplyPatchPaths as bK,
16108
- isMediaId as bL,
16109
- isVirtualRef as bM,
16110
- findVirtualModel as bN,
16111
- syncAccountProviders as bO,
16112
- expandOauthCatalog as bP,
16113
- supportsMultipleAccounts as bQ,
16114
- parseCodexAuthJson as bR,
16115
- CODEX_PROVIDER_ID as bS,
16116
- nextAccountKey as bT,
16117
- sanitizeUpstreamBody as bU,
16118
- defaultCodexAuthPath as bV,
16119
- ordinalOfAccountKey as bW,
16120
- sanitizeOauthLabel as bX,
16121
- parseAntigravityApiKey as bY,
16122
- fetchAntigravityUsage as bZ,
16123
- fetchDevinUsage as b_,
16124
- titleRejectReason as ba,
16125
- resolveChildReasoning as bb,
16126
- pickChildReasoningOverride as bc,
16127
- createWebTools as bd,
16128
- createTodoTool as be,
16129
- withPlanGate as bf,
16130
- createSubmitPlanTool as bg,
16131
- titleSummaryTimeoutMs as bh,
16132
- splitUnattendedPrefix as bi,
16133
- resolveHarnessSkillRoots as bj,
16134
- approvalReviewResultExtension as bk,
16135
- readHarnessRuleFiles as bl,
16136
- createProjectSettingsManager as bm,
16137
- CODEMODE_TOOL_NAME as bn,
16138
- prepareCodemodeInput as bo,
16139
- ANTIGRAVITY_PROVIDER_ID as bp,
16140
- antigravityProviderConfig as bq,
16141
- DEVIN_PROVIDER_ID as br,
16142
- devinProviderConfig as bs,
16143
- QODER_PROVIDER_ID as bt,
16144
- qoderProviderConfig as bu,
16145
- QODER_CN_PROVIDER_ID as bv,
16146
- installCodexLinkedRefresh as bw,
16147
- isHeadlessRun as bx,
16148
- withBackground as by,
16149
- withProtectedFloor as bz,
16874
+ expandOauthCatalog as b$,
16875
+ lastAssistantText as b0,
16876
+ positiveContextWindow as b1,
16877
+ foregroundCommandTimeoutMs as b2,
16878
+ buildTurnDigest as b3,
16879
+ buildTurnReport as b4,
16880
+ parseJsonFromAssistant as b5,
16881
+ validateAgainstSchema as b6,
16882
+ appendYieldJson as b7,
16883
+ appendCappedLog as b8,
16884
+ AGENT_COMPACTION_LOG as b9,
16885
+ ANTIGRAVITY_PROVIDER_ID as bA,
16886
+ antigravityProviderConfig as bB,
16887
+ DEVIN_PROVIDER_ID as bC,
16888
+ devinProviderConfig as bD,
16889
+ QODER_PROVIDER_ID as bE,
16890
+ qoderProviderConfig as bF,
16891
+ QODER_CN_PROVIDER_ID as bG,
16892
+ installCodexLinkedRefresh as bH,
16893
+ isHeadlessRun as bI,
16894
+ withBackground as bJ,
16895
+ withProtectedFloor as bK,
16896
+ loadWorkflowPreset as bL,
16897
+ cloneModelsDevOauthModel as bM,
16898
+ withWriteScope as bN,
16899
+ withWritePreflight as bO,
16900
+ validateApplyPatchTargets as bP,
16901
+ withAgentRead as bQ,
16902
+ extractEditTargetPath as bR,
16903
+ buildSshShellCommand as bS,
16904
+ resolveSshControlPath as bT,
16905
+ sshPasswordEnv as bU,
16906
+ getApplyPatchPaths as bV,
16907
+ RESTART_CHECKPOINT_ENV as bW,
16908
+ isMediaId as bX,
16909
+ isVirtualRef as bY,
16910
+ findVirtualModel as bZ,
16911
+ syncAccountProviders as b_,
16912
+ restartGate as ba,
16913
+ writeRestartCheckpoint as bb,
16914
+ RESTART_CHECKPOINT_FILE as bc,
16915
+ writeDetachedTasksManifest as bd,
16916
+ killRunGroup as be,
16917
+ describeTitleModel as bf,
16918
+ buildRollingTitleUserText as bg,
16919
+ buildInitialTitleUserText as bh,
16920
+ ROLLING_TITLE_SYSTEM_PROMPT as bi,
16921
+ TITLE_SYSTEM_PROMPT as bj,
16922
+ extractTitle as bk,
16923
+ titleRejectReason as bl,
16924
+ resolveChildReasoning as bm,
16925
+ pickChildReasoningOverride as bn,
16926
+ createWebTools as bo,
16927
+ createTodoTool as bp,
16928
+ withPlanGate as bq,
16929
+ createSubmitPlanTool as br,
16930
+ titleSummaryTimeoutMs as bs,
16931
+ splitUnattendedPrefix as bt,
16932
+ resolveHarnessSkillRoots as bu,
16933
+ approvalReviewResultExtension as bv,
16934
+ readHarnessRuleFiles as bw,
16935
+ createProjectSettingsManager as bx,
16936
+ CODEMODE_TOOL_NAME as by,
16937
+ prepareCodemodeInput as bz,
16150
16938
  charsToTokens as c,
16151
- DECAY_WEIGHT as c$,
16152
- parseAgentWorkerCrash as c0,
16153
- AGENT_WORKER_EXIT_LOG as c1,
16154
- elevatedCommandOf as c2,
16155
- startOauthCallbackServer as c3,
16156
- MODELS_DEV_URL as c4,
16157
- writeModelsDevCache as c5,
16158
- parseModelsDevPayload as c6,
16159
- MODELS_DEV_CACHE_NAME as c7,
16160
- modelsDevIsFresh as c8,
16161
- withModelsDevOauthModels as c9,
16162
- DISTILL_MAX_ATTEMPTS as cA,
16163
- FORGETTING_DEFAULT_MAX_IMPORTANCE as cB,
16164
- FORGETTING_DEFAULT_STALE_DAYS as cC,
16165
- FORGETTING_DEFAULT_INTERVAL_DAYS as cD,
16166
- FORGETTING_INTERVAL_DAYS_MAX as cE,
16167
- FORGETTING_INTERVAL_DAYS_MIN as cF,
16168
- FORGETTING_MAX_IMPORTANCE_MAX as cG,
16169
- FORGETTING_MAX_IMPORTANCE_MIN as cH,
16170
- FORGETTING_STALE_DAYS_MAX as cI,
16171
- FORGETTING_STALE_DAYS_MIN as cJ,
16172
- CRYSTAL_MIN_SOURCES as cK,
16173
- KG_MAX_LABEL_CHARS as cL,
16174
- KG_MAX_ENTITY_NAME_CHARS as cM,
16175
- KG_MAX_DESCRIPTION_CHARS as cN,
16176
- KG_MAX_ENTITIES as cO,
16177
- KG_MAX_RELATIONS as cP,
16178
- KG_EXTRACT_MAX_TOKENS as cQ,
16179
- KG_DEFAULT_RELATION_TYPE as cR,
16180
- KG_DEFAULT_ENTITY_TYPE as cS,
16181
- KG_MAX_ATTEMPTS as cT,
16182
- MIN_FLOOR as cU,
16183
- IMP_MULT as cV,
16184
- RECENCY_W as cW,
16185
- FREQUENCY_W as cX,
16186
- FREQUENCY_MAX_COUNT as cY,
16187
- HALF_LIFE_DAYS as cZ,
16188
- RRF_K as c_,
16189
- appUserImageDirs as ca,
16190
- describeAgentWorkerExit as cb,
16191
- directMemberRef as cc,
16192
- materializeProviders as cd,
16193
- parseVirtualModels as ce,
16194
- classifierProviderFor as cf,
16195
- classifierBaseUrlFor as cg,
16196
- pickModelCapabilityOverrides as ch,
16197
- canBeVirtualMember as ci,
16198
- mcpTimeoutsForSpawn as cj,
16199
- withPrivacyMask as ck,
16200
- withUserEntryIds as cl,
16201
- UNIT_TYPES as cm,
16202
- DEDUP_MIN_CHARS as cn,
16203
- DEFAULT_IMPORTANCE as co,
16204
- DEFAULT_UNIT_TYPE as cp,
16205
- isEvolvesRelation as cq,
16206
- DEDUP_MAX as cr,
16207
- DEDUP_VECTOR as cs,
16208
- DISTILL_MAX_OUTPUT_TOKENS as ct,
16209
- DISTILL_MIN_IMPORTANCE as cu,
16210
- DISTILL_MAX_CHUNK_CHARS as cv,
16211
- DISTILL_SINGLE_EXTRACT_MAX_TOKENS as cw,
16212
- DISTILL_EXTRACT_MAX_TOKENS as cx,
16213
- DISTILL_CONSOLIDATE_MAX_TOKENS as cy,
16214
- isUnitType as cz,
16939
+ KG_MAX_ENTITIES as c$,
16940
+ supportsMultipleAccounts as c0,
16941
+ parseCodexAuthJson as c1,
16942
+ CODEX_PROVIDER_ID as c2,
16943
+ nextAccountKey as c3,
16944
+ sanitizeUpstreamBody as c4,
16945
+ defaultCodexAuthPath as c5,
16946
+ ordinalOfAccountKey as c6,
16947
+ sanitizeOauthLabel as c7,
16948
+ parseAntigravityApiKey as c8,
16949
+ fetchAntigravityUsage as c9,
16950
+ DEDUP_MIN_CHARS as cA,
16951
+ DEFAULT_IMPORTANCE as cB,
16952
+ DEFAULT_UNIT_TYPE as cC,
16953
+ isEvolvesRelation as cD,
16954
+ DEDUP_MAX as cE,
16955
+ DEDUP_VECTOR as cF,
16956
+ DISTILL_MAX_OUTPUT_TOKENS as cG,
16957
+ DISTILL_MIN_IMPORTANCE as cH,
16958
+ DISTILL_MAX_CHUNK_CHARS as cI,
16959
+ DISTILL_SINGLE_EXTRACT_MAX_TOKENS as cJ,
16960
+ DISTILL_EXTRACT_MAX_TOKENS as cK,
16961
+ DISTILL_CONSOLIDATE_MAX_TOKENS as cL,
16962
+ isUnitType as cM,
16963
+ DISTILL_MAX_ATTEMPTS as cN,
16964
+ FORGETTING_DEFAULT_MAX_IMPORTANCE as cO,
16965
+ FORGETTING_DEFAULT_STALE_DAYS as cP,
16966
+ FORGETTING_DEFAULT_INTERVAL_DAYS as cQ,
16967
+ FORGETTING_INTERVAL_DAYS_MAX as cR,
16968
+ FORGETTING_INTERVAL_DAYS_MIN as cS,
16969
+ FORGETTING_MAX_IMPORTANCE_MAX as cT,
16970
+ FORGETTING_MAX_IMPORTANCE_MIN as cU,
16971
+ FORGETTING_STALE_DAYS_MAX as cV,
16972
+ FORGETTING_STALE_DAYS_MIN as cW,
16973
+ CRYSTAL_MIN_SOURCES as cX,
16974
+ KG_MAX_LABEL_CHARS as cY,
16975
+ KG_MAX_ENTITY_NAME_CHARS as cZ,
16976
+ KG_MAX_DESCRIPTION_CHARS as c_,
16977
+ fetchDevinUsage as ca,
16978
+ DEFAULT_PERSONA_PROMPT as cb,
16979
+ parseAgentWorkerCrash as cc,
16980
+ AGENT_WORKER_EXIT_LOG as cd,
16981
+ elevatedCommandOf as ce,
16982
+ parseRestartCheckpoint as cf,
16983
+ startOauthCallbackServer as cg,
16984
+ MODELS_DEV_URL as ch,
16985
+ writeModelsDevCache as ci,
16986
+ parseModelsDevPayload as cj,
16987
+ MODELS_DEV_CACHE_NAME as ck,
16988
+ modelsDevIsFresh as cl,
16989
+ withModelsDevOauthModels as cm,
16990
+ appUserImageDirs as cn,
16991
+ describeAgentWorkerExit as co,
16992
+ directMemberRef as cp,
16993
+ materializeProviders as cq,
16994
+ parseVirtualModels as cr,
16995
+ classifierProviderFor as cs,
16996
+ classifierBaseUrlFor as ct,
16997
+ pickModelCapabilityOverrides as cu,
16998
+ canBeVirtualMember as cv,
16999
+ mcpTimeoutsForSpawn as cw,
17000
+ withPrivacyMask as cx,
17001
+ withUserEntryIds as cy,
17002
+ UNIT_TYPES as cz,
16215
17003
  skillOccupancyText as d,
16216
- TEMPORAL_YEAR_BOOST as d0,
16217
- CRYSTAL_BOOST as d1,
16218
- MMR_LAMBDA as d2,
16219
- parseMemorySearchRequest as d3,
16220
- parseMemoryCaptureRequest as d4,
16221
- parseMemoryCrystallizeRequest as d5,
16222
- parseMemoryDeleteRequest as d6,
16223
- SNAPSHOT_TAIL_MESSAGES as d7,
16224
- userTextWithoutSkills as d8,
16225
- defaultImageRoots as d9,
16226
- parseBtwAbortRequest as dA,
16227
- parseBtwSpawnRequest as dB,
16228
- BTW_DISABLED_TOOLS as dC,
16229
- parseBtwDisposeRequest as dD,
16230
- isHumanRequestTimeout as dE,
16231
- buildSshExecArgs as dF,
16232
- buildRemoteCommand as dG,
16233
- listProjectCodeSources as dH,
16234
- positiveFiniteNumber as dI,
16235
- mergeFetchedOauthModels as dJ,
16236
- supportedProjectThinkingLevels as dK,
16237
- buildSshPtyArgs as dL,
16238
- ENSO_HEADLESS_RUN_ENV as dM,
16239
- projection as dN,
16240
- classifyCommand as da,
16241
- chunkMessageText as db,
16242
- readableText as dc,
16243
- projectReadableMessages as dd,
16244
- probeImageView as de,
16245
- validateScopedFile as df,
16246
- IMAGE_VIEW_MAX_BYTES as dg,
16247
- readImageFacts as dh,
16248
- resolveSshTarget as di,
16249
- checkPassed as dj,
16250
- checkFailureText as dk,
16251
- parseVirtualClassifier as dl,
16252
- VIRTUAL_CLASSIFIER_DEFAULT_TIMEOUT_MS as dm,
16253
- isSecretFilePath as dn,
16254
- isUnderSecretDirectory as dp,
16255
- codemodeToolSnapshot as dq,
16256
- estimateToolsTotal as dr,
16257
- listCustomWorkflowPresets as ds,
16258
- listBuiltinWorkflowPresets as dt,
16259
- readCustomWorkflowPreset as du,
16260
- parseWorkflowPresetDraft as dv,
16261
- saveCustomWorkflowPreset as dw,
16262
- deleteCustomWorkflowPreset as dx,
16263
- parseBtwPromptRequest as dy,
16264
- btwModelCandidates as dz,
17004
+ buildSshPtyArgs as d$,
17005
+ KG_MAX_RELATIONS as d0,
17006
+ KG_EXTRACT_MAX_TOKENS as d1,
17007
+ KG_DEFAULT_RELATION_TYPE as d2,
17008
+ KG_DEFAULT_ENTITY_TYPE as d3,
17009
+ KG_MAX_ATTEMPTS as d4,
17010
+ MIN_FLOOR as d5,
17011
+ IMP_MULT as d6,
17012
+ RECENCY_W as d7,
17013
+ FREQUENCY_W as d8,
17014
+ FREQUENCY_MAX_COUNT as d9,
17015
+ checkFailureText as dA,
17016
+ parseVirtualClassifier as dB,
17017
+ VIRTUAL_CLASSIFIER_DEFAULT_TIMEOUT_MS as dC,
17018
+ EnsoSafeJournal as dD,
17019
+ isSecretFilePath as dE,
17020
+ isUnderSecretDirectory as dF,
17021
+ codemodeToolSnapshot as dG,
17022
+ estimateToolsTotal as dH,
17023
+ listCustomWorkflowPresets as dI,
17024
+ listBuiltinWorkflowPresets as dJ,
17025
+ readCustomWorkflowPreset as dK,
17026
+ parseWorkflowPresetDraft as dL,
17027
+ saveCustomWorkflowPreset as dM,
17028
+ deleteCustomWorkflowPreset as dN,
17029
+ parseBtwPromptRequest as dO,
17030
+ btwModelCandidates as dP,
17031
+ parseBtwAbortRequest as dQ,
17032
+ parseBtwSpawnRequest as dR,
17033
+ BTW_DISABLED_TOOLS as dS,
17034
+ parseBtwDisposeRequest as dT,
17035
+ isHumanRequestTimeout as dU,
17036
+ buildSshExecArgs as dV,
17037
+ buildRemoteCommand as dW,
17038
+ listProjectCodeSources as dX,
17039
+ positiveFiniteNumber as dY,
17040
+ mergeFetchedOauthModels as dZ,
17041
+ supportedProjectThinkingLevels as d_,
17042
+ HALF_LIFE_DAYS as da,
17043
+ RRF_K as db,
17044
+ DECAY_WEIGHT as dc,
17045
+ TEMPORAL_YEAR_BOOST as dd,
17046
+ CRYSTAL_BOOST as de,
17047
+ MMR_LAMBDA as df,
17048
+ parseMemorySearchRequest as dg,
17049
+ parseMemoryCaptureRequest as dh,
17050
+ parseMemoryCrystallizeRequest as di,
17051
+ parseMemoryDeleteRequest as dj,
17052
+ DISTILL_BATCH_MAX_CHARS as dk,
17053
+ EVOLVES_MIN_CONF as dl,
17054
+ SNAPSHOT_TAIL_MESSAGES as dm,
17055
+ userTextWithoutSkills as dn,
17056
+ defaultImageRoots as dp,
17057
+ classifyCommand as dq,
17058
+ chunkMessageText as dr,
17059
+ readableText as ds,
17060
+ projectReadableMessages as dt,
17061
+ probeImageView as du,
17062
+ validateScopedFile as dv,
17063
+ IMAGE_VIEW_MAX_BYTES as dw,
17064
+ readImageFacts as dx,
17065
+ resolveSshTarget as dy,
17066
+ checkPassed as dz,
16265
17067
  executeApplyPatch as e,
17068
+ ENSO_HEADLESS_RUN_ENV as e0,
17069
+ projection as e1,
16266
17070
  estimateToolTokens as f,
16267
17071
  estimateSkillTokens as g,
16268
17072
  estimateInstructionTokens as h,
16269
17073
  OM_REFLECTIONS_RECORDED as i,
16270
17074
  isObservationsRecordedData as j,
16271
- killProcessTree as k,
16272
- isReflectionsRecordedData as l,
16273
- isReflectionsConsolidatedData as m,
17075
+ isReflectionsRecordedData as k,
17076
+ isReflectionsConsolidatedData as l,
17077
+ isObservationsDroppedData as m,
16274
17078
  normalizeApplyPatchArguments as n,
16275
- isObservationsDroppedData as o,
17079
+ OM_REFLECTIONS_CONSOLIDATED as o,
16276
17080
  providerKeyFor as p,
16277
- OM_REFLECTIONS_CONSOLIDATED as q,
16278
- OM_OBSERVATIONS_DROPPED as r,
16279
- shellQuote as s,
17081
+ OM_OBSERVATIONS_DROPPED as q,
17082
+ OM_FOLDED as r,
17083
+ shellQuote$1 as s,
16280
17084
  toolOccupancyText as t,
16281
- OM_FOLDED as u,
16282
- isMemoryDetails as v,
16283
- isObservationsRecordedEntry as w,
16284
- isReflectionsRecordedEntry as x,
16285
- isReflectionsConsolidatedEntry as y,
16286
- isObservationsDroppedEntry as z
17085
+ isMemoryDetails as u,
17086
+ isObservationsRecordedEntry as v,
17087
+ isReflectionsRecordedEntry as w,
17088
+ isReflectionsConsolidatedEntry as x,
17089
+ isObservationsDroppedEntry as y,
17090
+ buildObservationsRecordedData as z
16287
17091
  };
16288
- //# sourceMappingURL=workflowPresets-XbQNDJh1.js.map
17092
+ //# sourceMappingURL=workflowPresets-CAA0AY6f.js.map