@theokit/sdk 4.53.1 → 4.55.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 +1184 -0
- package/README.md +9 -4
- package/dist/a2a/agent-mailbox.d.cts +27 -0
- package/dist/a2a/agent-mailbox.d.ts +27 -0
- package/dist/a2a/index.cjs +9 -4
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +7 -2
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/message-bus.d.cts +39 -0
- package/dist/a2a/message-bus.d.ts +39 -0
- package/dist/a2a/subagent.d.cts +68 -7
- package/dist/a2a/subagent.d.ts +68 -7
- package/dist/a2a/types.d.cts +26 -0
- package/dist/a2a/types.d.ts +26 -0
- package/dist/{agent-B9HXlwID.d.ts → agent-D3Xr_-6Z.d.cts} +245 -850
- package/dist/{agent-nLqeXKIX.d.cts → agent-DIu6FooJ.d.ts} +245 -850
- package/dist/agent-HDEVVUBS.js +52 -0
- package/dist/{agent-FFVV4U5N.js.map → agent-HDEVVUBS.js.map} +1 -1
- package/dist/agent-R2HOJFZJ.cjs +61 -0
- package/dist/{agent-YLAHVHEH.cjs.map → agent-R2HOJFZJ.cjs.map} +1 -1
- package/dist/agent-builder.d.ts +19 -0
- package/dist/agent-session-store-P6V3FINW.js +7 -0
- package/dist/{agent-session-store-TNCGL5RN.js.map → agent-session-store-P6V3FINW.js.map} +1 -1
- package/dist/agent-session-store-ZJ3JSRS4.cjs +24 -0
- package/dist/{agent-session-store-DUGBAX5V.cjs.map → agent-session-store-ZJ3JSRS4.cjs.map} +1 -1
- package/dist/agent.d.ts +9 -6
- package/dist/auth/index.cjs +52 -35
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +26 -9
- package/dist/auth/index.js.map +1 -1
- package/dist/{batch-UPKN4SG6.js → batch-2TGJMNCJ.js} +14 -13
- package/dist/batch-2TGJMNCJ.js.map +1 -0
- package/dist/{batch-ZEFN5SO7.cjs → batch-ND32UKZS.cjs} +31 -30
- package/dist/batch-ND32UKZS.cjs.map +1 -0
- package/dist/{chunk-TTJ54H3E.cjs → chunk-2ADR2GSO.cjs} +8 -8
- package/dist/chunk-2ADR2GSO.cjs.map +1 -0
- package/dist/chunk-2BDH744Z.js +15 -0
- package/dist/chunk-2BDH744Z.js.map +1 -0
- package/dist/{chunk-VGPXHHF3.cjs → chunk-2C72DXQF.cjs} +63 -27
- package/dist/chunk-2C72DXQF.cjs.map +1 -0
- package/dist/{chunk-4Q4K4WB5.js → chunk-2D34UTDC.js} +20 -4
- package/dist/chunk-2D34UTDC.js.map +1 -0
- package/dist/{chunk-UFIXH26P.js → chunk-2QKTVKH3.js} +4 -4
- package/dist/{chunk-UFIXH26P.js.map → chunk-2QKTVKH3.js.map} +1 -1
- package/dist/{chunk-GBBDINFK.js → chunk-3E77SX4H.js} +4 -4
- package/dist/{chunk-GBBDINFK.js.map → chunk-3E77SX4H.js.map} +1 -1
- package/dist/{chunk-VYHJZVL5.cjs → chunk-3EE6LVWT.cjs} +2 -2
- package/dist/chunk-3EE6LVWT.cjs.map +1 -0
- package/dist/{chunk-5NBUH3NO.js → chunk-3OR54XG4.js} +2 -2
- package/dist/{chunk-C6Y6CWYD.cjs.map → chunk-3OR54XG4.js.map} +1 -1
- package/dist/{chunk-ZN2DGEY3.cjs → chunk-3YJNUKYN.cjs} +15 -15
- package/dist/{chunk-ZN2DGEY3.cjs.map → chunk-3YJNUKYN.cjs.map} +1 -1
- package/dist/{chunk-POWRZSK4.js → chunk-44JAAH4X.js} +3 -3
- package/dist/{chunk-POWRZSK4.js.map → chunk-44JAAH4X.js.map} +1 -1
- package/dist/{chunk-SSDD676S.js → chunk-44MBDIHG.js} +4 -4
- package/dist/{chunk-SSDD676S.js.map → chunk-44MBDIHG.js.map} +1 -1
- package/dist/{chunk-OY7O3Q6R.js → chunk-4ERPXIVB.js} +5 -5
- package/dist/{chunk-OY7O3Q6R.js.map → chunk-4ERPXIVB.js.map} +1 -1
- package/dist/{chunk-3BK6YR5P.cjs → chunk-4I55V454.cjs} +4 -4
- package/dist/{chunk-3BK6YR5P.cjs.map → chunk-4I55V454.cjs.map} +1 -1
- package/dist/{chunk-B4YA6BRS.cjs → chunk-4O5TGQBW.cjs} +30 -7
- package/dist/chunk-4O5TGQBW.cjs.map +1 -0
- package/dist/{chunk-4JBHSLQO.cjs → chunk-4OTIXDMU.cjs} +2 -2
- package/dist/{chunk-4JBHSLQO.cjs.map → chunk-4OTIXDMU.cjs.map} +1 -1
- package/dist/{chunk-C6Y6CWYD.cjs → chunk-52NKC5HT.cjs} +2 -2
- package/dist/chunk-52NKC5HT.cjs.map +1 -0
- package/dist/{chunk-665SFFFR.cjs → chunk-53CBTBWO.cjs} +11 -11
- package/dist/{chunk-665SFFFR.cjs.map → chunk-53CBTBWO.cjs.map} +1 -1
- package/dist/{chunk-FFM3SJTQ.js → chunk-5JLFFPCH.js} +4 -4
- package/dist/{chunk-FFM3SJTQ.js.map → chunk-5JLFFPCH.js.map} +1 -1
- package/dist/{chunk-34XOCZJO.js → chunk-5PHVENFV.js} +3 -3
- package/dist/chunk-5PHVENFV.js.map +1 -0
- package/dist/{chunk-BDTVFIPB.cjs → chunk-5UOVYM3P.cjs} +36 -31
- package/dist/chunk-5UOVYM3P.cjs.map +1 -0
- package/dist/{chunk-VF7X6HDR.cjs → chunk-5USCYPPI.cjs} +15 -15
- package/dist/{chunk-VF7X6HDR.cjs.map → chunk-5USCYPPI.cjs.map} +1 -1
- package/dist/chunk-6HTXPPHK.cjs +18 -0
- package/dist/chunk-6HTXPPHK.cjs.map +1 -0
- package/dist/{chunk-D24WJWN2.js → chunk-AEOZTXVW.js} +3 -3
- package/dist/{chunk-D24WJWN2.js.map → chunk-AEOZTXVW.js.map} +1 -1
- package/dist/{chunk-DGOG5NXR.js → chunk-AG5JPQIY.js} +3 -3
- package/dist/{chunk-DGOG5NXR.js.map → chunk-AG5JPQIY.js.map} +1 -1
- package/dist/{chunk-BFYGJGC5.js → chunk-AQLGBKNT.js} +3 -3
- package/dist/chunk-AQLGBKNT.js.map +1 -0
- package/dist/{chunk-7W7ZWMLQ.js → chunk-AWO27VRZ.js} +3 -3
- package/dist/chunk-AWO27VRZ.js.map +1 -0
- package/dist/{chunk-VYCKUKPA.cjs → chunk-B2J4ZMZL.cjs} +3 -2
- package/dist/chunk-B2J4ZMZL.cjs.map +1 -0
- package/dist/{chunk-BERBYXFH.js → chunk-BMAZLQQ4.js} +3 -3
- package/dist/{chunk-BERBYXFH.js.map → chunk-BMAZLQQ4.js.map} +1 -1
- package/dist/{chunk-5YKNEMXR.cjs → chunk-BVZW2B5V.cjs} +4 -4
- package/dist/chunk-BVZW2B5V.cjs.map +1 -0
- package/dist/{chunk-MSFLYJDY.js → chunk-CQ2TQ32Y.js} +4 -4
- package/dist/chunk-CQ2TQ32Y.js.map +1 -0
- package/dist/{chunk-C5DEO6OI.cjs → chunk-CQGYNZ3K.cjs} +4 -4
- package/dist/{chunk-C5DEO6OI.cjs.map → chunk-CQGYNZ3K.cjs.map} +1 -1
- package/dist/{chunk-D75S2X6I.cjs → chunk-CTCGWIUD.cjs} +5 -5
- package/dist/{chunk-D75S2X6I.cjs.map → chunk-CTCGWIUD.cjs.map} +1 -1
- package/dist/{chunk-NZL4BNFQ.js → chunk-CV7XMBHP.js} +4 -4
- package/dist/chunk-CV7XMBHP.js.map +1 -0
- package/dist/{chunk-SEL2ZQMT.js → chunk-DAPSQZT4.js} +15 -10
- package/dist/chunk-DAPSQZT4.js.map +1 -0
- package/dist/{chunk-SVO5WPZX.cjs → chunk-DQKERTND.cjs} +11 -11
- package/dist/{chunk-SVO5WPZX.cjs.map → chunk-DQKERTND.cjs.map} +1 -1
- package/dist/{chunk-N5CR3TJZ.js → chunk-DZBSJX6J.js} +4 -4
- package/dist/{chunk-N5CR3TJZ.js.map → chunk-DZBSJX6J.js.map} +1 -1
- package/dist/{chunk-RAHSWE5C.cjs → chunk-EI2Q7SJ5.cjs} +12 -12
- package/dist/chunk-EI2Q7SJ5.cjs.map +1 -0
- package/dist/{chunk-UCFONJBG.js → chunk-EPSICJLZ.js} +2 -2
- package/dist/{chunk-UCFONJBG.js.map → chunk-EPSICJLZ.js.map} +1 -1
- package/dist/{chunk-3X6PM7DU.cjs → chunk-F3YZMOAU.cjs} +8 -8
- package/dist/{chunk-3X6PM7DU.cjs.map → chunk-F3YZMOAU.cjs.map} +1 -1
- package/dist/{chunk-F77UENR6.cjs → chunk-F5WMX4EA.cjs} +586 -398
- package/dist/chunk-F5WMX4EA.cjs.map +1 -0
- package/dist/{chunk-HE4BIAOS.js → chunk-F7AQV62G.js} +5 -4
- package/dist/chunk-F7AQV62G.js.map +1 -0
- package/dist/{chunk-2RW7K6FN.cjs → chunk-GHX4P3V2.cjs} +2 -2
- package/dist/chunk-GHX4P3V2.cjs.map +1 -0
- package/dist/{chunk-B6HOIWQ6.js → chunk-GJ6RK75E.js} +5 -5
- package/dist/chunk-GJ6RK75E.js.map +1 -0
- package/dist/{chunk-FOXKFTVZ.cjs → chunk-GNT35C5U.cjs} +13 -13
- package/dist/chunk-GNT35C5U.cjs.map +1 -0
- package/dist/{chunk-4NAKHID5.js → chunk-GTKFV7O5.js} +2 -2
- package/dist/chunk-GTKFV7O5.js.map +1 -0
- package/dist/{chunk-ELKO4ZLR.cjs → chunk-GWC3HADL.cjs} +4 -4
- package/dist/{chunk-ELKO4ZLR.cjs.map → chunk-GWC3HADL.cjs.map} +1 -1
- package/dist/{chunk-OXNYIMZZ.js → chunk-H73MEMQB.js} +2 -2
- package/dist/chunk-H73MEMQB.js.map +1 -0
- package/dist/{chunk-E7FJOO4G.cjs → chunk-HJBMA5MB.cjs} +11 -11
- package/dist/{chunk-E7FJOO4G.cjs.map → chunk-HJBMA5MB.cjs.map} +1 -1
- package/dist/{chunk-2FYEVT2B.cjs → chunk-HLPSLDGL.cjs} +275 -160
- package/dist/chunk-HLPSLDGL.cjs.map +1 -0
- package/dist/{chunk-VW6M4B3Z.cjs → chunk-HY57ULY2.cjs} +5 -5
- package/dist/{chunk-VW6M4B3Z.cjs.map → chunk-HY57ULY2.cjs.map} +1 -1
- package/dist/{chunk-CAH3G4IS.js → chunk-HY66GLM6.js} +2 -2
- package/dist/chunk-HY66GLM6.js.map +1 -0
- package/dist/{chunk-G3JWXOGY.js → chunk-I5BE5M5L.js} +310 -122
- package/dist/chunk-I5BE5M5L.js.map +1 -0
- package/dist/{chunk-C4H6PB5J.cjs → chunk-I6TGFUCO.cjs} +4 -4
- package/dist/{chunk-C4H6PB5J.cjs.map → chunk-I6TGFUCO.cjs.map} +1 -1
- package/dist/{chunk-U4UJHOSH.js → chunk-IDCKSLYH.js} +3 -3
- package/dist/{chunk-U4UJHOSH.js.map → chunk-IDCKSLYH.js.map} +1 -1
- package/dist/{chunk-WQ53UQL4.cjs → chunk-ILCGLTSA.cjs} +4 -4
- package/dist/{chunk-WQ53UQL4.cjs.map → chunk-ILCGLTSA.cjs.map} +1 -1
- package/dist/{chunk-QBTVATSF.cjs → chunk-ITSSOVOB.cjs} +44 -47
- package/dist/chunk-ITSSOVOB.cjs.map +1 -0
- package/dist/{chunk-V6HWJQQV.js → chunk-IVNNSANC.js} +27 -30
- package/dist/chunk-IVNNSANC.js.map +1 -0
- package/dist/{chunk-SZHU7A5B.cjs → chunk-IWBGCBR6.cjs} +4 -4
- package/dist/{chunk-SZHU7A5B.cjs.map → chunk-IWBGCBR6.cjs.map} +1 -1
- package/dist/{chunk-Q4RESANI.cjs → chunk-J24VJOH3.cjs} +20 -4
- package/dist/chunk-J24VJOH3.cjs.map +1 -0
- package/dist/{chunk-Y4AXQOT4.cjs → chunk-JHPGF3FP.cjs} +8 -8
- package/dist/{chunk-Y4AXQOT4.cjs.map → chunk-JHPGF3FP.cjs.map} +1 -1
- package/dist/{chunk-BM6N4KHO.cjs → chunk-JTB5Q42C.cjs} +6 -22
- package/dist/chunk-JTB5Q42C.cjs.map +1 -0
- package/dist/{chunk-LPVIRJVF.cjs → chunk-K3FW2XZD.cjs} +9 -9
- package/dist/{chunk-LPVIRJVF.cjs.map → chunk-K3FW2XZD.cjs.map} +1 -1
- package/dist/{chunk-LS3LMQ23.js → chunk-MVAPK2BX.js} +162 -49
- package/dist/chunk-MVAPK2BX.js.map +1 -0
- package/dist/{chunk-XPR366DL.cjs → chunk-NGESVVJN.cjs} +17 -17
- package/dist/chunk-NGESVVJN.cjs.map +1 -0
- package/dist/{chunk-VUKQL3L2.cjs → chunk-NIRE5CNO.cjs} +20 -13
- package/dist/chunk-NIRE5CNO.cjs.map +1 -0
- package/dist/{chunk-VC5ABJXC.js → chunk-NLTVXLGT.js} +3 -3
- package/dist/{chunk-VC5ABJXC.js.map → chunk-NLTVXLGT.js.map} +1 -1
- package/dist/chunk-NUKRL3I6.cjs +23 -0
- package/dist/chunk-NUKRL3I6.cjs.map +1 -0
- package/dist/{chunk-R5YZACGK.js → chunk-OC4NTGMN.js} +3 -3
- package/dist/{chunk-R5YZACGK.js.map → chunk-OC4NTGMN.js.map} +1 -1
- package/dist/{chunk-GOVJO4YE.js → chunk-OHBIUXKM.js} +6 -6
- package/dist/chunk-OHBIUXKM.js.map +1 -0
- package/dist/{chunk-FPYT5WZP.cjs → chunk-P6A3M6VD.cjs} +10 -10
- package/dist/{chunk-FPYT5WZP.cjs.map → chunk-P6A3M6VD.cjs.map} +1 -1
- package/dist/{chunk-OKLYRPKL.cjs → chunk-Q47R5E2X.cjs} +8 -8
- package/dist/chunk-Q47R5E2X.cjs.map +1 -0
- package/dist/{chunk-HSQ5Q3I5.js → chunk-Q4CMI2LP.js} +12 -5
- package/dist/chunk-Q4CMI2LP.js.map +1 -0
- package/dist/{chunk-2XLKLVVR.js → chunk-Q5EWJPRY.js} +2 -2
- package/dist/chunk-Q5EWJPRY.js.map +1 -0
- package/dist/{chunk-SK4QLUBK.js → chunk-QARJGQSA.js} +16 -7
- package/dist/chunk-QARJGQSA.js.map +1 -0
- package/dist/{chunk-CZ2GKKYL.cjs → chunk-QDED6YO6.cjs} +5 -5
- package/dist/{chunk-CZ2GKKYL.cjs.map → chunk-QDED6YO6.cjs.map} +1 -1
- package/dist/{chunk-VK7MAV65.cjs → chunk-QKLOP4VC.cjs} +2 -2
- package/dist/{chunk-VK7MAV65.cjs.map → chunk-QKLOP4VC.cjs.map} +1 -1
- package/dist/{chunk-FIOCJYLA.js → chunk-QRSUA2CV.js} +3 -3
- package/dist/{chunk-FIOCJYLA.js.map → chunk-QRSUA2CV.js.map} +1 -1
- package/dist/{chunk-ZT57WTUJ.cjs → chunk-R3UPQFKK.cjs} +21 -12
- package/dist/chunk-R3UPQFKK.cjs.map +1 -0
- package/dist/{chunk-X2FR4OIT.js → chunk-R7WIIPUR.js} +2 -2
- package/dist/chunk-R7WIIPUR.js.map +1 -0
- package/dist/{chunk-RP5HQVLD.js → chunk-RNB4APBZ.js} +30 -7
- package/dist/chunk-RNB4APBZ.js.map +1 -0
- package/dist/{chunk-GD63JPGC.cjs → chunk-ROYPRJH4.cjs} +9 -9
- package/dist/{chunk-GD63JPGC.cjs.map → chunk-ROYPRJH4.cjs.map} +1 -1
- package/dist/{chunk-V26QVGUG.js → chunk-RUDY2GTT.js} +59 -23
- package/dist/chunk-RUDY2GTT.js.map +1 -0
- package/dist/{chunk-JIQRXKTA.cjs → chunk-SKXBJ2NU.cjs} +7 -7
- package/dist/chunk-SKXBJ2NU.cjs.map +1 -0
- package/dist/{chunk-XROIW6BH.js → chunk-SUKXXLWD.js} +6 -6
- package/dist/chunk-SUKXXLWD.js.map +1 -0
- package/dist/{chunk-LTSTGCL6.js → chunk-T73NA43R.js} +3 -3
- package/dist/{chunk-LTSTGCL6.js.map → chunk-T73NA43R.js.map} +1 -1
- package/dist/chunk-T7O6K6PX.js +20 -0
- package/dist/chunk-T7O6K6PX.js.map +1 -0
- package/dist/{chunk-5F5NWKPN.js → chunk-T7XEKOVW.js} +5 -20
- package/dist/chunk-T7XEKOVW.js.map +1 -0
- package/dist/{chunk-HAWE74GQ.cjs → chunk-U2AC6JUP.cjs} +8 -8
- package/dist/chunk-U2AC6JUP.cjs.map +1 -0
- package/dist/{chunk-3WVMJY7F.js → chunk-UC3HT2S4.js} +3 -3
- package/dist/{chunk-3WVMJY7F.js.map → chunk-UC3HT2S4.js.map} +1 -1
- package/dist/{chunk-PBZ7HMBP.js → chunk-UPRJR6IP.js} +4 -4
- package/dist/chunk-UPRJR6IP.js.map +1 -0
- package/dist/{chunk-3V7UJLQT.js → chunk-UQGQFBRL.js} +3 -3
- package/dist/chunk-UQGQFBRL.js.map +1 -0
- package/dist/{chunk-2D43RD5D.cjs → chunk-V2UUGUY4.cjs} +27 -27
- package/dist/chunk-V2UUGUY4.cjs.map +1 -0
- package/dist/{chunk-6AZDM6LK.js → chunk-VF7EWVDG.js} +3 -3
- package/dist/{chunk-6AZDM6LK.js.map → chunk-VF7EWVDG.js.map} +1 -1
- package/dist/{chunk-PNVDQL5Y.cjs → chunk-VTYY7XL5.cjs} +2 -2
- package/dist/chunk-VTYY7XL5.cjs.map +1 -0
- package/dist/{chunk-Y4I4EQFK.js → chunk-WKRSH2VR.js} +3 -3
- package/dist/{chunk-Y4I4EQFK.js.map → chunk-WKRSH2VR.js.map} +1 -1
- package/dist/{chunk-4QEC4CCS.js → chunk-WTMU7J4U.js} +2 -2
- package/dist/{chunk-4QEC4CCS.js.map → chunk-WTMU7J4U.js.map} +1 -1
- package/dist/{chunk-KSWHTR54.js → chunk-XN7NOENA.js} +6 -6
- package/dist/chunk-XN7NOENA.js.map +1 -0
- package/dist/{chunk-ADLLFY3H.cjs → chunk-XSX2UU6Y.cjs} +10 -9
- package/dist/chunk-XSX2UU6Y.cjs.map +1 -0
- package/dist/{chunk-LD4MOBFX.js → chunk-XV4IZNV4.js} +9 -9
- package/dist/chunk-XV4IZNV4.js.map +1 -0
- package/dist/{chunk-EZ2YEF4F.cjs → chunk-XWL6O3SW.cjs} +4 -4
- package/dist/chunk-XWL6O3SW.cjs.map +1 -0
- package/dist/{chunk-PGP7IOJ2.js → chunk-YMA4S2WO.js} +4 -4
- package/dist/{chunk-PGP7IOJ2.js.map → chunk-YMA4S2WO.js.map} +1 -1
- package/dist/{chunk-OUOXM36O.cjs → chunk-YPJ5NH5N.cjs} +11 -11
- package/dist/chunk-YPJ5NH5N.cjs.map +1 -0
- package/dist/{chunk-YLQQX5W2.cjs → chunk-ZF2LDKQQ.cjs} +2 -2
- package/dist/chunk-ZF2LDKQQ.cjs.map +1 -0
- package/dist/{chunk-L5YO6PWL.cjs → chunk-ZNW6V4Y6.cjs} +2 -2
- package/dist/chunk-ZNW6V4Y6.cjs.map +1 -0
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/theokit-client.d.cts +36 -0
- package/dist/client/theokit-client.d.ts +36 -0
- package/dist/client/types.d.cts +30 -0
- package/dist/client/types.d.ts +30 -0
- package/dist/compact-session-FUJDVF7B.js +22 -0
- package/dist/{compact-session-4MNKNMO2.js.map → compact-session-FUJDVF7B.js.map} +1 -1
- package/dist/compact-session-LEWF554G.cjs +59 -0
- package/dist/{compact-session-EPFBQ46Z.cjs.map → compact-session-LEWF554G.cjs.map} +1 -1
- package/dist/compaction.cjs +17 -16
- package/dist/compaction.d.cts +13 -13
- package/dist/compaction.d.ts +13 -13
- package/dist/compaction.js +4 -3
- package/dist/concurrency.cjs +7 -6
- package/dist/concurrency.cjs.map +1 -1
- package/dist/concurrency.js +5 -4
- package/dist/concurrency.js.map +1 -1
- package/dist/context/index.cjs +7 -7
- package/dist/context/index.js +3 -3
- package/dist/context-FDOON2DB.js +6 -0
- package/dist/{context-ENXZNF6J.js.map → context-FDOON2DB.js.map} +1 -1
- package/dist/context-VMIE4BMD.cjs +23 -0
- package/dist/{context-7USNN6LP.cjs.map → context-VMIE4BMD.cjs.map} +1 -1
- package/dist/cron-BcWmzWzT.d.cts +240 -0
- package/dist/cron-De6hzWCF.d.ts +240 -0
- package/dist/cron.cjs +43 -41
- package/dist/cron.d.cts +5 -3
- package/dist/cron.d.ts +5 -3
- package/dist/cron.js +42 -40
- package/dist/define-tool.d.ts +14 -6
- package/dist/{errors-BSoXcl3F.d.cts → errors-BgJH9PHi.d.cts} +39 -24
- package/dist/{errors-CHllybaU.d.ts → errors-C5fJUqLk.d.ts} +39 -24
- package/dist/errors.cjs +22 -21
- package/dist/errors.d.cts +2 -2
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +3 -2
- package/dist/eval.cjs +61 -58
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.d.cts +38 -0
- package/dist/eval.d.ts +38 -0
- package/dist/eval.js +51 -48
- package/dist/eval.js.map +1 -1
- package/dist/event-bus.d.ts +16 -0
- package/dist/{executor-2Z6XJJJG.js → executor-BMEHFOXZ.js} +8 -7
- package/dist/executor-BMEHFOXZ.js.map +1 -0
- package/dist/{executor-2Z3LGG3I.cjs → executor-ZERJ3DGN.cjs} +25 -24
- package/dist/executor-ZERJ3DGN.cjs.map +1 -0
- package/dist/filesystem/index.cjs +8 -7
- package/dist/filesystem/index.cjs.map +1 -1
- package/dist/filesystem/index.js +4 -3
- package/dist/filesystem/index.js.map +1 -1
- package/dist/filesystem/local-filesystem.d.cts +18 -0
- package/dist/filesystem/local-filesystem.d.ts +18 -0
- package/dist/filesystem/types.d.cts +12 -0
- package/dist/filesystem/types.d.ts +12 -0
- package/dist/fs-session-store-3MOJQGP2.cjs +20 -0
- package/dist/{fs-session-store-VVY2AHWG.cjs.map → fs-session-store-3MOJQGP2.cjs.map} +1 -1
- package/dist/fs-session-store-IN7JTTXD.js +11 -0
- package/dist/{fs-session-store-R5FD3EN6.js.map → fs-session-store-IN7JTTXD.js.map} +1 -1
- package/dist/generate-object-N5MDZUJI.js +8 -0
- package/dist/{generate-object-WQRCXFD2.js.map → generate-object-N5MDZUJI.js.map} +1 -1
- package/dist/generate-object-PGSP5U7N.cjs +21 -0
- package/dist/{generate-object-AVXOJK2I.cjs.map → generate-object-PGSP5U7N.cjs.map} +1 -1
- package/dist/generate-object.d.ts +20 -0
- package/dist/index-manager-NG5YENWO.cjs +22 -0
- package/dist/{index-manager-VRU3A2YL.cjs.map → index-manager-NG5YENWO.cjs.map} +1 -1
- package/dist/index-manager-ZMRJ6ZII.js +13 -0
- package/dist/{index-manager-WS7TVKUW.js.map → index-manager-ZMRJ6ZII.js.map} +1 -1
- package/dist/index.cjs +169 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +702 -54
- package/dist/index.d.ts +702 -54
- package/dist/index.js +61 -58
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-GMBMJVNZ.js → inject-session-BJMJH5BX.js} +9 -8
- package/dist/inject-session-BJMJH5BX.js.map +1 -0
- package/dist/inject-session-WQGGMCQY.cjs +29 -0
- package/dist/inject-session-WQGGMCQY.cjs.map +1 -0
- package/dist/internal/auth/auth-types.d.ts +83 -1
- package/dist/internal/auth/credential-store.d.ts +34 -6
- package/dist/internal/auth/oauth-device.d.ts +0 -1
- package/dist/internal/auth/resolve-credential.d.ts +40 -0
- package/dist/internal/budget/tracker/budget.d.ts +12 -14
- package/dist/internal/budget/usage-accumulator.d.ts +15 -0
- package/dist/internal/llm/anthropic-shared.d.ts +8 -4
- package/dist/internal/llm/model-identifier.d.ts +26 -0
- package/dist/internal/llm/openai.d.ts +8 -0
- package/dist/internal/llm/prompt-cache-key.d.ts +1 -0
- package/dist/internal/llm/responses.d.ts +67 -1
- package/dist/internal/llm/router.d.ts +8 -0
- package/dist/internal/llm/types.d.ts +27 -1
- package/dist/internal/local-agent/real-local-run-provider.d.ts +8 -3
- package/dist/internal/local-agent/real-local-run-tools.d.ts +23 -4
- package/dist/internal/mcp/oauth.d.ts +5 -0
- package/dist/internal/mcp/token-storage.d.ts +34 -0
- package/dist/internal/memory/adapters/index.cjs +12 -11
- package/dist/internal/memory/adapters/index.d.cts +3 -1
- package/dist/internal/memory/adapters/index.d.ts +3 -1
- package/dist/internal/memory/adapters/index.js +9 -8
- package/dist/internal/memory/adapters/openai-compatible.d.cts +45 -0
- package/dist/internal/memory/adapters/openai-compatible.d.ts +45 -0
- package/dist/internal/memory/embedding-cache.d.ts +42 -1
- package/dist/internal/memory/escape-like-pattern.d.ts +22 -0
- package/dist/internal/memory/sqlite-vec-loader.d.ts +1 -3
- package/dist/internal/memory/storage/markdown-store.d.ts +0 -5
- package/dist/internal/persistence/cwd-mutex.d.cts +34 -0
- package/dist/internal/persistence/cwd-mutex.d.ts +34 -0
- package/dist/internal/persistence/exclusive-create.d.cts +31 -0
- package/dist/internal/persistence/exclusive-create.d.ts +31 -0
- package/dist/internal/persistence/file-lock.d.cts +28 -0
- package/dist/internal/persistence/file-lock.d.ts +28 -0
- package/dist/internal/persistence/fs-session-store.d.cts +3 -0
- package/dist/internal/persistence/fs-session-store.d.ts +3 -0
- package/dist/internal/persistence/fts5-sanitize.d.cts +20 -0
- package/dist/internal/persistence/fts5-sanitize.d.ts +20 -0
- package/dist/internal/persistence/index.cjs +40 -39
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.d.cts +6 -1
- package/dist/internal/persistence/index.d.ts +6 -1
- package/dist/internal/persistence/index.js +9 -8
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/persistence/paths.d.cts +54 -1
- package/dist/internal/persistence/paths.d.ts +54 -1
- package/dist/internal/persistence/persistence-schema.d.cts +9 -1
- package/dist/internal/persistence/persistence-schema.d.ts +9 -1
- package/dist/internal/persistence/schema-version.d.cts +215 -1
- package/dist/internal/persistence/schema-version.d.ts +215 -1
- package/dist/internal/persistence/session-writer.d.cts +7 -7
- package/dist/internal/persistence/session-writer.d.ts +7 -7
- package/dist/internal/persistence/sqlite-cas.d.cts +37 -1
- package/dist/internal/persistence/sqlite-cas.d.ts +37 -1
- package/dist/internal/persistence/sqlite-open.d.cts +14 -0
- package/dist/internal/persistence/sqlite-open.d.ts +14 -0
- package/dist/internal/persistence/sqlite-wal.d.cts +45 -0
- package/dist/internal/persistence/sqlite-wal.d.ts +45 -0
- package/dist/internal/persistence/transcript-ops.d.cts +7 -1
- package/dist/internal/persistence/transcript-ops.d.ts +7 -1
- package/dist/internal/plugins/types.d.cts +1 -1
- package/dist/internal/plugins/types.d.ts +1 -1
- package/dist/internal/providers/builtin/openai-chatgpt.d.ts +12 -0
- package/dist/internal/providers/catalog-loader.d.ts +8 -0
- package/dist/internal/providers/catalog-schema.d.ts +55 -0
- package/dist/internal/providers/catalog-source-models-dev.d.ts +36 -0
- package/dist/internal/runtime/concurrency/delegation-depth.d.ts +27 -0
- package/dist/internal/runtime/concurrency/subagent-credentials.d.ts +33 -1
- package/dist/internal/runtime/context/context-discovery-runner.d.ts +44 -0
- package/dist/internal/runtime/context/context-discovery.d.ts +58 -0
- package/dist/internal/runtime/context/context-rules-frontmatter.d.ts +70 -1
- package/dist/internal/runtime/fixtures/fixture-mode.d.ts +15 -1
- package/dist/internal/runtime/lifecycle/post-run-lifecycle.d.ts +15 -0
- package/dist/internal/runtime/registry/agent-registry-store.d.ts +12 -0
- package/dist/internal/runtime/registry/live-agent-registry.d.ts +37 -0
- package/dist/internal/scorers/llm-judge.d.ts +6 -1
- package/dist/internal/security/index.cjs +14 -13
- package/dist/internal/security/index.d.cts +4 -1
- package/dist/internal/security/index.d.ts +4 -1
- package/dist/internal/security/index.js +4 -3
- package/dist/internal/security/path-guard.d.cts +46 -0
- package/dist/internal/security/path-guard.d.ts +46 -0
- package/dist/internal/security/redact.d.cts +71 -0
- package/dist/internal/security/redact.d.ts +71 -0
- package/dist/internal/session/agent-session.d.ts +15 -4
- package/dist/internal/session/session-cache.d.ts +5 -0
- package/dist/internal/task/store.d.ts +91 -5
- package/dist/internal/telemetry/span-names.d.ts +0 -1
- package/dist/internal/telemetry/tracer.d.ts +14 -0
- package/dist/job-queue.d.ts +18 -0
- package/dist/judge-call-DWHAJATE.js +6 -0
- package/dist/{judge-call-MDIPTBJI.js.map → judge-call-DWHAJATE.js.map} +1 -1
- package/dist/judge-call-EGYRC2RE.cjs +23 -0
- package/dist/{judge-call-G5SGV2M2.cjs.map → judge-call-EGYRC2RE.cjs.map} +1 -1
- package/dist/mcp-auth.cjs +41 -25
- package/dist/mcp-auth.cjs.map +1 -1
- package/dist/mcp-auth.js +34 -18
- package/dist/mcp-auth.js.map +1 -1
- package/dist/models.cjs +42 -27
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +25 -10
- package/dist/models.js.map +1 -1
- package/dist/oauth-transaction-store-BT4GLTLK.cjs +36 -0
- package/dist/{oauth-transaction-store-7CKHPQRN.cjs.map → oauth-transaction-store-BT4GLTLK.cjs.map} +1 -1
- package/dist/oauth-transaction-store-W52KVHQ4.js +3 -0
- package/dist/{oauth-transaction-store-W74I6EFD.js.map → oauth-transaction-store-W52KVHQ4.js.map} +1 -1
- package/dist/path-safety.cjs +11 -10
- package/dist/path-safety.js +4 -3
- package/dist/permission-engine.d.ts +55 -0
- package/dist/persistence.cjs +43 -42
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +13 -12
- package/dist/persistence.js.map +1 -1
- package/dist/project.cjs +9 -8
- package/dist/project.cjs.map +1 -1
- package/dist/project.js +5 -4
- package/dist/project.js.map +1 -1
- package/dist/providers.cjs +23 -0
- package/dist/providers.cjs.map +1 -0
- package/dist/providers.d.cts +29 -0
- package/dist/providers.d.ts +29 -0
- package/dist/providers.js +10 -0
- package/dist/providers.js.map +1 -0
- package/dist/registry-VFKX7WOP.cjs +47 -0
- package/dist/{registry-63ASMXT4.cjs.map → registry-VFKX7WOP.cjs.map} +1 -1
- package/dist/registry-VFP3WWQP.js +10 -0
- package/dist/{registry-O7FJ2MPM.js.map → registry-VFP3WWQP.js.map} +1 -1
- package/dist/retry.cjs +5 -4
- package/dist/retry.js +4 -3
- package/dist/{run-C8FBAC8o.d.cts → run-BYSHf58D.d.cts} +185 -33
- package/dist/{run-C8FBAC8o.d.ts → run-BYSHf58D.d.ts} +185 -33
- package/dist/{run-to-completion-JDPIUKSH.js → run-to-completion-DRO77625.js} +3 -3
- package/dist/{run-to-completion-JDPIUKSH.js.map → run-to-completion-DRO77625.js.map} +1 -1
- package/dist/{run-to-completion-J73I6IY4.cjs → run-to-completion-X4OWM673.cjs} +13 -13
- package/dist/{run-to-completion-J73I6IY4.cjs.map → run-to-completion-X4OWM673.cjs.map} +1 -1
- package/dist/sandbox/bwrap.d.cts +27 -13
- package/dist/sandbox/bwrap.d.ts +27 -13
- package/dist/sandbox/index.cjs +20 -19
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.js +5 -4
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/linux-sandbox.d.cts +72 -0
- package/dist/sandbox/linux-sandbox.d.ts +72 -0
- package/dist/sandbox/local-sandbox.d.cts +41 -0
- package/dist/sandbox/local-sandbox.d.ts +41 -0
- package/dist/sandbox/seccomp.d.cts +6 -0
- package/dist/sandbox/seccomp.d.ts +6 -0
- package/dist/sandbox/types.d.cts +64 -0
- package/dist/sandbox/types.d.ts +64 -0
- package/dist/scorers.d.ts +38 -7
- package/dist/sdk-agent-D8qJVkuV.d.ts +860 -0
- package/dist/sdk-agent-DEoKhA8a.d.cts +860 -0
- package/dist/server/auth/errors.d.cts +1 -1
- package/dist/server/auth/errors.d.ts +1 -1
- package/dist/server/auth/index.cjs +29 -21
- package/dist/server/auth/index.cjs.map +1 -1
- package/dist/server/auth/index.d.cts +25 -15
- package/dist/server/auth/index.d.ts +25 -15
- package/dist/server/auth/index.js +15 -7
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/auth/oauth-transaction-store.d.cts +13 -1
- package/dist/server/auth/oauth-transaction-store.d.ts +13 -1
- package/dist/server/auth/orchestrator.d.cts +1 -1
- package/dist/server/auth/orchestrator.d.ts +1 -1
- package/dist/server/auth/types.d.cts +1 -1
- package/dist/server/auth/types.d.ts +1 -1
- package/dist/server/auth/validate-return-to.d.cts +21 -11
- package/dist/server/auth/validate-return-to.d.ts +21 -11
- package/dist/server/errors-envelope.cjs +15 -14
- package/dist/server/errors-envelope.cjs.map +1 -1
- package/dist/server/errors-envelope.d.cts +4 -4
- package/dist/server/errors-envelope.d.ts +4 -4
- package/dist/server/errors-envelope.js +4 -3
- package/dist/server/errors-envelope.js.map +1 -1
- package/dist/session-transcript-AKDYYGXQ.js +6 -0
- package/dist/{session-transcript-RAKEK76V.js.map → session-transcript-AKDYYGXQ.js.map} +1 -1
- package/dist/session-transcript-JXHFTB7G.cjs +51 -0
- package/dist/{session-transcript-DOM3UTXR.cjs.map → session-transcript-JXHFTB7G.cjs.map} +1 -1
- package/dist/skills.cjs +8 -7
- package/dist/skills.js +6 -5
- package/dist/stream-object-BUCF5PHO.cjs +21 -0
- package/dist/{stream-object-L3Q7PBMF.cjs.map → stream-object-BUCF5PHO.cjs.map} +1 -1
- package/dist/stream-object-L57K4OFS.js +8 -0
- package/dist/{stream-object-ZYXWS4B2.js.map → stream-object-L57K4OFS.js.map} +1 -1
- package/dist/{stream-to-completion-DFJ5T3BK.js → stream-to-completion-QV5HCL3J.js} +3 -3
- package/dist/{stream-to-completion-DFJ5T3BK.js.map → stream-to-completion-QV5HCL3J.js.map} +1 -1
- package/dist/{stream-to-completion-H2MHISSK.cjs → stream-to-completion-SRISU5AB.cjs} +10 -10
- package/dist/{stream-to-completion-H2MHISSK.cjs.map → stream-to-completion-SRISU5AB.cjs.map} +1 -1
- package/dist/subagents-loader-AZIXJ7D3.cjs +16 -0
- package/dist/{subagents-loader-VRW73QQT.cjs.map → subagents-loader-AZIXJ7D3.cjs.map} +1 -1
- package/dist/subagents-loader-J54ESLDV.js +7 -0
- package/dist/{subagents-loader-I56GSKAQ.js.map → subagents-loader-J54ESLDV.js.map} +1 -1
- package/dist/subagents-loader.cjs +7 -6
- package/dist/subagents-loader.cjs.map +1 -1
- package/dist/subagents-loader.d.cts +3 -2
- package/dist/subagents-loader.d.ts +3 -2
- package/dist/subagents-loader.js +5 -4
- package/dist/subagents-loader.js.map +1 -1
- package/dist/subscription/define-subscription.d.cts +1 -1
- package/dist/subscription/define-subscription.d.ts +1 -1
- package/dist/subscription/index.cjs +22 -9
- package/dist/subscription/index.cjs.map +1 -1
- package/dist/subscription/index.d.cts +1 -1
- package/dist/subscription/index.d.ts +1 -1
- package/dist/subscription/index.js +21 -8
- package/dist/subscription/index.js.map +1 -1
- package/dist/subscription/internal/adapter-types.d.cts +1 -1
- package/dist/subscription/internal/adapter-types.d.ts +1 -1
- package/dist/subscription/internal/server-integration.d.cts +1 -1
- package/dist/subscription/internal/server-integration.d.ts +1 -1
- package/dist/subscription/internal/sse-encoder.d.cts +1 -1
- package/dist/subscription/internal/sse-encoder.d.ts +1 -1
- package/dist/subscription/internal/sse-parser.d.cts +1 -1
- package/dist/subscription/internal/sse-parser.d.ts +1 -1
- package/dist/subscription/internal/subscription-runtime.d.cts +1 -1
- package/dist/subscription/internal/subscription-runtime.d.ts +1 -1
- package/dist/subscription/internal/ws-adapter-node.d.cts +1 -1
- package/dist/subscription/internal/ws-adapter-node.d.ts +1 -1
- package/dist/subscription/theokit-subscribe.d.cts +14 -1
- package/dist/subscription/theokit-subscribe.d.ts +14 -1
- package/dist/subscription/types.d.cts +19 -1
- package/dist/subscription/types.d.ts +19 -1
- package/dist/task-store.cjs +8 -7
- package/dist/task-store.js +5 -4
- package/dist/types/agent-prims.d.ts +14 -0
- package/dist/types/agent.d.ts +92 -11
- package/dist/types/batch.d.ts +7 -1
- package/dist/types/conversation.d.ts +18 -5
- package/dist/types/goal-events.d.ts +4 -8
- package/dist/types/memory-adapter.d.ts +12 -1
- package/dist/types/plugin.d.ts +101 -0
- package/dist/types/provider-profile.d.ts +32 -0
- package/dist/types/run-events.d.ts +28 -1
- package/dist/types/run.d.ts +35 -23
- package/dist/types/sdk-agent.d.ts +14 -0
- package/dist/types/session-record.d.ts +18 -1
- package/dist/types/task.d.ts +15 -1
- package/dist/types/theokit.d.ts +10 -1
- package/dist/types/updates.d.ts +35 -4
- package/dist/types/workflow.d.ts +155 -0
- package/dist/workflow.cjs +29 -28
- package/dist/workflow.d.cts +666 -17
- package/dist/workflow.d.ts +666 -17
- package/dist/workflow.js +8 -7
- package/docs/error-codes.md +215 -0
- package/docs/harness-capability-map.md +1358 -0
- package/package.json +29 -16
- package/bin/init-claude.mjs +0 -68
- package/claude-template/AGENTS.md +0 -157
- package/claude-template/CLAUDE.md +0 -66
- package/claude-template/dot-claude/rules/theokit-conventions.md +0 -32
- package/claude-template/dot-claude/settings.json +0 -16
- package/claude-template/dot-claude/skills/theokit-agent-core/SKILL.md +0 -209
- package/claude-template/dot-claude/skills/theokit-auth/SKILL.md +0 -102
- package/claude-template/dot-claude/skills/theokit-budget/SKILL.md +0 -176
- package/claude-template/dot-claude/skills/theokit-client/SKILL.md +0 -58
- package/claude-template/dot-claude/skills/theokit-compaction/SKILL.md +0 -102
- package/claude-template/dot-claude/skills/theokit-concurrency/SKILL.md +0 -68
- package/claude-template/dot-claude/skills/theokit-config/SKILL.md +0 -139
- package/claude-template/dot-claude/skills/theokit-cron/SKILL.md +0 -148
- package/claude-template/dot-claude/skills/theokit-di/SKILL.md +0 -233
- package/claude-template/dot-claude/skills/theokit-di-agent/SKILL.md +0 -294
- package/claude-template/dot-claude/skills/theokit-errors/SKILL.md +0 -172
- package/claude-template/dot-claude/skills/theokit-eval/SKILL.md +0 -179
- package/claude-template/dot-claude/skills/theokit-filesystem/SKILL.md +0 -74
- package/claude-template/dot-claude/skills/theokit-gateways/SKILL.md +0 -209
- package/claude-template/dot-claude/skills/theokit-memory/SKILL.md +0 -176
- package/claude-template/dot-claude/skills/theokit-messages/SKILL.md +0 -58
- package/claude-template/dot-claude/skills/theokit-models/SKILL.md +0 -79
- package/claude-template/dot-claude/skills/theokit-path-safety/SKILL.md +0 -60
- package/claude-template/dot-claude/skills/theokit-persistence/SKILL.md +0 -85
- package/claude-template/dot-claude/skills/theokit-project/SKILL.md +0 -55
- package/claude-template/dot-claude/skills/theokit-retry/SKILL.md +0 -50
- package/claude-template/dot-claude/skills/theokit-sandbox/SKILL.md +0 -93
- package/claude-template/dot-claude/skills/theokit-sanitize/SKILL.md +0 -66
- package/claude-template/dot-claude/skills/theokit-skills/SKILL.md +0 -68
- package/claude-template/dot-claude/skills/theokit-streaming/SKILL.md +0 -156
- package/claude-template/dot-claude/skills/theokit-subagents/SKILL.md +0 -109
- package/claude-template/dot-claude/skills/theokit-subscriptions/SKILL.md +0 -148
- package/claude-template/dot-claude/skills/theokit-task-store/SKILL.md +0 -75
- package/claude-template/dot-claude/skills/theokit-tools/SKILL.md +0 -170
- package/claude-template/dot-claude/skills/theokit-workflows/SKILL.md +0 -218
- package/dist/agent-FFVV4U5N.js +0 -50
- package/dist/agent-YLAHVHEH.cjs +0 -59
- package/dist/agent-session-store-DUGBAX5V.cjs +0 -23
- package/dist/agent-session-store-TNCGL5RN.js +0 -6
- package/dist/batch-UPKN4SG6.js.map +0 -1
- package/dist/batch-ZEFN5SO7.cjs.map +0 -1
- package/dist/chunk-2D43RD5D.cjs.map +0 -1
- package/dist/chunk-2FYEVT2B.cjs.map +0 -1
- package/dist/chunk-2RW7K6FN.cjs.map +0 -1
- package/dist/chunk-2XLKLVVR.js.map +0 -1
- package/dist/chunk-34XOCZJO.js.map +0 -1
- package/dist/chunk-3V7UJLQT.js.map +0 -1
- package/dist/chunk-4NAKHID5.js.map +0 -1
- package/dist/chunk-4Q4K4WB5.js.map +0 -1
- package/dist/chunk-5F5NWKPN.js.map +0 -1
- package/dist/chunk-5NBUH3NO.js.map +0 -1
- package/dist/chunk-5YKNEMXR.cjs.map +0 -1
- package/dist/chunk-7W7ZWMLQ.js.map +0 -1
- package/dist/chunk-ADLLFY3H.cjs.map +0 -1
- package/dist/chunk-B4YA6BRS.cjs.map +0 -1
- package/dist/chunk-B6HOIWQ6.js.map +0 -1
- package/dist/chunk-BDTVFIPB.cjs.map +0 -1
- package/dist/chunk-BFYGJGC5.js.map +0 -1
- package/dist/chunk-BM6N4KHO.cjs.map +0 -1
- package/dist/chunk-CAH3G4IS.js.map +0 -1
- package/dist/chunk-EZ2YEF4F.cjs.map +0 -1
- package/dist/chunk-F77UENR6.cjs.map +0 -1
- package/dist/chunk-FOXKFTVZ.cjs.map +0 -1
- package/dist/chunk-G3JWXOGY.js.map +0 -1
- package/dist/chunk-GOVJO4YE.js.map +0 -1
- package/dist/chunk-HAWE74GQ.cjs.map +0 -1
- package/dist/chunk-HE4BIAOS.js.map +0 -1
- package/dist/chunk-HSQ5Q3I5.js.map +0 -1
- package/dist/chunk-JIQRXKTA.cjs.map +0 -1
- package/dist/chunk-KSWHTR54.js.map +0 -1
- package/dist/chunk-L5YO6PWL.cjs.map +0 -1
- package/dist/chunk-LD4MOBFX.js.map +0 -1
- package/dist/chunk-LS3LMQ23.js.map +0 -1
- package/dist/chunk-MSFLYJDY.js.map +0 -1
- package/dist/chunk-NZL4BNFQ.js.map +0 -1
- package/dist/chunk-OKLYRPKL.cjs.map +0 -1
- package/dist/chunk-OUOXM36O.cjs.map +0 -1
- package/dist/chunk-OXNYIMZZ.js.map +0 -1
- package/dist/chunk-PBZ7HMBP.js.map +0 -1
- package/dist/chunk-PNVDQL5Y.cjs.map +0 -1
- package/dist/chunk-Q4RESANI.cjs.map +0 -1
- package/dist/chunk-QBTVATSF.cjs.map +0 -1
- package/dist/chunk-RAHSWE5C.cjs.map +0 -1
- package/dist/chunk-RP5HQVLD.js.map +0 -1
- package/dist/chunk-SEL2ZQMT.js.map +0 -1
- package/dist/chunk-SK4QLUBK.js.map +0 -1
- package/dist/chunk-TTJ54H3E.cjs.map +0 -1
- package/dist/chunk-V26QVGUG.js.map +0 -1
- package/dist/chunk-V6HWJQQV.js.map +0 -1
- package/dist/chunk-VGPXHHF3.cjs.map +0 -1
- package/dist/chunk-VUKQL3L2.cjs.map +0 -1
- package/dist/chunk-VYCKUKPA.cjs.map +0 -1
- package/dist/chunk-VYHJZVL5.cjs.map +0 -1
- package/dist/chunk-X2FR4OIT.js.map +0 -1
- package/dist/chunk-XPR366DL.cjs.map +0 -1
- package/dist/chunk-XROIW6BH.js.map +0 -1
- package/dist/chunk-YLQQX5W2.cjs.map +0 -1
- package/dist/chunk-ZT57WTUJ.cjs.map +0 -1
- package/dist/compact-session-4MNKNMO2.js +0 -21
- package/dist/compact-session-EPFBQ46Z.cjs +0 -58
- package/dist/context-7USNN6LP.cjs +0 -22
- package/dist/context-ENXZNF6J.js +0 -5
- package/dist/cron-BMjgFH-_.d.ts +0 -631
- package/dist/cron-DFDdCdMM.d.cts +0 -631
- package/dist/executor-2Z3LGG3I.cjs.map +0 -1
- package/dist/executor-2Z6XJJJG.js.map +0 -1
- package/dist/fs-session-store-R5FD3EN6.js +0 -10
- package/dist/fs-session-store-VVY2AHWG.cjs +0 -19
- package/dist/generate-object-AVXOJK2I.cjs +0 -20
- package/dist/generate-object-WQRCXFD2.js +0 -7
- package/dist/index-manager-VRU3A2YL.cjs +0 -21
- package/dist/index-manager-WS7TVKUW.js +0 -12
- package/dist/inject-session-AUQLBDRS.cjs +0 -28
- package/dist/inject-session-AUQLBDRS.cjs.map +0 -1
- package/dist/inject-session-GMBMJVNZ.js.map +0 -1
- package/dist/judge-call-G5SGV2M2.cjs +0 -22
- package/dist/judge-call-MDIPTBJI.js +0 -5
- package/dist/oauth-transaction-store-7CKHPQRN.cjs +0 -32
- package/dist/oauth-transaction-store-W74I6EFD.js +0 -3
- package/dist/registry-63ASMXT4.cjs +0 -46
- package/dist/registry-O7FJ2MPM.js +0 -9
- package/dist/session-transcript-DOM3UTXR.cjs +0 -50
- package/dist/session-transcript-RAKEK76V.js +0 -5
- package/dist/stream-object-L3Q7PBMF.cjs +0 -20
- package/dist/stream-object-ZYXWS4B2.js +0 -7
- package/dist/subagents-loader-I56GSKAQ.js +0 -6
- package/dist/subagents-loader-VRW73QQT.cjs +0 -15
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
user-invocable: false
|
|
3
|
-
paths:
|
|
4
|
-
- "**/*error*"
|
|
5
|
-
- "**/*Error*"
|
|
6
|
-
- "**/*exception*"
|
|
7
|
-
description: TheoKit SDK error hierarchy — TheokitAgentError, error codes, retry patterns
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# TheoKit Error Handling
|
|
11
|
-
|
|
12
|
-
All SDK errors extend `TheokitAgentError`. Use `isRetryable` to drive
|
|
13
|
-
retry/backoff logic without coupling to specific subclasses.
|
|
14
|
-
|
|
15
|
-
## Error hierarchy
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
Error
|
|
19
|
-
+-- TheokitAgentError
|
|
20
|
-
| +-- AuthenticationError
|
|
21
|
-
| +-- RateLimitError
|
|
22
|
-
| +-- ConfigurationError
|
|
23
|
-
| | +-- IntegrationNotConnectedError
|
|
24
|
-
| +-- NetworkError
|
|
25
|
-
| +-- UnknownAgentError
|
|
26
|
-
|
|
|
27
|
-
+-- UnsupportedRunOperationError (separate hierarchy)
|
|
28
|
-
+-- AgentRunError (thrown by Agent.prompt with throwOnError)
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Error reference
|
|
32
|
-
|
|
33
|
-
| Error | When | `isRetryable` |
|
|
34
|
-
|---|---|---|
|
|
35
|
-
| `AuthenticationError` | Invalid API key, not logged in, insufficient permissions | `false` |
|
|
36
|
-
| `RateLimitError` | Too many requests or usage limits exceeded | `true` |
|
|
37
|
-
| `ConfigurationError` | Invalid model, bad request parameters, malformed options | `false` |
|
|
38
|
-
| `IntegrationNotConnectedError` | Cloud agent for a repo whose SCM is not connected | `false` |
|
|
39
|
-
| `NetworkError` | Service unavailable, timeout, transport failure | `true` |
|
|
40
|
-
| `UnknownAgentError` | Catch-all for unclassified errors | `false` |
|
|
41
|
-
| `UnsupportedRunOperationError` | Runtime does not support a `Run` operation | n/a |
|
|
42
|
-
| `AgentRunError` | Run finished with error status (only with `throwOnError: true`) | n/a |
|
|
43
|
-
|
|
44
|
-
## `TheokitAgentError` properties
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
class TheokitAgentError extends Error {
|
|
48
|
-
readonly isRetryable: boolean;
|
|
49
|
-
readonly code?: string;
|
|
50
|
-
readonly protoErrorCode?: string;
|
|
51
|
-
readonly cause?: unknown;
|
|
52
|
-
readonly metadata?: ErrorMetadata; // v1.3+ provider HTTP errors
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## `ErrorMetadata` (v1.3+)
|
|
57
|
-
|
|
58
|
-
When an error originates from a provider HTTP call:
|
|
59
|
-
|
|
60
|
-
```typescript
|
|
61
|
-
interface ErrorMetadata {
|
|
62
|
-
provider: string; // "anthropic" | "openai" | "openrouter" | ...
|
|
63
|
-
endpoint: string; // "/v1/messages" | "/v1/chat/completions"
|
|
64
|
-
code: ErrorCode;
|
|
65
|
-
statusCode?: number;
|
|
66
|
-
retryAfter?: number; // seconds
|
|
67
|
-
raw?: unknown; // raw response body (truncated ~2KB)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
type ErrorCode =
|
|
71
|
-
| "rate_limit" | "auth_failed" | "invalid_request"
|
|
72
|
-
| "timeout" | "server_error" | "context_too_long"
|
|
73
|
-
| "content_filtered" | "model_unavailable"
|
|
74
|
-
| "network" | "unknown";
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Retry pattern
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
import { TheokitAgentError, type Run } from "@theokit/sdk";
|
|
81
|
-
|
|
82
|
-
async function withRetry(send: () => Promise<Run>, attempts = 3): Promise<Run> {
|
|
83
|
-
let lastError: unknown;
|
|
84
|
-
for (let i = 0; i < attempts; i++) {
|
|
85
|
-
try {
|
|
86
|
-
return await send();
|
|
87
|
-
} catch (err) {
|
|
88
|
-
lastError = err;
|
|
89
|
-
if (err instanceof TheokitAgentError && err.isRetryable) {
|
|
90
|
-
await new Promise((r) => setTimeout(r, 2 ** i * 1000));
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
throw err;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
throw lastError;
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Using metadata for programmatic handling
|
|
101
|
-
|
|
102
|
-
```typescript
|
|
103
|
-
try {
|
|
104
|
-
await agent.send("...");
|
|
105
|
-
} catch (err) {
|
|
106
|
-
if (err instanceof TheokitAgentError && err.metadata) {
|
|
107
|
-
switch (err.metadata.code) {
|
|
108
|
-
case "rate_limit":
|
|
109
|
-
await wait(err.metadata.retryAfter ?? 60);
|
|
110
|
-
return retry();
|
|
111
|
-
case "auth_failed":
|
|
112
|
-
throw new Error(`Check API key for ${err.metadata.provider}`);
|
|
113
|
-
case "context_too_long":
|
|
114
|
-
// trigger prompt compression
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
throw err;
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## `IntegrationNotConnectedError`
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
import { IntegrationNotConnectedError } from "@theokit/sdk/errors";
|
|
126
|
-
|
|
127
|
-
try {
|
|
128
|
-
await Agent.create({ /* cloud with disconnected repo */ });
|
|
129
|
-
} catch (err) {
|
|
130
|
-
if (err instanceof IntegrationNotConnectedError) {
|
|
131
|
-
console.error(`Connect ${err.provider} at ${err.helpUrl}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## `UnsupportedRunOperationError`
|
|
137
|
-
|
|
138
|
-
Check before calling runtime-dependent operations:
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
if (run.supports("conversation")) {
|
|
142
|
-
const turns = await run.conversation();
|
|
143
|
-
} else {
|
|
144
|
-
console.log(run.unsupportedReason("conversation"));
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Tree-shaking
|
|
149
|
-
|
|
150
|
-
Import error classes from the `/errors` subpath to avoid pulling the full SDK:
|
|
151
|
-
|
|
152
|
-
```typescript
|
|
153
|
-
import { TheokitAgentError, RateLimitError } from "@theokit/sdk/errors";
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## `throwOnError` on `Agent.prompt`
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
import { Agent, AgentRunError } from "@theokit/sdk";
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
const result = await Agent.prompt("hi", {
|
|
163
|
-
apiKey: process.env.ANTHROPIC_API_KEY!,
|
|
164
|
-
model: { id: "claude-sonnet-4-5-20250929" },
|
|
165
|
-
throwOnError: true,
|
|
166
|
-
});
|
|
167
|
-
} catch (err) {
|
|
168
|
-
if (err instanceof AgentRunError && err.code === "auth_failed") {
|
|
169
|
-
// bad API key
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
```
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
user-invocable: false
|
|
3
|
-
paths:
|
|
4
|
-
- "**/*eval*"
|
|
5
|
-
- "**/*Eval*"
|
|
6
|
-
- "**/*scorer*"
|
|
7
|
-
description: TheoKit SDK Eval suite API reference — Eval.create, scorers, datasets, EvalRun
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# TheoKit Eval Suite
|
|
11
|
-
|
|
12
|
-
Eval-as-code primitive for production deploy gates. Run evals against real LLM
|
|
13
|
-
providers to measure quality, latency, and cost before shipping.
|
|
14
|
-
|
|
15
|
-
## Quick start
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
import { Eval, Scorers } from "@theokit/sdk";
|
|
19
|
-
|
|
20
|
-
const run = await Eval.create({
|
|
21
|
-
name: "qa-smoke",
|
|
22
|
-
dataset: [
|
|
23
|
-
{ input: "Reply with the word: ok.", expected: "ok" },
|
|
24
|
-
{ input: "Say jazz in one word.", expected: "jazz" },
|
|
25
|
-
],
|
|
26
|
-
scorers: [
|
|
27
|
-
Scorers.containsExpected({ caseSensitive: false }),
|
|
28
|
-
Scorers.regex(/[a-zA-Z]/),
|
|
29
|
-
],
|
|
30
|
-
agent: {
|
|
31
|
-
apiKey: process.env.OPENROUTER_API_KEY,
|
|
32
|
-
model: { id: "openai/gpt-4o-mini" },
|
|
33
|
-
local: { cwd: process.cwd(), sandboxOptions: { enabled: false } },
|
|
34
|
-
},
|
|
35
|
-
concurrency: 4,
|
|
36
|
-
}).run();
|
|
37
|
-
|
|
38
|
-
console.log(run.aggregate.meanScore); // 0.95
|
|
39
|
-
console.log(run.aggregate.passRatio); // 1.0
|
|
40
|
-
console.log(run.aggregate.tokensInTotal); // 142
|
|
41
|
-
console.log(run.aggregate.durationMsP95); // 1830
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Built-in scorers (`Scorers`)
|
|
45
|
-
|
|
46
|
-
| Scorer | What it checks |
|
|
47
|
-
|---|---|
|
|
48
|
-
| `Scorers.exactMatch({ caseSensitive? })` | `output.trim() === expected.trim()` — refuses empty `expected` |
|
|
49
|
-
| `Scorers.containsExpected({ caseSensitive? })` | `output.includes(expected)` — refuses empty `expected` |
|
|
50
|
-
| `Scorers.regex(pattern)` | `pattern.test(output)` — test patterns against adversarial output to avoid ReDoS |
|
|
51
|
-
| `Scorers.jsonShape(zodSchema, { strict? })` | `JSON.parse(output)` + Zod validation — caps output at 1 MB before parse |
|
|
52
|
-
| `Scorers.llmJudge({ model, apiKey, criteria, rubric? })` | Second LLM scores against criteria — requires SEPARATE `apiKey` |
|
|
53
|
-
| `Scorers.levenshtein({ threshold?, caseSensitive? })` | Normalized edit-distance similarity `1 - dist/max(len)` — deterministic (no LLM); `threshold` binarizes |
|
|
54
|
-
| `Scorers.numericDiff({ tolerance? })` | Relative numeric closeness `1 - |o-e|/max(|o|,|e|)` — deterministic; `tolerance` binarizes |
|
|
55
|
-
| `Scorers.embeddingSimilarity({ apiKey?, model?, threshold?, embed? })` | Cosine of output vs expected embeddings (OpenRouter by default; inject `embed` for another provider). One embeddings call per row |
|
|
56
|
-
| `Scorers.verifyGate({ sandbox?, repoDir, failToPass, passToPass, command })` | Runs the project's tests in a sandbox; scores 1 iff exit 0 (SWE-bench style) |
|
|
57
|
-
|
|
58
|
-
### Custom scorer
|
|
59
|
-
|
|
60
|
-
A scorer is an async function returning a number between 0 and 1:
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
const myScorer = async (row: { input: string; output: string; expected?: string }) => {
|
|
64
|
-
return row.output.length < 100 ? 1.0 : 0.5;
|
|
65
|
-
};
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Dataset
|
|
69
|
-
|
|
70
|
-
The `dataset` field accepts an array of objects with `input` and optional `expected`:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
interface EvalDatasetRow {
|
|
74
|
-
input: string;
|
|
75
|
-
expected?: string;
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Recommended ceiling: ~10k rows (v1 materializes in memory). For larger evals,
|
|
80
|
-
partition into multiple `Eval.create` calls.
|
|
81
|
-
|
|
82
|
-
## `EvalRun` shape
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
interface EvalRun {
|
|
86
|
-
id: string;
|
|
87
|
-
name: string;
|
|
88
|
-
startedAt: number;
|
|
89
|
-
endedAt: number;
|
|
90
|
-
durationMs: number;
|
|
91
|
-
aggregate: EvalAggregate;
|
|
92
|
-
rows: ReadonlyArray<EvalRowResult>;
|
|
93
|
-
metadata?: Record<string, unknown>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
interface EvalAggregate {
|
|
97
|
-
meanScore: number;
|
|
98
|
-
medianScore: number;
|
|
99
|
-
passRatio: number; // rows where meanScore >= 0.5
|
|
100
|
-
perScorer: Record<string, { mean; median; min; max }>;
|
|
101
|
-
totalRows: number;
|
|
102
|
-
errorRows: number;
|
|
103
|
-
durationMsP50: number;
|
|
104
|
-
durationMsP95: number;
|
|
105
|
-
tokensInTotal: number;
|
|
106
|
-
tokensOutTotal: number;
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
`EvalRun` is plain JSON — `JSON.stringify(run)` works directly.
|
|
111
|
-
|
|
112
|
-
## CI gate — `assertEval`
|
|
113
|
-
|
|
114
|
-
Turn a run into a pass/fail gate. `assertEval` reads only `run.aggregate`,
|
|
115
|
-
collects EVERY unmet threshold, and throws `EvalThresholdError` (with a
|
|
116
|
-
`.failures` list) when any is missed — otherwise returns `void`. Drop it into a
|
|
117
|
-
Vitest `it(...)` or a standalone script whose non-zero exit fails the CI job.
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
|
-
import { Eval, Scorers, assertEval, EvalThresholdError } from "@theokit/sdk/eval";
|
|
121
|
-
|
|
122
|
-
const run = await Eval.create({ name: "qa", dataset, scorers, agent }).run();
|
|
123
|
-
|
|
124
|
-
assertEval(run, {
|
|
125
|
-
minMeanScore: 0.8, // aggregate.meanScore >= 0.8
|
|
126
|
-
minPassRatio: 0.9, // aggregate.passRatio >= 0.9
|
|
127
|
-
maxErrorRatio: 0, // errorRows / totalRows <= 0
|
|
128
|
-
perScorer: { "contains-expected": 0.7 }, // per-scorer mean floor (absent scorer = failure)
|
|
129
|
-
});
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Trials (smooth non-determinism)
|
|
133
|
-
|
|
134
|
-
`trials: N` runs each dataset row N times and collapses to ONE row whose
|
|
135
|
-
per-scorer score is the mean over the trials (an errored trial contributes 0).
|
|
136
|
-
`EvalRowResult.trialCount` records the collapse. Range `[1, 100]`.
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
const run = await Eval.create({ name: "qa", dataset, scorers, agent, trials: 3 }).run();
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Concurrency
|
|
143
|
-
|
|
144
|
-
`concurrency` defaults to 4. Allowed range: `[1, 64]` (integer). 0 and
|
|
145
|
-
Infinity are rejected at `Eval.create` time.
|
|
146
|
-
|
|
147
|
-
## Concurrent runs
|
|
148
|
-
|
|
149
|
-
Per-process single-flight per `name`. Two `Eval.run` calls with the same
|
|
150
|
-
`name` running simultaneously throw `EvalAlreadyRunningError`. Include model
|
|
151
|
-
id in the name for matrix runs.
|
|
152
|
-
|
|
153
|
-
## CLI integration
|
|
154
|
-
|
|
155
|
-
The `theokit eval` CLI invokes `Eval.run` internally. User-authored
|
|
156
|
-
`eval.config.{ts,mjs}` files are forward-compatible.
|
|
157
|
-
|
|
158
|
-
## Telemetry
|
|
159
|
-
|
|
160
|
-
When `agent.telemetry.enabled === true`, `Eval.run` emits a parent `eval.run`
|
|
161
|
-
OTel span; `agent.send` / `llm.call` spans nest under it.
|
|
162
|
-
|
|
163
|
-
## Cost forecasting
|
|
164
|
-
|
|
165
|
-
```
|
|
166
|
-
aggregate.tokensInTotal x provider_input_price
|
|
167
|
-
+ aggregate.tokensOutTotal x provider_output_price
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
With `llmJudge`, add ~1 judge call per row. 1000 rows with `gpt-4o-mini`
|
|
171
|
-
costs roughly $3.00 total (base + judge).
|
|
172
|
-
|
|
173
|
-
## Errors
|
|
174
|
-
|
|
175
|
-
| Error | When |
|
|
176
|
-
|---|---|
|
|
177
|
-
| `EvalAlreadyRunningError` | Same `name` already running in this process |
|
|
178
|
-
| `EvalThresholdError` | `assertEval` found one or more unmet thresholds (see `.failures`) |
|
|
179
|
-
| `ConfigurationError` | Invalid concurrency, missing required fields |
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
user-invocable: false
|
|
3
|
-
paths:
|
|
4
|
-
- "**/*filesystem*"
|
|
5
|
-
- "**/*Filesystem*"
|
|
6
|
-
description: TheoKit SDK filesystem seam — FilesystemBackend, LocalFilesystem, boundary-enforced storage with read-before-write safety
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# TheoKit Filesystem
|
|
10
|
-
|
|
11
|
-
A pluggable, boundary-enforced file *storage* provider for agent file tools —
|
|
12
|
-
the storage-side twin of the sandbox seam. Ship a `FilesystemBackend` (default
|
|
13
|
-
`LocalFilesystem`) with an optional `readOnly` flag and a per-request resolver.
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import {
|
|
17
|
-
LocalFilesystem, FilesystemBackend, resolveFilesystem,
|
|
18
|
-
} from "@theokit/sdk/filesystem";
|
|
19
|
-
import type {
|
|
20
|
-
FilesystemProvider, FilesystemConfig, FileStat, WriteFileOptions,
|
|
21
|
-
} from "@theokit/sdk/filesystem";
|
|
22
|
-
import {
|
|
23
|
-
FileNotFoundError, FilesystemError,
|
|
24
|
-
FilesystemReadOnlyError, FilesystemSecurityError, StaleFileError,
|
|
25
|
-
} from "@theokit/sdk/filesystem";
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## LocalFilesystem
|
|
29
|
-
|
|
30
|
-
Boundary-enforced over `node:fs/promises`. Every path resolves within `basePath`;
|
|
31
|
-
traversal / symlink escapes are rejected with `FilesystemSecurityError`. NOT an
|
|
32
|
-
isolation boundary — run untrusted code inside a container/VM.
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
const fs = new LocalFilesystem({ basePath: "/workspace", readOnly: false });
|
|
36
|
-
|
|
37
|
-
const stat: FileStat = await fs.writeFile("notes.md", "# hello"); // returns FileStat
|
|
38
|
-
const text = await fs.readFile("notes.md");
|
|
39
|
-
const names = await fs.list("."); // entry names, not recursive
|
|
40
|
-
if (await fs.exists("notes.md")) { /* … */ }
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Read-before-write safety (SE32)
|
|
44
|
-
|
|
45
|
-
`stat().mtimeMs` is the oracle. Pass `expectedMtime` so a concurrent change makes
|
|
46
|
-
the write fail with `StaleFileError` instead of silently clobbering.
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
const before = await fs.stat("notes.md");
|
|
50
|
-
try {
|
|
51
|
-
await fs.writeFile("notes.md", updated, { expectedMtime: before.mtimeMs });
|
|
52
|
-
} catch (err) {
|
|
53
|
-
if (err instanceof StaleFileError) { /* someone changed it — re-read + merge */ }
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Per-request provider (multi-tenant)
|
|
58
|
-
|
|
59
|
-
A `FilesystemProvider` is a backend OR a resolver `(ctx) => backend` run at
|
|
60
|
-
tool-execution time, giving each request its own root. `resolveFilesystem`
|
|
61
|
-
collapses either form to a concrete backend.
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
const provider: FilesystemProvider<{ tenant: string }> = (ctx) =>
|
|
65
|
-
new LocalFilesystem({ basePath: `/data/${ctx.tenant}` });
|
|
66
|
-
|
|
67
|
-
const backend = await resolveFilesystem(provider, { tenant: "acme" });
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Custom backend
|
|
71
|
-
|
|
72
|
-
Extend `FilesystemBackend` and implement `readFile` / `writeFile` / `stat` /
|
|
73
|
-
`list`; `exists()`, `readOnly`, and `basePath` derive on the base class. Map raw
|
|
74
|
-
Node errors to the typed errors above (`FileNotFoundError`, `FilesystemError`).
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
user-invocable: false
|
|
3
|
-
description: Gateway architecture and 10 platform adapters (Telegram, Slack, Discord, WhatsApp, Teams, Email, SMS, Mattermost, LINE, Matrix).
|
|
4
|
-
paths:
|
|
5
|
-
- "**/*gateway*"
|
|
6
|
-
- "**/*Gateway*"
|
|
7
|
-
- "**/*telegram*"
|
|
8
|
-
- "**/*slack*"
|
|
9
|
-
- "**/*discord*"
|
|
10
|
-
- "**/*whatsapp*"
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# TheoKit SDK -- Gateways
|
|
14
|
-
|
|
15
|
-
Quick reference for the gateway architecture and all 10 platform adapters.
|
|
16
|
-
|
|
17
|
-
## Architecture
|
|
18
|
-
|
|
19
|
-
The gateway system uses a base adapter pattern. Each platform adapter extends `BasePlatformAdapter` from `@theokit/gateway`. The core package defines:
|
|
20
|
-
|
|
21
|
-
- `BasePlatformAdapter` -- abstract class with `connect`, `disconnect`, `sendMessage`, `onInbound`.
|
|
22
|
-
- `GatewayMessageEvent` -- discriminated union of all platform inbound events (keyed by `platform`).
|
|
23
|
-
- `OutboundMessage` -- what `sendMessage` accepts.
|
|
24
|
-
- `SendResult` -- `{ ok, messageId?, error? }`.
|
|
25
|
-
- Session router for multi-platform agent dispatch.
|
|
26
|
-
|
|
27
|
-
## BasePlatformAdapter
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
abstract class BasePlatformAdapter {
|
|
31
|
-
abstract readonly platform: PlatformName;
|
|
32
|
-
abstract connect(): Promise<boolean>;
|
|
33
|
-
abstract disconnect(): Promise<void>;
|
|
34
|
-
abstract sendMessage(out: OutboundMessage): Promise<SendResult>;
|
|
35
|
-
abstract onInbound(handler: (event: GatewayMessageEvent) => Promise<void>): () => void;
|
|
36
|
-
async startTyping(channelId: string): Promise<void> { /* noop */ }
|
|
37
|
-
async stopTyping(channelId: string): Promise<void> { /* noop */ }
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## GatewayMessageEvent (common fields)
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
interface BaseMessageEvent {
|
|
45
|
-
id: string;
|
|
46
|
-
platform: PlatformName;
|
|
47
|
-
sender: { id: string; username?: string; displayName?: string };
|
|
48
|
-
channel: { id: string; type: "dm" | "group" | "thread"; topicId?: string };
|
|
49
|
-
text: string;
|
|
50
|
-
receivedAt: number;
|
|
51
|
-
replyTo?: string;
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## PlatformName
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
type PlatformName =
|
|
59
|
-
| "telegram" | "discord" | "slack" | "whatsapp" | "teams"
|
|
60
|
-
| "email" | "sms" | "mattermost" | "line" | "matrix";
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Platform adapters
|
|
64
|
-
|
|
65
|
-
### 1. Telegram (`@theokit/gateway-telegram`)
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
pnpm add @theokit/gateway-telegram @theokit/gateway grammy
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
import { TelegramAdapter } from "@theokit/gateway-telegram";
|
|
73
|
-
|
|
74
|
-
const adapter = new TelegramAdapter({ botToken: process.env.TELEGRAM_BOT_TOKEN! });
|
|
75
|
-
await adapter.connect();
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Platform-specific: `event.telegram.chatId`, `event.telegram.messageId`, `event.telegram.threadId?`.
|
|
79
|
-
|
|
80
|
-
### 2. Discord (`@theokit/gateway-discord`)
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
pnpm add @theokit/gateway-discord @theokit/gateway discord.js
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
import { DiscordAdapter } from "@theokit/gateway-discord";
|
|
88
|
-
|
|
89
|
-
const adapter = new DiscordAdapter({ botToken: process.env.DISCORD_BOT_TOKEN! });
|
|
90
|
-
await adapter.connect();
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Platform-specific: `event.discord.guildId`, `event.discord.channelId`, `event.discord.messageId`.
|
|
94
|
-
|
|
95
|
-
### 3. Slack (`@theokit/gateway-slack`)
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
pnpm add @theokit/gateway-slack @theokit/gateway @slack/bolt @slack/web-api
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
```typescript
|
|
102
|
-
import { SlackAdapter } from "@theokit/gateway-slack";
|
|
103
|
-
|
|
104
|
-
const adapter = new SlackAdapter({
|
|
105
|
-
botToken: process.env.SLACK_BOT_TOKEN!,
|
|
106
|
-
appToken: process.env.SLACK_APP_TOKEN!,
|
|
107
|
-
requireMention: true, // default; public channels need @bot mention
|
|
108
|
-
});
|
|
109
|
-
await adapter.connect();
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Platform-specific: `event.slack.teamId`, `event.slack.channelId`, `event.slack.ts`, `event.slack.threadTs?`.
|
|
113
|
-
|
|
114
|
-
### 4. WhatsApp (`@theokit/gateway-whatsapp`)
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
pnpm add @theokit/gateway-whatsapp @theokit/gateway
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Two backends: `"cloud"` (Meta Cloud API) and `"web"` (whatsapp-web.js bridge).
|
|
121
|
-
|
|
122
|
-
Platform-specific: `event.whatsapp.wamid`, `event.whatsapp.backend`, `event.whatsapp.phoneNumberId?`.
|
|
123
|
-
|
|
124
|
-
### 5. Teams (`@theokit/gateway-teams`)
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
pnpm add @theokit/gateway-teams @theokit/gateway botbuilder
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Platform-specific: `event.teams.activityId`, `event.teams.conversationId`, `event.teams.conversationType`, `event.teams.tenantId?`.
|
|
131
|
-
|
|
132
|
-
### 6. Email (`@theokit/gateway-email`)
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
pnpm add @theokit/gateway-email @theokit/gateway
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Uses IMAP for inbound and SMTP for outbound.
|
|
139
|
-
|
|
140
|
-
Platform-specific: `event.email.messageId`, `event.email.subject`, `event.email.fromAddress`, `event.email.recipients`.
|
|
141
|
-
|
|
142
|
-
### 7. SMS (`@theokit/gateway-sms`)
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
pnpm add @theokit/gateway-sms @theokit/gateway
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Backends: `"twilio"`, `"plivo"`, `"vonage"`. Inbound via webhook server.
|
|
149
|
-
|
|
150
|
-
Platform-specific: `event.sms.backend`, `event.sms.from` (E.164), `event.sms.to` (E.164).
|
|
151
|
-
|
|
152
|
-
### 8. Mattermost (`@theokit/gateway-mattermost`)
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
pnpm add @theokit/gateway-mattermost @theokit/gateway
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
Platform-specific: `event.mattermost.postId`, `event.mattermost.channelId`, `event.mattermost.rootId?`.
|
|
159
|
-
|
|
160
|
-
### 9. LINE (`@theokit/gateway-line`)
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
pnpm add @theokit/gateway-line @theokit/gateway
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Inbound via webhook with signature verification. Reply tokens are cached (one-shot, 60s TTL).
|
|
167
|
-
|
|
168
|
-
Platform-specific: `event.line.sourceType`, `event.line.sourceId`, `event.line.messageId`.
|
|
169
|
-
|
|
170
|
-
### 10. Matrix (`@theokit/gateway-matrix`)
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
pnpm add @theokit/gateway-matrix @theokit/gateway matrix-js-sdk
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Platform-specific: `event.matrix.roomId`, `event.matrix.eventId`, `event.matrix.memberCount`.
|
|
177
|
-
|
|
178
|
-
## Common usage pattern
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
import { Agent } from "@theokit/sdk";
|
|
182
|
-
|
|
183
|
-
const adapter = new TelegramAdapter({ botToken: process.env.TELEGRAM_BOT_TOKEN! });
|
|
184
|
-
await adapter.connect();
|
|
185
|
-
|
|
186
|
-
adapter.onInbound(async (event) => {
|
|
187
|
-
const agent = await Agent.getOrCreate(`${event.platform}-${event.sender.id}`, {
|
|
188
|
-
apiKey: process.env.THEOKIT_API_KEY!,
|
|
189
|
-
model: { id: "google/gemini-2.0-flash-001" },
|
|
190
|
-
local: { cwd: process.cwd() },
|
|
191
|
-
memory: { enabled: true, namespace: "bot", scope: "user", userId: event.sender.id },
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
await adapter.startTyping(event.channel.id);
|
|
195
|
-
const run = await agent.send(event.text);
|
|
196
|
-
const result = await run.wait();
|
|
197
|
-
await adapter.stopTyping(event.channel.id);
|
|
198
|
-
|
|
199
|
-
await adapter.sendMessage({
|
|
200
|
-
channel: event.channel,
|
|
201
|
-
text: result.result ?? "No response.",
|
|
202
|
-
replyTo: event.id,
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
## Error mapping convention
|
|
208
|
-
|
|
209
|
-
Each adapter maps platform errors to canonical `SendResult.error.code` values: `rate_limit`, `channel_not_found`, `no_permission`, `auth_error`, `message_too_long`, `platform_error`.
|