@namzu/cli 39.1.0 → 39.2.0
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 +24 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-7MS4QWHQ.js → acp-OOJ6EBDV.js} +35 -35
- package/dist/chunks/{activity-command-ZLQTSOOT.js → activity-command-H7YPFJXX.js} +11 -11
- package/dist/chunks/{add-I77S5XFR.js → add-E46I4MLS.js} +15 -15
- package/dist/chunks/{agent-CD2IIXPD.js → agent-A3IFU43K.js} +26 -26
- package/dist/chunks/agent-session-V7NDZWPF.js +53 -0
- package/dist/chunks/{archive-JRJTOPHL.js → archive-FWKUN3JD.js} +9 -9
- package/dist/chunks/{bin-main-KTQUVYIP.js → bin-main-YOWKMTAT.js} +3 -3
- package/dist/chunks/{browser-OKCFCNCP.js → browser-ZISCIIZG.js} +6 -6
- package/dist/chunks/{chat-LTGXH6SR.js → chat-JNYLC4XC.js} +14 -14
- package/dist/chunks/{chunk-24FWPXME.js → chunk-2SPJH5HF.js} +3 -3
- package/dist/chunks/{chunk-7K7VDUT3.js → chunk-2ZRQG2PH.js} +28 -28
- package/dist/chunks/{chunk-QFAZWIVS.js → chunk-52NW6KXV.js} +4 -4
- package/dist/chunks/{chunk-HYJTH4L6.js → chunk-5ED3H3C7.js} +2 -2
- package/dist/chunks/{chunk-2TEGJRBM.js → chunk-5WZ63LBF.js} +2 -2
- package/dist/chunks/{chunk-DXQQSQQ3.js → chunk-5Y3XJ2QD.js} +9 -9
- package/dist/chunks/{chunk-UB6WVOKM.js → chunk-62GB6STC.js} +4 -4
- package/dist/chunks/{chunk-GQBSRXFY.js → chunk-65L26A6S.js} +4 -4
- package/dist/chunks/{chunk-CI3SKMXQ.js → chunk-6E2F73CY.js} +2 -2
- package/dist/chunks/{chunk-6AH52DNV.js → chunk-7T6O6HZO.js} +2 -2
- package/dist/chunks/{chunk-67YTCGFQ.js → chunk-A2PPMNCN.js} +4 -4
- package/dist/chunks/{chunk-JDS4SYAJ.js → chunk-AJMJHLWZ.js} +2 -2
- package/dist/chunks/{chunk-WICKQJR4.js → chunk-ARILZQYC.js} +5 -5
- package/dist/chunks/{chunk-2GO7AWHX.js → chunk-AWDFNOGP.js} +2 -2
- package/dist/chunks/{chunk-6MRGH7S5.js → chunk-AZCFI7C6.js} +671 -149
- package/dist/chunks/chunk-AZCFI7C6.js.map +6 -0
- package/dist/chunks/{chunk-RI5G5NS3.js → chunk-BD7DGINR.js} +4 -4
- package/dist/chunks/{chunk-IAA2O76K.js → chunk-BTSYFCBK.js} +2 -2
- package/dist/chunks/{chunk-JBYO5UWH.js → chunk-BVUYBGWV.js} +6 -6
- package/dist/chunks/{chunk-H2SFQIVZ.js → chunk-COI6QKBD.js} +5 -5
- package/dist/chunks/{chunk-PWO4HKDQ.js → chunk-CWFDC3IX.js} +2 -2
- package/dist/chunks/{chunk-SVTNQGLN.js → chunk-D24BFQ2R.js} +13 -13
- package/dist/chunks/{chunk-ECO3KP5U.js → chunk-D57LFZYV.js} +3 -3
- package/dist/chunks/{chunk-CYGNCTMI.js → chunk-DEYB7GQW.js} +2 -2
- package/dist/chunks/{chunk-5BULAR3C.js → chunk-DJCBJ4D2.js} +2 -2
- package/dist/chunks/{chunk-44JEVSTR.js → chunk-DK6MIKJ5.js} +7 -7
- package/dist/chunks/{chunk-BYJ4AGMC.js → chunk-DQIPEDOM.js} +2 -2
- package/dist/chunks/{chunk-6A5BVWEI.js → chunk-EWD65LWA.js} +2 -2
- package/dist/chunks/{chunk-L5EE2M32.js → chunk-FCM3BH55.js} +3 -3
- package/dist/chunks/{chunk-X62U63KJ.js → chunk-FEANPQH4.js} +3 -3
- package/dist/chunks/{chunk-EXL2ALVX.js → chunk-FZZU6FGO.js} +2 -2
- package/dist/chunks/{chunk-XOIV3R6O.js → chunk-J3JUC6J6.js} +6 -6
- package/dist/chunks/{chunk-4UYGMFWB.js → chunk-JBI7VU5W.js} +2 -2
- package/dist/chunks/{chunk-NNSCLV6S.js → chunk-JC37Z4C2.js} +3 -3
- package/dist/chunks/{chunk-CL475F3V.js → chunk-JPWIGZJ4.js} +2 -2
- package/dist/chunks/{chunk-5GVYGWMK.js → chunk-K2WHGUA7.js} +2 -2
- package/dist/chunks/{chunk-VIRFJSX6.js → chunk-KG5YQMJ7.js} +8 -8
- package/dist/chunks/{chunk-5CKCYCPL.js → chunk-KVYTZCCO.js} +2 -2
- package/dist/chunks/{chunk-BGI5U5XL.js → chunk-KYEHKRUB.js} +4 -4
- package/dist/chunks/{chunk-DCAKHMT4.js → chunk-L4M6ZSF6.js} +4 -4
- package/dist/chunks/{chunk-VMJWG5TF.js → chunk-LNANLHGE.js} +3 -3
- package/dist/chunks/{chunk-WUBN6DXH.js → chunk-MD7SYK6K.js} +2 -2
- package/dist/chunks/{chunk-64WCX6UV.js → chunk-OIRKBC2L.js} +3 -3
- package/dist/chunks/{chunk-QYIY7Q5R.js → chunk-P5GCOEET.js} +4 -4
- package/dist/chunks/{chunk-NXLK7UAG.js → chunk-Q733LA67.js} +4 -4
- package/dist/chunks/{chunk-SYMXDX7F.js → chunk-QGU3QOXI.js} +2 -2
- package/dist/chunks/{chunk-YVJTVJN4.js → chunk-RGCA3YZA.js} +2 -2
- package/dist/chunks/{chunk-FTZT4UAB.js → chunk-RKMGVFLZ.js} +573 -307
- package/dist/chunks/chunk-RKMGVFLZ.js.map +6 -0
- package/dist/chunks/{chunk-MBGTDQFF.js → chunk-S7HFDW5W.js} +3 -3
- package/dist/chunks/{chunk-QX6YDLUD.js → chunk-SN4RRU3A.js} +7 -7
- package/dist/chunks/{chunk-VUBQ6IRM.js → chunk-TAWI7GF2.js} +2 -2
- package/dist/chunks/{chunk-ERSRQ6QN.js → chunk-TQ2PH66J.js} +3 -3
- package/dist/chunks/{chunk-YH7CW765.js → chunk-U4A4C4GE.js} +4 -4
- package/dist/chunks/{chunk-A7F56OV6.js → chunk-UJ7NTALX.js} +12 -12
- package/dist/chunks/{chunk-PAJTVGYM.js → chunk-VPDXH3ZZ.js} +3 -3
- package/dist/chunks/{chunk-D7UUTTLG.js → chunk-XJMHPZGJ.js} +3 -3
- package/dist/chunks/{chunk-NFCBNDBG.js → chunk-XRLM7PL2.js} +12 -12
- package/dist/chunks/{chunk-HZH2LZR3.js → chunk-YN5PDLFB.js} +2 -2
- package/dist/chunks/{chunk-XLPUR46F.js → chunk-ZGL3HYDE.js} +2 -2
- package/dist/chunks/{cli-runtime-KLGRRAPC.js → cli-runtime-KFHNZS4M.js} +10 -10
- package/dist/chunks/{commands-UQGS6244.js → commands-7FSE67S7.js} +5 -5
- package/dist/chunks/{crash-report-F3CLYQ6A.js → crash-report-5S6I2H4P.js} +6 -6
- package/dist/chunks/{dist-FFM3ZZQ4.js → dist-2QEEO2BO.js} +2 -2
- package/dist/chunks/{dist-BF3HQ6PJ.js → dist-BMP4NVQA.js} +2 -2
- package/dist/chunks/{dist-SGU5HCLT.js → dist-EC2S5MA6.js} +2 -2
- package/dist/chunks/{dist-BYIBYB4E.js → dist-KGS4QDJL.js} +2 -2
- package/dist/chunks/{dist-FE7KZYMC.js → dist-MLM3PBXB.js} +2 -2
- package/dist/chunks/{dist-MMWDBT7P.js → dist-VMJECBAZ.js} +2 -2
- package/dist/chunks/{dist-TZU45EHB.js → dist-ZHD7MSXC.js} +2 -2
- package/dist/chunks/{doctor-6ZZOTVMF.js → doctor-P67RCEDL.js} +8 -8
- package/dist/chunks/{drain-XK5PA7E5.js → drain-GXTL5M2V.js} +10 -10
- package/dist/chunks/{eval-RPKIJFAB.js → eval-TGCAUXM6.js} +2 -2
- package/dist/chunks/{exec-DJ4ECSDD.js → exec-KGTWE4LA.js} +25 -25
- package/dist/chunks/{home-ZAIMBEH7.js → home-PZO47UU7.js} +3 -3
- package/dist/chunks/{host-queries-AMSRIPNG.js → host-queries-QOFBCKMJ.js} +14 -14
- package/dist/chunks/{lifecycle-L4E6FPYN.js → lifecycle-DPH2KOCH.js} +23 -23
- package/dist/chunks/{list-2QTHV4YO.js → list-ILFBHQS7.js} +11 -11
- package/dist/chunks/{login-QMOTL6Y5.js → login-EUEB5HLK.js} +8 -8
- package/dist/chunks/{logs-JIQJGYVR.js → logs-F2II4CCT.js} +4 -4
- package/dist/chunks/{mcp-ZCRO5DB3.js → mcp-KPJ7KVE4.js} +16 -16
- package/dist/chunks/{message-command-2SCMXO4D.js → message-command-I3J5NA35.js} +32 -32
- package/dist/chunks/{operator-tools-23FYQ5OE.js → operator-tools-2SI6AFFF.js} +12 -12
- package/dist/chunks/{output-schema-RTXHP2NW.js → output-schema-PJNYSOO5.js} +3 -3
- package/dist/chunks/{pal-AC73MLO6.js → pal-7ILZQGYB.js} +11 -11
- package/dist/chunks/{providers-SUXIFNA4.js → providers-MD4HAS6J.js} +6 -6
- package/dist/chunks/{resident-VFEZDABF.js → resident-HVI3YGHH.js} +20 -20
- package/dist/chunks/resume-R2OYMKYY.js +22 -0
- package/dist/chunks/{resume-command-PZ3NLBOR.js → resume-command-EVY3VMMM.js} +4 -4
- package/dist/chunks/{schedule-4KYTYQML.js → schedule-QCGOB5T2.js} +8 -8
- package/dist/chunks/{service-NI46RYPW.js → service-MVQA56RE.js} +22 -22
- package/dist/chunks/session-step-XAOTLL4U.js +29 -0
- package/dist/chunks/{skills-OYRPNK3I.js → skills-MTR3YGWW.js} +8 -8
- package/dist/chunks/{state-ULVIHH2M.js → state-5GSLSGR2.js} +2 -2
- package/dist/chunks/{store-3LVJZEHS.js → store-P2I5OF2S.js} +4 -4
- package/dist/chunks/{store-W2VNXICH.js → store-SQUUV4YQ.js} +9 -9
- package/dist/chunks/{store-EOHDDBM7.js → store-UMSGE2UE.js} +6 -6
- package/dist/chunks/{tui-GEHRYWRG.js → tui-5EKXXN5S.js} +46 -46
- package/dist/chunks/{upgrade-LSB2KNDF.js → upgrade-OZE2Z2OV.js} +2 -2
- package/dist/chunks/{worktree-PZU6IAUF.js → worktree-452AXJPV.js} +11 -11
- package/dist/index.js +12 -12
- package/dist/integrations/resident/runner-worker.js +18 -18
- package/dist/integrations/sessions/conversation-search.d.ts +10 -1
- package/dist/integrations/sessions/conversation-search.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +3 -1
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/saved-agents.d.ts +7 -5
- package/dist/integrations/subagents/saved-agents.d.ts.map +1 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/chunks/agent-session-6F55DYFA.js +0 -53
- package/dist/chunks/chunk-6MRGH7S5.js.map +0 -6
- package/dist/chunks/chunk-FTZT4UAB.js.map +0 -6
- package/dist/chunks/resume-I3YLV7D3.js +0 -22
- package/dist/chunks/session-step-IR57BRZX.js +0 -29
- /package/dist/chunks/{acp-7MS4QWHQ.js.map → acp-OOJ6EBDV.js.map} +0 -0
- /package/dist/chunks/{activity-command-ZLQTSOOT.js.map → activity-command-H7YPFJXX.js.map} +0 -0
- /package/dist/chunks/{add-I77S5XFR.js.map → add-E46I4MLS.js.map} +0 -0
- /package/dist/chunks/{agent-CD2IIXPD.js.map → agent-A3IFU43K.js.map} +0 -0
- /package/dist/chunks/{agent-session-6F55DYFA.js.map → agent-session-V7NDZWPF.js.map} +0 -0
- /package/dist/chunks/{archive-JRJTOPHL.js.map → archive-FWKUN3JD.js.map} +0 -0
- /package/dist/chunks/{bin-main-KTQUVYIP.js.map → bin-main-YOWKMTAT.js.map} +0 -0
- /package/dist/chunks/{browser-OKCFCNCP.js.map → browser-ZISCIIZG.js.map} +0 -0
- /package/dist/chunks/{chat-LTGXH6SR.js.map → chat-JNYLC4XC.js.map} +0 -0
- /package/dist/chunks/{chunk-24FWPXME.js.map → chunk-2SPJH5HF.js.map} +0 -0
- /package/dist/chunks/{chunk-7K7VDUT3.js.map → chunk-2ZRQG2PH.js.map} +0 -0
- /package/dist/chunks/{chunk-QFAZWIVS.js.map → chunk-52NW6KXV.js.map} +0 -0
- /package/dist/chunks/{chunk-HYJTH4L6.js.map → chunk-5ED3H3C7.js.map} +0 -0
- /package/dist/chunks/{chunk-2TEGJRBM.js.map → chunk-5WZ63LBF.js.map} +0 -0
- /package/dist/chunks/{chunk-DXQQSQQ3.js.map → chunk-5Y3XJ2QD.js.map} +0 -0
- /package/dist/chunks/{chunk-UB6WVOKM.js.map → chunk-62GB6STC.js.map} +0 -0
- /package/dist/chunks/{chunk-GQBSRXFY.js.map → chunk-65L26A6S.js.map} +0 -0
- /package/dist/chunks/{chunk-CI3SKMXQ.js.map → chunk-6E2F73CY.js.map} +0 -0
- /package/dist/chunks/{chunk-6AH52DNV.js.map → chunk-7T6O6HZO.js.map} +0 -0
- /package/dist/chunks/{chunk-67YTCGFQ.js.map → chunk-A2PPMNCN.js.map} +0 -0
- /package/dist/chunks/{chunk-JDS4SYAJ.js.map → chunk-AJMJHLWZ.js.map} +0 -0
- /package/dist/chunks/{chunk-WICKQJR4.js.map → chunk-ARILZQYC.js.map} +0 -0
- /package/dist/chunks/{chunk-2GO7AWHX.js.map → chunk-AWDFNOGP.js.map} +0 -0
- /package/dist/chunks/{chunk-RI5G5NS3.js.map → chunk-BD7DGINR.js.map} +0 -0
- /package/dist/chunks/{chunk-IAA2O76K.js.map → chunk-BTSYFCBK.js.map} +0 -0
- /package/dist/chunks/{chunk-JBYO5UWH.js.map → chunk-BVUYBGWV.js.map} +0 -0
- /package/dist/chunks/{chunk-H2SFQIVZ.js.map → chunk-COI6QKBD.js.map} +0 -0
- /package/dist/chunks/{chunk-PWO4HKDQ.js.map → chunk-CWFDC3IX.js.map} +0 -0
- /package/dist/chunks/{chunk-SVTNQGLN.js.map → chunk-D24BFQ2R.js.map} +0 -0
- /package/dist/chunks/{chunk-ECO3KP5U.js.map → chunk-D57LFZYV.js.map} +0 -0
- /package/dist/chunks/{chunk-CYGNCTMI.js.map → chunk-DEYB7GQW.js.map} +0 -0
- /package/dist/chunks/{chunk-5BULAR3C.js.map → chunk-DJCBJ4D2.js.map} +0 -0
- /package/dist/chunks/{chunk-44JEVSTR.js.map → chunk-DK6MIKJ5.js.map} +0 -0
- /package/dist/chunks/{chunk-BYJ4AGMC.js.map → chunk-DQIPEDOM.js.map} +0 -0
- /package/dist/chunks/{chunk-6A5BVWEI.js.map → chunk-EWD65LWA.js.map} +0 -0
- /package/dist/chunks/{chunk-L5EE2M32.js.map → chunk-FCM3BH55.js.map} +0 -0
- /package/dist/chunks/{chunk-X62U63KJ.js.map → chunk-FEANPQH4.js.map} +0 -0
- /package/dist/chunks/{chunk-EXL2ALVX.js.map → chunk-FZZU6FGO.js.map} +0 -0
- /package/dist/chunks/{chunk-XOIV3R6O.js.map → chunk-J3JUC6J6.js.map} +0 -0
- /package/dist/chunks/{chunk-4UYGMFWB.js.map → chunk-JBI7VU5W.js.map} +0 -0
- /package/dist/chunks/{chunk-NNSCLV6S.js.map → chunk-JC37Z4C2.js.map} +0 -0
- /package/dist/chunks/{chunk-CL475F3V.js.map → chunk-JPWIGZJ4.js.map} +0 -0
- /package/dist/chunks/{chunk-5GVYGWMK.js.map → chunk-K2WHGUA7.js.map} +0 -0
- /package/dist/chunks/{chunk-VIRFJSX6.js.map → chunk-KG5YQMJ7.js.map} +0 -0
- /package/dist/chunks/{chunk-5CKCYCPL.js.map → chunk-KVYTZCCO.js.map} +0 -0
- /package/dist/chunks/{chunk-BGI5U5XL.js.map → chunk-KYEHKRUB.js.map} +0 -0
- /package/dist/chunks/{chunk-DCAKHMT4.js.map → chunk-L4M6ZSF6.js.map} +0 -0
- /package/dist/chunks/{chunk-VMJWG5TF.js.map → chunk-LNANLHGE.js.map} +0 -0
- /package/dist/chunks/{chunk-WUBN6DXH.js.map → chunk-MD7SYK6K.js.map} +0 -0
- /package/dist/chunks/{chunk-64WCX6UV.js.map → chunk-OIRKBC2L.js.map} +0 -0
- /package/dist/chunks/{chunk-QYIY7Q5R.js.map → chunk-P5GCOEET.js.map} +0 -0
- /package/dist/chunks/{chunk-NXLK7UAG.js.map → chunk-Q733LA67.js.map} +0 -0
- /package/dist/chunks/{chunk-SYMXDX7F.js.map → chunk-QGU3QOXI.js.map} +0 -0
- /package/dist/chunks/{chunk-YVJTVJN4.js.map → chunk-RGCA3YZA.js.map} +0 -0
- /package/dist/chunks/{chunk-MBGTDQFF.js.map → chunk-S7HFDW5W.js.map} +0 -0
- /package/dist/chunks/{chunk-QX6YDLUD.js.map → chunk-SN4RRU3A.js.map} +0 -0
- /package/dist/chunks/{chunk-VUBQ6IRM.js.map → chunk-TAWI7GF2.js.map} +0 -0
- /package/dist/chunks/{chunk-ERSRQ6QN.js.map → chunk-TQ2PH66J.js.map} +0 -0
- /package/dist/chunks/{chunk-YH7CW765.js.map → chunk-U4A4C4GE.js.map} +0 -0
- /package/dist/chunks/{chunk-A7F56OV6.js.map → chunk-UJ7NTALX.js.map} +0 -0
- /package/dist/chunks/{chunk-PAJTVGYM.js.map → chunk-VPDXH3ZZ.js.map} +0 -0
- /package/dist/chunks/{chunk-D7UUTTLG.js.map → chunk-XJMHPZGJ.js.map} +0 -0
- /package/dist/chunks/{chunk-NFCBNDBG.js.map → chunk-XRLM7PL2.js.map} +0 -0
- /package/dist/chunks/{chunk-HZH2LZR3.js.map → chunk-YN5PDLFB.js.map} +0 -0
- /package/dist/chunks/{chunk-XLPUR46F.js.map → chunk-ZGL3HYDE.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-KLGRRAPC.js.map → cli-runtime-KFHNZS4M.js.map} +0 -0
- /package/dist/chunks/{commands-UQGS6244.js.map → commands-7FSE67S7.js.map} +0 -0
- /package/dist/chunks/{crash-report-F3CLYQ6A.js.map → crash-report-5S6I2H4P.js.map} +0 -0
- /package/dist/chunks/{dist-FFM3ZZQ4.js.map → dist-2QEEO2BO.js.map} +0 -0
- /package/dist/chunks/{dist-BF3HQ6PJ.js.map → dist-BMP4NVQA.js.map} +0 -0
- /package/dist/chunks/{dist-SGU5HCLT.js.map → dist-EC2S5MA6.js.map} +0 -0
- /package/dist/chunks/{dist-BYIBYB4E.js.map → dist-KGS4QDJL.js.map} +0 -0
- /package/dist/chunks/{dist-FE7KZYMC.js.map → dist-MLM3PBXB.js.map} +0 -0
- /package/dist/chunks/{dist-MMWDBT7P.js.map → dist-VMJECBAZ.js.map} +0 -0
- /package/dist/chunks/{dist-TZU45EHB.js.map → dist-ZHD7MSXC.js.map} +0 -0
- /package/dist/chunks/{doctor-6ZZOTVMF.js.map → doctor-P67RCEDL.js.map} +0 -0
- /package/dist/chunks/{drain-XK5PA7E5.js.map → drain-GXTL5M2V.js.map} +0 -0
- /package/dist/chunks/{eval-RPKIJFAB.js.map → eval-TGCAUXM6.js.map} +0 -0
- /package/dist/chunks/{exec-DJ4ECSDD.js.map → exec-KGTWE4LA.js.map} +0 -0
- /package/dist/chunks/{home-ZAIMBEH7.js.map → home-PZO47UU7.js.map} +0 -0
- /package/dist/chunks/{host-queries-AMSRIPNG.js.map → host-queries-QOFBCKMJ.js.map} +0 -0
- /package/dist/chunks/{lifecycle-L4E6FPYN.js.map → lifecycle-DPH2KOCH.js.map} +0 -0
- /package/dist/chunks/{list-2QTHV4YO.js.map → list-ILFBHQS7.js.map} +0 -0
- /package/dist/chunks/{login-QMOTL6Y5.js.map → login-EUEB5HLK.js.map} +0 -0
- /package/dist/chunks/{logs-JIQJGYVR.js.map → logs-F2II4CCT.js.map} +0 -0
- /package/dist/chunks/{mcp-ZCRO5DB3.js.map → mcp-KPJ7KVE4.js.map} +0 -0
- /package/dist/chunks/{message-command-2SCMXO4D.js.map → message-command-I3J5NA35.js.map} +0 -0
- /package/dist/chunks/{operator-tools-23FYQ5OE.js.map → operator-tools-2SI6AFFF.js.map} +0 -0
- /package/dist/chunks/{output-schema-RTXHP2NW.js.map → output-schema-PJNYSOO5.js.map} +0 -0
- /package/dist/chunks/{pal-AC73MLO6.js.map → pal-7ILZQGYB.js.map} +0 -0
- /package/dist/chunks/{providers-SUXIFNA4.js.map → providers-MD4HAS6J.js.map} +0 -0
- /package/dist/chunks/{resident-VFEZDABF.js.map → resident-HVI3YGHH.js.map} +0 -0
- /package/dist/chunks/{resume-I3YLV7D3.js.map → resume-R2OYMKYY.js.map} +0 -0
- /package/dist/chunks/{resume-command-PZ3NLBOR.js.map → resume-command-EVY3VMMM.js.map} +0 -0
- /package/dist/chunks/{schedule-4KYTYQML.js.map → schedule-QCGOB5T2.js.map} +0 -0
- /package/dist/chunks/{service-NI46RYPW.js.map → service-MVQA56RE.js.map} +0 -0
- /package/dist/chunks/{session-step-IR57BRZX.js.map → session-step-XAOTLL4U.js.map} +0 -0
- /package/dist/chunks/{skills-OYRPNK3I.js.map → skills-MTR3YGWW.js.map} +0 -0
- /package/dist/chunks/{state-ULVIHH2M.js.map → state-5GSLSGR2.js.map} +0 -0
- /package/dist/chunks/{store-3LVJZEHS.js.map → store-P2I5OF2S.js.map} +0 -0
- /package/dist/chunks/{store-EOHDDBM7.js.map → store-SQUUV4YQ.js.map} +0 -0
- /package/dist/chunks/{store-W2VNXICH.js.map → store-UMSGE2UE.js.map} +0 -0
- /package/dist/chunks/{tui-GEHRYWRG.js.map → tui-5EKXXN5S.js.map} +0 -0
- /package/dist/chunks/{upgrade-LSB2KNDF.js.map → upgrade-OZE2Z2OV.js.map} +0 -0
- /package/dist/chunks/{worktree-PZU6IAUF.js.map → worktree-452AXJPV.js.map} +0 -0
|
@@ -641,8 +641,8 @@ function windowsEnv(env, name2) {
|
|
|
641
641
|
}
|
|
642
642
|
__name(windowsEnv, "windowsEnv");
|
|
643
643
|
function insideDirectory(path2, directory) {
|
|
644
|
-
const
|
|
645
|
-
return
|
|
644
|
+
const relative11 = win32.relative(directory, path2);
|
|
645
|
+
return relative11 === "" || !relative11.startsWith("..") && !win32.isAbsolute(relative11);
|
|
646
646
|
}
|
|
647
647
|
__name(insideDirectory, "insideDirectory");
|
|
648
648
|
function findGitBash(probe2) {
|
|
@@ -1366,13 +1366,13 @@ var GuardedFetchProvider = class {
|
|
|
1366
1366
|
operation.throwIfStopped();
|
|
1367
1367
|
return url;
|
|
1368
1368
|
}
|
|
1369
|
-
const
|
|
1369
|
+
const resolve28 = 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(() => resolve28(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" });
|
|
@@ -6392,9 +6392,9 @@ async function vetWebSocketTarget(raw, options = {}) {
|
|
|
6392
6392
|
if (literal !== 0) {
|
|
6393
6393
|
addresses = [hostname];
|
|
6394
6394
|
} else {
|
|
6395
|
-
const
|
|
6395
|
+
const resolve28 = options.resolve ?? (async (name2) => (await dnsLookup(name2, { all: true })).map((r) => r.address));
|
|
6396
6396
|
try {
|
|
6397
|
-
addresses = await
|
|
6397
|
+
addresses = await resolve28(hostname);
|
|
6398
6398
|
} catch (err) {
|
|
6399
6399
|
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.`);
|
|
6400
6400
|
}
|
|
@@ -6820,8 +6820,8 @@ var BackgroundJobRegistry = class {
|
|
|
6820
6820
|
};
|
|
6821
6821
|
let startError;
|
|
6822
6822
|
let settleStarted;
|
|
6823
|
-
const startedPromise = new Promise((
|
|
6824
|
-
settleStarted = /* @__PURE__ */ __name(() =>
|
|
6823
|
+
const startedPromise = new Promise((resolve28) => {
|
|
6824
|
+
settleStarted = /* @__PURE__ */ __name(() => resolve28(startError === void 0 ? {} : { error: startError }), "settleStarted");
|
|
6825
6825
|
});
|
|
6826
6826
|
if (params.spawn || child.pid !== void 0)
|
|
6827
6827
|
settleStarted();
|
|
@@ -6867,7 +6867,7 @@ var BackgroundJobRegistry = class {
|
|
|
6867
6867
|
outputChunks: [],
|
|
6868
6868
|
outputObservers: /* @__PURE__ */ new Set(),
|
|
6869
6869
|
started: startedPromise,
|
|
6870
|
-
exit: new Promise((
|
|
6870
|
+
exit: new Promise((resolve28) => {
|
|
6871
6871
|
let spawned = child.pid !== void 0;
|
|
6872
6872
|
let failedToSpawn = false;
|
|
6873
6873
|
let finalized = false;
|
|
@@ -6885,7 +6885,7 @@ var BackgroundJobRegistry = class {
|
|
|
6885
6885
|
...code === null ? {} : { exitCode: code },
|
|
6886
6886
|
...signal ? { signal } : {}
|
|
6887
6887
|
};
|
|
6888
|
-
|
|
6888
|
+
resolve28();
|
|
6889
6889
|
for (const observer of entry.outputObservers)
|
|
6890
6890
|
observer();
|
|
6891
6891
|
if (entry.monitor) {
|
|
@@ -7058,7 +7058,7 @@ var BackgroundJobRegistry = class {
|
|
|
7058
7058
|
const signal = opts.signal;
|
|
7059
7059
|
if (signal.aborted)
|
|
7060
7060
|
return Promise.reject(signal.reason);
|
|
7061
|
-
return new Promise((
|
|
7061
|
+
return new Promise((resolve28, reject2) => {
|
|
7062
7062
|
let disposeAbort = /* @__PURE__ */ __name(() => {
|
|
7063
7063
|
}, "disposeAbort");
|
|
7064
7064
|
const unsubscribe = this.onExit((job) => {
|
|
@@ -7066,7 +7066,7 @@ var BackgroundJobRegistry = class {
|
|
|
7066
7066
|
return;
|
|
7067
7067
|
unsubscribe();
|
|
7068
7068
|
disposeAbort();
|
|
7069
|
-
|
|
7069
|
+
resolve28(job);
|
|
7070
7070
|
});
|
|
7071
7071
|
disposeAbort = subscribeToAbort(signal, () => {
|
|
7072
7072
|
unsubscribe();
|
|
@@ -7163,7 +7163,7 @@ var BackgroundJobRegistry = class {
|
|
|
7163
7163
|
throw new BackgroundJobOutputWaitLimitError({ owner, limit: globalLimit, scope: "registry" });
|
|
7164
7164
|
this.outputWaiters++;
|
|
7165
7165
|
this.outputWaitersByOwner.set(owner, ownerCount + 1);
|
|
7166
|
-
return new Promise((
|
|
7166
|
+
return new Promise((resolve28) => {
|
|
7167
7167
|
const startedAt = Date.now();
|
|
7168
7168
|
let settled = false;
|
|
7169
7169
|
let disposeAbort = /* @__PURE__ */ __name(() => {
|
|
@@ -7183,7 +7183,7 @@ var BackgroundJobRegistry = class {
|
|
|
7183
7183
|
this.outputWaitersByOwner.delete(owner);
|
|
7184
7184
|
else
|
|
7185
7185
|
this.outputWaitersByOwner.set(owner, remaining);
|
|
7186
|
-
|
|
7186
|
+
resolve28(result);
|
|
7187
7187
|
}, "finish");
|
|
7188
7188
|
const timeout = /* @__PURE__ */ __name((cause) => {
|
|
7189
7189
|
read();
|
|
@@ -9604,7 +9604,7 @@ async function renameWithRetry(from, to) {
|
|
|
9604
9604
|
const code = err.code ?? "";
|
|
9605
9605
|
if (!CONTENDED.has(code) || attempt >= RENAME_ATTEMPTS)
|
|
9606
9606
|
throw err;
|
|
9607
|
-
await new Promise((
|
|
9607
|
+
await new Promise((resolve28) => setTimeout(resolve28, attempt));
|
|
9608
9608
|
}
|
|
9609
9609
|
}
|
|
9610
9610
|
}
|
|
@@ -12572,8 +12572,8 @@ async function releaseHeldSessionLeases(options = {}) {
|
|
|
12572
12572
|
}, () => {
|
|
12573
12573
|
})));
|
|
12574
12574
|
let timer;
|
|
12575
|
-
const deadline = new Promise((
|
|
12576
|
-
timer = setTimeout(
|
|
12575
|
+
const deadline = new Promise((resolve28) => {
|
|
12576
|
+
timer = setTimeout(resolve28, options.timeoutMs ?? 2e3);
|
|
12577
12577
|
});
|
|
12578
12578
|
await Promise.race([all, deadline]);
|
|
12579
12579
|
clearTimeout(timer);
|
|
@@ -13591,7 +13591,18 @@ var ChildSessionMetaSchema = external_exports.object({
|
|
|
13591
13591
|
description: text2,
|
|
13592
13592
|
status: turnExecutionStatus,
|
|
13593
13593
|
createdAt: isoUtc,
|
|
13594
|
-
endedAt: isoUtc.optional()
|
|
13594
|
+
endedAt: isoUtc.optional(),
|
|
13595
|
+
/**
|
|
13596
|
+
* What a later process needs to continue this child from its saved log:
|
|
13597
|
+
* the filesystem policy it ran under and a small host-defined profile
|
|
13598
|
+
* (which agent to rebuild, which model). Absent on children saved before
|
|
13599
|
+
* this field existed and on children whose host recorded no profile; those
|
|
13600
|
+
* cannot be continued from disk.
|
|
13601
|
+
*/
|
|
13602
|
+
continuation: external_exports.object({
|
|
13603
|
+
workspace: external_exports.enum(["shared", "isolated"]),
|
|
13604
|
+
profile: external_exports.record(external_exports.string().min(1).max(64), external_exports.string().max(256)).refine((value) => Object.keys(value).length <= 16, "At most 16 profile entries")
|
|
13605
|
+
}).strict().optional()
|
|
13595
13606
|
}).strict();
|
|
13596
13607
|
var SessionLeaseDocumentSchema = external_exports.object({
|
|
13597
13608
|
v: external_exports.literal(1),
|
|
@@ -14273,7 +14284,7 @@ async function renameWithRetry2(from, to) {
|
|
|
14273
14284
|
const code = err.code ?? "";
|
|
14274
14285
|
if (!CONTENDED2.has(code) || attempt >= RENAME_ATTEMPTS2)
|
|
14275
14286
|
throw err;
|
|
14276
|
-
await new Promise((
|
|
14287
|
+
await new Promise((resolve28) => setTimeout(resolve28, attempt));
|
|
14277
14288
|
}
|
|
14278
14289
|
}
|
|
14279
14290
|
}
|
|
@@ -16610,25 +16621,28 @@ function buildTaskTools(taskStore, scope) {
|
|
|
16610
16621
|
}
|
|
16611
16622
|
__name(buildTaskTools, "buildTaskTools");
|
|
16612
16623
|
|
|
16613
|
-
// ../sdk/dist/types/permission/index.js
|
|
16614
|
-
var PLAN_MODE_REFUSAL = "Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply \u2014 what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.";
|
|
16615
|
-
|
|
16616
16624
|
// ../sdk/dist/compaction/summary.js
|
|
16617
16625
|
var COMPACTION_HEADER = "[COMPACTED CONTEXT] The following is a structured summary of the conversation so far.";
|
|
16618
16626
|
function isCompactionMessage(content) {
|
|
16619
16627
|
return typeof content === "string" && content.startsWith(COMPACTION_HEADER);
|
|
16620
16628
|
}
|
|
16621
16629
|
__name(isCompactionMessage, "isCompactionMessage");
|
|
16622
|
-
|
|
16630
|
+
var COMPACTION_RECOVERY_NOTE = "Earlier output was cut from this summary. To get exact earlier text, call search_conversation, then read_conversation.";
|
|
16631
|
+
function buildCompactionMessage(body, recoveryNote) {
|
|
16623
16632
|
return {
|
|
16624
16633
|
...createSystemMessage(`${COMPACTION_HEADER}
|
|
16625
16634
|
|
|
16626
|
-
${body}`
|
|
16635
|
+
${body}${recoveryNote ? `
|
|
16636
|
+
|
|
16637
|
+
${recoveryNote}` : ""}`),
|
|
16627
16638
|
source: { type: "compaction-summary" }
|
|
16628
16639
|
};
|
|
16629
16640
|
}
|
|
16630
16641
|
__name(buildCompactionMessage, "buildCompactionMessage");
|
|
16631
16642
|
|
|
16643
|
+
// ../sdk/dist/types/permission/index.js
|
|
16644
|
+
var PLAN_MODE_REFUSAL = "Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply \u2014 what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.";
|
|
16645
|
+
|
|
16632
16646
|
// ../sdk/dist/provider/strict-schema.js
|
|
16633
16647
|
var NO_CONDITIONALS = "strict mode has no conditional schemas; flatten the object";
|
|
16634
16648
|
var NO_NUMERIC_BOUNDS = "numeric bounds are not in the subset; enforce at execution";
|
|
@@ -22630,14 +22644,14 @@ __name(backoffProportional, "backoffProportional");
|
|
|
22630
22644
|
function sleep(ms, signal) {
|
|
22631
22645
|
if (ms <= 0)
|
|
22632
22646
|
return Promise.resolve();
|
|
22633
|
-
return new Promise((
|
|
22647
|
+
return new Promise((resolve28, reject2) => {
|
|
22634
22648
|
if (signal?.aborted) {
|
|
22635
22649
|
reject2(signal.reason);
|
|
22636
22650
|
return;
|
|
22637
22651
|
}
|
|
22638
22652
|
const timer = setTimeout(() => {
|
|
22639
22653
|
signal?.removeEventListener("abort", onAbort);
|
|
22640
|
-
|
|
22654
|
+
resolve28();
|
|
22641
22655
|
}, ms);
|
|
22642
22656
|
const onAbort = /* @__PURE__ */ __name(() => {
|
|
22643
22657
|
clearTimeout(timer);
|
|
@@ -23371,11 +23385,11 @@ __name(checkRemoval, "checkRemoval");
|
|
|
23371
23385
|
var GLOB_TAIL = /[\\/]\.?\*$/;
|
|
23372
23386
|
function checkTarget(program, args, spelled, word2, scope) {
|
|
23373
23387
|
const expanded = expandTilde(spelled, scope.home);
|
|
23374
|
-
const
|
|
23388
|
+
const relative11 = !isAbsolute3(expanded);
|
|
23375
23389
|
if (expandsAtRuntime(word2) && /[$`]/.test(expanded)) {
|
|
23376
23390
|
return void 0;
|
|
23377
23391
|
}
|
|
23378
|
-
const absolute =
|
|
23392
|
+
const absolute = relative11 ? resolve2(scope.cwd, expanded) : resolve2(expanded);
|
|
23379
23393
|
let settled = absolute;
|
|
23380
23394
|
for (let previous = ""; previous !== settled; ) {
|
|
23381
23395
|
previous = settled;
|
|
@@ -23385,18 +23399,18 @@ function checkTarget(program, args, spelled, word2, scope) {
|
|
|
23385
23399
|
}
|
|
23386
23400
|
const globbed = settled !== absolute;
|
|
23387
23401
|
const original = expanded;
|
|
23388
|
-
if (scope.changesDirectory && globbed &&
|
|
23402
|
+
if (scope.changesDirectory && globbed && relative11 && GLOB_TAIL.test(absolute)) {
|
|
23389
23403
|
return `${program} ${spelled}: a relative glob after a cd cannot be resolved before the line runs`;
|
|
23390
23404
|
}
|
|
23391
23405
|
let below = settled;
|
|
23392
|
-
if (
|
|
23406
|
+
if (relative11) {
|
|
23393
23407
|
const prefix = scope.cwd.endsWith(sep3) ? scope.cwd : scope.cwd + sep3;
|
|
23394
23408
|
if (settled.startsWith(prefix))
|
|
23395
23409
|
below = settled.slice(prefix.length);
|
|
23396
23410
|
else if (settled === scope.cwd)
|
|
23397
23411
|
below = "";
|
|
23398
23412
|
}
|
|
23399
|
-
if (globbed && (hasParentAfterName(original) || original.startsWith("~") || /^[\\/]{2}/.test(original) ||
|
|
23413
|
+
if (globbed && (hasParentAfterName(original) || original.startsWith("~") || /^[\\/]{2}/.test(original) || relative11 && /(^|[\\/])\.\.([\\/]|$)/.test(original) && GLOB_TAIL.test(absolute) || program === "rmdir" && GLOB_TAIL.test(absolute) && args.some((a) => /^--p/.test(a.value) || /^-[a-z]*p/.test(a.value)) || relative11 && /\*[\\/]+$/.test(original) && GLOB_TAIL.test(absolute))) {
|
|
23400
23414
|
return `${program} ${spelled}: the target cannot be resolved to a directory before the line runs`;
|
|
23401
23415
|
}
|
|
23402
23416
|
if (!globbed || !/[*?[]/.test(below)) {
|
|
@@ -23417,8 +23431,8 @@ function checkTarget(program, args, spelled, word2, scope) {
|
|
|
23417
23431
|
if (globbed && GLOB_TAIL.test(absolute)) {
|
|
23418
23432
|
const segments = /* @__PURE__ */ __name((value) => value.split(/[\\/]+/).filter((s) => s !== "" && s !== ".").length, "segments");
|
|
23419
23433
|
const crossed = segments(absolute) - segments(settled);
|
|
23420
|
-
const
|
|
23421
|
-
if (crossed +
|
|
23434
|
+
const inside2 = below.split(/[\\/]+/).filter((s) => /[*?[]/.test(s)).length;
|
|
23435
|
+
if (crossed + inside2 > 1) {
|
|
23422
23436
|
return `${program} ${spelled}: the glob crosses directories that cannot be listed before the line runs`;
|
|
23423
23437
|
}
|
|
23424
23438
|
}
|
|
@@ -24792,7 +24806,7 @@ function createFileReadTracker() {
|
|
|
24792
24806
|
__name(createFileReadTracker, "createFileReadTracker");
|
|
24793
24807
|
|
|
24794
24808
|
// ../sdk/dist/runtime/query/file-evidence-replay.js
|
|
24795
|
-
import { resolve as
|
|
24809
|
+
import { resolve as resolve7 } from "node:path";
|
|
24796
24810
|
|
|
24797
24811
|
// ../sdk/dist/constants/limits.js
|
|
24798
24812
|
var ZERO_COST2 = {
|
|
@@ -24971,6 +24985,30 @@ var DEFAULT_MAX_TOOL_OUTPUT_CHARS = 4e4;
|
|
|
24971
24985
|
var DEFAULT_MAX_TOOL_OUTPUT_CHARS_PER_MESSAGE = 2e5;
|
|
24972
24986
|
var MESSAGE_BUDGET_PREVIEW_CHARS = 2e3;
|
|
24973
24987
|
var SPILL_MARKER = "The full output was written to:";
|
|
24988
|
+
var RETAINED_OUTPUT_NOTE = "This path identifies retained output, not the original input.";
|
|
24989
|
+
var REPLAY_WARNING = "A fresh observation of the original input cannot recover its earlier contents. If recovery is unavailable, report the missing detail; do not replay the original action.";
|
|
24990
|
+
function describeRetainedOutputRecovery(routes) {
|
|
24991
|
+
const read = routes?.read === true;
|
|
24992
|
+
const conversation = routes?.conversation === true;
|
|
24993
|
+
const how = [
|
|
24994
|
+
read ? "To read more of it, open this file with the read tool (offset and limit)." : "",
|
|
24995
|
+
conversation ? read ? "For anything else from earlier in this conversation, call search_conversation with a phrase from it, then read_conversation with the seq and part it returns." : "To read more of it, call search_conversation with a phrase from it, then read_conversation with the seq and part it returns. The path is not a workspace file, so read and grep cannot open it." : ""
|
|
24996
|
+
].filter(Boolean);
|
|
24997
|
+
if (how.length === 0)
|
|
24998
|
+
return `${RETAINED_OUTPUT_NOTE} Use the host-authorized retained-output recovery tools when available; the path does not grant filesystem access. ${REPLAY_WARNING}`;
|
|
24999
|
+
return [RETAINED_OUTPUT_NOTE, ...how, REPLAY_WARNING].join(" ");
|
|
25000
|
+
}
|
|
25001
|
+
__name(describeRetainedOutputRecovery, "describeRetainedOutputRecovery");
|
|
25002
|
+
function retainedOutputPointer(text9) {
|
|
25003
|
+
const lines = text9.split(/\r\n|\r|\n/);
|
|
25004
|
+
const at = lines.findIndex((line) => line.startsWith(SPILL_MARKER));
|
|
25005
|
+
if (at < 0)
|
|
25006
|
+
return void 0;
|
|
25007
|
+
const next = lines[at + 1];
|
|
25008
|
+
return next?.startsWith(RETAINED_OUTPUT_NOTE) ? `${lines[at]}
|
|
25009
|
+
${next}` : lines[at];
|
|
25010
|
+
}
|
|
25011
|
+
__name(retainedOutputPointer, "retainedOutputPointer");
|
|
24974
25012
|
var HEAD_SHARE = 0.75;
|
|
24975
25013
|
function safeHead(text9, maxChars2) {
|
|
24976
25014
|
let end = Math.min(text9.length, Math.max(0, maxChars2));
|
|
@@ -25000,7 +25038,7 @@ function boundedPreview(output, maxChars2, toolName, recovery) {
|
|
|
25000
25038
|
""
|
|
25001
25039
|
].join("\n");
|
|
25002
25040
|
const compactMiddle = "\n[... omitted ...]\n";
|
|
25003
|
-
const spillLine = recovery.split(
|
|
25041
|
+
const spillLine = recovery.split(/\r\n|\r|\n/).find((line) => line.startsWith(SPILL_MARKER));
|
|
25004
25042
|
const compactRecovery = spillLine ? `${compactMiddle}${spillLine}
|
|
25005
25043
|
` : compactMiddle;
|
|
25006
25044
|
const middle = detailedMiddle.length < maxChars2 ? detailedMiddle : compactRecovery.length < maxChars2 ? compactRecovery : compactMiddle;
|
|
@@ -25052,10 +25090,7 @@ function applyToolOutputBudget(opts) {
|
|
|
25052
25090
|
}
|
|
25053
25091
|
const retained = opts.spillDir ? spill2(opts.spillDir, opts.toolUseId, output, opts.onError) : void 0;
|
|
25054
25092
|
const spillPath = retained?.path;
|
|
25055
|
-
const recovery = spillPath ? [
|
|
25056
|
-
`${SPILL_MARKER} ${spillPath}`,
|
|
25057
|
-
"This path identifies retained output, not the original input. Use the host-authorized retained-output recovery tools when available; the path does not grant filesystem access. A fresh observation of the original input cannot recover its earlier contents. If recovery is unavailable, report the missing detail; do not replay the original action."
|
|
25058
|
-
].join("\n") : "The full output was not retained. Use a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.";
|
|
25093
|
+
const recovery = spillPath ? [`${SPILL_MARKER} ${spillPath}`, describeRetainedOutputRecovery(opts.recoveryRoutes)].join("\n") : "The full output was not retained. Use a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.";
|
|
25059
25094
|
const requestedPreview = opts.retainedPreviewChars;
|
|
25060
25095
|
const previewLimit = retained?.integrity && requestedPreview !== void 0 && Number.isFinite(requestedPreview) && requestedPreview > 0 ? Math.min(limit, Math.floor(requestedPreview)) : limit;
|
|
25061
25096
|
const previewTextBudget = Math.max(0, previewLimit - notice.length - (notice && output ? 2 : 0));
|
|
@@ -25114,7 +25149,6 @@ function spill2(dir, toolUseId3, content, onError) {
|
|
|
25114
25149
|
}
|
|
25115
25150
|
}
|
|
25116
25151
|
__name(spill2, "spill");
|
|
25117
|
-
var SPILL_LINE = new RegExp(`^${SPILL_MARKER} .+$`, "m");
|
|
25118
25152
|
function fitResultsToMessageBudget(items, opts) {
|
|
25119
25153
|
const replaced = /* @__PURE__ */ new Map();
|
|
25120
25154
|
if (!Number.isFinite(opts.maxChars) || opts.maxChars <= 0)
|
|
@@ -25137,7 +25171,7 @@ function fitResultsToMessageBudget(items, opts) {
|
|
|
25137
25171
|
}
|
|
25138
25172
|
__name(fitResultsToMessageBudget, "fitResultsToMessageBudget");
|
|
25139
25173
|
function previewForMessageBudget(item, opts) {
|
|
25140
|
-
const spilledAt =
|
|
25174
|
+
const spilledAt = retainedOutputPointer(item.output);
|
|
25141
25175
|
if (spilledAt !== void 0) {
|
|
25142
25176
|
const output = [
|
|
25143
25177
|
safeHead(item.output, MESSAGE_BUDGET_PREVIEW_CHARS / 2),
|
|
@@ -25148,7 +25182,7 @@ function previewForMessageBudget(item, opts) {
|
|
|
25148
25182
|
return {
|
|
25149
25183
|
output,
|
|
25150
25184
|
originalLength: item.output.length,
|
|
25151
|
-
spillPath: spilledAt.slice(SPILL_MARKER.length + 1)
|
|
25185
|
+
spillPath: spilledAt.split("\n")[0].slice(SPILL_MARKER.length + 1)
|
|
25152
25186
|
};
|
|
25153
25187
|
}
|
|
25154
25188
|
const budgeted = applyToolOutputBudget({
|
|
@@ -25158,6 +25192,7 @@ function previewForMessageBudget(item, opts) {
|
|
|
25158
25192
|
output: item.output,
|
|
25159
25193
|
maxChars: MESSAGE_BUDGET_PREVIEW_CHARS,
|
|
25160
25194
|
spillDir: opts.spillDir,
|
|
25195
|
+
...opts.recoveryRoutes ? { recoveryRoutes: opts.recoveryRoutes } : {},
|
|
25161
25196
|
...opts.onError ? { onError: opts.onError } : {}
|
|
25162
25197
|
});
|
|
25163
25198
|
return {
|
|
@@ -25301,9 +25336,10 @@ function clearedPlaceholder(content, toolName, size) {
|
|
|
25301
25336
|
const parts = [
|
|
25302
25337
|
`${CLEARED_PREFIX} ${toolName} returned ${size.toLocaleString("en-US")} characters, cleared to reclaim context.`
|
|
25303
25338
|
];
|
|
25304
|
-
const
|
|
25305
|
-
if (
|
|
25306
|
-
parts.push(
|
|
25339
|
+
const pointer2 = retainedOutputPointer(text9);
|
|
25340
|
+
if (pointer2) {
|
|
25341
|
+
parts.push(pointer2.includes("\n") ? pointer2 : `${pointer2}
|
|
25342
|
+
${describeRetainedOutputRecovery()}`);
|
|
25307
25343
|
} else {
|
|
25308
25344
|
parts.push("Full result unavailable here. Recover from a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.");
|
|
25309
25345
|
}
|
|
@@ -25866,8 +25902,8 @@ async function withFileMutationLock(key5, operation) {
|
|
|
25866
25902
|
const previous = mutationTails.get(key5) ?? Promise.resolve();
|
|
25867
25903
|
let release = /* @__PURE__ */ __name(() => {
|
|
25868
25904
|
}, "release");
|
|
25869
|
-
const current = new Promise((
|
|
25870
|
-
release =
|
|
25905
|
+
const current = new Promise((resolve28) => {
|
|
25906
|
+
release = resolve28;
|
|
25871
25907
|
});
|
|
25872
25908
|
const tail = previous.then(() => current);
|
|
25873
25909
|
mutationTails.set(key5, tail);
|
|
@@ -27004,7 +27040,38 @@ var EditTool = defineTool({
|
|
|
27004
27040
|
|
|
27005
27041
|
// ../sdk/dist/tools/builtins/read-file.js
|
|
27006
27042
|
import { readFile as readFile7, stat as stat4 } from "node:fs/promises";
|
|
27007
|
-
import { extname } from "node:path";
|
|
27043
|
+
import { extname as extname2 } from "node:path";
|
|
27044
|
+
|
|
27045
|
+
// ../sdk/dist/tools/retained-output.js
|
|
27046
|
+
import { lstat as lstat2, realpath as realpath4 } from "node:fs/promises";
|
|
27047
|
+
import { dirname as dirname9, extname, isAbsolute as isAbsolute6, relative as relative3, resolve as resolve6 } from "node:path";
|
|
27048
|
+
function inside(root, path2) {
|
|
27049
|
+
const rel = relative3(root, path2);
|
|
27050
|
+
return rel !== "" && !rel.startsWith("..") && !isAbsolute6(rel);
|
|
27051
|
+
}
|
|
27052
|
+
__name(inside, "inside");
|
|
27053
|
+
async function resolveRetainedOutput(directory, candidate) {
|
|
27054
|
+
if (!directory || !candidate || !isAbsolute6(candidate) || candidate.includes("\0"))
|
|
27055
|
+
return void 0;
|
|
27056
|
+
try {
|
|
27057
|
+
const base3 = await realpath4(directory);
|
|
27058
|
+
const lexical = resolve6(candidate);
|
|
27059
|
+
if (extname(lexical).toLowerCase() !== ".txt")
|
|
27060
|
+
return void 0;
|
|
27061
|
+
if (!inside(resolve6(directory), lexical) && !inside(base3, lexical))
|
|
27062
|
+
return void 0;
|
|
27063
|
+
const stat15 = await lstat2(lexical);
|
|
27064
|
+
if (stat15.isSymbolicLink() || !stat15.isFile() || stat15.nlink !== 1)
|
|
27065
|
+
return void 0;
|
|
27066
|
+
const real = await realpath4(lexical);
|
|
27067
|
+
if (!inside(base3, real) || dirname9(real) === real)
|
|
27068
|
+
return void 0;
|
|
27069
|
+
return real;
|
|
27070
|
+
} catch {
|
|
27071
|
+
return void 0;
|
|
27072
|
+
}
|
|
27073
|
+
}
|
|
27074
|
+
__name(resolveRetainedOutput, "resolveRetainedOutput");
|
|
27008
27075
|
|
|
27009
27076
|
// ../sdk/dist/tools/text-window.js
|
|
27010
27077
|
var WINDOW_HEAD_LINES = 80;
|
|
@@ -27264,7 +27331,8 @@ var ReadFileTool = defineTool({
|
|
|
27264
27331
|
};
|
|
27265
27332
|
},
|
|
27266
27333
|
async execute(input, context2) {
|
|
27267
|
-
|
|
27334
|
+
const retained = await resolveRetainedOutput(context2.retainedOutputDirectory, input.path);
|
|
27335
|
+
if (context2.sandbox && retained === void 0) {
|
|
27268
27336
|
const buffer2 = await context2.sandbox.readFile(input.path);
|
|
27269
27337
|
const binaryGuidance2 = describeStructuredBinaryRead(input.path, buffer2);
|
|
27270
27338
|
if (binaryGuidance2) {
|
|
@@ -27303,7 +27371,7 @@ var ReadFileTool = defineTool({
|
|
|
27303
27371
|
facts: readFacts(input.path, buffer2, content2, rendered2)
|
|
27304
27372
|
};
|
|
27305
27373
|
}
|
|
27306
|
-
const filePath = await resolveWithinAnyReal(toolRoots(context2), input.path);
|
|
27374
|
+
const filePath = retained ?? await resolveWithinAnyReal(toolRoots(context2), input.path);
|
|
27307
27375
|
if (input.readRange === void 0 && input.limit === void 0) {
|
|
27308
27376
|
const { size } = await stat4(filePath);
|
|
27309
27377
|
const early = renderCappedRead("", size, input, capOptions(input, context2));
|
|
@@ -27351,7 +27419,7 @@ function capOptions(input, context2) {
|
|
|
27351
27419
|
const tokens = Number(context2.env?.NAMZU_FILE_READ_MAX_OUTPUT_TOKENS);
|
|
27352
27420
|
return {
|
|
27353
27421
|
path: input.path,
|
|
27354
|
-
ext:
|
|
27422
|
+
ext: extname2(input.path).toLowerCase(),
|
|
27355
27423
|
...input.allow_large === true ? { allowLarge: true } : {},
|
|
27356
27424
|
...Number.isFinite(tokens) && tokens > 0 ? { caps: { maxTokens: tokens } } : {}
|
|
27357
27425
|
};
|
|
@@ -27392,7 +27460,7 @@ function recordObservedRead(context2, key5, content, rendered) {
|
|
|
27392
27460
|
}
|
|
27393
27461
|
__name(recordObservedRead, "recordObservedRead");
|
|
27394
27462
|
function describeStructuredBinaryRead(path2, buffer) {
|
|
27395
|
-
const ext2 =
|
|
27463
|
+
const ext2 = extname2(path2).toLowerCase();
|
|
27396
27464
|
const image = buffer.subarray(0, 8).equals(Buffer.from("89504e470d0a1a0a", "hex")) ? "PNG" : buffer[0] === 255 && buffer[1] === 216 ? "JPEG" : buffer.toString("ascii", 0, 4) === "RIFF" && buffer.toString("ascii", 8, 12) === "WEBP" ? "WebP" : null;
|
|
27397
27465
|
if (image) {
|
|
27398
27466
|
return [
|
|
@@ -27429,7 +27497,7 @@ __name(buildStructuredBinaryGuidance, "buildStructuredBinaryGuidance");
|
|
|
27429
27497
|
|
|
27430
27498
|
// ../sdk/dist/tools/builtins/write-file.js
|
|
27431
27499
|
import { mkdir as mkdir8, readFile as readFile8 } from "node:fs/promises";
|
|
27432
|
-
import { dirname as
|
|
27500
|
+
import { dirname as dirname10 } from "node:path";
|
|
27433
27501
|
|
|
27434
27502
|
// ../sdk/dist/tools/builtins/file-write-result.js
|
|
27435
27503
|
import { createHash as createHash8 } from "node:crypto";
|
|
@@ -27590,7 +27658,7 @@ var WriteFileTool = defineTool({
|
|
|
27590
27658
|
if (guard)
|
|
27591
27659
|
return guard;
|
|
27592
27660
|
}
|
|
27593
|
-
await mkdir8(
|
|
27661
|
+
await mkdir8(dirname10(hostPath), { recursive: true });
|
|
27594
27662
|
await atomicWriteFile2(hostPath, content);
|
|
27595
27663
|
context2.fileReadTracker?.recordRead(hostPath, content, context2.toolUseId);
|
|
27596
27664
|
return fileWriteResult(hostPath, current, content);
|
|
@@ -27725,7 +27793,7 @@ function parseArguments2(call2) {
|
|
|
27725
27793
|
}
|
|
27726
27794
|
__name(parseArguments2, "parseArguments");
|
|
27727
27795
|
function lexicalFileKeys(workingDirectory, sandboxed) {
|
|
27728
|
-
return (path2) => sandboxed ? path2 :
|
|
27796
|
+
return (path2) => sandboxed ? path2 : resolve7(workingDirectory, path2);
|
|
27729
27797
|
}
|
|
27730
27798
|
__name(lexicalFileKeys, "lexicalFileKeys");
|
|
27731
27799
|
function indexVisibleHistory(messages, keyOf) {
|
|
@@ -30670,7 +30738,7 @@ var RUNTIME_DEFAULTS = RuntimeConfigSchema.parse({});
|
|
|
30670
30738
|
|
|
30671
30739
|
// ../sdk/dist/manager/agent/child-session.js
|
|
30672
30740
|
import { mkdir as mkdir9, readFile as readFile9 } from "node:fs/promises";
|
|
30673
|
-
import { dirname as
|
|
30741
|
+
import { dirname as dirname11 } from "node:path";
|
|
30674
30742
|
async function childSessionEnded(childLog) {
|
|
30675
30743
|
let ended = null;
|
|
30676
30744
|
for await (const { record: record3 } of childLog.read({ mode: "tolerant" })) {
|
|
@@ -30702,7 +30770,7 @@ async function writeChildSessionMeta(path2, meta) {
|
|
|
30702
30770
|
if (current !== null && (current.sessionId !== next.sessionId || current.parentSessionId !== next.parentSessionId || current.parentTurnId !== next.parentTurnId)) {
|
|
30703
30771
|
throw new ChildSessionMetaOwnerError(`${path2} describes child session ${current.sessionId} of ${current.parentSessionId}; refusing to overwrite it with ${next.sessionId} of ${next.parentSessionId}.`);
|
|
30704
30772
|
}
|
|
30705
|
-
await mkdir9(
|
|
30773
|
+
await mkdir9(dirname11(path2), { recursive: true, mode: 448 });
|
|
30706
30774
|
await atomicWriteFile(path2, `${JSON.stringify(next)}
|
|
30707
30775
|
`, { mode: 384 });
|
|
30708
30776
|
}
|
|
@@ -32601,12 +32669,12 @@ var AwaitedJobs = class {
|
|
|
32601
32669
|
return Promise.resolve();
|
|
32602
32670
|
if (this.outstanding.size === 0 && this.monitors.size === 0)
|
|
32603
32671
|
return Promise.resolve();
|
|
32604
|
-
return new Promise((
|
|
32672
|
+
return new Promise((resolve28) => {
|
|
32605
32673
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
32606
32674
|
clearTimeout(timer);
|
|
32607
32675
|
this.arrivals.delete(finish2);
|
|
32608
32676
|
signal?.removeEventListener("abort", finish2);
|
|
32609
|
-
|
|
32677
|
+
resolve28();
|
|
32610
32678
|
}, "finish");
|
|
32611
32679
|
const timer = setTimeout(finish2, timeoutMs);
|
|
32612
32680
|
timer.unref?.();
|
|
@@ -34616,12 +34684,12 @@ var CompletionInbox = class {
|
|
|
34616
34684
|
return Promise.resolve();
|
|
34617
34685
|
if (!this.hasPendingWork)
|
|
34618
34686
|
return Promise.resolve();
|
|
34619
|
-
return new Promise((
|
|
34687
|
+
return new Promise((resolve28) => {
|
|
34620
34688
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
34621
34689
|
clearTimeout(timer);
|
|
34622
34690
|
this.arrivals.delete(finish2);
|
|
34623
34691
|
signal?.removeEventListener("abort", finish2);
|
|
34624
|
-
|
|
34692
|
+
resolve28();
|
|
34625
34693
|
}, "finish");
|
|
34626
34694
|
const timer = setTimeout(finish2, timeoutMs);
|
|
34627
34695
|
timer.unref?.();
|
|
@@ -34746,11 +34814,11 @@ ${JSON.stringify({ tasks: tasks2, omitted: this.ours.size - ids.length })}`;
|
|
|
34746
34814
|
});
|
|
34747
34815
|
if (settlements.length === 0)
|
|
34748
34816
|
return this.drain();
|
|
34749
|
-
await new Promise((
|
|
34817
|
+
await new Promise((resolve28) => {
|
|
34750
34818
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
34751
34819
|
signal?.removeEventListener("abort", finish2);
|
|
34752
34820
|
this.drains.delete(finish2);
|
|
34753
|
-
|
|
34821
|
+
resolve28();
|
|
34754
34822
|
}, "finish");
|
|
34755
34823
|
this.drains.add(finish2);
|
|
34756
34824
|
signal?.addEventListener("abort", finish2, { once: true });
|
|
@@ -37444,7 +37512,8 @@ async function runCompactionCheckInner(ctx, pass, options) {
|
|
|
37444
37512
|
} else {
|
|
37445
37513
|
compactedContent = serializeState(manager.getState());
|
|
37446
37514
|
}
|
|
37447
|
-
const
|
|
37515
|
+
const mounted = new Set(ctx.tools?.listNames?.() ?? []);
|
|
37516
|
+
const compactionMessage = buildCompactionMessage(compactedContent, mounted.has("search_conversation") && mounted.has("read_conversation") ? COMPACTION_RECOVERY_NOTE : void 0);
|
|
37448
37517
|
const preservedSystem = systemMessages.filter((m) => !isCompactionMessage(typeof m.content === "string" ? m.content : null) || m.retain === true);
|
|
37449
37518
|
const retained = findRetainedIndices(messages);
|
|
37450
37519
|
const retainedOlder = retained.size === 0 ? [] : messages.slice(systemMessages.length, keepStart).filter((_, offset) => retained.has(systemMessages.length + offset));
|
|
@@ -37695,14 +37764,14 @@ async function awaitDecisionDurably(ctx, checkpoint, request) {
|
|
|
37695
37764
|
}, "record");
|
|
37696
37765
|
let parkTimer;
|
|
37697
37766
|
let recording = false;
|
|
37698
|
-
const recordIfSlow = new Promise((
|
|
37767
|
+
const recordIfSlow = new Promise((resolve28) => {
|
|
37699
37768
|
parkTimer = setTimeout(() => {
|
|
37700
37769
|
if (settled) {
|
|
37701
|
-
|
|
37770
|
+
resolve28();
|
|
37702
37771
|
return;
|
|
37703
37772
|
}
|
|
37704
37773
|
recording = true;
|
|
37705
|
-
record3().then(
|
|
37774
|
+
record3().then(resolve28, resolve28);
|
|
37706
37775
|
}, delay2);
|
|
37707
37776
|
});
|
|
37708
37777
|
try {
|
|
@@ -37752,13 +37821,13 @@ async function awaitDecisionOrAbort(ctx, request) {
|
|
|
37752
37821
|
};
|
|
37753
37822
|
if (signal.aborted)
|
|
37754
37823
|
return abortDecision;
|
|
37755
|
-
return new Promise((
|
|
37824
|
+
return new Promise((resolve28) => {
|
|
37756
37825
|
let settled = false;
|
|
37757
37826
|
const onAbort = /* @__PURE__ */ __name(() => {
|
|
37758
37827
|
if (settled)
|
|
37759
37828
|
return;
|
|
37760
37829
|
settled = true;
|
|
37761
|
-
|
|
37830
|
+
resolve28(abortDecision);
|
|
37762
37831
|
}, "onAbort");
|
|
37763
37832
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
37764
37833
|
Promise.resolve(ctx.resumeHandler(request, resumeContext)).then((decision2) => {
|
|
@@ -37766,13 +37835,13 @@ async function awaitDecisionOrAbort(ctx, request) {
|
|
|
37766
37835
|
return;
|
|
37767
37836
|
settled = true;
|
|
37768
37837
|
signal.removeEventListener("abort", onAbort);
|
|
37769
|
-
|
|
37838
|
+
resolve28(decision2);
|
|
37770
37839
|
}, (err) => {
|
|
37771
37840
|
if (settled)
|
|
37772
37841
|
return;
|
|
37773
37842
|
settled = true;
|
|
37774
37843
|
signal.removeEventListener("abort", onAbort);
|
|
37775
|
-
|
|
37844
|
+
resolve28({
|
|
37776
37845
|
action: "abort",
|
|
37777
37846
|
reason: err instanceof Error ? err.message : "resume handler failed"
|
|
37778
37847
|
});
|
|
@@ -37975,7 +38044,7 @@ __name(runPlanGate, "runPlanGate");
|
|
|
37975
38044
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
37976
38045
|
async function awaitProjectInstructionCallback(signal, start) {
|
|
37977
38046
|
signal.throwIfAborted();
|
|
37978
|
-
return new Promise((
|
|
38047
|
+
return new Promise((resolve28, reject2) => {
|
|
37979
38048
|
let settled = false;
|
|
37980
38049
|
const cleanup = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "cleanup");
|
|
37981
38050
|
const rejectOnce = /* @__PURE__ */ __name((reason2) => {
|
|
@@ -37990,7 +38059,7 @@ async function awaitProjectInstructionCallback(signal, start) {
|
|
|
37990
38059
|
return;
|
|
37991
38060
|
settled = true;
|
|
37992
38061
|
cleanup();
|
|
37993
|
-
|
|
38062
|
+
resolve28(value);
|
|
37994
38063
|
}, "resolveOnce");
|
|
37995
38064
|
const onAbort = /* @__PURE__ */ __name(() => rejectOnce(signal.reason), "onAbort");
|
|
37996
38065
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -38424,8 +38493,8 @@ async function* runToolReview(ctx, response, iterationNum) {
|
|
|
38424
38493
|
}
|
|
38425
38494
|
const wakeup = /* @__PURE__ */ __name(() => {
|
|
38426
38495
|
let notify;
|
|
38427
|
-
const promise = new Promise((
|
|
38428
|
-
notify =
|
|
38496
|
+
const promise = new Promise((resolve28) => {
|
|
38497
|
+
notify = resolve28;
|
|
38429
38498
|
});
|
|
38430
38499
|
return { promise, notify };
|
|
38431
38500
|
}, "wakeup");
|
|
@@ -42992,7 +43061,7 @@ async function awaitStoreRead(signal, start) {
|
|
|
42992
43061
|
if (!signal)
|
|
42993
43062
|
return await start();
|
|
42994
43063
|
signal.throwIfAborted();
|
|
42995
|
-
return new Promise((
|
|
43064
|
+
return new Promise((resolve28, reject2) => {
|
|
42996
43065
|
let settled = false;
|
|
42997
43066
|
const cleanup = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "cleanup");
|
|
42998
43067
|
const rejectOnce = /* @__PURE__ */ __name((reason2) => {
|
|
@@ -43007,7 +43076,7 @@ async function awaitStoreRead(signal, start) {
|
|
|
43007
43076
|
return;
|
|
43008
43077
|
settled = true;
|
|
43009
43078
|
cleanup();
|
|
43010
|
-
|
|
43079
|
+
resolve28(value);
|
|
43011
43080
|
}, "resolveOnce");
|
|
43012
43081
|
const onAbort = /* @__PURE__ */ __name(() => rejectOnce(signal.reason), "onAbort");
|
|
43013
43082
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -43848,8 +43917,8 @@ var ProbeRegistry = class {
|
|
|
43848
43917
|
var probe = new ProbeRegistry();
|
|
43849
43918
|
|
|
43850
43919
|
// ../sdk/dist/store/evidence/disk.js
|
|
43851
|
-
import { lstat as
|
|
43852
|
-
import { resolve as
|
|
43920
|
+
import { lstat as lstat4 } from "node:fs/promises";
|
|
43921
|
+
import { resolve as resolve8 } from "node:path";
|
|
43853
43922
|
|
|
43854
43923
|
// ../sdk/dist/store/evidence/index-page.js
|
|
43855
43924
|
import { createHash as createHash15, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -44210,7 +44279,7 @@ function excludesSuccessfulTool(entry, names) {
|
|
|
44210
44279
|
__name(excludesSuccessfulTool, "excludesSuccessfulTool");
|
|
44211
44280
|
|
|
44212
44281
|
// ../sdk/dist/store/evidence/source-text.js
|
|
44213
|
-
import { lstat as
|
|
44282
|
+
import { lstat as lstat3 } from "node:fs/promises";
|
|
44214
44283
|
import { join as join14 } from "node:path";
|
|
44215
44284
|
|
|
44216
44285
|
// ../sdk/dist/utils/evidence-time.js
|
|
@@ -44334,7 +44403,7 @@ async function sourceText(pointer2, sessionDir, budget, { event, parts }) {
|
|
|
44334
44403
|
throw new Error("Retained output bytes changed.");
|
|
44335
44404
|
pieces.push(bytes);
|
|
44336
44405
|
}
|
|
44337
|
-
if (stamp2(before) !== stamp2(await file.stat()) || stamp2(before) !== stamp2(await
|
|
44406
|
+
if (stamp2(before) !== stamp2(await file.stat()) || stamp2(before) !== stamp2(await lstat3(path2)))
|
|
44338
44407
|
throw new Error("Retained output changed during read.");
|
|
44339
44408
|
const all = Buffer.concat(pieces);
|
|
44340
44409
|
const ownedStart = (chunk - first) * EVIDENCE_CHUNK_BYTES;
|
|
@@ -44362,15 +44431,33 @@ async function sourceText(pointer2, sessionDir, budget, { event, parts }) {
|
|
|
44362
44431
|
};
|
|
44363
44432
|
}
|
|
44364
44433
|
__name(sourceText, "sourceText");
|
|
44434
|
+
var SessionEvidenceOffsetError = class extends Error {
|
|
44435
|
+
static {
|
|
44436
|
+
__name(this, "SessionEvidenceOffsetError");
|
|
44437
|
+
}
|
|
44438
|
+
code;
|
|
44439
|
+
totalBytes;
|
|
44440
|
+
scannedBytes;
|
|
44441
|
+
constructor(code, message, totalBytes, scannedBytes) {
|
|
44442
|
+
super(message);
|
|
44443
|
+
this.code = code;
|
|
44444
|
+
this.totalBytes = totalBytes;
|
|
44445
|
+
this.scannedBytes = scannedBytes;
|
|
44446
|
+
this.name = "SessionEvidenceOffsetError";
|
|
44447
|
+
}
|
|
44448
|
+
};
|
|
44365
44449
|
async function readTextPage(source, scope, offset, budget) {
|
|
44366
44450
|
const entry = source.entry;
|
|
44367
44451
|
if (offset > source.bytes)
|
|
44368
|
-
throw new
|
|
44452
|
+
throw new SessionEvidenceOffsetError("past_end", "Offset exceeds retained text.", source.bytes, budget.bytes);
|
|
44369
44453
|
const chunk = entry.spill ? Math.min(Math.floor(offset / EVIDENCE_CHUNK_BYTES), source.chunks - 1) : 0;
|
|
44370
44454
|
const window2 = await source.window(chunk);
|
|
44455
|
+
const splits = /* @__PURE__ */ __name(() => new SessionEvidenceOffsetError("inside_character", "Offset splits a UTF-8 character.", source.bytes, budget.bytes), "splits");
|
|
44371
44456
|
if (offset < window2.offset)
|
|
44372
|
-
throw
|
|
44457
|
+
throw splits();
|
|
44373
44458
|
const bytes = window2.bytes.subarray(offset - window2.offset);
|
|
44459
|
+
if (bytes.length && ((bytes[0] ?? 0) & 192) === 128)
|
|
44460
|
+
throw splits();
|
|
44374
44461
|
let text9 = decode(utf8Page(bytes, 24e3));
|
|
44375
44462
|
if (text9.length > 6e3) {
|
|
44376
44463
|
let end = 6e3;
|
|
@@ -44526,7 +44613,7 @@ function createSource(options, mode, anchor) {
|
|
|
44526
44613
|
const consistency = external_exports.enum(["closed", "snapshot"]).parse(options.consistency ?? "closed");
|
|
44527
44614
|
const maxReadBytes = external_exports.number().int().min(1024 * 1024).max(PAGE_BYTES).parse(options.maxReadBytes ?? PAGE_BYTES);
|
|
44528
44615
|
const scope = Object.freeze(scopeSchema.parse(options.scope));
|
|
44529
|
-
const logPath =
|
|
44616
|
+
const logPath = resolve8(options.logPath);
|
|
44530
44617
|
if (!logPath.endsWith(".jsonl"))
|
|
44531
44618
|
throw new Error("A session log path ends in .jsonl.");
|
|
44532
44619
|
const sessionDir = logPath.slice(0, -".jsonl".length);
|
|
@@ -44556,14 +44643,14 @@ function createSource(options, mode, anchor) {
|
|
|
44556
44643
|
throw new Error("Evidence scope has an active turn; it is not closed.");
|
|
44557
44644
|
}
|
|
44558
44645
|
const anchorKey = anchor ? await verifyAnchor(handle, anchor) : void 0;
|
|
44559
|
-
const sourceKey = digest2(`session-v1:${consistency}:${mode}:${scopeKey}:${
|
|
44646
|
+
const sourceKey = digest2(`session-v1:${consistency}:${mode}:${scopeKey}:${fileIdentity(before)}`);
|
|
44560
44647
|
const seal = evidenceSeal(state.first, sourceKey);
|
|
44561
44648
|
const value = await action(handle, size, seal, sourceKey, budget, !state.closed);
|
|
44562
44649
|
signal?.throwIfAborted();
|
|
44563
44650
|
if (anchor) {
|
|
44564
44651
|
if (await verifyAnchor(handle, anchor) !== anchorKey)
|
|
44565
44652
|
throw new Error("Evidence source changed during retrieval.");
|
|
44566
|
-
} else if (stamp2(before) !== stamp2(await handle.stat()) || stamp2(before) !== stamp2(await
|
|
44653
|
+
} else if (stamp2(before) !== stamp2(await handle.stat()) || stamp2(before) !== stamp2(await lstat4(logPath))) {
|
|
44567
44654
|
throw new Error("Evidence source changed during retrieval.");
|
|
44568
44655
|
}
|
|
44569
44656
|
return value;
|
|
@@ -44761,6 +44848,10 @@ function createSource(options, mode, anchor) {
|
|
|
44761
44848
|
});
|
|
44762
44849
|
}
|
|
44763
44850
|
__name(createSource, "createSource");
|
|
44851
|
+
function fileIdentity(stats) {
|
|
44852
|
+
return Number(stats.ino) === 0 ? `${stats.dev}:0:${stats.birthtimeMs}` : `${stats.dev}:${stats.ino}`;
|
|
44853
|
+
}
|
|
44854
|
+
__name(fileIdentity, "fileIdentity");
|
|
44764
44855
|
async function verifyAnchor(handle, anchor) {
|
|
44765
44856
|
const bytes = await readBytes(handle, anchor.offset, anchor.length, {
|
|
44766
44857
|
bytes: 0,
|
|
@@ -44811,8 +44902,8 @@ var EventTranslator = class {
|
|
|
44811
44902
|
async withLogLock(operation) {
|
|
44812
44903
|
const previous = this.appendChain;
|
|
44813
44904
|
let release;
|
|
44814
|
-
this.appendChain = new Promise((
|
|
44815
|
-
release =
|
|
44905
|
+
this.appendChain = new Promise((resolve28) => {
|
|
44906
|
+
release = resolve28;
|
|
44816
44907
|
});
|
|
44817
44908
|
try {
|
|
44818
44909
|
await previous;
|
|
@@ -45207,11 +45298,11 @@ async function teardownSandbox(sandbox, timeoutMs) {
|
|
|
45207
45298
|
return await operation;
|
|
45208
45299
|
let timer;
|
|
45209
45300
|
let timedOut;
|
|
45210
|
-
const deadline = new Promise((
|
|
45301
|
+
const deadline = new Promise((resolve28) => {
|
|
45211
45302
|
timer = setTimeout(() => {
|
|
45212
45303
|
timedOut = teardownTimeoutError(timeoutMs);
|
|
45213
45304
|
controller.abort(timedOut);
|
|
45214
|
-
|
|
45305
|
+
resolve28({ kind: "timed_out", error: timedOut });
|
|
45215
45306
|
}, timeoutMs);
|
|
45216
45307
|
});
|
|
45217
45308
|
try {
|
|
@@ -45239,20 +45330,20 @@ async function acquireSandbox(options) {
|
|
|
45239
45330
|
let timeoutError2;
|
|
45240
45331
|
let timer;
|
|
45241
45332
|
let onAbort;
|
|
45242
|
-
const aborted = new Promise((
|
|
45333
|
+
const aborted = new Promise((resolve28) => {
|
|
45243
45334
|
onAbort = /* @__PURE__ */ __name(() => {
|
|
45244
45335
|
operationController.abort(runSignal.reason);
|
|
45245
|
-
|
|
45336
|
+
resolve28({ kind: "cancelled" });
|
|
45246
45337
|
}, "onAbort");
|
|
45247
45338
|
runSignal.addEventListener("abort", onAbort, { once: true });
|
|
45248
45339
|
});
|
|
45249
|
-
const timedOut = new Promise((
|
|
45340
|
+
const timedOut = new Promise((resolve28) => {
|
|
45250
45341
|
if (options.timeoutMs === Number.POSITIVE_INFINITY)
|
|
45251
45342
|
return;
|
|
45252
45343
|
timer = setTimeout(() => {
|
|
45253
45344
|
timeoutError2 = acquisitionTimeoutError(options.timeoutMs);
|
|
45254
45345
|
operationController.abort(timeoutError2);
|
|
45255
|
-
|
|
45346
|
+
resolve28({ kind: "timed_out", error: timeoutError2 });
|
|
45256
45347
|
}, options.timeoutMs);
|
|
45257
45348
|
});
|
|
45258
45349
|
if (runSignal.aborted) {
|
|
@@ -45301,8 +45392,8 @@ async function acquireSandbox(options) {
|
|
|
45301
45392
|
__name(acquireSandbox, "acquireSandbox");
|
|
45302
45393
|
|
|
45303
45394
|
// ../sdk/dist/runtime/query/session-storage.js
|
|
45304
|
-
import { readdir as readdir4, realpath as
|
|
45305
|
-
import { basename as basename6, dirname as
|
|
45395
|
+
import { readdir as readdir4, realpath as realpath5 } from "node:fs/promises";
|
|
45396
|
+
import { basename as basename6, dirname as dirname13, join as join15, resolve as resolve9 } from "node:path";
|
|
45306
45397
|
|
|
45307
45398
|
// ../sdk/dist/store/budget/ledger.js
|
|
45308
45399
|
var SESSION_TOKEN_BUDGET_VERSION = 2;
|
|
@@ -45992,7 +46083,7 @@ var SessionTokenBudget = class _SessionTokenBudget {
|
|
|
45992
46083
|
|
|
45993
46084
|
// ../sdk/dist/store/budget/disk.js
|
|
45994
46085
|
import { mkdir as mkdir10, readFile as readFile10, rename as rename4, unlink as unlink8, writeFile as writeFile4 } from "node:fs/promises";
|
|
45995
|
-
import { dirname as
|
|
46086
|
+
import { dirname as dirname12 } from "node:path";
|
|
45996
46087
|
var DiskSessionTokenBudgetStore = class {
|
|
45997
46088
|
static {
|
|
45998
46089
|
__name(this, "DiskSessionTokenBudgetStore");
|
|
@@ -46020,7 +46111,7 @@ var DiskSessionTokenBudgetStore = class {
|
|
|
46020
46111
|
const existing = await this.#read(path2, checkedScope);
|
|
46021
46112
|
if (existing)
|
|
46022
46113
|
assertSameRoot(existing, checked2);
|
|
46023
|
-
await mkdir10(
|
|
46114
|
+
await mkdir10(dirname12(path2), { recursive: true, mode: 448 });
|
|
46024
46115
|
const temporary = temporaryPathFor(path2);
|
|
46025
46116
|
try {
|
|
46026
46117
|
await writeFile4(temporary, `${JSON.stringify(checked2)}
|
|
@@ -46196,15 +46287,15 @@ async function placeInLayout(paths2, log) {
|
|
|
46196
46287
|
}
|
|
46197
46288
|
__name(placeInLayout, "placeInLayout");
|
|
46198
46289
|
async function canonicalPath(path2) {
|
|
46199
|
-
let existing =
|
|
46290
|
+
let existing = resolve9(path2);
|
|
46200
46291
|
let remainder = "";
|
|
46201
46292
|
for (; ; ) {
|
|
46202
|
-
const found = await
|
|
46293
|
+
const found = await realpath5(existing).catch(() => void 0);
|
|
46203
46294
|
if (found !== void 0)
|
|
46204
46295
|
return remainder ? join15(found, remainder) : found;
|
|
46205
|
-
const parent =
|
|
46296
|
+
const parent = dirname13(existing);
|
|
46206
46297
|
if (parent === existing)
|
|
46207
|
-
return
|
|
46298
|
+
return resolve9(path2);
|
|
46208
46299
|
remainder = remainder ? join15(basename6(existing), remainder) : basename6(existing);
|
|
46209
46300
|
existing = parent;
|
|
46210
46301
|
}
|
|
@@ -46433,8 +46524,8 @@ var ToolCallBudget = class {
|
|
|
46433
46524
|
signal.throwIfAborted();
|
|
46434
46525
|
const previous = this.chain;
|
|
46435
46526
|
let release;
|
|
46436
|
-
this.chain = new Promise((
|
|
46437
|
-
release =
|
|
46527
|
+
this.chain = new Promise((resolve28) => {
|
|
46528
|
+
release = resolve28;
|
|
46438
46529
|
});
|
|
46439
46530
|
try {
|
|
46440
46531
|
await previous;
|
|
@@ -46509,8 +46600,8 @@ async function resolveProviderContextWindow(provider, model, signal, timeoutMs,
|
|
|
46509
46600
|
const resolverSignal = signal ? AbortSignal.any([signal, deadline.signal]) : deadline.signal;
|
|
46510
46601
|
const interrupted = /* @__PURE__ */ Symbol("provider-context-window-interrupted");
|
|
46511
46602
|
let onAbort;
|
|
46512
|
-
const interruption = new Promise((
|
|
46513
|
-
onAbort = /* @__PURE__ */ __name(() =>
|
|
46603
|
+
const interruption = new Promise((resolve28) => {
|
|
46604
|
+
onAbort = /* @__PURE__ */ __name(() => resolve28(interrupted), "onAbort");
|
|
46514
46605
|
resolverSignal.addEventListener("abort", onAbort, { once: true });
|
|
46515
46606
|
});
|
|
46516
46607
|
const deadlineMs = timeoutMs === 0 ? 5e3 : Math.min(Math.max(0, timeoutMs), 2147483647);
|
|
@@ -49006,6 +49097,14 @@ var ToolExecutor = class {
|
|
|
49006
49097
|
static {
|
|
49007
49098
|
__name(this, "ToolExecutor");
|
|
49008
49099
|
}
|
|
49100
|
+
/** The recovery routes this turn actually has, so a pointer never names a missing tool. */
|
|
49101
|
+
recoveryRoutes() {
|
|
49102
|
+
const tools = this.config.tools;
|
|
49103
|
+
return {
|
|
49104
|
+
read: tools.get("read") !== void 0,
|
|
49105
|
+
conversation: tools.get("search_conversation") !== void 0 && tools.get("read_conversation") !== void 0
|
|
49106
|
+
};
|
|
49107
|
+
}
|
|
49009
49108
|
outputDirectory() {
|
|
49010
49109
|
return typeof this.config.toolOutputDir === "function" ? this.config.toolOutputDir() : this.config.toolOutputDir;
|
|
49011
49110
|
}
|
|
@@ -49349,7 +49448,8 @@ var ToolExecutor = class {
|
|
|
49349
49448
|
if (this.config.outsideRootAccess === "review" && !sandboxed && tool.pathArgument !== void 0) {
|
|
49350
49449
|
const value = input[tool.pathArgument];
|
|
49351
49450
|
if (typeof value === "string") {
|
|
49352
|
-
const
|
|
49451
|
+
const retained = tool.name === "read" && await resolveRetainedOutput(this.outputDirectory(), value);
|
|
49452
|
+
const outside = retained ? void 0 : await pathOutsideRoots(toolRoots(this.config), value);
|
|
49353
49453
|
if (outside !== void 0)
|
|
49354
49454
|
outsidePaths = [outside];
|
|
49355
49455
|
}
|
|
@@ -49662,6 +49762,7 @@ var ToolExecutor = class {
|
|
|
49662
49762
|
})), {
|
|
49663
49763
|
maxChars: maxChars2,
|
|
49664
49764
|
spillDir: this.outputDirectory(),
|
|
49765
|
+
recoveryRoutes: this.recoveryRoutes(),
|
|
49665
49766
|
onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to retain a tool output replaced for the message budget", {
|
|
49666
49767
|
[NAMZU.TURN_ID]: this.config.turnId,
|
|
49667
49768
|
"exception.message": message
|
|
@@ -49866,6 +49967,7 @@ var ToolExecutor = class {
|
|
|
49866
49967
|
maxChars: this.config.maxToolOutputChars ?? DEFAULT_MAX_TOOL_OUTPUT_CHARS,
|
|
49867
49968
|
retainedPreviewChars: this.config.retainedToolPreviewChars,
|
|
49868
49969
|
spillDir: this.outputDirectory(),
|
|
49970
|
+
recoveryRoutes: this.recoveryRoutes(),
|
|
49869
49971
|
onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to spill oversized nested tool output", {
|
|
49870
49972
|
[NAMZU.TURN_ID]: this.config.turnId,
|
|
49871
49973
|
[GENAI.TOOL_NAME]: name2,
|
|
@@ -49942,6 +50044,7 @@ var ToolExecutor = class {
|
|
|
49942
50044
|
turnId: this.config.turnId,
|
|
49943
50045
|
workingDirectory: this.config.workingDirectory,
|
|
49944
50046
|
...this.config.additionalDirectories?.length ? { additionalDirectories: this.config.additionalDirectories } : {},
|
|
50047
|
+
...this.outputDirectory() ? { retainedOutputDirectory: this.outputDirectory() } : {},
|
|
49945
50048
|
abortSignal: this.config.abortSignal,
|
|
49946
50049
|
env: this.config.env,
|
|
49947
50050
|
log: /* @__PURE__ */ __name((level, message) => this.log[level](message), "log"),
|
|
@@ -50207,6 +50310,7 @@ var ToolExecutor = class {
|
|
|
50207
50310
|
maxChars: maxToolOutputChars,
|
|
50208
50311
|
retainedPreviewChars: this.config.retainedToolPreviewChars,
|
|
50209
50312
|
spillDir: this.outputDirectory(),
|
|
50313
|
+
recoveryRoutes: this.recoveryRoutes(),
|
|
50210
50314
|
onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to retain original tool output", {
|
|
50211
50315
|
[NAMZU.TURN_ID]: this.config.turnId,
|
|
50212
50316
|
[GENAI.TOOL_NAME]: toolName,
|
|
@@ -50371,21 +50475,21 @@ ${note}`;
|
|
|
50371
50475
|
let invocationOpen = true;
|
|
50372
50476
|
const nestedDispatches = /* @__PURE__ */ new Set();
|
|
50373
50477
|
try {
|
|
50374
|
-
const expired = Number.isFinite(timeoutMs) && timeoutMs > 0 ? new Promise((
|
|
50478
|
+
const expired = Number.isFinite(timeoutMs) && timeoutMs > 0 ? new Promise((resolve28) => {
|
|
50375
50479
|
timer = setTimeout(() => {
|
|
50376
50480
|
timedOut = true;
|
|
50377
50481
|
controller.abort(new Error(`Tool "${toolName}" exceeded ${timeoutMs}ms`));
|
|
50378
|
-
|
|
50482
|
+
resolve28("timeout");
|
|
50379
50483
|
}, timeoutMs);
|
|
50380
50484
|
}) : void 0;
|
|
50381
|
-
const aborted = new Promise((
|
|
50485
|
+
const aborted = new Promise((resolve28) => {
|
|
50382
50486
|
if (controller.signal.aborted && !timedOut) {
|
|
50383
|
-
|
|
50487
|
+
resolve28("aborted");
|
|
50384
50488
|
return;
|
|
50385
50489
|
}
|
|
50386
50490
|
controller.signal.addEventListener("abort", () => {
|
|
50387
50491
|
if (!timedOut)
|
|
50388
|
-
|
|
50492
|
+
resolve28("aborted");
|
|
50389
50493
|
}, { once: true });
|
|
50390
50494
|
});
|
|
50391
50495
|
const inheritedDispatch = toolContext.dispatchTool;
|
|
@@ -50872,6 +50976,7 @@ ${note}`;
|
|
|
50872
50976
|
// A tool may return different host and model text. They must
|
|
50873
50977
|
// never compete for the same exclusive spill filename.
|
|
50874
50978
|
spillDir: this.outputDirectory() ? join16(this.outputDirectory(), "content") : void 0,
|
|
50979
|
+
recoveryRoutes: this.recoveryRoutes(),
|
|
50875
50980
|
onError: /* @__PURE__ */ __name((message) => this.log.warn("Failed to spill oversized model tool content", {
|
|
50876
50981
|
[NAMZU.TURN_ID]: this.config.turnId,
|
|
50877
50982
|
[GENAI.TOOL_NAME]: toolName,
|
|
@@ -50926,8 +51031,8 @@ var Semaphore = class {
|
|
|
50926
51031
|
this.available--;
|
|
50927
51032
|
return Promise.resolve();
|
|
50928
51033
|
}
|
|
50929
|
-
return new Promise((
|
|
50930
|
-
this.waiters.push(
|
|
51034
|
+
return new Promise((resolve28) => {
|
|
51035
|
+
this.waiters.push(resolve28);
|
|
50931
51036
|
});
|
|
50932
51037
|
}
|
|
50933
51038
|
release() {
|
|
@@ -53316,7 +53421,7 @@ var ScanSessionIndex = class _ScanSessionIndex extends SessionIndexBase {
|
|
|
53316
53421
|
// ../sdk/dist/store/session-index/sqlite.js
|
|
53317
53422
|
import { mkdir as mkdir11, readdir as readdir6, rename as rename5, rm, stat as stat6 } from "node:fs/promises";
|
|
53318
53423
|
import { createRequire } from "node:module";
|
|
53319
|
-
import { basename as basename7, dirname as
|
|
53424
|
+
import { basename as basename7, dirname as dirname14, join as join18 } from "node:path";
|
|
53320
53425
|
var SESSION_INDEX_VERSION = 1;
|
|
53321
53426
|
var sqliteModule;
|
|
53322
53427
|
function loadSqlite() {
|
|
@@ -53507,7 +53612,7 @@ async function modifiedAt(path2) {
|
|
|
53507
53612
|
}
|
|
53508
53613
|
__name(modifiedAt, "modifiedAt");
|
|
53509
53614
|
async function sweepAbandonedRebuilds(path2) {
|
|
53510
|
-
const directory =
|
|
53615
|
+
const directory = dirname14(path2);
|
|
53511
53616
|
const prefix = `${basename7(path2)}.tmp-`;
|
|
53512
53617
|
let names;
|
|
53513
53618
|
try {
|
|
@@ -53638,7 +53743,7 @@ var SqliteSessionIndex = class _SqliteSessionIndex extends SessionIndexBase {
|
|
|
53638
53743
|
/** See {@link rebuildSqliteSessionIndex}. */
|
|
53639
53744
|
static async rebuild(options) {
|
|
53640
53745
|
const { DatabaseSync } = requireSqlite();
|
|
53641
|
-
await mkdir11(
|
|
53746
|
+
await mkdir11(dirname14(options.path), { recursive: true });
|
|
53642
53747
|
await sweepAbandonedRebuilds(options.path);
|
|
53643
53748
|
const temporary = `${options.path}.tmp-${process.pid}-${uuidv7()}`;
|
|
53644
53749
|
try {
|
|
@@ -53889,8 +53994,8 @@ function preservedSystemFloor(systemMessages) {
|
|
|
53889
53994
|
return systemMessages.filter((m) => !isCompactionMessage(typeof m.content === "string" ? m.content : null) || m.retain === true);
|
|
53890
53995
|
}
|
|
53891
53996
|
__name(preservedSystemFloor, "preservedSystemFloor");
|
|
53892
|
-
function splice(preservedSystem, summaryBody, retainedOlder, recentMessages) {
|
|
53893
|
-
const summary2 = { ...buildCompactionMessage(summaryBody), retain: true };
|
|
53997
|
+
function splice(preservedSystem, summaryBody, retainedOlder, recentMessages, recoveryNote) {
|
|
53998
|
+
const summary2 = { ...buildCompactionMessage(summaryBody, recoveryNote), retain: true };
|
|
53894
53999
|
return { messages: [...preservedSystem, summary2, ...retainedOlder, ...recentMessages], summary: summary2 };
|
|
53895
54000
|
}
|
|
53896
54001
|
__name(splice, "splice");
|
|
@@ -53950,7 +54055,7 @@ async function compactNow(input) {
|
|
|
53950
54055
|
streamIdleTimeoutMs: input.streamIdleTimeoutMs,
|
|
53951
54056
|
instructions: input.instructions
|
|
53952
54057
|
});
|
|
53953
|
-
const { messages, summary: summary2 } = splice(preservedSystem, body, retainedOlder, plan.recentMessages);
|
|
54058
|
+
const { messages, summary: summary2 } = splice(preservedSystem, body, retainedOlder, plan.recentMessages, input.recoveryNote);
|
|
53954
54059
|
return publishManualCompaction(input, {
|
|
53955
54060
|
messages,
|
|
53956
54061
|
shed: input.messages.length - messages.length,
|
|
@@ -54607,7 +54712,7 @@ __name(createMemoryRecallStep, "createMemoryRecallStep");
|
|
|
54607
54712
|
// ../sdk/dist/execution/local.js
|
|
54608
54713
|
import { spawn } from "node:child_process";
|
|
54609
54714
|
import { existsSync as existsSync3 } from "node:fs";
|
|
54610
|
-
import { resolve as
|
|
54715
|
+
import { resolve as resolve10 } from "node:path";
|
|
54611
54716
|
|
|
54612
54717
|
// ../sdk/dist/execution/base.js
|
|
54613
54718
|
var InitializationSupersededError = class extends Error {
|
|
@@ -54898,7 +55003,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
54898
55003
|
constructor(options) {
|
|
54899
55004
|
super(options.log);
|
|
54900
55005
|
this.id = options.id;
|
|
54901
|
-
this.cwd =
|
|
55006
|
+
this.cwd = resolve10(options.cwd);
|
|
54902
55007
|
this.fsAccess = options.fsAccess ?? true;
|
|
54903
55008
|
this.envVars = options.envVars ?? {};
|
|
54904
55009
|
this.capabilities = options.capabilities ?? ["filesystem", "process", "shell"];
|
|
@@ -54934,7 +55039,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
54934
55039
|
return this.cwd;
|
|
54935
55040
|
}
|
|
54936
55041
|
setCwd(newCwd) {
|
|
54937
|
-
const resolved2 =
|
|
55042
|
+
const resolved2 = resolve10(newCwd);
|
|
54938
55043
|
if (!existsSync3(resolved2)) {
|
|
54939
55044
|
throw new Error(`Working directory does not exist: ${resolved2}`);
|
|
54940
55045
|
}
|
|
@@ -54944,7 +55049,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
54944
55049
|
return this.fsAccess;
|
|
54945
55050
|
}
|
|
54946
55051
|
resolvePath(relativePath) {
|
|
54947
|
-
return
|
|
55052
|
+
return resolve10(this.cwd, relativePath);
|
|
54948
55053
|
}
|
|
54949
55054
|
getEnvVar(key5) {
|
|
54950
55055
|
return this.envVars[key5] ?? process.env[key5];
|
|
@@ -54972,7 +55077,7 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
54972
55077
|
durationMs: 0
|
|
54973
55078
|
};
|
|
54974
55079
|
}
|
|
54975
|
-
const cwd = options?.cwd ?
|
|
55080
|
+
const cwd = options?.cwd ? resolve10(this.cwd, options.cwd) : this.cwd;
|
|
54976
55081
|
const env = { ...process.env, ...this.envVars, ...options?.env };
|
|
54977
55082
|
const timeoutMs = options?.timeoutMs ?? LOCAL_COMMAND_DEFAULT_TIMEOUT_MS;
|
|
54978
55083
|
if (!Number.isInteger(timeoutMs) || timeoutMs < 0) {
|
|
@@ -55103,9 +55208,9 @@ var LocalExecutionContext = class extends BaseExecutionContext {
|
|
|
55103
55208
|
|
|
55104
55209
|
// ../sdk/dist/turn/workspace-fingerprint.js
|
|
55105
55210
|
import { createHash as createHash17 } from "node:crypto";
|
|
55106
|
-
import { lstat as
|
|
55211
|
+
import { lstat as lstat5, readFile as readFile11, readlink } from "node:fs/promises";
|
|
55107
55212
|
import { join as join20 } from "node:path";
|
|
55108
|
-
var NODE_FS = { lstat:
|
|
55213
|
+
var NODE_FS = { lstat: lstat5, readlink, readFile: readFile11 };
|
|
55109
55214
|
var FINGERPRINT_MAX_BYTES = 4 * 1024 * 1024;
|
|
55110
55215
|
var FINGERPRINT_TIMEOUT_MS = 2e4;
|
|
55111
55216
|
async function untrackedEntry(cwd, rel, fs) {
|
|
@@ -56032,15 +56137,15 @@ var DiskTaskStore = class {
|
|
|
56032
56137
|
break;
|
|
56033
56138
|
await existing.catch(() => void 0);
|
|
56034
56139
|
}
|
|
56035
|
-
let
|
|
56140
|
+
let resolve28;
|
|
56036
56141
|
const lock = new Promise((r) => {
|
|
56037
|
-
|
|
56142
|
+
resolve28 = r;
|
|
56038
56143
|
});
|
|
56039
56144
|
this.locks.set(taskId, lock);
|
|
56040
56145
|
try {
|
|
56041
56146
|
return await fn();
|
|
56042
56147
|
} finally {
|
|
56043
|
-
|
|
56148
|
+
resolve28?.();
|
|
56044
56149
|
if (this.locks.get(taskId) === lock) {
|
|
56045
56150
|
this.locks.delete(taskId);
|
|
56046
56151
|
}
|
|
@@ -56360,8 +56465,8 @@ var DiskTaskStore = class {
|
|
|
56360
56465
|
|
|
56361
56466
|
// ../sdk/dist/store/memory/markdown.js
|
|
56362
56467
|
import { createHash as createHash20 } from "node:crypto";
|
|
56363
|
-
import { lstat as
|
|
56364
|
-
import { dirname as
|
|
56468
|
+
import { lstat as lstat7, mkdir as mkdir13, readFile as readFile14, readdir as readdir8, realpath as realpath6, rename as rename6, unlink as unlink11 } from "node:fs/promises";
|
|
56469
|
+
import { dirname as dirname15, join as join24, resolve as resolve11 } from "node:path";
|
|
56365
56470
|
|
|
56366
56471
|
// ../sdk/dist/store/memory/index-file.js
|
|
56367
56472
|
var MEMORY_INDEX_MAX_LINES = 200;
|
|
@@ -56578,7 +56683,7 @@ __name(formatMemoryFile, "formatMemoryFile");
|
|
|
56578
56683
|
|
|
56579
56684
|
// ../sdk/dist/store/memory/operation-lock.js
|
|
56580
56685
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
56581
|
-
import { lstat as
|
|
56686
|
+
import { lstat as lstat6, open as open9, readFile as readFile13, unlink as unlink10 } from "node:fs/promises";
|
|
56582
56687
|
import { setTimeout as delay } from "node:timers/promises";
|
|
56583
56688
|
var DEFAULT_MEMORY_LOCK_TIMEOUT_MS = 1e4;
|
|
56584
56689
|
function validateMemoryLockTimeout(timeoutMs) {
|
|
@@ -56614,7 +56719,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
|
|
|
56614
56719
|
} catch (error) {
|
|
56615
56720
|
if (error.code !== "EEXIST")
|
|
56616
56721
|
throw error;
|
|
56617
|
-
const existing = await
|
|
56722
|
+
const existing = await lstat6(path2).catch((statError) => {
|
|
56618
56723
|
if (statError.code === "ENOENT")
|
|
56619
56724
|
return void 0;
|
|
56620
56725
|
throw statError;
|
|
@@ -56641,7 +56746,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
|
|
|
56641
56746
|
await handle.sync();
|
|
56642
56747
|
} catch (error) {
|
|
56643
56748
|
await handle.close();
|
|
56644
|
-
const current = await
|
|
56749
|
+
const current = await lstat6(path2).catch(() => void 0);
|
|
56645
56750
|
if (current?.dev === identity.dev && current.ino === identity.ino) {
|
|
56646
56751
|
await unlink10(path2).catch(() => void 0);
|
|
56647
56752
|
}
|
|
@@ -56649,7 +56754,7 @@ async function acquireMemoryOperationLock(path2, timeoutMs) {
|
|
|
56649
56754
|
}
|
|
56650
56755
|
await handle.close();
|
|
56651
56756
|
return async () => {
|
|
56652
|
-
const current = await
|
|
56757
|
+
const current = await lstat6(path2);
|
|
56653
56758
|
if (!current.isFile() || current.isSymbolicLink() || current.dev !== identity.dev || current.ino !== identity.ino || await readFile13(path2, "utf8") !== owner) {
|
|
56654
56759
|
throw lockError(path2, "the lock owner changed before release", timeoutMs);
|
|
56655
56760
|
}
|
|
@@ -56935,7 +57040,7 @@ var MarkdownMemoryStore = class {
|
|
|
56935
57040
|
lockTimeoutMs;
|
|
56936
57041
|
canonical;
|
|
56937
57042
|
constructor(config) {
|
|
56938
|
-
this.directory =
|
|
57043
|
+
this.directory = resolve11(config.directory);
|
|
56939
57044
|
this.log = resolveLogger(config.logger).child({
|
|
56940
57045
|
[SCOPE_ATTRIBUTE]: "store/memory/markdown"
|
|
56941
57046
|
});
|
|
@@ -56950,14 +57055,14 @@ var MarkdownMemoryStore = class {
|
|
|
56950
57055
|
if (this.canonical)
|
|
56951
57056
|
return this.canonical;
|
|
56952
57057
|
await mkdir13(this.directory, { recursive: true, mode: DIRECTORY_MODE });
|
|
56953
|
-
this.canonical = await
|
|
57058
|
+
this.canonical = await realpath6(this.directory);
|
|
56954
57059
|
return this.canonical;
|
|
56955
57060
|
}
|
|
56956
57061
|
memoryPath(dir, name2) {
|
|
56957
57062
|
if (!isMemoryName(name2))
|
|
56958
57063
|
invalidFile(join24(dir, `${name2}.md`), "name is not a memory name");
|
|
56959
|
-
const path2 =
|
|
56960
|
-
if (
|
|
57064
|
+
const path2 = resolve11(entryPath(dir, name2, ".md"));
|
|
57065
|
+
if (dirname15(path2) !== dir)
|
|
56961
57066
|
invalidFile(path2, "resolved path escapes the memory directory");
|
|
56962
57067
|
return path2;
|
|
56963
57068
|
}
|
|
@@ -56973,7 +57078,7 @@ var MarkdownMemoryStore = class {
|
|
|
56973
57078
|
if (!fileName2.endsWith(".md") || fileName2 === MEMORY_INDEX_FILE)
|
|
56974
57079
|
continue;
|
|
56975
57080
|
const path2 = join24(dir, fileName2);
|
|
56976
|
-
const stat15 = await
|
|
57081
|
+
const stat15 = await lstat7(path2).catch((error) => {
|
|
56977
57082
|
if (error.code === "ENOENT")
|
|
56978
57083
|
return void 0;
|
|
56979
57084
|
throw error;
|
|
@@ -57036,7 +57141,7 @@ var MarkdownMemoryStore = class {
|
|
|
57036
57141
|
}
|
|
57037
57142
|
async setAside(path2) {
|
|
57038
57143
|
let target = `${path2}${SUPERSEDED_SUFFIX}`;
|
|
57039
|
-
const taken = /* @__PURE__ */ __name((candidate) =>
|
|
57144
|
+
const taken = /* @__PURE__ */ __name((candidate) => lstat7(candidate).then(() => true, () => false), "taken");
|
|
57040
57145
|
for (let n = 2; await taken(target); n++)
|
|
57041
57146
|
target = `${path2}${SUPERSEDED_SUFFIX}-${n}`;
|
|
57042
57147
|
await rename6(path2, target);
|
|
@@ -57329,8 +57434,8 @@ ${text9 ? `${text9}
|
|
|
57329
57434
|
};
|
|
57330
57435
|
|
|
57331
57436
|
// ../sdk/dist/store/memory/disk.js
|
|
57332
|
-
import { mkdir as mkdir14, realpath as
|
|
57333
|
-
import { dirname as
|
|
57437
|
+
import { mkdir as mkdir14, realpath as realpath7, unlink as unlink12 } from "node:fs/promises";
|
|
57438
|
+
import { dirname as dirname16, join as join25, resolve as resolve12 } from "node:path";
|
|
57334
57439
|
var SCHEMA5 = defineSchema({ kind: "memory-store", current: 1, migrations: {} });
|
|
57335
57440
|
function invalidIndex(reason2, details = {}) {
|
|
57336
57441
|
throw new NamzuError({
|
|
@@ -57446,7 +57551,7 @@ var DiskMemoryStore = class {
|
|
|
57446
57551
|
records = new DiskRecordStore(SCHEMA5);
|
|
57447
57552
|
indexRecords = new DiskRecordStore(SCHEMA5);
|
|
57448
57553
|
constructor(config) {
|
|
57449
|
-
this.baseDir = config.directory === void 0 ? join25(config.baseDir, "memory") :
|
|
57554
|
+
this.baseDir = config.directory === void 0 ? join25(config.baseDir, "memory") : resolve12(config.directory);
|
|
57450
57555
|
this.log = resolveLogger(config.logger).child({ [SCOPE_ATTRIBUTE]: "store/memory/disk" });
|
|
57451
57556
|
this.lockTimeoutMs = config.lockTimeoutMs ?? DEFAULT_MEMORY_LOCK_TIMEOUT_MS;
|
|
57452
57557
|
validateMemoryLockTimeout(this.lockTimeoutMs);
|
|
@@ -57459,10 +57564,10 @@ var DiskMemoryStore = class {
|
|
|
57459
57564
|
return this.location;
|
|
57460
57565
|
await mkdir14(this.contentDir, { recursive: true });
|
|
57461
57566
|
const [canonicalBaseDir, canonicalContentDir] = await Promise.all([
|
|
57462
|
-
|
|
57463
|
-
|
|
57567
|
+
realpath7(this.baseDir),
|
|
57568
|
+
realpath7(this.contentDir)
|
|
57464
57569
|
]);
|
|
57465
|
-
if (
|
|
57570
|
+
if (dirname16(canonicalContentDir) !== canonicalBaseDir) {
|
|
57466
57571
|
invalidIndex("the content directory resolves outside the memory store");
|
|
57467
57572
|
}
|
|
57468
57573
|
this.location = {
|
|
@@ -57473,8 +57578,8 @@ var DiskMemoryStore = class {
|
|
|
57473
57578
|
}
|
|
57474
57579
|
contentPath(location, id3) {
|
|
57475
57580
|
assertStorageMemoryId(id3, (reason2) => invalidContent(id3, reason2, { field: "id" }));
|
|
57476
|
-
const path2 =
|
|
57477
|
-
if (
|
|
57581
|
+
const path2 = resolve12(entryPath(location.contentDir, id3, ".json"));
|
|
57582
|
+
if (dirname16(path2) !== location.contentDir) {
|
|
57478
57583
|
invalidContent(id3, "resolved path escapes the content directory", { field: "id" });
|
|
57479
57584
|
}
|
|
57480
57585
|
return path2;
|
|
@@ -57498,7 +57603,7 @@ var DiskMemoryStore = class {
|
|
|
57498
57603
|
}
|
|
57499
57604
|
async withAuthoritativeIndex(operation) {
|
|
57500
57605
|
const location = await this.storageLocation();
|
|
57501
|
-
const release = await acquireMemoryOperationLock(join25(
|
|
57606
|
+
const release = await acquireMemoryOperationLock(join25(dirname16(location.indexPath), "operation.lock"), this.lockTimeoutMs);
|
|
57502
57607
|
try {
|
|
57503
57608
|
await this.reloadIndex(location);
|
|
57504
57609
|
return await operation(location);
|
|
@@ -60479,7 +60584,7 @@ var MockLLMProvider = class {
|
|
|
60479
60584
|
async delay() {
|
|
60480
60585
|
if (this.responseDelayMs <= 0)
|
|
60481
60586
|
return;
|
|
60482
|
-
await new Promise((
|
|
60587
|
+
await new Promise((resolve28) => setTimeout(resolve28, this.responseDelayMs));
|
|
60483
60588
|
}
|
|
60484
60589
|
/**
|
|
60485
60590
|
* The turn to play. A script shorter than the turn repeats its last
|
|
@@ -60857,7 +60962,7 @@ var StdioTransport = class {
|
|
|
60857
60962
|
this.exitPending = false;
|
|
60858
60963
|
return;
|
|
60859
60964
|
}
|
|
60860
|
-
await new Promise((
|
|
60965
|
+
await new Promise((resolve28) => {
|
|
60861
60966
|
let settled = false;
|
|
60862
60967
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
60863
60968
|
if (settled)
|
|
@@ -60865,7 +60970,7 @@ var StdioTransport = class {
|
|
|
60865
60970
|
settled = true;
|
|
60866
60971
|
clearTimeout(escalate);
|
|
60867
60972
|
clearTimeout(giveUp);
|
|
60868
|
-
|
|
60973
|
+
resolve28();
|
|
60869
60974
|
}, "finish");
|
|
60870
60975
|
child.once("close", finish2);
|
|
60871
60976
|
child.once("error", finish2);
|
|
@@ -62140,7 +62245,7 @@ async function resolveMcpEra(input) {
|
|
|
62140
62245
|
__name(resolveMcpEra, "resolveMcpEra");
|
|
62141
62246
|
|
|
62142
62247
|
// ../sdk/dist/version.js
|
|
62143
|
-
var VERSION2 = "53.
|
|
62248
|
+
var VERSION2 = "53.2.0";
|
|
62144
62249
|
|
|
62145
62250
|
// ../sdk/dist/connector/mcp/client.js
|
|
62146
62251
|
var MAX_LIST_PAGES = 100;
|
|
@@ -62464,7 +62569,7 @@ var MCPClient = class {
|
|
|
62464
62569
|
capabilities: this.config.capabilities ?? {}
|
|
62465
62570
|
});
|
|
62466
62571
|
const controller = new AbortController();
|
|
62467
|
-
return new Promise((
|
|
62572
|
+
return new Promise((resolve28) => {
|
|
62468
62573
|
let settled = false;
|
|
62469
62574
|
const finish2 = /* @__PURE__ */ __name((answer) => {
|
|
62470
62575
|
if (settled)
|
|
@@ -62473,7 +62578,7 @@ var MCPClient = class {
|
|
|
62473
62578
|
clearTimeout(timer);
|
|
62474
62579
|
if (this.pendingRequests.get(id3) === entry)
|
|
62475
62580
|
this.pendingRequests.delete(id3);
|
|
62476
|
-
|
|
62581
|
+
resolve28(answer);
|
|
62477
62582
|
}, "finish");
|
|
62478
62583
|
const entry = {
|
|
62479
62584
|
resolve: /* @__PURE__ */ __name((value) => finish2({ kind: "result", result: value }), "resolve"),
|
|
@@ -63047,8 +63152,8 @@ var MCPClient = class {
|
|
|
63047
63152
|
let settled = false;
|
|
63048
63153
|
let resolvePublic;
|
|
63049
63154
|
let rejectPublic;
|
|
63050
|
-
const result = new Promise((
|
|
63051
|
-
resolvePublic =
|
|
63155
|
+
const result = new Promise((resolve28, reject2) => {
|
|
63156
|
+
resolvePublic = resolve28;
|
|
63052
63157
|
rejectPublic = reject2;
|
|
63053
63158
|
});
|
|
63054
63159
|
const entry = {
|
|
@@ -63892,14 +63997,14 @@ var MCPReconnectSupervisor = class {
|
|
|
63892
63997
|
});
|
|
63893
63998
|
}
|
|
63894
63999
|
wait(ms) {
|
|
63895
|
-
return new Promise((
|
|
64000
|
+
return new Promise((resolve28) => {
|
|
63896
64001
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
63897
64002
|
if (this.timer)
|
|
63898
64003
|
clearTimeout(this.timer);
|
|
63899
64004
|
this.timer = void 0;
|
|
63900
64005
|
if (this.finishWait === finish2)
|
|
63901
64006
|
this.finishWait = void 0;
|
|
63902
|
-
|
|
64007
|
+
resolve28();
|
|
63903
64008
|
}, "finish");
|
|
63904
64009
|
this.finishWait = finish2;
|
|
63905
64010
|
this.timer = setTimeout(finish2, ms);
|
|
@@ -64199,7 +64304,7 @@ async function mcpToolset(client, options = {}) {
|
|
|
64199
64304
|
__name(mcpToolset, "mcpToolset");
|
|
64200
64305
|
|
|
64201
64306
|
// ../sdk/dist/bridge/acp/server.js
|
|
64202
|
-
import { isAbsolute as
|
|
64307
|
+
import { isAbsolute as isAbsolute7 } from "node:path";
|
|
64203
64308
|
|
|
64204
64309
|
// ../sdk/dist/constants/acp/index.js
|
|
64205
64310
|
var ACP_PROTOCOL_VERSION = 1;
|
|
@@ -64530,7 +64635,7 @@ var ACPServer = class {
|
|
|
64530
64635
|
request(method, params, signal) {
|
|
64531
64636
|
this.requestSeq += 1;
|
|
64532
64637
|
const id3 = `agent_${this.requestSeq}`;
|
|
64533
|
-
return new Promise((
|
|
64638
|
+
return new Promise((resolve28, reject2) => {
|
|
64534
64639
|
const finish2 = /* @__PURE__ */ __name(() => {
|
|
64535
64640
|
if (this.pending.get(id3) !== entry)
|
|
64536
64641
|
return false;
|
|
@@ -64545,7 +64650,7 @@ var ACPServer = class {
|
|
|
64545
64650
|
const entry = {
|
|
64546
64651
|
resolve: /* @__PURE__ */ __name((value) => {
|
|
64547
64652
|
if (finish2())
|
|
64548
|
-
|
|
64653
|
+
resolve28(value);
|
|
64549
64654
|
}, "resolve"),
|
|
64550
64655
|
reject: /* @__PURE__ */ __name((error) => {
|
|
64551
64656
|
if (finish2())
|
|
@@ -64692,7 +64797,7 @@ var ACPServer = class {
|
|
|
64692
64797
|
}
|
|
64693
64798
|
requireAbsoluteCwd(cwd) {
|
|
64694
64799
|
const resolved2 = cwd ?? process.cwd();
|
|
64695
|
-
if (!
|
|
64800
|
+
if (!isAbsolute7(resolved2)) {
|
|
64696
64801
|
throw new AcpError(ACP_ERROR_CODES.INVALID_PARAMS, `ACP session cwd must be an absolute path; received ${JSON.stringify(resolved2)}.`);
|
|
64697
64802
|
}
|
|
64698
64803
|
return resolved2;
|
|
@@ -66891,7 +66996,7 @@ __name(createResidentEvidenceRecallStep, "createResidentEvidenceRecallStep");
|
|
|
66891
66996
|
// ../sdk/dist/pals/store.js
|
|
66892
66997
|
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
66893
66998
|
import { chmodSync, closeSync, fsyncSync, linkSync, lstatSync as lstatSync3, mkdirSync as mkdirSync3, openSync, readFileSync, readdirSync, realpathSync as realpathSync3, unlinkSync, writeSync } from "node:fs";
|
|
66894
|
-
import { dirname as
|
|
66999
|
+
import { dirname as dirname17, isAbsolute as isAbsolute8, join as join27, relative as relative4, resolve as resolve13, sep as sep6 } from "node:path";
|
|
66895
67000
|
var ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
|
|
66896
67001
|
var REVISION_FILE = /^[1-9][0-9]*\.json$/u;
|
|
66897
67002
|
var PalConflictError = class extends Error {
|
|
@@ -66912,7 +67017,7 @@ function palId(id3) {
|
|
|
66912
67017
|
}
|
|
66913
67018
|
__name(palId, "palId");
|
|
66914
67019
|
function homePath(home) {
|
|
66915
|
-
const path2 =
|
|
67020
|
+
const path2 = resolve13(home);
|
|
66916
67021
|
mkdirSync3(path2, { recursive: true, mode: 448 });
|
|
66917
67022
|
const entry = lstatSync3(path2);
|
|
66918
67023
|
if (!entry.isDirectory() || entry.isSymbolicLink())
|
|
@@ -66924,8 +67029,8 @@ function homePath(home) {
|
|
|
66924
67029
|
}
|
|
66925
67030
|
__name(homePath, "homePath");
|
|
66926
67031
|
function contained(path2, root) {
|
|
66927
|
-
const rel =
|
|
66928
|
-
return rel === "" || !
|
|
67032
|
+
const rel = relative4(root, path2);
|
|
67033
|
+
return rel === "" || !isAbsolute8(rel) && rel !== ".." && !rel.startsWith(`..${sep6}`);
|
|
66929
67034
|
}
|
|
66930
67035
|
__name(contained, "contained");
|
|
66931
67036
|
function paths(home, workspaceRoot, id3) {
|
|
@@ -67159,7 +67264,7 @@ var DiskPalStore = class {
|
|
|
67159
67264
|
}
|
|
67160
67265
|
/** Exact validated host control directory; never an execution-computer claim. */
|
|
67161
67266
|
atWorkspace(cwd) {
|
|
67162
|
-
const lexical =
|
|
67267
|
+
const lexical = resolve13(cwd);
|
|
67163
67268
|
const canonical2 = realpathSync3(lexical);
|
|
67164
67269
|
const lexicalReserved = contained(lexical, this.workspaceRoot);
|
|
67165
67270
|
const canonicalReserved = contained(canonical2, this.workspaceRoot);
|
|
@@ -67167,7 +67272,7 @@ var DiskPalStore = class {
|
|
|
67167
67272
|
return null;
|
|
67168
67273
|
if (lexical !== canonical2)
|
|
67169
67274
|
throw new Error("Pal workspace is a symlink alias.");
|
|
67170
|
-
const rel =
|
|
67275
|
+
const rel = relative4(this.workspaceRoot, canonical2);
|
|
67171
67276
|
if (!ID.test(rel))
|
|
67172
67277
|
throw new Error("Reserved Pal control directories cannot run ordinary host sessions. Open the exact Pal workspace.");
|
|
67173
67278
|
const pal = this.get(rel);
|
|
@@ -67183,7 +67288,7 @@ function assertDirectory(path2) {
|
|
|
67183
67288
|
}
|
|
67184
67289
|
__name(assertDirectory, "assertDirectory");
|
|
67185
67290
|
function publishExclusive(path2, value) {
|
|
67186
|
-
const temporary = join27(
|
|
67291
|
+
const temporary = join27(dirname17(path2), `.pal-${randomUUID7()}.tmp`);
|
|
67187
67292
|
const fd = openSync(temporary, "wx", 384);
|
|
67188
67293
|
try {
|
|
67189
67294
|
writeSync(fd, `${JSON.stringify(value)}
|
|
@@ -68676,10 +68781,10 @@ var ExternalHarnessSession = class {
|
|
|
68676
68781
|
}
|
|
68677
68782
|
}
|
|
68678
68783
|
makeActive(turnId6, operationId, startedAt) {
|
|
68679
|
-
let
|
|
68784
|
+
let resolve28;
|
|
68680
68785
|
let reject2;
|
|
68681
68786
|
const done = new Promise((yes, no) => {
|
|
68682
|
-
|
|
68787
|
+
resolve28 = yes;
|
|
68683
68788
|
reject2 = no;
|
|
68684
68789
|
});
|
|
68685
68790
|
void done.catch(() => void 0);
|
|
@@ -68689,7 +68794,7 @@ var ExternalHarnessSession = class {
|
|
|
68689
68794
|
startedAt,
|
|
68690
68795
|
items: /* @__PURE__ */ new Map(),
|
|
68691
68796
|
reviews: /* @__PURE__ */ new Map(),
|
|
68692
|
-
resolve:
|
|
68797
|
+
resolve: resolve28,
|
|
68693
68798
|
reject: reject2,
|
|
68694
68799
|
done
|
|
68695
68800
|
};
|
|
@@ -69900,7 +70005,7 @@ ${line}`;
|
|
|
69900
70005
|
stdout: true,
|
|
69901
70006
|
stderr: true
|
|
69902
70007
|
});
|
|
69903
|
-
return await new Promise((
|
|
70008
|
+
return await new Promise((resolve28) => {
|
|
69904
70009
|
let settled = false;
|
|
69905
70010
|
let terminal;
|
|
69906
70011
|
const inFlight = /* @__PURE__ */ new Set();
|
|
@@ -69915,7 +70020,7 @@ ${line}`;
|
|
|
69915
70020
|
clearTimeout(deadline);
|
|
69916
70021
|
options.signal?.removeEventListener("abort", onAbort);
|
|
69917
70022
|
void worker.terminate();
|
|
69918
|
-
|
|
70023
|
+
resolve28({ ...result, calls: [...calls] });
|
|
69919
70024
|
}, "finish");
|
|
69920
70025
|
const finishTerminalWhenHostCallsSettle = /* @__PURE__ */ __name(() => {
|
|
69921
70026
|
if (terminal && inFlight.size === 0)
|
|
@@ -71344,8 +71449,8 @@ ${body}`,
|
|
|
71344
71449
|
let timer;
|
|
71345
71450
|
await Promise.race([
|
|
71346
71451
|
Promise.allSettled([...inFlight]),
|
|
71347
|
-
new Promise((
|
|
71348
|
-
timer = setTimeout(
|
|
71452
|
+
new Promise((resolve28) => {
|
|
71453
|
+
timer = setTimeout(resolve28, grace);
|
|
71349
71454
|
})
|
|
71350
71455
|
]);
|
|
71351
71456
|
clearTimeout(timer);
|
|
@@ -72197,6 +72302,7 @@ var LocalTaskScheduler = class {
|
|
|
72197
72302
|
{
|
|
72198
72303
|
agentId: options.agentId,
|
|
72199
72304
|
...options.resumeSessionId ? { resumeSessionId: options.resumeSessionId } : {},
|
|
72305
|
+
...options.continuationProfile ? { continuationProfile: options.continuationProfile } : {},
|
|
72200
72306
|
beforeStart: options.beforeStart,
|
|
72201
72307
|
...options.workspace ? { workspace: options.workspace } : {},
|
|
72202
72308
|
...options.planId ? { planId: options.planId } : {},
|
|
@@ -72398,6 +72504,11 @@ var LocalTaskScheduler = class {
|
|
|
72398
72504
|
async continueTask(taskId, message) {
|
|
72399
72505
|
await this.agentManager.continueTask(taskId, message);
|
|
72400
72506
|
}
|
|
72507
|
+
async restoreChild(options) {
|
|
72508
|
+
if (!this.agentManager.restoreChildConversation)
|
|
72509
|
+
return { status: "refused", reason: "no-layout" };
|
|
72510
|
+
return this.agentManager.restoreChildConversation(options, this.taskContext);
|
|
72511
|
+
}
|
|
72401
72512
|
cancelTask(taskId, cause) {
|
|
72402
72513
|
this.agentManager.cancel(taskId, cause);
|
|
72403
72514
|
}
|
|
@@ -72695,9 +72806,9 @@ var PluginRegistry = class extends ManagedRegistry {
|
|
|
72695
72806
|
};
|
|
72696
72807
|
|
|
72697
72808
|
// ../sdk/dist/plugin/loader.js
|
|
72698
|
-
import { lstat as
|
|
72809
|
+
import { lstat as lstat8, readFile as readFile16, readdir as readdir10, realpath as realpath8 } from "node:fs/promises";
|
|
72699
72810
|
import { homedir as homedir4, platform } from "node:os";
|
|
72700
|
-
import { join as join30, resolve as
|
|
72811
|
+
import { join as join30, resolve as resolve14 } from "node:path";
|
|
72701
72812
|
|
|
72702
72813
|
// ../sdk/dist/types/plugin/index.js
|
|
72703
72814
|
var RENAMED_PLUGIN_HOOK_EVENTS = {
|
|
@@ -72763,7 +72874,7 @@ async function discoverPlugins(parentDir, log) {
|
|
|
72763
72874
|
const logger = resolveLogger(log).child({ [SCOPE_ATTRIBUTE]: "plugin/loader" });
|
|
72764
72875
|
const dirs = [];
|
|
72765
72876
|
try {
|
|
72766
|
-
const parent = await
|
|
72877
|
+
const parent = await lstat8(parentDir);
|
|
72767
72878
|
if (parent.isSymbolicLink() || !parent.isDirectory()) {
|
|
72768
72879
|
logger.warn("Refusing a non-regular plugins directory", {
|
|
72769
72880
|
"namzu.plugin.parent_dir": parentDir
|
|
@@ -72775,7 +72886,7 @@ async function discoverPlugins(parentDir, log) {
|
|
|
72775
72886
|
if (entry.startsWith(".") || entry.startsWith("_"))
|
|
72776
72887
|
continue;
|
|
72777
72888
|
const fullPath = join30(parentDir, entry);
|
|
72778
|
-
const s = await
|
|
72889
|
+
const s = await lstat8(fullPath);
|
|
72779
72890
|
if (s.isSymbolicLink()) {
|
|
72780
72891
|
logger.warn("Refusing a symlinked plugin directory", { "namzu.plugin.path": fullPath });
|
|
72781
72892
|
continue;
|
|
@@ -72784,7 +72895,7 @@ async function discoverPlugins(parentDir, log) {
|
|
|
72784
72895
|
continue;
|
|
72785
72896
|
const manifestPath = join30(fullPath, PLUGIN_MANIFEST_FILENAME);
|
|
72786
72897
|
try {
|
|
72787
|
-
const manifest = await
|
|
72898
|
+
const manifest = await lstat8(manifestPath);
|
|
72788
72899
|
if (manifest.isSymbolicLink() || !manifest.isFile()) {
|
|
72789
72900
|
logger.warn("Refusing a non-regular plugin manifest", {
|
|
72790
72901
|
"namzu.plugin.path": fullPath,
|
|
@@ -72803,12 +72914,12 @@ async function discoverPlugins(parentDir, log) {
|
|
|
72803
72914
|
}
|
|
72804
72915
|
__name(discoverPlugins, "discoverPlugins");
|
|
72805
72916
|
async function loadPluginManifest(pluginDir, capabilities2 = {}) {
|
|
72806
|
-
const root = await
|
|
72917
|
+
const root = await lstat8(pluginDir);
|
|
72807
72918
|
if (root.isSymbolicLink() || !root.isDirectory()) {
|
|
72808
72919
|
throw new Error(`Plugin root must be a regular directory: ${pluginDir}`);
|
|
72809
72920
|
}
|
|
72810
72921
|
const manifestPath = join30(pluginDir, PLUGIN_MANIFEST_FILENAME);
|
|
72811
|
-
const manifestEntry = await
|
|
72922
|
+
const manifestEntry = await lstat8(manifestPath);
|
|
72812
72923
|
if (manifestEntry.isSymbolicLink() || !manifestEntry.isFile()) {
|
|
72813
72924
|
throw new Error(`Plugin manifest must be a regular file, not a symlink: ${manifestPath}`);
|
|
72814
72925
|
}
|
|
@@ -72878,9 +72989,9 @@ async function samePhysicalDirectory(left, right) {
|
|
|
72878
72989
|
const canonical2 = /* @__PURE__ */ __name(async (path2) => {
|
|
72879
72990
|
let value;
|
|
72880
72991
|
try {
|
|
72881
|
-
value = await
|
|
72992
|
+
value = await realpath8(path2);
|
|
72882
72993
|
} catch {
|
|
72883
|
-
value =
|
|
72994
|
+
value = resolve14(path2);
|
|
72884
72995
|
}
|
|
72885
72996
|
return platform() === "win32" ? value.toLocaleLowerCase("en-US") : value;
|
|
72886
72997
|
}, "canonical");
|
|
@@ -73837,7 +73948,7 @@ function runShellHook(entry, input, signal) {
|
|
|
73837
73948
|
});
|
|
73838
73949
|
const toolPath = pathOf(input.toolInput);
|
|
73839
73950
|
const { NAMZU_TURN_ID: _inheritedTurnId, ...inherited } = process.env;
|
|
73840
|
-
return new Promise((
|
|
73951
|
+
return new Promise((resolve28) => {
|
|
73841
73952
|
let child;
|
|
73842
73953
|
try {
|
|
73843
73954
|
child = spawnHostShell(entry.command, {
|
|
@@ -73864,7 +73975,7 @@ function runShellHook(entry, input, signal) {
|
|
|
73864
73975
|
...process.platform === "win32" ? {} : { shell: { path: "sh", dialect: "sh", source: "sh" } }
|
|
73865
73976
|
});
|
|
73866
73977
|
} catch (error) {
|
|
73867
|
-
|
|
73978
|
+
resolve28({
|
|
73868
73979
|
exitCode: null,
|
|
73869
73980
|
timedOut: false,
|
|
73870
73981
|
stdout: "",
|
|
@@ -73890,7 +74001,7 @@ function runShellHook(entry, input, signal) {
|
|
|
73890
74001
|
settled = true;
|
|
73891
74002
|
clearTimeout(timer);
|
|
73892
74003
|
signal?.removeEventListener("abort", onAbort);
|
|
73893
|
-
|
|
74004
|
+
resolve28(outcome);
|
|
73894
74005
|
}, "finish");
|
|
73895
74006
|
const killTree2 = /* @__PURE__ */ __name(() => {
|
|
73896
74007
|
if (child.pid !== void 0 && process.platform !== "win32") {
|
|
@@ -74441,8 +74552,8 @@ function summarizeBlocking(sessions) {
|
|
|
74441
74552
|
__name(summarizeBlocking, "summarizeBlocking");
|
|
74442
74553
|
|
|
74443
74554
|
// ../sdk/dist/manager/agent/lifecycle.js
|
|
74444
|
-
import { realpath as
|
|
74445
|
-
import { isAbsolute as
|
|
74555
|
+
import { realpath as realpath9, rm as rm2, stat as stat10 } from "node:fs/promises";
|
|
74556
|
+
import { isAbsolute as isAbsolute9, relative as relative5, resolve as resolve15, sep as sep7 } from "node:path";
|
|
74446
74557
|
|
|
74447
74558
|
// ../sdk/dist/session/handoff/capacity.js
|
|
74448
74559
|
var DelegationCapacityExceeded = class extends Error {
|
|
@@ -74533,14 +74644,14 @@ function mergeEnv(base3, override) {
|
|
|
74533
74644
|
__name(mergeEnv, "mergeEnv");
|
|
74534
74645
|
async function requireIsolatedWorktreePath(ref, callerCwd, subdirectory) {
|
|
74535
74646
|
const meta = ref?.meta;
|
|
74536
|
-
if (typeof ref?.id !== "string" || ref.id.length === 0 || meta?.backend !== "git-worktree" || typeof meta.repoRoot !== "string" || !
|
|
74647
|
+
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) || resolve15(meta.worktreePath) === resolve15(callerCwd ?? process.cwd())) {
|
|
74537
74648
|
throw new Error("Isolated git-worktree driver returned an invalid workspace ref or path");
|
|
74538
74649
|
}
|
|
74539
74650
|
let physicalPaths;
|
|
74540
74651
|
try {
|
|
74541
74652
|
physicalPaths = await Promise.all([
|
|
74542
|
-
|
|
74543
|
-
|
|
74653
|
+
realpath9(meta.worktreePath),
|
|
74654
|
+
realpath9(resolve15(callerCwd ?? process.cwd()))
|
|
74544
74655
|
]);
|
|
74545
74656
|
if (!(await stat10(physicalPaths[0])).isDirectory()) {
|
|
74546
74657
|
throw new Error("The worktree path is not a directory");
|
|
@@ -74555,25 +74666,25 @@ async function requireIsolatedWorktreePath(ref, callerCwd, subdirectory) {
|
|
|
74555
74666
|
}
|
|
74556
74667
|
if (subdirectory === void 0)
|
|
74557
74668
|
return meta.worktreePath;
|
|
74558
|
-
if (typeof subdirectory !== "string" || subdirectory.length === 0 ||
|
|
74669
|
+
if (typeof subdirectory !== "string" || subdirectory.length === 0 || isAbsolute9(subdirectory)) {
|
|
74559
74670
|
throw new Error("Isolated workspace subdirectory must be a nonempty relative path");
|
|
74560
74671
|
}
|
|
74561
|
-
const lexicalChild =
|
|
74562
|
-
const lexicalRelative =
|
|
74563
|
-
if (
|
|
74672
|
+
const lexicalChild = resolve15(meta.worktreePath, subdirectory);
|
|
74673
|
+
const lexicalRelative = relative5(resolve15(meta.worktreePath), lexicalChild);
|
|
74674
|
+
if (isAbsolute9(lexicalRelative) || lexicalRelative === ".." || lexicalRelative.startsWith(`..${sep7}`)) {
|
|
74564
74675
|
throw new Error("Isolated workspace subdirectory escapes the worktree");
|
|
74565
74676
|
}
|
|
74566
74677
|
let physicalChild;
|
|
74567
74678
|
try {
|
|
74568
|
-
physicalChild = await
|
|
74679
|
+
physicalChild = await realpath9(lexicalChild);
|
|
74569
74680
|
if (!(await stat10(physicalChild)).isDirectory()) {
|
|
74570
74681
|
throw new Error("The selected worktree path is not a directory");
|
|
74571
74682
|
}
|
|
74572
74683
|
} catch (cause) {
|
|
74573
74684
|
throw new Error("Isolated workspace subdirectory is missing or not a directory", { cause });
|
|
74574
74685
|
}
|
|
74575
|
-
const physicalRelative =
|
|
74576
|
-
if (physicalRelative === "" ||
|
|
74686
|
+
const physicalRelative = relative5(physicalPaths[0], physicalChild);
|
|
74687
|
+
if (physicalRelative === "" || isAbsolute9(physicalRelative) || physicalRelative === ".." || physicalRelative.startsWith(`..${sep7}`)) {
|
|
74577
74688
|
throw new Error("Isolated workspace subdirectory resolves outside its worktree");
|
|
74578
74689
|
}
|
|
74579
74690
|
return physicalChild;
|
|
@@ -75208,7 +75319,8 @@ var AgentManager = class {
|
|
|
75208
75319
|
agentType: placement.agentType,
|
|
75209
75320
|
description: placement.description,
|
|
75210
75321
|
status: "running",
|
|
75211
|
-
createdAt: placement.createdAt
|
|
75322
|
+
createdAt: placement.createdAt,
|
|
75323
|
+
...placement.continuation ? { continuation: placement.continuation } : {}
|
|
75212
75324
|
};
|
|
75213
75325
|
}
|
|
75214
75326
|
/**
|
|
@@ -75259,7 +75371,13 @@ var AgentManager = class {
|
|
|
75259
75371
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
75260
75372
|
toolCallId: spawnToolCallId(taskId),
|
|
75261
75373
|
agentType: options.agentId,
|
|
75262
|
-
description: describeSpawn(options)
|
|
75374
|
+
description: describeSpawn(options),
|
|
75375
|
+
...options.continuationProfile ? {
|
|
75376
|
+
continuation: {
|
|
75377
|
+
workspace: options.workspace?.mode === "isolated" ? "isolated" : "shared",
|
|
75378
|
+
profile: { ...options.continuationProfile }
|
|
75379
|
+
}
|
|
75380
|
+
} : {}
|
|
75263
75381
|
};
|
|
75264
75382
|
await writeChildSessionMeta(spawnRecord.placement.metaPath, this.childMeta(spawnRecord));
|
|
75265
75383
|
return DiskSessionLog.at(paths2, {
|
|
@@ -75361,9 +75479,9 @@ var AgentManager = class {
|
|
|
75361
75479
|
if (isTerminalAgentTaskState(agentTask.state)) {
|
|
75362
75480
|
return Promise.resolve();
|
|
75363
75481
|
}
|
|
75364
|
-
return new Promise((
|
|
75482
|
+
return new Promise((resolve28) => {
|
|
75365
75483
|
const existing = this.completionCallbacks.get(taskId) ?? [];
|
|
75366
|
-
existing.push(
|
|
75484
|
+
existing.push(resolve28);
|
|
75367
75485
|
this.completionCallbacks.set(taskId, existing);
|
|
75368
75486
|
});
|
|
75369
75487
|
}
|
|
@@ -75570,11 +75688,156 @@ var AgentManager = class {
|
|
|
75570
75688
|
origin,
|
|
75571
75689
|
topicId: context2.topicId,
|
|
75572
75690
|
projectId: context2.projectId,
|
|
75573
|
-
cwd:
|
|
75691
|
+
cwd: resolve15(options.input.workingDirectory ?? process.cwd()),
|
|
75574
75692
|
log,
|
|
75575
75693
|
activeSubSessionId: origin.subSessionId
|
|
75576
75694
|
});
|
|
75577
75695
|
}
|
|
75696
|
+
/**
|
|
75697
|
+
* Make a child saved by an earlier process continuable again.
|
|
75698
|
+
*
|
|
75699
|
+
* Reads the child's meta document and log from the project layout under the
|
|
75700
|
+
* invoking parent, checks they describe a settled, shared-workspace child of
|
|
75701
|
+
* this very parent session, then re-creates the in-memory session and edge
|
|
75702
|
+
* and the retained conversation that {@link provisionContinuation} requires.
|
|
75703
|
+
* It runs nothing; the caller continues the child with `sendMessage` and
|
|
75704
|
+
* `resumeSessionId`, so the invoking turn's authority, limits and review
|
|
75705
|
+
* channel apply exactly as for a child that finished in this process.
|
|
75706
|
+
*/
|
|
75707
|
+
async restoreChildConversation(options, context2) {
|
|
75708
|
+
const refuse3 = /* @__PURE__ */ __name((reason2) => ({
|
|
75709
|
+
status: "refused",
|
|
75710
|
+
reason: reason2
|
|
75711
|
+
}), "refuse");
|
|
75712
|
+
const id3 = options.childSessionId;
|
|
75713
|
+
const retained = this.childConversations.get(id3);
|
|
75714
|
+
if (retained?.activeSubSessionId)
|
|
75715
|
+
return refuse3("running");
|
|
75716
|
+
const paths2 = context2.childStorage?.kind === "disk" ? context2.childStorage.paths : this.deps.paths;
|
|
75717
|
+
if (!paths2)
|
|
75718
|
+
return refuse3("no-layout");
|
|
75719
|
+
const store = this.deps.sessionStore;
|
|
75720
|
+
if (store.supportsInvocationSummaries !== true || store.supportsOwnerVersionCas !== true)
|
|
75721
|
+
return refuse3("not-resumable");
|
|
75722
|
+
const ancestry = await store.getAncestry(context2.sessionId, context2.tenantId);
|
|
75723
|
+
const parentLocator = {
|
|
75724
|
+
sessionId: context2.sessionId,
|
|
75725
|
+
ancestors: ancestry.slice(0, -1)
|
|
75726
|
+
};
|
|
75727
|
+
let meta;
|
|
75728
|
+
try {
|
|
75729
|
+
meta = await readChildSessionMeta(paths2.subagentMeta(parentLocator, id3));
|
|
75730
|
+
} catch {
|
|
75731
|
+
return refuse3("not-saved");
|
|
75732
|
+
}
|
|
75733
|
+
if (!meta)
|
|
75734
|
+
return refuse3("not-saved");
|
|
75735
|
+
if (meta.sessionId !== id3 || meta.parentSessionId !== context2.sessionId)
|
|
75736
|
+
return refuse3("foreign");
|
|
75737
|
+
const continuation = meta.continuation;
|
|
75738
|
+
if (!continuation || continuation.workspace !== "shared")
|
|
75739
|
+
return refuse3("not-resumable");
|
|
75740
|
+
const agentId = options.agentFor(continuation.profile);
|
|
75741
|
+
if (agentId === void 0 || !this.registry.has(agentId))
|
|
75742
|
+
return refuse3("not-resumable");
|
|
75743
|
+
const log = retained?.log ?? DiskSessionLog.at(paths2, { sessionId: id3, ancestors: ancestry });
|
|
75744
|
+
const ended = await childSessionEnded(log);
|
|
75745
|
+
if (!ended)
|
|
75746
|
+
return refuse3("unsettled");
|
|
75747
|
+
if (ended.status === "cancelled" || meta.status === "cancelled")
|
|
75748
|
+
return refuse3("stopped");
|
|
75749
|
+
const started = await log.head();
|
|
75750
|
+
if (started === null)
|
|
75751
|
+
return refuse3("unsettled");
|
|
75752
|
+
for await (const { record: record3 } of log.read({ mode: "tolerant" })) {
|
|
75753
|
+
if (record3.type !== "session_started")
|
|
75754
|
+
continue;
|
|
75755
|
+
if (record3.projectId !== context2.projectId || record3.topicId !== context2.topicId)
|
|
75756
|
+
return refuse3("foreign");
|
|
75757
|
+
break;
|
|
75758
|
+
}
|
|
75759
|
+
const placement = {
|
|
75760
|
+
paths: paths2,
|
|
75761
|
+
metaPath: paths2.subagentMeta(parentLocator, id3),
|
|
75762
|
+
createdAt: meta.createdAt,
|
|
75763
|
+
toolCallId: meta.toolCallId,
|
|
75764
|
+
agentType: meta.agentType,
|
|
75765
|
+
description: meta.description,
|
|
75766
|
+
continuation
|
|
75767
|
+
};
|
|
75768
|
+
const restored = {
|
|
75769
|
+
status: "restored",
|
|
75770
|
+
childSessionId: id3,
|
|
75771
|
+
agentId,
|
|
75772
|
+
profile: continuation.profile,
|
|
75773
|
+
description: meta.description
|
|
75774
|
+
};
|
|
75775
|
+
if (retained)
|
|
75776
|
+
return restored;
|
|
75777
|
+
if (this.childConversations.size >= RETAINED_CHILD_CONVERSATION_CAP) {
|
|
75778
|
+
const oldest = [...this.childConversations].find(([, value]) => !value.activeSubSessionId);
|
|
75779
|
+
if (!oldest)
|
|
75780
|
+
return refuse3("full");
|
|
75781
|
+
this.childConversations.delete(oldest[0]);
|
|
75782
|
+
}
|
|
75783
|
+
const childActor = {
|
|
75784
|
+
kind: "agent",
|
|
75785
|
+
agentId,
|
|
75786
|
+
tenantId: context2.tenantId,
|
|
75787
|
+
parentActor: context2.parentActor
|
|
75788
|
+
};
|
|
75789
|
+
let child = await store.getSession(id3, context2.tenantId);
|
|
75790
|
+
let createdChild = false;
|
|
75791
|
+
let edge;
|
|
75792
|
+
let createdEdge = false;
|
|
75793
|
+
try {
|
|
75794
|
+
if (child) {
|
|
75795
|
+
if (child.status === "active" || child.status === "archived" || child.status === "locked" || child.projectId !== context2.projectId || child.topicId !== context2.topicId || child.currentActor?.kind !== "agent" || child.currentActor.agentId !== agentId)
|
|
75796
|
+
return refuse3("running");
|
|
75797
|
+
} else {
|
|
75798
|
+
child = await store.createSession({ id: id3, topicId: context2.topicId, projectId: context2.projectId, currentActor: childActor }, context2.tenantId);
|
|
75799
|
+
createdChild = true;
|
|
75800
|
+
}
|
|
75801
|
+
edge = (await store.getChildren(context2.sessionId, context2.tenantId)).find((candidate) => candidate.childSessionId === id3);
|
|
75802
|
+
if (!edge) {
|
|
75803
|
+
edge = await store.createSubSession({
|
|
75804
|
+
parentSessionId: context2.sessionId,
|
|
75805
|
+
childSessionId: id3,
|
|
75806
|
+
kind: "agent_spawn",
|
|
75807
|
+
spawnedBy: context2.parentActor,
|
|
75808
|
+
failureMode: "delegate",
|
|
75809
|
+
completionMode: "summary_ref"
|
|
75810
|
+
}, context2.tenantId);
|
|
75811
|
+
createdEdge = true;
|
|
75812
|
+
}
|
|
75813
|
+
} catch (error) {
|
|
75814
|
+
if (edge && createdEdge)
|
|
75815
|
+
await store.deleteSubSession(edge.id, context2.tenantId).catch(() => void 0);
|
|
75816
|
+
if (child && createdChild)
|
|
75817
|
+
await store.deleteSession(id3, context2.tenantId).catch(() => void 0);
|
|
75818
|
+
throw error;
|
|
75819
|
+
}
|
|
75820
|
+
this.childConversations.set(id3, {
|
|
75821
|
+
definition: this.registry.getOrThrow(agentId),
|
|
75822
|
+
origin: {
|
|
75823
|
+
subSessionId: edge.id,
|
|
75824
|
+
childSessionId: id3,
|
|
75825
|
+
tenantId: context2.tenantId,
|
|
75826
|
+
parentSessionId: context2.sessionId,
|
|
75827
|
+
parentTurnId: meta.parentTurnId,
|
|
75828
|
+
rootSessionId: meta.rootSessionId,
|
|
75829
|
+
ancestry,
|
|
75830
|
+
childDepth: meta.depth,
|
|
75831
|
+
childOwnerVersion: child.ownerVersion,
|
|
75832
|
+
placement
|
|
75833
|
+
},
|
|
75834
|
+
topicId: context2.topicId,
|
|
75835
|
+
projectId: context2.projectId,
|
|
75836
|
+
cwd: resolve15(options.workingDirectory),
|
|
75837
|
+
log
|
|
75838
|
+
});
|
|
75839
|
+
return restored;
|
|
75840
|
+
}
|
|
75578
75841
|
releaseChildConversation(record3) {
|
|
75579
75842
|
const conversation = this.childConversations.get(record3.childSessionId);
|
|
75580
75843
|
if (conversation?.activeSubSessionId !== record3.subSessionId)
|
|
@@ -75598,7 +75861,7 @@ var AgentManager = class {
|
|
|
75598
75861
|
throw new Error("Child conversation is still running or settling");
|
|
75599
75862
|
if (origin.workspaceRef || options.workspace?.mode === "isolated" || options.workspaceBackend)
|
|
75600
75863
|
throw new Error("Child continuation requires a shared workspace; isolated leases cannot be resumed");
|
|
75601
|
-
if (
|
|
75864
|
+
if (resolve15(options.input.workingDirectory ?? process.cwd()) !== conversation.cwd)
|
|
75602
75865
|
throw new Error("Child continuation cannot change its working directory");
|
|
75603
75866
|
const store = this.deps.sessionStore;
|
|
75604
75867
|
if (store.supportsInvocationSummaries !== true || store.supportsOwnerVersionCas !== true)
|
|
@@ -75937,8 +76200,8 @@ var AgentManager = class {
|
|
|
75937
76200
|
resolveCompletionCallbacks(taskId) {
|
|
75938
76201
|
const callbacks = this.completionCallbacks.get(taskId);
|
|
75939
76202
|
if (callbacks) {
|
|
75940
|
-
for (const
|
|
75941
|
-
|
|
76203
|
+
for (const resolve28 of callbacks)
|
|
76204
|
+
resolve28();
|
|
75942
76205
|
this.completionCallbacks.delete(taskId);
|
|
75943
76206
|
}
|
|
75944
76207
|
}
|
|
@@ -76132,11 +76395,11 @@ import { spawn as spawn3, spawnSync } from "node:child_process";
|
|
|
76132
76395
|
import { constants as constants3, accessSync as accessSync2, existsSync as existsSync4, realpathSync as realpathSync4 } from "node:fs";
|
|
76133
76396
|
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";
|
|
76134
76397
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
76135
|
-
import { dirname as
|
|
76398
|
+
import { dirname as dirname18, isAbsolute as isAbsolute11, join as join31, parse as parse3, resolve as resolve16 } from "node:path";
|
|
76136
76399
|
|
|
76137
76400
|
// ../sdk/dist/sandbox/file-walk.js
|
|
76138
76401
|
var import_brace_expansion2 = __toESM(require_brace_expansion(), 1);
|
|
76139
|
-
import { isAbsolute as
|
|
76402
|
+
import { isAbsolute as isAbsolute10, posix as posix3 } from "node:path";
|
|
76140
76403
|
|
|
76141
76404
|
// ../../node_modules/.pnpm/minimatch@9.0.9/node_modules/minimatch/dist/esm/index.js
|
|
76142
76405
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
|
@@ -77693,7 +77956,7 @@ function positiveInteger(value, name2) {
|
|
|
77693
77956
|
}
|
|
77694
77957
|
__name(positiveInteger, "positiveInteger");
|
|
77695
77958
|
function planWalk(root, options) {
|
|
77696
|
-
if (!
|
|
77959
|
+
if (!isAbsolute10(root) && !posix3.isAbsolute(root)) {
|
|
77697
77960
|
throw new Error("File walk root must be an absolute path");
|
|
77698
77961
|
}
|
|
77699
77962
|
let pattern = options.pattern ?? "**/*";
|
|
@@ -77750,7 +78013,7 @@ function planWalk(root, options) {
|
|
|
77750
78013
|
__name(planWalk, "planWalk");
|
|
77751
78014
|
function directoryMatcher(plan) {
|
|
77752
78015
|
const patterns = plan.patterns.map((set3) => set3.map((part2) => typeof part2 === "object" && part2 !== null ? new RegExp(part2.source, `${part2.flags}s`) : part2));
|
|
77753
|
-
return (
|
|
78016
|
+
return (relative11) => patterns.some((pattern) => {
|
|
77754
78017
|
const closure = /* @__PURE__ */ __name((states2) => {
|
|
77755
78018
|
for (const index of states2)
|
|
77756
78019
|
if (pattern[index] === null)
|
|
@@ -77758,7 +78021,7 @@ function directoryMatcher(plan) {
|
|
|
77758
78021
|
return states2;
|
|
77759
78022
|
}, "closure");
|
|
77760
78023
|
let states = closure(/* @__PURE__ */ new Set([0]));
|
|
77761
|
-
for (const name2 of
|
|
78024
|
+
for (const name2 of relative11.split("/")) {
|
|
77762
78025
|
const next = /* @__PURE__ */ new Set();
|
|
77763
78026
|
for (const index of states) {
|
|
77764
78027
|
const segment2 = pattern[index];
|
|
@@ -77878,14 +78141,14 @@ async function* executeWalk(plan, signal) {
|
|
|
77878
78141
|
}
|
|
77879
78142
|
if (plan.prefix.length >= maxDepth)
|
|
77880
78143
|
return;
|
|
77881
|
-
const openDirectory = /* @__PURE__ */ __name(async (absolute,
|
|
78144
|
+
const openDirectory = /* @__PURE__ */ __name(async (absolute, relative11, depth) => {
|
|
77882
78145
|
check2();
|
|
77883
78146
|
try {
|
|
77884
78147
|
const dir = await wait(fs.opendir(absolute), (late2) => {
|
|
77885
78148
|
void close(late2).catch(() => {
|
|
77886
78149
|
});
|
|
77887
78150
|
});
|
|
77888
|
-
open13.push({ dir, relative:
|
|
78151
|
+
open13.push({ dir, relative: relative11, depth });
|
|
77889
78152
|
} catch (error) {
|
|
77890
78153
|
if (!missing(error))
|
|
77891
78154
|
throw error;
|
|
@@ -77903,15 +78166,15 @@ async function* executeWalk(plan, signal) {
|
|
|
77903
78166
|
continue;
|
|
77904
78167
|
}
|
|
77905
78168
|
noteVisit();
|
|
77906
|
-
const
|
|
77907
|
-
const absolute = path2.join(plan.root,
|
|
78169
|
+
const relative11 = frame.relative ? `${frame.relative}/${entry.name}` : entry.name;
|
|
78170
|
+
const absolute = path2.join(plan.root, relative11);
|
|
77908
78171
|
const depth = frame.depth + 1;
|
|
77909
78172
|
if (entry.isDirectory()) {
|
|
77910
|
-
if (depth < maxDepth && canDescend(
|
|
77911
|
-
await openDirectory(absolute,
|
|
78173
|
+
if (depth < maxDepth && canDescend(relative11))
|
|
78174
|
+
await openDirectory(absolute, relative11, depth);
|
|
77912
78175
|
continue;
|
|
77913
78176
|
}
|
|
77914
|
-
if (!entry.isFile() || !matchers.some((matcher) => matcher.test(
|
|
78177
|
+
if (!entry.isFile() || !matchers.some((matcher) => matcher.test(relative11)))
|
|
77915
78178
|
continue;
|
|
77916
78179
|
let info;
|
|
77917
78180
|
try {
|
|
@@ -78043,7 +78306,7 @@ var CappedStream = class {
|
|
|
78043
78306
|
}
|
|
78044
78307
|
};
|
|
78045
78308
|
function requiredWrapper(request) {
|
|
78046
|
-
if (request.wrapperCommand === void 0 || !
|
|
78309
|
+
if (request.wrapperCommand === void 0 || !isAbsolute11(request.wrapperCommand)) {
|
|
78047
78310
|
throw new Error(`Sandbox environment ${request.environment} requires the absolute wrapper path that was probed`);
|
|
78048
78311
|
}
|
|
78049
78312
|
return request.wrapperCommand;
|
|
@@ -78141,7 +78404,7 @@ function buildBwrapArgs(sandboxRoot, additionalDirectories = []) {
|
|
|
78141
78404
|
if (existsSync4(path2))
|
|
78142
78405
|
args.push("--ro-bind", path2, path2);
|
|
78143
78406
|
}
|
|
78144
|
-
const interpreterPrefix =
|
|
78407
|
+
const interpreterPrefix = dirname18(dirname18(canonicalizePath(process.execPath)));
|
|
78145
78408
|
const alreadyCovered = BWRAP_SYSTEM_PATHS.some((path2) => interpreterPrefix === path2 || interpreterPrefix.startsWith(`${path2}/`));
|
|
78146
78409
|
if (!alreadyCovered && existsSync4(interpreterPrefix)) {
|
|
78147
78410
|
args.push("--ro-bind", interpreterPrefix, interpreterPrefix);
|
|
@@ -78312,7 +78575,7 @@ var LocalSandbox = class {
|
|
|
78312
78575
|
this.rootDir = rootDir;
|
|
78313
78576
|
this.environment = environment;
|
|
78314
78577
|
this.config = config;
|
|
78315
|
-
this.additionalDirectories = (config.additionalDirectories ?? []).map((dir) => canonicalizePath(
|
|
78578
|
+
this.additionalDirectories = (config.additionalDirectories ?? []).map((dir) => canonicalizePath(resolve16(dir))).filter((dir) => dir !== rootDir);
|
|
78316
78579
|
this._status = "ready";
|
|
78317
78580
|
this.log = log.child({
|
|
78318
78581
|
[SCOPE_ATTRIBUTE]: "sandbox/provider/local",
|
|
@@ -78356,7 +78619,7 @@ var LocalSandbox = class {
|
|
|
78356
78619
|
throw new Error(`Sandbox ${this.id} is destroyed`);
|
|
78357
78620
|
}
|
|
78358
78621
|
const resolved2 = await resolveWithinAnyReal(this.roots, path2);
|
|
78359
|
-
await mkdir16(
|
|
78622
|
+
await mkdir16(dirname18(resolved2), { recursive: true });
|
|
78360
78623
|
const tmpPath = `${resolved2}.tmp.${Date.now()}`;
|
|
78361
78624
|
await fsWriteFile(tmpPath, content);
|
|
78362
78625
|
await rename7(tmpPath, resolved2);
|
|
@@ -78705,7 +78968,7 @@ var LocalSandboxProvider = class {
|
|
|
78705
78968
|
let rootDir;
|
|
78706
78969
|
let removeRootOnDestroy;
|
|
78707
78970
|
if (config?.workingDirectory !== void 0) {
|
|
78708
|
-
const requested =
|
|
78971
|
+
const requested = resolve16(config.workingDirectory);
|
|
78709
78972
|
let entry;
|
|
78710
78973
|
try {
|
|
78711
78974
|
entry = await stat11(requested);
|
|
@@ -78728,9 +78991,9 @@ var LocalSandboxProvider = class {
|
|
|
78728
78991
|
}
|
|
78729
78992
|
removeRootOnDestroy = false;
|
|
78730
78993
|
for (const dir of config.additionalDirectories ?? []) {
|
|
78731
|
-
const entry2 = await stat11(
|
|
78994
|
+
const entry2 = await stat11(resolve16(dir)).catch(() => null);
|
|
78732
78995
|
if (!entry2?.isDirectory()) {
|
|
78733
|
-
throw new Error(`Sandbox additional directory is not a directory: ${
|
|
78996
|
+
throw new Error(`Sandbox additional directory is not a directory: ${resolve16(dir)}`);
|
|
78734
78997
|
}
|
|
78735
78998
|
}
|
|
78736
78999
|
} else {
|
|
@@ -78787,8 +79050,8 @@ var WorkspaceBackendRegistry = class {
|
|
|
78787
79050
|
// ../sdk/dist/session/workspace/git-worktree.js
|
|
78788
79051
|
import { execFile } from "node:child_process";
|
|
78789
79052
|
import { readFileSync as readFileSync2, realpathSync as realpathSync5 } from "node:fs";
|
|
78790
|
-
import { realpath as
|
|
78791
|
-
import { basename as basename9, dirname as
|
|
79053
|
+
import { realpath as realpath10 } from "node:fs/promises";
|
|
79054
|
+
import { basename as basename9, dirname as dirname19, isAbsolute as isAbsolute12, join as join32, relative as relative6, resolve as resolve17, sep as sep9 } from "node:path";
|
|
78792
79055
|
import { promisify } from "node:util";
|
|
78793
79056
|
var execFileAsync = promisify(execFile);
|
|
78794
79057
|
var defaultExecFile = /* @__PURE__ */ __name(async (file, args) => execFileAsync(file, [...args]), "defaultExecFile");
|
|
@@ -78802,8 +79065,8 @@ var GitWorktreeDriver = class {
|
|
|
78802
79065
|
log;
|
|
78803
79066
|
exec;
|
|
78804
79067
|
constructor(config) {
|
|
78805
|
-
this.repoRoot =
|
|
78806
|
-
this.worktreesDir =
|
|
79068
|
+
this.repoRoot = resolve17(config.repoRoot);
|
|
79069
|
+
this.worktreesDir = resolve17(config.worktreesDir ?? defaultWorktreesDir(config.repoRoot));
|
|
78807
79070
|
this.log = config.logger.child({ [SCOPE_ATTRIBUTE]: "session/workspace/git-worktree" });
|
|
78808
79071
|
this.exec = config.execFile ?? defaultExecFile;
|
|
78809
79072
|
}
|
|
@@ -78816,7 +79079,7 @@ var GitWorktreeDriver = class {
|
|
|
78816
79079
|
try {
|
|
78817
79080
|
repoRoot = await canonicalizeThroughExisting(this.repoRoot);
|
|
78818
79081
|
worktreesDir = await canonicalizeThroughExisting(this.worktreesDir);
|
|
78819
|
-
const lexicalPath =
|
|
79082
|
+
const lexicalPath = resolve17(worktreesDir, label5);
|
|
78820
79083
|
if (!isStrictDescendant(worktreesDir, lexicalPath)) {
|
|
78821
79084
|
throw new Error(`Workspace label escapes the managed worktree directory: ${label5}`);
|
|
78822
79085
|
}
|
|
@@ -78824,13 +79087,13 @@ var GitWorktreeDriver = class {
|
|
|
78824
79087
|
if (!isStrictDescendant(worktreesDir, worktreePath)) {
|
|
78825
79088
|
throw new Error(`Workspace label resolves through a link outside the managed worktree directory: ${label5}`);
|
|
78826
79089
|
}
|
|
78827
|
-
if (
|
|
79090
|
+
if (relative6(worktreesDir, lexicalPath) !== relative6(worktreesDir, worktreePath)) {
|
|
78828
79091
|
throw new Error(`Workspace label resolves through a link to a different managed path: ${label5}`);
|
|
78829
79092
|
}
|
|
78830
79093
|
} catch (cause) {
|
|
78831
79094
|
throw new WorkspaceBackendError({ op: "create:ownership", kind: this.kind, cause });
|
|
78832
79095
|
}
|
|
78833
|
-
const relativePath =
|
|
79096
|
+
const relativePath = relative6(worktreesDir, worktreePath).split(sep9).join("/");
|
|
78834
79097
|
const branch = `namzu/${relativePath}`;
|
|
78835
79098
|
const argv = ["-C", repoRoot, "worktree", "add", "-b", branch, "--", worktreePath];
|
|
78836
79099
|
if (params.baseRef !== void 0) {
|
|
@@ -78985,7 +79248,7 @@ var GitWorktreeDriver = class {
|
|
|
78985
79248
|
if (!isStrictDescendant(worktreesDir, worktreePath)) {
|
|
78986
79249
|
throw new Error("Workspace reference escapes the managed worktree directory");
|
|
78987
79250
|
}
|
|
78988
|
-
const label5 =
|
|
79251
|
+
const label5 = relative6(worktreesDir, worktreePath).split(sep9).join("/");
|
|
78989
79252
|
const branch = `namzu/${label5}`;
|
|
78990
79253
|
if (ref.meta.branch !== branch) {
|
|
78991
79254
|
throw new Error("Workspace reference branch does not match its managed path");
|
|
@@ -79019,28 +79282,28 @@ var GitWorktreeDriver = class {
|
|
|
79019
79282
|
}
|
|
79020
79283
|
};
|
|
79021
79284
|
async function canonicalizeThroughExisting(input) {
|
|
79022
|
-
let existing =
|
|
79285
|
+
let existing = resolve17(input);
|
|
79023
79286
|
const remainder = [];
|
|
79024
79287
|
for (; ; ) {
|
|
79025
79288
|
try {
|
|
79026
|
-
const canonical2 = await
|
|
79027
|
-
return
|
|
79289
|
+
const canonical2 = await realpath10(existing);
|
|
79290
|
+
return resolve17(canonical2, ...remainder);
|
|
79028
79291
|
} catch (cause) {
|
|
79029
79292
|
const code = cause.code;
|
|
79030
79293
|
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
79031
79294
|
throw cause;
|
|
79032
79295
|
}
|
|
79033
|
-
const parent =
|
|
79296
|
+
const parent = dirname19(existing);
|
|
79034
79297
|
if (parent === existing)
|
|
79035
|
-
return
|
|
79298
|
+
return resolve17(existing, ...remainder);
|
|
79036
79299
|
remainder.unshift(basename9(existing));
|
|
79037
79300
|
existing = parent;
|
|
79038
79301
|
}
|
|
79039
79302
|
}
|
|
79040
79303
|
__name(canonicalizeThroughExisting, "canonicalizeThroughExisting");
|
|
79041
79304
|
function isStrictDescendant(root, candidate) {
|
|
79042
|
-
const rel =
|
|
79043
|
-
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep9}`) && !
|
|
79305
|
+
const rel = relative6(root, candidate);
|
|
79306
|
+
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep9}`) && !isAbsolute12(rel);
|
|
79044
79307
|
}
|
|
79045
79308
|
__name(isStrictDescendant, "isStrictDescendant");
|
|
79046
79309
|
function parseWorktreeList(stdout, worktreePath) {
|
|
@@ -79074,7 +79337,7 @@ function defaultWorktreesDir(repoRoot) {
|
|
|
79074
79337
|
try {
|
|
79075
79338
|
cwd = realpathSync5(repoRoot);
|
|
79076
79339
|
} catch {
|
|
79077
|
-
cwd =
|
|
79340
|
+
cwd = resolve17(repoRoot);
|
|
79078
79341
|
}
|
|
79079
79342
|
const home = resolveNamzuHome();
|
|
79080
79343
|
let slug = slugForCwd(cwd);
|
|
@@ -79235,15 +79498,15 @@ var SessionSummaryMaterializer = class {
|
|
|
79235
79498
|
|
|
79236
79499
|
// ../sdk/dist/store/session/memory.js
|
|
79237
79500
|
import { realpathSync as realpathSync6 } from "node:fs";
|
|
79238
|
-
import { resolve as
|
|
79501
|
+
import { resolve as resolve19 } from "node:path";
|
|
79239
79502
|
|
|
79240
79503
|
// ../sdk/dist/store/session/canonical-path.js
|
|
79241
|
-
import { realpath as
|
|
79242
|
-
import { resolve as
|
|
79504
|
+
import { realpath as realpath11 } from "node:fs/promises";
|
|
79505
|
+
import { resolve as resolve18 } from "node:path";
|
|
79243
79506
|
async function canonicalizePath2(input) {
|
|
79244
|
-
const absolute =
|
|
79507
|
+
const absolute = resolve18(input);
|
|
79245
79508
|
try {
|
|
79246
|
-
return await
|
|
79509
|
+
return await realpath11(absolute);
|
|
79247
79510
|
} catch (err) {
|
|
79248
79511
|
if (err.code === "ENOENT")
|
|
79249
79512
|
return absolute;
|
|
@@ -79331,7 +79594,7 @@ var InMemorySessionStore = class {
|
|
|
79331
79594
|
} catch (error) {
|
|
79332
79595
|
if (error.code !== "ENOENT")
|
|
79333
79596
|
throw error;
|
|
79334
|
-
rootPath =
|
|
79597
|
+
rootPath = resolve19(project.rootPath);
|
|
79335
79598
|
}
|
|
79336
79599
|
const key5 = `${project.tenantId}\0${rootPath}`;
|
|
79337
79600
|
const existingProjectId = roots.get(key5);
|
|
@@ -79782,13 +80045,13 @@ __name(stepResident, "stepResident");
|
|
|
79782
80045
|
|
|
79783
80046
|
// ../sdk/dist/manager/resident/agenda.js
|
|
79784
80047
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
79785
|
-
import { join as join34, resolve as
|
|
80048
|
+
import { join as join34, resolve as resolve21 } from "node:path";
|
|
79786
80049
|
import { isDeepStrictEqual as isDeepStrictEqual6 } from "node:util";
|
|
79787
80050
|
|
|
79788
80051
|
// ../sdk/dist/manager/resident/history-disk.js
|
|
79789
80052
|
import { constants as constants4 } from "node:fs";
|
|
79790
|
-
import { lstat as
|
|
79791
|
-
import { join as join33, relative as
|
|
80053
|
+
import { lstat as lstat9, open as open11 } from "node:fs/promises";
|
|
80054
|
+
import { join as join33, relative as relative7, resolve as resolve20, sep as sep10 } from "node:path";
|
|
79792
80055
|
var RECORD_BYTES2 = 4 * 1024 * 1024;
|
|
79793
80056
|
var ResidentHistoryPageLimit = class extends Error {
|
|
79794
80057
|
static {
|
|
@@ -79797,14 +80060,14 @@ var ResidentHistoryPageLimit = class extends Error {
|
|
|
79797
80060
|
};
|
|
79798
80061
|
async function readResidentHistoryRecord(root, path2, budget) {
|
|
79799
80062
|
budget.signal?.throwIfAborted();
|
|
79800
|
-
const base3 =
|
|
79801
|
-
const suffix =
|
|
80063
|
+
const base3 = resolve20(root);
|
|
80064
|
+
const suffix = relative7(base3, resolve20(path2));
|
|
79802
80065
|
if (suffix === ".." || suffix.startsWith(`..${sep10}`))
|
|
79803
80066
|
throw new Error("Invalid history path.");
|
|
79804
80067
|
let current = base3;
|
|
79805
80068
|
for (const part2 of ["", ...suffix.split(sep10).filter(Boolean)]) {
|
|
79806
80069
|
current = join33(current, part2);
|
|
79807
|
-
if ((await
|
|
80070
|
+
if ((await lstat9(current)).isSymbolicLink())
|
|
79808
80071
|
throw new Error("History symlinks are refused.");
|
|
79809
80072
|
}
|
|
79810
80073
|
const handle = await open11(path2, constants4.O_RDONLY | constants4.O_NOFOLLOW | constants4.O_NONBLOCK);
|
|
@@ -80373,8 +80636,8 @@ var DiskResidentAgenda = class {
|
|
|
80373
80636
|
revisionsDir: join34(directory, "revisions"),
|
|
80374
80637
|
publishLegacyProjection: false
|
|
80375
80638
|
};
|
|
80376
|
-
this.historyRoot =
|
|
80377
|
-
this.historyRevisions =
|
|
80639
|
+
this.historyRoot = resolve21(root);
|
|
80640
|
+
this.historyRevisions = resolve21(this.location.revisionsDir);
|
|
80378
80641
|
}
|
|
80379
80642
|
checked(record3) {
|
|
80380
80643
|
const agenda = agendaSchema.parse(record3);
|
|
@@ -81719,7 +81982,7 @@ __name(createResidentToolEvidenceSource, "createResidentToolEvidenceSource");
|
|
|
81719
81982
|
import { createHash as createHash30, randomUUID as randomUUID13 } from "node:crypto";
|
|
81720
81983
|
import { closeSync as closeSync2, existsSync as existsSync5, fsyncSync as fsyncSync2, linkSync as linkSync2, lstatSync as lstatSync4, mkdirSync as mkdirSync4, openSync as openSync2, readFileSync as readFileSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
81721
81984
|
import { createRequire as createRequire3 } from "node:module";
|
|
81722
|
-
import { dirname as
|
|
81985
|
+
import { dirname as dirname20, join as join35, resolve as resolve22 } from "node:path";
|
|
81723
81986
|
|
|
81724
81987
|
// ../sdk/dist/manager/resident/learning-observation.js
|
|
81725
81988
|
var label4 = external_exports.string().trim().min(1).max(256);
|
|
@@ -81849,8 +82112,8 @@ var SqliteResidentLearningStore = class {
|
|
|
81849
82112
|
scope;
|
|
81850
82113
|
readOnly;
|
|
81851
82114
|
constructor(options) {
|
|
81852
|
-
this.databasePath =
|
|
81853
|
-
this.artifactsPath =
|
|
82115
|
+
this.databasePath = resolve22(options.databasePath);
|
|
82116
|
+
this.artifactsPath = resolve22(options.artifactsPath);
|
|
81854
82117
|
this.scope = Object.freeze({
|
|
81855
82118
|
tenantId: asTenantId(options.scope.tenantId.toLowerCase()),
|
|
81856
82119
|
projectId: asProjectId(options.scope.projectId.toLowerCase()),
|
|
@@ -81870,7 +82133,7 @@ var SqliteResidentLearningStore = class {
|
|
|
81870
82133
|
});
|
|
81871
82134
|
}
|
|
81872
82135
|
if (!this.readOnly)
|
|
81873
|
-
mkdirSync4(
|
|
82136
|
+
mkdirSync4(dirname20(this.databasePath), { recursive: true, mode: 448 });
|
|
81874
82137
|
const db = new Database(this.databasePath, { readOnly: this.readOnly });
|
|
81875
82138
|
try {
|
|
81876
82139
|
db.exec("PRAGMA busy_timeout = 5000; PRAGMA foreign_keys = ON;");
|
|
@@ -82485,7 +82748,7 @@ __name(derivePeerRef, "derivePeerRef");
|
|
|
82485
82748
|
// ../sdk/dist/peers/registry.js
|
|
82486
82749
|
import { randomBytes as randomBytes6 } from "node:crypto";
|
|
82487
82750
|
import { closeSync as closeSync3, fsyncSync as fsyncSync3, lstatSync as lstatSync6, openSync as openSync3, readFileSync as readFileSync4, readdirSync as readdirSync2, renameSync, unlinkSync as unlinkSync3, writeSync as writeSync2 } from "node:fs";
|
|
82488
|
-
import { basename as basename10, dirname as
|
|
82751
|
+
import { basename as basename10, dirname as dirname21, join as join38 } from "node:path";
|
|
82489
82752
|
|
|
82490
82753
|
// ../sdk/dist/peers/client.js
|
|
82491
82754
|
import { createConnection } from "node:net";
|
|
@@ -82505,7 +82768,7 @@ function connectPath(address2) {
|
|
|
82505
82768
|
}
|
|
82506
82769
|
__name(connectPath, "connectPath");
|
|
82507
82770
|
function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
|
|
82508
|
-
return new Promise((
|
|
82771
|
+
return new Promise((resolve28) => {
|
|
82509
82772
|
let settled = false;
|
|
82510
82773
|
const finish2 = /* @__PURE__ */ __name((result) => {
|
|
82511
82774
|
if (settled)
|
|
@@ -82513,7 +82776,7 @@ function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
|
|
|
82513
82776
|
settled = true;
|
|
82514
82777
|
clearTimeout(timer);
|
|
82515
82778
|
socket.destroy();
|
|
82516
|
-
|
|
82779
|
+
resolve28(result);
|
|
82517
82780
|
}, "finish");
|
|
82518
82781
|
const unreachable = /* @__PURE__ */ __name((error) => finish2({
|
|
82519
82782
|
kind: "unreachable",
|
|
@@ -82525,7 +82788,7 @@ function sendPeerRequest(address2, request, parseResponse, timeoutMs) {
|
|
|
82525
82788
|
path2 = connectPath(address2);
|
|
82526
82789
|
} catch (error) {
|
|
82527
82790
|
clearTimeout(timer);
|
|
82528
|
-
|
|
82791
|
+
resolve28({
|
|
82529
82792
|
kind: "unreachable",
|
|
82530
82793
|
reason: error instanceof Error ? error.message : String(error)
|
|
82531
82794
|
});
|
|
@@ -82617,7 +82880,7 @@ function recordPath(sessionsDir, sessionId5) {
|
|
|
82617
82880
|
}
|
|
82618
82881
|
__name(recordPath, "recordPath");
|
|
82619
82882
|
function temporaryPathBeside(path2) {
|
|
82620
|
-
return join38(
|
|
82883
|
+
return join38(dirname21(path2), `.${basename10(path2)}.${process.pid}.${randomBytes6(6).toString("hex")}.tmp`);
|
|
82621
82884
|
}
|
|
82622
82885
|
__name(temporaryPathBeside, "temporaryPathBeside");
|
|
82623
82886
|
function writePeerRecord(sessionsDir, record3) {
|
|
@@ -83034,23 +83297,23 @@ async function createPeerEndpoint(options) {
|
|
|
83034
83297
|
void handleLine(buffered.subarray(0, newline)).catch(() => socket.destroy());
|
|
83035
83298
|
});
|
|
83036
83299
|
});
|
|
83037
|
-
await new Promise((
|
|
83300
|
+
await new Promise((resolve28, reject2) => {
|
|
83038
83301
|
const failed = /* @__PURE__ */ __name((error) => reject2(error), "failed");
|
|
83039
83302
|
server.once("error", failed);
|
|
83040
83303
|
server.listen({ path: listenPath }, () => {
|
|
83041
83304
|
server.removeListener("error", failed);
|
|
83042
|
-
|
|
83305
|
+
resolve28();
|
|
83043
83306
|
});
|
|
83044
83307
|
});
|
|
83045
83308
|
server.on("error", () => {
|
|
83046
83309
|
});
|
|
83047
83310
|
if (parsed.scheme === "uds")
|
|
83048
83311
|
chmodSync3(listenPath, 384);
|
|
83049
|
-
const close = /* @__PURE__ */ __name(() => new Promise((
|
|
83312
|
+
const close = /* @__PURE__ */ __name(() => new Promise((resolve28) => {
|
|
83050
83313
|
closing = true;
|
|
83051
83314
|
for (const socket of sockets)
|
|
83052
83315
|
socket.destroy();
|
|
83053
|
-
server.close(() =>
|
|
83316
|
+
server.close(() => resolve28());
|
|
83054
83317
|
}), "close");
|
|
83055
83318
|
return {
|
|
83056
83319
|
address: options.address,
|
|
@@ -83654,7 +83917,7 @@ var PalRuntime = class {
|
|
|
83654
83917
|
// ../sdk/dist/pals/communication/store.js
|
|
83655
83918
|
import { randomUUID as randomUUID14 } from "node:crypto";
|
|
83656
83919
|
import { chmodSync as chmodSync4, lstatSync as lstatSync8, mkdirSync as mkdirSync6, readdirSync as readdirSync3, realpathSync as realpathSync7 } from "node:fs";
|
|
83657
|
-
import { join as join39, resolve as
|
|
83920
|
+
import { join as join39, resolve as resolve23 } from "node:path";
|
|
83658
83921
|
import { isDeepStrictEqual as isDeepStrictEqual8 } from "node:util";
|
|
83659
83922
|
|
|
83660
83923
|
// ../sdk/dist/pals/communication/ingress-types.js
|
|
@@ -83888,7 +84151,7 @@ var DiskPalCommunicationStore = class {
|
|
|
83888
84151
|
migrations: { 1: (value) => value }
|
|
83889
84152
|
}), "Pal communication", (record3) => record3.revision);
|
|
83890
84153
|
constructor(options) {
|
|
83891
|
-
this.root =
|
|
84154
|
+
this.root = resolve23(options.root);
|
|
83892
84155
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
83893
84156
|
if (process.platform !== "win32")
|
|
83894
84157
|
chmodSync4(path2, 448);
|
|
@@ -84363,7 +84626,7 @@ var PalMessageBroker = class {
|
|
|
84363
84626
|
|
|
84364
84627
|
// ../sdk/dist/pals/communication/policy.js
|
|
84365
84628
|
import { chmodSync as chmodSync5, lstatSync as lstatSync9, mkdirSync as mkdirSync7, readdirSync as readdirSync4, realpathSync as realpathSync8 } from "node:fs";
|
|
84366
|
-
import { join as join40, resolve as
|
|
84629
|
+
import { join as join40, resolve as resolve24 } from "node:path";
|
|
84367
84630
|
var PalMessagePermissionConflictError = class extends Error {
|
|
84368
84631
|
static {
|
|
84369
84632
|
__name(this, "PalMessagePermissionConflictError");
|
|
@@ -84399,7 +84662,7 @@ var DiskPalMessagePolicy = class {
|
|
|
84399
84662
|
secure;
|
|
84400
84663
|
records = new DiskRevisionRecordStore(defineSchema({ kind: "pal-message-permission", current: 1, migrations: {} }), "Pal message permission", (value) => value.revision);
|
|
84401
84664
|
constructor(options) {
|
|
84402
|
-
this.root =
|
|
84665
|
+
this.root = resolve24(options.root);
|
|
84403
84666
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
84404
84667
|
if (process.platform !== "win32")
|
|
84405
84668
|
chmodSync5(path2, 448);
|
|
@@ -85040,7 +85303,7 @@ __name(dispatchPalIngressOnce, "dispatchPalIngressOnce");
|
|
|
85040
85303
|
|
|
85041
85304
|
// ../sdk/dist/pals/activity/subscription-store.js
|
|
85042
85305
|
import { chmodSync as chmodSync6, lstatSync as lstatSync10, mkdirSync as mkdirSync8, readdirSync as readdirSync5, realpathSync as realpathSync9 } from "node:fs";
|
|
85043
|
-
import { join as join41, resolve as
|
|
85306
|
+
import { join as join41, resolve as resolve25 } from "node:path";
|
|
85044
85307
|
import { isDeepStrictEqual as isDeepStrictEqual9 } from "node:util";
|
|
85045
85308
|
|
|
85046
85309
|
// ../sdk/dist/pals/activity/subscription-schema.js
|
|
@@ -85079,7 +85342,7 @@ var DiskPalActivitySubscriptionStore = class {
|
|
|
85079
85342
|
migrations: {}
|
|
85080
85343
|
}), "Pal activity subscription", (value) => value.revision);
|
|
85081
85344
|
constructor(options) {
|
|
85082
|
-
this.root =
|
|
85345
|
+
this.root = resolve25(options.root);
|
|
85083
85346
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
85084
85347
|
if (process.platform !== "win32")
|
|
85085
85348
|
chmodSync6(path2, 448);
|
|
@@ -85201,7 +85464,7 @@ var DiskPalActivitySubscriptionStore = class {
|
|
|
85201
85464
|
|
|
85202
85465
|
// ../sdk/dist/pals/activity/subscription-policy.js
|
|
85203
85466
|
import { chmodSync as chmodSync7, lstatSync as lstatSync11, mkdirSync as mkdirSync9, readdirSync as readdirSync6, realpathSync as realpathSync10 } from "node:fs";
|
|
85204
|
-
import { join as join42, resolve as
|
|
85467
|
+
import { join as join42, resolve as resolve26 } from "node:path";
|
|
85205
85468
|
import { isDeepStrictEqual as isDeepStrictEqual10 } from "node:util";
|
|
85206
85469
|
var PalActivitySubscriptionPermissionConflictError = class extends Error {
|
|
85207
85470
|
static {
|
|
@@ -85236,7 +85499,7 @@ var DiskPalActivitySubscriptionPolicy = class {
|
|
|
85236
85499
|
migrations: {}
|
|
85237
85500
|
}), "Pal activity subscription permission", (value) => value.revision);
|
|
85238
85501
|
constructor(options) {
|
|
85239
|
-
this.root =
|
|
85502
|
+
this.root = resolve26(options.root);
|
|
85240
85503
|
this.subscriptions = options.subscriptions;
|
|
85241
85504
|
this.secure = options.secureDirectory ?? ((path2) => {
|
|
85242
85505
|
if (process.platform !== "win32")
|
|
@@ -86603,7 +86866,7 @@ function shellProgress(report) {
|
|
|
86603
86866
|
__name(shellProgress, "shellProgress");
|
|
86604
86867
|
function execHostShell(command, options) {
|
|
86605
86868
|
options.signal?.throwIfAborted();
|
|
86606
|
-
return new Promise((
|
|
86869
|
+
return new Promise((resolve28, reject2) => {
|
|
86607
86870
|
const child = spawnHostShell(command, {
|
|
86608
86871
|
cwd: options.cwd,
|
|
86609
86872
|
env: options.env,
|
|
@@ -86704,7 +86967,7 @@ function execHostShell(command, options) {
|
|
|
86704
86967
|
const stdout = decodeCapture("stdout");
|
|
86705
86968
|
const stderr = decodeCapture("stderr");
|
|
86706
86969
|
if (!failure2 && cause === void 0 && code === 0 && signal === null) {
|
|
86707
|
-
|
|
86970
|
+
resolve28({
|
|
86708
86971
|
stdout,
|
|
86709
86972
|
stderr,
|
|
86710
86973
|
stdoutBytes: captures.stdout.bytes,
|
|
@@ -86751,7 +87014,7 @@ ${stderr}`));
|
|
|
86751
87014
|
child.off("close", onClose);
|
|
86752
87015
|
child.off("error", onError);
|
|
86753
87016
|
child.off("spawn", onSpawn);
|
|
86754
|
-
|
|
87017
|
+
resolve28({
|
|
86755
87018
|
backgroundedJobId: jobId,
|
|
86756
87019
|
stdout: decodeCapture("stdout"),
|
|
86757
87020
|
stderr: decodeCapture("stderr")
|
|
@@ -87081,8 +87344,8 @@ var BashTool = Object.defineProperty({ ...BashToolBase }, "description", {
|
|
|
87081
87344
|
});
|
|
87082
87345
|
|
|
87083
87346
|
// ../sdk/dist/tools/builtins/code-analysis.js
|
|
87084
|
-
import { realpath as
|
|
87085
|
-
import { isAbsolute as
|
|
87347
|
+
import { realpath as realpath12, stat as stat12 } from "node:fs/promises";
|
|
87348
|
+
import { isAbsolute as isAbsolute13, relative as relative8, sep as sep11 } from "node:path";
|
|
87086
87349
|
var DEFAULT_LIMIT = 50;
|
|
87087
87350
|
var MAX_LIMIT = 200;
|
|
87088
87351
|
var DEFAULT_MAX_CHARS = 2e4;
|
|
@@ -87219,8 +87482,8 @@ var CodeAnalysisTool = defineTool({
|
|
|
87219
87482
|
return renderPage(result, (hit) => {
|
|
87220
87483
|
const shown = JSON.stringify(hit.value) + (hit.valueTruncated ? " (cut)" : "");
|
|
87221
87484
|
const kind = hit.kind === "string" ? "" : ` (${hit.kind})`;
|
|
87222
|
-
const
|
|
87223
|
-
return `${hit.line}:${hit.column} ${shown}${kind}${
|
|
87485
|
+
const inside2 = hit.function ? ` in ${shortFunction(hit.function)}` : " at top level";
|
|
87486
|
+
return `${hit.line}:${hit.column} ${shown}${kind}${inside2}${staleMark(hit.stale)}`;
|
|
87224
87487
|
}, (hit) => relativeTo(root, hit.path));
|
|
87225
87488
|
}
|
|
87226
87489
|
case "enclosing_function": {
|
|
@@ -87287,11 +87550,11 @@ var CodeAnalysisTool = defineTool({
|
|
|
87287
87550
|
...signalOf(context2)
|
|
87288
87551
|
});
|
|
87289
87552
|
return renderPage(result, (site) => {
|
|
87290
|
-
const
|
|
87553
|
+
const inside2 = site.caller ? ` in ${shortFunction(site.caller)}` : " at top level";
|
|
87291
87554
|
const how = site.kind === "new" ? "new " : "";
|
|
87292
87555
|
const tag = site.kind === "call-via" ? " [call/apply/bind]" : site.kind === "tagged" ? " [tagged template]" : "";
|
|
87293
87556
|
const label5 = site.resolution === "text-only" ? " [text-only]" : "";
|
|
87294
|
-
return `${site.line}:${site.column} ${how}${site.callee}(${site.argumentCount} arg${site.argumentCount === 1 ? "" : "s"})${tag}${label5}${
|
|
87557
|
+
return `${site.line}:${site.column} ${how}${site.callee}(${site.argumentCount} arg${site.argumentCount === 1 ? "" : "s"})${tag}${label5}${inside2}${staleMark(site.stale)}`;
|
|
87295
87558
|
}, (site) => relativeTo(root, site.path));
|
|
87296
87559
|
}
|
|
87297
87560
|
case "imports": {
|
|
@@ -87346,7 +87609,7 @@ async function owningRoot(roots, target) {
|
|
|
87346
87609
|
for (const candidate of roots) {
|
|
87347
87610
|
let real;
|
|
87348
87611
|
try {
|
|
87349
|
-
real = await
|
|
87612
|
+
real = await realpath12(candidate);
|
|
87350
87613
|
if (!(await stat12(real)).isDirectory()) {
|
|
87351
87614
|
if (isWithin(real, target) || real === target)
|
|
87352
87615
|
sawFile = true;
|
|
@@ -87362,8 +87625,8 @@ async function owningRoot(roots, target) {
|
|
|
87362
87625
|
}
|
|
87363
87626
|
__name(owningRoot, "owningRoot");
|
|
87364
87627
|
function relativeTo(root, path2) {
|
|
87365
|
-
const rel =
|
|
87366
|
-
if (rel === "" || rel === ".." || rel.startsWith(`..${sep11}`) ||
|
|
87628
|
+
const rel = relative8(root, path2);
|
|
87629
|
+
if (rel === "" || rel === ".." || rel.startsWith(`..${sep11}`) || isAbsolute13(rel))
|
|
87367
87630
|
return path2;
|
|
87368
87631
|
return sep11 === "/" ? rel : rel.split(sep11).join("/");
|
|
87369
87632
|
}
|
|
@@ -90332,7 +90595,7 @@ ${wrapUntrusted({
|
|
|
90332
90595
|
__name(createComputerUseTool, "createComputerUseTool");
|
|
90333
90596
|
|
|
90334
90597
|
// ../sdk/dist/tools/builtins/glob.js
|
|
90335
|
-
import { isAbsolute as
|
|
90598
|
+
import { isAbsolute as isAbsolute14, join as join43, relative as relative9, sep as sep12 } from "node:path";
|
|
90336
90599
|
|
|
90337
90600
|
// ../sdk/dist/tools/posix-path.js
|
|
90338
90601
|
function normalizeSegments(path2) {
|
|
@@ -90394,9 +90657,9 @@ function relativePattern(pattern, root, sandboxed) {
|
|
|
90394
90657
|
if (result.split("/").includes("..")) {
|
|
90395
90658
|
throw new Error('Glob pattern escapes the search directory through "..". Choose a contained path and a relative pattern.');
|
|
90396
90659
|
}
|
|
90397
|
-
if (sandboxed ? result.startsWith("/") :
|
|
90660
|
+
if (sandboxed ? result.startsWith("/") : isAbsolute14(pattern)) {
|
|
90398
90661
|
const contained2 = sandboxed ? resolveWithinPosix(root, result) : resolveWithin(root, pattern);
|
|
90399
|
-
result = sandboxed ? relativePosix(root, contained2) :
|
|
90662
|
+
result = sandboxed ? relativePosix(root, contained2) : relative9(root, contained2).split(sep12).join("/");
|
|
90400
90663
|
}
|
|
90401
90664
|
while (result.startsWith("./"))
|
|
90402
90665
|
result = result.slice(2);
|
|
@@ -90468,7 +90731,7 @@ var GlobTool = defineTool({
|
|
|
90468
90731
|
truncated = true;
|
|
90469
90732
|
break;
|
|
90470
90733
|
}
|
|
90471
|
-
const file = sandbox ? relativePosix(sandbox.rootDir, absolute) :
|
|
90734
|
+
const file = sandbox ? relativePosix(sandbox.rootDir, absolute) : relative9(context2.workingDirectory, join43(lexicalRoot, relative9(root, absolute)));
|
|
90472
90735
|
files.push(`./${sandbox ? file : file.split(sep12).join("/")}`);
|
|
90473
90736
|
}
|
|
90474
90737
|
} catch (error) {
|
|
@@ -90496,7 +90759,7 @@ var GlobTool = defineTool({
|
|
|
90496
90759
|
|
|
90497
90760
|
// ../sdk/dist/tools/builtins/grep.js
|
|
90498
90761
|
import { readFile as readFile17, stat as stat13 } from "node:fs/promises";
|
|
90499
|
-
import { isAbsolute as
|
|
90762
|
+
import { isAbsolute as isAbsolute15, join as join44, relative as relative10, sep as sep13 } from "node:path";
|
|
90500
90763
|
async function readWithSignal(read, signal) {
|
|
90501
90764
|
signal?.throwIfAborted();
|
|
90502
90765
|
if (!signal)
|
|
@@ -90522,9 +90785,9 @@ function relativeInclude(include, root, sandboxed) {
|
|
|
90522
90785
|
let pattern = sandboxed ? include : include.split(sep13).join("/");
|
|
90523
90786
|
if (pattern.split("/").includes(".."))
|
|
90524
90787
|
throw new Error("Include pattern escapes the search directory");
|
|
90525
|
-
if (sandboxed ? pattern.startsWith("/") :
|
|
90788
|
+
if (sandboxed ? pattern.startsWith("/") : isAbsolute15(include)) {
|
|
90526
90789
|
const absolute = sandboxed ? resolveWithinPosix(root, pattern) : resolveWithin(root, include);
|
|
90527
|
-
pattern = sandboxed ? relativePosix(root, absolute) :
|
|
90790
|
+
pattern = sandboxed ? relativePosix(root, absolute) : relative10(root, absolute).split(sep13).join("/");
|
|
90528
90791
|
}
|
|
90529
90792
|
while (pattern.startsWith("./"))
|
|
90530
90793
|
pattern = pattern.slice(2);
|
|
@@ -90660,7 +90923,7 @@ var GrepTool = defineTool({
|
|
|
90660
90923
|
}
|
|
90661
90924
|
const lines = content.split("\n");
|
|
90662
90925
|
let fileMatches = 0;
|
|
90663
|
-
const relPath = sandbox ? `./${relativePosix(sandbox.rootDir, filePath)}` : `./${
|
|
90926
|
+
const relPath = sandbox ? `./${relativePosix(sandbox.rootDir, filePath)}` : `./${relative10(context2.workingDirectory, join44(lexicalRoot, relative10(root, filePath))).split(sep13).join("/")}`;
|
|
90664
90927
|
for (let i = 0; i < lines.length; i++) {
|
|
90665
90928
|
context2.abortSignal?.throwIfAborted();
|
|
90666
90929
|
const line = lines[i] ?? "";
|
|
@@ -90943,7 +91206,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
|
|
|
90943
91206
|
omittedOutputBytes
|
|
90944
91207
|
};
|
|
90945
91208
|
});
|
|
90946
|
-
const expiry = new Promise((
|
|
91209
|
+
const expiry = new Promise((resolve28) => {
|
|
90947
91210
|
const tick = setInterval(() => {
|
|
90948
91211
|
if (settled)
|
|
90949
91212
|
return;
|
|
@@ -90951,7 +91214,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
|
|
|
90951
91214
|
const elapsed = now() - startedAt;
|
|
90952
91215
|
if (elapsed >= options.wallMs) {
|
|
90953
91216
|
clearInterval(tick);
|
|
90954
|
-
|
|
91217
|
+
resolve28({
|
|
90955
91218
|
kind: "timeout",
|
|
90956
91219
|
cause: "wall",
|
|
90957
91220
|
elapsedMs: elapsed,
|
|
@@ -90966,7 +91229,7 @@ async function waitForJobWithBounds(jobs, id3, options, now = Date.now) {
|
|
|
90966
91229
|
const quietFor = now() - lastProgressAt;
|
|
90967
91230
|
if (quietFor >= options.idleMs) {
|
|
90968
91231
|
clearInterval(tick);
|
|
90969
|
-
|
|
91232
|
+
resolve28({
|
|
90970
91233
|
kind: "timeout",
|
|
90971
91234
|
cause: "idle",
|
|
90972
91235
|
elapsedMs: elapsed,
|
|
@@ -91197,7 +91460,7 @@ ${observed}
|
|
|
91197
91460
|
|
|
91198
91461
|
// ../sdk/dist/tools/builtins/verify-outputs.js
|
|
91199
91462
|
import { stat as stat14 } from "node:fs/promises";
|
|
91200
|
-
import { resolve as
|
|
91463
|
+
import { resolve as resolve27 } from "node:path";
|
|
91201
91464
|
var inputSchema15 = external_exports.object({
|
|
91202
91465
|
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."),
|
|
91203
91466
|
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).")
|
|
@@ -91253,7 +91516,7 @@ async function verifyOne(input) {
|
|
|
91253
91516
|
};
|
|
91254
91517
|
}
|
|
91255
91518
|
}
|
|
91256
|
-
const filePath =
|
|
91519
|
+
const filePath = resolve27(context2.workingDirectory, path2);
|
|
91257
91520
|
try {
|
|
91258
91521
|
const info = await stat14(filePath);
|
|
91259
91522
|
if (!info.isFile()) {
|
|
@@ -93539,6 +93802,7 @@ export {
|
|
|
93539
93802
|
generateTopicId,
|
|
93540
93803
|
generateTurnId,
|
|
93541
93804
|
generateSessionId,
|
|
93805
|
+
generateTaskId,
|
|
93542
93806
|
generateTenantId,
|
|
93543
93807
|
generateWorkspaceId,
|
|
93544
93808
|
generateSummaryId,
|
|
@@ -93655,6 +93919,7 @@ export {
|
|
|
93655
93919
|
selectTaskContext,
|
|
93656
93920
|
buildTaskTools,
|
|
93657
93921
|
isCompactionMessage,
|
|
93922
|
+
COMPACTION_RECOVERY_NOTE,
|
|
93658
93923
|
PLAN_MODE_REFUSAL,
|
|
93659
93924
|
toToolSourceRef,
|
|
93660
93925
|
ToolManager,
|
|
@@ -93693,6 +93958,7 @@ export {
|
|
|
93693
93958
|
withProviderFallback,
|
|
93694
93959
|
buildProbeContext,
|
|
93695
93960
|
probe,
|
|
93961
|
+
SessionEvidenceOffsetError,
|
|
93696
93962
|
createSessionTextEvidenceSource,
|
|
93697
93963
|
createSessionEvidenceSource,
|
|
93698
93964
|
NamzuHomeError,
|
|
@@ -93865,4 +94131,4 @@ export {
|
|
|
93865
94131
|
buildResidentToolEvidenceTools,
|
|
93866
94132
|
createPalMessagingTools
|
|
93867
94133
|
};
|
|
93868
|
-
//# sourceMappingURL=chunk-
|
|
94134
|
+
//# sourceMappingURL=chunk-RKMGVFLZ.js.map
|