@theokit/sdk 4.62.0 → 4.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/dist/a2a/index.cjs +2 -2
- package/dist/a2a/index.js +1 -1
- package/dist/{agent-DIu6FooJ.d.ts → agent-BFno7Sfn.d.ts} +36 -21
- package/dist/agent-WK7MKIMH.cjs +66 -0
- package/dist/{agent-VYPUO4UB.cjs.map → agent-WK7MKIMH.cjs.map} +1 -1
- package/dist/{agent-D3Xr_-6Z.d.cts → agent-X0DKA943.d.cts} +36 -21
- package/dist/agent-YWMBM7LX.js +57 -0
- package/dist/{agent-NVBFTY5H.js.map → agent-YWMBM7LX.js.map} +1 -1
- package/dist/agent-session-store-6EL5NPA4.cjs +24 -0
- package/dist/{agent-session-store-WAKLOKWK.cjs.map → agent-session-store-6EL5NPA4.cjs.map} +1 -1
- package/dist/agent-session-store-OPGRB4XM.js +7 -0
- package/dist/{agent-session-store-G2BMUZQV.js.map → agent-session-store-OPGRB4XM.js.map} +1 -1
- package/dist/auth/index.cjs +18 -18
- package/dist/auth/index.js +6 -6
- package/dist/{batch-ND32UKZS.cjs → batch-BXYTW2DP.cjs} +27 -27
- package/dist/{batch-ND32UKZS.cjs.map → batch-BXYTW2DP.cjs.map} +1 -1
- package/dist/{batch-2TGJMNCJ.js → batch-L4ZXS46M.js} +10 -10
- package/dist/{batch-2TGJMNCJ.js.map → batch-L4ZXS46M.js.map} +1 -1
- package/dist/{chunk-VF7EWVDG.js → chunk-2GUYQR5P.js} +3 -3
- package/dist/{chunk-VF7EWVDG.js.map → chunk-2GUYQR5P.js.map} +1 -1
- package/dist/{chunk-J2UROOIG.cjs → chunk-2HVF2WJY.cjs} +8 -8
- package/dist/{chunk-J2UROOIG.cjs.map → chunk-2HVF2WJY.cjs.map} +1 -1
- package/dist/{chunk-44MBDIHG.js → chunk-2QDYBS2A.js} +3 -3
- package/dist/{chunk-44MBDIHG.js.map → chunk-2QDYBS2A.js.map} +1 -1
- package/dist/{chunk-NGESVVJN.cjs → chunk-3FFAEAUJ.cjs} +17 -17
- package/dist/{chunk-NGESVVJN.cjs.map → chunk-3FFAEAUJ.cjs.map} +1 -1
- package/dist/{chunk-GWC3HADL.cjs → chunk-3NSS2OIZ.cjs} +4 -4
- package/dist/{chunk-GWC3HADL.cjs.map → chunk-3NSS2OIZ.cjs.map} +1 -1
- package/dist/{chunk-CV7XMBHP.js → chunk-3O42QOMJ.js} +3 -3
- package/dist/{chunk-CV7XMBHP.js.map → chunk-3O42QOMJ.js.map} +1 -1
- package/dist/{chunk-IWBGCBR6.cjs → chunk-4CLOXP6H.cjs} +4 -4
- package/dist/{chunk-IWBGCBR6.cjs.map → chunk-4CLOXP6H.cjs.map} +1 -1
- package/dist/{chunk-YEXA3PGR.js → chunk-4FFBAUFS.js} +5 -5
- package/dist/{chunk-YEXA3PGR.js.map → chunk-4FFBAUFS.js.map} +1 -1
- package/dist/{chunk-HY57ULY2.cjs → chunk-4PYZ5AX3.cjs} +5 -5
- package/dist/{chunk-HY57ULY2.cjs.map → chunk-4PYZ5AX3.cjs.map} +1 -1
- package/dist/{chunk-OC4NTGMN.js → chunk-4QZSA2HJ.js} +3 -3
- package/dist/{chunk-OC4NTGMN.js.map → chunk-4QZSA2HJ.js.map} +1 -1
- package/dist/{chunk-K3FW2XZD.cjs → chunk-4ZHTIJNE.cjs} +9 -9
- package/dist/{chunk-K3FW2XZD.cjs.map → chunk-4ZHTIJNE.cjs.map} +1 -1
- package/dist/{chunk-BUIK7GUA.cjs → chunk-5HEG4CQH.cjs} +8 -8
- package/dist/{chunk-BUIK7GUA.cjs.map → chunk-5HEG4CQH.cjs.map} +1 -1
- package/dist/{chunk-SKXBJ2NU.cjs → chunk-5VB22SYX.cjs} +7 -54
- package/dist/chunk-5VB22SYX.cjs.map +1 -0
- package/dist/{chunk-5USCYPPI.cjs → chunk-6HKGLTJI.cjs} +8 -8
- package/dist/{chunk-5USCYPPI.cjs.map → chunk-6HKGLTJI.cjs.map} +1 -1
- package/dist/chunk-6RKUO7AW.cjs +864 -0
- package/dist/chunk-6RKUO7AW.cjs.map +1 -0
- package/dist/{chunk-5JLFFPCH.js → chunk-7YGCPMGB.js} +4 -4
- package/dist/{chunk-5JLFFPCH.js.map → chunk-7YGCPMGB.js.map} +1 -1
- package/dist/{chunk-SUKXXLWD.js → chunk-A46SWMIF.js} +6 -6
- package/dist/{chunk-SUKXXLWD.js.map → chunk-A46SWMIF.js.map} +1 -1
- package/dist/{chunk-F7AQV62G.js → chunk-A4JVILQU.js} +5 -5
- package/dist/{chunk-F7AQV62G.js.map → chunk-A4JVILQU.js.map} +1 -1
- package/dist/chunk-A4RAL2ER.cjs +51 -0
- package/dist/chunk-A4RAL2ER.cjs.map +1 -0
- package/dist/{chunk-44JAAH4X.js → chunk-B3IMEBOA.js} +3 -3
- package/dist/{chunk-44JAAH4X.js.map → chunk-B3IMEBOA.js.map} +1 -1
- package/dist/{chunk-QDED6YO6.cjs → chunk-B4EOJWOY.cjs} +5 -5
- package/dist/{chunk-QDED6YO6.cjs.map → chunk-B4EOJWOY.cjs.map} +1 -1
- package/dist/{chunk-YJDH3CKG.js → chunk-BP46RJ5X.js} +5 -5
- package/dist/{chunk-YJDH3CKG.js.map → chunk-BP46RJ5X.js.map} +1 -1
- package/dist/{chunk-QRSUA2CV.js → chunk-BU4KFWXF.js} +3 -3
- package/dist/{chunk-QRSUA2CV.js.map → chunk-BU4KFWXF.js.map} +1 -1
- package/dist/{chunk-IBYRA5PM.js → chunk-BVJJ3DRV.js} +6 -6
- package/dist/{chunk-IBYRA5PM.js.map → chunk-BVJJ3DRV.js.map} +1 -1
- package/dist/{chunk-AQLGBKNT.js → chunk-BZRFXJHA.js} +3 -3
- package/dist/{chunk-AQLGBKNT.js.map → chunk-BZRFXJHA.js.map} +1 -1
- package/dist/{chunk-UQGQFBRL.js → chunk-C3NT3PVE.js} +3 -3
- package/dist/{chunk-UQGQFBRL.js.map → chunk-C3NT3PVE.js.map} +1 -1
- package/dist/{chunk-UC3HT2S4.js → chunk-C72AZW7J.js} +3 -3
- package/dist/{chunk-UC3HT2S4.js.map → chunk-C72AZW7J.js.map} +1 -1
- package/dist/{chunk-WNTAPVU5.cjs → chunk-CQBXOJ6U.cjs} +13 -13
- package/dist/{chunk-WNTAPVU5.cjs.map → chunk-CQBXOJ6U.cjs.map} +1 -1
- package/dist/{chunk-T7XEKOVW.js → chunk-D4CUGAKZ.js} +3 -3
- package/dist/{chunk-T7XEKOVW.js.map → chunk-D4CUGAKZ.js.map} +1 -1
- package/dist/chunk-DKD3MH6A.js +194 -0
- package/dist/chunk-DKD3MH6A.js.map +1 -0
- package/dist/{chunk-YXGAW7BB.js → chunk-DN2PACRI.js} +10 -10
- package/dist/{chunk-YXGAW7BB.js.map → chunk-DN2PACRI.js.map} +1 -1
- package/dist/{chunk-XSX2UU6Y.cjs → chunk-DXGZ2NUG.cjs} +10 -10
- package/dist/{chunk-XSX2UU6Y.cjs.map → chunk-DXGZ2NUG.cjs.map} +1 -1
- package/dist/{chunk-NUKRL3I6.cjs → chunk-EG4QM7ZJ.cjs} +18 -2
- package/dist/chunk-EG4QM7ZJ.cjs.map +1 -0
- package/dist/chunk-GEEXBYFL.js +831 -0
- package/dist/chunk-GEEXBYFL.js.map +1 -0
- package/dist/chunk-GKEFRLU7.cjs +21 -0
- package/dist/chunk-GKEFRLU7.cjs.map +1 -0
- package/dist/{chunk-NIRE5CNO.cjs → chunk-HCZD23VS.cjs} +13 -13
- package/dist/{chunk-NIRE5CNO.cjs.map → chunk-HCZD23VS.cjs.map} +1 -1
- package/dist/chunk-HOXVQ5FR.cjs +201 -0
- package/dist/chunk-HOXVQ5FR.cjs.map +1 -0
- package/dist/{chunk-QARJGQSA.js → chunk-HS7AVXTF.js} +3 -3
- package/dist/{chunk-QARJGQSA.js.map → chunk-HS7AVXTF.js.map} +1 -1
- package/dist/{chunk-4I55V454.cjs → chunk-I6HGWHPU.cjs} +4 -4
- package/dist/{chunk-4I55V454.cjs.map → chunk-I6HGWHPU.cjs.map} +1 -1
- package/dist/{chunk-T73NA43R.js → chunk-IPYYKCRC.js} +3 -3
- package/dist/{chunk-T73NA43R.js.map → chunk-IPYYKCRC.js.map} +1 -1
- package/dist/{chunk-6OBIWHDR.cjs → chunk-ITYQ6VBP.cjs} +24 -365
- package/dist/chunk-ITYQ6VBP.cjs.map +1 -0
- package/dist/chunk-JPBKYL3B.cjs +18 -0
- package/dist/{chunk-6HTXPPHK.cjs.map → chunk-JPBKYL3B.cjs.map} +1 -1
- package/dist/{chunk-MZ2FGBLZ.js → chunk-K5OJUYSZ.js} +4 -4
- package/dist/{chunk-MZ2FGBLZ.js.map → chunk-K5OJUYSZ.js.map} +1 -1
- package/dist/{chunk-SKOCYA55.js → chunk-KIH6IZ43.js} +90 -88
- package/dist/chunk-KIH6IZ43.js.map +1 -0
- package/dist/{chunk-EI2Q7SJ5.cjs → chunk-KQ7TS7WW.cjs} +10 -10
- package/dist/{chunk-EI2Q7SJ5.cjs.map → chunk-KQ7TS7WW.cjs.map} +1 -1
- package/dist/{chunk-RUDY2GTT.js → chunk-KQRW2GPZ.js} +5 -5
- package/dist/{chunk-RUDY2GTT.js.map → chunk-KQRW2GPZ.js.map} +1 -1
- package/dist/{chunk-P5LCASTC.cjs → chunk-KYAJINUI.cjs} +125 -125
- package/dist/{chunk-P5LCASTC.cjs.map → chunk-KYAJINUI.cjs.map} +1 -1
- package/dist/{chunk-CQ2TQ32Y.js → chunk-LWGSI6M3.js} +5 -50
- package/dist/chunk-LWGSI6M3.js.map +1 -0
- package/dist/{chunk-ZHPWGIUX.js → chunk-LXI4XZEC.js} +5 -5
- package/dist/{chunk-ZHPWGIUX.js.map → chunk-LXI4XZEC.js.map} +1 -1
- package/dist/{chunk-AG5JPQIY.js → chunk-LXQ6HKPS.js} +3 -3
- package/dist/{chunk-AG5JPQIY.js.map → chunk-LXQ6HKPS.js.map} +1 -1
- package/dist/{chunk-ROYPRJH4.cjs → chunk-LYRDF5TQ.cjs} +9 -9
- package/dist/{chunk-ROYPRJH4.cjs.map → chunk-LYRDF5TQ.cjs.map} +1 -1
- package/dist/{chunk-G24KZRSA.js → chunk-N2U4AZGB.js} +3 -3
- package/dist/{chunk-G24KZRSA.js.map → chunk-N2U4AZGB.js.map} +1 -1
- package/dist/{chunk-4ERPXIVB.js → chunk-O73J46PV.js} +5 -5
- package/dist/{chunk-4ERPXIVB.js.map → chunk-O73J46PV.js.map} +1 -1
- package/dist/{chunk-F3YZMOAU.cjs → chunk-O7DK5PBJ.cjs} +4 -4
- package/dist/{chunk-F3YZMOAU.cjs.map → chunk-O7DK5PBJ.cjs.map} +1 -1
- package/dist/{chunk-Z4BCLVTI.cjs → chunk-O7LZFG6O.cjs} +5 -5
- package/dist/{chunk-Z4BCLVTI.cjs.map → chunk-O7LZFG6O.cjs.map} +1 -1
- package/dist/{chunk-3YJNUKYN.cjs → chunk-OHLDPWTA.cjs} +15 -15
- package/dist/{chunk-3YJNUKYN.cjs.map → chunk-OHLDPWTA.cjs.map} +1 -1
- package/dist/{chunk-FUL2I7G5.js → chunk-OSEG74VJ.js} +8 -8
- package/dist/{chunk-FUL2I7G5.js.map → chunk-OSEG74VJ.js.map} +1 -1
- package/dist/{chunk-UCBJBJ27.js → chunk-PUAEFLYK.js} +4 -4
- package/dist/{chunk-UCBJBJ27.js.map → chunk-PUAEFLYK.js.map} +1 -1
- package/dist/{chunk-CWHTMNNK.cjs → chunk-Q7LPTOD6.cjs} +24 -24
- package/dist/{chunk-CWHTMNNK.cjs.map → chunk-Q7LPTOD6.cjs.map} +1 -1
- package/dist/{chunk-2C72DXQF.cjs → chunk-RFMBZPOW.cjs} +9 -9
- package/dist/{chunk-2C72DXQF.cjs.map → chunk-RFMBZPOW.cjs.map} +1 -1
- package/dist/{chunk-NLTVXLGT.js → chunk-RFXWMRFC.js} +3 -3
- package/dist/{chunk-NLTVXLGT.js.map → chunk-RFXWMRFC.js.map} +1 -1
- package/dist/{chunk-2DG7KW4L.cjs → chunk-RMWTPV3M.cjs} +8 -8
- package/dist/{chunk-2DG7KW4L.cjs.map → chunk-RMWTPV3M.cjs.map} +1 -1
- package/dist/{chunk-P6A3M6VD.cjs → chunk-SZVR77EJ.cjs} +10 -10
- package/dist/{chunk-P6A3M6VD.cjs.map → chunk-SZVR77EJ.cjs.map} +1 -1
- package/dist/{chunk-3E77SX4H.js → chunk-TAZVKYWJ.js} +3 -3
- package/dist/{chunk-3E77SX4H.js.map → chunk-TAZVKYWJ.js.map} +1 -1
- package/dist/{chunk-WKRSH2VR.js → chunk-U6IFHFWK.js} +3 -3
- package/dist/{chunk-WKRSH2VR.js.map → chunk-U6IFHFWK.js.map} +1 -1
- package/dist/{chunk-I6TGFUCO.cjs → chunk-UALX2J2Q.cjs} +4 -4
- package/dist/{chunk-I6TGFUCO.cjs.map → chunk-UALX2J2Q.cjs.map} +1 -1
- package/dist/{chunk-XN7NOENA.js → chunk-UBDMVMBZ.js} +5 -5
- package/dist/{chunk-XN7NOENA.js.map → chunk-UBDMVMBZ.js.map} +1 -1
- package/dist/{chunk-QEKI3YKI.js → chunk-UEXIJTLC.js} +14 -349
- package/dist/chunk-UEXIJTLC.js.map +1 -0
- package/dist/{chunk-DQKERTND.cjs → chunk-UGT7GK7I.cjs} +11 -11
- package/dist/{chunk-DQKERTND.cjs.map → chunk-UGT7GK7I.cjs.map} +1 -1
- package/dist/{chunk-FKMUFNQE.js → chunk-UMP6OJIM.js} +4 -4
- package/dist/{chunk-FKMUFNQE.js.map → chunk-UMP6OJIM.js.map} +1 -1
- package/dist/{chunk-AEOZTXVW.js → chunk-UNYXQ4M5.js} +3 -3
- package/dist/{chunk-AEOZTXVW.js.map → chunk-UNYXQ4M5.js.map} +1 -1
- package/dist/{chunk-2BDH744Z.js → chunk-UTSRIDKZ.js} +3 -3
- package/dist/{chunk-2BDH744Z.js.map → chunk-UTSRIDKZ.js.map} +1 -1
- package/dist/{chunk-2ADR2GSO.cjs → chunk-UU36SHFY.cjs} +5 -5
- package/dist/{chunk-2ADR2GSO.cjs.map → chunk-UU36SHFY.cjs.map} +1 -1
- package/dist/{chunk-R3UPQFKK.cjs → chunk-V2BOS4WF.cjs} +9 -9
- package/dist/{chunk-R3UPQFKK.cjs.map → chunk-V2BOS4WF.cjs.map} +1 -1
- package/dist/chunk-WE22OXQA.js +48 -0
- package/dist/chunk-WE22OXQA.js.map +1 -0
- package/dist/{chunk-Q4CMI2LP.js → chunk-WLQNMXQE.js} +5 -5
- package/dist/{chunk-Q4CMI2LP.js.map → chunk-WLQNMXQE.js.map} +1 -1
- package/dist/{chunk-XWL6O3SW.cjs → chunk-WNO3C3N2.cjs} +4 -4
- package/dist/{chunk-XWL6O3SW.cjs.map → chunk-WNO3C3N2.cjs.map} +1 -1
- package/dist/{chunk-T7O6K6PX.js → chunk-XEQ3TM66.js} +18 -3
- package/dist/chunk-XEQ3TM66.js.map +1 -0
- package/dist/{chunk-BVZW2B5V.cjs → chunk-XJCXEKMD.cjs} +4 -4
- package/dist/{chunk-BVZW2B5V.cjs.map → chunk-XJCXEKMD.cjs.map} +1 -1
- package/dist/{chunk-JTB5Q42C.cjs → chunk-XL7Q7HB2.cjs} +4 -4
- package/dist/{chunk-JTB5Q42C.cjs.map → chunk-XL7Q7HB2.cjs.map} +1 -1
- package/dist/chunk-XO4SOZN6.js +19 -0
- package/dist/chunk-XO4SOZN6.js.map +1 -0
- package/dist/{chunk-CQGYNZ3K.cjs → chunk-XWTLIGO3.cjs} +4 -4
- package/dist/{chunk-CQGYNZ3K.cjs.map → chunk-XWTLIGO3.cjs.map} +1 -1
- package/dist/{chunk-6SBW4QR2.cjs → chunk-YML4ME27.cjs} +11 -11
- package/dist/{chunk-6SBW4QR2.cjs.map → chunk-YML4ME27.cjs.map} +1 -1
- package/dist/{chunk-P6H23T43.cjs → chunk-ZCIRZE37.cjs} +11 -11
- package/dist/{chunk-P6H23T43.cjs.map → chunk-ZCIRZE37.cjs.map} +1 -1
- package/dist/{chunk-QI7WE46I.cjs → chunk-ZLQSWSJ2.cjs} +11 -11
- package/dist/{chunk-QI7WE46I.cjs.map → chunk-ZLQSWSJ2.cjs.map} +1 -1
- package/dist/{chunk-AH6WD7JR.cjs → chunk-ZMRD5DZQ.cjs} +362 -360
- package/dist/chunk-ZMRD5DZQ.cjs.map +1 -0
- package/dist/{chunk-ILCGLTSA.cjs → chunk-ZSWPZ23K.cjs} +4 -4
- package/dist/{chunk-ILCGLTSA.cjs.map → chunk-ZSWPZ23K.cjs.map} +1 -1
- package/dist/{chunk-IDCKSLYH.js → chunk-ZZMZWBR6.js} +3 -3
- package/dist/{chunk-IDCKSLYH.js.map → chunk-ZZMZWBR6.js.map} +1 -1
- package/dist/compact-session-QV57KR66.cjs +59 -0
- package/dist/{compact-session-GJXJD73F.cjs.map → compact-session-QV57KR66.cjs.map} +1 -1
- package/dist/compact-session-RIGOWC4Y.js +22 -0
- package/dist/{compact-session-TSMQOIHO.js.map → compact-session-RIGOWC4Y.js.map} +1 -1
- package/dist/compaction.cjs +17 -17
- package/dist/compaction.js +4 -4
- package/dist/concurrency.cjs +7 -7
- package/dist/concurrency.js +5 -5
- package/dist/context-AGQ3DIZU.cjs +24 -0
- package/dist/{context-LCKNH2XI.cjs.map → context-AGQ3DIZU.cjs.map} +1 -1
- package/dist/context-GQRFBCLP.js +7 -0
- package/dist/{context-MZSKGKYR.js.map → context-GQRFBCLP.js.map} +1 -1
- package/dist/{cron-BcWmzWzT.d.cts → cron-BuiRPrvt.d.cts} +1 -1
- package/dist/{cron-De6hzWCF.d.ts → cron-C2SIi31n.d.ts} +1 -1
- package/dist/cron.cjs +37 -35
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +36 -34
- package/dist/errors.cjs +22 -22
- package/dist/errors.js +3 -3
- package/dist/eval.cjs +42 -40
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +36 -34
- package/dist/eval.js.map +1 -1
- package/dist/{executor-ZERJ3DGN.cjs → executor-6CYCA7MI.cjs} +25 -25
- package/dist/{executor-ZERJ3DGN.cjs.map → executor-6CYCA7MI.cjs.map} +1 -1
- package/dist/{executor-BMEHFOXZ.js → executor-QSEC3MRH.js} +8 -8
- package/dist/{executor-BMEHFOXZ.js.map → executor-QSEC3MRH.js.map} +1 -1
- package/dist/filesystem/index.cjs +8 -8
- package/dist/filesystem/index.js +4 -4
- package/dist/fs-session-store-4PIHT5UX.cjs +20 -0
- package/dist/{fs-session-store-XZ7ZTB3A.cjs.map → fs-session-store-4PIHT5UX.cjs.map} +1 -1
- package/dist/fs-session-store-NM6YSTE2.js +11 -0
- package/dist/{fs-session-store-4BHGIWRE.js.map → fs-session-store-NM6YSTE2.js.map} +1 -1
- package/dist/generate-object-GUNAUVBX.js +8 -0
- package/dist/{generate-object-N5MDZUJI.js.map → generate-object-GUNAUVBX.js.map} +1 -1
- package/dist/generate-object-R7HTMW7F.cjs +21 -0
- package/dist/{generate-object-PGSP5U7N.cjs.map → generate-object-R7HTMW7F.cjs.map} +1 -1
- package/dist/index-manager-RBDHP3PM.js +17 -0
- package/dist/{index-manager-AHAYJ33H.js.map → index-manager-RBDHP3PM.js.map} +1 -1
- package/dist/index-manager-UZBF22BJ.cjs +26 -0
- package/dist/{index-manager-RHPFVFSC.cjs.map → index-manager-UZBF22BJ.cjs.map} +1 -1
- package/dist/index.cjs +146 -319
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +62 -235
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-ZCQUB3IT.js → inject-session-DAR7OUCW.js} +8 -8
- package/dist/{inject-session-ZCQUB3IT.js.map → inject-session-DAR7OUCW.js.map} +1 -1
- package/dist/{inject-session-PPSO2IDD.cjs → inject-session-WQKMC3GR.cjs} +10 -10
- package/dist/{inject-session-PPSO2IDD.cjs.map → inject-session-WQKMC3GR.cjs.map} +1 -1
- package/dist/internal/memory/active-memory.d.ts +8 -1
- package/dist/internal/memory/adapters/index.cjs +9 -9
- package/dist/internal/memory/adapters/index.js +8 -8
- package/dist/internal/memory/dreaming/diary.d.ts +39 -2
- package/dist/internal/memory/index-db.d.ts +44 -1
- package/dist/internal/memory/index-manager-contract.d.ts +10 -0
- package/dist/internal/memory/index-manager-helpers.d.ts +20 -1
- package/dist/internal/memory/index-manager.d.ts +1 -1
- package/dist/internal/memory/lance-index.d.ts +15 -1
- package/dist/internal/memory/migrate-sqlite-to-lance.d.ts +43 -0
- package/dist/internal/memory/storage/index.cjs +101 -18
- package/dist/internal/memory/storage/index.d.cts +11 -1
- package/dist/internal/memory/storage/index.d.ts +11 -1
- package/dist/internal/memory/storage/index.js +10 -7
- package/dist/internal/memory/storage/markdown-store.d.cts +13 -42
- package/dist/internal/memory/storage/markdown-store.d.ts +13 -42
- package/dist/internal/memory/storage/memory-root.d.cts +93 -0
- package/dist/internal/memory/storage/memory-root.d.ts +93 -0
- package/dist/internal/memory/storage/session-loader.d.cts +35 -1
- package/dist/internal/memory/storage/session-loader.d.ts +35 -1
- package/dist/internal/memory/storage/session-summary-writer.d.cts +50 -2
- package/dist/internal/memory/storage/session-summary-writer.d.ts +50 -2
- package/dist/internal/memory/storage/transcript-store.d.cts +38 -1
- package/dist/internal/memory/storage/transcript-store.d.ts +38 -1
- package/dist/internal/memory/storage/wiki-loader.d.cts +27 -2
- package/dist/internal/memory/storage/wiki-loader.d.ts +27 -2
- package/dist/internal/memory/tools.d.ts +8 -1
- package/dist/internal/memory/types.d.ts +5 -0
- package/dist/internal/persistence/index.cjs +29 -28
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +8 -7
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/persistence/session-dir.d.cts +0 -15
- package/dist/internal/persistence/session-dir.d.ts +0 -15
- package/dist/internal/runtime/memory/memory-store.d.ts +2 -2
- package/dist/internal/security/index.cjs +14 -14
- package/dist/internal/security/index.js +4 -4
- package/dist/judge-call-LAHMBJ57.cjs +23 -0
- package/dist/{judge-call-EGYRC2RE.cjs.map → judge-call-LAHMBJ57.cjs.map} +1 -1
- package/dist/judge-call-LVXABPS3.js +6 -0
- package/dist/{judge-call-DWHAJATE.js.map → judge-call-LVXABPS3.js.map} +1 -1
- package/dist/mcp-auth.cjs +15 -15
- package/dist/mcp-auth.js +5 -5
- package/dist/models.cjs +22 -22
- package/dist/models.js +7 -7
- package/dist/path-safety.cjs +11 -11
- package/dist/path-safety.js +4 -4
- package/dist/persistence.cjs +33 -32
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +10 -9
- package/dist/persistence.js.map +1 -1
- package/dist/project.cjs +6 -6
- package/dist/project.js +4 -4
- package/dist/providers.cjs +9 -9
- package/dist/providers.js +7 -7
- package/dist/registry-75W33OGL.js +10 -0
- package/dist/{registry-VFP3WWQP.js.map → registry-75W33OGL.js.map} +1 -1
- package/dist/registry-V7BDQ6QB.cjs +47 -0
- package/dist/{registry-VFKX7WOP.cjs.map → registry-V7BDQ6QB.cjs.map} +1 -1
- package/dist/retry.cjs +5 -5
- package/dist/retry.js +4 -4
- package/dist/sandbox/index.cjs +7 -7
- package/dist/sandbox/index.js +3 -3
- package/dist/server/errors-envelope.cjs +15 -15
- package/dist/server/errors-envelope.js +4 -4
- package/dist/session-transcript-6WNITKRE.cjs +63 -0
- package/dist/{session-transcript-HF5GEU5M.cjs.map → session-transcript-6WNITKRE.cjs.map} +1 -1
- package/dist/session-transcript-XAEKW6P7.js +6 -0
- package/dist/{session-transcript-P462ZRHX.js.map → session-transcript-XAEKW6P7.js.map} +1 -1
- package/dist/skills.cjs +8 -8
- package/dist/skills.js +6 -6
- package/dist/stream-object-UF4QRQRU.js +8 -0
- package/dist/{stream-object-L57K4OFS.js.map → stream-object-UF4QRQRU.js.map} +1 -1
- package/dist/stream-object-ZJTQNKY3.cjs +21 -0
- package/dist/{stream-object-BUCF5PHO.cjs.map → stream-object-ZJTQNKY3.cjs.map} +1 -1
- package/dist/subagents-loader-CRT5LLL3.js +8 -0
- package/dist/{subagents-loader-6ATCDEKN.js.map → subagents-loader-CRT5LLL3.js.map} +1 -1
- package/dist/subagents-loader-YEUFFPAL.cjs +17 -0
- package/dist/{subagents-loader-X5QKODCL.cjs.map → subagents-loader-YEUFFPAL.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +7 -7
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/subagents-loader.js +5 -5
- package/dist/subscription/index.cjs +4 -4
- package/dist/subscription/index.js +3 -3
- package/dist/task-store.cjs +8 -8
- package/dist/task-store.js +5 -5
- package/dist/types/agent.d.ts +11 -0
- package/dist/types/memory-provider.d.ts +8 -0
- package/dist/workflow.cjs +28 -28
- package/dist/workflow.js +7 -7
- package/docs/error-codes.md +10 -9
- package/docs/harness-capability-map.md +57 -17
- package/docs/memory-decisions.md +44 -7
- package/package.json +1 -1
- package/dist/agent-NVBFTY5H.js +0 -55
- package/dist/agent-VYPUO4UB.cjs +0 -64
- package/dist/agent-session-store-G2BMUZQV.js +0 -7
- package/dist/agent-session-store-WAKLOKWK.cjs +0 -24
- package/dist/chunk-2UCFUSPW.cjs +0 -468
- package/dist/chunk-2UCFUSPW.cjs.map +0 -1
- package/dist/chunk-6HTXPPHK.cjs +0 -18
- package/dist/chunk-6OBIWHDR.cjs.map +0 -1
- package/dist/chunk-AH6WD7JR.cjs.map +0 -1
- package/dist/chunk-CQ2TQ32Y.js.map +0 -1
- package/dist/chunk-NUKRL3I6.cjs.map +0 -1
- package/dist/chunk-QEKI3YKI.js.map +0 -1
- package/dist/chunk-SKOCYA55.js.map +0 -1
- package/dist/chunk-SKXBJ2NU.cjs.map +0 -1
- package/dist/chunk-T7O6K6PX.js.map +0 -1
- package/dist/chunk-WCLDJSMY.js +0 -456
- package/dist/chunk-WCLDJSMY.js.map +0 -1
- package/dist/compact-session-GJXJD73F.cjs +0 -59
- package/dist/compact-session-TSMQOIHO.js +0 -22
- package/dist/context-LCKNH2XI.cjs +0 -24
- package/dist/context-MZSKGKYR.js +0 -7
- package/dist/fs-session-store-4BHGIWRE.js +0 -11
- package/dist/fs-session-store-XZ7ZTB3A.cjs +0 -20
- package/dist/generate-object-N5MDZUJI.js +0 -8
- package/dist/generate-object-PGSP5U7N.cjs +0 -21
- package/dist/index-manager-AHAYJ33H.js +0 -16
- package/dist/index-manager-RHPFVFSC.cjs +0 -25
- package/dist/judge-call-DWHAJATE.js +0 -6
- package/dist/judge-call-EGYRC2RE.cjs +0 -23
- package/dist/registry-VFKX7WOP.cjs +0 -47
- package/dist/registry-VFP3WWQP.js +0 -10
- package/dist/session-transcript-HF5GEU5M.cjs +0 -63
- package/dist/session-transcript-P462ZRHX.js +0 -6
- package/dist/stream-object-BUCF5PHO.cjs +0 -21
- package/dist/stream-object-L57K4OFS.js +0 -8
- package/dist/subagents-loader-6ATCDEKN.js +0 -8
- package/dist/subagents-loader-X5QKODCL.cjs +0 -17
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO7DK5PBJ_cjs = require('./chunk-O7DK5PBJ.cjs');
|
|
4
4
|
var chunk4OTIXDMU_cjs = require('./chunk-4OTIXDMU.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkUGT7GK7I_cjs = require('./chunk-UGT7GK7I.cjs');
|
|
6
6
|
var chunk6JSIEDKL_cjs = require('./chunk-6JSIEDKL.cjs');
|
|
7
7
|
var chunkFRITRLZQ_cjs = require('./chunk-FRITRLZQ.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
8
|
+
var chunk5HEG4CQH_cjs = require('./chunk-5HEG4CQH.cjs');
|
|
9
|
+
var chunkDXGZ2NUG_cjs = require('./chunk-DXGZ2NUG.cjs');
|
|
10
|
+
var chunkHCZD23VS_cjs = require('./chunk-HCZD23VS.cjs');
|
|
11
|
+
var chunkXJCXEKMD_cjs = require('./chunk-XJCXEKMD.cjs');
|
|
12
|
+
var chunk4ZHTIJNE_cjs = require('./chunk-4ZHTIJNE.cjs');
|
|
13
|
+
var chunkEG4QM7ZJ_cjs = require('./chunk-EG4QM7ZJ.cjs');
|
|
14
14
|
var fs = require('fs');
|
|
15
15
|
var promises = require('fs/promises');
|
|
16
16
|
var os = require('os');
|
|
@@ -19,7 +19,7 @@ var url = require('url');
|
|
|
19
19
|
var module$1 = require('module');
|
|
20
20
|
|
|
21
21
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
22
|
-
var discoveryState =
|
|
22
|
+
var discoveryState = chunkHCZD23VS_cjs.globalSingleton("theokit-sdk.providers.discovered", () => ({
|
|
23
23
|
done: false
|
|
24
24
|
}));
|
|
25
25
|
function pluginsRoot() {
|
|
@@ -41,19 +41,19 @@ function loadTrustedNames() {
|
|
|
41
41
|
else discarded += 1;
|
|
42
42
|
}
|
|
43
43
|
if (discarded > 0) {
|
|
44
|
-
|
|
44
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
45
45
|
`[theokit-sdk] WARN: ${path} contains ${discarded} non-string entr${discarded === 1 ? "y" : "ies"} \u2014 discarded (entries must be plugin-name strings)
|
|
46
46
|
`
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
} else {
|
|
50
|
-
|
|
50
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
51
51
|
`[theokit-sdk] WARN: ${path} is not a JSON array \u2014 trusting NO provider plugins (fail-closed)
|
|
52
52
|
`
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
} catch {
|
|
56
|
-
|
|
56
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
57
57
|
`[theokit-sdk] WARN: ${path} is not valid JSON \u2014 trusting NO provider plugins (fail-closed)
|
|
58
58
|
`
|
|
59
59
|
);
|
|
@@ -79,7 +79,7 @@ async function discoverProviderPlugins() {
|
|
|
79
79
|
const trusted = loadTrustedNames();
|
|
80
80
|
for (const entry of entries) {
|
|
81
81
|
if (!trusted.has(entry)) {
|
|
82
|
-
|
|
82
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
83
83
|
`[theokit-sdk] WARN: provider plugin "${entry}" is present but NOT trusted \u2014 skipped. To trust it, add "${entry}" to ${trustFilePath()} (JSON array of names) or THEOKIT_TRUSTED_PROVIDERS (comma-separated), then restart the process.
|
|
84
84
|
`
|
|
85
85
|
);
|
|
@@ -98,13 +98,13 @@ async function loadOne(dir, entryName) {
|
|
|
98
98
|
if (plugin !== null && typeof plugin === "object" && plugin.kind === "model-provider") {
|
|
99
99
|
const profile = plugin.profile;
|
|
100
100
|
if (profile !== void 0 && typeof profile === "object") {
|
|
101
|
-
|
|
101
|
+
chunkHCZD23VS_cjs.registerProvider(profile);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return;
|
|
105
105
|
} catch (err) {
|
|
106
106
|
const msg = err instanceof Error ? err.message : String(err);
|
|
107
|
-
|
|
107
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] failed to load provider plugin "${entryName}": ${msg}
|
|
108
108
|
`);
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
@@ -116,7 +116,7 @@ function mapAnthropicError(args) {
|
|
|
116
116
|
const { status, body, headers, endpoint } = args;
|
|
117
117
|
const code = mapAnthropicStatusToCode(status, body);
|
|
118
118
|
const message = formatMessage(status, code);
|
|
119
|
-
const metadata =
|
|
119
|
+
const metadata = chunkUGT7GK7I_cjs.buildErrorMetadata({
|
|
120
120
|
provider: "anthropic",
|
|
121
121
|
endpoint,
|
|
122
122
|
code,
|
|
@@ -125,24 +125,24 @@ function mapAnthropicError(args) {
|
|
|
125
125
|
body
|
|
126
126
|
});
|
|
127
127
|
if (status === 401 || status === 403) {
|
|
128
|
-
return new
|
|
128
|
+
return new chunk4ZHTIJNE_cjs.AuthenticationError(message, { code: "anthropic_auth_failed", metadata });
|
|
129
129
|
}
|
|
130
130
|
if (status === 429) {
|
|
131
|
-
return new
|
|
131
|
+
return new chunk4ZHTIJNE_cjs.RateLimitError(message, { code: "anthropic_rate_limit", metadata });
|
|
132
132
|
}
|
|
133
133
|
if (status === 400) {
|
|
134
|
-
return new
|
|
134
|
+
return new chunk4ZHTIJNE_cjs.ConfigurationError(message, {
|
|
135
135
|
code: `anthropic_${code}`,
|
|
136
136
|
metadata
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
if (status === 408) {
|
|
140
|
-
return new
|
|
140
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(message, { code: "anthropic_timeout", metadata });
|
|
141
141
|
}
|
|
142
142
|
if (status >= 500 && status < 600) {
|
|
143
|
-
return new
|
|
143
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(message, { code: "anthropic_server_error", metadata });
|
|
144
144
|
}
|
|
145
|
-
return new
|
|
145
|
+
return new chunk4ZHTIJNE_cjs.UnknownAgentError(message, { code: "anthropic_unknown", metadata });
|
|
146
146
|
}
|
|
147
147
|
function mapAnthropicStatusToCode(status, body) {
|
|
148
148
|
if (status === 401 || status === 403) return "auth_failed";
|
|
@@ -200,7 +200,7 @@ function assign(finish, key, value) {
|
|
|
200
200
|
if (value === void 0) return;
|
|
201
201
|
const count = asTokenCount(value);
|
|
202
202
|
if (count === void 0) {
|
|
203
|
-
|
|
203
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
204
204
|
`[theokit-sdk] provider reported an unusable ${key} (${String(value)}) \u2014 dropping it. Usage and cost for this turn will be incomplete.
|
|
205
205
|
`
|
|
206
206
|
);
|
|
@@ -230,7 +230,7 @@ function toBlockToolResultContent(content) {
|
|
|
230
230
|
function toStringToolResultContent(content, providerName) {
|
|
231
231
|
if (typeof content === "string") return content;
|
|
232
232
|
if (content.some((block) => block.type === "image")) {
|
|
233
|
-
throw new
|
|
233
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
234
234
|
`provider "${providerName}" does not support image content in tool results`
|
|
235
235
|
);
|
|
236
236
|
}
|
|
@@ -409,7 +409,7 @@ function readWithIdleTimeout(reader, idleTimeoutMs) {
|
|
|
409
409
|
(resolve, reject) => {
|
|
410
410
|
const timer = setTimeout(() => {
|
|
411
411
|
reject(
|
|
412
|
-
new
|
|
412
|
+
new chunk4ZHTIJNE_cjs.NetworkError(`SSE stream idle for ${idleTimeoutMs}ms \u2014 upstream stalled`, {
|
|
413
413
|
code: "stream_idle_timeout"
|
|
414
414
|
})
|
|
415
415
|
);
|
|
@@ -486,9 +486,9 @@ function ehAbort(err) {
|
|
|
486
486
|
}
|
|
487
487
|
function wrapTransportError(err, ctx) {
|
|
488
488
|
if (ehAbort(err)) return err;
|
|
489
|
-
if (err instanceof
|
|
489
|
+
if (err instanceof chunk4ZHTIJNE_cjs.TheokitAgentError) return err;
|
|
490
490
|
const detail = err instanceof Error ? err.message : String(err);
|
|
491
|
-
return new
|
|
491
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(`${ctx.providerId} transport failure on ${ctx.endpoint}: ${detail}`, {
|
|
492
492
|
code: "transport_failure",
|
|
493
493
|
cause: err
|
|
494
494
|
});
|
|
@@ -552,7 +552,7 @@ var AnthropicClient = class {
|
|
|
552
552
|
for (const event of events) yield event;
|
|
553
553
|
}
|
|
554
554
|
if (!accumulator.finishReasonSeen) {
|
|
555
|
-
throw new
|
|
555
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError("Anthropic SSE stream truncated (no stop_reason)", {
|
|
556
556
|
code: "stream_truncated"
|
|
557
557
|
});
|
|
558
558
|
}
|
|
@@ -705,7 +705,7 @@ function classifyBedrockError(args, awsType, message) {
|
|
|
705
705
|
return "unknown";
|
|
706
706
|
}
|
|
707
707
|
function buildBedrockMetadata(args, code) {
|
|
708
|
-
return
|
|
708
|
+
return chunkUGT7GK7I_cjs.buildErrorMetadata({
|
|
709
709
|
provider: "bedrock",
|
|
710
710
|
endpoint: args.endpoint,
|
|
711
711
|
code,
|
|
@@ -722,19 +722,19 @@ function mapBedrockError(args) {
|
|
|
722
722
|
const metadata = buildBedrockMetadata(args, code);
|
|
723
723
|
switch (code) {
|
|
724
724
|
case "rate_limit":
|
|
725
|
-
return new
|
|
725
|
+
return new chunk4ZHTIJNE_cjs.RateLimitError(`Bedrock throttled: ${message}`, { metadata });
|
|
726
726
|
case "auth_failed":
|
|
727
|
-
return new
|
|
727
|
+
return new chunk4ZHTIJNE_cjs.AuthenticationError(`Bedrock auth: ${message}`, { metadata });
|
|
728
728
|
case "invalid_request": {
|
|
729
729
|
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}`;
|
|
730
|
-
return new
|
|
730
|
+
return new chunk4ZHTIJNE_cjs.ConfigurationError(friendly, { metadata });
|
|
731
731
|
}
|
|
732
732
|
case "timeout":
|
|
733
|
-
return new
|
|
733
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(`Bedrock timeout: ${message}`, { metadata });
|
|
734
734
|
case "server_error":
|
|
735
|
-
return new
|
|
735
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(`Bedrock server error: ${message}`, { metadata });
|
|
736
736
|
default:
|
|
737
|
-
return new
|
|
737
|
+
return new chunk4ZHTIJNE_cjs.UnknownAgentError(`Bedrock unknown: ${message}`, { metadata });
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
function parseBody(body) {
|
|
@@ -758,7 +758,7 @@ async function resolveBedrockToken(region) {
|
|
|
758
758
|
return cachedToken.value;
|
|
759
759
|
}
|
|
760
760
|
try {
|
|
761
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
761
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-KYAJINUI.cjs', document.baseURI).href)));
|
|
762
762
|
const gen = r("@aws/bedrock-token-generator");
|
|
763
763
|
if (typeof gen.getToken !== "function") return void 0;
|
|
764
764
|
const providers = r("@aws-sdk/credential-providers");
|
|
@@ -786,16 +786,16 @@ var BedrockAnthropicClient = class {
|
|
|
786
786
|
if (fromOpts !== void 0 && fromOpts.length > 0) return fromOpts;
|
|
787
787
|
const fromEnv = await resolveBedrockToken(region);
|
|
788
788
|
if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
|
|
789
|
-
throw new
|
|
789
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
790
790
|
"Bedrock requires AWS_BEARER_TOKEN_BEDROCK env var, or install `@aws/bedrock-token-generator` for auto-refresh, or pass apiKey explicitly.",
|
|
791
791
|
{ code: "auth_failed" }
|
|
792
792
|
);
|
|
793
793
|
}
|
|
794
794
|
async *stream(request, signal) {
|
|
795
|
-
const region =
|
|
795
|
+
const region = chunkHCZD23VS_cjs.inferRegionFromModelId(request.model) ?? process.env.AWS_REGION ?? "us-east-1";
|
|
796
796
|
const token = await this.resolveTokenOrThrow(region);
|
|
797
|
-
const bareModel =
|
|
798
|
-
const baseUrl = this.options.baseUrl ??
|
|
797
|
+
const bareModel = chunkHCZD23VS_cjs.stripBedrockPrefix(request.model);
|
|
798
|
+
const baseUrl = this.options.baseUrl ?? chunkHCZD23VS_cjs.resolveBedrockBaseUrl(request.model);
|
|
799
799
|
const endpoint = `/model/${encodeURIComponent(bareModel)}/invoke`;
|
|
800
800
|
const url = `${baseUrl}${endpoint}`;
|
|
801
801
|
const response = await postAnthropicRequest({
|
|
@@ -850,7 +850,7 @@ var FaultInjectingLlmClient = class {
|
|
|
850
850
|
return yield* this.inner.stream(request, signal);
|
|
851
851
|
}
|
|
852
852
|
if (parsed.status >= 400) {
|
|
853
|
-
throw
|
|
853
|
+
throw chunkUGT7GK7I_cjs.mapOpenAICompatibleError({
|
|
854
854
|
providerId: this.name,
|
|
855
855
|
status: parsed.status,
|
|
856
856
|
body: parsed.body,
|
|
@@ -897,7 +897,7 @@ function parseOverrideOrWarnOnce() {
|
|
|
897
897
|
function warnInvalidJsonOnce(_raw) {
|
|
898
898
|
if (warnedInvalidJson) return;
|
|
899
899
|
warnedInvalidJson = true;
|
|
900
|
-
|
|
900
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
901
901
|
`[theokit-sdk] ${ENV_OVERRIDE_KEY} is set but value is not valid JSON of shape \`{"status": number, "body": object | string}\`. Falling back to real LLM call. This warning is shown once per process.
|
|
902
902
|
`
|
|
903
903
|
);
|
|
@@ -925,7 +925,7 @@ function mapOllamaTransportError(args) {
|
|
|
925
925
|
if (args.providerId !== "ollama") return void 0;
|
|
926
926
|
const causeCode = extractCauseCode(args.cause);
|
|
927
927
|
if (causeCode !== "ECONNREFUSED" && causeCode !== "ENOTFOUND") return void 0;
|
|
928
|
-
const metadata =
|
|
928
|
+
const metadata = chunkUGT7GK7I_cjs.buildErrorMetadata({
|
|
929
929
|
provider: "ollama",
|
|
930
930
|
endpoint: args.endpoint,
|
|
931
931
|
code: "network",
|
|
@@ -933,7 +933,7 @@ function mapOllamaTransportError(args) {
|
|
|
933
933
|
headers: void 0,
|
|
934
934
|
body: { cause: causeCode }
|
|
935
935
|
});
|
|
936
|
-
return new
|
|
936
|
+
return new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
937
937
|
"Ollama is not reachable. Run `ollama serve` to start the local runtime, or set OLLAMA_HOST to point at a remote Ollama server.",
|
|
938
938
|
{ code: "ollama_unreachable", metadata }
|
|
939
939
|
);
|
|
@@ -943,7 +943,7 @@ function mapOllamaHttpError(args) {
|
|
|
943
943
|
const errString = extractErrorString(args.body).toLowerCase();
|
|
944
944
|
if (args.status === 404 && errString.includes("not found") && errString.includes("pull")) {
|
|
945
945
|
const modelHint = extractModelName(errString);
|
|
946
|
-
const metadata =
|
|
946
|
+
const metadata = chunkUGT7GK7I_cjs.buildErrorMetadata({
|
|
947
947
|
provider: "ollama",
|
|
948
948
|
endpoint: args.endpoint,
|
|
949
949
|
code: "model_unavailable",
|
|
@@ -952,13 +952,13 @@ function mapOllamaHttpError(args) {
|
|
|
952
952
|
body: args.body
|
|
953
953
|
});
|
|
954
954
|
const pullCmd = modelHint !== void 0 ? `ollama pull ${modelHint}` : "ollama pull <model>";
|
|
955
|
-
return new
|
|
955
|
+
return new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
956
956
|
`Ollama model is not pulled. Run \`${pullCmd}\` to download it first.`,
|
|
957
957
|
{ code: "ollama_model_not_pulled", metadata }
|
|
958
958
|
);
|
|
959
959
|
}
|
|
960
960
|
if (args.status === 503 && errString.includes("model is loading")) {
|
|
961
|
-
const metadata =
|
|
961
|
+
const metadata = chunkUGT7GK7I_cjs.buildErrorMetadata({
|
|
962
962
|
provider: "ollama",
|
|
963
963
|
endpoint: args.endpoint,
|
|
964
964
|
code: "server_error",
|
|
@@ -966,7 +966,7 @@ function mapOllamaHttpError(args) {
|
|
|
966
966
|
headers: args.headers,
|
|
967
967
|
body: args.body
|
|
968
968
|
});
|
|
969
|
-
return new
|
|
969
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(
|
|
970
970
|
"Ollama model is loading. Retry in a few seconds \u2014 Ollama is warming up the model into memory.",
|
|
971
971
|
{ code: "ollama_model_loading", metadata }
|
|
972
972
|
);
|
|
@@ -1187,7 +1187,7 @@ function toOllamaMessages(message) {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
if (message.role === "user") {
|
|
1189
1189
|
if (message.content.some((p) => p.type === "image")) {
|
|
1190
|
-
throw new
|
|
1190
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
1191
1191
|
"image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
|
|
1192
1192
|
{ code: "ollama_image_unsupported" }
|
|
1193
1193
|
);
|
|
@@ -1273,7 +1273,7 @@ var AMBIENT_STORE = {
|
|
|
1273
1273
|
};
|
|
1274
1274
|
function isStoredOAuthAvailable(env = process.env) {
|
|
1275
1275
|
try {
|
|
1276
|
-
return
|
|
1276
|
+
return chunkXJCXEKMD_cjs.readStoredOAuth(AMBIENT_STORE, env) !== void 0;
|
|
1277
1277
|
} catch {
|
|
1278
1278
|
return false;
|
|
1279
1279
|
}
|
|
@@ -1341,7 +1341,7 @@ async function safeFetch(fetchFn, url, init) {
|
|
|
1341
1341
|
try {
|
|
1342
1342
|
return await fetchFn(url, init);
|
|
1343
1343
|
} catch (cause) {
|
|
1344
|
-
throw new
|
|
1344
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError("HTTP request failed", { code: "network_error", cause });
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
async function safeParseJsonResponse(response) {
|
|
@@ -1368,7 +1368,7 @@ function mapHttpStatusToError(status, body) {
|
|
|
1368
1368
|
cause: body
|
|
1369
1369
|
};
|
|
1370
1370
|
if (envelope.code === "integration_not_connected") {
|
|
1371
|
-
return new
|
|
1371
|
+
return new chunk4ZHTIJNE_cjs.IntegrationNotConnectedError(message, {
|
|
1372
1372
|
provider: envelope.provider ?? "unknown",
|
|
1373
1373
|
helpUrl: envelope.helpUrl ?? "",
|
|
1374
1374
|
code: envelope.code,
|
|
@@ -1376,18 +1376,18 @@ function mapHttpStatusToError(status, body) {
|
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
1378
1378
|
if (status === 401 || status === 403) {
|
|
1379
|
-
return new
|
|
1379
|
+
return new chunk4ZHTIJNE_cjs.AuthenticationError(message, errorOptions);
|
|
1380
1380
|
}
|
|
1381
1381
|
if (status === 429) {
|
|
1382
|
-
return new
|
|
1382
|
+
return new chunk4ZHTIJNE_cjs.RateLimitError(message, errorOptions);
|
|
1383
1383
|
}
|
|
1384
1384
|
if (status >= 400 && status < 500) {
|
|
1385
|
-
return new
|
|
1385
|
+
return new chunk4ZHTIJNE_cjs.ConfigurationError(message, errorOptions);
|
|
1386
1386
|
}
|
|
1387
1387
|
if (status >= 500) {
|
|
1388
|
-
return new
|
|
1388
|
+
return new chunk4ZHTIJNE_cjs.NetworkError(message, errorOptions);
|
|
1389
1389
|
}
|
|
1390
|
-
return new
|
|
1390
|
+
return new chunk4ZHTIJNE_cjs.UnknownAgentError(message, errorOptions);
|
|
1391
1391
|
}
|
|
1392
1392
|
function extractErrorEnvelope(body) {
|
|
1393
1393
|
if (!body || typeof body !== "object") return {};
|
|
@@ -1641,7 +1641,7 @@ var OpenAIClient = class {
|
|
|
1641
1641
|
endpoint: "/v1/chat/completions"
|
|
1642
1642
|
});
|
|
1643
1643
|
if (ollamaMapped !== void 0) throw ollamaMapped;
|
|
1644
|
-
throw
|
|
1644
|
+
throw chunkUGT7GK7I_cjs.mapOpenAICompatibleError({
|
|
1645
1645
|
providerId,
|
|
1646
1646
|
status: response.status,
|
|
1647
1647
|
body,
|
|
@@ -1677,7 +1677,7 @@ var OpenAIClient = class {
|
|
|
1677
1677
|
}
|
|
1678
1678
|
if (chunk.error !== void 0 && chunk.error !== null) {
|
|
1679
1679
|
const status = typeof chunk.error.code === "number" ? chunk.error.code : 502;
|
|
1680
|
-
throw
|
|
1680
|
+
throw chunkUGT7GK7I_cjs.mapOpenAICompatibleError({
|
|
1681
1681
|
providerId,
|
|
1682
1682
|
status,
|
|
1683
1683
|
body: chunk,
|
|
@@ -1689,7 +1689,7 @@ var OpenAIClient = class {
|
|
|
1689
1689
|
for (const event of events) yield event;
|
|
1690
1690
|
}
|
|
1691
1691
|
if (!sawDone && !accumulator.finishReasonSeen) {
|
|
1692
|
-
throw new
|
|
1692
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError("SSE stream truncated (no finish_reason / [DONE])", {
|
|
1693
1693
|
code: "stream_truncated"
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
@@ -1821,13 +1821,13 @@ var OpenAIStreamAccumulator = class {
|
|
|
1821
1821
|
toolCalls.push(...recovered.toolCalls);
|
|
1822
1822
|
text = recovered.residualText;
|
|
1823
1823
|
stopReason = "tool_use";
|
|
1824
|
-
|
|
1824
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
1825
1825
|
`[theokit-sdk] recovered ${recovered.toolCalls.length} leaked tool call(s) from assistant content (provider="${this.providerName}", names=${recovered.toolCalls.map((c) => c.name).join(",")})
|
|
1826
1826
|
`
|
|
1827
1827
|
);
|
|
1828
1828
|
}
|
|
1829
1829
|
if (recovered.droppedNames.length > 0) {
|
|
1830
|
-
|
|
1830
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
1831
1831
|
`[theokit-sdk] dropped ${recovered.droppedNames.length} leaked block(s) whose name is not a tool in the request (provider="${this.providerName}", names=${recovered.droppedNames.join(",")})
|
|
1832
1832
|
`
|
|
1833
1833
|
);
|
|
@@ -1949,10 +1949,10 @@ async function tryFirstEvent(client, request, signal, logFallback = false) {
|
|
|
1949
1949
|
const firstResult = await generator.next();
|
|
1950
1950
|
return { kind: "ok", generator, firstResult };
|
|
1951
1951
|
} catch (cause) {
|
|
1952
|
-
if (cause instanceof
|
|
1952
|
+
if (cause instanceof chunk4ZHTIJNE_cjs.NetworkError || cause instanceof chunk4ZHTIJNE_cjs.RateLimitError || cause instanceof chunk4ZHTIJNE_cjs.AuthenticationError) {
|
|
1953
1953
|
if (logFallback) {
|
|
1954
1954
|
const errCode = cause.metadata?.code ?? cause.code ?? "unknown";
|
|
1955
|
-
|
|
1955
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] provider ${client.name} failed (${errCode}): falling back
|
|
1956
1956
|
`);
|
|
1957
1957
|
}
|
|
1958
1958
|
return { kind: "handshake_error", error: cause };
|
|
@@ -1994,7 +1994,7 @@ var PoolAwareLlmClient = class {
|
|
|
1994
1994
|
// 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.
|
|
1995
1995
|
async *stream(request, signal) {
|
|
1996
1996
|
if (this.breaker.shouldSkip(this.pool.provider)) {
|
|
1997
|
-
throw new
|
|
1997
|
+
throw new chunk4ZHTIJNE_cjs.NetworkError(`${this.pool.provider} circuit open \u2014 failing fast`, {
|
|
1998
1998
|
code: "circuit_open"
|
|
1999
1999
|
});
|
|
2000
2000
|
}
|
|
@@ -2013,7 +2013,7 @@ var PoolAwareLlmClient = class {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
if (entry === null) {
|
|
2015
2015
|
this.breaker.recordTimeout(this.pool.provider);
|
|
2016
|
-
throw new
|
|
2016
|
+
throw new chunk4ZHTIJNE_cjs.CredentialPoolExhaustedError(
|
|
2017
2017
|
`All ${this.pool.provider} credentials exhausted; next retry available at ${this.nextRetryHint() ?? "unknown"}`,
|
|
2018
2018
|
{ provider: this.pool.provider, nextRetryAt: this.nextRetryHint() }
|
|
2019
2019
|
);
|
|
@@ -2027,13 +2027,13 @@ var PoolAwareLlmClient = class {
|
|
|
2027
2027
|
}
|
|
2028
2028
|
const decision = classifyAndDecide(attempt.error, hasRetried429);
|
|
2029
2029
|
if (decision === "retry") {
|
|
2030
|
-
const backoffMs =
|
|
2030
|
+
const backoffMs = chunkO7DK5PBJ_cjs.computeBackoffMs({
|
|
2031
2031
|
attempt: 0,
|
|
2032
2032
|
...this.backoffBaseMs !== void 0 ? { baseMs: this.backoffBaseMs } : {},
|
|
2033
2033
|
...this.rng !== void 0 ? { rng: this.rng } : {}
|
|
2034
2034
|
});
|
|
2035
2035
|
this.onRateLimit?.({ attempt: 1, retryAfterMs: backoffMs });
|
|
2036
|
-
await
|
|
2036
|
+
await chunkO7DK5PBJ_cjs.sleepWithAbort(backoffMs, signal);
|
|
2037
2037
|
hasRetried429 = true;
|
|
2038
2038
|
continue;
|
|
2039
2039
|
}
|
|
@@ -2045,7 +2045,7 @@ var PoolAwareLlmClient = class {
|
|
|
2045
2045
|
...parseRetryAfterMs(attempt.error) !== void 0 ? { resetAtMs: parseRetryAfterMs(attempt.error) } : {}
|
|
2046
2046
|
});
|
|
2047
2047
|
} catch (persistErr) {
|
|
2048
|
-
|
|
2048
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2049
2049
|
`[theokit-sdk] credential-pool: persist failed during rotate; continuing in-memory: ${persistErr instanceof Error ? persistErr.message : String(persistErr)}
|
|
2050
2050
|
`
|
|
2051
2051
|
);
|
|
@@ -2067,8 +2067,8 @@ var PoolAwareLlmClient = class {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
};
|
|
2069
2069
|
function classifyAndDecide(error, hasRetried429) {
|
|
2070
|
-
if (error instanceof
|
|
2071
|
-
if (error instanceof
|
|
2070
|
+
if (error instanceof chunk4ZHTIJNE_cjs.NetworkError) return "propagate";
|
|
2071
|
+
if (error instanceof chunk4ZHTIJNE_cjs.AuthenticationError) return "rotate";
|
|
2072
2072
|
const status = error.metadata?.statusCode ?? 429;
|
|
2073
2073
|
if (status === 402) return "rotate";
|
|
2074
2074
|
return hasRetried429 ? "rotate" : "retry";
|
|
@@ -2081,8 +2081,8 @@ function parseRetryAfterMs(error) {
|
|
|
2081
2081
|
return void 0;
|
|
2082
2082
|
}
|
|
2083
2083
|
function inferStatusCode(error) {
|
|
2084
|
-
if (error instanceof
|
|
2085
|
-
if (error instanceof
|
|
2084
|
+
if (error instanceof chunk4ZHTIJNE_cjs.AuthenticationError) return 401;
|
|
2085
|
+
if (error instanceof chunk4ZHTIJNE_cjs.RateLimitError) return 429;
|
|
2086
2086
|
return 0;
|
|
2087
2087
|
}
|
|
2088
2088
|
function abortError(signal) {
|
|
@@ -2238,7 +2238,7 @@ var ResponsesApiClient = class {
|
|
|
2238
2238
|
body = JSON.parse(text2);
|
|
2239
2239
|
} catch {
|
|
2240
2240
|
}
|
|
2241
|
-
throw
|
|
2241
|
+
throw chunkUGT7GK7I_cjs.mapOpenAICompatibleError({
|
|
2242
2242
|
providerId,
|
|
2243
2243
|
status: response.status,
|
|
2244
2244
|
body,
|
|
@@ -2324,7 +2324,7 @@ var ResponsesApiClient = class {
|
|
|
2324
2324
|
} else if (t === "response.failed" || t === "error") {
|
|
2325
2325
|
const msg = event.response?.error?.message ?? event.message ?? "responses stream failed";
|
|
2326
2326
|
yield { type: "error", message: msg };
|
|
2327
|
-
throw
|
|
2327
|
+
throw chunkUGT7GK7I_cjs.mapOpenAICompatibleError({
|
|
2328
2328
|
providerId,
|
|
2329
2329
|
status: 502,
|
|
2330
2330
|
body: { error: { message: msg } },
|
|
@@ -2357,14 +2357,14 @@ function abortError2(signal) {
|
|
|
2357
2357
|
// src/internal/llm/retrying-client.ts
|
|
2358
2358
|
var MAX_ATTEMPTS = 3;
|
|
2359
2359
|
function isRetriableError(err) {
|
|
2360
|
-
if (!
|
|
2361
|
-
if (err instanceof
|
|
2362
|
-
if (err instanceof
|
|
2363
|
-
if (err instanceof
|
|
2360
|
+
if (!chunk4ZHTIJNE_cjs.isTransientError(err)) return false;
|
|
2361
|
+
if (err instanceof chunk4ZHTIJNE_cjs.CredentialPoolExhaustedError) return false;
|
|
2362
|
+
if (err instanceof chunk4ZHTIJNE_cjs.TheokitAgentError && err.code === "circuit_open") return false;
|
|
2363
|
+
if (err instanceof chunk4ZHTIJNE_cjs.RateLimitError && err.metadata?.statusCode === 402) return false;
|
|
2364
2364
|
return true;
|
|
2365
2365
|
}
|
|
2366
2366
|
function retryAfterHintMs(err) {
|
|
2367
|
-
if (!(err instanceof
|
|
2367
|
+
if (!(err instanceof chunk4ZHTIJNE_cjs.RateLimitError)) return void 0;
|
|
2368
2368
|
const seconds = err.metadata?.retryAfter;
|
|
2369
2369
|
return typeof seconds === "number" && seconds > 0 ? seconds * 1e3 : void 0;
|
|
2370
2370
|
}
|
|
@@ -2410,16 +2410,16 @@ var RetryingLlmClient = class {
|
|
|
2410
2410
|
*/
|
|
2411
2411
|
async #waitBackoff(err, attempt, signal) {
|
|
2412
2412
|
const hint = retryAfterHintMs(err);
|
|
2413
|
-
const ms =
|
|
2413
|
+
const ms = chunkO7DK5PBJ_cjs.computeBackoffMs({
|
|
2414
2414
|
attempt,
|
|
2415
2415
|
...hint !== void 0 ? { retryAfterMs: hint } : {},
|
|
2416
2416
|
...this.#rng !== void 0 ? { rng: this.#rng } : {}
|
|
2417
2417
|
});
|
|
2418
2418
|
const cause = err instanceof Error ? err.name : typeof err;
|
|
2419
|
-
|
|
2419
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2420
2420
|
`retry ${attempt + 1}/${MAX_ATTEMPTS} in ${String(ms)}ms \u2014 ${cause}` + (hint !== void 0 ? ` (Retry-After: ${String(hint)}ms)` : "")
|
|
2421
2421
|
);
|
|
2422
|
-
await
|
|
2422
|
+
await chunkO7DK5PBJ_cjs.sleepWithAbort(ms, signal);
|
|
2423
2423
|
}
|
|
2424
2424
|
async *stream(request, signal) {
|
|
2425
2425
|
let lastError;
|
|
@@ -2457,7 +2457,7 @@ function classifyVertexError(args, errStatus) {
|
|
|
2457
2457
|
return "unknown";
|
|
2458
2458
|
}
|
|
2459
2459
|
function vertexMetadata(args, code) {
|
|
2460
|
-
return
|
|
2460
|
+
return chunkUGT7GK7I_cjs.buildErrorMetadata({
|
|
2461
2461
|
provider: "vertex",
|
|
2462
2462
|
endpoint: args.endpoint,
|
|
2463
2463
|
code,
|
|
@@ -2467,23 +2467,23 @@ function vertexMetadata(args, code) {
|
|
|
2467
2467
|
});
|
|
2468
2468
|
}
|
|
2469
2469
|
var VERTEX_ERROR_BUILDERS = {
|
|
2470
|
-
rate_limit: (args, msg) => new
|
|
2470
|
+
rate_limit: (args, msg) => new chunk4ZHTIJNE_cjs.RateLimitError(`Vertex quota exhausted: ${msg}`, {
|
|
2471
2471
|
metadata: vertexMetadata(args, "rate_limit")
|
|
2472
2472
|
}),
|
|
2473
|
-
auth_unauthenticated: (args, msg) => new
|
|
2473
|
+
auth_unauthenticated: (args, msg) => new chunk4ZHTIJNE_cjs.AuthenticationError(`Vertex unauthenticated: ${msg}`, {
|
|
2474
2474
|
metadata: vertexMetadata(args, "auth_failed")
|
|
2475
2475
|
}),
|
|
2476
|
-
auth_permission: (args, msg) => new
|
|
2476
|
+
auth_permission: (args, msg) => new chunk4ZHTIJNE_cjs.AuthenticationError(`Vertex permission denied: ${msg}`, {
|
|
2477
2477
|
metadata: vertexMetadata(args, "auth_failed")
|
|
2478
2478
|
}),
|
|
2479
|
-
invalid_request: (args, msg) => new
|
|
2479
|
+
invalid_request: (args, msg) => new chunk4ZHTIJNE_cjs.ConfigurationError(`Vertex validation: ${msg}`, {
|
|
2480
2480
|
metadata: vertexMetadata(args, "invalid_request")
|
|
2481
2481
|
}),
|
|
2482
|
-
timeout: (args, msg) => new
|
|
2483
|
-
server_error: (args, msg) => new
|
|
2482
|
+
timeout: (args, msg) => new chunk4ZHTIJNE_cjs.NetworkError(`Vertex timeout: ${msg}`, { metadata: vertexMetadata(args, "timeout") }),
|
|
2483
|
+
server_error: (args, msg) => new chunk4ZHTIJNE_cjs.NetworkError(`Vertex server error: ${msg}`, {
|
|
2484
2484
|
metadata: vertexMetadata(args, "server_error")
|
|
2485
2485
|
}),
|
|
2486
|
-
unknown: (args, msg) => new
|
|
2486
|
+
unknown: (args, msg) => new chunk4ZHTIJNE_cjs.UnknownAgentError(`Vertex unknown: ${msg}`, { metadata: vertexMetadata(args, "unknown") })
|
|
2487
2487
|
};
|
|
2488
2488
|
function mapVertexError(args) {
|
|
2489
2489
|
const parsed = parseBody2(args.body);
|
|
@@ -2519,12 +2519,12 @@ async function resolveVertexAccessToken() {
|
|
|
2519
2519
|
async function getAuthClientOrThrow() {
|
|
2520
2520
|
let mod;
|
|
2521
2521
|
try {
|
|
2522
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
2522
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-KYAJINUI.cjs', document.baseURI).href)));
|
|
2523
2523
|
mod = r("google-auth-library");
|
|
2524
2524
|
} catch (err) {
|
|
2525
2525
|
const isModuleMissing = err instanceof Error && (err.message.includes("Cannot find module") || err.code === "MODULE_NOT_FOUND");
|
|
2526
2526
|
if (isModuleMissing) {
|
|
2527
|
-
throw new
|
|
2527
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2528
2528
|
"Vertex provider requires `google-auth-library`. Install: `pnpm add google-auth-library`.",
|
|
2529
2529
|
{ code: "auth_failed", cause: err }
|
|
2530
2530
|
);
|
|
@@ -2535,7 +2535,7 @@ async function getAuthClientOrThrow() {
|
|
|
2535
2535
|
const auth = new mod.GoogleAuth({ scopes: [SCOPE_CLOUD_PLATFORM] });
|
|
2536
2536
|
return await auth.getClient();
|
|
2537
2537
|
} catch (err) {
|
|
2538
|
-
|
|
2538
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2539
2539
|
`[theokit-sdk] Vertex ADC initialization failed: ${err instanceof Error ? err.message : String(err)}
|
|
2540
2540
|
`
|
|
2541
2541
|
);
|
|
@@ -2561,7 +2561,7 @@ var VertexAnthropicClient = class {
|
|
|
2561
2561
|
resolveProjectOrThrow() {
|
|
2562
2562
|
const projectId = this.options.projectId ?? resolveVertexProjectId();
|
|
2563
2563
|
if (projectId !== void 0) return projectId;
|
|
2564
|
-
throw new
|
|
2564
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2565
2565
|
"Vertex requires a project id. Set GOOGLE_CLOUD_PROJECT env var or run `gcloud config set project <id>`.",
|
|
2566
2566
|
{ code: "auth_failed" }
|
|
2567
2567
|
);
|
|
@@ -2571,7 +2571,7 @@ var VertexAnthropicClient = class {
|
|
|
2571
2571
|
if (fromOpts !== void 0 && fromOpts.length > 0) return fromOpts;
|
|
2572
2572
|
const fromAdc = await resolveVertexAccessToken();
|
|
2573
2573
|
if (fromAdc !== void 0 && fromAdc.length > 0) return fromAdc;
|
|
2574
|
-
throw new
|
|
2574
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2575
2575
|
"Vertex could not resolve an access token. Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS to a service-account JSON path.",
|
|
2576
2576
|
{ code: "auth_failed" }
|
|
2577
2577
|
);
|
|
@@ -2580,8 +2580,8 @@ var VertexAnthropicClient = class {
|
|
|
2580
2580
|
const projectId = this.resolveProjectOrThrow();
|
|
2581
2581
|
const location = this.options.location ?? resolveVertexLocation();
|
|
2582
2582
|
const accessToken = await this.resolveTokenOrThrow();
|
|
2583
|
-
const baseUrl =
|
|
2584
|
-
const bareModel =
|
|
2583
|
+
const baseUrl = chunkHCZD23VS_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "anthropic" });
|
|
2584
|
+
const bareModel = chunkHCZD23VS_cjs.stripVertexPrefix(request.model);
|
|
2585
2585
|
const endpoint = `/models/${encodeURIComponent(bareModel)}:rawPredict`;
|
|
2586
2586
|
const url = `${baseUrl}${endpoint}`;
|
|
2587
2587
|
const response = await postAnthropicRequest({
|
|
@@ -2617,7 +2617,7 @@ var VertexGeminiClient = class {
|
|
|
2617
2617
|
async *stream(request, signal) {
|
|
2618
2618
|
const projectId = this.options.projectId ?? resolveVertexProjectId();
|
|
2619
2619
|
if (projectId === void 0) {
|
|
2620
|
-
throw new
|
|
2620
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2621
2621
|
"Vertex requires a project id. Set GOOGLE_CLOUD_PROJECT env var or run `gcloud config set project <id>`.",
|
|
2622
2622
|
{ code: "auth_failed" }
|
|
2623
2623
|
);
|
|
@@ -2625,12 +2625,12 @@ var VertexGeminiClient = class {
|
|
|
2625
2625
|
const location = this.options.location ?? resolveVertexLocation();
|
|
2626
2626
|
const accessToken = this.options.apiKey !== void 0 && this.options.apiKey.length > 0 ? this.options.apiKey : await resolveVertexAccessToken();
|
|
2627
2627
|
if (accessToken === void 0 || accessToken.length === 0) {
|
|
2628
|
-
throw new
|
|
2628
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2629
2629
|
"Vertex could not resolve an access token. Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS to a service-account JSON path.",
|
|
2630
2630
|
{ code: "auth_failed" }
|
|
2631
2631
|
);
|
|
2632
2632
|
}
|
|
2633
|
-
const baseUrl =
|
|
2633
|
+
const baseUrl = chunkHCZD23VS_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "gemini" });
|
|
2634
2634
|
const url = `${baseUrl}/chat/completions`;
|
|
2635
2635
|
const innerFetch = this.options.fetch ?? fetch;
|
|
2636
2636
|
const rewriteFetch = (_input, init) => innerFetch(url, init);
|
|
@@ -2652,7 +2652,7 @@ var VertexRouterClient = class {
|
|
|
2652
2652
|
options;
|
|
2653
2653
|
name = "vertex";
|
|
2654
2654
|
async *stream(request, signal) {
|
|
2655
|
-
const dialect =
|
|
2655
|
+
const dialect = chunkHCZD23VS_cjs.inferModelDialect(request.model);
|
|
2656
2656
|
if (dialect === "anthropic") {
|
|
2657
2657
|
const inner2 = new VertexAnthropicClient(this.options);
|
|
2658
2658
|
return yield* inner2.stream(request, signal);
|
|
@@ -2664,7 +2664,7 @@ var VertexRouterClient = class {
|
|
|
2664
2664
|
|
|
2665
2665
|
// src/internal/llm/router.ts
|
|
2666
2666
|
function resolveProviderChain(options) {
|
|
2667
|
-
|
|
2667
|
+
chunkHCZD23VS_cjs.registerBuiltins();
|
|
2668
2668
|
return buildChain(options);
|
|
2669
2669
|
}
|
|
2670
2670
|
function buildChain(options) {
|
|
@@ -2681,7 +2681,7 @@ function buildChain(options) {
|
|
|
2681
2681
|
addClient(options.primary, options.baseUrl);
|
|
2682
2682
|
for (const fallback of options.fallback ?? []) addClient(fallback);
|
|
2683
2683
|
if (clients.length === 0) {
|
|
2684
|
-
throw new
|
|
2684
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2685
2685
|
`No provider client could be resolved (primary=${options.primary}). Set ANTHROPIC_API_KEY or OPENAI_API_KEY / OPENROUTER_API_KEY.`,
|
|
2686
2686
|
{ code: "provider_unresolved" }
|
|
2687
2687
|
);
|
|
@@ -2689,11 +2689,11 @@ function buildChain(options) {
|
|
|
2689
2689
|
return clients;
|
|
2690
2690
|
}
|
|
2691
2691
|
function buildClient(name, routerOptions, perCallBaseUrl) {
|
|
2692
|
-
const baseProfile =
|
|
2692
|
+
const baseProfile = chunkHCZD23VS_cjs.getProviderProfile(name);
|
|
2693
2693
|
if (baseProfile === void 0) return void 0;
|
|
2694
2694
|
const profile = routerOptions.extractToolCallsFromContent === true && baseProfile.extractToolCallsFromContent !== true ? { ...baseProfile, extractToolCallsFromContent: true } : baseProfile;
|
|
2695
2695
|
const resilience = routerOptions.onRateLimit !== void 0 ? { onRateLimit: routerOptions.onRateLimit } : {};
|
|
2696
|
-
const ambient =
|
|
2696
|
+
const ambient = chunkO7DK5PBJ_cjs.currentCredentialPool(name);
|
|
2697
2697
|
if (ambient !== void 0) {
|
|
2698
2698
|
return new RetryingLlmClient(
|
|
2699
2699
|
new PoolAwareLlmClient(
|
|
@@ -2723,9 +2723,9 @@ function buildPoolOrSingle(args) {
|
|
|
2723
2723
|
if (poolKeys !== void 0 && poolKeys.length >= 2) {
|
|
2724
2724
|
const strategy = routerOptions.credentialPoolStrategy?.[name] ?? "fill_first";
|
|
2725
2725
|
const entries = poolKeys.map(
|
|
2726
|
-
(accessToken, priority) =>
|
|
2726
|
+
(accessToken, priority) => chunkO7DK5PBJ_cjs.newPooledCredential({ provider: name, accessToken, priority, source: "manual" })
|
|
2727
2727
|
);
|
|
2728
|
-
const pool = new
|
|
2728
|
+
const pool = new chunkO7DK5PBJ_cjs.CredentialPool(name, entries, strategy);
|
|
2729
2729
|
const resilience = routerOptions.onRateLimit !== void 0 ? { onRateLimit: routerOptions.onRateLimit } : {};
|
|
2730
2730
|
return new RetryingLlmClient(
|
|
2731
2731
|
new PoolAwareLlmClient(
|
|
@@ -2758,7 +2758,7 @@ var warnedNoAuthApiKeys = /* @__PURE__ */ new Set();
|
|
|
2758
2758
|
function warnNoAuthApiKeysIgnoredOnce(provider) {
|
|
2759
2759
|
if (warnedNoAuthApiKeys.has(provider)) return;
|
|
2760
2760
|
warnedNoAuthApiKeys.add(provider);
|
|
2761
|
-
|
|
2761
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2762
2762
|
`[theokit-sdk] provider "${provider}" has authType: "none" \u2014 apiKeys ignored (no auth required for local runtime).
|
|
2763
2763
|
`
|
|
2764
2764
|
);
|
|
@@ -2784,10 +2784,10 @@ function warnUnknownProvidersInApiKeys(apiKeys) {
|
|
|
2784
2784
|
if (apiKeys === void 0) return;
|
|
2785
2785
|
for (const name of Object.keys(apiKeys)) {
|
|
2786
2786
|
if (warnedProviders.has(name)) continue;
|
|
2787
|
-
const profile =
|
|
2787
|
+
const profile = chunkHCZD23VS_cjs.getProviderProfile(name);
|
|
2788
2788
|
if (profile === void 0) {
|
|
2789
2789
|
warnedProviders.add(name);
|
|
2790
|
-
|
|
2790
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2791
2791
|
`[theokit-sdk] credential-pool: unknown provider "${name}" in apiKeys (no profile registered)
|
|
2792
2792
|
`
|
|
2793
2793
|
);
|
|
@@ -2819,7 +2819,7 @@ function selectTransport(profile, apiKey, baseUrl) {
|
|
|
2819
2819
|
if (apiKey !== "__oauth_lazy_token__") return;
|
|
2820
2820
|
const auth = t.headers?.authorization ?? t.headers?.Authorization;
|
|
2821
2821
|
if (t.fetch === void 0 && auth === void 0) {
|
|
2822
|
-
throw new
|
|
2822
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2823
2823
|
`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".`
|
|
2824
2824
|
);
|
|
2825
2825
|
}
|
|
@@ -2878,7 +2878,7 @@ function selectTransport(profile, apiKey, baseUrl) {
|
|
|
2878
2878
|
providerName: profile.name
|
|
2879
2879
|
});
|
|
2880
2880
|
}
|
|
2881
|
-
throw new
|
|
2881
|
+
throw new chunk4ZHTIJNE_cjs.ConfigurationError(
|
|
2882
2882
|
`Provider "${profile.name}" requires apiMode "${profile.apiMode}" but no transport is registered. Install a third-party transport plugin (@theokit-transport-${profile.apiMode}) or use a provider with apiMode "chat_completions" or "anthropic_messages".`,
|
|
2883
2883
|
{ code: "transport_unavailable" }
|
|
2884
2884
|
);
|
|
@@ -2888,7 +2888,7 @@ function selectTransport(profile, apiKey, baseUrl) {
|
|
|
2888
2888
|
function inferProviderFromApiKey(apiKey) {
|
|
2889
2889
|
const provider = chunkFRITRLZQ_cjs.providerFromApiKeyPrefix(apiKey);
|
|
2890
2890
|
if (provider === void 0) return void 0;
|
|
2891
|
-
return
|
|
2891
|
+
return chunkHCZD23VS_cjs.getProviderProfile(provider) === void 0 ? void 0 : provider;
|
|
2892
2892
|
}
|
|
2893
2893
|
function detectPrimaryProvider() {
|
|
2894
2894
|
if (process.env.ANTHROPIC_API_KEY !== void 0 && process.env.ANTHROPIC_API_KEY.length > 0) {
|
|
@@ -2908,7 +2908,7 @@ function warnProviderPrecedenceOnce(asked, used) {
|
|
|
2908
2908
|
const key = `${asked}->${used}`;
|
|
2909
2909
|
if (warnedProviderPrecedence.has(key)) return;
|
|
2910
2910
|
warnedProviderPrecedence.add(key);
|
|
2911
|
-
|
|
2911
|
+
chunkEG4QM7ZJ_cjs.diag(
|
|
2912
2912
|
`[theokit-sdk] model id names provider "${asked}", but "${used}" was used \u2014 an explicit \`providers.routes[0]\` or the API key's own prefix outranks the model id's prefix. Pass \`providers.routes\` to choose deliberately.
|
|
2913
2913
|
`
|
|
2914
2914
|
);
|
|
@@ -3034,7 +3034,7 @@ function plainText(content) {
|
|
|
3034
3034
|
}
|
|
3035
3035
|
async function compactSessionTranscript(opts) {
|
|
3036
3036
|
const prior = await opts.store.readRecords(opts.loc.agentId);
|
|
3037
|
-
const history =
|
|
3037
|
+
const history = chunk5HEG4CQH_cjs.reconstructMessages(prior);
|
|
3038
3038
|
const compressible = [];
|
|
3039
3039
|
for (const m of history) {
|
|
3040
3040
|
const text = plainText(m.content);
|
|
@@ -3042,14 +3042,14 @@ async function compactSessionTranscript(opts) {
|
|
|
3042
3042
|
compressible.push({ role: m.role, content: text });
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
|
-
const preTokens =
|
|
3045
|
+
const preTokens = chunkDXGZ2NUG_cjs.estimateTokens(compressible.map((m) => m.content).join("\n"));
|
|
3046
3046
|
const summaryBody = await opts.summarize(compressible);
|
|
3047
3047
|
const preserved = [];
|
|
3048
3048
|
let budget = 0;
|
|
3049
3049
|
for (let i = compressible.length - 1; i >= 0; i--) {
|
|
3050
3050
|
const m = compressible[i];
|
|
3051
3051
|
if (m === void 0 || m.role !== "user" || isCompactSummary(m.content)) continue;
|
|
3052
|
-
const cost =
|
|
3052
|
+
const cost = chunkDXGZ2NUG_cjs.estimateTokens(m.content);
|
|
3053
3053
|
if (budget + cost > COMPACT_USER_MESSAGE_MAX_TOKENS) {
|
|
3054
3054
|
const remaining = COMPACT_USER_MESSAGE_MAX_TOKENS - budget;
|
|
3055
3055
|
if (remaining > 50) {
|
|
@@ -3063,7 +3063,7 @@ async function compactSessionTranscript(opts) {
|
|
|
3063
3063
|
}
|
|
3064
3064
|
const summary = `${COMPACT_SUMMARY_MARKER}
|
|
3065
3065
|
${summaryBody}`;
|
|
3066
|
-
const transcript =
|
|
3066
|
+
const transcript = chunk5HEG4CQH_cjs.SessionTranscript.fromRecords(prior, {
|
|
3067
3067
|
cwd: opts.loc.cwd,
|
|
3068
3068
|
sessionId: opts.sessionId,
|
|
3069
3069
|
model: opts.loc.model ?? "unknown"
|
|
@@ -3074,7 +3074,7 @@ ${summaryBody}`;
|
|
|
3074
3074
|
const delta = transcript.records().slice(prior.length);
|
|
3075
3075
|
await opts.store.appendRecords(opts.loc.agentId, delta);
|
|
3076
3076
|
chunk4OTIXDMU_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
|
|
3077
|
-
const postTokens =
|
|
3077
|
+
const postTokens = chunkDXGZ2NUG_cjs.estimateTokens([...preserved, summary].join("\n"));
|
|
3078
3078
|
return { preTokens, postTokens };
|
|
3079
3079
|
}
|
|
3080
3080
|
function resolveSummarizerRoute(opts) {
|
|
@@ -3083,9 +3083,9 @@ function resolveSummarizerRoute(opts) {
|
|
|
3083
3083
|
}
|
|
3084
3084
|
function buildDefaultSummarizer(opts) {
|
|
3085
3085
|
return async (messages) => {
|
|
3086
|
-
|
|
3086
|
+
chunkHCZD23VS_cjs.registerBuiltins();
|
|
3087
3087
|
const modelPrefix = opts.agentModel.includes("/") ? opts.agentModel.slice(0, opts.agentModel.indexOf("/")) : void 0;
|
|
3088
|
-
const prefixProfile = modelPrefix !== void 0 ?
|
|
3088
|
+
const prefixProfile = modelPrefix !== void 0 ? chunkHCZD23VS_cjs.getProviderProfile(modelPrefix) : void 0;
|
|
3089
3089
|
const prefixUsable = prefixProfile !== void 0 && (prefixProfile.authType !== "api_key" || prefixProfile.envVars.some((v) => (process.env[v] ?? "").length > 0));
|
|
3090
3090
|
const route = resolveSummarizerRoute({
|
|
3091
3091
|
keyProvider: inferProviderFromApiKey(opts.apiKey),
|
|
@@ -3156,7 +3156,7 @@ async function autoCompactIfNeeded(opts) {
|
|
|
3156
3156
|
return true;
|
|
3157
3157
|
} catch (cause) {
|
|
3158
3158
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
3159
|
-
|
|
3159
|
+
chunkEG4QM7ZJ_cjs.diag(`[theokit-sdk] auto-compaction failed (left transcript untouched): ${msg}
|
|
3160
3160
|
`);
|
|
3161
3161
|
return false;
|
|
3162
3162
|
}
|
|
@@ -3189,5 +3189,5 @@ exports.shouldUseFixtureMode = shouldUseFixtureMode;
|
|
|
3189
3189
|
exports.shouldUseRealLocalRuntime = shouldUseRealLocalRuntime;
|
|
3190
3190
|
exports.tryFirstEvent = tryFirstEvent;
|
|
3191
3191
|
exports.warnProviderPrecedenceOnce = warnProviderPrecedenceOnce;
|
|
3192
|
-
//# sourceMappingURL=chunk-
|
|
3193
|
-
//# sourceMappingURL=chunk-
|
|
3192
|
+
//# sourceMappingURL=chunk-KYAJINUI.cjs.map
|
|
3193
|
+
//# sourceMappingURL=chunk-KYAJINUI.cjs.map
|