@theokit/sdk 5.6.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -0
- package/dist/a2a/index.cjs +6 -6
- package/dist/a2a/index.js +2 -2
- package/dist/{agent-82d_DrCL.d.cts → agent-3RcPVGMo.d.cts} +22 -4
- package/dist/agent-7ERQNV66.js +59 -0
- package/dist/{agent-JJZM2VIK.js.map → agent-7ERQNV66.js.map} +1 -1
- package/dist/agent-LNTR4QH5.cjs +68 -0
- package/dist/{agent-47NS6ZVL.cjs.map → agent-LNTR4QH5.cjs.map} +1 -1
- package/dist/{agent-G6g-uwcB.d.ts → agent-lS68mYIL.d.ts} +22 -4
- package/dist/agent.d.ts +11 -0
- package/dist/auth/index.cjs +32 -32
- package/dist/auth/index.js +5 -5
- package/dist/{batch-US4F6WPK.js → batch-427O54FQ.js} +7 -7
- package/dist/{batch-US4F6WPK.js.map → batch-427O54FQ.js.map} +1 -1
- package/dist/{batch-I6T6MXZO.cjs → batch-U4SO4RLX.cjs} +24 -24
- package/dist/{batch-I6T6MXZO.cjs.map → batch-U4SO4RLX.cjs.map} +1 -1
- package/dist/{chunk-44I6UYVH.js → chunk-26NEAJ6T.js} +4 -4
- package/dist/{chunk-44I6UYVH.js.map → chunk-26NEAJ6T.js.map} +1 -1
- package/dist/{chunk-GCHZMH42.cjs → chunk-2STSX2SY.cjs} +264 -260
- package/dist/chunk-2STSX2SY.cjs.map +1 -0
- package/dist/{chunk-2UXQASTX.js → chunk-3CU5J7V3.js} +38 -34
- package/dist/chunk-3CU5J7V3.js.map +1 -0
- package/dist/{chunk-5NELQ6LB.js → chunk-4QCJAJAG.js} +12 -3
- package/dist/chunk-4QCJAJAG.js.map +1 -0
- package/dist/{chunk-XYFGKVZ7.js → chunk-53RDNK3H.js} +3 -3
- package/dist/{chunk-XYFGKVZ7.js.map → chunk-53RDNK3H.js.map} +1 -1
- package/dist/{chunk-2QKV4CGK.js → chunk-5522X223.js} +3 -3
- package/dist/{chunk-2QKV4CGK.js.map → chunk-5522X223.js.map} +1 -1
- package/dist/{chunk-EH6XD3FY.js → chunk-5DD4NJN3.js} +3 -3
- package/dist/{chunk-EH6XD3FY.js.map → chunk-5DD4NJN3.js.map} +1 -1
- package/dist/{chunk-V22DZIXO.js → chunk-5Q4RTLMP.js} +3 -3
- package/dist/{chunk-V22DZIXO.js.map → chunk-5Q4RTLMP.js.map} +1 -1
- package/dist/{chunk-4A3SKJ53.cjs → chunk-6PB5AQCY.cjs} +14 -14
- package/dist/{chunk-4A3SKJ53.cjs.map → chunk-6PB5AQCY.cjs.map} +1 -1
- package/dist/{chunk-PRZ3BES7.cjs → chunk-72CPLZPC.cjs} +5 -5
- package/dist/{chunk-PRZ3BES7.cjs.map → chunk-72CPLZPC.cjs.map} +1 -1
- package/dist/{chunk-GFFBXSQT.cjs → chunk-76PIKR4P.cjs} +22 -22
- package/dist/{chunk-GFFBXSQT.cjs.map → chunk-76PIKR4P.cjs.map} +1 -1
- package/dist/{chunk-EFMFILPG.js → chunk-7F7XE6CM.js} +3 -3
- package/dist/{chunk-EFMFILPG.js.map → chunk-7F7XE6CM.js.map} +1 -1
- package/dist/{chunk-N2KAIZ5D.js → chunk-7GDHFV2M.js} +4 -20
- package/dist/chunk-7GDHFV2M.js.map +1 -0
- package/dist/{chunk-CA5VUAP3.js → chunk-7HUCU3KK.js} +5 -5
- package/dist/{chunk-CA5VUAP3.js.map → chunk-7HUCU3KK.js.map} +1 -1
- package/dist/{chunk-4MMWFSCD.js → chunk-7JAKO3NM.js} +3 -3
- package/dist/{chunk-4MMWFSCD.js.map → chunk-7JAKO3NM.js.map} +1 -1
- package/dist/{chunk-UADQJBHR.cjs → chunk-7NQ7HJ3E.cjs} +6 -6
- package/dist/{chunk-UADQJBHR.cjs.map → chunk-7NQ7HJ3E.cjs.map} +1 -1
- package/dist/{chunk-HG4UN4MN.cjs → chunk-AOHRKGAA.cjs} +22 -22
- package/dist/{chunk-HG4UN4MN.cjs.map → chunk-AOHRKGAA.cjs.map} +1 -1
- package/dist/{chunk-C4ZQPWXJ.cjs → chunk-ARMFXTY6.cjs} +143 -190
- package/dist/chunk-ARMFXTY6.cjs.map +1 -0
- package/dist/{chunk-5WKQDIGO.js → chunk-AY43232P.js} +4 -4
- package/dist/{chunk-5WKQDIGO.js.map → chunk-AY43232P.js.map} +1 -1
- package/dist/{chunk-7FDKWDA2.cjs → chunk-B3XXQX6L.cjs} +7 -7
- package/dist/{chunk-7FDKWDA2.cjs.map → chunk-B3XXQX6L.cjs.map} +1 -1
- package/dist/{chunk-ALUN2B4W.js → chunk-B5MHRQJZ.js} +9 -3
- package/dist/chunk-B5MHRQJZ.js.map +1 -0
- package/dist/{chunk-TA3K7SBK.js → chunk-BKMDRBJ7.js} +3 -3
- package/dist/{chunk-TA3K7SBK.js.map → chunk-BKMDRBJ7.js.map} +1 -1
- package/dist/{chunk-FUSDYC2B.cjs → chunk-CQYBJOB2.cjs} +4 -4
- package/dist/{chunk-FUSDYC2B.cjs.map → chunk-CQYBJOB2.cjs.map} +1 -1
- package/dist/{chunk-7JJ3A6AT.cjs → chunk-D5KXKBEN.cjs} +5 -5
- package/dist/{chunk-7JJ3A6AT.cjs.map → chunk-D5KXKBEN.cjs.map} +1 -1
- package/dist/{chunk-HUDNLFY4.js → chunk-DDRX4LYS.js} +13 -4
- package/dist/chunk-DDRX4LYS.js.map +1 -0
- package/dist/{chunk-QDM3OHUT.cjs → chunk-ECD6ER3E.cjs} +4 -4
- package/dist/{chunk-QDM3OHUT.cjs.map → chunk-ECD6ER3E.cjs.map} +1 -1
- package/dist/{chunk-JMDDYA22.js → chunk-EJROML3Q.js} +4 -4
- package/dist/{chunk-JMDDYA22.js.map → chunk-EJROML3Q.js.map} +1 -1
- package/dist/{chunk-FPIY5CLV.js → chunk-FRL35MFN.js} +5 -5
- package/dist/{chunk-FPIY5CLV.js.map → chunk-FRL35MFN.js.map} +1 -1
- package/dist/{chunk-EIQFAOFD.js → chunk-GGRPAQ3B.js} +3 -3
- package/dist/{chunk-EIQFAOFD.js.map → chunk-GGRPAQ3B.js.map} +1 -1
- package/dist/{chunk-HCT4HPCL.cjs → chunk-GHHIJEFX.cjs} +4 -4
- package/dist/{chunk-HCT4HPCL.cjs.map → chunk-GHHIJEFX.cjs.map} +1 -1
- package/dist/{chunk-7A6535RA.cjs → chunk-GM54F4FE.cjs} +9 -9
- package/dist/{chunk-7A6535RA.cjs.map → chunk-GM54F4FE.cjs.map} +1 -1
- package/dist/{chunk-6M2OIS4Y.js → chunk-GMRFAX4I.js} +74 -4
- package/dist/chunk-GMRFAX4I.js.map +1 -0
- package/dist/{chunk-O6USDERH.js → chunk-GMSRRJ53.js} +3 -3
- package/dist/{chunk-O6USDERH.js.map → chunk-GMSRRJ53.js.map} +1 -1
- package/dist/{chunk-VE6DFSKU.js → chunk-GTX6FEDP.js} +3 -3
- package/dist/{chunk-VE6DFSKU.js.map → chunk-GTX6FEDP.js.map} +1 -1
- package/dist/{chunk-NJWYQWDL.js → chunk-H3CVJSFC.js} +3 -3
- package/dist/{chunk-NJWYQWDL.js.map → chunk-H3CVJSFC.js.map} +1 -1
- package/dist/{chunk-MYJGWS2J.cjs → chunk-HG5LKFG7.cjs} +16 -16
- package/dist/{chunk-MYJGWS2J.cjs.map → chunk-HG5LKFG7.cjs.map} +1 -1
- package/dist/{chunk-55GB6JYQ.js → chunk-HOHR75KF.js} +5 -5
- package/dist/{chunk-55GB6JYQ.js.map → chunk-HOHR75KF.js.map} +1 -1
- package/dist/{chunk-GBCVPKHE.js → chunk-HV4V63CO.js} +3 -3
- package/dist/{chunk-GBCVPKHE.js.map → chunk-HV4V63CO.js.map} +1 -1
- package/dist/{chunk-I2PWY7VM.cjs → chunk-IIYJMXYW.cjs} +4 -4
- package/dist/{chunk-I2PWY7VM.cjs.map → chunk-IIYJMXYW.cjs.map} +1 -1
- package/dist/chunk-J4SA2ZEJ.cjs +24 -0
- package/dist/chunk-J4SA2ZEJ.cjs.map +1 -0
- package/dist/{chunk-ATT276RD.cjs → chunk-J5623RIV.cjs} +78 -6
- package/dist/chunk-J5623RIV.cjs.map +1 -0
- package/dist/{chunk-KVSAY6NZ.cjs → chunk-J6GXS5A2.cjs} +13 -13
- package/dist/{chunk-KVSAY6NZ.cjs.map → chunk-J6GXS5A2.cjs.map} +1 -1
- package/dist/{chunk-NQTD6QOW.cjs → chunk-JW3GVLM6.cjs} +4 -4
- package/dist/{chunk-NQTD6QOW.cjs.map → chunk-JW3GVLM6.cjs.map} +1 -1
- package/dist/{chunk-TFG5IBZS.cjs → chunk-KGZ66JVZ.cjs} +14 -14
- package/dist/{chunk-TFG5IBZS.cjs.map → chunk-KGZ66JVZ.cjs.map} +1 -1
- package/dist/{chunk-47TF32NQ.js → chunk-KO6SHCEH.js} +3 -3
- package/dist/{chunk-47TF32NQ.js.map → chunk-KO6SHCEH.js.map} +1 -1
- package/dist/{chunk-EIOMN5VA.cjs → chunk-KTA7YTZQ.cjs} +17 -8
- package/dist/chunk-KTA7YTZQ.cjs.map +1 -0
- package/dist/{chunk-D6POWE7E.cjs → chunk-MEUBLCM4.cjs} +11 -11
- package/dist/{chunk-D6POWE7E.cjs.map → chunk-MEUBLCM4.cjs.map} +1 -1
- package/dist/{chunk-VWUXIVEI.js → chunk-MFZODA5Y.js} +5 -5
- package/dist/{chunk-VWUXIVEI.js.map → chunk-MFZODA5Y.js.map} +1 -1
- package/dist/{chunk-4HS6FFGL.cjs → chunk-MPQJE3G4.cjs} +15 -15
- package/dist/{chunk-4HS6FFGL.cjs.map → chunk-MPQJE3G4.cjs.map} +1 -1
- package/dist/{chunk-QRVS2PRE.cjs → chunk-MPR2ISL2.cjs} +4 -4
- package/dist/{chunk-QRVS2PRE.cjs.map → chunk-MPR2ISL2.cjs.map} +1 -1
- package/dist/{chunk-UOLBAPDM.js → chunk-MQGSOKR3.js} +3 -3
- package/dist/{chunk-UOLBAPDM.js.map → chunk-MQGSOKR3.js.map} +1 -1
- package/dist/{chunk-HFEJE7AC.js → chunk-MU7IAA7G.js} +9 -9
- package/dist/{chunk-HFEJE7AC.js.map → chunk-MU7IAA7G.js.map} +1 -1
- package/dist/{chunk-EXTRW7GW.cjs → chunk-NAGPKWOD.cjs} +4 -4
- package/dist/{chunk-EXTRW7GW.cjs.map → chunk-NAGPKWOD.cjs.map} +1 -1
- package/dist/{chunk-KTTHHYEW.cjs → chunk-NJSIAJEK.cjs} +4 -4
- package/dist/{chunk-KTTHHYEW.cjs.map → chunk-NJSIAJEK.cjs.map} +1 -1
- package/dist/{chunk-Z3NTRKIC.cjs → chunk-NKIQTLFA.cjs} +4 -4
- package/dist/{chunk-Z3NTRKIC.cjs.map → chunk-NKIQTLFA.cjs.map} +1 -1
- package/dist/{chunk-KZSKIUXZ.js → chunk-NOO6GZTZ.js} +37 -85
- package/dist/chunk-NOO6GZTZ.js.map +1 -0
- package/dist/{chunk-7IZKTQ5G.cjs → chunk-OCEQ6DW2.cjs} +10 -29
- package/dist/chunk-OCEQ6DW2.cjs.map +1 -0
- package/dist/{chunk-BJUJT5ED.cjs → chunk-OF2CLCTH.cjs} +4 -4
- package/dist/{chunk-BJUJT5ED.cjs.map → chunk-OF2CLCTH.cjs.map} +1 -1
- package/dist/{chunk-HUFSABUZ.cjs → chunk-OLSEWLK5.cjs} +6 -6
- package/dist/{chunk-HUFSABUZ.cjs.map → chunk-OLSEWLK5.cjs.map} +1 -1
- package/dist/{chunk-DQZU7JK6.cjs → chunk-P22BZE7G.cjs} +4 -4
- package/dist/{chunk-DQZU7JK6.cjs.map → chunk-P22BZE7G.cjs.map} +1 -1
- package/dist/{chunk-QWD3CZWE.cjs → chunk-P7NNKEWO.cjs} +4 -4
- package/dist/{chunk-QWD3CZWE.cjs.map → chunk-P7NNKEWO.cjs.map} +1 -1
- package/dist/chunk-PQCTDMUI.js +20 -0
- package/dist/chunk-PQCTDMUI.js.map +1 -0
- package/dist/{chunk-DZG77WU7.cjs → chunk-PSLCVSCS.cjs} +3 -3
- package/dist/{chunk-DZG77WU7.cjs.map → chunk-PSLCVSCS.cjs.map} +1 -1
- package/dist/{chunk-STGSMJMJ.js → chunk-QDQQYRJI.js} +4 -4
- package/dist/{chunk-STGSMJMJ.js.map → chunk-QDQQYRJI.js.map} +1 -1
- package/dist/{chunk-7MMTZBTT.js → chunk-R2C3HXR3.js} +4 -4
- package/dist/{chunk-7MMTZBTT.js.map → chunk-R2C3HXR3.js.map} +1 -1
- package/dist/chunk-R3ZQBPA5.cjs +18 -0
- package/dist/{chunk-ANMJJD6D.cjs.map → chunk-R3ZQBPA5.cjs.map} +1 -1
- package/dist/{chunk-4NLCWGH7.cjs → chunk-RA7IE4NK.cjs} +15 -15
- package/dist/{chunk-4NLCWGH7.cjs.map → chunk-RA7IE4NK.cjs.map} +1 -1
- package/dist/{chunk-UBR5PWD7.js → chunk-SUVCHX4L.js} +3 -3
- package/dist/{chunk-UBR5PWD7.js.map → chunk-SUVCHX4L.js.map} +1 -1
- package/dist/{chunk-LD6HASA5.cjs → chunk-SWALPLFQ.cjs} +12 -2
- package/dist/chunk-SWALPLFQ.cjs.map +1 -0
- package/dist/{chunk-52FDUJSV.cjs → chunk-T5KOSR5Y.cjs} +11 -11
- package/dist/{chunk-52FDUJSV.cjs.map → chunk-T5KOSR5Y.cjs.map} +1 -1
- package/dist/{chunk-BZ3YMAMP.js → chunk-TC4RWP3Y.js} +6 -6
- package/dist/{chunk-BZ3YMAMP.js.map → chunk-TC4RWP3Y.js.map} +1 -1
- package/dist/{chunk-XB4GI5RZ.js → chunk-TE6XVTOA.js} +3 -3
- package/dist/{chunk-XB4GI5RZ.js.map → chunk-TE6XVTOA.js.map} +1 -1
- package/dist/{chunk-VUHXC74Q.cjs → chunk-TTBIQTO5.cjs} +19 -19
- package/dist/{chunk-VUHXC74Q.cjs.map → chunk-TTBIQTO5.cjs.map} +1 -1
- package/dist/{chunk-J7J7J2GN.cjs → chunk-UNFBHV46.cjs} +9 -2
- package/dist/chunk-UNFBHV46.cjs.map +1 -0
- package/dist/{chunk-AAEZSPTC.js → chunk-UNZOJVVC.js} +4 -4
- package/dist/{chunk-AAEZSPTC.js.map → chunk-UNZOJVVC.js.map} +1 -1
- package/dist/{chunk-T3ZDEYTJ.js → chunk-W4VQMXBZ.js} +4 -4
- package/dist/{chunk-T3ZDEYTJ.js.map → chunk-W4VQMXBZ.js.map} +1 -1
- package/dist/{chunk-24SYBZPL.cjs → chunk-WPO3VCY4.cjs} +9 -9
- package/dist/{chunk-24SYBZPL.cjs.map → chunk-WPO3VCY4.cjs.map} +1 -1
- package/dist/{chunk-IUMAQURF.js → chunk-X6DUEDAF.js} +3 -3
- package/dist/{chunk-IUMAQURF.js.map → chunk-X6DUEDAF.js.map} +1 -1
- package/dist/{chunk-CFE6QF2Q.js → chunk-XCQ432OX.js} +3 -3
- package/dist/{chunk-CFE6QF2Q.js.map → chunk-XCQ432OX.js.map} +1 -1
- package/dist/{chunk-QWD4RDZ3.cjs → chunk-XDUGSTYJ.cjs} +15 -15
- package/dist/{chunk-QWD4RDZ3.cjs.map → chunk-XDUGSTYJ.cjs.map} +1 -1
- package/dist/{chunk-K2VMFZQ5.js → chunk-XKMVJ443.js} +5 -5
- package/dist/{chunk-K2VMFZQ5.js.map → chunk-XKMVJ443.js.map} +1 -1
- package/dist/{chunk-RWPLWMCZ.cjs → chunk-XW4POZ6V.cjs} +11 -11
- package/dist/{chunk-RWPLWMCZ.cjs.map → chunk-XW4POZ6V.cjs.map} +1 -1
- package/dist/{chunk-6PWOWXMC.js → chunk-XZHJYSPB.js} +3 -3
- package/dist/{chunk-6PWOWXMC.js.map → chunk-XZHJYSPB.js.map} +1 -1
- package/dist/{chunk-QC55H6RJ.cjs → chunk-YRJA2POB.cjs} +9 -9
- package/dist/{chunk-QC55H6RJ.cjs.map → chunk-YRJA2POB.cjs.map} +1 -1
- package/dist/{chunk-DMRT67Y6.js → chunk-ZJZ7LV3A.js} +3 -3
- package/dist/{chunk-DMRT67Y6.js.map → chunk-ZJZ7LV3A.js.map} +1 -1
- package/dist/{chunk-G7BLGBRN.js → chunk-ZWFTECOE.js} +3 -3
- package/dist/{chunk-G7BLGBRN.js.map → chunk-ZWFTECOE.js.map} +1 -1
- package/dist/compact-session-2N3ZYJTW.js +24 -0
- package/dist/{compact-session-YSEK7NQF.js.map → compact-session-2N3ZYJTW.js.map} +1 -1
- package/dist/compact-session-RBPLUPCK.cjs +65 -0
- package/dist/{compact-session-7FMYJXQ7.cjs.map → compact-session-RBPLUPCK.cjs.map} +1 -1
- package/dist/compaction.cjs +20 -16
- package/dist/compaction.d.cts +2 -0
- package/dist/compaction.d.ts +2 -0
- package/dist/compaction.js +2 -2
- package/dist/concurrency.cjs +5 -5
- package/dist/concurrency.js +3 -3
- package/dist/context/index.cjs +15 -7
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.d.cts +2 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +7 -3
- package/dist/context/index.js.map +1 -1
- package/dist/context-SXR2HLHT.js +7 -0
- package/dist/{context-J5BJ3LBS.js.map → context-SXR2HLHT.js.map} +1 -1
- package/dist/context-ZOULM2RB.cjs +24 -0
- package/dist/{context-HR4KMXMA.cjs.map → context-ZOULM2RB.cjs.map} +1 -1
- package/dist/{cron-DWv69ZSD.d.cts → cron-CGxoEKlx.d.cts} +2 -2
- package/dist/{cron-GynWtAax.d.ts → cron-DJv8zMa3.d.ts} +2 -2
- package/dist/cron.cjs +34 -33
- package/dist/cron.d.cts +4 -4
- package/dist/cron.d.ts +4 -4
- package/dist/cron.js +33 -32
- package/dist/{errors-DrDEgyz1.d.cts → errors-BWOJeWTZ.d.cts} +25 -2
- package/dist/{errors-CLOAyuiv.d.ts → errors-DDvG18IB.d.ts} +25 -2
- package/dist/errors.cjs +25 -21
- package/dist/errors.d.cts +2 -2
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +1 -1
- package/dist/eval.cjs +44 -43
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +34 -33
- package/dist/eval.js.map +1 -1
- package/dist/{executor-XQAOQOHD.cjs → executor-2SUGI3ZT.cjs} +21 -21
- package/dist/{executor-XQAOQOHD.cjs.map → executor-2SUGI3ZT.cjs.map} +1 -1
- package/dist/{executor-ZNDQDX6Q.js → executor-3NI7KNL4.js} +6 -6
- package/dist/{executor-ZNDQDX6Q.js.map → executor-3NI7KNL4.js.map} +1 -1
- package/dist/filesystem/index.cjs +11 -11
- package/dist/filesystem/index.js +2 -2
- package/dist/fs-session-store-JHBJFKVV.cjs +19 -0
- package/dist/{fs-session-store-E4U3P56L.cjs.map → fs-session-store-JHBJFKVV.cjs.map} +1 -1
- package/dist/fs-session-store-STZZFXH2.js +10 -0
- package/dist/{fs-session-store-77JU46UZ.js.map → fs-session-store-STZZFXH2.js.map} +1 -1
- package/dist/generate-object-NTKAWE7D.js +7 -0
- package/dist/{generate-object-BXV7BZRP.js.map → generate-object-NTKAWE7D.js.map} +1 -1
- package/dist/generate-object-YHTWG5DB.cjs +20 -0
- package/dist/{generate-object-YBI2TDJ3.cjs.map → generate-object-YHTWG5DB.cjs.map} +1 -1
- package/dist/index-manager-ONQJSWX5.js +17 -0
- package/dist/{index-manager-27WLNQEE.js.map → index-manager-ONQJSWX5.js.map} +1 -1
- package/dist/{index-manager-BBHDKMQS.cjs → index-manager-ZGJN25FD.cjs} +9 -9
- package/dist/{index-manager-BBHDKMQS.cjs.map → index-manager-ZGJN25FD.cjs.map} +1 -1
- package/dist/index.cjs +148 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -10
- package/dist/index.d.ts +57 -10
- package/dist/index.js +49 -48
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-PC73TMP2.cjs → inject-session-3FPXJDJP.cjs} +4 -4
- package/dist/{inject-session-PC73TMP2.cjs.map → inject-session-3FPXJDJP.cjs.map} +1 -1
- package/dist/{inject-session-J4LBWAPH.js → inject-session-YNNOE3O6.js} +3 -3
- package/dist/{inject-session-J4LBWAPH.js.map → inject-session-YNNOE3O6.js.map} +1 -1
- package/dist/interactive/index.cjs +3 -3
- package/dist/interactive/index.js +1 -1
- package/dist/internal/memory/adapters/index.cjs +7 -7
- package/dist/internal/memory/adapters/index.js +6 -6
- package/dist/internal/memory/storage/index.cjs +35 -35
- package/dist/internal/memory/storage/index.js +6 -6
- package/dist/internal/persistence/index.cjs +11 -11
- package/dist/internal/persistence/index.js +3 -3
- package/dist/internal/runtime/compression/compression-model-registry.d.ts +1 -0
- package/dist/internal/runtime/compression/compression-summarizer.d.ts +0 -14
- package/dist/internal/runtime/context/context-discovery.d.ts +42 -0
- package/dist/internal/runtime/context/context-loaders.d.ts +5 -1
- package/dist/internal/security/index.cjs +9 -9
- package/dist/internal/security/index.js +2 -2
- package/dist/internal/session/compact-session.d.ts +36 -0
- package/dist/judge-call-AQQYK6VT.cjs +22 -0
- package/dist/{judge-call-46M2E5FA.cjs.map → judge-call-AQQYK6VT.cjs.map} +1 -1
- package/dist/judge-call-LOL5FQEX.js +5 -0
- package/dist/{judge-call-FGUNNWEI.js.map → judge-call-LOL5FQEX.js.map} +1 -1
- package/dist/mcp-auth.cjs +9 -9
- package/dist/mcp-auth.js +2 -2
- package/dist/models.cjs +15 -15
- package/dist/models.js +6 -6
- package/dist/oauth-transaction-store-NP2YHZ6D.js +5 -0
- package/dist/{oauth-transaction-store-5RIR6D5C.js.map → oauth-transaction-store-NP2YHZ6D.js.map} +1 -1
- package/dist/oauth-transaction-store-ZINDV7AF.cjs +38 -0
- package/dist/{oauth-transaction-store-SXIE57OD.cjs.map → oauth-transaction-store-ZINDV7AF.cjs.map} +1 -1
- package/dist/path-safety.cjs +9 -9
- package/dist/path-safety.js +2 -2
- package/dist/persistence.cjs +16 -16
- package/dist/persistence.js +4 -4
- package/dist/project.cjs +5 -5
- package/dist/project.js +2 -2
- package/dist/providers.cjs +8 -8
- package/dist/providers.js +6 -6
- package/dist/{registry-DMWCJKRF.js → registry-5FK42CRV.js} +6 -6
- package/dist/{registry-DMWCJKRF.js.map → registry-5FK42CRV.js.map} +1 -1
- package/dist/{registry-BZQFYRTL.cjs → registry-BVTNO73E.cjs} +14 -14
- package/dist/{registry-BZQFYRTL.cjs.map → registry-BVTNO73E.cjs.map} +1 -1
- package/dist/retry.cjs +3 -3
- package/dist/retry.js +2 -2
- package/dist/{run-CTAdRU3U.d.cts → run-DsA5Ip2i.d.cts} +1 -1
- package/dist/{run-CTAdRU3U.d.ts → run-DsA5Ip2i.d.ts} +1 -1
- package/dist/sandbox/index.cjs +18 -18
- package/dist/sandbox/index.js +3 -3
- package/dist/{sdk-agent-BOiKqOgL.d.cts → sdk-agent-dNwjwCt5.d.cts} +2 -2
- package/dist/{sdk-agent-D4a_BR_6.d.ts → sdk-agent-wEOLXD3F.d.ts} +2 -2
- package/dist/server/auth/index.cjs +21 -21
- package/dist/server/auth/index.js +6 -6
- package/dist/server/errors-envelope.cjs +13 -13
- package/dist/server/errors-envelope.d.cts +2 -2
- package/dist/server/errors-envelope.d.ts +2 -2
- package/dist/server/errors-envelope.js +2 -2
- package/dist/skills.cjs +7 -7
- package/dist/skills.js +4 -4
- package/dist/stream-object-QAEHG4YO.js +7 -0
- package/dist/{stream-object-HBFMIZLD.js.map → stream-object-QAEHG4YO.js.map} +1 -1
- package/dist/stream-object-TKVGGA54.cjs +20 -0
- package/dist/{stream-object-QSKHISDJ.cjs.map → stream-object-TKVGGA54.cjs.map} +1 -1
- package/dist/subagents-loader-7GE7YUDI.cjs +16 -0
- package/dist/{subagents-loader-MOO7DC4E.cjs.map → subagents-loader-7GE7YUDI.cjs.map} +1 -1
- package/dist/subagents-loader-S2PMZY7J.js +7 -0
- package/dist/{subagents-loader-CJFYQQU2.js.map → subagents-loader-S2PMZY7J.js.map} +1 -1
- package/dist/subagents-loader.cjs +5 -5
- package/dist/subagents-loader.d.cts +3 -3
- package/dist/subagents-loader.d.ts +3 -3
- package/dist/subagents-loader.js +3 -3
- package/dist/subscription/index.cjs +3 -2
- package/dist/subscription/index.d.cts +1 -1
- package/dist/subscription/index.d.ts +1 -1
- package/dist/subscription/index.js +2 -2
- package/dist/task-store.cjs +5 -5
- package/dist/task-store.js +2 -2
- package/dist/types/agent.d.ts +1 -1
- package/dist/workflow.cjs +25 -25
- package/dist/workflow.d.cts +2 -2
- package/dist/workflow.d.ts +2 -2
- package/dist/workflow.js +4 -4
- package/docs/error-codes.md +1 -1
- package/docs/harness-capability-map.md +17 -1
- package/package.json +1 -1
- package/dist/agent-47NS6ZVL.cjs +0 -67
- package/dist/agent-JJZM2VIK.js +0 -58
- package/dist/chunk-2UXQASTX.js.map +0 -1
- package/dist/chunk-5NELQ6LB.js.map +0 -1
- package/dist/chunk-6M2OIS4Y.js.map +0 -1
- package/dist/chunk-7IZKTQ5G.cjs.map +0 -1
- package/dist/chunk-ALUN2B4W.js.map +0 -1
- package/dist/chunk-ANMJJD6D.cjs +0 -18
- package/dist/chunk-ATT276RD.cjs.map +0 -1
- package/dist/chunk-C4ZQPWXJ.cjs.map +0 -1
- package/dist/chunk-EIOMN5VA.cjs.map +0 -1
- package/dist/chunk-GCHZMH42.cjs.map +0 -1
- package/dist/chunk-HUDNLFY4.js.map +0 -1
- package/dist/chunk-J7J7J2GN.cjs.map +0 -1
- package/dist/chunk-KZSKIUXZ.js.map +0 -1
- package/dist/chunk-LD6HASA5.cjs.map +0 -1
- package/dist/chunk-N2KAIZ5D.js.map +0 -1
- package/dist/compact-session-7FMYJXQ7.cjs +0 -61
- package/dist/compact-session-YSEK7NQF.js +0 -24
- package/dist/context-HR4KMXMA.cjs +0 -23
- package/dist/context-J5BJ3LBS.js +0 -6
- package/dist/fs-session-store-77JU46UZ.js +0 -10
- package/dist/fs-session-store-E4U3P56L.cjs +0 -19
- package/dist/generate-object-BXV7BZRP.js +0 -7
- package/dist/generate-object-YBI2TDJ3.cjs +0 -20
- package/dist/index-manager-27WLNQEE.js +0 -17
- package/dist/judge-call-46M2E5FA.cjs +0 -22
- package/dist/judge-call-FGUNNWEI.js +0 -5
- package/dist/oauth-transaction-store-5RIR6D5C.js +0 -5
- package/dist/oauth-transaction-store-SXIE57OD.cjs +0 -38
- package/dist/stream-object-HBFMIZLD.js +0 -7
- package/dist/stream-object-QSKHISDJ.cjs +0 -20
- package/dist/subagents-loader-CJFYQQU2.js +0 -7
- package/dist/subagents-loader-MOO7DC4E.cjs +0 -16
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkJ6GXS5A2_cjs = require('./chunk-J6GXS5A2.cjs');
|
|
4
|
+
var chunkPSLCVSCS_cjs = require('./chunk-PSLCVSCS.cjs');
|
|
5
|
+
var chunkTTBIQTO5_cjs = require('./chunk-TTBIQTO5.cjs');
|
|
6
|
+
var chunkJ4SA2ZEJ_cjs = require('./chunk-J4SA2ZEJ.cjs');
|
|
7
7
|
var chunkBV2MWEMV_cjs = require('./chunk-BV2MWEMV.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkMEUBLCM4_cjs = require('./chunk-MEUBLCM4.cjs');
|
|
9
9
|
var chunkTMKTSYDS_cjs = require('./chunk-TMKTSYDS.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var chunk76PIKR4P_cjs = require('./chunk-76PIKR4P.cjs');
|
|
11
|
+
var chunkB3XXQX6L_cjs = require('./chunk-B3XXQX6L.cjs');
|
|
12
|
+
var chunkARMFXTY6_cjs = require('./chunk-ARMFXTY6.cjs');
|
|
13
13
|
var chunk2ZPEDVLM_cjs = require('./chunk-2ZPEDVLM.cjs');
|
|
14
|
-
var
|
|
14
|
+
var chunkKTA7YTZQ_cjs = require('./chunk-KTA7YTZQ.cjs');
|
|
15
|
+
var chunkOCEQ6DW2_cjs = require('./chunk-OCEQ6DW2.cjs');
|
|
15
16
|
var chunkRQMCOFAI_cjs = require('./chunk-RQMCOFAI.cjs');
|
|
16
17
|
var chunkAA27GEYS_cjs = require('./chunk-AA27GEYS.cjs');
|
|
17
18
|
var chunkYSTXFWQE_cjs = require('./chunk-YSTXFWQE.cjs');
|
|
18
|
-
var
|
|
19
|
+
var chunkJW3GVLM6_cjs = require('./chunk-JW3GVLM6.cjs');
|
|
19
20
|
var chunkNINIJCHU_cjs = require('./chunk-NINIJCHU.cjs');
|
|
20
|
-
var
|
|
21
|
+
var chunkHG5LKFG7_cjs = require('./chunk-HG5LKFG7.cjs');
|
|
21
22
|
var chunkIJ7M6GOG_cjs = require('./chunk-IJ7M6GOG.cjs');
|
|
22
|
-
var
|
|
23
|
+
var chunkGM54F4FE_cjs = require('./chunk-GM54F4FE.cjs');
|
|
23
24
|
var chunkSA6K24NB_cjs = require('./chunk-SA6K24NB.cjs');
|
|
24
|
-
var
|
|
25
|
+
var chunkIIYJMXYW_cjs = require('./chunk-IIYJMXYW.cjs');
|
|
25
26
|
var chunkGZV6AVRL_cjs = require('./chunk-GZV6AVRL.cjs');
|
|
26
|
-
var
|
|
27
|
+
var chunkOF2CLCTH_cjs = require('./chunk-OF2CLCTH.cjs');
|
|
27
28
|
var chunkZF2LDKQQ_cjs = require('./chunk-ZF2LDKQQ.cjs');
|
|
28
29
|
var chunkJLRLCBJ4_cjs = require('./chunk-JLRLCBJ4.cjs');
|
|
29
|
-
var
|
|
30
|
+
var chunkXW4POZ6V_cjs = require('./chunk-XW4POZ6V.cjs');
|
|
30
31
|
var chunkTY56BKSK_cjs = require('./chunk-TY56BKSK.cjs');
|
|
31
|
-
var
|
|
32
|
-
var
|
|
32
|
+
var chunkMPR2ISL2_cjs = require('./chunk-MPR2ISL2.cjs');
|
|
33
|
+
var chunkJ5623RIV_cjs = require('./chunk-J5623RIV.cjs');
|
|
33
34
|
var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
|
|
34
|
-
var
|
|
35
|
-
var
|
|
35
|
+
var chunkR3ZQBPA5_cjs = require('./chunk-R3ZQBPA5.cjs');
|
|
36
|
+
var chunkYRJA2POB_cjs = require('./chunk-YRJA2POB.cjs');
|
|
36
37
|
var chunkNVXXWAU7_cjs = require('./chunk-NVXXWAU7.cjs');
|
|
37
|
-
var
|
|
38
|
+
var chunkUNFBHV46_cjs = require('./chunk-UNFBHV46.cjs');
|
|
38
39
|
var chunk6LHQPOMI_cjs = require('./chunk-6LHQPOMI.cjs');
|
|
39
40
|
var promises = require('fs/promises');
|
|
40
41
|
var crypto = require('crypto');
|
|
@@ -161,7 +162,7 @@ async function agentGenerate(agent, agentModel, agentApiKey, agentLocal, input,
|
|
|
161
162
|
const { output, maxRetries, errorStrategy, ...sendOptions } = options;
|
|
162
163
|
const run = await agent.send(input, sendOptions);
|
|
163
164
|
const result = await run.wait();
|
|
164
|
-
const { generateObjectImpl, GenerateObjectError } = await import('./generate-object-
|
|
165
|
+
const { generateObjectImpl, GenerateObjectError } = await import('./generate-object-YHTWG5DB.cjs');
|
|
165
166
|
const answer = structurableAnswerOrThrow(result, GenerateObjectError);
|
|
166
167
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
167
168
|
const facade = getAgentFacade();
|
|
@@ -250,7 +251,7 @@ function normalizeModel(m) {
|
|
|
250
251
|
if (m === void 0 || typeof m !== "string") return m;
|
|
251
252
|
const id = m.trim();
|
|
252
253
|
if (id.length === 0) {
|
|
253
|
-
throw new
|
|
254
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
254
255
|
'model must be a non-empty "provider/model" id string or a ModelSelection object',
|
|
255
256
|
{ code: "invalid_model_selection" }
|
|
256
257
|
);
|
|
@@ -819,7 +820,7 @@ async function readLegacyFacts(jsonPath) {
|
|
|
819
820
|
}
|
|
820
821
|
async function writeMigratedFacts(cwd, jsonPath, facts) {
|
|
821
822
|
try {
|
|
822
|
-
for (const fact of facts) await
|
|
823
|
+
for (const fact of facts) await chunk76PIKR4P_cjs.appendFactToMarkdown(cwd, fact);
|
|
823
824
|
await promises.unlink(jsonPath).catch(() => void 0);
|
|
824
825
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] migrated ${facts.length} fact(s) from ${jsonPath} to MEMORY.md
|
|
825
826
|
`);
|
|
@@ -836,11 +837,11 @@ async function migrateLegacyJson(cwd, config) {
|
|
|
836
837
|
const key = `${cwd}::${config.namespace ?? "default"}::${config.scope ?? "agent"}::${config.userId ?? "default"}`;
|
|
837
838
|
if (migrationRun.has(key)) return { migrated: false, factCount: 0, reason: "already-migrated" };
|
|
838
839
|
migrationRun.add(key);
|
|
839
|
-
const jsonPath =
|
|
840
|
+
const jsonPath = chunk76PIKR4P_cjs.legacyMemoryJsonPath(cwd, config);
|
|
840
841
|
if (!await fileExists(jsonPath)) {
|
|
841
842
|
return { migrated: false, factCount: 0, reason: "no-legacy-json" };
|
|
842
843
|
}
|
|
843
|
-
if (await fileExists(
|
|
844
|
+
if (await fileExists(chunk76PIKR4P_cjs.memoryMdPath(chunk76PIKR4P_cjs.resolveMemoryRoot(cwd, config)))) {
|
|
844
845
|
chunk6LHQPOMI_cjs.diag(
|
|
845
846
|
`[theokit-sdk] memory migration skipped: both MEMORY.md and legacy JSON exist at ${jsonPath}; leaving both intact
|
|
846
847
|
`
|
|
@@ -869,19 +870,19 @@ function unstoredRememberWarning(message) {
|
|
|
869
870
|
if (isMemoryWritePrompt(message) && extractMemoryFact(message).length > 0) return void 0;
|
|
870
871
|
const trimmed = message.trim();
|
|
871
872
|
const quoted = trimmed.length > QUOTED_MESSAGE_MAX ? `${trimmed.slice(0, QUOTED_MESSAGE_MAX)}\u2026` : trimmed;
|
|
872
|
-
return `[theokit-sdk] NOTHING WAS STORED \u2014 this message does not match the memory capture pattern: ${JSON.stringify(quoted)}. Supported: "Remember: <fact>" or "Remember (${
|
|
873
|
+
return `[theokit-sdk] NOTHING WAS STORED \u2014 this message does not match the memory capture pattern: ${JSON.stringify(quoted)}. Supported: "Remember: <fact>" or "Remember (${chunk76PIKR4P_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.`;
|
|
873
874
|
}
|
|
874
875
|
function extractMemoryKind(message) {
|
|
875
876
|
const match = REMEMBER_PATTERN.exec(message);
|
|
876
877
|
const declared = match?.[1];
|
|
877
878
|
if (declared === void 0) return void 0;
|
|
878
879
|
const lowered = declared.toLowerCase();
|
|
879
|
-
return
|
|
880
|
+
return chunk76PIKR4P_cjs.MEMORY_KINDS.includes(lowered) ? lowered : void 0;
|
|
880
881
|
}
|
|
881
882
|
async function readMemoryFacts(cwd, config) {
|
|
882
883
|
if (!config.enabled) return [];
|
|
883
884
|
await migrateLegacyJson(cwd, config);
|
|
884
|
-
return
|
|
885
|
+
return chunk76PIKR4P_cjs.readFacts(cwd, config);
|
|
885
886
|
}
|
|
886
887
|
async function appendMemoryFact(cwd, config, fact) {
|
|
887
888
|
if (!config.enabled) return;
|
|
@@ -890,7 +891,7 @@ async function appendMemoryFact(cwd, config, fact) {
|
|
|
890
891
|
text: chunk6LHQPOMI_cjs.redactSecrets(fact.text),
|
|
891
892
|
...fact.kind === void 0 ? {} : { kind: fact.kind }
|
|
892
893
|
};
|
|
893
|
-
await
|
|
894
|
+
await chunk76PIKR4P_cjs.appendFact(cwd, config, sanitized);
|
|
894
895
|
}
|
|
895
896
|
|
|
896
897
|
// src/internal/runtime/fixtures/fixture-scripts.ts
|
|
@@ -1561,7 +1562,7 @@ function createRealCloudRun(options) {
|
|
|
1561
1562
|
conversation: []
|
|
1562
1563
|
};
|
|
1563
1564
|
const apiKey = chunk6LHQPOMI_cjs.resolveApiKey(options.agentOptions.apiKey);
|
|
1564
|
-
const baseUrl =
|
|
1565
|
+
const baseUrl = chunkARMFXTY6_cjs.getConfiguredBaseUrl();
|
|
1565
1566
|
const handle = new RealCloudRun(
|
|
1566
1567
|
{
|
|
1567
1568
|
id,
|
|
@@ -1634,7 +1635,7 @@ var RealCloudRun = class extends FixtureRunBase {
|
|
|
1634
1635
|
});
|
|
1635
1636
|
if (!response.ok) {
|
|
1636
1637
|
const text = await response.text().catch(() => "");
|
|
1637
|
-
throw new
|
|
1638
|
+
throw new chunkUNFBHV46_cjs.NetworkError(
|
|
1638
1639
|
`Cloud Run endpoint returned ${response.status}: ${text.slice(0, 200)}`,
|
|
1639
1640
|
{ code: "cloud_run_http_error" }
|
|
1640
1641
|
);
|
|
@@ -1644,7 +1645,7 @@ var RealCloudRun = class extends FixtureRunBase {
|
|
|
1644
1645
|
async consumeStream(response) {
|
|
1645
1646
|
let finalStatus = "finished";
|
|
1646
1647
|
let finalText = "";
|
|
1647
|
-
for await (const record of
|
|
1648
|
+
for await (const record of chunkARMFXTY6_cjs.parseSseStream(response.body, this.controller.signal)) {
|
|
1648
1649
|
const parsed = safeParse(record.data);
|
|
1649
1650
|
if (parsed === void 0) continue;
|
|
1650
1651
|
const update = this.applyRecord(record.event, parsed);
|
|
@@ -1724,7 +1725,7 @@ function toWireStatus(token) {
|
|
|
1724
1725
|
const match = WIRE_STATUSES.find((candidate) => candidate === upper);
|
|
1725
1726
|
if (match !== void 0) return match;
|
|
1726
1727
|
}
|
|
1727
|
-
throw new
|
|
1728
|
+
throw new chunkUNFBHV46_cjs.NetworkError(
|
|
1728
1729
|
`Cloud Run stream reported an unrecognised status ${JSON.stringify(token)}; expected one of ${WIRE_STATUSES.join(", ")} (case-insensitive)`,
|
|
1729
1730
|
{ code: "cloud_run_unknown_status" }
|
|
1730
1731
|
);
|
|
@@ -1734,7 +1735,7 @@ function toRunStatus(token) {
|
|
|
1734
1735
|
const mapped = SERVER_STATUS_TO_RUN_STATUS[token.toLowerCase()];
|
|
1735
1736
|
if (mapped !== void 0) return mapped;
|
|
1736
1737
|
}
|
|
1737
|
-
throw new
|
|
1738
|
+
throw new chunkUNFBHV46_cjs.NetworkError(
|
|
1738
1739
|
`Cloud Run stream reported an unrecognised status ${JSON.stringify(token)}; expected one of ${Object.keys(SERVER_STATUS_TO_RUN_STATUS).join(", ")} (case-insensitive)`,
|
|
1739
1740
|
{ code: "cloud_run_unknown_status" }
|
|
1740
1741
|
);
|
|
@@ -1811,7 +1812,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1811
1812
|
*/
|
|
1812
1813
|
isFixtureMode() {
|
|
1813
1814
|
const apiKey = chunk6LHQPOMI_cjs.resolveApiKey(this.options.apiKey);
|
|
1814
|
-
return
|
|
1815
|
+
return chunkARMFXTY6_cjs.isFixtureApiKey(apiKey) && chunkARMFXTY6_cjs.getConfiguredBaseUrl() === void 0;
|
|
1815
1816
|
}
|
|
1816
1817
|
// SE9 — integrated structured output; delegates to the shared helper.
|
|
1817
1818
|
generate(message, options) {
|
|
@@ -1825,9 +1826,9 @@ var CloudAgent = class _CloudAgent {
|
|
|
1825
1826
|
);
|
|
1826
1827
|
}
|
|
1827
1828
|
async send(message, options = {}) {
|
|
1828
|
-
if (this.disposed) throw new
|
|
1829
|
+
if (this.disposed) throw new chunkUNFBHV46_cjs.AgentDisposedError(this.agentId);
|
|
1829
1830
|
if (options.tools !== void 0 && options.tools.length > 0) {
|
|
1830
|
-
throw new
|
|
1831
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
1831
1832
|
"Custom inline tools are local-only in SDK v1.0 \u2014 cloud agents cannot serialize handler functions",
|
|
1832
1833
|
{ code: "cloud_custom_tools_rejected" }
|
|
1833
1834
|
);
|
|
@@ -1863,7 +1864,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1863
1864
|
const userText = typeof message === "string" ? message : message.text;
|
|
1864
1865
|
const systemPrompt = await this.resolveSystemPromptForSend(userText, options);
|
|
1865
1866
|
const apiKey = chunk6LHQPOMI_cjs.resolveApiKey(this.options.apiKey);
|
|
1866
|
-
const useRealRuntime = apiKey !== void 0 && !
|
|
1867
|
+
const useRealRuntime = apiKey !== void 0 && !chunkARMFXTY6_cjs.isFixtureApiKey(apiKey) && chunkARMFXTY6_cjs.getConfiguredBaseUrl() !== void 0;
|
|
1867
1868
|
return useRealRuntime ? createRealCloudRun({
|
|
1868
1869
|
agentId: this.agentId,
|
|
1869
1870
|
model: this.model ?? { id: DEFAULT_AGENTIC_MODEL_ID },
|
|
@@ -1912,7 +1913,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1912
1913
|
listArtifacts() {
|
|
1913
1914
|
if (!this.isFixtureMode()) {
|
|
1914
1915
|
return Promise.reject(
|
|
1915
|
-
new
|
|
1916
|
+
new chunkUNFBHV46_cjs.ConfigurationError(
|
|
1916
1917
|
"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).",
|
|
1917
1918
|
{ code: "cloud_runtime_pre_release" }
|
|
1918
1919
|
)
|
|
@@ -1922,11 +1923,11 @@ var CloudAgent = class _CloudAgent {
|
|
|
1922
1923
|
}
|
|
1923
1924
|
downloadArtifact(path) {
|
|
1924
1925
|
try {
|
|
1925
|
-
|
|
1926
|
+
chunkGM54F4FE_cjs.validateArtifactPath(path);
|
|
1926
1927
|
} catch (cause) {
|
|
1927
|
-
if (cause instanceof
|
|
1928
|
+
if (cause instanceof chunkGM54F4FE_cjs.PathTraversalError) {
|
|
1928
1929
|
return Promise.reject(
|
|
1929
|
-
new
|
|
1930
|
+
new chunkUNFBHV46_cjs.ConfigurationError(`Artifact path must stay inside the workspace: ${path}`, {
|
|
1930
1931
|
code: "artifact_path_traversal",
|
|
1931
1932
|
cause
|
|
1932
1933
|
})
|
|
@@ -1936,7 +1937,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1936
1937
|
}
|
|
1937
1938
|
if (!this.isFixtureMode()) {
|
|
1938
1939
|
return Promise.reject(
|
|
1939
|
-
new
|
|
1940
|
+
new chunkUNFBHV46_cjs.ConfigurationError(
|
|
1940
1941
|
"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).",
|
|
1941
1942
|
{ code: "cloud_runtime_pre_release" }
|
|
1942
1943
|
)
|
|
@@ -1945,7 +1946,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1945
1946
|
const match = buildFixtureArtifacts().find((artifact) => artifact.path === path);
|
|
1946
1947
|
if (match === void 0) {
|
|
1947
1948
|
return Promise.reject(
|
|
1948
|
-
new
|
|
1949
|
+
new chunkUNFBHV46_cjs.UnknownAgentError(`Artifact ${path} not found`, { code: "unknown_artifact" })
|
|
1949
1950
|
);
|
|
1950
1951
|
}
|
|
1951
1952
|
return Promise.resolve(Buffer.from(`fixture artifact content for ${path}
|
|
@@ -1959,7 +1960,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1959
1960
|
* @public
|
|
1960
1961
|
*/
|
|
1961
1962
|
runUntil() {
|
|
1962
|
-
throw new
|
|
1963
|
+
throw new chunkUNFBHV46_cjs.UnsupportedRunOperationError(
|
|
1963
1964
|
"Agent.runUntil() is not supported on cloud agents. Cloud runtime manages goal loops server-side. Use a local agent for autonomous Ralph loops.",
|
|
1964
1965
|
"runUntil"
|
|
1965
1966
|
);
|
|
@@ -1970,7 +1971,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1970
1971
|
* @public
|
|
1971
1972
|
*/
|
|
1972
1973
|
fork() {
|
|
1973
|
-
throw new
|
|
1974
|
+
throw new chunkUNFBHV46_cjs.UnsupportedRunOperationError(
|
|
1974
1975
|
"Agent.fork() is not supported on cloud agents. Fork inheritance requires local credential + system-prompt access. Use a local agent.",
|
|
1975
1976
|
"fork"
|
|
1976
1977
|
);
|
|
@@ -1982,7 +1983,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1982
1983
|
* @public
|
|
1983
1984
|
*/
|
|
1984
1985
|
runToCompletion() {
|
|
1985
|
-
throw new
|
|
1986
|
+
throw new chunkUNFBHV46_cjs.UnsupportedRunOperationError(
|
|
1986
1987
|
"Agent.runToCompletion() is not supported on cloud agents. Cloud runtime manages continuation server-side. Use a local agent.",
|
|
1987
1988
|
"runToCompletion"
|
|
1988
1989
|
);
|
|
@@ -1994,7 +1995,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
1994
1995
|
* @public
|
|
1995
1996
|
*/
|
|
1996
1997
|
streamToCompletion() {
|
|
1997
|
-
throw new
|
|
1998
|
+
throw new chunkUNFBHV46_cjs.UnsupportedRunOperationError(
|
|
1998
1999
|
"Agent.streamToCompletion() is not supported on cloud agents. Cloud runtime manages continuation server-side. Use a local agent.",
|
|
1999
2000
|
"streamToCompletion"
|
|
2000
2001
|
);
|
|
@@ -2008,7 +2009,7 @@ var CloudAgent = class _CloudAgent {
|
|
|
2008
2009
|
*/
|
|
2009
2010
|
usePersonality() {
|
|
2010
2011
|
return Promise.reject(
|
|
2011
|
-
new
|
|
2012
|
+
new chunkUNFBHV46_cjs.UnsupportedRunOperationError(
|
|
2012
2013
|
"Agent.usePersonality() is not supported on cloud agents (pre-release). Use a local agent or wait for cloud GA.",
|
|
2013
2014
|
"usePersonality"
|
|
2014
2015
|
)
|
|
@@ -2036,7 +2037,7 @@ function validateCloudToolParity(options) {
|
|
|
2036
2037
|
function rejectProcessors(options) {
|
|
2037
2038
|
const hasProcessors = (options.inputProcessors?.length ?? 0) > 0 || (options.outputProcessors?.length ?? 0) > 0;
|
|
2038
2039
|
if (hasProcessors) {
|
|
2039
|
-
throw new
|
|
2040
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2040
2041
|
"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.",
|
|
2041
2042
|
{ code: "cloud_incompatible_function_resolver" }
|
|
2042
2043
|
);
|
|
@@ -2044,7 +2045,7 @@ function rejectProcessors(options) {
|
|
|
2044
2045
|
}
|
|
2045
2046
|
function rejectFunctionSystemPrompt(options) {
|
|
2046
2047
|
if (typeof options.systemPrompt === "function") {
|
|
2047
|
-
throw new
|
|
2048
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2048
2049
|
"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.",
|
|
2049
2050
|
{ code: "cloud_incompatible_function_resolver" }
|
|
2050
2051
|
);
|
|
@@ -2052,7 +2053,7 @@ function rejectFunctionSystemPrompt(options) {
|
|
|
2052
2053
|
}
|
|
2053
2054
|
function rejectFunctionSkills(options) {
|
|
2054
2055
|
if (typeof options.skills === "function") {
|
|
2055
|
-
throw new
|
|
2056
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2056
2057
|
"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.",
|
|
2057
2058
|
{ code: "cloud_incompatible_function_resolver" }
|
|
2058
2059
|
);
|
|
@@ -2064,7 +2065,7 @@ function rejectStdioMcpLocalPaths(options) {
|
|
|
2064
2065
|
if (!isStdioCommandConfig(config)) continue;
|
|
2065
2066
|
const command = config.command ?? "";
|
|
2066
2067
|
if (isLocalPath(command)) {
|
|
2067
|
-
throw new
|
|
2068
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2068
2069
|
`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.`,
|
|
2069
2070
|
{ code: "cloud_incompatible_mcp_stdio_local" }
|
|
2070
2071
|
);
|
|
@@ -2123,14 +2124,14 @@ async function readState(filePath) {
|
|
|
2123
2124
|
try {
|
|
2124
2125
|
parsed = JSON.parse(raw);
|
|
2125
2126
|
} catch {
|
|
2126
|
-
|
|
2127
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
2127
2128
|
"personality-store-json-parse",
|
|
2128
2129
|
"[theokit-sdk] personality.json is malformed; treating as empty"
|
|
2129
2130
|
);
|
|
2130
2131
|
return emptyState();
|
|
2131
2132
|
}
|
|
2132
2133
|
if (!isStateV1(parsed)) {
|
|
2133
|
-
|
|
2134
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
2134
2135
|
"personality-store-bad-version",
|
|
2135
2136
|
`[theokit-sdk] personality.json has unknown version; treating as empty (file kept untouched)`
|
|
2136
2137
|
);
|
|
@@ -2161,7 +2162,7 @@ var PersonalityStore = class {
|
|
|
2161
2162
|
try {
|
|
2162
2163
|
await this.#persist(agentId, slug);
|
|
2163
2164
|
} catch (err) {
|
|
2164
|
-
|
|
2165
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
2165
2166
|
`personality-store-persist-failure-${agentId}`,
|
|
2166
2167
|
`[theokit-sdk] personality persist failed for ${chunk6LHQPOMI_cjs.redactSecrets(agentId)}: ${chunk6LHQPOMI_cjs.redactSecrets(
|
|
2167
2168
|
err.message
|
|
@@ -2178,7 +2179,7 @@ var PersonalityStore = class {
|
|
|
2178
2179
|
try {
|
|
2179
2180
|
state = await readState(filePath);
|
|
2180
2181
|
} catch (err) {
|
|
2181
|
-
|
|
2182
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
2182
2183
|
`personality-store-hydrate-failure-${agentId}`,
|
|
2183
2184
|
`[theokit-sdk] personality hydrate failed for ${chunk6LHQPOMI_cjs.redactSecrets(agentId)}: ${chunk6LHQPOMI_cjs.redactSecrets(
|
|
2184
2185
|
err.message
|
|
@@ -2197,7 +2198,7 @@ var PersonalityStore = class {
|
|
|
2197
2198
|
async #persist(agentId, slug) {
|
|
2198
2199
|
const filePath = this.#filePath();
|
|
2199
2200
|
await promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
2200
|
-
await
|
|
2201
|
+
await chunkOF2CLCTH_cjs.withFileLock(filePath, async () => {
|
|
2201
2202
|
const current = await readState(filePath);
|
|
2202
2203
|
const nextAgents = { ...current.agents };
|
|
2203
2204
|
if (slug === void 0) delete nextAgents[agentId];
|
|
@@ -2323,7 +2324,7 @@ var PluginManager = class {
|
|
|
2323
2324
|
*/
|
|
2324
2325
|
async register(plugin) {
|
|
2325
2326
|
if (plugin.kind !== "general") {
|
|
2326
|
-
throw new
|
|
2327
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2327
2328
|
`late register supports general plugins only (got "${plugin.kind}" for "${plugin.name}")`,
|
|
2328
2329
|
{ code: "plugin_late_register_kind" }
|
|
2329
2330
|
);
|
|
@@ -2727,7 +2728,7 @@ var HooksExecutor = class {
|
|
|
2727
2728
|
config = {};
|
|
2728
2729
|
async initialize(settingSourcesIncludeProject) {
|
|
2729
2730
|
if (readManagedSettings(this.policy.managedSettingsRoot).disableAllHooks === true) {
|
|
2730
|
-
|
|
2731
|
+
chunkOCEQ6DW2_cjs.warnFailureOnce(
|
|
2731
2732
|
"hooks-disabled-by-policy",
|
|
2732
2733
|
"[theokit-sdk] hooks: an operator policy (managed-settings.json) declares disableAllHooks \u2014 NO hook will run, including any this project declared."
|
|
2733
2734
|
);
|
|
@@ -2738,7 +2739,7 @@ var HooksExecutor = class {
|
|
|
2738
2739
|
this.config = {};
|
|
2739
2740
|
return;
|
|
2740
2741
|
}
|
|
2741
|
-
this.config = await
|
|
2742
|
+
this.config = await chunkOCEQ6DW2_cjs.loadHookConfig(this.cwd, this.compatSources);
|
|
2742
2743
|
}
|
|
2743
2744
|
/** Fire every hook registered for `event` and aggregate the decisions. */
|
|
2744
2745
|
async run(payload) {
|
|
@@ -2901,11 +2902,11 @@ function sessionTranscriptAllowed(memory) {
|
|
|
2901
2902
|
}
|
|
2902
2903
|
function resolveWindowForRun(model, contextWindow) {
|
|
2903
2904
|
const override = contextWindow !== void 0 && contextWindow > 0 ? contextWindow : void 0;
|
|
2904
|
-
return
|
|
2905
|
+
return chunkJ5623RIV_cjs.resolveEffectiveContextWindow({
|
|
2905
2906
|
...override !== void 0 ? { override } : {},
|
|
2906
|
-
catalog:
|
|
2907
|
-
margin:
|
|
2908
|
-
floor:
|
|
2907
|
+
catalog: chunkYRJA2POB_cjs.getCatalogModelInfo(model)?.limit?.context,
|
|
2908
|
+
margin: chunkJ5623RIV_cjs.CONTEXT_WINDOW_MARGIN,
|
|
2909
|
+
floor: chunkJ5623RIV_cjs.CONTEXT_WINDOW_FLOOR
|
|
2909
2910
|
});
|
|
2910
2911
|
}
|
|
2911
2912
|
async function runPostRunLifecycle(inputs) {
|
|
@@ -2928,7 +2929,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2928
2929
|
try {
|
|
2929
2930
|
const partial = await safeConversation(run);
|
|
2930
2931
|
if (partial !== void 0) {
|
|
2931
|
-
|
|
2932
|
+
chunkPSLCVSCS_cjs.persistTurnToTranscript(sessionStore, { cwd: workspaceCwd, agentId, model }, agentId, {
|
|
2932
2933
|
userText,
|
|
2933
2934
|
conversation: partial
|
|
2934
2935
|
});
|
|
@@ -2938,22 +2939,22 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2938
2939
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] partial transcript write failed (${agentId}): ${msg}
|
|
2939
2940
|
`);
|
|
2940
2941
|
}
|
|
2941
|
-
await
|
|
2942
|
+
await chunkPSLCVSCS_cjs.flushSessionWrites();
|
|
2942
2943
|
return;
|
|
2943
2944
|
}
|
|
2944
2945
|
if (result.result !== void 0) {
|
|
2945
|
-
|
|
2946
|
+
chunkPSLCVSCS_cjs.appendSessionMessage(agentId, { role: "assistant", text: result.result });
|
|
2946
2947
|
}
|
|
2947
2948
|
const conversation = await safeConversation(run);
|
|
2948
2949
|
const resolvedWindow = resolveWindowForRun(model, contextWindow);
|
|
2949
2950
|
const effectiveWindow = resolvedWindow.window;
|
|
2950
2951
|
const budgetEvent = buildContextBudgetEvent(model, resolvedWindow);
|
|
2951
2952
|
if (budgetEvent !== void 0 && onRunEvent !== void 0) {
|
|
2952
|
-
|
|
2953
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(onRunEvent, budgetEvent);
|
|
2953
2954
|
}
|
|
2954
2955
|
const lastRequestUsage = result.usage?.requests?.at(-1)?.totalTokens;
|
|
2955
2956
|
const usageForTrigger = lastRequestUsage ?? result.usage?.totalTokens;
|
|
2956
|
-
|
|
2957
|
+
chunkPSLCVSCS_cjs.persistTurnToTranscript(
|
|
2957
2958
|
sessionStore,
|
|
2958
2959
|
{ cwd: workspaceCwd, agentId, model },
|
|
2959
2960
|
agentId,
|
|
@@ -2965,20 +2966,20 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2965
2966
|
// The EFFECTIVE window (after override, clamp and margin) — not the declared one. Swapping for
|
|
2966
2967
|
// `contextWindow` here would budget against a number the clamp already rejected.
|
|
2967
2968
|
contextWindow: effectiveWindow,
|
|
2968
|
-
summarize:
|
|
2969
|
+
summarize: chunkARMFXTY6_cjs.buildDefaultSummarizer({
|
|
2969
2970
|
agentModel: model,
|
|
2970
2971
|
...inputs.apiKey !== void 0 ? { apiKey: inputs.apiKey } : {}
|
|
2971
2972
|
})
|
|
2972
2973
|
}
|
|
2973
2974
|
},
|
|
2974
|
-
onRunEvent !== void 0 ? () =>
|
|
2975
|
+
onRunEvent !== void 0 ? () => chunkJ6GXS5A2_cjs.emitRunEvent(onRunEvent, { type: "compact_boundary", trigger: "auto" }) : void 0
|
|
2975
2976
|
);
|
|
2976
2977
|
if (result.status === "finished" && result.result !== void 0 && sessionTranscriptAllowed(inputs.memory)) {
|
|
2977
2978
|
const summaryArgs = {
|
|
2978
2979
|
cwd: workspaceCwd,
|
|
2979
2980
|
// Resolved once, here, and handed to both writers. Recomputing it inside either one is how
|
|
2980
2981
|
// the summary ended up in a directory the indexer never scanned (#463).
|
|
2981
|
-
memoryRoot:
|
|
2982
|
+
memoryRoot: chunk76PIKR4P_cjs.resolveMemoryRoot(workspaceCwd, inputs.memory),
|
|
2982
2983
|
runId: result.id,
|
|
2983
2984
|
agentId,
|
|
2984
2985
|
userText,
|
|
@@ -2990,7 +2991,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2990
2991
|
if (memoryProvider?.recordSessionSummary !== void 0) {
|
|
2991
2992
|
await memoryProvider.recordSessionSummary(summaryArgs);
|
|
2992
2993
|
} else {
|
|
2993
|
-
await
|
|
2994
|
+
await chunk76PIKR4P_cjs.writeSessionSummary(summaryArgs);
|
|
2994
2995
|
}
|
|
2995
2996
|
} catch (cause) {
|
|
2996
2997
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
@@ -3007,7 +3008,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
3007
3008
|
agentId,
|
|
3008
3009
|
runId: result.id
|
|
3009
3010
|
});
|
|
3010
|
-
await
|
|
3011
|
+
await chunkPSLCVSCS_cjs.flushSessionWrites();
|
|
3011
3012
|
}
|
|
3012
3013
|
async function safeConversation(run) {
|
|
3013
3014
|
try {
|
|
@@ -3045,12 +3046,12 @@ var SkillsManager = class {
|
|
|
3045
3046
|
...chunkTY56BKSK_cjs.projectConfigRoots(this.cwd, this.compatSources, "skills").map(
|
|
3046
3047
|
(root) => path.join(root, "skills")
|
|
3047
3048
|
),
|
|
3048
|
-
...(await
|
|
3049
|
+
...(await chunkXW4POZ6V_cjs.pluginBundleDirs(this.cwd, this.compatSources)).map((b) => path.join(b, "skills"))
|
|
3049
3050
|
] : [this.skillsDir];
|
|
3050
3051
|
const discovered = [];
|
|
3051
3052
|
const seen = /* @__PURE__ */ new Set();
|
|
3052
3053
|
for (const root of roots) {
|
|
3053
|
-
for (const skill of await
|
|
3054
|
+
for (const skill of await chunkHG5LKFG7_cjs.discoverSkills(root, {
|
|
3054
3055
|
onInvalidSkill: (info) => {
|
|
3055
3056
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
|
|
3056
3057
|
`);
|
|
@@ -3081,7 +3082,7 @@ var SkillsManager = class {
|
|
|
3081
3082
|
async get(name) {
|
|
3082
3083
|
const skill = this.skills.find((s) => s.name === name);
|
|
3083
3084
|
if (skill === void 0) return void 0;
|
|
3084
|
-
const instructions = typeof skill.instructions === "string" ? skill.instructions :
|
|
3085
|
+
const instructions = typeof skill.instructions === "string" ? skill.instructions : chunkHG5LKFG7_cjs.stripSkillFrontmatter(await promises.readFile(skill.source, "utf8"));
|
|
3085
3086
|
const references = skill.references;
|
|
3086
3087
|
return {
|
|
3087
3088
|
name: skill.name,
|
|
@@ -3268,7 +3269,7 @@ var ActiveMemoryPromptProvider = class {
|
|
|
3268
3269
|
if (ctx.activeMemorySummary === void 0 || ctx.activeMemorySummary.length === 0) {
|
|
3269
3270
|
return Promise.resolve(void 0);
|
|
3270
3271
|
}
|
|
3271
|
-
const body =
|
|
3272
|
+
const body = chunkHG5LKFG7_cjs.escapeBlockBody(ctx.activeMemorySummary);
|
|
3272
3273
|
return Promise.resolve(`<active-memory>
|
|
3273
3274
|
${body}
|
|
3274
3275
|
</active-memory>`);
|
|
@@ -3321,7 +3322,7 @@ function formatSource(name, tokens) {
|
|
|
3321
3322
|
if (tokens.length === 0) {
|
|
3322
3323
|
return ` <source name="${escapeAttribute(name)}" />`;
|
|
3323
3324
|
}
|
|
3324
|
-
const body =
|
|
3325
|
+
const body = chunkHG5LKFG7_cjs.escapeBlockBody(tokens.join(" "));
|
|
3325
3326
|
return ` <source name="${escapeAttribute(name)}">
|
|
3326
3327
|
${body}
|
|
3327
3328
|
</source>`;
|
|
@@ -3345,7 +3346,7 @@ var MemoryPromptProvider = class {
|
|
|
3345
3346
|
if (ctx.memory.length === 0) return Promise.resolve(void 0);
|
|
3346
3347
|
const lines = ctx.memory.map((fact) => {
|
|
3347
3348
|
const tag = fact.observations === 1 ? "[unconfirmed] " : "";
|
|
3348
|
-
return ` - ${tag}${
|
|
3349
|
+
return ` - ${tag}${chunkHG5LKFG7_cjs.escapeBlockBody(fact.text)}`;
|
|
3349
3350
|
});
|
|
3350
3351
|
return Promise.resolve(`${MEMORY_GUIDANCE}
|
|
3351
3352
|
<memory>
|
|
@@ -3369,7 +3370,7 @@ var SkillsPromptProvider = class {
|
|
|
3369
3370
|
priority = 20;
|
|
3370
3371
|
contribute(ctx) {
|
|
3371
3372
|
if (ctx.skillsAutoInject === false) return Promise.resolve(void 0);
|
|
3372
|
-
return Promise.resolve(
|
|
3373
|
+
return Promise.resolve(chunkHG5LKFG7_cjs.buildSkillsBlock(ctx.skills));
|
|
3373
3374
|
}
|
|
3374
3375
|
};
|
|
3375
3376
|
|
|
@@ -3381,7 +3382,7 @@ var SystemPromptPipeline = class _SystemPromptPipeline {
|
|
|
3381
3382
|
for (const p of providers) {
|
|
3382
3383
|
const key = `${p.priority}:${p.id}`;
|
|
3383
3384
|
if (seen.has(key)) {
|
|
3384
|
-
throw new
|
|
3385
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Duplicate system-prompt provider ${key}`, {
|
|
3385
3386
|
code: "pipeline_duplicate_provider"
|
|
3386
3387
|
});
|
|
3387
3388
|
}
|
|
@@ -3428,7 +3429,7 @@ function validateAgentOptions(options) {
|
|
|
3428
3429
|
ensureRuntimeShape(options);
|
|
3429
3430
|
if (options.local !== void 0) {
|
|
3430
3431
|
if (options.model === void 0) {
|
|
3431
|
-
throw new
|
|
3432
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError("Local agents require a model selection", {
|
|
3432
3433
|
code: "missing_model"
|
|
3433
3434
|
});
|
|
3434
3435
|
}
|
|
@@ -3452,7 +3453,7 @@ function validateCredentialPoolShape(options) {
|
|
|
3452
3453
|
([, arr]) => Array.isArray(arr) && arr.some((k) => typeof k === "string" && k.length > 0)
|
|
3453
3454
|
);
|
|
3454
3455
|
if (populated.length === 0) return;
|
|
3455
|
-
throw new
|
|
3456
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3456
3457
|
"Ambiguous credential configuration: use either `apiKey: '...'` (single-key, simplest) OR `apiKeys: { provider: [...] }` (multi-key pool), not both.",
|
|
3457
3458
|
{ code: "credential_pool_ambiguous" }
|
|
3458
3459
|
);
|
|
@@ -3461,7 +3462,7 @@ function validatePlugins(options) {
|
|
|
3461
3462
|
const plugins = options.plugins;
|
|
3462
3463
|
if (plugins?.paths === void 0) return;
|
|
3463
3464
|
if (options.cloud !== void 0 && plugins.paths.length > 0) {
|
|
3464
|
-
throw new
|
|
3465
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3465
3466
|
"Cloud agents require committed plugin manifests; local plugin paths are not supported",
|
|
3466
3467
|
{ code: "cloud_plugin_path_rejected" }
|
|
3467
3468
|
);
|
|
@@ -3469,7 +3470,7 @@ function validatePlugins(options) {
|
|
|
3469
3470
|
}
|
|
3470
3471
|
function ensureRuntimeShape(options) {
|
|
3471
3472
|
if (options.local !== void 0 && options.cloud !== void 0) {
|
|
3472
|
-
throw new
|
|
3473
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3473
3474
|
"Pass either local or cloud \u2014 they are mutually exclusive runtimes",
|
|
3474
3475
|
{ code: "runtime_exclusive" }
|
|
3475
3476
|
);
|
|
@@ -3477,7 +3478,7 @@ function ensureRuntimeShape(options) {
|
|
|
3477
3478
|
}
|
|
3478
3479
|
function rejectProgrammaticHooks(options) {
|
|
3479
3480
|
if (options.hooks !== void 0) {
|
|
3480
|
-
throw new
|
|
3481
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3481
3482
|
"Programmatic hooks are not supported \u2014 hooks are file-based only (.theokit/hooks.json)",
|
|
3482
3483
|
{ code: "programmatic_hooks_rejected" }
|
|
3483
3484
|
);
|
|
@@ -3487,7 +3488,7 @@ function validateCloud(cloud) {
|
|
|
3487
3488
|
if (cloud.envVars !== void 0) {
|
|
3488
3489
|
for (const key of Object.keys(cloud.envVars)) {
|
|
3489
3490
|
if (key.startsWith("THEOKIT_")) {
|
|
3490
|
-
throw new
|
|
3491
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3491
3492
|
`Cloud envVars cannot use the reserved THEOKIT_ prefix (got "${key}")`,
|
|
3492
3493
|
{ code: "reserved_env_prefix" }
|
|
3493
3494
|
);
|
|
@@ -3499,7 +3500,7 @@ function validateMcpServers(options) {
|
|
|
3499
3500
|
if (options.mcpServers === void 0) return;
|
|
3500
3501
|
for (const [name, config] of Object.entries(options.mcpServers)) {
|
|
3501
3502
|
if (options.cloud !== void 0 && isStdioWithCwd(config)) {
|
|
3502
|
-
throw new
|
|
3503
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3503
3504
|
`MCP server "${name}" uses stdio with cwd, which is rejected for cloud agents`,
|
|
3504
3505
|
{ code: "cloud_stdio_cwd_rejected" }
|
|
3505
3506
|
);
|
|
@@ -3518,12 +3519,12 @@ function validateSubagents(agents2) {
|
|
|
3518
3519
|
if (agents2 === void 0) return;
|
|
3519
3520
|
for (const [name, definition] of Object.entries(agents2)) {
|
|
3520
3521
|
if (typeof definition.description !== "string" || definition.description.length === 0) {
|
|
3521
|
-
throw new
|
|
3522
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Subagent "${name}" requires a non-empty description`, {
|
|
3522
3523
|
code: "subagent_missing_description"
|
|
3523
3524
|
});
|
|
3524
3525
|
}
|
|
3525
3526
|
if (typeof definition.prompt !== "string" || definition.prompt.length === 0) {
|
|
3526
|
-
throw new
|
|
3527
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Subagent "${name}" requires a non-empty prompt`, {
|
|
3527
3528
|
code: "subagent_missing_prompt"
|
|
3528
3529
|
});
|
|
3529
3530
|
}
|
|
@@ -3542,7 +3543,7 @@ function validateToolCatalog(tools, withheldBuiltins) {
|
|
|
3542
3543
|
for (const tool of tools) {
|
|
3543
3544
|
validateSingleTool(tool, reserved);
|
|
3544
3545
|
if (seen.has(tool.name)) {
|
|
3545
|
-
throw new
|
|
3546
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Duplicate custom tool name "${tool.name}"`, {
|
|
3546
3547
|
code: "duplicate_tool_name"
|
|
3547
3548
|
});
|
|
3548
3549
|
}
|
|
@@ -3553,7 +3554,7 @@ function validateCustomTools(options) {
|
|
|
3553
3554
|
const tools = options.tools;
|
|
3554
3555
|
if (tools === void 0 || tools.length === 0) return;
|
|
3555
3556
|
if (options.cloud !== void 0) {
|
|
3556
|
-
throw new
|
|
3557
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3557
3558
|
"Custom inline tools are local-only in SDK v1.0 \u2014 cloud agents cannot serialize handler functions",
|
|
3558
3559
|
{ code: "cloud_custom_tools_rejected" }
|
|
3559
3560
|
);
|
|
@@ -3565,25 +3566,25 @@ function validateSingleTool(tool, reserved) {
|
|
|
3565
3566
|
validateToolDescription(tool);
|
|
3566
3567
|
validateToolSchema(tool);
|
|
3567
3568
|
if (typeof tool.handler !== "function") {
|
|
3568
|
-
throw new
|
|
3569
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Custom tool "${tool.name}" requires a handler function`, {
|
|
3569
3570
|
code: "tool_missing_handler"
|
|
3570
3571
|
});
|
|
3571
3572
|
}
|
|
3572
3573
|
}
|
|
3573
3574
|
function validateToolName(tool, reserved) {
|
|
3574
3575
|
if (typeof tool.name !== "string" || tool.name.length === 0) {
|
|
3575
|
-
throw new
|
|
3576
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError("Custom tool requires a non-empty name", {
|
|
3576
3577
|
code: "tool_missing_name"
|
|
3577
3578
|
});
|
|
3578
3579
|
}
|
|
3579
3580
|
if (!TOOL_NAME_PATTERN.test(tool.name)) {
|
|
3580
|
-
throw new
|
|
3581
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3581
3582
|
`Custom tool name "${tool.name}" must match /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/`,
|
|
3582
3583
|
{ code: "tool_invalid_name" }
|
|
3583
3584
|
);
|
|
3584
3585
|
}
|
|
3585
3586
|
if (reserved.has(tool.name) || tool.name.startsWith("mcp_")) {
|
|
3586
|
-
throw new
|
|
3587
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3587
3588
|
`Custom tool name "${tool.name}" collides with a reserved SDK tool name`,
|
|
3588
3589
|
{ code: "tool_reserved_name" }
|
|
3589
3590
|
);
|
|
@@ -3591,7 +3592,7 @@ function validateToolName(tool, reserved) {
|
|
|
3591
3592
|
}
|
|
3592
3593
|
function validateToolDescription(tool) {
|
|
3593
3594
|
if (typeof tool.description !== "string" || tool.description.length === 0) {
|
|
3594
|
-
throw new
|
|
3595
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Custom tool "${tool.name}" requires a non-empty description`, {
|
|
3595
3596
|
code: "tool_missing_description"
|
|
3596
3597
|
});
|
|
3597
3598
|
}
|
|
@@ -3599,12 +3600,12 @@ function validateToolDescription(tool) {
|
|
|
3599
3600
|
function validateToolSchema(tool) {
|
|
3600
3601
|
const schema = tool.inputSchema;
|
|
3601
3602
|
if (schema === null || schema === void 0 || typeof schema !== "object") {
|
|
3602
|
-
throw new
|
|
3603
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Custom tool "${tool.name}" requires an inputSchema object`, {
|
|
3603
3604
|
code: "tool_missing_schema"
|
|
3604
3605
|
});
|
|
3605
3606
|
}
|
|
3606
3607
|
if (schema.type !== "object") {
|
|
3607
|
-
throw new
|
|
3608
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3608
3609
|
`Custom tool "${tool.name}" inputSchema must declare \`type: "object"\``,
|
|
3609
3610
|
{ code: "tool_invalid_schema_type" }
|
|
3610
3611
|
);
|
|
@@ -3615,7 +3616,7 @@ function validateMemory(options) {
|
|
|
3615
3616
|
if (memory?.storePath === void 0) return;
|
|
3616
3617
|
const storePath = memory.storePath;
|
|
3617
3618
|
if (storePath.includes("..") || storePath.startsWith("/") || /^[A-Z]:/i.test(storePath)) {
|
|
3618
|
-
throw new
|
|
3619
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
3619
3620
|
`Memory storePath must stay inside the workspace; got "${storePath}"`,
|
|
3620
3621
|
{ code: "memory_path_traversal" }
|
|
3621
3622
|
);
|
|
@@ -3637,7 +3638,7 @@ var HISTOGRAM_NAMES = {
|
|
|
3637
3638
|
};
|
|
3638
3639
|
function safeRequire(moduleName) {
|
|
3639
3640
|
try {
|
|
3640
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3641
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-2STSX2SY.cjs', document.baseURI).href)));
|
|
3641
3642
|
return r(moduleName);
|
|
3642
3643
|
} catch {
|
|
3643
3644
|
return void 0;
|
|
@@ -3880,7 +3881,7 @@ var cachedOtel;
|
|
|
3880
3881
|
function loadOtel() {
|
|
3881
3882
|
if (cachedOtel === void 0) {
|
|
3882
3883
|
try {
|
|
3883
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3884
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-2STSX2SY.cjs', document.baseURI).href)));
|
|
3884
3885
|
const mod = r("@opentelemetry/api");
|
|
3885
3886
|
cachedOtel = mod;
|
|
3886
3887
|
} catch {
|
|
@@ -4117,10 +4118,10 @@ async function loadMarkdownEntities(opts) {
|
|
|
4117
4118
|
const raw = await promises.readFile(resolved.source, "utf8").catch(() => null);
|
|
4118
4119
|
if (raw === null) continue;
|
|
4119
4120
|
const split = splitFrontmatter(raw, resolved.source, errorCodePrefix);
|
|
4120
|
-
const fields =
|
|
4121
|
+
const fields = chunkMPR2ISL2_cjs.parseSimpleYaml(split.frontmatter);
|
|
4121
4122
|
const parsed = schema.safeParse(fields);
|
|
4122
4123
|
if (!parsed.success) {
|
|
4123
|
-
throw new
|
|
4124
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
4124
4125
|
`Invalid frontmatter in ${resolved.source}: ${parsed.error.message}`,
|
|
4125
4126
|
{ code: `${errorCodePrefix}_frontmatter_invalid` }
|
|
4126
4127
|
);
|
|
@@ -4138,13 +4139,13 @@ async function assertFileSizeUnderCap(source, errorCodePrefix) {
|
|
|
4138
4139
|
try {
|
|
4139
4140
|
const info = await promises.stat(source);
|
|
4140
4141
|
if (info.size > MAX_MD_FILE_BYTES) {
|
|
4141
|
-
throw new
|
|
4142
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
4142
4143
|
`Config file ${source} exceeds 1 MB size limit (${info.size} bytes). Reduce the file or split into multiple entities.`,
|
|
4143
4144
|
{ code: `${errorCodePrefix}_file_too_large` }
|
|
4144
4145
|
);
|
|
4145
4146
|
}
|
|
4146
4147
|
} catch (cause) {
|
|
4147
|
-
if (cause instanceof
|
|
4148
|
+
if (cause instanceof chunkUNFBHV46_cjs.ConfigurationError) throw cause;
|
|
4148
4149
|
}
|
|
4149
4150
|
}
|
|
4150
4151
|
async function readDirSafe(dir, errorCodePrefix) {
|
|
@@ -4153,7 +4154,7 @@ async function readDirSafe(dir, errorCodePrefix) {
|
|
|
4153
4154
|
} catch (cause) {
|
|
4154
4155
|
const code = cause.code;
|
|
4155
4156
|
if (code === "ENOENT") return null;
|
|
4156
|
-
throw new
|
|
4157
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Failed to read ${dir}`, {
|
|
4157
4158
|
code: `${errorCodePrefix}_dir_read_error`,
|
|
4158
4159
|
cause
|
|
4159
4160
|
});
|
|
@@ -4170,7 +4171,7 @@ function resolveEntryPath(entry, pattern, dir) {
|
|
|
4170
4171
|
function splitFrontmatter(raw, source, errorCodePrefix) {
|
|
4171
4172
|
const match = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/.exec(raw);
|
|
4172
4173
|
if (match === null) {
|
|
4173
|
-
throw new
|
|
4174
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
4174
4175
|
`Missing or malformed frontmatter in ${source} (expected \`---\` delimited block at file head)`,
|
|
4175
4176
|
{ code: `${errorCodePrefix}_missing_frontmatter` }
|
|
4176
4177
|
);
|
|
@@ -4199,7 +4200,7 @@ function applyAggregateCap(sources, maxTotal) {
|
|
|
4199
4200
|
}
|
|
4200
4201
|
const remaining = maxTotal - totalBytes;
|
|
4201
4202
|
if (remaining > 0) {
|
|
4202
|
-
const { finalContent } =
|
|
4203
|
+
const { finalContent } = chunkKTA7YTZQ_cjs.truncateWithMarker(s.content, remaining);
|
|
4203
4204
|
kept.push({ ...s, content: finalContent, truncated: true });
|
|
4204
4205
|
totalBytes = maxTotal;
|
|
4205
4206
|
} else {
|
|
@@ -4296,10 +4297,10 @@ var FileContextManager = class {
|
|
|
4296
4297
|
this.lastScope = [...touchedFiles];
|
|
4297
4298
|
const config = await loadContextConfig(this.cwd);
|
|
4298
4299
|
const legacy = await loadSources(config, this.cwd);
|
|
4299
|
-
const maxBytesPerFile = this.settings.maxBytesPerFile ??
|
|
4300
|
+
const maxBytesPerFile = this.settings.maxBytesPerFile ?? chunkKTA7YTZQ_cjs.DEFAULT_MAX_BYTES_PER_FILE;
|
|
4300
4301
|
const maxBytesTotal = this.settings.maxBytesTotal ?? DEFAULT_MAX_BYTES_TOTAL;
|
|
4301
4302
|
const granted = this.grantedContextDialects();
|
|
4302
|
-
const discovered = await
|
|
4303
|
+
const discovered = await chunkKTA7YTZQ_cjs.runDiscovery({
|
|
4303
4304
|
cwd: this.cwd,
|
|
4304
4305
|
maxBytesPerFile,
|
|
4305
4306
|
skipLegacyTheokitContext: true,
|
|
@@ -4372,7 +4373,7 @@ async function loadContextConfig(cwd) {
|
|
|
4372
4373
|
});
|
|
4373
4374
|
if (mdEntities.length > 0) {
|
|
4374
4375
|
if (fs.existsSync(jsonPath)) {
|
|
4375
|
-
|
|
4376
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
4376
4377
|
"context-both-present",
|
|
4377
4378
|
"[theokit-sdk] both .theokit/context/ and .theokit/context.json detected \u2014 using markdown; remove context.json"
|
|
4378
4379
|
);
|
|
@@ -4382,7 +4383,7 @@ async function loadContextConfig(cwd) {
|
|
|
4382
4383
|
};
|
|
4383
4384
|
}
|
|
4384
4385
|
if (!fs.existsSync(jsonPath)) return { sources: [] };
|
|
4385
|
-
|
|
4386
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
4386
4387
|
"context-json-deprecated",
|
|
4387
4388
|
// Names no command: `theokit-migrate-config` was unpublished with the `bin` entry, and a warning
|
|
4388
4389
|
// that tells you to run something the package does not ship is worse than one that tells you
|
|
@@ -4393,7 +4394,7 @@ async function loadContextConfig(cwd) {
|
|
|
4393
4394
|
try {
|
|
4394
4395
|
raw = await promises.readFile(jsonPath, "utf8");
|
|
4395
4396
|
} catch (cause) {
|
|
4396
|
-
throw new
|
|
4397
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Failed to read context config: ${jsonPath}`, {
|
|
4397
4398
|
code: "context_read_error",
|
|
4398
4399
|
cause
|
|
4399
4400
|
});
|
|
@@ -4405,13 +4406,13 @@ function parseConfig(raw, configPath) {
|
|
|
4405
4406
|
try {
|
|
4406
4407
|
parsed = JSON.parse(raw);
|
|
4407
4408
|
} catch (cause) {
|
|
4408
|
-
throw new
|
|
4409
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Invalid JSON in context config: ${configPath}`, {
|
|
4409
4410
|
code: "context_json_invalid",
|
|
4410
4411
|
cause
|
|
4411
4412
|
});
|
|
4412
4413
|
}
|
|
4413
4414
|
if (!parsed || typeof parsed !== "object") {
|
|
4414
|
-
throw new
|
|
4415
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Context config must be an object: ${configPath}`, {
|
|
4415
4416
|
code: "context_config_shape"
|
|
4416
4417
|
});
|
|
4417
4418
|
}
|
|
@@ -4426,7 +4427,7 @@ function parseConfig(raw, configPath) {
|
|
|
4426
4427
|
}
|
|
4427
4428
|
function readSources(sourcesRaw, configPath) {
|
|
4428
4429
|
if (!Array.isArray(sourcesRaw)) {
|
|
4429
|
-
throw new
|
|
4430
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Context config sources must be an array: ${configPath}`, {
|
|
4430
4431
|
code: "context_sources_shape"
|
|
4431
4432
|
});
|
|
4432
4433
|
}
|
|
@@ -4529,7 +4530,7 @@ var PluginsManager = class {
|
|
|
4529
4530
|
}
|
|
4530
4531
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: MD-first + JSON fallback + CLI location + both-present detection per plugin folder — branch table is clearer inlined.
|
|
4531
4532
|
async refreshRoot(pluginsRoot) {
|
|
4532
|
-
const entries = await
|
|
4533
|
+
const entries = await chunkMPR2ISL2_cjs.readWorkspaceDir(pluginsRoot, "plugins_read_error", "plugins directory");
|
|
4533
4534
|
for (const entry of entries) {
|
|
4534
4535
|
if (!entry.isDirectory()) continue;
|
|
4535
4536
|
const folderName = entry.name;
|
|
@@ -4545,13 +4546,13 @@ var PluginsManager = class {
|
|
|
4545
4546
|
const jsonPath = path.join(pluginsRoot, folderName, "plugin.json");
|
|
4546
4547
|
const metadata = fs.existsSync(mdPath) ? await loadPluginManifestFromMarkdown(this.cwd, pluginsRoot, folderName) : await loadPluginManifestFromJson(this.cwd, jsonPath, folderName);
|
|
4547
4548
|
if (fs.existsSync(mdPath) && fs.existsSync(jsonPath)) {
|
|
4548
|
-
|
|
4549
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
4549
4550
|
`plugin-${folderName}-both`,
|
|
4550
4551
|
`[theokit-sdk] both ${folderName}/PLUGIN.md and ${folderName}/plugin.json detected \u2014 using markdown; remove plugin.json`
|
|
4551
4552
|
);
|
|
4552
4553
|
}
|
|
4553
4554
|
if (!fs.existsSync(mdPath) && fs.existsSync(jsonPath)) {
|
|
4554
|
-
|
|
4555
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
4555
4556
|
"plugin-json-deprecated",
|
|
4556
4557
|
// Same reason as the context.json warning: the CLI it used to name is no longer published.
|
|
4557
4558
|
"[theokit-sdk] plugin.json manifests are deprecated; replace each with a PLUGIN.md"
|
|
@@ -4570,11 +4571,11 @@ var PluginsManager = class {
|
|
|
4570
4571
|
const entry = metadata.entry;
|
|
4571
4572
|
if (entry === void 0) return;
|
|
4572
4573
|
const pluginRoot = path.join(pluginsRoot, folderName);
|
|
4573
|
-
const entryPath =
|
|
4574
|
+
const entryPath = chunkGM54F4FE_cjs.safePathJoin(pluginRoot, entry);
|
|
4574
4575
|
try {
|
|
4575
4576
|
await promises.readFile(entryPath, "utf8");
|
|
4576
4577
|
} catch (cause) {
|
|
4577
|
-
throw new
|
|
4578
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Plugin ${metadata.name} entry file is missing: ${entry}`, {
|
|
4578
4579
|
code: "plugin_entry_missing",
|
|
4579
4580
|
cause
|
|
4580
4581
|
});
|
|
@@ -4598,7 +4599,7 @@ var PluginsManager = class {
|
|
|
4598
4599
|
assertCloudRules() {
|
|
4599
4600
|
if (!this.cloud) return;
|
|
4600
4601
|
if (this.localPaths !== void 0 && this.localPaths.length > 0) {
|
|
4601
|
-
throw new
|
|
4602
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
4602
4603
|
"Cloud agents reject local plugin paths \u2014 plugins must come from committed repo files",
|
|
4603
4604
|
{ code: "cloud_plugin_path_rejected" }
|
|
4604
4605
|
);
|
|
@@ -4610,7 +4611,7 @@ async function loadPluginManifestFromJson(cwd, manifestPath, folderName) {
|
|
|
4610
4611
|
try {
|
|
4611
4612
|
raw = await promises.readFile(manifestPath, "utf8");
|
|
4612
4613
|
} catch (cause) {
|
|
4613
|
-
throw new
|
|
4614
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Plugin ${folderName} is missing plugin.json`, {
|
|
4614
4615
|
code: "plugin_missing_manifest",
|
|
4615
4616
|
cause
|
|
4616
4617
|
});
|
|
@@ -4619,13 +4620,13 @@ async function loadPluginManifestFromJson(cwd, manifestPath, folderName) {
|
|
|
4619
4620
|
try {
|
|
4620
4621
|
parsed = JSON.parse(raw);
|
|
4621
4622
|
} catch (cause) {
|
|
4622
|
-
throw new
|
|
4623
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Plugin ${folderName} manifest is invalid JSON`, {
|
|
4623
4624
|
code: "plugin_manifest_invalid",
|
|
4624
4625
|
cause
|
|
4625
4626
|
});
|
|
4626
4627
|
}
|
|
4627
4628
|
if (!parsed || typeof parsed !== "object") {
|
|
4628
|
-
throw new
|
|
4629
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Plugin ${folderName} manifest must be an object`, {
|
|
4629
4630
|
code: "plugin_manifest_shape"
|
|
4630
4631
|
});
|
|
4631
4632
|
}
|
|
@@ -4644,7 +4645,7 @@ async function loadPluginManifestFromMarkdown(cwd, pluginsRoot, folderName) {
|
|
|
4644
4645
|
try {
|
|
4645
4646
|
raw = await promises.readFile(mdPath, "utf8");
|
|
4646
4647
|
} catch (cause) {
|
|
4647
|
-
throw new
|
|
4648
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Plugin ${folderName} is missing PLUGIN.md`, {
|
|
4648
4649
|
code: "plugin_missing_manifest",
|
|
4649
4650
|
cause
|
|
4650
4651
|
});
|
|
@@ -4659,7 +4660,7 @@ async function loadPluginManifestFromMarkdown(cwd, pluginsRoot, folderName) {
|
|
|
4659
4660
|
});
|
|
4660
4661
|
const entity = entities.find((e) => e.slug === "PLUGIN");
|
|
4661
4662
|
if (entity === void 0) {
|
|
4662
|
-
throw new
|
|
4663
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`Plugin ${folderName} PLUGIN.md not parseable`, {
|
|
4663
4664
|
code: "plugin_missing_manifest"
|
|
4664
4665
|
});
|
|
4665
4666
|
}
|
|
@@ -4785,7 +4786,7 @@ function localAgentListArtifacts() {
|
|
|
4785
4786
|
}
|
|
4786
4787
|
function localAgentDownloadArtifact() {
|
|
4787
4788
|
return Promise.reject(
|
|
4788
|
-
new
|
|
4789
|
+
new chunkUNFBHV46_cjs.UnsupportedRunOperationError(
|
|
4789
4790
|
"Artifacts are not supported for local agents",
|
|
4790
4791
|
"downloadArtifact"
|
|
4791
4792
|
)
|
|
@@ -4988,7 +4989,7 @@ function assertValidThresholds(soft, hard) {
|
|
|
4988
4989
|
["hardThreshold", hard]
|
|
4989
4990
|
]) {
|
|
4990
4991
|
if (!Number.isInteger(value) || value < 1) {
|
|
4991
|
-
throw new
|
|
4992
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
4992
4993
|
`doomLoop.${label} must be a positive integer (received ${value}).`,
|
|
4993
4994
|
{ code: "invalid_doom_loop_threshold" }
|
|
4994
4995
|
);
|
|
@@ -5337,12 +5338,12 @@ function reportMemoryDegraded(stage, cause, sink) {
|
|
|
5337
5338
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
5338
5339
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] memory ${stage} failed \u2014 continuing without it: ${message}
|
|
5339
5340
|
`);
|
|
5340
|
-
|
|
5341
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(sink, { type: "memory_degraded", stage, message });
|
|
5341
5342
|
}
|
|
5342
5343
|
async function safeListTools(client, serverName, sink) {
|
|
5343
5344
|
try {
|
|
5344
5345
|
const listed = await client.listTools();
|
|
5345
|
-
|
|
5346
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(sink, {
|
|
5346
5347
|
type: "mcp_server_ready",
|
|
5347
5348
|
serverName: serverName ?? "unknown",
|
|
5348
5349
|
tools: listed.map((tool) => tool.name)
|
|
@@ -5353,7 +5354,7 @@ async function safeListTools(client, serverName, sink) {
|
|
|
5353
5354
|
const server = serverName ?? "unknown";
|
|
5354
5355
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] mcp listTools failed (server=${server}): ${message}
|
|
5355
5356
|
`);
|
|
5356
|
-
|
|
5357
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(sink, { type: "mcp_server_failed", serverName: server, message });
|
|
5357
5358
|
return [];
|
|
5358
5359
|
}
|
|
5359
5360
|
}
|
|
@@ -5583,7 +5584,7 @@ function catalogCostFallback(provider, cleanedModel) {
|
|
|
5583
5584
|
const candidates = [`${provider}/${cleanedModel}`, cleanedModel];
|
|
5584
5585
|
if (stripped !== cleanedModel) candidates.push(`${provider}/${stripped}`, stripped);
|
|
5585
5586
|
for (const key of candidates) {
|
|
5586
|
-
const info =
|
|
5587
|
+
const info = chunkYRJA2POB_cjs.getCatalogModelInfo(key);
|
|
5587
5588
|
const cost = info?.cost;
|
|
5588
5589
|
if (cost === void 0) continue;
|
|
5589
5590
|
const [prov, ...modelParts] = key.split("/");
|
|
@@ -5595,7 +5596,7 @@ function catalogCostFallback(provider, cleanedModel) {
|
|
|
5595
5596
|
...cost.cache_read !== void 0 ? { cacheReadCostPerMillion: cost.cache_read } : {},
|
|
5596
5597
|
...cost.cache_write !== void 0 ? { cacheWriteCostPerMillion: cost.cache_write } : {},
|
|
5597
5598
|
// M44 M5 fix — honest provenance: a key patched by the LIVE models-dev source is not "vendored".
|
|
5598
|
-
pricingVersion:
|
|
5599
|
+
pricingVersion: chunkYRJA2POB_cjs.isPatchedModelKey(key) ? "catalog-models-dev" : "catalog-vendored"
|
|
5599
5600
|
};
|
|
5600
5601
|
}
|
|
5601
5602
|
return void 0;
|
|
@@ -5802,7 +5803,7 @@ function stripThinkBlocks(content) {
|
|
|
5802
5803
|
function resolveSystemPromptWithMemoryAdditions(systemPrompt, additions) {
|
|
5803
5804
|
if (additions === void 0 || additions.length === 0) return systemPrompt;
|
|
5804
5805
|
const block = `<active-memory>
|
|
5805
|
-
${
|
|
5806
|
+
${chunkHG5LKFG7_cjs.escapeBlockBody(additions)}
|
|
5806
5807
|
</active-memory>`;
|
|
5807
5808
|
if (systemPrompt === void 0 || systemPrompt.length === 0) return block;
|
|
5808
5809
|
return `${block}
|
|
@@ -6130,7 +6131,7 @@ function coerceArgsToSchema(args, schema) {
|
|
|
6130
6131
|
}
|
|
6131
6132
|
|
|
6132
6133
|
// src/tool-error.ts
|
|
6133
|
-
var ToolError = class extends
|
|
6134
|
+
var ToolError = class extends chunkUNFBHV46_cjs.TheokitAgentError {
|
|
6134
6135
|
name = "ToolError";
|
|
6135
6136
|
/** The error content surfaced to the model: a string, or text/image blocks. */
|
|
6136
6137
|
content;
|
|
@@ -6304,7 +6305,7 @@ function raceToolExecution(exec, opts) {
|
|
|
6304
6305
|
// src/internal/agent-loop/tool-dispatch.ts
|
|
6305
6306
|
async function dispatchTools(inputs, tools, toolCalls, events, parentSpan) {
|
|
6306
6307
|
const maxConcurrent = inputs.maxConcurrentTools ?? 4;
|
|
6307
|
-
return
|
|
6308
|
+
return chunkIIYJMXYW_cjs.mapWithConcurrency(
|
|
6308
6309
|
toolCalls,
|
|
6309
6310
|
maxConcurrent,
|
|
6310
6311
|
(call) => dispatchSingleCall(inputs, tools, call, events, parentSpan)
|
|
@@ -6338,7 +6339,7 @@ async function dispatchSingleCall(inputs, tools, call, events, parentSpan) {
|
|
|
6338
6339
|
toolSpan?.end();
|
|
6339
6340
|
return fileVeto;
|
|
6340
6341
|
}
|
|
6341
|
-
|
|
6342
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(inputs.runEventSink, {
|
|
6342
6343
|
type: "tool_progress",
|
|
6343
6344
|
toolName: workingCall.name,
|
|
6344
6345
|
toolCallId: dc.callId
|
|
@@ -6370,7 +6371,7 @@ function vetoFromForkWhitelist(dc) {
|
|
|
6370
6371
|
const { inputs, call, callId, events } = dc;
|
|
6371
6372
|
const whitelistDecision = chunkIJ7M6GOG_cjs.checkToolWhitelist(call.name);
|
|
6372
6373
|
if (whitelistDecision.allowed) return void 0;
|
|
6373
|
-
|
|
6374
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(inputs.runEventSink, {
|
|
6374
6375
|
type: "permission_denied",
|
|
6375
6376
|
toolName: call.name,
|
|
6376
6377
|
toolCallId: callId,
|
|
@@ -6417,7 +6418,7 @@ async function vetoFromPluginPreHook(dc) {
|
|
|
6417
6418
|
...inputs.permissionMode !== void 0 ? { permissionMode: inputs.permissionMode } : {}
|
|
6418
6419
|
});
|
|
6419
6420
|
if (pluginVeto === void 0) return void 0;
|
|
6420
|
-
|
|
6421
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(inputs.runEventSink, {
|
|
6421
6422
|
type: "permission_denied",
|
|
6422
6423
|
toolName: call.name,
|
|
6423
6424
|
toolCallId: callId,
|
|
@@ -6447,7 +6448,7 @@ async function vetoFromFileHookPreDecision(dc) {
|
|
|
6447
6448
|
runId: inputs.runId
|
|
6448
6449
|
});
|
|
6449
6450
|
if (!preDecision.blocked) return void 0;
|
|
6450
|
-
|
|
6451
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(inputs.runEventSink, {
|
|
6451
6452
|
type: "permission_denied",
|
|
6452
6453
|
toolName: call.name,
|
|
6453
6454
|
toolCallId: callId,
|
|
@@ -6648,7 +6649,7 @@ function applyToolResultGuard(parts, opts) {
|
|
|
6648
6649
|
(p) => (
|
|
6649
6650
|
// SE7 — guard the TEXT of a tool result (string or the text blocks of a
|
|
6650
6651
|
// structured content); image blocks pass through untouched.
|
|
6651
|
-
p.type === "tool_result" ? { ...p, content:
|
|
6652
|
+
p.type === "tool_result" ? { ...p, content: chunkARMFXTY6_cjs.renderToolResultContentText(p.content, (t) => guardText(t, opts)) } : p
|
|
6652
6653
|
)
|
|
6653
6654
|
);
|
|
6654
6655
|
}
|
|
@@ -6940,16 +6941,16 @@ var FallbackLlmClient = class {
|
|
|
6940
6941
|
async *stream(request, signal) {
|
|
6941
6942
|
let lastError;
|
|
6942
6943
|
for (const client of this.clients) {
|
|
6943
|
-
if (signal.aborted) throw
|
|
6944
|
-
const attempt = await
|
|
6944
|
+
if (signal.aborted) throw chunkARMFXTY6_cjs.abortError(signal);
|
|
6945
|
+
const attempt = await chunkARMFXTY6_cjs.tryFirstEvent(client, request, signal, true);
|
|
6945
6946
|
if (attempt.kind === "handshake_error") {
|
|
6946
6947
|
lastError = attempt.error;
|
|
6947
6948
|
continue;
|
|
6948
6949
|
}
|
|
6949
|
-
return yield*
|
|
6950
|
+
return yield* chunkARMFXTY6_cjs.relayStream(attempt.generator, attempt.firstResult);
|
|
6950
6951
|
}
|
|
6951
6952
|
if (lastError !== void 0) throw lastError;
|
|
6952
|
-
throw new
|
|
6953
|
+
throw new chunkUNFBHV46_cjs.NetworkError("FallbackLlmClient has no providers configured", {
|
|
6953
6954
|
code: "fallback_empty_chain"
|
|
6954
6955
|
});
|
|
6955
6956
|
}
|
|
@@ -6977,7 +6978,7 @@ function reconnectDelay(attempt) {
|
|
|
6977
6978
|
return ms <= 0 ? Promise.resolve() : new Promise((resolve) => setTimeout(resolve, ms));
|
|
6978
6979
|
}
|
|
6979
6980
|
function mcpTimeoutError(name, timeoutMs) {
|
|
6980
|
-
return new
|
|
6981
|
+
return new chunkUNFBHV46_cjs.NetworkError(`MCP ${name} request timed out after ${timeoutMs}ms`, {
|
|
6981
6982
|
code: "mcp_timeout"
|
|
6982
6983
|
});
|
|
6983
6984
|
}
|
|
@@ -7075,7 +7076,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7075
7076
|
child.stdin.on("error", () => void 0);
|
|
7076
7077
|
child.on("error", () => {
|
|
7077
7078
|
this.rejectAllPending(
|
|
7078
|
-
new
|
|
7079
|
+
new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} process crashed`, { code: "mcp_crashed" })
|
|
7079
7080
|
);
|
|
7080
7081
|
});
|
|
7081
7082
|
child.on("exit", () => {
|
|
@@ -7083,7 +7084,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7083
7084
|
this.child = void 0;
|
|
7084
7085
|
this.dropped = true;
|
|
7085
7086
|
this.rejectAllPending(
|
|
7086
|
-
new
|
|
7087
|
+
new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} disconnected`, { code: "mcp_disconnected" })
|
|
7087
7088
|
);
|
|
7088
7089
|
});
|
|
7089
7090
|
}
|
|
@@ -7111,7 +7112,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7111
7112
|
if (this.child !== void 0) return Promise.resolve();
|
|
7112
7113
|
if (!this.dropped) {
|
|
7113
7114
|
return Promise.reject(
|
|
7114
|
-
new
|
|
7115
|
+
new chunkUNFBHV46_cjs.ConfigurationError(`MCP ${this.name} is not initialized`, { code: "mcp_not_init" })
|
|
7115
7116
|
);
|
|
7116
7117
|
}
|
|
7117
7118
|
this.reconnectPromise ??= this.reconnect().finally(() => {
|
|
@@ -7135,13 +7136,13 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7135
7136
|
this.reconnecting = false;
|
|
7136
7137
|
}
|
|
7137
7138
|
}
|
|
7138
|
-
throw new
|
|
7139
|
+
throw new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} reconnect exhausted`, {
|
|
7139
7140
|
code: "mcp_disconnected",
|
|
7140
7141
|
...lastErr instanceof Error ? { cause: lastErr } : {}
|
|
7141
7142
|
});
|
|
7142
7143
|
}
|
|
7143
7144
|
async close() {
|
|
7144
|
-
this.rejectAllPending(new
|
|
7145
|
+
this.rejectAllPending(new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} closed`, { code: "mcp_closed" }));
|
|
7145
7146
|
const child = this.child;
|
|
7146
7147
|
this.child = void 0;
|
|
7147
7148
|
this.dropped = false;
|
|
@@ -7160,7 +7161,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7160
7161
|
if (this.buffer.length > MAX_STDIO_BUFFER_BYTES) {
|
|
7161
7162
|
this.buffer = "";
|
|
7162
7163
|
this.rejectAllPending(
|
|
7163
|
-
new
|
|
7164
|
+
new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} exceeded stdout buffer limit`, {
|
|
7164
7165
|
code: "mcp_buffer_overflow"
|
|
7165
7166
|
})
|
|
7166
7167
|
);
|
|
@@ -7195,7 +7196,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7195
7196
|
if (child !== void 0) return this.send(child, method, params);
|
|
7196
7197
|
if (this.dropped) return this.reconnectAndRequest(method, params);
|
|
7197
7198
|
return Promise.reject(
|
|
7198
|
-
new
|
|
7199
|
+
new chunkUNFBHV46_cjs.ConfigurationError(`MCP ${this.name} is not initialized`, { code: "mcp_not_init" })
|
|
7199
7200
|
);
|
|
7200
7201
|
}
|
|
7201
7202
|
/** M2 #59 — reconnect a dropped client, then send. Separate async path so the
|
|
@@ -7204,7 +7205,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7204
7205
|
await this.ensureConnected();
|
|
7205
7206
|
const child = this.child;
|
|
7206
7207
|
if (child === void 0) {
|
|
7207
|
-
throw new
|
|
7208
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(`MCP ${this.name} is not initialized`, { code: "mcp_not_init" });
|
|
7208
7209
|
}
|
|
7209
7210
|
return this.send(child, method, params);
|
|
7210
7211
|
}
|
|
@@ -7222,7 +7223,7 @@ var StdioMcpClient = class extends BaseMcpClient {
|
|
|
7222
7223
|
this.child = void 0;
|
|
7223
7224
|
this.dropped = true;
|
|
7224
7225
|
this.rejectAllPending(
|
|
7225
|
-
new
|
|
7226
|
+
new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} disconnected`, { code: "mcp_disconnected" })
|
|
7226
7227
|
);
|
|
7227
7228
|
}, budget);
|
|
7228
7229
|
this.pending.set(id, { resolve, reject, timer });
|
|
@@ -7294,7 +7295,7 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
7294
7295
|
if (payload === "") continue;
|
|
7295
7296
|
return JSON.parse(payload);
|
|
7296
7297
|
}
|
|
7297
|
-
throw new
|
|
7298
|
+
throw new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} returned an event stream with no data payload`, {
|
|
7298
7299
|
code: "mcp_http_error"
|
|
7299
7300
|
});
|
|
7300
7301
|
}
|
|
@@ -7328,7 +7329,7 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
7328
7329
|
throw cause;
|
|
7329
7330
|
}
|
|
7330
7331
|
if (!response.ok) {
|
|
7331
|
-
throw new
|
|
7332
|
+
throw new chunkUNFBHV46_cjs.NetworkError(`MCP ${this.name} returned ${response.status}`, {
|
|
7332
7333
|
code: "mcp_http_error"
|
|
7333
7334
|
});
|
|
7334
7335
|
}
|
|
@@ -7344,7 +7345,7 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
7344
7345
|
function resolveMcpCwd(configCwd) {
|
|
7345
7346
|
if (configCwd === void 0) return process.cwd();
|
|
7346
7347
|
if (path.isAbsolute(configCwd)) return configCwd;
|
|
7347
|
-
return
|
|
7348
|
+
return chunkGM54F4FE_cjs.safePathJoin(process.cwd(), configCwd);
|
|
7348
7349
|
}
|
|
7349
7350
|
|
|
7350
7351
|
// src/internal/local-agent/mcp-pool.ts
|
|
@@ -7446,7 +7447,7 @@ function applyPersonalityFilter(exposedTools, whitelist, opts) {
|
|
|
7446
7447
|
if (exposedSet.has(name)) continue;
|
|
7447
7448
|
const hint = suggestClosest(name, exposedSet);
|
|
7448
7449
|
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)`;
|
|
7449
|
-
|
|
7450
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
7450
7451
|
`personality-tool-missing|${opts?.agentId ?? "?"}|${opts?.personalityName ?? "?"}|${name}`,
|
|
7451
7452
|
message
|
|
7452
7453
|
);
|
|
@@ -7488,7 +7489,7 @@ function levenshtein(a, b) {
|
|
|
7488
7489
|
// src/internal/local-agent/real-local-run-tools.ts
|
|
7489
7490
|
function declarativeSubagentTools(agents2, parentTools) {
|
|
7490
7491
|
if (agents2 === void 0 || Object.keys(agents2).length === 0) return [];
|
|
7491
|
-
return
|
|
7492
|
+
return chunkJW3GVLM6_cjs.subAgentToolsFromDefinitions(agents2, parentTools);
|
|
7492
7493
|
}
|
|
7493
7494
|
function resolveInheritedCredentials(agentOptions) {
|
|
7494
7495
|
const parentPlugins = Array.isArray(agentOptions.plugins) ? agentOptions.plugins : void 0;
|
|
@@ -7577,14 +7578,14 @@ function createRealLocalRun(options) {
|
|
|
7577
7578
|
function buildLoopInputs(options, runId, userText, userImages) {
|
|
7578
7579
|
const maxIterations = options.sendOptions.maxIterations;
|
|
7579
7580
|
if (maxIterations !== void 0 && (!Number.isInteger(maxIterations) || maxIterations < 1)) {
|
|
7580
|
-
throw new
|
|
7581
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
7581
7582
|
`SendOptions.maxIterations must be a positive integer, got ${maxIterations}`,
|
|
7582
7583
|
{ code: "invalid_max_iterations" }
|
|
7583
7584
|
);
|
|
7584
7585
|
}
|
|
7585
|
-
const { primary, effectiveModelId } =
|
|
7586
|
+
const { primary, effectiveModelId } = chunkARMFXTY6_cjs.resolveRunProvider(options);
|
|
7586
7587
|
const fallback = options.agentOptions.providers?.fallback;
|
|
7587
|
-
const apiKeys =
|
|
7588
|
+
const apiKeys = chunkARMFXTY6_cjs.mergeExplicitApiKey(
|
|
7588
7589
|
options.agentOptions.providers?.apiKeys,
|
|
7589
7590
|
primary,
|
|
7590
7591
|
options.agentOptions.apiKey
|
|
@@ -7593,7 +7594,7 @@ function buildLoopInputs(options, runId, userText, userImages) {
|
|
|
7593
7594
|
const extractToolCallsFromContent = options.agentOptions.providers?.routes?.[0]?.extractToolCallsFromContent;
|
|
7594
7595
|
const rateLimitSink = options.sendOptions.onRunEvent;
|
|
7595
7596
|
const modelBaseUrl = options.model?.url;
|
|
7596
|
-
const chain =
|
|
7597
|
+
const chain = chunkARMFXTY6_cjs.resolveProviderChain({
|
|
7597
7598
|
primary,
|
|
7598
7599
|
...modelBaseUrl !== void 0 ? { baseUrl: modelBaseUrl } : {},
|
|
7599
7600
|
...fallback !== void 0 ? { fallback } : {},
|
|
@@ -7601,7 +7602,7 @@ function buildLoopInputs(options, runId, userText, userImages) {
|
|
|
7601
7602
|
...credentialPoolStrategy !== void 0 ? { credentialPoolStrategy } : {},
|
|
7602
7603
|
...extractToolCallsFromContent === true ? { extractToolCallsFromContent: true } : {},
|
|
7603
7604
|
...rateLimitSink !== void 0 ? {
|
|
7604
|
-
onRateLimit: (info) =>
|
|
7605
|
+
onRateLimit: (info) => chunkJ6GXS5A2_cjs.emitRunEvent(rateLimitSink, { type: "rate_limit", ...info })
|
|
7605
7606
|
} : {}
|
|
7606
7607
|
});
|
|
7607
7608
|
const llm = chain.length === 1 ? chain[0] : new FallbackLlmClient(chain);
|
|
@@ -7760,7 +7761,7 @@ var RealLocalRun = class extends FixtureRunBase {
|
|
|
7760
7761
|
};
|
|
7761
7762
|
try {
|
|
7762
7763
|
const runLoop = () => inputs.activeTools !== void 0 ? chunkIJ7M6GOG_cjs.withToolWhitelist(new Set(inputs.activeTools), () => runAgentLoop(inputs)) : runAgentLoop(inputs);
|
|
7763
|
-
const output = await
|
|
7764
|
+
const output = await chunkJW3GVLM6_cjs.withInheritedSubAgentCredentials(this.inheritedCredentials, runLoop);
|
|
7764
7765
|
this.applyAgentLoopOutput(output);
|
|
7765
7766
|
this.transitionTo(output.finalStatus);
|
|
7766
7767
|
} catch (cause) {
|
|
@@ -7853,7 +7854,7 @@ function buildRealRunOptions(args) {
|
|
|
7853
7854
|
};
|
|
7854
7855
|
}
|
|
7855
7856
|
async function createFixtureRunHelper(args) {
|
|
7856
|
-
const sessionMessages =
|
|
7857
|
+
const sessionMessages = chunkPSLCVSCS_cjs.getSessionMessages(args.inputs.agentId);
|
|
7857
7858
|
const projectMcpServers = args.inputs.settingSourcesIncludeProject ? await readProjectMcpServers(args.inputs.workspaceCwd) : {};
|
|
7858
7859
|
return createLocalRun({
|
|
7859
7860
|
agentId: args.inputs.agentId,
|
|
@@ -7872,7 +7873,7 @@ async function createFixtureRunHelper(args) {
|
|
|
7872
7873
|
}
|
|
7873
7874
|
async function dispatchLocalRun(args) {
|
|
7874
7875
|
const apiKey = chunk6LHQPOMI_cjs.resolveApiKey(args.inputs.options.apiKey);
|
|
7875
|
-
if (
|
|
7876
|
+
if (chunkARMFXTY6_cjs.shouldUseRealLocalRuntime(apiKey)) {
|
|
7876
7877
|
return createRealLocalRun(
|
|
7877
7878
|
buildRealRunOptions({
|
|
7878
7879
|
inputs: args.inputs,
|
|
@@ -8128,16 +8129,16 @@ async function disposeLocalAgentSession(agent) {
|
|
|
8128
8129
|
agent.lifecycleAbortController.abort();
|
|
8129
8130
|
await chunkZF2LDKQQ_cjs.withCwdMutex(`agent-send:${agent.agentId}`, () => Promise.resolve());
|
|
8130
8131
|
disposeSessionMcpClients(agent.agentId);
|
|
8131
|
-
await
|
|
8132
|
+
await chunkPSLCVSCS_cjs.flushSessionWrites();
|
|
8132
8133
|
await flushRegistrySaves(agent.workspaceCwd);
|
|
8133
8134
|
await disposeSessionStore(agent.sessionStore);
|
|
8134
|
-
|
|
8135
|
+
chunkPSLCVSCS_cjs.discardSession(agent.workspaceCwd, agent.agentId);
|
|
8135
8136
|
}
|
|
8136
8137
|
async function reloadLocalAgent(agent) {
|
|
8137
8138
|
if (agent.context !== void 0) await agent.context.refresh();
|
|
8138
8139
|
if (agent.skillsManager !== void 0) await agent.skillsManager.refresh();
|
|
8139
8140
|
if (agent.pluginsManager !== void 0) await agent.pluginsManager.refresh();
|
|
8140
|
-
return await
|
|
8141
|
+
return await chunkXW4POZ6V_cjs.loadSubagents(
|
|
8141
8142
|
agent.workspaceCwd,
|
|
8142
8143
|
agent.settingSourcesIncludeProject,
|
|
8143
8144
|
agent.options.agents
|
|
@@ -8184,7 +8185,7 @@ function buildAgentMemory(pluginManager, workspaceCwd, defaultContext) {
|
|
|
8184
8185
|
...partial?.metadata !== void 0 ? { metadata: partial.metadata } : defaultContext?.metadata !== void 0 ? { metadata: defaultContext.metadata } : {}
|
|
8185
8186
|
};
|
|
8186
8187
|
if (merged.userId === "") {
|
|
8187
|
-
throw new
|
|
8188
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
8188
8189
|
"agent.memory requires a userId \u2014 either set AgentOptions.memoryContext.userId or pass ctx.userId at call time.",
|
|
8189
8190
|
{ code: "memory_context_missing_user_id" }
|
|
8190
8191
|
);
|
|
@@ -8194,7 +8195,7 @@ function buildAgentMemory(pluginManager, workspaceCwd, defaultContext) {
|
|
|
8194
8195
|
async function requireAdapters() {
|
|
8195
8196
|
const r = await ensure();
|
|
8196
8197
|
if (r.adapters.length === 0) {
|
|
8197
|
-
throw new
|
|
8198
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
8198
8199
|
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.`,
|
|
8199
8200
|
{ code: "no_memory_adapter" }
|
|
8200
8201
|
);
|
|
@@ -8235,7 +8236,7 @@ function buildAgentMemory(pluginManager, workspaceCwd, defaultContext) {
|
|
|
8235
8236
|
const prefix = id.split(":", 1)[0] ?? "";
|
|
8236
8237
|
const target = adapters.find((a) => a.id === prefix);
|
|
8237
8238
|
if (target === void 0) {
|
|
8238
|
-
throw new
|
|
8239
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
8239
8240
|
`No adapter found for MemoryId prefix "${prefix}" (registered: ${adapters.map((a) => a.id).join(", ")}).`,
|
|
8240
8241
|
{ code: "no_memory_adapter" }
|
|
8241
8242
|
);
|
|
@@ -8383,7 +8384,7 @@ async function finalize(args, queryMode, result) {
|
|
|
8383
8384
|
};
|
|
8384
8385
|
args.cache?.set(args.userText, queryMode, result, tenantCtx);
|
|
8385
8386
|
if (args.persistTranscripts === true && args.cwd !== void 0) {
|
|
8386
|
-
await chunkTMKTSYDS_cjs.persistActiveMemoryTranscript(args.memoryRoot ??
|
|
8387
|
+
await chunkTMKTSYDS_cjs.persistActiveMemoryTranscript(args.memoryRoot ?? chunk76PIKR4P_cjs.resolveMemoryRoot(args.cwd), {
|
|
8387
8388
|
runId: args.runId ?? `run-${Date.now()}`,
|
|
8388
8389
|
startedAtMs: Date.now() - result.durationMs,
|
|
8389
8390
|
userText: args.userText,
|
|
@@ -8486,7 +8487,7 @@ var openAiMemoryEmbeddingProviderAdapter = {
|
|
|
8486
8487
|
transport: "remote",
|
|
8487
8488
|
authProviderId: "openai",
|
|
8488
8489
|
autoSelectPriority: 20,
|
|
8489
|
-
create: (options) =>
|
|
8490
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8490
8491
|
{
|
|
8491
8492
|
id: "openai",
|
|
8492
8493
|
defaultBaseUrl: "https://api.openai.com",
|
|
@@ -8508,7 +8509,7 @@ var azureOpenAiMemoryEmbeddingProviderAdapter = {
|
|
|
8508
8509
|
transport: "remote",
|
|
8509
8510
|
authProviderId: "azure-openai",
|
|
8510
8511
|
autoSelectPriority: 25,
|
|
8511
|
-
create: (options) =>
|
|
8512
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8512
8513
|
{
|
|
8513
8514
|
id: "azure-openai",
|
|
8514
8515
|
defaultBaseUrl: "https://your-resource.openai.azure.com",
|
|
@@ -8544,7 +8545,7 @@ var cohereMemoryEmbeddingProviderAdapter = {
|
|
|
8544
8545
|
transport: "remote",
|
|
8545
8546
|
authProviderId: "cohere",
|
|
8546
8547
|
autoSelectPriority: 30,
|
|
8547
|
-
create: (options) =>
|
|
8548
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8548
8549
|
{
|
|
8549
8550
|
id: "cohere",
|
|
8550
8551
|
defaultBaseUrl: "https://api.cohere.com",
|
|
@@ -8590,7 +8591,7 @@ var deepinfraMemoryEmbeddingProviderAdapter = {
|
|
|
8590
8591
|
transport: "remote",
|
|
8591
8592
|
authProviderId: "deepinfra",
|
|
8592
8593
|
autoSelectPriority: 13,
|
|
8593
|
-
create: (options) =>
|
|
8594
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8594
8595
|
{
|
|
8595
8596
|
id: "deepinfra",
|
|
8596
8597
|
defaultBaseUrl: "https://api.deepinfra.com",
|
|
@@ -8616,7 +8617,7 @@ var geminiMemoryEmbeddingProviderAdapter = {
|
|
|
8616
8617
|
transport: "remote",
|
|
8617
8618
|
authProviderId: "gemini",
|
|
8618
8619
|
autoSelectPriority: 30,
|
|
8619
|
-
create: (options) =>
|
|
8620
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8620
8621
|
{
|
|
8621
8622
|
id: "gemini",
|
|
8622
8623
|
defaultBaseUrl: "https://generativelanguage.googleapis.com",
|
|
@@ -8644,7 +8645,7 @@ var jinaMemoryEmbeddingProviderAdapter = {
|
|
|
8644
8645
|
transport: "remote",
|
|
8645
8646
|
authProviderId: "jina",
|
|
8646
8647
|
autoSelectPriority: 35,
|
|
8647
|
-
create: (options) =>
|
|
8648
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8648
8649
|
{
|
|
8649
8650
|
id: "jina",
|
|
8650
8651
|
defaultBaseUrl: "https://api.jina.ai",
|
|
@@ -8667,7 +8668,7 @@ var mistralMemoryEmbeddingProviderAdapter = {
|
|
|
8667
8668
|
transport: "remote",
|
|
8668
8669
|
authProviderId: "mistral",
|
|
8669
8670
|
autoSelectPriority: 18,
|
|
8670
|
-
create: (options) =>
|
|
8671
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8671
8672
|
{
|
|
8672
8673
|
id: "mistral",
|
|
8673
8674
|
defaultBaseUrl: "https://api.mistral.ai",
|
|
@@ -8709,7 +8710,7 @@ var ollamaMemoryEmbeddingProviderAdapter = {
|
|
|
8709
8710
|
autoSelectPriority: 10,
|
|
8710
8711
|
create: (options) => {
|
|
8711
8712
|
const apiKey = options.apiKey ?? process.env.OLLAMA_API_KEY ?? OLLAMA_LOCAL_SENTINEL_KEY;
|
|
8712
|
-
return
|
|
8713
|
+
return chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8713
8714
|
{
|
|
8714
8715
|
id: "ollama",
|
|
8715
8716
|
defaultBaseUrl: "http://localhost:11434",
|
|
@@ -8737,7 +8738,7 @@ var openRouterMemoryEmbeddingProviderAdapter = {
|
|
|
8737
8738
|
transport: "remote",
|
|
8738
8739
|
authProviderId: "openrouter",
|
|
8739
8740
|
autoSelectPriority: 15,
|
|
8740
|
-
create: (options) =>
|
|
8741
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8741
8742
|
{
|
|
8742
8743
|
id: "openrouter",
|
|
8743
8744
|
defaultBaseUrl: "https://openrouter.ai/api",
|
|
@@ -8765,7 +8766,7 @@ var voyageMemoryEmbeddingProviderAdapter = {
|
|
|
8765
8766
|
transport: "remote",
|
|
8766
8767
|
authProviderId: "voyage",
|
|
8767
8768
|
autoSelectPriority: 14,
|
|
8768
|
-
create: (options) =>
|
|
8769
|
+
create: (options) => chunkMEUBLCM4_cjs.createOpenAiCompatibleRuntime(
|
|
8769
8770
|
{
|
|
8770
8771
|
id: "voyage",
|
|
8771
8772
|
defaultBaseUrl: "https://api.voyageai.com",
|
|
@@ -8877,7 +8878,7 @@ function createMemoryGetTool(opts) {
|
|
|
8877
8878
|
const lines = readNumber(input.lines);
|
|
8878
8879
|
const resolved = path.resolve(memoryRoot, relPath);
|
|
8879
8880
|
if (!isPathInside(memoryRoot, resolved)) {
|
|
8880
|
-
throw new
|
|
8881
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
8881
8882
|
`memory_get rejected path that escapes memory root: ${relPath}`,
|
|
8882
8883
|
{ code: "memory_path_escapes_root" }
|
|
8883
8884
|
);
|
|
@@ -8897,7 +8898,7 @@ function readString(value, errorIfMissing, allowUndefined = false) {
|
|
|
8897
8898
|
if (typeof value === "string") return value;
|
|
8898
8899
|
if (allowUndefined && (value === void 0 || value === null)) return "";
|
|
8899
8900
|
if (errorIfMissing !== void 0) {
|
|
8900
|
-
throw new
|
|
8901
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(errorIfMissing, { code: "memory_tool_bad_args" });
|
|
8901
8902
|
}
|
|
8902
8903
|
return "";
|
|
8903
8904
|
}
|
|
@@ -8974,7 +8975,7 @@ var LocalAgentMemory = class {
|
|
|
8974
8975
|
const openOpts = { cwd: this.workspaceCwd, memoryRoot };
|
|
8975
8976
|
if (embedding !== void 0) openOpts.embedding = embedding;
|
|
8976
8977
|
if (cfg?.backend !== void 0) openOpts.backend = cfg.backend;
|
|
8977
|
-
this.index = await
|
|
8978
|
+
this.index = await chunkTTBIQTO5_cjs.IndexManager.open(openOpts);
|
|
8978
8979
|
await this.index.sync();
|
|
8979
8980
|
this.toolsCache = [
|
|
8980
8981
|
createMemorySearchTool({ index: this.index }),
|
|
@@ -8995,7 +8996,7 @@ var LocalAgentMemory = class {
|
|
|
8995
8996
|
async runActiveMemoryIfEnabled(userText, priorMessages, telemetry) {
|
|
8996
8997
|
const cfg = this.options.memory?.activeRecall;
|
|
8997
8998
|
if (cfg?.enabled !== true || this.index === void 0) return void 0;
|
|
8998
|
-
if (this.breaker === void 0) this.breaker = new
|
|
8999
|
+
if (this.breaker === void 0) this.breaker = new chunkARMFXTY6_cjs.CircuitBreaker();
|
|
8999
9000
|
if (this.cache === void 0) this.cache = new ActiveMemoryCache();
|
|
9000
9001
|
const result = await runActiveMemory({
|
|
9001
9002
|
userText,
|
|
@@ -9018,7 +9019,7 @@ var LocalAgentMemory = class {
|
|
|
9018
9019
|
* and the active-memory transcript writer. Three separate resolutions is how they drifted (#463).
|
|
9019
9020
|
*/
|
|
9020
9021
|
memoryRoot() {
|
|
9021
|
-
this.memoryRootCache ??=
|
|
9022
|
+
this.memoryRootCache ??= chunk76PIKR4P_cjs.resolveMemoryRoot(this.workspaceCwd, this.options.memory);
|
|
9022
9023
|
return this.memoryRootCache;
|
|
9023
9024
|
}
|
|
9024
9025
|
buildActiveMemoryOptions(cfg) {
|
|
@@ -9133,7 +9134,7 @@ function createLocalAgentMemoryProvider(opts) {
|
|
|
9133
9134
|
return { facts: [], systemPromptAdditions: summary };
|
|
9134
9135
|
},
|
|
9135
9136
|
async recordSessionSummary(args) {
|
|
9136
|
-
await
|
|
9137
|
+
await chunk76PIKR4P_cjs.writeSessionSummary(args);
|
|
9137
9138
|
},
|
|
9138
9139
|
async sync(handle) {
|
|
9139
9140
|
const state = handle[INTERNAL_LAM_KEY];
|
|
@@ -9211,19 +9212,19 @@ var PersonalityRegistry = class _PersonalityRegistry {
|
|
|
9211
9212
|
function addEntity(byName, entity, origin, collisionMap) {
|
|
9212
9213
|
const fm = entity.frontmatter;
|
|
9213
9214
|
if (PersonalityRegistry.isReservedClearSlug(fm.name)) {
|
|
9214
|
-
throw new
|
|
9215
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
9215
9216
|
`Personality name "${fm.name}" is reserved (used to clear active preset)`,
|
|
9216
9217
|
{ code: "personality_reserved_name" }
|
|
9217
9218
|
);
|
|
9218
9219
|
}
|
|
9219
9220
|
if (entity.body.trim().length === 0) {
|
|
9220
|
-
throw new
|
|
9221
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
9221
9222
|
`Personality "${fm.name}" has empty body (system prompt required)`,
|
|
9222
9223
|
{ code: "personality_empty_body" }
|
|
9223
9224
|
);
|
|
9224
9225
|
}
|
|
9225
9226
|
if (origin === "project" && collisionMap?.has(fm.name)) {
|
|
9226
|
-
|
|
9227
|
+
chunkOCEQ6DW2_cjs.warnOnce(
|
|
9227
9228
|
`personality-collision-${fm.name}`,
|
|
9228
9229
|
`[theokit-sdk] personality "${fm.name}" overridden by project preset`
|
|
9229
9230
|
);
|
|
@@ -9252,7 +9253,7 @@ async function performPersonalitySwitch(args) {
|
|
|
9252
9253
|
const preset = args.registry.get(args.requestedName);
|
|
9253
9254
|
if (preset === void 0) {
|
|
9254
9255
|
const available = args.registry.all().map((p) => p.name).join(", ") || "(none)";
|
|
9255
|
-
throw new
|
|
9256
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
9256
9257
|
`Personality "${args.requestedName}" not found. Available: ${available}`,
|
|
9257
9258
|
{ code: "personality_not_found" }
|
|
9258
9259
|
);
|
|
@@ -9273,14 +9274,14 @@ async function performPersonalitySwitch(args) {
|
|
|
9273
9274
|
|
|
9274
9275
|
// src/internal/local-agent/local-agent-personality-extensions.ts
|
|
9275
9276
|
function resolveActivePersonalityPreset(args) {
|
|
9276
|
-
const forkCtx =
|
|
9277
|
+
const forkCtx = chunkJ4SA2ZEJ_cjs.currentPersonalityContext();
|
|
9277
9278
|
const slug = forkCtx !== void 0 ? forkCtx.slug : args.personalityStore.active(args.agentId);
|
|
9278
9279
|
if (slug === void 0) return void 0;
|
|
9279
9280
|
return args.personalityRegistry?.get(slug);
|
|
9280
9281
|
}
|
|
9281
9282
|
async function ensurePersonalityRegistryIfNeeded(args) {
|
|
9282
9283
|
if (args.personalityRegistry !== void 0) return args.personalityRegistry;
|
|
9283
|
-
const forkSlug =
|
|
9284
|
+
const forkSlug = chunkJ4SA2ZEJ_cjs.currentPersonalityContext()?.slug;
|
|
9284
9285
|
const ownSlug = args.personalityStore.active(args.agentId);
|
|
9285
9286
|
if (forkSlug === void 0 && ownSlug === void 0) return void 0;
|
|
9286
9287
|
return await PersonalityRegistry.load(args.workspaceCwd);
|
|
@@ -9293,8 +9294,8 @@ function applyPersonalityOverlay(preset, base) {
|
|
|
9293
9294
|
${preset.systemPrompt}`;
|
|
9294
9295
|
}
|
|
9295
9296
|
async function localAgentUsePersonality(agent, name, opts) {
|
|
9296
|
-
if (
|
|
9297
|
-
|
|
9297
|
+
if (chunkJ4SA2ZEJ_cjs.currentPersonalityContext() !== void 0) {
|
|
9298
|
+
chunkJ4SA2ZEJ_cjs.warnPersonalitySwitchInsideFork(agent.agentId);
|
|
9298
9299
|
return null;
|
|
9299
9300
|
}
|
|
9300
9301
|
if (agent.personalityRegistry === void 0) {
|
|
@@ -9310,8 +9311,8 @@ async function localAgentUsePersonality(agent, name, opts) {
|
|
|
9310
9311
|
registry,
|
|
9311
9312
|
store: agent.personalityStore,
|
|
9312
9313
|
invalidateCache: (reason) => agent.invalidateCache(reason),
|
|
9313
|
-
appendSessionMessage: (msg) =>
|
|
9314
|
-
clearSession: () =>
|
|
9314
|
+
appendSessionMessage: (msg) => chunkPSLCVSCS_cjs.appendSessionMessage(agent.agentId, msg),
|
|
9315
|
+
clearSession: () => chunkPSLCVSCS_cjs.clearSession(agent.agentId),
|
|
9315
9316
|
opts: opts ?? {}
|
|
9316
9317
|
})
|
|
9317
9318
|
);
|
|
@@ -9322,7 +9323,7 @@ function localAgentRunUntil(agent, goal, options) {
|
|
|
9322
9323
|
async function* wrap() {
|
|
9323
9324
|
const { runUntilImpl } = await import('./run-until-DG2KXWB2.cjs');
|
|
9324
9325
|
const buildDeps = async () => {
|
|
9325
|
-
const { judgeCallImpl } = await import('./judge-call-
|
|
9326
|
+
const { judgeCallImpl } = await import('./judge-call-AQQYK6VT.cjs');
|
|
9326
9327
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
9327
9328
|
const create = getAgentFacade().create;
|
|
9328
9329
|
return {
|
|
@@ -9355,7 +9356,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
|
|
|
9355
9356
|
async function localAgentFork(parent, options) {
|
|
9356
9357
|
const { forkAgentImpl } = await import('./fork-agent-WAEQI2DL.cjs');
|
|
9357
9358
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
9358
|
-
const { withPersonalityContext } = await import('./context-
|
|
9359
|
+
const { withPersonalityContext } = await import('./context-ZOULM2RB.cjs');
|
|
9359
9360
|
const create = getAgentFacade().create;
|
|
9360
9361
|
return withPersonalityContext(
|
|
9361
9362
|
{ slug: parent.personalitySlugSnapshot, isFork: true },
|
|
@@ -9425,7 +9426,7 @@ function wrapRunWithCompletionCheck(args) {
|
|
|
9425
9426
|
judgeOpts
|
|
9426
9427
|
);
|
|
9427
9428
|
const complete = !verdict.parseFailed && verdict.verdict === "done";
|
|
9428
|
-
|
|
9429
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(args.onRunEvent, {
|
|
9429
9430
|
type: "completion_check",
|
|
9430
9431
|
complete,
|
|
9431
9432
|
reason: verdict.reason
|
|
@@ -9742,7 +9743,7 @@ function wrapRunWithOutputProcessors(args) {
|
|
|
9742
9743
|
if (result.status !== "finished" || result.result === void 0) return result;
|
|
9743
9744
|
const res = await runOutputProcessors(args.processors, result.result, args.agentId);
|
|
9744
9745
|
if (res.kind === "ok") return { ...result, result: res.value };
|
|
9745
|
-
|
|
9746
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(args.onRunEvent, {
|
|
9746
9747
|
type: "tripwire",
|
|
9747
9748
|
reason: res.tripwire.reason,
|
|
9748
9749
|
processorId: res.tripwire.processorId
|
|
@@ -9832,7 +9833,7 @@ async function applyInputProcessors(inputs, message, rawUserText, options, sendM
|
|
|
9832
9833
|
}
|
|
9833
9834
|
const res = await runInputProcessors(processors, rawUserText, inputs.agentId);
|
|
9834
9835
|
if (res.kind === "tripwire") {
|
|
9835
|
-
|
|
9836
|
+
chunkJ6GXS5A2_cjs.emitRunEvent(options.onRunEvent, {
|
|
9836
9837
|
type: "tripwire",
|
|
9837
9838
|
reason: res.tripwire.reason,
|
|
9838
9839
|
processorId: res.tripwire.processorId
|
|
@@ -9849,7 +9850,7 @@ async function applyInputProcessors(inputs, message, rawUserText, options, sendM
|
|
|
9849
9850
|
return { userText: res.value, effectiveMessage };
|
|
9850
9851
|
}
|
|
9851
9852
|
async function executeSendLocked(inputs, message, options) {
|
|
9852
|
-
if (inputs.disposed) throw new
|
|
9853
|
+
if (inputs.disposed) throw new chunkUNFBHV46_cjs.AgentDisposedError(inputs.agentId);
|
|
9853
9854
|
await consumePending(
|
|
9854
9855
|
inputs.agentId,
|
|
9855
9856
|
inputs.invalidationPending,
|
|
@@ -9865,7 +9866,7 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9865
9866
|
if (inputs.options.onBeforeSend !== void 0) {
|
|
9866
9867
|
await inputs.options.onBeforeSend({
|
|
9867
9868
|
conversationId: inputs.agentId,
|
|
9868
|
-
previousMessageCount:
|
|
9869
|
+
previousMessageCount: chunkPSLCVSCS_cjs.getSessionMessages(inputs.agentId).length
|
|
9869
9870
|
});
|
|
9870
9871
|
}
|
|
9871
9872
|
await inputs.runPreHook(userText);
|
|
@@ -9877,8 +9878,8 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9877
9878
|
userText,
|
|
9878
9879
|
sendOptions: options
|
|
9879
9880
|
});
|
|
9880
|
-
const priorMessages = [...
|
|
9881
|
-
|
|
9881
|
+
const priorMessages = [...chunkPSLCVSCS_cjs.getSessionMessages(inputs.agentId)];
|
|
9882
|
+
chunkPSLCVSCS_cjs.appendSessionMessage(inputs.agentId, { role: "user", text: userText });
|
|
9882
9883
|
await persistMemoryFactIfWritePrompt(inputs.workspaceCwd, inputs.options.memory, userText);
|
|
9883
9884
|
const memoryFacts = await readMemoryForSend(inputs.workspaceCwd, inputs.options.memory, userText);
|
|
9884
9885
|
const memoryTools = void 0;
|
|
@@ -9929,7 +9930,7 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9929
9930
|
function buildCompletionCheckDeps() {
|
|
9930
9931
|
return {
|
|
9931
9932
|
judge: async (ctx, opts) => {
|
|
9932
|
-
const { judgeCallImpl } = await import('./judge-call-
|
|
9933
|
+
const { judgeCallImpl } = await import('./judge-call-AQQYK6VT.cjs');
|
|
9933
9934
|
const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
|
|
9934
9935
|
return judgeCallImpl(ctx, opts, { create: getAgentFacade().create });
|
|
9935
9936
|
}
|
|
@@ -9953,7 +9954,7 @@ function readMemoryForSend(workspaceCwd, memoryConfig, query) {
|
|
|
9953
9954
|
...query === void 0 ? {} : { query }
|
|
9954
9955
|
});
|
|
9955
9956
|
} catch (cause) {
|
|
9956
|
-
if (!(cause instanceof
|
|
9957
|
+
if (!(cause instanceof chunkUNFBHV46_cjs.ConfigurationError)) throw cause;
|
|
9957
9958
|
reportRefusedMemoryDirectoryOnce(workspaceCwd, memoryConfig?.directory, cause.message);
|
|
9958
9959
|
return [];
|
|
9959
9960
|
}
|
|
@@ -9972,7 +9973,7 @@ function registerRunAsTask(run, agentId, taskOpt, userText) {
|
|
|
9972
9973
|
promptPreview: userText.slice(0, 120),
|
|
9973
9974
|
...opts.meta ?? {}
|
|
9974
9975
|
};
|
|
9975
|
-
void
|
|
9976
|
+
void chunkJ6GXS5A2_cjs.submit({
|
|
9976
9977
|
kind: "run",
|
|
9977
9978
|
work: async (ctx) => {
|
|
9978
9979
|
ctx.signal.addEventListener(
|
|
@@ -10131,7 +10132,7 @@ var LocalAgent = class {
|
|
|
10131
10132
|
this.options = options;
|
|
10132
10133
|
this.workspaceCwd = resolveCwd(options.local?.cwd);
|
|
10133
10134
|
this.transcriptBaseDir = resolveSessionDir(options.local);
|
|
10134
|
-
this.sessionStore = options.local?.sessionStore ?? new
|
|
10135
|
+
this.sessionStore = options.local?.sessionStore ?? new chunkB3XXQX6L_cjs.FsSessionStore({ baseDir: this.transcriptBaseDir, cwd: this.workspaceCwd });
|
|
10135
10136
|
this.settingSourcesIncludeProject = includesSetting(options, "project");
|
|
10136
10137
|
this.settingSourcesIncludePlugins = includesSetting(options, "plugins");
|
|
10137
10138
|
const sub = bootstrapSubmanagers({
|
|
@@ -10176,7 +10177,7 @@ var LocalAgent = class {
|
|
|
10176
10177
|
if (this.pluginsManager !== void 0) await this.pluginsManager.initialize();
|
|
10177
10178
|
const codePlugins = chunkBV2MWEMV_cjs.extractCodePlugins(this.options.plugins);
|
|
10178
10179
|
await this.pluginManagerCode.initialize(codePlugins);
|
|
10179
|
-
this.resolvedSubagents = await
|
|
10180
|
+
this.resolvedSubagents = await chunkXW4POZ6V_cjs.loadSubagents(
|
|
10180
10181
|
this.workspaceCwd,
|
|
10181
10182
|
this.settingSourcesIncludeProject,
|
|
10182
10183
|
this.options.agents,
|
|
@@ -10184,7 +10185,7 @@ var LocalAgent = class {
|
|
|
10184
10185
|
);
|
|
10185
10186
|
await acquireLeaseIfPossible(this.sessionStore, this.agentId);
|
|
10186
10187
|
try {
|
|
10187
|
-
await
|
|
10188
|
+
await chunkPSLCVSCS_cjs.hydrateSession(this.agentId, { store: this.sessionStore, cwd: this.workspaceCwd });
|
|
10188
10189
|
await this.personalityStore.hydrate(this.agentId);
|
|
10189
10190
|
} catch (err) {
|
|
10190
10191
|
await releaseLeaseIfPossible(this.sessionStore, this.agentId);
|
|
@@ -10342,7 +10343,7 @@ var LocalAgent = class {
|
|
|
10342
10343
|
agentId: this.agentId
|
|
10343
10344
|
});
|
|
10344
10345
|
if (preRun.blocked) {
|
|
10345
|
-
throw new
|
|
10346
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
10346
10347
|
`preRun hook denied execution: ${preRun.reason ?? "unspecified"}`,
|
|
10347
10348
|
{ code: "hook_denied" }
|
|
10348
10349
|
);
|
|
@@ -10474,7 +10475,7 @@ async function guardAgainstIdCollision(options) {
|
|
|
10474
10475
|
const persistenceCwd = resolveAgentPersistenceCwd(options);
|
|
10475
10476
|
await hydrateRegistryFromDisk(persistenceCwd);
|
|
10476
10477
|
if (getRegisteredAgent(options.agentId) !== void 0) {
|
|
10477
|
-
throw new
|
|
10478
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
10478
10479
|
`Agent "${options.agentId}" already exists. Use Agent.resume("${options.agentId}") to reattach, or pick a different agentId.`,
|
|
10479
10480
|
{ code: "agent_id_already_exists" }
|
|
10480
10481
|
);
|
|
@@ -10507,7 +10508,7 @@ async function maybeInjectHandoffTools(options) {
|
|
|
10507
10508
|
const spec = "@theokit/sdk-handoff/internal/tool-injector";
|
|
10508
10509
|
mod = await import(spec);
|
|
10509
10510
|
} catch (err) {
|
|
10510
|
-
throw new
|
|
10511
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
10511
10512
|
"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).",
|
|
10512
10513
|
{ code: "handoff_package_missing", cause: err }
|
|
10513
10514
|
);
|
|
@@ -10525,22 +10526,22 @@ async function maybeInjectHandoffTools(options) {
|
|
|
10525
10526
|
};
|
|
10526
10527
|
}
|
|
10527
10528
|
function keyWillFlowToProvider(apiKey, provider) {
|
|
10528
|
-
if (
|
|
10529
|
-
if (
|
|
10529
|
+
if (chunkARMFXTY6_cjs.isFixtureApiKey(apiKey)) return false;
|
|
10530
|
+
if (chunkARMFXTY6_cjs.getConfiguredBaseUrl() !== void 0) return false;
|
|
10530
10531
|
if (provider === void 0) return false;
|
|
10531
|
-
const profile =
|
|
10532
|
+
const profile = chunkR3ZQBPA5_cjs.getProviderProfile(provider);
|
|
10532
10533
|
if (profile === void 0) return false;
|
|
10533
10534
|
return profile.authType !== "none";
|
|
10534
10535
|
}
|
|
10535
10536
|
function missingApiKeyMessage() {
|
|
10536
|
-
const present =
|
|
10537
|
+
const present = chunkARMFXTY6_cjs.presentProviderCredentialEnvVars();
|
|
10537
10538
|
const base = `Missing API key \u2014 set ${chunk6LHQPOMI_cjs.API_KEY_ENV_VAR}, or pass \`apiKey\` to Agent.create()`;
|
|
10538
10539
|
if (present.length === 0) return `${base}.`;
|
|
10539
10540
|
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]}, ... })\`.`;
|
|
10540
10541
|
}
|
|
10541
10542
|
function providerNeedsCallerKey(provider) {
|
|
10542
10543
|
if (provider === void 0) return true;
|
|
10543
|
-
const profile =
|
|
10544
|
+
const profile = chunkR3ZQBPA5_cjs.getProviderProfile(provider);
|
|
10544
10545
|
if (profile === void 0) return true;
|
|
10545
10546
|
return profile.authType === "api_key";
|
|
10546
10547
|
}
|
|
@@ -10549,16 +10550,16 @@ async function createLocalAgent(options) {
|
|
|
10549
10550
|
const apiKey = chunk6LHQPOMI_cjs.resolveApiKey(options.apiKey);
|
|
10550
10551
|
if (apiKey === void 0) {
|
|
10551
10552
|
if (providerNeedsCallerKey(provider)) {
|
|
10552
|
-
throw new
|
|
10553
|
+
throw new chunkUNFBHV46_cjs.AuthenticationError(missingApiKeyMessage(), { code: "missing_api_key" });
|
|
10553
10554
|
}
|
|
10554
10555
|
} else {
|
|
10555
10556
|
const willFlowToProvider = keyWillFlowToProvider(apiKey, provider);
|
|
10556
|
-
const shape =
|
|
10557
|
+
const shape = chunkARMFXTY6_cjs.validateApiKeyShape(apiKey, {
|
|
10557
10558
|
strict: willFlowToProvider,
|
|
10558
10559
|
...willFlowToProvider ? { provider } : {}
|
|
10559
10560
|
});
|
|
10560
10561
|
if (shape.malformed) {
|
|
10561
|
-
throw new
|
|
10562
|
+
throw new chunkUNFBHV46_cjs.AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
10562
10563
|
}
|
|
10563
10564
|
}
|
|
10564
10565
|
const agent = new LocalAgent(options);
|
|
@@ -10568,19 +10569,19 @@ async function createLocalAgent(options) {
|
|
|
10568
10569
|
async function createCloudAgent(options) {
|
|
10569
10570
|
const apiKey = chunk6LHQPOMI_cjs.resolveApiKey(options.apiKey);
|
|
10570
10571
|
if (apiKey === void 0) {
|
|
10571
|
-
throw new
|
|
10572
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError("Missing API key for cloud agent", {
|
|
10572
10573
|
code: "missing_api_key"
|
|
10573
10574
|
});
|
|
10574
10575
|
}
|
|
10575
|
-
const shape =
|
|
10576
|
+
const shape = chunkARMFXTY6_cjs.validateApiKeyShape(apiKey);
|
|
10576
10577
|
if (shape.malformed) {
|
|
10577
|
-
throw new
|
|
10578
|
+
throw new chunkUNFBHV46_cjs.AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
10578
10579
|
}
|
|
10579
|
-
const baseUrl =
|
|
10580
|
+
const baseUrl = chunkARMFXTY6_cjs.getConfiguredBaseUrl();
|
|
10580
10581
|
if (baseUrl === void 0) {
|
|
10581
10582
|
return new CloudAgent(options);
|
|
10582
10583
|
}
|
|
10583
|
-
const response = await
|
|
10584
|
+
const response = await chunkARMFXTY6_cjs.httpRequest("/v1/agents", {
|
|
10584
10585
|
apiKey,
|
|
10585
10586
|
method: "POST",
|
|
10586
10587
|
body: {
|
|
@@ -10605,7 +10606,7 @@ function resolveAgentPersistenceCwd(options) {
|
|
|
10605
10606
|
return process.cwd();
|
|
10606
10607
|
}
|
|
10607
10608
|
async function rehydrateExistingAgent(agentId, existing, options) {
|
|
10608
|
-
await
|
|
10609
|
+
await chunkARMFXTY6_cjs.discoverProviderPlugins();
|
|
10609
10610
|
await validateRehydratedAgent(agentId, existing);
|
|
10610
10611
|
const mergedLocal = options.local !== void 0 && existing.options.local !== void 0 ? { ...existing.options.local, ...options.local } : options.local ?? existing.options.local;
|
|
10611
10612
|
const mergedOptions = {
|
|
@@ -10634,13 +10635,13 @@ async function validateRehydratedAgent(agentId, entry) {
|
|
|
10634
10635
|
try {
|
|
10635
10636
|
info = await promises.stat(candidate);
|
|
10636
10637
|
} catch (cause) {
|
|
10637
|
-
throw new
|
|
10638
|
+
throw new chunkUNFBHV46_cjs.UnknownAgentError(
|
|
10638
10639
|
`Agent "${agentId}" cannot be rehydrated \u2014 workspace cwd "${candidate}" is missing or inaccessible.`,
|
|
10639
10640
|
{ code: "agent_rehydration_failed", cause }
|
|
10640
10641
|
);
|
|
10641
10642
|
}
|
|
10642
10643
|
if (!info.isDirectory()) {
|
|
10643
|
-
throw new
|
|
10644
|
+
throw new chunkUNFBHV46_cjs.UnknownAgentError(
|
|
10644
10645
|
`Agent "${agentId}" cannot be rehydrated \u2014 workspace cwd "${candidate}" exists but is not a directory.`,
|
|
10645
10646
|
{ code: "agent_rehydration_failed" }
|
|
10646
10647
|
);
|
|
@@ -10695,7 +10696,7 @@ async function getRegisteredAgentOrThrow(agentId, cwd = process.cwd()) {
|
|
|
10695
10696
|
agent = getRegisteredAgent(agentId);
|
|
10696
10697
|
}
|
|
10697
10698
|
if (agent === void 0) {
|
|
10698
|
-
throw new
|
|
10699
|
+
throw new chunkUNFBHV46_cjs.UnknownAgentError(`Agent ${agentId} not found`, { code: "unknown_agent" });
|
|
10699
10700
|
}
|
|
10700
10701
|
return agent;
|
|
10701
10702
|
}
|
|
@@ -10756,7 +10757,7 @@ var Agent = class _Agent {
|
|
|
10756
10757
|
pluginCount: enabledPluginNames(options.plugins).length
|
|
10757
10758
|
});
|
|
10758
10759
|
try {
|
|
10759
|
-
await
|
|
10760
|
+
await chunkARMFXTY6_cjs.discoverProviderPlugins();
|
|
10760
10761
|
const agent = await runCreateUnderSpan(options, span);
|
|
10761
10762
|
return agent;
|
|
10762
10763
|
} catch (err) {
|
|
@@ -10797,8 +10798,8 @@ var Agent = class _Agent {
|
|
|
10797
10798
|
const run = await agent.send(message);
|
|
10798
10799
|
const result = await run.wait();
|
|
10799
10800
|
if (options.throwOnError === true && result.status === "error" && result.error !== void 0) {
|
|
10800
|
-
throw new
|
|
10801
|
-
code:
|
|
10801
|
+
throw new chunkUNFBHV46_cjs.AgentRunError(result.error.message, {
|
|
10802
|
+
code: chunkUNFBHV46_cjs.coerceToKnownAgentRunErrorCode(result.error.code),
|
|
10802
10803
|
cause: result.error.cause
|
|
10803
10804
|
});
|
|
10804
10805
|
}
|
|
@@ -10825,7 +10826,7 @@ var Agent = class _Agent {
|
|
|
10825
10826
|
if (existing !== void 0) {
|
|
10826
10827
|
return await rehydrateExistingAgent(agentId, existing, options);
|
|
10827
10828
|
}
|
|
10828
|
-
throw new
|
|
10829
|
+
throw new chunkUNFBHV46_cjs.UnknownAgentError(
|
|
10829
10830
|
`Agent "${agentId}" not found. Use Agent.create({ agentId, ... }) for first-time setup, or catch UnknownAgentError to branch resume-vs-create.`,
|
|
10830
10831
|
{ code: "unknown_agent" }
|
|
10831
10832
|
);
|
|
@@ -10854,7 +10855,7 @@ var Agent = class _Agent {
|
|
|
10854
10855
|
* @public
|
|
10855
10856
|
*/
|
|
10856
10857
|
static async generateObject(options) {
|
|
10857
|
-
const { generateObjectImpl } = await import('./generate-object-
|
|
10858
|
+
const { generateObjectImpl } = await import('./generate-object-YHTWG5DB.cjs');
|
|
10858
10859
|
return generateObjectImpl(options, {
|
|
10859
10860
|
create: (opts) => _Agent.create(opts),
|
|
10860
10861
|
delete: (agentId) => _Agent.delete(agentId)
|
|
@@ -10878,7 +10879,7 @@ var Agent = class _Agent {
|
|
|
10878
10879
|
delete: (agentId) => _Agent.delete(agentId)
|
|
10879
10880
|
};
|
|
10880
10881
|
async function* wrapper() {
|
|
10881
|
-
streamObjectImport ??= import('./stream-object-
|
|
10882
|
+
streamObjectImport ??= import('./stream-object-TKVGGA54.cjs');
|
|
10882
10883
|
const { streamObjectImpl } = await streamObjectImport;
|
|
10883
10884
|
yield* streamObjectImpl(options, deps);
|
|
10884
10885
|
}
|
|
@@ -10902,7 +10903,7 @@ var Agent = class _Agent {
|
|
|
10902
10903
|
* @public
|
|
10903
10904
|
*/
|
|
10904
10905
|
static async batch(prompts, options) {
|
|
10905
|
-
const { batchImpl } = await import('./batch-
|
|
10906
|
+
const { batchImpl } = await import('./batch-U4SO4RLX.cjs');
|
|
10906
10907
|
return batchImpl(prompts, options, { create: (opts) => _Agent.create(opts) });
|
|
10907
10908
|
}
|
|
10908
10909
|
/**
|
|
@@ -11005,14 +11006,14 @@ var Agent = class _Agent {
|
|
|
11005
11006
|
*/
|
|
11006
11007
|
static async getRun(runId, options = {}) {
|
|
11007
11008
|
if (options.runtime === "cloud") {
|
|
11008
|
-
throw new
|
|
11009
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
11009
11010
|
"Cloud runtime is pre-release. Theo PaaS endpoints are not wired yet \u2014 getRun({ runtime: 'cloud' }) will be enabled when the PaaS ships.",
|
|
11010
11011
|
{ code: "cloud_runtime_pre_release" }
|
|
11011
11012
|
);
|
|
11012
11013
|
}
|
|
11013
11014
|
const existing = getRun(runId);
|
|
11014
11015
|
if (existing !== void 0) return existing;
|
|
11015
|
-
throw new
|
|
11016
|
+
throw new chunkUNFBHV46_cjs.UnknownAgentError(
|
|
11016
11017
|
`Run ${runId} is not in this process's registry. It may have been disposed, persisted in a previous process, or never created.`,
|
|
11017
11018
|
{ code: "run_not_found" }
|
|
11018
11019
|
);
|
|
@@ -11054,9 +11055,9 @@ var Agent = class _Agent {
|
|
|
11054
11055
|
*/
|
|
11055
11056
|
static async compact(agentId, options = {}) {
|
|
11056
11057
|
const reg = await requireLocalAgent(agentId, "compact");
|
|
11057
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
11058
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-RBPLUPCK.cjs');
|
|
11058
11059
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
11059
|
-
return
|
|
11060
|
+
return chunkPSLCVSCS_cjs.enqueueSessionWrite(
|
|
11060
11061
|
cwd,
|
|
11061
11062
|
agentId,
|
|
11062
11063
|
() => compactSessionTranscript({
|
|
@@ -11067,7 +11068,10 @@ var Agent = class _Agent {
|
|
|
11067
11068
|
summarize: options.summarize ?? buildDefaultSummarizer2({
|
|
11068
11069
|
agentModel: model,
|
|
11069
11070
|
...reg.options.apiKey !== void 0 ? { apiKey: reg.options.apiKey } : {}
|
|
11070
|
-
})
|
|
11071
|
+
}),
|
|
11072
|
+
...options.onPreCompact !== void 0 ? { onPreCompact: options.onPreCompact } : {},
|
|
11073
|
+
...options.onPreCompactError !== void 0 ? { onPreCompactError: options.onPreCompactError } : {},
|
|
11074
|
+
...options.preCompactTimeoutMs !== void 0 ? { preCompactTimeoutMs: options.preCompactTimeoutMs } : {}
|
|
11071
11075
|
})
|
|
11072
11076
|
);
|
|
11073
11077
|
}
|
|
@@ -11081,7 +11085,7 @@ var Agent = class _Agent {
|
|
|
11081
11085
|
*/
|
|
11082
11086
|
static async injectSessionTurn(agentId, turn) {
|
|
11083
11087
|
const reg = await requireLocalAgent(agentId, "injectSessionTurn");
|
|
11084
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
11088
|
+
const { injectSessionTurn } = await import('./inject-session-3FPXJDJP.cjs');
|
|
11085
11089
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
11086
11090
|
await injectSessionTurn({
|
|
11087
11091
|
store,
|
|
@@ -11132,7 +11136,7 @@ var Agent = class _Agent {
|
|
|
11132
11136
|
*/
|
|
11133
11137
|
static async describe(agentId) {
|
|
11134
11138
|
const agent = await getRegisteredAgentOrThrow(agentId);
|
|
11135
|
-
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-
|
|
11139
|
+
const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-7GE7YUDI.cjs');
|
|
11136
11140
|
const settingSources = agent.options.local?.settingSources;
|
|
11137
11141
|
const subagents = await loadSubagents2(
|
|
11138
11142
|
agent.cwd ?? process.cwd(),
|
|
@@ -11195,12 +11199,12 @@ async function getOrCreateUncached(agentId, options) {
|
|
|
11195
11199
|
try {
|
|
11196
11200
|
return await Agent.resume(agentId, options);
|
|
11197
11201
|
} catch (err) {
|
|
11198
|
-
if (!(err instanceof
|
|
11202
|
+
if (!(err instanceof chunkUNFBHV46_cjs.UnknownAgentError)) throw err;
|
|
11199
11203
|
}
|
|
11200
11204
|
try {
|
|
11201
11205
|
return await Agent.create({ ...options, agentId });
|
|
11202
11206
|
} catch (err) {
|
|
11203
|
-
if (err instanceof
|
|
11207
|
+
if (err instanceof chunkUNFBHV46_cjs.ConfigurationError && err.code === "agent_id_already_exists") {
|
|
11204
11208
|
return await Agent.resume(agentId, options);
|
|
11205
11209
|
}
|
|
11206
11210
|
throw err;
|
|
@@ -11221,7 +11225,7 @@ async function requireLocalAgent(agentId, operation) {
|
|
|
11221
11225
|
reg = getRegisteredAgent(agentId);
|
|
11222
11226
|
}
|
|
11223
11227
|
if (reg === void 0 || reg.runtime !== "local") {
|
|
11224
|
-
throw new
|
|
11228
|
+
throw new chunkUNFBHV46_cjs.UnknownAgentError(
|
|
11225
11229
|
`No local agent "${agentId}" registered \u2014 ${operation} targets local sessions.`
|
|
11226
11230
|
);
|
|
11227
11231
|
}
|
|
@@ -11231,7 +11235,7 @@ async function openLocalStore(reg) {
|
|
|
11231
11235
|
const cwd = reg.cwd ?? process.cwd();
|
|
11232
11236
|
const optModel = reg.options.model;
|
|
11233
11237
|
const model = reg.model?.id ?? (typeof optModel === "string" ? optModel : optModel?.id) ?? "unknown";
|
|
11234
|
-
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-
|
|
11238
|
+
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-JHBJFKVV.cjs');
|
|
11235
11239
|
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-LGHSNVY5.cjs');
|
|
11236
11240
|
const configuredSessionDir = reg.options.local?.sessionDir ?? reg.options.local?.baseDir;
|
|
11237
11241
|
const baseDir = configuredSessionDir !== void 0 ? expandTilde2(configuredSessionDir) : defaultBaseDir2();
|
|
@@ -11252,5 +11256,5 @@ exports.managedSettingsPathFor = managedSettingsPathFor;
|
|
|
11252
11256
|
exports.openRouterMemoryEmbeddingProviderAdapter = openRouterMemoryEmbeddingProviderAdapter;
|
|
11253
11257
|
exports.readManagedSettings = readManagedSettings;
|
|
11254
11258
|
exports.resolveSessionDir = resolveSessionDir;
|
|
11255
|
-
//# sourceMappingURL=chunk-
|
|
11256
|
-
//# sourceMappingURL=chunk-
|
|
11259
|
+
//# sourceMappingURL=chunk-2STSX2SY.cjs.map
|
|
11260
|
+
//# sourceMappingURL=chunk-2STSX2SY.cjs.map
|