@namzu/cli 41.1.1 → 41.2.1
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/CHANGELOG.md +26 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-ZNDDGL4A.js → acp-MCDCWJ45.js} +39 -39
- package/dist/chunks/{activity-command-IGRDHYFY.js → activity-command-AYLW5EEX.js} +12 -12
- package/dist/chunks/{add-DKDPH2O7.js → add-VNM5QPTX.js} +15 -15
- package/dist/chunks/{agent-5MAZW7PD.js → agent-4IMOBJR5.js} +30 -30
- package/dist/chunks/agent-session-44AYNTQJ.js +59 -0
- package/dist/chunks/{archive-3PH42KH6.js → archive-VXJWPZBA.js} +10 -10
- package/dist/chunks/{bin-main-YJBHUBGV.js → bin-main-BMCDNDGC.js} +3 -3
- package/dist/chunks/{browser-DYA5FWWB.js → browser-7MVCQL2G.js} +6 -6
- package/dist/chunks/{chat-W7G4NIMV.js → chat-M2WFCRYV.js} +15 -15
- package/dist/chunks/{chunk-M7TGNC4F.js → chunk-2LLNCAZS.js} +2 -2
- package/dist/chunks/{chunk-2F4BARJH.js → chunk-2Q6PBTPY.js} +2 -2
- package/dist/chunks/{chunk-5ND5QQDO.js → chunk-3ZMECJLN.js} +13 -13
- package/dist/chunks/{chunk-VEB3EYJK.js → chunk-4I5FGMVR.js} +2 -2
- package/dist/chunks/{chunk-ITSVWCSR.js → chunk-5L7ZQ37R.js} +6 -6
- package/dist/chunks/{chunk-MOUJITK2.js → chunk-5LGZUFDJ.js} +3 -3
- package/dist/chunks/{chunk-GR7FEYP5.js → chunk-5XWYY63Z.js} +4 -4
- package/dist/chunks/{chunk-NWTFQJZI.js → chunk-6FSVNUBA.js} +375 -230
- package/dist/chunks/chunk-6FSVNUBA.js.map +6 -0
- package/dist/chunks/{chunk-KSWPRDI2.js → chunk-7A5TVBGS.js} +2 -2
- package/dist/chunks/{chunk-3RSNEZOX.js → chunk-7RBZS3TN.js} +4 -4
- package/dist/chunks/{chunk-DSW5QXUB.js → chunk-AGRFKHS2.js} +4 -4
- package/dist/chunks/{chunk-R5FI7ST2.js → chunk-AVSE45ED.js} +4 -4
- package/dist/chunks/{chunk-RVEF2EUC.js → chunk-AYCKJIVD.js} +2 -2
- package/dist/chunks/{chunk-S7L7KHGT.js → chunk-C4CVM56Z.js} +4 -4
- package/dist/chunks/{chunk-VJZ4NHWX.js → chunk-CN6EFAK5.js} +2 -2
- package/dist/chunks/{chunk-P7PEG3T2.js → chunk-DAJBZ4B7.js} +2 -2
- package/dist/chunks/{chunk-HPBQLE3Y.js → chunk-DAUWDTZI.js} +2 -2
- package/dist/chunks/{chunk-6DY377DD.js → chunk-DTNJTMWP.js} +90 -30
- package/dist/chunks/chunk-DTNJTMWP.js.map +6 -0
- package/dist/chunks/{chunk-FVHJPEJU.js → chunk-DVRRRNSA.js} +8 -8
- package/dist/chunks/{chunk-ZZIK6J3Q.js → chunk-EYBTANG5.js} +6 -6
- package/dist/chunks/{chunk-VYJUJQ4H.js → chunk-F2UUHEPY.js} +2 -2
- package/dist/chunks/{chunk-VHSRFBTI.js → chunk-G7JH3PMC.js} +2 -2
- package/dist/chunks/{chunk-Z37S7NJH.js → chunk-GD6LOX4A.js} +13 -13
- package/dist/chunks/{chunk-HKY44MS7.js → chunk-H3ALHXFV.js} +12 -12
- package/dist/chunks/{chunk-FTBXHPCM.js → chunk-HV7PRPHJ.js} +7 -7
- package/dist/chunks/{chunk-LSHPFJKI.js → chunk-HWAPKOAW.js} +4 -4
- package/dist/chunks/{chunk-ABTQVE2K.js → chunk-IBCA2WDM.js} +3 -3
- package/dist/chunks/{chunk-7Y6IIRSM.js → chunk-IBUFD2HH.js} +2 -2
- package/dist/chunks/{chunk-XTSD7XEF.js → chunk-IMFIQJM6.js} +3 -3
- package/dist/chunks/{chunk-UJVN6557.js → chunk-IQBKDY6G.js} +3 -3
- package/dist/chunks/{chunk-EAQJSEKA.js → chunk-KDZ6GM2A.js} +2 -2
- package/dist/chunks/{chunk-E5FAPPFH.js → chunk-KEKFOEEP.js} +2 -2
- package/dist/chunks/{chunk-TBQRTGCQ.js → chunk-KGKRKFB7.js} +2 -2
- package/dist/chunks/{chunk-TTEKFLTN.js → chunk-KTF5NW2V.js} +8 -8
- package/dist/chunks/{chunk-BO4VL25F.js → chunk-L2MEW4AZ.js} +2 -2
- package/dist/chunks/{chunk-G5747QGU.js → chunk-LETTT4ZZ.js} +2 -2
- package/dist/chunks/{chunk-LXGH4QBJ.js → chunk-LRDLJTYP.js} +9 -9
- package/dist/chunks/{chunk-PJQJZFYF.js → chunk-MCUV6EI7.js} +2 -2
- package/dist/chunks/{chunk-ELVAEMBF.js → chunk-MSKJK6NZ.js} +3 -3
- package/dist/chunks/{chunk-L3NHCRUZ.js → chunk-N457UJQL.js} +2 -2
- package/dist/chunks/{chunk-7AAONVMX.js → chunk-O3CIRAYD.js} +5 -5
- package/dist/chunks/{chunk-5CF5NKWH.js → chunk-O7VKAFEU.js} +2 -2
- package/dist/chunks/{chunk-P4BH5CLU.js → chunk-PWGJB2WA.js} +4 -4
- package/dist/chunks/{chunk-RT7XM57Q.js → chunk-PXEHKMLO.js} +4 -4
- package/dist/chunks/{chunk-4OHKGKUE.js → chunk-QWFD2LFU.js} +4 -4
- package/dist/chunks/{chunk-BPLY6HCD.js → chunk-QYA34YM5.js} +4 -4
- package/dist/chunks/{chunk-VXJFOQIO.js → chunk-RI57PEYF.js} +4 -4
- package/dist/chunks/{chunk-XKFG3473.js → chunk-RPKRLR3O.js} +3 -3
- package/dist/chunks/{chunk-PUXPTJMD.js → chunk-TIFSH2BH.js} +7 -7
- package/dist/chunks/{chunk-OS33YOPX.js → chunk-TSKCIC5T.js} +2 -2
- package/dist/chunks/{chunk-GFBEQZGH.js → chunk-TZDYMWYP.js} +3 -3
- package/dist/chunks/{chunk-TRX6W6TD.js → chunk-UHDKUVR5.js} +2 -2
- package/dist/chunks/{chunk-56MTJMCE.js → chunk-VD4D37MT.js} +3 -3
- package/dist/chunks/{chunk-YL2SBQDK.js → chunk-VHXXNM6W.js} +3 -3
- package/dist/chunks/{chunk-72SF2UK7.js → chunk-WYUJ4USW.js} +2 -2
- package/dist/chunks/{chunk-64BXKXCY.js → chunk-X4BCXODL.js} +5 -5
- package/dist/chunks/{chunk-2X5QU773.js → chunk-XSAS6TS2.js} +3 -3
- package/dist/chunks/{chunk-MIPMLOJ4.js → chunk-Y37JJJVY.js} +3 -3
- package/dist/chunks/{chunk-24CZYMWP.js → chunk-YAOKLAUU.js} +2 -2
- package/dist/chunks/{chunk-XBEW7SQB.js → chunk-YBOKKRHB.js} +6 -6
- package/dist/chunks/{chunk-7UHIIE6W.js → chunk-YZW6H2LD.js} +30 -30
- package/dist/chunks/{chunk-KES7QU4W.js → chunk-Z2WGX7UM.js} +3 -3
- package/dist/chunks/{chunk-UOPSAWJE.js → chunk-ZPNX25RU.js} +5 -5
- package/dist/chunks/{cli-runtime-CBVA2QU3.js → cli-runtime-Q6BW37I2.js} +10 -10
- package/dist/chunks/{commands-7KVEJYKS.js → commands-C5I7PC7W.js} +5 -5
- package/dist/chunks/{crash-report-NXFD4VH5.js → crash-report-DRT5OCHO.js} +6 -6
- package/dist/chunks/{dist-FRHHWOOW.js → dist-2NWJAAJM.js} +2 -2
- package/dist/chunks/{dist-CUCXA33N.js → dist-5JM4UMVC.js} +2 -2
- package/dist/chunks/{dist-VQIK2TS3.js → dist-D7WSQBE7.js} +2 -2
- package/dist/chunks/{dist-KURG5KLO.js → dist-PRTI23W3.js} +2 -2
- package/dist/chunks/{dist-JZXBY5D3.js → dist-T2N57REG.js} +2 -2
- package/dist/chunks/{dist-6LIEN5YB.js → dist-VJC5RCYZ.js} +2 -2
- package/dist/chunks/{dist-HTMWZWBC.js → dist-WO56PFGZ.js} +2 -2
- package/dist/chunks/{doctor-B3TR2C6U.js → doctor-HXKU6QKJ.js} +8 -8
- package/dist/chunks/{drain-YWRSLFBO.js → drain-MLRRMEGK.js} +10 -10
- package/dist/chunks/{eval-BP6U5TEX.js → eval-ECOECG74.js} +2 -2
- package/dist/chunks/{exec-Y6TR57J4.js → exec-JLB6F5ZR.js} +28 -28
- package/dist/chunks/{home-HVHU4PVC.js → home-G65CC45B.js} +3 -3
- package/dist/chunks/{host-queries-W7ATBLK2.js → host-queries-7LKGEBO5.js} +15 -15
- package/dist/chunks/{learn-WM5TTHUD.js → learn-NRY6X2K6.js} +13 -13
- package/dist/chunks/{learn-builtin-RXNSBTBC.js → learn-builtin-QOM4KLT2.js} +16 -16
- package/dist/chunks/{lifecycle-SHRBIHQV.js → lifecycle-BI2PMV4Q.js} +24 -24
- package/dist/chunks/{list-WB7ULXJM.js → list-QTWALT6F.js} +11 -11
- package/dist/chunks/{login-PDYMJ6JR.js → login-7LJG7D3F.js} +8 -8
- package/dist/chunks/{logs-5X7RTN2P.js → logs-UGMCEFAZ.js} +4 -4
- package/dist/chunks/{mcp-R4ZVPY23.js → mcp-KOZOXU6J.js} +16 -16
- package/dist/chunks/{message-command-PHYRUQCA.js → message-command-7B5OFSGL.js} +36 -36
- package/dist/chunks/{operator-tools-VBLGZWBL.js → operator-tools-PWBZHKXO.js} +13 -13
- package/dist/chunks/{output-schema-4H5YYW34.js → output-schema-QPHXNRKI.js} +3 -3
- package/dist/chunks/{pal-7LGE7ORS.js → pal-XSD45IR6.js} +11 -11
- package/dist/chunks/{providers-APLUKR7Z.js → providers-ULPGYRWC.js} +6 -6
- package/dist/chunks/{resident-COJTHT7K.js → resident-NY7XSEK7.js} +24 -24
- package/dist/chunks/resume-4FV66TEK.js +23 -0
- package/dist/chunks/{resume-command-CCEBJXTF.js → resume-command-DLOW7MYW.js} +4 -4
- package/dist/chunks/{schedule-3MVCIZZS.js → schedule-QR7JOA4F.js} +8 -8
- package/dist/chunks/{service-OAKQZBBF.js → service-CLLR5VUD.js} +23 -23
- package/dist/chunks/session-step-IEMT6LRR.js +30 -0
- package/dist/chunks/{skills-ZXEEIGHF.js → skills-OZZLTH6P.js} +8 -8
- package/dist/chunks/{state-ETXYDF3L.js → state-EROTPJRH.js} +2 -2
- package/dist/chunks/{store-MKUMQQBF.js → store-C24DXKO4.js} +6 -6
- package/dist/chunks/{store-ODVHN3VE.js → store-ROEYUKBM.js} +4 -4
- package/dist/chunks/{store-HJFAIW4G.js → store-VDQRT2KF.js} +10 -10
- package/dist/chunks/{tui-WTLNGZ3U.js → tui-XBQCRSIJ.js} +171 -84
- package/dist/chunks/tui-XBQCRSIJ.js.map +6 -0
- package/dist/chunks/{upgrade-OV2AFIZR.js → upgrade-ZRQZD2N2.js} +2 -2
- package/dist/chunks/{worktree-3QCDPF3N.js → worktree-XMJ355ND.js} +12 -12
- package/dist/index.js +12 -12
- package/dist/integrations/resident/runner-worker.js +20 -20
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/PlanApprovalOverlay.d.ts.map +1 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/compaction-rows.d.ts +13 -0
- package/dist/tui/compaction-rows.d.ts.map +1 -1
- package/dist/tui/display-path.d.ts +12 -0
- package/dist/tui/display-path.d.ts.map +1 -1
- package/dist/tui/per-call-review.d.ts.map +1 -1
- package/dist/tui/permission-review.d.ts +9 -0
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/resume-empty.d.ts +14 -0
- package/dist/tui/resume-empty.d.ts.map +1 -0
- package/dist/tui/tidy-tool-output.d.ts +2 -0
- package/dist/tui/tidy-tool-output.d.ts.map +1 -1
- package/dist/tui/tool-end-rows.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunks/agent-session-SY5BWKNS.js +0 -59
- package/dist/chunks/chunk-6DY377DD.js.map +0 -6
- package/dist/chunks/chunk-NWTFQJZI.js.map +0 -6
- package/dist/chunks/resume-DL73LUH6.js +0 -23
- package/dist/chunks/session-step-HOLKYCG2.js +0 -30
- package/dist/chunks/tui-WTLNGZ3U.js.map +0 -6
- /package/dist/chunks/{acp-ZNDDGL4A.js.map → acp-MCDCWJ45.js.map} +0 -0
- /package/dist/chunks/{activity-command-IGRDHYFY.js.map → activity-command-AYLW5EEX.js.map} +0 -0
- /package/dist/chunks/{add-DKDPH2O7.js.map → add-VNM5QPTX.js.map} +0 -0
- /package/dist/chunks/{agent-5MAZW7PD.js.map → agent-4IMOBJR5.js.map} +0 -0
- /package/dist/chunks/{agent-session-SY5BWKNS.js.map → agent-session-44AYNTQJ.js.map} +0 -0
- /package/dist/chunks/{archive-3PH42KH6.js.map → archive-VXJWPZBA.js.map} +0 -0
- /package/dist/chunks/{bin-main-YJBHUBGV.js.map → bin-main-BMCDNDGC.js.map} +0 -0
- /package/dist/chunks/{browser-DYA5FWWB.js.map → browser-7MVCQL2G.js.map} +0 -0
- /package/dist/chunks/{chat-W7G4NIMV.js.map → chat-M2WFCRYV.js.map} +0 -0
- /package/dist/chunks/{chunk-M7TGNC4F.js.map → chunk-2LLNCAZS.js.map} +0 -0
- /package/dist/chunks/{chunk-2F4BARJH.js.map → chunk-2Q6PBTPY.js.map} +0 -0
- /package/dist/chunks/{chunk-5ND5QQDO.js.map → chunk-3ZMECJLN.js.map} +0 -0
- /package/dist/chunks/{chunk-VEB3EYJK.js.map → chunk-4I5FGMVR.js.map} +0 -0
- /package/dist/chunks/{chunk-ITSVWCSR.js.map → chunk-5L7ZQ37R.js.map} +0 -0
- /package/dist/chunks/{chunk-MOUJITK2.js.map → chunk-5LGZUFDJ.js.map} +0 -0
- /package/dist/chunks/{chunk-GR7FEYP5.js.map → chunk-5XWYY63Z.js.map} +0 -0
- /package/dist/chunks/{chunk-KSWPRDI2.js.map → chunk-7A5TVBGS.js.map} +0 -0
- /package/dist/chunks/{chunk-3RSNEZOX.js.map → chunk-7RBZS3TN.js.map} +0 -0
- /package/dist/chunks/{chunk-DSW5QXUB.js.map → chunk-AGRFKHS2.js.map} +0 -0
- /package/dist/chunks/{chunk-R5FI7ST2.js.map → chunk-AVSE45ED.js.map} +0 -0
- /package/dist/chunks/{chunk-RVEF2EUC.js.map → chunk-AYCKJIVD.js.map} +0 -0
- /package/dist/chunks/{chunk-S7L7KHGT.js.map → chunk-C4CVM56Z.js.map} +0 -0
- /package/dist/chunks/{chunk-VJZ4NHWX.js.map → chunk-CN6EFAK5.js.map} +0 -0
- /package/dist/chunks/{chunk-P7PEG3T2.js.map → chunk-DAJBZ4B7.js.map} +0 -0
- /package/dist/chunks/{chunk-HPBQLE3Y.js.map → chunk-DAUWDTZI.js.map} +0 -0
- /package/dist/chunks/{chunk-FVHJPEJU.js.map → chunk-DVRRRNSA.js.map} +0 -0
- /package/dist/chunks/{chunk-ZZIK6J3Q.js.map → chunk-EYBTANG5.js.map} +0 -0
- /package/dist/chunks/{chunk-VYJUJQ4H.js.map → chunk-F2UUHEPY.js.map} +0 -0
- /package/dist/chunks/{chunk-VHSRFBTI.js.map → chunk-G7JH3PMC.js.map} +0 -0
- /package/dist/chunks/{chunk-Z37S7NJH.js.map → chunk-GD6LOX4A.js.map} +0 -0
- /package/dist/chunks/{chunk-HKY44MS7.js.map → chunk-H3ALHXFV.js.map} +0 -0
- /package/dist/chunks/{chunk-FTBXHPCM.js.map → chunk-HV7PRPHJ.js.map} +0 -0
- /package/dist/chunks/{chunk-LSHPFJKI.js.map → chunk-HWAPKOAW.js.map} +0 -0
- /package/dist/chunks/{chunk-ABTQVE2K.js.map → chunk-IBCA2WDM.js.map} +0 -0
- /package/dist/chunks/{chunk-7Y6IIRSM.js.map → chunk-IBUFD2HH.js.map} +0 -0
- /package/dist/chunks/{chunk-XTSD7XEF.js.map → chunk-IMFIQJM6.js.map} +0 -0
- /package/dist/chunks/{chunk-UJVN6557.js.map → chunk-IQBKDY6G.js.map} +0 -0
- /package/dist/chunks/{chunk-EAQJSEKA.js.map → chunk-KDZ6GM2A.js.map} +0 -0
- /package/dist/chunks/{chunk-E5FAPPFH.js.map → chunk-KEKFOEEP.js.map} +0 -0
- /package/dist/chunks/{chunk-TBQRTGCQ.js.map → chunk-KGKRKFB7.js.map} +0 -0
- /package/dist/chunks/{chunk-TTEKFLTN.js.map → chunk-KTF5NW2V.js.map} +0 -0
- /package/dist/chunks/{chunk-BO4VL25F.js.map → chunk-L2MEW4AZ.js.map} +0 -0
- /package/dist/chunks/{chunk-G5747QGU.js.map → chunk-LETTT4ZZ.js.map} +0 -0
- /package/dist/chunks/{chunk-LXGH4QBJ.js.map → chunk-LRDLJTYP.js.map} +0 -0
- /package/dist/chunks/{chunk-PJQJZFYF.js.map → chunk-MCUV6EI7.js.map} +0 -0
- /package/dist/chunks/{chunk-ELVAEMBF.js.map → chunk-MSKJK6NZ.js.map} +0 -0
- /package/dist/chunks/{chunk-L3NHCRUZ.js.map → chunk-N457UJQL.js.map} +0 -0
- /package/dist/chunks/{chunk-7AAONVMX.js.map → chunk-O3CIRAYD.js.map} +0 -0
- /package/dist/chunks/{chunk-5CF5NKWH.js.map → chunk-O7VKAFEU.js.map} +0 -0
- /package/dist/chunks/{chunk-P4BH5CLU.js.map → chunk-PWGJB2WA.js.map} +0 -0
- /package/dist/chunks/{chunk-RT7XM57Q.js.map → chunk-PXEHKMLO.js.map} +0 -0
- /package/dist/chunks/{chunk-4OHKGKUE.js.map → chunk-QWFD2LFU.js.map} +0 -0
- /package/dist/chunks/{chunk-BPLY6HCD.js.map → chunk-QYA34YM5.js.map} +0 -0
- /package/dist/chunks/{chunk-VXJFOQIO.js.map → chunk-RI57PEYF.js.map} +0 -0
- /package/dist/chunks/{chunk-XKFG3473.js.map → chunk-RPKRLR3O.js.map} +0 -0
- /package/dist/chunks/{chunk-PUXPTJMD.js.map → chunk-TIFSH2BH.js.map} +0 -0
- /package/dist/chunks/{chunk-OS33YOPX.js.map → chunk-TSKCIC5T.js.map} +0 -0
- /package/dist/chunks/{chunk-GFBEQZGH.js.map → chunk-TZDYMWYP.js.map} +0 -0
- /package/dist/chunks/{chunk-TRX6W6TD.js.map → chunk-UHDKUVR5.js.map} +0 -0
- /package/dist/chunks/{chunk-56MTJMCE.js.map → chunk-VD4D37MT.js.map} +0 -0
- /package/dist/chunks/{chunk-YL2SBQDK.js.map → chunk-VHXXNM6W.js.map} +0 -0
- /package/dist/chunks/{chunk-72SF2UK7.js.map → chunk-WYUJ4USW.js.map} +0 -0
- /package/dist/chunks/{chunk-64BXKXCY.js.map → chunk-X4BCXODL.js.map} +0 -0
- /package/dist/chunks/{chunk-2X5QU773.js.map → chunk-XSAS6TS2.js.map} +0 -0
- /package/dist/chunks/{chunk-MIPMLOJ4.js.map → chunk-Y37JJJVY.js.map} +0 -0
- /package/dist/chunks/{chunk-24CZYMWP.js.map → chunk-YAOKLAUU.js.map} +0 -0
- /package/dist/chunks/{chunk-XBEW7SQB.js.map → chunk-YBOKKRHB.js.map} +0 -0
- /package/dist/chunks/{chunk-7UHIIE6W.js.map → chunk-YZW6H2LD.js.map} +0 -0
- /package/dist/chunks/{chunk-KES7QU4W.js.map → chunk-Z2WGX7UM.js.map} +0 -0
- /package/dist/chunks/{chunk-UOPSAWJE.js.map → chunk-ZPNX25RU.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-CBVA2QU3.js.map → cli-runtime-Q6BW37I2.js.map} +0 -0
- /package/dist/chunks/{commands-7KVEJYKS.js.map → commands-C5I7PC7W.js.map} +0 -0
- /package/dist/chunks/{crash-report-NXFD4VH5.js.map → crash-report-DRT5OCHO.js.map} +0 -0
- /package/dist/chunks/{dist-FRHHWOOW.js.map → dist-2NWJAAJM.js.map} +0 -0
- /package/dist/chunks/{dist-CUCXA33N.js.map → dist-5JM4UMVC.js.map} +0 -0
- /package/dist/chunks/{dist-VQIK2TS3.js.map → dist-D7WSQBE7.js.map} +0 -0
- /package/dist/chunks/{dist-KURG5KLO.js.map → dist-PRTI23W3.js.map} +0 -0
- /package/dist/chunks/{dist-JZXBY5D3.js.map → dist-T2N57REG.js.map} +0 -0
- /package/dist/chunks/{dist-6LIEN5YB.js.map → dist-VJC5RCYZ.js.map} +0 -0
- /package/dist/chunks/{dist-HTMWZWBC.js.map → dist-WO56PFGZ.js.map} +0 -0
- /package/dist/chunks/{doctor-B3TR2C6U.js.map → doctor-HXKU6QKJ.js.map} +0 -0
- /package/dist/chunks/{drain-YWRSLFBO.js.map → drain-MLRRMEGK.js.map} +0 -0
- /package/dist/chunks/{eval-BP6U5TEX.js.map → eval-ECOECG74.js.map} +0 -0
- /package/dist/chunks/{exec-Y6TR57J4.js.map → exec-JLB6F5ZR.js.map} +0 -0
- /package/dist/chunks/{home-HVHU4PVC.js.map → home-G65CC45B.js.map} +0 -0
- /package/dist/chunks/{host-queries-W7ATBLK2.js.map → host-queries-7LKGEBO5.js.map} +0 -0
- /package/dist/chunks/{learn-WM5TTHUD.js.map → learn-NRY6X2K6.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-RXNSBTBC.js.map → learn-builtin-QOM4KLT2.js.map} +0 -0
- /package/dist/chunks/{lifecycle-SHRBIHQV.js.map → lifecycle-BI2PMV4Q.js.map} +0 -0
- /package/dist/chunks/{list-WB7ULXJM.js.map → list-QTWALT6F.js.map} +0 -0
- /package/dist/chunks/{login-PDYMJ6JR.js.map → login-7LJG7D3F.js.map} +0 -0
- /package/dist/chunks/{logs-5X7RTN2P.js.map → logs-UGMCEFAZ.js.map} +0 -0
- /package/dist/chunks/{mcp-R4ZVPY23.js.map → mcp-KOZOXU6J.js.map} +0 -0
- /package/dist/chunks/{message-command-PHYRUQCA.js.map → message-command-7B5OFSGL.js.map} +0 -0
- /package/dist/chunks/{operator-tools-VBLGZWBL.js.map → operator-tools-PWBZHKXO.js.map} +0 -0
- /package/dist/chunks/{output-schema-4H5YYW34.js.map → output-schema-QPHXNRKI.js.map} +0 -0
- /package/dist/chunks/{pal-7LGE7ORS.js.map → pal-XSD45IR6.js.map} +0 -0
- /package/dist/chunks/{providers-APLUKR7Z.js.map → providers-ULPGYRWC.js.map} +0 -0
- /package/dist/chunks/{resident-COJTHT7K.js.map → resident-NY7XSEK7.js.map} +0 -0
- /package/dist/chunks/{resume-DL73LUH6.js.map → resume-4FV66TEK.js.map} +0 -0
- /package/dist/chunks/{resume-command-CCEBJXTF.js.map → resume-command-DLOW7MYW.js.map} +0 -0
- /package/dist/chunks/{schedule-3MVCIZZS.js.map → schedule-QR7JOA4F.js.map} +0 -0
- /package/dist/chunks/{service-OAKQZBBF.js.map → service-CLLR5VUD.js.map} +0 -0
- /package/dist/chunks/{session-step-HOLKYCG2.js.map → session-step-IEMT6LRR.js.map} +0 -0
- /package/dist/chunks/{skills-ZXEEIGHF.js.map → skills-OZZLTH6P.js.map} +0 -0
- /package/dist/chunks/{state-ETXYDF3L.js.map → state-EROTPJRH.js.map} +0 -0
- /package/dist/chunks/{store-HJFAIW4G.js.map → store-C24DXKO4.js.map} +0 -0
- /package/dist/chunks/{store-MKUMQQBF.js.map → store-ROEYUKBM.js.map} +0 -0
- /package/dist/chunks/{store-ODVHN3VE.js.map → store-VDQRT2KF.js.map} +0 -0
- /package/dist/chunks/{upgrade-OV2AFIZR.js.map → upgrade-ZRQZD2N2.js.map} +0 -0
- /package/dist/chunks/{worktree-3QCDPF3N.js.map → worktree-XMJ355ND.js.map} +0 -0
|
@@ -1366,13 +1366,13 @@ var GuardedFetchProvider = class {
|
|
|
1366
1366
|
operation.throwIfStopped();
|
|
1367
1367
|
return url;
|
|
1368
1368
|
}
|
|
1369
|
-
const
|
|
1369
|
+
const resolve30 = this.config.resolve ?? (async (name2) => (await lookup(name2, { all: true })).map((r) => r.address));
|
|
1370
1370
|
let addresses;
|
|
1371
1371
|
if (isIP(hostname)) {
|
|
1372
1372
|
addresses = [hostname];
|
|
1373
1373
|
} else {
|
|
1374
1374
|
try {
|
|
1375
|
-
addresses = await operation.run(() =>
|
|
1375
|
+
addresses = await operation.run(() => resolve30(hostname, operation.signal));
|
|
1376
1376
|
} catch (err) {
|
|
1377
1377
|
operation.throwIfStopped();
|
|
1378
1378
|
throw new WebFetchRefusedError(`Refused "${hostname}" \u2014 it could not be resolved (${err instanceof Error ? err.message : String(err)}), so nothing here can say where it points.`, { url: rawUrl, reason: "private-address" });
|
|
@@ -6399,9 +6399,9 @@ async function vetWebSocketTarget(raw, options = {}) {
|
|
|
6399
6399
|
if (literal !== 0) {
|
|
6400
6400
|
addresses = [hostname];
|
|
6401
6401
|
} else {
|
|
6402
|
-
const
|
|
6402
|
+
const resolve30 = options.resolve ?? (async (name2) => (await dnsLookup(name2, { all: true })).map((r) => r.address));
|
|
6403
6403
|
try {
|
|
6404
|
-
addresses = await
|
|
6404
|
+
addresses = await resolve30(hostname);
|
|
6405
6405
|
} catch (err) {
|
|
6406
6406
|
throw new WebSocketRefusedError(`Refused "${hostname}": it could not be resolved (${err instanceof Error ? err.message : String(err)}), so nothing here can say where it points.`);
|
|
6407
6407
|
}
|
|
@@ -6827,8 +6827,8 @@ var BackgroundJobRegistry = class {
|
|
|
6827
6827
|
};
|
|
6828
6828
|
let startError;
|
|
6829
6829
|
let settleStarted;
|
|
6830
|
-
const startedPromise = new Promise((
|
|
6831
|
-
settleStarted = /* @__PURE__ */ __name(() =>
|
|
6830
|
+
const startedPromise = new Promise((resolve30) => {
|
|
6831
|
+
settleStarted = /* @__PURE__ */ __name(() => resolve30(startError === void 0 ? {} : { error: startError }), "settleStarted");
|
|
6832
6832
|
});
|
|
6833
6833
|
if (params.spawn || child.pid !== void 0)
|
|
6834
6834
|
settleStarted();
|
|
@@ -6874,7 +6874,7 @@ var BackgroundJobRegistry = class {
|
|
|
6874
6874
|
outputChunks: [],
|
|
6875
6875
|
outputObservers: /* @__PURE__ */ new Set(),
|
|
6876
6876
|
started: startedPromise,
|
|
6877
|
-
exit: new Promise((
|
|
6877
|
+
exit: new Promise((resolve30) => {
|
|
6878
6878
|
let spawned = child.pid !== void 0;
|
|
6879
6879
|
let failedToSpawn = false;
|
|
6880
6880
|
let finalized = false;
|
|
@@ -6892,7 +6892,7 @@ var BackgroundJobRegistry = class {
|
|
|
6892
6892
|
...code === null ? {} : { exitCode: code },
|
|
6893
6893
|
...signal ? { signal } : {}
|
|
6894
6894
|
};
|
|
6895
|
-
|
|
6895
|
+
resolve30();
|
|
6896
6896
|
for (const observer of entry.outputObservers)
|
|
6897
6897
|
observer();
|
|
6898
6898
|
if (entry.monitor) {
|
|
@@ -7065,7 +7065,7 @@ var BackgroundJobRegistry = class {
|
|
|
7065
7065
|
const signal = opts.signal;
|
|
7066
7066
|
if (signal.aborted)
|
|
7067
7067
|
return Promise.reject(signal.reason);
|
|
7068
|
-
return new Promise((
|
|
7068
|
+
return new Promise((resolve30, reject2) => {
|
|
7069
7069
|
let disposeAbort = /* @__PURE__ */ __name(() => {
|
|
7070
7070
|
}, "disposeAbort");
|
|
7071
7071
|
const unsubscribe = this.onExit((job) => {
|
|
@@ -7073,7 +7073,7 @@ var BackgroundJobRegistry = class {
|
|
|
7073
7073
|
return;
|
|
7074
7074
|
unsubscribe();
|
|
7075
7075
|
disposeAbort();
|
|
7076
|
-
|
|
7076
|
+
resolve30(job);
|
|
7077
7077
|
});
|
|
7078
7078
|
disposeAbort = subscribeToAbort(signal, () => {
|
|
7079
7079
|
unsubscribe();
|
|
@@ -7170,7 +7170,7 @@ var BackgroundJobRegistry = class {
|
|
|
7170
7170
|
throw new BackgroundJobOutputWaitLimitError({ owner, limit: globalLimit, scope: "registry" });
|
|
7171
7171
|
this.outputWaiters++;
|
|
7172
7172
|
this.outputWaitersByOwner.set(owner, ownerCount + 1);
|
|
7173
|
-
return new Promise((
|
|
7173
|
+
return new Promise((resolve30) => {
|
|
7174
7174
|
const startedAt = Date.now();
|
|
7175
7175
|
let settled = false;
|
|
7176
7176
|
let disposeAbort = /* @__PURE__ */ __name(() => {
|
|
@@ -7190,7 +7190,7 @@ var BackgroundJobRegistry = class {
|
|
|
7190
7190
|
this.outputWaitersByOwner.delete(owner);
|
|
7191
7191
|
else
|
|
7192
7192
|
this.outputWaitersByOwner.set(owner, remaining);
|
|
7193
|
-
|
|
7193
|
+
resolve30(result);
|
|
7194
7194
|
}, "finish");
|
|
7195
7195
|
const timeout = /* @__PURE__ */ __name((cause) => {
|
|
7196
7196
|
read();
|
|
@@ -9611,7 +9611,7 @@ async function renameWithRetry(from, to) {
|
|
|
9611
9611
|
const code = err.code ?? "";
|
|
9612
9612
|
if (!CONTENDED.has(code) || attempt >= RENAME_ATTEMPTS)
|
|
9613
9613
|
throw err;
|
|
9614
|
-
await new Promise((
|
|
9614
|
+
await new Promise((resolve30) => setTimeout(resolve30, attempt));
|
|
9615
9615
|
}
|
|
9616
9616
|
}
|
|
9617
9617
|
}
|
|
@@ -10514,6 +10514,7 @@ function defineTool(options) {
|
|
|
10514
10514
|
...options.commandArgument !== void 0 ? { commandArgument: options.commandArgument } : {},
|
|
10515
10515
|
...options.commandDialect !== void 0 ? { commandDialect: options.commandDialect } : {},
|
|
10516
10516
|
...options.pathArgument !== void 0 ? { pathArgument: options.pathArgument } : {},
|
|
10517
|
+
...options.refuseBeforeReview ? { refuseBeforeReview: options.refuseBeforeReview } : {},
|
|
10517
10518
|
...options.urlArgument !== void 0 ? { urlArgument: options.urlArgument } : {},
|
|
10518
10519
|
...options.sandboxEscapeArgument !== void 0 ? { sandboxEscapeArgument: options.sandboxEscapeArgument } : {},
|
|
10519
10520
|
...options.presentCall ? { presentCall: options.presentCall } : {},
|
|
@@ -12628,8 +12629,8 @@ async function releaseHeldSessionLeases(options = {}) {
|
|
|
12628
12629
|
}, () => {
|
|
12629
12630
|
})));
|
|
12630
12631
|
let timer;
|
|
12631
|
-
const deadline = new Promise((
|
|
12632
|
-
timer = setTimeout(
|
|
12632
|
+
const deadline = new Promise((resolve30) => {
|
|
12633
|
+
timer = setTimeout(resolve30, options.timeoutMs ?? 2e3);
|
|
12633
12634
|
});
|
|
12634
12635
|
await Promise.race([all, deadline]);
|
|
12635
12636
|
clearTimeout(timer);
|
|
@@ -14342,7 +14343,7 @@ async function renameWithRetry2(from, to) {
|
|
|
14342
14343
|
const code = err.code ?? "";
|
|
14343
14344
|
if (!CONTENDED2.has(code) || attempt >= RENAME_ATTEMPTS2)
|
|
14344
14345
|
throw err;
|
|
14345
|
-
await new Promise((
|
|
14346
|
+
await new Promise((resolve30) => setTimeout(resolve30, attempt));
|
|
14346
14347
|
}
|
|
14347
14348
|
}
|
|
14348
14349
|
}
|
|
@@ -16870,9 +16871,9 @@ __name(safely, "safely");
|
|
|
16870
16871
|
async function screenToolResult(guardrails, result, ctx, log) {
|
|
16871
16872
|
if (!guardrails || guardrails.length === 0)
|
|
16872
16873
|
return result;
|
|
16873
|
-
let current = result.success ? result.output : result.output.trim() ? `${result.output}
|
|
16874
|
+
let current = result.success ? result.output : result.output.trim() ? result.error === void 0 ? result.output : `${result.output}
|
|
16874
16875
|
|
|
16875
|
-
Error: ${result.error
|
|
16876
|
+
Error: ${result.error}` : `Error: ${result.error ?? "Tool execution failed"}`;
|
|
16876
16877
|
let rewritten = false;
|
|
16877
16878
|
for (const [index, spec] of guardrails.entries()) {
|
|
16878
16879
|
const { name: name2, check: check2 } = normalize2(spec);
|
|
@@ -22713,14 +22714,14 @@ __name(backoffProportional, "backoffProportional");
|
|
|
22713
22714
|
function sleep(ms, signal) {
|
|
22714
22715
|
if (ms <= 0)
|
|
22715
22716
|
return Promise.resolve();
|
|
22716
|
-
return new Promise((
|
|
22717
|
+
return new Promise((resolve30, reject2) => {
|
|
22717
22718
|
if (signal?.aborted) {
|
|
22718
22719
|
reject2(signal.reason);
|
|
22719
22720
|
return;
|
|
22720
22721
|
}
|
|
22721
22722
|
const timer = setTimeout(() => {
|
|
22722
22723
|
signal?.removeEventListener("abort", onAbort);
|
|
22723
|
-
|
|
22724
|
+
resolve30();
|
|
22724
22725
|
}, ms);
|
|
22725
22726
|
const onAbort = /* @__PURE__ */ __name(() => {
|
|
22726
22727
|
clearTimeout(timer);
|
|
@@ -23806,6 +23807,10 @@ function isReviewMode(value) {
|
|
|
23806
23807
|
__name(isReviewMode, "isReviewMode");
|
|
23807
23808
|
var STRICT_MODE_REFUSAL = "Refused: this turn only permits tools an explicit rule allows, and no rule covers this call. Asking again will not change it \u2014 either the operator adds a rule, or this has to be done another way.";
|
|
23808
23809
|
var ACCEPT_EDITS_TOOLS = /* @__PURE__ */ new Set(["edit", "write"]);
|
|
23810
|
+
function isFileWrite(name2) {
|
|
23811
|
+
return name2 === "write";
|
|
23812
|
+
}
|
|
23813
|
+
__name(isFileWrite, "isFileWrite");
|
|
23809
23814
|
var REVIEW_EXEMPT_WRITES = /* @__PURE__ */ new Set([
|
|
23810
23815
|
"task_create",
|
|
23811
23816
|
"task_update",
|
|
@@ -24210,7 +24215,11 @@ function createReviewHandler(options = {}) {
|
|
|
24210
24215
|
if (!batchNeedsReview(reviewable, exempt)) {
|
|
24211
24216
|
return { action: "approve_tools" };
|
|
24212
24217
|
}
|
|
24213
|
-
if (mode === "accept-edits" && (await Promise.all(request.toolCalls.map(
|
|
24218
|
+
if (mode === "accept-edits" && (await Promise.all(request.toolCalls.map((tc) => (
|
|
24219
|
+
// The mode covers a write although the flag is set; the classifier
|
|
24220
|
+
// still judges one, so only this branch lifts the flag.
|
|
24221
|
+
acceptEditsAllows(isFileWrite(tc.name) ? { ...tc, isDestructive: false } : tc)
|
|
24222
|
+
)))).every(Boolean)) {
|
|
24214
24223
|
return { action: "approve_tools" };
|
|
24215
24224
|
}
|
|
24216
24225
|
if (mode === "plan" && !onlyReadsOutsideRoots(reviewable.filter((tc) => !isPlanFileWrite(tc)), exempt)) {
|
|
@@ -24442,6 +24451,13 @@ function unreadFileError(path2, operation = "edit") {
|
|
|
24442
24451
|
return `${path2} has not been read yet. Read it first, then redo the ${operation}. Nothing was written.`;
|
|
24443
24452
|
}
|
|
24444
24453
|
__name(unreadFileError, "unreadFileError");
|
|
24454
|
+
function movedSinceRead(tracker, key5, current) {
|
|
24455
|
+
if (!tracker || !tracker.hasRead(key5))
|
|
24456
|
+
return false;
|
|
24457
|
+
const seen = tracker.fingerprint?.(key5);
|
|
24458
|
+
return seen !== void 0 && seen !== fingerprintContent(current);
|
|
24459
|
+
}
|
|
24460
|
+
__name(movedSinceRead, "movedSinceRead");
|
|
24445
24461
|
|
|
24446
24462
|
// ../sdk/dist/tools/file-read-tracker.js
|
|
24447
24463
|
function createFileReadTracker() {
|
|
@@ -25550,7 +25566,7 @@ function countOccurrences(content, needle, cap) {
|
|
|
25550
25566
|
__name(countOccurrences, "countOccurrences");
|
|
25551
25567
|
|
|
25552
25568
|
// ../sdk/dist/tools/builtins/edit.js
|
|
25553
|
-
import { readFile as
|
|
25569
|
+
import { readFile as readFile6 } from "node:fs/promises";
|
|
25554
25570
|
|
|
25555
25571
|
// ../sdk/dist/tools/builtins/atomic-write-file.js
|
|
25556
25572
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -25616,8 +25632,8 @@ async function withFileMutationLock(key5, operation) {
|
|
|
25616
25632
|
const previous = mutationTails.get(key5) ?? Promise.resolve();
|
|
25617
25633
|
let release = /* @__PURE__ */ __name(() => {
|
|
25618
25634
|
}, "release");
|
|
25619
|
-
const current = new Promise((
|
|
25620
|
-
release =
|
|
25635
|
+
const current = new Promise((resolve30) => {
|
|
25636
|
+
release = resolve30;
|
|
25621
25637
|
});
|
|
25622
25638
|
const tail = previous.then(() => current);
|
|
25623
25639
|
mutationTails.set(key5, tail);
|
|
@@ -26402,6 +26418,35 @@ function lineDiff2(before, after) {
|
|
|
26402
26418
|
}
|
|
26403
26419
|
__name(lineDiff2, "lineDiff");
|
|
26404
26420
|
|
|
26421
|
+
// ../sdk/dist/tools/builtins/stale-before-review.js
|
|
26422
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
26423
|
+
async function staleBeforeReview(context2, path2, operation) {
|
|
26424
|
+
const tracker = context2.fileReadTracker;
|
|
26425
|
+
if (!tracker)
|
|
26426
|
+
return void 0;
|
|
26427
|
+
let key5;
|
|
26428
|
+
let current;
|
|
26429
|
+
try {
|
|
26430
|
+
if (context2.sandbox) {
|
|
26431
|
+
key5 = path2;
|
|
26432
|
+
current = (await context2.sandbox.readFile(path2)).toString("utf-8");
|
|
26433
|
+
} else {
|
|
26434
|
+
key5 = await resolveWithinAnyReal(toolRoots(context2), path2);
|
|
26435
|
+
current = await readFile5(key5, "utf-8");
|
|
26436
|
+
}
|
|
26437
|
+
} catch {
|
|
26438
|
+
return void 0;
|
|
26439
|
+
}
|
|
26440
|
+
if (!movedSinceRead(tracker, key5, current))
|
|
26441
|
+
return void 0;
|
|
26442
|
+
tracker.recordDriftObserved?.(key5);
|
|
26443
|
+
return {
|
|
26444
|
+
error: staleFileError(key5, operation),
|
|
26445
|
+
facts: { kind: "failure", reason: "changed_on_disk", subject: key5 }
|
|
26446
|
+
};
|
|
26447
|
+
}
|
|
26448
|
+
__name(staleBeforeReview, "staleBeforeReview");
|
|
26449
|
+
|
|
26405
26450
|
// ../sdk/dist/tools/builtins/edit.js
|
|
26406
26451
|
var inputSchema3 = external_exports.object({
|
|
26407
26452
|
path: external_exports.string().refine((value) => value.trim().length > 0, "Path must not be empty.").describe("Path to the file to edit. Must not be empty."),
|
|
@@ -26591,19 +26636,16 @@ function admitAgainstRead(context2, key5, content, operations) {
|
|
|
26591
26636
|
};
|
|
26592
26637
|
}
|
|
26593
26638
|
const seen = tracker?.fingerprint?.(key5);
|
|
26594
|
-
const applied = applyEdit(content, operations);
|
|
26595
26639
|
if (seen !== void 0 && seen !== fingerprintContent(content)) {
|
|
26596
|
-
|
|
26597
|
-
|
|
26598
|
-
|
|
26599
|
-
|
|
26600
|
-
|
|
26601
|
-
|
|
26602
|
-
|
|
26603
|
-
facts: { kind: "failure", reason: "changed_on_disk", subject: key5 }
|
|
26604
|
-
};
|
|
26605
|
-
}
|
|
26640
|
+
recordDrift(context2, key5);
|
|
26641
|
+
return {
|
|
26642
|
+
success: false,
|
|
26643
|
+
output: "",
|
|
26644
|
+
error: staleFileError(key5),
|
|
26645
|
+
facts: { kind: "failure", reason: "changed_on_disk", subject: key5 }
|
|
26646
|
+
};
|
|
26606
26647
|
}
|
|
26648
|
+
const applied = applyEdit(content, operations);
|
|
26607
26649
|
return { success: true, result: applied };
|
|
26608
26650
|
}
|
|
26609
26651
|
__name(admitAgainstRead, "admitAgainstRead");
|
|
@@ -26650,6 +26692,9 @@ var EditTool = defineTool({
|
|
|
26650
26692
|
// Declared so a path outside the turn's roots can be reviewed before the
|
|
26651
26693
|
// call runs, rather than refused after. See `ToolDefinition.pathArgument`.
|
|
26652
26694
|
pathArgument: "path",
|
|
26695
|
+
// A file that moved since the read is refused whatever the replacement is,
|
|
26696
|
+
// so the person is not asked to approve one that cannot run.
|
|
26697
|
+
refuseBeforeReview: /* @__PURE__ */ __name((input, context2) => staleBeforeReview(context2, input.path, "edit"), "refuseBeforeReview"),
|
|
26653
26698
|
// The classifier judges which file changes and in what way, in a line.
|
|
26654
26699
|
classifierInput: /* @__PURE__ */ __name((input) => {
|
|
26655
26700
|
if (input.edits !== void 0) {
|
|
@@ -26750,7 +26795,7 @@ var EditTool = defineTool({
|
|
|
26750
26795
|
};
|
|
26751
26796
|
}
|
|
26752
26797
|
const hostPath = filePath;
|
|
26753
|
-
const content = await
|
|
26798
|
+
const content = await readFile6(hostPath, "utf-8");
|
|
26754
26799
|
const admitted = admitAgainstRead(context2, hostPath, content, normalized.operations);
|
|
26755
26800
|
if (!admitted.success)
|
|
26756
26801
|
return admitted;
|
|
@@ -26771,7 +26816,7 @@ var EditTool = defineTool({
|
|
|
26771
26816
|
});
|
|
26772
26817
|
|
|
26773
26818
|
// ../sdk/dist/tools/builtins/read-file.js
|
|
26774
|
-
import { readFile as
|
|
26819
|
+
import { readFile as readFile7, stat as stat4 } from "node:fs/promises";
|
|
26775
26820
|
import { extname as extname2 } from "node:path";
|
|
26776
26821
|
|
|
26777
26822
|
// ../sdk/dist/tools/retained-output.js
|
|
@@ -26875,14 +26920,32 @@ __name(looksBinary, "looksBinary");
|
|
|
26875
26920
|
var DEFAULT_READ_LINES = 2e3;
|
|
26876
26921
|
function renderNumberedRead(content, input) {
|
|
26877
26922
|
const lines = content.split("\n");
|
|
26878
|
-
const
|
|
26879
|
-
const
|
|
26923
|
+
const lineCount = countFileLines(content);
|
|
26924
|
+
const { start, end } = resolveReadWindow(input, lineCount);
|
|
26925
|
+
if (content === "") {
|
|
26926
|
+
return {
|
|
26927
|
+
output: "Warning: the file exists but is empty.",
|
|
26928
|
+
totalLines: 0,
|
|
26929
|
+
returnedLines: 0,
|
|
26930
|
+
partial: false
|
|
26931
|
+
};
|
|
26932
|
+
}
|
|
26933
|
+
if (start >= lineCount) {
|
|
26934
|
+
return {
|
|
26935
|
+
output: `Warning: the file is shorter than the requested start (line ${start + 1}). It has ${lineCount} ${lineCount === 1 ? "line" : "lines"}.`,
|
|
26936
|
+
totalLines: lineCount,
|
|
26937
|
+
returnedLines: 0,
|
|
26938
|
+
// Nothing of the file was shown, so this must never stand in for it.
|
|
26939
|
+
partial: true
|
|
26940
|
+
};
|
|
26941
|
+
}
|
|
26942
|
+
const selected = lines.slice(start, Math.min(end, lineCount));
|
|
26880
26943
|
const numbered2 = selected.map((line, i) => `${start + i + 1} ${line}`).join("\n");
|
|
26881
26944
|
return {
|
|
26882
|
-
output: numbered2 + partialViewNotice(start, selected.length,
|
|
26883
|
-
totalLines:
|
|
26945
|
+
output: numbered2 + partialViewNotice(start, selected.length, lineCount),
|
|
26946
|
+
totalLines: lineCount,
|
|
26884
26947
|
returnedLines: selected.length,
|
|
26885
|
-
partial: selected.length <
|
|
26948
|
+
partial: selected.length < lineCount
|
|
26886
26949
|
};
|
|
26887
26950
|
}
|
|
26888
26951
|
__name(renderNumberedRead, "renderNumberedRead");
|
|
@@ -26898,6 +26961,13 @@ function partialViewNotice(start, returned, total) {
|
|
|
26898
26961
|
].join("\n");
|
|
26899
26962
|
}
|
|
26900
26963
|
__name(partialViewNotice, "partialViewNotice");
|
|
26964
|
+
function countFileLines(content) {
|
|
26965
|
+
if (content === "")
|
|
26966
|
+
return 0;
|
|
26967
|
+
const parts = content.split("\n").length;
|
|
26968
|
+
return content.endsWith("\n") ? parts - 1 : parts;
|
|
26969
|
+
}
|
|
26970
|
+
__name(countFileLines, "countFileLines");
|
|
26901
26971
|
function resolveReadWindow(input, totalLines) {
|
|
26902
26972
|
const [first, last] = input.readRange ?? [];
|
|
26903
26973
|
if (first !== void 0 && last !== void 0) {
|
|
@@ -26945,8 +27015,9 @@ function renderCappedRead(content, byteLength, input, options) {
|
|
|
26945
27015
|
};
|
|
26946
27016
|
}
|
|
26947
27017
|
const lines = content.split("\n");
|
|
26948
|
-
const
|
|
26949
|
-
const
|
|
27018
|
+
const lineCount = countFileLines(content);
|
|
27019
|
+
const { start, end } = resolveReadWindow(input, lineCount);
|
|
27020
|
+
const selected = lines.slice(start, Math.min(end, lineCount));
|
|
26950
27021
|
const selectedText = selected.join("\n");
|
|
26951
27022
|
const selectedBytes = Buffer.byteLength(selectedText, "utf8");
|
|
26952
27023
|
if (selectedBytes > maxTokens * SELECTED_BYTES_PER_TOKEN) {
|
|
@@ -26968,7 +27039,7 @@ function renderCappedRead(content, byteLength, input, options) {
|
|
|
26968
27039
|
}
|
|
26969
27040
|
return {
|
|
26970
27041
|
ok: true,
|
|
26971
|
-
rendered: trimFirstPage(selected,
|
|
27042
|
+
rendered: trimFirstPage(selected, lineCount, selectedText, tokens, maxTokens, options.path)
|
|
26972
27043
|
};
|
|
26973
27044
|
}
|
|
26974
27045
|
__name(renderCappedRead, "renderCappedRead");
|
|
@@ -27085,6 +27156,8 @@ var ReadFileTool = defineTool({
|
|
|
27085
27156
|
};
|
|
27086
27157
|
}
|
|
27087
27158
|
const content2 = buffer2.toString("utf-8");
|
|
27159
|
+
if (looksBinary(content2))
|
|
27160
|
+
return unreadableAsText(input.path, buffer2.length, true);
|
|
27088
27161
|
const capped2 = renderCappedRead(content2, buffer2.length, input, capOptions(input, context2));
|
|
27089
27162
|
if (!capped2.ok)
|
|
27090
27163
|
return refusedRead(input.path, buffer2.length, capped2.message, true);
|
|
@@ -27110,7 +27183,7 @@ var ReadFileTool = defineTool({
|
|
|
27110
27183
|
if (!early.ok)
|
|
27111
27184
|
return refusedRead(filePath, size, early.message, false);
|
|
27112
27185
|
}
|
|
27113
|
-
const buffer = await
|
|
27186
|
+
const buffer = await readFile7(filePath);
|
|
27114
27187
|
const binaryGuidance = describeStructuredBinaryRead(filePath, buffer);
|
|
27115
27188
|
if (binaryGuidance) {
|
|
27116
27189
|
return {
|
|
@@ -27129,6 +27202,8 @@ var ReadFileTool = defineTool({
|
|
|
27129
27202
|
};
|
|
27130
27203
|
}
|
|
27131
27204
|
const content = buffer.toString("utf-8");
|
|
27205
|
+
if (looksBinary(content))
|
|
27206
|
+
return unreadableAsText(filePath, buffer.length, false);
|
|
27132
27207
|
const capped = renderCappedRead(content, buffer.length, input, capOptions(input, context2));
|
|
27133
27208
|
if (!capped.ok)
|
|
27134
27209
|
return refusedRead(filePath, buffer.length, capped.message, false);
|
|
@@ -27157,6 +27232,15 @@ function capOptions(input, context2) {
|
|
|
27157
27232
|
};
|
|
27158
27233
|
}
|
|
27159
27234
|
__name(capOptions, "capOptions");
|
|
27235
|
+
function unreadableAsText(path2, bytes, sandboxed) {
|
|
27236
|
+
return {
|
|
27237
|
+
success: false,
|
|
27238
|
+
output: `This file is not readable as text (${humanBytes(bytes)} of binary or non-UTF-8 data). Inspect it with a shell command such as file or xxd, or use a tool made for its format.`,
|
|
27239
|
+
data: { path: path2, binary: true, ...sandboxed ? { sandboxed: true } : {} },
|
|
27240
|
+
facts: { kind: "read", path: path2, binary: true, bytes }
|
|
27241
|
+
};
|
|
27242
|
+
}
|
|
27243
|
+
__name(unreadableAsText, "unreadableAsText");
|
|
27160
27244
|
function refusedRead(path2, bytes, message, sandboxed) {
|
|
27161
27245
|
return {
|
|
27162
27246
|
success: false,
|
|
@@ -27173,9 +27257,8 @@ function readFacts(path2, buffer, content, rendered) {
|
|
|
27173
27257
|
path: path2,
|
|
27174
27258
|
bytes: buffer.length,
|
|
27175
27259
|
...looksBinary(content) ? { binary: true } : {},
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
returnedLines: content.endsWith("\n") && !rendered.partial ? rendered.returnedLines - 1 : rendered.returnedLines,
|
|
27260
|
+
totalLines: rendered.totalLines,
|
|
27261
|
+
returnedLines: rendered.returnedLines,
|
|
27179
27262
|
...rendered.partial ? { partial: true } : {}
|
|
27180
27263
|
};
|
|
27181
27264
|
}
|
|
@@ -27228,7 +27311,7 @@ function buildStructuredBinaryGuidance(path2, format, extractor) {
|
|
|
27228
27311
|
__name(buildStructuredBinaryGuidance, "buildStructuredBinaryGuidance");
|
|
27229
27312
|
|
|
27230
27313
|
// ../sdk/dist/tools/builtins/write-file.js
|
|
27231
|
-
import { mkdir as mkdir7, readFile as
|
|
27314
|
+
import { mkdir as mkdir7, readFile as readFile8 } from "node:fs/promises";
|
|
27232
27315
|
import { dirname as dirname9 } from "node:path";
|
|
27233
27316
|
|
|
27234
27317
|
// ../sdk/dist/tools/builtins/file-write-result.js
|
|
@@ -27326,6 +27409,9 @@ var WriteFileTool = defineTool({
|
|
|
27326
27409
|
// Declared so a path outside the turn's roots can be reviewed before the
|
|
27327
27410
|
// call runs, rather than refused after. See `ToolDefinition.pathArgument`.
|
|
27328
27411
|
pathArgument: "path",
|
|
27412
|
+
// An overwrite of a file that moved since the read is refused when it runs,
|
|
27413
|
+
// so the person is not asked to approve one that cannot.
|
|
27414
|
+
refuseBeforeReview: /* @__PURE__ */ __name((input, context2) => staleBeforeReview(context2, input.path, "write"), "refuseBeforeReview"),
|
|
27329
27415
|
// The classifier judges where a file is written and how much, not the body.
|
|
27330
27416
|
classifierInput: /* @__PURE__ */ __name((input) => {
|
|
27331
27417
|
const body = input.content ?? input.newStr ?? "";
|
|
@@ -27429,7 +27515,7 @@ function enforceFreshOverwrite(context2, key5, currentContent) {
|
|
|
27429
27515
|
__name(enforceFreshOverwrite, "enforceFreshOverwrite");
|
|
27430
27516
|
async function readHostFileIfPresent(hostPath) {
|
|
27431
27517
|
try {
|
|
27432
|
-
return await
|
|
27518
|
+
return await readFile8(hostPath, "utf-8");
|
|
27433
27519
|
} catch (error) {
|
|
27434
27520
|
if (isMissingFileError(error))
|
|
27435
27521
|
return void 0;
|
|
@@ -27750,18 +27836,20 @@ function observeRead(history, call2, claims, withBody, budget) {
|
|
|
27750
27836
|
}
|
|
27751
27837
|
__name(observeRead, "observeRead");
|
|
27752
27838
|
function wholeFileRenderUnits(body, window2) {
|
|
27839
|
+
if (body === "")
|
|
27840
|
+
return void 0;
|
|
27753
27841
|
const lines = countLines(body);
|
|
27754
27842
|
const { start, end } = resolveReadWindow(window2, lines);
|
|
27755
27843
|
if (start !== 0 || end < lines)
|
|
27756
27844
|
return void 0;
|
|
27757
|
-
return body.length + lines + lineNumberUnits(lines);
|
|
27845
|
+
return body.length - (body.endsWith("\n") ? 1 : 0) + lines + lineNumberUnits(lines);
|
|
27758
27846
|
}
|
|
27759
27847
|
__name(wholeFileRenderUnits, "wholeFileRenderUnits");
|
|
27760
27848
|
function countLines(body) {
|
|
27761
27849
|
let lines = 1;
|
|
27762
27850
|
for (let at = body.indexOf("\n"); at !== -1; at = body.indexOf("\n", at + 1))
|
|
27763
27851
|
lines++;
|
|
27764
|
-
return lines;
|
|
27852
|
+
return body.endsWith("\n") ? lines - 1 : lines;
|
|
27765
27853
|
}
|
|
27766
27854
|
__name(countLines, "countLines");
|
|
27767
27855
|
function lineNumberUnits(lines) {
|
|
@@ -27854,7 +27942,7 @@ function resolveNamzuHome(options = {}) {
|
|
|
27854
27942
|
__name(resolveNamzuHome, "resolveNamzuHome");
|
|
27855
27943
|
|
|
27856
27944
|
// ../sdk/dist/store/checkpoint/disk.js
|
|
27857
|
-
import { link as link5, mkdir as mkdir8, open as open7, readFile as
|
|
27945
|
+
import { link as link5, mkdir as mkdir8, open as open7, readFile as readFile9, readdir as readdir3, unlink as unlink7 } from "node:fs/promises";
|
|
27858
27946
|
import { dirname as dirname10 } from "node:path";
|
|
27859
27947
|
|
|
27860
27948
|
// ../sdk/dist/store/checkpoint/contract.js
|
|
@@ -28094,7 +28182,7 @@ var DiskSessionCheckpointStore = class {
|
|
|
28094
28182
|
};
|
|
28095
28183
|
async function readIfPresent(path2) {
|
|
28096
28184
|
try {
|
|
28097
|
-
return await
|
|
28185
|
+
return await readFile9(path2, "utf8");
|
|
28098
28186
|
} catch (error) {
|
|
28099
28187
|
if (error.code === "ENOENT")
|
|
28100
28188
|
return null;
|
|
@@ -30880,7 +30968,7 @@ var RuntimeConfigSchema = external_exports.object({
|
|
|
30880
30968
|
var RUNTIME_DEFAULTS = RuntimeConfigSchema.parse({});
|
|
30881
30969
|
|
|
30882
30970
|
// ../sdk/dist/manager/agent/child-session.js
|
|
30883
|
-
import { mkdir as mkdir9, readFile as
|
|
30971
|
+
import { mkdir as mkdir9, readFile as readFile10 } from "node:fs/promises";
|
|
30884
30972
|
import { dirname as dirname11 } from "node:path";
|
|
30885
30973
|
async function childSessionEnded(childLog) {
|
|
30886
30974
|
let ended = null;
|
|
@@ -30921,7 +31009,7 @@ __name(writeChildSessionMeta, "writeChildSessionMeta");
|
|
|
30921
31009
|
async function readChildSessionMeta(path2) {
|
|
30922
31010
|
let raw;
|
|
30923
31011
|
try {
|
|
30924
|
-
raw = await
|
|
31012
|
+
raw = await readFile10(path2, "utf8");
|
|
30925
31013
|
} catch (error) {
|
|
30926
31014
|
if (error.code === "ENOENT")
|
|
30927
31015
|
return null;
|
|
@@ -32812,12 +32900,12 @@ var AwaitedJobs = class {
|
|
|
32812
32900
|
return Promise.resolve();
|
|
32813
32901
|
if (this.outstanding.size === 0 && this.monitors.size === 0)
|
|
32814
32902
|
return Promise.resolve();
|
|
32815
|
-
return new Promise((
|
|
32903
|
+
return new Promise((resolve30) => {
|
|
32816
32904
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
32817
32905
|
clearTimeout(timer);
|
|
32818
32906
|
this.arrivals.delete(finish2);
|
|
32819
32907
|
signal?.removeEventListener("abort", finish2);
|
|
32820
|
-
|
|
32908
|
+
resolve30();
|
|
32821
32909
|
}, "finish");
|
|
32822
32910
|
const timer = setTimeout(finish2, timeoutMs);
|
|
32823
32911
|
timer.unref?.();
|
|
@@ -34853,12 +34941,12 @@ var CompletionInbox = class {
|
|
|
34853
34941
|
return Promise.resolve();
|
|
34854
34942
|
if (!this.hasPendingWork)
|
|
34855
34943
|
return Promise.resolve();
|
|
34856
|
-
return new Promise((
|
|
34944
|
+
return new Promise((resolve30) => {
|
|
34857
34945
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
34858
34946
|
clearTimeout(timer);
|
|
34859
34947
|
this.arrivals.delete(finish2);
|
|
34860
34948
|
signal?.removeEventListener("abort", finish2);
|
|
34861
|
-
|
|
34949
|
+
resolve30();
|
|
34862
34950
|
}, "finish");
|
|
34863
34951
|
const timer = setTimeout(finish2, timeoutMs);
|
|
34864
34952
|
timer.unref?.();
|
|
@@ -34983,11 +35071,11 @@ ${JSON.stringify({ tasks: tasks2, omitted: this.ours.size - ids.length })}`;
|
|
|
34983
35071
|
});
|
|
34984
35072
|
if (settlements.length === 0)
|
|
34985
35073
|
return this.drain();
|
|
34986
|
-
await new Promise((
|
|
35074
|
+
await new Promise((resolve30) => {
|
|
34987
35075
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
34988
35076
|
signal?.removeEventListener("abort", finish2);
|
|
34989
35077
|
this.drains.delete(finish2);
|
|
34990
|
-
|
|
35078
|
+
resolve30();
|
|
34991
35079
|
}, "finish");
|
|
34992
35080
|
this.drains.add(finish2);
|
|
34993
35081
|
signal?.addEventListener("abort", finish2, { once: true });
|
|
@@ -39011,14 +39099,14 @@ async function awaitDecisionDurably(ctx, checkpoint, request, scope) {
|
|
|
39011
39099
|
}, "record");
|
|
39012
39100
|
let parkTimer;
|
|
39013
39101
|
let recording = false;
|
|
39014
|
-
const recordIfSlow = new Promise((
|
|
39102
|
+
const recordIfSlow = new Promise((resolve30) => {
|
|
39015
39103
|
parkTimer = setTimeout(() => {
|
|
39016
39104
|
if (settled) {
|
|
39017
|
-
|
|
39105
|
+
resolve30();
|
|
39018
39106
|
return;
|
|
39019
39107
|
}
|
|
39020
39108
|
recording = true;
|
|
39021
|
-
record3().then(
|
|
39109
|
+
record3().then(resolve30, resolve30);
|
|
39022
39110
|
}, delay2);
|
|
39023
39111
|
});
|
|
39024
39112
|
try {
|
|
@@ -39067,13 +39155,13 @@ async function awaitDecisionOrAbort(ctx, request, scope) {
|
|
|
39067
39155
|
const abortedDecision = /* @__PURE__ */ __name(() => scope && !turnSignal?.aborted ? scope.closedAs() : { action: "abort", reason: "run aborted while parked for HITL" }, "abortedDecision");
|
|
39068
39156
|
if (signal.aborted)
|
|
39069
39157
|
return abortedDecision();
|
|
39070
|
-
return new Promise((
|
|
39158
|
+
return new Promise((resolve30) => {
|
|
39071
39159
|
let settled = false;
|
|
39072
39160
|
const onAbort = /* @__PURE__ */ __name(() => {
|
|
39073
39161
|
if (settled)
|
|
39074
39162
|
return;
|
|
39075
39163
|
settled = true;
|
|
39076
|
-
|
|
39164
|
+
resolve30(abortedDecision());
|
|
39077
39165
|
}, "onAbort");
|
|
39078
39166
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
39079
39167
|
Promise.resolve(ctx.resumeHandler(request, resumeContext)).then((decision2) => {
|
|
@@ -39081,13 +39169,13 @@ async function awaitDecisionOrAbort(ctx, request, scope) {
|
|
|
39081
39169
|
return;
|
|
39082
39170
|
settled = true;
|
|
39083
39171
|
signal.removeEventListener("abort", onAbort);
|
|
39084
|
-
|
|
39172
|
+
resolve30(decision2);
|
|
39085
39173
|
}, (err) => {
|
|
39086
39174
|
if (settled)
|
|
39087
39175
|
return;
|
|
39088
39176
|
settled = true;
|
|
39089
39177
|
signal.removeEventListener("abort", onAbort);
|
|
39090
|
-
|
|
39178
|
+
resolve30({
|
|
39091
39179
|
action: "abort",
|
|
39092
39180
|
reason: err instanceof Error ? err.message : "resume handler failed"
|
|
39093
39181
|
});
|
|
@@ -39290,7 +39378,7 @@ __name(runPlanGate, "runPlanGate");
|
|
|
39290
39378
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
39291
39379
|
async function awaitProjectInstructionCallback(signal, start) {
|
|
39292
39380
|
signal.throwIfAborted();
|
|
39293
|
-
return new Promise((
|
|
39381
|
+
return new Promise((resolve30, reject2) => {
|
|
39294
39382
|
let settled = false;
|
|
39295
39383
|
const cleanup = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "cleanup");
|
|
39296
39384
|
const rejectOnce = /* @__PURE__ */ __name((reason2) => {
|
|
@@ -39305,7 +39393,7 @@ async function awaitProjectInstructionCallback(signal, start) {
|
|
|
39305
39393
|
return;
|
|
39306
39394
|
settled = true;
|
|
39307
39395
|
cleanup();
|
|
39308
|
-
|
|
39396
|
+
resolve30(value);
|
|
39309
39397
|
}, "resolveOnce");
|
|
39310
39398
|
const onAbort = /* @__PURE__ */ __name(() => rejectOnce(signal.reason), "onAbort");
|
|
39311
39399
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -39615,7 +39703,7 @@ __name(attachRepeatNotice, "attachRepeatNotice");
|
|
|
39615
39703
|
|
|
39616
39704
|
// ../sdk/dist/runtime/query/executor.js
|
|
39617
39705
|
import { createHash as createHash14 } from "node:crypto";
|
|
39618
|
-
import { join as join13 } from "node:path";
|
|
39706
|
+
import { join as join13, resolve as resolve8 } from "node:path";
|
|
39619
39707
|
|
|
39620
39708
|
// ../sdk/dist/probe/context.js
|
|
39621
39709
|
function buildProbeContext(input = {}) {
|
|
@@ -40422,8 +40510,11 @@ function parseArguments3(raw) {
|
|
|
40422
40510
|
}
|
|
40423
40511
|
__name(parseArguments3, "parseArguments");
|
|
40424
40512
|
function formatFailedToolOutput(output, error) {
|
|
40513
|
+
const hasOutput = !!output && output.trim().length > 0;
|
|
40514
|
+
if (hasOutput && error === void 0)
|
|
40515
|
+
return output;
|
|
40425
40516
|
const errorText2 = `Error: ${error ?? "Tool execution failed"}`;
|
|
40426
|
-
if (!
|
|
40517
|
+
if (!hasOutput)
|
|
40427
40518
|
return errorText2;
|
|
40428
40519
|
return `${output}
|
|
40429
40520
|
|
|
@@ -40721,8 +40812,8 @@ var ToolCallBudget = class {
|
|
|
40721
40812
|
signal.throwIfAborted();
|
|
40722
40813
|
const previous = this.chain;
|
|
40723
40814
|
let release;
|
|
40724
|
-
this.chain = new Promise((
|
|
40725
|
-
release =
|
|
40815
|
+
this.chain = new Promise((resolve30) => {
|
|
40816
|
+
release = resolve30;
|
|
40726
40817
|
});
|
|
40727
40818
|
try {
|
|
40728
40819
|
await previous;
|
|
@@ -41178,8 +41269,13 @@ var ToolExecutor = class {
|
|
|
41178
41269
|
await this.awaitSandbox();
|
|
41179
41270
|
const calls = /* @__PURE__ */ new Map();
|
|
41180
41271
|
const escalations = /* @__PURE__ */ new Map();
|
|
41272
|
+
const earlierPaths = [];
|
|
41181
41273
|
for (const toolCall of response.message.toolCalls ?? []) {
|
|
41182
|
-
const
|
|
41274
|
+
const prepared = await prepareDirectCall(this.admissionHost(), toolCall, !hostModifiedCallIds?.has(toolCall.id));
|
|
41275
|
+
const call2 = await this.refusedBeforeReview(prepared, earlierPaths);
|
|
41276
|
+
const path2 = inputPathOf(prepared);
|
|
41277
|
+
if (path2 !== void 0)
|
|
41278
|
+
earlierPaths.push(path2);
|
|
41183
41279
|
calls.set(toolCall.id, call2);
|
|
41184
41280
|
const escalation = await this.escalationOrUnfinished(call2);
|
|
41185
41281
|
if (escalation)
|
|
@@ -41188,6 +41284,45 @@ var ToolExecutor = class {
|
|
|
41188
41284
|
this.config.abortSignal.throwIfAborted();
|
|
41189
41285
|
return this.publishPreparedBatch(calls, escalations);
|
|
41190
41286
|
}
|
|
41287
|
+
/**
|
|
41288
|
+
* A ready call the tool already knows cannot run, answered now instead of
|
|
41289
|
+
* after a reviewer has been asked about it (`ToolDefinition.refuseBeforeReview`).
|
|
41290
|
+
*
|
|
41291
|
+
* The refusal takes the place of the call, as any other refusal found while
|
|
41292
|
+
* preparing it does: it reaches no reviewer, runs nothing and answers the
|
|
41293
|
+
* model with the tool's own text. A hook that throws objects to nothing.
|
|
41294
|
+
*/
|
|
41295
|
+
async refusedBeforeReview(call2, earlierPaths) {
|
|
41296
|
+
if (call2.kind !== "ready")
|
|
41297
|
+
return call2;
|
|
41298
|
+
const tool = this.config.tools.get(call2.toolName);
|
|
41299
|
+
if (!tool?.refuseBeforeReview)
|
|
41300
|
+
return call2;
|
|
41301
|
+
const path2 = inputPathOf(call2);
|
|
41302
|
+
if (path2 !== void 0) {
|
|
41303
|
+
const target = resolve8(this.config.workingDirectory, path2);
|
|
41304
|
+
if (earlierPaths.some((p) => resolve8(this.config.workingDirectory, p) === target))
|
|
41305
|
+
return call2;
|
|
41306
|
+
}
|
|
41307
|
+
try {
|
|
41308
|
+
const refusal3 = await tool.refuseBeforeReview(call2.input, this.buildToolContext());
|
|
41309
|
+
this.config.abortSignal.throwIfAborted();
|
|
41310
|
+
if (!refusal3)
|
|
41311
|
+
return call2;
|
|
41312
|
+
return {
|
|
41313
|
+
kind: "synthetic",
|
|
41314
|
+
toolCall: call2.toolCall,
|
|
41315
|
+
toolName: call2.toolName,
|
|
41316
|
+
input: call2.input,
|
|
41317
|
+
message: formatFailedToolOutput(void 0, refusal3.error),
|
|
41318
|
+
isError: true,
|
|
41319
|
+
...refusal3.facts ? { facts: refusal3.facts } : {}
|
|
41320
|
+
};
|
|
41321
|
+
} catch {
|
|
41322
|
+
this.config.abortSignal.throwIfAborted();
|
|
41323
|
+
return call2;
|
|
41324
|
+
}
|
|
41325
|
+
}
|
|
41191
41326
|
/**
|
|
41192
41327
|
* {@link escalationOf}, except that a check which itself throws is not
|
|
41193
41328
|
* read as "nothing found". The failure becomes an escalation of its own
|
|
@@ -41322,9 +41457,10 @@ var ToolExecutor = class {
|
|
|
41322
41457
|
}
|
|
41323
41458
|
const calls = new Map(previous.calls);
|
|
41324
41459
|
const escalations = new Map(previous.escalations);
|
|
41460
|
+
const earlierPaths = [];
|
|
41325
41461
|
for (const toolCall of response.message.toolCalls ?? []) {
|
|
41326
41462
|
if (changedCallIds.has(toolCall.id)) {
|
|
41327
|
-
const call2 = await prepareDirectCall(this.admissionHost(), toolCall, false);
|
|
41463
|
+
const call2 = await this.refusedBeforeReview(await prepareDirectCall(this.admissionHost(), toolCall, false), earlierPaths);
|
|
41328
41464
|
calls.set(toolCall.id, call2);
|
|
41329
41465
|
const escalation = await this.escalationOrUnfinished(call2);
|
|
41330
41466
|
if (escalation)
|
|
@@ -41332,6 +41468,10 @@ var ToolExecutor = class {
|
|
|
41332
41468
|
else
|
|
41333
41469
|
escalations.delete(toolCall.id);
|
|
41334
41470
|
}
|
|
41471
|
+
const prepared = calls.get(toolCall.id);
|
|
41472
|
+
const path2 = prepared ? inputPathOf(prepared) : void 0;
|
|
41473
|
+
if (path2 !== void 0)
|
|
41474
|
+
earlierPaths.push(path2);
|
|
41335
41475
|
}
|
|
41336
41476
|
this.config.abortSignal.throwIfAborted();
|
|
41337
41477
|
return this.publishPreparedBatch(calls, escalations);
|
|
@@ -41561,7 +41701,7 @@ var ToolExecutor = class {
|
|
|
41561
41701
|
let failure2;
|
|
41562
41702
|
const settledUnits = /* @__PURE__ */ new Map();
|
|
41563
41703
|
const refusedAfterEnd = "An earlier call in this batch was refused and the turn was stopped, so this call was not run.";
|
|
41564
|
-
await new Promise((
|
|
41704
|
+
await new Promise((resolve30) => {
|
|
41565
41705
|
const start = /* @__PURE__ */ __name((unit) => {
|
|
41566
41706
|
inFlight.add(unit);
|
|
41567
41707
|
let settledUnit;
|
|
@@ -41609,7 +41749,7 @@ var ToolExecutor = class {
|
|
|
41609
41749
|
start(unit);
|
|
41610
41750
|
}
|
|
41611
41751
|
if (cursor >= units.length && inFlight.size === 0)
|
|
41612
|
-
|
|
41752
|
+
resolve30();
|
|
41613
41753
|
}, "pump");
|
|
41614
41754
|
review.ended.addEventListener("abort", pump, { once: true });
|
|
41615
41755
|
pump();
|
|
@@ -42349,21 +42489,21 @@ ${note}`;
|
|
|
42349
42489
|
let invocationOpen = true;
|
|
42350
42490
|
const nestedDispatches = /* @__PURE__ */ new Set();
|
|
42351
42491
|
try {
|
|
42352
|
-
const expired = Number.isFinite(timeoutMs) && timeoutMs > 0 ? new Promise((
|
|
42492
|
+
const expired = Number.isFinite(timeoutMs) && timeoutMs > 0 ? new Promise((resolve30) => {
|
|
42353
42493
|
timer = setTimeout(() => {
|
|
42354
42494
|
timedOut = true;
|
|
42355
42495
|
controller.abort(new Error(`Tool "${toolName}" exceeded ${timeoutMs}ms`));
|
|
42356
|
-
|
|
42496
|
+
resolve30("timeout");
|
|
42357
42497
|
}, timeoutMs);
|
|
42358
42498
|
}) : void 0;
|
|
42359
|
-
const aborted = new Promise((
|
|
42499
|
+
const aborted = new Promise((resolve30) => {
|
|
42360
42500
|
if (controller.signal.aborted && !timedOut) {
|
|
42361
|
-
|
|
42501
|
+
resolve30("aborted");
|
|
42362
42502
|
return;
|
|
42363
42503
|
}
|
|
42364
42504
|
controller.signal.addEventListener("abort", () => {
|
|
42365
42505
|
if (!timedOut)
|
|
42366
|
-
|
|
42506
|
+
resolve30("aborted");
|
|
42367
42507
|
}, { once: true });
|
|
42368
42508
|
});
|
|
42369
42509
|
const inheritedDispatch = toolContext.dispatchTool;
|
|
@@ -42905,8 +43045,8 @@ var Semaphore = class {
|
|
|
42905
43045
|
this.available--;
|
|
42906
43046
|
return Promise.resolve();
|
|
42907
43047
|
}
|
|
42908
|
-
return new Promise((
|
|
42909
|
-
this.waiters.push(
|
|
43048
|
+
return new Promise((resolve30) => {
|
|
43049
|
+
this.waiters.push(resolve30);
|
|
42910
43050
|
});
|
|
42911
43051
|
}
|
|
42912
43052
|
release() {
|
|
@@ -42917,6 +43057,11 @@ var Semaphore = class {
|
|
|
42917
43057
|
this.available++;
|
|
42918
43058
|
}
|
|
42919
43059
|
};
|
|
43060
|
+
function inputPathOf(call2) {
|
|
43061
|
+
const input = call2.input;
|
|
43062
|
+
return input !== null && typeof input === "object" && typeof input.path === "string" ? input.path : void 0;
|
|
43063
|
+
}
|
|
43064
|
+
__name(inputPathOf, "inputPathOf");
|
|
42920
43065
|
|
|
42921
43066
|
// ../sdk/dist/runtime/query/resume-pending.js
|
|
42922
43067
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
@@ -43773,8 +43918,8 @@ var PerCallReview = class {
|
|
|
43773
43918
|
async admit(call2) {
|
|
43774
43919
|
const before = this.#line;
|
|
43775
43920
|
let leave;
|
|
43776
|
-
this.#line = new Promise((
|
|
43777
|
-
leave =
|
|
43921
|
+
this.#line = new Promise((resolve30) => {
|
|
43922
|
+
leave = resolve30;
|
|
43778
43923
|
});
|
|
43779
43924
|
try {
|
|
43780
43925
|
const verdict = await this.#decide(call2, before, leave);
|
|
@@ -44285,8 +44430,8 @@ async function* runToolReview(ctx, response, iterationNum) {
|
|
|
44285
44430
|
}
|
|
44286
44431
|
const wakeup = /* @__PURE__ */ __name(() => {
|
|
44287
44432
|
let notify;
|
|
44288
|
-
const promise = new Promise((
|
|
44289
|
-
notify =
|
|
44433
|
+
const promise = new Promise((resolve30) => {
|
|
44434
|
+
notify = resolve30;
|
|
44290
44435
|
});
|
|
44291
44436
|
return { promise, notify };
|
|
44292
44437
|
}, "wakeup");
|
|
@@ -48902,7 +49047,7 @@ async function awaitStoreRead(signal, start) {
|
|
|
48902
49047
|
if (!signal)
|
|
48903
49048
|
return await start();
|
|
48904
49049
|
signal.throwIfAborted();
|
|
48905
|
-
return new Promise((
|
|
49050
|
+
return new Promise((resolve30, reject2) => {
|
|
48906
49051
|
let settled = false;
|
|
48907
49052
|
const cleanup = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "cleanup");
|
|
48908
49053
|
const rejectOnce = /* @__PURE__ */ __name((reason2) => {
|
|
@@ -48917,7 +49062,7 @@ async function awaitStoreRead(signal, start) {
|
|
|
48917
49062
|
return;
|
|
48918
49063
|
settled = true;
|
|
48919
49064
|
cleanup();
|
|
48920
|
-
|
|
49065
|
+
resolve30(value);
|
|
48921
49066
|
}, "resolveOnce");
|
|
48922
49067
|
const onAbort = /* @__PURE__ */ __name(() => rejectOnce(signal.reason), "onAbort");
|
|
48923
49068
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -49485,7 +49630,7 @@ var TurnContextFactory = class _TurnContextFactory {
|
|
|
49485
49630
|
|
|
49486
49631
|
// ../sdk/dist/store/evidence/disk.js
|
|
49487
49632
|
import { lstat as lstat4 } from "node:fs/promises";
|
|
49488
|
-
import { resolve as
|
|
49633
|
+
import { resolve as resolve9 } from "node:path";
|
|
49489
49634
|
|
|
49490
49635
|
// ../sdk/dist/store/evidence/index-page.js
|
|
49491
49636
|
import { createHash as createHash16, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -50172,7 +50317,7 @@ function createSource(options, mode, anchor) {
|
|
|
50172
50317
|
const consistency = external_exports.enum(["closed", "snapshot"]).parse(options.consistency ?? "closed");
|
|
50173
50318
|
const maxReadBytes = external_exports.number().int().min(1024 * 1024).max(PAGE_BYTES).parse(options.maxReadBytes ?? PAGE_BYTES);
|
|
50174
50319
|
const scope = Object.freeze(scopeSchema.parse(options.scope));
|
|
50175
|
-
const logPath =
|
|
50320
|
+
const logPath = resolve9(options.logPath);
|
|
50176
50321
|
if (!logPath.endsWith(".jsonl"))
|
|
50177
50322
|
throw new Error("A session log path ends in .jsonl.");
|
|
50178
50323
|
const sessionDir = logPath.slice(0, -".jsonl".length);
|
|
@@ -50461,8 +50606,8 @@ var EventTranslator = class {
|
|
|
50461
50606
|
async withLogLock(operation) {
|
|
50462
50607
|
const previous = this.appendChain;
|
|
50463
50608
|
let release;
|
|
50464
|
-
this.appendChain = new Promise((
|
|
50465
|
-
release =
|
|
50609
|
+
this.appendChain = new Promise((resolve30) => {
|
|
50610
|
+
release = resolve30;
|
|
50466
50611
|
});
|
|
50467
50612
|
try {
|
|
50468
50613
|
await previous;
|
|
@@ -50857,11 +51002,11 @@ async function teardownSandbox(sandbox, timeoutMs) {
|
|
|
50857
51002
|
return await operation;
|
|
50858
51003
|
let timer;
|
|
50859
51004
|
let timedOut;
|
|
50860
|
-
const deadline = new Promise((
|
|
51005
|
+
const deadline = new Promise((resolve30) => {
|
|
50861
51006
|
timer = setTimeout(() => {
|
|
50862
51007
|
timedOut = teardownTimeoutError(timeoutMs);
|
|
50863
51008
|
controller.abort(timedOut);
|
|
50864
|
-
|
|
51009
|
+
resolve30({ kind: "timed_out", error: timedOut });
|
|
50865
51010
|
}, timeoutMs);
|
|
50866
51011
|
});
|
|
50867
51012
|
try {
|
|
@@ -50889,20 +51034,20 @@ async function acquireSandbox(options) {
|
|
|
50889
51034
|
let timeoutError2;
|
|
50890
51035
|
let timer;
|
|
50891
51036
|
let onAbort;
|
|
50892
|
-
const aborted = new Promise((
|
|
51037
|
+
const aborted = new Promise((resolve30) => {
|
|
50893
51038
|
onAbort = /* @__PURE__ */ __name(() => {
|
|
50894
51039
|
operationController.abort(runSignal.reason);
|
|
50895
|
-
|
|
51040
|
+
resolve30({ kind: "cancelled" });
|
|
50896
51041
|
}, "onAbort");
|
|
50897
51042
|
runSignal.addEventListener("abort", onAbort, { once: true });
|
|
50898
51043
|
});
|
|
50899
|
-
const timedOut = new Promise((
|
|
51044
|
+
const timedOut = new Promise((resolve30) => {
|
|
50900
51045
|
if (options.timeoutMs === Number.POSITIVE_INFINITY)
|
|
50901
51046
|
return;
|
|
50902
51047
|
timer = setTimeout(() => {
|
|
50903
51048
|
timeoutError2 = acquisitionTimeoutError(options.timeoutMs);
|
|
50904
51049
|
operationController.abort(timeoutError2);
|
|
50905
|
-
|
|
51050
|
+
resolve30({ kind: "timed_out", error: timeoutError2 });
|
|
50906
51051
|
}, options.timeoutMs);
|
|
50907
51052
|
});
|
|
50908
51053
|
if (runSignal.aborted) {
|
|
@@ -50952,7 +51097,7 @@ __name(acquireSandbox, "acquireSandbox");
|
|
|
50952
51097
|
|
|
50953
51098
|
// ../sdk/dist/runtime/query/session-storage.js
|
|
50954
51099
|
import { readdir as readdir4, realpath as realpath5 } from "node:fs/promises";
|
|
50955
|
-
import { basename as basename6, dirname as dirname13, join as join16, resolve as
|
|
51100
|
+
import { basename as basename6, dirname as dirname13, join as join16, resolve as resolve10 } from "node:path";
|
|
50956
51101
|
|
|
50957
51102
|
// ../sdk/dist/store/budget/ledger.js
|
|
50958
51103
|
var SESSION_TOKEN_BUDGET_VERSION = 2;
|
|
@@ -51641,7 +51786,7 @@ var SessionTokenBudget = class _SessionTokenBudget {
|
|
|
51641
51786
|
};
|
|
51642
51787
|
|
|
51643
51788
|
// ../sdk/dist/store/budget/disk.js
|
|
51644
|
-
import { mkdir as mkdir10, readFile as
|
|
51789
|
+
import { mkdir as mkdir10, readFile as readFile11, rename as rename4, unlink as unlink8, writeFile as writeFile4 } from "node:fs/promises";
|
|
51645
51790
|
import { dirname as dirname12 } from "node:path";
|
|
51646
51791
|
var DiskSessionTokenBudgetStore = class {
|
|
51647
51792
|
static {
|
|
@@ -51696,7 +51841,7 @@ var DiskSessionTokenBudgetStore = class {
|
|
|
51696
51841
|
async #read(path2, scope) {
|
|
51697
51842
|
let text10;
|
|
51698
51843
|
try {
|
|
51699
|
-
text10 = await
|
|
51844
|
+
text10 = await readFile11(path2, "utf8");
|
|
51700
51845
|
} catch (error) {
|
|
51701
51846
|
if (error.code === "ENOENT")
|
|
51702
51847
|
return null;
|
|
@@ -51847,7 +51992,7 @@ async function placeInLayout(paths2, log) {
|
|
|
51847
51992
|
}
|
|
51848
51993
|
__name(placeInLayout, "placeInLayout");
|
|
51849
51994
|
async function canonicalPath(path2) {
|
|
51850
|
-
let existing =
|
|
51995
|
+
let existing = resolve10(path2);
|
|
51851
51996
|
let remainder = "";
|
|
51852
51997
|
for (; ; ) {
|
|
51853
51998
|
const found = await realpath5(existing).catch(() => void 0);
|
|
@@ -51855,7 +52000,7 @@ async function canonicalPath(path2) {
|
|
|
51855
52000
|
return remainder ? join16(found, remainder) : found;
|
|
51856
52001
|
const parent = dirname13(existing);
|
|
51857
52002
|
if (parent === existing)
|
|
51858
|
-
return
|
|
52003
|
+
return resolve10(path2);
|
|
51859
52004
|
remainder = remainder ? join16(basename6(existing), remainder) : basename6(existing);
|
|
51860
52005
|
existing = parent;
|
|
51861
52006
|
}
|
|
@@ -52064,8 +52209,8 @@ async function resolveProviderContextWindow(provider, model, signal, timeoutMs,
|
|
|
52064
52209
|
const resolverSignal = signal ? AbortSignal.any([signal, deadline.signal]) : deadline.signal;
|
|
52065
52210
|
const interrupted = /* @__PURE__ */ Symbol("provider-context-window-interrupted");
|
|
52066
52211
|
let onAbort;
|
|
52067
|
-
const interruption = new Promise((
|
|
52068
|
-
onAbort = /* @__PURE__ */ __name(() =>
|
|
52212
|
+
const interruption = new Promise((resolve30) => {
|
|
52213
|
+
onAbort = /* @__PURE__ */ __name(() => resolve30(interrupted), "onAbort");
|
|
52069
52214
|
resolverSignal.addEventListener("abort", onAbort, { once: true });
|
|
52070
52215
|
});
|
|
52071
52216
|
const deadlineMs = timeoutMs === 0 ? 5e3 : Math.min(Math.max(0, timeoutMs), 2147483647);
|
|
@@ -56680,7 +56825,7 @@ __name(createMemoryRecallStep, "createMemoryRecallStep");
|
|
|
56680
56825
|
// ../sdk/dist/execution/local.js
|
|
56681
56826
|
import { spawn } from "node:child_process";
|
|
56682
56827
|
import { existsSync as existsSync3 } from "node:fs";
|
|
56683
|
-
import { resolve as
|
|
56828
|
+
import { resolve as resolve11 } from "node:path";
|
|
56684
56829
|
|
|
56685
56830
|
// ../sdk/dist/execution/base.js
|
|
56686
56831
|
var InitializationSupersededError = class extends Error {
|
|
@@ -56971,7 +57116,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
56971
57116
|
constructor(options) {
|
|
56972
57117
|
super(options.log);
|
|
56973
57118
|
this.id = options.id;
|
|
56974
|
-
this.cwd =
|
|
57119
|
+
this.cwd = resolve11(options.cwd);
|
|
56975
57120
|
this.fsAccess = options.fsAccess ?? true;
|
|
56976
57121
|
this.envVars = options.envVars ?? {};
|
|
56977
57122
|
this.capabilities = options.capabilities ?? ["filesystem", "process", "shell"];
|
|
@@ -57007,7 +57152,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
57007
57152
|
return this.cwd;
|
|
57008
57153
|
}
|
|
57009
57154
|
setCwd(newCwd) {
|
|
57010
|
-
const resolved2 =
|
|
57155
|
+
const resolved2 = resolve11(newCwd);
|
|
57011
57156
|
if (!existsSync3(resolved2)) {
|
|
57012
57157
|
throw new Error(`Working directory does not exist: ${resolved2}`);
|
|
57013
57158
|
}
|
|
@@ -57017,7 +57162,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
57017
57162
|
return this.fsAccess;
|
|
57018
57163
|
}
|
|
57019
57164
|
resolvePath(relativePath) {
|
|
57020
|
-
return
|
|
57165
|
+
return resolve11(this.cwd, relativePath);
|
|
57021
57166
|
}
|
|
57022
57167
|
getEnvVar(key5) {
|
|
57023
57168
|
return this.envVars[key5] ?? process.env[key5];
|
|
@@ -57045,7 +57190,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
57045
57190
|
durationMs: 0
|
|
57046
57191
|
};
|
|
57047
57192
|
}
|
|
57048
|
-
const cwd = options?.cwd ?
|
|
57193
|
+
const cwd = options?.cwd ? resolve11(this.cwd, options.cwd) : this.cwd;
|
|
57049
57194
|
const env = { ...process.env, ...this.envVars, ...options?.env };
|
|
57050
57195
|
const timeoutMs = options?.timeoutMs ?? LOCAL_COMMAND_DEFAULT_TIMEOUT_MS;
|
|
57051
57196
|
if (!Number.isInteger(timeoutMs) || timeoutMs < 0) {
|
|
@@ -57176,9 +57321,9 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
57176
57321
|
|
|
57177
57322
|
// ../sdk/dist/turn/workspace-fingerprint.js
|
|
57178
57323
|
import { createHash as createHash17 } from "node:crypto";
|
|
57179
|
-
import { lstat as lstat5, readFile as
|
|
57324
|
+
import { lstat as lstat5, readFile as readFile12, readlink } from "node:fs/promises";
|
|
57180
57325
|
import { join as join20 } from "node:path";
|
|
57181
|
-
var NODE_FS = { lstat: lstat5, readlink, readFile:
|
|
57326
|
+
var NODE_FS = { lstat: lstat5, readlink, readFile: readFile12 };
|
|
57182
57327
|
var FINGERPRINT_MAX_BYTES = 4 * 1024 * 1024;
|
|
57183
57328
|
var FINGERPRINT_TIMEOUT_MS = 2e4;
|
|
57184
57329
|
async function untrackedEntry(cwd, rel, fs) {
|
|
@@ -57657,7 +57802,7 @@ function assertReadableScalar(key5, value, source) {
|
|
|
57657
57802
|
__name(assertReadableScalar, "assertReadableScalar");
|
|
57658
57803
|
|
|
57659
57804
|
// ../sdk/dist/skills/loader.js
|
|
57660
|
-
import { readFile as
|
|
57805
|
+
import { readFile as readFile13, readdir as readdir7, stat as stat7 } from "node:fs/promises";
|
|
57661
57806
|
import { basename as basename8, join as join21 } from "node:path";
|
|
57662
57807
|
var SKILL_FILENAME = "SKILL.md";
|
|
57663
57808
|
var SKILL_FRONTMATTER_KEYS = Object.freeze([
|
|
@@ -57778,7 +57923,7 @@ function estimateTokens2(text10) {
|
|
|
57778
57923
|
__name(estimateTokens2, "estimateTokens");
|
|
57779
57924
|
async function loadSkill(dirPath, level = "metadata", log) {
|
|
57780
57925
|
const skillMdPath = join21(dirPath, SKILL_FILENAME);
|
|
57781
|
-
const raw = await
|
|
57926
|
+
const raw = await readFile13(skillMdPath, "utf-8");
|
|
57782
57927
|
const parsed = parseFrontmatter(raw, sourceLabel(dirPath), SKILL_FRONTMATTER_OPTIONS);
|
|
57783
57928
|
const metadata = toSkillMetadata(parsed, dirPath);
|
|
57784
57929
|
const skill = {
|
|
@@ -58105,15 +58250,15 @@ var DiskTaskStore = class {
|
|
|
58105
58250
|
break;
|
|
58106
58251
|
await existing.catch(() => void 0);
|
|
58107
58252
|
}
|
|
58108
|
-
let
|
|
58253
|
+
let resolve30;
|
|
58109
58254
|
const lock = new Promise((r) => {
|
|
58110
|
-
|
|
58255
|
+
resolve30 = r;
|
|
58111
58256
|
});
|
|
58112
58257
|
this.locks.set(taskId, lock);
|
|
58113
58258
|
try {
|
|
58114
58259
|
return await fn();
|
|
58115
58260
|
} finally {
|
|
58116
|
-
|
|
58261
|
+
resolve30?.();
|
|
58117
58262
|
if (this.locks.get(taskId) === lock) {
|
|
58118
58263
|
this.locks.delete(taskId);
|
|
58119
58264
|
}
|
|
@@ -58433,8 +58578,8 @@ var DiskTaskStore = class {
|
|
|
58433
58578
|
|
|
58434
58579
|
// ../sdk/dist/store/memory/markdown.js
|
|
58435
58580
|
import { createHash as createHash20 } from "node:crypto";
|
|
58436
|
-
import { lstat as lstat7, mkdir as mkdir13, readFile as
|
|
58437
|
-
import { dirname as dirname15, join as join24, resolve as
|
|
58581
|
+
import { lstat as lstat7, mkdir as mkdir13, readFile as readFile15, readdir as readdir8, realpath as realpath6, rename as rename6, unlink as unlink11 } from "node:fs/promises";
|
|
58582
|
+
import { dirname as dirname15, join as join24, resolve as resolve12 } from "node:path";
|
|
58438
58583
|
|
|
58439
58584
|
// ../sdk/dist/store/memory/index-file.js
|
|
58440
58585
|
var MEMORY_INDEX_MAX_LINES = 200;
|
|
@@ -58651,7 +58796,7 @@ __name(formatMemoryFile, "formatMemoryFile");
|
|
|
58651
58796
|
|
|
58652
58797
|
// ../sdk/dist/store/memory/operation-lock.js
|
|
58653
58798
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
58654
|
-
import { lstat as lstat6, open as open9, readFile as
|
|
58799
|
+
import { lstat as lstat6, open as open9, readFile as readFile14, unlink as unlink10 } from "node:fs/promises";
|
|
58655
58800
|
import { setTimeout as delay } from "node:timers/promises";
|
|
58656
58801
|
var DEFAULT_MEMORY_LOCK_TIMEOUT_MS = 1e4;
|
|
58657
58802
|
function validateMemoryLockTimeout(timeoutMs) {
|
|
@@ -58723,7 +58868,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
|
|
|
58723
58868
|
await handle.close();
|
|
58724
58869
|
return async () => {
|
|
58725
58870
|
const current = await lstat6(path2);
|
|
58726
|
-
if (!current.isFile() || current.isSymbolicLink() || current.dev !== identity.dev || current.ino !== identity.ino || await
|
|
58871
|
+
if (!current.isFile() || current.isSymbolicLink() || current.dev !== identity.dev || current.ino !== identity.ino || await readFile14(path2, "utf8") !== owner) {
|
|
58727
58872
|
throw lockError(path2, "the lock owner changed before release", timeoutMs);
|
|
58728
58873
|
}
|
|
58729
58874
|
await unlink10(path2);
|
|
@@ -59008,7 +59153,7 @@ var MarkdownMemoryStore = class {
|
|
|
59008
59153
|
lockTimeoutMs;
|
|
59009
59154
|
canonical;
|
|
59010
59155
|
constructor(config) {
|
|
59011
|
-
this.directory =
|
|
59156
|
+
this.directory = resolve12(config.directory);
|
|
59012
59157
|
this.log = resolveLogger(config.logger).child({
|
|
59013
59158
|
[SCOPE_ATTRIBUTE]: "store/memory/markdown"
|
|
59014
59159
|
});
|
|
@@ -59029,7 +59174,7 @@ var MarkdownMemoryStore = class {
|
|
|
59029
59174
|
memoryPath(dir, name2) {
|
|
59030
59175
|
if (!isMemoryName(name2))
|
|
59031
59176
|
invalidFile(join24(dir, `${name2}.md`), "name is not a memory name");
|
|
59032
|
-
const path2 =
|
|
59177
|
+
const path2 = resolve12(entryPath(dir, name2, ".md"));
|
|
59033
59178
|
if (dirname15(path2) !== dir)
|
|
59034
59179
|
invalidFile(path2, "resolved path escapes the memory directory");
|
|
59035
59180
|
return path2;
|
|
@@ -59060,7 +59205,7 @@ var MarkdownMemoryStore = class {
|
|
|
59060
59205
|
if (stat15.size > MEMORY_FILE_MAX_BYTES) {
|
|
59061
59206
|
invalidFile(path2, `larger than the ${MEMORY_FILE_MAX_BYTES}-byte memory file limit`);
|
|
59062
59207
|
}
|
|
59063
|
-
const bytes = await
|
|
59208
|
+
const bytes = await readFile15(path2);
|
|
59064
59209
|
let raw;
|
|
59065
59210
|
try {
|
|
59066
59211
|
raw = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
@@ -59160,7 +59305,7 @@ var MarkdownMemoryStore = class {
|
|
|
59160
59305
|
${text10 ? `${text10}
|
|
59161
59306
|
` : ""}`;
|
|
59162
59307
|
const path2 = join24(dir, MEMORY_INDEX_FILE);
|
|
59163
|
-
const current = await
|
|
59308
|
+
const current = await readFile15(path2, "utf-8").catch(() => void 0);
|
|
59164
59309
|
if (current !== next)
|
|
59165
59310
|
await atomicWriteFile(path2, next, { mode: FILE_MODE });
|
|
59166
59311
|
}
|
|
@@ -59403,7 +59548,7 @@ ${text10 ? `${text10}
|
|
|
59403
59548
|
|
|
59404
59549
|
// ../sdk/dist/store/memory/disk.js
|
|
59405
59550
|
import { mkdir as mkdir14, realpath as realpath7, unlink as unlink12 } from "node:fs/promises";
|
|
59406
|
-
import { dirname as dirname16, join as join25, resolve as
|
|
59551
|
+
import { dirname as dirname16, join as join25, resolve as resolve13 } from "node:path";
|
|
59407
59552
|
var SCHEMA5 = defineSchema({ kind: "memory-store", current: 1, migrations: {} });
|
|
59408
59553
|
function invalidIndex(reason2, details = {}) {
|
|
59409
59554
|
throw new NamzuError({
|
|
@@ -59519,7 +59664,7 @@ var DiskMemoryStore = class {
|
|
|
59519
59664
|
records = new DiskRecordStore(SCHEMA5);
|
|
59520
59665
|
indexRecords = new DiskRecordStore(SCHEMA5);
|
|
59521
59666
|
constructor(config) {
|
|
59522
|
-
this.baseDir = config.directory === void 0 ? join25(config.baseDir, "memory") :
|
|
59667
|
+
this.baseDir = config.directory === void 0 ? join25(config.baseDir, "memory") : resolve13(config.directory);
|
|
59523
59668
|
this.log = resolveLogger(config.logger).child({ [SCOPE_ATTRIBUTE]: "store/memory/disk" });
|
|
59524
59669
|
this.lockTimeoutMs = config.lockTimeoutMs ?? DEFAULT_MEMORY_LOCK_TIMEOUT_MS;
|
|
59525
59670
|
validateMemoryLockTimeout(this.lockTimeoutMs);
|
|
@@ -59546,7 +59691,7 @@ var DiskMemoryStore = class {
|
|
|
59546
59691
|
}
|
|
59547
59692
|
contentPath(location, id3) {
|
|
59548
59693
|
assertStorageMemoryId(id3, (reason2) => invalidContent(id3, reason2, { field: "id" }));
|
|
59549
|
-
const path2 =
|
|
59694
|
+
const path2 = resolve13(entryPath(location.contentDir, id3, ".json"));
|
|
59550
59695
|
if (dirname16(path2) !== location.contentDir) {
|
|
59551
59696
|
invalidContent(id3, "resolved path escapes the content directory", { field: "id" });
|
|
59552
59697
|
}
|
|
@@ -62552,7 +62697,7 @@ var MockLLMProvider = class {
|
|
|
62552
62697
|
async delay() {
|
|
62553
62698
|
if (this.responseDelayMs <= 0)
|
|
62554
62699
|
return;
|
|
62555
|
-
await new Promise((
|
|
62700
|
+
await new Promise((resolve30) => setTimeout(resolve30, this.responseDelayMs));
|
|
62556
62701
|
}
|
|
62557
62702
|
/**
|
|
62558
62703
|
* The turn to play. A script shorter than the turn repeats its last
|
|
@@ -62930,7 +63075,7 @@ var StdioTransport = class {
|
|
|
62930
63075
|
this.exitPending = false;
|
|
62931
63076
|
return;
|
|
62932
63077
|
}
|
|
62933
|
-
await new Promise((
|
|
63078
|
+
await new Promise((resolve30) => {
|
|
62934
63079
|
let settled = false;
|
|
62935
63080
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
62936
63081
|
if (settled)
|
|
@@ -62938,7 +63083,7 @@ var StdioTransport = class {
|
|
|
62938
63083
|
settled = true;
|
|
62939
63084
|
clearTimeout(escalate);
|
|
62940
63085
|
clearTimeout(giveUp);
|
|
62941
|
-
|
|
63086
|
+
resolve30();
|
|
62942
63087
|
}, "finish");
|
|
62943
63088
|
child.once("close", finish2);
|
|
62944
63089
|
child.once("error", finish2);
|
|
@@ -64213,7 +64358,7 @@ async function resolveMcpEra(input) {
|
|
|
64213
64358
|
__name(resolveMcpEra, "resolveMcpEra");
|
|
64214
64359
|
|
|
64215
64360
|
// ../sdk/dist/version.js
|
|
64216
|
-
var VERSION2 = "56.
|
|
64361
|
+
var VERSION2 = "56.1.0";
|
|
64217
64362
|
|
|
64218
64363
|
// ../sdk/dist/connector/mcp/client.js
|
|
64219
64364
|
var MAX_LIST_PAGES = 100;
|
|
@@ -64537,7 +64682,7 @@ var MCPClient = class {
|
|
|
64537
64682
|
capabilities: this.config.capabilities ?? {}
|
|
64538
64683
|
});
|
|
64539
64684
|
const controller = new AbortController();
|
|
64540
|
-
return new Promise((
|
|
64685
|
+
return new Promise((resolve30) => {
|
|
64541
64686
|
let settled = false;
|
|
64542
64687
|
const finish2 = /* @__PURE__ */ __name((answer) => {
|
|
64543
64688
|
if (settled)
|
|
@@ -64546,7 +64691,7 @@ var MCPClient = class {
|
|
|
64546
64691
|
clearTimeout(timer);
|
|
64547
64692
|
if (this.pendingRequests.get(id3) === entry)
|
|
64548
64693
|
this.pendingRequests.delete(id3);
|
|
64549
|
-
|
|
64694
|
+
resolve30(answer);
|
|
64550
64695
|
}, "finish");
|
|
64551
64696
|
const entry = {
|
|
64552
64697
|
resolve: /* @__PURE__ */ __name((value) => finish2({ kind: "result", result: value }), "resolve"),
|
|
@@ -65120,8 +65265,8 @@ var MCPClient = class {
|
|
|
65120
65265
|
let settled = false;
|
|
65121
65266
|
let resolvePublic;
|
|
65122
65267
|
let rejectPublic;
|
|
65123
|
-
const result = new Promise((
|
|
65124
|
-
resolvePublic =
|
|
65268
|
+
const result = new Promise((resolve30, reject2) => {
|
|
65269
|
+
resolvePublic = resolve30;
|
|
65125
65270
|
rejectPublic = reject2;
|
|
65126
65271
|
});
|
|
65127
65272
|
const entry = {
|
|
@@ -65965,14 +66110,14 @@ var MCPReconnectSupervisor = class {
|
|
|
65965
66110
|
});
|
|
65966
66111
|
}
|
|
65967
66112
|
wait(ms) {
|
|
65968
|
-
return new Promise((
|
|
66113
|
+
return new Promise((resolve30) => {
|
|
65969
66114
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
65970
66115
|
if (this.timer)
|
|
65971
66116
|
clearTimeout(this.timer);
|
|
65972
66117
|
this.timer = void 0;
|
|
65973
66118
|
if (this.finishWait === finish2)
|
|
65974
66119
|
this.finishWait = void 0;
|
|
65975
|
-
|
|
66120
|
+
resolve30();
|
|
65976
66121
|
}, "finish");
|
|
65977
66122
|
this.finishWait = finish2;
|
|
65978
66123
|
this.timer = setTimeout(finish2, ms);
|
|
@@ -66603,7 +66748,7 @@ var ACPServer = class {
|
|
|
66603
66748
|
request(method, params, signal) {
|
|
66604
66749
|
this.requestSeq += 1;
|
|
66605
66750
|
const id3 = `agent_${this.requestSeq}`;
|
|
66606
|
-
return new Promise((
|
|
66751
|
+
return new Promise((resolve30, reject2) => {
|
|
66607
66752
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
66608
66753
|
if (this.pending.get(id3) !== entry)
|
|
66609
66754
|
return false;
|
|
@@ -66618,7 +66763,7 @@ var ACPServer = class {
|
|
|
66618
66763
|
const entry = {
|
|
66619
66764
|
resolve: /* @__PURE__ */ __name((value) => {
|
|
66620
66765
|
if (finish2())
|
|
66621
|
-
|
|
66766
|
+
resolve30(value);
|
|
66622
66767
|
}, "resolve"),
|
|
66623
66768
|
reject: /* @__PURE__ */ __name((error) => {
|
|
66624
66769
|
if (finish2())
|
|
@@ -68353,7 +68498,7 @@ __name(createResidentEvidenceRecallStep, "createResidentEvidenceRecallStep");
|
|
|
68353
68498
|
// ../sdk/dist/pals/store.js
|
|
68354
68499
|
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
68355
68500
|
import { chmodSync, closeSync, fsyncSync, linkSync, lstatSync as lstatSync3, mkdirSync as mkdirSync3, openSync, readFileSync, readdirSync, realpathSync as realpathSync3, unlinkSync, writeSync } from "node:fs";
|
|
68356
|
-
import { dirname as dirname17, isAbsolute as isAbsolute8, join as join27, relative as relative4, resolve as
|
|
68501
|
+
import { dirname as dirname17, isAbsolute as isAbsolute8, join as join27, relative as relative4, resolve as resolve14, sep as sep6 } from "node:path";
|
|
68357
68502
|
var ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
|
|
68358
68503
|
var REVISION_FILE = /^[1-9][0-9]*\.json$/u;
|
|
68359
68504
|
var PalConflictError = class extends Error {
|
|
@@ -68374,7 +68519,7 @@ function palId(id3) {
|
|
|
68374
68519
|
}
|
|
68375
68520
|
__name(palId, "palId");
|
|
68376
68521
|
function homePath(home) {
|
|
68377
|
-
const path2 =
|
|
68522
|
+
const path2 = resolve14(home);
|
|
68378
68523
|
mkdirSync3(path2, { recursive: true, mode: 448 });
|
|
68379
68524
|
const entry = lstatSync3(path2);
|
|
68380
68525
|
if (!entry.isDirectory() || entry.isSymbolicLink())
|
|
@@ -68621,7 +68766,7 @@ var DiskPalStore = class {
|
|
|
68621
68766
|
}
|
|
68622
68767
|
/** Exact validated host control directory; never an execution-computer claim. */
|
|
68623
68768
|
atWorkspace(cwd) {
|
|
68624
|
-
const lexical =
|
|
68769
|
+
const lexical = resolve14(cwd);
|
|
68625
68770
|
const canonical3 = realpathSync3(lexical);
|
|
68626
68771
|
const lexicalReserved = contained(lexical, this.workspaceRoot);
|
|
68627
68772
|
const canonicalReserved = contained(canonical3, this.workspaceRoot);
|
|
@@ -70138,10 +70283,10 @@ var ExternalHarnessSession = class {
|
|
|
70138
70283
|
}
|
|
70139
70284
|
}
|
|
70140
70285
|
makeActive(turnId6, operationId, startedAt) {
|
|
70141
|
-
let
|
|
70286
|
+
let resolve30;
|
|
70142
70287
|
let reject2;
|
|
70143
70288
|
const done = new Promise((yes, no) => {
|
|
70144
|
-
|
|
70289
|
+
resolve30 = yes;
|
|
70145
70290
|
reject2 = no;
|
|
70146
70291
|
});
|
|
70147
70292
|
void done.catch(() => void 0);
|
|
@@ -70151,7 +70296,7 @@ var ExternalHarnessSession = class {
|
|
|
70151
70296
|
startedAt,
|
|
70152
70297
|
items: /* @__PURE__ */ new Map(),
|
|
70153
70298
|
reviews: /* @__PURE__ */ new Map(),
|
|
70154
|
-
resolve:
|
|
70299
|
+
resolve: resolve30,
|
|
70155
70300
|
reject: reject2,
|
|
70156
70301
|
done
|
|
70157
70302
|
};
|
|
@@ -71362,7 +71507,7 @@ ${line}`;
|
|
|
71362
71507
|
stdout: true,
|
|
71363
71508
|
stderr: true
|
|
71364
71509
|
});
|
|
71365
|
-
return await new Promise((
|
|
71510
|
+
return await new Promise((resolve30) => {
|
|
71366
71511
|
let settled = false;
|
|
71367
71512
|
let terminal;
|
|
71368
71513
|
const inFlight = /* @__PURE__ */ new Set();
|
|
@@ -71377,7 +71522,7 @@ ${line}`;
|
|
|
71377
71522
|
clearTimeout(deadline);
|
|
71378
71523
|
options.signal?.removeEventListener("abort", onAbort);
|
|
71379
71524
|
void worker.terminate();
|
|
71380
|
-
|
|
71525
|
+
resolve30({ ...result, calls: [...calls] });
|
|
71381
71526
|
}, "finish");
|
|
71382
71527
|
const finishTerminalWhenHostCallsSettle = /* @__PURE__ */ __name(() => {
|
|
71383
71528
|
if (terminal && inFlight.size === 0)
|
|
@@ -72806,8 +72951,8 @@ ${body}`,
|
|
|
72806
72951
|
let timer;
|
|
72807
72952
|
await Promise.race([
|
|
72808
72953
|
Promise.allSettled([...inFlight]),
|
|
72809
|
-
new Promise((
|
|
72810
|
-
timer = setTimeout(
|
|
72954
|
+
new Promise((resolve30) => {
|
|
72955
|
+
timer = setTimeout(resolve30, grace);
|
|
72811
72956
|
})
|
|
72812
72957
|
]);
|
|
72813
72958
|
clearTimeout(timer);
|
|
@@ -74008,7 +74153,7 @@ function toHandle(task) {
|
|
|
74008
74153
|
__name(toHandle, "toHandle");
|
|
74009
74154
|
|
|
74010
74155
|
// ../sdk/dist/agents/file-definitions.js
|
|
74011
|
-
import { readFile as
|
|
74156
|
+
import { readFile as readFile16, readdir as readdir9, stat as stat9 } from "node:fs/promises";
|
|
74012
74157
|
import { join as join29 } from "node:path";
|
|
74013
74158
|
var MAX_AGENT_FILE_CHARS = 32e3;
|
|
74014
74159
|
var MAX_AGENT_FILE_BYTES = 4 * 1024 * 1024;
|
|
@@ -74046,7 +74191,7 @@ async function parseAgentFile(path2, source, reserved = DEFAULT_RESERVED_AGENT_N
|
|
|
74046
74191
|
if ((await stat9(path2)).size > MAX_AGENT_FILE_BYTES) {
|
|
74047
74192
|
return { path: path2, reason: "is larger than 4 MiB, which no agent file is" };
|
|
74048
74193
|
}
|
|
74049
|
-
raw = await
|
|
74194
|
+
raw = await readFile16(path2, "utf8");
|
|
74050
74195
|
} catch (error) {
|
|
74051
74196
|
return {
|
|
74052
74197
|
path: path2,
|
|
@@ -74208,9 +74353,9 @@ var PluginRegistry = class extends ManagedRegistry {
|
|
|
74208
74353
|
};
|
|
74209
74354
|
|
|
74210
74355
|
// ../sdk/dist/plugin/loader.js
|
|
74211
|
-
import { lstat as lstat8, readFile as
|
|
74356
|
+
import { lstat as lstat8, readFile as readFile17, readdir as readdir10, realpath as realpath8 } from "node:fs/promises";
|
|
74212
74357
|
import { homedir as homedir4, platform } from "node:os";
|
|
74213
|
-
import { join as join30, resolve as
|
|
74358
|
+
import { join as join30, resolve as resolve15 } from "node:path";
|
|
74214
74359
|
|
|
74215
74360
|
// ../sdk/dist/types/plugin/index.js
|
|
74216
74361
|
var RENAMED_PLUGIN_HOOK_EVENTS = {
|
|
@@ -74325,7 +74470,7 @@ async function loadPluginManifest(pluginDir, capabilities2 = {}) {
|
|
|
74325
74470
|
if (manifestEntry.isSymbolicLink() || !manifestEntry.isFile()) {
|
|
74326
74471
|
throw new Error(`Plugin manifest must be a regular file, not a symlink: ${manifestPath}`);
|
|
74327
74472
|
}
|
|
74328
|
-
const raw = await
|
|
74473
|
+
const raw = await readFile17(manifestPath, "utf-8");
|
|
74329
74474
|
const parsed = JSON.parse(raw);
|
|
74330
74475
|
const manifest = PluginManifestSchema.parse(parsed);
|
|
74331
74476
|
assertEnableable(manifest, capabilities2);
|
|
@@ -74393,7 +74538,7 @@ async function samePhysicalDirectory(left, right) {
|
|
|
74393
74538
|
try {
|
|
74394
74539
|
value = await realpath8(path2);
|
|
74395
74540
|
} catch {
|
|
74396
|
-
value =
|
|
74541
|
+
value = resolve15(path2);
|
|
74397
74542
|
}
|
|
74398
74543
|
return platform() === "win32" ? value.toLocaleLowerCase("en-US") : value;
|
|
74399
74544
|
}, "canonical");
|
|
@@ -75350,7 +75495,7 @@ function runShellHook(entry, input, signal) {
|
|
|
75350
75495
|
});
|
|
75351
75496
|
const toolPath = pathOf(input.toolInput);
|
|
75352
75497
|
const { NAMZU_TURN_ID: _inheritedTurnId, ...inherited } = process.env;
|
|
75353
|
-
return new Promise((
|
|
75498
|
+
return new Promise((resolve30) => {
|
|
75354
75499
|
let child;
|
|
75355
75500
|
try {
|
|
75356
75501
|
child = spawnHostShell(entry.command, {
|
|
@@ -75377,7 +75522,7 @@ function runShellHook(entry, input, signal) {
|
|
|
75377
75522
|
...process.platform === "win32" ? {} : { shell: { path: "sh", dialect: "sh", source: "sh" } }
|
|
75378
75523
|
});
|
|
75379
75524
|
} catch (error) {
|
|
75380
|
-
|
|
75525
|
+
resolve30({
|
|
75381
75526
|
exitCode: null,
|
|
75382
75527
|
timedOut: false,
|
|
75383
75528
|
stdout: "",
|
|
@@ -75403,7 +75548,7 @@ function runShellHook(entry, input, signal) {
|
|
|
75403
75548
|
settled = true;
|
|
75404
75549
|
clearTimeout(timer);
|
|
75405
75550
|
signal?.removeEventListener("abort", onAbort);
|
|
75406
|
-
|
|
75551
|
+
resolve30(outcome);
|
|
75407
75552
|
}, "finish");
|
|
75408
75553
|
const killTree2 = /* @__PURE__ */ __name(() => {
|
|
75409
75554
|
if (child.pid !== void 0 && process.platform !== "win32") {
|
|
@@ -75955,7 +76100,7 @@ __name(summarizeBlocking, "summarizeBlocking");
|
|
|
75955
76100
|
|
|
75956
76101
|
// ../sdk/dist/manager/agent/lifecycle.js
|
|
75957
76102
|
import { realpath as realpath9, rm as rm2, stat as stat10 } from "node:fs/promises";
|
|
75958
|
-
import { isAbsolute as isAbsolute9, relative as relative5, resolve as
|
|
76103
|
+
import { isAbsolute as isAbsolute9, relative as relative5, resolve as resolve16, sep as sep7 } from "node:path";
|
|
75959
76104
|
|
|
75960
76105
|
// ../sdk/dist/session/handoff/capacity.js
|
|
75961
76106
|
var DelegationCapacityExceeded = class extends Error {
|
|
@@ -76046,14 +76191,14 @@ function mergeEnv(base3, override) {
|
|
|
76046
76191
|
__name(mergeEnv, "mergeEnv");
|
|
76047
76192
|
async function requireIsolatedWorktreePath(ref, callerCwd, subdirectory) {
|
|
76048
76193
|
const meta = ref?.meta;
|
|
76049
|
-
if (typeof ref?.id !== "string" || ref.id.length === 0 || meta?.backend !== "git-worktree" || typeof meta.repoRoot !== "string" || !isAbsolute9(meta.repoRoot) || typeof meta.branch !== "string" || meta.branch.length === 0 || typeof meta.worktreePath !== "string" || !isAbsolute9(meta.worktreePath) ||
|
|
76194
|
+
if (typeof ref?.id !== "string" || ref.id.length === 0 || meta?.backend !== "git-worktree" || typeof meta.repoRoot !== "string" || !isAbsolute9(meta.repoRoot) || typeof meta.branch !== "string" || meta.branch.length === 0 || typeof meta.worktreePath !== "string" || !isAbsolute9(meta.worktreePath) || resolve16(meta.worktreePath) === resolve16(callerCwd ?? process.cwd())) {
|
|
76050
76195
|
throw new Error("Isolated git-worktree driver returned an invalid workspace ref or path");
|
|
76051
76196
|
}
|
|
76052
76197
|
let physicalPaths;
|
|
76053
76198
|
try {
|
|
76054
76199
|
physicalPaths = await Promise.all([
|
|
76055
76200
|
realpath9(meta.worktreePath),
|
|
76056
|
-
realpath9(
|
|
76201
|
+
realpath9(resolve16(callerCwd ?? process.cwd()))
|
|
76057
76202
|
]);
|
|
76058
76203
|
if (!(await stat10(physicalPaths[0])).isDirectory()) {
|
|
76059
76204
|
throw new Error("The worktree path is not a directory");
|
|
@@ -76071,8 +76216,8 @@ async function requireIsolatedWorktreePath(ref, callerCwd, subdirectory) {
|
|
|
76071
76216
|
if (typeof subdirectory !== "string" || subdirectory.length === 0 || isAbsolute9(subdirectory)) {
|
|
76072
76217
|
throw new Error("Isolated workspace subdirectory must be a nonempty relative path");
|
|
76073
76218
|
}
|
|
76074
|
-
const lexicalChild =
|
|
76075
|
-
const lexicalRelative = relative5(
|
|
76219
|
+
const lexicalChild = resolve16(meta.worktreePath, subdirectory);
|
|
76220
|
+
const lexicalRelative = relative5(resolve16(meta.worktreePath), lexicalChild);
|
|
76076
76221
|
if (isAbsolute9(lexicalRelative) || lexicalRelative === ".." || lexicalRelative.startsWith(`..${sep7}`)) {
|
|
76077
76222
|
throw new Error("Isolated workspace subdirectory escapes the worktree");
|
|
76078
76223
|
}
|
|
@@ -76881,9 +77026,9 @@ var AgentManager = class {
|
|
|
76881
77026
|
if (isTerminalAgentTaskState(agentTask.state)) {
|
|
76882
77027
|
return Promise.resolve();
|
|
76883
77028
|
}
|
|
76884
|
-
return new Promise((
|
|
77029
|
+
return new Promise((resolve30) => {
|
|
76885
77030
|
const existing = this.completionCallbacks.get(taskId) ?? [];
|
|
76886
|
-
existing.push(
|
|
77031
|
+
existing.push(resolve30);
|
|
76887
77032
|
this.completionCallbacks.set(taskId, existing);
|
|
76888
77033
|
});
|
|
76889
77034
|
}
|
|
@@ -77090,7 +77235,7 @@ var AgentManager = class {
|
|
|
77090
77235
|
origin,
|
|
77091
77236
|
topicId: context2.topicId,
|
|
77092
77237
|
projectId: context2.projectId,
|
|
77093
|
-
cwd:
|
|
77238
|
+
cwd: resolve16(options.input.workingDirectory ?? process.cwd()),
|
|
77094
77239
|
log,
|
|
77095
77240
|
activeSubSessionId: origin.subSessionId
|
|
77096
77241
|
});
|
|
@@ -77235,7 +77380,7 @@ var AgentManager = class {
|
|
|
77235
77380
|
},
|
|
77236
77381
|
topicId: context2.topicId,
|
|
77237
77382
|
projectId: context2.projectId,
|
|
77238
|
-
cwd:
|
|
77383
|
+
cwd: resolve16(options.workingDirectory),
|
|
77239
77384
|
log
|
|
77240
77385
|
});
|
|
77241
77386
|
return restored;
|
|
@@ -77263,7 +77408,7 @@ var AgentManager = class {
|
|
|
77263
77408
|
throw new Error("Child conversation is still running or settling");
|
|
77264
77409
|
if (origin.workspaceRef || options.workspace?.mode === "isolated" || options.workspaceBackend)
|
|
77265
77410
|
throw new Error("Child continuation requires a shared workspace; isolated leases cannot be resumed");
|
|
77266
|
-
if (
|
|
77411
|
+
if (resolve16(options.input.workingDirectory ?? process.cwd()) !== conversation.cwd)
|
|
77267
77412
|
throw new Error("Child continuation cannot change its working directory");
|
|
77268
77413
|
const store = this.deps.sessionStore;
|
|
77269
77414
|
if (store.supportsInvocationSummaries !== true || store.supportsOwnerVersionCas !== true)
|
|
@@ -77602,8 +77747,8 @@ var AgentManager = class {
|
|
|
77602
77747
|
resolveCompletionCallbacks(taskId) {
|
|
77603
77748
|
const callbacks = this.completionCallbacks.get(taskId);
|
|
77604
77749
|
if (callbacks) {
|
|
77605
|
-
for (const
|
|
77606
|
-
|
|
77750
|
+
for (const resolve30 of callbacks)
|
|
77751
|
+
resolve30();
|
|
77607
77752
|
this.completionCallbacks.delete(taskId);
|
|
77608
77753
|
}
|
|
77609
77754
|
}
|
|
@@ -77797,7 +77942,7 @@ import { spawn as spawn3, spawnSync } from "node:child_process";
|
|
|
77797
77942
|
import { constants as constants3, accessSync as accessSync2, existsSync as existsSync4, realpathSync as realpathSync4 } from "node:fs";
|
|
77798
77943
|
import { readFile as fsReadFile, writeFile as fsWriteFile, mkdir as mkdir16, open as open10, readdir as readdir11, rename as rename7, rm as rm3, stat as stat11 } from "node:fs/promises";
|
|
77799
77944
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
77800
|
-
import { dirname as dirname18, isAbsolute as isAbsolute11, join as join31, parse as parse3, resolve as
|
|
77945
|
+
import { dirname as dirname18, isAbsolute as isAbsolute11, join as join31, parse as parse3, resolve as resolve17 } from "node:path";
|
|
77801
77946
|
|
|
77802
77947
|
// ../sdk/dist/sandbox/file-walk.js
|
|
77803
77948
|
var import_brace_expansion2 = __toESM(require_brace_expansion(), 1);
|
|
@@ -79977,7 +80122,7 @@ var LocalSandbox = class {
|
|
|
79977
80122
|
this.rootDir = rootDir;
|
|
79978
80123
|
this.environment = environment;
|
|
79979
80124
|
this.config = config;
|
|
79980
|
-
this.additionalDirectories = (config.additionalDirectories ?? []).map((dir) => canonicalizePath(
|
|
80125
|
+
this.additionalDirectories = (config.additionalDirectories ?? []).map((dir) => canonicalizePath(resolve17(dir))).filter((dir) => dir !== rootDir);
|
|
79981
80126
|
this._status = "ready";
|
|
79982
80127
|
this.log = log.child({
|
|
79983
80128
|
[SCOPE_ATTRIBUTE]: "sandbox/provider/local",
|
|
@@ -80370,7 +80515,7 @@ var LocalSandboxProvider = class {
|
|
|
80370
80515
|
let rootDir;
|
|
80371
80516
|
let removeRootOnDestroy;
|
|
80372
80517
|
if (config?.workingDirectory !== void 0) {
|
|
80373
|
-
const requested =
|
|
80518
|
+
const requested = resolve17(config.workingDirectory);
|
|
80374
80519
|
let entry;
|
|
80375
80520
|
try {
|
|
80376
80521
|
entry = await stat11(requested);
|
|
@@ -80393,9 +80538,9 @@ var LocalSandboxProvider = class {
|
|
|
80393
80538
|
}
|
|
80394
80539
|
removeRootOnDestroy = false;
|
|
80395
80540
|
for (const dir of config.additionalDirectories ?? []) {
|
|
80396
|
-
const entry2 = await stat11(
|
|
80541
|
+
const entry2 = await stat11(resolve17(dir)).catch(() => null);
|
|
80397
80542
|
if (!entry2?.isDirectory()) {
|
|
80398
|
-
throw new Error(`Sandbox additional directory is not a directory: ${
|
|
80543
|
+
throw new Error(`Sandbox additional directory is not a directory: ${resolve17(dir)}`);
|
|
80399
80544
|
}
|
|
80400
80545
|
}
|
|
80401
80546
|
} else {
|
|
@@ -80453,7 +80598,7 @@ var WorkspaceBackendRegistry = class {
|
|
|
80453
80598
|
import { execFile } from "node:child_process";
|
|
80454
80599
|
import { readFileSync as readFileSync2, realpathSync as realpathSync5 } from "node:fs";
|
|
80455
80600
|
import { realpath as realpath10 } from "node:fs/promises";
|
|
80456
|
-
import { basename as basename9, dirname as dirname19, isAbsolute as isAbsolute12, join as join32, relative as relative6, resolve as
|
|
80601
|
+
import { basename as basename9, dirname as dirname19, isAbsolute as isAbsolute12, join as join32, relative as relative6, resolve as resolve18, sep as sep9 } from "node:path";
|
|
80457
80602
|
import { promisify } from "node:util";
|
|
80458
80603
|
var execFileAsync = promisify(execFile);
|
|
80459
80604
|
var defaultExecFile = /* @__PURE__ */ __name(async (file, args) => execFileAsync(file, [...args]), "defaultExecFile");
|
|
@@ -80467,8 +80612,8 @@ var GitWorktreeDriver = class {
|
|
|
80467
80612
|
log;
|
|
80468
80613
|
exec;
|
|
80469
80614
|
constructor(config) {
|
|
80470
|
-
this.repoRoot =
|
|
80471
|
-
this.worktreesDir =
|
|
80615
|
+
this.repoRoot = resolve18(config.repoRoot);
|
|
80616
|
+
this.worktreesDir = resolve18(config.worktreesDir ?? defaultWorktreesDir(config.repoRoot));
|
|
80472
80617
|
this.log = config.logger.child({ [SCOPE_ATTRIBUTE]: "session/workspace/git-worktree" });
|
|
80473
80618
|
this.exec = config.execFile ?? defaultExecFile;
|
|
80474
80619
|
}
|
|
@@ -80481,7 +80626,7 @@ var GitWorktreeDriver = class {
|
|
|
80481
80626
|
try {
|
|
80482
80627
|
repoRoot = await canonicalizeThroughExisting(this.repoRoot);
|
|
80483
80628
|
worktreesDir = await canonicalizeThroughExisting(this.worktreesDir);
|
|
80484
|
-
const lexicalPath =
|
|
80629
|
+
const lexicalPath = resolve18(worktreesDir, label6);
|
|
80485
80630
|
if (!isStrictDescendant(worktreesDir, lexicalPath)) {
|
|
80486
80631
|
throw new Error(`Workspace label escapes the managed worktree directory: ${label6}`);
|
|
80487
80632
|
}
|
|
@@ -80684,12 +80829,12 @@ var GitWorktreeDriver = class {
|
|
|
80684
80829
|
}
|
|
80685
80830
|
};
|
|
80686
80831
|
async function canonicalizeThroughExisting(input) {
|
|
80687
|
-
let existing =
|
|
80832
|
+
let existing = resolve18(input);
|
|
80688
80833
|
const remainder = [];
|
|
80689
80834
|
for (; ; ) {
|
|
80690
80835
|
try {
|
|
80691
80836
|
const canonical3 = await realpath10(existing);
|
|
80692
|
-
return
|
|
80837
|
+
return resolve18(canonical3, ...remainder);
|
|
80693
80838
|
} catch (cause) {
|
|
80694
80839
|
const code = cause.code;
|
|
80695
80840
|
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
@@ -80697,7 +80842,7 @@ async function canonicalizeThroughExisting(input) {
|
|
|
80697
80842
|
}
|
|
80698
80843
|
const parent = dirname19(existing);
|
|
80699
80844
|
if (parent === existing)
|
|
80700
|
-
return
|
|
80845
|
+
return resolve18(existing, ...remainder);
|
|
80701
80846
|
remainder.unshift(basename9(existing));
|
|
80702
80847
|
existing = parent;
|
|
80703
80848
|
}
|
|
@@ -80739,7 +80884,7 @@ function defaultWorktreesDir(repoRoot) {
|
|
|
80739
80884
|
try {
|
|
80740
80885
|
cwd = realpathSync5(repoRoot);
|
|
80741
80886
|
} catch {
|
|
80742
|
-
cwd =
|
|
80887
|
+
cwd = resolve18(repoRoot);
|
|
80743
80888
|
}
|
|
80744
80889
|
const home = resolveNamzuHome();
|
|
80745
80890
|
let slug = slugForCwd(cwd);
|
|
@@ -80900,13 +81045,13 @@ var SessionSummaryMaterializer = class {
|
|
|
80900
81045
|
|
|
80901
81046
|
// ../sdk/dist/store/session/memory.js
|
|
80902
81047
|
import { realpathSync as realpathSync6 } from "node:fs";
|
|
80903
|
-
import { resolve as
|
|
81048
|
+
import { resolve as resolve20 } from "node:path";
|
|
80904
81049
|
|
|
80905
81050
|
// ../sdk/dist/store/session/canonical-path.js
|
|
80906
81051
|
import { realpath as realpath11 } from "node:fs/promises";
|
|
80907
|
-
import { resolve as
|
|
81052
|
+
import { resolve as resolve19 } from "node:path";
|
|
80908
81053
|
async function canonicalizePath2(input) {
|
|
80909
|
-
const absolute =
|
|
81054
|
+
const absolute = resolve19(input);
|
|
80910
81055
|
try {
|
|
80911
81056
|
return await realpath11(absolute);
|
|
80912
81057
|
} catch (err) {
|
|
@@ -80996,7 +81141,7 @@ var InMemorySessionStore = class {
|
|
|
80996
81141
|
} catch (error) {
|
|
80997
81142
|
if (error.code !== "ENOENT")
|
|
80998
81143
|
throw error;
|
|
80999
|
-
rootPath =
|
|
81144
|
+
rootPath = resolve20(project.rootPath);
|
|
81000
81145
|
}
|
|
81001
81146
|
const key5 = `${project.tenantId}\0${rootPath}`;
|
|
81002
81147
|
const existingProjectId = roots.get(key5);
|
|
@@ -81447,13 +81592,13 @@ __name(stepResident, "stepResident");
|
|
|
81447
81592
|
|
|
81448
81593
|
// ../sdk/dist/manager/resident/agenda.js
|
|
81449
81594
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
81450
|
-
import { join as join34, resolve as
|
|
81595
|
+
import { join as join34, resolve as resolve22 } from "node:path";
|
|
81451
81596
|
import { isDeepStrictEqual as isDeepStrictEqual6 } from "node:util";
|
|
81452
81597
|
|
|
81453
81598
|
// ../sdk/dist/manager/resident/history-disk.js
|
|
81454
81599
|
import { constants as constants4 } from "node:fs";
|
|
81455
81600
|
import { lstat as lstat9, open as open11 } from "node:fs/promises";
|
|
81456
|
-
import { join as join33, relative as relative7, resolve as
|
|
81601
|
+
import { join as join33, relative as relative7, resolve as resolve21, sep as sep10 } from "node:path";
|
|
81457
81602
|
var RECORD_BYTES2 = 4 * 1024 * 1024;
|
|
81458
81603
|
var ResidentHistoryPageLimit = class extends Error {
|
|
81459
81604
|
static {
|
|
@@ -81462,8 +81607,8 @@ var ResidentHistoryPageLimit = class extends Error {
|
|
|
81462
81607
|
};
|
|
81463
81608
|
async function readResidentHistoryRecord(root, path2, budget) {
|
|
81464
81609
|
budget.signal?.throwIfAborted();
|
|
81465
|
-
const base3 =
|
|
81466
|
-
const suffix = relative7(base3,
|
|
81610
|
+
const base3 = resolve21(root);
|
|
81611
|
+
const suffix = relative7(base3, resolve21(path2));
|
|
81467
81612
|
if (suffix === ".." || suffix.startsWith(`..${sep10}`))
|
|
81468
81613
|
throw new Error("Invalid history path.");
|
|
81469
81614
|
let current = base3;
|
|
@@ -82038,8 +82183,8 @@ var DiskResidentAgenda = class {
|
|
|
82038
82183
|
revisionsDir: join34(directory, "revisions"),
|
|
82039
82184
|
publishLegacyProjection: false
|
|
82040
82185
|
};
|
|
82041
|
-
this.historyRoot =
|
|
82042
|
-
this.historyRevisions =
|
|
82186
|
+
this.historyRoot = resolve22(root);
|
|
82187
|
+
this.historyRevisions = resolve22(this.location.revisionsDir);
|
|
82043
82188
|
}
|
|
82044
82189
|
checked(record3) {
|
|
82045
82190
|
const agenda = agendaSchema.parse(record3);
|
|
@@ -83719,7 +83864,7 @@ __name(selectLearningExperience, "selectLearningExperience");
|
|
|
83719
83864
|
// ../sdk/dist/learning/experience-store.js
|
|
83720
83865
|
import { mkdirSync as mkdirSync4 } from "node:fs";
|
|
83721
83866
|
import { createRequire as createRequire3 } from "node:module";
|
|
83722
|
-
import { dirname as dirname20, resolve as
|
|
83867
|
+
import { dirname as dirname20, resolve as resolve23 } from "node:path";
|
|
83723
83868
|
var SCHEMA7 = `
|
|
83724
83869
|
CREATE TABLE experience (
|
|
83725
83870
|
ordinal INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -83741,7 +83886,7 @@ var SqliteLearningExperienceStore = class {
|
|
|
83741
83886
|
scope;
|
|
83742
83887
|
readOnly;
|
|
83743
83888
|
constructor(options) {
|
|
83744
|
-
this.databasePath =
|
|
83889
|
+
this.databasePath = resolve23(options.databasePath);
|
|
83745
83890
|
this.scope = Object.freeze({
|
|
83746
83891
|
tenantId: asTenantId(options.scope.tenantId.toLowerCase()),
|
|
83747
83892
|
projectId: asProjectId(options.scope.projectId.toLowerCase()),
|
|
@@ -84079,7 +84224,7 @@ __name(createResidentToolEvidenceSource, "createResidentToolEvidenceSource");
|
|
|
84079
84224
|
import { createHash as createHash30, randomUUID as randomUUID14 } from "node:crypto";
|
|
84080
84225
|
import { closeSync as closeSync2, existsSync as existsSync5, fsyncSync as fsyncSync2, linkSync as linkSync2, lstatSync as lstatSync4, mkdirSync as mkdirSync5, openSync as openSync2, readFileSync as readFileSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
84081
84226
|
import { createRequire as createRequire4 } from "node:module";
|
|
84082
|
-
import { dirname as dirname21, join as join35, resolve as
|
|
84227
|
+
import { dirname as dirname21, join as join35, resolve as resolve24 } from "node:path";
|
|
84083
84228
|
|
|
84084
84229
|
// ../sdk/dist/learning/observation.js
|
|
84085
84230
|
var label5 = external_exports.string().trim().min(1).max(256);
|
|
@@ -84209,8 +84354,8 @@ var SqliteLearningStore = class {
|
|
|
84209
84354
|
scope;
|
|
84210
84355
|
readOnly;
|
|
84211
84356
|
constructor(options) {
|
|
84212
|
-
this.databasePath =
|
|
84213
|
-
this.artifactsPath =
|
|
84357
|
+
this.databasePath = resolve24(options.databasePath);
|
|
84358
|
+
this.artifactsPath = resolve24(options.artifactsPath);
|
|
84214
84359
|
this.scope = Object.freeze({
|
|
84215
84360
|
tenantId: asTenantId(options.scope.tenantId.toLowerCase()),
|
|
84216
84361
|
projectId: asProjectId(options.scope.projectId.toLowerCase()),
|
|
@@ -84896,7 +85041,7 @@ function connectPath(address2) {
|
|
|
84896
85041
|
}
|
|
84897
85042
|
__name(connectPath, "connectPath");
|
|
84898
85043
|
function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
|
|
84899
|
-
return new Promise((
|
|
85044
|
+
return new Promise((resolve30) => {
|
|
84900
85045
|
let settled = false;
|
|
84901
85046
|
const finish2 = /* @__PURE__ */ __name((result) => {
|
|
84902
85047
|
if (settled)
|
|
@@ -84904,7 +85049,7 @@ function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
|
|
|
84904
85049
|
settled = true;
|
|
84905
85050
|
clearTimeout(timer);
|
|
84906
85051
|
socket.destroy();
|
|
84907
|
-
|
|
85052
|
+
resolve30(result);
|
|
84908
85053
|
}, "finish");
|
|
84909
85054
|
const unreachable = /* @__PURE__ */ __name((error) => finish2({
|
|
84910
85055
|
kind: "unreachable",
|
|
@@ -84916,7 +85061,7 @@ function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
|
|
|
84916
85061
|
path2 = connectPath(address2);
|
|
84917
85062
|
} catch (error) {
|
|
84918
85063
|
clearTimeout(timer);
|
|
84919
|
-
|
|
85064
|
+
resolve30({
|
|
84920
85065
|
kind: "unreachable",
|
|
84921
85066
|
reason: error instanceof Error ? error.message : String(error)
|
|
84922
85067
|
});
|
|
@@ -85425,23 +85570,23 @@ async function createPeerEndpoint(options) {
|
|
|
85425
85570
|
void handleLine(buffered.subarray(0, newline)).catch(() => socket.destroy());
|
|
85426
85571
|
});
|
|
85427
85572
|
});
|
|
85428
|
-
await new Promise((
|
|
85573
|
+
await new Promise((resolve30, reject2) => {
|
|
85429
85574
|
const failed = /* @__PURE__ */ __name((error) => reject2(error), "failed");
|
|
85430
85575
|
server.once("error", failed);
|
|
85431
85576
|
server.listen({ path: listenPath }, () => {
|
|
85432
85577
|
server.removeListener("error", failed);
|
|
85433
|
-
|
|
85578
|
+
resolve30();
|
|
85434
85579
|
});
|
|
85435
85580
|
});
|
|
85436
85581
|
server.on("error", () => {
|
|
85437
85582
|
});
|
|
85438
85583
|
if (parsed.scheme === "uds")
|
|
85439
85584
|
chmodSync3(listenPath, 384);
|
|
85440
|
-
const close = /* @__PURE__ */ __name(() => new Promise((
|
|
85585
|
+
const close = /* @__PURE__ */ __name(() => new Promise((resolve30) => {
|
|
85441
85586
|
closing = true;
|
|
85442
85587
|
for (const socket of sockets)
|
|
85443
85588
|
socket.destroy();
|
|
85444
|
-
server.close(() =>
|
|
85589
|
+
server.close(() => resolve30());
|
|
85445
85590
|
}), "close");
|
|
85446
85591
|
return {
|
|
85447
85592
|
address: options.address,
|
|
@@ -86045,7 +86190,7 @@ var PalRuntime = class {
|
|
|
86045
86190
|
// ../sdk/dist/pals/communication/store.js
|
|
86046
86191
|
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
86047
86192
|
import { chmodSync as chmodSync4, lstatSync as lstatSync8, mkdirSync as mkdirSync7, readdirSync as readdirSync3, realpathSync as realpathSync7 } from "node:fs";
|
|
86048
|
-
import { join as join39, resolve as
|
|
86193
|
+
import { join as join39, resolve as resolve25 } from "node:path";
|
|
86049
86194
|
import { isDeepStrictEqual as isDeepStrictEqual8 } from "node:util";
|
|
86050
86195
|
|
|
86051
86196
|
// ../sdk/dist/pals/communication/ingress-types.js
|
|
@@ -86279,7 +86424,7 @@ var DiskPalCommunicationStore = class {
|
|
|
86279
86424
|
migrations: { 1: (value) => value }
|
|
86280
86425
|
}), "Pal communication", (record3) => record3.revision);
|
|
86281
86426
|
constructor(options) {
|
|
86282
|
-
this.root =
|
|
86427
|
+
this.root = resolve25(options.root);
|
|
86283
86428
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
86284
86429
|
if (process.platform !== "win32")
|
|
86285
86430
|
chmodSync4(path2, 448);
|
|
@@ -86754,7 +86899,7 @@ var PalMessageBroker = class {
|
|
|
86754
86899
|
|
|
86755
86900
|
// ../sdk/dist/pals/communication/policy.js
|
|
86756
86901
|
import { chmodSync as chmodSync5, lstatSync as lstatSync9, mkdirSync as mkdirSync8, readdirSync as readdirSync4, realpathSync as realpathSync8 } from "node:fs";
|
|
86757
|
-
import { join as join40, resolve as
|
|
86902
|
+
import { join as join40, resolve as resolve26 } from "node:path";
|
|
86758
86903
|
var PalMessagePermissionConflictError = class extends Error {
|
|
86759
86904
|
static {
|
|
86760
86905
|
__name(this, "PalMessagePermissionConflictError");
|
|
@@ -86790,7 +86935,7 @@ var DiskPalMessagePolicy = class {
|
|
|
86790
86935
|
secure;
|
|
86791
86936
|
records = new DiskRevisionRecordStore(defineSchema({ kind: "pal-message-permission", current: 1, migrations: {} }), "Pal message permission", (value) => value.revision);
|
|
86792
86937
|
constructor(options) {
|
|
86793
|
-
this.root =
|
|
86938
|
+
this.root = resolve26(options.root);
|
|
86794
86939
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
86795
86940
|
if (process.platform !== "win32")
|
|
86796
86941
|
chmodSync5(path2, 448);
|
|
@@ -87431,7 +87576,7 @@ __name(dispatchPalIngressOnce, "dispatchPalIngressOnce");
|
|
|
87431
87576
|
|
|
87432
87577
|
// ../sdk/dist/pals/activity/subscription-store.js
|
|
87433
87578
|
import { chmodSync as chmodSync6, lstatSync as lstatSync10, mkdirSync as mkdirSync9, readdirSync as readdirSync5, realpathSync as realpathSync9 } from "node:fs";
|
|
87434
|
-
import { join as join41, resolve as
|
|
87579
|
+
import { join as join41, resolve as resolve27 } from "node:path";
|
|
87435
87580
|
import { isDeepStrictEqual as isDeepStrictEqual9 } from "node:util";
|
|
87436
87581
|
|
|
87437
87582
|
// ../sdk/dist/pals/activity/subscription-schema.js
|
|
@@ -87470,7 +87615,7 @@ var DiskPalActivitySubscriptionStore = class {
|
|
|
87470
87615
|
migrations: {}
|
|
87471
87616
|
}), "Pal activity subscription", (value) => value.revision);
|
|
87472
87617
|
constructor(options) {
|
|
87473
|
-
this.root =
|
|
87618
|
+
this.root = resolve27(options.root);
|
|
87474
87619
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
87475
87620
|
if (process.platform !== "win32")
|
|
87476
87621
|
chmodSync6(path2, 448);
|
|
@@ -87592,7 +87737,7 @@ var DiskPalActivitySubscriptionStore = class {
|
|
|
87592
87737
|
|
|
87593
87738
|
// ../sdk/dist/pals/activity/subscription-policy.js
|
|
87594
87739
|
import { chmodSync as chmodSync7, lstatSync as lstatSync11, mkdirSync as mkdirSync10, readdirSync as readdirSync6, realpathSync as realpathSync10 } from "node:fs";
|
|
87595
|
-
import { join as join42, resolve as
|
|
87740
|
+
import { join as join42, resolve as resolve28 } from "node:path";
|
|
87596
87741
|
import { isDeepStrictEqual as isDeepStrictEqual10 } from "node:util";
|
|
87597
87742
|
var PalActivitySubscriptionPermissionConflictError = class extends Error {
|
|
87598
87743
|
static {
|
|
@@ -87627,7 +87772,7 @@ var DiskPalActivitySubscriptionPolicy = class {
|
|
|
87627
87772
|
migrations: {}
|
|
87628
87773
|
}), "Pal activity subscription permission", (value) => value.revision);
|
|
87629
87774
|
constructor(options) {
|
|
87630
|
-
this.root =
|
|
87775
|
+
this.root = resolve28(options.root);
|
|
87631
87776
|
this.subscriptions = options.subscriptions;
|
|
87632
87777
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
87633
87778
|
if (process.platform !== "win32")
|
|
@@ -89160,7 +89305,7 @@ function shellProgress(report) {
|
|
|
89160
89305
|
__name(shellProgress, "shellProgress");
|
|
89161
89306
|
function execHostShell(command, options) {
|
|
89162
89307
|
options.signal?.throwIfAborted();
|
|
89163
|
-
return new Promise((
|
|
89308
|
+
return new Promise((resolve30, reject2) => {
|
|
89164
89309
|
const child = spawnHostShell(command, {
|
|
89165
89310
|
cwd: options.cwd,
|
|
89166
89311
|
env: options.env,
|
|
@@ -89261,7 +89406,7 @@ function execHostShell(command, options) {
|
|
|
89261
89406
|
const stdout = decodeCapture("stdout");
|
|
89262
89407
|
const stderr = decodeCapture("stderr");
|
|
89263
89408
|
if (!failure2 && cause === void 0 && code === 0 && signal === null) {
|
|
89264
|
-
|
|
89409
|
+
resolve30({
|
|
89265
89410
|
stdout,
|
|
89266
89411
|
stderr,
|
|
89267
89412
|
stdoutBytes: captures.stdout.bytes,
|
|
@@ -89308,7 +89453,7 @@ ${stderr}`));
|
|
|
89308
89453
|
child.off("close", onClose);
|
|
89309
89454
|
child.off("error", onError);
|
|
89310
89455
|
child.off("spawn", onSpawn);
|
|
89311
|
-
|
|
89456
|
+
resolve30({
|
|
89312
89457
|
backgroundedJobId: jobId,
|
|
89313
89458
|
stdout: decodeCapture("stdout"),
|
|
89314
89459
|
stderr: decodeCapture("stderr")
|
|
@@ -93053,7 +93198,7 @@ var GlobTool = defineTool({
|
|
|
93053
93198
|
});
|
|
93054
93199
|
|
|
93055
93200
|
// ../sdk/dist/tools/builtins/grep.js
|
|
93056
|
-
import { readFile as
|
|
93201
|
+
import { readFile as readFile18, stat as stat13 } from "node:fs/promises";
|
|
93057
93202
|
import { isAbsolute as isAbsolute15, join as join44, relative as relative10, sep as sep13 } from "node:path";
|
|
93058
93203
|
async function readWithSignal(read, signal) {
|
|
93059
93204
|
signal?.throwIfAborted();
|
|
@@ -93204,7 +93349,7 @@ var GrepTool = defineTool({
|
|
|
93204
93349
|
try {
|
|
93205
93350
|
const buffer = await readWithSignal(() => sandbox ? sandbox.readFile(filePath) : resolveWithinReal(root, filePath).then((path2) => {
|
|
93206
93351
|
contained2 = path2;
|
|
93207
|
-
return
|
|
93352
|
+
return readFile18(path2, { signal: context2.abortSignal });
|
|
93208
93353
|
}), context2.abortSignal);
|
|
93209
93354
|
context2.abortSignal?.throwIfAborted();
|
|
93210
93355
|
if (buffer.length > MAX_FILE_SIZE || isBinaryContent(buffer))
|
|
@@ -93501,7 +93646,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
|
|
|
93501
93646
|
omittedOutputBytes
|
|
93502
93647
|
};
|
|
93503
93648
|
});
|
|
93504
|
-
const expiry = new Promise((
|
|
93649
|
+
const expiry = new Promise((resolve30) => {
|
|
93505
93650
|
const tick = setInterval(() => {
|
|
93506
93651
|
if (settled)
|
|
93507
93652
|
return;
|
|
@@ -93509,7 +93654,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
|
|
|
93509
93654
|
const elapsed = now() - startedAt;
|
|
93510
93655
|
if (elapsed >= options.wallMs) {
|
|
93511
93656
|
clearInterval(tick);
|
|
93512
|
-
|
|
93657
|
+
resolve30({
|
|
93513
93658
|
kind: "timeout",
|
|
93514
93659
|
cause: "wall",
|
|
93515
93660
|
elapsedMs: elapsed,
|
|
@@ -93524,7 +93669,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
|
|
|
93524
93669
|
const quietFor = now() - lastProgressAt;
|
|
93525
93670
|
if (quietFor >= options.idleMs) {
|
|
93526
93671
|
clearInterval(tick);
|
|
93527
|
-
|
|
93672
|
+
resolve30({
|
|
93528
93673
|
kind: "timeout",
|
|
93529
93674
|
cause: "idle",
|
|
93530
93675
|
elapsedMs: elapsed,
|
|
@@ -93755,7 +93900,7 @@ ${observed}
|
|
|
93755
93900
|
|
|
93756
93901
|
// ../sdk/dist/tools/builtins/verify-outputs.js
|
|
93757
93902
|
import { stat as stat14 } from "node:fs/promises";
|
|
93758
|
-
import { resolve as
|
|
93903
|
+
import { resolve as resolve29 } from "node:path";
|
|
93759
93904
|
var inputSchema16 = external_exports.object({
|
|
93760
93905
|
paths: external_exports.array(external_exports.string().min(1)).min(1).describe("Expected output file paths to verify. Each path is checked for existence and size."),
|
|
93761
93906
|
min_bytes: external_exports.number().int().min(0).optional().describe("Minimum acceptable file size in bytes. A file under this size counts as missing. Default: 1 (any non-empty file passes).")
|
|
@@ -93811,7 +93956,7 @@ async function verifyOne(input) {
|
|
|
93811
93956
|
};
|
|
93812
93957
|
}
|
|
93813
93958
|
}
|
|
93814
|
-
const filePath =
|
|
93959
|
+
const filePath = resolve29(context2.workingDirectory, path2);
|
|
93815
93960
|
try {
|
|
93816
93961
|
const info = await stat14(filePath);
|
|
93817
93962
|
if (!info.isFile()) {
|
|
@@ -96472,4 +96617,4 @@ export {
|
|
|
96472
96617
|
buildResidentToolEvidenceTools,
|
|
96473
96618
|
createPalMessagingTools
|
|
96474
96619
|
};
|
|
96475
|
-
//# sourceMappingURL=chunk-
|
|
96620
|
+
//# sourceMappingURL=chunk-6FSVNUBA.js.map
|