@theokit/sdk 5.15.1 → 5.15.3
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 +12 -0
- package/dist/a2a/index.cjs +3 -3
- package/dist/a2a/index.js +1 -1
- package/dist/agent-LTJYDRWI.cjs +72 -0
- package/dist/{agent-CB27KF6O.cjs.map → agent-LTJYDRWI.cjs.map} +1 -1
- package/dist/agent-MOSFFVPU.js +63 -0
- package/dist/{agent-66U5QCPF.js.map → agent-MOSFFVPU.js.map} +1 -1
- package/dist/agent-session-store-2LQEPS4H.js +6 -0
- package/dist/{agent-session-store-22GKA7O4.js.map → agent-session-store-2LQEPS4H.js.map} +1 -1
- package/dist/agent-session-store-IOH6BREF.cjs +23 -0
- package/dist/{agent-session-store-WP6NGDVX.cjs.map → agent-session-store-IOH6BREF.cjs.map} +1 -1
- package/dist/auth/index.cjs +15 -15
- package/dist/auth/index.js +3 -3
- package/dist/{batch-N2XDYZED.js → batch-7IGV2OKA.js} +8 -8
- package/dist/{batch-N2XDYZED.js.map → batch-7IGV2OKA.js.map} +1 -1
- package/dist/{batch-VFR2MAUE.cjs → batch-FIWQZ3JD.cjs} +14 -14
- package/dist/{batch-VFR2MAUE.cjs.map → batch-FIWQZ3JD.cjs.map} +1 -1
- package/dist/{chunk-AT2PESXB.cjs → chunk-2UYAL4N7.cjs} +5 -5
- package/dist/chunk-2UYAL4N7.cjs.map +1 -0
- package/dist/{chunk-K2BQQ445.js → chunk-3GQYMKVJ.js} +3 -3
- package/dist/{chunk-K2BQQ445.js.map → chunk-3GQYMKVJ.js.map} +1 -1
- package/dist/{chunk-YSTXFWQE.cjs → chunk-3HL43XBD.cjs} +4 -4
- package/dist/{chunk-YSTXFWQE.cjs.map → chunk-3HL43XBD.cjs.map} +1 -1
- package/dist/{chunk-XESYJ4JC.js → chunk-3VX7JHJI.js} +7 -7
- package/dist/{chunk-XESYJ4JC.js.map → chunk-3VX7JHJI.js.map} +1 -1
- package/dist/{chunk-6XQLTQB6.cjs → chunk-3YCNBOX7.cjs} +3 -3
- package/dist/{chunk-6XQLTQB6.cjs.map → chunk-3YCNBOX7.cjs.map} +1 -1
- package/dist/{chunk-3E3VSMB6.cjs → chunk-3ZRJ4RNB.cjs} +100 -61
- package/dist/chunk-3ZRJ4RNB.cjs.map +1 -0
- package/dist/{chunk-CHKV2L2Y.cjs → chunk-46YYJIHL.cjs} +30 -30
- package/dist/chunk-46YYJIHL.cjs.map +1 -0
- package/dist/{chunk-73IITAF7.js → chunk-4C37ELQL.js} +9 -9
- package/dist/{chunk-73IITAF7.js.map → chunk-4C37ELQL.js.map} +1 -1
- package/dist/{chunk-AGO5S5WD.js → chunk-4E4D6H77.js} +3 -3
- package/dist/{chunk-AGO5S5WD.js.map → chunk-4E4D6H77.js.map} +1 -1
- package/dist/{chunk-R35ZJAYT.cjs → chunk-4JF52NED.cjs} +12 -12
- package/dist/{chunk-R35ZJAYT.cjs.map → chunk-4JF52NED.cjs.map} +1 -1
- package/dist/{chunk-VNRNZ3WI.js → chunk-4OMRDNPY.js} +4 -4
- package/dist/{chunk-VNRNZ3WI.js.map → chunk-4OMRDNPY.js.map} +1 -1
- package/dist/{chunk-INVEGVGO.js → chunk-4TA47IK4.js} +8 -8
- package/dist/{chunk-INVEGVGO.js.map → chunk-4TA47IK4.js.map} +1 -1
- package/dist/{chunk-O2RCS3SJ.js → chunk-4TTR63O7.js} +4 -4
- package/dist/{chunk-O2RCS3SJ.js.map → chunk-4TTR63O7.js.map} +1 -1
- package/dist/{chunk-MLGETTYX.js → chunk-4YUIYSZO.js} +6 -6
- package/dist/{chunk-MLGETTYX.js.map → chunk-4YUIYSZO.js.map} +1 -1
- package/dist/{chunk-RZL2W4C3.js → chunk-5L7S2VOL.js} +5 -5
- package/dist/{chunk-RZL2W4C3.js.map → chunk-5L7S2VOL.js.map} +1 -1
- package/dist/{chunk-3WKWBYPO.cjs → chunk-6EHOJLJ3.cjs} +20 -20
- package/dist/chunk-6EHOJLJ3.cjs.map +1 -0
- package/dist/{chunk-XOU3CL7S.cjs → chunk-6HQFPX7N.cjs} +28 -28
- package/dist/chunk-6HQFPX7N.cjs.map +1 -0
- package/dist/{chunk-R427EOZE.cjs → chunk-7EFT6N5C.cjs} +13 -13
- package/dist/{chunk-R427EOZE.cjs.map → chunk-7EFT6N5C.cjs.map} +1 -1
- package/dist/{chunk-L7V4DDIE.cjs → chunk-7VNFOGRD.cjs} +12 -12
- package/dist/chunk-7VNFOGRD.cjs.map +1 -0
- package/dist/{chunk-YKNBTHMD.js → chunk-AQ23NII7.js} +3 -3
- package/dist/{chunk-YKNBTHMD.js.map → chunk-AQ23NII7.js.map} +1 -1
- package/dist/{chunk-H7HD6RXO.cjs → chunk-AW72G4TC.cjs} +5 -5
- package/dist/{chunk-H7HD6RXO.cjs.map → chunk-AW72G4TC.cjs.map} +1 -1
- package/dist/{chunk-M4U24U6G.js → chunk-AZK3QM36.js} +5 -5
- package/dist/{chunk-M4U24U6G.js.map → chunk-AZK3QM36.js.map} +1 -1
- package/dist/{chunk-QK2ERTO3.js → chunk-BH6M2DGV.js} +4 -4
- package/dist/{chunk-QK2ERTO3.js.map → chunk-BH6M2DGV.js.map} +1 -1
- package/dist/{chunk-CBBT42VX.js → chunk-CMDM4VF6.js} +3 -3
- package/dist/{chunk-CBBT42VX.js.map → chunk-CMDM4VF6.js.map} +1 -1
- package/dist/{chunk-OLJOI4LK.js → chunk-CN732Z5C.js} +4 -4
- package/dist/{chunk-OLJOI4LK.js.map → chunk-CN732Z5C.js.map} +1 -1
- package/dist/{chunk-SETHRLQS.cjs → chunk-D3BL3EEB.cjs} +9 -9
- package/dist/chunk-D3BL3EEB.cjs.map +1 -0
- package/dist/{chunk-LCCT5ZXJ.js → chunk-DB5RYCXX.js} +13 -13
- package/dist/{chunk-LCCT5ZXJ.js.map → chunk-DB5RYCXX.js.map} +1 -1
- package/dist/{chunk-SV63WTA2.js → chunk-DBH2WA2U.js} +4 -4
- package/dist/{chunk-SV63WTA2.js.map → chunk-DBH2WA2U.js.map} +1 -1
- package/dist/{chunk-XE3CAY6Z.cjs → chunk-DEHPRORL.cjs} +4 -4
- package/dist/{chunk-XE3CAY6Z.cjs.map → chunk-DEHPRORL.cjs.map} +1 -1
- package/dist/{chunk-UKMBRMGT.js → chunk-DGO4LPLP.js} +4 -4
- package/dist/{chunk-UKMBRMGT.js.map → chunk-DGO4LPLP.js.map} +1 -1
- package/dist/{chunk-RS7YQR4X.cjs → chunk-EBX6XUN7.cjs} +7 -7
- package/dist/{chunk-RS7YQR4X.cjs.map → chunk-EBX6XUN7.cjs.map} +1 -1
- package/dist/chunk-EDIYR4VR.cjs +18 -0
- package/dist/{chunk-SPEN7RJU.cjs.map → chunk-EDIYR4VR.cjs.map} +1 -1
- package/dist/{chunk-QGDPMM3C.js → chunk-EF5IONLL.js} +5 -5
- package/dist/{chunk-QGDPMM3C.js.map → chunk-EF5IONLL.js.map} +1 -1
- package/dist/{chunk-MSW7LB2V.cjs → chunk-EOWIUDKG.cjs} +5 -5
- package/dist/{chunk-MSW7LB2V.cjs.map → chunk-EOWIUDKG.cjs.map} +1 -1
- package/dist/{chunk-L7JPXZ2C.cjs → chunk-ER3BF23R.cjs} +19 -19
- package/dist/{chunk-L7JPXZ2C.cjs.map → chunk-ER3BF23R.cjs.map} +1 -1
- package/dist/{chunk-BNEUB52I.cjs → chunk-ERBKPA2N.cjs} +4 -4
- package/dist/{chunk-BNEUB52I.cjs.map → chunk-ERBKPA2N.cjs.map} +1 -1
- package/dist/{chunk-4QCJAJAG.js → chunk-F54PXZIA.js} +5 -5
- package/dist/{chunk-4QCJAJAG.js.map → chunk-F54PXZIA.js.map} +1 -1
- package/dist/{chunk-2XWAYCFM.cjs → chunk-FBT2SF2S.cjs} +12 -12
- package/dist/{chunk-2XWAYCFM.cjs.map → chunk-FBT2SF2S.cjs.map} +1 -1
- package/dist/{chunk-AUH2EVWY.cjs → chunk-FZSPVIFK.cjs} +16 -16
- package/dist/chunk-FZSPVIFK.cjs.map +1 -0
- package/dist/{chunk-CYWOJA6B.js → chunk-GA27FFT5.js} +3 -3
- package/dist/{chunk-CYWOJA6B.js.map → chunk-GA27FFT5.js.map} +1 -1
- package/dist/{chunk-HWMGR3HA.js → chunk-GEQLHBJM.js} +6 -6
- package/dist/{chunk-HWMGR3HA.js.map → chunk-GEQLHBJM.js.map} +1 -1
- package/dist/{chunk-IJ7M6GOG.cjs → chunk-GKERJ52A.cjs} +4 -4
- package/dist/{chunk-IJ7M6GOG.cjs.map → chunk-GKERJ52A.cjs.map} +1 -1
- package/dist/{chunk-26GI3OYA.js → chunk-HFEAU2L2.js} +55 -16
- package/dist/chunk-HFEAU2L2.js.map +1 -0
- package/dist/{chunk-NEH3BPFD.cjs → chunk-HI5TJWQE.cjs} +19 -19
- package/dist/{chunk-NEH3BPFD.cjs.map → chunk-HI5TJWQE.cjs.map} +1 -1
- package/dist/{chunk-ZOFRNNZD.cjs → chunk-IZV72OEI.cjs} +11 -11
- package/dist/chunk-IZV72OEI.cjs.map +1 -0
- package/dist/{chunk-KU5O7WPK.js → chunk-JD3EKKKB.js} +4 -4
- package/dist/{chunk-KU5O7WPK.js.map → chunk-JD3EKKKB.js.map} +1 -1
- package/dist/{chunk-DFBWYETS.js → chunk-JRP2W2DR.js} +3 -3
- package/dist/{chunk-DFBWYETS.js.map → chunk-JRP2W2DR.js.map} +1 -1
- package/dist/{chunk-YQ3XC6C2.cjs → chunk-JVH3NNJ3.cjs} +13 -13
- package/dist/chunk-JVH3NNJ3.cjs.map +1 -0
- package/dist/{chunk-VWYFGE27.cjs → chunk-KC2HKUPT.cjs} +56 -56
- package/dist/chunk-KC2HKUPT.cjs.map +1 -0
- package/dist/{chunk-PDOXYXWX.cjs → chunk-KDJTECE6.cjs} +4 -4
- package/dist/{chunk-PDOXYXWX.cjs.map → chunk-KDJTECE6.cjs.map} +1 -1
- package/dist/{chunk-QD6B6W6I.js → chunk-L2KC2G7H.js} +5 -5
- package/dist/{chunk-QD6B6W6I.js.map → chunk-L2KC2G7H.js.map} +1 -1
- package/dist/{chunk-3BBTHFGJ.js → chunk-L5B7EWWH.js} +5 -5
- package/dist/{chunk-3BBTHFGJ.js.map → chunk-L5B7EWWH.js.map} +1 -1
- package/dist/{chunk-26UQG242.cjs → chunk-LAZTNGNR.cjs} +264 -264
- package/dist/chunk-LAZTNGNR.cjs.map +1 -0
- package/dist/{chunk-X7CE7Y5W.js → chunk-LG4JCJEI.js} +11 -11
- package/dist/{chunk-X7CE7Y5W.js.map → chunk-LG4JCJEI.js.map} +1 -1
- package/dist/{chunk-2HXTNVLM.js → chunk-LSURFRJA.js} +6 -6
- package/dist/{chunk-2HXTNVLM.js.map → chunk-LSURFRJA.js.map} +1 -1
- package/dist/{chunk-55LLQFHW.cjs → chunk-MJGY3E3C.cjs} +4 -4
- package/dist/{chunk-55LLQFHW.cjs.map → chunk-MJGY3E3C.cjs.map} +1 -1
- package/dist/{chunk-EQ5IDL6W.cjs → chunk-MKS5FFH5.cjs} +15 -15
- package/dist/chunk-MKS5FFH5.cjs.map +1 -0
- package/dist/{chunk-WM646HEN.js → chunk-MTNCJ7MQ.js} +6 -6
- package/dist/{chunk-WM646HEN.js.map → chunk-MTNCJ7MQ.js.map} +1 -1
- package/dist/{chunk-SA6K24NB.cjs → chunk-MXJJMP4U.cjs} +7 -7
- package/dist/chunk-MXJJMP4U.cjs.map +1 -0
- package/dist/{chunk-FTXY4D44.cjs → chunk-N2ORTDSO.cjs} +20 -20
- package/dist/chunk-N2ORTDSO.cjs.map +1 -0
- package/dist/{chunk-7YUPSBDV.cjs → chunk-NDXZXGVP.cjs} +6 -6
- package/dist/{chunk-7YUPSBDV.cjs.map → chunk-NDXZXGVP.cjs.map} +1 -1
- package/dist/{chunk-3UMPP553.cjs → chunk-NMRNE6QX.cjs} +11 -11
- package/dist/{chunk-3UMPP553.cjs.map → chunk-NMRNE6QX.cjs.map} +1 -1
- package/dist/{chunk-PKRPV3R7.js → chunk-NO6AG22P.js} +6 -6
- package/dist/{chunk-PKRPV3R7.js.map → chunk-NO6AG22P.js.map} +1 -1
- package/dist/{chunk-NK5EOTDY.js → chunk-OIOSY5G6.js} +3 -3
- package/dist/{chunk-NK5EOTDY.js.map → chunk-OIOSY5G6.js.map} +1 -1
- package/dist/{chunk-RGVMJU57.js → chunk-P7B64NFK.js} +8 -8
- package/dist/{chunk-RGVMJU57.js.map → chunk-P7B64NFK.js.map} +1 -1
- package/dist/{chunk-TDED5XES.js → chunk-PCPYTBVV.js} +6 -6
- package/dist/chunk-PCPYTBVV.js.map +1 -0
- package/dist/{chunk-YMVTUV5K.js → chunk-PISZRLES.js} +5 -5
- package/dist/{chunk-YMVTUV5K.js.map → chunk-PISZRLES.js.map} +1 -1
- package/dist/{chunk-BUUUWQMB.cjs → chunk-PNL63WDP.cjs} +4 -4
- package/dist/{chunk-BUUUWQMB.cjs.map → chunk-PNL63WDP.cjs.map} +1 -1
- package/dist/{chunk-5645PMVU.cjs → chunk-PXYINWBC.cjs} +20 -20
- package/dist/chunk-PXYINWBC.cjs.map +1 -0
- package/dist/{chunk-RTDVSHJR.cjs → chunk-Q4UOCMAO.cjs} +5 -5
- package/dist/{chunk-RTDVSHJR.cjs.map → chunk-Q4UOCMAO.cjs.map} +1 -1
- package/dist/{chunk-5IRDK5BC.js → chunk-QH6MWGOA.js} +4 -4
- package/dist/{chunk-5IRDK5BC.js.map → chunk-QH6MWGOA.js.map} +1 -1
- package/dist/{chunk-FBIDOOJM.cjs → chunk-QJVTDW3G.cjs} +6 -6
- package/dist/{chunk-FBIDOOJM.cjs.map → chunk-QJVTDW3G.cjs.map} +1 -1
- package/dist/{chunk-3LMVJTNJ.js → chunk-QPUKIZOT.js} +3 -3
- package/dist/{chunk-3LMVJTNJ.js.map → chunk-QPUKIZOT.js.map} +1 -1
- package/dist/{chunk-TRPRTZEH.cjs → chunk-RB3ZMMUU.cjs} +6 -6
- package/dist/{chunk-TRPRTZEH.cjs.map → chunk-RB3ZMMUU.cjs.map} +1 -1
- package/dist/{chunk-SWALPLFQ.cjs → chunk-RTCO3USA.cjs} +16 -16
- package/dist/chunk-RTCO3USA.cjs.map +1 -0
- package/dist/{chunk-SAGRF4IB.js → chunk-S2CMEJ5F.js} +3 -3
- package/dist/{chunk-SAGRF4IB.js.map → chunk-S2CMEJ5F.js.map} +1 -1
- package/dist/{chunk-VZGE7NAI.js → chunk-S5ERB3CH.js} +3 -3
- package/dist/{chunk-VZGE7NAI.js.map → chunk-S5ERB3CH.js.map} +1 -1
- package/dist/{chunk-XJ3WU5CZ.js → chunk-S7IZEVXX.js} +6 -6
- package/dist/{chunk-XJ3WU5CZ.js.map → chunk-S7IZEVXX.js.map} +1 -1
- package/dist/{chunk-Q7UG242V.js → chunk-TIYQDJFK.js} +3 -3
- package/dist/{chunk-Q7UG242V.js.map → chunk-TIYQDJFK.js.map} +1 -1
- package/dist/{chunk-POBZXULR.cjs → chunk-TTNJOM5W.cjs} +16 -16
- package/dist/{chunk-POBZXULR.cjs.map → chunk-TTNJOM5W.cjs.map} +1 -1
- package/dist/{chunk-VCQ37TC5.js → chunk-TTXRNCXY.js} +3 -3
- package/dist/{chunk-VCQ37TC5.js.map → chunk-TTXRNCXY.js.map} +1 -1
- package/dist/{chunk-3HA7N2BB.cjs → chunk-TYKBAKAS.cjs} +5 -5
- package/dist/{chunk-3HA7N2BB.cjs.map → chunk-TYKBAKAS.cjs.map} +1 -1
- package/dist/{chunk-A77UMVMD.cjs → chunk-UMCCYXFZ.cjs} +8 -8
- package/dist/{chunk-A77UMVMD.cjs.map → chunk-UMCCYXFZ.cjs.map} +1 -1
- package/dist/{chunk-3GTN4HOO.js → chunk-UNP4NCMZ.js} +3 -3
- package/dist/{chunk-3GTN4HOO.js.map → chunk-UNP4NCMZ.js.map} +1 -1
- package/dist/{chunk-BPL5CVZ5.js → chunk-VFT63FJF.js} +3 -3
- package/dist/{chunk-BPL5CVZ5.js.map → chunk-VFT63FJF.js.map} +1 -1
- package/dist/{chunk-3KIUY67P.cjs → chunk-VHY6NVCJ.cjs} +30 -30
- package/dist/chunk-VHY6NVCJ.cjs.map +1 -0
- package/dist/{chunk-ZQWRUJHE.js → chunk-WAKGYSQ6.js} +50 -50
- package/dist/{chunk-ZQWRUJHE.js.map → chunk-WAKGYSQ6.js.map} +1 -1
- package/dist/{chunk-FJWQP6EE.js → chunk-WJ6OGKAO.js} +3 -3
- package/dist/{chunk-FJWQP6EE.js.map → chunk-WJ6OGKAO.js.map} +1 -1
- package/dist/{chunk-FLDHYF5C.cjs → chunk-X2XLSE2N.cjs} +9 -9
- package/dist/chunk-X2XLSE2N.cjs.map +1 -0
- package/dist/{chunk-UDAKAE4Z.cjs → chunk-X4ZYEZPD.cjs} +12 -12
- package/dist/chunk-X4ZYEZPD.cjs.map +1 -0
- package/dist/{chunk-QG4SXZ2A.cjs → chunk-XR6O6G3B.cjs} +27 -27
- package/dist/chunk-XR6O6G3B.cjs.map +1 -0
- package/dist/{chunk-BWYC7RZG.cjs → chunk-XTQWTVVI.cjs} +11 -11
- package/dist/chunk-XTQWTVVI.cjs.map +1 -0
- package/dist/{chunk-MLJDW2YK.js → chunk-YSGS57DA.js} +4 -4
- package/dist/{chunk-MLJDW2YK.js.map → chunk-YSGS57DA.js.map} +1 -1
- package/dist/{chunk-KCM3RMKR.js → chunk-YUQNHLKN.js} +8 -8
- package/dist/{chunk-KCM3RMKR.js.map → chunk-YUQNHLKN.js.map} +1 -1
- package/dist/{chunk-P7QYG4RZ.cjs → chunk-Z5MB2HAN.cjs} +8 -8
- package/dist/{chunk-P7QYG4RZ.cjs.map → chunk-Z5MB2HAN.cjs.map} +1 -1
- package/dist/{chunk-HJ2LV464.js → chunk-ZUWVO442.js} +4 -4
- package/dist/{chunk-HJ2LV464.js.map → chunk-ZUWVO442.js.map} +1 -1
- package/dist/{compact-session-CHBJOYWP.cjs → compact-session-PIDZQ7AR.cjs} +21 -21
- package/dist/{compact-session-CHBJOYWP.cjs.map → compact-session-PIDZQ7AR.cjs.map} +1 -1
- package/dist/{compact-session-F3J3FMEU.js → compact-session-ZPEJSTLA.js} +12 -12
- package/dist/{compact-session-F3J3FMEU.js.map → compact-session-ZPEJSTLA.js.map} +1 -1
- package/dist/context/index.cjs +11 -11
- package/dist/context/index.js +6 -6
- package/dist/context-4XSD2V3G.js +7 -0
- package/dist/{context-7EBZST3L.js.map → context-4XSD2V3G.js.map} +1 -1
- package/dist/context-ZX2VBGSX.cjs +24 -0
- package/dist/{context-4RSI3AXT.cjs.map → context-ZX2VBGSX.cjs.map} +1 -1
- package/dist/cron.cjs +40 -40
- package/dist/cron.js +39 -39
- package/dist/eval.cjs +51 -51
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +41 -41
- package/dist/{executor-THUXNAFR.js → executor-ZHIUSHRV.js} +7 -7
- package/dist/{executor-THUXNAFR.js.map → executor-ZHIUSHRV.js.map} +1 -1
- package/dist/{executor-5QL5AXIZ.cjs → executor-ZTLJZ5LK.cjs} +24 -24
- package/dist/{executor-5QL5AXIZ.cjs.map → executor-ZTLJZ5LK.cjs.map} +1 -1
- package/dist/filesystem/index.cjs +14 -14
- package/dist/filesystem/index.cjs.map +1 -1
- package/dist/filesystem/index.js +4 -4
- package/dist/{fork-agent-S2EPIML7.js → fork-agent-BHVTALT5.js} +3 -3
- package/dist/{fork-agent-S2EPIML7.js.map → fork-agent-BHVTALT5.js.map} +1 -1
- package/dist/{fork-agent-WAEQI2DL.cjs → fork-agent-DCOPPXM2.cjs} +4 -4
- package/dist/{fork-agent-WAEQI2DL.cjs.map → fork-agent-DCOPPXM2.cjs.map} +1 -1
- package/dist/fs-session-store-EZ32TFGB.js +11 -0
- package/dist/{fs-session-store-MYQEVUFL.js.map → fs-session-store-EZ32TFGB.js.map} +1 -1
- package/dist/fs-session-store-G664LDDN.cjs +20 -0
- package/dist/{fs-session-store-CYNTEPJZ.cjs.map → fs-session-store-G664LDDN.cjs.map} +1 -1
- package/dist/generate-object-JFZTK567.cjs +20 -0
- package/dist/{generate-object-A5F576IT.cjs.map → generate-object-JFZTK567.cjs.map} +1 -1
- package/dist/{generate-object-TBDOBBYW.js → generate-object-RPBXY2U3.js} +4 -4
- package/dist/{generate-object-TBDOBBYW.js.map → generate-object-RPBXY2U3.js.map} +1 -1
- package/dist/index-manager-2MJEEN2O.js +18 -0
- package/dist/{index-manager-NF2WRLOU.js.map → index-manager-2MJEEN2O.js.map} +1 -1
- package/dist/index-manager-CT6MMG7S.cjs +27 -0
- package/dist/{index-manager-2KH75BRW.cjs.map → index-manager-CT6MMG7S.cjs.map} +1 -1
- package/dist/index.cjs +130 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +56 -56
- package/dist/{inject-session-LC2TROHM.js → inject-session-OMBJKMVD.js} +6 -6
- package/dist/{inject-session-LC2TROHM.js.map → inject-session-OMBJKMVD.js.map} +1 -1
- package/dist/{inject-session-T4RXANG3.cjs → inject-session-Z2HIB6P6.cjs} +8 -8
- package/dist/{inject-session-T4RXANG3.cjs.map → inject-session-Z2HIB6P6.cjs.map} +1 -1
- package/dist/internal/llm/openai.d.ts +2 -0
- package/dist/internal/llm/responses.d.ts +2 -0
- package/dist/internal/llm/sse.d.ts +6 -0
- package/dist/internal/memory/adapters/index.cjs +4 -4
- package/dist/internal/memory/adapters/index.js +3 -3
- package/dist/internal/memory/storage/index.cjs +45 -45
- package/dist/internal/memory/storage/index.js +9 -9
- package/dist/internal/persistence/index.cjs +22 -22
- package/dist/internal/persistence/index.js +6 -6
- package/dist/internal/security/index.cjs +9 -9
- package/dist/internal/security/index.js +2 -2
- package/dist/mcp-auth.cjs +8 -8
- package/dist/mcp-auth.js +3 -3
- package/dist/models.cjs +30 -30
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +8 -8
- package/dist/{oauth-transaction-store-U34YLEGP.js → oauth-transaction-store-QQBWGNE2.js} +3 -3
- package/dist/{oauth-transaction-store-U34YLEGP.js.map → oauth-transaction-store-QQBWGNE2.js.map} +1 -1
- package/dist/{oauth-transaction-store-OMX436YB.cjs → oauth-transaction-store-YF7WOA6B.cjs} +10 -10
- package/dist/{oauth-transaction-store-OMX436YB.cjs.map → oauth-transaction-store-YF7WOA6B.cjs.map} +1 -1
- package/dist/path-safety.cjs +9 -9
- package/dist/path-safety.js +2 -2
- package/dist/persistence.cjs +41 -41
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +11 -11
- package/dist/project.cjs +7 -7
- package/dist/project.cjs.map +1 -1
- package/dist/project.js +4 -4
- package/dist/providers.cjs +6 -6
- package/dist/providers.js +4 -4
- package/dist/{registry-5TDAF7RK.js → registry-DOYBR237.js} +6 -6
- package/dist/{registry-5TDAF7RK.js.map → registry-DOYBR237.js.map} +1 -1
- package/dist/{registry-W7TSCLQO.cjs → registry-PB7JFVUJ.cjs} +14 -14
- package/dist/{registry-W7TSCLQO.cjs.map → registry-PB7JFVUJ.cjs.map} +1 -1
- package/dist/sandbox/index.cjs +41 -41
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.js +7 -7
- package/dist/sanitize/index.cjs +2 -2
- package/dist/sanitize/index.js +1 -1
- package/dist/server/auth/index.cjs +9 -9
- package/dist/server/auth/index.cjs.map +1 -1
- package/dist/server/auth/index.js +4 -4
- package/dist/{session-transcript-7TZ6HXSX.cjs → session-transcript-EBVGLZ6B.cjs} +17 -17
- package/dist/{session-transcript-7TZ6HXSX.cjs.map → session-transcript-EBVGLZ6B.cjs.map} +1 -1
- package/dist/{session-transcript-BSHZYYY6.js → session-transcript-GU2VE7JX.js} +4 -4
- package/dist/{session-transcript-BSHZYYY6.js.map → session-transcript-GU2VE7JX.js.map} +1 -1
- package/dist/skills.cjs +7 -7
- package/dist/skills.js +4 -4
- package/dist/stream-object-3AU7QDHT.js +7 -0
- package/dist/{stream-object-EKM4WGTI.js.map → stream-object-3AU7QDHT.js.map} +1 -1
- package/dist/stream-object-SLGR2KIA.cjs +20 -0
- package/dist/{stream-object-AS4YYM4B.cjs.map → stream-object-SLGR2KIA.cjs.map} +1 -1
- package/dist/subagents-loader-4PQS7ULK.cjs +16 -0
- package/dist/{subagents-loader-KLWF4QPD.cjs.map → subagents-loader-4PQS7ULK.cjs.map} +1 -1
- package/dist/subagents-loader-CPFVLWLH.js +7 -0
- package/dist/{subagents-loader-SXETS2F2.js.map → subagents-loader-CPFVLWLH.js.map} +1 -1
- package/dist/subagents-loader.cjs +4 -4
- package/dist/subagents-loader.js +3 -3
- package/dist/subagents.cjs +2 -2
- package/dist/subagents.js +1 -1
- package/dist/task-store.cjs +5 -5
- package/dist/task-store.js +2 -2
- package/dist/workflow.cjs +28 -28
- package/dist/workflow.js +5 -5
- package/docs/error-codes.md +5 -4
- package/package.json +1 -1
- package/dist/agent-66U5QCPF.js +0 -63
- package/dist/agent-CB27KF6O.cjs +0 -72
- package/dist/agent-session-store-22GKA7O4.js +0 -6
- package/dist/agent-session-store-WP6NGDVX.cjs +0 -23
- package/dist/chunk-26GI3OYA.js.map +0 -1
- package/dist/chunk-26UQG242.cjs.map +0 -1
- package/dist/chunk-3E3VSMB6.cjs.map +0 -1
- package/dist/chunk-3KIUY67P.cjs.map +0 -1
- package/dist/chunk-3WKWBYPO.cjs.map +0 -1
- package/dist/chunk-5645PMVU.cjs.map +0 -1
- package/dist/chunk-AT2PESXB.cjs.map +0 -1
- package/dist/chunk-AUH2EVWY.cjs.map +0 -1
- package/dist/chunk-BWYC7RZG.cjs.map +0 -1
- package/dist/chunk-CHKV2L2Y.cjs.map +0 -1
- package/dist/chunk-EQ5IDL6W.cjs.map +0 -1
- package/dist/chunk-FLDHYF5C.cjs.map +0 -1
- package/dist/chunk-FTXY4D44.cjs.map +0 -1
- package/dist/chunk-L7V4DDIE.cjs.map +0 -1
- package/dist/chunk-QG4SXZ2A.cjs.map +0 -1
- package/dist/chunk-SA6K24NB.cjs.map +0 -1
- package/dist/chunk-SETHRLQS.cjs.map +0 -1
- package/dist/chunk-SPEN7RJU.cjs +0 -18
- package/dist/chunk-SWALPLFQ.cjs.map +0 -1
- package/dist/chunk-TDED5XES.js.map +0 -1
- package/dist/chunk-UDAKAE4Z.cjs.map +0 -1
- package/dist/chunk-VWYFGE27.cjs.map +0 -1
- package/dist/chunk-XOU3CL7S.cjs.map +0 -1
- package/dist/chunk-YQ3XC6C2.cjs.map +0 -1
- package/dist/chunk-ZOFRNNZD.cjs.map +0 -1
- package/dist/context-4RSI3AXT.cjs +0 -24
- package/dist/context-7EBZST3L.js +0 -7
- package/dist/fs-session-store-CYNTEPJZ.cjs +0 -20
- package/dist/fs-session-store-MYQEVUFL.js +0 -11
- package/dist/generate-object-A5F576IT.cjs +0 -20
- package/dist/index-manager-2KH75BRW.cjs +0 -27
- package/dist/index-manager-NF2WRLOU.js +0 -18
- package/dist/stream-object-AS4YYM4B.cjs +0 -20
- package/dist/stream-object-EKM4WGTI.js +0 -7
- package/dist/subagents-loader-KLWF4QPD.cjs +0 -16
- package/dist/subagents-loader-SXETS2F2.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/persistence/sqlite-session-store.ts"],"names":[],"mappings":";;;AA2BO,IAAM,qBAAN,MAAiD;AAAA,EACrC,QAAA;AAAA,EACT,SAAA;AAAA,EAER,YAAY,OAAA,EAAoC;AAC9C,IAAA,IAAA,CAAK,WAAW,OAAA,CAAQ,QAAA;AAAA,EAC1B;AAAA,EAEQ,EAAA,GAAkB;AACxB,IAAA,IAAA,CAAK,cAAc,mBAAA,CAAwB;AAAA,MACzC,UAAU,IAAA,CAAK,QAAA;AAAA,MACf,KAAA,EAAO,eAAA;AAAA,MACP,cAAA,EAAgB,KAAA;AAAA,MAChB,MAAA,EAAQ,CAAC,EAAA,KAAO;AACd,QAAA,EAAA,CAAG,IAAA;AAAA,UACD;AAAA,SAEF;AAAA,MACF;AAAA,KACD,CAAA;AACD,IAAA,IAAA,CAAK,SAAA,CAAU,MAAM,MAAM;AACzB,MAAA,IAAA,CAAK,SAAA,GAAY,MAAA;AAAA,IACnB,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AAO,GAAA,CAAI,SAAS,IAAA,CAAK,SAAA,CAAU,GAAG,CAAC,CAAA;AAClE,MAAA,EAAA,CAAG,KAAK,QAAQ,CAAA;AAAA,IAClB,SAAS,GAAA,EAAK;AACZ,MAAA,EAAA,CAAG,KAAK,UAAU,CAAA;AAClB,MAAA,MAAM,GAAA;AAAA,IACR;AAAA,EACF;AAAA,EAEA,MAAM,OAAA,GAAyB;AAC7B,IAAA,MAAM,IAAI,IAAA,CAAK,SAAA;AACf,IAAA,IAAA,CAAK,SAAA,GAAY,MAAA;AACjB,IAAA,IAAI,CAAA,EAAG,CAAC,MAAM,CAAA,EAAG,KAAA,EAAM;AAAA,EACzB;AACF","file":"chunk-VFT63FJF.js","sourcesContent":["import type { SessionRecord, SessionStore } from \"../../types/session-store.js\";\nimport { openSqliteResilient, type ResilientSqliteDb } from \"./sqlite-open.js\";\n\n/** Options for {@link SqliteSessionStore}. */\nexport interface SqliteSessionStoreOptions {\n /** Absolute path of the SQLite file. Parent directories are created. */\n filePath: string;\n}\n\ninterface Stmt {\n run(...args: unknown[]): unknown;\n all(...args: unknown[]): unknown[];\n}\ninterface Db extends ResilientSqliteDb {\n prepare(sql: string): Stmt;\n}\n\n/**\n * A {@link SessionStore} that keeps the native session records in one SQLite file instead of\n * per-agent JSONL transcripts. Pass it as `local.sessionStore`.\n *\n * Uses `better-sqlite3` when installed, else the built-in `node:sqlite` (Node 22.5+).\n * Appends are one transaction, so a batch lands whole or not at all; order is the\n * autoincrement `seq`. Corruption is NOT silently rebuilt: opening a corrupt file throws.\n *\n * @public\n */\nexport class SqliteSessionStore implements SessionStore {\n private readonly filePath: string;\n private dbPromise: Promise<Db> | undefined;\n\n constructor(options: SqliteSessionStoreOptions) {\n this.filePath = options.filePath;\n }\n\n private db(): Promise<Db> {\n this.dbPromise ??= openSqliteResilient<Db>({\n filePath: this.filePath,\n label: \"session-store\",\n recoverCorrupt: false,\n onOpen: (db) => {\n db.exec(\n \"CREATE TABLE IF NOT EXISTS session_records (seq INTEGER PRIMARY KEY AUTOINCREMENT, agent_id TEXT NOT NULL, record TEXT NOT NULL);\" +\n \"CREATE INDEX IF NOT EXISTS session_records_agent ON session_records (agent_id, seq);\",\n );\n },\n });\n this.dbPromise.catch(() => {\n this.dbPromise = undefined; // allow retry after a failed open\n });\n return this.dbPromise;\n }\n\n async readRecords(agentId: string): Promise<SessionRecord[]> {\n const db = await this.db();\n const rows = db\n .prepare(\"SELECT record FROM session_records WHERE agent_id = ? ORDER BY seq\")\n .all(agentId) as { record: string }[];\n return rows.map((r) => JSON.parse(r.record) as SessionRecord);\n }\n\n async appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void> {\n if (records.length === 0) return;\n const db = await this.db();\n const insert = db.prepare(\"INSERT INTO session_records (agent_id, record) VALUES (?, ?)\");\n db.exec(\"BEGIN IMMEDIATE\");\n try {\n for (const rec of records) insert.run(agentId, JSON.stringify(rec));\n db.exec(\"COMMIT\");\n } catch (err) {\n db.exec(\"ROLLBACK\");\n throw err;\n }\n }\n\n async dispose(): Promise<void> {\n const p = this.dbPromise;\n this.dbPromise = undefined;\n if (p) (await p).close();\n }\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMXJJMP4U_cjs = require('./chunk-MXJJMP4U.cjs');
|
|
4
4
|
var chunkCEGU5AVD_cjs = require('./chunk-CEGU5AVD.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var node_crypto = require('node:crypto');
|
|
6
|
+
var node_fs = require('node:fs');
|
|
7
|
+
var node_path = require('node:path');
|
|
8
8
|
|
|
9
9
|
var PathTraversalError = class extends chunkCEGU5AVD_cjs.ConfigurationError {
|
|
10
10
|
name = "PathTraversalError";
|
|
@@ -26,7 +26,7 @@ var ForbiddenPathError = class extends chunkCEGU5AVD_cjs.ConfigurationError {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
function isInside(target, base) {
|
|
29
|
-
return
|
|
29
|
+
return chunkMXJJMP4U_cjs.atOrInsideRoot(target, base);
|
|
30
30
|
}
|
|
31
31
|
function safePathJoin(base, ...parts) {
|
|
32
32
|
if (base === "") {
|
|
@@ -36,8 +36,8 @@ function safePathJoin(base, ...parts) {
|
|
|
36
36
|
for (const part of parts) {
|
|
37
37
|
rejectNulAndControlChars(part, "path segment");
|
|
38
38
|
}
|
|
39
|
-
const baseResolved =
|
|
40
|
-
const target =
|
|
39
|
+
const baseResolved = node_path.resolve(base);
|
|
40
|
+
const target = node_path.resolve(base, ...parts);
|
|
41
41
|
if (!isInside(target, baseResolved)) {
|
|
42
42
|
throw new PathTraversalError(parts.join("/"), target);
|
|
43
43
|
}
|
|
@@ -56,45 +56,45 @@ function rejectNulAndControlChars(input, role) {
|
|
|
56
56
|
const label = firstControlCharLabel(input);
|
|
57
57
|
if (label !== void 0) throw new PathTraversalError(`${role}: ${input}`, label);
|
|
58
58
|
}
|
|
59
|
-
function assertNoSymlinkEscape(path
|
|
60
|
-
rejectNulAndControlChars(path
|
|
59
|
+
function assertNoSymlinkEscape(path, base) {
|
|
60
|
+
rejectNulAndControlChars(path, "path");
|
|
61
61
|
rejectNulAndControlChars(base, "base");
|
|
62
62
|
let baseResolved;
|
|
63
63
|
try {
|
|
64
|
-
baseResolved =
|
|
64
|
+
baseResolved = node_fs.realpathSync(base);
|
|
65
65
|
} catch {
|
|
66
|
-
baseResolved =
|
|
66
|
+
baseResolved = node_path.resolve(base);
|
|
67
67
|
}
|
|
68
|
-
const resolved = realpathOfDeepestExisting(path
|
|
68
|
+
const resolved = realpathOfDeepestExisting(path);
|
|
69
69
|
if (resolved === void 0) return;
|
|
70
70
|
if (!isInside(resolved, baseResolved)) {
|
|
71
|
-
throw new PathTraversalError(`symlink ${path
|
|
71
|
+
throw new PathTraversalError(`symlink ${path}`, resolved);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function realpathOfDeepestExisting(path
|
|
74
|
+
function realpathOfDeepestExisting(path) {
|
|
75
75
|
try {
|
|
76
|
-
return
|
|
76
|
+
return node_fs.realpathSync(path);
|
|
77
77
|
} catch {
|
|
78
78
|
}
|
|
79
79
|
try {
|
|
80
|
-
const stat =
|
|
80
|
+
const stat = node_fs.lstatSync(path);
|
|
81
81
|
if (stat.isSymbolicLink()) {
|
|
82
|
-
const target =
|
|
83
|
-
const parentReal = realpathOfDeepestExisting(
|
|
84
|
-
const parentBase = parentReal ??
|
|
85
|
-
return
|
|
82
|
+
const target = node_fs.readlinkSync(path);
|
|
83
|
+
const parentReal = realpathOfDeepestExisting(node_path.dirname(path));
|
|
84
|
+
const parentBase = parentReal ?? node_path.dirname(path);
|
|
85
|
+
return node_path.resolve(parentBase, target);
|
|
86
86
|
}
|
|
87
87
|
} catch {
|
|
88
88
|
}
|
|
89
|
-
let cursor =
|
|
90
|
-
let suffix = path
|
|
91
|
-
while (cursor !==
|
|
89
|
+
let cursor = node_path.dirname(path);
|
|
90
|
+
let suffix = path.slice(cursor.length);
|
|
91
|
+
while (cursor !== node_path.dirname(cursor)) {
|
|
92
92
|
try {
|
|
93
|
-
const real =
|
|
94
|
-
return
|
|
93
|
+
const real = node_fs.realpathSync(cursor);
|
|
94
|
+
return node_path.resolve(real, `.${suffix}`);
|
|
95
95
|
} catch {
|
|
96
|
-
suffix = path
|
|
97
|
-
cursor =
|
|
96
|
+
suffix = path.slice(node_path.dirname(cursor).length);
|
|
97
|
+
cursor = node_path.dirname(cursor);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
return void 0;
|
|
@@ -216,7 +216,7 @@ function safeFilenameForId(id, options) {
|
|
|
216
216
|
if (lower.length <= maxLen && IDENTIFIER_PATTERN.test(lower)) {
|
|
217
217
|
return lower;
|
|
218
218
|
}
|
|
219
|
-
return `h-${
|
|
219
|
+
return `h-${node_crypto.createHash("sha256").update(id).digest("hex").slice(0, 16)}`;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
exports.ForbiddenPathError = ForbiddenPathError;
|
|
@@ -227,5 +227,5 @@ exports.safeFilenameForId = safeFilenameForId;
|
|
|
227
227
|
exports.safePathJoin = safePathJoin;
|
|
228
228
|
exports.sanitizeIdentifier = sanitizeIdentifier;
|
|
229
229
|
exports.validateArtifactPath = validateArtifactPath;
|
|
230
|
-
//# sourceMappingURL=chunk-
|
|
231
|
-
//# sourceMappingURL=chunk-
|
|
230
|
+
//# sourceMappingURL=chunk-VHY6NVCJ.cjs.map
|
|
231
|
+
//# sourceMappingURL=chunk-VHY6NVCJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/security/path-guard.ts"],"names":["ConfigurationError","atOrInsideRoot","resolve","realpathSync","lstatSync","readlinkSync","dirname","createHash"],"mappings":";;;;;;;;AAgCO,IAAM,kBAAA,GAAN,cAAiCA,oCAAA,CAAmB;AAAA,EACvC,IAAA,GAAe,oBAAA;AAAA,EAEjC,WAAA,CAAY,OAAe,YAAA,EAAsB;AAC/C,IAAA,KAAA,CAAM,CAAA,wBAAA,EAA2B,KAAK,CAAA,QAAA,EAAM,YAAY,CAAA,CAAA,EAAI;AAAA,MAC1D,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AACF;AAYO,IAAM,kBAAA,GAAN,cAAiCA,oCAAA,CAAmB;AAAA,EACvC,IAAA,GAAe,oBAAA;AAAA,EAEjC,YAAY,IAAA,EAAc;AACxB,IAAA,KAAA;AAAA,MACE,SAAS,IAAI,CAAA,qFAAA,CAAA;AAAA,MACb;AAAA,QACE,IAAA,EAAM;AAAA;AACR,KACF;AAAA,EACF;AACF;AAeA,SAAS,QAAA,CAAS,QAAgB,IAAA,EAAuB;AASvD,EAAA,OAAOC,gCAAA,CAAe,QAAQ,IAAI,CAAA;AACpC;AAUO,SAAS,YAAA,CAAa,SAAiB,KAAA,EAAyB;AACrE,EAAA,IAAI,SAAS,EAAA,EAAI;AACf,IAAA,MAAM,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,KACP,CAAA;AAAA,EACH;AACA,EAAA,MAAM,MAAA,GAAS,SAAS,MAAA,IAAU,GAAA;AAClC,EAAA,MAAM,KAAA,GAAQ,GAAG,WAAA,EAAY;AAC7B,EAAA,IAAI,MAAM,MAAA,IAAU,MAAA,IAAU,kBAAA,CAAmB,IAAA,CAAK,KAAK,CAAA,EAAG;AAC5D,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,OAAO,CAAA,EAAA,EAAKO,sBAAA,CAAW,QAAQ,CAAA,CAAE,MAAA,CAAO,EAAE,CAAA,CAAE,MAAA,CAAO,KAAK,CAAA,CAAE,KAAA,CAAM,CAAA,EAAG,EAAE,CAAC,CAAA,CAAA;AACxE","file":"chunk-VHY6NVCJ.cjs","sourcesContent":["/**\n * Canonical path-guard module (ADRs D79-D81).\n *\n * Three primitives + one typed error:\n * - `safePathJoin(base, ...parts)` — resolve THEN prefix-check (ADR D80).\n * - `assertNoSymlinkEscape(path, base)` — `realpathSync` resolves entire\n * symlink chain (EC-1 fix; Hermes v0.2 #386, #61).\n * - `sanitizeIdentifier(input, { maxLen })` — strict grammar\n * `^[a-z0-9][a-z0-9-_]*$` (ADR D81; case-insensitive on input,\n * lowercase on output).\n * - `PathTraversalError` — extends ConfigurationError with code\n * `path_traversal` (ADR D65: no new hierarchy).\n *\n * Wire at all sites where user input becomes a path. CI lint gate\n * `tests/lint/no-unguarded-path-input.test.ts` prevents regression\n * (ADR D85).\n *\n * @internal\n */\n\nimport { createHash } from \"node:crypto\";\nimport { lstatSync, readlinkSync, realpathSync, type Stats } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\n\nimport { ConfigurationError } from \"../../errors.js\";\nimport { atOrInsideRoot } from \"./path-containment.js\";\n\n/**\n * Thrown when a path operation would escape its allowed base directory.\n * Extends `ConfigurationError` (no new error hierarchy per ADR D65).\n *\n */\nexport class PathTraversalError extends ConfigurationError {\n override readonly name: string = \"PathTraversalError\";\n\n constructor(input: string, resolvedPath: string) {\n super(`Path traversal attempt: ${input} → ${resolvedPath}`, {\n code: \"path_traversal\",\n });\n }\n}\n\n/**\n * Thrown when an agent tool is asked to read or write a sensitive path\n * that the blocklist forbids (`.env`, `.git/`, `node_modules/`, `.theo/`,\n * lock files). Distinct from `PathTraversalError` because the path is\n * lexically inside the project — it is just sensitive.\n *\n * Extends `ConfigurationError` (no new error hierarchy per ADR D65).\n *\n * @public\n */\nexport class ForbiddenPathError extends ConfigurationError {\n override readonly name: string = \"ForbiddenPathError\";\n\n constructor(path: string) {\n super(\n `Path '${path}' is in the sensitive-file blocklist (.env, .git/, node_modules/, .theo/, lock files)`,\n {\n code: \"forbidden_path\",\n },\n );\n }\n}\n\n/**\n * Is `target` the same as `base`, or strictly under it?\n *\n * The prefix must not double the separator. `resolve` strips a trailing `sep` from every base\n * EXCEPT the filesystem root, where `resolve(sep) === sep`; there `base + sep` would be `//`, which\n * no absolute path starts with, so a root base rejected EVERY path (#149). Only the root takes that\n * branch — for any other base the prefix is unchanged, so containment is not weakened.\n *\n * Both containment checks in this module go through here: they had the same defect and were fixed\n * one at a time, which is exactly how the two drifted apart in the first place.\n *\n * Both arguments MUST already be resolved absolute paths.\n */\nfunction isInside(target: string, base: string): boolean {\n // B-117 — compared after symlink resolution, via the shared rule. A prefix test judges a link by\n // its NAME: `<base>/link/x` where `link` points outside is lexically inside and physically not.\n // Measured reachable from the plugin manager and the MCP client before this was changed.\n //\n // The root itself stays allowed, which `insideRoot` alone does not answer: it returns false for\n // `target === base` (correct for its own caller, wrong here, where `safePathJoin(base)` with no\n // parts must return `base`). Kept as an explicit second clause rather than by weakening the\n // shared rule for everyone.\n return atOrInsideRoot(target, base);\n}\n\n/**\n * Join `base` with `...parts` and ensure the resolved absolute path stays\n * under `base`. Resolves FIRST, then prefix-checks (ADR D80) — prevents\n * normalized-escape bypasses like `subdir/.\\\\./bar`.\n *\n * Returns the safe absolute path. Throws `PathTraversalError` if escape.\n *\n */\nexport function safePathJoin(base: string, ...parts: string[]): string {\n if (base === \"\") {\n throw new Error(\"safePathJoin: base must be non-empty\");\n }\n // T5.5 — NUL byte + C0/DEL control char rejection at the boundary.\n // Apply before path resolution so a malicious input never reaches\n // `resolve` (which on some platforms behaved unexpectedly with NUL\n // and in N-API callers historically silently truncated).\n rejectNulAndControlChars(base, \"base\");\n for (const part of parts) {\n rejectNulAndControlChars(part, \"path segment\");\n }\n const baseResolved = resolve(base);\n const target = resolve(base, ...parts);\n if (!isInside(target, baseResolved)) {\n throw new PathTraversalError(parts.join(\"/\"), target);\n }\n return target;\n}\n\n/**\n * T5.5 — the operator-legible label for the first NUL (`\\x00`), C0 control char (`\\x01-\\x1F`) or\n * DEL (`\\x7F`) in `input`, or `undefined` when it carries none. Centralizes the scan so every\n * public path-guard / sanitize entrypoint shares one definition of \"control character\".\n *\n * Detection is separated from the throw so the two callers can share the scan and the precise\n * diagnostic while each raising the error ITS OWN contract documents (#368) — a path guard reports\n * a traversal, an identifier validator reports an invalid identifier. Before that split both threw\n * `PathTraversalError`, which made an identifier validator's error class depend on the bytes of the\n * input it was handed.\n *\n * @internal\n */\nfunction firstControlCharLabel(input: string): string | undefined {\n for (let i = 0; i < input.length; i++) {\n const code = input.charCodeAt(i);\n if (code === 0x00 || (code >= 0x01 && code <= 0x1f) || code === 0x7f) {\n return code === 0x00 ? \"<nul-byte>\" : `<control-char-0x${code.toString(16)}>`;\n }\n }\n return undefined;\n}\n\n/**\n * Reject any path-shaped input carrying a NUL or control character, as `PathTraversalError` — the\n * same shape as every other path-shape rejection, so callers do not learn a second error class.\n *\n * @internal\n */\nfunction rejectNulAndControlChars(input: string, role: string): void {\n const label = firstControlCharLabel(input);\n if (label !== undefined) throw new PathTraversalError(`${role}: ${input}`, label);\n}\n\n/**\n * Assert that `path` — including every directory component in the chain —\n * stays under `base` after symlink resolution. No-op when nothing on the\n * path exists yet.\n *\n * Two-bug history:\n * 1. **EC-1** (original fix, kept): a multi-level symlink chain A → B → C\n * must be resolved end-to-end. `realpathSync` does this in 1 syscall.\n * 2. **Defence-in-depth** (added v1.x): the previous implementation only\n * called `lstatSync(path)` on the terminal component. If an INTERMEDIATE\n * directory was a symlink (`base/inner-symlink → /outside`), `lstat` on\n * `base/inner-symlink/file.txt` followed the symlink and reported the\n * regular file — escape went undetected. Fix: walk up to the nearest\n * existing ancestor and `realpath` THAT, then re-attach the suffix and\n * check the result against the canonical base.\n *\n */\nexport function assertNoSymlinkEscape(path: string, base: string): void {\n // T5.5 — reject NUL / control chars before any FS call (a NUL byte\n // in the path used to silently truncate at the C boundary on legacy\n // libc — defense in depth even on modern Node).\n rejectNulAndControlChars(path, \"path\");\n rejectNulAndControlChars(base, \"base\");\n // Canonical base — symlinks in the base path itself are absorbed once here.\n let baseResolved: string;\n try {\n baseResolved = realpathSync(base);\n } catch {\n // base doesn't exist as a real directory yet — fall back to lexical resolve.\n baseResolved = resolve(base);\n }\n\n // Find the deepest ancestor of `path` that exists, then realpath it.\n // Anything from there onward is \"not yet on disk\" and contributes only\n // its lexical suffix. This covers three cases:\n // - path exists (regular file or symlink at any depth) → realpath the full path\n // - path doesn't exist but intermediate dir is a symlink → realpath the ancestor\n // - nothing on the path exists → no escape risk (return)\n const resolved = realpathOfDeepestExisting(path);\n if (resolved === undefined) return; // path has no existing prefix — nothing to attack\n\n if (!isInside(resolved, baseResolved)) {\n throw new PathTraversalError(`symlink ${path}`, resolved);\n }\n}\n\n/**\n * Find the deepest ancestor of `path` that exists on disk, resolve all\n * symlinks in that ancestor via `realpathSync`, and re-attach the\n * lexical suffix. Returns `undefined` when no ancestor exists.\n *\n * Handles dangling symlinks: if the terminal IS a symlink but its target\n * is missing, we still detect escape via `readlinkSync` + parent resolve.\n */\nfunction realpathOfDeepestExisting(path: string): string | undefined {\n // First try the full path — the common case.\n try {\n return realpathSync(path);\n } catch {\n // Not resolvable. Two sub-cases.\n }\n\n // Sub-case A: terminal is a dangling symlink.\n try {\n const stat: Stats = lstatSync(path);\n if (stat.isSymbolicLink()) {\n const target = readlinkSync(path);\n // Resolve target relative to the REAL parent dir, so intermediate\n // symlinks in the parent chain are absorbed.\n const parentReal = realpathOfDeepestExisting(dirname(path));\n const parentBase = parentReal ?? dirname(path);\n return resolve(parentBase, target);\n }\n } catch {\n // lstat failed too — terminal doesn't exist at all.\n }\n\n // Sub-case B: walk up to the nearest existing ancestor, then re-attach\n // the suffix lexically.\n let cursor = dirname(path);\n let suffix = path.slice(cursor.length);\n while (cursor !== dirname(cursor)) {\n try {\n const real = realpathSync(cursor);\n // Reconstruct: ancestor's realpath + remaining (still-lexical) suffix\n return resolve(real, `.${suffix}`);\n } catch {\n suffix = path.slice(dirname(cursor).length);\n cursor = dirname(cursor);\n }\n }\n // Reached filesystem root without finding any existing ancestor.\n return undefined;\n}\n\nconst LOCK_FILES = new Set([\"pnpm-lock.yaml\", \"package-lock.json\", \"yarn.lock\", \"bun.lockb\"]);\n\n// T5.6 — top-level credential dot-dirs / dot-files. Matching against\n// the FIRST path segment (lowercase). Adding any entry here costs a\n// CHANGELOG note + an explicit case-fold test (entries are lowercased\n// at module load).\nconst SENSITIVE_FIRST_SEGMENTS = new Set([\n \".ssh\",\n \".aws\",\n \".docker\",\n \".kube\",\n \".npmrc\",\n \".netrc\",\n \".pgpass\",\n]);\n\n// T5.6 — credential basenames blocked at ANY depth (lowercase). Catches\n// the developer-laptop case where an agent recurses into a subdir.\nconst SENSITIVE_BASENAMES = new Set([\n \"id_rsa\",\n \"id_ed25519\",\n \"id_ecdsa\",\n \"id_dsa\",\n \"authorized_keys\",\n \"known_hosts\",\n \".npmrc\",\n \".netrc\",\n \".pgpass\",\n]);\n\n// T5.6 — extension suffixes blocked at ANY depth (lowercase). Covers\n// the entire `*.pem` / `*.key` private-material family.\nconst SENSITIVE_SUFFIXES = [\".pem\", \".key\", \".p12\", \".pfx\"];\n\n/**\n * Decide whether a project-relative path points to a known-sensitive file\n * that a coding agent must not read or write.\n *\n * Universal blocklist (works for any agent operating on a project tree):\n *\n * - `.env`, `.env.<anything>` — except `.env.example` (template safe to read)\n * - `.git/` — version control internals\n * - `node_modules/` — dependency cache (changes don't belong to the user)\n * - `.theo/` — TheoKit build artefacts / state\n * - Lock files at any depth: `pnpm-lock.yaml`, `package-lock.json`,\n * `yarn.lock`, `bun.lockb`\n *\n * Operates on path segments (forward-slash normalized). Cross-platform safe.\n *\n * Use together with `safePathJoin` + `assertNoSymlinkEscape`: the former two\n * defeat traversal, this one defeats reading a file that is lexically inside\n * the project but should not be agent-visible.\n *\n * @public\n */\nexport function isForbiddenPath(input: string): boolean {\n // T5.6 — lowercase normalization defeats case-only bypass on\n // case-insensitive filesystems (Windows/macOS-default) where `.ENV`\n // and `.env` map to the same inode but a case-sensitive string\n // check passes the former.\n const normalized = input.replace(/\\\\/g, \"/\").replace(/^\\.\\//, \"\").toLowerCase();\n if (normalized.length === 0) return false;\n\n const segments = normalized.split(\"/\").filter((s) => s.length > 0);\n if (segments.length === 0) return false;\n\n if (isForbiddenFirstSegment(segments[0]!)) return true;\n if (isForbiddenBasename(segments[segments.length - 1]!)) return true;\n return false;\n}\n\nfunction isForbiddenFirstSegment(first: string): boolean {\n // .env.example is explicitly allowlisted (template safe to read)\n if (first === \".env.example\") return false;\n if (first === \".env\") return true;\n if (/^\\.env\\./.test(first)) return true;\n if (first === \".git\" || first === \"node_modules\" || first === \".theo\") return true;\n return SENSITIVE_FIRST_SEGMENTS.has(first);\n}\n\nfunction isForbiddenBasename(basename: string): boolean {\n if (LOCK_FILES.has(basename)) return true;\n if (SENSITIVE_BASENAMES.has(basename)) return true;\n for (const suffix of SENSITIVE_SUFFIXES) {\n if (basename.endsWith(suffix)) return true;\n }\n return false;\n}\n\nconst IDENTIFIER_PATTERN = /^[a-z0-9][a-z0-9\\-_]*$/i;\n\n/**\n * T1.4 — validate a relative artifact path string BEFORE it is used to look\n * up a fixture or to fetch from PaaS. Rejects every well-known traversal\n * vector at the boundary, throwing `PathTraversalError`.\n *\n * Vectors rejected:\n * - classic `..` parent-directory traversal (any segment).\n * - backslash separators (Windows-style `..\\\\windows`).\n * - URL-encoded `%2e%2e` / `%2E%2E` (double-decoded traversal).\n * - NUL byte injection (`\\x00`).\n * - Windows drive letter prefix (`C:`, `D:\\\\...`).\n * - Home-tilde expansion (`~/`, `~root/...`).\n * - Absolute paths starting with `/`.\n *\n * Does NOT touch the filesystem — the call is shape-only. Live symlink\n * traversal protection happens via `assertNoSymlinkEscape` at the FS-resolve\n * boundary.\n *\n * @param input - Caller-supplied artifact path.\n * @throws `PathTraversalError` on any rejection.\n *\n * Semver-exempt: reachable via the `@theokit/sdk/internal/security` sub-path, which the package\n * declares in `exports` but does NOT cover with its semver contract.\n */\nexport function validateArtifactPath(input: string): void {\n rejectKnownPrefixVectors(input);\n const normalized = decodeAndNormalize(input);\n rejectParentTraversal(input, normalized);\n}\n\nfunction rejectKnownPrefixVectors(input: string): void {\n if (input.includes(\"\\x00\")) {\n throw new PathTraversalError(input, \"<nul-byte>\");\n }\n if (input.startsWith(\"/\") || input.startsWith(\"~\")) {\n throw new PathTraversalError(input, input);\n }\n if (/^[A-Za-z]:[\\\\/]?/.test(input)) {\n throw new PathTraversalError(input, input);\n }\n}\n\nfunction decodeAndNormalize(input: string): string {\n // URL-encoded traversal — 2 passes catches `%252e%252e`.\n // Malformed sequences (decodeURIComponent throws) are themselves a rejection.\n let decoded = input;\n for (let i = 0; i < 2; i += 1) {\n try {\n const next = decodeURIComponent(decoded);\n if (next === decoded) break;\n decoded = next;\n } catch {\n throw new PathTraversalError(input, \"<malformed-url-encoding>\");\n }\n }\n // Normalize backslash to forward slash before segment-walking.\n return decoded.replace(/\\\\/g, \"/\");\n}\n\nfunction rejectParentTraversal(input: string, normalized: string): void {\n for (const segment of normalized.split(\"/\")) {\n if (segment === \"..\" || segment === \"..%00\") {\n throw new PathTraversalError(input, normalized);\n }\n }\n // Defense in depth: literal `..` anywhere in the normalized string.\n if (normalized.includes(\"..\")) {\n throw new PathTraversalError(input, normalized);\n }\n}\n\n/**\n * Validate that `input` is a safe path component (skill name, agent ID,\n * namespace, etc.) and return its lowercase form. Strict grammar\n * `^[a-z0-9][a-z0-9-_]*$` rejects path separators, dots, null bytes,\n * whitespace, unicode invisible chars, and any leading `-`/`_`.\n *\n * ONE error class leaves this function: `ConfigurationError` with code\n * `invalid_identifier`, for every rejection — length out of range, a path\n * separator, `..`, a space, a leading `-`, and a NUL / C0 control char / DEL\n * alike. A caller can branch on that code and know it has covered the whole\n * rejection surface.\n *\n * Before #368 the control-char branch threw `PathTraversalError` instead, which\n * made the error CLASS a function of the attacker's bytes; the message still names\n * the offending byte, which is the part that was worth keeping.\n *\n * @param input - User-supplied identifier candidate.\n * @param options.maxLen - Maximum allowed length (default 64).\n * @returns Lowercase form of `input`.\n * @throws `ConfigurationError` with code `invalid_identifier` on every rejection.\n */\nexport function sanitizeIdentifier(input: string, options?: { maxLen?: number }): string {\n const maxLen = options?.maxLen ?? 64;\n if (input.length === 0 || input.length > maxLen) {\n throw new ConfigurationError(`Identifier length out of range (1-${maxLen}): \"${input}\"`, {\n code: \"invalid_identifier\",\n });\n }\n // T5.5 — explicit NUL / control char rejection ahead of the generic pattern check. The\n // IDENTIFIER_PATTERN regex already excludes these (they are not in `[a-z0-9\\-_]`); naming the\n // offending byte gives operators a precise diagnostic instead of the generic \"invalid characters\"\n // message, which is what makes a prompt-injection trace legible (Rule 3).\n //\n // #368 — the diagnostic used to arrive as a `PathTraversalError`, because the branch reused\n // `safePathJoin`'s thrower. That made the error CLASS a function of the attacker's bytes: a\n // caller branching on the documented `invalid_identifier` rethrew for any input carrying a\n // control char, so a rejection surfaced as a 500 and the 400/500 split became an oracle. The\n // detection is shared; the error each contract documents is not.\n const controlChar = firstControlCharLabel(input);\n if (controlChar !== undefined) {\n throw new ConfigurationError(`Identifier contains ${controlChar}: \"${input}\"`, {\n code: \"invalid_identifier\",\n });\n }\n if (!IDENTIFIER_PATTERN.test(input)) {\n throw new ConfigurationError(`Identifier contains invalid characters: \"${input}\"`, {\n code: \"invalid_identifier\",\n });\n }\n return input.toLowerCase();\n}\n\n/**\n * Convert ANY opaque id (agent id, run id, conversation id, namespace, email,\n * arbitrary string) into a deterministic, filesystem-safe filename component.\n *\n * Unlike {@link sanitizeIdentifier} (which THROWS on non-conforming input),\n * this is a total function: it NEVER throws on a non-empty string. It returns\n * the lowercased id verbatim when it already matches the safe grammar\n * `^[a-z0-9][a-z0-9-_]*$` and fits `maxLen` (so UUIDs, hashes, and slugs stay\n * human-readable), otherwise a deterministic `h-<16 hex>` sha256 token\n * (collision-resistant and always a valid filename). The output charset is\n * always `[a-z0-9_-]`, safe as a literal path segment on every filesystem.\n *\n * @param id - any opaque identifier (must be a non-empty string)\n * @param options.maxLen - max length for the passthrough branch (default 128).\n * Ids longer than this are hashed; the hash token itself is always short.\n * @throws ConfigurationError (code `invalid_filename_id`) only on empty input.\n *\n * @example\n * safeFilenameForId(\"550e8400-e29b-41d4-a716-446655440000\") // passthrough\n * safeFilenameForId(\"user@example.com\") // \"h-<16hex>\"\n *\n */\nexport function safeFilenameForId(id: string, options?: { maxLen?: number }): string {\n if (id.length === 0) {\n throw new ConfigurationError(\"Filename id must be a non-empty string\", {\n code: \"invalid_filename_id\",\n });\n }\n const maxLen = options?.maxLen ?? 128;\n const lower = id.toLowerCase();\n if (lower.length <= maxLen && IDENTIFIER_PATTERN.test(lower)) {\n return lower;\n }\n return `h-${createHash(\"sha256\").update(id).digest(\"hex\").slice(0, 16)}`;\n}\n"]}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { submit, emitRunEvent } from './chunk-
|
|
2
|
-
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-
|
|
3
|
-
import { IndexManager } from './chunk-
|
|
4
|
-
import { currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-
|
|
1
|
+
import { submit, emitRunEvent } from './chunk-GEQLHBJM.js';
|
|
2
|
+
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-4OMRDNPY.js';
|
|
3
|
+
import { IndexManager } from './chunk-L5B7EWWH.js';
|
|
4
|
+
import { currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-ZUWVO442.js';
|
|
5
5
|
import { extractCodePlugins, isCodePlugin } from './chunk-2SFBB54R.js';
|
|
6
|
-
import { createOpenAiCompatibleRuntime } from './chunk-
|
|
7
|
-
import { persistActiveMemoryTranscript } from './chunk-
|
|
8
|
-
import { resolveMaxFacts, writeSessionSummary, resolveMemoryRoot, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-
|
|
9
|
-
import { FsSessionStore } from './chunk-
|
|
10
|
-
import { discoverProviderPlugins, validateApiKeyShape, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, readTrustArray, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, CircuitBreaker, trustFilePath, resolveRunProvider, mergeExplicitApiKey, resolveProviderChain, abortError, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-
|
|
6
|
+
import { createOpenAiCompatibleRuntime } from './chunk-TTXRNCXY.js';
|
|
7
|
+
import { persistActiveMemoryTranscript } from './chunk-BH6M2DGV.js';
|
|
8
|
+
import { resolveMaxFacts, writeSessionSummary, resolveMemoryRoot, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-DB5RYCXX.js';
|
|
9
|
+
import { FsSessionStore } from './chunk-P7B64NFK.js';
|
|
10
|
+
import { discoverProviderPlugins, validateApiKeyShape, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, readTrustArray, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, CircuitBreaker, trustFilePath, resolveRunProvider, mergeExplicitApiKey, resolveProviderChain, abortError, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-HFEAU2L2.js';
|
|
11
11
|
import { resolveChildEnv } from './chunk-HKCKOAIO.js';
|
|
12
|
-
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-
|
|
13
|
-
import { warnFailureOnce, loadHookConfig, warnOnce } from './chunk-
|
|
14
|
-
import { getTokens, lockedRefresh, refreshAccessToken, runPkceFlow, setTokens } from './chunk-
|
|
15
|
-
import { readVersionedJson, writeVersionedJson } from './chunk-
|
|
12
|
+
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-YUQNHLKN.js';
|
|
13
|
+
import { warnFailureOnce, loadHookConfig, warnOnce } from './chunk-S7IZEVXX.js';
|
|
14
|
+
import { getTokens, lockedRefresh, refreshAccessToken, runPkceFlow, setTokens } from './chunk-LG4JCJEI.js';
|
|
15
|
+
import { readVersionedJson, writeVersionedJson } from './chunk-CN732Z5C.js';
|
|
16
16
|
import { toJsonSchema } from './chunk-7I5Z3UBJ.js';
|
|
17
|
-
import { sanitizeToolInput } from './chunk-
|
|
18
|
-
import { withInheritedSubAgentCredentials, subAgentToolsFromDefinitions } from './chunk-
|
|
17
|
+
import { sanitizeToolInput } from './chunk-WJ6OGKAO.js';
|
|
18
|
+
import { withInheritedSubAgentCredentials, subAgentToolsFromDefinitions } from './chunk-S5ERB3CH.js';
|
|
19
19
|
import { setAgentFacade } from './chunk-6X6ID4MO.js';
|
|
20
|
-
import { escapeBlockBody, buildSkillsBlock, discoverSkills, stripSkillFrontmatter } from './chunk-
|
|
21
|
-
import { withToolWhitelist, checkToolWhitelist } from './chunk-
|
|
22
|
-
import { validateArtifactPath, PathTraversalError, safePathJoin } from './chunk-
|
|
23
|
-
import { insideRoot, atOrInsideRoot } from './chunk-
|
|
20
|
+
import { escapeBlockBody, buildSkillsBlock, discoverSkills, stripSkillFrontmatter } from './chunk-LSURFRJA.js';
|
|
21
|
+
import { withToolWhitelist, checkToolWhitelist } from './chunk-S2CMEJ5F.js';
|
|
22
|
+
import { validateArtifactPath, PathTraversalError, safePathJoin } from './chunk-NO6AG22P.js';
|
|
23
|
+
import { insideRoot, atOrInsideRoot } from './chunk-DGO4LPLP.js';
|
|
24
24
|
import { mapWithConcurrency } from './chunk-ORLTGPOS.js';
|
|
25
|
-
import { expandTilde, defaultBaseDir } from './chunk-
|
|
25
|
+
import { expandTilde, defaultBaseDir } from './chunk-3VX7JHJI.js';
|
|
26
26
|
import { withFileLock } from './chunk-FGGVSHDW.js';
|
|
27
27
|
import { withCwdMutex } from './chunk-PPU2D4FZ.js';
|
|
28
|
-
import { sweepStaleAtomicTemps, atomicWriteJson } from './chunk-
|
|
29
|
-
import { loadSubagents, pluginBundleDirs } from './chunk-
|
|
30
|
-
import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, adaptersForSurface, projectConfigRoots, pluginBundleRoots } from './chunk-
|
|
31
|
-
import { readWorkspaceDir, parseSimpleYaml } from './chunk-
|
|
28
|
+
import { sweepStaleAtomicTemps, atomicWriteJson } from './chunk-AZK3QM36.js';
|
|
29
|
+
import { loadSubagents, pluginBundleDirs } from './chunk-MTNCJ7MQ.js';
|
|
30
|
+
import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, adaptersForSurface, projectConfigRoots, pluginBundleRoots } from './chunk-PISZRLES.js';
|
|
31
|
+
import { readWorkspaceDir, parseSimpleYaml } from './chunk-TIYQDJFK.js';
|
|
32
32
|
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-SZQFCHU6.js';
|
|
33
|
-
import { isAnthropicFamilyModel } from './chunk-
|
|
33
|
+
import { isAnthropicFamilyModel } from './chunk-CMDM4VF6.js';
|
|
34
34
|
import { parseModelId } from './chunk-R7WIIPUR.js';
|
|
35
|
-
import { getProviderProfile } from './chunk-
|
|
36
|
-
import { getCatalogModelInfo, isPatchedModelKey } from './chunk-
|
|
35
|
+
import { getProviderProfile } from './chunk-AQ23NII7.js';
|
|
36
|
+
import { getCatalogModelInfo, isPatchedModelKey } from './chunk-5L7S2VOL.js';
|
|
37
37
|
import { globalSingleton } from './chunk-AGACYRJ2.js';
|
|
38
38
|
import { boundFetch } from './chunk-Q7GYMXVC.js';
|
|
39
39
|
import { AgentRunError, coerceToKnownAgentRunErrorCode, UnknownAgentError, ConfigurationError, AuthenticationError, AgentDisposedError, UnsupportedRunOperationError, TheokitAgentError, NetworkError } from './chunk-TNFOU6SB.js';
|
|
40
40
|
import { diag, resolveApiKey, diagFailure, API_KEY_ENV_VAR, redactSecrets } from './chunk-3OY6H3I7.js';
|
|
41
|
-
import { stat, mkdir, readFile, readdir, access, unlink } from 'fs/promises';
|
|
42
|
-
import { randomUUID, createHash } from 'crypto';
|
|
43
|
-
import { join, dirname, isAbsolute, delimiter, resolve, relative } from 'path';
|
|
44
|
-
import { existsSync, readFileSync, realpathSync, accessSync, constants } from 'fs';
|
|
45
|
-
import { platform } from 'process';
|
|
46
|
-
import { spawn } from 'child_process';
|
|
47
|
-
import { pathToFileURL } from 'url';
|
|
41
|
+
import { stat, mkdir, readFile, readdir, access, unlink } from 'node:fs/promises';
|
|
42
|
+
import { randomUUID, createHash } from 'node:crypto';
|
|
43
|
+
import { join, dirname, isAbsolute, delimiter, resolve, relative } from 'node:path';
|
|
44
|
+
import { existsSync, readFileSync, realpathSync, accessSync, constants } from 'node:fs';
|
|
45
|
+
import { platform } from 'node:process';
|
|
46
|
+
import { spawn } from 'node:child_process';
|
|
47
|
+
import { pathToFileURL } from 'node:url';
|
|
48
48
|
import { z } from 'zod';
|
|
49
|
-
import { createRequire } from 'module';
|
|
50
|
-
import { homedir } from 'os';
|
|
49
|
+
import { createRequire } from 'node:module';
|
|
50
|
+
import { homedir } from 'node:os';
|
|
51
51
|
|
|
52
52
|
// src/agent-builder.ts
|
|
53
53
|
var AgentBuilder = class {
|
|
@@ -163,7 +163,7 @@ async function agentGenerate(agent, agentModel, agentApiKey, agentLocal, input,
|
|
|
163
163
|
const { output, maxRetries, errorStrategy, ...sendOptions } = options;
|
|
164
164
|
const run = await agent.send(input, sendOptions);
|
|
165
165
|
const result = await run.wait();
|
|
166
|
-
const { generateObjectImpl, GenerateObjectError } = await import('./generate-object-
|
|
166
|
+
const { generateObjectImpl, GenerateObjectError } = await import('./generate-object-RPBXY2U3.js');
|
|
167
167
|
const answer = structurableAnswerOrThrow(result, GenerateObjectError);
|
|
168
168
|
const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
|
|
169
169
|
const facade = getAgentFacade();
|
|
@@ -9844,9 +9844,9 @@ async function* localAgentStreamToCompletion(agent, message, options) {
|
|
|
9844
9844
|
return yield* streamToCompletionImpl({ send: (m, o) => agent.send(m, o) }, message, options);
|
|
9845
9845
|
}
|
|
9846
9846
|
async function localAgentFork(parent, options) {
|
|
9847
|
-
const { forkAgentImpl } = await import('./fork-agent-
|
|
9847
|
+
const { forkAgentImpl } = await import('./fork-agent-BHVTALT5.js');
|
|
9848
9848
|
const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
|
|
9849
|
-
const { withPersonalityContext } = await import('./context-
|
|
9849
|
+
const { withPersonalityContext } = await import('./context-4XSD2V3G.js');
|
|
9850
9850
|
const create = getAgentFacade().create;
|
|
9851
9851
|
return withPersonalityContext(
|
|
9852
9852
|
{ slug: parent.personalitySlugSnapshot, isFork: true },
|
|
@@ -11450,7 +11450,7 @@ var Agent = class _Agent {
|
|
|
11450
11450
|
* @public
|
|
11451
11451
|
*/
|
|
11452
11452
|
static async generateObject(options) {
|
|
11453
|
-
const { generateObjectImpl } = await import('./generate-object-
|
|
11453
|
+
const { generateObjectImpl } = await import('./generate-object-RPBXY2U3.js');
|
|
11454
11454
|
return generateObjectImpl(options, {
|
|
11455
11455
|
create: (opts) => _Agent.create(opts),
|
|
11456
11456
|
delete: (agentId) => _Agent.delete(agentId)
|
|
@@ -11474,7 +11474,7 @@ var Agent = class _Agent {
|
|
|
11474
11474
|
delete: (agentId) => _Agent.delete(agentId)
|
|
11475
11475
|
};
|
|
11476
11476
|
async function* wrapper() {
|
|
11477
|
-
streamObjectImport ??= import('./stream-object-
|
|
11477
|
+
streamObjectImport ??= import('./stream-object-3AU7QDHT.js');
|
|
11478
11478
|
const { streamObjectImpl } = await streamObjectImport;
|
|
11479
11479
|
yield* streamObjectImpl(options, deps);
|
|
11480
11480
|
}
|
|
@@ -11498,7 +11498,7 @@ var Agent = class _Agent {
|
|
|
11498
11498
|
* @public
|
|
11499
11499
|
*/
|
|
11500
11500
|
static async batch(prompts, options) {
|
|
11501
|
-
const { batchImpl } = await import('./batch-
|
|
11501
|
+
const { batchImpl } = await import('./batch-7IGV2OKA.js');
|
|
11502
11502
|
return batchImpl(prompts, options, { create: (opts) => _Agent.create(opts) });
|
|
11503
11503
|
}
|
|
11504
11504
|
/**
|
|
@@ -11659,7 +11659,7 @@ var Agent = class _Agent {
|
|
|
11659
11659
|
*/
|
|
11660
11660
|
static async compact(agentId, options = {}) {
|
|
11661
11661
|
const reg = await requireLocalAgent(agentId, "compact");
|
|
11662
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
11662
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-ZPEJSTLA.js');
|
|
11663
11663
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
11664
11664
|
return enqueueSessionWrite(
|
|
11665
11665
|
cwd,
|
|
@@ -11689,7 +11689,7 @@ var Agent = class _Agent {
|
|
|
11689
11689
|
*/
|
|
11690
11690
|
static async injectSessionTurn(agentId, turn) {
|
|
11691
11691
|
const reg = await requireLocalAgent(agentId, "injectSessionTurn");
|
|
11692
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
11692
|
+
const { injectSessionTurn } = await import('./inject-session-OMBJKMVD.js');
|
|
11693
11693
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
11694
11694
|
await injectSessionTurn({
|
|
11695
11695
|
store,
|
|
@@ -11719,7 +11719,7 @@ var Agent = class _Agent {
|
|
|
11719
11719
|
*/
|
|
11720
11720
|
static async transcript(agentId) {
|
|
11721
11721
|
const reg = await requireLocalAgent(agentId, "transcript");
|
|
11722
|
-
const { readSessionMessages } = await import('./agent-session-store-
|
|
11722
|
+
const { readSessionMessages } = await import('./agent-session-store-2LQEPS4H.js');
|
|
11723
11723
|
const { store } = await openLocalStore(reg);
|
|
11724
11724
|
return readSessionMessages(store, agentId);
|
|
11725
11725
|
}
|
|
@@ -11740,7 +11740,7 @@ var Agent = class _Agent {
|
|
|
11740
11740
|
*/
|
|
11741
11741
|
static async describe(agentId) {
|
|
11742
11742
|
const agent = await getRegisteredAgentOrThrow(agentId);
|
|
11743
|
-
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-
|
|
11743
|
+
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-CPFVLWLH.js');
|
|
11744
11744
|
const settingSources = agent.options.local?.settingSources;
|
|
11745
11745
|
const subagents = await loadSubagents2(
|
|
11746
11746
|
agent.cwd ?? process.cwd(),
|
|
@@ -11841,13 +11841,13 @@ async function openLocalStore(reg) {
|
|
|
11841
11841
|
const model = reg.model?.id ?? (typeof optModel === "string" ? optModel : optModel?.id) ?? "unknown";
|
|
11842
11842
|
const injected = reg.options.local?.sessionStore;
|
|
11843
11843
|
if (injected !== void 0) return { cwd, model, store: injected };
|
|
11844
|
-
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-
|
|
11845
|
-
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-
|
|
11844
|
+
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-EZ32TFGB.js');
|
|
11845
|
+
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-GU2VE7JX.js');
|
|
11846
11846
|
const configuredSessionDir = reg.options.local?.sessionDir ?? reg.options.local?.baseDir;
|
|
11847
11847
|
const baseDir = configuredSessionDir !== void 0 ? expandTilde2(configuredSessionDir) : defaultBaseDir2();
|
|
11848
11848
|
return { cwd, model, store: new FsSessionStore2({ baseDir, cwd }) };
|
|
11849
11849
|
}
|
|
11850
11850
|
|
|
11851
11851
|
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, managedSettingsPathFor, openRouterMemoryEmbeddingProviderAdapter, readManagedSettings, resolveSessionDir };
|
|
11852
|
-
//# sourceMappingURL=chunk-
|
|
11853
|
-
//# sourceMappingURL=chunk-
|
|
11852
|
+
//# sourceMappingURL=chunk-WAKGYSQ6.js.map
|
|
11853
|
+
//# sourceMappingURL=chunk-WAKGYSQ6.js.map
|