@theokit/sdk 5.7.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/a2a/index.cjs +6 -6
- package/dist/a2a/index.js +2 -2
- package/dist/{agent-Dya5SmhY.d.cts → agent-3RcPVGMo.d.cts} +21 -3
- package/dist/agent-7ERQNV66.js +59 -0
- package/dist/{agent-EQ5HKTWV.js.map → agent-7ERQNV66.js.map} +1 -1
- package/dist/agent-LNTR4QH5.cjs +68 -0
- package/dist/{agent-KA63WDQH.cjs.map → agent-LNTR4QH5.cjs.map} +1 -1
- package/dist/{agent-Bqzdhkqr.d.ts → agent-lS68mYIL.d.ts} +21 -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-A575WPBL.cjs → chunk-2STSX2SY.cjs} +260 -260
- package/dist/{chunk-A575WPBL.cjs.map → chunk-2STSX2SY.cjs.map} +1 -1
- package/dist/{chunk-FUUSIT2T.js → chunk-3CU5J7V3.js} +34 -34
- package/dist/{chunk-FUUSIT2T.js.map → chunk-3CU5J7V3.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-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-ER5BOIYD.cjs → chunk-AOHRKGAA.cjs} +22 -22
- package/dist/{chunk-ER5BOIYD.cjs.map → chunk-AOHRKGAA.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-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-6JG2RFGK.js → chunk-FRL35MFN.js} +5 -5
- package/dist/{chunk-6JG2RFGK.js.map → chunk-FRL35MFN.js.map} +1 -1
- package/dist/{chunk-EIQFAOFD.js → chunk-GGRPAQ3B.js} +3 -3
- package/dist/{chunk-EIQFAOFD.js.map → chunk-GGRPAQ3B.js.map} +1 -1
- package/dist/{chunk-HCT4HPCL.cjs → chunk-GHHIJEFX.cjs} +4 -4
- package/dist/{chunk-HCT4HPCL.cjs.map → chunk-GHHIJEFX.cjs.map} +1 -1
- package/dist/{chunk-7A6535RA.cjs → chunk-GM54F4FE.cjs} +9 -9
- package/dist/{chunk-7A6535RA.cjs.map → chunk-GM54F4FE.cjs.map} +1 -1
- package/dist/{chunk-6M2OIS4Y.js → chunk-GMRFAX4I.js} +74 -4
- package/dist/chunk-GMRFAX4I.js.map +1 -0
- package/dist/{chunk-O6USDERH.js → chunk-GMSRRJ53.js} +3 -3
- package/dist/{chunk-O6USDERH.js.map → chunk-GMSRRJ53.js.map} +1 -1
- package/dist/{chunk-VE6DFSKU.js → chunk-GTX6FEDP.js} +3 -3
- package/dist/{chunk-VE6DFSKU.js.map → chunk-GTX6FEDP.js.map} +1 -1
- package/dist/{chunk-NJWYQWDL.js → chunk-H3CVJSFC.js} +3 -3
- package/dist/{chunk-NJWYQWDL.js.map → chunk-H3CVJSFC.js.map} +1 -1
- package/dist/{chunk-MYJGWS2J.cjs → chunk-HG5LKFG7.cjs} +16 -16
- package/dist/{chunk-MYJGWS2J.cjs.map → chunk-HG5LKFG7.cjs.map} +1 -1
- package/dist/{chunk-55GB6JYQ.js → chunk-HOHR75KF.js} +5 -5
- package/dist/{chunk-55GB6JYQ.js.map → chunk-HOHR75KF.js.map} +1 -1
- package/dist/{chunk-GBCVPKHE.js → chunk-HV4V63CO.js} +3 -3
- package/dist/{chunk-GBCVPKHE.js.map → chunk-HV4V63CO.js.map} +1 -1
- package/dist/{chunk-I2PWY7VM.cjs → chunk-IIYJMXYW.cjs} +4 -4
- package/dist/{chunk-I2PWY7VM.cjs.map → chunk-IIYJMXYW.cjs.map} +1 -1
- package/dist/{chunk-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-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-J7J7J2GN.cjs → chunk-UNFBHV46.cjs} +9 -2
- package/dist/chunk-UNFBHV46.cjs.map +1 -0
- package/dist/{chunk-AAEZSPTC.js → chunk-UNZOJVVC.js} +4 -4
- package/dist/{chunk-AAEZSPTC.js.map → chunk-UNZOJVVC.js.map} +1 -1
- package/dist/{chunk-T3ZDEYTJ.js → chunk-W4VQMXBZ.js} +4 -4
- package/dist/{chunk-T3ZDEYTJ.js.map → chunk-W4VQMXBZ.js.map} +1 -1
- package/dist/{chunk-24SYBZPL.cjs → chunk-WPO3VCY4.cjs} +9 -9
- package/dist/{chunk-24SYBZPL.cjs.map → chunk-WPO3VCY4.cjs.map} +1 -1
- package/dist/{chunk-IUMAQURF.js → chunk-X6DUEDAF.js} +3 -3
- package/dist/{chunk-IUMAQURF.js.map → chunk-X6DUEDAF.js.map} +1 -1
- package/dist/{chunk-CFE6QF2Q.js → chunk-XCQ432OX.js} +3 -3
- package/dist/{chunk-CFE6QF2Q.js.map → chunk-XCQ432OX.js.map} +1 -1
- package/dist/{chunk-QWD4RDZ3.cjs → chunk-XDUGSTYJ.cjs} +15 -15
- package/dist/{chunk-QWD4RDZ3.cjs.map → chunk-XDUGSTYJ.cjs.map} +1 -1
- package/dist/{chunk-K2VMFZQ5.js → chunk-XKMVJ443.js} +5 -5
- package/dist/{chunk-K2VMFZQ5.js.map → chunk-XKMVJ443.js.map} +1 -1
- package/dist/{chunk-RWPLWMCZ.cjs → chunk-XW4POZ6V.cjs} +11 -11
- package/dist/{chunk-RWPLWMCZ.cjs.map → chunk-XW4POZ6V.cjs.map} +1 -1
- package/dist/{chunk-6PWOWXMC.js → chunk-XZHJYSPB.js} +3 -3
- package/dist/{chunk-6PWOWXMC.js.map → chunk-XZHJYSPB.js.map} +1 -1
- package/dist/{chunk-QC55H6RJ.cjs → chunk-YRJA2POB.cjs} +9 -9
- package/dist/{chunk-QC55H6RJ.cjs.map → chunk-YRJA2POB.cjs.map} +1 -1
- package/dist/{chunk-DMRT67Y6.js → chunk-ZJZ7LV3A.js} +3 -3
- package/dist/{chunk-DMRT67Y6.js.map → chunk-ZJZ7LV3A.js.map} +1 -1
- package/dist/{chunk-G7BLGBRN.js → chunk-ZWFTECOE.js} +3 -3
- package/dist/{chunk-G7BLGBRN.js.map → chunk-ZWFTECOE.js.map} +1 -1
- package/dist/{compact-session-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-BwxDUscv.d.cts → cron-CGxoEKlx.d.cts} +2 -2
- package/dist/{cron-D8uB1Xh5.d.ts → cron-DJv8zMa3.d.ts} +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-7GE7YUDI.cjs +16 -0
- package/dist/{subagents-loader-MOO7DC4E.cjs.map → subagents-loader-7GE7YUDI.cjs.map} +1 -1
- package/dist/subagents-loader-S2PMZY7J.js +7 -0
- package/dist/{subagents-loader-CJFYQQU2.js.map → subagents-loader-S2PMZY7J.js.map} +1 -1
- package/dist/subagents-loader.cjs +5 -5
- package/dist/subagents-loader.d.cts +3 -3
- package/dist/subagents-loader.d.ts +3 -3
- package/dist/subagents-loader.js +3 -3
- package/dist/subscription/index.cjs +3 -2
- package/dist/subscription/index.d.cts +1 -1
- package/dist/subscription/index.d.ts +1 -1
- package/dist/subscription/index.js +2 -2
- package/dist/task-store.cjs +5 -5
- package/dist/task-store.js +2 -2
- package/dist/workflow.cjs +25 -25
- package/dist/workflow.d.cts +2 -2
- package/dist/workflow.d.ts +2 -2
- package/dist/workflow.js +4 -4
- package/docs/error-codes.md +1 -1
- package/docs/harness-capability-map.md +17 -1
- package/package.json +1 -1
- package/dist/agent-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-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,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCQYBJOB2_cjs = require('./chunk-CQYBJOB2.cjs');
|
|
4
4
|
var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkWPO3VCY4_cjs = require('./chunk-WPO3VCY4.cjs');
|
|
6
6
|
var chunkQOGNZMHD_cjs = require('./chunk-QOGNZMHD.cjs');
|
|
7
7
|
var chunkYSTXFWQE_cjs = require('./chunk-YSTXFWQE.cjs');
|
|
8
8
|
var chunkFRITRLZQ_cjs = require('./chunk-FRITRLZQ.cjs');
|
|
9
9
|
var chunkGZV6AVRL_cjs = require('./chunk-GZV6AVRL.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkJ5623RIV_cjs = require('./chunk-J5623RIV.cjs');
|
|
11
11
|
var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkYRJA2POB_cjs = require('./chunk-YRJA2POB.cjs');
|
|
13
13
|
var chunkNVXXWAU7_cjs = require('./chunk-NVXXWAU7.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkNAGPKWOD_cjs = require('./chunk-NAGPKWOD.cjs');
|
|
15
|
+
var chunkUNFBHV46_cjs = require('./chunk-UNFBHV46.cjs');
|
|
16
16
|
var chunk6LHQPOMI_cjs = require('./chunk-6LHQPOMI.cjs');
|
|
17
17
|
var fs = require('fs');
|
|
18
18
|
var promises = require('fs/promises');
|
|
@@ -101,7 +101,7 @@ async function loadOne(dir, entryName) {
|
|
|
101
101
|
if (plugin !== null && typeof plugin === "object" && plugin.kind === "model-provider") {
|
|
102
102
|
const profile = plugin.profile;
|
|
103
103
|
if (profile !== void 0 && typeof profile === "object") {
|
|
104
|
-
|
|
104
|
+
chunkYRJA2POB_cjs.registerProvider(profile);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
return;
|
|
@@ -119,7 +119,7 @@ function mapAnthropicError(args) {
|
|
|
119
119
|
const { status, body, headers, endpoint } = args;
|
|
120
120
|
const code = mapAnthropicStatusToCode(status, body);
|
|
121
121
|
const message = formatMessage(status, code);
|
|
122
|
-
const metadata =
|
|
122
|
+
const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
|
|
123
123
|
provider: "anthropic",
|
|
124
124
|
endpoint,
|
|
125
125
|
code,
|
|
@@ -128,24 +128,24 @@ function mapAnthropicError(args) {
|
|
|
128
128
|
body
|
|
129
129
|
});
|
|
130
130
|
if (status === 401 || status === 403) {
|
|
131
|
-
return new
|
|
131
|
+
return new chunkUNFBHV46_cjs.AuthenticationError(message, { code: "anthropic_auth_failed", metadata });
|
|
132
132
|
}
|
|
133
133
|
if (status === 429) {
|
|
134
|
-
return new
|
|
134
|
+
return new chunkUNFBHV46_cjs.RateLimitError(message, { code: "anthropic_rate_limit", metadata });
|
|
135
135
|
}
|
|
136
136
|
if (status === 400) {
|
|
137
|
-
return new
|
|
137
|
+
return new chunkUNFBHV46_cjs.ConfigurationError(message, {
|
|
138
138
|
code: `anthropic_${code}`,
|
|
139
139
|
metadata
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
if (status === 408) {
|
|
143
|
-
return new
|
|
143
|
+
return new chunkUNFBHV46_cjs.NetworkError(message, { code: "anthropic_timeout", metadata });
|
|
144
144
|
}
|
|
145
145
|
if (status >= 500 && status < 600) {
|
|
146
|
-
return new
|
|
146
|
+
return new chunkUNFBHV46_cjs.NetworkError(message, { code: "anthropic_server_error", metadata });
|
|
147
147
|
}
|
|
148
|
-
return new
|
|
148
|
+
return new chunkUNFBHV46_cjs.UnknownAgentError(message, { code: "anthropic_unknown", metadata });
|
|
149
149
|
}
|
|
150
150
|
function mapAnthropicStatusToCode(status, body) {
|
|
151
151
|
if (status === 400) {
|
|
@@ -158,7 +158,7 @@ function mapAnthropicStatusToCode(status, body) {
|
|
|
158
158
|
}
|
|
159
159
|
return "invalid_request";
|
|
160
160
|
}
|
|
161
|
-
return
|
|
161
|
+
return chunkWPO3VCY4_cjs.httpStatusToErrorCode(status);
|
|
162
162
|
}
|
|
163
163
|
function formatMessage(status, code) {
|
|
164
164
|
return `Anthropic API error: ${code} (HTTP ${status})`;
|
|
@@ -229,7 +229,7 @@ function toBlockToolResultContent(content) {
|
|
|
229
229
|
function toStringToolResultContent(content, providerName, toolUseId) {
|
|
230
230
|
if (typeof content === "string") return content;
|
|
231
231
|
if (content.some((block) => block.type === "image")) {
|
|
232
|
-
throw new
|
|
232
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
233
233
|
`provider "${providerName}" does not support image content in tool results` + (toolUseId === void 0 ? "" : ` \u2014 the result of tool call ${toolUseId} carried an image`) + `, and this wire carries tool results as text only`
|
|
234
234
|
);
|
|
235
235
|
}
|
|
@@ -408,7 +408,7 @@ function readWithIdleTimeout(reader, idleTimeoutMs) {
|
|
|
408
408
|
(resolve, reject) => {
|
|
409
409
|
const timer = setTimeout(() => {
|
|
410
410
|
reject(
|
|
411
|
-
new
|
|
411
|
+
new chunkUNFBHV46_cjs.NetworkError(`SSE stream idle for ${idleTimeoutMs}ms \u2014 upstream stalled`, {
|
|
412
412
|
code: "stream_idle_timeout"
|
|
413
413
|
})
|
|
414
414
|
);
|
|
@@ -485,9 +485,9 @@ function isAbortError(err) {
|
|
|
485
485
|
}
|
|
486
486
|
function wrapTransportError(err, ctx) {
|
|
487
487
|
if (isAbortError(err)) return err;
|
|
488
|
-
if (err instanceof
|
|
488
|
+
if (err instanceof chunkUNFBHV46_cjs.TheokitAgentError) return err;
|
|
489
489
|
const detail = err instanceof Error ? err.message : String(err);
|
|
490
|
-
return new
|
|
490
|
+
return new chunkUNFBHV46_cjs.NetworkError(`${ctx.providerId} transport failure on ${ctx.endpoint}: ${detail}`, {
|
|
491
491
|
code: "transport_failure",
|
|
492
492
|
cause: err
|
|
493
493
|
});
|
|
@@ -551,7 +551,7 @@ var AnthropicClient = class {
|
|
|
551
551
|
for (const event of events) yield event;
|
|
552
552
|
}
|
|
553
553
|
if (!accumulator.finishReasonSeen) {
|
|
554
|
-
throw new
|
|
554
|
+
throw new chunkUNFBHV46_cjs.NetworkError("Anthropic SSE stream truncated (no stop_reason)", {
|
|
555
555
|
code: "stream_truncated"
|
|
556
556
|
});
|
|
557
557
|
}
|
|
@@ -700,10 +700,10 @@ function classifyBedrockError(args, awsType, message) {
|
|
|
700
700
|
return "invalid_request";
|
|
701
701
|
}
|
|
702
702
|
if (awsType.includes("Timeout")) return "timeout";
|
|
703
|
-
return
|
|
703
|
+
return chunkWPO3VCY4_cjs.httpStatusToErrorCode(args.status);
|
|
704
704
|
}
|
|
705
705
|
function buildBedrockMetadata(args, code) {
|
|
706
|
-
return
|
|
706
|
+
return chunkWPO3VCY4_cjs.buildErrorMetadata({
|
|
707
707
|
provider: "bedrock",
|
|
708
708
|
endpoint: args.endpoint,
|
|
709
709
|
code,
|
|
@@ -713,28 +713,28 @@ function buildBedrockMetadata(args, code) {
|
|
|
713
713
|
});
|
|
714
714
|
}
|
|
715
715
|
function mapBedrockError(args) {
|
|
716
|
-
const parsed =
|
|
716
|
+
const parsed = chunkWPO3VCY4_cjs.parseErrorBody(args.body);
|
|
717
717
|
const awsType = parsed.__type ?? "";
|
|
718
718
|
const message = parsed.message ?? parsed.Message ?? "Bedrock request failed";
|
|
719
719
|
const code = classifyBedrockError(args, awsType, message);
|
|
720
720
|
const metadata = buildBedrockMetadata(args, code);
|
|
721
721
|
switch (code) {
|
|
722
722
|
case "rate_limit":
|
|
723
|
-
return new
|
|
723
|
+
return new chunkUNFBHV46_cjs.RateLimitError(`Bedrock throttled: ${message}`, { metadata });
|
|
724
724
|
case "auth_failed":
|
|
725
|
-
return new
|
|
725
|
+
return new chunkUNFBHV46_cjs.AuthenticationError(`Bedrock auth: ${message}`, { metadata });
|
|
726
726
|
case "invalid_request": {
|
|
727
727
|
const friendly = message.includes("use case details") ? `Bedrock account setup required: ${message} (AWS Console \u2192 Bedrock \u2192 Model access \u2192 Anthropic \u2192 Submit use case form, then retry in 15 min.)` : `Bedrock validation: ${message}`;
|
|
728
|
-
return new
|
|
728
|
+
return new chunkUNFBHV46_cjs.ConfigurationError(friendly, { metadata });
|
|
729
729
|
}
|
|
730
730
|
case "quota_exceeded":
|
|
731
|
-
return new
|
|
731
|
+
return new chunkUNFBHV46_cjs.RateLimitError(`Bedrock quota exceeded: ${message}`, { metadata });
|
|
732
732
|
case "timeout":
|
|
733
|
-
return new
|
|
733
|
+
return new chunkUNFBHV46_cjs.NetworkError(`Bedrock timeout: ${message}`, { metadata });
|
|
734
734
|
case "server_error":
|
|
735
|
-
return new
|
|
735
|
+
return new chunkUNFBHV46_cjs.NetworkError(`Bedrock server error: ${message}`, { metadata });
|
|
736
736
|
default:
|
|
737
|
-
return new
|
|
737
|
+
return new chunkUNFBHV46_cjs.UnknownAgentError(`Bedrock unknown: ${message}`, { metadata });
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
var cachedToken = null;
|
|
@@ -747,7 +747,7 @@ async function resolveBedrockToken(region) {
|
|
|
747
747
|
return cachedToken.value;
|
|
748
748
|
}
|
|
749
749
|
try {
|
|
750
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
750
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ARMFXTY6.cjs', document.baseURI).href)));
|
|
751
751
|
const gen = r("@aws/bedrock-token-generator");
|
|
752
752
|
if (typeof gen.getToken !== "function") return void 0;
|
|
753
753
|
const providers = r("@aws-sdk/credential-providers");
|
|
@@ -775,16 +775,16 @@ var BedrockAnthropicClient = class {
|
|
|
775
775
|
if (fromOpts !== void 0 && fromOpts.length > 0) return fromOpts;
|
|
776
776
|
const fromEnv = await resolveBedrockToken(region);
|
|
777
777
|
if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
|
|
778
|
-
throw new
|
|
778
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
779
779
|
"Bedrock requires AWS_BEARER_TOKEN_BEDROCK env var, or install `@aws/bedrock-token-generator` for auto-refresh, or pass apiKey explicitly.",
|
|
780
780
|
{ code: "auth_failed" }
|
|
781
781
|
);
|
|
782
782
|
}
|
|
783
783
|
async *stream(request, signal) {
|
|
784
|
-
const region =
|
|
784
|
+
const region = chunkYRJA2POB_cjs.inferRegionFromModelId(request.model) ?? process.env.AWS_REGION ?? "us-east-1";
|
|
785
785
|
const token = await this.resolveTokenOrThrow(region);
|
|
786
|
-
const bareModel =
|
|
787
|
-
const baseUrl = this.options.baseUrl ??
|
|
786
|
+
const bareModel = chunkYRJA2POB_cjs.stripBedrockPrefix(request.model);
|
|
787
|
+
const baseUrl = this.options.baseUrl ?? chunkYRJA2POB_cjs.resolveBedrockBaseUrl(request.model);
|
|
788
788
|
const endpoint = `/model/${encodeURIComponent(bareModel)}/invoke`;
|
|
789
789
|
const url = `${baseUrl}${endpoint}`;
|
|
790
790
|
const response = await postAnthropicRequest({
|
|
@@ -839,7 +839,7 @@ var FaultInjectingLlmClient = class {
|
|
|
839
839
|
return yield* this.inner.stream(request, signal);
|
|
840
840
|
}
|
|
841
841
|
if (parsed.status >= 400) {
|
|
842
|
-
throw
|
|
842
|
+
throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
|
|
843
843
|
providerId: this.name,
|
|
844
844
|
status: parsed.status,
|
|
845
845
|
body: parsed.body,
|
|
@@ -914,7 +914,7 @@ function mapOllamaTransportError(args) {
|
|
|
914
914
|
if (args.providerId !== "ollama") return void 0;
|
|
915
915
|
const causeCode = extractCauseCode(args.cause);
|
|
916
916
|
if (causeCode !== "ECONNREFUSED" && causeCode !== "ENOTFOUND") return void 0;
|
|
917
|
-
const metadata =
|
|
917
|
+
const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
|
|
918
918
|
provider: "ollama",
|
|
919
919
|
endpoint: args.endpoint,
|
|
920
920
|
code: "network",
|
|
@@ -922,7 +922,7 @@ function mapOllamaTransportError(args) {
|
|
|
922
922
|
headers: void 0,
|
|
923
923
|
body: { cause: causeCode }
|
|
924
924
|
});
|
|
925
|
-
return new
|
|
925
|
+
return new chunkUNFBHV46_cjs.ConfigurationError(
|
|
926
926
|
"Ollama is not reachable. Run `ollama serve` to start the local runtime, or set OLLAMA_HOST to point at a remote Ollama server.",
|
|
927
927
|
{ code: "ollama_unreachable", metadata }
|
|
928
928
|
);
|
|
@@ -932,7 +932,7 @@ function mapOllamaHttpError(args) {
|
|
|
932
932
|
const errString = extractErrorString(args.body).toLowerCase();
|
|
933
933
|
if (args.status === 404 && errString.includes("not found") && errString.includes("pull")) {
|
|
934
934
|
const modelHint = extractModelName(errString);
|
|
935
|
-
const metadata =
|
|
935
|
+
const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
|
|
936
936
|
provider: "ollama",
|
|
937
937
|
endpoint: args.endpoint,
|
|
938
938
|
code: "model_unavailable",
|
|
@@ -941,13 +941,13 @@ function mapOllamaHttpError(args) {
|
|
|
941
941
|
body: args.body
|
|
942
942
|
});
|
|
943
943
|
const pullCmd = modelHint !== void 0 ? `ollama pull ${modelHint}` : "ollama pull <model>";
|
|
944
|
-
return new
|
|
944
|
+
return new chunkUNFBHV46_cjs.ConfigurationError(
|
|
945
945
|
`Ollama model is not pulled. Run \`${pullCmd}\` to download it first.`,
|
|
946
946
|
{ code: "ollama_model_not_pulled", metadata }
|
|
947
947
|
);
|
|
948
948
|
}
|
|
949
949
|
if (args.status === 503 && errString.includes("model is loading")) {
|
|
950
|
-
const metadata =
|
|
950
|
+
const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
|
|
951
951
|
provider: "ollama",
|
|
952
952
|
endpoint: args.endpoint,
|
|
953
953
|
code: "server_error",
|
|
@@ -955,7 +955,7 @@ function mapOllamaHttpError(args) {
|
|
|
955
955
|
headers: args.headers,
|
|
956
956
|
body: args.body
|
|
957
957
|
});
|
|
958
|
-
return new
|
|
958
|
+
return new chunkUNFBHV46_cjs.NetworkError(
|
|
959
959
|
"Ollama model is loading. Retry in a few seconds \u2014 Ollama is warming up the model into memory.",
|
|
960
960
|
{ code: "ollama_model_loading", metadata }
|
|
961
961
|
);
|
|
@@ -1034,7 +1034,7 @@ var OllamaNativeClient = class {
|
|
|
1034
1034
|
endpoint: "/api/chat"
|
|
1035
1035
|
});
|
|
1036
1036
|
if (mapped !== void 0) throw mapped;
|
|
1037
|
-
throw
|
|
1037
|
+
throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
|
|
1038
1038
|
providerId: "ollama",
|
|
1039
1039
|
status: response.status,
|
|
1040
1040
|
body: bodyJson,
|
|
@@ -1182,7 +1182,7 @@ function toOllamaMessages(message) {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
if (message.role === "user") {
|
|
1184
1184
|
if (message.content.some((p) => p.type === "image")) {
|
|
1185
|
-
throw new
|
|
1185
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
1186
1186
|
"image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
|
|
1187
1187
|
{ code: "ollama_image_unsupported" }
|
|
1188
1188
|
);
|
|
@@ -1266,7 +1266,7 @@ async function safeFetch(fetchFn, url, init) {
|
|
|
1266
1266
|
try {
|
|
1267
1267
|
return await fetchFn(url, init);
|
|
1268
1268
|
} catch (cause) {
|
|
1269
|
-
throw new
|
|
1269
|
+
throw new chunkUNFBHV46_cjs.NetworkError("HTTP request failed", { code: "network_error", cause });
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
async function safeParseJsonResponse(response) {
|
|
@@ -1293,7 +1293,7 @@ function mapHttpStatusToError(status, body) {
|
|
|
1293
1293
|
cause: body
|
|
1294
1294
|
};
|
|
1295
1295
|
if (envelope.code === "integration_not_connected") {
|
|
1296
|
-
return new
|
|
1296
|
+
return new chunkUNFBHV46_cjs.IntegrationNotConnectedError(message, {
|
|
1297
1297
|
provider: envelope.provider ?? "unknown",
|
|
1298
1298
|
helpUrl: envelope.helpUrl ?? "",
|
|
1299
1299
|
code: envelope.code,
|
|
@@ -1304,21 +1304,21 @@ function mapHttpStatusToError(status, body) {
|
|
|
1304
1304
|
}
|
|
1305
1305
|
function statusToError(status, message, errorOptions) {
|
|
1306
1306
|
if (status === 401 || status === 403) {
|
|
1307
|
-
return new
|
|
1307
|
+
return new chunkUNFBHV46_cjs.AuthenticationError(message, errorOptions);
|
|
1308
1308
|
}
|
|
1309
1309
|
if (status === 429) {
|
|
1310
|
-
return new
|
|
1310
|
+
return new chunkUNFBHV46_cjs.RateLimitError(message, errorOptions);
|
|
1311
1311
|
}
|
|
1312
1312
|
if (status === 408) {
|
|
1313
|
-
return new
|
|
1313
|
+
return new chunkUNFBHV46_cjs.NetworkError(message, { ...errorOptions, code: errorOptions.code ?? "timeout" });
|
|
1314
1314
|
}
|
|
1315
1315
|
if (status >= 400 && status < 500) {
|
|
1316
|
-
return new
|
|
1316
|
+
return new chunkUNFBHV46_cjs.ConfigurationError(message, errorOptions);
|
|
1317
1317
|
}
|
|
1318
1318
|
if (status >= 500) {
|
|
1319
|
-
return new
|
|
1319
|
+
return new chunkUNFBHV46_cjs.NetworkError(message, errorOptions);
|
|
1320
1320
|
}
|
|
1321
|
-
return new
|
|
1321
|
+
return new chunkUNFBHV46_cjs.UnknownAgentError(message, errorOptions);
|
|
1322
1322
|
}
|
|
1323
1323
|
function extractErrorEnvelope(body) {
|
|
1324
1324
|
if (!body || typeof body !== "object") return {};
|
|
@@ -1572,7 +1572,7 @@ var OpenAIClient = class {
|
|
|
1572
1572
|
endpoint: "/v1/chat/completions"
|
|
1573
1573
|
});
|
|
1574
1574
|
if (ollamaMapped !== void 0) throw ollamaMapped;
|
|
1575
|
-
throw
|
|
1575
|
+
throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
|
|
1576
1576
|
providerId,
|
|
1577
1577
|
status: response.status,
|
|
1578
1578
|
body,
|
|
@@ -1608,7 +1608,7 @@ var OpenAIClient = class {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
if (chunk.error !== void 0 && chunk.error !== null) {
|
|
1610
1610
|
const status = typeof chunk.error.code === "number" ? chunk.error.code : 502;
|
|
1611
|
-
throw
|
|
1611
|
+
throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
|
|
1612
1612
|
providerId,
|
|
1613
1613
|
status,
|
|
1614
1614
|
body: chunk,
|
|
@@ -1620,7 +1620,7 @@ var OpenAIClient = class {
|
|
|
1620
1620
|
for (const event of events) yield event;
|
|
1621
1621
|
}
|
|
1622
1622
|
if (!sawDone && !accumulator.finishReasonSeen) {
|
|
1623
|
-
throw new
|
|
1623
|
+
throw new chunkUNFBHV46_cjs.NetworkError("SSE stream truncated (no finish_reason / [DONE])", {
|
|
1624
1624
|
code: "stream_truncated"
|
|
1625
1625
|
});
|
|
1626
1626
|
}
|
|
@@ -1886,7 +1886,7 @@ async function tryFirstEvent(client, request, signal, logFallback = false) {
|
|
|
1886
1886
|
const firstResult = await generator.next();
|
|
1887
1887
|
return { kind: "ok", generator, firstResult };
|
|
1888
1888
|
} catch (cause) {
|
|
1889
|
-
if (cause instanceof
|
|
1889
|
+
if (cause instanceof chunkUNFBHV46_cjs.NetworkError || cause instanceof chunkUNFBHV46_cjs.RateLimitError || cause instanceof chunkUNFBHV46_cjs.AuthenticationError) {
|
|
1890
1890
|
if (logFallback) {
|
|
1891
1891
|
const errCode = cause.metadata?.code ?? cause.code ?? "unknown";
|
|
1892
1892
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] provider ${client.name} failed (${errCode}): falling back
|
|
@@ -1931,7 +1931,7 @@ var PoolAwareLlmClient = class {
|
|
|
1931
1931
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: stream() must serialize pool-select → build client → first-event probe → classify → retry/rotate/propagate. Extracting helpers fragments the linear narrative; the comments above each branch keep it readable.
|
|
1932
1932
|
async *stream(request, signal) {
|
|
1933
1933
|
if (this.breaker.shouldSkip(this.pool.provider)) {
|
|
1934
|
-
throw new
|
|
1934
|
+
throw new chunkUNFBHV46_cjs.NetworkError(`${this.pool.provider} circuit open \u2014 failing fast`, {
|
|
1935
1935
|
code: "circuit_open"
|
|
1936
1936
|
});
|
|
1937
1937
|
}
|
|
@@ -1950,7 +1950,7 @@ var PoolAwareLlmClient = class {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
if (entry === null) {
|
|
1952
1952
|
this.breaker.recordTimeout(this.pool.provider);
|
|
1953
|
-
throw new
|
|
1953
|
+
throw new chunkUNFBHV46_cjs.CredentialPoolExhaustedError(
|
|
1954
1954
|
`All ${this.pool.provider} credentials exhausted; next retry available at ${this.nextRetryHint() ?? "unknown"}`,
|
|
1955
1955
|
{ provider: this.pool.provider, nextRetryAt: this.nextRetryHint() }
|
|
1956
1956
|
);
|
|
@@ -2004,8 +2004,8 @@ var PoolAwareLlmClient = class {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
};
|
|
2006
2006
|
function classifyAndDecide(error, hasRetried429) {
|
|
2007
|
-
if (error instanceof
|
|
2008
|
-
if (error instanceof
|
|
2007
|
+
if (error instanceof chunkUNFBHV46_cjs.NetworkError) return "propagate";
|
|
2008
|
+
if (error instanceof chunkUNFBHV46_cjs.AuthenticationError) return "rotate";
|
|
2009
2009
|
const status = error.metadata?.statusCode ?? 429;
|
|
2010
2010
|
if (status === 402) return "rotate";
|
|
2011
2011
|
return hasRetried429 ? "rotate" : "retry";
|
|
@@ -2018,8 +2018,8 @@ function parseRetryAfterMs(error) {
|
|
|
2018
2018
|
return void 0;
|
|
2019
2019
|
}
|
|
2020
2020
|
function inferStatusCode(error) {
|
|
2021
|
-
if (error instanceof
|
|
2022
|
-
if (error instanceof
|
|
2021
|
+
if (error instanceof chunkUNFBHV46_cjs.AuthenticationError) return 401;
|
|
2022
|
+
if (error instanceof chunkUNFBHV46_cjs.RateLimitError) return 429;
|
|
2023
2023
|
return 0;
|
|
2024
2024
|
}
|
|
2025
2025
|
|
|
@@ -2307,7 +2307,7 @@ var ResponsesApiClient = class {
|
|
|
2307
2307
|
body = JSON.parse(text);
|
|
2308
2308
|
} catch {
|
|
2309
2309
|
}
|
|
2310
|
-
return
|
|
2310
|
+
return chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
|
|
2311
2311
|
providerId,
|
|
2312
2312
|
status: response.status,
|
|
2313
2313
|
body,
|
|
@@ -2343,7 +2343,7 @@ var ResponsesApiClient = class {
|
|
|
2343
2343
|
const failure = ResponsesStreamAccumulator.failureMessage(event);
|
|
2344
2344
|
if (failure !== void 0) {
|
|
2345
2345
|
yield { type: "error", message: failure };
|
|
2346
|
-
throw
|
|
2346
|
+
throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
|
|
2347
2347
|
providerId,
|
|
2348
2348
|
status: 502,
|
|
2349
2349
|
body: { error: { message: failure } },
|
|
@@ -2361,14 +2361,14 @@ var ResponsesApiClient = class {
|
|
|
2361
2361
|
// src/internal/llm/retrying-client.ts
|
|
2362
2362
|
var MAX_ATTEMPTS = 3;
|
|
2363
2363
|
function isRetriableError(err) {
|
|
2364
|
-
if (!
|
|
2365
|
-
if (err instanceof
|
|
2366
|
-
if (err instanceof
|
|
2367
|
-
if (err instanceof
|
|
2364
|
+
if (!chunkUNFBHV46_cjs.isTransientError(err)) return false;
|
|
2365
|
+
if (err instanceof chunkUNFBHV46_cjs.CredentialPoolExhaustedError) return false;
|
|
2366
|
+
if (err instanceof chunkUNFBHV46_cjs.TheokitAgentError && err.code === "circuit_open") return false;
|
|
2367
|
+
if (err instanceof chunkUNFBHV46_cjs.RateLimitError && err.metadata?.statusCode === 402) return false;
|
|
2368
2368
|
return true;
|
|
2369
2369
|
}
|
|
2370
2370
|
function retryAfterHintMs(err) {
|
|
2371
|
-
if (!(err instanceof
|
|
2371
|
+
if (!(err instanceof chunkUNFBHV46_cjs.RateLimitError)) return void 0;
|
|
2372
2372
|
const seconds = err.metadata?.retryAfter;
|
|
2373
2373
|
return typeof seconds === "number" && seconds > 0 ? seconds * 1e3 : void 0;
|
|
2374
2374
|
}
|
|
@@ -2457,11 +2457,11 @@ function classifyVertexError(args, errStatus) {
|
|
|
2457
2457
|
for (const rule of VERTEX_RULES) {
|
|
2458
2458
|
if (rule.test(args.status, errStatus)) return rule.code;
|
|
2459
2459
|
}
|
|
2460
|
-
const shared =
|
|
2460
|
+
const shared = chunkWPO3VCY4_cjs.httpStatusToErrorCode(args.status);
|
|
2461
2461
|
return shared === "auth_failed" ? "auth_permission" : shared;
|
|
2462
2462
|
}
|
|
2463
2463
|
function vertexMetadata(args, code) {
|
|
2464
|
-
return
|
|
2464
|
+
return chunkWPO3VCY4_cjs.buildErrorMetadata({
|
|
2465
2465
|
provider: "vertex",
|
|
2466
2466
|
endpoint: args.endpoint,
|
|
2467
2467
|
code,
|
|
@@ -2471,29 +2471,29 @@ function vertexMetadata(args, code) {
|
|
|
2471
2471
|
});
|
|
2472
2472
|
}
|
|
2473
2473
|
var VERTEX_ERROR_BUILDERS = {
|
|
2474
|
-
rate_limit: (args, msg) => new
|
|
2474
|
+
rate_limit: (args, msg) => new chunkUNFBHV46_cjs.RateLimitError(`Vertex quota exhausted: ${msg}`, {
|
|
2475
2475
|
metadata: vertexMetadata(args, "rate_limit")
|
|
2476
2476
|
}),
|
|
2477
|
-
auth_unauthenticated: (args, msg) => new
|
|
2477
|
+
auth_unauthenticated: (args, msg) => new chunkUNFBHV46_cjs.AuthenticationError(`Vertex unauthenticated: ${msg}`, {
|
|
2478
2478
|
metadata: vertexMetadata(args, "auth_failed")
|
|
2479
2479
|
}),
|
|
2480
|
-
auth_permission: (args, msg) => new
|
|
2480
|
+
auth_permission: (args, msg) => new chunkUNFBHV46_cjs.AuthenticationError(`Vertex permission denied: ${msg}`, {
|
|
2481
2481
|
metadata: vertexMetadata(args, "auth_failed")
|
|
2482
2482
|
}),
|
|
2483
|
-
invalid_request: (args, msg) => new
|
|
2483
|
+
invalid_request: (args, msg) => new chunkUNFBHV46_cjs.ConfigurationError(`Vertex validation: ${msg}`, {
|
|
2484
2484
|
metadata: vertexMetadata(args, "invalid_request")
|
|
2485
2485
|
}),
|
|
2486
|
-
quota_exceeded: (args, msg) => new
|
|
2486
|
+
quota_exceeded: (args, msg) => new chunkUNFBHV46_cjs.RateLimitError(`Vertex quota exceeded: ${msg}`, {
|
|
2487
2487
|
metadata: vertexMetadata(args, "quota_exceeded")
|
|
2488
2488
|
}),
|
|
2489
|
-
timeout: (args, msg) => new
|
|
2490
|
-
server_error: (args, msg) => new
|
|
2489
|
+
timeout: (args, msg) => new chunkUNFBHV46_cjs.NetworkError(`Vertex timeout: ${msg}`, { metadata: vertexMetadata(args, "timeout") }),
|
|
2490
|
+
server_error: (args, msg) => new chunkUNFBHV46_cjs.NetworkError(`Vertex server error: ${msg}`, {
|
|
2491
2491
|
metadata: vertexMetadata(args, "server_error")
|
|
2492
2492
|
}),
|
|
2493
|
-
unknown: (args, msg) => new
|
|
2493
|
+
unknown: (args, msg) => new chunkUNFBHV46_cjs.UnknownAgentError(`Vertex unknown: ${msg}`, { metadata: vertexMetadata(args, "unknown") })
|
|
2494
2494
|
};
|
|
2495
2495
|
function mapVertexError(args) {
|
|
2496
|
-
const parsed =
|
|
2496
|
+
const parsed = chunkWPO3VCY4_cjs.parseErrorBody(args.body);
|
|
2497
2497
|
const errStatus = parsed.error?.status ?? "";
|
|
2498
2498
|
const message = parsed.error?.message ?? "Vertex request failed";
|
|
2499
2499
|
const code = classifyVertexError(args, errStatus);
|
|
@@ -2515,12 +2515,12 @@ async function resolveVertexAccessToken() {
|
|
|
2515
2515
|
async function getAuthClientOrThrow() {
|
|
2516
2516
|
let mod;
|
|
2517
2517
|
try {
|
|
2518
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
2518
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ARMFXTY6.cjs', document.baseURI).href)));
|
|
2519
2519
|
mod = r("google-auth-library");
|
|
2520
2520
|
} catch (err) {
|
|
2521
2521
|
const isModuleMissing = err instanceof Error && (err.message.includes("Cannot find module") || err.code === "MODULE_NOT_FOUND");
|
|
2522
2522
|
if (isModuleMissing) {
|
|
2523
|
-
throw new
|
|
2523
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2524
2524
|
"Vertex provider requires `google-auth-library`. Install: `pnpm add google-auth-library`.",
|
|
2525
2525
|
{ code: "auth_failed", cause: err }
|
|
2526
2526
|
);
|
|
@@ -2557,7 +2557,7 @@ var VertexAnthropicClient = class {
|
|
|
2557
2557
|
resolveProjectOrThrow() {
|
|
2558
2558
|
const projectId = this.options.projectId ?? resolveVertexProjectId();
|
|
2559
2559
|
if (projectId !== void 0) return projectId;
|
|
2560
|
-
throw new
|
|
2560
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2561
2561
|
"Vertex requires a project id. Set GOOGLE_CLOUD_PROJECT env var or run `gcloud config set project <id>`.",
|
|
2562
2562
|
{ code: "auth_failed" }
|
|
2563
2563
|
);
|
|
@@ -2567,7 +2567,7 @@ var VertexAnthropicClient = class {
|
|
|
2567
2567
|
if (fromOpts !== void 0 && fromOpts.length > 0) return fromOpts;
|
|
2568
2568
|
const fromAdc = await resolveVertexAccessToken();
|
|
2569
2569
|
if (fromAdc !== void 0 && fromAdc.length > 0) return fromAdc;
|
|
2570
|
-
throw new
|
|
2570
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2571
2571
|
"Vertex could not resolve an access token. Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS to a service-account JSON path.",
|
|
2572
2572
|
{ code: "auth_failed" }
|
|
2573
2573
|
);
|
|
@@ -2576,8 +2576,8 @@ var VertexAnthropicClient = class {
|
|
|
2576
2576
|
const projectId = this.resolveProjectOrThrow();
|
|
2577
2577
|
const location = this.options.location ?? resolveVertexLocation();
|
|
2578
2578
|
const accessToken = await this.resolveTokenOrThrow();
|
|
2579
|
-
const baseUrl =
|
|
2580
|
-
const bareModel =
|
|
2579
|
+
const baseUrl = chunkYRJA2POB_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "anthropic" });
|
|
2580
|
+
const bareModel = chunkYRJA2POB_cjs.stripVertexPrefix(request.model);
|
|
2581
2581
|
const endpoint = `/models/${encodeURIComponent(bareModel)}:rawPredict`;
|
|
2582
2582
|
const url = `${baseUrl}${endpoint}`;
|
|
2583
2583
|
const response = await postAnthropicRequest({
|
|
@@ -2613,7 +2613,7 @@ var VertexGeminiClient = class {
|
|
|
2613
2613
|
async *stream(request, signal) {
|
|
2614
2614
|
const projectId = this.options.projectId ?? resolveVertexProjectId();
|
|
2615
2615
|
if (projectId === void 0) {
|
|
2616
|
-
throw new
|
|
2616
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2617
2617
|
"Vertex requires a project id. Set GOOGLE_CLOUD_PROJECT env var or run `gcloud config set project <id>`.",
|
|
2618
2618
|
{ code: "auth_failed" }
|
|
2619
2619
|
);
|
|
@@ -2621,12 +2621,12 @@ var VertexGeminiClient = class {
|
|
|
2621
2621
|
const location = this.options.location ?? resolveVertexLocation();
|
|
2622
2622
|
const accessToken = this.options.apiKey !== void 0 && this.options.apiKey.length > 0 ? this.options.apiKey : await resolveVertexAccessToken();
|
|
2623
2623
|
if (accessToken === void 0 || accessToken.length === 0) {
|
|
2624
|
-
throw new
|
|
2624
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2625
2625
|
"Vertex could not resolve an access token. Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS to a service-account JSON path.",
|
|
2626
2626
|
{ code: "auth_failed" }
|
|
2627
2627
|
);
|
|
2628
2628
|
}
|
|
2629
|
-
const baseUrl =
|
|
2629
|
+
const baseUrl = chunkYRJA2POB_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "gemini" });
|
|
2630
2630
|
const url = `${baseUrl}/chat/completions`;
|
|
2631
2631
|
const innerFetch = this.options.fetch ?? fetch;
|
|
2632
2632
|
const rewriteFetch = (_input, init) => innerFetch(url, init);
|
|
@@ -2648,7 +2648,7 @@ var VertexRouterClient = class {
|
|
|
2648
2648
|
options;
|
|
2649
2649
|
name = "vertex";
|
|
2650
2650
|
async *stream(request, signal) {
|
|
2651
|
-
const dialect =
|
|
2651
|
+
const dialect = chunkYRJA2POB_cjs.inferModelDialect(request.model);
|
|
2652
2652
|
if (dialect === "anthropic") {
|
|
2653
2653
|
const inner2 = new VertexAnthropicClient(this.options);
|
|
2654
2654
|
return yield* inner2.stream(request, signal);
|
|
@@ -2660,7 +2660,7 @@ var VertexRouterClient = class {
|
|
|
2660
2660
|
|
|
2661
2661
|
// src/internal/llm/router.ts
|
|
2662
2662
|
function resolveProviderChain(options) {
|
|
2663
|
-
|
|
2663
|
+
chunkYRJA2POB_cjs.registerBuiltins();
|
|
2664
2664
|
return buildChain(options);
|
|
2665
2665
|
}
|
|
2666
2666
|
function buildChain(options) {
|
|
@@ -2677,7 +2677,7 @@ function buildChain(options) {
|
|
|
2677
2677
|
addClient(options.primary, options.baseUrl);
|
|
2678
2678
|
for (const fallback of options.fallback ?? []) addClient(fallback);
|
|
2679
2679
|
if (clients.length === 0) {
|
|
2680
|
-
throw new
|
|
2680
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2681
2681
|
`No provider client could be resolved (primary=${options.primary}). Set ANTHROPIC_API_KEY or OPENAI_API_KEY / OPENROUTER_API_KEY.`,
|
|
2682
2682
|
{ code: "provider_unresolved" }
|
|
2683
2683
|
);
|
|
@@ -2685,11 +2685,11 @@ function buildChain(options) {
|
|
|
2685
2685
|
return clients;
|
|
2686
2686
|
}
|
|
2687
2687
|
function buildTransport(name, routerOptions, perCallBaseUrl) {
|
|
2688
|
-
const baseProfile =
|
|
2688
|
+
const baseProfile = chunkYRJA2POB_cjs.getProviderProfile(name);
|
|
2689
2689
|
if (baseProfile === void 0) return void 0;
|
|
2690
2690
|
const profile = routerOptions.extractToolCallsFromContent === true && baseProfile.extractToolCallsFromContent !== true ? { ...baseProfile, extractToolCallsFromContent: true } : baseProfile;
|
|
2691
2691
|
const resilience = routerOptions.onRateLimit !== void 0 ? { onRateLimit: routerOptions.onRateLimit } : {};
|
|
2692
|
-
const ambient =
|
|
2692
|
+
const ambient = chunkCQYBJOB2_cjs.currentCredentialPool(name);
|
|
2693
2693
|
if (ambient !== void 0) {
|
|
2694
2694
|
return new PoolAwareLlmClient(
|
|
2695
2695
|
ambient,
|
|
@@ -2721,9 +2721,9 @@ function buildPoolOrSingle(args) {
|
|
|
2721
2721
|
if (poolKeys !== void 0 && poolKeys.length >= 2) {
|
|
2722
2722
|
const strategy = routerOptions.credentialPoolStrategy?.[name] ?? "fill_first";
|
|
2723
2723
|
const entries = poolKeys.map(
|
|
2724
|
-
(accessToken, priority) =>
|
|
2724
|
+
(accessToken, priority) => chunkCQYBJOB2_cjs.newPooledCredential({ provider: name, accessToken, priority, source: "manual" })
|
|
2725
2725
|
);
|
|
2726
|
-
const pool = new
|
|
2726
|
+
const pool = new chunkCQYBJOB2_cjs.CredentialPool(name, entries, strategy);
|
|
2727
2727
|
const resilience = routerOptions.onRateLimit !== void 0 ? { onRateLimit: routerOptions.onRateLimit } : {};
|
|
2728
2728
|
return new PoolAwareLlmClient(
|
|
2729
2729
|
pool,
|
|
@@ -2780,7 +2780,7 @@ function warnUnknownProvidersInApiKeys(apiKeys) {
|
|
|
2780
2780
|
if (apiKeys === void 0) return;
|
|
2781
2781
|
for (const name of Object.keys(apiKeys)) {
|
|
2782
2782
|
if (warnedProviders.has(name)) continue;
|
|
2783
|
-
const profile =
|
|
2783
|
+
const profile = chunkYRJA2POB_cjs.getProviderProfile(name);
|
|
2784
2784
|
if (profile === void 0) {
|
|
2785
2785
|
warnedProviders.add(name);
|
|
2786
2786
|
chunk6LHQPOMI_cjs.diag(
|
|
@@ -2815,7 +2815,7 @@ function selectTransport(profile, apiKey, baseUrl) {
|
|
|
2815
2815
|
if (apiKey !== "__oauth_lazy_token__") return;
|
|
2816
2816
|
const auth = t.headers?.authorization ?? t.headers?.Authorization;
|
|
2817
2817
|
if (t.fetch === void 0 && auth === void 0) {
|
|
2818
|
-
throw new
|
|
2818
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2819
2819
|
`provider "${profile.name}" uses OAuth (authType: ${profile.authType}) but no credential was resolved. Register a ProviderProfile.transform whose fetch (or headers.authorization) supplies the bearer \u2014 typically via resolveCredential() from "@theokit/sdk/auth".`
|
|
2820
2820
|
);
|
|
2821
2821
|
}
|
|
@@ -2874,7 +2874,7 @@ function selectTransport(profile, apiKey, baseUrl) {
|
|
|
2874
2874
|
providerName: profile.name
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
|
-
throw new
|
|
2877
|
+
throw new chunkUNFBHV46_cjs.ConfigurationError(
|
|
2878
2878
|
`Provider "${profile.name}" declares apiMode "${profile.apiMode}", which this SDK has no transport for. Transports are built in and cannot be extended by a plugin; the supported modes are "chat_completions", "anthropic_messages", "bedrock_anthropic" and "responses_api". Change the provider's apiMode to one of those, or open an issue if the provider genuinely speaks a fifth protocol.`,
|
|
2879
2879
|
{ code: "transport_unavailable" }
|
|
2880
2880
|
);
|
|
@@ -2955,7 +2955,7 @@ function checkProviderPrefix(key, provider) {
|
|
|
2955
2955
|
function registerPluginProviderProfiles(entries) {
|
|
2956
2956
|
let registered = 0;
|
|
2957
2957
|
for (const entry of entries) {
|
|
2958
|
-
|
|
2958
|
+
chunkYRJA2POB_cjs.registerProvider(entry.profile);
|
|
2959
2959
|
registered += 1;
|
|
2960
2960
|
}
|
|
2961
2961
|
return registered;
|
|
@@ -2979,7 +2979,7 @@ var AMBIENT_STORE = {
|
|
|
2979
2979
|
};
|
|
2980
2980
|
function isStoredOAuthAvailable(env = process.env) {
|
|
2981
2981
|
try {
|
|
2982
|
-
return
|
|
2982
|
+
return chunkNAGPKWOD_cjs.readStoredOAuth(AMBIENT_STORE, env) !== void 0;
|
|
2983
2983
|
} catch {
|
|
2984
2984
|
return false;
|
|
2985
2985
|
}
|
|
@@ -3039,7 +3039,7 @@ function shouldUseRealLocalRuntime(apiKey) {
|
|
|
3039
3039
|
function inferProviderFromApiKey(apiKey) {
|
|
3040
3040
|
const provider = chunkFRITRLZQ_cjs.providerFromApiKeyPrefix(apiKey);
|
|
3041
3041
|
if (provider === void 0) return void 0;
|
|
3042
|
-
return
|
|
3042
|
+
return chunkYRJA2POB_cjs.getProviderProfile(provider) === void 0 ? void 0 : provider;
|
|
3043
3043
|
}
|
|
3044
3044
|
function detectPrimaryProvider() {
|
|
3045
3045
|
if (process.env.ANTHROPIC_API_KEY !== void 0 && process.env.ANTHROPIC_API_KEY.length > 0) {
|
|
@@ -3066,7 +3066,7 @@ function warnProviderPrecedenceOnce(asked, used) {
|
|
|
3066
3066
|
}
|
|
3067
3067
|
var pluginProvidersAnnounced = false;
|
|
3068
3068
|
function resolveRunProvider(options) {
|
|
3069
|
-
|
|
3069
|
+
chunkYRJA2POB_cjs.registerBuiltins();
|
|
3070
3070
|
const profiles = options.pluginManager?.aggregated.providerProfiles ?? [];
|
|
3071
3071
|
const registered = registerPluginProviderProfiles(profiles);
|
|
3072
3072
|
if (registered > 0 && !pluginProvidersAnnounced) {
|
|
@@ -3076,7 +3076,7 @@ function resolveRunProvider(options) {
|
|
|
3076
3076
|
`);
|
|
3077
3077
|
}
|
|
3078
3078
|
const parsedModel = chunk3EE6LVWT_cjs.parseModelId(options.model?.id);
|
|
3079
|
-
const modelInferredProvider = parsedModel.provider !== void 0 &&
|
|
3079
|
+
const modelInferredProvider = parsedModel.provider !== void 0 && chunkYRJA2POB_cjs.getProviderProfile(parsedModel.provider) !== void 0 ? parsedModel.provider : void 0;
|
|
3080
3080
|
const keyInferredProvider = inferProviderFromApiKey(options.agentOptions.apiKey);
|
|
3081
3081
|
const primary = options.agentOptions.providers?.routes?.[0]?.provider ?? keyInferredProvider ?? modelInferredProvider ?? detectPrimaryProvider();
|
|
3082
3082
|
warnProviderPrecedenceOnce(modelInferredProvider, primary);
|
|
@@ -3091,83 +3091,7 @@ function mergeExplicitApiKey(pools, primary, apiKey) {
|
|
|
3091
3091
|
return { ...pools ?? {}, [primary]: [apiKey] };
|
|
3092
3092
|
}
|
|
3093
3093
|
|
|
3094
|
-
// src/internal/runtime/compression/compression-model-registry.ts
|
|
3095
|
-
var EXACT_REGISTRY = /* @__PURE__ */ new Map([
|
|
3096
|
-
// OpenAI family
|
|
3097
|
-
["openai/gpt-4o", "openai/gpt-4o-mini"],
|
|
3098
|
-
["openai/gpt-4-turbo", "openai/gpt-4o-mini"],
|
|
3099
|
-
["openai/gpt-4", "openai/gpt-4o-mini"],
|
|
3100
|
-
["openai/o1-preview", "openai/gpt-4o-mini"],
|
|
3101
|
-
["openai/o1", "openai/gpt-4o-mini"],
|
|
3102
|
-
["openai/o3", "openai/gpt-4o-mini"],
|
|
3103
|
-
["openai/o3-mini", "openai/gpt-4o-mini"],
|
|
3104
|
-
// Anthropic family
|
|
3105
|
-
["anthropic/claude-opus-4", "anthropic/claude-3-5-haiku-latest"],
|
|
3106
|
-
["anthropic/claude-sonnet-4", "anthropic/claude-3-5-haiku-latest"],
|
|
3107
|
-
["anthropic/claude-3-5-sonnet", "anthropic/claude-3-5-haiku-latest"],
|
|
3108
|
-
["anthropic/claude-3-5-sonnet-latest", "anthropic/claude-3-5-haiku-latest"],
|
|
3109
|
-
["anthropic/claude-3-opus", "anthropic/claude-3-haiku"],
|
|
3110
|
-
["anthropic/claude-3-sonnet", "anthropic/claude-3-haiku"],
|
|
3111
|
-
// Vertex (Gemini + Anthropic-on-Vertex)
|
|
3112
|
-
["vertex/gemini-1.5-pro", "vertex/gemini-1.5-flash"],
|
|
3113
|
-
["vertex/gemini-2.0-pro", "vertex/gemini-1.5-flash"],
|
|
3114
|
-
["vertex/claude-3-5-sonnet", "vertex/claude-3-5-haiku"],
|
|
3115
|
-
["vertex/claude-3-opus", "vertex/claude-3-haiku"],
|
|
3116
|
-
// OpenRouter (preserve openrouter prefix, swap tier within same vendor)
|
|
3117
|
-
["openrouter/openai/gpt-4o", "openrouter/openai/gpt-4o-mini"],
|
|
3118
|
-
["openrouter/openai/gpt-4-turbo", "openrouter/openai/gpt-4o-mini"],
|
|
3119
|
-
["openrouter/anthropic/claude-3-5-sonnet", "openrouter/anthropic/claude-3-5-haiku"],
|
|
3120
|
-
["openrouter/anthropic/claude-opus-4", "openrouter/anthropic/claude-3-5-haiku"]
|
|
3121
|
-
]);
|
|
3122
|
-
var WILDCARD_REGISTRY = [
|
|
3123
|
-
// Bedrock Anthropic: us.anthropic.claude-sonnet-* → us.anthropic.claude-3-haiku-*
|
|
3124
|
-
["bedrock/anthropic.claude-sonnet*", "bedrock/anthropic.claude-3-haiku*"],
|
|
3125
|
-
["bedrock/anthropic.claude-opus*", "bedrock/anthropic.claude-3-haiku*"],
|
|
3126
|
-
["bedrock/anthropic.claude-3-5-sonnet*", "bedrock/anthropic.claude-3-5-haiku*"]
|
|
3127
|
-
];
|
|
3128
|
-
var NO_AUTH_PROVIDERS = /* @__PURE__ */ new Set(["ollama", "lmstudio", "llamacpp"]);
|
|
3129
|
-
var CompressionModelUnresolvedError = class extends chunkJ7J7J2GN_cjs.TheokitAgentError {
|
|
3130
|
-
name = "CompressionModelUnresolvedError";
|
|
3131
|
-
agentModel;
|
|
3132
|
-
constructor(agentModel) {
|
|
3133
|
-
super(
|
|
3134
|
-
`Could not resolve a same-family-cheaper-tier compression model for "${agentModel}". Provide Agent.create({compression: {model: "<your-cheaper-model>"}}) OR add "${agentModel}" to the compression-model-registry (see ADR D440).`,
|
|
3135
|
-
{ code: "compression_model_unresolved", isRetryable: false }
|
|
3136
|
-
);
|
|
3137
|
-
this.agentModel = agentModel;
|
|
3138
|
-
}
|
|
3139
|
-
};
|
|
3140
|
-
function resolveCompressionModel(agentModel) {
|
|
3141
|
-
const exact = EXACT_REGISTRY.get(agentModel);
|
|
3142
|
-
if (exact !== void 0) return exact;
|
|
3143
|
-
const wildcard = matchWildcard(agentModel);
|
|
3144
|
-
if (wildcard !== null) return wildcard;
|
|
3145
|
-
if (isNoAuthProvider(agentModel)) return agentModel;
|
|
3146
|
-
throw new CompressionModelUnresolvedError(agentModel);
|
|
3147
|
-
}
|
|
3148
|
-
function matchWildcard(agentModel) {
|
|
3149
|
-
for (const [pattern, replacement] of WILDCARD_REGISTRY) {
|
|
3150
|
-
const prefix = pattern.endsWith("*") ? pattern.slice(0, -1) : pattern;
|
|
3151
|
-
if (!agentModel.startsWith(prefix)) continue;
|
|
3152
|
-
const suffix = agentModel.slice(prefix.length);
|
|
3153
|
-
const replPrefix = replacement.endsWith("*") ? replacement.slice(0, -1) : replacement;
|
|
3154
|
-
return `${replPrefix}${suffix}`;
|
|
3155
|
-
}
|
|
3156
|
-
return null;
|
|
3157
|
-
}
|
|
3158
|
-
function isNoAuthProvider(agentModel) {
|
|
3159
|
-
const slashIdx = agentModel.indexOf("/");
|
|
3160
|
-
if (slashIdx <= 0) return false;
|
|
3161
|
-
return NO_AUTH_PROVIDERS.has(agentModel.slice(0, slashIdx));
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
3094
|
// src/internal/runtime/compression/compression-summarizer.ts
|
|
3165
|
-
var CompressionFailedError = class extends chunkJ7J7J2GN_cjs.TheokitAgentError {
|
|
3166
|
-
name = "CompressionFailedError";
|
|
3167
|
-
constructor(message, options = {}) {
|
|
3168
|
-
super(message, { ...options, code: "compression_failed", isRetryable: true });
|
|
3169
|
-
}
|
|
3170
|
-
};
|
|
3171
3095
|
function buildCompressionPrompt(messages) {
|
|
3172
3096
|
const formatted = messages.map((m) => `[${m.role}]: ${m.content}`).join("\n\n");
|
|
3173
3097
|
return `Summarize the following ${messages.length} conversation messages into a concise summary that preserves ALL facts, decisions, user preferences, and context needed for the conversation to continue naturally. The summary will replace these messages in the context window. Be thorough but concise.
|
|
@@ -3183,13 +3107,13 @@ async function compressConversationWindow(opts) {
|
|
|
3183
3107
|
try {
|
|
3184
3108
|
summary = await opts.callLlm(opts.model, COMPRESSION_SYSTEM, userPrompt);
|
|
3185
3109
|
} catch (cause) {
|
|
3186
|
-
throw new CompressionFailedError(
|
|
3110
|
+
throw new chunkUNFBHV46_cjs.CompressionFailedError(
|
|
3187
3111
|
`Compression LLM call failed: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
3188
3112
|
{ cause: cause instanceof Error ? cause : void 0 }
|
|
3189
3113
|
);
|
|
3190
3114
|
}
|
|
3191
3115
|
if (!summary || summary.trim().length === 0) {
|
|
3192
|
-
throw new CompressionFailedError(
|
|
3116
|
+
throw new chunkUNFBHV46_cjs.CompressionFailedError(
|
|
3193
3117
|
"Compression LLM returned empty summary \u2014 reduction ineffective."
|
|
3194
3118
|
);
|
|
3195
3119
|
}
|
|
@@ -3243,7 +3167,7 @@ async function compactSessionTranscript(opts) {
|
|
|
3243
3167
|
compressible.push({ role: m.role, content: text });
|
|
3244
3168
|
}
|
|
3245
3169
|
}
|
|
3246
|
-
const preTokens =
|
|
3170
|
+
const preTokens = chunkJ5623RIV_cjs.estimateTokens(compressible.map((m) => m.content).join("\n"));
|
|
3247
3171
|
if (opts.onPreCompact !== void 0) {
|
|
3248
3172
|
await runPreCompactBounded(
|
|
3249
3173
|
opts.onPreCompact,
|
|
@@ -3258,7 +3182,7 @@ async function compactSessionTranscript(opts) {
|
|
|
3258
3182
|
for (let i = compressible.length - 1; i >= 0; i--) {
|
|
3259
3183
|
const m = compressible[i];
|
|
3260
3184
|
if (m === void 0 || m.role !== "user" || isCompactSummary(m.content)) continue;
|
|
3261
|
-
const cost =
|
|
3185
|
+
const cost = chunkJ5623RIV_cjs.estimateTokens(m.content);
|
|
3262
3186
|
if (budget + cost > COMPACT_USER_MESSAGE_MAX_TOKENS) {
|
|
3263
3187
|
const remaining = COMPACT_USER_MESSAGE_MAX_TOKENS - budget;
|
|
3264
3188
|
if (remaining > 50) {
|
|
@@ -3283,7 +3207,7 @@ ${summaryBody}`;
|
|
|
3283
3207
|
const delta = transcript.records().slice(prior.length);
|
|
3284
3208
|
await opts.store.appendRecords(opts.loc.agentId, delta);
|
|
3285
3209
|
chunkYJNYDJ2T_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
|
|
3286
|
-
const postTokens =
|
|
3210
|
+
const postTokens = chunkJ5623RIV_cjs.estimateTokens([...preserved, summary].join("\n"));
|
|
3287
3211
|
return { preTokens, postTokens };
|
|
3288
3212
|
}
|
|
3289
3213
|
function resolveSummarizerRoute(opts) {
|
|
@@ -3292,9 +3216,9 @@ function resolveSummarizerRoute(opts) {
|
|
|
3292
3216
|
}
|
|
3293
3217
|
function buildDefaultSummarizer(opts) {
|
|
3294
3218
|
return async (messages) => {
|
|
3295
|
-
|
|
3219
|
+
chunkYRJA2POB_cjs.registerBuiltins();
|
|
3296
3220
|
const modelPrefix = opts.agentModel.includes("/") ? opts.agentModel.slice(0, opts.agentModel.indexOf("/")) : void 0;
|
|
3297
|
-
const prefixProfile = modelPrefix !== void 0 ?
|
|
3221
|
+
const prefixProfile = modelPrefix !== void 0 ? chunkYRJA2POB_cjs.getProviderProfile(modelPrefix) : void 0;
|
|
3298
3222
|
const prefixUsable = prefixProfile !== void 0 && (prefixProfile.authType !== "api_key" || prefixProfile.envVars.some((v) => (process.env[v] ?? "").length > 0));
|
|
3299
3223
|
const route = resolveSummarizerRoute({
|
|
3300
3224
|
keyProvider: inferProviderFromApiKey(opts.apiKey),
|
|
@@ -3308,7 +3232,7 @@ function buildDefaultSummarizer(opts) {
|
|
|
3308
3232
|
model = opts.agentModel;
|
|
3309
3233
|
} else {
|
|
3310
3234
|
try {
|
|
3311
|
-
model = resolveCompressionModel(opts.agentModel);
|
|
3235
|
+
model = chunkJ5623RIV_cjs.resolveCompressionModel(opts.agentModel);
|
|
3312
3236
|
} catch {
|
|
3313
3237
|
model = opts.agentModel;
|
|
3314
3238
|
}
|
|
@@ -3398,5 +3322,5 @@ exports.shouldUseFixtureMode = shouldUseFixtureMode;
|
|
|
3398
3322
|
exports.shouldUseRealLocalRuntime = shouldUseRealLocalRuntime;
|
|
3399
3323
|
exports.tryFirstEvent = tryFirstEvent;
|
|
3400
3324
|
exports.validateApiKeyShape = validateApiKeyShape;
|
|
3401
|
-
//# sourceMappingURL=chunk-
|
|
3402
|
-
//# sourceMappingURL=chunk-
|
|
3325
|
+
//# sourceMappingURL=chunk-ARMFXTY6.cjs.map
|
|
3326
|
+
//# sourceMappingURL=chunk-ARMFXTY6.cjs.map
|