@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.
- package/LICENSE +679 -19
- package/out/phone/assets/{abnfDiagram-VCTEODGH-DeKO4j9Y.js → abnfDiagram-VCTEODGH-D-9apHOZ.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-DhPgDhMQ.js → architectureDiagram-5GKGNRK7-B7ti5Yuy.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-CHjEV4S2.js → blockDiagram-I7D4REHJ-CMg6PHJB.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-C_w2ZiGg.js → c4Diagram-7LVT6UL2-YtDbC01g.js} +1 -1
- package/out/phone/assets/channel-BQsoblXW.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-DsFB5306.js → chunk-4HAMMTFA-Djg6ctlZ.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-D-GYq_Mf.js → chunk-75Z2AOVW-Be2kq0FP.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-CfnOn1uu.js → chunk-DU6HZSFF-d5JZiOMy.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-DFQr9a2N.js → chunk-F27PBJKO-DHBQ6nrV.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW--AoHkXxN.js → chunk-GMAD6QVW-BatU6uXC.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-CzbFqhoi.js → chunk-GVQU2GXP-CiyvoRIy.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-DT26rqUA.js → chunk-IMKFNOWR-vOQaK90i.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-CvadXD9U.js → chunk-L3NEJ4N5-CPykFzBy.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-DROHZT6z.js → chunk-OSK3NFVY-q4NiGH59.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-BcsvTFQT.js → chunk-P2QGCYS3-DUV9S_qP.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-Bib7YUpn.js → chunk-POPQ4Y6H-CjycswNE.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-CrsdfQvi.js → chunk-PWAF6VOD-Dben6plA.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-BSSsjkbn.js → chunk-SHT3W25Y-D2hK_jmb.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-BorYBfcS.js → chunk-SVP7TREG-DLtgLN89.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-DwWprz_z.js → chunk-TICWLB2K-BeBB0_0w.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-rwnxFDXp.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-rwnxFDXp.js +1 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-UxW1ctBn.js → cynefin-OW5HDTMX-CsDdLZPP.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-3xyjt_Zk.js → cynefinDiagram-5FMLGOSQ-BcaPty-s.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-BA8g5sNo.js → dagre-GXQ25YYZ-o7dqm5ri.js} +1 -1
- package/out/phone/assets/desk-DNf6lCoq.js +2 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-CqaAk0xY.js → diagram-S7CK7UJ4-B5m8q3yP.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-BJs2alr_.js → diagram-UQ7AKVKN-_lP617OW.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-goFBlClH.js → diagram-VSXAHHWV-D16twHR0.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-NC_soOMz.js → diagram-VX7I27RA-BT8YSil1.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-CPBmdhd-.js → diagram-Z3DM3KII-CiSuhrxd.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-e_KXtWp1.js → ebnfDiagram-PWID7BFC-BbCXn4HA.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-BV3oU6Yk.js → erDiagram-RLTQ6QDP-5-xE_bP2.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-BVS2RGt-.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-BSlxj9Uk.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-DOtr1Ilh.js → ganttDiagram-EL5Y4UJY-Rqgggqg_.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-D0CbVtzh.js → gitGraph-4MIJSDKK-Drt18ZKK.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-C6wXAX8a.js → gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-BLbppMXJ.js → info-A6RAGUB7-CpPeSHE0.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-DOlhaNYG.js → infoDiagram-27XIBGKW-D3d9S0Y6.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-BtaSUSnr.js → ishikawaDiagram-5VMMS53U-plFMqx62.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-C6DElK_Y.js → journeyDiagram-3NMN7TZE-CX-n-XXx.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-WqCAwlkm.js → kanban-definition-UXKFOSKX-DrdTzKIc.js} +1 -1
- package/out/phone/assets/{line-CvY1fizC.js → line-CqyaArNm.js} +1 -1
- package/out/phone/assets/main-BGlFv7yA.js +1658 -0
- package/out/phone/assets/main-BS1SSCau.css +1 -0
- package/out/phone/assets/{mermaid-parser.core-BNyl33x8.js → mermaid-parser.core-CERMa6fg.js} +3 -3
- package/out/phone/assets/{mermaid.core-BnUF0ZCX.js → mermaid.core-CbGP2wFn.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-CsORTLIm.js → mindmap-definition-YA3MSWOX-BxaIrov6.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-CoxwVVdp.js → packet-AYTQ26CC-DguFQxPm.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-BI2W6aLH.js → pegDiagram-XKGWAZYB-t3td03dz.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-CQD3JNcj.js → pie-WAS4IAKB-DoFu2rhu.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-aLnzVgco.js → pieDiagram-E7YTZNPT-DctHLSL8.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Cbl0x-Id.js → quadrantDiagram-AXDQQJYC-Br7-ImNr.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-Bu2EN1RM.js → radar-RG4KPBEZ-BDjTOHD8.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-DiiOMWSM.js → railroad-74A4TZTK-v8vsrpxb.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-CUELjEtC.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-DdIokM4i.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-DYyy0B-_.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-r5JJp9nP.js → railroadDiagram-O6MQD6OU-DtH4qQrr.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-Bh86zb_w.js → requirementDiagram-BXWQKSXE-BSqejjZP.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CykRlthT.js → sankeyDiagram-P5KCCOFB-DsTWuNtL.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BPLcD6MF.js → sequenceDiagram-WJ2MYXX4-zLMvPyPC.js} +1 -1
- package/out/phone/assets/{stateDiagram-D77RDMKH-DWXApcUM.js → stateDiagram-D77RDMKH-DrBC05BN.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-DT7BlwvF.js +1 -0
- package/out/phone/assets/storage-BeJvYXAx.js +36 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-BVi6IPTq.js → swimlanes-42K2YHIH-B27-qSm5.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CWnm4v0A.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-xf--BXjO.js → timeline-definition-24CTP7MA-8NDkGf5U.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-DzJs7PRI.js → treeView-Q6P3EWNA-B9BXwCDC.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-AXb7EeRP.js → treemap-WGGIJYW6-B0IqbwdT.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-CXDX5KG5.js → vennDiagram-4TSXK5OY-Dp-aKgNa.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-DrSIz3RL.js → wardley-WFR3VGLG-B7FlADZf.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-DFL8ndUf.js → wardleyDiagram-VM6X3IG4-BVntjQNl.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-CZZX0maW.js → xychartDiagram-S5SC5T6Z-kgVJvkgO.js} +1 -1
- package/out/phone/desk.html +2 -2
- package/out/phone/index.html +3 -3
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-C03tURh9.js → abnfDiagram-VCTEODGH-Bp0r3dKm.js} +1 -1
- package/out/renderer/assets/{arc-B9ePZBoh.js → arc-BD5HnhIt.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-xqG-LPqx.js → architectureDiagram-5GKGNRK7-CgJHjETB.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-BJCB1uWW.js → blockDiagram-I7D4REHJ-5le9vk4G.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-B8YiLE3O.js → c4Diagram-7LVT6UL2-B4DCe-qN.js} +1 -1
- package/out/renderer/assets/channel-D-HltTAP.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-BfCgzuF1.js → chunk-2Q5K7J3B-DIxWfJHE.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-j2RDggaS.js → chunk-5VM5RSS4-D9j4om1l.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-D1w1G98C.js → chunk-F27PBJKO-B_tGbKyc.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-HX7TqjEn.js → chunk-IMKFNOWR-Cfffd1p9.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-Ee_2ucfe.js → chunk-JWPE2WC7-BABZOPGb.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-DuxBT9GV.js → chunk-POPQ4Y6H-D-QyVpSn.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-DFjkSsO8.js → chunk-SVP7TREG-BghyPSd6.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-1B31w-4D.js → chunk-TICWLB2K-CQmthy6z.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-DZ7nGbEc.js → chunk-XXDRQBXY-CDKsbyR7.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BCWhgMul.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BCWhgMul.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-k2aKhVw_.js → cose-bilkent-JH36ORCC-oajViFnN.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-xPUo1qjT.js → cynefin-OW5HDTMX-DMH1CUmI.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-KbWg9eRv.js → cynefinDiagram-5FMLGOSQ-DVUJf9t0.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-CLBXU3_O.js → cytoscape-fcose-adTZ191M.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-ilq61to2.js → dagre-GXQ25YYZ-BXRWWNje.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-DsRzYvTT.js → diagram-S7CK7UJ4-Dg7f2Dan.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-nE6Ly2i6.js → diagram-UQ7AKVKN-DsLRyZAt.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-B9Crbma_.js → diagram-VSXAHHWV-3_LoodSS.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-Bm5JhnFh.js → diagram-VX7I27RA-DQeZp2Cz.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-ZD7ANoYg.js → diagram-Z3DM3KII-Dwil6g5m.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CT3pW9tk.js → ebnfDiagram-PWID7BFC-DecVNxpu.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-D0ikskdu.js → erDiagram-RLTQ6QDP-D2rmo2nP.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-BOF_JMXY.js → flowDiagram-HODETNUW-_SF2dRBl.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BCEnP39-.js → ganttDiagram-EL5Y4UJY-BoYWs5Ev.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-WpPHHkc3.js → gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js} +1 -1
- package/out/renderer/assets/globals-BEwCf508.css +1 -0
- package/out/renderer/assets/{globals-DWAN16wT.js → globals-C3zxoqqH.js} +223 -223
- package/out/renderer/assets/index-9vqh4wxi.js +133 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-nRW-sje9.js → infoDiagram-27XIBGKW-CFt6xyuD.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CEfZo_k8.js → ishikawaDiagram-5VMMS53U-CZB8G4dD.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-C5hopb9Y.js → journeyDiagram-3NMN7TZE-CO2VRmpx.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-D9XV2n-x.js → kanban-definition-UXKFOSKX-DIqEnfMM.js} +1 -1
- package/out/renderer/assets/{layout-t2tiRL7x.js → layout-DXRKfO_Y.js} +1 -1
- package/out/renderer/assets/{linear-DJLwPmUz.js → linear-Cdx1AdZJ.js} +1 -1
- package/out/renderer/assets/{mermaid.core-C0XHWibr.js → mermaid.core-DuIO2jsm.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-DD-erShR.js → mindmap-definition-YA3MSWOX-B5lvxG2M.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-DZ0Jk0gq.js → pegDiagram-XKGWAZYB-DCwHp-K3.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-E7wG7xIV.js → pieDiagram-E7YTZNPT-Dq048Wh7.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-iyjmw417.js → quadrantDiagram-AXDQQJYC-DwkFkAi_.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-vCkzrMpv.js → railroadDiagram-O6MQD6OU-2NKvwLP-.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-DJ7nU4ps.js → requirementDiagram-BXWQKSXE-Bp44tNQ0.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-1TKFsYjQ.js → sankeyDiagram-P5KCCOFB-C3TFp1NK.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-C3ajyWo7.js → sequenceDiagram-WJ2MYXX4-BTPoYQeW.js} +1 -1
- package/out/renderer/assets/settings-DlDHkOe2.js +25 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-BKripAfM.js → sizeCapture-INFHLROL-DvNj5TDT.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-DSqc4avN.js → stateDiagram-D77RDMKH-DC8YykNp.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-C2Jeg683.js → swimlanes-42K2YHIH-0yL1nNkg.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-rvOKRLqz.js → timeline-definition-24CTP7MA-Pg-2roGv.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-Cig1eOav.js → vennDiagram-4TSXK5OY-D0af5K4E.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-C8spX5XL.js → wardleyDiagram-VM6X3IG4-CB_nIy_l.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DHQsGiFY.js → xychartDiagram-S5SC5T6Z-A26Yld8R.js} +1 -1
- package/out/renderer/index.html +3 -3
- package/out/renderer/settings.html +4 -4
- package/out/renderer/web-preload.js +39 -39
- package/out/server/agent.js +276 -506
- package/out/server/chunks/{agent-BbLTL3oo.js → agent-D33nI7fP.js} +176 -195
- package/out/server/chunks/dispatchModel-CsfmL396.js +20 -0
- package/out/server/chunks/gpuBackendInstall-CRzfB150.js +237 -0
- package/out/server/chunks/{loadProvider-ff0h4G9y.js → loadProvider-4Y15KP7W.js} +2 -2
- package/out/server/chunks/{manifest-DjsZzZuh.js → manifest-wlfh-NN5.js} +2 -2
- package/out/server/chunks/{resources-DmaKIeBc.js → resources-DzUshg1j.js} +3 -3
- package/out/server/chunks/{storageScanWorker-BQ1LXUu7.js → storageScanWorker-CX8O_DlF.js} +2 -2
- package/out/server/chunks/{storageScanWorker-Bebego8l.js → storageScanWorker-CuttDIGS.js} +2 -2
- package/out/server/chunks/{workflowPresets-XbQNDJh1.js → workflowPresets-CAA0AY6f.js} +1091 -287
- package/out/server/index.js +2376 -3358
- package/out/server/plugin-host.js +2 -2
- package/package.json +2 -3
- package/out/phone/assets/architecture-7GRP2DOG-C-qor9pl.js +0 -1
- package/out/phone/assets/channel-X_IbcoWa.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-BM8gYXGQ.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-BM8gYXGQ.js +0 -1
- package/out/phone/assets/desk-BNoyCelL.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-BdEBApKV.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-OPg41_ia.js +0 -1
- package/out/phone/assets/main-BU1pbfVw.css +0 -1
- package/out/phone/assets/main-ZLMPRLjZ.js +0 -1658
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BoQXwOPL.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-1G126duh.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-C7pIuHge.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-BMZswIYt.js +0 -1
- package/out/phone/assets/storage-dUWOZ2xo.js +0 -36
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-RYt3eASc.js +0 -8
- package/out/renderer/assets/channel-DwCSANyp.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BT-9dtRl.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BT-9dtRl.js +0 -1
- package/out/renderer/assets/globals-DoPyZAQo.css +0 -1
- package/out/renderer/assets/index-DOUivox4.js +0 -133
- package/out/renderer/assets/settings-BmMFkVO5.js +0 -27
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-JOz8ISDT.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-Km8IGI0J.js +0 -8
- package/out/server/chunks/engine-IZbRceya.js +0 -70
- package/out/server/chunks/engineWorker-CQxNRdLD.js +0 -6
- package/out/server/chunks/engineWorker-CrUIcXCt.js +0 -73
- package/out/server/chunks/gpuBackendInstall-COO4pT2M.js +0 -158
- package/out/server/chunks/hanbao-_aDjow_f.js +0 -187
- package/out/server/chunks/speech-CqK6_tIR.js +0 -25
- package/out/server/chunks/wetype-CR0YLhHP.js +0 -677
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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 =
|
|
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
|
-
|
|
16780
|
+
replacePersonaParagraph as $,
|
|
15993
16781
|
AGENT_WORKER_CRASH_FILE as A,
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
16002
|
-
|
|
16003
|
-
|
|
16004
|
-
|
|
16005
|
-
|
|
16006
|
-
|
|
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
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
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
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
|
|
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
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
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
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
|
|
16039
|
-
|
|
16040
|
-
|
|
16041
|
-
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
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
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
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
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
|
|
16122
|
-
|
|
16123
|
-
|
|
16124
|
-
|
|
16125
|
-
|
|
16126
|
-
|
|
16127
|
-
|
|
16128
|
-
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16140
|
-
|
|
16141
|
-
|
|
16142
|
-
|
|
16143
|
-
|
|
16144
|
-
|
|
16145
|
-
|
|
16146
|
-
|
|
16147
|
-
|
|
16148
|
-
|
|
16149
|
-
|
|
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
|
-
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
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
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
|
|
16226
|
-
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
-
|
|
16230
|
-
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16237
|
-
|
|
16238
|
-
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16244
|
-
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
|
|
16257
|
-
|
|
16258
|
-
|
|
16259
|
-
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
|
|
16263
|
-
|
|
16264
|
-
|
|
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
|
-
|
|
16272
|
-
|
|
16273
|
-
|
|
17075
|
+
isReflectionsRecordedData as k,
|
|
17076
|
+
isReflectionsConsolidatedData as l,
|
|
17077
|
+
isObservationsDroppedData as m,
|
|
16274
17078
|
normalizeApplyPatchArguments as n,
|
|
16275
|
-
|
|
17079
|
+
OM_REFLECTIONS_CONSOLIDATED as o,
|
|
16276
17080
|
providerKeyFor as p,
|
|
16277
|
-
|
|
16278
|
-
|
|
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
|
-
|
|
16282
|
-
|
|
16283
|
-
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
|
|
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-
|
|
17092
|
+
//# sourceMappingURL=workflowPresets-CAA0AY6f.js.map
|