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