@ensocode/server 0.3.4 → 0.3.6
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/{abnfDiagram-VCTEODGH-6JYofuK8.js → abnfDiagram-VCTEODGH-CcwMwkZ2.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-K5Dyn6vg.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-BeLeAQB1.js → architectureDiagram-5GKGNRK7-C4vXoVVW.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-uXn3vhT2.js → blockDiagram-I7D4REHJ-btZonF7x.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-CjzMFRll.js → c4Diagram-7LVT6UL2-wbgQC5h_.js} +1 -1
- package/out/phone/assets/channel-C0dO6zWg.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-BA8HaYy2.js → chunk-4HAMMTFA-ClL6ufY7.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-BhIfO9es.js → chunk-75Z2AOVW-CsGKueom.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-BTLBHwj-.js → chunk-DU6HZSFF-BOrl8wD9.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-CUw8NZk8.js → chunk-F27PBJKO-CQYtYMPT.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW-bZOKnRyM.js → chunk-GMAD6QVW-D2uUUIys.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-B0WIm1dS.js → chunk-GVQU2GXP-k4NEAgCW.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-DWND4rEr.js → chunk-IMKFNOWR-DGBKnQoB.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-DgMknY3k.js → chunk-L3NEJ4N5-BrOC_Q4h.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-C5aEouov.js → chunk-OSK3NFVY-Cpg-5-0Y.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-D2ID3RxV.js → chunk-P2QGCYS3-Cwbos3wS.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-C1lOuNpV.js → chunk-POPQ4Y6H-CtPqYixr.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-CfqWQZRE.js → chunk-PWAF6VOD-HDvh5SEv.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-p37Dlvn4.js → chunk-SHT3W25Y-DKgmKLLr.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-CSSqW-zb.js → chunk-SVP7TREG-DLVIWYD0.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-Bse5ne4b.js → chunk-TICWLB2K-DzvrdWmw.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-CWPX0UEe.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-CWPX0UEe.js +1 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-BGQqPhYk.js → cynefin-OW5HDTMX-Cx32WN9e.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-Cz3XWaxY.js → cynefinDiagram-5FMLGOSQ-k3jOnfBl.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-CjAF6lSz.js → dagre-GXQ25YYZ-CTEzzJig.js} +1 -1
- package/out/phone/assets/desk-9dPB4fYu.js +2 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-B135cp5a.js → diagram-S7CK7UJ4-BpfiB5rc.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-C4pCe0fQ.js → diagram-UQ7AKVKN-BpJj6V2i.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-CYkCrin2.js → diagram-VSXAHHWV-BXTUks5P.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-CT_vufh_.js → diagram-VX7I27RA-BGaGiVKW.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-XEkkXu3P.js → diagram-Z3DM3KII-DhtDyIq2.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-DfLyeXjw.js → ebnfDiagram-PWID7BFC-TUM8eXrc.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-pKNbKkAP.js → erDiagram-RLTQ6QDP-DqLrmkHj.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-_H7VbKRu.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-HeI2O8Jm.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-Df4E50Mj.js → ganttDiagram-EL5Y4UJY-Bfx_3wSL.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-CkjzZeFD.js → gitGraph-4MIJSDKK-BByrtu13.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-CBxfRAfy.js → gitGraphDiagram-WWUBYQGX-DX-_HrkV.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-CHFXa2pw.js → info-A6RAGUB7-B9AtEuqS.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-K0DnZhi4.js → infoDiagram-27XIBGKW-BlTJ4y54.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-DTQF2ZuR.js → ishikawaDiagram-5VMMS53U-W8zt5UiH.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-wBltkU2i.js → journeyDiagram-3NMN7TZE-ClJSjx26.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-BZpcOajP.js → kanban-definition-UXKFOSKX-BPyXsdoL.js} +1 -1
- package/out/phone/assets/{line-BflnZFgp.js → line-DMsvqHhd.js} +1 -1
- package/out/phone/assets/main-DNRbLxEx.css +1 -0
- package/out/phone/assets/{main-Crtf_g8h.js → main-QdYtohlX.js} +97 -97
- package/out/phone/assets/{mermaid-parser.core-BiCTmcqa.js → mermaid-parser.core-BteiwAAk.js} +3 -3
- package/out/phone/assets/{mermaid.core-D3TwYaLF.js → mermaid.core-BLIwkLpP.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-Cz0aS_6Y.js → mindmap-definition-YA3MSWOX-CtvOuG70.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-DW-djbhd.js → packet-AYTQ26CC-D9BlJkYf.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-CE0sZZAE.js → pegDiagram-XKGWAZYB-BCIWH2f6.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-CKGFlXok.js → pie-WAS4IAKB-no-EBGVU.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-BrnQ32_6.js → pieDiagram-E7YTZNPT-CSjCYWAz.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-BrxDAygB.js → quadrantDiagram-AXDQQJYC-Bh1Jh1q-.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-Bo2f5QyA.js → radar-RG4KPBEZ-BVweBCte.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-BZEmm0Ha.js → railroad-74A4TZTK-kUK_6AdA.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-Df9jtRyX.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-vjjsvYjl.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-DrKQG8aR.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-BvOyUNMC.js → railroadDiagram-O6MQD6OU-DDKZuEH9.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-T42N3TW5.js → requirementDiagram-BXWQKSXE-BAdrpp8Z.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-0us9ErVV.js → sankeyDiagram-P5KCCOFB-Dm0dmnQJ.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BMcYh2ll.js → sequenceDiagram-WJ2MYXX4-DtN1lgR9.js} +1 -1
- package/out/phone/assets/{stateDiagram-D77RDMKH-CgP9dUc3.js → stateDiagram-D77RDMKH-m5U6QGoM.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-g06bNGjI.js +1 -0
- package/out/phone/assets/storage-p-WxHA1h.js +1 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-VnE4ceCW.js → swimlanes-42K2YHIH-jWtOgaZK.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CwlfCnnJ.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-tH3izgae.js → timeline-definition-24CTP7MA-CncsPQSQ.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-CVFDOC7i.js → treeView-Q6P3EWNA-BNIDY5fM.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-vmikHzt3.js → treemap-WGGIJYW6-FkDWRKqS.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-b8ttDCR-.js → vennDiagram-4TSXK5OY-CeyTscuj.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-D32vKoC1.js → wardley-WFR3VGLG-CEuN_S8l.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-CMkaIPVH.js → wardleyDiagram-VM6X3IG4-DE3tgI7J.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-pLYDcql3.js → xychartDiagram-S5SC5T6Z-Di64LYy0.js} +1 -1
- package/out/phone/desk.html +2 -2
- package/out/phone/index.html +3 -3
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-N6OiVFQx.js → abnfDiagram-VCTEODGH-B7uu_Gw1.js} +1 -1
- package/out/renderer/assets/{arc-CXVc3U0J.js → arc-CkW2-Pr7.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-BT5CXpcQ.js → architectureDiagram-5GKGNRK7-2E0AYPn5.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-C32Vqzip.js → blockDiagram-I7D4REHJ-BsSmBeco.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-qjwL2BP8.js → c4Diagram-7LVT6UL2-gzVW5Xek.js} +1 -1
- package/out/renderer/assets/channel-AuDXnH14.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-YC6CQiyD.js → chunk-2Q5K7J3B-K_IlhZEX.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-E-kluPz3.js → chunk-5VM5RSS4-r65AjBn5.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-Bhx1_P75.js → chunk-F27PBJKO-CZszqKBI.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-Dgb_730B.js → chunk-IMKFNOWR-7mYCkNCZ.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-COQNHw4u.js → chunk-JWPE2WC7-B-cBpNJA.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-CQz4hRgP.js → chunk-POPQ4Y6H-CjWY4_mJ.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-DGp9XQFd.js → chunk-SVP7TREG-g5p-RdlH.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-CovR1uHr.js → chunk-TICWLB2K-BMr5sD7G.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-gVmqSU5b.js → chunk-XXDRQBXY-CNfQgYe3.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-D8JIsdAI.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-D8JIsdAI.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-DD4PEqt_.js → cose-bilkent-JH36ORCC-ByPl0yeB.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-DNsYCrBx.js → cynefin-OW5HDTMX-CMTgEepT.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-CoSzqs25.js → cynefinDiagram-5FMLGOSQ-DYx_JMNT.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-CV0MpCmk.js → cytoscape-fcose-BcbfusAa.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-BxpTPeHN.js → dagre-GXQ25YYZ-p-Meu2Lo.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-Df_OM1vW.js → diagram-S7CK7UJ4-1m9BA3xi.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-iovjmny_.js → diagram-UQ7AKVKN-Cg3zgAxc.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-BMrwlcQx.js → diagram-VSXAHHWV-B58Hl37z.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-DqLh449X.js → diagram-VX7I27RA-C7dhzeqr.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-CH_W77UO.js → diagram-Z3DM3KII-C-Bn7OHR.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-yjzodXoL.js → ebnfDiagram-PWID7BFC-BcrVBxSI.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-DXxhvHYS.js → erDiagram-RLTQ6QDP-CZHJHTxr.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-b2AWCAaB.js → flowDiagram-HODETNUW-oCdJ784z.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-COkyXL3K.js → ganttDiagram-EL5Y4UJY-C9TlTohh.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-BYPqy5fh.js → gitGraphDiagram-WWUBYQGX-RVFZsGPP.js} +1 -1
- package/out/renderer/assets/globals-BJ2xID1e.js +2539 -0
- package/out/renderer/assets/globals-l3kDGoYH.css +1 -0
- package/out/renderer/assets/index-CHNrHypo.js +117 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-DNg-VxlH.js → infoDiagram-27XIBGKW-CxE810pn.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-DProTI6a.js → ishikawaDiagram-5VMMS53U-Osr2JJcF.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-BWhC4n3f.js → journeyDiagram-3NMN7TZE-Bigxb8hB.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-CHJRR0qi.js → kanban-definition-UXKFOSKX-DVP3FCG8.js} +1 -1
- package/out/renderer/assets/{layout-D8t6q8k0.js → layout-Dn80hFs0.js} +1 -1
- package/out/renderer/assets/{linear-Cxb1p4iF.js → linear-B4dfTk2J.js} +1 -1
- package/out/renderer/assets/{mermaid.core-CFNOEUmc.js → mermaid.core-uI5XQTV1.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-Ba78cyY4.js → mindmap-definition-YA3MSWOX-BD7FdpQU.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-C7zqoWMk.js → pegDiagram-XKGWAZYB-DU5iHhXs.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-g304yFeX.js → pieDiagram-E7YTZNPT-DpEVmuWZ.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-Bwn3gGTO.js → quadrantDiagram-AXDQQJYC-CcEfCONf.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-DRetS8pv.js → railroadDiagram-O6MQD6OU-BWnKKcat.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-CHz0FVZ7.js → requirementDiagram-BXWQKSXE-B7sPFe0g.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-BYGRDIG9.js → sankeyDiagram-P5KCCOFB-ClwzZmCX.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-B60RuFFk.js → sequenceDiagram-WJ2MYXX4-Dn8StCfr.js} +1 -1
- package/out/renderer/assets/settings-CUBQyINw.js +34 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-CB-i3Fmz.js → sizeCapture-INFHLROL-Csrj-WKZ.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-CJOcikAJ.js → stateDiagram-D77RDMKH-CuJq0aAV.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-CXFPvfab.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-Buap2upT.js → swimlanes-42K2YHIH-CjyTBmUr.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-D83-vEQi.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-BdQta3QT.js → timeline-definition-24CTP7MA-BSTk1WRZ.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-BynM2l28.js → vennDiagram-4TSXK5OY-oO2Udqo9.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-FZjDO9FY.js → wardleyDiagram-VM6X3IG4-C27UPHbe.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-pJPSISxM.js → xychartDiagram-S5SC5T6Z-_SQkHfU0.js} +1 -1
- package/out/renderer/index.html +3 -3
- package/out/renderer/settings.html +4 -4
- package/out/renderer/web-preload.js +1 -1
- package/out/server/agent.js +564 -533
- package/out/server/chunks/{agent--Q7N17bY.js → agent-BlAuVqNp.js} +158 -215
- package/out/server/chunks/{gpuBackendInstall-P7COXJlD.js → gpuBackendInstall-C-ypqydV.js} +9 -8
- package/out/server/chunks/{loadProvider-DvvFIF6F.js → loadProvider-CQUR_oho.js} +7 -20
- package/out/server/chunks/{manifest-BvEa5QR3.js → manifest-CojWIAHB.js} +6 -3
- package/out/server/chunks/{workflowPresets-CuLnfQqa.js → workflowPresets-DQ3QX6Ju.js} +808 -1841
- package/out/server/index.js +6005 -6581
- package/out/server/plugin-host.js +62 -26
- package/package.json +4 -4
- package/out/phone/assets/architecture-7GRP2DOG-D7mwyuxS.js +0 -1
- package/out/phone/assets/channel-BsGN1oT0.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-a1PUvjC2.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-a1PUvjC2.js +0 -1
- package/out/phone/assets/desk-1McWacjU.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-DcUsfQiW.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-sUobw8zi.js +0 -1
- package/out/phone/assets/main-CnA1zWP8.css +0 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-CGiIT1ZV.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-C85Q3c0J.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-8qPPCLgU.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-WM4CNSf-.js +0 -1
- package/out/phone/assets/storage-CahQ0cyN.js +0 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-65AiMWVp.js +0 -8
- package/out/renderer/assets/channel-B1Cv56hA.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-CDWgELaf.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-CDWgELaf.js +0 -1
- package/out/renderer/assets/globals-DX-8GWfJ.css +0 -1
- package/out/renderer/assets/globals-y5_C1IiJ.js +0 -2539
- package/out/renderer/assets/index-CHJ6mVl2.js +0 -117
- package/out/renderer/assets/settings-Cd128yRb.js +0 -34
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-BosPi5SR.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-B7TQEEbL.js +0 -8
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs, { statSync, writeFileSync, appendFileSync, existsSync, readFileSync, mkdirSync, realpathSync, constants, lstatSync, createWriteStream, renameSync, readdirSync } from "node:fs";
|
|
2
|
+
import { aj as parseWindowsLocalShell, U as THINKING_LEVELS$1, g as MODEL_REASONING_OVERRIDES, h as MODEL_THINKING_LEVEL_OVERRIDES, F as splitPlanPrefix, aY as DEFAULT_BASE_URLS, H as isClassifierOnlyProvider, aZ as PROJECTED_FILE_TEXT_LIMIT, aS as SHELL_LIMITS, a_ as imageGenerationPreviewPaths, a$ as parseGeneratedImagePaths, b0 as parseMaskReport, P as PLUGIN_MESSAGE_TYPE, b1 as parsePluginMessageSource, b2 as parseRtkToolStats, b3 as isBackgroundTaskId, b4 as parseShellFailure, a4 as parsePluginToolName, b5 as pluginArtifactsFromToolDetails, b6 as parseApprovalReviewRecord, b7 as PROJECTED_FILE_CHANGE_LIMIT, b8 as PROJECTED_APPLY_PATCH_PATH_TEXT_LIMIT, b9 as PROJECTED_APPLY_PATCH_PATH_COUNT_LIMIT, N as PRIVACY_MASK_ENTRY, ag as parsePrivacyMaskRecord, L as mergeMaskReports, ba as foldPlanState, bb as PLAN_MODE_ON_NOTE, bc as PLAN_MODE_OFF_NOTE, bd as planFeedbackText, be as planKickoffText, bf as activePlanNote, bg as PLAN_TITLE_MAX, bh as PLAN_TEXT_MAX, bi as planPhase, x as PLAN_ENTRY_TYPE, bj as parsePlanEntry, av as AGENT_WAIT_DEFAULT_MS, aw as AGENT_WAIT_MAX_MS, bk as parseAgentControlToolRequest, bl as nativeSearchKindFor, bm as isWorkflowPresetId } from "./agent-BlAuVqNp.js";
|
|
2
3
|
import { readFile, writeFile, rename, rm, unlink, open, lstat, chmod, realpath, access, mkdir } from "node:fs/promises";
|
|
3
4
|
import os from "node:os";
|
|
4
5
|
import path, { join, dirname } from "node:path";
|
|
5
6
|
import crypto, { randomBytes, createHash, randomUUID } from "node:crypto";
|
|
6
7
|
import { gzipSync, gunzipSync } from "node:zlib";
|
|
7
|
-
import fs, { existsSync, readFileSync, mkdirSync, writeFileSync, realpathSync, constants, lstatSync, createWriteStream, renameSync, appendFileSync, readdirSync } from "node:fs";
|
|
8
8
|
import * as PiAi from "@earendil-works/pi-ai";
|
|
9
9
|
import { getCurrentSystemPrompt, getCurrentTools, clampThinkingLevel } from "@earendil-works/pi-ai";
|
|
10
10
|
import { withFileMutationQueue, getPowerShellConfig, createCodemodeExtension, createToolSearchExtension, sessionEntryToContextMessages, SettingsManager } from "@earendil-works/pi-coding-agent";
|
|
@@ -12,12 +12,15 @@ import { parse, stringify } from "yaml";
|
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
13
13
|
import { StringDecoder } from "node:string_decoder";
|
|
14
14
|
import { stripVTControlCharacters } from "node:util";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
15
16
|
import { isUtf8 } from "node:buffer";
|
|
16
17
|
import { lookup } from "node:dns/promises";
|
|
17
|
-
import {
|
|
18
|
+
import { isIP, BlockList } from "node:net";
|
|
18
19
|
import { Readability } from "@mozilla/readability";
|
|
19
20
|
import { parseHTML } from "linkedom";
|
|
20
21
|
import TurndownService from "turndown";
|
|
22
|
+
import { ProxyAgent, fetch as fetch$1, Agent } from "undici";
|
|
23
|
+
import { transformMessages } from "@earendil-works/pi-ai/api/transform-messages";
|
|
21
24
|
import http from "node:http";
|
|
22
25
|
const OAUTH_LABEL_MAX_LENGTH = 32;
|
|
23
26
|
function sanitizeOauthLabel(value) {
|
|
@@ -35,6 +38,43 @@ const providerIdOfAccountKey = (key) => {
|
|
|
35
38
|
const hash = key.indexOf("#");
|
|
36
39
|
return hash === -1 ? key : key.slice(0, hash);
|
|
37
40
|
};
|
|
41
|
+
const AGENT_WORKER_CRASH_FILE = "worker-crash.json";
|
|
42
|
+
const AGENT_WORKER_EXIT_LOG = "worker-exits.log";
|
|
43
|
+
const AGENT_COMPACTION_LOG = "compaction.log";
|
|
44
|
+
function parseAgentWorkerCrash(raw) {
|
|
45
|
+
if (!raw || typeof raw !== "object") return null;
|
|
46
|
+
const r = raw;
|
|
47
|
+
if (typeof r.pid !== "number" || typeof r.at !== "number") return null;
|
|
48
|
+
if (typeof r.origin !== "string" || typeof r.message !== "string") return null;
|
|
49
|
+
const crash = { pid: r.pid, at: r.at, origin: r.origin, message: r.message };
|
|
50
|
+
if (typeof r.stack === "string") crash.stack = r.stack;
|
|
51
|
+
if (typeof r.rss === "number") crash.rss = r.rss;
|
|
52
|
+
if (typeof r.heapUsed === "number") crash.heapUsed = r.heapUsed;
|
|
53
|
+
return crash;
|
|
54
|
+
}
|
|
55
|
+
const WINDOWS_EXIT_CODES = {
|
|
56
|
+
3758096392: "out of memory",
|
|
57
|
+
3221225477: "access violation",
|
|
58
|
+
3221225725: "stack overflow",
|
|
59
|
+
3221226505: "fatal error (fail-fast)",
|
|
60
|
+
// 0xFFFF7003 crashpad:未启用崩溃上报时 native 崩溃以此码自杀,原始异常码丢失
|
|
61
|
+
4294930435: "native crash, crash handler not connected"
|
|
62
|
+
};
|
|
63
|
+
function formatExitCode(code) {
|
|
64
|
+
if (typeof code !== "number" || !Number.isFinite(code)) return "code=unknown";
|
|
65
|
+
const unsigned = code >>> 0;
|
|
66
|
+
if (code >= 0 && code < 65536) return `code=${code}`;
|
|
67
|
+
const hex = `0x${unsigned.toString(16).toUpperCase()}`;
|
|
68
|
+
const meaning = WINDOWS_EXIT_CODES[unsigned];
|
|
69
|
+
return meaning ? `code=${hex} ${meaning}` : `code=${hex}`;
|
|
70
|
+
}
|
|
71
|
+
function describeAgentWorkerExit(code, crash) {
|
|
72
|
+
const exit = formatExitCode(code);
|
|
73
|
+
if (!crash) return exit;
|
|
74
|
+
const first = crash.message.split("\n", 1)[0].trim();
|
|
75
|
+
const rss = crash.rss === void 0 ? "" : `, rss=${Math.round(crash.rss / 1024 ** 2)}MB`;
|
|
76
|
+
return `${crash.origin}: ${first} (${exit}${rss})`;
|
|
77
|
+
}
|
|
38
78
|
function currentSystemPrompt(context) {
|
|
39
79
|
return getCurrentSystemPrompt(context.messages);
|
|
40
80
|
}
|
|
@@ -101,6 +141,20 @@ class LocalAssistantEventStream {
|
|
|
101
141
|
function createEventStream() {
|
|
102
142
|
return new LocalAssistantEventStream();
|
|
103
143
|
}
|
|
144
|
+
function appendCappedLog(file, text2, maxBytes = 512 * 1024) {
|
|
145
|
+
const line = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${text2}
|
|
146
|
+
`;
|
|
147
|
+
try {
|
|
148
|
+
let size = 0;
|
|
149
|
+
try {
|
|
150
|
+
size = statSync(file).size;
|
|
151
|
+
} catch {
|
|
152
|
+
}
|
|
153
|
+
if (size + line.length > maxBytes) writeFileSync(file, line, "utf8");
|
|
154
|
+
else appendFileSync(file, line, "utf8");
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
}
|
|
104
158
|
const WORKSPACE_WRITE_TOOL_ID = "workspace_write";
|
|
105
159
|
function childProfileToolIds(tools, options = {}) {
|
|
106
160
|
const editMode = options.editMode ?? "apply_patch";
|
|
@@ -630,122 +684,6 @@ function nextAccountKey(providerId, existingKeys) {
|
|
|
630
684
|
const ordinals = existingKeys.filter((key) => providerIdOfAccountKey(key) === providerId).map(ordinalOfAccountKey);
|
|
631
685
|
return accountKeyFor(providerId, ordinals.length === 0 ? 0 : Math.max(...ordinals) + 1);
|
|
632
686
|
}
|
|
633
|
-
const BUILTIN_TOOLS = [
|
|
634
|
-
{
|
|
635
|
-
id: "image_generation",
|
|
636
|
-
name: "ImageGen",
|
|
637
|
-
description: "Generate images with the configured image model and save them to the session scratch directory"
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
id: "subagent",
|
|
641
|
-
name: "Subagent",
|
|
642
|
-
description: "Unified agents: delegate one-shot tasks or keep persistent coworkers under Main control"
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
id: "workflow",
|
|
646
|
-
name: "Workflow",
|
|
647
|
-
description: "Run a JavaScript workflow that fans work out across subagents. Live status appears in the side panel."
|
|
648
|
-
},
|
|
649
|
-
{ id: "todo", name: "Todo", description: "Task list: track progress on multi-step work" },
|
|
650
|
-
{
|
|
651
|
-
id: "plan",
|
|
652
|
-
name: "Plan mode",
|
|
653
|
-
description: "Plan mode: research read-only, submit a plan for approval, then carry it out after approval"
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
id: "ask_user",
|
|
657
|
-
name: "Ask user",
|
|
658
|
-
description: "Ask the user a question and wait for an answer (options / timeout)"
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
id: "browser",
|
|
662
|
-
name: "Browser",
|
|
663
|
-
description: "Built-in browser: open pages in Enso's own Chromium, read snapshots, click and type by ref"
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
id: "web",
|
|
667
|
-
name: "Web search",
|
|
668
|
-
description: "Web search and fetch: search with the session model's built-in search (falls back to a keyless service) and read public pages as markdown"
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
id: "background_tasks",
|
|
672
|
-
name: "Background tasks",
|
|
673
|
-
description: "Background shell task: run long commands in the background and notify on completion"
|
|
674
|
-
},
|
|
675
|
-
{
|
|
676
|
-
id: "memory",
|
|
677
|
-
name: "Memory",
|
|
678
|
-
description: "Long-term memory: the agent can search, capture and consolidate durable decisions, preferences and lessons across sessions"
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
id: "isolated_sandbox",
|
|
682
|
-
name: "Isolated sandbox",
|
|
683
|
-
description: "Run JavaScript in an isolated sandbox that can call session tools. Intermediate reads and edits stay out of the chat; only the returned value is added to the conversation."
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
id: "computer",
|
|
687
|
-
name: "Computer",
|
|
688
|
-
description: "Host desktop: list windows, screenshot, accessibility tree, and input. Default off. Not the built-in browser."
|
|
689
|
-
}
|
|
690
|
-
];
|
|
691
|
-
const DEFAULT_DISABLED_BUILTIN_TOOLS = ["memory", "computer"];
|
|
692
|
-
const COMPUTER_DEFAULT_OFF_SETTINGS_VERSION = 14;
|
|
693
|
-
function withComputerDisabled(entry) {
|
|
694
|
-
if (!Array.isArray(entry.disabledBuiltinTools)) return entry;
|
|
695
|
-
const list = entry.disabledBuiltinTools.filter((id) => typeof id === "string");
|
|
696
|
-
return list.includes("computer") ? entry : { ...entry, disabledBuiltinTools: [...list, "computer"] };
|
|
697
|
-
}
|
|
698
|
-
function addComputerDefaultOff(state) {
|
|
699
|
-
const migrated = withComputerDisabled(state);
|
|
700
|
-
if (!Array.isArray(migrated.projects)) return migrated;
|
|
701
|
-
return {
|
|
702
|
-
...migrated,
|
|
703
|
-
projects: migrated.projects.map(
|
|
704
|
-
(project) => project && typeof project === "object" && !Array.isArray(project) ? withComputerDisabled(project) : project
|
|
705
|
-
)
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
function persistedSettingsState(persisted) {
|
|
709
|
-
if (!persisted || typeof persisted !== "object" || Array.isArray(persisted)) return void 0;
|
|
710
|
-
const { state, version: version2 } = persisted;
|
|
711
|
-
if (!state || typeof state !== "object" || Array.isArray(state)) return void 0;
|
|
712
|
-
const current = typeof version2 === "number" ? version2 : 0;
|
|
713
|
-
const record = state;
|
|
714
|
-
const base = current < COMPUTER_DEFAULT_OFF_SETTINGS_VERSION ? addComputerDefaultOff(record) : record;
|
|
715
|
-
if (base.webSearchChain === void 0) return base;
|
|
716
|
-
return { ...base, webSearchChain: parseWebSearchChain(base.webSearchChain) };
|
|
717
|
-
}
|
|
718
|
-
function effectiveSubagentAllowedModes(configured, disabledBuiltinTools) {
|
|
719
|
-
if (Array.isArray(configured)) {
|
|
720
|
-
const selected = new Set(
|
|
721
|
-
configured.filter(
|
|
722
|
-
(mode) => mode === "task" || mode === "coworker"
|
|
723
|
-
)
|
|
724
|
-
);
|
|
725
|
-
return ["task", "coworker"].filter((mode) => selected.has(mode));
|
|
726
|
-
}
|
|
727
|
-
const disabled = new Set(
|
|
728
|
-
Array.isArray(disabledBuiltinTools) ? disabledBuiltinTools.filter((id) => typeof id === "string") : []
|
|
729
|
-
);
|
|
730
|
-
return ["task", "coworker"].filter(
|
|
731
|
-
(mode) => !disabled.has(mode === "task" ? "subagent" : "coworker")
|
|
732
|
-
);
|
|
733
|
-
}
|
|
734
|
-
function effectiveDisabledBuiltinTools(disabled) {
|
|
735
|
-
return Array.isArray(disabled) ? disabled.filter((id) => typeof id === "string") : [...DEFAULT_DISABLED_BUILTIN_TOOLS];
|
|
736
|
-
}
|
|
737
|
-
function resolveDisabledBuiltinTools(globalDisabled, project) {
|
|
738
|
-
return Array.isArray(project?.disabledBuiltinTools) ? effectiveDisabledBuiltinTools(project.disabledBuiltinTools) : effectiveDisabledBuiltinTools(globalDisabled);
|
|
739
|
-
}
|
|
740
|
-
function projectDisabledBuiltinTools(projects, projectId) {
|
|
741
|
-
if (!projectId || !Array.isArray(projects)) return void 0;
|
|
742
|
-
for (const entry of projects) {
|
|
743
|
-
if (!entry || typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
744
|
-
const record = entry;
|
|
745
|
-
if (record.id === projectId) return record.disabledBuiltinTools;
|
|
746
|
-
}
|
|
747
|
-
return void 0;
|
|
748
|
-
}
|
|
749
687
|
const LOOPBACK_HOST = "127.0.0.1";
|
|
750
688
|
const DEFAULT_WAIT_MS = 3e5;
|
|
751
689
|
const SUCCESS_HTML = `<!doctype html><html lang="zh"><head><meta charset="utf-8">
|
|
@@ -758,6 +696,11 @@ const FAILURE_HTML = `<!doctype html><html lang="zh"><head><meta charset="utf-8"
|
|
|
758
696
|
display:flex;align-items:center;justify-content:center;height:100vh;margin:0;
|
|
759
697
|
background:#0f1115;color:#e6e6e6}div{text-align:center}</style></head>
|
|
760
698
|
<body><div><h2>登录失败</h2><p>回调参数不合法,请回到应用重试。</p></div></body></html>`;
|
|
699
|
+
const ERROR_HTML = `<!doctype html><html lang="zh"><head><meta charset="utf-8">
|
|
700
|
+
<title>授权未完成</title><style>body{font-family:system-ui,-apple-system,sans-serif;
|
|
701
|
+
display:flex;align-items:center;justify-content:center;height:100vh;margin:0;
|
|
702
|
+
background:#0f1115;color:#e6e6e6}div{text-align:center}</style></head>
|
|
703
|
+
<body><div><h2>授权未完成</h2><p>授权服务器返回了错误,请回到应用查看原因后重试。</p></div></body></html>`;
|
|
761
704
|
function listen(port) {
|
|
762
705
|
const server = http.createServer();
|
|
763
706
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
@@ -810,7 +753,14 @@ async function startOauthCallbackServer(options) {
|
|
|
810
753
|
const onAbort = () => settle(() => reject(new Error("登录已取消")));
|
|
811
754
|
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
812
755
|
server.on("request", (req, res) => {
|
|
813
|
-
|
|
756
|
+
let url;
|
|
757
|
+
try {
|
|
758
|
+
url = new URL(req.url ?? "/", redirectUri);
|
|
759
|
+
} catch {
|
|
760
|
+
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
761
|
+
res.end("bad request");
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
814
764
|
if (url.pathname !== options.callbackPath) {
|
|
815
765
|
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
816
766
|
res.end("not found");
|
|
@@ -821,8 +771,9 @@ async function startOauthCallbackServer(options) {
|
|
|
821
771
|
const state = url.searchParams.get("state");
|
|
822
772
|
const isValidState = state === options.expectedState;
|
|
823
773
|
const isSuccess = !error && !!code && isValidState;
|
|
774
|
+
const isAuthError = !!error && isValidState;
|
|
824
775
|
res.writeHead(isSuccess ? 200 : 400, { "Content-Type": "text/html; charset=utf-8" });
|
|
825
|
-
res.end(isSuccess ? SUCCESS_HTML : FAILURE_HTML);
|
|
776
|
+
res.end(isSuccess ? SUCCESS_HTML : isAuthError ? ERROR_HTML : FAILURE_HTML);
|
|
826
777
|
if (isSuccess) {
|
|
827
778
|
const iss = url.searchParams.get("iss");
|
|
828
779
|
settle(() => {
|
|
@@ -831,8 +782,9 @@ async function startOauthCallbackServer(options) {
|
|
|
831
782
|
});
|
|
832
783
|
return;
|
|
833
784
|
}
|
|
834
|
-
if (
|
|
835
|
-
|
|
785
|
+
if (isAuthError) {
|
|
786
|
+
const message = error === "access_denied" ? `授权被拒绝:${error}` : `授权失败:${error}`;
|
|
787
|
+
settle(() => reject(new Error(message)));
|
|
836
788
|
}
|
|
837
789
|
});
|
|
838
790
|
return {
|
|
@@ -953,7 +905,7 @@ function parseAntigravityApiKey(apiKeyRaw) {
|
|
|
953
905
|
};
|
|
954
906
|
}
|
|
955
907
|
const UPSTREAM_BODY_LIMIT = 300;
|
|
956
|
-
const SECRET_PATTERNS
|
|
908
|
+
const SECRET_PATTERNS = [
|
|
957
909
|
[/\b(Bearer|Basic)\s+[\w\-._~+/]+=*/gi, "$1 [已脱敏]"],
|
|
958
910
|
[
|
|
959
911
|
/"(access_token|refresh_token|id_token|client_secret|authorization|api_key|apikey)"\s*:\s*"[^"]*"/gi,
|
|
@@ -968,7 +920,7 @@ const SECRET_PATTERNS$1 = [
|
|
|
968
920
|
];
|
|
969
921
|
function sanitizeUpstreamBody(text2) {
|
|
970
922
|
let safe = text2;
|
|
971
|
-
for (const [pattern, replacement] of SECRET_PATTERNS
|
|
923
|
+
for (const [pattern, replacement] of SECRET_PATTERNS) safe = safe.replace(pattern, replacement);
|
|
972
924
|
safe = safe.replace(/\s+/g, " ").trim();
|
|
973
925
|
return safe.length > UPSTREAM_BODY_LIMIT ? `${safe.slice(0, UPSTREAM_BODY_LIMIT)}…(已截断)` : safe;
|
|
974
926
|
}
|
|
@@ -1308,6 +1260,12 @@ function normalizeToolSchema(value) {
|
|
|
1308
1260
|
const out = {};
|
|
1309
1261
|
for (const [key, raw] of Object.entries(value)) {
|
|
1310
1262
|
if (DROPPED_SCHEMA_KEYS[key]) continue;
|
|
1263
|
+
if (key === "properties" && raw && typeof raw === "object" && !Array.isArray(raw)) {
|
|
1264
|
+
out.properties = Object.fromEntries(
|
|
1265
|
+
Object.entries(raw).map(([name, schema2]) => [name, normalizeToolSchema(schema2)])
|
|
1266
|
+
);
|
|
1267
|
+
continue;
|
|
1268
|
+
}
|
|
1311
1269
|
if (key === "const") {
|
|
1312
1270
|
out.enum = [raw];
|
|
1313
1271
|
continue;
|
|
@@ -1326,6 +1284,12 @@ function normalizeToolSchema(value) {
|
|
|
1326
1284
|
out[key] = normalizeToolSchema(raw);
|
|
1327
1285
|
}
|
|
1328
1286
|
if (out.type === "object" && out.properties === void 0) out.properties = {};
|
|
1287
|
+
const declared = out.properties;
|
|
1288
|
+
if (Array.isArray(out.required) && declared && typeof declared === "object") {
|
|
1289
|
+
out.required = out.required.filter(
|
|
1290
|
+
(name) => typeof name === "string" && Object.hasOwn(declared, name)
|
|
1291
|
+
);
|
|
1292
|
+
}
|
|
1329
1293
|
return out;
|
|
1330
1294
|
}
|
|
1331
1295
|
const EFFORT_LADDER = [
|
|
@@ -1617,12 +1581,15 @@ function isGemini3Plus(modelId) {
|
|
|
1617
1581
|
const match = /^gemini-(\d+)/.exec(modelId.toLowerCase());
|
|
1618
1582
|
return match ? Number.parseInt(match[1], 10) >= 3 : true;
|
|
1619
1583
|
}
|
|
1584
|
+
function normalizeToolCallId(id) {
|
|
1585
|
+
return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64);
|
|
1586
|
+
}
|
|
1620
1587
|
function convertMessages(model, context) {
|
|
1621
1588
|
const contents = [];
|
|
1622
1589
|
const supportsImages = model.input.includes("image");
|
|
1623
1590
|
const isClaude = model.id.startsWith("claude-");
|
|
1624
1591
|
const emittedToolNames = /* @__PURE__ */ new Map();
|
|
1625
|
-
for (const message of context.messages) {
|
|
1592
|
+
for (const message of transformMessages(context.messages, model, normalizeToolCallId)) {
|
|
1626
1593
|
if (message.role === "user") {
|
|
1627
1594
|
const parts = [];
|
|
1628
1595
|
if (typeof message.content === "string") {
|
|
@@ -3768,6 +3735,7 @@ function buildChatMessagePrompts(context, cascadeId, model) {
|
|
|
3768
3735
|
continue;
|
|
3769
3736
|
}
|
|
3770
3737
|
if (message.role === "assistant") {
|
|
3738
|
+
if (message.stopReason === "error" || message.stopReason === "aborted") continue;
|
|
3771
3739
|
const native = message.api === model.api && message.provider === model.provider && message.model === model.id;
|
|
3772
3740
|
let promptText = "";
|
|
3773
3741
|
let thinkingText = "";
|
|
@@ -6758,16 +6726,6 @@ function buildSshExecArgs(host, remoteCommand, options = {}) {
|
|
|
6758
6726
|
args.push("--", host, remoteCommand);
|
|
6759
6727
|
return args;
|
|
6760
6728
|
}
|
|
6761
|
-
const ssh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6762
|
-
__proto__: null,
|
|
6763
|
-
buildRemoteCommand,
|
|
6764
|
-
buildSshExecArgs,
|
|
6765
|
-
buildSshPtyArgs,
|
|
6766
|
-
buildSshPtyRemoteCommand,
|
|
6767
|
-
buildSshShellCommand,
|
|
6768
|
-
resolveSshTarget,
|
|
6769
|
-
shellQuote
|
|
6770
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
6771
6729
|
const DEFAULT_PERSONA_PROMPT = "You are a coding assistant running inside pi, a coding agent harness. Help users inspect files, run commands, and modify code.";
|
|
6772
6730
|
function replacePersonaParagraph(prompt2, persona) {
|
|
6773
6731
|
if (!persona) return prompt2;
|
|
@@ -7983,7 +7941,12 @@ function result(fileChanges, error, failed = [], unattempted = [], uncertain = [
|
|
|
7983
7941
|
const details = {
|
|
7984
7942
|
kind: "apply_patch",
|
|
7985
7943
|
status,
|
|
7986
|
-
|
|
7944
|
+
// details 随会话落盘且常驻 worker 内存,全文会让会话涨到数十 MB;只留投影用得到的部分
|
|
7945
|
+
fileChanges: fileChanges.map((change) => ({
|
|
7946
|
+
...change,
|
|
7947
|
+
oldText: capDetailText(change.oldText),
|
|
7948
|
+
newText: capDetailText(change.newText)
|
|
7949
|
+
})),
|
|
7987
7950
|
applied,
|
|
7988
7951
|
failed,
|
|
7989
7952
|
...error ? { error } : {},
|
|
@@ -8004,6 +7967,10 @@ function result(fileChanges, error, failed = [], unattempted = [], uncertain = [
|
|
|
8004
7967
|
];
|
|
8005
7968
|
return { content: [{ type: "text", text: lines.join("\n") }], details };
|
|
8006
7969
|
}
|
|
7970
|
+
function capDetailText(text2) {
|
|
7971
|
+
return text2.length <= PROJECTED_FILE_TEXT_LIMIT ? text2 : `${text2.slice(0, PROJECTED_FILE_TEXT_LIMIT)}
|
|
7972
|
+
…`;
|
|
7973
|
+
}
|
|
8007
7974
|
async function runPlan(plan, signal) {
|
|
8008
7975
|
const fail = (fileChanges, error, failed = [], unattempted = [], uncertain = []) => result(fileChanges, error, failed, unattempted, uncertain, plan.input);
|
|
8009
7976
|
for (const target of plan.paths) await recheck(plan, target, signal);
|
|
@@ -8085,16 +8052,27 @@ function peekApplyPatchInput(params) {
|
|
|
8085
8052
|
return typeof input === "string" && input.length > 0 ? input : void 0;
|
|
8086
8053
|
}
|
|
8087
8054
|
}
|
|
8088
|
-
function mutationTargets(cwd, params, io) {
|
|
8055
|
+
async function mutationTargets(cwd, params, io) {
|
|
8056
|
+
let operations;
|
|
8089
8057
|
try {
|
|
8090
|
-
|
|
8058
|
+
operations = normalizeOperations(
|
|
8091
8059
|
parseApplyPatch(requireApplyPatchInput(params)),
|
|
8092
8060
|
io?.normalizePath ?? normalizePatchPath
|
|
8093
8061
|
);
|
|
8094
|
-
return [...new Set(operationPaths(operations).map((value) => path.resolve(cwd, value)))].sort();
|
|
8095
8062
|
} catch {
|
|
8096
8063
|
return [];
|
|
8097
8064
|
}
|
|
8065
|
+
const keys = await Promise.all(
|
|
8066
|
+
operationPaths(operations).map((value) => mutationQueueKey(path.resolve(cwd, value)))
|
|
8067
|
+
);
|
|
8068
|
+
return [...new Set(keys)].sort();
|
|
8069
|
+
}
|
|
8070
|
+
async function mutationQueueKey(target) {
|
|
8071
|
+
try {
|
|
8072
|
+
return await realpath(target);
|
|
8073
|
+
} catch {
|
|
8074
|
+
return target;
|
|
8075
|
+
}
|
|
8098
8076
|
}
|
|
8099
8077
|
function withMutationQueues(targets, task) {
|
|
8100
8078
|
return targets.reduceRight(
|
|
@@ -8106,7 +8084,7 @@ function executeApplyPatch(cwd, params, options = {}) {
|
|
|
8106
8084
|
return enqueue(async () => {
|
|
8107
8085
|
try {
|
|
8108
8086
|
return await withMutationQueues(
|
|
8109
|
-
mutationTargets(cwd, params, options.io),
|
|
8087
|
+
await mutationTargets(cwd, params, options.io),
|
|
8110
8088
|
async () => runPlan(await buildPlan(cwd, params, options.io, options.signal), options.signal)
|
|
8111
8089
|
);
|
|
8112
8090
|
} catch (error) {
|
|
@@ -8145,6 +8123,42 @@ const approvalReviewResultExtension = {
|
|
|
8145
8123
|
});
|
|
8146
8124
|
}
|
|
8147
8125
|
};
|
|
8126
|
+
function globToRegExp(glob, options) {
|
|
8127
|
+
let out = "";
|
|
8128
|
+
for (let i = 0; i < glob.length; i++) {
|
|
8129
|
+
const ch = glob[i];
|
|
8130
|
+
if (ch === "*") {
|
|
8131
|
+
if (glob[i + 1] === "*") {
|
|
8132
|
+
i++;
|
|
8133
|
+
if (glob[i + 1] === "/") {
|
|
8134
|
+
i++;
|
|
8135
|
+
out += "(?:.*/)?";
|
|
8136
|
+
} else {
|
|
8137
|
+
out += ".*";
|
|
8138
|
+
}
|
|
8139
|
+
} else {
|
|
8140
|
+
out += "[^/]*";
|
|
8141
|
+
}
|
|
8142
|
+
} else if (ch === "?") {
|
|
8143
|
+
out += "[^/]";
|
|
8144
|
+
} else if (ch === "[" && options?.classes) {
|
|
8145
|
+
const close = glob.indexOf("]", i + 1);
|
|
8146
|
+
if (close <= i + 1) {
|
|
8147
|
+
out += "\\[";
|
|
8148
|
+
continue;
|
|
8149
|
+
}
|
|
8150
|
+
let body = glob.slice(i + 1, close);
|
|
8151
|
+
i = close;
|
|
8152
|
+
const negate = body.startsWith("!") || body.startsWith("^");
|
|
8153
|
+
if (negate) body = body.slice(1);
|
|
8154
|
+
body = body.replace(/\//g, "");
|
|
8155
|
+
out += `[${negate ? "^" : ""}${body}${negate ? "/" : ""}]`;
|
|
8156
|
+
} else {
|
|
8157
|
+
out += ch.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
8158
|
+
}
|
|
8159
|
+
}
|
|
8160
|
+
return new RegExp(`^${out}$`);
|
|
8161
|
+
}
|
|
8148
8162
|
const SECRET_BASENAMES = /^(\.env(\.(?!(example|sample|template|dist|defaults)$)[\w.-]+)?|id_(rsa|dsa|ecdsa|ed25519)|\.netrc|\.npmrc|\.pypirc|\.pgpass|\.git-credentials|credentials\.json|oauth-accounts\.json|secrets?\.(json|ya?ml|env)|[\w.-]+\.(pem|key|p12|pfx|keystore|jks))$/i;
|
|
8149
8163
|
const SECRET_PATH_SUFFIX = /(^|\/)(\.aws\/credentials|\.docker\/config\.json|\.kube\/config|pi-agent\/auth\.json)$/i;
|
|
8150
8164
|
function isSecretFilePath(path2) {
|
|
@@ -8153,6 +8167,185 @@ function isSecretFilePath(path2) {
|
|
|
8153
8167
|
const base = normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
8154
8168
|
return SECRET_BASENAMES.test(base) || SECRET_PATH_SUFFIX.test(normalized);
|
|
8155
8169
|
}
|
|
8170
|
+
const SECRET_HOME_DIRS = [".ssh", ".aws", ".docker", ".kube", ".gnupg"];
|
|
8171
|
+
function isUnderSecretDirectory(expanded) {
|
|
8172
|
+
const fold = (value) => {
|
|
8173
|
+
const normalized = value.trim().replace(/\\/g, "/").replace(/\/+$/, "");
|
|
8174
|
+
return process.platform === "linux" ? normalized : normalized.toLowerCase();
|
|
8175
|
+
};
|
|
8176
|
+
const target = fold(expanded);
|
|
8177
|
+
const home = fold(os.homedir());
|
|
8178
|
+
if (!target || !home) return false;
|
|
8179
|
+
return SECRET_HOME_DIRS.some((dir) => {
|
|
8180
|
+
const root = `${home}/${dir}`;
|
|
8181
|
+
return target === root || target.startsWith(`${root}/`);
|
|
8182
|
+
});
|
|
8183
|
+
}
|
|
8184
|
+
const SECRET_GLOB_PROBES = [
|
|
8185
|
+
".env",
|
|
8186
|
+
".env.local",
|
|
8187
|
+
"id_rsa",
|
|
8188
|
+
"id_ed25519",
|
|
8189
|
+
"a.pem",
|
|
8190
|
+
"a.key",
|
|
8191
|
+
"cert.p12",
|
|
8192
|
+
"credentials.json",
|
|
8193
|
+
"oauth-accounts.json",
|
|
8194
|
+
"secrets.json",
|
|
8195
|
+
"secret.yaml",
|
|
8196
|
+
".npmrc",
|
|
8197
|
+
".netrc",
|
|
8198
|
+
".ssh/id_rsa",
|
|
8199
|
+
".aws/credentials",
|
|
8200
|
+
".docker/config.json",
|
|
8201
|
+
".kube/config",
|
|
8202
|
+
"pi-agent/auth.json"
|
|
8203
|
+
];
|
|
8204
|
+
const UNRELATED_GLOB_PROBES = [
|
|
8205
|
+
"src/app.ts",
|
|
8206
|
+
"src/App.tsx",
|
|
8207
|
+
"README.md",
|
|
8208
|
+
"package.json",
|
|
8209
|
+
"tsconfig.json",
|
|
8210
|
+
"src/config.json",
|
|
8211
|
+
"notes.txt",
|
|
8212
|
+
"a.ts",
|
|
8213
|
+
"a.json",
|
|
8214
|
+
"a.md",
|
|
8215
|
+
"a.txt",
|
|
8216
|
+
"x"
|
|
8217
|
+
];
|
|
8218
|
+
function topLevelBrace(pattern) {
|
|
8219
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
8220
|
+
if (pattern[i] === "[") {
|
|
8221
|
+
const close = pattern.indexOf("]", i + 1);
|
|
8222
|
+
if (close !== -1) {
|
|
8223
|
+
i = close;
|
|
8224
|
+
continue;
|
|
8225
|
+
}
|
|
8226
|
+
}
|
|
8227
|
+
if (pattern[i] === "{") return i;
|
|
8228
|
+
}
|
|
8229
|
+
return -1;
|
|
8230
|
+
}
|
|
8231
|
+
function matchBrace(pattern, start) {
|
|
8232
|
+
let depth = 0;
|
|
8233
|
+
for (let i = start; i < pattern.length; i++) {
|
|
8234
|
+
if (pattern[i] === "[") {
|
|
8235
|
+
const close = pattern.indexOf("]", i + 1);
|
|
8236
|
+
if (close !== -1) {
|
|
8237
|
+
i = close;
|
|
8238
|
+
continue;
|
|
8239
|
+
}
|
|
8240
|
+
}
|
|
8241
|
+
if (pattern[i] === "{") depth++;
|
|
8242
|
+
else if (pattern[i] === "}") {
|
|
8243
|
+
depth--;
|
|
8244
|
+
if (depth === 0) return i;
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
return -1;
|
|
8248
|
+
}
|
|
8249
|
+
function splitTopLevelCommas(body) {
|
|
8250
|
+
const parts = [];
|
|
8251
|
+
let current = "";
|
|
8252
|
+
let brace = 0;
|
|
8253
|
+
for (let i = 0; i < body.length; i++) {
|
|
8254
|
+
const ch = body[i];
|
|
8255
|
+
if (ch === "[") {
|
|
8256
|
+
const close = body.indexOf("]", i + 1);
|
|
8257
|
+
if (close !== -1) {
|
|
8258
|
+
current += body.slice(i, close + 1);
|
|
8259
|
+
i = close;
|
|
8260
|
+
continue;
|
|
8261
|
+
}
|
|
8262
|
+
}
|
|
8263
|
+
if (ch === "{") brace++;
|
|
8264
|
+
if (ch === "}" && brace > 0) brace--;
|
|
8265
|
+
if (ch === "," && brace === 0) {
|
|
8266
|
+
parts.push(current);
|
|
8267
|
+
current = "";
|
|
8268
|
+
continue;
|
|
8269
|
+
}
|
|
8270
|
+
current += ch;
|
|
8271
|
+
}
|
|
8272
|
+
parts.push(current);
|
|
8273
|
+
return parts;
|
|
8274
|
+
}
|
|
8275
|
+
const MAX_BRACE_ALTERNATIVES = 256;
|
|
8276
|
+
class BraceLimitError extends Error {
|
|
8277
|
+
}
|
|
8278
|
+
function expandBraceAlternatives(pattern) {
|
|
8279
|
+
const start = topLevelBrace(pattern);
|
|
8280
|
+
if (start < 0) return [pattern];
|
|
8281
|
+
const end = matchBrace(pattern, start);
|
|
8282
|
+
if (end < 0) return [pattern];
|
|
8283
|
+
const parts = splitTopLevelCommas(pattern.slice(start + 1, end));
|
|
8284
|
+
const prefix2 = pattern.slice(0, start);
|
|
8285
|
+
const suffix = pattern.slice(end + 1);
|
|
8286
|
+
const tails = expandBraceAlternatives(suffix);
|
|
8287
|
+
if (parts.length * tails.length > MAX_BRACE_ALTERNATIVES) throw new BraceLimitError();
|
|
8288
|
+
const out = [];
|
|
8289
|
+
for (const part of parts) {
|
|
8290
|
+
for (const tail of tails) {
|
|
8291
|
+
out.push(...expandBraceAlternatives(prefix2 + part + tail));
|
|
8292
|
+
if (out.length > MAX_BRACE_ALTERNATIVES) throw new BraceLimitError();
|
|
8293
|
+
}
|
|
8294
|
+
}
|
|
8295
|
+
return out;
|
|
8296
|
+
}
|
|
8297
|
+
function alternativeTargetsSecrets(pattern) {
|
|
8298
|
+
let matched;
|
|
8299
|
+
try {
|
|
8300
|
+
const re = new RegExp(globToRegExp(pattern, { classes: true }).source, "i");
|
|
8301
|
+
matched = (probe) => re.test(probe);
|
|
8302
|
+
} catch {
|
|
8303
|
+
return true;
|
|
8304
|
+
}
|
|
8305
|
+
if (!SECRET_GLOB_PROBES.some(matched)) return false;
|
|
8306
|
+
return !UNRELATED_GLOB_PROBES.some(matched);
|
|
8307
|
+
}
|
|
8308
|
+
function globTargetsSecrets(glob) {
|
|
8309
|
+
const trimmed = glob.trim();
|
|
8310
|
+
if (!trimmed || trimmed.startsWith("!")) return false;
|
|
8311
|
+
if (!/[*?[\]{}]/.test(trimmed)) return isSecretFilePath(trimmed);
|
|
8312
|
+
let alternatives;
|
|
8313
|
+
try {
|
|
8314
|
+
alternatives = expandBraceAlternatives(trimmed);
|
|
8315
|
+
} catch (error) {
|
|
8316
|
+
if (error instanceof BraceLimitError) return true;
|
|
8317
|
+
throw error;
|
|
8318
|
+
}
|
|
8319
|
+
return alternatives.some(
|
|
8320
|
+
(alt) => alt.length > 0 && !alt.startsWith("!") && alternativeTargetsSecrets(alt)
|
|
8321
|
+
);
|
|
8322
|
+
}
|
|
8323
|
+
const UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
|
|
8324
|
+
function expandPiToolPath(input, platform = process.platform) {
|
|
8325
|
+
const win = platform === "win32";
|
|
8326
|
+
let normalized = input.replace(UNICODE_SPACES, " ");
|
|
8327
|
+
if (normalized.startsWith("@")) normalized = normalized.slice(1);
|
|
8328
|
+
if (win) normalized = windowsShellPath(normalized);
|
|
8329
|
+
const home = os.homedir();
|
|
8330
|
+
if (normalized === "~") return home;
|
|
8331
|
+
if (normalized.startsWith("~/") || win && normalized.startsWith("~\\"))
|
|
8332
|
+
return (win ? path.win32 : path.posix).join(home, normalized.slice(2));
|
|
8333
|
+
if (/^file:\/\//.test(normalized)) {
|
|
8334
|
+
try {
|
|
8335
|
+
return fileURLToPath(normalized);
|
|
8336
|
+
} catch {
|
|
8337
|
+
return normalized;
|
|
8338
|
+
}
|
|
8339
|
+
}
|
|
8340
|
+
return normalized;
|
|
8341
|
+
}
|
|
8342
|
+
function windowsShellPath(filePath) {
|
|
8343
|
+
if (!filePath.startsWith("/") || filePath.startsWith("//") || filePath.includes("\\"))
|
|
8344
|
+
return filePath;
|
|
8345
|
+
const match = /^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i.exec(filePath);
|
|
8346
|
+
if (!match) return filePath;
|
|
8347
|
+
return `${match[1].toUpperCase()}:\\${match[2]?.replaceAll("/", "\\") ?? ""}`;
|
|
8348
|
+
}
|
|
8156
8349
|
const WRAPPERS = /* @__PURE__ */ new Set([
|
|
8157
8350
|
"sudo",
|
|
8158
8351
|
"doas",
|
|
@@ -8164,6 +8357,35 @@ const WRAPPERS = /* @__PURE__ */ new Set([
|
|
|
8164
8357
|
"nice",
|
|
8165
8358
|
"xargs"
|
|
8166
8359
|
]);
|
|
8360
|
+
const WRAPPER_VALUE_OPTIONS = {
|
|
8361
|
+
sudo: {
|
|
8362
|
+
short: "CDgpRrTtUu",
|
|
8363
|
+
long: [
|
|
8364
|
+
"chdir",
|
|
8365
|
+
"chroot",
|
|
8366
|
+
"close-from",
|
|
8367
|
+
"command-timeout",
|
|
8368
|
+
"group",
|
|
8369
|
+
"host",
|
|
8370
|
+
"other-user",
|
|
8371
|
+
"prompt",
|
|
8372
|
+
"role",
|
|
8373
|
+
"type",
|
|
8374
|
+
"user"
|
|
8375
|
+
]
|
|
8376
|
+
},
|
|
8377
|
+
doas: { short: "aCu", long: [] },
|
|
8378
|
+
env: { short: "aCLPUu", long: ["argv0", "chdir", "unset"] },
|
|
8379
|
+
nice: { short: "n", long: ["adjustment"] },
|
|
8380
|
+
time: { short: "fo", long: ["format", "output"] },
|
|
8381
|
+
exec: { short: "a", long: [] },
|
|
8382
|
+
xargs: {
|
|
8383
|
+
short: "adEIJLnPRSs",
|
|
8384
|
+
long: ["arg-file", "delimiter", "max-args", "max-chars", "max-procs", "process-slot-var"]
|
|
8385
|
+
},
|
|
8386
|
+
timeout: { short: "ks", long: ["kill-after", "signal"] }
|
|
8387
|
+
};
|
|
8388
|
+
const RESERVED_WORDS = /* @__PURE__ */ new Set(["!", "if", "then", "else", "elif", "do", "while", "until"]);
|
|
8167
8389
|
const SHELLS = /* @__PURE__ */ new Set(["sh", "bash", "zsh", "dash", "fish"]);
|
|
8168
8390
|
const SCRIPT_RUNNERS = /* @__PURE__ */ new Set([
|
|
8169
8391
|
"node",
|
|
@@ -8220,21 +8442,40 @@ function hasDeployWord(text2) {
|
|
|
8220
8442
|
function unquote(token) {
|
|
8221
8443
|
return token.replace(/^[({'"]+|[)}'";]+$/g, "");
|
|
8222
8444
|
}
|
|
8445
|
+
function skipWrapperOptions(tokens, start, wrapper) {
|
|
8446
|
+
const spec = WRAPPER_VALUE_OPTIONS[wrapper];
|
|
8447
|
+
let i = start;
|
|
8448
|
+
while (i < tokens.length && tokens[i].startsWith("-")) {
|
|
8449
|
+
const token = tokens[i++];
|
|
8450
|
+
if (token === "--") break;
|
|
8451
|
+
if (!spec) continue;
|
|
8452
|
+
if (token.startsWith("--")) {
|
|
8453
|
+
if (!token.includes("=") && spec.long.includes(token.slice(2))) i++;
|
|
8454
|
+
continue;
|
|
8455
|
+
}
|
|
8456
|
+
const letters = token.slice(1);
|
|
8457
|
+
const at = [...letters].findIndex((letter) => spec.short.includes(letter));
|
|
8458
|
+
if (at !== -1 && at === letters.length - 1) i++;
|
|
8459
|
+
}
|
|
8460
|
+
return i;
|
|
8461
|
+
}
|
|
8223
8462
|
function programTokens(segment) {
|
|
8224
|
-
|
|
8463
|
+
const tokens = segment.trim().split(/\s+/).map(unquote);
|
|
8464
|
+
let i = 0;
|
|
8225
8465
|
for (; ; ) {
|
|
8226
|
-
while (tokens.length && /^[A-Za-z_][A-Za-z0-9_]*=/.test(tokens[
|
|
8227
|
-
|
|
8466
|
+
while (i < tokens.length && (!tokens[i] || RESERVED_WORDS.has(tokens[i]) || /^[A-Za-z_][A-Za-z0-9_]*=/.test(tokens[i])))
|
|
8467
|
+
i++;
|
|
8468
|
+
const head = basename(tokens[i] ?? "");
|
|
8228
8469
|
if (WRAPPERS.has(head)) {
|
|
8229
|
-
|
|
8230
|
-
while (tokens.length && tokens[0].startsWith("-")) tokens = tokens.slice(1);
|
|
8470
|
+
i = skipWrapperOptions(tokens, i + 1, head);
|
|
8231
8471
|
continue;
|
|
8232
8472
|
}
|
|
8233
8473
|
if (head === "timeout") {
|
|
8234
|
-
|
|
8474
|
+
i = skipWrapperOptions(tokens, i + 1, head);
|
|
8475
|
+
if (/^\d/.test(tokens[i] ?? "")) i++;
|
|
8235
8476
|
continue;
|
|
8236
8477
|
}
|
|
8237
|
-
return tokens;
|
|
8478
|
+
return tokens.slice(i).filter(Boolean);
|
|
8238
8479
|
}
|
|
8239
8480
|
}
|
|
8240
8481
|
function basename(token) {
|
|
@@ -8501,35 +8742,15 @@ function classifyProtectedTool(toolName2, kind, params) {
|
|
|
8501
8742
|
}
|
|
8502
8743
|
if (kind === "read") {
|
|
8503
8744
|
const path2 = record.path ?? record.file_path;
|
|
8504
|
-
|
|
8745
|
+
if (typeof path2 === "string") {
|
|
8746
|
+
const expanded = expandPiToolPath(path2);
|
|
8747
|
+
if (isSecretFilePath(expanded) || isUnderSecretDirectory(expanded)) return "secret";
|
|
8748
|
+
}
|
|
8749
|
+
return typeof record.glob === "string" && globTargetsSecrets(record.glob) ? "secret" : null;
|
|
8505
8750
|
}
|
|
8506
8751
|
if (kind === "mcp") return classifyMcpTool(toolName2);
|
|
8507
8752
|
return null;
|
|
8508
8753
|
}
|
|
8509
|
-
function globToRegExp(glob) {
|
|
8510
|
-
let out = "";
|
|
8511
|
-
for (let i = 0; i < glob.length; i++) {
|
|
8512
|
-
const ch = glob[i];
|
|
8513
|
-
if (ch === "*") {
|
|
8514
|
-
if (glob[i + 1] === "*") {
|
|
8515
|
-
i++;
|
|
8516
|
-
if (glob[i + 1] === "/") {
|
|
8517
|
-
i++;
|
|
8518
|
-
out += "(?:.*/)?";
|
|
8519
|
-
} else {
|
|
8520
|
-
out += ".*";
|
|
8521
|
-
}
|
|
8522
|
-
} else {
|
|
8523
|
-
out += "[^/]*";
|
|
8524
|
-
}
|
|
8525
|
-
} else if (ch === "?") {
|
|
8526
|
-
out += "[^/]";
|
|
8527
|
-
} else {
|
|
8528
|
-
out += ch.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
8529
|
-
}
|
|
8530
|
-
}
|
|
8531
|
-
return new RegExp(`^${out}$`);
|
|
8532
|
-
}
|
|
8533
8754
|
function extractEditTargetPath(params) {
|
|
8534
8755
|
if (!params || typeof params !== "object" || Array.isArray(params)) return void 0;
|
|
8535
8756
|
const record = params;
|
|
@@ -8568,7 +8789,8 @@ function withWriteScope(def, cwd, scope) {
|
|
|
8568
8789
|
throw new Error("write scope: cannot determine a valid target path");
|
|
8569
8790
|
}
|
|
8570
8791
|
for (const target of targets) {
|
|
8571
|
-
|
|
8792
|
+
const resolved = def.name === "apply_patch" ? target : expandPiToolPath(target);
|
|
8793
|
+
if (!isPathInWriteScope(resolved, cwd, scope)) {
|
|
8572
8794
|
throw new Error(
|
|
8573
8795
|
`write scope: "${target}" is outside [${scope.join(", ")}] — this agent type may only write files matching those globs`
|
|
8574
8796
|
);
|
|
@@ -8846,10 +9068,12 @@ function withProtectedFloor(gate, kind, definition) {
|
|
|
8846
9068
|
const protectedCategory = gate.protectedFloor ? classifyProtectedTool(definition.name, kind, params) : null;
|
|
8847
9069
|
if (protectedCategory) {
|
|
8848
9070
|
const record = params ?? {};
|
|
9071
|
+
const target = record.path ?? record.file_path;
|
|
9072
|
+
const glob = typeof record.glob === "string" && record.glob ? `--glob ${record.glob}` : "";
|
|
8849
9073
|
const result2 = await gate.ask(
|
|
8850
9074
|
definition.name,
|
|
8851
9075
|
"command",
|
|
8852
|
-
|
|
9076
|
+
[definition.name, target === void 0 ? "" : String(target), glob].filter(Boolean).join(" "),
|
|
8853
9077
|
signal,
|
|
8854
9078
|
toolCallId,
|
|
8855
9079
|
void 0,
|
|
@@ -9198,6 +9422,8 @@ function hardenedEnv(base, options) {
|
|
|
9198
9422
|
const userSsh = base.GIT_SSH_COMMAND?.trim();
|
|
9199
9423
|
if (userSsh) {
|
|
9200
9424
|
env.GIT_SSH_COMMAND = /BatchMode/.test(userSsh) ? userSsh : `${userSsh} -o BatchMode=yes`;
|
|
9425
|
+
} else if (base.GIT_SSH?.trim()) {
|
|
9426
|
+
delete env.GIT_SSH_COMMAND;
|
|
9201
9427
|
}
|
|
9202
9428
|
return env;
|
|
9203
9429
|
}
|
|
@@ -9538,6 +9764,7 @@ function abortedError() {
|
|
|
9538
9764
|
return error;
|
|
9539
9765
|
}
|
|
9540
9766
|
const yieldSec = (ms) => Math.round(ms / 100) / 10;
|
|
9767
|
+
const inSessionTree = (sessionId, rootId) => sessionId === rootId || sessionId.startsWith(`${rootId}::`);
|
|
9541
9768
|
function detachedWaitNote(reason, subject) {
|
|
9542
9769
|
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.`;
|
|
9543
9770
|
}
|
|
@@ -9563,7 +9790,7 @@ class BackgroundTaskManager {
|
|
|
9563
9790
|
this.currentLimits = limits;
|
|
9564
9791
|
}
|
|
9565
9792
|
start(sessionId, command, cwd, spawnOpts) {
|
|
9566
|
-
const taskId = this.reserveId();
|
|
9793
|
+
const taskId = this.reserveId(sessionId);
|
|
9567
9794
|
const child = spawnBackground(command, cwd, spawnOpts);
|
|
9568
9795
|
const task = this.register(sessionId, taskId, spawnOpts?.displayCommand ?? command, {
|
|
9569
9796
|
details: spawnOpts?.details,
|
|
@@ -9582,7 +9809,7 @@ class BackgroundTaskManager {
|
|
|
9582
9809
|
}
|
|
9583
9810
|
/** 接管前台命令的在跑进程:不重启,已有输出作为任务初始输出 */
|
|
9584
9811
|
adopt(sessionId, proc, opts) {
|
|
9585
|
-
const taskId = this.reserveId();
|
|
9812
|
+
const taskId = this.reserveId(sessionId);
|
|
9586
9813
|
const task = this.register(sessionId, taskId, opts.command, {
|
|
9587
9814
|
startedAt: opts.startedAt,
|
|
9588
9815
|
kill: () => proc.kill()
|
|
@@ -9668,12 +9895,12 @@ class BackgroundTaskManager {
|
|
|
9668
9895
|
const commands = [...this.foreground.get(sessionId)?.values() ?? []];
|
|
9669
9896
|
return commands.flatMap((command) => command.detach(reason) ?? []);
|
|
9670
9897
|
}
|
|
9671
|
-
reserveId() {
|
|
9898
|
+
reserveId(sessionId) {
|
|
9672
9899
|
const max = this.limits.maxTasks;
|
|
9673
9900
|
if (this.tasks.size >= max) this.pruneFinished();
|
|
9674
9901
|
if (this.tasks.size >= max) {
|
|
9675
9902
|
throw new Error(
|
|
9676
|
-
`Too many background tasks (limit ${max}). Stop one with task_stop first. Known task ids: [${
|
|
9903
|
+
`Too many background tasks (limit ${max}). Stop one with task_stop first. Known task ids: [${this.knownIds(sessionId).join(", ")}]`
|
|
9677
9904
|
);
|
|
9678
9905
|
}
|
|
9679
9906
|
return `task-${++this.counter}-${Date.now().toString(36)}`;
|
|
@@ -9941,8 +10168,14 @@ class BackgroundTaskManager {
|
|
|
9941
10168
|
}, this.limits.killGraceMs).unref?.();
|
|
9942
10169
|
return true;
|
|
9943
10170
|
}
|
|
9944
|
-
|
|
9945
|
-
|
|
10171
|
+
/** 给了 rootId 时只列该会话树的任务 */
|
|
10172
|
+
knownIds(rootId) {
|
|
10173
|
+
return [...this.tasks.values()].filter((task) => rootId === void 0 || inSessionTree(task.sessionId, rootId)).map((task) => task.info.taskId);
|
|
10174
|
+
}
|
|
10175
|
+
/** 任务是否属于以 rootId 为根的会话树:所有会话共用一个 manager,模型面只能碰自己的 */
|
|
10176
|
+
owns(taskId, rootId) {
|
|
10177
|
+
const task = this.tasks.get(taskId);
|
|
10178
|
+
return task !== void 0 && inSessionTree(task.sessionId, rootId);
|
|
9946
10179
|
}
|
|
9947
10180
|
hasRunningInWorkspace(rootIds2) {
|
|
9948
10181
|
return [...this.tasks.values()].some(
|
|
@@ -10221,6 +10454,7 @@ function withBackground(definition, manager, sessionId, cwd, transform, foregrou
|
|
|
10221
10454
|
}
|
|
10222
10455
|
function createTaskTools(manager, sessionId) {
|
|
10223
10456
|
const waitCapMs = manager.limits.taskWaitMaxMs;
|
|
10457
|
+
const owned = (taskId) => sessionId === void 0 || manager.owns(taskId, sessionId);
|
|
10224
10458
|
return [
|
|
10225
10459
|
{
|
|
10226
10460
|
name: "task_output",
|
|
@@ -10241,17 +10475,18 @@ function createTaskTools(manager, sessionId) {
|
|
|
10241
10475
|
async execute(toolCallId, params, signal) {
|
|
10242
10476
|
const { taskId = "", timeout_ms: timeoutMs } = params;
|
|
10243
10477
|
const requested = typeof timeoutMs === "number" && timeoutMs > 0 ? timeoutMs : 0;
|
|
10244
|
-
const
|
|
10478
|
+
const mine = owned(taskId);
|
|
10479
|
+
const blocking = mine && requested > 0 && sessionId ? manager.trackBlockingWait(sessionId, toolCallId) : null;
|
|
10245
10480
|
const waitSignal = blocking ? signal ? AbortSignal.any([signal, blocking.signal]) : blocking.signal : signal;
|
|
10246
|
-
let result2;
|
|
10481
|
+
let result2 = null;
|
|
10247
10482
|
try {
|
|
10248
|
-
result2 = await manager.read(taskId, requested, waitSignal);
|
|
10483
|
+
if (mine) result2 = await manager.read(taskId, requested, waitSignal);
|
|
10249
10484
|
} finally {
|
|
10250
10485
|
blocking?.untrack();
|
|
10251
10486
|
}
|
|
10252
10487
|
if (!result2) {
|
|
10253
10488
|
throw new Error(
|
|
10254
|
-
`unknown task: ${taskId}. Known task ids: [${manager.knownIds().join(", ")}]`
|
|
10489
|
+
`unknown task: ${taskId}. Known task ids: [${manager.knownIds(sessionId).join(", ")}]`
|
|
10255
10490
|
);
|
|
10256
10491
|
}
|
|
10257
10492
|
const suffix = result2.exitCode !== void 0 ? ` (exit ${result2.exitCode})` : "";
|
|
@@ -10292,12 +10527,12 @@ ${shown.text}` : ""}${hint}${failure}`
|
|
|
10292
10527
|
},
|
|
10293
10528
|
async execute(_id, params) {
|
|
10294
10529
|
const taskId = params.taskId ?? "";
|
|
10295
|
-
const stopped = manager.stop(taskId);
|
|
10530
|
+
const stopped = owned(taskId) && manager.stop(taskId);
|
|
10296
10531
|
return {
|
|
10297
10532
|
content: [
|
|
10298
10533
|
{
|
|
10299
10534
|
type: "text",
|
|
10300
|
-
text: stopped ? `Stopped ${taskId}` : `${taskId} is not running. Known task ids: [${manager.knownIds().join(", ")}]`
|
|
10535
|
+
text: stopped ? `Stopped ${taskId}` : `${taskId} is not running. Known task ids: [${manager.knownIds(sessionId).join(", ")}]`
|
|
10301
10536
|
}
|
|
10302
10537
|
],
|
|
10303
10538
|
details: void 0
|
|
@@ -10961,7 +11196,7 @@ function parseDirectoryProvider(value) {
|
|
|
10961
11196
|
}
|
|
10962
11197
|
return provider;
|
|
10963
11198
|
}
|
|
10964
|
-
const version = "0.3.
|
|
11199
|
+
const version = "0.3.6";
|
|
10965
11200
|
function readModelsDevCache(file) {
|
|
10966
11201
|
try {
|
|
10967
11202
|
if (!existsSync(file)) return void 0;
|
|
@@ -10976,112 +11211,6 @@ function writeModelsDevCache(file, cache) {
|
|
|
10976
11211
|
writeFileSync(tmp, JSON.stringify(cache));
|
|
10977
11212
|
renameSync(tmp, file);
|
|
10978
11213
|
}
|
|
10979
|
-
const ENSO_SYSTEM_PROMPT = `You are Enso, the built-in product assistant for EnsoCode.
|
|
10980
|
-
|
|
10981
|
-
Use only the tools provided to this session. Call enso_capabilities with operation "list" when the catalog is not already available in the current context or when the user asks what EnsoCode can do. Before invoking a capability whose contract is not already clear, call enso_capabilities with operation "describe". Never invent capability ids, parameters, results, or availability.
|
|
10982
|
-
|
|
10983
|
-
Use enso_app only for executable product capabilities. Capability authorization and target binding are enforced outside this worker. The Main-generated result and receipt are the only execution truth: report denied, failed, unavailable, or cancelled exactly as returned, and never turn a completed model response into a success claim. Use ask_user only to clarify ambiguous intent or collect a genuine user preference; never use it to authorize a dangerous capability.
|
|
10984
|
-
|
|
10985
|
-
Do not request, expose, or infer raw IPC channels, internal handler or tool ids, credentials, access tokens, API keys, environment values, or hidden application state. The session working directory is storage metadata only: it grants no project, file, command, MCP, skill, preset, instruction, subagent, coworker, todo, goal, or background-task access. If a catalog entry is unavailable, explain its published reason and suggested action instead of claiming completion.`;
|
|
10986
|
-
const SECRET_PATTERNS = [
|
|
10987
|
-
/\bBearer\s+[A-Za-z0-9._~+/-]+=*/gi,
|
|
10988
|
-
/\b(?:api[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)\s*[:=]\s*[^\s,;]+/gi,
|
|
10989
|
-
/https?:\/\/[^\s/@:]+:[^\s/@]+@/gi,
|
|
10990
|
-
/\b(?:sk|ghp|xox[baprs])-[-A-Za-z0-9_]{12,}\b/g
|
|
10991
|
-
];
|
|
10992
|
-
function redactSafeText(text2) {
|
|
10993
|
-
return SECRET_PATTERNS.reduce(
|
|
10994
|
-
(value, pattern) => value.replace(pattern, "[REDACTED]"),
|
|
10995
|
-
text2
|
|
10996
|
-
).slice(0, 1e5);
|
|
10997
|
-
}
|
|
10998
|
-
class EnsoSafeJournal {
|
|
10999
|
-
sessionFile;
|
|
11000
|
-
constructor(sessionDir, child, cwd, resumeFile) {
|
|
11001
|
-
mkdirSync(sessionDir, { recursive: true });
|
|
11002
|
-
this.sessionFile = resumeFile ?? path.join(
|
|
11003
|
-
sessionDir,
|
|
11004
|
-
`enso-${child.sessionId.replace(/[^A-Za-z0-9._-]/g, "_")}-${child.generation}.jsonl`
|
|
11005
|
-
);
|
|
11006
|
-
if (!resumeFile) {
|
|
11007
|
-
const header = {
|
|
11008
|
-
type: "enso-safe-session",
|
|
11009
|
-
version: 1,
|
|
11010
|
-
child,
|
|
11011
|
-
cwd,
|
|
11012
|
-
createdAt: Date.now()
|
|
11013
|
-
};
|
|
11014
|
-
writeFileSync(this.sessionFile, `${JSON.stringify(header)}
|
|
11015
|
-
`, {
|
|
11016
|
-
encoding: "utf8",
|
|
11017
|
-
mode: 384,
|
|
11018
|
-
flag: "wx"
|
|
11019
|
-
});
|
|
11020
|
-
}
|
|
11021
|
-
}
|
|
11022
|
-
append(record) {
|
|
11023
|
-
appendFileSync(this.sessionFile, `${JSON.stringify(this.sanitize(record))}
|
|
11024
|
-
`, "utf8");
|
|
11025
|
-
}
|
|
11026
|
-
appendUserText(text2) {
|
|
11027
|
-
this.append({ type: "safe-user-text", text: redactSafeText(text2), at: Date.now() });
|
|
11028
|
-
}
|
|
11029
|
-
appendAssistantText(text2) {
|
|
11030
|
-
this.append({ type: "safe-assistant-text", text: redactSafeText(text2), at: Date.now() });
|
|
11031
|
-
}
|
|
11032
|
-
appendCapabilityResult(toolCallId, envelope) {
|
|
11033
|
-
this.append({
|
|
11034
|
-
type: "safe-model-result",
|
|
11035
|
-
toolCallId,
|
|
11036
|
-
modelResult: envelope.modelResult,
|
|
11037
|
-
at: Date.now()
|
|
11038
|
-
});
|
|
11039
|
-
this.append({ type: "capability-receipt", receipt: envelope.receipt, at: Date.now() });
|
|
11040
|
-
}
|
|
11041
|
-
static async restore(sessionFile) {
|
|
11042
|
-
const records2 = [];
|
|
11043
|
-
let partial = false;
|
|
11044
|
-
let lines;
|
|
11045
|
-
try {
|
|
11046
|
-
lines = (await readFile(sessionFile, "utf8")).split("\n").filter(Boolean);
|
|
11047
|
-
} catch {
|
|
11048
|
-
return { records: records2, partial: true };
|
|
11049
|
-
}
|
|
11050
|
-
for (let index = 0; index < lines.length; index += 1) {
|
|
11051
|
-
try {
|
|
11052
|
-
const value = JSON.parse(lines[index]);
|
|
11053
|
-
if (index === 0 && value.type === "enso-safe-session" && value.version === 1) continue;
|
|
11054
|
-
const parsed = parseRecord(value);
|
|
11055
|
-
if (parsed) records2.push(parsed);
|
|
11056
|
-
else partial = true;
|
|
11057
|
-
} catch {
|
|
11058
|
-
partial = true;
|
|
11059
|
-
}
|
|
11060
|
-
}
|
|
11061
|
-
return { records: records2, partial };
|
|
11062
|
-
}
|
|
11063
|
-
sanitize(record) {
|
|
11064
|
-
if (record.type === "safe-user-text" || record.type === "safe-assistant-text") {
|
|
11065
|
-
return { ...record, text: redactSafeText(record.text) };
|
|
11066
|
-
}
|
|
11067
|
-
return record;
|
|
11068
|
-
}
|
|
11069
|
-
}
|
|
11070
|
-
function parseRecord(value) {
|
|
11071
|
-
if ((value.type === "safe-user-text" || value.type === "safe-assistant-text") && typeof value.text === "string" && typeof value.at === "number") {
|
|
11072
|
-
return value;
|
|
11073
|
-
}
|
|
11074
|
-
if (value.type === "enso-operation" && typeof value.operationId === "string" && typeof value.capabilityId === "string" && typeof value.toolCallId === "string" && typeof value.at === "number") {
|
|
11075
|
-
return value;
|
|
11076
|
-
}
|
|
11077
|
-
if (value.type === "safe-model-result" && typeof value.toolCallId === "string" && value.modelResult && typeof value.modelResult === "object" && typeof value.at === "number") {
|
|
11078
|
-
return value;
|
|
11079
|
-
}
|
|
11080
|
-
if (value.type === "capability-receipt" && value.receipt && typeof value.receipt === "object" && typeof value.at === "number") {
|
|
11081
|
-
return value;
|
|
11082
|
-
}
|
|
11083
|
-
return null;
|
|
11084
|
-
}
|
|
11085
11214
|
const HARNESS_SKILL_ROOTS = [
|
|
11086
11215
|
[".claude", "skills"],
|
|
11087
11216
|
[".codex", "skills"],
|
|
@@ -11399,7 +11528,7 @@ function projectPart(part) {
|
|
|
11399
11528
|
name: typeof part.name === "string" ? part.name : ""
|
|
11400
11529
|
};
|
|
11401
11530
|
if ("arguments" in part) {
|
|
11402
|
-
projected.arguments =
|
|
11531
|
+
projected.arguments = capJson(structuredCloneSafe(part.arguments));
|
|
11403
11532
|
}
|
|
11404
11533
|
return projected;
|
|
11405
11534
|
}
|
|
@@ -11412,10 +11541,6 @@ function projectPart(part) {
|
|
|
11412
11541
|
return { type: "unknown" };
|
|
11413
11542
|
}
|
|
11414
11543
|
}
|
|
11415
|
-
function projectEnsoAppReference(value) {
|
|
11416
|
-
if (!isRecord$1(value) || typeof value.capability_id !== "string") return void 0;
|
|
11417
|
-
return { capability_id: value.capability_id };
|
|
11418
|
-
}
|
|
11419
11544
|
const isRecord$1 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
11420
11545
|
function capText(text2) {
|
|
11421
11546
|
return text2.length <= PROJECTED_TEXT_LIMIT ? text2 : `${text2.slice(0, PROJECTED_TEXT_LIMIT)}
|
|
@@ -12035,6 +12160,8 @@ function createSshExecutor(host, controlDir, spawnImpl = spawn, remote = { auth:
|
|
|
12035
12160
|
code: code ?? -1
|
|
12036
12161
|
});
|
|
12037
12162
|
});
|
|
12163
|
+
proc.stdin?.on("error", () => {
|
|
12164
|
+
});
|
|
12038
12165
|
if (options.stdin !== void 0 && proc.stdin) {
|
|
12039
12166
|
proc.stdin.write(options.stdin);
|
|
12040
12167
|
proc.stdin.end();
|
|
@@ -12119,9 +12246,21 @@ function tryParseJson(text2) {
|
|
|
12119
12246
|
function sliceFirstJson(text2) {
|
|
12120
12247
|
const start = text2.search(/[{[]/);
|
|
12121
12248
|
if (start < 0) return void 0;
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12249
|
+
let depth = 0;
|
|
12250
|
+
let inString = false;
|
|
12251
|
+
for (let i = start; i < text2.length; i++) {
|
|
12252
|
+
const char = text2[i];
|
|
12253
|
+
if (inString) {
|
|
12254
|
+
if (char === "\\") i++;
|
|
12255
|
+
else if (char === '"') inString = false;
|
|
12256
|
+
} else if (char === '"') {
|
|
12257
|
+
inString = true;
|
|
12258
|
+
} else if (char === "{" || char === "[") {
|
|
12259
|
+
depth++;
|
|
12260
|
+
} else if (char === "}" || char === "]") {
|
|
12261
|
+
depth--;
|
|
12262
|
+
if (depth === 0) return tryParseJson(text2.slice(start, i + 1));
|
|
12263
|
+
}
|
|
12125
12264
|
}
|
|
12126
12265
|
return void 0;
|
|
12127
12266
|
}
|
|
@@ -12237,12 +12376,25 @@ function withAgentRead(definition, getStore) {
|
|
|
12237
12376
|
}
|
|
12238
12377
|
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.";
|
|
12239
12378
|
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.";
|
|
12240
|
-
function
|
|
12379
|
+
function normalizeSubagentArgs(params) {
|
|
12241
12380
|
if (!params || typeof params !== "object" || Array.isArray(params)) return params;
|
|
12242
|
-
|
|
12243
|
-
if (
|
|
12381
|
+
let record = params;
|
|
12382
|
+
if (record.operation === void 0 || record.operation === null) {
|
|
12383
|
+
const filled = (value) => typeof value === "string" && value.trim() !== "";
|
|
12384
|
+
if (!filled(record.description) || !filled(record.prompt)) {
|
|
12385
|
+
throw new Error(
|
|
12386
|
+
`subagent requires operation. To spawn, pass operation:"spawn" with non-empty description and prompt; other operations: ${SUBAGENT_OPERATIONS.slice(1).join(", ")}`
|
|
12387
|
+
);
|
|
12388
|
+
}
|
|
12389
|
+
record = { ...record, operation: "spawn" };
|
|
12390
|
+
} else if (!SUBAGENT_OPERATIONS.includes(record.operation)) {
|
|
12391
|
+
throw new Error(
|
|
12392
|
+
`unknown operation ${JSON.stringify(record.operation)}. Expected one of: ${SUBAGENT_OPERATIONS.join(", ")}`
|
|
12393
|
+
);
|
|
12394
|
+
}
|
|
12395
|
+
if (typeof record.timeoutMs !== "number" || !Number.isFinite(record.timeoutMs)) return record;
|
|
12244
12396
|
const timeoutMs = Math.min(AGENT_WAIT_MAX_MS, Math.max(0, Math.round(record.timeoutMs)));
|
|
12245
|
-
return timeoutMs === record.timeoutMs ?
|
|
12397
|
+
return timeoutMs === record.timeoutMs ? record : { ...record, timeoutMs };
|
|
12246
12398
|
}
|
|
12247
12399
|
function waitReceiptOf(value) {
|
|
12248
12400
|
if (!value || typeof value !== "object") return void 0;
|
|
@@ -12393,10 +12545,10 @@ function createUnifiedSubagentTool(deps) {
|
|
|
12393
12545
|
return {
|
|
12394
12546
|
name: "subagent",
|
|
12395
12547
|
label: "Subagent",
|
|
12396
|
-
description: "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.
|
|
12397
|
-
promptSnippet:
|
|
12548
|
+
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.',
|
|
12549
|
+
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 dismiss an Agent. Default spawn mode=task and wait=false; finished Runs notify you automatically.',
|
|
12398
12550
|
promptGuidelines: [
|
|
12399
|
-
"spawn requires non-empty description and prompt. Omit both for every other operation.
|
|
12551
|
+
'Every subagent call must pass operation; to spawn, pass operation:"spawn". spawn requires non-empty description and prompt. Omit both for every other operation.',
|
|
12400
12552
|
"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.",
|
|
12401
12553
|
"Agent and Run are different identities: use runId for wait/report/stop and agentId for send/dismiss.",
|
|
12402
12554
|
"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.",
|
|
@@ -12485,9 +12637,9 @@ function createUnifiedSubagentTool(deps) {
|
|
|
12485
12637
|
required: ["operation"],
|
|
12486
12638
|
additionalProperties: false
|
|
12487
12639
|
},
|
|
12488
|
-
prepareArguments:
|
|
12640
|
+
prepareArguments: normalizeSubagentArgs,
|
|
12489
12641
|
async execute(toolCallId, params, signal) {
|
|
12490
|
-
const input =
|
|
12642
|
+
const input = normalizeSubagentArgs(params);
|
|
12491
12643
|
const request = normalize(input);
|
|
12492
12644
|
if (!request) {
|
|
12493
12645
|
throw new Error(`invalid subagent parameters: ${describeInvalidSubagentParams(input)}`);
|
|
@@ -13514,1308 +13666,119 @@ function checkPassed(check, messages, since) {
|
|
|
13514
13666
|
);
|
|
13515
13667
|
}
|
|
13516
13668
|
const checkFailureText = (check) => `验收未通过:未在工具输出中看到「${check.text}」`;
|
|
13517
|
-
const
|
|
13518
|
-
function
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
|
|
13531
|
-
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
"auto",
|
|
13543
|
-
...WINDOWS_TERMINAL_SHELLS,
|
|
13544
|
-
...UNIX_TERMINAL_SHELLS
|
|
13545
|
-
];
|
|
13546
|
-
const WINDOWS_FILES = {
|
|
13547
|
-
cmd: "cmd.exe",
|
|
13548
|
-
powershell: "powershell.exe",
|
|
13549
|
-
pwsh: "pwsh.exe",
|
|
13550
|
-
"git-bash": "bash.exe"
|
|
13551
|
-
};
|
|
13552
|
-
function parseTerminalShell(value) {
|
|
13553
|
-
return typeof value === "string" && TERMINAL_SHELLS.includes(value) ? value : "auto";
|
|
13669
|
+
const DEFAULT_PORTS = { "http:": 80, "https:": 443 };
|
|
13670
|
+
function parseNoProxy(value) {
|
|
13671
|
+
const entries = [];
|
|
13672
|
+
for (const raw of value.split(/[,\s]/)) {
|
|
13673
|
+
if (!raw) continue;
|
|
13674
|
+
let hostname;
|
|
13675
|
+
let port = 0;
|
|
13676
|
+
const ipv6WithPort = /^\[(.+)\]:(\d+)$/.exec(raw);
|
|
13677
|
+
if (ipv6WithPort) {
|
|
13678
|
+
hostname = ipv6WithPort[1];
|
|
13679
|
+
port = Number.parseInt(ipv6WithPort[2], 10);
|
|
13680
|
+
} else {
|
|
13681
|
+
const unbracketed = raw.replace(/^\[(.+)\]$/, "$1");
|
|
13682
|
+
const colonCount = unbracketed.match(/:/g)?.length ?? 0;
|
|
13683
|
+
const parsed = colonCount === 1 ? /^(.+):(\d+)$/.exec(unbracketed) : null;
|
|
13684
|
+
hostname = parsed?.[1] ?? unbracketed;
|
|
13685
|
+
port = parsed ? Number.parseInt(parsed[2], 10) : 0;
|
|
13686
|
+
}
|
|
13687
|
+
entries.push({
|
|
13688
|
+
hostname: hostname.replace(/^\*?\./, "").replace(/^(.+)\.$/, "$1").toLowerCase(),
|
|
13689
|
+
port,
|
|
13690
|
+
wildcard: raw.charCodeAt(0) === 42
|
|
13691
|
+
});
|
|
13692
|
+
}
|
|
13693
|
+
return entries;
|
|
13554
13694
|
}
|
|
13555
|
-
function
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13695
|
+
function requestHostPort(url) {
|
|
13696
|
+
let hostname = url.host.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase();
|
|
13697
|
+
if (hostname.length > 1 && hostname.charCodeAt(hostname.length - 1) === 46) {
|
|
13698
|
+
hostname = hostname.slice(0, -1);
|
|
13559
13699
|
}
|
|
13560
|
-
|
|
13561
|
-
return
|
|
13700
|
+
const port = Number.parseInt(url.port, 10) || DEFAULT_PORTS[url.protocol] || 0;
|
|
13701
|
+
return { hostname, port };
|
|
13562
13702
|
}
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
required: ["id"],
|
|
13572
|
-
additionalProperties: false
|
|
13573
|
-
};
|
|
13574
|
-
const ID_ENABLED_INPUT_SCHEMA = {
|
|
13575
|
-
type: "object",
|
|
13576
|
-
properties: {
|
|
13577
|
-
id: { type: "string", minLength: 1 },
|
|
13578
|
-
enabled: { type: "boolean" }
|
|
13579
|
-
},
|
|
13580
|
-
required: ["id", "enabled"],
|
|
13581
|
-
additionalProperties: false
|
|
13582
|
-
};
|
|
13583
|
-
const BOOLEAN_VALUE_INPUT_SCHEMA = {
|
|
13584
|
-
type: "object",
|
|
13585
|
-
properties: { value: { type: "boolean" } },
|
|
13586
|
-
required: ["value"],
|
|
13587
|
-
additionalProperties: false
|
|
13588
|
-
};
|
|
13589
|
-
const STRING_VALUE_INPUT_SCHEMA = {
|
|
13590
|
-
type: "object",
|
|
13591
|
-
properties: { value: { type: "string", minLength: 1 } },
|
|
13592
|
-
required: ["value"],
|
|
13593
|
-
additionalProperties: false
|
|
13594
|
-
};
|
|
13595
|
-
const THEME_VALUE_INPUT_SCHEMA = {
|
|
13596
|
-
type: "object",
|
|
13597
|
-
properties: {
|
|
13598
|
-
value: { type: "string", enum: ["light", "dark", "system", "sync-terminal"] }
|
|
13599
|
-
},
|
|
13600
|
-
required: ["value"],
|
|
13601
|
-
additionalProperties: false
|
|
13602
|
-
};
|
|
13603
|
-
const ACCENT_VALUE_INPUT_SCHEMA = {
|
|
13604
|
-
type: "object",
|
|
13605
|
-
properties: { value: { type: "string", enum: [...ACCENT_COLORS] } },
|
|
13606
|
-
required: ["value"],
|
|
13607
|
-
additionalProperties: false
|
|
13608
|
-
};
|
|
13609
|
-
const LANGUAGE_VALUE_INPUT_SCHEMA = {
|
|
13610
|
-
type: "object",
|
|
13611
|
-
properties: { value: { type: "string", enum: ["en", "zh"] } },
|
|
13612
|
-
required: ["value"],
|
|
13613
|
-
additionalProperties: false
|
|
13614
|
-
};
|
|
13615
|
-
const FONT_WEIGHT_VALUES = [
|
|
13616
|
-
"normal",
|
|
13617
|
-
"bold",
|
|
13618
|
-
"100",
|
|
13619
|
-
"200",
|
|
13620
|
-
"300",
|
|
13621
|
-
"400",
|
|
13622
|
-
"500",
|
|
13623
|
-
"600",
|
|
13624
|
-
"700",
|
|
13625
|
-
"800",
|
|
13626
|
-
"900"
|
|
13627
|
-
];
|
|
13628
|
-
const FONT_WEIGHT_VALUE_INPUT_SCHEMA = {
|
|
13629
|
-
type: "object",
|
|
13630
|
-
properties: { value: { type: "string", enum: FONT_WEIGHT_VALUES } },
|
|
13631
|
-
required: ["value"],
|
|
13632
|
-
additionalProperties: false
|
|
13633
|
-
};
|
|
13634
|
-
const FONT_SIZE_VALUE_INPUT_SCHEMA = {
|
|
13635
|
-
type: "object",
|
|
13636
|
-
properties: { value: { type: "number", minimum: 8 } },
|
|
13637
|
-
required: ["value"],
|
|
13638
|
-
additionalProperties: false
|
|
13639
|
-
};
|
|
13640
|
-
const STRING_ARRAY_VALUE_INPUT_SCHEMA = {
|
|
13641
|
-
type: "object",
|
|
13642
|
-
properties: { value: { type: "array", items: { type: "string", minLength: 1 } } },
|
|
13643
|
-
required: ["value"],
|
|
13644
|
-
additionalProperties: false
|
|
13645
|
-
};
|
|
13646
|
-
const STATUS_LINE_VALUE_INPUT_SCHEMA = {
|
|
13647
|
-
type: "object",
|
|
13648
|
-
properties: {
|
|
13649
|
-
value: {
|
|
13650
|
-
type: "array",
|
|
13651
|
-
items: { type: "string", enum: STATUS_LINE_SEGMENT_IDS },
|
|
13652
|
-
uniqueItems: true
|
|
13703
|
+
function shouldProxy(url, noProxy) {
|
|
13704
|
+
const entries = parseNoProxy(noProxy);
|
|
13705
|
+
if (entries.length === 0) return true;
|
|
13706
|
+
const { hostname, port } = requestHostPort(url);
|
|
13707
|
+
for (const entry of entries) {
|
|
13708
|
+
if (entry.hostname === "*") {
|
|
13709
|
+
if (entry.port && entry.port !== port) continue;
|
|
13710
|
+
return false;
|
|
13653
13711
|
}
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
};
|
|
13658
|
-
const KEYBINDING_INPUT_SCHEMA = {
|
|
13659
|
-
type: "object",
|
|
13660
|
-
properties: {
|
|
13661
|
-
action: { type: "string", minLength: 1 },
|
|
13662
|
-
binding: { type: "string", minLength: 1 }
|
|
13663
|
-
},
|
|
13664
|
-
required: ["action", "binding"],
|
|
13665
|
-
additionalProperties: false
|
|
13666
|
-
};
|
|
13667
|
-
const KEYBINDING_ACTION_INPUT_SCHEMA = {
|
|
13668
|
-
type: "object",
|
|
13669
|
-
properties: { action: { type: "string", minLength: 1 } },
|
|
13670
|
-
required: ["action"],
|
|
13671
|
-
additionalProperties: false
|
|
13672
|
-
};
|
|
13673
|
-
const MODEL_REF_INPUT_SCHEMA = {
|
|
13674
|
-
type: "object",
|
|
13675
|
-
properties: {
|
|
13676
|
-
providerId: { type: "string", minLength: 1 },
|
|
13677
|
-
modelId: { type: "string", minLength: 1 }
|
|
13678
|
-
},
|
|
13679
|
-
required: ["providerId", "modelId"],
|
|
13680
|
-
additionalProperties: false
|
|
13681
|
-
};
|
|
13682
|
-
const PROVIDER_MODEL_TOGGLE_INPUT_SCHEMA = {
|
|
13683
|
-
type: "object",
|
|
13684
|
-
properties: {
|
|
13685
|
-
providerId: { type: "string", minLength: 1 },
|
|
13686
|
-
modelId: { type: "string", minLength: 1 },
|
|
13687
|
-
enabled: { type: "boolean" }
|
|
13688
|
-
},
|
|
13689
|
-
required: ["providerId", "modelId", "enabled"],
|
|
13690
|
-
additionalProperties: false
|
|
13691
|
-
};
|
|
13692
|
-
const SUBAGENT_MODEL_FIELDS = {
|
|
13693
|
-
providerId: { type: "string", minLength: 1 },
|
|
13694
|
-
modelId: { type: "string", minLength: 1 },
|
|
13695
|
-
description: { type: "string" },
|
|
13696
|
-
reasoning: { type: "string", enum: ["on", "off", "follow"] },
|
|
13697
|
-
thinkingLevel: {
|
|
13698
|
-
type: "string",
|
|
13699
|
-
enum: ["minimal", "low", "medium", "high", "xhigh", "max", "follow"]
|
|
13712
|
+
if (entry.port && entry.port !== port) continue;
|
|
13713
|
+
if (!entry.wildcard && hostname === entry.hostname) return false;
|
|
13714
|
+
if (hostname.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) return false;
|
|
13700
13715
|
}
|
|
13701
|
-
|
|
13702
|
-
const SUBAGENT_MODEL_ADD_INPUT_SCHEMA = {
|
|
13703
|
-
type: "object",
|
|
13704
|
-
properties: SUBAGENT_MODEL_FIELDS,
|
|
13705
|
-
required: ["providerId", "modelId"],
|
|
13706
|
-
additionalProperties: false
|
|
13707
|
-
};
|
|
13708
|
-
const SUBAGENT_MODEL_UPDATE_INPUT_SCHEMA = {
|
|
13709
|
-
type: "object",
|
|
13710
|
-
properties: {
|
|
13711
|
-
id: { type: "string", minLength: 1 },
|
|
13712
|
-
...SUBAGENT_MODEL_FIELDS
|
|
13713
|
-
},
|
|
13714
|
-
required: ["id"],
|
|
13715
|
-
additionalProperties: false
|
|
13716
|
-
};
|
|
13717
|
-
const ACCOUNT_INPUT_SCHEMA = {
|
|
13718
|
-
type: "object",
|
|
13719
|
-
properties: { accountKey: { type: "string", minLength: 1 } },
|
|
13720
|
-
required: ["accountKey"],
|
|
13721
|
-
additionalProperties: false
|
|
13722
|
-
};
|
|
13723
|
-
const PROVIDER_ID_INPUT_SCHEMA = {
|
|
13724
|
-
type: "object",
|
|
13725
|
-
properties: { providerId: { type: "string", minLength: 1 } },
|
|
13726
|
-
required: ["providerId"],
|
|
13727
|
-
additionalProperties: false
|
|
13728
|
-
};
|
|
13729
|
-
const CONTENT_INPUT_SCHEMA = {
|
|
13730
|
-
type: "object",
|
|
13731
|
-
properties: {
|
|
13732
|
-
id: { type: "string", minLength: 1 },
|
|
13733
|
-
content: { type: "string" }
|
|
13734
|
-
},
|
|
13735
|
-
required: ["id", "content"],
|
|
13736
|
-
additionalProperties: false
|
|
13737
|
-
};
|
|
13738
|
-
const HIRE_COWORKER_INPUT_SCHEMA = {
|
|
13739
|
-
type: "object",
|
|
13740
|
-
properties: {
|
|
13741
|
-
name: { type: "string", minLength: 1 },
|
|
13742
|
-
agentType: { type: "string", minLength: 1 }
|
|
13743
|
-
},
|
|
13744
|
-
required: ["name"],
|
|
13745
|
-
additionalProperties: false
|
|
13746
|
-
};
|
|
13747
|
-
const STRING_ID_ARRAY_SCHEMA = {
|
|
13748
|
-
type: "array",
|
|
13749
|
-
items: { type: "string", minLength: 1 }
|
|
13750
|
-
};
|
|
13751
|
-
const PRESET_FIELDS = {
|
|
13752
|
-
name: { type: "string", minLength: 1 },
|
|
13753
|
-
skillIds: STRING_ID_ARRAY_SCHEMA,
|
|
13754
|
-
mcpServerIds: STRING_ID_ARRAY_SCHEMA,
|
|
13755
|
-
instructionId: { type: "string", minLength: 1 }
|
|
13756
|
-
};
|
|
13757
|
-
const PRESET_CREATE_INPUT_SCHEMA = {
|
|
13758
|
-
type: "object",
|
|
13759
|
-
properties: PRESET_FIELDS,
|
|
13760
|
-
required: ["name"],
|
|
13761
|
-
additionalProperties: false
|
|
13762
|
-
};
|
|
13763
|
-
const PRESET_EDIT_INPUT_SCHEMA = {
|
|
13764
|
-
type: "object",
|
|
13765
|
-
properties: {
|
|
13766
|
-
id: { type: "string", minLength: 1 },
|
|
13767
|
-
...PRESET_FIELDS
|
|
13768
|
-
},
|
|
13769
|
-
required: ["id"],
|
|
13770
|
-
additionalProperties: false
|
|
13771
|
-
};
|
|
13772
|
-
const AGENT_TYPE_FIELDS = {
|
|
13773
|
-
name: { type: "string", minLength: 1 },
|
|
13774
|
-
description: { type: "string" },
|
|
13775
|
-
systemPrompt: { type: "string" },
|
|
13776
|
-
tools: { type: "string", enum: ["readonly", "all"] },
|
|
13777
|
-
modelMode: { type: "string", enum: ["agent_pick", "follow", "fixed"] },
|
|
13778
|
-
providerId: { type: "string", minLength: 1 },
|
|
13779
|
-
modelId: { type: "string", minLength: 1 },
|
|
13780
|
-
skillIds: STRING_ID_ARRAY_SCHEMA,
|
|
13781
|
-
mcpServerIds: STRING_ID_ARRAY_SCHEMA
|
|
13782
|
-
};
|
|
13783
|
-
const AGENT_TYPE_MODEL_PAIR = {
|
|
13784
|
-
providerId: ["modelId"],
|
|
13785
|
-
modelId: ["providerId"]
|
|
13786
|
-
};
|
|
13787
|
-
const AGENT_TYPE_CREATE_INPUT_SCHEMA = {
|
|
13788
|
-
type: "object",
|
|
13789
|
-
properties: AGENT_TYPE_FIELDS,
|
|
13790
|
-
required: ["name"],
|
|
13791
|
-
dependentRequired: AGENT_TYPE_MODEL_PAIR,
|
|
13792
|
-
additionalProperties: false
|
|
13793
|
-
};
|
|
13794
|
-
const AGENT_TYPE_EDIT_INPUT_SCHEMA = {
|
|
13795
|
-
type: "object",
|
|
13796
|
-
properties: {
|
|
13797
|
-
id: { type: "string", minLength: 1 },
|
|
13798
|
-
...AGENT_TYPE_FIELDS
|
|
13799
|
-
},
|
|
13800
|
-
required: ["id"],
|
|
13801
|
-
dependentRequired: AGENT_TYPE_MODEL_PAIR,
|
|
13802
|
-
additionalProperties: false
|
|
13803
|
-
};
|
|
13804
|
-
const DISMISS_COWORKER_INPUT_SCHEMA = {
|
|
13805
|
-
type: "object",
|
|
13806
|
-
properties: { coworkerId: { type: "string", minLength: 1 } },
|
|
13807
|
-
required: ["coworkerId"],
|
|
13808
|
-
additionalProperties: false
|
|
13809
|
-
};
|
|
13810
|
-
const BUILTIN_TOOL_TOGGLE_INPUT_SCHEMA = {
|
|
13811
|
-
type: "object",
|
|
13812
|
-
properties: {
|
|
13813
|
-
id: { type: "string", enum: BUILTIN_TOOLS.map((tool) => tool.id) },
|
|
13814
|
-
enabled: { type: "boolean" }
|
|
13815
|
-
},
|
|
13816
|
-
required: ["id", "enabled"],
|
|
13817
|
-
additionalProperties: false
|
|
13818
|
-
};
|
|
13819
|
-
const BUILTIN_AGENT_TYPE_TOGGLE_INPUT_SCHEMA = {
|
|
13820
|
-
type: "object",
|
|
13821
|
-
properties: {
|
|
13822
|
-
id: { type: "string", enum: BUILTIN_AGENT_TYPES.map((type) => type.name) },
|
|
13823
|
-
enabled: { type: "boolean" }
|
|
13824
|
-
},
|
|
13825
|
-
required: ["id", "enabled"],
|
|
13826
|
-
additionalProperties: false
|
|
13827
|
-
};
|
|
13828
|
-
function executable(id, options) {
|
|
13829
|
-
return {
|
|
13830
|
-
id,
|
|
13831
|
-
domain: PRODUCT_SURFACE_INVENTORY[id].domain,
|
|
13832
|
-
description: options.description,
|
|
13833
|
-
inputSchema: options.inputSchema ?? NO_INPUT_SCHEMA,
|
|
13834
|
-
risk: options.risk,
|
|
13835
|
-
targetContext: options.targetContext,
|
|
13836
|
-
availability: options.availability ?? [],
|
|
13837
|
-
execution: { kind: "executable", handlerId: id }
|
|
13838
|
-
};
|
|
13716
|
+
return true;
|
|
13839
13717
|
}
|
|
13840
|
-
function
|
|
13841
|
-
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
|
|
13852
|
-
|
|
13718
|
+
function selectWebFetchProxy(url, env = process.env) {
|
|
13719
|
+
const httpProxy = env.http_proxy ?? env.HTTP_PROXY ?? "";
|
|
13720
|
+
const httpsProxy = env.https_proxy ?? env.HTTPS_PROXY ?? "";
|
|
13721
|
+
const noProxy = env.no_proxy ?? env.NO_PROXY ?? "";
|
|
13722
|
+
if (!shouldProxy(url, noProxy)) return null;
|
|
13723
|
+
if (url.protocol === "https:") return httpsProxy || httpProxy || null;
|
|
13724
|
+
if (url.protocol === "http:") return httpProxy || null;
|
|
13725
|
+
return null;
|
|
13726
|
+
}
|
|
13727
|
+
function orderConnectAddresses(addresses) {
|
|
13728
|
+
return addresses.map((address, index) => ({ address, index, v4: isIP(address) === 4 })).sort((a, b) => Number(b.v4) - Number(a.v4) || a.index - b.index).map((item) => item.address);
|
|
13729
|
+
}
|
|
13730
|
+
function pinnedAgent(url, address) {
|
|
13731
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, "");
|
|
13732
|
+
const family = isIP(address);
|
|
13733
|
+
const lookup2 = ((_host, options, callback) => {
|
|
13734
|
+
if (options.all) callback(null, [{ address, family }]);
|
|
13735
|
+
else callback(null, address, family);
|
|
13736
|
+
});
|
|
13737
|
+
return new Agent({
|
|
13738
|
+
connect: {
|
|
13739
|
+
lookup: lookup2,
|
|
13740
|
+
...url.protocol === "https:" && !isIP(hostname) ? { servername: hostname } : {}
|
|
13853
13741
|
}
|
|
13854
|
-
};
|
|
13742
|
+
});
|
|
13743
|
+
}
|
|
13744
|
+
function isAbortError(error) {
|
|
13745
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13746
|
+
let current = error;
|
|
13747
|
+
while (current && typeof current === "object" && !seen.has(current)) {
|
|
13748
|
+
seen.add(current);
|
|
13749
|
+
if (current instanceof Error && (current.name === "AbortError" || current.name === "TimeoutError")) {
|
|
13750
|
+
return true;
|
|
13751
|
+
}
|
|
13752
|
+
const code = current.code;
|
|
13753
|
+
if (code === "UND_ERR_ABORTED" || code === "ABORT_ERR") return true;
|
|
13754
|
+
current = current.cause;
|
|
13755
|
+
}
|
|
13756
|
+
return false;
|
|
13757
|
+
}
|
|
13758
|
+
async function undiciRequest(url, init, dispatcher) {
|
|
13759
|
+
return fetch$1(url, { ...init, dispatcher });
|
|
13760
|
+
}
|
|
13761
|
+
async function fetchWebResource(url, addresses, init, onDispatcher) {
|
|
13762
|
+
const proxy = selectWebFetchProxy(url);
|
|
13763
|
+
if (proxy) {
|
|
13764
|
+
const dispatcher = new ProxyAgent({ uri: proxy });
|
|
13765
|
+
onDispatcher(dispatcher);
|
|
13766
|
+
return undiciRequest(url.href, init, dispatcher);
|
|
13767
|
+
}
|
|
13768
|
+
const ordered = orderConnectAddresses(addresses).filter((address) => isIP(address) !== 0);
|
|
13769
|
+
let last;
|
|
13770
|
+
for (let i = 0; i < ordered.length; i++) {
|
|
13771
|
+
const dispatcher = pinnedAgent(url, ordered[i]);
|
|
13772
|
+
onDispatcher(dispatcher);
|
|
13773
|
+
try {
|
|
13774
|
+
return await undiciRequest(url.href, init, dispatcher);
|
|
13775
|
+
} catch (error) {
|
|
13776
|
+
last = error;
|
|
13777
|
+
if (i === ordered.length - 1 || isAbortError(error)) throw error;
|
|
13778
|
+
}
|
|
13779
|
+
}
|
|
13780
|
+
throw last instanceof Error ? last : new Error("No validated address to connect");
|
|
13855
13781
|
}
|
|
13856
|
-
const reversibleGlobal = (description, inputSchema = NO_INPUT_SCHEMA) => ({
|
|
13857
|
-
description,
|
|
13858
|
-
risk: "reversible",
|
|
13859
|
-
targetContext: "global",
|
|
13860
|
-
inputSchema
|
|
13861
|
-
});
|
|
13862
|
-
const readGlobal = (description, inputSchema = NO_INPUT_SCHEMA) => ({
|
|
13863
|
-
description,
|
|
13864
|
-
risk: "read",
|
|
13865
|
-
targetContext: "global",
|
|
13866
|
-
inputSchema
|
|
13867
|
-
});
|
|
13868
|
-
const CAPABILITY_CATALOG = {
|
|
13869
|
-
"general.language": executable(
|
|
13870
|
-
"general.language",
|
|
13871
|
-
reversibleGlobal("Read or change the UI language.", LANGUAGE_VALUE_INPUT_SCHEMA)
|
|
13872
|
-
),
|
|
13873
|
-
"general.load-local-skills": executable(
|
|
13874
|
-
"general.load-local-skills",
|
|
13875
|
-
reversibleGlobal(
|
|
13876
|
-
"Read or change whether coding sessions discover local skills.",
|
|
13877
|
-
BOOLEAN_VALUE_INPUT_SCHEMA
|
|
13878
|
-
)
|
|
13879
|
-
),
|
|
13880
|
-
"general.load-harness-assets": executable(
|
|
13881
|
-
"general.load-harness-assets",
|
|
13882
|
-
reversibleGlobal(
|
|
13883
|
-
"Read or change whether coding sessions also load skills and rule files from project-level .claude/.codex/.cursor directories.",
|
|
13884
|
-
BOOLEAN_VALUE_INPUT_SCHEMA
|
|
13885
|
-
)
|
|
13886
|
-
),
|
|
13887
|
-
"general.windows-local-shell": executable(
|
|
13888
|
-
"general.windows-local-shell",
|
|
13889
|
-
reversibleGlobal("Read or change the Windows local agent command shell.", {
|
|
13890
|
-
type: "object",
|
|
13891
|
-
properties: { value: { type: "string", enum: ["auto", "powershell", "bash"] } },
|
|
13892
|
-
required: ["value"],
|
|
13893
|
-
additionalProperties: false
|
|
13894
|
-
})
|
|
13895
|
-
),
|
|
13896
|
-
"general.terminal-shell": executable(
|
|
13897
|
-
"general.terminal-shell",
|
|
13898
|
-
reversibleGlobal("Read or change the shell used by new side panel terminals.", {
|
|
13899
|
-
type: "object",
|
|
13900
|
-
properties: { value: { type: "string", enum: [...TERMINAL_SHELLS] } },
|
|
13901
|
-
required: ["value"],
|
|
13902
|
-
additionalProperties: false
|
|
13903
|
-
})
|
|
13904
|
-
),
|
|
13905
|
-
"general.worktree-root": executable(
|
|
13906
|
-
"general.worktree-root",
|
|
13907
|
-
reversibleGlobal(
|
|
13908
|
-
"Read or change the root directory hosting isolated session worktrees. Empty string restores the default under app data. Must be an absolute path.",
|
|
13909
|
-
{
|
|
13910
|
-
type: "object",
|
|
13911
|
-
properties: { value: { type: "string" } },
|
|
13912
|
-
required: ["value"],
|
|
13913
|
-
additionalProperties: false
|
|
13914
|
-
}
|
|
13915
|
-
)
|
|
13916
|
-
),
|
|
13917
|
-
"general.automatic-updates": executable(
|
|
13918
|
-
"general.automatic-updates",
|
|
13919
|
-
reversibleGlobal("Read or change automatic update downloads.", BOOLEAN_VALUE_INPUT_SCHEMA)
|
|
13920
|
-
),
|
|
13921
|
-
"general.proxy-mode": executable(
|
|
13922
|
-
"general.proxy-mode",
|
|
13923
|
-
reversibleGlobal("Read or change the application network proxy mode.", {
|
|
13924
|
-
type: "object",
|
|
13925
|
-
properties: { value: { type: "string", enum: ["system", "none", "custom"] } },
|
|
13926
|
-
required: ["value"],
|
|
13927
|
-
additionalProperties: false
|
|
13928
|
-
})
|
|
13929
|
-
),
|
|
13930
|
-
"general.custom-proxy-url": executable(
|
|
13931
|
-
"general.custom-proxy-url",
|
|
13932
|
-
reversibleGlobal("Read or change the custom HTTP(S) proxy URL.", STRING_VALUE_INPUT_SCHEMA)
|
|
13933
|
-
),
|
|
13934
|
-
"general.keybindings.list": executable(
|
|
13935
|
-
"general.keybindings.list",
|
|
13936
|
-
readGlobal("List effective application keybindings.")
|
|
13937
|
-
),
|
|
13938
|
-
"general.keybindings.set": executable("general.keybindings.set", {
|
|
13939
|
-
...reversibleGlobal("Override one application keybinding.", KEYBINDING_INPUT_SCHEMA)
|
|
13940
|
-
}),
|
|
13941
|
-
"general.keybindings.reset": executable("general.keybindings.reset", {
|
|
13942
|
-
...reversibleGlobal("Reset one application keybinding.", KEYBINDING_ACTION_INPUT_SCHEMA)
|
|
13943
|
-
}),
|
|
13944
|
-
"appearance.theme": executable(
|
|
13945
|
-
"appearance.theme",
|
|
13946
|
-
reversibleGlobal("Read or change the application theme.", THEME_VALUE_INPUT_SCHEMA)
|
|
13947
|
-
),
|
|
13948
|
-
"appearance.accent": executable(
|
|
13949
|
-
"appearance.accent",
|
|
13950
|
-
reversibleGlobal("Read or change the interface accent color.", ACCENT_VALUE_INPUT_SCHEMA)
|
|
13951
|
-
),
|
|
13952
|
-
"appearance.terminal-theme": executable(
|
|
13953
|
-
"appearance.terminal-theme",
|
|
13954
|
-
reversibleGlobal("Read or change the terminal color theme.", STRING_VALUE_INPUT_SCHEMA)
|
|
13955
|
-
),
|
|
13956
|
-
"appearance.terminal-font-size": executable(
|
|
13957
|
-
"appearance.terminal-font-size",
|
|
13958
|
-
reversibleGlobal("Read or change the terminal font size.", FONT_SIZE_VALUE_INPUT_SCHEMA)
|
|
13959
|
-
),
|
|
13960
|
-
"appearance.terminal-font-family": executable(
|
|
13961
|
-
"appearance.terminal-font-family",
|
|
13962
|
-
reversibleGlobal("Read or change the terminal font family.", STRING_VALUE_INPUT_SCHEMA)
|
|
13963
|
-
),
|
|
13964
|
-
"appearance.terminal-font-weight": executable(
|
|
13965
|
-
"appearance.terminal-font-weight",
|
|
13966
|
-
reversibleGlobal("Read or change the terminal font weight.", FONT_WEIGHT_VALUE_INPUT_SCHEMA)
|
|
13967
|
-
),
|
|
13968
|
-
"appearance.terminal-bold-weight": executable(
|
|
13969
|
-
"appearance.terminal-bold-weight",
|
|
13970
|
-
reversibleGlobal(
|
|
13971
|
-
"Read or change the terminal bold font weight.",
|
|
13972
|
-
FONT_WEIGHT_VALUE_INPUT_SCHEMA
|
|
13973
|
-
)
|
|
13974
|
-
),
|
|
13975
|
-
"appearance.favorite-terminal-themes": executable(
|
|
13976
|
-
"appearance.favorite-terminal-themes",
|
|
13977
|
-
reversibleGlobal("Read or change favorite terminal themes.", STRING_ARRAY_VALUE_INPUT_SCHEMA)
|
|
13978
|
-
),
|
|
13979
|
-
"appearance.status-line-segments": executable(
|
|
13980
|
-
"appearance.status-line-segments",
|
|
13981
|
-
reversibleGlobal(
|
|
13982
|
-
"Read, reorder, enable, or disable status line segments.",
|
|
13983
|
-
STATUS_LINE_VALUE_INPUT_SCHEMA
|
|
13984
|
-
)
|
|
13985
|
-
),
|
|
13986
|
-
"providers.list": executable(
|
|
13987
|
-
"providers.list",
|
|
13988
|
-
readGlobal("List configured providers and enabled models without secrets.")
|
|
13989
|
-
),
|
|
13990
|
-
"providers.import-local": unavailable("providers.import-local", {
|
|
13991
|
-
...readGlobal("Scan local AI applications and import selected providers."),
|
|
13992
|
-
risk: "dangerous",
|
|
13993
|
-
reason: "The import flow may discover credentials and requires an explicit candidate review UI.",
|
|
13994
|
-
suggestedAction: "Open Model Providers and use Import from local apps."
|
|
13995
|
-
}),
|
|
13996
|
-
"providers.add": unavailable("providers.add", {
|
|
13997
|
-
...reversibleGlobal("Add a subscription or API-key provider."),
|
|
13998
|
-
risk: "dangerous",
|
|
13999
|
-
reason: "API keys must never enter Enso context; provider setup uses the protected setup flow.",
|
|
14000
|
-
suggestedAction: "Open Model Providers and choose Add model or provider."
|
|
14001
|
-
}),
|
|
14002
|
-
"providers.update": unavailable("providers.update", {
|
|
14003
|
-
...reversibleGlobal("Edit provider API settings."),
|
|
14004
|
-
reason: "Editing provider credentials could expose a plaintext key to Enso.",
|
|
14005
|
-
suggestedAction: "Edit the provider in Model Providers."
|
|
14006
|
-
}),
|
|
14007
|
-
"providers.remove": executable("providers.remove", {
|
|
14008
|
-
description: "Remove one provider entry; subscription entries are signed out first.",
|
|
14009
|
-
risk: "dangerous",
|
|
14010
|
-
targetContext: "global",
|
|
14011
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14012
|
-
}),
|
|
14013
|
-
"providers.fetch-models": executable("providers.fetch-models", {
|
|
14014
|
-
...readGlobal(
|
|
14015
|
-
"Fetch available model ids using an already configured provider.",
|
|
14016
|
-
PROVIDER_ID_INPUT_SCHEMA
|
|
14017
|
-
),
|
|
14018
|
-
availability: [{ kind: "configured-provider" }]
|
|
14019
|
-
}),
|
|
14020
|
-
"providers.test-connection": executable("providers.test-connection", {
|
|
14021
|
-
...readGlobal(
|
|
14022
|
-
"Test an already configured provider; this may make a minimal billable request.",
|
|
14023
|
-
MODEL_REF_INPUT_SCHEMA
|
|
14024
|
-
),
|
|
14025
|
-
risk: "dangerous",
|
|
14026
|
-
availability: [{ kind: "configured-provider" }]
|
|
14027
|
-
}),
|
|
14028
|
-
"providers.model-meta": executable(
|
|
14029
|
-
"providers.model-meta",
|
|
14030
|
-
readGlobal("Read cached or discoverable model capability metadata.", MODEL_REF_INPUT_SCHEMA)
|
|
14031
|
-
),
|
|
14032
|
-
"providers.toggle-provider": executable(
|
|
14033
|
-
"providers.toggle-provider",
|
|
14034
|
-
reversibleGlobal("Enable or disable one provider entry.", ID_ENABLED_INPUT_SCHEMA)
|
|
14035
|
-
),
|
|
14036
|
-
"providers.toggle-model": executable(
|
|
14037
|
-
"providers.toggle-model",
|
|
14038
|
-
reversibleGlobal("Enable or disable one model entry.", PROVIDER_MODEL_TOGGLE_INPUT_SCHEMA)
|
|
14039
|
-
),
|
|
14040
|
-
"providers.default-model": executable("providers.default-model", {
|
|
14041
|
-
...reversibleGlobal("Set or clear the global default model.", MODEL_REF_INPUT_SCHEMA),
|
|
14042
|
-
availability: [{ kind: "configured-provider" }]
|
|
14043
|
-
}),
|
|
14044
|
-
"providers.subagent-models": executable(
|
|
14045
|
-
"providers.subagent-models",
|
|
14046
|
-
readGlobal("List subagent model entries and whether the feature is enabled.")
|
|
14047
|
-
),
|
|
14048
|
-
"providers.subagent-models.toggle": executable(
|
|
14049
|
-
"providers.subagent-models.toggle",
|
|
14050
|
-
reversibleGlobal(
|
|
14051
|
-
"Enable or disable letting the agent pick subagent models.",
|
|
14052
|
-
BOOLEAN_VALUE_INPUT_SCHEMA
|
|
14053
|
-
)
|
|
14054
|
-
),
|
|
14055
|
-
"providers.subagent-models.add": executable(
|
|
14056
|
-
"providers.subagent-models.add",
|
|
14057
|
-
reversibleGlobal(
|
|
14058
|
-
"Add one subagent model entry with optional guidance text and reasoning override.",
|
|
14059
|
-
SUBAGENT_MODEL_ADD_INPUT_SCHEMA
|
|
14060
|
-
)
|
|
14061
|
-
),
|
|
14062
|
-
"providers.subagent-models.update": executable(
|
|
14063
|
-
"providers.subagent-models.update",
|
|
14064
|
-
reversibleGlobal(
|
|
14065
|
-
'Edit one subagent model entry; "follow" clears a reasoning override.',
|
|
14066
|
-
SUBAGENT_MODEL_UPDATE_INPUT_SCHEMA
|
|
14067
|
-
)
|
|
14068
|
-
),
|
|
14069
|
-
"providers.subagent-models.remove": executable("providers.subagent-models.remove", {
|
|
14070
|
-
...reversibleGlobal("Remove one subagent model entry.", ID_INPUT_SCHEMA)
|
|
14071
|
-
}),
|
|
14072
|
-
"providers.oauth.list": executable(
|
|
14073
|
-
"providers.oauth.list",
|
|
14074
|
-
readGlobal("List subscription providers and signed-in account metadata without tokens.")
|
|
14075
|
-
),
|
|
14076
|
-
"providers.oauth.login": executable("providers.oauth.login", {
|
|
14077
|
-
description: "Start the protected subscription authorization flow.",
|
|
14078
|
-
risk: "dangerous",
|
|
14079
|
-
targetContext: "origin-window",
|
|
14080
|
-
inputSchema: PROVIDER_ID_INPUT_SCHEMA,
|
|
14081
|
-
availability: [{ kind: "origin-window" }, { kind: "oauth-provider" }]
|
|
14082
|
-
}),
|
|
14083
|
-
"providers.oauth.logout": executable("providers.oauth.logout", {
|
|
14084
|
-
description: "Sign out one subscription account.",
|
|
14085
|
-
risk: "dangerous",
|
|
14086
|
-
targetContext: "global",
|
|
14087
|
-
inputSchema: ACCOUNT_INPUT_SCHEMA
|
|
14088
|
-
}),
|
|
14089
|
-
"providers.oauth.usage": executable(
|
|
14090
|
-
"providers.oauth.usage",
|
|
14091
|
-
readGlobal("Read subscription quota windows for one account.", ACCOUNT_INPUT_SCHEMA)
|
|
14092
|
-
),
|
|
14093
|
-
"providers.oauth.cancel-login": executable("providers.oauth.cancel-login", {
|
|
14094
|
-
description: "Cancel the active subscription authorization flow.",
|
|
14095
|
-
risk: "reversible",
|
|
14096
|
-
targetContext: "origin-window",
|
|
14097
|
-
availability: [{ kind: "origin-window" }]
|
|
14098
|
-
}),
|
|
14099
|
-
"providers.oauth.reopen-login": executable("providers.oauth.reopen-login", {
|
|
14100
|
-
description: "Reopen the authorization page for the active subscription login.",
|
|
14101
|
-
risk: "dangerous",
|
|
14102
|
-
targetContext: "origin-window",
|
|
14103
|
-
availability: [{ kind: "origin-window" }]
|
|
14104
|
-
}),
|
|
14105
|
-
"skills.list": executable("skills.list", readGlobal("List registered skills and enabled state.")),
|
|
14106
|
-
"skills.import-local": unavailable("skills.import-local", {
|
|
14107
|
-
...readGlobal("Scan local applications and import selected skills."),
|
|
14108
|
-
reason: "Import requires reviewing filesystem-derived candidates before registration.",
|
|
14109
|
-
suggestedAction: "Open Skills and use Import."
|
|
14110
|
-
}),
|
|
14111
|
-
"skills.toggle": executable(
|
|
14112
|
-
"skills.toggle",
|
|
14113
|
-
reversibleGlobal("Enable or disable a registered skill.", ID_ENABLED_INPUT_SCHEMA)
|
|
14114
|
-
),
|
|
14115
|
-
"skills.remove": executable("skills.remove", {
|
|
14116
|
-
description: "Remove a skill registration without deleting its source directory.",
|
|
14117
|
-
risk: "dangerous",
|
|
14118
|
-
targetContext: "global",
|
|
14119
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14120
|
-
}),
|
|
14121
|
-
"mcp.list": executable(
|
|
14122
|
-
"mcp.list",
|
|
14123
|
-
readGlobal("List MCP registrations without environment values.")
|
|
14124
|
-
),
|
|
14125
|
-
"mcp.import-local": unavailable("mcp.import-local", {
|
|
14126
|
-
...readGlobal("Scan local applications and import selected MCP registrations."),
|
|
14127
|
-
reason: "MCP imports may contain environment secrets and require a protected review flow.",
|
|
14128
|
-
suggestedAction: "Open MCP Servers and use Import."
|
|
14129
|
-
}),
|
|
14130
|
-
"mcp.edit": unavailable("mcp.edit", {
|
|
14131
|
-
...reversibleGlobal("Edit an MCP server registration."),
|
|
14132
|
-
reason: "MCP environment values must not enter Enso context.",
|
|
14133
|
-
suggestedAction: "Edit the server in MCP Servers."
|
|
14134
|
-
}),
|
|
14135
|
-
"mcp.toggle": executable(
|
|
14136
|
-
"mcp.toggle",
|
|
14137
|
-
reversibleGlobal("Enable or disable an MCP registration.", ID_ENABLED_INPUT_SCHEMA)
|
|
14138
|
-
),
|
|
14139
|
-
"mcp.remove": executable("mcp.remove", {
|
|
14140
|
-
description: "Remove an MCP server registration.",
|
|
14141
|
-
risk: "dangerous",
|
|
14142
|
-
targetContext: "global",
|
|
14143
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14144
|
-
}),
|
|
14145
|
-
"instructions.list": executable(
|
|
14146
|
-
"instructions.list",
|
|
14147
|
-
readGlobal("List registered instruction files and active state.")
|
|
14148
|
-
),
|
|
14149
|
-
"instructions.import-local": unavailable("instructions.import-local", {
|
|
14150
|
-
...readGlobal("Scan local applications and import instruction registrations."),
|
|
14151
|
-
reason: "Import requires reviewing filesystem-derived candidates before registration.",
|
|
14152
|
-
suggestedAction: "Open Instruction Files and use Import."
|
|
14153
|
-
}),
|
|
14154
|
-
"instructions.toggle": executable(
|
|
14155
|
-
"instructions.toggle",
|
|
14156
|
-
reversibleGlobal("Select the active instruction registration.", ID_ENABLED_INPUT_SCHEMA)
|
|
14157
|
-
),
|
|
14158
|
-
"instructions.read": executable(
|
|
14159
|
-
"instructions.read",
|
|
14160
|
-
readGlobal(
|
|
14161
|
-
"Read one registered instruction through its controlled registration id.",
|
|
14162
|
-
ID_INPUT_SCHEMA
|
|
14163
|
-
)
|
|
14164
|
-
),
|
|
14165
|
-
"instructions.edit-local-copy": executable(
|
|
14166
|
-
"instructions.edit-local-copy",
|
|
14167
|
-
reversibleGlobal(
|
|
14168
|
-
"Save content to the application-managed local instruction copy.",
|
|
14169
|
-
CONTENT_INPUT_SCHEMA
|
|
14170
|
-
)
|
|
14171
|
-
),
|
|
14172
|
-
"instructions.overwrite-source": unavailable("instructions.overwrite-source", {
|
|
14173
|
-
description: "Overwrite the original instruction source file.",
|
|
14174
|
-
risk: "dangerous",
|
|
14175
|
-
targetContext: "global",
|
|
14176
|
-
inputSchema: CONTENT_INPUT_SCHEMA,
|
|
14177
|
-
reason: "Enso is not allowed to write arbitrary source files.",
|
|
14178
|
-
suggestedAction: "Use Overwrite original in Instruction Files after reviewing the target path."
|
|
14179
|
-
}),
|
|
14180
|
-
"instructions.remove": executable("instructions.remove", {
|
|
14181
|
-
description: "Remove an instruction registration and its application-managed local copy.",
|
|
14182
|
-
risk: "dangerous",
|
|
14183
|
-
targetContext: "global",
|
|
14184
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14185
|
-
}),
|
|
14186
|
-
"presets.list": executable("presets.list", readGlobal("List injection presets.")),
|
|
14187
|
-
"presets.create": executable(
|
|
14188
|
-
"presets.create",
|
|
14189
|
-
reversibleGlobal(
|
|
14190
|
-
"Create an injection preset from registered asset ids.",
|
|
14191
|
-
PRESET_CREATE_INPUT_SCHEMA
|
|
14192
|
-
)
|
|
14193
|
-
),
|
|
14194
|
-
"presets.edit": executable(
|
|
14195
|
-
"presets.edit",
|
|
14196
|
-
reversibleGlobal("Edit an injection preset.", PRESET_EDIT_INPUT_SCHEMA)
|
|
14197
|
-
),
|
|
14198
|
-
"presets.delete": executable("presets.delete", {
|
|
14199
|
-
description: "Delete an injection preset.",
|
|
14200
|
-
risk: "dangerous",
|
|
14201
|
-
targetContext: "global",
|
|
14202
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14203
|
-
}),
|
|
14204
|
-
"presets.set-default": executable(
|
|
14205
|
-
"presets.set-default",
|
|
14206
|
-
reversibleGlobal(
|
|
14207
|
-
"Set the default preset applied to new conversations ('default' = built-in global preset).",
|
|
14208
|
-
ID_INPUT_SCHEMA
|
|
14209
|
-
)
|
|
14210
|
-
),
|
|
14211
|
-
"presets.select-for-conversation": unavailable("presets.select-for-conversation", {
|
|
14212
|
-
description: "Select the preset for the origin conversation.",
|
|
14213
|
-
risk: "reversible",
|
|
14214
|
-
targetContext: "origin-conversation",
|
|
14215
|
-
inputSchema: ID_INPUT_SCHEMA,
|
|
14216
|
-
availability: [{ kind: "origin-conversation" }],
|
|
14217
|
-
reason: "Source conversation configuration is not exposed through the Enso gateway in this release.",
|
|
14218
|
-
suggestedAction: "Choose the preset from the source conversation model controls."
|
|
14219
|
-
}),
|
|
14220
|
-
"agent-types.list": executable(
|
|
14221
|
-
"agent-types.list",
|
|
14222
|
-
readGlobal("List built-in and custom agent types.")
|
|
14223
|
-
),
|
|
14224
|
-
"agent-types.create": executable(
|
|
14225
|
-
"agent-types.create",
|
|
14226
|
-
reversibleGlobal("Create a custom agent type.", AGENT_TYPE_CREATE_INPUT_SCHEMA)
|
|
14227
|
-
),
|
|
14228
|
-
"agent-types.edit": executable(
|
|
14229
|
-
"agent-types.edit",
|
|
14230
|
-
reversibleGlobal("Edit a custom agent type.", AGENT_TYPE_EDIT_INPUT_SCHEMA)
|
|
14231
|
-
),
|
|
14232
|
-
"agent-types.toggle-builtin": executable(
|
|
14233
|
-
"agent-types.toggle-builtin",
|
|
14234
|
-
reversibleGlobal(
|
|
14235
|
-
"Enable or disable a built-in agent type.",
|
|
14236
|
-
BUILTIN_AGENT_TYPE_TOGGLE_INPUT_SCHEMA
|
|
14237
|
-
)
|
|
14238
|
-
),
|
|
14239
|
-
"agent-types.delete": executable("agent-types.delete", {
|
|
14240
|
-
description: "Delete a custom agent type.",
|
|
14241
|
-
risk: "dangerous",
|
|
14242
|
-
targetContext: "global",
|
|
14243
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14244
|
-
}),
|
|
14245
|
-
"tools.list": executable(
|
|
14246
|
-
"tools.list",
|
|
14247
|
-
readGlobal("List built-in coding tools and enabled state.")
|
|
14248
|
-
),
|
|
14249
|
-
"tools.toggle-builtin": executable(
|
|
14250
|
-
"tools.toggle-builtin",
|
|
14251
|
-
reversibleGlobal("Enable or disable a built-in coding tool.", BUILTIN_TOOL_TOGGLE_INPUT_SCHEMA)
|
|
14252
|
-
),
|
|
14253
|
-
"onboarding.complete": unavailable("onboarding.complete", {
|
|
14254
|
-
description: "Complete the first-run onboarding flow.",
|
|
14255
|
-
risk: "reversible",
|
|
14256
|
-
targetContext: "origin-window",
|
|
14257
|
-
reason: "Onboarding completion must follow the visible provider and project setup steps.",
|
|
14258
|
-
suggestedAction: "Finish the onboarding flow in its window."
|
|
14259
|
-
}),
|
|
14260
|
-
"projects.list": executable("projects.list", readGlobal("List registered projects and paths.")),
|
|
14261
|
-
"projects.recent": executable(
|
|
14262
|
-
"projects.recent",
|
|
14263
|
-
readGlobal("List recent projects discovered from local apps.")
|
|
14264
|
-
),
|
|
14265
|
-
"projects.add": unavailable("projects.add", {
|
|
14266
|
-
description: "Add a local directory as a project.",
|
|
14267
|
-
risk: "dangerous",
|
|
14268
|
-
targetContext: "origin-window",
|
|
14269
|
-
reason: "Project registration requires an explicit native directory selection.",
|
|
14270
|
-
suggestedAction: "Use Add project and choose the directory in the native picker."
|
|
14271
|
-
}),
|
|
14272
|
-
"projects.remove": executable("projects.remove", {
|
|
14273
|
-
description: "Remove a project and its conversations from the application list.",
|
|
14274
|
-
risk: "dangerous",
|
|
14275
|
-
targetContext: "global",
|
|
14276
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14277
|
-
}),
|
|
14278
|
-
"projects.ssh-connections": executable(
|
|
14279
|
-
"projects.ssh-connections",
|
|
14280
|
-
readGlobal("List SSH connection profiles without credentials.")
|
|
14281
|
-
),
|
|
14282
|
-
"projects.ssh-connections.add": unavailable("projects.ssh-connections.add", {
|
|
14283
|
-
...reversibleGlobal("Add an SSH connection profile."),
|
|
14284
|
-
risk: "dangerous",
|
|
14285
|
-
reason: "SSH passwords must never enter Enso context; profile setup uses the settings form.",
|
|
14286
|
-
suggestedAction: "Open Settings and add the SSH connection there."
|
|
14287
|
-
}),
|
|
14288
|
-
"projects.ssh-connections.update": unavailable("projects.ssh-connections.update", {
|
|
14289
|
-
...reversibleGlobal("Edit an SSH connection profile."),
|
|
14290
|
-
reason: "Editing host or credentials could redirect a stored password to an attacker-chosen host.",
|
|
14291
|
-
suggestedAction: "Edit the SSH connection in Settings."
|
|
14292
|
-
}),
|
|
14293
|
-
"projects.ssh-connections.remove": executable("projects.ssh-connections.remove", {
|
|
14294
|
-
description: "Remove one SSH connection profile; connections used by projects are protected.",
|
|
14295
|
-
risk: "dangerous",
|
|
14296
|
-
targetContext: "global",
|
|
14297
|
-
inputSchema: ID_INPUT_SCHEMA
|
|
14298
|
-
}),
|
|
14299
|
-
"projects.ssh-connections.test": executable("projects.ssh-connections.test", {
|
|
14300
|
-
...readGlobal("Test an SSH connection; this performs a real login attempt.", ID_INPUT_SCHEMA),
|
|
14301
|
-
risk: "dangerous"
|
|
14302
|
-
}),
|
|
14303
|
-
"conversations.list": executable(
|
|
14304
|
-
"conversations.list",
|
|
14305
|
-
readGlobal("List conversation metadata without injecting message history into Enso.")
|
|
14306
|
-
),
|
|
14307
|
-
"conversations.create": unavailable("conversations.create", {
|
|
14308
|
-
description: "Create a coding conversation in a project.",
|
|
14309
|
-
risk: "reversible",
|
|
14310
|
-
targetContext: "origin-project",
|
|
14311
|
-
reason: "Creating source coding sessions is not exposed through the Enso gateway in this release.",
|
|
14312
|
-
suggestedAction: "Use New conversation in the project sidebar."
|
|
14313
|
-
}),
|
|
14314
|
-
"conversations.select": unavailable("conversations.select", {
|
|
14315
|
-
description: "Select a coding conversation in the source window.",
|
|
14316
|
-
risk: "reversible",
|
|
14317
|
-
targetContext: "origin-window",
|
|
14318
|
-
reason: "Enso cannot take over source window navigation.",
|
|
14319
|
-
suggestedAction: "Select the conversation from the sidebar."
|
|
14320
|
-
}),
|
|
14321
|
-
"conversations.delete": unavailable("conversations.delete", {
|
|
14322
|
-
description: "Delete a coding conversation from the list.",
|
|
14323
|
-
risk: "dangerous",
|
|
14324
|
-
targetContext: "origin-conversation",
|
|
14325
|
-
reason: "Conversation deletion is not exposed through the Enso gateway in this release.",
|
|
14326
|
-
suggestedAction: "Use Delete conversation in the sidebar and confirm it."
|
|
14327
|
-
}),
|
|
14328
|
-
"conversations.import-external": unavailable("conversations.import-external", {
|
|
14329
|
-
description: "Import a conversation from another local AI application.",
|
|
14330
|
-
risk: "dangerous",
|
|
14331
|
-
targetContext: "origin-project",
|
|
14332
|
-
reason: "Import requires reviewing external session history in a dedicated UI.",
|
|
14333
|
-
suggestedAction: "Use Import session from the project menu."
|
|
14334
|
-
}),
|
|
14335
|
-
"conversations.send": unavailable("conversations.send", {
|
|
14336
|
-
description: "Send a message to the origin coding agent.",
|
|
14337
|
-
risk: "reversible",
|
|
14338
|
-
targetContext: "origin-conversation",
|
|
14339
|
-
reason: "Messages addressed to Enso must not be forwarded into the coding agent conversation.",
|
|
14340
|
-
suggestedAction: "Send the message directly in the coding conversation."
|
|
14341
|
-
}),
|
|
14342
|
-
"conversations.abort": unavailable("conversations.abort", {
|
|
14343
|
-
description: "Abort the origin coding agent turn.",
|
|
14344
|
-
risk: "dangerous",
|
|
14345
|
-
targetContext: "origin-conversation",
|
|
14346
|
-
reason: "Coding-agent lifecycle controls are not exposed through the Enso gateway.",
|
|
14347
|
-
suggestedAction: "Use Stop in the source conversation."
|
|
14348
|
-
}),
|
|
14349
|
-
"conversations.set-model": unavailable("conversations.set-model", {
|
|
14350
|
-
description: "Change the origin coding conversation model.",
|
|
14351
|
-
risk: "reversible",
|
|
14352
|
-
targetContext: "origin-conversation",
|
|
14353
|
-
reason: "Per-conversation model controls remain owned by the source conversation.",
|
|
14354
|
-
suggestedAction: "Use the model picker in the source conversation."
|
|
14355
|
-
}),
|
|
14356
|
-
"conversations.set-reasoning": unavailable("conversations.set-reasoning", {
|
|
14357
|
-
description: "Change reasoning mode for the origin conversation.",
|
|
14358
|
-
risk: "reversible",
|
|
14359
|
-
targetContext: "origin-conversation",
|
|
14360
|
-
reason: "Per-conversation reasoning controls remain owned by the source conversation.",
|
|
14361
|
-
suggestedAction: "Use the reasoning control in the source conversation."
|
|
14362
|
-
}),
|
|
14363
|
-
"conversations.set-thinking": unavailable("conversations.set-thinking", {
|
|
14364
|
-
description: "Change thinking level for the origin conversation.",
|
|
14365
|
-
risk: "reversible",
|
|
14366
|
-
targetContext: "origin-conversation",
|
|
14367
|
-
reason: "Per-conversation thinking controls remain owned by the source conversation.",
|
|
14368
|
-
suggestedAction: "Use the thinking control in the source conversation."
|
|
14369
|
-
}),
|
|
14370
|
-
"conversations.set-approval-mode": unavailable("conversations.set-approval-mode", {
|
|
14371
|
-
description: "Change coding-agent approval mode.",
|
|
14372
|
-
risk: "dangerous",
|
|
14373
|
-
targetContext: "origin-conversation",
|
|
14374
|
-
reason: "Enso must not weaken or inherit coding-agent approval policy.",
|
|
14375
|
-
suggestedAction: "Change approval mode directly in the source conversation."
|
|
14376
|
-
}),
|
|
14377
|
-
"conversations.approval.respond": unavailable("conversations.approval.respond", {
|
|
14378
|
-
description: "Allow or deny a pending coding-agent tool request.",
|
|
14379
|
-
risk: "dangerous",
|
|
14380
|
-
targetContext: "origin-conversation",
|
|
14381
|
-
reason: "Enso cannot impersonate the user when resolving coding-agent approvals.",
|
|
14382
|
-
suggestedAction: "Resolve the approval directly in the source conversation."
|
|
14383
|
-
}),
|
|
14384
|
-
"conversations.ask.respond": unavailable("conversations.ask.respond", {
|
|
14385
|
-
description: "Answer a pending question from the coding agent.",
|
|
14386
|
-
risk: "dangerous",
|
|
14387
|
-
targetContext: "origin-conversation",
|
|
14388
|
-
reason: "Enso cannot answer a coding-agent question on behalf of the user.",
|
|
14389
|
-
suggestedAction: "Answer the question directly in the source conversation."
|
|
14390
|
-
}),
|
|
14391
|
-
"conversations.background-task.stop": unavailable("conversations.background-task.stop", {
|
|
14392
|
-
description: "Stop a coding-agent background task.",
|
|
14393
|
-
risk: "dangerous",
|
|
14394
|
-
targetContext: "origin-conversation",
|
|
14395
|
-
reason: "Coding-agent process lifecycle controls are outside the Enso gateway.",
|
|
14396
|
-
suggestedAction: "Stop the task from the source conversation task panel."
|
|
14397
|
-
}),
|
|
14398
|
-
"conversations.file-mention.attach": unavailable("conversations.file-mention.attach", {
|
|
14399
|
-
description: "Search for and attach a project file mention.",
|
|
14400
|
-
risk: "read",
|
|
14401
|
-
targetContext: "origin-project",
|
|
14402
|
-
reason: "Enso only receives files explicitly selected by the user in the mention picker.",
|
|
14403
|
-
suggestedAction: "Attach the file with @ in the source composer."
|
|
14404
|
-
}),
|
|
14405
|
-
"conversations.queue.edit": unavailable("conversations.queue.edit", {
|
|
14406
|
-
description: "Edit a queued coding-agent message.",
|
|
14407
|
-
risk: "reversible",
|
|
14408
|
-
targetContext: "origin-conversation",
|
|
14409
|
-
reason: "Source message queues are not exposed through the Enso gateway.",
|
|
14410
|
-
suggestedAction: "Edit the queued message in the source conversation."
|
|
14411
|
-
}),
|
|
14412
|
-
"conversations.queue.remove": unavailable("conversations.queue.remove", {
|
|
14413
|
-
description: "Remove a queued coding-agent message.",
|
|
14414
|
-
risk: "reversible",
|
|
14415
|
-
targetContext: "origin-conversation",
|
|
14416
|
-
reason: "Source message queues are not exposed through the Enso gateway.",
|
|
14417
|
-
suggestedAction: "Remove the queued message in the source conversation."
|
|
14418
|
-
}),
|
|
14419
|
-
"conversations.queue.send-now": unavailable("conversations.queue.send-now", {
|
|
14420
|
-
description: "Send a queued coding-agent message immediately.",
|
|
14421
|
-
risk: "reversible",
|
|
14422
|
-
targetContext: "origin-conversation",
|
|
14423
|
-
reason: "Source message queues are not exposed through the Enso gateway.",
|
|
14424
|
-
suggestedAction: "Use Send now in the source conversation."
|
|
14425
|
-
}),
|
|
14426
|
-
"conversations.goal.set": unavailable("conversations.goal.set", {
|
|
14427
|
-
description: "Set a goal for the origin coding conversation.",
|
|
14428
|
-
risk: "reversible",
|
|
14429
|
-
targetContext: "origin-conversation",
|
|
14430
|
-
reason: "Coding session goal control is not exposed through the Enso gateway.",
|
|
14431
|
-
suggestedAction: "Use /goal in the source conversation."
|
|
14432
|
-
}),
|
|
14433
|
-
"conversations.goal.pause": unavailable("conversations.goal.pause", {
|
|
14434
|
-
description: "Pause the origin coding conversation goal.",
|
|
14435
|
-
risk: "reversible",
|
|
14436
|
-
targetContext: "origin-conversation",
|
|
14437
|
-
reason: "Coding session goal control is not exposed through the Enso gateway.",
|
|
14438
|
-
suggestedAction: "Pause the goal in the source conversation."
|
|
14439
|
-
}),
|
|
14440
|
-
"conversations.goal.resume": unavailable("conversations.goal.resume", {
|
|
14441
|
-
description: "Resume the origin coding conversation goal.",
|
|
14442
|
-
risk: "reversible",
|
|
14443
|
-
targetContext: "origin-conversation",
|
|
14444
|
-
reason: "Coding session goal control is not exposed through the Enso gateway.",
|
|
14445
|
-
suggestedAction: "Resume the goal in the source conversation."
|
|
14446
|
-
}),
|
|
14447
|
-
"conversations.goal.clear": unavailable("conversations.goal.clear", {
|
|
14448
|
-
description: "Clear the origin coding conversation goal.",
|
|
14449
|
-
risk: "reversible",
|
|
14450
|
-
targetContext: "origin-conversation",
|
|
14451
|
-
reason: "Coding session goal control is not exposed through the Enso gateway.",
|
|
14452
|
-
suggestedAction: "Clear the goal in the source conversation."
|
|
14453
|
-
}),
|
|
14454
|
-
"conversations.worktree.create": unavailable("conversations.worktree.create", {
|
|
14455
|
-
description: "Create an isolated git worktree for a conversation.",
|
|
14456
|
-
risk: "reversible",
|
|
14457
|
-
targetContext: "origin-conversation",
|
|
14458
|
-
reason: "Workspace isolation is a desktop-side decision, not an Enso capability.",
|
|
14459
|
-
suggestedAction: "Create the isolated session from the sidebar."
|
|
14460
|
-
}),
|
|
14461
|
-
"conversations.worktree.status": unavailable("conversations.worktree.status", {
|
|
14462
|
-
description: "Inspect worktree status (dirty / unmerged) of a conversation.",
|
|
14463
|
-
risk: "reversible",
|
|
14464
|
-
targetContext: "origin-conversation",
|
|
14465
|
-
reason: "Worktree status is surfaced in the sidebar, not through the gateway.",
|
|
14466
|
-
suggestedAction: "Check the session badges in the sidebar."
|
|
14467
|
-
}),
|
|
14468
|
-
"conversations.worktree.remove": unavailable("conversations.worktree.remove", {
|
|
14469
|
-
description: "Clean up the isolated worktree of a conversation.",
|
|
14470
|
-
risk: "dangerous",
|
|
14471
|
-
targetContext: "origin-conversation",
|
|
14472
|
-
reason: "Worktree cleanup may drop uncommitted work and requires user confirmation.",
|
|
14473
|
-
suggestedAction: "Use the session context menu to clean up the worktree."
|
|
14474
|
-
}),
|
|
14475
|
-
"conversations.worktree.rebuild": unavailable("conversations.worktree.rebuild", {
|
|
14476
|
-
description: "Rebuild a missing conversation worktree.",
|
|
14477
|
-
risk: "reversible",
|
|
14478
|
-
targetContext: "origin-conversation",
|
|
14479
|
-
reason: "Rebuild choices (branch vs fallback) belong to the user on resume.",
|
|
14480
|
-
suggestedAction: "Resume the conversation and choose rebuild or fallback."
|
|
14481
|
-
}),
|
|
14482
|
-
"conversations.worktree.release": unavailable("conversations.worktree.release", {
|
|
14483
|
-
description: "Release a live session for workspace migration.",
|
|
14484
|
-
risk: "dangerous",
|
|
14485
|
-
targetContext: "origin-conversation",
|
|
14486
|
-
reason: "Session release interrupts the running agent and is user-initiated only.",
|
|
14487
|
-
suggestedAction: "Use Move to worktree from the session context menu."
|
|
14488
|
-
}),
|
|
14489
|
-
"conversations.retry-turn": unavailable("conversations.retry-turn", {
|
|
14490
|
-
description: "Retry a failed origin coding-agent turn without sending a new user message.",
|
|
14491
|
-
risk: "reversible",
|
|
14492
|
-
targetContext: "origin-conversation",
|
|
14493
|
-
reason: "Coding-agent lifecycle controls are not exposed through the Enso gateway.",
|
|
14494
|
-
suggestedAction: "Use Retry on the failed turn in the source conversation."
|
|
14495
|
-
}),
|
|
14496
|
-
"conversations.rewind": unavailable("conversations.rewind", {
|
|
14497
|
-
description: "Rewind origin conversation history without restoring files.",
|
|
14498
|
-
risk: "dangerous",
|
|
14499
|
-
targetContext: "origin-conversation",
|
|
14500
|
-
reason: "Conversation history rewrites require review in the source timeline.",
|
|
14501
|
-
suggestedAction: "Use Rewind in the source conversation and confirm it."
|
|
14502
|
-
}),
|
|
14503
|
-
"conversations.rewind-files": unavailable("conversations.rewind-files", {
|
|
14504
|
-
description: "Rewind origin conversation history and restore project files.",
|
|
14505
|
-
risk: "dangerous",
|
|
14506
|
-
targetContext: "origin-conversation",
|
|
14507
|
-
reason: "Enso is not allowed to rewrite project files or checkpoints.",
|
|
14508
|
-
suggestedAction: "Use Conversation + files in the source timeline and confirm it."
|
|
14509
|
-
}),
|
|
14510
|
-
"team.list-agent-types": executable(
|
|
14511
|
-
"team.list-agent-types",
|
|
14512
|
-
readGlobal("List agent types available for team hiring.")
|
|
14513
|
-
),
|
|
14514
|
-
"team.list-coworkers": executable("team.list-coworkers", {
|
|
14515
|
-
description: "List coworkers belonging to the origin coding conversation.",
|
|
14516
|
-
risk: "read",
|
|
14517
|
-
targetContext: "origin-conversation",
|
|
14518
|
-
availability: [{ kind: "origin-conversation" }]
|
|
14519
|
-
}),
|
|
14520
|
-
"team.hire-coworker": executable("team.hire-coworker", {
|
|
14521
|
-
description: "Hire a coworker into the origin coding conversation.",
|
|
14522
|
-
risk: "dangerous",
|
|
14523
|
-
targetContext: "origin-conversation",
|
|
14524
|
-
inputSchema: HIRE_COWORKER_INPUT_SCHEMA,
|
|
14525
|
-
availability: [{ kind: "started-origin-conversation" }]
|
|
14526
|
-
}),
|
|
14527
|
-
"team.dismiss-coworker": executable("team.dismiss-coworker", {
|
|
14528
|
-
description: "Dismiss a coworker from the origin coding conversation.",
|
|
14529
|
-
risk: "dangerous",
|
|
14530
|
-
targetContext: "origin-conversation",
|
|
14531
|
-
inputSchema: DISMISS_COWORKER_INPUT_SCHEMA,
|
|
14532
|
-
availability: [{ kind: "started-origin-conversation" }]
|
|
14533
|
-
}),
|
|
14534
|
-
"team.message-coworker": unavailable("team.message-coworker", {
|
|
14535
|
-
description: "Send a direct message to an origin coworker.",
|
|
14536
|
-
risk: "reversible",
|
|
14537
|
-
targetContext: "origin-conversation",
|
|
14538
|
-
reason: "Direct coworker messaging is not a controlled Enso domain handler in this release.",
|
|
14539
|
-
suggestedAction: "Open the coworker tab and send the message there."
|
|
14540
|
-
}),
|
|
14541
|
-
"updates.status": unavailable("updates.status", {
|
|
14542
|
-
...readGlobal("Read current update availability and download status."),
|
|
14543
|
-
availability: [{ kind: "desktop-updater" }],
|
|
14544
|
-
reason: "Current status is only a renderer event projection; Main has no snapshot getter.",
|
|
14545
|
-
suggestedAction: "Open the Updates UI to view the current update status."
|
|
14546
|
-
}),
|
|
14547
|
-
"updates.check": executable("updates.check", {
|
|
14548
|
-
...readGlobal("Check the release feed for application updates."),
|
|
14549
|
-
availability: [{ kind: "desktop-updater" }]
|
|
14550
|
-
}),
|
|
14551
|
-
"updates.download": executable("updates.download", {
|
|
14552
|
-
description: "Download an available application update.",
|
|
14553
|
-
risk: "reversible",
|
|
14554
|
-
targetContext: "global",
|
|
14555
|
-
availability: [{ kind: "desktop-updater" }]
|
|
14556
|
-
}),
|
|
14557
|
-
"updates.install": unavailable("updates.install", {
|
|
14558
|
-
description: "Quit the application and install a downloaded update.",
|
|
14559
|
-
risk: "dangerous",
|
|
14560
|
-
targetContext: "global",
|
|
14561
|
-
availability: [{ kind: "desktop-updater" }],
|
|
14562
|
-
reason: "Enso cannot terminate or restart the application process in this release.",
|
|
14563
|
-
suggestedAction: "Use Restart and install from the update UI."
|
|
14564
|
-
}),
|
|
14565
|
-
"window.open-settings": unavailable("window.open-settings", {
|
|
14566
|
-
description: "Open the settings window.",
|
|
14567
|
-
risk: "reversible",
|
|
14568
|
-
targetContext: "origin-window",
|
|
14569
|
-
reason: "Window navigation is intentionally outside the Enso execution gateway.",
|
|
14570
|
-
suggestedAction: "Open Settings from the sidebar or keyboard shortcut."
|
|
14571
|
-
}),
|
|
14572
|
-
"window.focus-conversation-notification": unavailable("window.focus-conversation-notification", {
|
|
14573
|
-
description: "Focus a conversation after clicking its system notification.",
|
|
14574
|
-
risk: "reversible",
|
|
14575
|
-
targetContext: "origin-window",
|
|
14576
|
-
reason: "Notification focus is a direct window navigation action.",
|
|
14577
|
-
suggestedAction: "Click the system notification or select the conversation in the sidebar."
|
|
14578
|
-
}),
|
|
14579
|
-
"window.minimize": unavailable("window.minimize", {
|
|
14580
|
-
description: "Minimize the origin window.",
|
|
14581
|
-
risk: "reversible",
|
|
14582
|
-
targetContext: "origin-window",
|
|
14583
|
-
reason: "Window controls are intentionally outside the Enso execution gateway.",
|
|
14584
|
-
suggestedAction: "Use the window title bar controls."
|
|
14585
|
-
}),
|
|
14586
|
-
"window.maximize": unavailable("window.maximize", {
|
|
14587
|
-
description: "Maximize or restore the origin window.",
|
|
14588
|
-
risk: "reversible",
|
|
14589
|
-
targetContext: "origin-window",
|
|
14590
|
-
reason: "Window controls are intentionally outside the Enso execution gateway.",
|
|
14591
|
-
suggestedAction: "Use the window title bar controls."
|
|
14592
|
-
}),
|
|
14593
|
-
"window.close": unavailable("window.close", {
|
|
14594
|
-
description: "Close the origin window.",
|
|
14595
|
-
risk: "dangerous",
|
|
14596
|
-
targetContext: "origin-window",
|
|
14597
|
-
reason: "Enso cannot close application windows.",
|
|
14598
|
-
suggestedAction: "Use the window title bar close control."
|
|
14599
|
-
}),
|
|
14600
|
-
"window.toggle-sidebar": unavailable("window.toggle-sidebar", {
|
|
14601
|
-
description: "Expand or collapse the project sidebar.",
|
|
14602
|
-
risk: "reversible",
|
|
14603
|
-
targetContext: "origin-window",
|
|
14604
|
-
reason: "Per-window layout controls remain direct UI actions.",
|
|
14605
|
-
suggestedAction: "Use the sidebar toggle button or shortcut."
|
|
14606
|
-
}),
|
|
14607
|
-
"window.fullscreen": unavailable("window.fullscreen", {
|
|
14608
|
-
description: "Enter or leave fullscreen.",
|
|
14609
|
-
risk: "reversible",
|
|
14610
|
-
targetContext: "origin-window",
|
|
14611
|
-
reason: "Window controls are intentionally outside the Enso execution gateway.",
|
|
14612
|
-
suggestedAction: "Use the operating-system fullscreen control."
|
|
14613
|
-
}),
|
|
14614
|
-
"coding-tools.command": unavailable("coding-tools.command", {
|
|
14615
|
-
description: "Run an arbitrary shell command.",
|
|
14616
|
-
risk: "dangerous",
|
|
14617
|
-
targetContext: "origin-project",
|
|
14618
|
-
reason: "Enso never receives a shell command tool.",
|
|
14619
|
-
suggestedAction: "Ask the coding agent in the project conversation."
|
|
14620
|
-
}),
|
|
14621
|
-
"coding-tools.file-read": unavailable("coding-tools.file-read", {
|
|
14622
|
-
description: "Read an arbitrary project file.",
|
|
14623
|
-
risk: "read",
|
|
14624
|
-
targetContext: "origin-project",
|
|
14625
|
-
reason: "Enso only receives immutable snapshots from explicit file mentions.",
|
|
14626
|
-
suggestedAction: "Mention the file explicitly with @file or ask the coding agent."
|
|
14627
|
-
}),
|
|
14628
|
-
"coding-tools.file-search": unavailable("coding-tools.file-search", {
|
|
14629
|
-
description: "Search arbitrary project files.",
|
|
14630
|
-
risk: "read",
|
|
14631
|
-
targetContext: "origin-project",
|
|
14632
|
-
reason: "Enso has no general filesystem search tool.",
|
|
14633
|
-
suggestedAction: "Ask the coding agent to search the project."
|
|
14634
|
-
}),
|
|
14635
|
-
"coding-tools.file-edit": unavailable("coding-tools.file-edit", {
|
|
14636
|
-
description: "Edit a project file.",
|
|
14637
|
-
risk: "dangerous",
|
|
14638
|
-
targetContext: "origin-project",
|
|
14639
|
-
reason: "Enso is not allowed to modify project files.",
|
|
14640
|
-
suggestedAction: "Ask the coding agent to make the change."
|
|
14641
|
-
}),
|
|
14642
|
-
"coding-tools.file-write": unavailable("coding-tools.file-write", {
|
|
14643
|
-
description: "Create or overwrite a project file.",
|
|
14644
|
-
risk: "dangerous",
|
|
14645
|
-
targetContext: "origin-project",
|
|
14646
|
-
reason: "Enso is not allowed to modify project files.",
|
|
14647
|
-
suggestedAction: "Ask the coding agent to create or write the file."
|
|
14648
|
-
}),
|
|
14649
|
-
"coding-tools.mcp": unavailable("coding-tools.mcp", {
|
|
14650
|
-
description: "Call an arbitrary MCP tool.",
|
|
14651
|
-
risk: "dangerous",
|
|
14652
|
-
targetContext: "origin-project",
|
|
14653
|
-
reason: "Enso does not receive arbitrary MCP tools.",
|
|
14654
|
-
suggestedAction: "Use the coding agent session with the required MCP server enabled."
|
|
14655
|
-
}),
|
|
14656
|
-
"coding-tools.subagent": unavailable("coding-tools.subagent", {
|
|
14657
|
-
description: "Delegate an arbitrary coding subtask to a subagent.",
|
|
14658
|
-
risk: "dangerous",
|
|
14659
|
-
targetContext: "origin-conversation",
|
|
14660
|
-
reason: "Enso does not receive the general subagent tool.",
|
|
14661
|
-
suggestedAction: "Ask the coding agent to delegate the coding task."
|
|
14662
|
-
}),
|
|
14663
|
-
"coding-tools.workflow": unavailable("coding-tools.workflow", {
|
|
14664
|
-
description: "Run a JavaScript workflow that fans work out across subagents.",
|
|
14665
|
-
risk: "dangerous",
|
|
14666
|
-
targetContext: "origin-conversation",
|
|
14667
|
-
reason: "Enso does not receive the coding-session workflow tool.",
|
|
14668
|
-
suggestedAction: "Ask the coding agent to run the workflow."
|
|
14669
|
-
}),
|
|
14670
|
-
"coding-tools.coworker": unavailable("coding-tools.coworker", {
|
|
14671
|
-
description: "Use the unrestricted coworker tool.",
|
|
14672
|
-
risk: "dangerous",
|
|
14673
|
-
targetContext: "origin-conversation",
|
|
14674
|
-
reason: "Enso only uses origin-bound team handlers, never the raw coworker tool.",
|
|
14675
|
-
suggestedAction: "Use team.list-coworkers, team.hire-coworker, or team.dismiss-coworker."
|
|
14676
|
-
}),
|
|
14677
|
-
"coding-tools.todo": unavailable("coding-tools.todo", {
|
|
14678
|
-
description: "Manage a coding agent todo list.",
|
|
14679
|
-
risk: "reversible",
|
|
14680
|
-
targetContext: "origin-conversation",
|
|
14681
|
-
reason: "Coding todo state belongs to the coding agent session.",
|
|
14682
|
-
suggestedAction: "Ask the coding agent to update its todo list."
|
|
14683
|
-
}),
|
|
14684
|
-
"coding-tools.ask-user": unavailable("coding-tools.ask-user", {
|
|
14685
|
-
description: "Use the coding agent ask_user tool.",
|
|
14686
|
-
risk: "read",
|
|
14687
|
-
targetContext: "origin-conversation",
|
|
14688
|
-
reason: "Enso has its own clarification channel and does not invoke the coding agent tool.",
|
|
14689
|
-
suggestedAction: "Answer Enso directly or continue in the coding conversation."
|
|
14690
|
-
}),
|
|
14691
|
-
"coding-tools.background-task": unavailable("coding-tools.background-task", {
|
|
14692
|
-
description: "Run a background shell task.",
|
|
14693
|
-
risk: "dangerous",
|
|
14694
|
-
targetContext: "origin-project",
|
|
14695
|
-
reason: "Enso never receives command or background process tools.",
|
|
14696
|
-
suggestedAction: "Ask the coding agent to run the background task."
|
|
14697
|
-
}),
|
|
14698
|
-
"coding-tools.browser": unavailable("coding-tools.browser", {
|
|
14699
|
-
description: "Browse pages in Enso's built-in browser.",
|
|
14700
|
-
risk: "dangerous",
|
|
14701
|
-
targetContext: "origin-project",
|
|
14702
|
-
reason: "Enso never receives browsing or page-interaction tools.",
|
|
14703
|
-
suggestedAction: "Ask the coding agent to use the built-in browser."
|
|
14704
|
-
}),
|
|
14705
|
-
"coding-tools.web": unavailable("coding-tools.web", {
|
|
14706
|
-
description: "Search the public web and fetch pages.",
|
|
14707
|
-
risk: "read",
|
|
14708
|
-
targetContext: "origin-project",
|
|
14709
|
-
reason: "Enso never receives the coding-session web tools.",
|
|
14710
|
-
suggestedAction: "Ask the coding agent to search or fetch the page."
|
|
14711
|
-
}),
|
|
14712
|
-
"coding-tools.isolated-sandbox": unavailable("coding-tools.isolated-sandbox", {
|
|
14713
|
-
description: "Run JavaScript that calls coding-session tools, including edits.",
|
|
14714
|
-
risk: "dangerous",
|
|
14715
|
-
targetContext: "origin-project",
|
|
14716
|
-
reason: "Enso never receives the coding-session isolated sandbox.",
|
|
14717
|
-
suggestedAction: "Ask the coding agent to use the isolated sandbox."
|
|
14718
|
-
}),
|
|
14719
|
-
"coding-tools.memory": unavailable("coding-tools.memory", {
|
|
14720
|
-
description: "Search and capture durable memories across coding sessions.",
|
|
14721
|
-
risk: "dangerous",
|
|
14722
|
-
targetContext: "origin-project",
|
|
14723
|
-
reason: "Enso never receives the coding-session memory tools.",
|
|
14724
|
-
suggestedAction: "Ask the coding agent to search or capture the memory."
|
|
14725
|
-
}),
|
|
14726
|
-
"coding-tools.computer": unavailable("coding-tools.computer", {
|
|
14727
|
-
description: "Operate the host desktop with screenshots, accessibility, and input.",
|
|
14728
|
-
risk: "dangerous",
|
|
14729
|
-
targetContext: "origin-project",
|
|
14730
|
-
reason: "Enso never receives host-desktop computer tools.",
|
|
14731
|
-
suggestedAction: "Ask the coding agent to use the computer tool."
|
|
14732
|
-
}),
|
|
14733
|
-
"coding-tools.plan": unavailable("coding-tools.plan", {
|
|
14734
|
-
description: "Research read-only and submit an implementation plan for user approval.",
|
|
14735
|
-
risk: "read",
|
|
14736
|
-
targetContext: "origin-project",
|
|
14737
|
-
reason: "Enso never receives the coding-session plan mode tools.",
|
|
14738
|
-
suggestedAction: "Turn on plan mode in the coding session composer."
|
|
14739
|
-
})
|
|
14740
|
-
};
|
|
14741
|
-
const CAPABILITY_HANDLER_CONTRACT = {
|
|
14742
|
-
"general.language": true,
|
|
14743
|
-
"general.load-local-skills": true,
|
|
14744
|
-
"general.load-harness-assets": true,
|
|
14745
|
-
"general.windows-local-shell": true,
|
|
14746
|
-
"general.terminal-shell": true,
|
|
14747
|
-
"general.worktree-root": true,
|
|
14748
|
-
"general.automatic-updates": true,
|
|
14749
|
-
"general.proxy-mode": true,
|
|
14750
|
-
"general.custom-proxy-url": true,
|
|
14751
|
-
"general.keybindings.list": true,
|
|
14752
|
-
"general.keybindings.set": true,
|
|
14753
|
-
"general.keybindings.reset": true,
|
|
14754
|
-
"appearance.theme": true,
|
|
14755
|
-
"appearance.accent": true,
|
|
14756
|
-
"appearance.terminal-theme": true,
|
|
14757
|
-
"appearance.terminal-font-size": true,
|
|
14758
|
-
"appearance.terminal-font-family": true,
|
|
14759
|
-
"appearance.terminal-font-weight": true,
|
|
14760
|
-
"appearance.terminal-bold-weight": true,
|
|
14761
|
-
"appearance.favorite-terminal-themes": true,
|
|
14762
|
-
"appearance.status-line-segments": true,
|
|
14763
|
-
"providers.list": true,
|
|
14764
|
-
"providers.remove": true,
|
|
14765
|
-
"providers.fetch-models": true,
|
|
14766
|
-
"providers.test-connection": true,
|
|
14767
|
-
"providers.model-meta": true,
|
|
14768
|
-
"providers.toggle-provider": true,
|
|
14769
|
-
"providers.toggle-model": true,
|
|
14770
|
-
"providers.default-model": true,
|
|
14771
|
-
"providers.subagent-models": true,
|
|
14772
|
-
"providers.subagent-models.toggle": true,
|
|
14773
|
-
"providers.subagent-models.add": true,
|
|
14774
|
-
"providers.subagent-models.update": true,
|
|
14775
|
-
"providers.subagent-models.remove": true,
|
|
14776
|
-
"providers.oauth.list": true,
|
|
14777
|
-
"providers.oauth.login": true,
|
|
14778
|
-
"providers.oauth.logout": true,
|
|
14779
|
-
"providers.oauth.usage": true,
|
|
14780
|
-
"providers.oauth.cancel-login": true,
|
|
14781
|
-
"providers.oauth.reopen-login": true,
|
|
14782
|
-
"skills.list": true,
|
|
14783
|
-
"skills.toggle": true,
|
|
14784
|
-
"skills.remove": true,
|
|
14785
|
-
"mcp.list": true,
|
|
14786
|
-
"mcp.toggle": true,
|
|
14787
|
-
"mcp.remove": true,
|
|
14788
|
-
"instructions.list": true,
|
|
14789
|
-
"instructions.toggle": true,
|
|
14790
|
-
"instructions.read": true,
|
|
14791
|
-
"instructions.edit-local-copy": true,
|
|
14792
|
-
"instructions.remove": true,
|
|
14793
|
-
"presets.list": true,
|
|
14794
|
-
"presets.create": true,
|
|
14795
|
-
"presets.edit": true,
|
|
14796
|
-
"presets.delete": true,
|
|
14797
|
-
"presets.set-default": true,
|
|
14798
|
-
"agent-types.list": true,
|
|
14799
|
-
"agent-types.create": true,
|
|
14800
|
-
"agent-types.edit": true,
|
|
14801
|
-
"agent-types.toggle-builtin": true,
|
|
14802
|
-
"agent-types.delete": true,
|
|
14803
|
-
"tools.list": true,
|
|
14804
|
-
"tools.toggle-builtin": true,
|
|
14805
|
-
"projects.list": true,
|
|
14806
|
-
"projects.recent": true,
|
|
14807
|
-
"projects.remove": true,
|
|
14808
|
-
"projects.ssh-connections": true,
|
|
14809
|
-
"projects.ssh-connections.remove": true,
|
|
14810
|
-
"projects.ssh-connections.test": true,
|
|
14811
|
-
"conversations.list": true,
|
|
14812
|
-
"team.list-agent-types": true,
|
|
14813
|
-
"team.list-coworkers": true,
|
|
14814
|
-
"team.hire-coworker": true,
|
|
14815
|
-
"team.dismiss-coworker": true,
|
|
14816
|
-
"updates.check": true,
|
|
14817
|
-
"updates.download": true
|
|
14818
|
-
};
|
|
14819
13782
|
const MAX_URL_LENGTH = 2048;
|
|
14820
13783
|
const MAX_REDIRECTS = 5;
|
|
14821
13784
|
const MAX_BODY_BYTES = 5 * 1024 * 1024;
|
|
@@ -14872,6 +13835,7 @@ async function assertPublicHost(url, lookup2) {
|
|
|
14872
13835
|
if (host === "localhost" || host.endsWith(".localhost")) throw blocked();
|
|
14873
13836
|
const addresses = isIP(host) ? [host] : await lookup2(host);
|
|
14874
13837
|
if (addresses.length === 0 || !addresses.every(isPublicAddress)) throw blocked();
|
|
13838
|
+
return addresses;
|
|
14875
13839
|
}
|
|
14876
13840
|
function classify(contentType) {
|
|
14877
13841
|
const mime = contentType.split(";")[0]?.trim().toLowerCase() ?? "";
|
|
@@ -14960,54 +13924,64 @@ function htmlToMarkdown(html, base) {
|
|
|
14960
13924
|
return { ...title ? { title } : {}, markdown };
|
|
14961
13925
|
}
|
|
14962
13926
|
async function webFetch(input, options, deps = {}) {
|
|
14963
|
-
const fetchImpl = deps.fetch ?? ((url2, init) => fetch(url2, init));
|
|
14964
13927
|
const lookup2 = deps.lookup ?? systemLookup;
|
|
14965
13928
|
const timeout = AbortSignal.timeout(TIMEOUT_MS);
|
|
14966
13929
|
const signal = options.signal ? AbortSignal.any([options.signal, timeout]) : timeout;
|
|
13930
|
+
const dispatchers = [];
|
|
13931
|
+
const fetchHop = (url2, addresses, init) => {
|
|
13932
|
+
if (deps.fetch) return deps.fetch(url2.href, init);
|
|
13933
|
+
return fetchWebResource(url2, addresses, init, (dispatcher) => {
|
|
13934
|
+
dispatchers.push(dispatcher);
|
|
13935
|
+
});
|
|
13936
|
+
};
|
|
14967
13937
|
let url = validateFetchUrl(input);
|
|
14968
13938
|
let response;
|
|
14969
|
-
|
|
14970
|
-
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
|
|
14985
|
-
|
|
13939
|
+
try {
|
|
13940
|
+
for (let hop = 0; ; hop++) {
|
|
13941
|
+
const addresses = await assertPublicHost(url, lookup2);
|
|
13942
|
+
response = await fetchHop(url, addresses, {
|
|
13943
|
+
redirect: "manual",
|
|
13944
|
+
signal,
|
|
13945
|
+
headers: {
|
|
13946
|
+
"user-agent": USER_AGENT,
|
|
13947
|
+
accept: "text/html,application/xhtml+xml,text/markdown;q=0.9,text/plain;q=0.8,application/json;q=0.8,*/*;q=0.5",
|
|
13948
|
+
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8"
|
|
13949
|
+
}
|
|
13950
|
+
});
|
|
13951
|
+
const location = response.headers.get("location");
|
|
13952
|
+
if (response.status < 300 || response.status >= 400 || !location) break;
|
|
13953
|
+
await response.body?.cancel().catch(() => {
|
|
13954
|
+
});
|
|
13955
|
+
if (hop >= MAX_REDIRECTS) throw new Error(`Stopped after ${MAX_REDIRECTS} redirects`);
|
|
13956
|
+
url = validateFetchUrl(new URL(location, url).href);
|
|
13957
|
+
}
|
|
13958
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
13959
|
+
const kind = classify(contentType);
|
|
13960
|
+
if (!kind) {
|
|
13961
|
+
await response.body?.cancel().catch(() => {
|
|
13962
|
+
});
|
|
13963
|
+
throw new Error(`Unsupported content type: ${contentType.split(";")[0]?.trim()}`);
|
|
13964
|
+
}
|
|
13965
|
+
const { bytes, cut } = await readCapped(response);
|
|
13966
|
+
const raw = decode(bytes, contentType, kind);
|
|
13967
|
+
const page = kind === "html" ? htmlToMarkdown(raw, url.href) : { markdown: raw };
|
|
13968
|
+
const full = page.markdown;
|
|
13969
|
+
const offset = Math.min(Math.max(0, Math.floor(options.offset ?? 0)), full.length);
|
|
13970
|
+
const end = offset + PAGE_CHARS;
|
|
13971
|
+
return {
|
|
13972
|
+
url: url.href,
|
|
13973
|
+
status: response.status,
|
|
13974
|
+
contentType: contentType.split(";")[0]?.trim() ?? "",
|
|
13975
|
+
...page.title ? { title: page.title } : {},
|
|
13976
|
+
text: full.slice(offset, end),
|
|
13977
|
+
offset,
|
|
13978
|
+
totalChars: full.length,
|
|
13979
|
+
...end < full.length ? { nextOffset: end } : {},
|
|
13980
|
+
bodyCut: cut
|
|
13981
|
+
};
|
|
13982
|
+
} finally {
|
|
13983
|
+
await Promise.all(dispatchers.map((dispatcher) => dispatcher.destroy()));
|
|
14986
13984
|
}
|
|
14987
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
14988
|
-
const kind = classify(contentType);
|
|
14989
|
-
if (!kind) {
|
|
14990
|
-
await response.body?.cancel().catch(() => {
|
|
14991
|
-
});
|
|
14992
|
-
throw new Error(`Unsupported content type: ${contentType.split(";")[0]?.trim()}`);
|
|
14993
|
-
}
|
|
14994
|
-
const { bytes, cut } = await readCapped(response);
|
|
14995
|
-
const raw = decode(bytes, contentType, kind);
|
|
14996
|
-
const page = kind === "html" ? htmlToMarkdown(raw, url.href) : { markdown: raw };
|
|
14997
|
-
const full = page.markdown;
|
|
14998
|
-
const offset = Math.min(Math.max(0, Math.floor(options.offset ?? 0)), full.length);
|
|
14999
|
-
const end = offset + PAGE_CHARS;
|
|
15000
|
-
return {
|
|
15001
|
-
url: url.href,
|
|
15002
|
-
status: response.status,
|
|
15003
|
-
contentType: contentType.split(";")[0]?.trim() ?? "",
|
|
15004
|
-
...page.title ? { title: page.title } : {},
|
|
15005
|
-
text: full.slice(offset, end),
|
|
15006
|
-
offset,
|
|
15007
|
-
totalChars: full.length,
|
|
15008
|
-
...end < full.length ? { nextOffset: end } : {},
|
|
15009
|
-
bodyCut: cut
|
|
15010
|
-
};
|
|
15011
13985
|
}
|
|
15012
13986
|
function formatFetchResult(result2) {
|
|
15013
13987
|
const lines = [`Fetched ${result2.url} (HTTP ${result2.status})`];
|
|
@@ -16535,46 +15509,46 @@ function builtinPresets() {
|
|
|
16535
15509
|
return builtinCache;
|
|
16536
15510
|
}
|
|
16537
15511
|
export {
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
|
|
16552
|
-
|
|
15512
|
+
ensureAccountProvider as $,
|
|
15513
|
+
AGENT_WORKER_CRASH_FILE as A,
|
|
15514
|
+
buildObservationsRecordedData as B,
|
|
15515
|
+
buildReflectionsRecordedData as C,
|
|
15516
|
+
buildReflectionsConsolidatedData as D,
|
|
15517
|
+
buildObservationsDroppedData as E,
|
|
15518
|
+
readModelsDevCache as F,
|
|
15519
|
+
version as G,
|
|
15520
|
+
parseModelDirectorySnapshot as H,
|
|
15521
|
+
findCatalogModelById as I,
|
|
15522
|
+
findModelsDevModel as J,
|
|
15523
|
+
mergeCatalogEntry as K,
|
|
15524
|
+
resolveCustomModelCapabilities as L,
|
|
15525
|
+
closestMatchHint as M,
|
|
15526
|
+
mcpTimeoutMsOrDefault as N,
|
|
16553
15527
|
OM_OBSERVATIONS_RECORDED as O,
|
|
16554
15528
|
PatchMutationUncertainError as P,
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
15529
|
+
oneLine as Q,
|
|
15530
|
+
mcpNamespaceName as R,
|
|
15531
|
+
assignMcpToolNames as S,
|
|
15532
|
+
MCP_OAUTH_REFRESH_SKEW_MS as T,
|
|
15533
|
+
mcpOAuthFingerprint as U,
|
|
16560
15534
|
VIRTUAL_PROVIDER_ID as V,
|
|
16561
|
-
|
|
16562
|
-
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16570
|
-
|
|
16571
|
-
|
|
16572
|
-
|
|
16573
|
-
|
|
16574
|
-
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
15535
|
+
DEFAULT_MCP_CONNECT_TIMEOUT_MS as W,
|
|
15536
|
+
DEFAULT_MCP_CALL_TIMEOUT_MS as X,
|
|
15537
|
+
isXaiChatModelId as Y,
|
|
15538
|
+
transcriptMessages as Z,
|
|
15539
|
+
projectMessage as _,
|
|
15540
|
+
APPLY_PATCH_PROMPT_GUIDELINES as a,
|
|
15541
|
+
buildRollingTitleUserText as a$,
|
|
15542
|
+
takeSnapshotTail as a0,
|
|
15543
|
+
attachBackgroundCommandHooks as a1,
|
|
15544
|
+
ForegroundDetachedError as a2,
|
|
15545
|
+
withHardenedEnv as a3,
|
|
15546
|
+
childProfileShell as a4,
|
|
15547
|
+
withDetachableExec as a5,
|
|
15548
|
+
ELEVATE_ASKPASS_ENV as a6,
|
|
15549
|
+
buildElevatedCommand as a7,
|
|
15550
|
+
ELEVATE_DECLINED_MARKER as a8,
|
|
15551
|
+
ELEVATE_TIMED_OUT_MARKER as a9,
|
|
16578
15552
|
CoworkerIdleReminder as aA,
|
|
16579
15553
|
createUnifiedSubagentTool as aB,
|
|
16580
15554
|
workflowPresetRoots as aC,
|
|
@@ -16599,14 +15573,14 @@ export {
|
|
|
16599
15573
|
parseJsonFromAssistant as aV,
|
|
16600
15574
|
validateAgainstSchema as aW,
|
|
16601
15575
|
appendYieldJson as aX,
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16605
|
-
|
|
16606
|
-
|
|
16607
|
-
|
|
16608
|
-
|
|
16609
|
-
|
|
15576
|
+
appendCappedLog as aY,
|
|
15577
|
+
AGENT_COMPACTION_LOG as aZ,
|
|
15578
|
+
describeTitleModel as a_,
|
|
15579
|
+
ELEVATE_TIMEOUT_MS as aa,
|
|
15580
|
+
ELEVATE_UNAVAILABLE_MARKER as ab,
|
|
15581
|
+
expandSkillCommands as ac,
|
|
15582
|
+
CODEMODE_FORBIDDEN_TOOLS as ad,
|
|
15583
|
+
normalizeTaskCheck as ae,
|
|
16610
15584
|
validateFetchUrl as af,
|
|
16611
15585
|
isPublicAddress as ag,
|
|
16612
15586
|
throwUnlessAllowed as ah,
|
|
@@ -16628,18 +15602,18 @@ export {
|
|
|
16628
15602
|
ApprovalGate as ax,
|
|
16629
15603
|
HUMAN_REQUEST_TIMEOUT_MS as ay,
|
|
16630
15604
|
TodoStaleReminder as az,
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
|
|
16641
|
-
|
|
16642
|
-
|
|
15605
|
+
emptyUsage as b,
|
|
15606
|
+
writeModelsDevCache as b$,
|
|
15607
|
+
buildInitialTitleUserText as b0,
|
|
15608
|
+
ROLLING_TITLE_SYSTEM_PROMPT as b1,
|
|
15609
|
+
TITLE_SYSTEM_PROMPT as b2,
|
|
15610
|
+
extractTitle as b3,
|
|
15611
|
+
titleRejectReason as b4,
|
|
15612
|
+
WORKSPACE_WRITE_TOOL_ID as b5,
|
|
15613
|
+
resolveChildReasoning as b6,
|
|
15614
|
+
pickChildReasoningOverride as b7,
|
|
15615
|
+
createWebTools as b8,
|
|
15616
|
+
createTodoTool as b9,
|
|
16643
15617
|
extractEditTargetPath as bA,
|
|
16644
15618
|
buildSshShellCommand as bB,
|
|
16645
15619
|
resolveSshControlPath as bC,
|
|
@@ -16651,42 +15625,42 @@ export {
|
|
|
16651
15625
|
syncAccountProviders as bI,
|
|
16652
15626
|
expandOauthCatalog as bJ,
|
|
16653
15627
|
supportsMultipleAccounts as bK,
|
|
16654
|
-
|
|
16655
|
-
|
|
16656
|
-
|
|
16657
|
-
|
|
16658
|
-
|
|
16659
|
-
|
|
15628
|
+
parseCodexAuthJson as bL,
|
|
15629
|
+
CODEX_PROVIDER_ID as bM,
|
|
15630
|
+
nextAccountKey as bN,
|
|
15631
|
+
sanitizeUpstreamBody as bO,
|
|
15632
|
+
defaultCodexAuthPath as bP,
|
|
15633
|
+
ordinalOfAccountKey as bQ,
|
|
16660
15634
|
sanitizeOauthLabel as bR,
|
|
16661
|
-
|
|
16662
|
-
|
|
16663
|
-
|
|
15635
|
+
parseAntigravityApiKey as bS,
|
|
15636
|
+
fetchAntigravityUsage as bT,
|
|
15637
|
+
fetchDevinUsage as bU,
|
|
16664
15638
|
DEFAULT_PERSONA_PROMPT as bV,
|
|
16665
|
-
|
|
16666
|
-
|
|
15639
|
+
parseAgentWorkerCrash as bW,
|
|
15640
|
+
AGENT_WORKER_EXIT_LOG as bX,
|
|
16667
15641
|
elevatedCommandOf as bY,
|
|
16668
15642
|
startOauthCallbackServer as bZ,
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16683
|
-
|
|
16684
|
-
|
|
16685
|
-
|
|
16686
|
-
|
|
16687
|
-
|
|
16688
|
-
|
|
16689
|
-
|
|
15643
|
+
MODELS_DEV_URL as b_,
|
|
15644
|
+
withPlanGate as ba,
|
|
15645
|
+
createSubmitPlanTool as bb,
|
|
15646
|
+
titleSummaryTimeoutMs as bc,
|
|
15647
|
+
splitUnattendedPrefix as bd,
|
|
15648
|
+
resolveHarnessSkillRoots as be,
|
|
15649
|
+
approvalReviewResultExtension as bf,
|
|
15650
|
+
readHarnessRuleFiles as bg,
|
|
15651
|
+
replacePersonaParagraph as bh,
|
|
15652
|
+
createProjectSettingsManager as bi,
|
|
15653
|
+
ANTIGRAVITY_PROVIDER_ID as bj,
|
|
15654
|
+
antigravityProviderConfig as bk,
|
|
15655
|
+
DEVIN_PROVIDER_ID as bl,
|
|
15656
|
+
devinProviderConfig as bm,
|
|
15657
|
+
QODER_PROVIDER_ID as bn,
|
|
15658
|
+
qoderProviderConfig as bo,
|
|
15659
|
+
QODER_CN_PROVIDER_ID as bp,
|
|
15660
|
+
installCodexLinkedRefresh as bq,
|
|
15661
|
+
isHeadlessRun as br,
|
|
15662
|
+
withBackground as bs,
|
|
15663
|
+
withProtectedFloor as bt,
|
|
16690
15664
|
loadWorkflowPreset as bu,
|
|
16691
15665
|
cloneModelsDevOauthModel as bv,
|
|
16692
15666
|
withWriteScope as bw,
|
|
@@ -16694,118 +15668,111 @@ export {
|
|
|
16694
15668
|
validateApplyPatchTargets as by,
|
|
16695
15669
|
withAgentRead as bz,
|
|
16696
15670
|
charsToTokens as c,
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
15671
|
+
isSecretFilePath as c$,
|
|
15672
|
+
parseModelsDevPayload as c0,
|
|
15673
|
+
MODELS_DEV_CACHE_NAME as c1,
|
|
16700
15674
|
modelsDevIsFresh as c2,
|
|
16701
|
-
|
|
16702
|
-
|
|
16703
|
-
|
|
16704
|
-
|
|
16705
|
-
|
|
15675
|
+
withModelsDevOauthModels as c3,
|
|
15676
|
+
describeAgentWorkerExit as c4,
|
|
15677
|
+
directMemberRef as c5,
|
|
15678
|
+
materializeProviders as c6,
|
|
15679
|
+
parseVirtualModels as c7,
|
|
16706
15680
|
classifierProviderFor as c8,
|
|
16707
15681
|
classifierBaseUrlFor as c9,
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16719
|
-
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
|
|
16749
|
-
|
|
16750
|
-
|
|
16751
|
-
|
|
16752
|
-
|
|
16753
|
-
|
|
16754
|
-
|
|
16755
|
-
|
|
16756
|
-
|
|
16757
|
-
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16761
|
-
|
|
16762
|
-
|
|
16763
|
-
|
|
16764
|
-
|
|
16765
|
-
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
isHumanRequestTimeout as dj,
|
|
16782
|
-
listProjectCodeSources as dk,
|
|
16783
|
-
buildSshPtyArgs as dl,
|
|
16784
|
-
parseTerminalShell as dm,
|
|
16785
|
-
ENSO_HEADLESS_RUN_ENV as dn,
|
|
16786
|
-
ssh as dp,
|
|
16787
|
-
projection as dq,
|
|
15682
|
+
KG_MAX_RELATIONS as cA,
|
|
15683
|
+
KG_EXTRACT_MAX_TOKENS as cB,
|
|
15684
|
+
KG_DEFAULT_RELATION_TYPE as cC,
|
|
15685
|
+
KG_DEFAULT_ENTITY_TYPE as cD,
|
|
15686
|
+
KG_MAX_ATTEMPTS as cE,
|
|
15687
|
+
MIN_FLOOR as cF,
|
|
15688
|
+
IMP_MULT as cG,
|
|
15689
|
+
RECENCY_W as cH,
|
|
15690
|
+
FREQUENCY_W as cI,
|
|
15691
|
+
FREQUENCY_MAX_COUNT as cJ,
|
|
15692
|
+
HALF_LIFE_DAYS as cK,
|
|
15693
|
+
RRF_K as cL,
|
|
15694
|
+
DECAY_WEIGHT as cM,
|
|
15695
|
+
TEMPORAL_YEAR_BOOST as cN,
|
|
15696
|
+
CRYSTAL_BOOST as cO,
|
|
15697
|
+
MMR_LAMBDA as cP,
|
|
15698
|
+
parseMemorySearchRequest as cQ,
|
|
15699
|
+
parseMemoryCaptureRequest as cR,
|
|
15700
|
+
parseMemoryCrystallizeRequest as cS,
|
|
15701
|
+
parseMemoryDeleteRequest as cT,
|
|
15702
|
+
SNAPSHOT_TAIL_MESSAGES as cU,
|
|
15703
|
+
userTextWithoutSkills as cV,
|
|
15704
|
+
resolveSshTarget as cW,
|
|
15705
|
+
checkPassed as cX,
|
|
15706
|
+
checkFailureText as cY,
|
|
15707
|
+
parseVirtualClassifier as cZ,
|
|
15708
|
+
VIRTUAL_CLASSIFIER_DEFAULT_TIMEOUT_MS as c_,
|
|
15709
|
+
childProfileToolIds as ca,
|
|
15710
|
+
pickModelCapabilityOverrides as cb,
|
|
15711
|
+
canBeVirtualMember as cc,
|
|
15712
|
+
mcpTimeoutsForSpawn as cd,
|
|
15713
|
+
withPrivacyMask as ce,
|
|
15714
|
+
withUserEntryIds as cf,
|
|
15715
|
+
UNIT_TYPES as cg,
|
|
15716
|
+
DEDUP_MIN_CHARS as ch,
|
|
15717
|
+
DEFAULT_IMPORTANCE as ci,
|
|
15718
|
+
DEFAULT_UNIT_TYPE as cj,
|
|
15719
|
+
isEvolvesRelation as ck,
|
|
15720
|
+
DEDUP_MAX as cl,
|
|
15721
|
+
DEDUP_VECTOR as cm,
|
|
15722
|
+
CRYSTAL_MIN_SOURCES as cn,
|
|
15723
|
+
DISTILL_MAX_OUTPUT_TOKENS as co,
|
|
15724
|
+
DISTILL_MIN_IMPORTANCE as cp,
|
|
15725
|
+
DISTILL_MAX_CHUNK_CHARS as cq,
|
|
15726
|
+
DISTILL_SINGLE_EXTRACT_MAX_TOKENS as cr,
|
|
15727
|
+
DISTILL_EXTRACT_MAX_TOKENS as cs,
|
|
15728
|
+
DISTILL_CONSOLIDATE_MAX_TOKENS as ct,
|
|
15729
|
+
isUnitType as cu,
|
|
15730
|
+
DISTILL_MAX_ATTEMPTS as cv,
|
|
15731
|
+
KG_MAX_LABEL_CHARS as cw,
|
|
15732
|
+
KG_MAX_ENTITY_NAME_CHARS as cx,
|
|
15733
|
+
KG_MAX_DESCRIPTION_CHARS as cy,
|
|
15734
|
+
KG_MAX_ENTITIES as cz,
|
|
15735
|
+
skillOccupancyText as d,
|
|
15736
|
+
isUnderSecretDirectory as d0,
|
|
15737
|
+
codemodeToolSnapshot as d1,
|
|
15738
|
+
estimateToolsTotal as d2,
|
|
15739
|
+
listCustomWorkflowPresets as d3,
|
|
15740
|
+
listBuiltinWorkflowPresets as d4,
|
|
15741
|
+
readCustomWorkflowPreset as d5,
|
|
15742
|
+
parseWorkflowPresetDraft as d6,
|
|
15743
|
+
saveCustomWorkflowPreset as d7,
|
|
15744
|
+
deleteCustomWorkflowPreset as d8,
|
|
15745
|
+
isHumanRequestTimeout as d9,
|
|
15746
|
+
buildSshExecArgs as da,
|
|
15747
|
+
buildRemoteCommand as db,
|
|
15748
|
+
listProjectCodeSources as dc,
|
|
15749
|
+
positiveFiniteNumber as dd,
|
|
15750
|
+
mergeFetchedOauthModels as de,
|
|
15751
|
+
supportedProjectThinkingLevels as df,
|
|
15752
|
+
buildSshPtyArgs as dg,
|
|
15753
|
+
ENSO_HEADLESS_RUN_ENV as dh,
|
|
15754
|
+
projection as di,
|
|
16788
15755
|
executeApplyPatch as e,
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
15756
|
+
estimateToolTokens as f,
|
|
15757
|
+
estimateSkillTokens as g,
|
|
15758
|
+
estimateInstructionTokens as h,
|
|
15759
|
+
OM_REFLECTIONS_RECORDED as i,
|
|
15760
|
+
isObservationsRecordedData as j,
|
|
16794
15761
|
killProcessTree as k,
|
|
16795
|
-
|
|
16796
|
-
|
|
15762
|
+
isReflectionsRecordedData as l,
|
|
15763
|
+
isReflectionsConsolidatedData as m,
|
|
16797
15764
|
normalizeApplyPatchArguments as n,
|
|
16798
|
-
|
|
15765
|
+
isObservationsDroppedData as o,
|
|
16799
15766
|
providerKeyFor as p,
|
|
16800
|
-
|
|
16801
|
-
|
|
15767
|
+
OM_REFLECTIONS_CONSOLIDATED as q,
|
|
15768
|
+
OM_OBSERVATIONS_DROPPED as r,
|
|
16802
15769
|
shellQuote as s,
|
|
16803
15770
|
toolOccupancyText as t,
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
15771
|
+
OM_FOLDED as u,
|
|
15772
|
+
isMemoryDetails as v,
|
|
15773
|
+
isObservationsRecordedEntry as w,
|
|
15774
|
+
isReflectionsRecordedEntry as x,
|
|
15775
|
+
isReflectionsConsolidatedEntry as y,
|
|
15776
|
+
isObservationsDroppedEntry as z
|
|
16810
15777
|
};
|
|
16811
|
-
//# sourceMappingURL=workflowPresets-
|
|
15778
|
+
//# sourceMappingURL=workflowPresets-DQ3QX6Ju.js.map
|