@theokit/sdk 4.63.0 → 4.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/a2a/index.cjs +2 -2
- package/dist/a2a/index.js +1 -1
- package/dist/agent-WK7MKIMH.cjs +66 -0
- package/dist/{agent-5KYMG63I.cjs.map → agent-WK7MKIMH.cjs.map} +1 -1
- package/dist/agent-YWMBM7LX.js +57 -0
- package/dist/{agent-536OOESZ.js.map → agent-YWMBM7LX.js.map} +1 -1
- package/dist/agent-session-store-6EL5NPA4.cjs +24 -0
- package/dist/{agent-session-store-WAKLOKWK.cjs.map → agent-session-store-6EL5NPA4.cjs.map} +1 -1
- package/dist/agent-session-store-OPGRB4XM.js +7 -0
- package/dist/{agent-session-store-G2BMUZQV.js.map → agent-session-store-OPGRB4XM.js.map} +1 -1
- package/dist/auth/index.cjs +18 -18
- package/dist/auth/index.js +6 -6
- package/dist/{batch-ND32UKZS.cjs → batch-BXYTW2DP.cjs} +27 -27
- package/dist/{batch-ND32UKZS.cjs.map → batch-BXYTW2DP.cjs.map} +1 -1
- package/dist/{batch-2TGJMNCJ.js → batch-L4ZXS46M.js} +10 -10
- package/dist/{batch-2TGJMNCJ.js.map → batch-L4ZXS46M.js.map} +1 -1
- package/dist/{chunk-VF7EWVDG.js → chunk-2GUYQR5P.js} +3 -3
- package/dist/{chunk-VF7EWVDG.js.map → chunk-2GUYQR5P.js.map} +1 -1
- package/dist/{chunk-J2UROOIG.cjs → chunk-2HVF2WJY.cjs} +8 -8
- package/dist/{chunk-J2UROOIG.cjs.map → chunk-2HVF2WJY.cjs.map} +1 -1
- package/dist/{chunk-44MBDIHG.js → chunk-2QDYBS2A.js} +3 -3
- package/dist/{chunk-44MBDIHG.js.map → chunk-2QDYBS2A.js.map} +1 -1
- package/dist/{chunk-NGESVVJN.cjs → chunk-3FFAEAUJ.cjs} +17 -17
- package/dist/{chunk-NGESVVJN.cjs.map → chunk-3FFAEAUJ.cjs.map} +1 -1
- package/dist/{chunk-GWC3HADL.cjs → chunk-3NSS2OIZ.cjs} +4 -4
- package/dist/{chunk-GWC3HADL.cjs.map → chunk-3NSS2OIZ.cjs.map} +1 -1
- package/dist/{chunk-CV7XMBHP.js → chunk-3O42QOMJ.js} +3 -3
- package/dist/{chunk-CV7XMBHP.js.map → chunk-3O42QOMJ.js.map} +1 -1
- package/dist/{chunk-IWBGCBR6.cjs → chunk-4CLOXP6H.cjs} +4 -4
- package/dist/{chunk-IWBGCBR6.cjs.map → chunk-4CLOXP6H.cjs.map} +1 -1
- package/dist/{chunk-YEXA3PGR.js → chunk-4FFBAUFS.js} +5 -5
- package/dist/{chunk-YEXA3PGR.js.map → chunk-4FFBAUFS.js.map} +1 -1
- package/dist/{chunk-HY57ULY2.cjs → chunk-4PYZ5AX3.cjs} +5 -5
- package/dist/{chunk-HY57ULY2.cjs.map → chunk-4PYZ5AX3.cjs.map} +1 -1
- package/dist/{chunk-OC4NTGMN.js → chunk-4QZSA2HJ.js} +3 -3
- package/dist/{chunk-OC4NTGMN.js.map → chunk-4QZSA2HJ.js.map} +1 -1
- package/dist/{chunk-K3FW2XZD.cjs → chunk-4ZHTIJNE.cjs} +9 -9
- package/dist/{chunk-K3FW2XZD.cjs.map → chunk-4ZHTIJNE.cjs.map} +1 -1
- package/dist/{chunk-BUIK7GUA.cjs → chunk-5HEG4CQH.cjs} +8 -8
- package/dist/{chunk-BUIK7GUA.cjs.map → chunk-5HEG4CQH.cjs.map} +1 -1
- package/dist/{chunk-NXH4GPAQ.cjs → chunk-5VB22SYX.cjs} +7 -7
- package/dist/{chunk-NXH4GPAQ.cjs.map → chunk-5VB22SYX.cjs.map} +1 -1
- package/dist/{chunk-5USCYPPI.cjs → chunk-6HKGLTJI.cjs} +8 -8
- package/dist/{chunk-5USCYPPI.cjs.map → chunk-6HKGLTJI.cjs.map} +1 -1
- package/dist/{chunk-EHJEZAOO.cjs → chunk-6RKUO7AW.cjs} +32 -32
- package/dist/{chunk-EHJEZAOO.cjs.map → chunk-6RKUO7AW.cjs.map} +1 -1
- package/dist/{chunk-5JLFFPCH.js → chunk-7YGCPMGB.js} +4 -4
- package/dist/{chunk-5JLFFPCH.js.map → chunk-7YGCPMGB.js.map} +1 -1
- package/dist/{chunk-SUKXXLWD.js → chunk-A46SWMIF.js} +6 -6
- package/dist/{chunk-SUKXXLWD.js.map → chunk-A46SWMIF.js.map} +1 -1
- package/dist/{chunk-F7AQV62G.js → chunk-A4JVILQU.js} +5 -5
- package/dist/{chunk-F7AQV62G.js.map → chunk-A4JVILQU.js.map} +1 -1
- package/dist/{chunk-44JAAH4X.js → chunk-B3IMEBOA.js} +3 -3
- package/dist/{chunk-44JAAH4X.js.map → chunk-B3IMEBOA.js.map} +1 -1
- package/dist/{chunk-QDED6YO6.cjs → chunk-B4EOJWOY.cjs} +5 -5
- package/dist/{chunk-QDED6YO6.cjs.map → chunk-B4EOJWOY.cjs.map} +1 -1
- package/dist/{chunk-YJDH3CKG.js → chunk-BP46RJ5X.js} +5 -5
- package/dist/{chunk-YJDH3CKG.js.map → chunk-BP46RJ5X.js.map} +1 -1
- package/dist/{chunk-QRSUA2CV.js → chunk-BU4KFWXF.js} +3 -3
- package/dist/{chunk-QRSUA2CV.js.map → chunk-BU4KFWXF.js.map} +1 -1
- package/dist/{chunk-MG3SOM3M.js → chunk-BVJJ3DRV.js} +6 -6
- package/dist/{chunk-MG3SOM3M.js.map → chunk-BVJJ3DRV.js.map} +1 -1
- package/dist/{chunk-AQLGBKNT.js → chunk-BZRFXJHA.js} +3 -3
- package/dist/{chunk-AQLGBKNT.js.map → chunk-BZRFXJHA.js.map} +1 -1
- package/dist/{chunk-UQGQFBRL.js → chunk-C3NT3PVE.js} +3 -3
- package/dist/{chunk-UQGQFBRL.js.map → chunk-C3NT3PVE.js.map} +1 -1
- package/dist/{chunk-UC3HT2S4.js → chunk-C72AZW7J.js} +3 -3
- package/dist/{chunk-UC3HT2S4.js.map → chunk-C72AZW7J.js.map} +1 -1
- package/dist/{chunk-WNTAPVU5.cjs → chunk-CQBXOJ6U.cjs} +13 -13
- package/dist/{chunk-WNTAPVU5.cjs.map → chunk-CQBXOJ6U.cjs.map} +1 -1
- package/dist/{chunk-T7XEKOVW.js → chunk-D4CUGAKZ.js} +3 -3
- package/dist/{chunk-T7XEKOVW.js.map → chunk-D4CUGAKZ.js.map} +1 -1
- package/dist/{chunk-R6TA2DRJ.js → chunk-DKD3MH6A.js} +6 -6
- package/dist/{chunk-R6TA2DRJ.js.map → chunk-DKD3MH6A.js.map} +1 -1
- package/dist/{chunk-YXGAW7BB.js → chunk-DN2PACRI.js} +10 -10
- package/dist/{chunk-YXGAW7BB.js.map → chunk-DN2PACRI.js.map} +1 -1
- package/dist/{chunk-XSX2UU6Y.cjs → chunk-DXGZ2NUG.cjs} +10 -10
- package/dist/{chunk-XSX2UU6Y.cjs.map → chunk-DXGZ2NUG.cjs.map} +1 -1
- package/dist/{chunk-NUKRL3I6.cjs → chunk-EG4QM7ZJ.cjs} +18 -2
- package/dist/chunk-EG4QM7ZJ.cjs.map +1 -0
- package/dist/{chunk-C7QPML3L.js → chunk-GEEXBYFL.js} +9 -9
- package/dist/{chunk-C7QPML3L.js.map → chunk-GEEXBYFL.js.map} +1 -1
- package/dist/{chunk-A4VHSE56.cjs → chunk-GKEFRLU7.cjs} +6 -6
- package/dist/{chunk-A4VHSE56.cjs.map → chunk-GKEFRLU7.cjs.map} +1 -1
- package/dist/{chunk-NIRE5CNO.cjs → chunk-HCZD23VS.cjs} +13 -13
- package/dist/{chunk-NIRE5CNO.cjs.map → chunk-HCZD23VS.cjs.map} +1 -1
- package/dist/{chunk-IRCJ7EHV.cjs → chunk-HOXVQ5FR.cjs} +14 -14
- package/dist/{chunk-IRCJ7EHV.cjs.map → chunk-HOXVQ5FR.cjs.map} +1 -1
- package/dist/{chunk-QARJGQSA.js → chunk-HS7AVXTF.js} +3 -3
- package/dist/{chunk-QARJGQSA.js.map → chunk-HS7AVXTF.js.map} +1 -1
- package/dist/{chunk-4I55V454.cjs → chunk-I6HGWHPU.cjs} +4 -4
- package/dist/{chunk-4I55V454.cjs.map → chunk-I6HGWHPU.cjs.map} +1 -1
- package/dist/{chunk-T73NA43R.js → chunk-IPYYKCRC.js} +3 -3
- package/dist/{chunk-T73NA43R.js.map → chunk-IPYYKCRC.js.map} +1 -1
- package/dist/{chunk-UUP3MUZ6.cjs → chunk-ITYQ6VBP.cjs} +18 -18
- package/dist/{chunk-UUP3MUZ6.cjs.map → chunk-ITYQ6VBP.cjs.map} +1 -1
- package/dist/chunk-JPBKYL3B.cjs +18 -0
- package/dist/{chunk-6HTXPPHK.cjs.map → chunk-JPBKYL3B.cjs.map} +1 -1
- package/dist/{chunk-MZ2FGBLZ.js → chunk-K5OJUYSZ.js} +4 -4
- package/dist/{chunk-MZ2FGBLZ.js.map → chunk-K5OJUYSZ.js.map} +1 -1
- package/dist/{chunk-CHKH5452.js → chunk-KIH6IZ43.js} +60 -45
- package/dist/chunk-KIH6IZ43.js.map +1 -0
- package/dist/{chunk-EI2Q7SJ5.cjs → chunk-KQ7TS7WW.cjs} +10 -10
- package/dist/{chunk-EI2Q7SJ5.cjs.map → chunk-KQ7TS7WW.cjs.map} +1 -1
- package/dist/{chunk-RUDY2GTT.js → chunk-KQRW2GPZ.js} +5 -5
- package/dist/{chunk-RUDY2GTT.js.map → chunk-KQRW2GPZ.js.map} +1 -1
- package/dist/{chunk-P5LCASTC.cjs → chunk-KYAJINUI.cjs} +125 -125
- package/dist/{chunk-P5LCASTC.cjs.map → chunk-KYAJINUI.cjs.map} +1 -1
- package/dist/{chunk-AMFXSENK.js → chunk-LWGSI6M3.js} +4 -4
- package/dist/{chunk-AMFXSENK.js.map → chunk-LWGSI6M3.js.map} +1 -1
- package/dist/{chunk-ZHPWGIUX.js → chunk-LXI4XZEC.js} +5 -5
- package/dist/{chunk-ZHPWGIUX.js.map → chunk-LXI4XZEC.js.map} +1 -1
- package/dist/{chunk-AG5JPQIY.js → chunk-LXQ6HKPS.js} +3 -3
- package/dist/{chunk-AG5JPQIY.js.map → chunk-LXQ6HKPS.js.map} +1 -1
- package/dist/{chunk-ROYPRJH4.cjs → chunk-LYRDF5TQ.cjs} +9 -9
- package/dist/{chunk-ROYPRJH4.cjs.map → chunk-LYRDF5TQ.cjs.map} +1 -1
- package/dist/{chunk-G24KZRSA.js → chunk-N2U4AZGB.js} +3 -3
- package/dist/{chunk-G24KZRSA.js.map → chunk-N2U4AZGB.js.map} +1 -1
- package/dist/{chunk-4ERPXIVB.js → chunk-O73J46PV.js} +5 -5
- package/dist/{chunk-4ERPXIVB.js.map → chunk-O73J46PV.js.map} +1 -1
- package/dist/{chunk-F3YZMOAU.cjs → chunk-O7DK5PBJ.cjs} +4 -4
- package/dist/{chunk-F3YZMOAU.cjs.map → chunk-O7DK5PBJ.cjs.map} +1 -1
- package/dist/{chunk-Z4BCLVTI.cjs → chunk-O7LZFG6O.cjs} +5 -5
- package/dist/{chunk-Z4BCLVTI.cjs.map → chunk-O7LZFG6O.cjs.map} +1 -1
- package/dist/{chunk-3YJNUKYN.cjs → chunk-OHLDPWTA.cjs} +15 -15
- package/dist/{chunk-3YJNUKYN.cjs.map → chunk-OHLDPWTA.cjs.map} +1 -1
- package/dist/{chunk-FUL2I7G5.js → chunk-OSEG74VJ.js} +8 -8
- package/dist/{chunk-FUL2I7G5.js.map → chunk-OSEG74VJ.js.map} +1 -1
- package/dist/{chunk-UCBJBJ27.js → chunk-PUAEFLYK.js} +4 -4
- package/dist/{chunk-UCBJBJ27.js.map → chunk-PUAEFLYK.js.map} +1 -1
- package/dist/{chunk-CASUEY42.cjs → chunk-Q7LPTOD6.cjs} +24 -24
- package/dist/{chunk-CASUEY42.cjs.map → chunk-Q7LPTOD6.cjs.map} +1 -1
- package/dist/{chunk-2C72DXQF.cjs → chunk-RFMBZPOW.cjs} +9 -9
- package/dist/{chunk-2C72DXQF.cjs.map → chunk-RFMBZPOW.cjs.map} +1 -1
- package/dist/{chunk-NLTVXLGT.js → chunk-RFXWMRFC.js} +3 -3
- package/dist/{chunk-NLTVXLGT.js.map → chunk-RFXWMRFC.js.map} +1 -1
- package/dist/{chunk-2DG7KW4L.cjs → chunk-RMWTPV3M.cjs} +8 -8
- package/dist/{chunk-2DG7KW4L.cjs.map → chunk-RMWTPV3M.cjs.map} +1 -1
- package/dist/{chunk-P6A3M6VD.cjs → chunk-SZVR77EJ.cjs} +10 -10
- package/dist/{chunk-P6A3M6VD.cjs.map → chunk-SZVR77EJ.cjs.map} +1 -1
- package/dist/{chunk-3E77SX4H.js → chunk-TAZVKYWJ.js} +3 -3
- package/dist/{chunk-3E77SX4H.js.map → chunk-TAZVKYWJ.js.map} +1 -1
- package/dist/{chunk-WKRSH2VR.js → chunk-U6IFHFWK.js} +3 -3
- package/dist/{chunk-WKRSH2VR.js.map → chunk-U6IFHFWK.js.map} +1 -1
- package/dist/{chunk-I6TGFUCO.cjs → chunk-UALX2J2Q.cjs} +4 -4
- package/dist/{chunk-I6TGFUCO.cjs.map → chunk-UALX2J2Q.cjs.map} +1 -1
- package/dist/{chunk-XN7NOENA.js → chunk-UBDMVMBZ.js} +5 -5
- package/dist/{chunk-XN7NOENA.js.map → chunk-UBDMVMBZ.js.map} +1 -1
- package/dist/{chunk-YTR3RBUZ.js → chunk-UEXIJTLC.js} +4 -4
- package/dist/{chunk-YTR3RBUZ.js.map → chunk-UEXIJTLC.js.map} +1 -1
- package/dist/{chunk-DQKERTND.cjs → chunk-UGT7GK7I.cjs} +11 -11
- package/dist/{chunk-DQKERTND.cjs.map → chunk-UGT7GK7I.cjs.map} +1 -1
- package/dist/{chunk-FKMUFNQE.js → chunk-UMP6OJIM.js} +4 -4
- package/dist/{chunk-FKMUFNQE.js.map → chunk-UMP6OJIM.js.map} +1 -1
- package/dist/{chunk-AEOZTXVW.js → chunk-UNYXQ4M5.js} +3 -3
- package/dist/{chunk-AEOZTXVW.js.map → chunk-UNYXQ4M5.js.map} +1 -1
- package/dist/{chunk-2BDH744Z.js → chunk-UTSRIDKZ.js} +3 -3
- package/dist/{chunk-2BDH744Z.js.map → chunk-UTSRIDKZ.js.map} +1 -1
- package/dist/{chunk-2ADR2GSO.cjs → chunk-UU36SHFY.cjs} +5 -5
- package/dist/{chunk-2ADR2GSO.cjs.map → chunk-UU36SHFY.cjs.map} +1 -1
- package/dist/{chunk-R3UPQFKK.cjs → chunk-V2BOS4WF.cjs} +9 -9
- package/dist/{chunk-R3UPQFKK.cjs.map → chunk-V2BOS4WF.cjs.map} +1 -1
- package/dist/{chunk-Q4CMI2LP.js → chunk-WLQNMXQE.js} +5 -5
- package/dist/{chunk-Q4CMI2LP.js.map → chunk-WLQNMXQE.js.map} +1 -1
- package/dist/{chunk-XWL6O3SW.cjs → chunk-WNO3C3N2.cjs} +4 -4
- package/dist/{chunk-XWL6O3SW.cjs.map → chunk-WNO3C3N2.cjs.map} +1 -1
- package/dist/{chunk-T7O6K6PX.js → chunk-XEQ3TM66.js} +18 -3
- package/dist/chunk-XEQ3TM66.js.map +1 -0
- package/dist/{chunk-BVZW2B5V.cjs → chunk-XJCXEKMD.cjs} +4 -4
- package/dist/{chunk-BVZW2B5V.cjs.map → chunk-XJCXEKMD.cjs.map} +1 -1
- package/dist/{chunk-JTB5Q42C.cjs → chunk-XL7Q7HB2.cjs} +4 -4
- package/dist/{chunk-JTB5Q42C.cjs.map → chunk-XL7Q7HB2.cjs.map} +1 -1
- package/dist/{chunk-LW7G5DYW.js → chunk-XO4SOZN6.js} +4 -4
- package/dist/{chunk-LW7G5DYW.js.map → chunk-XO4SOZN6.js.map} +1 -1
- package/dist/{chunk-CQGYNZ3K.cjs → chunk-XWTLIGO3.cjs} +4 -4
- package/dist/{chunk-CQGYNZ3K.cjs.map → chunk-XWTLIGO3.cjs.map} +1 -1
- package/dist/{chunk-6SBW4QR2.cjs → chunk-YML4ME27.cjs} +11 -11
- package/dist/{chunk-6SBW4QR2.cjs.map → chunk-YML4ME27.cjs.map} +1 -1
- package/dist/{chunk-P6H23T43.cjs → chunk-ZCIRZE37.cjs} +11 -11
- package/dist/{chunk-P6H23T43.cjs.map → chunk-ZCIRZE37.cjs.map} +1 -1
- package/dist/{chunk-QI7WE46I.cjs → chunk-ZLQSWSJ2.cjs} +11 -11
- package/dist/{chunk-QI7WE46I.cjs.map → chunk-ZLQSWSJ2.cjs.map} +1 -1
- package/dist/{chunk-NLXOGBRJ.cjs → chunk-ZMRD5DZQ.cjs} +338 -323
- package/dist/chunk-ZMRD5DZQ.cjs.map +1 -0
- package/dist/{chunk-ILCGLTSA.cjs → chunk-ZSWPZ23K.cjs} +4 -4
- package/dist/{chunk-ILCGLTSA.cjs.map → chunk-ZSWPZ23K.cjs.map} +1 -1
- package/dist/{chunk-IDCKSLYH.js → chunk-ZZMZWBR6.js} +3 -3
- package/dist/{chunk-IDCKSLYH.js.map → chunk-ZZMZWBR6.js.map} +1 -1
- package/dist/compact-session-QV57KR66.cjs +59 -0
- package/dist/{compact-session-GJXJD73F.cjs.map → compact-session-QV57KR66.cjs.map} +1 -1
- package/dist/compact-session-RIGOWC4Y.js +22 -0
- package/dist/{compact-session-TSMQOIHO.js.map → compact-session-RIGOWC4Y.js.map} +1 -1
- package/dist/compaction.cjs +17 -17
- package/dist/compaction.js +4 -4
- package/dist/concurrency.cjs +7 -7
- package/dist/concurrency.js +5 -5
- package/dist/context-AGQ3DIZU.cjs +24 -0
- package/dist/{context-LCKNH2XI.cjs.map → context-AGQ3DIZU.cjs.map} +1 -1
- package/dist/context-GQRFBCLP.js +7 -0
- package/dist/{context-MZSKGKYR.js.map → context-GQRFBCLP.js.map} +1 -1
- package/dist/cron.cjs +36 -36
- package/dist/cron.js +35 -35
- package/dist/errors.cjs +22 -22
- package/dist/errors.js +3 -3
- package/dist/eval.cjs +41 -41
- package/dist/eval.js +35 -35
- package/dist/{executor-ZERJ3DGN.cjs → executor-6CYCA7MI.cjs} +25 -25
- package/dist/{executor-ZERJ3DGN.cjs.map → executor-6CYCA7MI.cjs.map} +1 -1
- package/dist/{executor-BMEHFOXZ.js → executor-QSEC3MRH.js} +8 -8
- package/dist/{executor-BMEHFOXZ.js.map → executor-QSEC3MRH.js.map} +1 -1
- package/dist/filesystem/index.cjs +8 -8
- package/dist/filesystem/index.js +4 -4
- package/dist/fs-session-store-4PIHT5UX.cjs +20 -0
- package/dist/{fs-session-store-XZ7ZTB3A.cjs.map → fs-session-store-4PIHT5UX.cjs.map} +1 -1
- package/dist/fs-session-store-NM6YSTE2.js +11 -0
- package/dist/{fs-session-store-4BHGIWRE.js.map → fs-session-store-NM6YSTE2.js.map} +1 -1
- package/dist/generate-object-GUNAUVBX.js +8 -0
- package/dist/{generate-object-N5MDZUJI.js.map → generate-object-GUNAUVBX.js.map} +1 -1
- package/dist/generate-object-R7HTMW7F.cjs +21 -0
- package/dist/{generate-object-PGSP5U7N.cjs.map → generate-object-R7HTMW7F.cjs.map} +1 -1
- package/dist/index-manager-RBDHP3PM.js +17 -0
- package/dist/{index-manager-ACEQG3IJ.js.map → index-manager-RBDHP3PM.js.map} +1 -1
- package/dist/index-manager-UZBF22BJ.cjs +26 -0
- package/dist/{index-manager-6TEEIWM7.cjs.map → index-manager-UZBF22BJ.cjs.map} +1 -1
- package/dist/index.cjs +139 -139
- package/dist/index.js +50 -50
- package/dist/{inject-session-ZCQUB3IT.js → inject-session-DAR7OUCW.js} +8 -8
- package/dist/{inject-session-ZCQUB3IT.js.map → inject-session-DAR7OUCW.js.map} +1 -1
- package/dist/{inject-session-PPSO2IDD.cjs → inject-session-WQKMC3GR.cjs} +10 -10
- package/dist/{inject-session-PPSO2IDD.cjs.map → inject-session-WQKMC3GR.cjs.map} +1 -1
- package/dist/internal/memory/adapters/index.cjs +9 -9
- package/dist/internal/memory/adapters/index.js +8 -8
- package/dist/internal/memory/storage/index.cjs +39 -39
- package/dist/internal/memory/storage/index.js +10 -10
- package/dist/internal/persistence/index.cjs +21 -21
- package/dist/internal/persistence/index.js +7 -7
- package/dist/internal/security/index.cjs +14 -14
- package/dist/internal/security/index.js +4 -4
- package/dist/judge-call-LAHMBJ57.cjs +23 -0
- package/dist/{judge-call-EGYRC2RE.cjs.map → judge-call-LAHMBJ57.cjs.map} +1 -1
- package/dist/judge-call-LVXABPS3.js +6 -0
- package/dist/{judge-call-DWHAJATE.js.map → judge-call-LVXABPS3.js.map} +1 -1
- package/dist/mcp-auth.cjs +15 -15
- package/dist/mcp-auth.js +5 -5
- package/dist/models.cjs +22 -22
- package/dist/models.js +7 -7
- package/dist/path-safety.cjs +11 -11
- package/dist/path-safety.js +4 -4
- package/dist/persistence.cjs +28 -28
- package/dist/persistence.js +9 -9
- package/dist/project.cjs +6 -6
- package/dist/project.js +4 -4
- package/dist/providers.cjs +9 -9
- package/dist/providers.js +7 -7
- package/dist/registry-75W33OGL.js +10 -0
- package/dist/{registry-VFP3WWQP.js.map → registry-75W33OGL.js.map} +1 -1
- package/dist/registry-V7BDQ6QB.cjs +47 -0
- package/dist/{registry-VFKX7WOP.cjs.map → registry-V7BDQ6QB.cjs.map} +1 -1
- package/dist/retry.cjs +5 -5
- package/dist/retry.js +4 -4
- package/dist/sandbox/index.cjs +7 -7
- package/dist/sandbox/index.js +3 -3
- package/dist/server/errors-envelope.cjs +15 -15
- package/dist/server/errors-envelope.js +4 -4
- package/dist/session-transcript-6WNITKRE.cjs +63 -0
- package/dist/{session-transcript-HF5GEU5M.cjs.map → session-transcript-6WNITKRE.cjs.map} +1 -1
- package/dist/session-transcript-XAEKW6P7.js +6 -0
- package/dist/{session-transcript-P462ZRHX.js.map → session-transcript-XAEKW6P7.js.map} +1 -1
- package/dist/skills.cjs +8 -8
- package/dist/skills.js +6 -6
- package/dist/stream-object-UF4QRQRU.js +8 -0
- package/dist/{stream-object-L57K4OFS.js.map → stream-object-UF4QRQRU.js.map} +1 -1
- package/dist/stream-object-ZJTQNKY3.cjs +21 -0
- package/dist/{stream-object-BUCF5PHO.cjs.map → stream-object-ZJTQNKY3.cjs.map} +1 -1
- package/dist/subagents-loader-CRT5LLL3.js +8 -0
- package/dist/{subagents-loader-6ATCDEKN.js.map → subagents-loader-CRT5LLL3.js.map} +1 -1
- package/dist/subagents-loader-YEUFFPAL.cjs +17 -0
- package/dist/{subagents-loader-X5QKODCL.cjs.map → subagents-loader-YEUFFPAL.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +7 -7
- package/dist/subagents-loader.js +5 -5
- package/dist/subscription/index.cjs +4 -4
- package/dist/subscription/index.js +3 -3
- package/dist/task-store.cjs +8 -8
- package/dist/task-store.js +5 -5
- package/dist/workflow.cjs +28 -28
- package/dist/workflow.js +7 -7
- package/package.json +1 -1
- package/dist/agent-536OOESZ.js +0 -57
- package/dist/agent-5KYMG63I.cjs +0 -66
- package/dist/agent-session-store-G2BMUZQV.js +0 -7
- package/dist/agent-session-store-WAKLOKWK.cjs +0 -24
- package/dist/chunk-6HTXPPHK.cjs +0 -18
- package/dist/chunk-CHKH5452.js.map +0 -1
- package/dist/chunk-NLXOGBRJ.cjs.map +0 -1
- package/dist/chunk-NUKRL3I6.cjs.map +0 -1
- package/dist/chunk-T7O6K6PX.js.map +0 -1
- package/dist/compact-session-GJXJD73F.cjs +0 -59
- package/dist/compact-session-TSMQOIHO.js +0 -22
- package/dist/context-LCKNH2XI.cjs +0 -24
- package/dist/context-MZSKGKYR.js +0 -7
- package/dist/fs-session-store-4BHGIWRE.js +0 -11
- package/dist/fs-session-store-XZ7ZTB3A.cjs +0 -20
- package/dist/generate-object-N5MDZUJI.js +0 -8
- package/dist/generate-object-PGSP5U7N.cjs +0 -21
- package/dist/index-manager-6TEEIWM7.cjs +0 -26
- package/dist/index-manager-ACEQG3IJ.js +0 -17
- package/dist/judge-call-DWHAJATE.js +0 -6
- package/dist/judge-call-EGYRC2RE.cjs +0 -23
- package/dist/registry-VFKX7WOP.cjs +0 -47
- package/dist/registry-VFP3WWQP.js +0 -10
- package/dist/session-transcript-HF5GEU5M.cjs +0 -63
- package/dist/session-transcript-P462ZRHX.js +0 -6
- package/dist/stream-object-BUCF5PHO.cjs +0 -21
- package/dist/stream-object-L57K4OFS.js +0 -8
- package/dist/subagents-loader-6ATCDEKN.js +0 -8
- package/dist/subagents-loader-X5QKODCL.cjs +0 -17
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunk3FFAEAUJ_cjs = require('./chunk-3FFAEAUJ.cjs');
|
|
4
|
+
var chunkRMWTPV3M_cjs = require('./chunk-RMWTPV3M.cjs');
|
|
5
|
+
var chunkITYQ6VBP_cjs = require('./chunk-ITYQ6VBP.cjs');
|
|
6
|
+
var chunkZCIRZE37_cjs = require('./chunk-ZCIRZE37.cjs');
|
|
7
7
|
var chunkBV2MWEMV_cjs = require('./chunk-BV2MWEMV.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
8
|
+
var chunkKQ7TS7WW_cjs = require('./chunk-KQ7TS7WW.cjs');
|
|
9
|
+
var chunkGKEFRLU7_cjs = require('./chunk-GKEFRLU7.cjs');
|
|
10
|
+
var chunk6RKUO7AW_cjs = require('./chunk-6RKUO7AW.cjs');
|
|
11
|
+
var chunkZLQSWSJ2_cjs = require('./chunk-ZLQSWSJ2.cjs');
|
|
12
|
+
var chunkKYAJINUI_cjs = require('./chunk-KYAJINUI.cjs');
|
|
13
13
|
var chunk2ZPEDVLM_cjs = require('./chunk-2ZPEDVLM.cjs');
|
|
14
14
|
var chunk7BG5UH3T_cjs = require('./chunk-7BG5UH3T.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunk2HVF2WJY_cjs = require('./chunk-2HVF2WJY.cjs');
|
|
16
16
|
var chunkWJVHMTKB_cjs = require('./chunk-WJVHMTKB.cjs');
|
|
17
17
|
var chunk6JSIEDKL_cjs = require('./chunk-6JSIEDKL.cjs');
|
|
18
18
|
var chunk4O5TGQBW_cjs = require('./chunk-4O5TGQBW.cjs');
|
|
19
19
|
var chunkNINIJCHU_cjs = require('./chunk-NINIJCHU.cjs');
|
|
20
|
-
var
|
|
20
|
+
var chunkOHLDPWTA_cjs = require('./chunk-OHLDPWTA.cjs');
|
|
21
21
|
var chunkVJ26EKGJ_cjs = require('./chunk-VJ26EKGJ.cjs');
|
|
22
|
-
var
|
|
22
|
+
var chunkV2BOS4WF_cjs = require('./chunk-V2BOS4WF.cjs');
|
|
23
23
|
var chunkVKJ7V7EB_cjs = require('./chunk-VKJ7V7EB.cjs');
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var chunkZSWPZ23K_cjs = require('./chunk-ZSWPZ23K.cjs');
|
|
25
|
+
var chunk5HEG4CQH_cjs = require('./chunk-5HEG4CQH.cjs');
|
|
26
|
+
var chunkUU36SHFY_cjs = require('./chunk-UU36SHFY.cjs');
|
|
27
27
|
var chunkZF2LDKQQ_cjs = require('./chunk-ZF2LDKQQ.cjs');
|
|
28
|
-
var
|
|
29
|
-
var
|
|
28
|
+
var chunkUALX2J2Q_cjs = require('./chunk-UALX2J2Q.cjs');
|
|
29
|
+
var chunkCQBXOJ6U_cjs = require('./chunk-CQBXOJ6U.cjs');
|
|
30
30
|
var chunkAQO3NSRG_cjs = require('./chunk-AQO3NSRG.cjs');
|
|
31
|
-
var
|
|
32
|
-
var
|
|
31
|
+
var chunk4CLOXP6H_cjs = require('./chunk-4CLOXP6H.cjs');
|
|
32
|
+
var chunkDXGZ2NUG_cjs = require('./chunk-DXGZ2NUG.cjs');
|
|
33
33
|
var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
34
|
+
var chunkJPBKYL3B_cjs = require('./chunk-JPBKYL3B.cjs');
|
|
35
|
+
var chunkHCZD23VS_cjs = require('./chunk-HCZD23VS.cjs');
|
|
36
|
+
var chunk4ZHTIJNE_cjs = require('./chunk-4ZHTIJNE.cjs');
|
|
37
|
+
var chunkXL7Q7HB2_cjs = require('./chunk-XL7Q7HB2.cjs');
|
|
38
|
+
var chunkEG4QM7ZJ_cjs = require('./chunk-EG4QM7ZJ.cjs');
|
|
39
39
|
var promises = require('fs/promises');
|
|
40
40
|
var crypto = require('crypto');
|
|
41
41
|
var path = require('path');
|
|
@@ -231,7 +231,7 @@ async function agentGenerate(agent, agentModel, agentApiKey, agentLocal, input,
|
|
|
231
231
|
const { output, maxRetries, errorStrategy, ...sendOptions } = options;
|
|
232
232
|
const run = await agent.send(input, sendOptions);
|
|
233
233
|
const result = await run.wait();
|
|
234
|
-
const { generateObjectImpl, GenerateObjectError } = await import('./generate-object-
|
|
234
|
+
const { generateObjectImpl, GenerateObjectError } = await import('./generate-object-R7HTMW7F.cjs');
|
|
235
235
|
const answer = structurableAnswerOrThrow(result, GenerateObjectError);
|
|
236
236
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
237
237
|
const facade = getAgentFacade();
|
|
@@ -320,7 +320,7 @@ function normalizeModel(m) {
|
|
|
320
320
|
if (m === void 0 || typeof m !== "string") return m;
|
|
321
321
|
const id = m.trim();
|
|
322
322
|
if (id.length === 0) {
|
|
323
|
-
throw new
|
|
323
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
324
324
|
'model must be a non-empty "provider/model" id string or a ModelSelection object',
|
|
325
325
|
{ code: "invalid_model_selection" }
|
|
326
326
|
);
|
|
@@ -456,7 +456,7 @@ function registryPath(cwd) {
|
|
|
456
456
|
return path.join(cwd, REGISTRY_RELATIVE_PATH);
|
|
457
457
|
}
|
|
458
458
|
async function loadRegistry(cwd) {
|
|
459
|
-
return
|
|
459
|
+
return chunk2HVF2WJY_cjs.readVersionedJson({
|
|
460
460
|
path: registryPath(cwd),
|
|
461
461
|
currentVersion: SCHEMA_VERSION,
|
|
462
462
|
defaultValue: () => ({}),
|
|
@@ -480,7 +480,7 @@ async function saveRegistry(cwd, agents2) {
|
|
|
480
480
|
}
|
|
481
481
|
const path = registryPath(cwd);
|
|
482
482
|
await chunkZF2LDKQQ_cjs.withCwdMutex(`registry:${cwd}`, async () => {
|
|
483
|
-
await
|
|
483
|
+
await chunk2HVF2WJY_cjs.writeVersionedJson(path, serialized, SCHEMA_VERSION);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
function toSerialized(agent) {
|
|
@@ -547,7 +547,7 @@ function scheduleSaveForCwd(cwd) {
|
|
|
547
547
|
}
|
|
548
548
|
} catch (cause) {
|
|
549
549
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
550
|
-
|
|
550
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] registry persist failed (${cwd}): ${msg}
|
|
551
551
|
`);
|
|
552
552
|
} finally {
|
|
553
553
|
pendingSaves.delete(cwd);
|
|
@@ -887,14 +887,14 @@ async function readLegacyFacts(jsonPath) {
|
|
|
887
887
|
}
|
|
888
888
|
async function writeMigratedFacts(cwd, jsonPath, facts) {
|
|
889
889
|
try {
|
|
890
|
-
for (const fact of facts) await
|
|
890
|
+
for (const fact of facts) await chunk6RKUO7AW_cjs.appendFactToMarkdown(cwd, fact);
|
|
891
891
|
await promises.unlink(jsonPath).catch(() => void 0);
|
|
892
|
-
|
|
892
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] migrated ${facts.length} fact(s) from ${jsonPath} to MEMORY.md
|
|
893
893
|
`);
|
|
894
894
|
return { migrated: true, factCount: facts.length };
|
|
895
895
|
} catch (cause) {
|
|
896
896
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
897
|
-
|
|
897
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] memory migration failed (readonly fs?): ${message}
|
|
898
898
|
`);
|
|
899
899
|
return { migrated: false, factCount: 0, reason: "readonly-fs" };
|
|
900
900
|
}
|
|
@@ -904,12 +904,12 @@ async function migrateLegacyJson(cwd, config) {
|
|
|
904
904
|
const key = `${cwd}::${config.namespace ?? "default"}::${config.scope ?? "agent"}::${config.userId ?? "default"}`;
|
|
905
905
|
if (migrationRun.has(key)) return { migrated: false, factCount: 0, reason: "already-migrated" };
|
|
906
906
|
migrationRun.add(key);
|
|
907
|
-
const jsonPath =
|
|
907
|
+
const jsonPath = chunk6RKUO7AW_cjs.legacyMemoryJsonPath(cwd, config);
|
|
908
908
|
if (!await fileExists(jsonPath)) {
|
|
909
909
|
return { migrated: false, factCount: 0, reason: "no-legacy-json" };
|
|
910
910
|
}
|
|
911
|
-
if (await fileExists(
|
|
912
|
-
|
|
911
|
+
if (await fileExists(chunk6RKUO7AW_cjs.memoryMdPath(chunk6RKUO7AW_cjs.resolveMemoryRoot(cwd, config)))) {
|
|
912
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
913
913
|
`[theokit-sdk] memory migration skipped: both MEMORY.md and legacy JSON exist at ${jsonPath}; leaving both intact
|
|
914
914
|
`
|
|
915
915
|
);
|
|
@@ -930,26 +930,35 @@ function extractMemoryFact(message) {
|
|
|
930
930
|
if (match === null || match[2] === void 0) return "";
|
|
931
931
|
return match[2].trim().replace(/\.$/, "");
|
|
932
932
|
}
|
|
933
|
+
var LOOKS_LIKE_A_CAPTURE = /^\s*(?:please\s+|can\s+you\s+|could\s+you\s+)?remember\b/i;
|
|
934
|
+
var QUOTED_MESSAGE_MAX = 120;
|
|
935
|
+
function unstoredRememberWarning(message) {
|
|
936
|
+
if (!LOOKS_LIKE_A_CAPTURE.test(message)) return void 0;
|
|
937
|
+
if (isMemoryWritePrompt(message) && extractMemoryFact(message).length > 0) return void 0;
|
|
938
|
+
const trimmed = message.trim();
|
|
939
|
+
const quoted = trimmed.length > QUOTED_MESSAGE_MAX ? `${trimmed.slice(0, QUOTED_MESSAGE_MAX)}\u2026` : trimmed;
|
|
940
|
+
return `[theokit-sdk] NOTHING WAS STORED \u2014 this message does not match the memory capture pattern: ${JSON.stringify(quoted)}. Supported: "Remember: <fact>" or "Remember (${chunk6RKUO7AW_cjs.MEMORY_KINDS.join("|")}): <fact>". It still reaches the session transcript, so a follow-up may answer from it \u2014 that is search over transcripts, not a durable memory.`;
|
|
941
|
+
}
|
|
933
942
|
function extractMemoryKind(message) {
|
|
934
943
|
const match = REMEMBER_PATTERN.exec(message);
|
|
935
944
|
const declared = match?.[1];
|
|
936
945
|
if (declared === void 0) return void 0;
|
|
937
946
|
const lowered = declared.toLowerCase();
|
|
938
|
-
return
|
|
947
|
+
return chunk6RKUO7AW_cjs.MEMORY_KINDS.includes(lowered) ? lowered : void 0;
|
|
939
948
|
}
|
|
940
949
|
async function readMemoryFacts(cwd, config) {
|
|
941
950
|
if (!config.enabled) return [];
|
|
942
951
|
await migrateLegacyJson(cwd, config);
|
|
943
|
-
return
|
|
952
|
+
return chunk6RKUO7AW_cjs.readFacts(cwd, config);
|
|
944
953
|
}
|
|
945
954
|
async function appendMemoryFact(cwd, config, fact) {
|
|
946
955
|
if (!config.enabled) return;
|
|
947
956
|
await migrateLegacyJson(cwd, config);
|
|
948
957
|
const sanitized = {
|
|
949
|
-
text:
|
|
958
|
+
text: chunkXL7Q7HB2_cjs.redactSecrets(fact.text),
|
|
950
959
|
...fact.kind === void 0 ? {} : { kind: fact.kind }
|
|
951
960
|
};
|
|
952
|
-
await
|
|
961
|
+
await chunk6RKUO7AW_cjs.appendFact(cwd, config, sanitized);
|
|
953
962
|
}
|
|
954
963
|
|
|
955
964
|
// src/internal/runtime/fixtures/fixture-scripts.ts
|
|
@@ -1297,7 +1306,7 @@ function redactScriptSecrets(script) {
|
|
|
1297
1306
|
function redactEventSecrets(event) {
|
|
1298
1307
|
const serialized = JSON.stringify(event);
|
|
1299
1308
|
const localStripped = serialized.replace(FIXTURE_SENTINEL, "***");
|
|
1300
|
-
const redacted =
|
|
1309
|
+
const redacted = chunkXL7Q7HB2_cjs.redactSecrets(localStripped);
|
|
1301
1310
|
if (redacted === serialized) return event;
|
|
1302
1311
|
return JSON.parse(redacted);
|
|
1303
1312
|
}
|
|
@@ -1619,8 +1628,8 @@ function createRealCloudRun(options) {
|
|
|
1619
1628
|
cancellable: false,
|
|
1620
1629
|
conversation: []
|
|
1621
1630
|
};
|
|
1622
|
-
const apiKey =
|
|
1623
|
-
const baseUrl =
|
|
1631
|
+
const apiKey = chunkXL7Q7HB2_cjs.resolveApiKey(options.agentOptions.apiKey);
|
|
1632
|
+
const baseUrl = chunkKYAJINUI_cjs.getConfiguredBaseUrl();
|
|
1624
1633
|
const handle = new RealCloudRun(
|
|
1625
1634
|
{
|
|
1626
1635
|
id,
|
|
@@ -1693,7 +1702,7 @@ var RealCloudRun = class extends FixtureRunBase {
|
|
|
1693
1702
|
});
|
|
1694
1703
|
if (!response.ok) {
|
|
1695
1704
|
const text = await response.text().catch(() => "");
|
|
1696
|
-
throw new
|
|
1705
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(
|
|
1697
1706
|
`Cloud Run endpoint returned ${response.status}: ${text.slice(0, 200)}`,
|
|
1698
1707
|
{ code: "cloud_run_http_error" }
|
|
1699
1708
|
);
|
|
@@ -1703,7 +1712,7 @@ var RealCloudRun = class extends FixtureRunBase {
|
|
|
1703
1712
|
async consumeStream(response) {
|
|
1704
1713
|
let finalStatus = "finished";
|
|
1705
1714
|
let finalText = "";
|
|
1706
|
-
for await (const record of
|
|
1715
|
+
for await (const record of chunkKYAJINUI_cjs.parseSseStream(response.body, this.controller.signal)) {
|
|
1707
1716
|
const parsed = safeParse(record.data);
|
|
1708
1717
|
if (parsed === void 0) continue;
|
|
1709
1718
|
const update = this.applyRecord(record.event, parsed);
|
|
@@ -1783,7 +1792,7 @@ function toWireStatus(token) {
|
|
|
1783
1792
|
const match = WIRE_STATUSES.find((candidate) => candidate === upper);
|
|
1784
1793
|
if (match !== void 0) return match;
|
|
1785
1794
|
}
|
|
1786
|
-
throw new
|
|
1795
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(
|
|
1787
1796
|
`Cloud Run stream reported an unrecognised status ${JSON.stringify(token)}; expected one of ${WIRE_STATUSES.join(", ")} (case-insensitive)`,
|
|
1788
1797
|
{ code: "cloud_run_unknown_status" }
|
|
1789
1798
|
);
|
|
@@ -1793,7 +1802,7 @@ function toRunStatus(token) {
|
|
|
1793
1802
|
const mapped = SERVER_STATUS_TO_RUN_STATUS[token.toLowerCase()];
|
|
1794
1803
|
if (mapped !== void 0) return mapped;
|
|
1795
1804
|
}
|
|
1796
|
-
throw new
|
|
1805
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(
|
|
1797
1806
|
`Cloud Run stream reported an unrecognised status ${JSON.stringify(token)}; expected one of ${Object.keys(SERVER_STATUS_TO_RUN_STATUS).join(", ")} (case-insensitive)`,
|
|
1798
1807
|
{ code: "cloud_run_unknown_status" }
|
|
1799
1808
|
);
|
|
@@ -1848,8 +1857,8 @@ var CloudAgent = class {
|
|
|
1848
1857
|
* cloud operations are pre-release and must surface explicit errors.
|
|
1849
1858
|
*/
|
|
1850
1859
|
isFixtureMode() {
|
|
1851
|
-
const apiKey =
|
|
1852
|
-
return
|
|
1860
|
+
const apiKey = chunkXL7Q7HB2_cjs.resolveApiKey(this.options.apiKey);
|
|
1861
|
+
return chunkKYAJINUI_cjs.isFixtureApiKey(apiKey) && chunkKYAJINUI_cjs.getConfiguredBaseUrl() === void 0;
|
|
1853
1862
|
}
|
|
1854
1863
|
// SE9 — integrated structured output; delegates to the shared helper.
|
|
1855
1864
|
generate(message, options) {
|
|
@@ -1863,9 +1872,9 @@ var CloudAgent = class {
|
|
|
1863
1872
|
);
|
|
1864
1873
|
}
|
|
1865
1874
|
async send(message, options = {}) {
|
|
1866
|
-
if (this.disposed) throw new
|
|
1875
|
+
if (this.disposed) throw new chunk4ZHTIJNE_cjs.AgentDisposedError(this.agentId);
|
|
1867
1876
|
if (options.tools !== void 0 && options.tools.length > 0) {
|
|
1868
|
-
throw new
|
|
1877
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
1869
1878
|
"Custom inline tools are local-only in SDK v1.0 \u2014 cloud agents cannot serialize handler functions",
|
|
1870
1879
|
{ code: "cloud_custom_tools_rejected" }
|
|
1871
1880
|
);
|
|
@@ -1900,8 +1909,8 @@ var CloudAgent = class {
|
|
|
1900
1909
|
}
|
|
1901
1910
|
const userText = typeof message === "string" ? message : message.text;
|
|
1902
1911
|
const systemPrompt = await this.resolveSystemPromptForSend(userText, options);
|
|
1903
|
-
const apiKey =
|
|
1904
|
-
const useRealRuntime = apiKey !== void 0 && !
|
|
1912
|
+
const apiKey = chunkXL7Q7HB2_cjs.resolveApiKey(this.options.apiKey);
|
|
1913
|
+
const useRealRuntime = apiKey !== void 0 && !chunkKYAJINUI_cjs.isFixtureApiKey(apiKey) && chunkKYAJINUI_cjs.getConfiguredBaseUrl() !== void 0;
|
|
1905
1914
|
return useRealRuntime ? createRealCloudRun({
|
|
1906
1915
|
agentId: this.agentId,
|
|
1907
1916
|
model: this.model ?? { id: DEFAULT_AGENTIC_MODEL_ID },
|
|
@@ -1950,7 +1959,7 @@ var CloudAgent = class {
|
|
|
1950
1959
|
listArtifacts() {
|
|
1951
1960
|
if (!this.isFixtureMode()) {
|
|
1952
1961
|
return Promise.reject(
|
|
1953
|
-
new
|
|
1962
|
+
new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
1954
1963
|
"Cloud runtime is pre-release. listArtifacts() will return real artifacts when Theo PaaS ships; today it is only available in fixture mode (theo_test_* keys).",
|
|
1955
1964
|
{ code: "cloud_runtime_pre_release" }
|
|
1956
1965
|
)
|
|
@@ -1960,11 +1969,11 @@ var CloudAgent = class {
|
|
|
1960
1969
|
}
|
|
1961
1970
|
downloadArtifact(path) {
|
|
1962
1971
|
try {
|
|
1963
|
-
|
|
1972
|
+
chunkV2BOS4WF_cjs.validateArtifactPath(path);
|
|
1964
1973
|
} catch (cause) {
|
|
1965
|
-
if (cause instanceof
|
|
1974
|
+
if (cause instanceof chunkV2BOS4WF_cjs.PathTraversalError) {
|
|
1966
1975
|
return Promise.reject(
|
|
1967
|
-
new
|
|
1976
|
+
new chunk4ZHTIJNE_cjs.ConfigurationError(`Artifact path must stay inside the workspace: ${path}`, {
|
|
1968
1977
|
code: "artifact_path_traversal",
|
|
1969
1978
|
cause
|
|
1970
1979
|
})
|
|
@@ -1974,7 +1983,7 @@ var CloudAgent = class {
|
|
|
1974
1983
|
}
|
|
1975
1984
|
if (!this.isFixtureMode()) {
|
|
1976
1985
|
return Promise.reject(
|
|
1977
|
-
new
|
|
1986
|
+
new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
1978
1987
|
"Cloud runtime is pre-release. downloadArtifact() will fetch real PaaS artifacts when the cloud runtime ships; today it is only available in fixture mode (theo_test_* keys).",
|
|
1979
1988
|
{ code: "cloud_runtime_pre_release" }
|
|
1980
1989
|
)
|
|
@@ -1983,7 +1992,7 @@ var CloudAgent = class {
|
|
|
1983
1992
|
const match = buildFixtureArtifacts().find((artifact) => artifact.path === path);
|
|
1984
1993
|
if (match === void 0) {
|
|
1985
1994
|
return Promise.reject(
|
|
1986
|
-
new
|
|
1995
|
+
new chunk4ZHTIJNE_cjs.UnknownAgentError(`Artifact ${path} not found`, { code: "unknown_artifact" })
|
|
1987
1996
|
);
|
|
1988
1997
|
}
|
|
1989
1998
|
return Promise.resolve(Buffer.from(`fixture artifact content for ${path}
|
|
@@ -1997,7 +2006,7 @@ var CloudAgent = class {
|
|
|
1997
2006
|
* @public
|
|
1998
2007
|
*/
|
|
1999
2008
|
runUntil() {
|
|
2000
|
-
throw new
|
|
2009
|
+
throw new chunk4ZHTIJNE_cjs.UnsupportedRunOperationError(
|
|
2001
2010
|
"Agent.runUntil() is not supported on cloud agents. Cloud runtime manages goal loops server-side. Use a local agent for autonomous Ralph loops.",
|
|
2002
2011
|
"runUntil"
|
|
2003
2012
|
);
|
|
@@ -2008,7 +2017,7 @@ var CloudAgent = class {
|
|
|
2008
2017
|
* @public
|
|
2009
2018
|
*/
|
|
2010
2019
|
fork() {
|
|
2011
|
-
throw new
|
|
2020
|
+
throw new chunk4ZHTIJNE_cjs.UnsupportedRunOperationError(
|
|
2012
2021
|
"Agent.fork() is not supported on cloud agents. Fork inheritance requires local credential + system-prompt access. Use a local agent.",
|
|
2013
2022
|
"fork"
|
|
2014
2023
|
);
|
|
@@ -2020,7 +2029,7 @@ var CloudAgent = class {
|
|
|
2020
2029
|
* @public
|
|
2021
2030
|
*/
|
|
2022
2031
|
runToCompletion() {
|
|
2023
|
-
throw new
|
|
2032
|
+
throw new chunk4ZHTIJNE_cjs.UnsupportedRunOperationError(
|
|
2024
2033
|
"Agent.runToCompletion() is not supported on cloud agents. Cloud runtime manages continuation server-side. Use a local agent.",
|
|
2025
2034
|
"runToCompletion"
|
|
2026
2035
|
);
|
|
@@ -2032,7 +2041,7 @@ var CloudAgent = class {
|
|
|
2032
2041
|
* @public
|
|
2033
2042
|
*/
|
|
2034
2043
|
streamToCompletion() {
|
|
2035
|
-
throw new
|
|
2044
|
+
throw new chunk4ZHTIJNE_cjs.UnsupportedRunOperationError(
|
|
2036
2045
|
"Agent.streamToCompletion() is not supported on cloud agents. Cloud runtime manages continuation server-side. Use a local agent.",
|
|
2037
2046
|
"streamToCompletion"
|
|
2038
2047
|
);
|
|
@@ -2046,7 +2055,7 @@ var CloudAgent = class {
|
|
|
2046
2055
|
*/
|
|
2047
2056
|
usePersonality() {
|
|
2048
2057
|
return Promise.reject(
|
|
2049
|
-
new
|
|
2058
|
+
new chunk4ZHTIJNE_cjs.UnsupportedRunOperationError(
|
|
2050
2059
|
"Agent.usePersonality() is not supported on cloud agents (pre-release). Use a local agent or wait for cloud GA.",
|
|
2051
2060
|
"usePersonality"
|
|
2052
2061
|
)
|
|
@@ -2074,7 +2083,7 @@ function validateCloudToolParity(options) {
|
|
|
2074
2083
|
function rejectProcessors(options) {
|
|
2075
2084
|
const hasProcessors = (options.inputProcessors?.length ?? 0) > 0 || (options.outputProcessors?.length ?? 0) > 0;
|
|
2076
2085
|
if (hasProcessors) {
|
|
2077
|
-
throw new
|
|
2086
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2078
2087
|
"Cloud agents can't run guardrail processors \u2014 a Processor carries function handlers that don't survive serialization to PaaS. Run processors on a local agent, or move the guardrail into a server-side gateway in front of TheoCloud.",
|
|
2079
2088
|
{ code: "cloud_incompatible_function_resolver" }
|
|
2080
2089
|
);
|
|
@@ -2082,7 +2091,7 @@ function rejectProcessors(options) {
|
|
|
2082
2091
|
}
|
|
2083
2092
|
function rejectFunctionSystemPrompt(options) {
|
|
2084
2093
|
if (typeof options.systemPrompt === "function") {
|
|
2085
|
-
throw new
|
|
2094
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2086
2095
|
"Cloud agents require systemPrompt as a serializable string. SystemPromptResolver functions can't run on PaaS \u2014 resolve to a string before Agent.create() or move the dynamic logic into a hook rule.",
|
|
2087
2096
|
{ code: "cloud_incompatible_function_resolver" }
|
|
2088
2097
|
);
|
|
@@ -2090,7 +2099,7 @@ function rejectFunctionSystemPrompt(options) {
|
|
|
2090
2099
|
}
|
|
2091
2100
|
function rejectFunctionSkills(options) {
|
|
2092
2101
|
if (typeof options.skills === "function") {
|
|
2093
|
-
throw new
|
|
2102
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2094
2103
|
"Cloud agents require skills as a static settings object. SkillsResolver functions can't run on PaaS \u2014 resolve to a SkillsSettings object before Agent.create() or move the dynamic logic into a hook rule.",
|
|
2095
2104
|
{ code: "cloud_incompatible_function_resolver" }
|
|
2096
2105
|
);
|
|
@@ -2102,7 +2111,7 @@ function rejectStdioMcpLocalPaths(options) {
|
|
|
2102
2111
|
if (!isStdioCommandConfig(config)) continue;
|
|
2103
2112
|
const command = config.command ?? "";
|
|
2104
2113
|
if (isLocalPath(command)) {
|
|
2105
|
-
throw new
|
|
2114
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2106
2115
|
`MCP server "${name}" uses a local-FS command path (${command}). Cloud agents can't reach local binaries \u2014 use a bare command (npx, uvx, node, \u2026) that the PaaS VM image provides, or switch to an HTTP MCP server.`,
|
|
2107
2116
|
{ code: "cloud_incompatible_mcp_stdio_local" }
|
|
2108
2117
|
);
|
|
@@ -2122,19 +2131,19 @@ function isLocalPath(command) {
|
|
|
2122
2131
|
function resolveSessionDir(local) {
|
|
2123
2132
|
if (local?.sessionDir !== void 0) {
|
|
2124
2133
|
if (local.baseDir !== void 0) {
|
|
2125
|
-
|
|
2134
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2126
2135
|
"[theokit-sdk] local.sessionDir and local.baseDir are both set; using sessionDir. baseDir is the deprecated name for the same option (#301)."
|
|
2127
2136
|
);
|
|
2128
2137
|
}
|
|
2129
|
-
return
|
|
2138
|
+
return chunk5HEG4CQH_cjs.expandTilde(local.sessionDir);
|
|
2130
2139
|
}
|
|
2131
2140
|
if (local?.baseDir !== void 0) {
|
|
2132
|
-
|
|
2141
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2133
2142
|
"[theokit-sdk] local.baseDir is deprecated; rename it to local.sessionDir (#301). It is the directory for session transcripts, not the working directory \u2014 that is local.cwd."
|
|
2134
2143
|
);
|
|
2135
|
-
return
|
|
2144
|
+
return chunk5HEG4CQH_cjs.expandTilde(local.baseDir);
|
|
2136
2145
|
}
|
|
2137
|
-
return
|
|
2146
|
+
return chunk5HEG4CQH_cjs.defaultBaseDir();
|
|
2138
2147
|
}
|
|
2139
2148
|
var SCHEMA_VERSION2 = 1;
|
|
2140
2149
|
var FILE_NAME = "personality.json";
|
|
@@ -2161,14 +2170,14 @@ async function readState(filePath) {
|
|
|
2161
2170
|
try {
|
|
2162
2171
|
parsed = JSON.parse(raw);
|
|
2163
2172
|
} catch {
|
|
2164
|
-
|
|
2173
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
2165
2174
|
"personality-store-json-parse",
|
|
2166
2175
|
"[theokit-sdk] personality.json is malformed; treating as empty"
|
|
2167
2176
|
);
|
|
2168
2177
|
return emptyState();
|
|
2169
2178
|
}
|
|
2170
2179
|
if (!isStateV1(parsed)) {
|
|
2171
|
-
|
|
2180
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
2172
2181
|
"personality-store-bad-version",
|
|
2173
2182
|
`[theokit-sdk] personality.json has unknown version; treating as empty (file kept untouched)`
|
|
2174
2183
|
);
|
|
@@ -2199,9 +2208,9 @@ var PersonalityStore = class {
|
|
|
2199
2208
|
try {
|
|
2200
2209
|
await this.#persist(agentId, slug);
|
|
2201
2210
|
} catch (err) {
|
|
2202
|
-
|
|
2211
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
2203
2212
|
`personality-store-persist-failure-${agentId}`,
|
|
2204
|
-
`[theokit-sdk] personality persist failed for ${
|
|
2213
|
+
`[theokit-sdk] personality persist failed for ${chunkXL7Q7HB2_cjs.redactSecrets(agentId)}: ${chunkXL7Q7HB2_cjs.redactSecrets(
|
|
2205
2214
|
err.message
|
|
2206
2215
|
)}`
|
|
2207
2216
|
);
|
|
@@ -2216,9 +2225,9 @@ var PersonalityStore = class {
|
|
|
2216
2225
|
try {
|
|
2217
2226
|
state = await readState(filePath);
|
|
2218
2227
|
} catch (err) {
|
|
2219
|
-
|
|
2228
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
2220
2229
|
`personality-store-hydrate-failure-${agentId}`,
|
|
2221
|
-
`[theokit-sdk] personality hydrate failed for ${
|
|
2230
|
+
`[theokit-sdk] personality hydrate failed for ${chunkXL7Q7HB2_cjs.redactSecrets(agentId)}: ${chunkXL7Q7HB2_cjs.redactSecrets(
|
|
2222
2231
|
err.message
|
|
2223
2232
|
)}`
|
|
2224
2233
|
);
|
|
@@ -2235,13 +2244,13 @@ var PersonalityStore = class {
|
|
|
2235
2244
|
async #persist(agentId, slug) {
|
|
2236
2245
|
const filePath = this.#filePath();
|
|
2237
2246
|
await promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
2238
|
-
await
|
|
2247
|
+
await chunkUU36SHFY_cjs.withFileLock(filePath, async () => {
|
|
2239
2248
|
const current = await readState(filePath);
|
|
2240
2249
|
const nextAgents = { ...current.agents };
|
|
2241
2250
|
if (slug === void 0) delete nextAgents[agentId];
|
|
2242
2251
|
else nextAgents[agentId] = slug;
|
|
2243
2252
|
const next = { version: SCHEMA_VERSION2, agents: nextAgents };
|
|
2244
|
-
await
|
|
2253
|
+
await chunkUALX2J2Q_cjs.atomicWriteJson(filePath, next);
|
|
2245
2254
|
});
|
|
2246
2255
|
}
|
|
2247
2256
|
#filePath() {
|
|
@@ -2268,7 +2277,7 @@ function createPluginContext() {
|
|
|
2268
2277
|
},
|
|
2269
2278
|
on(hook, handler) {
|
|
2270
2279
|
if (typeof handler !== "function") {
|
|
2271
|
-
|
|
2280
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] ignoring non-function handler for hook "${hook}"
|
|
2272
2281
|
`);
|
|
2273
2282
|
return;
|
|
2274
2283
|
}
|
|
@@ -2321,7 +2330,7 @@ var PluginManager = class {
|
|
|
2321
2330
|
const seen = /* @__PURE__ */ new Set();
|
|
2322
2331
|
for (const plugin of plugins) {
|
|
2323
2332
|
if (seen.has(plugin.name)) {
|
|
2324
|
-
|
|
2333
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2325
2334
|
`[theokit-sdk] duplicate plugin name "${plugin.name}" \u2014 both will register independently
|
|
2326
2335
|
`
|
|
2327
2336
|
);
|
|
@@ -2348,7 +2357,7 @@ var PluginManager = class {
|
|
|
2348
2357
|
*/
|
|
2349
2358
|
async register(plugin) {
|
|
2350
2359
|
if (plugin.kind !== "general") {
|
|
2351
|
-
throw new
|
|
2360
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2352
2361
|
`late register supports general plugins only (got "${plugin.kind}" for "${plugin.name}")`,
|
|
2353
2362
|
{ code: "plugin_late_register_kind" }
|
|
2354
2363
|
);
|
|
@@ -2405,7 +2414,7 @@ var PluginManager = class {
|
|
|
2405
2414
|
parts.push(result.recalledContext);
|
|
2406
2415
|
}
|
|
2407
2416
|
} catch (err) {
|
|
2408
|
-
|
|
2417
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2409
2418
|
`[theokit-sdk] pre_user_send hook failed: ${err instanceof Error ? err.message : String(err)}
|
|
2410
2419
|
`
|
|
2411
2420
|
);
|
|
@@ -2433,7 +2442,7 @@ var PluginManager = class {
|
|
|
2433
2442
|
try {
|
|
2434
2443
|
await h(ctx);
|
|
2435
2444
|
} catch (err) {
|
|
2436
|
-
|
|
2445
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2437
2446
|
`[theokit-sdk] post_assistant_reply hook failed: ${err instanceof Error ? err.message : String(err)}
|
|
2438
2447
|
`
|
|
2439
2448
|
);
|
|
@@ -2449,7 +2458,7 @@ var PluginManager = class {
|
|
|
2449
2458
|
try {
|
|
2450
2459
|
await h(ctx);
|
|
2451
2460
|
} catch (err) {
|
|
2452
|
-
|
|
2461
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2453
2462
|
`[theokit-sdk] ${name} hook failed: ${err instanceof Error ? err.message : String(err)}
|
|
2454
2463
|
`
|
|
2455
2464
|
);
|
|
@@ -2464,7 +2473,7 @@ var PluginManager = class {
|
|
|
2464
2473
|
const out = await h(current, ctx);
|
|
2465
2474
|
if (out !== void 0) current = out;
|
|
2466
2475
|
} catch (err) {
|
|
2467
|
-
|
|
2476
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2468
2477
|
`[theokit-sdk] ${name} hook failed: ${err instanceof Error ? err.message : String(err)}
|
|
2469
2478
|
`
|
|
2470
2479
|
);
|
|
@@ -2606,7 +2615,7 @@ var HooksExecutor = class {
|
|
|
2606
2615
|
this.config = {};
|
|
2607
2616
|
return;
|
|
2608
2617
|
}
|
|
2609
|
-
this.config = await
|
|
2618
|
+
this.config = await chunkZCIRZE37_cjs.loadHookConfig(this.cwd);
|
|
2610
2619
|
}
|
|
2611
2620
|
/** Fire every hook registered for `event` and aggregate the decisions. */
|
|
2612
2621
|
async run(payload) {
|
|
@@ -2715,11 +2724,11 @@ function sessionTranscriptAllowed(memory) {
|
|
|
2715
2724
|
}
|
|
2716
2725
|
function resolveWindowForRun(model, contextWindow) {
|
|
2717
2726
|
const override = contextWindow !== void 0 && contextWindow > 0 ? contextWindow : void 0;
|
|
2718
|
-
return
|
|
2727
|
+
return chunkDXGZ2NUG_cjs.resolveEffectiveContextWindow({
|
|
2719
2728
|
...override !== void 0 ? { override } : {},
|
|
2720
|
-
catalog:
|
|
2721
|
-
margin:
|
|
2722
|
-
floor:
|
|
2729
|
+
catalog: chunkHCZD23VS_cjs.getCatalogModelInfo(model)?.limit?.context,
|
|
2730
|
+
margin: chunkDXGZ2NUG_cjs.CONTEXT_WINDOW_MARGIN,
|
|
2731
|
+
floor: chunkDXGZ2NUG_cjs.CONTEXT_WINDOW_FLOOR
|
|
2723
2732
|
});
|
|
2724
2733
|
}
|
|
2725
2734
|
async function runPostRunLifecycle(inputs) {
|
|
@@ -2743,32 +2752,32 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2743
2752
|
try {
|
|
2744
2753
|
const partial = await safeConversation(run);
|
|
2745
2754
|
if (partial !== void 0) {
|
|
2746
|
-
|
|
2755
|
+
chunkRMWTPV3M_cjs.persistTurnToTranscript(sessionStore, { cwd: workspaceCwd, agentId, model }, agentId, {
|
|
2747
2756
|
userText,
|
|
2748
2757
|
conversation: partial
|
|
2749
2758
|
});
|
|
2750
2759
|
}
|
|
2751
2760
|
} catch (cause) {
|
|
2752
2761
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
2753
|
-
|
|
2762
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] partial transcript write failed (${agentId}): ${msg}
|
|
2754
2763
|
`);
|
|
2755
2764
|
}
|
|
2756
|
-
await
|
|
2765
|
+
await chunkRMWTPV3M_cjs.flushSessionWrites();
|
|
2757
2766
|
return;
|
|
2758
2767
|
}
|
|
2759
2768
|
if (result.result !== void 0) {
|
|
2760
|
-
|
|
2769
|
+
chunkRMWTPV3M_cjs.appendSessionMessage(agentId, { role: "assistant", text: result.result });
|
|
2761
2770
|
}
|
|
2762
2771
|
const conversation = await safeConversation(run);
|
|
2763
2772
|
const resolvedWindow = resolveWindowForRun(model, contextWindow);
|
|
2764
2773
|
const effectiveWindow = resolvedWindow.window;
|
|
2765
2774
|
const budgetEvent = buildContextBudgetEvent(model, resolvedWindow);
|
|
2766
2775
|
if (budgetEvent !== void 0 && onRunEvent !== void 0) {
|
|
2767
|
-
|
|
2776
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(onRunEvent, budgetEvent);
|
|
2768
2777
|
}
|
|
2769
2778
|
const lastRequestUsage = result.usage?.requests?.at(-1)?.totalTokens;
|
|
2770
2779
|
const usageForTrigger = lastRequestUsage ?? result.usage?.totalTokens;
|
|
2771
|
-
|
|
2780
|
+
chunkRMWTPV3M_cjs.persistTurnToTranscript(
|
|
2772
2781
|
sessionStore,
|
|
2773
2782
|
{ cwd: workspaceCwd, agentId, model },
|
|
2774
2783
|
agentId,
|
|
@@ -2780,20 +2789,20 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2780
2789
|
// The EFFECTIVE window (after override, clamp and margin) — not the declared one. Swapping for
|
|
2781
2790
|
// `contextWindow` here would budget against a number the clamp already rejected.
|
|
2782
2791
|
contextWindow: effectiveWindow,
|
|
2783
|
-
summarize:
|
|
2792
|
+
summarize: chunkKYAJINUI_cjs.buildDefaultSummarizer({
|
|
2784
2793
|
agentModel: model,
|
|
2785
2794
|
...inputs.apiKey !== void 0 ? { apiKey: inputs.apiKey } : {}
|
|
2786
2795
|
})
|
|
2787
2796
|
}
|
|
2788
2797
|
},
|
|
2789
|
-
onRunEvent !== void 0 ? () =>
|
|
2798
|
+
onRunEvent !== void 0 ? () => chunk3FFAEAUJ_cjs.emitRunEvent(onRunEvent, { type: "compact_boundary", trigger: "auto" }) : void 0
|
|
2790
2799
|
);
|
|
2791
2800
|
if (result.status === "finished" && result.result !== void 0 && sessionTranscriptAllowed(inputs.memory)) {
|
|
2792
2801
|
const summaryArgs = {
|
|
2793
2802
|
cwd: workspaceCwd,
|
|
2794
2803
|
// Resolved once, here, and handed to both writers. Recomputing it inside either one is how
|
|
2795
2804
|
// the summary ended up in a directory the indexer never scanned (#463).
|
|
2796
|
-
memoryRoot:
|
|
2805
|
+
memoryRoot: chunk6RKUO7AW_cjs.resolveMemoryRoot(workspaceCwd, inputs.memory),
|
|
2797
2806
|
runId: result.id,
|
|
2798
2807
|
agentId,
|
|
2799
2808
|
userText,
|
|
@@ -2805,14 +2814,14 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2805
2814
|
if (memoryProvider?.recordSessionSummary !== void 0) {
|
|
2806
2815
|
await memoryProvider.recordSessionSummary(summaryArgs);
|
|
2807
2816
|
} else {
|
|
2808
|
-
await
|
|
2817
|
+
await chunk6RKUO7AW_cjs.writeSessionSummary(summaryArgs);
|
|
2809
2818
|
}
|
|
2810
2819
|
if (!shouldUsePortMemoryPath()) {
|
|
2811
2820
|
void memoryGlue.syncIfReady();
|
|
2812
2821
|
}
|
|
2813
2822
|
} catch (cause) {
|
|
2814
2823
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
2815
|
-
|
|
2824
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] session summary write failed (${result.id}): ${message}
|
|
2816
2825
|
`);
|
|
2817
2826
|
}
|
|
2818
2827
|
}
|
|
@@ -2825,7 +2834,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2825
2834
|
agentId,
|
|
2826
2835
|
runId: result.id
|
|
2827
2836
|
});
|
|
2828
|
-
await
|
|
2837
|
+
await chunkRMWTPV3M_cjs.flushSessionWrites();
|
|
2829
2838
|
}
|
|
2830
2839
|
async function safeConversation(run) {
|
|
2831
2840
|
try {
|
|
@@ -2900,7 +2909,7 @@ var warned = /* @__PURE__ */ new Set();
|
|
|
2900
2909
|
function warnDoubleReasoningOnce() {
|
|
2901
2910
|
if (warned.has("double-reasoning")) return;
|
|
2902
2911
|
warned.add("double-reasoning");
|
|
2903
|
-
|
|
2912
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2904
2913
|
"[theokit-sdk] `reasoning: true` skipped \u2014 a native reasoning model is configured (model.params thinking/reasoning); native reasoning wins. Remove one to silence.\n"
|
|
2905
2914
|
);
|
|
2906
2915
|
}
|
|
@@ -2934,14 +2943,14 @@ var SkillsManager = class {
|
|
|
2934
2943
|
async refresh() {
|
|
2935
2944
|
const roots = this.skillsDir === void 0 ? [
|
|
2936
2945
|
...chunkAQO3NSRG_cjs.projectConfigRoots(this.cwd).map((root) => path.join(root, "skills")),
|
|
2937
|
-
...(await
|
|
2946
|
+
...(await chunkCQBXOJ6U_cjs.pluginBundleDirs(this.cwd)).map((bundle) => path.join(bundle, "skills"))
|
|
2938
2947
|
] : [this.skillsDir];
|
|
2939
2948
|
const discovered = [];
|
|
2940
2949
|
const seen = /* @__PURE__ */ new Set();
|
|
2941
2950
|
for (const root of roots) {
|
|
2942
|
-
for (const skill of await
|
|
2951
|
+
for (const skill of await chunkOHLDPWTA_cjs.discoverSkills(root, {
|
|
2943
2952
|
onInvalidSkill: (info) => {
|
|
2944
|
-
|
|
2953
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
|
|
2945
2954
|
`);
|
|
2946
2955
|
}
|
|
2947
2956
|
})) {
|
|
@@ -2970,7 +2979,7 @@ var SkillsManager = class {
|
|
|
2970
2979
|
async get(name) {
|
|
2971
2980
|
const skill = this.skills.find((s) => s.name === name);
|
|
2972
2981
|
if (skill === void 0) return void 0;
|
|
2973
|
-
const instructions = typeof skill.instructions === "string" ? skill.instructions :
|
|
2982
|
+
const instructions = typeof skill.instructions === "string" ? skill.instructions : chunkOHLDPWTA_cjs.stripSkillFrontmatter(await promises.readFile(skill.source, "utf8"));
|
|
2974
2983
|
const references = skill.references;
|
|
2975
2984
|
return {
|
|
2976
2985
|
name: skill.name,
|
|
@@ -3056,7 +3065,7 @@ async function safeCall(fn, fallback, label = "safeCall") {
|
|
|
3056
3065
|
return await fn();
|
|
3057
3066
|
} catch (cause) {
|
|
3058
3067
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
3059
|
-
|
|
3068
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] ${label} failed: ${message}
|
|
3060
3069
|
`);
|
|
3061
3070
|
return fallback;
|
|
3062
3071
|
}
|
|
@@ -3070,7 +3079,7 @@ var ActiveMemoryPromptProvider = class {
|
|
|
3070
3079
|
if (ctx.activeMemorySummary === void 0 || ctx.activeMemorySummary.length === 0) {
|
|
3071
3080
|
return Promise.resolve(void 0);
|
|
3072
3081
|
}
|
|
3073
|
-
const body =
|
|
3082
|
+
const body = chunkOHLDPWTA_cjs.escapeBlockBody(ctx.activeMemorySummary);
|
|
3074
3083
|
return Promise.resolve(`<active-memory>
|
|
3075
3084
|
${body}
|
|
3076
3085
|
</active-memory>`);
|
|
@@ -3123,7 +3132,7 @@ function formatSource(name, tokens) {
|
|
|
3123
3132
|
if (tokens.length === 0) {
|
|
3124
3133
|
return ` <source name="${escapeAttribute(name)}" />`;
|
|
3125
3134
|
}
|
|
3126
|
-
const body =
|
|
3135
|
+
const body = chunkOHLDPWTA_cjs.escapeBlockBody(tokens.join(" "));
|
|
3127
3136
|
return ` <source name="${escapeAttribute(name)}">
|
|
3128
3137
|
${body}
|
|
3129
3138
|
</source>`;
|
|
@@ -3147,7 +3156,7 @@ var MemoryPromptProvider = class {
|
|
|
3147
3156
|
if (ctx.memory.length === 0) return Promise.resolve(void 0);
|
|
3148
3157
|
const lines = ctx.memory.map((fact) => {
|
|
3149
3158
|
const tag = fact.observations === 1 ? "[unconfirmed] " : "";
|
|
3150
|
-
return ` - ${tag}${
|
|
3159
|
+
return ` - ${tag}${chunkOHLDPWTA_cjs.escapeBlockBody(fact.text)}`;
|
|
3151
3160
|
});
|
|
3152
3161
|
return Promise.resolve(`${MEMORY_GUIDANCE}
|
|
3153
3162
|
<memory>
|
|
@@ -3171,7 +3180,7 @@ var SkillsPromptProvider = class {
|
|
|
3171
3180
|
priority = 20;
|
|
3172
3181
|
contribute(ctx) {
|
|
3173
3182
|
if (ctx.skillsAutoInject === false) return Promise.resolve(void 0);
|
|
3174
|
-
return Promise.resolve(
|
|
3183
|
+
return Promise.resolve(chunkOHLDPWTA_cjs.buildSkillsBlock(ctx.skills));
|
|
3175
3184
|
}
|
|
3176
3185
|
};
|
|
3177
3186
|
|
|
@@ -3183,7 +3192,7 @@ var SystemPromptPipeline = class _SystemPromptPipeline {
|
|
|
3183
3192
|
for (const p of providers) {
|
|
3184
3193
|
const key = `${p.priority}:${p.id}`;
|
|
3185
3194
|
if (seen.has(key)) {
|
|
3186
|
-
throw new
|
|
3195
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Duplicate system-prompt provider ${key}`, {
|
|
3187
3196
|
code: "pipeline_duplicate_provider"
|
|
3188
3197
|
});
|
|
3189
3198
|
}
|
|
@@ -3230,7 +3239,7 @@ function validateAgentOptions(options) {
|
|
|
3230
3239
|
ensureRuntimeShape(options);
|
|
3231
3240
|
if (options.local !== void 0) {
|
|
3232
3241
|
if (options.model === void 0) {
|
|
3233
|
-
throw new
|
|
3242
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError("Local agents require a model selection", {
|
|
3234
3243
|
code: "missing_model"
|
|
3235
3244
|
});
|
|
3236
3245
|
}
|
|
@@ -3254,7 +3263,7 @@ function validateCredentialPoolShape(options) {
|
|
|
3254
3263
|
([, arr]) => Array.isArray(arr) && arr.some((k) => typeof k === "string" && k.length > 0)
|
|
3255
3264
|
);
|
|
3256
3265
|
if (populated.length === 0) return;
|
|
3257
|
-
throw new
|
|
3266
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3258
3267
|
"Ambiguous credential configuration: use either `apiKey: '...'` (single-key, simplest) OR `apiKeys: { provider: [...] }` (multi-key pool), not both.",
|
|
3259
3268
|
{ code: "credential_pool_ambiguous" }
|
|
3260
3269
|
);
|
|
@@ -3263,7 +3272,7 @@ function validatePlugins(options) {
|
|
|
3263
3272
|
const plugins = options.plugins;
|
|
3264
3273
|
if (plugins?.paths === void 0) return;
|
|
3265
3274
|
if (options.cloud !== void 0 && plugins.paths.length > 0) {
|
|
3266
|
-
throw new
|
|
3275
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3267
3276
|
"Cloud agents require committed plugin manifests; local plugin paths are not supported",
|
|
3268
3277
|
{ code: "cloud_plugin_path_rejected" }
|
|
3269
3278
|
);
|
|
@@ -3271,7 +3280,7 @@ function validatePlugins(options) {
|
|
|
3271
3280
|
}
|
|
3272
3281
|
function ensureRuntimeShape(options) {
|
|
3273
3282
|
if (options.local !== void 0 && options.cloud !== void 0) {
|
|
3274
|
-
throw new
|
|
3283
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3275
3284
|
"Pass either local or cloud \u2014 they are mutually exclusive runtimes",
|
|
3276
3285
|
{ code: "runtime_exclusive" }
|
|
3277
3286
|
);
|
|
@@ -3279,7 +3288,7 @@ function ensureRuntimeShape(options) {
|
|
|
3279
3288
|
}
|
|
3280
3289
|
function rejectProgrammaticHooks(options) {
|
|
3281
3290
|
if (options.hooks !== void 0) {
|
|
3282
|
-
throw new
|
|
3291
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3283
3292
|
"Programmatic hooks are not supported \u2014 hooks are file-based only (.theokit/hooks.json)",
|
|
3284
3293
|
{ code: "programmatic_hooks_rejected" }
|
|
3285
3294
|
);
|
|
@@ -3289,7 +3298,7 @@ function validateCloud(cloud) {
|
|
|
3289
3298
|
if (cloud.envVars !== void 0) {
|
|
3290
3299
|
for (const key of Object.keys(cloud.envVars)) {
|
|
3291
3300
|
if (key.startsWith("THEOKIT_")) {
|
|
3292
|
-
throw new
|
|
3301
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3293
3302
|
`Cloud envVars cannot use the reserved THEOKIT_ prefix (got "${key}")`,
|
|
3294
3303
|
{ code: "reserved_env_prefix" }
|
|
3295
3304
|
);
|
|
@@ -3301,7 +3310,7 @@ function validateMcpServers(options) {
|
|
|
3301
3310
|
if (options.mcpServers === void 0) return;
|
|
3302
3311
|
for (const [name, config] of Object.entries(options.mcpServers)) {
|
|
3303
3312
|
if (options.cloud !== void 0 && isStdioWithCwd(config)) {
|
|
3304
|
-
throw new
|
|
3313
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3305
3314
|
`MCP server "${name}" uses stdio with cwd, which is rejected for cloud agents`,
|
|
3306
3315
|
{ code: "cloud_stdio_cwd_rejected" }
|
|
3307
3316
|
);
|
|
@@ -3320,12 +3329,12 @@ function validateSubagents(agents2) {
|
|
|
3320
3329
|
if (agents2 === void 0) return;
|
|
3321
3330
|
for (const [name, definition] of Object.entries(agents2)) {
|
|
3322
3331
|
if (typeof definition.description !== "string" || definition.description.length === 0) {
|
|
3323
|
-
throw new
|
|
3332
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Subagent "${name}" requires a non-empty description`, {
|
|
3324
3333
|
code: "subagent_missing_description"
|
|
3325
3334
|
});
|
|
3326
3335
|
}
|
|
3327
3336
|
if (typeof definition.prompt !== "string" || definition.prompt.length === 0) {
|
|
3328
|
-
throw new
|
|
3337
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Subagent "${name}" requires a non-empty prompt`, {
|
|
3329
3338
|
code: "subagent_missing_prompt"
|
|
3330
3339
|
});
|
|
3331
3340
|
}
|
|
@@ -3344,7 +3353,7 @@ function validateToolCatalog(tools, withheldBuiltins) {
|
|
|
3344
3353
|
for (const tool of tools) {
|
|
3345
3354
|
validateSingleTool(tool, reserved);
|
|
3346
3355
|
if (seen.has(tool.name)) {
|
|
3347
|
-
throw new
|
|
3356
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Duplicate custom tool name "${tool.name}"`, {
|
|
3348
3357
|
code: "duplicate_tool_name"
|
|
3349
3358
|
});
|
|
3350
3359
|
}
|
|
@@ -3355,7 +3364,7 @@ function validateCustomTools(options) {
|
|
|
3355
3364
|
const tools = options.tools;
|
|
3356
3365
|
if (tools === void 0 || tools.length === 0) return;
|
|
3357
3366
|
if (options.cloud !== void 0) {
|
|
3358
|
-
throw new
|
|
3367
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3359
3368
|
"Custom inline tools are local-only in SDK v1.0 \u2014 cloud agents cannot serialize handler functions",
|
|
3360
3369
|
{ code: "cloud_custom_tools_rejected" }
|
|
3361
3370
|
);
|
|
@@ -3367,25 +3376,25 @@ function validateSingleTool(tool, reserved) {
|
|
|
3367
3376
|
validateToolDescription(tool);
|
|
3368
3377
|
validateToolSchema(tool);
|
|
3369
3378
|
if (typeof tool.handler !== "function") {
|
|
3370
|
-
throw new
|
|
3379
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Custom tool "${tool.name}" requires a handler function`, {
|
|
3371
3380
|
code: "tool_missing_handler"
|
|
3372
3381
|
});
|
|
3373
3382
|
}
|
|
3374
3383
|
}
|
|
3375
3384
|
function validateToolName(tool, reserved) {
|
|
3376
3385
|
if (typeof tool.name !== "string" || tool.name.length === 0) {
|
|
3377
|
-
throw new
|
|
3386
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError("Custom tool requires a non-empty name", {
|
|
3378
3387
|
code: "tool_missing_name"
|
|
3379
3388
|
});
|
|
3380
3389
|
}
|
|
3381
3390
|
if (!TOOL_NAME_PATTERN.test(tool.name)) {
|
|
3382
|
-
throw new
|
|
3391
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3383
3392
|
`Custom tool name "${tool.name}" must match /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/`,
|
|
3384
3393
|
{ code: "tool_invalid_name" }
|
|
3385
3394
|
);
|
|
3386
3395
|
}
|
|
3387
3396
|
if (reserved.has(tool.name) || tool.name.startsWith("mcp_")) {
|
|
3388
|
-
throw new
|
|
3397
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3389
3398
|
`Custom tool name "${tool.name}" collides with a reserved SDK tool name`,
|
|
3390
3399
|
{ code: "tool_reserved_name" }
|
|
3391
3400
|
);
|
|
@@ -3393,7 +3402,7 @@ function validateToolName(tool, reserved) {
|
|
|
3393
3402
|
}
|
|
3394
3403
|
function validateToolDescription(tool) {
|
|
3395
3404
|
if (typeof tool.description !== "string" || tool.description.length === 0) {
|
|
3396
|
-
throw new
|
|
3405
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Custom tool "${tool.name}" requires a non-empty description`, {
|
|
3397
3406
|
code: "tool_missing_description"
|
|
3398
3407
|
});
|
|
3399
3408
|
}
|
|
@@ -3401,12 +3410,12 @@ function validateToolDescription(tool) {
|
|
|
3401
3410
|
function validateToolSchema(tool) {
|
|
3402
3411
|
const schema = tool.inputSchema;
|
|
3403
3412
|
if (schema === null || schema === void 0 || typeof schema !== "object") {
|
|
3404
|
-
throw new
|
|
3413
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Custom tool "${tool.name}" requires an inputSchema object`, {
|
|
3405
3414
|
code: "tool_missing_schema"
|
|
3406
3415
|
});
|
|
3407
3416
|
}
|
|
3408
3417
|
if (schema.type !== "object") {
|
|
3409
|
-
throw new
|
|
3418
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3410
3419
|
`Custom tool "${tool.name}" inputSchema must declare \`type: "object"\``,
|
|
3411
3420
|
{ code: "tool_invalid_schema_type" }
|
|
3412
3421
|
);
|
|
@@ -3417,7 +3426,7 @@ function validateMemory(options) {
|
|
|
3417
3426
|
if (memory?.storePath === void 0) return;
|
|
3418
3427
|
const storePath = memory.storePath;
|
|
3419
3428
|
if (storePath.includes("..") || storePath.startsWith("/") || /^[A-Z]:/i.test(storePath)) {
|
|
3420
|
-
throw new
|
|
3429
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3421
3430
|
`Memory storePath must stay inside the workspace; got "${storePath}"`,
|
|
3422
3431
|
{ code: "memory_path_traversal" }
|
|
3423
3432
|
);
|
|
@@ -3439,7 +3448,7 @@ var HISTOGRAM_NAMES = {
|
|
|
3439
3448
|
};
|
|
3440
3449
|
function safeRequire(moduleName) {
|
|
3441
3450
|
try {
|
|
3442
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3451
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ZMRD5DZQ.cjs', document.baseURI).href)));
|
|
3443
3452
|
return r(moduleName);
|
|
3444
3453
|
} catch {
|
|
3445
3454
|
return void 0;
|
|
@@ -3518,7 +3527,7 @@ var langfuseAdapter = {
|
|
|
3518
3527
|
}
|
|
3519
3528
|
}
|
|
3520
3529
|
if (lf.LangfuseSpanProcessor === void 0) {
|
|
3521
|
-
|
|
3530
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
3522
3531
|
"[theokit-sdk] @langfuse/node detected but LangfuseSpanProcessor not found (v2?). Use Langfuse v3+ for auto-instrumentation.\n"
|
|
3523
3532
|
);
|
|
3524
3533
|
return;
|
|
@@ -3650,11 +3659,11 @@ function tryAutoRegisterAdapters(settings) {
|
|
|
3650
3659
|
try {
|
|
3651
3660
|
adapter.register();
|
|
3652
3661
|
registered.add(adapter.moduleName);
|
|
3653
|
-
|
|
3662
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] telemetry: ${adapter.displayName} auto-instrumented.
|
|
3654
3663
|
`);
|
|
3655
3664
|
} catch (cause) {
|
|
3656
3665
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
3657
|
-
|
|
3666
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
3658
3667
|
`[theokit-sdk] telemetry: ${adapter.displayName} detected but failed to register: ${message}
|
|
3659
3668
|
`
|
|
3660
3669
|
);
|
|
@@ -3667,7 +3676,7 @@ var cachedOtel;
|
|
|
3667
3676
|
function loadOtel() {
|
|
3668
3677
|
if (cachedOtel === void 0) {
|
|
3669
3678
|
try {
|
|
3670
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3679
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ZMRD5DZQ.cjs', document.baseURI).href)));
|
|
3671
3680
|
const mod = r("@opentelemetry/api");
|
|
3672
3681
|
cachedOtel = mod;
|
|
3673
3682
|
} catch {
|
|
@@ -3710,7 +3719,7 @@ function safe(op, fallback) {
|
|
|
3710
3719
|
if (!warnedOnce) {
|
|
3711
3720
|
warnedOnce = true;
|
|
3712
3721
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
3713
|
-
|
|
3722
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
3714
3723
|
`[theokit-sdk] telemetry exporter error (suppressed; agent.send continues): ${message}
|
|
3715
3724
|
`
|
|
3716
3725
|
);
|
|
@@ -3724,7 +3733,7 @@ function createTelemetry(settings) {
|
|
|
3724
3733
|
if (otel === null) {
|
|
3725
3734
|
if (!warnedOnce) {
|
|
3726
3735
|
warnedOnce = true;
|
|
3727
|
-
|
|
3736
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
3728
3737
|
"[theokit-sdk] telemetry.enabled = true but `@opentelemetry/api` is not installed; telemetry is a no-op.\n"
|
|
3729
3738
|
);
|
|
3730
3739
|
}
|
|
@@ -3818,12 +3827,12 @@ function wrapSpan(span, openSpans) {
|
|
|
3818
3827
|
}
|
|
3819
3828
|
function redactAttrValue(value) {
|
|
3820
3829
|
if (typeof value !== "string") return value;
|
|
3821
|
-
return
|
|
3830
|
+
return chunkXL7Q7HB2_cjs.redactSecrets(value);
|
|
3822
3831
|
}
|
|
3823
3832
|
function redactAttrs(attrs) {
|
|
3824
3833
|
const out = {};
|
|
3825
3834
|
for (const [k, v] of Object.entries(attrs)) {
|
|
3826
|
-
out[k] = typeof v === "string" ?
|
|
3835
|
+
out[k] = typeof v === "string" ? chunkXL7Q7HB2_cjs.redactSecrets(v) : v;
|
|
3827
3836
|
}
|
|
3828
3837
|
return out;
|
|
3829
3838
|
}
|
|
@@ -3904,10 +3913,10 @@ async function loadMarkdownEntities(opts) {
|
|
|
3904
3913
|
const raw = await promises.readFile(resolved.source, "utf8").catch(() => null);
|
|
3905
3914
|
if (raw === null) continue;
|
|
3906
3915
|
const split = splitFrontmatter(raw, resolved.source, errorCodePrefix);
|
|
3907
|
-
const fields =
|
|
3916
|
+
const fields = chunk4CLOXP6H_cjs.parseSimpleYaml(split.frontmatter);
|
|
3908
3917
|
const parsed = schema.safeParse(fields);
|
|
3909
3918
|
if (!parsed.success) {
|
|
3910
|
-
throw new
|
|
3919
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3911
3920
|
`Invalid frontmatter in ${resolved.source}: ${parsed.error.message}`,
|
|
3912
3921
|
{ code: `${errorCodePrefix}_frontmatter_invalid` }
|
|
3913
3922
|
);
|
|
@@ -3925,13 +3934,13 @@ async function assertFileSizeUnderCap(source, errorCodePrefix) {
|
|
|
3925
3934
|
try {
|
|
3926
3935
|
const info = await promises.stat(source);
|
|
3927
3936
|
if (info.size > MAX_MD_FILE_BYTES) {
|
|
3928
|
-
throw new
|
|
3937
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3929
3938
|
`Config file ${source} exceeds 1 MB size limit (${info.size} bytes). Reduce the file or split into multiple entities.`,
|
|
3930
3939
|
{ code: `${errorCodePrefix}_file_too_large` }
|
|
3931
3940
|
);
|
|
3932
3941
|
}
|
|
3933
3942
|
} catch (cause) {
|
|
3934
|
-
if (cause instanceof
|
|
3943
|
+
if (cause instanceof chunk4ZHTIJNE_cjs.ConfigurationError) throw cause;
|
|
3935
3944
|
}
|
|
3936
3945
|
}
|
|
3937
3946
|
async function readDirSafe(dir, errorCodePrefix) {
|
|
@@ -3940,7 +3949,7 @@ async function readDirSafe(dir, errorCodePrefix) {
|
|
|
3940
3949
|
} catch (cause) {
|
|
3941
3950
|
const code = cause.code;
|
|
3942
3951
|
if (code === "ENOENT") return null;
|
|
3943
|
-
throw new
|
|
3952
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Failed to read ${dir}`, {
|
|
3944
3953
|
code: `${errorCodePrefix}_dir_read_error`,
|
|
3945
3954
|
cause
|
|
3946
3955
|
});
|
|
@@ -3957,7 +3966,7 @@ function resolveEntryPath(entry, pattern, dir) {
|
|
|
3957
3966
|
function splitFrontmatter(raw, source, errorCodePrefix) {
|
|
3958
3967
|
const match = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/.exec(raw);
|
|
3959
3968
|
if (match === null) {
|
|
3960
|
-
throw new
|
|
3969
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
3961
3970
|
`Missing or malformed frontmatter in ${source} (expected \`---\` delimited block at file head)`,
|
|
3962
3971
|
{ code: `${errorCodePrefix}_missing_frontmatter` }
|
|
3963
3972
|
);
|
|
@@ -4131,7 +4140,7 @@ async function loadContextConfig(cwd) {
|
|
|
4131
4140
|
});
|
|
4132
4141
|
if (mdEntities.length > 0) {
|
|
4133
4142
|
if (fs.existsSync(jsonPath)) {
|
|
4134
|
-
|
|
4143
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
4135
4144
|
"context-both-present",
|
|
4136
4145
|
"[theokit-sdk] both .theokit/context/ and .theokit/context.json detected \u2014 using markdown; remove context.json"
|
|
4137
4146
|
);
|
|
@@ -4141,7 +4150,7 @@ async function loadContextConfig(cwd) {
|
|
|
4141
4150
|
};
|
|
4142
4151
|
}
|
|
4143
4152
|
if (!fs.existsSync(jsonPath)) return { sources: [] };
|
|
4144
|
-
|
|
4153
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
4145
4154
|
"context-json-deprecated",
|
|
4146
4155
|
"[theokit-sdk] .theokit/context.json is deprecated; migrate to .theokit/context/<name>.md via theokit-migrate-config"
|
|
4147
4156
|
);
|
|
@@ -4149,7 +4158,7 @@ async function loadContextConfig(cwd) {
|
|
|
4149
4158
|
try {
|
|
4150
4159
|
raw = await promises.readFile(jsonPath, "utf8");
|
|
4151
4160
|
} catch (cause) {
|
|
4152
|
-
throw new
|
|
4161
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Failed to read context config: ${jsonPath}`, {
|
|
4153
4162
|
code: "context_read_error",
|
|
4154
4163
|
cause
|
|
4155
4164
|
});
|
|
@@ -4161,13 +4170,13 @@ function parseConfig(raw, configPath) {
|
|
|
4161
4170
|
try {
|
|
4162
4171
|
parsed = JSON.parse(raw);
|
|
4163
4172
|
} catch (cause) {
|
|
4164
|
-
throw new
|
|
4173
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Invalid JSON in context config: ${configPath}`, {
|
|
4165
4174
|
code: "context_json_invalid",
|
|
4166
4175
|
cause
|
|
4167
4176
|
});
|
|
4168
4177
|
}
|
|
4169
4178
|
if (!parsed || typeof parsed !== "object") {
|
|
4170
|
-
throw new
|
|
4179
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Context config must be an object: ${configPath}`, {
|
|
4171
4180
|
code: "context_config_shape"
|
|
4172
4181
|
});
|
|
4173
4182
|
}
|
|
@@ -4182,7 +4191,7 @@ function parseConfig(raw, configPath) {
|
|
|
4182
4191
|
}
|
|
4183
4192
|
function readSources(sourcesRaw, configPath) {
|
|
4184
4193
|
if (!Array.isArray(sourcesRaw)) {
|
|
4185
|
-
throw new
|
|
4194
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Context config sources must be an array: ${configPath}`, {
|
|
4186
4195
|
code: "context_sources_shape"
|
|
4187
4196
|
});
|
|
4188
4197
|
}
|
|
@@ -4283,7 +4292,7 @@ var PluginsManager = class {
|
|
|
4283
4292
|
}
|
|
4284
4293
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: MD-first + JSON fallback + CLI location + both-present detection per plugin folder — branch table is clearer inlined.
|
|
4285
4294
|
async refreshRoot(pluginsRoot) {
|
|
4286
|
-
const entries = await
|
|
4295
|
+
const entries = await chunk4CLOXP6H_cjs.readWorkspaceDir(pluginsRoot, "plugins_read_error", "plugins directory");
|
|
4287
4296
|
for (const entry of entries) {
|
|
4288
4297
|
if (!entry.isDirectory()) continue;
|
|
4289
4298
|
const folderName = entry.name;
|
|
@@ -4299,13 +4308,13 @@ var PluginsManager = class {
|
|
|
4299
4308
|
const jsonPath = path.join(pluginsRoot, folderName, "plugin.json");
|
|
4300
4309
|
const metadata = fs.existsSync(mdPath) ? await loadPluginManifestFromMarkdown(pluginsRoot, folderName) : await loadPluginManifestFromJson(jsonPath, folderName);
|
|
4301
4310
|
if (fs.existsSync(mdPath) && fs.existsSync(jsonPath)) {
|
|
4302
|
-
|
|
4311
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
4303
4312
|
`plugin-${folderName}-both`,
|
|
4304
4313
|
`[theokit-sdk] both ${folderName}/PLUGIN.md and ${folderName}/plugin.json detected \u2014 using markdown; remove plugin.json`
|
|
4305
4314
|
);
|
|
4306
4315
|
}
|
|
4307
4316
|
if (!fs.existsSync(mdPath) && fs.existsSync(jsonPath)) {
|
|
4308
|
-
|
|
4317
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
4309
4318
|
"plugin-json-deprecated",
|
|
4310
4319
|
"[theokit-sdk] plugin.json manifests are deprecated; migrate to PLUGIN.md via theokit-migrate-config"
|
|
4311
4320
|
);
|
|
@@ -4323,11 +4332,11 @@ var PluginsManager = class {
|
|
|
4323
4332
|
const entry = metadata.entry;
|
|
4324
4333
|
if (entry === void 0) return;
|
|
4325
4334
|
const pluginRoot = path.join(this.cwd, ".theokit", "plugins", folderName);
|
|
4326
|
-
const entryPath =
|
|
4335
|
+
const entryPath = chunkV2BOS4WF_cjs.safePathJoin(pluginRoot, entry);
|
|
4327
4336
|
try {
|
|
4328
4337
|
await promises.readFile(entryPath, "utf8");
|
|
4329
4338
|
} catch (cause) {
|
|
4330
|
-
throw new
|
|
4339
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Plugin ${metadata.name} entry file is missing: ${entry}`, {
|
|
4331
4340
|
code: "plugin_entry_missing",
|
|
4332
4341
|
cause
|
|
4333
4342
|
});
|
|
@@ -4351,7 +4360,7 @@ var PluginsManager = class {
|
|
|
4351
4360
|
assertCloudRules() {
|
|
4352
4361
|
if (!this.cloud) return;
|
|
4353
4362
|
if (this.localPaths !== void 0 && this.localPaths.length > 0) {
|
|
4354
|
-
throw new
|
|
4363
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
4355
4364
|
"Cloud agents reject local plugin paths \u2014 plugins must come from committed repo files",
|
|
4356
4365
|
{ code: "cloud_plugin_path_rejected" }
|
|
4357
4366
|
);
|
|
@@ -4363,7 +4372,7 @@ async function loadPluginManifestFromJson(manifestPath, folderName) {
|
|
|
4363
4372
|
try {
|
|
4364
4373
|
raw = await promises.readFile(manifestPath, "utf8");
|
|
4365
4374
|
} catch (cause) {
|
|
4366
|
-
throw new
|
|
4375
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Plugin ${folderName} is missing plugin.json`, {
|
|
4367
4376
|
code: "plugin_missing_manifest",
|
|
4368
4377
|
cause
|
|
4369
4378
|
});
|
|
@@ -4372,13 +4381,13 @@ async function loadPluginManifestFromJson(manifestPath, folderName) {
|
|
|
4372
4381
|
try {
|
|
4373
4382
|
parsed = JSON.parse(raw);
|
|
4374
4383
|
} catch (cause) {
|
|
4375
|
-
throw new
|
|
4384
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Plugin ${folderName} manifest is invalid JSON`, {
|
|
4376
4385
|
code: "plugin_manifest_invalid",
|
|
4377
4386
|
cause
|
|
4378
4387
|
});
|
|
4379
4388
|
}
|
|
4380
4389
|
if (!parsed || typeof parsed !== "object") {
|
|
4381
|
-
throw new
|
|
4390
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Plugin ${folderName} manifest must be an object`, {
|
|
4382
4391
|
code: "plugin_manifest_shape"
|
|
4383
4392
|
});
|
|
4384
4393
|
}
|
|
@@ -4397,7 +4406,7 @@ async function loadPluginManifestFromMarkdown(pluginsRoot, folderName) {
|
|
|
4397
4406
|
try {
|
|
4398
4407
|
raw = await promises.readFile(mdPath, "utf8");
|
|
4399
4408
|
} catch (cause) {
|
|
4400
|
-
throw new
|
|
4409
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Plugin ${folderName} is missing PLUGIN.md`, {
|
|
4401
4410
|
code: "plugin_missing_manifest",
|
|
4402
4411
|
cause
|
|
4403
4412
|
});
|
|
@@ -4412,7 +4421,7 @@ async function loadPluginManifestFromMarkdown(pluginsRoot, folderName) {
|
|
|
4412
4421
|
});
|
|
4413
4422
|
const entity = entities.find((e) => e.slug === "PLUGIN");
|
|
4414
4423
|
if (entity === void 0) {
|
|
4415
|
-
throw new
|
|
4424
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`Plugin ${folderName} PLUGIN.md not parseable`, {
|
|
4416
4425
|
code: "plugin_missing_manifest"
|
|
4417
4426
|
});
|
|
4418
4427
|
}
|
|
@@ -4686,7 +4695,7 @@ function assertValidThresholds(soft, hard) {
|
|
|
4686
4695
|
["hardThreshold", hard]
|
|
4687
4696
|
]) {
|
|
4688
4697
|
if (!Number.isInteger(value) || value < 1) {
|
|
4689
|
-
throw new
|
|
4698
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
4690
4699
|
`doomLoop.${label} must be a positive integer (received ${value}).`,
|
|
4691
4700
|
{ code: "invalid_doom_loop_threshold" }
|
|
4692
4701
|
);
|
|
@@ -4999,7 +5008,7 @@ async function initLoopContext(inputs) {
|
|
|
4999
5008
|
async function safeListTools(client, serverName, sink) {
|
|
5000
5009
|
try {
|
|
5001
5010
|
const listed = await client.listTools();
|
|
5002
|
-
|
|
5011
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(sink, {
|
|
5003
5012
|
type: "mcp_server_ready",
|
|
5004
5013
|
serverName: serverName ?? "unknown",
|
|
5005
5014
|
tools: listed.map((tool) => tool.name)
|
|
@@ -5008,9 +5017,9 @@ async function safeListTools(client, serverName, sink) {
|
|
|
5008
5017
|
} catch (cause) {
|
|
5009
5018
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
5010
5019
|
const server = serverName ?? "unknown";
|
|
5011
|
-
|
|
5020
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] mcp listTools failed (server=${server}): ${message}
|
|
5012
5021
|
`);
|
|
5013
|
-
|
|
5022
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(sink, { type: "mcp_server_failed", serverName: server, message });
|
|
5014
5023
|
return [];
|
|
5015
5024
|
}
|
|
5016
5025
|
}
|
|
@@ -5089,7 +5098,7 @@ function emitLlmMetrics(inputs, result, startAt) {
|
|
|
5089
5098
|
inputs.telemetry?.recordHistogram(HISTOGRAM_NAMES.LLM_USAGE_MISSING, 1, {
|
|
5090
5099
|
provider: inputs.llm.name
|
|
5091
5100
|
});
|
|
5092
|
-
|
|
5101
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
5093
5102
|
`[theokit-sdk] llm usage missing from ${inputs.llm.name} finish \u2014 budget may undercount
|
|
5094
5103
|
`
|
|
5095
5104
|
);
|
|
@@ -5395,7 +5404,7 @@ function coerceArgsToSchema(args, schema) {
|
|
|
5395
5404
|
}
|
|
5396
5405
|
|
|
5397
5406
|
// src/tool-error.ts
|
|
5398
|
-
var ToolError = class extends
|
|
5407
|
+
var ToolError = class extends chunk4ZHTIJNE_cjs.TheokitAgentError {
|
|
5399
5408
|
name = "ToolError";
|
|
5400
5409
|
/** The error content surfaced to the model: a string, or text/image blocks. */
|
|
5401
5410
|
content;
|
|
@@ -5589,7 +5598,7 @@ function raceToolExecution(exec, opts) {
|
|
|
5589
5598
|
// src/internal/agent-loop/tool-dispatch.ts
|
|
5590
5599
|
async function dispatchTools(inputs, tools, toolCalls, events, parentSpan) {
|
|
5591
5600
|
const maxConcurrent = inputs.maxConcurrentTools ?? 4;
|
|
5592
|
-
return
|
|
5601
|
+
return chunkZSWPZ23K_cjs.mapWithConcurrency(
|
|
5593
5602
|
toolCalls,
|
|
5594
5603
|
maxConcurrent,
|
|
5595
5604
|
(call) => dispatchSingleCall(inputs, tools, call, events, parentSpan)
|
|
@@ -5617,7 +5626,7 @@ async function dispatchSingleCall(inputs, tools, call, events, parentSpan) {
|
|
|
5617
5626
|
toolSpan?.end();
|
|
5618
5627
|
return fileVeto;
|
|
5619
5628
|
}
|
|
5620
|
-
|
|
5629
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(inputs.runEventSink, {
|
|
5621
5630
|
type: "tool_progress",
|
|
5622
5631
|
toolName: workingCall.name,
|
|
5623
5632
|
toolCallId: callId
|
|
@@ -5648,7 +5657,7 @@ function applyRepairAndExtractCall(tools, call) {
|
|
|
5648
5657
|
function vetoFromForkWhitelist(inputs, call, callId, events) {
|
|
5649
5658
|
const whitelistDecision = chunkVJ26EKGJ_cjs.checkToolWhitelist(call.name);
|
|
5650
5659
|
if (whitelistDecision.allowed) return void 0;
|
|
5651
|
-
|
|
5660
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(inputs.runEventSink, {
|
|
5652
5661
|
type: "permission_denied",
|
|
5653
5662
|
toolName: call.name,
|
|
5654
5663
|
toolCallId: callId,
|
|
@@ -5693,7 +5702,7 @@ async function vetoFromPluginPreHook(inputs, call, callId, events) {
|
|
|
5693
5702
|
...inputs.permissionMode !== void 0 ? { permissionMode: inputs.permissionMode } : {}
|
|
5694
5703
|
});
|
|
5695
5704
|
if (pluginVeto === void 0) return void 0;
|
|
5696
|
-
|
|
5705
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(inputs.runEventSink, {
|
|
5697
5706
|
type: "permission_denied",
|
|
5698
5707
|
toolName: call.name,
|
|
5699
5708
|
toolCallId: callId,
|
|
@@ -5722,7 +5731,7 @@ async function vetoFromFileHookPreDecision(inputs, call, callId, events) {
|
|
|
5722
5731
|
runId: inputs.runId
|
|
5723
5732
|
});
|
|
5724
5733
|
if (!preDecision.blocked) return void 0;
|
|
5725
|
-
|
|
5734
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(inputs.runEventSink, {
|
|
5726
5735
|
type: "permission_denied",
|
|
5727
5736
|
toolName: call.name,
|
|
5728
5737
|
toolCallId: callId,
|
|
@@ -5823,7 +5832,7 @@ function finalizeSpanAndPostHook(inputs, call, callId, result, events, toolSpan)
|
|
|
5823
5832
|
agentId: inputs.agentId,
|
|
5824
5833
|
runId: inputs.runId
|
|
5825
5834
|
}).catch((err) => {
|
|
5826
|
-
|
|
5835
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
5827
5836
|
`[theokit-sdk] postToolUse hook error (swallowed): ${err instanceof Error ? err.message : String(err)}
|
|
5828
5837
|
`
|
|
5829
5838
|
);
|
|
@@ -5842,7 +5851,7 @@ async function emitToolLifecycleDelta(inputs, update) {
|
|
|
5842
5851
|
try {
|
|
5843
5852
|
await inputs.onDelta({ update });
|
|
5844
5853
|
} catch (err) {
|
|
5845
|
-
|
|
5854
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
5846
5855
|
`[theokit-sdk] onDelta tool-lifecycle emit error (swallowed): ${err instanceof Error ? err.message : String(err)}
|
|
5847
5856
|
`
|
|
5848
5857
|
);
|
|
@@ -5854,7 +5863,7 @@ async function safeEmitToolHook(callback, event) {
|
|
|
5854
5863
|
await callback(event);
|
|
5855
5864
|
} catch (cause) {
|
|
5856
5865
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
5857
|
-
|
|
5866
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] tool lifecycle hook threw: ${msg}
|
|
5858
5867
|
`);
|
|
5859
5868
|
}
|
|
5860
5869
|
}
|
|
@@ -5921,7 +5930,7 @@ function applyToolResultGuard(parts, opts) {
|
|
|
5921
5930
|
(p) => (
|
|
5922
5931
|
// SE7 — guard the TEXT of a tool result (string or the text blocks of a
|
|
5923
5932
|
// structured content); image blocks pass through untouched.
|
|
5924
|
-
p.type === "tool_result" ? { ...p, content:
|
|
5933
|
+
p.type === "tool_result" ? { ...p, content: chunkKYAJINUI_cjs.renderToolResultContentText(p.content, (t) => guardText(t, opts)) } : p
|
|
5925
5934
|
)
|
|
5926
5935
|
);
|
|
5927
5936
|
}
|
|
@@ -6116,7 +6125,7 @@ function catalogCostFallback(provider, cleanedModel) {
|
|
|
6116
6125
|
const candidates = [`${provider}/${cleanedModel}`, cleanedModel];
|
|
6117
6126
|
if (stripped !== cleanedModel) candidates.push(`${provider}/${stripped}`, stripped);
|
|
6118
6127
|
for (const key of candidates) {
|
|
6119
|
-
const info =
|
|
6128
|
+
const info = chunkHCZD23VS_cjs.getCatalogModelInfo(key);
|
|
6120
6129
|
const cost = info?.cost;
|
|
6121
6130
|
if (cost === void 0) continue;
|
|
6122
6131
|
const [prov, ...modelParts] = key.split("/");
|
|
@@ -6128,7 +6137,7 @@ function catalogCostFallback(provider, cleanedModel) {
|
|
|
6128
6137
|
...cost.cache_read !== void 0 ? { cacheReadCostPerMillion: cost.cache_read } : {},
|
|
6129
6138
|
...cost.cache_write !== void 0 ? { cacheWriteCostPerMillion: cost.cache_write } : {},
|
|
6130
6139
|
// M44 M5 fix — honest provenance: a key patched by the LIVE models-dev source is not "vendored".
|
|
6131
|
-
pricingVersion:
|
|
6140
|
+
pricingVersion: chunkHCZD23VS_cjs.isPatchedModelKey(key) ? "catalog-models-dev" : "catalog-vendored"
|
|
6132
6141
|
};
|
|
6133
6142
|
}
|
|
6134
6143
|
return void 0;
|
|
@@ -6587,15 +6596,15 @@ var FallbackLlmClient = class {
|
|
|
6587
6596
|
let lastError;
|
|
6588
6597
|
for (const client of this.clients) {
|
|
6589
6598
|
if (signal.aborted) throw abortError(signal);
|
|
6590
|
-
const attempt = await
|
|
6599
|
+
const attempt = await chunkKYAJINUI_cjs.tryFirstEvent(client, request, signal, true);
|
|
6591
6600
|
if (attempt.kind === "handshake_error") {
|
|
6592
6601
|
lastError = attempt.error;
|
|
6593
6602
|
continue;
|
|
6594
6603
|
}
|
|
6595
|
-
return yield*
|
|
6604
|
+
return yield* chunkKYAJINUI_cjs.relayStream(attempt.generator, attempt.firstResult);
|
|
6596
6605
|
}
|
|
6597
6606
|
if (lastError !== void 0) throw lastError;
|
|
6598
|
-
throw new
|
|
6607
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError("FallbackLlmClient has no providers configured", {
|
|
6599
6608
|
code: "fallback_empty_chain"
|
|
6600
6609
|
});
|
|
6601
6610
|
}
|
|
@@ -6618,7 +6627,7 @@ function reconnectDelay(attempt) {
|
|
|
6618
6627
|
return ms <= 0 ? Promise.resolve() : new Promise((resolve) => setTimeout(resolve, ms));
|
|
6619
6628
|
}
|
|
6620
6629
|
function mcpTimeoutError(name, timeoutMs) {
|
|
6621
|
-
return new
|
|
6630
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${name} request timed out after ${timeoutMs}ms`, {
|
|
6622
6631
|
code: "mcp_timeout"
|
|
6623
6632
|
});
|
|
6624
6633
|
}
|
|
@@ -6701,7 +6710,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6701
6710
|
child.stdin.on("error", () => void 0);
|
|
6702
6711
|
child.on("error", () => {
|
|
6703
6712
|
this.rejectAllPending(
|
|
6704
|
-
new
|
|
6713
|
+
new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} process crashed`, { code: "mcp_crashed" })
|
|
6705
6714
|
);
|
|
6706
6715
|
});
|
|
6707
6716
|
child.on("exit", () => {
|
|
@@ -6709,7 +6718,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6709
6718
|
this.child = void 0;
|
|
6710
6719
|
this.dropped = true;
|
|
6711
6720
|
this.rejectAllPending(
|
|
6712
|
-
new
|
|
6721
|
+
new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} disconnected`, { code: "mcp_disconnected" })
|
|
6713
6722
|
);
|
|
6714
6723
|
});
|
|
6715
6724
|
}
|
|
@@ -6737,7 +6746,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6737
6746
|
if (this.child !== void 0) return Promise.resolve();
|
|
6738
6747
|
if (!this.dropped) {
|
|
6739
6748
|
return Promise.reject(
|
|
6740
|
-
new
|
|
6749
|
+
new chunk4ZHTIJNE_cjs.ConfigurationError(`MCP ${this.name} is not initialized`, { code: "mcp_not_init" })
|
|
6741
6750
|
);
|
|
6742
6751
|
}
|
|
6743
6752
|
this.reconnectPromise ??= this.reconnect().finally(() => {
|
|
@@ -6758,13 +6767,13 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6758
6767
|
lastErr = err;
|
|
6759
6768
|
}
|
|
6760
6769
|
}
|
|
6761
|
-
throw new
|
|
6770
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} reconnect exhausted`, {
|
|
6762
6771
|
code: "mcp_disconnected",
|
|
6763
6772
|
...lastErr instanceof Error ? { cause: lastErr } : {}
|
|
6764
6773
|
});
|
|
6765
6774
|
}
|
|
6766
6775
|
async close() {
|
|
6767
|
-
this.rejectAllPending(new
|
|
6776
|
+
this.rejectAllPending(new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} closed`, { code: "mcp_closed" }));
|
|
6768
6777
|
const child = this.child;
|
|
6769
6778
|
this.child = void 0;
|
|
6770
6779
|
this.dropped = false;
|
|
@@ -6783,7 +6792,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6783
6792
|
if (this.buffer.length > MAX_STDIO_BUFFER_BYTES) {
|
|
6784
6793
|
this.buffer = "";
|
|
6785
6794
|
this.rejectAllPending(
|
|
6786
|
-
new
|
|
6795
|
+
new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} exceeded stdout buffer limit`, {
|
|
6787
6796
|
code: "mcp_buffer_overflow"
|
|
6788
6797
|
})
|
|
6789
6798
|
);
|
|
@@ -6818,7 +6827,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6818
6827
|
if (child !== void 0) return this.send(child, method, params);
|
|
6819
6828
|
if (this.dropped) return this.reconnectAndRequest(method, params);
|
|
6820
6829
|
return Promise.reject(
|
|
6821
|
-
new
|
|
6830
|
+
new chunk4ZHTIJNE_cjs.ConfigurationError(`MCP ${this.name} is not initialized`, { code: "mcp_not_init" })
|
|
6822
6831
|
);
|
|
6823
6832
|
}
|
|
6824
6833
|
/** M2 #59 — reconnect a dropped client, then send. Separate async path so the
|
|
@@ -6827,7 +6836,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6827
6836
|
await this.ensureConnected();
|
|
6828
6837
|
const child = this.child;
|
|
6829
6838
|
if (child === void 0) {
|
|
6830
|
-
throw new
|
|
6839
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(`MCP ${this.name} is not initialized`, { code: "mcp_not_init" });
|
|
6831
6840
|
}
|
|
6832
6841
|
return this.send(child, method, params);
|
|
6833
6842
|
}
|
|
@@ -6844,7 +6853,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
6844
6853
|
this.child = void 0;
|
|
6845
6854
|
this.dropped = true;
|
|
6846
6855
|
this.rejectAllPending(
|
|
6847
|
-
new
|
|
6856
|
+
new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} disconnected`, { code: "mcp_disconnected" })
|
|
6848
6857
|
);
|
|
6849
6858
|
}, this.timeoutMs);
|
|
6850
6859
|
this.pending.set(id, { resolve, reject, timer });
|
|
@@ -6916,7 +6925,7 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
6916
6925
|
if (payload === "") continue;
|
|
6917
6926
|
return JSON.parse(payload);
|
|
6918
6927
|
}
|
|
6919
|
-
throw new
|
|
6928
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} returned an event stream with no data payload`, {
|
|
6920
6929
|
code: "mcp_http_error"
|
|
6921
6930
|
});
|
|
6922
6931
|
}
|
|
@@ -6950,7 +6959,7 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
6950
6959
|
throw cause;
|
|
6951
6960
|
}
|
|
6952
6961
|
if (!response.ok) {
|
|
6953
|
-
throw new
|
|
6962
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(`MCP ${this.name} returned ${response.status}`, {
|
|
6954
6963
|
code: "mcp_http_error"
|
|
6955
6964
|
});
|
|
6956
6965
|
}
|
|
@@ -6966,14 +6975,14 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
6966
6975
|
function resolveMcpCwd(configCwd) {
|
|
6967
6976
|
if (configCwd === void 0) return process.cwd();
|
|
6968
6977
|
if (path.isAbsolute(configCwd)) return configCwd;
|
|
6969
|
-
return
|
|
6978
|
+
return chunkV2BOS4WF_cjs.safePathJoin(process.cwd(), configCwd);
|
|
6970
6979
|
}
|
|
6971
6980
|
|
|
6972
6981
|
// src/internal/providers/register-plugin-providers.ts
|
|
6973
6982
|
function registerPluginProviderProfiles(entries) {
|
|
6974
6983
|
let registered2 = 0;
|
|
6975
6984
|
for (const entry of entries) {
|
|
6976
|
-
|
|
6985
|
+
chunkHCZD23VS_cjs.registerProvider(entry.profile);
|
|
6977
6986
|
registered2 += 1;
|
|
6978
6987
|
}
|
|
6979
6988
|
return registered2;
|
|
@@ -7053,7 +7062,7 @@ function applyPersonalityFilter(exposedTools, whitelist, opts) {
|
|
|
7053
7062
|
if (exposedSet.has(name)) continue;
|
|
7054
7063
|
const hint = suggestClosest(name, exposedSet);
|
|
7055
7064
|
const message = hint !== void 0 ? `[theokit-sdk] personality "${opts?.personalityName ?? "?"}" references unknown tool "${name}"; did you mean "${hint}"?` : `[theokit-sdk] personality "${opts?.personalityName ?? "?"}" references unknown tool "${name}" (not exposed)`;
|
|
7056
|
-
|
|
7065
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
7057
7066
|
`personality-tool-missing|${opts?.agentId ?? "?"}|${opts?.personalityName ?? "?"}|${name}`,
|
|
7058
7067
|
message
|
|
7059
7068
|
);
|
|
@@ -7168,26 +7177,26 @@ function createRealLocalRun(options) {
|
|
|
7168
7177
|
}
|
|
7169
7178
|
var pluginProvidersAnnounced = false;
|
|
7170
7179
|
function resolveRunProvider(options) {
|
|
7171
|
-
|
|
7180
|
+
chunkHCZD23VS_cjs.registerBuiltins();
|
|
7172
7181
|
const profiles = options.pluginManager?.aggregated.providerProfiles ?? [];
|
|
7173
7182
|
const registered2 = registerPluginProviderProfiles(profiles);
|
|
7174
7183
|
if (registered2 > 0 && !pluginProvidersAnnounced) {
|
|
7175
7184
|
pluginProvidersAnnounced = true;
|
|
7176
7185
|
const names = profiles.map((e) => e.profile.name).join(", ");
|
|
7177
|
-
|
|
7186
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] registered ${registered2} plugin provider profile(s): ${names}
|
|
7178
7187
|
`);
|
|
7179
7188
|
}
|
|
7180
7189
|
const parsedModel = chunk3EE6LVWT_cjs.parseModelId(options.model?.id);
|
|
7181
|
-
const modelInferredProvider = parsedModel.provider !== void 0 &&
|
|
7182
|
-
const keyInferredProvider =
|
|
7183
|
-
const primary = options.agentOptions.providers?.routes?.[0]?.provider ?? keyInferredProvider ?? modelInferredProvider ??
|
|
7184
|
-
|
|
7190
|
+
const modelInferredProvider = parsedModel.provider !== void 0 && chunkHCZD23VS_cjs.getProviderProfile(parsedModel.provider) !== void 0 ? parsedModel.provider : void 0;
|
|
7191
|
+
const keyInferredProvider = chunkKYAJINUI_cjs.inferProviderFromApiKey(options.agentOptions.apiKey);
|
|
7192
|
+
const primary = options.agentOptions.providers?.routes?.[0]?.provider ?? keyInferredProvider ?? modelInferredProvider ?? chunkKYAJINUI_cjs.detectPrimaryProvider();
|
|
7193
|
+
chunkKYAJINUI_cjs.warnProviderPrecedenceOnce(modelInferredProvider, primary);
|
|
7185
7194
|
const effectiveModelId = modelInferredProvider !== void 0 && modelInferredProvider === primary ? parsedModel.name : options.model?.id ?? "claude-sonnet-4-6";
|
|
7186
7195
|
return { primary, effectiveModelId };
|
|
7187
7196
|
}
|
|
7188
7197
|
function mergeExplicitApiKey(pools, primary, apiKey) {
|
|
7189
7198
|
if (apiKey === void 0 || apiKey.length === 0) return pools;
|
|
7190
|
-
if (
|
|
7199
|
+
if (chunkKYAJINUI_cjs.isFixtureApiKey(apiKey) || apiKey === LOCAL_RUNTIME_MOCK_KEY) return pools;
|
|
7191
7200
|
const existing = pools?.[primary];
|
|
7192
7201
|
if (existing !== void 0 && existing.length > 0) return pools;
|
|
7193
7202
|
return { ...pools ?? {}, [primary]: [apiKey] };
|
|
@@ -7195,7 +7204,7 @@ function mergeExplicitApiKey(pools, primary, apiKey) {
|
|
|
7195
7204
|
function buildLoopInputs(options, runId, userText, userImages) {
|
|
7196
7205
|
const maxIterations = options.sendOptions.maxIterations;
|
|
7197
7206
|
if (maxIterations !== void 0 && (!Number.isInteger(maxIterations) || maxIterations < 1)) {
|
|
7198
|
-
throw new
|
|
7207
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
7199
7208
|
`SendOptions.maxIterations must be a positive integer, got ${maxIterations}`,
|
|
7200
7209
|
{ code: "invalid_max_iterations" }
|
|
7201
7210
|
);
|
|
@@ -7211,7 +7220,7 @@ function buildLoopInputs(options, runId, userText, userImages) {
|
|
|
7211
7220
|
const extractToolCallsFromContent = options.agentOptions.providers?.routes?.[0]?.extractToolCallsFromContent;
|
|
7212
7221
|
const rateLimitSink = options.sendOptions.onRunEvent;
|
|
7213
7222
|
const modelBaseUrl = options.model?.url;
|
|
7214
|
-
const chain =
|
|
7223
|
+
const chain = chunkKYAJINUI_cjs.resolveProviderChain({
|
|
7215
7224
|
primary,
|
|
7216
7225
|
...modelBaseUrl !== void 0 ? { baseUrl: modelBaseUrl } : {},
|
|
7217
7226
|
...fallback !== void 0 ? { fallback } : {},
|
|
@@ -7219,7 +7228,7 @@ function buildLoopInputs(options, runId, userText, userImages) {
|
|
|
7219
7228
|
...credentialPoolStrategy !== void 0 ? { credentialPoolStrategy } : {},
|
|
7220
7229
|
...extractToolCallsFromContent === true ? { extractToolCallsFromContent: true } : {},
|
|
7221
7230
|
...rateLimitSink !== void 0 ? {
|
|
7222
|
-
onRateLimit: (info) =>
|
|
7231
|
+
onRateLimit: (info) => chunk3FFAEAUJ_cjs.emitRunEvent(rateLimitSink, { type: "rate_limit", ...info })
|
|
7223
7232
|
} : {}
|
|
7224
7233
|
});
|
|
7225
7234
|
const llm = chain.length === 1 ? chain[0] : new FallbackLlmClient(chain);
|
|
@@ -7494,7 +7503,7 @@ function buildRealRunOptions(args) {
|
|
|
7494
7503
|
};
|
|
7495
7504
|
}
|
|
7496
7505
|
async function createFixtureRunHelper(args) {
|
|
7497
|
-
const sessionMessages =
|
|
7506
|
+
const sessionMessages = chunkRMWTPV3M_cjs.getSessionMessages(args.inputs.agentId);
|
|
7498
7507
|
const projectMcpServers = args.inputs.settingSourcesIncludeProject ? await readProjectMcpServers(args.inputs.workspaceCwd) : {};
|
|
7499
7508
|
return createLocalRun({
|
|
7500
7509
|
agentId: args.inputs.agentId,
|
|
@@ -7512,8 +7521,8 @@ async function createFixtureRunHelper(args) {
|
|
|
7512
7521
|
});
|
|
7513
7522
|
}
|
|
7514
7523
|
async function dispatchLocalRun(args) {
|
|
7515
|
-
const apiKey =
|
|
7516
|
-
if (
|
|
7524
|
+
const apiKey = chunkXL7Q7HB2_cjs.resolveApiKey(args.inputs.options.apiKey);
|
|
7525
|
+
if (chunkKYAJINUI_cjs.shouldUseRealLocalRuntime(apiKey)) {
|
|
7517
7526
|
return createRealLocalRun(
|
|
7518
7527
|
buildRealRunOptions({
|
|
7519
7528
|
inputs: args.inputs,
|
|
@@ -7548,20 +7557,20 @@ async function readProjectMcpServers(cwd) {
|
|
|
7548
7557
|
|
|
7549
7558
|
// src/internal/local-agent/local-agent-invalidate.ts
|
|
7550
7559
|
async function applyDeferredInvalidation(agentId, pending, refresh) {
|
|
7551
|
-
|
|
7560
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] applying deferred cache invalidation (${agentId}): ${pending.reason}
|
|
7552
7561
|
`);
|
|
7553
7562
|
try {
|
|
7554
7563
|
await refresh();
|
|
7555
7564
|
} catch (err) {
|
|
7556
7565
|
const msg = err instanceof Error ? err.message : String(err);
|
|
7557
|
-
|
|
7566
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] invalidateCache reload failed (continuing): ${msg}
|
|
7558
7567
|
`);
|
|
7559
7568
|
}
|
|
7560
7569
|
}
|
|
7561
7570
|
async function invalidateCacheImpl(agentId, reason, options, disposed, dispose, setPending) {
|
|
7562
7571
|
if (disposed) return;
|
|
7563
7572
|
if (options.applyNow === true) {
|
|
7564
|
-
|
|
7573
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] invalidateCache applyNow disposing agent (${agentId}): ${reason}
|
|
7565
7574
|
`);
|
|
7566
7575
|
await dispose();
|
|
7567
7576
|
return;
|
|
@@ -7622,7 +7631,7 @@ var LiveAgentRegistry = class {
|
|
|
7622
7631
|
const existing = this.#agents.get(id);
|
|
7623
7632
|
if (existing !== void 0 && existing.agent !== agent) {
|
|
7624
7633
|
void existing.agent.dispose().catch(() => {
|
|
7625
|
-
|
|
7634
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] dispose during overwrite failed (${id})
|
|
7626
7635
|
`);
|
|
7627
7636
|
});
|
|
7628
7637
|
}
|
|
@@ -7726,7 +7735,7 @@ var LiveAgentRegistry = class {
|
|
|
7726
7735
|
await agent.dispose();
|
|
7727
7736
|
} catch (cause) {
|
|
7728
7737
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
7729
|
-
|
|
7738
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] dispose during eviction failed (${id}): ${msg}
|
|
7730
7739
|
`);
|
|
7731
7740
|
}
|
|
7732
7741
|
if (this.#onEvict !== void 0) {
|
|
@@ -7734,7 +7743,7 @@ var LiveAgentRegistry = class {
|
|
|
7734
7743
|
this.#onEvict(id, reason);
|
|
7735
7744
|
} catch (cause) {
|
|
7736
7745
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
7737
|
-
|
|
7746
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] onEvict listener threw (${id}): ${msg}
|
|
7738
7747
|
`);
|
|
7739
7748
|
}
|
|
7740
7749
|
}
|
|
@@ -7750,7 +7759,7 @@ async function acquireLeaseIfPossible(store, agentId) {
|
|
|
7750
7759
|
await a.call(store, agentId);
|
|
7751
7760
|
} catch (err) {
|
|
7752
7761
|
if (err instanceof Error && err.name === "SessionBusyError") throw err;
|
|
7753
|
-
|
|
7762
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
7754
7763
|
`[theokit-sdk] writer lease unavailable for ${agentId} (${err instanceof Error ? err.message : String(err)}) \u2014 proceeding without single-writer protection
|
|
7755
7764
|
`
|
|
7756
7765
|
);
|
|
@@ -7769,16 +7778,16 @@ async function disposeLocalAgentSession(agent) {
|
|
|
7769
7778
|
agent.lifecycleAbortController.abort();
|
|
7770
7779
|
await chunkZF2LDKQQ_cjs.withCwdMutex(`agent-send:${agent.agentId}`, () => Promise.resolve());
|
|
7771
7780
|
disposeSessionMcpClients(agent.agentId);
|
|
7772
|
-
await
|
|
7781
|
+
await chunkRMWTPV3M_cjs.flushSessionWrites();
|
|
7773
7782
|
await flushRegistrySaves(agent.workspaceCwd);
|
|
7774
7783
|
await disposeSessionStore(agent.sessionStore);
|
|
7775
|
-
|
|
7784
|
+
chunkRMWTPV3M_cjs.discardSession(agent.workspaceCwd, agent.agentId);
|
|
7776
7785
|
}
|
|
7777
7786
|
async function reloadLocalAgent(agent) {
|
|
7778
7787
|
if (agent.context !== void 0) await agent.context.refresh();
|
|
7779
7788
|
if (agent.skillsManager !== void 0) await agent.skillsManager.refresh();
|
|
7780
7789
|
if (agent.pluginsManager !== void 0) await agent.pluginsManager.refresh();
|
|
7781
|
-
return await
|
|
7790
|
+
return await chunkCQBXOJ6U_cjs.loadSubagents(
|
|
7782
7791
|
agent.workspaceCwd,
|
|
7783
7792
|
agent.settingSourcesIncludeProject,
|
|
7784
7793
|
agent.options.agents
|
|
@@ -7901,7 +7910,7 @@ async function searchOnce(args, cfg, query, started) {
|
|
|
7901
7910
|
return { summary, durationMs: Date.now() - started, status: "ok", hits };
|
|
7902
7911
|
} catch (cause) {
|
|
7903
7912
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
7904
|
-
|
|
7913
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] active-memory recall failed: ${message}
|
|
7905
7914
|
`);
|
|
7906
7915
|
return { summary: void 0, durationMs: Date.now() - started, status: "error", hits: [] };
|
|
7907
7916
|
}
|
|
@@ -7919,7 +7928,7 @@ async function finalize(args, queryMode, result) {
|
|
|
7919
7928
|
};
|
|
7920
7929
|
args.cache?.set(args.userText, queryMode, result, tenantCtx);
|
|
7921
7930
|
if (args.persistTranscripts === true && args.cwd !== void 0) {
|
|
7922
|
-
await
|
|
7931
|
+
await chunkGKEFRLU7_cjs.persistActiveMemoryTranscript(args.memoryRoot ?? chunk6RKUO7AW_cjs.resolveMemoryRoot(args.cwd), {
|
|
7923
7932
|
runId: args.runId ?? `run-${Date.now()}`,
|
|
7924
7933
|
startedAtMs: Date.now() - result.durationMs,
|
|
7925
7934
|
userText: args.userText,
|
|
@@ -8021,7 +8030,7 @@ var azureOpenAiMemoryEmbeddingProviderAdapter = {
|
|
|
8021
8030
|
transport: "remote",
|
|
8022
8031
|
authProviderId: "azure-openai",
|
|
8023
8032
|
autoSelectPriority: 25,
|
|
8024
|
-
create: (options) =>
|
|
8033
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8025
8034
|
{
|
|
8026
8035
|
id: "azure-openai",
|
|
8027
8036
|
defaultBaseUrl: "https://your-resource.openai.azure.com",
|
|
@@ -8057,7 +8066,7 @@ var cohereMemoryEmbeddingProviderAdapter = {
|
|
|
8057
8066
|
transport: "remote",
|
|
8058
8067
|
authProviderId: "cohere",
|
|
8059
8068
|
autoSelectPriority: 30,
|
|
8060
|
-
create: (options) =>
|
|
8069
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8061
8070
|
{
|
|
8062
8071
|
id: "cohere",
|
|
8063
8072
|
defaultBaseUrl: "https://api.cohere.com",
|
|
@@ -8103,7 +8112,7 @@ var deepinfraMemoryEmbeddingProviderAdapter = {
|
|
|
8103
8112
|
transport: "remote",
|
|
8104
8113
|
authProviderId: "deepinfra",
|
|
8105
8114
|
autoSelectPriority: 13,
|
|
8106
|
-
create: (options) =>
|
|
8115
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8107
8116
|
{
|
|
8108
8117
|
id: "deepinfra",
|
|
8109
8118
|
defaultBaseUrl: "https://api.deepinfra.com",
|
|
@@ -8129,7 +8138,7 @@ var geminiMemoryEmbeddingProviderAdapter = {
|
|
|
8129
8138
|
transport: "remote",
|
|
8130
8139
|
authProviderId: "gemini",
|
|
8131
8140
|
autoSelectPriority: 30,
|
|
8132
|
-
create: (options) =>
|
|
8141
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8133
8142
|
{
|
|
8134
8143
|
id: "gemini",
|
|
8135
8144
|
defaultBaseUrl: "https://generativelanguage.googleapis.com",
|
|
@@ -8157,7 +8166,7 @@ var jinaMemoryEmbeddingProviderAdapter = {
|
|
|
8157
8166
|
transport: "remote",
|
|
8158
8167
|
authProviderId: "jina",
|
|
8159
8168
|
autoSelectPriority: 35,
|
|
8160
|
-
create: (options) =>
|
|
8169
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8161
8170
|
{
|
|
8162
8171
|
id: "jina",
|
|
8163
8172
|
defaultBaseUrl: "https://api.jina.ai",
|
|
@@ -8180,7 +8189,7 @@ var mistralMemoryEmbeddingProviderAdapter = {
|
|
|
8180
8189
|
transport: "remote",
|
|
8181
8190
|
authProviderId: "mistral",
|
|
8182
8191
|
autoSelectPriority: 18,
|
|
8183
|
-
create: (options) =>
|
|
8192
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8184
8193
|
{
|
|
8185
8194
|
id: "mistral",
|
|
8186
8195
|
defaultBaseUrl: "https://api.mistral.ai",
|
|
@@ -8222,7 +8231,7 @@ var ollamaMemoryEmbeddingProviderAdapter = {
|
|
|
8222
8231
|
autoSelectPriority: 10,
|
|
8223
8232
|
create: (options) => {
|
|
8224
8233
|
const apiKey = options.apiKey ?? process.env.OLLAMA_API_KEY ?? OLLAMA_LOCAL_SENTINEL_KEY;
|
|
8225
|
-
return
|
|
8234
|
+
return chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8226
8235
|
{
|
|
8227
8236
|
id: "ollama",
|
|
8228
8237
|
defaultBaseUrl: "http://localhost:11434",
|
|
@@ -8249,7 +8258,7 @@ var openAiMemoryEmbeddingProviderAdapter = {
|
|
|
8249
8258
|
transport: "remote",
|
|
8250
8259
|
authProviderId: "openai",
|
|
8251
8260
|
autoSelectPriority: 20,
|
|
8252
|
-
create: (options) =>
|
|
8261
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8253
8262
|
{
|
|
8254
8263
|
id: "openai",
|
|
8255
8264
|
defaultBaseUrl: "https://api.openai.com",
|
|
@@ -8276,7 +8285,7 @@ var openRouterMemoryEmbeddingProviderAdapter = {
|
|
|
8276
8285
|
transport: "remote",
|
|
8277
8286
|
authProviderId: "openrouter",
|
|
8278
8287
|
autoSelectPriority: 15,
|
|
8279
|
-
create: (options) =>
|
|
8288
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8280
8289
|
{
|
|
8281
8290
|
id: "openrouter",
|
|
8282
8291
|
defaultBaseUrl: "https://openrouter.ai/api",
|
|
@@ -8304,7 +8313,7 @@ var voyageMemoryEmbeddingProviderAdapter = {
|
|
|
8304
8313
|
transport: "remote",
|
|
8305
8314
|
authProviderId: "voyage",
|
|
8306
8315
|
autoSelectPriority: 14,
|
|
8307
|
-
create: (options) =>
|
|
8316
|
+
create: (options) => chunkKQ7TS7WW_cjs.createOpenAiCompatibleRuntime(
|
|
8308
8317
|
{
|
|
8309
8318
|
id: "voyage",
|
|
8310
8319
|
defaultBaseUrl: "https://api.voyageai.com",
|
|
@@ -8416,7 +8425,7 @@ function createMemoryGetTool(opts) {
|
|
|
8416
8425
|
const lines = readNumber(input.lines);
|
|
8417
8426
|
const resolved = path.resolve(memoryRoot, relPath);
|
|
8418
8427
|
if (!isPathInside(memoryRoot, resolved)) {
|
|
8419
|
-
throw new
|
|
8428
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8420
8429
|
`memory_get rejected path that escapes memory root: ${relPath}`,
|
|
8421
8430
|
{ code: "memory_path_escapes_root" }
|
|
8422
8431
|
);
|
|
@@ -8436,7 +8445,7 @@ function readString(value, errorIfMissing, allowUndefined = false) {
|
|
|
8436
8445
|
if (typeof value === "string") return value;
|
|
8437
8446
|
if (allowUndefined && (value === void 0 || value === null)) return "";
|
|
8438
8447
|
if (errorIfMissing !== void 0) {
|
|
8439
|
-
throw new
|
|
8448
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(errorIfMissing, { code: "memory_tool_bad_args" });
|
|
8440
8449
|
}
|
|
8441
8450
|
return "";
|
|
8442
8451
|
}
|
|
@@ -8513,7 +8522,7 @@ var LocalAgentMemory = class {
|
|
|
8513
8522
|
const openOpts = { cwd: this.workspaceCwd, memoryRoot };
|
|
8514
8523
|
if (embedding !== void 0) openOpts.embedding = embedding;
|
|
8515
8524
|
if (cfg?.backend !== void 0) openOpts.backend = cfg.backend;
|
|
8516
|
-
this.index = await
|
|
8525
|
+
this.index = await chunkITYQ6VBP_cjs.IndexManager.open(openOpts);
|
|
8517
8526
|
await this.index.sync();
|
|
8518
8527
|
this.toolsCache = [
|
|
8519
8528
|
createMemorySearchTool({ index: this.index }),
|
|
@@ -8528,7 +8537,7 @@ var LocalAgentMemory = class {
|
|
|
8528
8537
|
const warned2 = g[sym];
|
|
8529
8538
|
if (!warned2.has(message)) {
|
|
8530
8539
|
warned2.add(message);
|
|
8531
|
-
|
|
8540
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] memory tools unavailable: ${message}
|
|
8532
8541
|
`);
|
|
8533
8542
|
}
|
|
8534
8543
|
return void 0;
|
|
@@ -8537,7 +8546,7 @@ var LocalAgentMemory = class {
|
|
|
8537
8546
|
async runActiveMemoryIfEnabled(userText, priorMessages, telemetry) {
|
|
8538
8547
|
const cfg = this.options.memory?.activeRecall;
|
|
8539
8548
|
if (cfg?.enabled !== true || this.index === void 0) return void 0;
|
|
8540
|
-
if (this.breaker === void 0) this.breaker = new
|
|
8549
|
+
if (this.breaker === void 0) this.breaker = new chunkKYAJINUI_cjs.CircuitBreaker();
|
|
8541
8550
|
if (this.cache === void 0) this.cache = new ActiveMemoryCache();
|
|
8542
8551
|
const result = await runActiveMemory({
|
|
8543
8552
|
userText,
|
|
@@ -8560,7 +8569,7 @@ var LocalAgentMemory = class {
|
|
|
8560
8569
|
* and the active-memory transcript writer. Three separate resolutions is how they drifted (#463).
|
|
8561
8570
|
*/
|
|
8562
8571
|
memoryRoot() {
|
|
8563
|
-
this.memoryRootCache ??=
|
|
8572
|
+
this.memoryRootCache ??= chunk6RKUO7AW_cjs.resolveMemoryRoot(this.workspaceCwd, this.options.memory);
|
|
8564
8573
|
return this.memoryRootCache;
|
|
8565
8574
|
}
|
|
8566
8575
|
buildActiveMemoryOptions(cfg) {
|
|
@@ -8596,7 +8605,7 @@ var LocalAgentMemory = class {
|
|
|
8596
8605
|
await this.index.sync();
|
|
8597
8606
|
} catch (cause) {
|
|
8598
8607
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
8599
|
-
|
|
8608
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] session index sync failed: ${message}
|
|
8600
8609
|
`);
|
|
8601
8610
|
}
|
|
8602
8611
|
}
|
|
@@ -8609,7 +8618,7 @@ var LocalAgentMemory = class {
|
|
|
8609
8618
|
return await adapter.create(cfg.model !== void 0 ? { model: cfg.model } : {});
|
|
8610
8619
|
} catch (cause) {
|
|
8611
8620
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
8612
|
-
|
|
8621
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] memory embedding ${cfg.provider} unavailable: ${message}
|
|
8613
8622
|
`);
|
|
8614
8623
|
return void 0;
|
|
8615
8624
|
}
|
|
@@ -8622,7 +8631,7 @@ async function createAvailableAdapters(entries, workspaceCwd) {
|
|
|
8622
8631
|
for (const entry of entries) {
|
|
8623
8632
|
const instance = await entry.createProvider(workspaceCwd);
|
|
8624
8633
|
if (instance.isAvailable() === false) {
|
|
8625
|
-
|
|
8634
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
8626
8635
|
`[theokit-sdk] memory adapter "${instance.id}" reports itself unavailable (plugin "${entry.pluginName}") \u2014 skipping it. Check its credentials.
|
|
8627
8636
|
`
|
|
8628
8637
|
);
|
|
@@ -8656,7 +8665,7 @@ function buildAgentMemory(pluginManager, workspaceCwd, defaultContext) {
|
|
|
8656
8665
|
...partial?.metadata !== void 0 ? { metadata: partial.metadata } : defaultContext?.metadata !== void 0 ? { metadata: defaultContext.metadata } : {}
|
|
8657
8666
|
};
|
|
8658
8667
|
if (merged.userId === "") {
|
|
8659
|
-
throw new
|
|
8668
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8660
8669
|
"agent.memory requires a userId \u2014 either set AgentOptions.memoryContext.userId or pass ctx.userId at call time.",
|
|
8661
8670
|
{ code: "memory_context_missing_user_id" }
|
|
8662
8671
|
);
|
|
@@ -8666,7 +8675,7 @@ function buildAgentMemory(pluginManager, workspaceCwd, defaultContext) {
|
|
|
8666
8675
|
async function requireAdapters() {
|
|
8667
8676
|
const r = await ensure();
|
|
8668
8677
|
if (r.adapters.length === 0) {
|
|
8669
|
-
throw new
|
|
8678
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8670
8679
|
r.registered === 0 ? "No memory adapter registered. Pass a memory plugin in AgentOptions.plugins (e.g. supermemoryMemory({...}))." : `All ${r.registered} registered memory adapter(s) reported themselves unavailable \u2014 see the warnings naming each one. Check their credentials.`,
|
|
8671
8680
|
{ code: "no_memory_adapter" }
|
|
8672
8681
|
);
|
|
@@ -8707,7 +8716,7 @@ function buildAgentMemory(pluginManager, workspaceCwd, defaultContext) {
|
|
|
8707
8716
|
const prefix = id.split(":", 1)[0] ?? "";
|
|
8708
8717
|
const target = adapters.find((a) => a.id === prefix);
|
|
8709
8718
|
if (target === void 0) {
|
|
8710
|
-
throw new
|
|
8719
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8711
8720
|
`No adapter found for MemoryId prefix "${prefix}" (registered: ${adapters.map((a) => a.id).join(", ")}).`,
|
|
8712
8721
|
{ code: "no_memory_adapter" }
|
|
8713
8722
|
);
|
|
@@ -8780,7 +8789,7 @@ function createLocalAgentMemoryProvider(opts) {
|
|
|
8780
8789
|
return { facts: [], systemPromptAdditions: summary };
|
|
8781
8790
|
},
|
|
8782
8791
|
async recordSessionSummary(args) {
|
|
8783
|
-
await
|
|
8792
|
+
await chunk6RKUO7AW_cjs.writeSessionSummary(args);
|
|
8784
8793
|
},
|
|
8785
8794
|
async sync(handle) {
|
|
8786
8795
|
const state = handle[INTERNAL_LAM_KEY];
|
|
@@ -8858,19 +8867,19 @@ var PersonalityRegistry = class _PersonalityRegistry {
|
|
|
8858
8867
|
function addEntity(byName, entity, origin, collisionMap) {
|
|
8859
8868
|
const fm = entity.frontmatter;
|
|
8860
8869
|
if (PersonalityRegistry.isReservedClearSlug(fm.name)) {
|
|
8861
|
-
throw new
|
|
8870
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8862
8871
|
`Personality name "${fm.name}" is reserved (used to clear active preset)`,
|
|
8863
8872
|
{ code: "personality_reserved_name" }
|
|
8864
8873
|
);
|
|
8865
8874
|
}
|
|
8866
8875
|
if (entity.body.trim().length === 0) {
|
|
8867
|
-
throw new
|
|
8876
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8868
8877
|
`Personality "${fm.name}" has empty body (system prompt required)`,
|
|
8869
8878
|
{ code: "personality_empty_body" }
|
|
8870
8879
|
);
|
|
8871
8880
|
}
|
|
8872
8881
|
if (origin === "project" && collisionMap?.has(fm.name)) {
|
|
8873
|
-
|
|
8882
|
+
chunkZCIRZE37_cjs.warnOnce(
|
|
8874
8883
|
`personality-collision-${fm.name}`,
|
|
8875
8884
|
`[theokit-sdk] personality "${fm.name}" overridden by project preset`
|
|
8876
8885
|
);
|
|
@@ -8899,7 +8908,7 @@ async function performPersonalitySwitch(args) {
|
|
|
8899
8908
|
const preset = args.registry.get(args.requestedName);
|
|
8900
8909
|
if (preset === void 0) {
|
|
8901
8910
|
const available = args.registry.all().map((p) => p.name).join(", ") || "(none)";
|
|
8902
|
-
throw new
|
|
8911
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
8903
8912
|
`Personality "${args.requestedName}" not found. Available: ${available}`,
|
|
8904
8913
|
{ code: "personality_not_found" }
|
|
8905
8914
|
);
|
|
@@ -8920,14 +8929,14 @@ async function performPersonalitySwitch(args) {
|
|
|
8920
8929
|
|
|
8921
8930
|
// src/internal/local-agent/local-agent-personality-extensions.ts
|
|
8922
8931
|
function resolveActivePersonalityPreset(args) {
|
|
8923
|
-
const forkCtx =
|
|
8932
|
+
const forkCtx = chunkZCIRZE37_cjs.currentPersonalityContext();
|
|
8924
8933
|
const slug = forkCtx !== void 0 ? forkCtx.slug : args.personalityStore.active(args.agentId);
|
|
8925
8934
|
if (slug === void 0) return void 0;
|
|
8926
8935
|
return args.personalityRegistry?.get(slug);
|
|
8927
8936
|
}
|
|
8928
8937
|
async function ensurePersonalityRegistryIfNeeded(args) {
|
|
8929
8938
|
if (args.personalityRegistry !== void 0) return args.personalityRegistry;
|
|
8930
|
-
const forkSlug =
|
|
8939
|
+
const forkSlug = chunkZCIRZE37_cjs.currentPersonalityContext()?.slug;
|
|
8931
8940
|
const ownSlug = args.personalityStore.active(args.agentId);
|
|
8932
8941
|
if (forkSlug === void 0 && ownSlug === void 0) return void 0;
|
|
8933
8942
|
return await PersonalityRegistry.load(args.workspaceCwd);
|
|
@@ -8941,8 +8950,8 @@ ${preset.systemPrompt}`;
|
|
|
8941
8950
|
}
|
|
8942
8951
|
async function localAgentUsePersonality(args) {
|
|
8943
8952
|
if (args.disposed) throw new Error("Agent has been disposed");
|
|
8944
|
-
if (
|
|
8945
|
-
|
|
8953
|
+
if (chunkZCIRZE37_cjs.currentPersonalityContext() !== void 0) {
|
|
8954
|
+
chunkZCIRZE37_cjs.warnPersonalitySwitchInsideFork(args.agentId);
|
|
8946
8955
|
return null;
|
|
8947
8956
|
}
|
|
8948
8957
|
let registry = args.personalityRegistry;
|
|
@@ -8959,8 +8968,8 @@ async function localAgentUsePersonality(args) {
|
|
|
8959
8968
|
registry,
|
|
8960
8969
|
store: args.personalityStore,
|
|
8961
8970
|
invalidateCache: (reason) => args.invalidateCache(reason),
|
|
8962
|
-
appendSessionMessage: (msg) =>
|
|
8963
|
-
clearSession: () =>
|
|
8971
|
+
appendSessionMessage: (msg) => chunkRMWTPV3M_cjs.appendSessionMessage(args.agentId, msg),
|
|
8972
|
+
clearSession: () => chunkRMWTPV3M_cjs.clearSession(args.agentId),
|
|
8964
8973
|
opts: args.opts ?? {}
|
|
8965
8974
|
})
|
|
8966
8975
|
);
|
|
@@ -8971,7 +8980,7 @@ function localAgentRunUntil(agent, goal, options) {
|
|
|
8971
8980
|
async function* wrap() {
|
|
8972
8981
|
const { runUntilImpl } = await import('./run-until-U2B5FJJI.cjs');
|
|
8973
8982
|
const buildDeps = async () => {
|
|
8974
|
-
const { judgeCallImpl } = await import('./judge-call-
|
|
8983
|
+
const { judgeCallImpl } = await import('./judge-call-LAHMBJ57.cjs');
|
|
8975
8984
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
8976
8985
|
const create = getAgentFacade().create;
|
|
8977
8986
|
return {
|
|
@@ -9004,7 +9013,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
|
|
|
9004
9013
|
async function localAgentFork(parent, options) {
|
|
9005
9014
|
const { forkAgentImpl } = await import('./fork-agent-Y2IK2RYU.cjs');
|
|
9006
9015
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
9007
|
-
const { withPersonalityContext } = await import('./context-
|
|
9016
|
+
const { withPersonalityContext } = await import('./context-AGQ3DIZU.cjs');
|
|
9008
9017
|
const create = getAgentFacade().create;
|
|
9009
9018
|
return withPersonalityContext(
|
|
9010
9019
|
{ slug: parent.personalitySlugSnapshot, isFork: true },
|
|
@@ -9013,18 +9022,24 @@ async function localAgentFork(parent, options) {
|
|
|
9013
9022
|
}
|
|
9014
9023
|
async function persistMemoryFactIfWritePrompt(workspaceCwd, memoryConfig, userText) {
|
|
9015
9024
|
if (memoryConfig?.enabled !== true) return;
|
|
9025
|
+
const unstored = unstoredRememberWarning(userText);
|
|
9026
|
+
if (unstored !== void 0) {
|
|
9027
|
+
chunkEG4QM7ZJ_cjs.diagFailure(unstored);
|
|
9028
|
+
return;
|
|
9029
|
+
}
|
|
9016
9030
|
if (!isMemoryWritePrompt(userText)) return;
|
|
9017
9031
|
const fact = extractMemoryFact(userText);
|
|
9018
9032
|
if (fact.length === 0) return;
|
|
9019
9033
|
const kind = extractMemoryKind(userText);
|
|
9020
|
-
|
|
9021
|
-
|
|
9034
|
+
try {
|
|
9035
|
+
await appendMemoryFact(workspaceCwd, memoryConfig, {
|
|
9022
9036
|
text: fact,
|
|
9023
9037
|
...kind === void 0 ? {} : { kind }
|
|
9024
|
-
})
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9038
|
+
});
|
|
9039
|
+
} catch (cause) {
|
|
9040
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
9041
|
+
chunkEG4QM7ZJ_cjs.diagFailure(`[theokit-sdk] memory write failed, nothing was stored: ${message}`);
|
|
9042
|
+
}
|
|
9028
9043
|
}
|
|
9029
9044
|
|
|
9030
9045
|
// src/internal/runtime/concurrency/abort-utils.ts
|
|
@@ -9068,7 +9083,7 @@ function wrapRunWithCompletionCheck(args) {
|
|
|
9068
9083
|
judgeOpts
|
|
9069
9084
|
);
|
|
9070
9085
|
const complete = !verdict.parseFailed && verdict.verdict === "done";
|
|
9071
|
-
|
|
9086
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(args.onRunEvent, {
|
|
9072
9087
|
type: "completion_check",
|
|
9073
9088
|
complete,
|
|
9074
9089
|
reason: verdict.reason
|
|
@@ -9385,7 +9400,7 @@ function wrapRunWithOutputProcessors(args) {
|
|
|
9385
9400
|
if (result.status !== "finished" || result.result === void 0) return result;
|
|
9386
9401
|
const res = await runOutputProcessors(args.processors, result.result, args.agentId);
|
|
9387
9402
|
if (res.kind === "ok") return { ...result, result: res.value };
|
|
9388
|
-
|
|
9403
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(args.onRunEvent, {
|
|
9389
9404
|
type: "tripwire",
|
|
9390
9405
|
reason: res.tripwire.reason,
|
|
9391
9406
|
processorId: res.tripwire.processorId
|
|
@@ -9475,7 +9490,7 @@ async function applyInputProcessors(inputs, message, rawUserText, options, sendM
|
|
|
9475
9490
|
}
|
|
9476
9491
|
const res = await runInputProcessors(processors, rawUserText, inputs.agentId);
|
|
9477
9492
|
if (res.kind === "tripwire") {
|
|
9478
|
-
|
|
9493
|
+
chunk3FFAEAUJ_cjs.emitRunEvent(options.onRunEvent, {
|
|
9479
9494
|
type: "tripwire",
|
|
9480
9495
|
reason: res.tripwire.reason,
|
|
9481
9496
|
processorId: res.tripwire.processorId
|
|
@@ -9492,7 +9507,7 @@ async function applyInputProcessors(inputs, message, rawUserText, options, sendM
|
|
|
9492
9507
|
return { userText: res.value, effectiveMessage };
|
|
9493
9508
|
}
|
|
9494
9509
|
async function executeSendLocked(inputs, message, options) {
|
|
9495
|
-
if (inputs.disposed) throw new
|
|
9510
|
+
if (inputs.disposed) throw new chunk4ZHTIJNE_cjs.AgentDisposedError(inputs.agentId);
|
|
9496
9511
|
await consumePending(inputs.agentId, inputs.invalidationPending, inputs.clearInvalidation, inputs.reload);
|
|
9497
9512
|
const sendModel = normalizeModel(options.model);
|
|
9498
9513
|
inputs.applyModelOverride(sendModel);
|
|
@@ -9503,7 +9518,7 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9503
9518
|
if (inputs.options.onBeforeSend !== void 0) {
|
|
9504
9519
|
await inputs.options.onBeforeSend({
|
|
9505
9520
|
conversationId: inputs.agentId,
|
|
9506
|
-
previousMessageCount:
|
|
9521
|
+
previousMessageCount: chunkRMWTPV3M_cjs.getSessionMessages(inputs.agentId).length
|
|
9507
9522
|
});
|
|
9508
9523
|
}
|
|
9509
9524
|
await inputs.runPreHook(userText);
|
|
@@ -9515,8 +9530,8 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9515
9530
|
userText,
|
|
9516
9531
|
sendOptions: options
|
|
9517
9532
|
});
|
|
9518
|
-
const priorMessages = [...
|
|
9519
|
-
|
|
9533
|
+
const priorMessages = [...chunkRMWTPV3M_cjs.getSessionMessages(inputs.agentId)];
|
|
9534
|
+
chunkRMWTPV3M_cjs.appendSessionMessage(inputs.agentId, { role: "user", text: userText });
|
|
9520
9535
|
await persistMemoryFactIfWritePrompt(inputs.workspaceCwd, inputs.options.memory, userText);
|
|
9521
9536
|
const memoryFacts = await readMemoryForSend(inputs.workspaceCwd, inputs.options.memory, userText);
|
|
9522
9537
|
const portPathActive = shouldUsePortMemoryPath();
|
|
@@ -9574,7 +9589,7 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9574
9589
|
function buildCompletionCheckDeps() {
|
|
9575
9590
|
return {
|
|
9576
9591
|
judge: async (ctx, opts) => {
|
|
9577
|
-
const { judgeCallImpl } = await import('./judge-call-
|
|
9592
|
+
const { judgeCallImpl } = await import('./judge-call-LAHMBJ57.cjs');
|
|
9578
9593
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
9579
9594
|
return judgeCallImpl(ctx, opts, { create: getAgentFacade().create });
|
|
9580
9595
|
}
|
|
@@ -9600,7 +9615,7 @@ function registerRunAsTask(run, agentId, taskOpt, userText) {
|
|
|
9600
9615
|
promptPreview: userText.slice(0, 120),
|
|
9601
9616
|
...opts.meta ?? {}
|
|
9602
9617
|
};
|
|
9603
|
-
void
|
|
9618
|
+
void chunk3FFAEAUJ_cjs.submit({
|
|
9604
9619
|
kind: "run",
|
|
9605
9620
|
work: async (ctx) => {
|
|
9606
9621
|
ctx.signal.addEventListener(
|
|
@@ -9685,7 +9700,7 @@ var LocalAgent = class {
|
|
|
9685
9700
|
this.options = options;
|
|
9686
9701
|
this.workspaceCwd = resolveCwd(options.local?.cwd);
|
|
9687
9702
|
this.transcriptBaseDir = resolveSessionDir(options.local);
|
|
9688
|
-
this.sessionStore = options.local?.sessionStore ?? new
|
|
9703
|
+
this.sessionStore = options.local?.sessionStore ?? new chunkZLQSWSJ2_cjs.FsSessionStore({ baseDir: this.transcriptBaseDir, cwd: this.workspaceCwd });
|
|
9689
9704
|
this.settingSourcesIncludeProject = includesSetting(options, "project");
|
|
9690
9705
|
this.settingSourcesIncludePlugins = includesSetting(options, "plugins");
|
|
9691
9706
|
const sub = bootstrapSubmanagers({
|
|
@@ -9728,14 +9743,14 @@ var LocalAgent = class {
|
|
|
9728
9743
|
if (this.pluginsManager !== void 0) await this.pluginsManager.initialize();
|
|
9729
9744
|
const codePlugins = chunkBV2MWEMV_cjs.extractCodePlugins(this.options.plugins);
|
|
9730
9745
|
await this.pluginManagerCode.initialize(codePlugins);
|
|
9731
|
-
this.resolvedSubagents = await
|
|
9746
|
+
this.resolvedSubagents = await chunkCQBXOJ6U_cjs.loadSubagents(
|
|
9732
9747
|
this.workspaceCwd,
|
|
9733
9748
|
this.settingSourcesIncludeProject,
|
|
9734
9749
|
this.options.agents
|
|
9735
9750
|
);
|
|
9736
9751
|
await acquireLeaseIfPossible(this.sessionStore, this.agentId);
|
|
9737
9752
|
try {
|
|
9738
|
-
await
|
|
9753
|
+
await chunkRMWTPV3M_cjs.hydrateSession(this.agentId, { store: this.sessionStore, cwd: this.workspaceCwd });
|
|
9739
9754
|
await this.personalityStore.hydrate(this.agentId);
|
|
9740
9755
|
} catch (err) {
|
|
9741
9756
|
await releaseLeaseIfPossible(this.sessionStore, this.agentId);
|
|
@@ -9886,7 +9901,7 @@ var LocalAgent = class {
|
|
|
9886
9901
|
agentId: this.agentId
|
|
9887
9902
|
});
|
|
9888
9903
|
if (preRun.blocked) {
|
|
9889
|
-
throw new
|
|
9904
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
9890
9905
|
`preRun hook denied execution: ${preRun.reason ?? "unspecified"}`,
|
|
9891
9906
|
{ code: "hook_denied" }
|
|
9892
9907
|
);
|
|
@@ -9967,7 +9982,7 @@ var LocalAgent = class {
|
|
|
9967
9982
|
}
|
|
9968
9983
|
// biome-ignore format: G8 budget — see listArtifacts.
|
|
9969
9984
|
downloadArtifact(_path) {
|
|
9970
|
-
return Promise.reject(new
|
|
9985
|
+
return Promise.reject(new chunk4ZHTIJNE_cjs.UnsupportedRunOperationError("Artifacts are not supported for local agents", "downloadArtifact"));
|
|
9971
9986
|
}
|
|
9972
9987
|
// biome-ignore format: G8 budget — delegates to `local-agent-runtime-extensions.ts`; kept 1-line.
|
|
9973
9988
|
runUntil(goal, options) {
|
|
@@ -10012,7 +10027,7 @@ async function guardAgainstIdCollision(options) {
|
|
|
10012
10027
|
const persistenceCwd = resolveAgentPersistenceCwd(options);
|
|
10013
10028
|
await hydrateRegistryFromDisk(persistenceCwd);
|
|
10014
10029
|
if (getRegisteredAgent(options.agentId) !== void 0) {
|
|
10015
|
-
throw new
|
|
10030
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
10016
10031
|
`Agent "${options.agentId}" already exists. Use Agent.resume("${options.agentId}") to reattach, or pick a different agentId.`,
|
|
10017
10032
|
{ code: "agent_id_already_exists" }
|
|
10018
10033
|
);
|
|
@@ -10045,7 +10060,7 @@ async function maybeInjectHandoffTools(options) {
|
|
|
10045
10060
|
const spec = "@theokit/sdk-handoff/internal/tool-injector";
|
|
10046
10061
|
mod = await import(spec);
|
|
10047
10062
|
} catch (err) {
|
|
10048
|
-
throw new
|
|
10063
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
10049
10064
|
"Agent.create({ handoffs: [...] }) requires @theokit/sdk-handoff. Install it: pnpm add @theokit/sdk-handoff. Or migrate to the preferred plugin pattern: plugins: [Handoff.asPlugin({ targets: [...] })] (see docs/migration/1-x-to-2-0.md#handoff).",
|
|
10050
10065
|
{ code: "handoff_package_missing", cause: err }
|
|
10051
10066
|
);
|
|
@@ -10063,31 +10078,31 @@ async function maybeInjectHandoffTools(options) {
|
|
|
10063
10078
|
};
|
|
10064
10079
|
}
|
|
10065
10080
|
function keyWillFlowToProvider(apiKey, provider) {
|
|
10066
|
-
if (
|
|
10067
|
-
if (
|
|
10081
|
+
if (chunkKYAJINUI_cjs.isFixtureApiKey(apiKey)) return false;
|
|
10082
|
+
if (chunkKYAJINUI_cjs.getConfiguredBaseUrl() !== void 0) return false;
|
|
10068
10083
|
if (provider === void 0) return false;
|
|
10069
|
-
const profile =
|
|
10084
|
+
const profile = chunkJPBKYL3B_cjs.getProviderProfile(provider);
|
|
10070
10085
|
if (profile === void 0) return false;
|
|
10071
10086
|
return profile.authType !== "none";
|
|
10072
10087
|
}
|
|
10073
10088
|
function missingApiKeyMessage() {
|
|
10074
|
-
const present =
|
|
10075
|
-
const base = `Missing API key \u2014 set ${
|
|
10089
|
+
const present = chunkKYAJINUI_cjs.presentProviderCredentialEnvVars();
|
|
10090
|
+
const base = `Missing API key \u2014 set ${chunkXL7Q7HB2_cjs.API_KEY_ENV_VAR}, or pass \`apiKey\` to Agent.create()`;
|
|
10076
10091
|
if (present.length === 0) return `${base}.`;
|
|
10077
10092
|
return `${base}. ${present.join(" and ")} ${present.length === 1 ? "is" : "are"} set, but a provider credential is not read from the environment automatically \u2014 pass it explicitly, e.g. \`Agent.create({ apiKey: process.env.${present[0]}, ... })\`.`;
|
|
10078
10093
|
}
|
|
10079
10094
|
function providerNeedsCallerKey(provider) {
|
|
10080
10095
|
if (provider === void 0) return true;
|
|
10081
|
-
const profile =
|
|
10096
|
+
const profile = chunkJPBKYL3B_cjs.getProviderProfile(provider);
|
|
10082
10097
|
if (profile === void 0) return true;
|
|
10083
10098
|
return profile.authType === "api_key";
|
|
10084
10099
|
}
|
|
10085
10100
|
async function createLocalAgent(options) {
|
|
10086
10101
|
const provider = providerFromModelId(normalizeModel(options.model)?.id);
|
|
10087
|
-
const apiKey =
|
|
10102
|
+
const apiKey = chunkXL7Q7HB2_cjs.resolveApiKey(options.apiKey);
|
|
10088
10103
|
if (apiKey === void 0) {
|
|
10089
10104
|
if (providerNeedsCallerKey(provider)) {
|
|
10090
|
-
throw new
|
|
10105
|
+
throw new chunk4ZHTIJNE_cjs.AuthenticationError(missingApiKeyMessage(), { code: "missing_api_key" });
|
|
10091
10106
|
}
|
|
10092
10107
|
} else {
|
|
10093
10108
|
const willFlowToProvider = keyWillFlowToProvider(apiKey, provider);
|
|
@@ -10096,7 +10111,7 @@ async function createLocalAgent(options) {
|
|
|
10096
10111
|
...willFlowToProvider ? { provider } : {}
|
|
10097
10112
|
});
|
|
10098
10113
|
if (shape.malformed) {
|
|
10099
|
-
throw new
|
|
10114
|
+
throw new chunk4ZHTIJNE_cjs.AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
10100
10115
|
}
|
|
10101
10116
|
}
|
|
10102
10117
|
const agent = new LocalAgent(options);
|
|
@@ -10104,21 +10119,21 @@ async function createLocalAgent(options) {
|
|
|
10104
10119
|
return agent;
|
|
10105
10120
|
}
|
|
10106
10121
|
async function createCloudAgent(options) {
|
|
10107
|
-
const apiKey =
|
|
10122
|
+
const apiKey = chunkXL7Q7HB2_cjs.resolveApiKey(options.apiKey);
|
|
10108
10123
|
if (apiKey === void 0) {
|
|
10109
|
-
throw new
|
|
10124
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError("Missing API key for cloud agent", {
|
|
10110
10125
|
code: "missing_api_key"
|
|
10111
10126
|
});
|
|
10112
10127
|
}
|
|
10113
10128
|
const shape = validateApiKeyShape(apiKey);
|
|
10114
10129
|
if (shape.malformed) {
|
|
10115
|
-
throw new
|
|
10130
|
+
throw new chunk4ZHTIJNE_cjs.AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
10116
10131
|
}
|
|
10117
|
-
const baseUrl =
|
|
10132
|
+
const baseUrl = chunkKYAJINUI_cjs.getConfiguredBaseUrl();
|
|
10118
10133
|
if (baseUrl === void 0) {
|
|
10119
10134
|
return new CloudAgent(options);
|
|
10120
10135
|
}
|
|
10121
|
-
const response = await
|
|
10136
|
+
const response = await chunkKYAJINUI_cjs.httpRequest("/v1/agents", {
|
|
10122
10137
|
apiKey,
|
|
10123
10138
|
method: "POST",
|
|
10124
10139
|
body: {
|
|
@@ -10143,7 +10158,7 @@ function resolveAgentPersistenceCwd(options) {
|
|
|
10143
10158
|
return process.cwd();
|
|
10144
10159
|
}
|
|
10145
10160
|
async function rehydrateExistingAgent(agentId, existing, options) {
|
|
10146
|
-
await
|
|
10161
|
+
await chunkKYAJINUI_cjs.discoverProviderPlugins();
|
|
10147
10162
|
await validateRehydratedAgent(agentId, existing);
|
|
10148
10163
|
const mergedLocal = options.local !== void 0 && existing.options.local !== void 0 ? { ...existing.options.local, ...options.local } : options.local ?? existing.options.local;
|
|
10149
10164
|
const mergedOptions = {
|
|
@@ -10174,7 +10189,7 @@ async function validateRehydratedAgent(agentId, entry) {
|
|
|
10174
10189
|
throw new Error(`Workspace path is not a directory: ${candidate}`);
|
|
10175
10190
|
}
|
|
10176
10191
|
} catch (cause) {
|
|
10177
|
-
throw new
|
|
10192
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(
|
|
10178
10193
|
`Agent "${agentId}" cannot be rehydrated \u2014 workspace cwd "${candidate}" is missing or inaccessible.`,
|
|
10179
10194
|
{ code: "agent_rehydration_failed", cause }
|
|
10180
10195
|
);
|
|
@@ -10226,7 +10241,7 @@ async function getRegisteredAgentOrThrow(agentId, cwd = process.cwd()) {
|
|
|
10226
10241
|
agent = getRegisteredAgent(agentId);
|
|
10227
10242
|
}
|
|
10228
10243
|
if (agent === void 0) {
|
|
10229
|
-
throw new
|
|
10244
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(`Agent ${agentId} not found`, { code: "unknown_agent" });
|
|
10230
10245
|
}
|
|
10231
10246
|
return agent;
|
|
10232
10247
|
}
|
|
@@ -10287,7 +10302,7 @@ var Agent = class _Agent {
|
|
|
10287
10302
|
pluginCount: enabledPluginNames(options.plugins).length
|
|
10288
10303
|
});
|
|
10289
10304
|
try {
|
|
10290
|
-
await
|
|
10305
|
+
await chunkKYAJINUI_cjs.discoverProviderPlugins();
|
|
10291
10306
|
const agent = await runCreateUnderSpan(options, span);
|
|
10292
10307
|
return agent;
|
|
10293
10308
|
} catch (err) {
|
|
@@ -10328,8 +10343,8 @@ var Agent = class _Agent {
|
|
|
10328
10343
|
const run = await agent.send(message);
|
|
10329
10344
|
const result = await run.wait();
|
|
10330
10345
|
if (options.throwOnError === true && result.status === "error" && result.error !== void 0) {
|
|
10331
|
-
throw new
|
|
10332
|
-
code:
|
|
10346
|
+
throw new chunk4ZHTIJNE_cjs.AgentRunError(result.error.message, {
|
|
10347
|
+
code: chunk4ZHTIJNE_cjs.coerceToKnownAgentRunErrorCode(result.error.code),
|
|
10333
10348
|
cause: result.error.cause
|
|
10334
10349
|
});
|
|
10335
10350
|
}
|
|
@@ -10356,7 +10371,7 @@ var Agent = class _Agent {
|
|
|
10356
10371
|
if (existing !== void 0) {
|
|
10357
10372
|
return await rehydrateExistingAgent(agentId, existing, options);
|
|
10358
10373
|
}
|
|
10359
|
-
throw new
|
|
10374
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(
|
|
10360
10375
|
`Agent "${agentId}" not found. Use Agent.create({ agentId, ... }) for first-time setup, or catch UnknownAgentError to branch resume-vs-create.`,
|
|
10361
10376
|
{ code: "unknown_agent" }
|
|
10362
10377
|
);
|
|
@@ -10385,7 +10400,7 @@ var Agent = class _Agent {
|
|
|
10385
10400
|
* @public
|
|
10386
10401
|
*/
|
|
10387
10402
|
static async generateObject(options) {
|
|
10388
|
-
const { generateObjectImpl } = await import('./generate-object-
|
|
10403
|
+
const { generateObjectImpl } = await import('./generate-object-R7HTMW7F.cjs');
|
|
10389
10404
|
return generateObjectImpl(options, {
|
|
10390
10405
|
create: (opts) => _Agent.create(opts),
|
|
10391
10406
|
delete: (agentId) => _Agent.delete(agentId)
|
|
@@ -10409,7 +10424,7 @@ var Agent = class _Agent {
|
|
|
10409
10424
|
delete: (agentId) => _Agent.delete(agentId)
|
|
10410
10425
|
};
|
|
10411
10426
|
async function* wrapper() {
|
|
10412
|
-
streamObjectImport ??= import('./stream-object-
|
|
10427
|
+
streamObjectImport ??= import('./stream-object-ZJTQNKY3.cjs');
|
|
10413
10428
|
const { streamObjectImpl } = await streamObjectImport;
|
|
10414
10429
|
yield* streamObjectImpl(options, deps);
|
|
10415
10430
|
}
|
|
@@ -10433,7 +10448,7 @@ var Agent = class _Agent {
|
|
|
10433
10448
|
* @public
|
|
10434
10449
|
*/
|
|
10435
10450
|
static async batch(prompts, options) {
|
|
10436
|
-
const { batchImpl } = await import('./batch-
|
|
10451
|
+
const { batchImpl } = await import('./batch-BXYTW2DP.cjs');
|
|
10437
10452
|
return batchImpl(prompts, options, { create: (opts) => _Agent.create(opts) });
|
|
10438
10453
|
}
|
|
10439
10454
|
/**
|
|
@@ -10536,14 +10551,14 @@ var Agent = class _Agent {
|
|
|
10536
10551
|
*/
|
|
10537
10552
|
static async getRun(runId, options = {}) {
|
|
10538
10553
|
if (options.runtime === "cloud") {
|
|
10539
|
-
throw new
|
|
10554
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
10540
10555
|
"Cloud runtime is pre-release. Theo PaaS endpoints are not wired yet \u2014 getRun({ runtime: 'cloud' }) will be enabled when the PaaS ships.",
|
|
10541
10556
|
{ code: "cloud_runtime_pre_release" }
|
|
10542
10557
|
);
|
|
10543
10558
|
}
|
|
10544
10559
|
const existing = getRun(runId);
|
|
10545
10560
|
if (existing !== void 0) return existing;
|
|
10546
|
-
throw new
|
|
10561
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(
|
|
10547
10562
|
`Run ${runId} is not in this process's registry. It may have been disposed, persisted in a previous process, or never created.`,
|
|
10548
10563
|
{ code: "run_not_found" }
|
|
10549
10564
|
);
|
|
@@ -10590,13 +10605,13 @@ var Agent = class _Agent {
|
|
|
10590
10605
|
reg = getRegisteredAgent(agentId);
|
|
10591
10606
|
}
|
|
10592
10607
|
if (reg === void 0 || reg.runtime !== "local") {
|
|
10593
|
-
throw new
|
|
10608
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(
|
|
10594
10609
|
`No local agent "${agentId}" registered \u2014 compact targets local sessions.`
|
|
10595
10610
|
);
|
|
10596
10611
|
}
|
|
10597
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
10612
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-QV57KR66.cjs');
|
|
10598
10613
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
10599
|
-
return
|
|
10614
|
+
return chunkRMWTPV3M_cjs.enqueueSessionWrite(
|
|
10600
10615
|
cwd,
|
|
10601
10616
|
agentId,
|
|
10602
10617
|
() => compactSessionTranscript({
|
|
@@ -10626,11 +10641,11 @@ var Agent = class _Agent {
|
|
|
10626
10641
|
reg = getRegisteredAgent(agentId);
|
|
10627
10642
|
}
|
|
10628
10643
|
if (reg === void 0 || reg.runtime !== "local") {
|
|
10629
|
-
throw new
|
|
10644
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(
|
|
10630
10645
|
`No local agent "${agentId}" registered \u2014 injectSessionTurn targets local sessions.`
|
|
10631
10646
|
);
|
|
10632
10647
|
}
|
|
10633
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
10648
|
+
const { injectSessionTurn } = await import('./inject-session-WQKMC3GR.cjs');
|
|
10634
10649
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
10635
10650
|
await injectSessionTurn({
|
|
10636
10651
|
store,
|
|
@@ -10665,11 +10680,11 @@ var Agent = class _Agent {
|
|
|
10665
10680
|
reg = getRegisteredAgent(agentId);
|
|
10666
10681
|
}
|
|
10667
10682
|
if (reg === void 0 || reg.runtime !== "local") {
|
|
10668
|
-
throw new
|
|
10683
|
+
throw new chunk4ZHTIJNE_cjs.UnknownAgentError(
|
|
10669
10684
|
`No local agent "${agentId}" registered \u2014 transcript targets local sessions.`
|
|
10670
10685
|
);
|
|
10671
10686
|
}
|
|
10672
|
-
const { readSessionMessages } = await import('./agent-session-store-
|
|
10687
|
+
const { readSessionMessages } = await import('./agent-session-store-6EL5NPA4.cjs');
|
|
10673
10688
|
const { store } = await openLocalStore(reg);
|
|
10674
10689
|
return readSessionMessages(store, agentId);
|
|
10675
10690
|
}
|
|
@@ -10690,7 +10705,7 @@ var Agent = class _Agent {
|
|
|
10690
10705
|
*/
|
|
10691
10706
|
static async describe(agentId) {
|
|
10692
10707
|
const agent = await getRegisteredAgentOrThrow(agentId);
|
|
10693
|
-
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-
|
|
10708
|
+
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-YEUFFPAL.cjs');
|
|
10694
10709
|
const settingSources = agent.options.local?.settingSources;
|
|
10695
10710
|
const subagents = await loadSubagents2(
|
|
10696
10711
|
agent.cwd ?? process.cwd(),
|
|
@@ -10734,12 +10749,12 @@ async function getOrCreateUncached(agentId, options) {
|
|
|
10734
10749
|
try {
|
|
10735
10750
|
return await Agent.resume(agentId, options);
|
|
10736
10751
|
} catch (err) {
|
|
10737
|
-
if (!(err instanceof
|
|
10752
|
+
if (!(err instanceof chunk4ZHTIJNE_cjs.UnknownAgentError)) throw err;
|
|
10738
10753
|
}
|
|
10739
10754
|
try {
|
|
10740
10755
|
return await Agent.create({ ...options, agentId });
|
|
10741
10756
|
} catch (err) {
|
|
10742
|
-
if (err instanceof
|
|
10757
|
+
if (err instanceof chunk4ZHTIJNE_cjs.ConfigurationError && err.code === "agent_id_already_exists") {
|
|
10743
10758
|
return await Agent.resume(agentId, options);
|
|
10744
10759
|
}
|
|
10745
10760
|
throw err;
|
|
@@ -10757,8 +10772,8 @@ async function openLocalStore(reg) {
|
|
|
10757
10772
|
const cwd = reg.cwd ?? process.cwd();
|
|
10758
10773
|
const optModel = reg.options.model;
|
|
10759
10774
|
const model = reg.model?.id ?? (typeof optModel === "string" ? optModel : optModel?.id) ?? "unknown";
|
|
10760
|
-
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-
|
|
10761
|
-
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-
|
|
10775
|
+
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-4PIHT5UX.cjs');
|
|
10776
|
+
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-6WNITKRE.cjs');
|
|
10762
10777
|
const configuredSessionDir = reg.options.local?.sessionDir ?? reg.options.local?.baseDir;
|
|
10763
10778
|
const baseDir = configuredSessionDir !== void 0 ? expandTilde2(configuredSessionDir) : defaultBaseDir2();
|
|
10764
10779
|
return { cwd, model, store: new FsSessionStore2({ baseDir, cwd }) };
|
|
@@ -10775,5 +10790,5 @@ exports.computeCost = computeCost;
|
|
|
10775
10790
|
exports.generateCronId = generateCronId;
|
|
10776
10791
|
exports.getPricingEntry = getPricingEntry;
|
|
10777
10792
|
exports.openRouterMemoryEmbeddingProviderAdapter = openRouterMemoryEmbeddingProviderAdapter;
|
|
10778
|
-
//# sourceMappingURL=chunk-
|
|
10779
|
-
//# sourceMappingURL=chunk-
|
|
10793
|
+
//# sourceMappingURL=chunk-ZMRD5DZQ.cjs.map
|
|
10794
|
+
//# sourceMappingURL=chunk-ZMRD5DZQ.cjs.map
|