@ensocode/server 0.3.12 → 0.3.13
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/out/phone/assets/EditDiff-B3HxLrbF.js +28 -0
- package/out/phone/assets/ReadFileView-BFpGH-kK.js +7 -0
- package/out/phone/assets/{abnfDiagram-VCTEODGH-D-9apHOZ.js → abnfDiagram-VCTEODGH-BNvyPGoF.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-Duql1LsL.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-B7ti5Yuy.js → architectureDiagram-5GKGNRK7-1bhpTEFA.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-CMg6PHJB.js → blockDiagram-I7D4REHJ-Bo9UMudu.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-YtDbC01g.js → c4Diagram-7LVT6UL2-YS11cig2.js} +1 -1
- package/out/phone/assets/channel-BPoIHov1.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-Djg6ctlZ.js → chunk-4HAMMTFA-gA-CzNGD.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-Be2kq0FP.js → chunk-75Z2AOVW-BL_5b1Dw.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-d5JZiOMy.js → chunk-DU6HZSFF-BpNlAs9R.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-DHBQ6nrV.js → chunk-F27PBJKO-lsKx96Nt.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW-BatU6uXC.js → chunk-GMAD6QVW-CxbljbtE.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-CiyvoRIy.js → chunk-GVQU2GXP-CTO3kTOF.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-vOQaK90i.js → chunk-IMKFNOWR-Cq8XlkcB.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-CPykFzBy.js → chunk-L3NEJ4N5-CvIm0JX7.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-q4NiGH59.js → chunk-OSK3NFVY-Cj3ilTL-.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-DUV9S_qP.js → chunk-P2QGCYS3-B-twI_Fz.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-CjycswNE.js → chunk-POPQ4Y6H-lPQttJ5s.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-Dben6plA.js → chunk-PWAF6VOD-DjwqZuIR.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-D2hK_jmb.js → chunk-SHT3W25Y-BWRVin1H.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-DLtgLN89.js → chunk-SVP7TREG-CGLhvnsS.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-BeBB0_0w.js → chunk-TICWLB2K-DkFUa03q.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-CIR76lHP.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-CIR76lHP.js +1 -0
- package/out/phone/assets/codeHighlighter-jQti-W31.js +1346 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-CsDdLZPP.js → cynefin-OW5HDTMX-L8oWVu5S.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-BcaPty-s.js → cynefinDiagram-5FMLGOSQ-DH8-4p4N.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-o7dqm5ri.js → dagre-GXQ25YYZ-HhLDmcu9.js} +1 -1
- package/out/phone/assets/desk-CixRGdTk.js +52 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-B5m8q3yP.js → diagram-S7CK7UJ4-CeIbR3Ir.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-_lP617OW.js → diagram-UQ7AKVKN-BQ84Qnq6.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-D16twHR0.js → diagram-VSXAHHWV-aF_J57fD.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-BT8YSil1.js → diagram-VX7I27RA-Bg1ZqM4Y.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-CiSuhrxd.js → diagram-Z3DM3KII-DjTkPAqa.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-BbCXn4HA.js → ebnfDiagram-PWID7BFC-DPsH5Eky.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-5-xE_bP2.js → erDiagram-RLTQ6QDP-ExvY7e6T.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-DYp-zWcL.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-CIU32By5.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-Rqgggqg_.js → ganttDiagram-EL5Y4UJY-hCe06ucl.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-Drt18ZKK.js → gitGraph-4MIJSDKK-BuZ6lDat.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js → gitGraphDiagram-WWUBYQGX-D-8aVxvj.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-CpPeSHE0.js → info-A6RAGUB7-CrZtdoYs.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-D3d9S0Y6.js → infoDiagram-27XIBGKW-BLRFHxtO.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-plFMqx62.js → ishikawaDiagram-5VMMS53U-D7SYWKoj.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-CX-n-XXx.js → journeyDiagram-3NMN7TZE-BPsg7CQD.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-DrdTzKIc.js → kanban-definition-UXKFOSKX-CbPuNr-E.js} +1 -1
- package/out/phone/assets/{line-CqyaArNm.js → line-CkpKMiqK.js} +1 -1
- package/out/phone/assets/main-BCnf7dVM.js +264 -0
- package/out/phone/assets/main-nqB-uD3v.css +2 -0
- package/out/phone/assets/{mermaid-parser.core-CERMa6fg.js → mermaid-parser.core-RTq_mEm1.js} +3 -3
- package/out/phone/assets/{mermaid.core-CbGP2wFn.js → mermaid.core-D9LtIKua.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-BxaIrov6.js → mindmap-definition-YA3MSWOX-8cGgRiRD.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-DguFQxPm.js → packet-AYTQ26CC-D9-eSn0v.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-t3td03dz.js → pegDiagram-XKGWAZYB-DztU_rIE.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-DoFu2rhu.js → pie-WAS4IAKB-Bk2Tqaq_.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-DctHLSL8.js → pieDiagram-E7YTZNPT-Dm_3mJ9_.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Br7-ImNr.js → quadrantDiagram-AXDQQJYC-lKskzjzu.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-BDjTOHD8.js → radar-RG4KPBEZ-B2z8Txd8.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-v8vsrpxb.js → railroad-74A4TZTK-11VmdALq.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BkSycwye.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BsPIU3iV.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-Cy8G7u5C.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-DtH4qQrr.js → railroadDiagram-O6MQD6OU-Dr0NTIA6.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-BSqejjZP.js → requirementDiagram-BXWQKSXE-C0W6h_5I.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-DsTWuNtL.js → sankeyDiagram-P5KCCOFB-CVJDathY.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-zLMvPyPC.js → sequenceDiagram-WJ2MYXX4-BxHQTG6x.js} +1 -1
- package/out/phone/assets/shellUpdate-DPSfgHG3.js +36 -0
- package/out/phone/assets/{stateDiagram-D77RDMKH-DrBC05BN.js → stateDiagram-D77RDMKH-BO5MAjhs.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-B8IHc2bm.js +1 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-B27-qSm5.js → swimlanes-42K2YHIH-DnhDPyy6.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-dmSDAN2F.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-8NDkGf5U.js → timeline-definition-24CTP7MA-bLEjS7re.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-B9BXwCDC.js → treeView-Q6P3EWNA-Ci-sA9wK.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-B0IqbwdT.js → treemap-WGGIJYW6-BXCjzK65.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-Dp-aKgNa.js → vennDiagram-4TSXK5OY-DHsj5dRx.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-B7FlADZf.js → wardley-WFR3VGLG-d8TdCu-H.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-BVntjQNl.js → wardleyDiagram-VM6X3IG4-DQFVP9qu.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-kgVJvkgO.js → xychartDiagram-S5SC5T6Z-Dni2Y0ov.js} +1 -1
- package/out/phone/desk.html +81 -2
- package/out/phone/index.html +51 -3
- package/out/phone/manifest.webmanifest +1 -0
- package/out/phone/splash/1125x2436-dark.png +0 -0
- package/out/phone/splash/1125x2436-light.png +0 -0
- package/out/phone/splash/1170x2532-dark.png +0 -0
- package/out/phone/splash/1170x2532-light.png +0 -0
- package/out/phone/splash/1179x2556-dark.png +0 -0
- package/out/phone/splash/1179x2556-light.png +0 -0
- package/out/phone/splash/1206x2622-dark.png +0 -0
- package/out/phone/splash/1206x2622-light.png +0 -0
- package/out/phone/splash/1242x2208-dark.png +0 -0
- package/out/phone/splash/1242x2208-light.png +0 -0
- package/out/phone/splash/1242x2688-dark.png +0 -0
- package/out/phone/splash/1242x2688-light.png +0 -0
- package/out/phone/splash/1260x2736-dark.png +0 -0
- package/out/phone/splash/1260x2736-light.png +0 -0
- package/out/phone/splash/1284x2778-dark.png +0 -0
- package/out/phone/splash/1284x2778-light.png +0 -0
- package/out/phone/splash/1290x2796-dark.png +0 -0
- package/out/phone/splash/1290x2796-light.png +0 -0
- package/out/phone/splash/1320x2868-dark.png +0 -0
- package/out/phone/splash/1320x2868-light.png +0 -0
- package/out/phone/splash/750x1334-dark.png +0 -0
- package/out/phone/splash/750x1334-light.png +0 -0
- package/out/phone/splash/828x1792-dark.png +0 -0
- package/out/phone/splash/828x1792-light.png +0 -0
- package/out/phone/sw.js +219 -6
- package/out/renderer/assets/EditDiff-DxxLuCEI.js +1 -0
- package/out/renderer/assets/File-Tz3MUtN6.js +1 -0
- package/out/renderer/assets/ReadFileView-DFoLPU04.js +4 -0
- package/out/renderer/assets/SidePanel-CL40W2RY.js +47 -0
- package/out/renderer/assets/SidePanel-D0m4IYxS.css +1 -0
- package/out/renderer/assets/Virtualizer-B0uwx_XV.js +1345 -0
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-Bp0r3dKm.js → abnfDiagram-VCTEODGH-CJ9nn9eH.js} +1 -1
- package/out/renderer/assets/{arc-BD5HnhIt.js → arc-B8im8n0O.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-CgJHjETB.js → architectureDiagram-5GKGNRK7-BRSi5FBk.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-5le9vk4G.js → blockDiagram-I7D4REHJ-CQ1wirIl.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-B4DCe-qN.js → c4Diagram-7LVT6UL2-9HyLIioe.js} +1 -1
- package/out/renderer/assets/channel-DjB0ww6b.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-DIxWfJHE.js → chunk-2Q5K7J3B-BwC9g3bx.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-D9j4om1l.js → chunk-5VM5RSS4-DMtgxPBL.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-B_tGbKyc.js → chunk-F27PBJKO-DSi_XV5v.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-Cfffd1p9.js → chunk-IMKFNOWR-Dctc6Apj.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-BABZOPGb.js → chunk-JWPE2WC7-I2BD5qM7.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-D-QyVpSn.js → chunk-POPQ4Y6H-k60pc4eT.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-BghyPSd6.js → chunk-SVP7TREG-zCGemfqm.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-CQmthy6z.js → chunk-TICWLB2K-CdDiHIq-.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-CDKsbyR7.js → chunk-XXDRQBXY-GYVDxVfN.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-6SiAw1np.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-6SiAw1np.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-oajViFnN.js → cose-bilkent-JH36ORCC-BnSAtUh-.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-DMH1CUmI.js → cynefin-OW5HDTMX-DnQaS9VN.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-DVUJf9t0.js → cynefinDiagram-5FMLGOSQ-BNQdw0PV.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-adTZ191M.js → cytoscape-fcose-CzkrRInm.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-BXRWWNje.js → dagre-GXQ25YYZ-fG1vMsyn.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-Dg7f2Dan.js → diagram-S7CK7UJ4-BcfAFVc2.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-DsLRyZAt.js → diagram-UQ7AKVKN-D8f3Tsx9.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-3_LoodSS.js → diagram-VSXAHHWV-B-U9CIWt.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-DQeZp2Cz.js → diagram-VX7I27RA-CX6ifTkJ.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-Dwil6g5m.js → diagram-Z3DM3KII-49dS9s3L.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-DecVNxpu.js → ebnfDiagram-PWID7BFC-CraGJRI7.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-D2rmo2nP.js → erDiagram-RLTQ6QDP-CfMNvEoW.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-_SF2dRBl.js → flowDiagram-HODETNUW-C8XM3p4T.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BoYWs5Ev.js → ganttDiagram-EL5Y4UJY-DlJBMKFX.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js → gitGraphDiagram-WWUBYQGX-DvEzDsKF.js} +1 -1
- package/out/renderer/assets/globals-BFf1P-Y5.js +715 -0
- package/out/renderer/assets/globals-DUBhAVpU.css +1 -0
- package/out/renderer/assets/index-L4TTIP10.js +89 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-CFt6xyuD.js → infoDiagram-27XIBGKW-CckfBO-R.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CZB8G4dD.js → ishikawaDiagram-5VMMS53U-mUoXchkB.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-CO2VRmpx.js → journeyDiagram-3NMN7TZE-zzLL0HFW.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-DIqEnfMM.js → kanban-definition-UXKFOSKX-BJ_9aIhB.js} +1 -1
- package/out/renderer/assets/{layout-DXRKfO_Y.js → layout-3SRMHY7n.js} +1 -1
- package/out/renderer/assets/{linear-Cdx1AdZJ.js → linear-CWpclK_R.js} +1 -1
- package/out/renderer/assets/manifest-DOzTaB8J.js +525 -0
- package/out/renderer/assets/{mermaid.core-DuIO2jsm.js → mermaid.core-DORpmVi3.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-B5lvxG2M.js → mindmap-definition-YA3MSWOX-CYBlCqIB.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-DCwHp-K3.js → pegDiagram-XKGWAZYB-DhWwLs4v.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-Dq048Wh7.js → pieDiagram-E7YTZNPT-Bzpc57-A.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-DwkFkAi_.js → quadrantDiagram-AXDQQJYC-spKXEbds.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-2NKvwLP-.js → railroadDiagram-O6MQD6OU-Br553px3.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-Bp44tNQ0.js → requirementDiagram-BXWQKSXE-CX-Dqij_.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-C3TFp1NK.js → sankeyDiagram-P5KCCOFB-Bgx1W6B9.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-BTPoYQeW.js → sequenceDiagram-WJ2MYXX4-CKQv6pcU.js} +1 -1
- package/out/renderer/assets/sessionChanges-BLzNhRuv.js +31 -0
- package/out/renderer/assets/settings-Bsrw4ERp.js +25 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-DvNj5TDT.js → sizeCapture-INFHLROL-DtRedfRe.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-DC8YykNp.js → stateDiagram-D77RDMKH-CMP5owem.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-6-731AqJ.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-0yL1nNkg.js → swimlanes-42K2YHIH-D30AvvmW.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-B8KijqIT.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-Pg-2roGv.js → timeline-definition-24CTP7MA-CsZAMmMZ.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-D0af5K4E.js → vennDiagram-4TSXK5OY-COQ7L1f7.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-CB_nIy_l.js → wardleyDiagram-VM6X3IG4-dqMWLTCs.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-A26Yld8R.js → xychartDiagram-S5SC5T6Z-DX4clIYP.js} +1 -1
- package/out/renderer/index.html +3 -4
- package/out/renderer/plugin-view.html +37 -0
- package/out/renderer/settings.html +7 -4
- package/out/renderer/web-preload.js +28 -28
- package/out/server/agent.js +663 -124
- package/out/server/chunks/{agent-D33nI7fP.js → agent-BbNq8i9j.js} +909 -592
- package/out/server/chunks/conversationsMove-CvFPFHaa.js +587 -0
- package/out/server/chunks/{gpuBackendInstall-CRzfB150.js → gpuBackendInstall-jAzoFq7U.js} +3 -3
- package/out/server/chunks/{loadProvider-4Y15KP7W.js → loadProvider-NdOVbsHi.js} +2 -2
- package/out/server/chunks/{manifest-wlfh-NN5.js → manifest-BPXFscqI.js} +9 -3
- package/out/server/chunks/registry-BhoHPSKn.js +3353 -0
- package/out/server/chunks/{resources-DzUshg1j.js → resources-BfbTkFP0.js} +21 -10
- package/out/server/chunks/sendImage-BCNW9JRV.js +418 -0
- package/out/server/chunks/{storageScanWorker-CuttDIGS.js → storageScanWorker-CR7HbOWG.js} +2 -2
- package/out/server/chunks/{storageScanWorker-CX8O_DlF.js → storageScanWorker-DjFyHTye.js} +2 -2
- package/out/server/chunks/{workflowPresets-CAA0AY6f.js → workflowPresets-C2T1BzA2.js} +863 -662
- package/out/server/index.js +13584 -15047
- package/out/server/memory-service.js +5008 -0
- package/out/server/plugin-host.js +2 -2
- package/package.json +1 -1
- package/out/phone/assets/EnsoNerdSymbolsMono-Regular-TdeMQojc.ttf +0 -0
- package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +0 -1
- package/out/phone/assets/channel-BQsoblXW.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-rwnxFDXp.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-rwnxFDXp.js +0 -1
- package/out/phone/assets/desk-DNf6lCoq.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-BVS2RGt-.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-BSlxj9Uk.js +0 -1
- package/out/phone/assets/main-BGlFv7yA.js +0 -1658
- package/out/phone/assets/main-BS1SSCau.css +0 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-CUELjEtC.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-DdIokM4i.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-DYyy0B-_.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-DT7BlwvF.js +0 -1
- package/out/phone/assets/storage-BeJvYXAx.js +0 -36
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CWnm4v0A.js +0 -8
- package/out/renderer/assets/channel-D-HltTAP.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BCWhgMul.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BCWhgMul.js +0 -1
- package/out/renderer/assets/globals-BEwCf508.css +0 -1
- package/out/renderer/assets/globals-C3zxoqqH.js +0 -2603
- package/out/renderer/assets/index-9vqh4wxi.js +0 -133
- package/out/renderer/assets/index-F_0FxVZ_.css +0 -1
- package/out/renderer/assets/settings-DlDHkOe2.js +0 -25
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +0 -8
- package/out/server/chunks/conversationsMove-CJZfkj55.js +0 -57
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import fs, { existsSync, renameSync, readFileSync, writeFileSync, statSync, appendFileSync, mkdirSync, realpathSync, constants, lstatSync, readdirSync, openSync, closeSync,
|
|
2
|
-
import { T as THINKING_LEVELS$1, a8 as APPROVAL_MODES, g as MODEL_REASONING_OVERRIDES, h as MODEL_THINKING_LEVEL_OVERRIDES,
|
|
1
|
+
import fs, { existsSync, renameSync, readFileSync, writeFileSync, statSync, appendFileSync, mkdirSync, realpathSync, constants, lstatSync, readdirSync, openSync, closeSync, readSync, rmSync, 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, b9 as splitPlanPrefix, bG as DEFAULT_BASE_URLS, $ as isClassifierOnlyProvider, bL as PROJECTED_FILE_TEXT_LIMIT, bA as SHELL_LIMITS, bM as imageGenerationPreviewPaths, bN as parseGeneratedImagePaths, bO as parseMaskReport, P as PLUGIN_MESSAGE_TYPE, bP as parsePluginMessageSource, bQ as parseRtkToolStats, bR as isBackgroundTaskId, bS as parseShellFailure, aq as parsePluginToolName, bT as pluginArtifactsFromToolDetails, bU as parseApprovalReviewRecord, bV as PROJECTED_FILE_CHANGE_LIMIT, bW as PROJECTED_APPLY_PATCH_PATH_TEXT_LIMIT, bX as PROJECTED_APPLY_PATCH_PATH_COUNT_LIMIT, a4 as PRIVACY_MASK_ENTRY, aD as parsePrivacyMaskRecord, a3 as mergeMaskReports, bY as foldPlanState, bZ as PLAN_MODE_ON_NOTE, b_ as PLAN_MODE_OFF_NOTE, b$ as planFeedbackText, c0 as planKickoffText, c1 as activePlanNote, c2 as PLAN_TITLE_MAX, c3 as PLAN_TEXT_MAX, c4 as planPhase, L as PLAN_ENTRY_TYPE, c5 as parsePlanEntry, aW as AGENT_TASK_MAX_RESUMES, aX as AGENT_WAIT_DEFAULT_MS, aY as AGENT_WAIT_MAX_MS, c6 as parseAgentControlToolRequest, bc as TURN_REPORT_MAX_CHARS, c7 as nativeSearchKindFor, c8 as isWorkflowPresetId } from "./agent-BbNq8i9j.js";
|
|
3
3
|
import { readFile, writeFile, rename, rm, unlink, open, lstat, chmod, realpath, access, mkdir } from "node:fs/promises";
|
|
4
4
|
import os, { constants as constants$1, homedir } from "node:os";
|
|
5
5
|
import path, { join, dirname } from "node:path";
|
|
@@ -9,11 +9,12 @@ import * as PiAi from "@earendil-works/pi-ai";
|
|
|
9
9
|
import { getCurrentSystemPrompt, getCurrentTools, clampThinkingLevel } from "@earendil-works/pi-ai";
|
|
10
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, execFileSync } from "node:child_process";
|
|
12
|
+
import { spawn, execFileSync, execFile } 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";
|
|
16
16
|
import { isUtf8 } from "node:buffer";
|
|
17
|
+
import { Q as normalizeMemorySearchParams, U as normalizeMemoryCaptureParams, V as normalizeMemoryCrystallizeParams, C as CRYSTAL_MIN_SOURCES, W as normalizeMemoryDeleteParams, X as MEMORY_SEARCH_MODES, Y as MEMORY_SEARCH_SPACES, Z as MEMORY_SEARCH_MAX_LIMIT, _ as EVOLVES_RELATIONS, $ as MEMORY_CAPTURE_SPACES, a0 as UNIT_TYPES } from "./sendImage-BCNW9JRV.js";
|
|
17
18
|
import { lookup } from "node:dns/promises";
|
|
18
19
|
import { isIP, BlockList } from "node:net";
|
|
19
20
|
import { Readability } from "@mozilla/readability";
|
|
@@ -540,7 +541,7 @@ const MODELS_DEV_URL = "https://models.dev/api.json";
|
|
|
540
541
|
const MODELS_DEV_TTL_MS = 4 * 60 * 60 * 1e3;
|
|
541
542
|
const MODELS_DEV_SCHEMA_VERSION = 1;
|
|
542
543
|
const MODELS_DEV_CACHE_NAME = "models-dev-cache.json";
|
|
543
|
-
function asRecord$
|
|
544
|
+
function asRecord$5(value) {
|
|
544
545
|
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
545
546
|
return value;
|
|
546
547
|
}
|
|
@@ -552,12 +553,12 @@ function nonNegative(value) {
|
|
|
552
553
|
}
|
|
553
554
|
function isTextChat(model) {
|
|
554
555
|
if (model.tool_call !== true) return false;
|
|
555
|
-
const output = asRecord$
|
|
556
|
+
const output = asRecord$5(model.modalities)?.output;
|
|
556
557
|
if (output === void 0) return true;
|
|
557
558
|
return Array.isArray(output) && output.includes("text");
|
|
558
559
|
}
|
|
559
560
|
function parseCost(value) {
|
|
560
|
-
const record = asRecord$
|
|
561
|
+
const record = asRecord$5(value);
|
|
561
562
|
if (!record) return void 0;
|
|
562
563
|
const input = nonNegative(record.input);
|
|
563
564
|
const output = nonNegative(record.output);
|
|
@@ -575,11 +576,11 @@ function parseCost(value) {
|
|
|
575
576
|
return cost.input || cost.output || cost.cacheRead || cost.cacheWrite ? cost : void 0;
|
|
576
577
|
}
|
|
577
578
|
function parseLiveModel(provider, key, value) {
|
|
578
|
-
const model = asRecord$
|
|
579
|
+
const model = asRecord$5(value);
|
|
579
580
|
if (!model || !isTextChat(model)) return void 0;
|
|
580
581
|
const id = typeof model.id === "string" && model.id.trim() ? model.id.trim() : key.trim();
|
|
581
582
|
if (!id) return void 0;
|
|
582
|
-
const limit = asRecord$
|
|
583
|
+
const limit = asRecord$5(model.limit);
|
|
583
584
|
const contextWindow = positiveInt(limit?.context) ?? positiveInt(limit?.input);
|
|
584
585
|
const maxTokens = positiveInt(limit?.output);
|
|
585
586
|
const name = typeof model.name === "string" && model.name.trim() ? model.name.trim() : void 0;
|
|
@@ -595,11 +596,11 @@ function parseLiveModel(provider, key, value) {
|
|
|
595
596
|
};
|
|
596
597
|
}
|
|
597
598
|
function parseModelsDevPayload(raw, fetchedAt, source = MODELS_DEV_URL) {
|
|
598
|
-
const root = asRecord$
|
|
599
|
+
const root = asRecord$5(raw);
|
|
599
600
|
if (!root || !Number.isFinite(fetchedAt)) return void 0;
|
|
600
601
|
const models = [];
|
|
601
602
|
for (const [provider, value] of Object.entries(root)) {
|
|
602
|
-
const modelsRecord = asRecord$
|
|
603
|
+
const modelsRecord = asRecord$5(asRecord$5(value)?.models);
|
|
603
604
|
if (!provider || !modelsRecord) continue;
|
|
604
605
|
for (const [key, model] of Object.entries(modelsRecord)) {
|
|
605
606
|
const parsed = parseLiveModel(provider, key, model);
|
|
@@ -610,7 +611,7 @@ function parseModelsDevPayload(raw, fetchedAt, source = MODELS_DEV_URL) {
|
|
|
610
611
|
return { schemaVersion: MODELS_DEV_SCHEMA_VERSION, source, fetchedAt, models };
|
|
611
612
|
}
|
|
612
613
|
function parseCachedModel(value) {
|
|
613
|
-
const model = asRecord$
|
|
614
|
+
const model = asRecord$5(value);
|
|
614
615
|
if (!model || typeof model.id !== "string" || !model.id || typeof model.provider !== "string" || !model.provider) {
|
|
615
616
|
return void 0;
|
|
616
617
|
}
|
|
@@ -629,7 +630,7 @@ function parseCachedModel(value) {
|
|
|
629
630
|
};
|
|
630
631
|
}
|
|
631
632
|
function parseCachedCost(value) {
|
|
632
|
-
const record = asRecord$
|
|
633
|
+
const record = asRecord$5(value);
|
|
633
634
|
if (!record) return void 0;
|
|
634
635
|
const input = nonNegative(record.input);
|
|
635
636
|
const output = nonNegative(record.output);
|
|
@@ -647,7 +648,7 @@ function parseCachedCost(value) {
|
|
|
647
648
|
return cost.input || cost.output || cost.cacheRead || cost.cacheWrite ? cost : void 0;
|
|
648
649
|
}
|
|
649
650
|
function parseModelsDevCache(raw) {
|
|
650
|
-
const record = asRecord$
|
|
651
|
+
const record = asRecord$5(raw);
|
|
651
652
|
if (!record || record.schemaVersion !== MODELS_DEV_SCHEMA_VERSION) return void 0;
|
|
652
653
|
if (typeof record.source !== "string" || !record.source) return void 0;
|
|
653
654
|
if (typeof record.fetchedAt !== "number" || !Number.isFinite(record.fetchedAt)) return void 0;
|
|
@@ -1158,16 +1159,16 @@ async function loadCodeAssist(accessToken, signal) {
|
|
|
1158
1159
|
}
|
|
1159
1160
|
return payload;
|
|
1160
1161
|
}
|
|
1161
|
-
function asRecord$
|
|
1162
|
+
function asRecord$4(value) {
|
|
1162
1163
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
1163
1164
|
}
|
|
1164
1165
|
function extractAntigravityProjectId(data) {
|
|
1165
|
-
const record = asRecord$
|
|
1166
|
+
const record = asRecord$4(data);
|
|
1166
1167
|
if (!record) return void 0;
|
|
1167
1168
|
const direct = record.antigravityProjectId ?? record.projectId ?? record.backendProjectId ?? record.userDefinedCloudaicompanionProject ?? record.cloudaicompanionProject ?? record.project;
|
|
1168
1169
|
const directId = optionalString(direct);
|
|
1169
1170
|
if (directId) return directId;
|
|
1170
|
-
const nestedId = optionalString(asRecord$
|
|
1171
|
+
const nestedId = optionalString(asRecord$4(direct)?.id);
|
|
1171
1172
|
if (nestedId) return nestedId;
|
|
1172
1173
|
for (const key of ["projects", "projectIds", "cloudaicompanionProjects"]) {
|
|
1173
1174
|
const value = record[key];
|
|
@@ -1175,7 +1176,7 @@ function extractAntigravityProjectId(data) {
|
|
|
1175
1176
|
for (const item of value) {
|
|
1176
1177
|
const fromItem = extractAntigravityProjectId(item);
|
|
1177
1178
|
if (fromItem) return fromItem;
|
|
1178
|
-
const itemId = optionalString(item) ?? optionalString(asRecord$
|
|
1179
|
+
const itemId = optionalString(item) ?? optionalString(asRecord$4(item)?.id);
|
|
1179
1180
|
if (itemId) return itemId;
|
|
1180
1181
|
}
|
|
1181
1182
|
}
|
|
@@ -1184,9 +1185,9 @@ function extractAntigravityProjectId(data) {
|
|
|
1184
1185
|
function planAntigravityProjectDiscovery(payload) {
|
|
1185
1186
|
const projectId = extractAntigravityProjectId(payload);
|
|
1186
1187
|
if (projectId) return { action: "use-project", projectId };
|
|
1187
|
-
const record = asRecord$
|
|
1188
|
+
const record = asRecord$4(payload) ?? {};
|
|
1188
1189
|
const allowed = Array.isArray(record.allowedTiers) ? record.allowedTiers : [];
|
|
1189
|
-
const freeAllowed = allowed.some((tier) => asRecord$
|
|
1190
|
+
const freeAllowed = allowed.some((tier) => asRecord$4(tier)?.id === FREE_TIER_ID);
|
|
1190
1191
|
if (freeAllowed && (record.currentTier === void 0 || record.currentTier === null)) {
|
|
1191
1192
|
return { action: "onboard" };
|
|
1192
1193
|
}
|
|
@@ -1470,6 +1471,12 @@ function normalizeToolSchema(value) {
|
|
|
1470
1471
|
}
|
|
1471
1472
|
return out;
|
|
1472
1473
|
}
|
|
1474
|
+
function cleanGeminiToolSchema(schema2) {
|
|
1475
|
+
return normalizeToolSchema(expandSchemaRefs(schema2));
|
|
1476
|
+
}
|
|
1477
|
+
function toolSchemaForModel(modelId, schema2) {
|
|
1478
|
+
return modelId.toLowerCase().startsWith("gemini") ? cleanGeminiToolSchema(schema2) : schema2;
|
|
1479
|
+
}
|
|
1473
1480
|
const EFFORT_LADDER = [
|
|
1474
1481
|
"off",
|
|
1475
1482
|
"minimal",
|
|
@@ -1870,7 +1877,7 @@ function convertTools(tools) {
|
|
|
1870
1877
|
functionDeclarations: tools.map((tool) => ({
|
|
1871
1878
|
name: tool.name,
|
|
1872
1879
|
description: tool.description || "",
|
|
1873
|
-
parameters:
|
|
1880
|
+
parameters: cleanGeminiToolSchema(tool.parameters)
|
|
1874
1881
|
}))
|
|
1875
1882
|
}
|
|
1876
1883
|
];
|
|
@@ -3998,7 +4005,7 @@ function buildDevinChatRequest(model, context, options, apiKey, userJwt) {
|
|
|
3998
4005
|
(tool) => create(ChatToolDefinitionSchema, {
|
|
3999
4006
|
name: tool.name,
|
|
4000
4007
|
description: tool.description || "",
|
|
4001
|
-
jsonSchemaString: JSON.stringify(tool.parameters ?? {}),
|
|
4008
|
+
jsonSchemaString: JSON.stringify(toolSchemaForModel(model.id, tool.parameters ?? {})),
|
|
4002
4009
|
strict: "strict" in tool && tool.strict === true
|
|
4003
4010
|
})
|
|
4004
4011
|
)
|
|
@@ -5471,7 +5478,7 @@ function normalizeBaseUrl(url) {
|
|
|
5471
5478
|
const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
5472
5479
|
return withScheme.endsWith("/") ? withScheme : `${withScheme}/`;
|
|
5473
5480
|
}
|
|
5474
|
-
function asRecord$
|
|
5481
|
+
function asRecord$3(value) {
|
|
5475
5482
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
5476
5483
|
}
|
|
5477
5484
|
function stringArray(value) {
|
|
@@ -5485,9 +5492,9 @@ function stringArray(value) {
|
|
|
5485
5492
|
return out;
|
|
5486
5493
|
}
|
|
5487
5494
|
function parseQoderRegionEndpoints(payload) {
|
|
5488
|
-
const root = asRecord$
|
|
5495
|
+
const root = asRecord$3(payload);
|
|
5489
5496
|
if (!root) return void 0;
|
|
5490
|
-
const dataNodes = asRecord$
|
|
5497
|
+
const dataNodes = asRecord$3(root.dataNodeMap) ?? {};
|
|
5491
5498
|
const endpoints = {
|
|
5492
5499
|
inferNodes: stringArray(root.inferNodes),
|
|
5493
5500
|
remoteAgentNodes: stringArray(dataNodes.remote_agent),
|
|
@@ -6792,10 +6799,10 @@ function streamQoder(model, context, options) {
|
|
|
6792
6799
|
return;
|
|
6793
6800
|
}
|
|
6794
6801
|
output.stopReason = aborted ? "aborted" : "error";
|
|
6795
|
-
let
|
|
6796
|
-
if (secretToken)
|
|
6797
|
-
if (options?.apiKey)
|
|
6798
|
-
output.errorMessage =
|
|
6802
|
+
let errorMessage2 = e instanceof Error ? e.message : String(e);
|
|
6803
|
+
if (secretToken) errorMessage2 = errorMessage2.replaceAll(secretToken, "[redacted]");
|
|
6804
|
+
if (options?.apiKey) errorMessage2 = errorMessage2.replaceAll(options.apiKey, "[redacted]");
|
|
6805
|
+
output.errorMessage = errorMessage2;
|
|
6799
6806
|
stream.push({ type: "error", reason: output.stopReason, error: output });
|
|
6800
6807
|
try {
|
|
6801
6808
|
stream.end();
|
|
@@ -6917,10 +6924,34 @@ function splitUnattendedPrefix(text2) {
|
|
|
6917
6924
|
rest: text2.slice(match[0].length)
|
|
6918
6925
|
};
|
|
6919
6926
|
}
|
|
6920
|
-
|
|
6927
|
+
const TASK_WRAP_UP_TAG = "background-tasks-wrap-up";
|
|
6928
|
+
const TASK_WRAP_UP_PREFIX = new RegExp(
|
|
6929
|
+
`^<${TASK_WRAP_UP_TAG}>\\n[\\s\\S]*?\\n</${TASK_WRAP_UP_TAG}>(?:\\n\\n|$)`
|
|
6930
|
+
);
|
|
6931
|
+
const TASK_LINE = /^- (\S+?): (.*?)(?: \(running ([^()]+)\))?$/;
|
|
6932
|
+
function parseTaskWrapUp(block) {
|
|
6933
|
+
const items = [];
|
|
6934
|
+
for (const line of block.split("\n")) {
|
|
6935
|
+
const match = TASK_LINE.exec(line);
|
|
6936
|
+
if (!match?.[1]) continue;
|
|
6937
|
+
items.push({
|
|
6938
|
+
taskId: match[1],
|
|
6939
|
+
command: match[2] ?? "",
|
|
6940
|
+
...match[3] ? { ran: match[3] } : {}
|
|
6941
|
+
});
|
|
6942
|
+
}
|
|
6943
|
+
return items;
|
|
6944
|
+
}
|
|
6945
|
+
function splitTaskWrapUpPrefix(text2) {
|
|
6946
|
+
const match = TASK_WRAP_UP_PREFIX.exec(text2);
|
|
6947
|
+
if (!match) return null;
|
|
6948
|
+
return { items: parseTaskWrapUp(match[0]), rest: text2.slice(match[0].length) };
|
|
6949
|
+
}
|
|
6950
|
+
function peelTurnNotes(text2) {
|
|
6921
6951
|
let rest = text2;
|
|
6922
6952
|
let plan;
|
|
6923
6953
|
let unattended;
|
|
6954
|
+
let wrapUp;
|
|
6924
6955
|
for (; ; ) {
|
|
6925
6956
|
const p = plan ? { rest } : splitPlanPrefix(rest);
|
|
6926
6957
|
if (p.note) {
|
|
@@ -6928,11 +6959,22 @@ function splitTurnNotes(text2) {
|
|
|
6928
6959
|
rest = p.rest;
|
|
6929
6960
|
continue;
|
|
6930
6961
|
}
|
|
6962
|
+
const found = wrapUp ? null : splitTaskWrapUpPrefix(rest);
|
|
6963
|
+
if (found) {
|
|
6964
|
+
const start = text2.length - rest.length;
|
|
6965
|
+
wrapUp = { items: found.items, start, end: start + rest.length - found.rest.length };
|
|
6966
|
+
rest = found.rest;
|
|
6967
|
+
continue;
|
|
6968
|
+
}
|
|
6931
6969
|
const u = unattended ? { rest } : splitUnattendedPrefix(rest);
|
|
6932
6970
|
if (!u.note) break;
|
|
6933
6971
|
unattended = u.note;
|
|
6934
6972
|
rest = u.rest;
|
|
6935
6973
|
}
|
|
6974
|
+
return { ...plan ? { plan } : {}, ...unattended ? { unattended } : {}, wrapUp, rest };
|
|
6975
|
+
}
|
|
6976
|
+
function splitTurnNotes(text2) {
|
|
6977
|
+
const { plan, unattended, rest } = peelTurnNotes(text2);
|
|
6936
6978
|
return { ...plan ? { plan } : {}, ...unattended ? { unattended } : {}, rest };
|
|
6937
6979
|
}
|
|
6938
6980
|
function prependTurnNote(note, text2) {
|
|
@@ -9367,10 +9409,10 @@ class AskManager {
|
|
|
9367
9409
|
this.pending.get(requestId)?.expire();
|
|
9368
9410
|
}
|
|
9369
9411
|
/** abort/dismiss 时取消全部挂起提问(fail-closed) */
|
|
9370
|
-
cancelAll() {
|
|
9412
|
+
cancelAll(reason = "question cancelled") {
|
|
9371
9413
|
for (const [requestId, entry] of this.pending) {
|
|
9372
9414
|
this.onResolved(requestId);
|
|
9373
|
-
entry.reject(new Error(
|
|
9415
|
+
entry.reject(new Error(reason));
|
|
9374
9416
|
}
|
|
9375
9417
|
this.pending.clear();
|
|
9376
9418
|
}
|
|
@@ -9648,8 +9690,9 @@ class FileTail {
|
|
|
9648
9690
|
try {
|
|
9649
9691
|
this.fd = openSync(file, "r");
|
|
9650
9692
|
if (statSync(file).size < offset) this.offset = 0;
|
|
9651
|
-
} catch {
|
|
9693
|
+
} catch (error) {
|
|
9652
9694
|
this.fd = null;
|
|
9695
|
+
this.error = errorMessage(error);
|
|
9653
9696
|
}
|
|
9654
9697
|
}
|
|
9655
9698
|
file;
|
|
@@ -9657,6 +9700,7 @@ class FileTail {
|
|
|
9657
9700
|
fd = null;
|
|
9658
9701
|
onData = () => {
|
|
9659
9702
|
};
|
|
9703
|
+
error = null;
|
|
9660
9704
|
sink(onData) {
|
|
9661
9705
|
this.onData = onData;
|
|
9662
9706
|
}
|
|
@@ -9669,9 +9713,11 @@ class FileTail {
|
|
|
9669
9713
|
let read;
|
|
9670
9714
|
try {
|
|
9671
9715
|
read = readSync(this.fd, buffer, 0, READ_CHUNK, this.offset);
|
|
9672
|
-
} catch {
|
|
9716
|
+
} catch (error) {
|
|
9717
|
+
this.error = errorMessage(error);
|
|
9673
9718
|
return any;
|
|
9674
9719
|
}
|
|
9720
|
+
this.error = null;
|
|
9675
9721
|
if (read <= 0) break;
|
|
9676
9722
|
any = true;
|
|
9677
9723
|
this.offset += read;
|
|
@@ -9691,6 +9737,7 @@ class FileTail {
|
|
|
9691
9737
|
this.fd = null;
|
|
9692
9738
|
}
|
|
9693
9739
|
}
|
|
9740
|
+
const errorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
9694
9741
|
function writeRunMeta(dir, run) {
|
|
9695
9742
|
try {
|
|
9696
9743
|
writeFileSync(
|
|
@@ -9770,6 +9817,7 @@ function spawnFileBacked(input) {
|
|
|
9770
9817
|
flush: () => {
|
|
9771
9818
|
if (!stopped) tail.drain();
|
|
9772
9819
|
},
|
|
9820
|
+
readError: () => tail.error,
|
|
9773
9821
|
done,
|
|
9774
9822
|
kill: (signal) => {
|
|
9775
9823
|
if (child.pid !== void 0) killRunGroup(child.pid, signal);
|
|
@@ -9818,6 +9866,7 @@ function attachFileBacked(dir, run, offset, probe = defaultRunProbe) {
|
|
|
9818
9866
|
flush: () => {
|
|
9819
9867
|
if (!released && !ended) tail.drain();
|
|
9820
9868
|
},
|
|
9869
|
+
readError: () => tail.error,
|
|
9821
9870
|
done,
|
|
9822
9871
|
kill: (signal) => {
|
|
9823
9872
|
if (probe.matches(run.pid, run)) killRunGroup(run.pid, signal);
|
|
@@ -9841,6 +9890,27 @@ function readRunOutput(file, offset) {
|
|
|
9841
9890
|
tail.close();
|
|
9842
9891
|
return Buffer.concat(chunks);
|
|
9843
9892
|
}
|
|
9893
|
+
function readFileTail(file, max) {
|
|
9894
|
+
let fd;
|
|
9895
|
+
try {
|
|
9896
|
+
fd = openSync(file, "r");
|
|
9897
|
+
const size = statSync(file).size;
|
|
9898
|
+
const length = Math.min(size, max);
|
|
9899
|
+
const buffer = Buffer.alloc(length);
|
|
9900
|
+
const read = readSync(fd, buffer, 0, length, size - length);
|
|
9901
|
+
const tail = buffer.subarray(0, read);
|
|
9902
|
+
if (length === size) return tail;
|
|
9903
|
+
const newline = tail.indexOf(10);
|
|
9904
|
+
if (newline !== -1) return tail.subarray(newline + 1);
|
|
9905
|
+
let start = 0;
|
|
9906
|
+
while (start < tail.length && (tail[start] & 192) === 128) start += 1;
|
|
9907
|
+
return tail.subarray(start);
|
|
9908
|
+
} catch {
|
|
9909
|
+
return Buffer.alloc(0);
|
|
9910
|
+
} finally {
|
|
9911
|
+
if (fd !== void 0) closeSync(fd);
|
|
9912
|
+
}
|
|
9913
|
+
}
|
|
9844
9914
|
function sweepOrphanRuns(dir, keep, probe = defaultRunProbe) {
|
|
9845
9915
|
let names;
|
|
9846
9916
|
try {
|
|
@@ -9918,6 +9988,7 @@ Cannot execute bash commands.`);
|
|
|
9918
9988
|
};
|
|
9919
9989
|
}
|
|
9920
9990
|
const DETACHED_TASKS_FILE = "restart-background-tasks.json";
|
|
9991
|
+
const INTERRUPTED_TASKS_FILE = "restart-interrupted-tasks.json";
|
|
9921
9992
|
const COMMAND_SUMMARY_LIMIT = 300;
|
|
9922
9993
|
const TASK_ID = /^task-\d+-[0-9a-z]+$/;
|
|
9923
9994
|
const SECRET_ASSIGNMENT = /\b([A-Za-z0-9_]*?(?:key|token|secret|passw(?:or)?d|pwd|auth|credential)[A-Za-z0-9_]*)=("[^"]*"|'[^']*'|\S+)/gi;
|
|
@@ -9966,6 +10037,35 @@ function takeDetachedTasksManifest(file, logDir) {
|
|
|
9966
10037
|
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
10038
|
});
|
|
9968
10039
|
}
|
|
10040
|
+
function appendInterruptedTasks(file, records2) {
|
|
10041
|
+
if (records2.length === 0) return;
|
|
10042
|
+
const merged = /* @__PURE__ */ new Map();
|
|
10043
|
+
for (const record of [...readInterrupted(file, null), ...records2])
|
|
10044
|
+
merged.set(record.taskId, record);
|
|
10045
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
10046
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
10047
|
+
writeFileSync(tmp, JSON.stringify({ version: 1, tasks: [...merged.values()] }, null, 2));
|
|
10048
|
+
renameSync(tmp, file);
|
|
10049
|
+
}
|
|
10050
|
+
function takeInterruptedTasks(file, logDir) {
|
|
10051
|
+
const records2 = readInterrupted(file, logDir);
|
|
10052
|
+
rmSync(file, { force: true });
|
|
10053
|
+
return records2;
|
|
10054
|
+
}
|
|
10055
|
+
function readInterrupted(file, logDir) {
|
|
10056
|
+
let parsed;
|
|
10057
|
+
try {
|
|
10058
|
+
parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
10059
|
+
} catch {
|
|
10060
|
+
return [];
|
|
10061
|
+
}
|
|
10062
|
+
const tasks = parsed?.tasks;
|
|
10063
|
+
if (parsed.version !== 1 || !Array.isArray(tasks)) return [];
|
|
10064
|
+
return tasks.filter((task) => {
|
|
10065
|
+
const t = task;
|
|
10066
|
+
return !!t && isStr(t.taskId) && TASK_ID.test(t.taskId) && isStr(t.sessionId) && typeof t.command === "string" && isNum(t.startedAt) && isNum(t.stoppedAt) && typeof t.resident === "boolean" && isStr(t.logPath) && (logDir === null || path.resolve(t.logPath) === path.resolve(logDir, `${t.taskId}.log`));
|
|
10067
|
+
});
|
|
10068
|
+
}
|
|
9969
10069
|
class ForegroundDetachedError extends Error {
|
|
9970
10070
|
constructor(taskId, reason, output, owner) {
|
|
9971
10071
|
super(`Command moved to background task ${taskId}`);
|
|
@@ -10266,9 +10366,10 @@ function normalizeSegment(segment) {
|
|
|
10266
10366
|
}
|
|
10267
10367
|
}
|
|
10268
10368
|
const INFO_FLAG = /(?:^|\s)(?:--help|-h|--version|-V)(?:\s|$)/;
|
|
10369
|
+
const FINITE_WATCH = /^gh\s+(?:pr\s+checks|run\s+watch)\b/;
|
|
10269
10370
|
function segmentClass(segment) {
|
|
10270
10371
|
const program = normalizeSegment(segment);
|
|
10271
|
-
if (!program || INFO_FLAG.test(program)) return "default";
|
|
10372
|
+
if (!program || INFO_FLAG.test(program) || FINITE_WATCH.test(program)) return "default";
|
|
10272
10373
|
if (SERVER_PATTERNS.some((pattern) => pattern.test(program))) return "server";
|
|
10273
10374
|
if (BUILD_PATTERNS.some((pattern) => pattern.test(program))) return "build";
|
|
10274
10375
|
return "default";
|
|
@@ -10521,11 +10622,182 @@ function classifyFailure(input) {
|
|
|
10521
10622
|
}
|
|
10522
10623
|
return verdict("none", true, "");
|
|
10523
10624
|
}
|
|
10625
|
+
const IDLE_QUIET_MS = 30 * 6e4;
|
|
10626
|
+
const KEEP_RECHECK_MS = 60 * 6e4;
|
|
10627
|
+
const IDLE_SAMPLE_INTERVAL_MS = 6e4;
|
|
10628
|
+
const IDLE_CPU_RATIO = 0.01;
|
|
10629
|
+
function judgeIdle(input) {
|
|
10630
|
+
const { sample } = input;
|
|
10631
|
+
if (input.now - input.lastOutputAt < IDLE_QUIET_MS) return false;
|
|
10632
|
+
if (sample?.cpuRatio === void 0 || sample.cpuRatio >= IDLE_CPU_RATIO) return false;
|
|
10633
|
+
if (!sample.sockets) return false;
|
|
10634
|
+
return sample.sockets.listening.length === 0 || sample.sockets.established === 0;
|
|
10635
|
+
}
|
|
10636
|
+
function keepSuppressesIdle(keep, now) {
|
|
10637
|
+
return keep !== void 0 && now < keep.at + KEEP_RECHECK_MS;
|
|
10638
|
+
}
|
|
10639
|
+
function cpuSeconds(text2) {
|
|
10640
|
+
const match = /^(?:(\d+)-)?(\d+(?::\d+){0,2}(?:\.\d+)?)$/.exec(text2);
|
|
10641
|
+
if (!match) return void 0;
|
|
10642
|
+
const parts = (match[2] ?? "").split(":").map(Number);
|
|
10643
|
+
if (parts.some((part) => !Number.isFinite(part))) return void 0;
|
|
10644
|
+
const seconds = parts.reduce((sum, part) => sum * 60 + part, 0);
|
|
10645
|
+
return Number(match[1] ?? 0) * 86400 + seconds;
|
|
10646
|
+
}
|
|
10647
|
+
function parsePsTable(stdout) {
|
|
10648
|
+
const table = /* @__PURE__ */ new Map();
|
|
10649
|
+
for (const line of stdout.split("\n")) {
|
|
10650
|
+
const [pid, ppid, time] = line.trim().split(/\s+/);
|
|
10651
|
+
const cpuSec = time === void 0 ? void 0 : cpuSeconds(time);
|
|
10652
|
+
if (!pid || !ppid || cpuSec === void 0 || !/^\d+$/.test(pid) || !/^\d+$/.test(ppid))
|
|
10653
|
+
continue;
|
|
10654
|
+
table.set(Number(pid), { ppid: Number(ppid), cpuSec });
|
|
10655
|
+
}
|
|
10656
|
+
return table;
|
|
10657
|
+
}
|
|
10658
|
+
function parseLsofTcp(stdout) {
|
|
10659
|
+
const result2 = /* @__PURE__ */ new Map();
|
|
10660
|
+
let current;
|
|
10661
|
+
let name = "";
|
|
10662
|
+
for (const line of stdout.split("\n")) {
|
|
10663
|
+
const tag = line[0];
|
|
10664
|
+
const value = line.slice(1);
|
|
10665
|
+
if (tag === "p") {
|
|
10666
|
+
const pid = Number(value);
|
|
10667
|
+
current = result2.get(pid) ?? { listening: [], established: 0 };
|
|
10668
|
+
result2.set(pid, current);
|
|
10669
|
+
} else if (tag === "f") name = "";
|
|
10670
|
+
else if (tag === "n") name = value;
|
|
10671
|
+
else if (tag === "T" && current) {
|
|
10672
|
+
if (value === "ST=LISTEN") {
|
|
10673
|
+
const port = Number(name.slice(name.lastIndexOf(":") + 1));
|
|
10674
|
+
if (Number.isInteger(port) && port > 0 && !current.listening.includes(port))
|
|
10675
|
+
current.listening.push(port);
|
|
10676
|
+
} else if (value === "ST=ESTABLISHED") current.established += 1;
|
|
10677
|
+
}
|
|
10678
|
+
}
|
|
10679
|
+
return result2;
|
|
10680
|
+
}
|
|
10681
|
+
const defaultExec = (file, args) => new Promise((resolve) => {
|
|
10682
|
+
execFile(file, args, { timeout: 1e4, maxBuffer: 8 * 1024 * 1024 }, (error, stdout) => {
|
|
10683
|
+
const code = error?.code;
|
|
10684
|
+
resolve({
|
|
10685
|
+
ok: !error,
|
|
10686
|
+
stdout: String(stdout ?? ""),
|
|
10687
|
+
...typeof code === "number" ? { code } : {}
|
|
10688
|
+
});
|
|
10689
|
+
});
|
|
10690
|
+
});
|
|
10691
|
+
function treeOf(table, root) {
|
|
10692
|
+
if (!table.has(root)) return [];
|
|
10693
|
+
const children = /* @__PURE__ */ new Map();
|
|
10694
|
+
for (const [pid, { ppid }] of table) children.set(ppid, [...children.get(ppid) ?? [], pid]);
|
|
10695
|
+
const tree = [root];
|
|
10696
|
+
for (let index = 0; index < tree.length; index++)
|
|
10697
|
+
for (const child of children.get(tree[index] ?? -1) ?? [])
|
|
10698
|
+
if (!tree.includes(child)) tree.push(child);
|
|
10699
|
+
return tree;
|
|
10700
|
+
}
|
|
10701
|
+
class ActivitySampler {
|
|
10702
|
+
constructor(exec = defaultExec) {
|
|
10703
|
+
this.exec = exec;
|
|
10704
|
+
}
|
|
10705
|
+
exec;
|
|
10706
|
+
baseline = /* @__PURE__ */ new Map();
|
|
10707
|
+
async sample(tasks, now) {
|
|
10708
|
+
const result2 = /* @__PURE__ */ new Map();
|
|
10709
|
+
for (const key of this.baseline.keys())
|
|
10710
|
+
if (!tasks.some((task) => task.key === key)) this.baseline.delete(key);
|
|
10711
|
+
if (tasks.length === 0) return result2;
|
|
10712
|
+
const ps = await this.exec("ps", ["-A", "-o", "pid=,ppid=,time="]);
|
|
10713
|
+
if (!ps.ok) return result2;
|
|
10714
|
+
const table = parsePsTable(ps.stdout);
|
|
10715
|
+
const trees = new Map(tasks.map((task) => [task.key, treeOf(table, task.pid)]));
|
|
10716
|
+
const pids = [...new Set([...trees.values()].flat())];
|
|
10717
|
+
if (pids.length === 0) return result2;
|
|
10718
|
+
const lsof = await this.exec("lsof", [
|
|
10719
|
+
"-nP",
|
|
10720
|
+
"-a",
|
|
10721
|
+
"-iTCP",
|
|
10722
|
+
"-p",
|
|
10723
|
+
pids.join(","),
|
|
10724
|
+
"-F",
|
|
10725
|
+
"pfnT",
|
|
10726
|
+
"-Ts"
|
|
10727
|
+
]);
|
|
10728
|
+
const sockets = lsof.ok || lsof.code === 1 && !lsof.stdout.trim() ? parseLsofTcp(lsof.stdout) : void 0;
|
|
10729
|
+
for (const task of tasks) {
|
|
10730
|
+
const tree = trees.get(task.key) ?? [];
|
|
10731
|
+
if (tree.length === 0) {
|
|
10732
|
+
this.baseline.delete(task.key);
|
|
10733
|
+
continue;
|
|
10734
|
+
}
|
|
10735
|
+
const cpuSec = tree.reduce((sum, pid) => sum + (table.get(pid)?.cpuSec ?? 0), 0);
|
|
10736
|
+
const base = this.baseline.get(task.key);
|
|
10737
|
+
this.baseline.set(task.key, { at: now, cpuSec });
|
|
10738
|
+
const sample = {};
|
|
10739
|
+
if (base && now > base.at)
|
|
10740
|
+
sample.cpuRatio = Math.max(0, cpuSec - base.cpuSec) / ((now - base.at) / 1e3);
|
|
10741
|
+
if (sockets) {
|
|
10742
|
+
const merged = { listening: [], established: 0 };
|
|
10743
|
+
for (const pid of tree) {
|
|
10744
|
+
const own = sockets.get(pid);
|
|
10745
|
+
if (!own) continue;
|
|
10746
|
+
for (const port of own.listening)
|
|
10747
|
+
if (!merged.listening.includes(port)) merged.listening.push(port);
|
|
10748
|
+
merged.established += own.established;
|
|
10749
|
+
}
|
|
10750
|
+
sample.sockets = merged;
|
|
10751
|
+
}
|
|
10752
|
+
result2.set(task.key, sample);
|
|
10753
|
+
}
|
|
10754
|
+
return result2;
|
|
10755
|
+
}
|
|
10756
|
+
}
|
|
10757
|
+
function ranText(ms) {
|
|
10758
|
+
const minutes = Math.max(0, Math.floor(ms / 6e4));
|
|
10759
|
+
return minutes < 60 ? `${minutes}m` : `${Math.floor(minutes / 60)}h ${minutes % 60}m`;
|
|
10760
|
+
}
|
|
10761
|
+
function taskLines(tasks, now) {
|
|
10762
|
+
return tasks.map(
|
|
10763
|
+
(task) => `- ${task.taskId}: ${task.command.replace(/\s+/g, " ").slice(0, 160)} (running ${ranText(now - task.startedAt)})`
|
|
10764
|
+
);
|
|
10765
|
+
}
|
|
10766
|
+
function settleChecklist(tasks, now) {
|
|
10767
|
+
const open2 = tasks.filter((task) => task.status === "running" && !task.keep);
|
|
10768
|
+
if (open2.length === 0) return void 0;
|
|
10769
|
+
return [
|
|
10770
|
+
`<${TASK_WRAP_UP_TAG}>`,
|
|
10771
|
+
"These background tasks are still running and you have not said what happens to them:",
|
|
10772
|
+
...taskLines(open2, now),
|
|
10773
|
+
"Call task_settle once for all of them: stop each one you no longer need, or keep it with a one-line reason the user will see. Do not leave them undeclared.",
|
|
10774
|
+
`</${TASK_WRAP_UP_TAG}>`
|
|
10775
|
+
].join("\n");
|
|
10776
|
+
}
|
|
10777
|
+
function awaitChecklist(tasks, now) {
|
|
10778
|
+
return [
|
|
10779
|
+
"These background tasks you started are still running:",
|
|
10780
|
+
...taskLines(tasks, now),
|
|
10781
|
+
"Your Run waits for them before it reports back. If you need their results, end your turn; each completion wakes you. Keep tasks that should run on after your report (such as servers) with task_settle keep, and stop the ones you no longer need."
|
|
10782
|
+
].join("\n");
|
|
10783
|
+
}
|
|
10524
10784
|
const MAX_BUFFER = 2e5;
|
|
10525
10785
|
const COMPLETION_OUTPUT_LIMIT = 4e3;
|
|
10526
10786
|
const HEAD_KEEP = Math.floor(COMPLETION_OUTPUT_LIMIT * 0.2);
|
|
10527
10787
|
const TASK_OUTPUT_LIMIT = 3e4;
|
|
10528
10788
|
const EMIT_INTERVAL_MS = 500;
|
|
10789
|
+
const RECOVER_TAIL_BYTES = 64 * 1024;
|
|
10790
|
+
function restartInterruptedNotice(record, tail) {
|
|
10791
|
+
const ranMin = Math.max(0, Math.round((record.stoppedAt - record.startedAt) / 6e4));
|
|
10792
|
+
const lines = [
|
|
10793
|
+
`Background task ${record.taskId} was terminated because the app restarted (status: interrupted-by-restart). It had run about ${ranMin} min.`,
|
|
10794
|
+
`Command: ${record.command}`,
|
|
10795
|
+
`Its output up to the restart is in ${record.logPath}${tail ? "; the last lines were:" : " (no output yet)."}`,
|
|
10796
|
+
...tail ? [tail] : [],
|
|
10797
|
+
record.resident ? "It was a long-running service. It was not restarted automatically; start it again only if you still need it." : "Its result is lost. If you still need it, run the command again; continue with any goal you were working on."
|
|
10798
|
+
];
|
|
10799
|
+
return lines.join("\n");
|
|
10800
|
+
}
|
|
10529
10801
|
const BACKGROUND_COMMAND_HOOKS = /* @__PURE__ */ Symbol("enso.background-command-hooks");
|
|
10530
10802
|
function attachBackgroundCommandHooks(definition, hooks) {
|
|
10531
10803
|
return Object.assign(definition, { [BACKGROUND_COMMAND_HOOKS]: hooks });
|
|
@@ -10541,19 +10813,23 @@ function detachedWaitNote(reason, subject) {
|
|
|
10541
10813
|
return reason === "steer" ? `Stopped waiting because the user sent a new message. The ${subject} keeps running and you will be notified automatically when it finishes — read and answer the user's message first.` : `The user chose to stop waiting. The ${subject} keeps running and you will be notified automatically when it finishes; do not wait for it again unless the user asks.`;
|
|
10542
10814
|
}
|
|
10543
10815
|
class BackgroundTaskManager {
|
|
10544
|
-
constructor(events, logDir, currentLimits = SHELL_LIMITS) {
|
|
10816
|
+
constructor(events, logDir, currentLimits = SHELL_LIMITS, sampler = new ActivitySampler()) {
|
|
10545
10817
|
this.events = events;
|
|
10546
10818
|
this.logDir = logDir;
|
|
10547
10819
|
this.currentLimits = currentLimits;
|
|
10820
|
+
this.sampler = sampler;
|
|
10548
10821
|
}
|
|
10549
10822
|
events;
|
|
10550
10823
|
logDir;
|
|
10551
10824
|
currentLimits;
|
|
10825
|
+
sampler;
|
|
10552
10826
|
tasks = /* @__PURE__ */ new Map();
|
|
10553
10827
|
/** sessionId → toolCallId → 在跑的前台命令(可移交后台)或阻塞等待(可提前结束) */
|
|
10554
10828
|
foreground = /* @__PURE__ */ new Map();
|
|
10555
10829
|
counter = 0;
|
|
10556
10830
|
timer = null;
|
|
10831
|
+
idleTimer = null;
|
|
10832
|
+
sampling = false;
|
|
10557
10833
|
/** 任务日志与文件直写输出所在目录 */
|
|
10558
10834
|
get outputDir() {
|
|
10559
10835
|
return this.logDir;
|
|
@@ -10723,6 +10999,7 @@ class BackgroundTaskManager {
|
|
|
10723
10999
|
const logPath = path.join(this.logDir, `${taskId}.log`);
|
|
10724
11000
|
let logStream = null;
|
|
10725
11001
|
let logBytes = 0;
|
|
11002
|
+
let seed = "";
|
|
10726
11003
|
try {
|
|
10727
11004
|
mkdirSync(this.logDir, { recursive: true });
|
|
10728
11005
|
if (opts.appendLog) {
|
|
@@ -10730,6 +11007,7 @@ class BackgroundTaskManager {
|
|
|
10730
11007
|
logBytes = statSync(logPath).size;
|
|
10731
11008
|
} catch {
|
|
10732
11009
|
}
|
|
11010
|
+
seed = new StringDecoder("utf8").end(readFileTail(logPath, RECOVER_TAIL_BYTES));
|
|
10733
11011
|
}
|
|
10734
11012
|
logStream = createWriteStream(logPath, { flags: opts.appendLog ? "a" : "w" });
|
|
10735
11013
|
} catch {
|
|
@@ -10737,17 +11015,20 @@ class BackgroundTaskManager {
|
|
|
10737
11015
|
const task = {
|
|
10738
11016
|
sessionId,
|
|
10739
11017
|
kill: opts.kill,
|
|
10740
|
-
output:
|
|
11018
|
+
output: seed,
|
|
10741
11019
|
droppedChars: 0,
|
|
10742
|
-
droppedMemBytes: 0,
|
|
10743
|
-
|
|
10744
|
-
|
|
11020
|
+
droppedMemBytes: Math.max(0, logBytes - Buffer.byteLength(seed)),
|
|
11021
|
+
// 上一代的输出模型已按它自己的游标读过/通知过,不再当作新输出重放
|
|
11022
|
+
readChars: seed.length,
|
|
11023
|
+
readBytes: Math.max(logBytes, Buffer.byteLength(seed)),
|
|
10745
11024
|
head: "",
|
|
10746
11025
|
dirty: false,
|
|
10747
11026
|
logPath,
|
|
10748
11027
|
logStream,
|
|
10749
11028
|
logBytes,
|
|
10750
11029
|
logDroppedBytes: 0,
|
|
11030
|
+
outputBytes: logBytes,
|
|
11031
|
+
lastOutputAt: Date.now(),
|
|
10751
11032
|
decoder: new StringDecoder("utf8"),
|
|
10752
11033
|
consumed: false,
|
|
10753
11034
|
killedByUser: false,
|
|
@@ -10760,7 +11041,7 @@ class BackgroundTaskManager {
|
|
|
10760
11041
|
taskId,
|
|
10761
11042
|
command,
|
|
10762
11043
|
status: "running",
|
|
10763
|
-
tail:
|
|
11044
|
+
tail: seed.slice(-8e3),
|
|
10764
11045
|
startedAt: opts.startedAt ?? Date.now()
|
|
10765
11046
|
}
|
|
10766
11047
|
};
|
|
@@ -10769,6 +11050,12 @@ class BackgroundTaskManager {
|
|
|
10769
11050
|
}
|
|
10770
11051
|
append(task, chunk) {
|
|
10771
11052
|
if (chunk.length === 0) return;
|
|
11053
|
+
task.outputBytes += chunk.length;
|
|
11054
|
+
task.lastOutputAt = Date.now();
|
|
11055
|
+
if (task.info.idle) {
|
|
11056
|
+
delete task.info.idle;
|
|
11057
|
+
this.emitLevel(task.sessionId);
|
|
11058
|
+
}
|
|
10772
11059
|
this.writeLog(task, chunk);
|
|
10773
11060
|
const text2 = task.decoder.write(chunk);
|
|
10774
11061
|
if (!text2) return;
|
|
@@ -10833,9 +11120,98 @@ class BackgroundTaskManager {
|
|
|
10833
11120
|
void this.settle(task, code === 0 ? "done" : "failed", code ?? void 0);
|
|
10834
11121
|
}
|
|
10835
11122
|
announce(task) {
|
|
10836
|
-
this.events.onStarted(task.sessionId,
|
|
11123
|
+
this.events.onStarted(task.sessionId, this.infoOf(task));
|
|
10837
11124
|
this.emitLevel(task.sessionId);
|
|
10838
11125
|
this.ensureTimer();
|
|
11126
|
+
if (process.platform !== "win32") {
|
|
11127
|
+
this.idleTimer ??= setInterval(() => void this.sampleIdle(), IDLE_SAMPLE_INTERVAL_MS);
|
|
11128
|
+
this.idleTimer.unref?.();
|
|
11129
|
+
}
|
|
11130
|
+
}
|
|
11131
|
+
/**
|
|
11132
|
+
* 闲置采样:只看已安静接近阈值的任务(提前一个周期取 CPU 基线),一轮一次 ps + 一次 lsof。
|
|
11133
|
+
* 状态变了才发全量快照;保留未满 1 小时的不判,到点后仍闲置就撤掉保留、重新标闲置。
|
|
11134
|
+
*/
|
|
11135
|
+
async sampleIdle(now = Date.now()) {
|
|
11136
|
+
if (this.sampling) return;
|
|
11137
|
+
const running = [...this.tasks.values()].filter(
|
|
11138
|
+
(task) => task.info.status === "running" && !task.settling
|
|
11139
|
+
);
|
|
11140
|
+
if (running.length === 0) {
|
|
11141
|
+
if (this.idleTimer) clearInterval(this.idleTimer);
|
|
11142
|
+
this.idleTimer = null;
|
|
11143
|
+
return;
|
|
11144
|
+
}
|
|
11145
|
+
const candidates = running.flatMap((task) => {
|
|
11146
|
+
const pid = task.pid ?? task.run?.pid;
|
|
11147
|
+
return pid !== void 0 && !keepSuppressesIdle(task.info.keep, now + IDLE_SAMPLE_INTERVAL_MS) && now - task.lastOutputAt >= IDLE_QUIET_MS - IDLE_SAMPLE_INTERVAL_MS ? [{ key: task.info.taskId, pid }] : [];
|
|
11148
|
+
});
|
|
11149
|
+
this.sampling = true;
|
|
11150
|
+
let samples;
|
|
11151
|
+
try {
|
|
11152
|
+
samples = await this.sampler.sample(candidates, now);
|
|
11153
|
+
} catch {
|
|
11154
|
+
samples = /* @__PURE__ */ new Map();
|
|
11155
|
+
} finally {
|
|
11156
|
+
this.sampling = false;
|
|
11157
|
+
}
|
|
11158
|
+
const touched = /* @__PURE__ */ new Set();
|
|
11159
|
+
for (const task of running) {
|
|
11160
|
+
if (task.info.status !== "running") continue;
|
|
11161
|
+
const idle = !keepSuppressesIdle(task.info.keep, now) && judgeIdle({ now, lastOutputAt: task.lastOutputAt, sample: samples.get(task.info.taskId) });
|
|
11162
|
+
if (idle) {
|
|
11163
|
+
const ports = samples.get(task.info.taskId)?.sockets?.listening ?? [];
|
|
11164
|
+
const changed = !task.info.idle || task.info.idle.since !== task.lastOutputAt || task.info.idle.ports.join() !== ports.join() || task.info.keep !== void 0;
|
|
11165
|
+
task.info.idle = { since: task.lastOutputAt, ports };
|
|
11166
|
+
delete task.info.keep;
|
|
11167
|
+
if (changed) touched.add(task.sessionId);
|
|
11168
|
+
} else if (task.info.idle && samples.has(task.info.taskId)) {
|
|
11169
|
+
delete task.info.idle;
|
|
11170
|
+
touched.add(task.sessionId);
|
|
11171
|
+
}
|
|
11172
|
+
}
|
|
11173
|
+
for (const sessionId of touched) this.emitLevel(sessionId);
|
|
11174
|
+
}
|
|
11175
|
+
/** 留下运行(agent 表态或用户手动保留):清掉闲置标记,1 小时后重新检查 */
|
|
11176
|
+
keep(taskId, keep, now = Date.now()) {
|
|
11177
|
+
const task = this.tasks.get(taskId);
|
|
11178
|
+
if (task?.info.status !== "running") return false;
|
|
11179
|
+
const reason = keep.reason?.trim().slice(0, 200);
|
|
11180
|
+
task.info.keep = { by: keep.by, ...reason ? { reason } : {}, at: now };
|
|
11181
|
+
delete task.info.idle;
|
|
11182
|
+
this.emitLevel(task.sessionId);
|
|
11183
|
+
return true;
|
|
11184
|
+
}
|
|
11185
|
+
/** 取消保留:下一轮采样重新判定 */
|
|
11186
|
+
unkeep(taskId) {
|
|
11187
|
+
const task = this.tasks.get(taskId);
|
|
11188
|
+
if (!task?.info.keep) return false;
|
|
11189
|
+
delete task.info.keep;
|
|
11190
|
+
this.emitLevel(task.sessionId);
|
|
11191
|
+
return true;
|
|
11192
|
+
}
|
|
11193
|
+
/** 会话自己起的、还在跑、没表态(没保留、也没在停)的任务;子代理起的归子代理,不算在内 */
|
|
11194
|
+
undeclared(sessionId) {
|
|
11195
|
+
return [...this.tasks.values()].filter(
|
|
11196
|
+
(task) => task.info.status === "running" && !task.info.keep && !task.killedByUser && !task.stoppedByModel && task.sessionId === sessionId
|
|
11197
|
+
).map((task) => this.infoOf(task));
|
|
11198
|
+
}
|
|
11199
|
+
taskInfo(taskId) {
|
|
11200
|
+
const task = this.tasks.get(taskId);
|
|
11201
|
+
return task ? this.infoOf(task) : void 0;
|
|
11202
|
+
}
|
|
11203
|
+
infoOf(task) {
|
|
11204
|
+
return { ...task.info, tail: task.output.slice(-8e3), outputBytes: task.outputBytes };
|
|
11205
|
+
}
|
|
11206
|
+
/** 输出文件读不到时把原因写进输出:面板和 task_output 看到的是失败原因,不是「暂无输出」 */
|
|
11207
|
+
noteReadError(task) {
|
|
11208
|
+
const error = task.run?.readError() ?? void 0;
|
|
11209
|
+
if (!error || error === task.readError) return;
|
|
11210
|
+
task.readError = error;
|
|
11211
|
+
task.output += `
|
|
11212
|
+
[cannot read command output: ${error}]
|
|
11213
|
+
`;
|
|
11214
|
+
task.dirty = true;
|
|
10839
11215
|
}
|
|
10840
11216
|
pruneFinished() {
|
|
10841
11217
|
const touched = /* @__PURE__ */ new Set();
|
|
@@ -10872,12 +11248,22 @@ class BackgroundTaskManager {
|
|
|
10872
11248
|
const hadWaiters = task.waiters.length > 0;
|
|
10873
11249
|
if (hadWaiters) task.consumed = true;
|
|
10874
11250
|
for (const wake of task.waiters.splice(0)) wake();
|
|
10875
|
-
this.events.onOutput(
|
|
11251
|
+
this.events.onOutput(
|
|
11252
|
+
task.sessionId,
|
|
11253
|
+
task.info.taskId,
|
|
11254
|
+
task.info.tail,
|
|
11255
|
+
status,
|
|
11256
|
+
task.outputBytes
|
|
11257
|
+
);
|
|
10876
11258
|
this.events.onEnded(task.sessionId, task.info.taskId, status, exitCode);
|
|
10877
11259
|
this.emitLevel(task.sessionId);
|
|
10878
11260
|
if (!task.consumed) {
|
|
10879
|
-
const text2 = this.completionText(task);
|
|
10880
|
-
if (task.recovered)
|
|
11261
|
+
const text2 = task.restartNotice ?? this.completionText(task);
|
|
11262
|
+
if (task.recovered)
|
|
11263
|
+
this.events.onCompletionNotify(task.sessionId, text2, {
|
|
11264
|
+
durable: true,
|
|
11265
|
+
...task.restartResident ? { quiet: true } : {}
|
|
11266
|
+
});
|
|
10881
11267
|
else this.events.onCompletionNotify(task.sessionId, text2);
|
|
10882
11268
|
}
|
|
10883
11269
|
}
|
|
@@ -10917,10 +11303,17 @@ class BackgroundTaskManager {
|
|
|
10917
11303
|
let anyRunning = false;
|
|
10918
11304
|
for (const task of this.tasks.values()) {
|
|
10919
11305
|
if (task.info.status === "running") anyRunning = true;
|
|
11306
|
+
this.noteReadError(task);
|
|
10920
11307
|
if (!task.dirty) continue;
|
|
10921
11308
|
task.dirty = false;
|
|
10922
11309
|
task.info.tail = task.output.slice(-8e3);
|
|
10923
|
-
this.events.onOutput(
|
|
11310
|
+
this.events.onOutput(
|
|
11311
|
+
task.sessionId,
|
|
11312
|
+
task.info.taskId,
|
|
11313
|
+
task.info.tail,
|
|
11314
|
+
task.info.status,
|
|
11315
|
+
task.outputBytes
|
|
11316
|
+
);
|
|
10924
11317
|
}
|
|
10925
11318
|
if (!anyRunning && this.timer) {
|
|
10926
11319
|
clearInterval(this.timer);
|
|
@@ -11030,7 +11423,11 @@ class BackgroundTaskManager {
|
|
|
11030
11423
|
);
|
|
11031
11424
|
}
|
|
11032
11425
|
snapshot(sessionId) {
|
|
11033
|
-
return [...this.tasks.values()].filter((task) => task.sessionId === sessionId).map((task) => (
|
|
11426
|
+
return [...this.tasks.values()].filter((task) => task.sessionId === sessionId).map((task) => this.infoOf(task));
|
|
11427
|
+
}
|
|
11428
|
+
/** 名下还有任务(含已结束、尚未清理的)的会话 */
|
|
11429
|
+
sessionIds() {
|
|
11430
|
+
return [...new Set([...this.tasks.values()].map((task) => task.sessionId))];
|
|
11034
11431
|
}
|
|
11035
11432
|
/**
|
|
11036
11433
|
* 前台命令转后台(adopt,有 yieldedAt)后还没结束的任务:优雅重启把它们当作在跑的工具。
|
|
@@ -11046,6 +11443,53 @@ class BackgroundTaskManager {
|
|
|
11046
11443
|
if (task.info.status === "running") this.stop(task.info.taskId, true);
|
|
11047
11444
|
}
|
|
11048
11445
|
}
|
|
11446
|
+
/**
|
|
11447
|
+
* worker 收尾前:还在跑、即将被停掉的任务(含空闲会话的)。记进台账后调 handOverNotices,
|
|
11448
|
+
* 本代不再发完成通知,由下一代在任务表留下「因重启中断」并通知一次。子代理的任务记到根会话:子会话不随换代恢复。
|
|
11449
|
+
*/
|
|
11450
|
+
interruptedOnShutdown(now = Date.now()) {
|
|
11451
|
+
const records2 = [];
|
|
11452
|
+
for (const task of this.tasks.values()) {
|
|
11453
|
+
if (task.info.status !== "running" || task.settling) continue;
|
|
11454
|
+
records2.push({
|
|
11455
|
+
taskId: task.info.taskId,
|
|
11456
|
+
sessionId: task.sessionId.split("::")[0] ?? task.sessionId,
|
|
11457
|
+
command: commandSummary(task.info.command),
|
|
11458
|
+
startedAt: task.info.startedAt,
|
|
11459
|
+
stoppedAt: now,
|
|
11460
|
+
logPath: task.logPath,
|
|
11461
|
+
resident: task.info.keep !== void 0 || classifyCommand(task.info.command).class === "server"
|
|
11462
|
+
});
|
|
11463
|
+
}
|
|
11464
|
+
return records2;
|
|
11465
|
+
}
|
|
11466
|
+
handOverNotices(taskIds) {
|
|
11467
|
+
for (const taskId of taskIds) {
|
|
11468
|
+
const task = this.tasks.get(taskId);
|
|
11469
|
+
if (task) task.consumed = true;
|
|
11470
|
+
}
|
|
11471
|
+
}
|
|
11472
|
+
/** 新一代:上一代收尾时停掉的任务按原 taskId 留在任务表(failed + interrupted),通知所属会话一次 */
|
|
11473
|
+
recoverInterrupted(records2) {
|
|
11474
|
+
for (const record of records2) {
|
|
11475
|
+
if (this.tasks.has(record.taskId)) continue;
|
|
11476
|
+
const task = this.register(record.sessionId, record.taskId, record.command, {
|
|
11477
|
+
startedAt: record.startedAt,
|
|
11478
|
+
kill: () => {
|
|
11479
|
+
},
|
|
11480
|
+
appendLog: true
|
|
11481
|
+
});
|
|
11482
|
+
task.recovered = true;
|
|
11483
|
+
task.info.interrupted = "restart";
|
|
11484
|
+
task.restartResident = record.resident;
|
|
11485
|
+
task.restartNotice = restartInterruptedNotice(
|
|
11486
|
+
record,
|
|
11487
|
+
stripVTControlCharacters(task.output.slice(-1500)).trim()
|
|
11488
|
+
);
|
|
11489
|
+
this.announce(task);
|
|
11490
|
+
this.finish(task, "failed");
|
|
11491
|
+
}
|
|
11492
|
+
}
|
|
11049
11493
|
/**
|
|
11050
11494
|
* 重启前把能脱离的在跑任务交出去:读完已有输出、停止跟读,进程不动,从本代移除,返回恢复清单条目。
|
|
11051
11495
|
* 脱离不了的(管道进程)留在原处,worker 收尾时照常停掉。
|
|
@@ -11183,12 +11627,17 @@ function shellSleepHint(command) {
|
|
|
11183
11627
|
return SHELL_SLEEP_HINT;
|
|
11184
11628
|
}
|
|
11185
11629
|
const TIMEOUT_HINT_MIN_SEC = SHELL_LIMITS.yieldDefaultMs / 1e3;
|
|
11186
|
-
|
|
11630
|
+
const TIMEOUT_HINT_SLOW_MS = SHELL_LIMITS.yieldDefaultMs * 2 / 3;
|
|
11631
|
+
function shellTimeoutHint(timeoutSec, run) {
|
|
11187
11632
|
if (timeoutSec === void 0 || timeoutSec < TIMEOUT_HINT_MIN_SEC) return "";
|
|
11633
|
+
if (!run.detached && run.elapsedMs < TIMEOUT_HINT_SLOW_MS) return "";
|
|
11188
11634
|
return SHELL_TIMEOUT_HINT;
|
|
11189
11635
|
}
|
|
11190
|
-
function withCommandHints(result2, command,
|
|
11191
|
-
const hint = [shellReadHint(command), shellSleepHint(command),
|
|
11636
|
+
function withCommandHints(result2, command, timeoutHint) {
|
|
11637
|
+
const hint = [shellReadHint(command), shellSleepHint(command), timeoutHint].filter(Boolean).join("\n");
|
|
11638
|
+
return prependHint(result2, hint);
|
|
11639
|
+
}
|
|
11640
|
+
function prependHint(result2, hint) {
|
|
11192
11641
|
if (!hint) return result2;
|
|
11193
11642
|
const content = result2.content;
|
|
11194
11643
|
if (!Array.isArray(content)) return result2;
|
|
@@ -11224,7 +11673,7 @@ function resolveBackgroundLaunch(toolName2, command, cwd, transform, resolvePowe
|
|
|
11224
11673
|
}
|
|
11225
11674
|
return { command, cwd };
|
|
11226
11675
|
}
|
|
11227
|
-
const asRecord$
|
|
11676
|
+
const asRecord$2 = (params) => params && typeof params === "object" && !Array.isArray(params) ? params : {};
|
|
11228
11677
|
function explicitTimeoutSec(record) {
|
|
11229
11678
|
return typeof record.timeout === "number" && Number.isFinite(record.timeout) && record.timeout > 0 ? record.timeout : void 0;
|
|
11230
11679
|
}
|
|
@@ -11269,7 +11718,7 @@ function detachedResult(error, context) {
|
|
|
11269
11718
|
};
|
|
11270
11719
|
}
|
|
11271
11720
|
function exitCodeOf(result2, text2) {
|
|
11272
|
-
const structured = asRecord$
|
|
11721
|
+
const structured = asRecord$2(result2.structuredContent).exit_code;
|
|
11273
11722
|
if (typeof structured === "number" && Number.isInteger(structured)) return structured;
|
|
11274
11723
|
const match = /Command exited with code (\d+)\s*$/.exec(text2);
|
|
11275
11724
|
return match ? Number(match[1]) : void 0;
|
|
@@ -11289,14 +11738,14 @@ ${failureLine(verdict2)}`;
|
|
|
11289
11738
|
return {
|
|
11290
11739
|
...result2,
|
|
11291
11740
|
details: {
|
|
11292
|
-
...asRecord$
|
|
11741
|
+
...asRecord$2(record.details),
|
|
11293
11742
|
shellFailure: { kind: verdict2.kind, retryable: verdict2.retryable, exitCode }
|
|
11294
11743
|
}
|
|
11295
11744
|
};
|
|
11296
11745
|
}
|
|
11297
11746
|
function foregroundCommandTimeoutMs(toolName2, args, limits = SHELL_LIMITS) {
|
|
11298
11747
|
if (toolName2 !== "bash" && toolName2 !== "powershell") return void 0;
|
|
11299
|
-
const record = asRecord$
|
|
11748
|
+
const record = asRecord$2(args);
|
|
11300
11749
|
if (record.background === true) return void 0;
|
|
11301
11750
|
const command = typeof record.command === "string" ? record.command : "";
|
|
11302
11751
|
const yieldMs = classifyCommand(command, limits).yieldMs;
|
|
@@ -11399,7 +11848,7 @@ function withBackground(definition, manager, sessionId, cwd, transform, foregrou
|
|
|
11399
11848
|
const callSignal = signal ? AbortSignal.any([signal]) : new AbortController().signal;
|
|
11400
11849
|
const startedAt = Date.now();
|
|
11401
11850
|
const policy = classifyCommand(command, manager.limits);
|
|
11402
|
-
const deadlineSec = explicitTimeoutSec(asRecord$
|
|
11851
|
+
const deadlineSec = explicitTimeoutSec(asRecord$2(params));
|
|
11403
11852
|
const foreground = new ForegroundCommand(
|
|
11404
11853
|
{
|
|
11405
11854
|
adopt: (proc) => manager.adopt(sessionId, proc, {
|
|
@@ -11417,15 +11866,19 @@ function withBackground(definition, manager, sessionId, cwd, transform, foregrou
|
|
|
11417
11866
|
const untrack = manager.trackForeground(foregroundSessionId, toolCallId, foreground);
|
|
11418
11867
|
try {
|
|
11419
11868
|
const result2 = await definition.execute(toolCallId, params, callSignal, onUpdate, ctx);
|
|
11420
|
-
|
|
11869
|
+
const timeoutHint = shellTimeoutHint(deadlineSec, { elapsedMs: Date.now() - startedAt });
|
|
11870
|
+
return withCommandHints(withFailureNote(result2), command, timeoutHint);
|
|
11421
11871
|
} catch (error) {
|
|
11422
11872
|
if (error instanceof ForegroundDetachedError) {
|
|
11423
|
-
return
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11873
|
+
return prependHint(
|
|
11874
|
+
detachedResult(error, {
|
|
11875
|
+
commandClass: policy.class,
|
|
11876
|
+
startedAt,
|
|
11877
|
+
logPath: manager.logPathOf(error.taskId) ?? "",
|
|
11878
|
+
waitCapSec: yieldSec(manager.limits.taskWaitMaxMs)
|
|
11879
|
+
}),
|
|
11880
|
+
shellTimeoutHint(deadlineSec, { elapsedMs: Date.now() - startedAt, detached: true })
|
|
11881
|
+
);
|
|
11429
11882
|
}
|
|
11430
11883
|
if (error instanceof ForegroundYieldError) {
|
|
11431
11884
|
return {
|
|
@@ -11541,9 +11994,85 @@ ${shown.text}` : ""}${hint}${failure}`
|
|
|
11541
11994
|
details: void 0
|
|
11542
11995
|
};
|
|
11543
11996
|
}
|
|
11997
|
+
},
|
|
11998
|
+
{
|
|
11999
|
+
name: "task_settle",
|
|
12000
|
+
label: "Task settle",
|
|
12001
|
+
description: "Declare what happens to background tasks that are still running when you wrap up, all in one call: stop the ones you no longer need, keep the rest with a one-line reason the user will see. Kept tasks are not flagged as idle for an hour.",
|
|
12002
|
+
promptSnippet: "task_settle: when wrapping up, stop or keep (with a reason) each still-running background task",
|
|
12003
|
+
parameters: {
|
|
12004
|
+
type: "object",
|
|
12005
|
+
properties: {
|
|
12006
|
+
tasks: {
|
|
12007
|
+
type: "array",
|
|
12008
|
+
description: "One entry per running background task",
|
|
12009
|
+
items: {
|
|
12010
|
+
type: "object",
|
|
12011
|
+
properties: {
|
|
12012
|
+
taskId: { type: "string", description: "Background task id" },
|
|
12013
|
+
action: { type: "string", enum: ["stop", "keep"], description: "stop or keep" },
|
|
12014
|
+
reason: {
|
|
12015
|
+
type: "string",
|
|
12016
|
+
description: "One short sentence: why it is no longer needed, or why it must keep running"
|
|
12017
|
+
}
|
|
12018
|
+
},
|
|
12019
|
+
required: ["taskId", "action", "reason"]
|
|
12020
|
+
}
|
|
12021
|
+
}
|
|
12022
|
+
},
|
|
12023
|
+
required: ["tasks"]
|
|
12024
|
+
},
|
|
12025
|
+
prepareArguments: (args) => normalizeSettleArgs(args),
|
|
12026
|
+
async execute(_id, params) {
|
|
12027
|
+
const entries = settleEntries(params.tasks);
|
|
12028
|
+
if (entries.length === 0)
|
|
12029
|
+
throw new Error("tasks must list at least one { taskId, action, reason }");
|
|
12030
|
+
const settled = entries.map((entry) => {
|
|
12031
|
+
const command = owned(entry.taskId) ? manager.taskInfo(entry.taskId)?.command : void 0;
|
|
12032
|
+
const ok = owned(entry.taskId) && (entry.action === "stop" ? manager.stop(entry.taskId) : manager.keep(entry.taskId, { by: "agent", reason: entry.reason }));
|
|
12033
|
+
return { ...entry, ...command ? { command } : {}, ok };
|
|
12034
|
+
});
|
|
12035
|
+
const stillOpen = sessionId ? manager.undeclared(sessionId).map((task) => task.taskId) : [];
|
|
12036
|
+
return {
|
|
12037
|
+
content: [
|
|
12038
|
+
{
|
|
12039
|
+
type: "text",
|
|
12040
|
+
text: JSON.stringify({
|
|
12041
|
+
settled,
|
|
12042
|
+
...stillOpen.length > 0 ? { stillUndeclared: stillOpen } : {}
|
|
12043
|
+
})
|
|
12044
|
+
}
|
|
12045
|
+
],
|
|
12046
|
+
details: void 0
|
|
12047
|
+
};
|
|
12048
|
+
}
|
|
11544
12049
|
}
|
|
11545
12050
|
];
|
|
11546
12051
|
}
|
|
12052
|
+
function normalizeSettleArgs(args) {
|
|
12053
|
+
if (!args || typeof args !== "object") return args;
|
|
12054
|
+
let tasks = args.tasks;
|
|
12055
|
+
if (typeof tasks === "string") {
|
|
12056
|
+
try {
|
|
12057
|
+
tasks = JSON.parse(tasks);
|
|
12058
|
+
} catch {
|
|
12059
|
+
}
|
|
12060
|
+
}
|
|
12061
|
+
if (tasks && typeof tasks === "object" && !Array.isArray(tasks)) tasks = [tasks];
|
|
12062
|
+
return { ...args, tasks };
|
|
12063
|
+
}
|
|
12064
|
+
function settleEntries(value) {
|
|
12065
|
+
if (!Array.isArray(value)) return [];
|
|
12066
|
+
return value.flatMap((item) => {
|
|
12067
|
+
if (!item || typeof item !== "object") return [];
|
|
12068
|
+
const { taskId, action, reason } = item;
|
|
12069
|
+
if (typeof taskId !== "string" || !taskId || action !== "stop" && action !== "keep")
|
|
12070
|
+
return [];
|
|
12071
|
+
return [
|
|
12072
|
+
{ taskId, action, reason: typeof reason === "string" ? reason.trim().slice(0, 200) : "" }
|
|
12073
|
+
];
|
|
12074
|
+
});
|
|
12075
|
+
}
|
|
11547
12076
|
const CHILD_THINKING_LEVELS = ["off", ...THINKING_LEVELS$1];
|
|
11548
12077
|
function isChildThinkingLevel(value) {
|
|
11549
12078
|
return CHILD_THINKING_LEVELS.includes(value);
|
|
@@ -11575,22 +12104,34 @@ function thinkingToOverride(thinking) {
|
|
|
11575
12104
|
if (thinking === "off") return { reasoning: "off" };
|
|
11576
12105
|
return { reasoning: "on", thinkingLevel: thinking };
|
|
11577
12106
|
}
|
|
11578
|
-
function pickChildReasoningOverride(dispatched, agentTypeOverride
|
|
12107
|
+
function pickChildReasoningOverride(dispatched, agentTypeOverride) {
|
|
11579
12108
|
if (dispatched) return thinkingToOverride(dispatched);
|
|
11580
|
-
const reasoning = agentTypeOverride?.reasoning
|
|
11581
|
-
const thinkingLevel = agentTypeOverride?.thinkingLevel
|
|
12109
|
+
const reasoning = agentTypeOverride?.reasoning;
|
|
12110
|
+
const thinkingLevel = agentTypeOverride?.thinkingLevel;
|
|
11582
12111
|
return {
|
|
11583
12112
|
...reasoning ? { reasoning } : {},
|
|
11584
12113
|
...thinkingLevel ? { thinkingLevel } : {}
|
|
11585
12114
|
};
|
|
11586
12115
|
}
|
|
11587
|
-
function resolveChildReasoning(override, parentEnabled, parentLevel) {
|
|
11588
|
-
const enabled = override?.reasoning ? override.reasoning === "on" : parentEnabled;
|
|
12116
|
+
function resolveChildReasoning(override, parentEnabled, parentLevel, modelOverride) {
|
|
12117
|
+
const enabled = override?.reasoning ? override.reasoning === "on" : parentEnabled || modelOverride?.reasoning === "on";
|
|
12118
|
+
if (!enabled) return { enabled, level: "off" };
|
|
11589
12119
|
return {
|
|
11590
12120
|
enabled,
|
|
11591
|
-
level:
|
|
12121
|
+
level: override?.thinkingLevel ?? (parentEnabled ? parentLevel : void 0) ?? modelOverride?.thinkingLevel ?? "medium"
|
|
11592
12122
|
};
|
|
11593
12123
|
}
|
|
12124
|
+
function fitChildReasoningToModel(decision, model) {
|
|
12125
|
+
if (!decision.enabled || decision.level === "off" || model.reasoning === false) {
|
|
12126
|
+
return { enabled: false, level: "off" };
|
|
12127
|
+
}
|
|
12128
|
+
if (!model.thinkingLevelMap) return decision;
|
|
12129
|
+
const supported = supportedProjectThinkingLevels({
|
|
12130
|
+
reasoning: true,
|
|
12131
|
+
thinkingLevelMap: model.thinkingLevelMap
|
|
12132
|
+
});
|
|
12133
|
+
return { enabled: true, level: clampProjectThinkingLevel(decision.level, supported) };
|
|
12134
|
+
}
|
|
11594
12135
|
const MAX_TOOL_NAME_LENGTH = 64;
|
|
11595
12136
|
const shortHash = (value) => createHash("sha256").update(value).digest("hex").slice(0, 8);
|
|
11596
12137
|
const serverSlug = (serverName) => serverName.replace(/[^A-Za-z0-9_]+/g, "_").replace(/^_+|_+$/g, "") || `server_${shortHash(serverName)}`;
|
|
@@ -11666,6 +12207,7 @@ const CODEMODE_FORBIDDEN_TOOLS = /* @__PURE__ */ new Set([
|
|
|
11666
12207
|
"todo",
|
|
11667
12208
|
"task_output",
|
|
11668
12209
|
"task_stop",
|
|
12210
|
+
"task_settle",
|
|
11669
12211
|
"computer",
|
|
11670
12212
|
"send_image",
|
|
11671
12213
|
"report_blocked"
|
|
@@ -12199,7 +12741,7 @@ function parseDirectoryProvider(value) {
|
|
|
12199
12741
|
}
|
|
12200
12742
|
return provider;
|
|
12201
12743
|
}
|
|
12202
|
-
const version = "0.3.
|
|
12744
|
+
const version = "0.3.13";
|
|
12203
12745
|
function readModelsDevCache(file) {
|
|
12204
12746
|
try {
|
|
12205
12747
|
if (!existsSync(file)) return void 0;
|
|
@@ -12417,6 +12959,9 @@ function projectMessage(value) {
|
|
|
12417
12959
|
if (value.role === "user" && typeof value.entryId === "string" && value.entryId.trim()) {
|
|
12418
12960
|
projected.entryId = value.entryId;
|
|
12419
12961
|
}
|
|
12962
|
+
if (typeof value.messageId === "string" && value.messageId.trim()) {
|
|
12963
|
+
projected.messageId = value.messageId;
|
|
12964
|
+
}
|
|
12420
12965
|
if (typeof value.toolName === "string") projected.toolName = value.toolName;
|
|
12421
12966
|
if (typeof value.toolCallId === "string") projected.toolCallId = value.toolCallId;
|
|
12422
12967
|
if (typeof value.isError === "boolean") projected.isError = value.isError;
|
|
@@ -12430,6 +12975,7 @@ function projectMessage(value) {
|
|
|
12430
12975
|
if (typeof value.errorMessage === "string") projected.errorMessage = value.errorMessage;
|
|
12431
12976
|
if (typeof value.timestamp === "number") projected.timestamp = value.timestamp;
|
|
12432
12977
|
if (value.role === "assistant" && typeof value.model === "string") projected.model = value.model;
|
|
12978
|
+
if (value.role === "assistant" && value.restartResumed === true) projected.restartResumed = true;
|
|
12433
12979
|
if (value.role === "assistant" && value.privacyMask !== void 0) {
|
|
12434
12980
|
const privacyMask = parseMaskReport(value.privacyMask);
|
|
12435
12981
|
if (privacyMask) projected.privacyMask = privacyMask;
|
|
@@ -12679,7 +13225,7 @@ ${persona}`;
|
|
|
12679
13225
|
}
|
|
12680
13226
|
const COMPUTER_DEFAULT_TIMEOUT_SEC = 60;
|
|
12681
13227
|
const COMPUTER_MAX_TIMEOUT_SEC = 120;
|
|
12682
|
-
function asRecord$
|
|
13228
|
+
function asRecord$1(value) {
|
|
12683
13229
|
if (typeof value === "string") {
|
|
12684
13230
|
const trimmed = value.trim();
|
|
12685
13231
|
if (!trimmed.startsWith("{")) return null;
|
|
@@ -12701,7 +13247,7 @@ function asTimeoutSec(value) {
|
|
|
12701
13247
|
return Math.min(Math.floor(n), COMPUTER_MAX_TIMEOUT_SEC);
|
|
12702
13248
|
}
|
|
12703
13249
|
function normalizeComputerParams(value) {
|
|
12704
|
-
const record = asRecord$
|
|
13250
|
+
const record = asRecord$1(value);
|
|
12705
13251
|
if (!record) return null;
|
|
12706
13252
|
const code = typeof record.code === "string" ? record.code : "";
|
|
12707
13253
|
if (!code.trim()) return null;
|
|
@@ -12870,6 +13416,10 @@ function withPlanGate(definition, deps) {
|
|
|
12870
13416
|
throw denied(
|
|
12871
13417
|
`spawn requires a read-only agent_type (${[...readonlyAgentTypes].join(", ") || "none available"})`
|
|
12872
13418
|
);
|
|
13419
|
+
} else if (operation === "resume") {
|
|
13420
|
+
const type = typeof record.agentId === "string" ? deps.agentTypeOf?.(record.agentId) : void 0;
|
|
13421
|
+
if (type === void 0 || !readonlyAgentTypes.has(type))
|
|
13422
|
+
throw denied("resume only continues read-only agent_type subagents while planning");
|
|
12873
13423
|
} else if (!SUBAGENT_PASSIVE_OPS.has(String(operation))) {
|
|
12874
13424
|
throw denied(`subagent ${String(operation)} is disabled while planning`);
|
|
12875
13425
|
}
|
|
@@ -13003,15 +13553,19 @@ function createProjectSettingsManager(cwd, agentDir, trusted) {
|
|
|
13003
13553
|
}
|
|
13004
13554
|
const SNAPSHOT_TAIL_MESSAGES = 60;
|
|
13005
13555
|
const SNAPSHOT_BYTE_BUDGET = 6e5;
|
|
13006
|
-
|
|
13556
|
+
const OVERVIEW_TAIL_MESSAGES = 10;
|
|
13557
|
+
const OVERVIEW_BYTE_BUDGET = 64e3;
|
|
13558
|
+
function takeSnapshotTail(messages, endIndex, limits = {}) {
|
|
13559
|
+
const maxMessages = limits.messages ?? SNAPSHOT_TAIL_MESSAGES;
|
|
13560
|
+
const budget = limits.bytes ?? SNAPSHOT_BYTE_BUDGET;
|
|
13007
13561
|
let bytes = 0;
|
|
13008
13562
|
let start = endIndex;
|
|
13009
|
-
while (start > 0 && endIndex - start <
|
|
13563
|
+
while (start > 0 && endIndex - start < maxMessages) {
|
|
13010
13564
|
const size = Buffer.byteLength(JSON.stringify(messages[start - 1]), "utf8");
|
|
13011
|
-
if (bytes + size >
|
|
13565
|
+
if (bytes + size > budget && start < endIndex) break;
|
|
13012
13566
|
bytes += size;
|
|
13013
13567
|
start--;
|
|
13014
|
-
if (bytes >
|
|
13568
|
+
if (bytes > budget) break;
|
|
13015
13569
|
}
|
|
13016
13570
|
return { messages: messages.slice(start, endIndex), baseIndex: start };
|
|
13017
13571
|
}
|
|
@@ -13389,6 +13943,34 @@ function withAgentRead(definition, getStore) {
|
|
|
13389
13943
|
})
|
|
13390
13944
|
};
|
|
13391
13945
|
}
|
|
13946
|
+
function toolParameters(schema2) {
|
|
13947
|
+
return schema2;
|
|
13948
|
+
}
|
|
13949
|
+
const PORTABLE_KEYS = /* @__PURE__ */ new Set([
|
|
13950
|
+
"type",
|
|
13951
|
+
"anyOf",
|
|
13952
|
+
"description",
|
|
13953
|
+
"title",
|
|
13954
|
+
"enum",
|
|
13955
|
+
"const",
|
|
13956
|
+
"default",
|
|
13957
|
+
"nullable",
|
|
13958
|
+
"minimum",
|
|
13959
|
+
"maximum",
|
|
13960
|
+
"minLength",
|
|
13961
|
+
"maxLength",
|
|
13962
|
+
"minItems",
|
|
13963
|
+
"maxItems",
|
|
13964
|
+
"pattern",
|
|
13965
|
+
"format",
|
|
13966
|
+
"properties",
|
|
13967
|
+
"required",
|
|
13968
|
+
"additionalProperties",
|
|
13969
|
+
"items"
|
|
13970
|
+
]);
|
|
13971
|
+
new Set(
|
|
13972
|
+
[...PORTABLE_KEYS].filter((key) => key !== "additionalProperties" && key !== "const")
|
|
13973
|
+
);
|
|
13392
13974
|
const WAIT_TIMEOUT_NOTE = "The wait timed out; this is not a failure. Pending Runs keep going and you will be notified automatically when each finishes — continue other work instead of waiting again.";
|
|
13393
13975
|
const BACKGROUND_RECEIPT_NOTE = "The subagent is working in the background. You will be notified automatically when the Run completes. You know nothing about its results until that notification arrives — do not report, assume, or predict them; continue other work or respond to the user in the meantime. If the user asks for progress, say it is still running. Do not duplicate its work on the same files or topics. agentId and runId are internal ids — do not mention them to the user.";
|
|
13394
13976
|
function normalizeSubagentArgs(params) {
|
|
@@ -13429,13 +14011,15 @@ const SUBAGENT_OPERATIONS = [
|
|
|
13429
14011
|
"list",
|
|
13430
14012
|
"message",
|
|
13431
14013
|
"stop",
|
|
13432
|
-
"dismiss"
|
|
14014
|
+
"dismiss",
|
|
14015
|
+
"resume"
|
|
13433
14016
|
];
|
|
13434
14017
|
const REQUIRED_FIELDS = {
|
|
13435
14018
|
send: ["agentId", "message"],
|
|
13436
14019
|
report: ["runId"],
|
|
13437
14020
|
stop: ["runId"],
|
|
13438
14021
|
dismiss: ["agentId"],
|
|
14022
|
+
resume: ["agentId"],
|
|
13439
14023
|
message: ["to", "text"]
|
|
13440
14024
|
};
|
|
13441
14025
|
const SCHEMA_GATE_HINT = "schema: object, gate: {commandRef: string}";
|
|
@@ -13541,7 +14125,7 @@ function createUnifiedSubagentTool(deps) {
|
|
|
13541
14125
|
if (operation === "report" || operation === "stop") {
|
|
13542
14126
|
return parseAgentControlToolRequest({ operation, runId: params.runId });
|
|
13543
14127
|
}
|
|
13544
|
-
if (operation === "dismiss") {
|
|
14128
|
+
if (operation === "dismiss" || operation === "resume") {
|
|
13545
14129
|
return parseAgentControlToolRequest({ operation, agentId: params.agentId });
|
|
13546
14130
|
}
|
|
13547
14131
|
if (operation === "list") {
|
|
@@ -13560,12 +14144,13 @@ function createUnifiedSubagentTool(deps) {
|
|
|
13560
14144
|
return {
|
|
13561
14145
|
name: "subagent",
|
|
13562
14146
|
label: "Subagent",
|
|
13563
|
-
description: 'Every call must pass operation, including operation:"spawn". Spawn requires non-empty description and prompt parameters; omit both for every other operation. Create and control delegated agents. mode=task is one-shot; mode=coworker preserves context for multiple Runs. All operations are Main-authorized. Spawning and sending are asynchronous unless wait:true; you are notified automatically when a Run finishes.',
|
|
13564
|
-
promptSnippet: 'subagent: always pass operation (operation:"spawn" to spawn). spawn requires non-empty description and prompt. Other operations omit both. Spawn task/coworker agents, list owned agents, send Runs or bound messages, wait/report/stop a Run, or
|
|
14147
|
+
description: 'Every call must pass operation, including operation:"spawn". Spawn requires non-empty description and prompt parameters; omit both for every other operation. Create and control delegated agents. mode=task is one-shot; mode=coworker preserves context for multiple Runs. All operations are Main-authorized. Spawning and sending are asynchronous unless wait:true; you are notified automatically when a Run finishes. A task interrupted before it finished keeps its progress: continue it with operation:"resume" and its agentId — do not spawn it again.',
|
|
14148
|
+
promptSnippet: 'subagent: always pass operation (operation:"spawn" to spawn). spawn requires non-empty description and prompt. Other operations omit both. Spawn task/coworker agents, list owned agents, send Runs or bound messages, wait/report/stop a Run, dismiss an Agent, or resume an interrupted task. Default spawn mode=task and wait=false; finished Runs notify you automatically.',
|
|
13565
14149
|
promptGuidelines: [
|
|
13566
14150
|
'Every subagent call must pass operation; to spawn, pass operation:"spawn". spawn requires non-empty description and prompt. Omit both for every other operation.',
|
|
13567
14151
|
"On spawn, description is the title the user sees in subagent history. Write a short human-readable label of the work, not an id or slug. name is an optional internal handle and is not the title.",
|
|
13568
|
-
"Agent and Run are different identities: use runId for wait/report/stop and agentId for send/dismiss.",
|
|
14152
|
+
"Agent and Run are different identities: use runId for wait/report/stop and agentId for send/dismiss/resume.",
|
|
14153
|
+
`When a task Run is interrupted by something recoverable — a network or provider error that persisted through automatic retries, or an agent worker crash — its Agent is parked with its progress saved and the completion notice says so. Call resume with that agentId to continue from where it stopped (at most ${AGENT_TASK_MAX_RESUMES} times per task) — do not spawn the same task again, which starts over from scratch. If you lost the agentId, list with status:"parked" finds it. Failures that retrying cannot fix (bad request, auth, request budget) close the task instead.`,
|
|
13569
14154
|
"Delegate when the work matches an available agent type, when two independent investigations can run in parallel, when answering needs broad exploration across several files, or when a long-running job can proceed in the background. For a known file, symbol, or single fact, use the direct tool (read for a known path, grep for a specific symbol) instead, and do not repeat work you delegated. Once you've delegated a search, don't also run it yourself.",
|
|
13570
14155
|
"Treat the delivered report as your source of record: do not re-read files it covered unless you are about to edit them or the report is incomplete.",
|
|
13571
14156
|
"Default to doing the work yourself in this thread: a few reads, one search, a short edit, or a single check is faster inline than delegating. Do not fan out several subagents for one small task, do not spawn a subagent to review or re-check work you can verify yourself, and keep the count low — one well-briefed subagent beats several thin ones. When independent subagents should run in parallel, spawn them all in the same message.",
|
|
@@ -13582,7 +14167,7 @@ function createUnifiedSubagentTool(deps) {
|
|
|
13582
14167
|
`model must be copied exactly from the model enum: ${modelNames.join(", ")}. Short names are rejected.${modelNotes ? ` ${modelNotes}.` : ""}`
|
|
13583
14168
|
] : []
|
|
13584
14169
|
],
|
|
13585
|
-
parameters: {
|
|
14170
|
+
parameters: toolParameters({
|
|
13586
14171
|
type: "object",
|
|
13587
14172
|
properties: {
|
|
13588
14173
|
operation: {
|
|
@@ -13651,7 +14236,7 @@ function createUnifiedSubagentTool(deps) {
|
|
|
13651
14236
|
},
|
|
13652
14237
|
required: ["operation"],
|
|
13653
14238
|
additionalProperties: false
|
|
13654
|
-
},
|
|
14239
|
+
}),
|
|
13655
14240
|
prepareArguments: normalizeSubagentArgs,
|
|
13656
14241
|
async execute(toolCallId, params, signal) {
|
|
13657
14242
|
const input = normalizeSubagentArgs(params);
|
|
@@ -13671,7 +14256,7 @@ function createUnifiedSubagentTool(deps) {
|
|
|
13671
14256
|
if (!response.ok) throw new Error(`${response.code}: ${response.error}`);
|
|
13672
14257
|
const receipt = waits ? waitReceiptOf(response.value) : void 0;
|
|
13673
14258
|
const detachedBy = blocking?.reason();
|
|
13674
|
-
const background = !waits && (request.operation === "spawn" || request.operation === "send") && response.value?.status !== void 0;
|
|
14259
|
+
const background = !waits && (request.operation === "spawn" || request.operation === "send" || request.operation === "resume") && response.value?.status !== void 0;
|
|
13675
14260
|
const note = receipt?.interrupted && detachedBy ? detachedWaitNote(detachedBy, "subagent") : receipt?.timedOut ? WAIT_TIMEOUT_NOTE : background ? BACKGROUND_RECEIPT_NOTE : void 0;
|
|
13676
14261
|
const modelNote = defaultedModel ? `No model was given; used ${defaultedModel}, the first configured subagent model. Pass model to choose another.` : void 0;
|
|
13677
14262
|
const value = (note || modelNote) && response.value && typeof response.value === "object" ? {
|
|
@@ -13935,8 +14520,17 @@ function buildTurnDigest(messages, fromIndex) {
|
|
|
13935
14520
|
const userText = userParts.join("\n").slice(0, TURN_DIGEST_USER_MAX);
|
|
13936
14521
|
const conclusion = turnConclusion(turn);
|
|
13937
14522
|
const assistantText = conclusion ? textOf(conclusion).slice(-1500) : "";
|
|
13938
|
-
|
|
13939
|
-
|
|
14523
|
+
const lastTool = conclusion ? void 0 : lastToolOf(turn);
|
|
14524
|
+
if (!userText && !assistantText && !lastTool) return null;
|
|
14525
|
+
return { firstUserText, userText, assistantText, ...lastTool ? { lastTool } : {} };
|
|
14526
|
+
}
|
|
14527
|
+
function lastToolOf(turn) {
|
|
14528
|
+
for (let index = turn.length - 1; index >= 0; index -= 1) {
|
|
14529
|
+
const message = turn[index];
|
|
14530
|
+
if (message.role !== "toolResult" || !message.toolName) continue;
|
|
14531
|
+
return { name: message.toolName, ok: message.isError !== true };
|
|
14532
|
+
}
|
|
14533
|
+
return void 0;
|
|
13940
14534
|
}
|
|
13941
14535
|
function turnConclusion(turn) {
|
|
13942
14536
|
return [...turn].reverse().find(
|
|
@@ -14094,7 +14688,7 @@ function isLoopbackHost(hostname) {
|
|
|
14094
14688
|
if (host === "[::1]" || host === "::1") return true;
|
|
14095
14689
|
return /^127(?:\.\d{1,3}){3}$/.test(host);
|
|
14096
14690
|
}
|
|
14097
|
-
const DEFAULT_TIMEOUT_MS$
|
|
14691
|
+
const DEFAULT_TIMEOUT_MS$1 = 6e4;
|
|
14098
14692
|
class BrowserInvoker {
|
|
14099
14693
|
constructor(identity, emit, options = {}) {
|
|
14100
14694
|
this.identity = identity;
|
|
@@ -14109,7 +14703,7 @@ class BrowserInvoker {
|
|
|
14109
14703
|
if (signal?.aborted) return Promise.reject(new Error("Browser action aborted"));
|
|
14110
14704
|
const requestId = randomUUID();
|
|
14111
14705
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
14112
|
-
const timeoutMs = this.options.timeoutMs ?? DEFAULT_TIMEOUT_MS$
|
|
14706
|
+
const timeoutMs = this.options.timeoutMs ?? DEFAULT_TIMEOUT_MS$1;
|
|
14113
14707
|
const timer = setTimeout(
|
|
14114
14708
|
() => settle(new Error(`Browser action ${op} timed out after ${timeoutMs}ms`)),
|
|
14115
14709
|
timeoutMs
|
|
@@ -14466,7 +15060,7 @@ function pixelFingerprint(data) {
|
|
|
14466
15060
|
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
14467
15061
|
}
|
|
14468
15062
|
const COMPUTER_INVOKE_GRACE_MS = 3e4;
|
|
14469
|
-
const DEFAULT_TIMEOUT_MS
|
|
15063
|
+
const DEFAULT_TIMEOUT_MS = 15e4;
|
|
14470
15064
|
class ComputerInvoker {
|
|
14471
15065
|
constructor(identity, emit, options = {}) {
|
|
14472
15066
|
this.identity = identity;
|
|
@@ -14477,7 +15071,7 @@ class ComputerInvoker {
|
|
|
14477
15071
|
emit;
|
|
14478
15072
|
options;
|
|
14479
15073
|
pending = /* @__PURE__ */ new Map();
|
|
14480
|
-
invoke(op, params, signal, timeoutMs = this.options.timeoutMs ?? DEFAULT_TIMEOUT_MS
|
|
15074
|
+
invoke(op, params, signal, timeoutMs = this.options.timeoutMs ?? DEFAULT_TIMEOUT_MS) {
|
|
14481
15075
|
if (signal?.aborted) return Promise.reject(new Error("Computer action aborted"));
|
|
14482
15076
|
const requestId = randomUUID();
|
|
14483
15077
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
@@ -15202,262 +15796,8 @@ async function readImageView(deps, requested) {
|
|
|
15202
15796
|
data: Buffer.from(bytes).toString("base64")
|
|
15203
15797
|
};
|
|
15204
15798
|
}
|
|
15205
|
-
const
|
|
15206
|
-
|
|
15207
|
-
"preference",
|
|
15208
|
-
"decision",
|
|
15209
|
-
"plan",
|
|
15210
|
-
"procedure",
|
|
15211
|
-
"learning",
|
|
15212
|
-
"context",
|
|
15213
|
-
"event"
|
|
15214
|
-
];
|
|
15215
|
-
function isUnitType(value) {
|
|
15216
|
-
return UNIT_TYPES.includes(value);
|
|
15217
|
-
}
|
|
15218
|
-
const DEFAULT_UNIT_TYPE = "fact";
|
|
15219
|
-
const DEFAULT_IMPORTANCE = 0.5;
|
|
15220
|
-
const AGENT_CREATE_IMPORTANCE = 0.6;
|
|
15221
|
-
const HALF_LIFE_DAYS = 30;
|
|
15222
|
-
const RECENCY_W = 0.7;
|
|
15223
|
-
const FREQUENCY_W = 0.3;
|
|
15224
|
-
const FREQUENCY_MAX_COUNT = 100;
|
|
15225
|
-
const MIN_FLOOR = 0.3;
|
|
15226
|
-
const IMP_MULT = 0.2;
|
|
15227
|
-
const DECAY_WEIGHT = 0.15;
|
|
15228
|
-
const FORGETTING_DEFAULT_STALE_DAYS = 90;
|
|
15229
|
-
const FORGETTING_DEFAULT_MAX_IMPORTANCE = 0.5;
|
|
15230
|
-
const FORGETTING_DEFAULT_INTERVAL_DAYS = 7;
|
|
15231
|
-
const FORGETTING_STALE_DAYS_MIN = 7;
|
|
15232
|
-
const FORGETTING_STALE_DAYS_MAX = 3650;
|
|
15233
|
-
const FORGETTING_MAX_IMPORTANCE_MIN = 0.1;
|
|
15234
|
-
const FORGETTING_MAX_IMPORTANCE_MAX = 0.9;
|
|
15235
|
-
const FORGETTING_INTERVAL_DAYS_MIN = 1;
|
|
15236
|
-
const FORGETTING_INTERVAL_DAYS_MAX = 90;
|
|
15237
|
-
const TEMPORAL_YEAR_BOOST = 0.1;
|
|
15238
|
-
const RRF_K = 60;
|
|
15239
|
-
const MMR_LAMBDA = 0.7;
|
|
15240
|
-
const DEDUP_VECTOR = 0.8;
|
|
15241
|
-
const DEDUP_MAX = 3;
|
|
15242
|
-
const DEDUP_MIN_CHARS = 100;
|
|
15243
|
-
const EVOLVES_MIN_CONF = 0.7;
|
|
15244
|
-
const EVOLVES_RELATIONS = ["replaces", "enriches", "confirms", "challenges"];
|
|
15245
|
-
function isEvolvesRelation(value) {
|
|
15246
|
-
return EVOLVES_RELATIONS.includes(value);
|
|
15247
|
-
}
|
|
15248
|
-
const CRYSTAL_MIN_SOURCES = 3;
|
|
15249
|
-
const CRYSTAL_BOOST = 1.25;
|
|
15250
|
-
const DISTILL_MAX_CHUNK_CHARS = 4e3;
|
|
15251
|
-
const DISTILL_SINGLE_EXTRACT_MAX_TOKENS = 1536;
|
|
15252
|
-
const DISTILL_EXTRACT_MAX_TOKENS = 1536;
|
|
15253
|
-
const DISTILL_CONSOLIDATE_MAX_TOKENS = 1536;
|
|
15254
|
-
const DISTILL_MAX_OUTPUT_TOKENS = 3072;
|
|
15255
|
-
const DISTILL_MIN_IMPORTANCE = 0.5;
|
|
15256
|
-
const DISTILL_MAX_ATTEMPTS = 3;
|
|
15257
|
-
const DISTILL_BATCH_MAX_CHARS = DISTILL_MAX_CHUNK_CHARS * 3;
|
|
15258
|
-
const KG_MAX_ENTITIES = 10;
|
|
15259
|
-
const KG_MAX_RELATIONS = 20;
|
|
15260
|
-
const KG_MAX_ENTITY_NAME_CHARS = 100;
|
|
15261
|
-
const KG_MAX_DESCRIPTION_CHARS = 300;
|
|
15262
|
-
const KG_MAX_LABEL_CHARS = 40;
|
|
15263
|
-
const KG_MAX_ATTEMPTS = 3;
|
|
15264
|
-
const KG_EXTRACT_MAX_TOKENS = 4096;
|
|
15265
|
-
const KG_DEFAULT_ENTITY_TYPE = "CONCEPT";
|
|
15266
|
-
const KG_DEFAULT_RELATION_TYPE = "RELATED_TO";
|
|
15267
|
-
const MEMORY_SEARCH_SPACES = ["all", "global", "project", "bot", "chat"];
|
|
15268
|
-
const MEMORY_CAPTURE_SPACES = ["global", "project", "bot", "chat"];
|
|
15269
|
-
const MEMORY_SEARCH_MODES = ["fast", "deep"];
|
|
15270
|
-
const MEMORY_SEARCH_DEFAULT_LIMIT = 10;
|
|
15271
|
-
const MEMORY_SEARCH_MAX_LIMIT = 50;
|
|
15272
|
-
const MEMORY_SEARCH_DATE_KEYS = [
|
|
15273
|
-
"eventDateFrom",
|
|
15274
|
-
"eventDateTo",
|
|
15275
|
-
"recordedDateFrom",
|
|
15276
|
-
"recordedDateTo"
|
|
15277
|
-
];
|
|
15278
|
-
function asRecord$1(value) {
|
|
15279
|
-
if (typeof value === "string") {
|
|
15280
|
-
const trimmed = value.trim();
|
|
15281
|
-
if (!trimmed.startsWith("{")) return null;
|
|
15282
|
-
try {
|
|
15283
|
-
const parsed = JSON.parse(trimmed);
|
|
15284
|
-
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
15285
|
-
} catch {
|
|
15286
|
-
return null;
|
|
15287
|
-
}
|
|
15288
|
-
}
|
|
15289
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
15290
|
-
}
|
|
15291
|
-
function asNumber(value) {
|
|
15292
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
15293
|
-
if (typeof value === "string" && value.trim()) {
|
|
15294
|
-
const n = Number(value);
|
|
15295
|
-
return Number.isFinite(n) ? n : null;
|
|
15296
|
-
}
|
|
15297
|
-
return null;
|
|
15298
|
-
}
|
|
15299
|
-
function optionalText$1(value) {
|
|
15300
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
15301
|
-
}
|
|
15302
|
-
function normalizeMemorySearchParams(raw) {
|
|
15303
|
-
const record = asRecord$1(raw);
|
|
15304
|
-
if (!record) return raw;
|
|
15305
|
-
const limit = asNumber(record.limit);
|
|
15306
|
-
const space = typeof record.spaceId === "string" ? record.spaceId.trim() : "";
|
|
15307
|
-
const mode = typeof record.mode === "string" ? record.mode.trim().toLowerCase() : "";
|
|
15308
|
-
const dates = {};
|
|
15309
|
-
for (const key of MEMORY_SEARCH_DATE_KEYS) {
|
|
15310
|
-
const v = optionalText$1(record[key]);
|
|
15311
|
-
if (v) dates[key] = v;
|
|
15312
|
-
}
|
|
15313
|
-
return {
|
|
15314
|
-
query: typeof record.query === "string" ? record.query : record.query,
|
|
15315
|
-
limit: limit === null ? MEMORY_SEARCH_DEFAULT_LIMIT : Math.min(MEMORY_SEARCH_MAX_LIMIT, Math.max(1, Math.floor(limit))),
|
|
15316
|
-
spaceId: MEMORY_SEARCH_SPACES.includes(space) ? space : "all",
|
|
15317
|
-
mode: MEMORY_SEARCH_MODES.includes(mode) ? mode : "fast",
|
|
15318
|
-
...dates
|
|
15319
|
-
};
|
|
15320
|
-
}
|
|
15321
|
-
function normalizeMemoryCaptureParams(raw) {
|
|
15322
|
-
const record = asRecord$1(raw);
|
|
15323
|
-
if (!record) return raw;
|
|
15324
|
-
const unitType = optionalText$1(record.unitType)?.toLowerCase();
|
|
15325
|
-
const importance = asNumber(record.importance);
|
|
15326
|
-
const space = typeof record.spaceId === "string" ? record.spaceId.trim() : "";
|
|
15327
|
-
const title = optionalText$1(record.title);
|
|
15328
|
-
const eventStart = optionalText$1(record.eventStart);
|
|
15329
|
-
const eventEnd = optionalText$1(record.eventEnd);
|
|
15330
|
-
const force = record.force === true || record.force === "true";
|
|
15331
|
-
const evolvesFromId = optionalText$1(record.evolvesFromId);
|
|
15332
|
-
const evolvesRelation = optionalText$1(record.evolvesRelation)?.toLowerCase();
|
|
15333
|
-
const evolvesReason = optionalText$1(record.evolvesReason);
|
|
15334
|
-
const emptyEvolutionTarget = typeof record.evolvesFromId === "string" && !evolvesFromId && isEvolvesRelation(evolvesRelation);
|
|
15335
|
-
return {
|
|
15336
|
-
content: record.content,
|
|
15337
|
-
...title ? { title } : {},
|
|
15338
|
-
...unitType ? { unitType } : {},
|
|
15339
|
-
importance: importance !== null && importance >= 0 && importance <= 1 ? importance : AGENT_CREATE_IMPORTANCE,
|
|
15340
|
-
// 缺省 / 非法不产出:worker 不知道会话是否 Bot 模式,由 Main 决定缺省 space
|
|
15341
|
-
...MEMORY_CAPTURE_SPACES.includes(space) ? { spaceId: space } : {},
|
|
15342
|
-
...eventStart ? { eventStart } : {},
|
|
15343
|
-
...eventEnd ? { eventEnd } : {},
|
|
15344
|
-
...force ? { force } : {},
|
|
15345
|
-
...evolvesFromId ? { evolvesFromId } : {},
|
|
15346
|
-
...evolvesRelation && !emptyEvolutionTarget ? { evolvesRelation } : {},
|
|
15347
|
-
// 理由只跟着关系走:没有关系的理由没有意义,别写进库
|
|
15348
|
-
...evolvesReason && evolvesRelation && !emptyEvolutionTarget ? { evolvesReason } : {}
|
|
15349
|
-
};
|
|
15350
|
-
}
|
|
15351
|
-
function asIdList(value) {
|
|
15352
|
-
let list = value;
|
|
15353
|
-
if (typeof value === "string") {
|
|
15354
|
-
const trimmed = value.trim();
|
|
15355
|
-
if (trimmed.startsWith("[")) {
|
|
15356
|
-
try {
|
|
15357
|
-
list = JSON.parse(trimmed);
|
|
15358
|
-
} catch {
|
|
15359
|
-
return value;
|
|
15360
|
-
}
|
|
15361
|
-
} else {
|
|
15362
|
-
list = trimmed.split(",");
|
|
15363
|
-
}
|
|
15364
|
-
}
|
|
15365
|
-
if (!Array.isArray(list)) return value;
|
|
15366
|
-
return [
|
|
15367
|
-
...new Set(
|
|
15368
|
-
list.filter((x) => typeof x === "string").map((x) => x.trim()).filter(Boolean)
|
|
15369
|
-
)
|
|
15370
|
-
];
|
|
15371
|
-
}
|
|
15372
|
-
function normalizeMemoryCrystallizeParams(raw) {
|
|
15373
|
-
const record = asRecord$1(raw);
|
|
15374
|
-
if (!record) return raw;
|
|
15375
|
-
const title = optionalText$1(record.title);
|
|
15376
|
-
const force = record.force === true || record.force === "true";
|
|
15377
|
-
return {
|
|
15378
|
-
content: record.content,
|
|
15379
|
-
title: title ?? record.title,
|
|
15380
|
-
sourceIds: asIdList(record.sourceIds),
|
|
15381
|
-
...force ? { force } : {}
|
|
15382
|
-
};
|
|
15383
|
-
}
|
|
15384
|
-
const hasOnlyKeys = (value, allowed) => Object.keys(value).every((key) => allowed.includes(key));
|
|
15385
|
-
function normalizeMemoryDeleteParams(raw) {
|
|
15386
|
-
const record = asRecord$1(raw);
|
|
15387
|
-
if (!record) return raw;
|
|
15388
|
-
return { id: optionalText$1(record.id) ?? record.id };
|
|
15389
|
-
}
|
|
15390
|
-
function parseMemoryDeleteRequest(value) {
|
|
15391
|
-
const record = asRecord$1(value);
|
|
15392
|
-
if (!record || typeof value === "string" || !hasOnlyKeys(record, ["id"]) || typeof record.id !== "string" || !record.id.trim()) {
|
|
15393
|
-
return null;
|
|
15394
|
-
}
|
|
15395
|
-
return { id: record.id };
|
|
15396
|
-
}
|
|
15397
|
-
function parseMemorySearchRequest(value) {
|
|
15398
|
-
const record = asRecord$1(value);
|
|
15399
|
-
if (!record || typeof value === "string" || !hasOnlyKeys(record, ["query", "limit", "spaceId", "mode", ...MEMORY_SEARCH_DATE_KEYS]) || typeof record.query !== "string" || !record.query.trim() || typeof record.limit !== "number" || !Number.isInteger(record.limit) || record.limit < 1 || record.limit > MEMORY_SEARCH_MAX_LIMIT || !MEMORY_SEARCH_SPACES.includes(record.spaceId) || record.mode !== void 0 && !MEMORY_SEARCH_MODES.includes(record.mode) || MEMORY_SEARCH_DATE_KEYS.some(
|
|
15400
|
-
(k) => record[k] !== void 0 && (typeof record[k] !== "string" || !record[k].trim())
|
|
15401
|
-
)) {
|
|
15402
|
-
return null;
|
|
15403
|
-
}
|
|
15404
|
-
const out = {
|
|
15405
|
-
query: record.query,
|
|
15406
|
-
limit: record.limit,
|
|
15407
|
-
spaceId: record.spaceId,
|
|
15408
|
-
mode: record.mode === "deep" ? "deep" : "fast"
|
|
15409
|
-
};
|
|
15410
|
-
for (const k of MEMORY_SEARCH_DATE_KEYS) if (typeof record[k] === "string") out[k] = record[k];
|
|
15411
|
-
return out;
|
|
15412
|
-
}
|
|
15413
|
-
function parseMemoryCrystallizeRequest(value) {
|
|
15414
|
-
const record = asRecord$1(value);
|
|
15415
|
-
if (!record || typeof value === "string" || !hasOnlyKeys(record, ["content", "title", "sourceIds", "force"]) || typeof record.content !== "string" || !record.content.trim() || typeof record.title !== "string" || !record.title.trim() || !Array.isArray(record.sourceIds) || record.sourceIds.length < CRYSTAL_MIN_SOURCES || !record.sourceIds.every((id) => typeof id === "string" && id.trim()) || record.force !== void 0 && typeof record.force !== "boolean") {
|
|
15416
|
-
return null;
|
|
15417
|
-
}
|
|
15418
|
-
return {
|
|
15419
|
-
content: record.content,
|
|
15420
|
-
title: record.title,
|
|
15421
|
-
sourceIds: record.sourceIds,
|
|
15422
|
-
...record.force !== void 0 ? { force: record.force } : {}
|
|
15423
|
-
};
|
|
15424
|
-
}
|
|
15425
|
-
function parseMemoryCaptureRequest(value) {
|
|
15426
|
-
const record = asRecord$1(value);
|
|
15427
|
-
if (!record || typeof value === "string" || !hasOnlyKeys(record, [
|
|
15428
|
-
"content",
|
|
15429
|
-
"title",
|
|
15430
|
-
"unitType",
|
|
15431
|
-
"importance",
|
|
15432
|
-
"spaceId",
|
|
15433
|
-
"eventStart",
|
|
15434
|
-
"eventEnd",
|
|
15435
|
-
"force",
|
|
15436
|
-
"evolvesFromId",
|
|
15437
|
-
"evolvesRelation",
|
|
15438
|
-
"evolvesReason"
|
|
15439
|
-
]) || typeof record.content !== "string" || !record.content.trim() || record.title !== void 0 && typeof record.title !== "string" || record.unitType !== void 0 && typeof record.unitType !== "string" || typeof record.importance !== "number" || record.importance < 0 || record.importance > 1 || record.spaceId !== void 0 && !MEMORY_CAPTURE_SPACES.includes(record.spaceId) || record.eventStart !== void 0 && typeof record.eventStart !== "string" || record.eventEnd !== void 0 && typeof record.eventEnd !== "string" || record.force !== void 0 && typeof record.force !== "boolean" || record.evolvesReason !== void 0 && typeof record.evolvesReason !== "string" || // 关系与目标必须成对,关系限闭集
|
|
15440
|
-
record.evolvesFromId === void 0 !== (record.evolvesRelation === void 0) || record.evolvesFromId !== void 0 && (typeof record.evolvesFromId !== "string" || !record.evolvesFromId.trim() || !isEvolvesRelation(record.evolvesRelation))) {
|
|
15441
|
-
return null;
|
|
15442
|
-
}
|
|
15443
|
-
const rawUnit = record.unitType?.trim().toLowerCase() ?? "";
|
|
15444
|
-
const unitType = isUnitType(rawUnit) ? rawUnit : DEFAULT_UNIT_TYPE;
|
|
15445
|
-
const unitTypeSource = !rawUnit ? "default" : isUnitType(rawUnit) ? "explicit" : "fallback";
|
|
15446
|
-
return {
|
|
15447
|
-
content: record.content,
|
|
15448
|
-
...record.title !== void 0 ? { title: record.title } : {},
|
|
15449
|
-
unitType,
|
|
15450
|
-
unitTypeSource,
|
|
15451
|
-
importance: record.importance,
|
|
15452
|
-
...record.spaceId !== void 0 ? { spaceId: record.spaceId } : {},
|
|
15453
|
-
...record.eventStart !== void 0 ? { eventStart: record.eventStart } : {},
|
|
15454
|
-
...record.eventEnd !== void 0 ? { eventEnd: record.eventEnd } : {},
|
|
15455
|
-
...record.force !== void 0 ? { force: record.force } : {},
|
|
15456
|
-
...typeof record.evolvesFromId === "string" && isEvolvesRelation(record.evolvesRelation) ? { evolvesFromId: record.evolvesFromId, evolvesRelation: record.evolvesRelation } : {},
|
|
15457
|
-
...typeof record.evolvesReason === "string" && record.evolvesReason.trim() ? { evolvesReason: record.evolvesReason.trim() } : {}
|
|
15458
|
-
};
|
|
15459
|
-
}
|
|
15460
|
-
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
15799
|
+
const SEARCH_TIMEOUT_MS = 15e3;
|
|
15800
|
+
const WRITE_TIMEOUT_MS = 3e4;
|
|
15461
15801
|
class MemoryInvoker {
|
|
15462
15802
|
constructor(identity, emit, options = {}) {
|
|
15463
15803
|
this.identity = identity;
|
|
@@ -15473,7 +15813,7 @@ class MemoryInvoker {
|
|
|
15473
15813
|
if (signal?.aborted) return Promise.reject(new Error("Memory action aborted"));
|
|
15474
15814
|
const requestId = randomUUID();
|
|
15475
15815
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
15476
|
-
const waitMs = timeoutMs ?? this.options.timeoutMs ??
|
|
15816
|
+
const waitMs = timeoutMs ?? this.options.timeoutMs ?? (op === "search" ? SEARCH_TIMEOUT_MS : WRITE_TIMEOUT_MS);
|
|
15477
15817
|
const timer = setTimeout(
|
|
15478
15818
|
() => settle(new Error(`Memory action ${op} timed out after ${waitMs}ms`)),
|
|
15479
15819
|
waitMs
|
|
@@ -15697,96 +16037,6 @@ function createMemoryTools(invoker, opts = {}) {
|
|
|
15697
16037
|
)
|
|
15698
16038
|
];
|
|
15699
16039
|
}
|
|
15700
|
-
const READABLE_MESSAGE_MAX_CHARS = 2e3;
|
|
15701
|
-
const MESSAGE_CHUNK_MAX = 3e4;
|
|
15702
|
-
const END_TAG = "</untrusted-content";
|
|
15703
|
-
function wrapUntrusted(source, text2) {
|
|
15704
|
-
const escaped = text2.split(END_TAG).join("<\\/untrusted-content");
|
|
15705
|
-
return `<untrusted-content source="${source}">${escaped}</untrusted-content>`;
|
|
15706
|
-
}
|
|
15707
|
-
function readableText(message) {
|
|
15708
|
-
return message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n").trim();
|
|
15709
|
-
}
|
|
15710
|
-
function chunkMessageText(text2, offset = 0) {
|
|
15711
|
-
const totalChars = text2.length;
|
|
15712
|
-
const start = Number.isFinite(offset) ? Math.min(Math.max(0, Math.floor(offset)), totalChars) : 0;
|
|
15713
|
-
const end = Math.min(start + MESSAGE_CHUNK_MAX, totalChars);
|
|
15714
|
-
return {
|
|
15715
|
-
text: text2.slice(start, end),
|
|
15716
|
-
offset: start,
|
|
15717
|
-
totalChars,
|
|
15718
|
-
...end < totalChars ? { nextOffset: end } : {}
|
|
15719
|
-
};
|
|
15720
|
-
}
|
|
15721
|
-
function projectReadableMessages(messages, options) {
|
|
15722
|
-
const baseIndex = options.baseIndex ?? 0;
|
|
15723
|
-
const maxChars = options.maxChars ?? READABLE_MESSAGE_MAX_CHARS;
|
|
15724
|
-
const readable = [];
|
|
15725
|
-
messages.forEach((message, offset) => {
|
|
15726
|
-
if (message.role !== "user" && message.role !== "assistant") return;
|
|
15727
|
-
const text2 = readableText(message);
|
|
15728
|
-
if (!text2) return;
|
|
15729
|
-
const truncated = text2.length > maxChars;
|
|
15730
|
-
readable.push({
|
|
15731
|
-
index: baseIndex + offset,
|
|
15732
|
-
role: message.role,
|
|
15733
|
-
text: truncated ? `${text2.slice(0, maxChars)}…` : text2,
|
|
15734
|
-
...truncated ? { truncated: true } : {}
|
|
15735
|
-
});
|
|
15736
|
-
});
|
|
15737
|
-
const kept = readable.slice(-Math.max(0, options.limit));
|
|
15738
|
-
const firstIndex = kept[0]?.index ?? baseIndex;
|
|
15739
|
-
return { messages: kept, hasMore: firstIndex > 0 };
|
|
15740
|
-
}
|
|
15741
|
-
const SEND_IMAGE_PER_REPLY = 4;
|
|
15742
|
-
const SEND_IMAGE_CAPTION_MAX = 200;
|
|
15743
|
-
const MEDIA_ID_RE = /^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/;
|
|
15744
|
-
const SOURCES = ["file", "web", "desktop"];
|
|
15745
|
-
const ERRORS = ["too-large", "quota"];
|
|
15746
|
-
const isMediaId = (value) => typeof value === "string" && MEDIA_ID_RE.test(value);
|
|
15747
|
-
const optionalText = (value, max) => typeof value === "string" && value.trim() ? value.trim().slice(0, max) : void 0;
|
|
15748
|
-
function parseSendImageResult(text2) {
|
|
15749
|
-
let value;
|
|
15750
|
-
try {
|
|
15751
|
-
value = JSON.parse(text2.split("\n", 1)[0]);
|
|
15752
|
-
} catch {
|
|
15753
|
-
return null;
|
|
15754
|
-
}
|
|
15755
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
15756
|
-
const raw = value;
|
|
15757
|
-
if (typeof raw.source !== "string" || !SOURCES.includes(raw.source)) return null;
|
|
15758
|
-
const source = raw.source;
|
|
15759
|
-
const name = optionalText(raw.name, 1024);
|
|
15760
|
-
const caption = optionalText(raw.caption, SEND_IMAGE_CAPTION_MAX);
|
|
15761
|
-
const extra = { ...name ? { name } : {}, ...caption ? { caption } : {} };
|
|
15762
|
-
if (raw.ok === true && isMediaId(raw.mediaId))
|
|
15763
|
-
return { ok: true, mediaId: raw.mediaId, source, ...extra };
|
|
15764
|
-
if (raw.ok === false && typeof raw.error === "string" && ERRORS.includes(raw.error))
|
|
15765
|
-
return { ok: false, error: raw.error, source, ...extra };
|
|
15766
|
-
return null;
|
|
15767
|
-
}
|
|
15768
|
-
function resultText(message) {
|
|
15769
|
-
if (!Array.isArray(message.content)) return "";
|
|
15770
|
-
return message.content.map(
|
|
15771
|
-
(part) => part?.type === "text" && typeof part.text === "string" ? part.text : ""
|
|
15772
|
-
).join("");
|
|
15773
|
-
}
|
|
15774
|
-
function sendImageItems(messages) {
|
|
15775
|
-
const out = [];
|
|
15776
|
-
const seen = /* @__PURE__ */ new Set();
|
|
15777
|
-
for (const message of messages) {
|
|
15778
|
-
if (out.length >= SEND_IMAGE_PER_REPLY) break;
|
|
15779
|
-
if (message.role !== "toolResult" || message.toolName !== "send_image") continue;
|
|
15780
|
-
const item = parseSendImageResult(resultText(message));
|
|
15781
|
-
if (!item) continue;
|
|
15782
|
-
if (item.ok) {
|
|
15783
|
-
if (seen.has(item.mediaId)) continue;
|
|
15784
|
-
seen.add(item.mediaId);
|
|
15785
|
-
}
|
|
15786
|
-
out.push(item);
|
|
15787
|
-
}
|
|
15788
|
-
return out;
|
|
15789
|
-
}
|
|
15790
16040
|
const NATIVE_TIMEOUT_MS = 9e4;
|
|
15791
16041
|
const EXA_TIMEOUT_MS = 3e4;
|
|
15792
16042
|
const EXA_MCP_URL = "https://mcp.exa.ai/mcp?tools=web_search_exa";
|
|
@@ -16806,7 +17056,7 @@ export {
|
|
|
16806
17056
|
projectMessage as Z,
|
|
16807
17057
|
ensureAccountProvider as _,
|
|
16808
17058
|
APPLY_PATCH_PROMPT_GUIDELINES as a,
|
|
16809
|
-
|
|
17059
|
+
positiveContextWindow as a$,
|
|
16810
17060
|
takeSnapshotTail as a0,
|
|
16811
17061
|
attachBackgroundCommandHooks as a1,
|
|
16812
17062
|
ForegroundDetachedError as a2,
|
|
@@ -16817,33 +17067,33 @@ export {
|
|
|
16817
17067
|
buildElevatedCommand as a7,
|
|
16818
17068
|
ELEVATE_DECLINED_MARKER as a8,
|
|
16819
17069
|
ELEVATE_TIMED_OUT_MARKER as a9,
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
17070
|
+
resolveOauthCatalogModel as aA,
|
|
17071
|
+
createSshExecutor as aB,
|
|
17072
|
+
partitionMcpNamespaces as aC,
|
|
17073
|
+
CodemodeHost as aD,
|
|
17074
|
+
ApprovalGate as aE,
|
|
17075
|
+
HUMAN_REQUEST_TIMEOUT_MS as aF,
|
|
17076
|
+
TodoStaleReminder as aG,
|
|
17077
|
+
CoworkerIdleReminder as aH,
|
|
17078
|
+
createUnifiedSubagentTool as aI,
|
|
17079
|
+
workflowPresetRoots as aJ,
|
|
17080
|
+
withMandatoryApproval as aK,
|
|
17081
|
+
createBrowserTools as aL,
|
|
17082
|
+
withNavigateApproval as aM,
|
|
17083
|
+
createMemoryTools as aN,
|
|
17084
|
+
withComputerApproval as aO,
|
|
17085
|
+
createComputerTool as aP,
|
|
17086
|
+
withApproval as aQ,
|
|
17087
|
+
listWorkflowPresets as aR,
|
|
17088
|
+
createTaskTools as aS,
|
|
17089
|
+
BrowserInvoker as aT,
|
|
17090
|
+
MemoryInvoker as aU,
|
|
17091
|
+
PlanController as aV,
|
|
17092
|
+
ComputerInvoker as aW,
|
|
17093
|
+
AskManager as aX,
|
|
17094
|
+
createAskTool as aY,
|
|
17095
|
+
snapshotMainConversation as aZ,
|
|
17096
|
+
lastAssistantText as a_,
|
|
16847
17097
|
ELEVATE_TIMEOUT_MS as aa,
|
|
16848
17098
|
ELEVATE_UNAVAILABLE_MARKER as ab,
|
|
16849
17099
|
expandSkillCommands as ac,
|
|
@@ -16855,218 +17105,169 @@ export {
|
|
|
16855
17105
|
readImageView as ai,
|
|
16856
17106
|
resolveRoots as aj,
|
|
16857
17107
|
systemImageRoots as ak,
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
|
|
17108
|
+
prependTurnNote as al,
|
|
17109
|
+
describeSubagentModels as am,
|
|
17110
|
+
resolveWorkflowPresetArgs as an,
|
|
17111
|
+
extractWriteTargetPaths as ao,
|
|
17112
|
+
programTokens as ap,
|
|
17113
|
+
RESTART_CHECKPOINT_ARCHIVE as aq,
|
|
17114
|
+
takeRestartCheckpoint as ar,
|
|
17115
|
+
BackgroundTaskManager as as,
|
|
17116
|
+
takeDetachedTasksManifest as at,
|
|
17117
|
+
DETACHED_TASKS_FILE as au,
|
|
17118
|
+
sweepOrphanRuns as av,
|
|
17119
|
+
takeInterruptedTasks as aw,
|
|
17120
|
+
INTERRUPTED_TASKS_FILE as ax,
|
|
17121
|
+
isDeferredMcp as ay,
|
|
17122
|
+
providerIdOfAccountKey as az,
|
|
16873
17123
|
emptyUsage as b,
|
|
16874
|
-
|
|
16875
|
-
|
|
16876
|
-
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
|
|
17124
|
+
OVERVIEW_TAIL_MESSAGES as b$,
|
|
17125
|
+
foregroundCommandTimeoutMs as b0,
|
|
17126
|
+
buildTurnDigest as b1,
|
|
17127
|
+
buildTurnReport as b2,
|
|
17128
|
+
awaitChecklist as b3,
|
|
17129
|
+
settleChecklist as b4,
|
|
16880
17130
|
parseJsonFromAssistant as b5,
|
|
16881
17131
|
validateAgainstSchema as b6,
|
|
16882
17132
|
appendYieldJson as b7,
|
|
16883
17133
|
appendCappedLog as b8,
|
|
16884
17134
|
AGENT_COMPACTION_LOG as b9,
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
17135
|
+
CODEMODE_TOOL_NAME as bA,
|
|
17136
|
+
prepareCodemodeInput as bB,
|
|
17137
|
+
ANTIGRAVITY_PROVIDER_ID as bC,
|
|
17138
|
+
antigravityProviderConfig as bD,
|
|
17139
|
+
DEVIN_PROVIDER_ID as bE,
|
|
17140
|
+
devinProviderConfig as bF,
|
|
17141
|
+
QODER_PROVIDER_ID as bG,
|
|
17142
|
+
qoderProviderConfig as bH,
|
|
17143
|
+
QODER_CN_PROVIDER_ID as bI,
|
|
17144
|
+
installCodexLinkedRefresh as bJ,
|
|
17145
|
+
isHeadlessRun as bK,
|
|
17146
|
+
withBackground as bL,
|
|
17147
|
+
withProtectedFloor as bM,
|
|
17148
|
+
loadWorkflowPreset as bN,
|
|
17149
|
+
cloneModelsDevOauthModel as bO,
|
|
17150
|
+
withWriteScope as bP,
|
|
17151
|
+
withWritePreflight as bQ,
|
|
17152
|
+
validateApplyPatchTargets as bR,
|
|
17153
|
+
withAgentRead as bS,
|
|
17154
|
+
extractEditTargetPath as bT,
|
|
17155
|
+
buildSshShellCommand as bU,
|
|
17156
|
+
resolveSshControlPath as bV,
|
|
17157
|
+
sshPasswordEnv as bW,
|
|
17158
|
+
getApplyPatchPaths as bX,
|
|
17159
|
+
RESTART_CHECKPOINT_ENV as bY,
|
|
17160
|
+
isVirtualRef as bZ,
|
|
17161
|
+
findVirtualModel as b_,
|
|
16912
17162
|
restartGate as ba,
|
|
16913
17163
|
writeRestartCheckpoint as bb,
|
|
16914
17164
|
RESTART_CHECKPOINT_FILE as bc,
|
|
16915
17165
|
writeDetachedTasksManifest as bd,
|
|
16916
17166
|
killRunGroup as be,
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
|
|
16933
|
-
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
17167
|
+
appendInterruptedTasks as bf,
|
|
17168
|
+
describeTitleModel as bg,
|
|
17169
|
+
buildRollingTitleUserText as bh,
|
|
17170
|
+
buildInitialTitleUserText as bi,
|
|
17171
|
+
ROLLING_TITLE_SYSTEM_PROMPT as bj,
|
|
17172
|
+
TITLE_SYSTEM_PROMPT as bk,
|
|
17173
|
+
extractTitle as bl,
|
|
17174
|
+
titleRejectReason as bm,
|
|
17175
|
+
resolveChildReasoning as bn,
|
|
17176
|
+
pickChildReasoningOverride as bo,
|
|
17177
|
+
fitChildReasoningToModel as bp,
|
|
17178
|
+
createWebTools as bq,
|
|
17179
|
+
createTodoTool as br,
|
|
17180
|
+
withPlanGate as bs,
|
|
17181
|
+
createSubmitPlanTool as bt,
|
|
17182
|
+
titleSummaryTimeoutMs as bu,
|
|
17183
|
+
splitTurnNotes as bv,
|
|
17184
|
+
resolveHarnessSkillRoots as bw,
|
|
17185
|
+
approvalReviewResultExtension as bx,
|
|
17186
|
+
readHarnessRuleFiles as by,
|
|
17187
|
+
createProjectSettingsManager as bz,
|
|
16938
17188
|
charsToTokens as c,
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
|
|
17189
|
+
deleteCustomWorkflowPreset as c$,
|
|
17190
|
+
OVERVIEW_BYTE_BUDGET as c0,
|
|
17191
|
+
syncAccountProviders as c1,
|
|
17192
|
+
expandOauthCatalog as c2,
|
|
17193
|
+
supportsMultipleAccounts as c3,
|
|
17194
|
+
parseCodexAuthJson as c4,
|
|
17195
|
+
CODEX_PROVIDER_ID as c5,
|
|
17196
|
+
nextAccountKey as c6,
|
|
17197
|
+
sanitizeUpstreamBody as c7,
|
|
17198
|
+
defaultCodexAuthPath as c8,
|
|
17199
|
+
ordinalOfAccountKey as c9,
|
|
17200
|
+
withPrivacyMask as cA,
|
|
17201
|
+
withUserEntryIds as cB,
|
|
17202
|
+
SNAPSHOT_TAIL_MESSAGES as cC,
|
|
17203
|
+
splitUnattendedPrefix as cD,
|
|
17204
|
+
userTextWithoutSkills as cE,
|
|
17205
|
+
defaultImageRoots as cF,
|
|
17206
|
+
classifyCommand as cG,
|
|
17207
|
+
probeImageView as cH,
|
|
17208
|
+
inImageViewScope as cI,
|
|
17209
|
+
IMAGE_VIEW_MAX_BYTES as cJ,
|
|
17210
|
+
validateScopedFile as cK,
|
|
17211
|
+
readImageFacts as cL,
|
|
17212
|
+
resolveSshTarget as cM,
|
|
17213
|
+
checkPassed as cN,
|
|
17214
|
+
checkFailureText as cO,
|
|
17215
|
+
parseVirtualClassifier as cP,
|
|
17216
|
+
VIRTUAL_CLASSIFIER_DEFAULT_TIMEOUT_MS as cQ,
|
|
17217
|
+
EnsoSafeJournal as cR,
|
|
17218
|
+
isSecretFilePath as cS,
|
|
17219
|
+
isUnderSecretDirectory as cT,
|
|
17220
|
+
codemodeToolSnapshot as cU,
|
|
17221
|
+
estimateToolsTotal as cV,
|
|
17222
|
+
listCustomWorkflowPresets as cW,
|
|
17223
|
+
listBuiltinWorkflowPresets as cX,
|
|
17224
|
+
readCustomWorkflowPreset as cY,
|
|
17225
|
+
parseWorkflowPresetDraft as cZ,
|
|
17226
|
+
saveCustomWorkflowPreset as c_,
|
|
17227
|
+
sanitizeOauthLabel as ca,
|
|
17228
|
+
parseAntigravityApiKey as cb,
|
|
17229
|
+
fetchAntigravityUsage as cc,
|
|
17230
|
+
fetchDevinUsage as cd,
|
|
17231
|
+
DEFAULT_PERSONA_PROMPT as ce,
|
|
17232
|
+
parseAgentWorkerCrash as cf,
|
|
17233
|
+
AGENT_WORKER_EXIT_LOG as cg,
|
|
17234
|
+
elevatedCommandOf as ch,
|
|
17235
|
+
parseRestartCheckpoint as ci,
|
|
17236
|
+
startOauthCallbackServer as cj,
|
|
17237
|
+
MODELS_DEV_URL as ck,
|
|
17238
|
+
writeModelsDevCache as cl,
|
|
17239
|
+
parseModelsDevPayload as cm,
|
|
17240
|
+
MODELS_DEV_CACHE_NAME as cn,
|
|
17241
|
+
modelsDevIsFresh as co,
|
|
17242
|
+
withModelsDevOauthModels as cp,
|
|
17243
|
+
appUserImageDirs as cq,
|
|
17244
|
+
describeAgentWorkerExit as cr,
|
|
17245
|
+
directMemberRef as cs,
|
|
17246
|
+
materializeProviders as ct,
|
|
17247
|
+
parseVirtualModels as cu,
|
|
17248
|
+
classifierProviderFor as cv,
|
|
17249
|
+
classifierBaseUrlFor as cw,
|
|
17250
|
+
pickModelCapabilityOverrides as cx,
|
|
17251
|
+
canBeVirtualMember as cy,
|
|
17252
|
+
mcpTimeoutsForSpawn as cz,
|
|
17003
17253
|
skillOccupancyText as d,
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
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,
|
|
17254
|
+
parseBtwPromptRequest as d0,
|
|
17255
|
+
btwModelCandidates as d1,
|
|
17256
|
+
parseBtwAbortRequest as d2,
|
|
17257
|
+
parseBtwSpawnRequest as d3,
|
|
17258
|
+
BTW_DISABLED_TOOLS as d4,
|
|
17259
|
+
parseBtwDisposeRequest as d5,
|
|
17260
|
+
isHumanRequestTimeout as d6,
|
|
17261
|
+
buildSshExecArgs as d7,
|
|
17262
|
+
buildRemoteCommand as d8,
|
|
17263
|
+
listProjectCodeSources as d9,
|
|
17264
|
+
positiveFiniteNumber as da,
|
|
17265
|
+
mergeFetchedOauthModels as db,
|
|
17266
|
+
supportedProjectThinkingLevels as dc,
|
|
17267
|
+
buildSshPtyArgs as dd,
|
|
17268
|
+
ENSO_HEADLESS_RUN_ENV as de,
|
|
17269
|
+
projection as df,
|
|
17067
17270
|
executeApplyPatch as e,
|
|
17068
|
-
ENSO_HEADLESS_RUN_ENV as e0,
|
|
17069
|
-
projection as e1,
|
|
17070
17271
|
estimateToolTokens as f,
|
|
17071
17272
|
estimateSkillTokens as g,
|
|
17072
17273
|
estimateInstructionTokens as h,
|
|
@@ -17089,4 +17290,4 @@ export {
|
|
|
17089
17290
|
isObservationsDroppedEntry as y,
|
|
17090
17291
|
buildObservationsRecordedData as z
|
|
17091
17292
|
};
|
|
17092
|
-
//# sourceMappingURL=workflowPresets-
|
|
17293
|
+
//# sourceMappingURL=workflowPresets-C2T1BzA2.js.map
|