@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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { m as MemoryFact, j as MemoryAdapter, S as SDKAgent, l as MemoryContext, D as SystemPromptSkillRef, C as ContextSettings, P as ProviderRoutingSettings, a as PluginsSettings } from './sdk-agent-D8qJVkuV.js';
|
|
2
|
+
import { C as CustomTool, c as PermissionMode, M as ModelSelection, a as McpServerConfig, P as Processor } from './run-BYSHf58D.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `SessionRecord` — the native on-disk transcript record shape (SE40).
|
|
@@ -15,7 +15,6 @@ import * as zod from 'zod';
|
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
/** One transcript record (one JSONL line). `message` absent on `system` (compact_boundary) records. */
|
|
19
18
|
/** A content block inside {@link TranscriptMessage}. */
|
|
20
19
|
type TranscriptBlock = {
|
|
21
20
|
type: "text";
|
|
@@ -60,6 +59,24 @@ interface TranscriptMessage {
|
|
|
60
59
|
type?: "message";
|
|
61
60
|
model?: string;
|
|
62
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* One transcript record — a single line of the session JSONL file, and the unit the pluggable
|
|
64
|
+
* `SessionStore` seam reads and writes.
|
|
65
|
+
*
|
|
66
|
+
* Records form a `uuid`/`parentUuid` DAG, not a flat list: `parentUuid` names the preceding record
|
|
67
|
+
* and is `null` at the root. Thread a session by following those links; a reader that assumes file
|
|
68
|
+
* order is linear will mis-thread one that branched.
|
|
69
|
+
*
|
|
70
|
+
* `message` is absent on `system` records — a compaction boundary carries `compactMetadata` instead —
|
|
71
|
+
* so it is optional even on records you would expect to be conversational, and `type` is what tells
|
|
72
|
+
* you which you are holding.
|
|
73
|
+
*
|
|
74
|
+
* Reading is deliberately tolerant: a malformed line is skipped rather than failing the whole read.
|
|
75
|
+
* Every record you receive is well-formed, but the file may have contained more than you got back,
|
|
76
|
+
* so this is not the type to use for an exact-count audit of what was written.
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
63
80
|
interface SessionRecord {
|
|
64
81
|
type: "user" | "assistant" | "system";
|
|
65
82
|
uuid: string;
|
|
@@ -144,182 +161,6 @@ interface SessionStore {
|
|
|
144
161
|
appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void>;
|
|
145
162
|
}
|
|
146
163
|
|
|
147
|
-
/**
|
|
148
|
-
* Public `MemoryAdapter` contract (T1.1, ADRs D141 / D147).
|
|
149
|
-
*
|
|
150
|
-
* The plugin extension point `{ kind: "memory" }` (ADR D98) declares a
|
|
151
|
-
* `createProvider` factory; this file types its return value formally.
|
|
152
|
-
* Adapters implement `write` / `recall` / `delete` plus optional methods
|
|
153
|
-
* gated by `capabilities`. `MemoryId` is a branded string prefixed with
|
|
154
|
-
* the adapter id so cross-adapter use throws on `extractRawId` (EC-B).
|
|
155
|
-
*
|
|
156
|
-
* Each provider-specific package (`@theokit-memory-supermemory`, etc)
|
|
157
|
-
* exports a factory returning a `Plugin { kind: "memory" }` whose
|
|
158
|
-
* `createProvider` resolves to a `MemoryAdapter` instance.
|
|
159
|
-
*
|
|
160
|
-
* @public
|
|
161
|
-
*/
|
|
162
|
-
/**
|
|
163
|
-
* Branded provider memory ID. Format: `${adapterId}:${rawProviderId}`.
|
|
164
|
-
* Use `mkMemoryId` / `extractRawId` from `../memory-adapter-helpers.js`
|
|
165
|
-
* to construct and unwrap with cross-adapter safety (EC-B).
|
|
166
|
-
*
|
|
167
|
-
* @public
|
|
168
|
-
*/
|
|
169
|
-
type MemoryId = string & {
|
|
170
|
-
readonly __brand: "MemoryId";
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Portable identity context. `userId` is the only required field —
|
|
174
|
-
* the lowest common denominator across Supermemory / Honcho / Mem0.
|
|
175
|
-
* Adapter implementations translate the optional fields to their
|
|
176
|
-
* provider's native primitives (Honcho session, Mem0 run_id, etc).
|
|
177
|
-
*
|
|
178
|
-
* @public
|
|
179
|
-
*/
|
|
180
|
-
interface MemoryContext {
|
|
181
|
-
/** End-user identity. */
|
|
182
|
-
userId: string;
|
|
183
|
-
/** Agent / persona writing the memory. */
|
|
184
|
-
agentId?: string;
|
|
185
|
-
/** Logical conversation / run boundary. */
|
|
186
|
-
sessionId?: string;
|
|
187
|
-
/** Tenant / workspace partition. */
|
|
188
|
-
tenantId?: string;
|
|
189
|
-
/** Free-form tags for filtering / categorization. */
|
|
190
|
-
tags?: string[];
|
|
191
|
-
/** Provider-passthrough metadata. */
|
|
192
|
-
metadata?: Record<string, unknown>;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* A single memory fact returned by `recall` or `get`.
|
|
196
|
-
*
|
|
197
|
-
* @public
|
|
198
|
-
*/
|
|
199
|
-
interface MemoryFact {
|
|
200
|
-
id: MemoryId;
|
|
201
|
-
content: string;
|
|
202
|
-
/** Semantic relevance score (provider-defined scale) when result of `recall`. */
|
|
203
|
-
score?: number;
|
|
204
|
-
/** ISO 8601 timestamp of creation. */
|
|
205
|
-
createdAt?: string;
|
|
206
|
-
metadata?: Record<string, unknown>;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Versioned snapshot of a memory's history. Only emitted by providers
|
|
210
|
-
* with `capabilities.history === true` (Mem0 today).
|
|
211
|
-
*
|
|
212
|
-
* @public
|
|
213
|
-
*/
|
|
214
|
-
interface MemoryRevision {
|
|
215
|
-
id: MemoryId;
|
|
216
|
-
content: string;
|
|
217
|
-
version: number;
|
|
218
|
-
changedAt: string;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Statically declared adapter feature flags. Consumers feature-detect
|
|
222
|
-
* at compile time via `if (adapter.capabilities.history)`.
|
|
223
|
-
*
|
|
224
|
-
* @public
|
|
225
|
-
*/
|
|
226
|
-
interface MemoryAdapterCapabilities {
|
|
227
|
-
/** Returns prior versions of a memory via `history(id)`. */
|
|
228
|
-
history: boolean;
|
|
229
|
-
/** First-class `sessionId` scoping. */
|
|
230
|
-
sessions: boolean;
|
|
231
|
-
/** First-class `tenantId` scoping. */
|
|
232
|
-
tenancy: boolean;
|
|
233
|
-
/** Provider performs reasoning over memory (e.g., Honcho dialectic). */
|
|
234
|
-
reasoning: boolean;
|
|
235
|
-
/** Exposes LLM-callable function-calling schemas. */
|
|
236
|
-
toolSchemas: boolean;
|
|
237
|
-
/** Supports background prefetch (currently informational). */
|
|
238
|
-
prefetch: boolean;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* One assistant-turn message in the canonical `{role, content}` shape
|
|
242
|
-
* an adapter may receive instead of a flat string when writing a turn.
|
|
243
|
-
*
|
|
244
|
-
* @public
|
|
245
|
-
*/
|
|
246
|
-
interface MemoryTurnMessage {
|
|
247
|
-
role: "user" | "assistant" | "system";
|
|
248
|
-
content: string;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* OpenAI-format function-calling schema exposed to the LLM.
|
|
252
|
-
*
|
|
253
|
-
* @public
|
|
254
|
-
*/
|
|
255
|
-
interface MemoryToolSchema {
|
|
256
|
-
name: string;
|
|
257
|
-
description: string;
|
|
258
|
-
parameters: Record<string, unknown>;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Portable third-party memory adapter contract. Implementations live
|
|
262
|
-
* in `@theokit-memory-*` packages; the SDK never imports them.
|
|
263
|
-
*
|
|
264
|
-
* @public
|
|
265
|
-
*/
|
|
266
|
-
interface MemoryAdapter {
|
|
267
|
-
/** Short identifier — matches the `${adapterId}` prefix in `MemoryId`. */
|
|
268
|
-
readonly id: string;
|
|
269
|
-
readonly capabilities: MemoryAdapterCapabilities;
|
|
270
|
-
/** Synchronous availability probe — no network, no I/O. */
|
|
271
|
-
isAvailable(): boolean;
|
|
272
|
-
/** One-shot initialization. Idempotent: safe to call multiple times. */
|
|
273
|
-
initialize?(): Promise<void>;
|
|
274
|
-
/**
|
|
275
|
-
* Persist a fact or full turn to memory. Returns the stored
|
|
276
|
-
* `MemoryId`. Throws `MemoryAdapterError(code: "invalid_input")` on
|
|
277
|
-
* empty content or invalid identifiers in `ctx`.
|
|
278
|
-
*/
|
|
279
|
-
write(content: string | MemoryTurnMessage[], ctx: MemoryContext): Promise<MemoryId>;
|
|
280
|
-
/**
|
|
281
|
-
* Semantic recall — top-`k` facts ordered by relevance. Returns
|
|
282
|
-
* empty array when `k === 0` or no matches.
|
|
283
|
-
*/
|
|
284
|
-
recall(query: string, ctx: MemoryContext, k?: number): Promise<MemoryFact[]>;
|
|
285
|
-
/**
|
|
286
|
-
* Delete a memory by id. Throws `MemoryAdapterError(code:
|
|
287
|
-
* "invalid_input")` when the id was minted by a different adapter
|
|
288
|
-
* (EC-B). Throws `code: "not_found"` when the id does not exist.
|
|
289
|
-
*/
|
|
290
|
-
delete(id: MemoryId): Promise<void>;
|
|
291
|
-
list?(ctx: MemoryContext, opts?: {
|
|
292
|
-
cursor?: string;
|
|
293
|
-
limit?: number;
|
|
294
|
-
}): AsyncIterable<MemoryFact>;
|
|
295
|
-
get?(id: MemoryId): Promise<MemoryFact | null>;
|
|
296
|
-
history?(id: MemoryId): Promise<MemoryRevision[]>;
|
|
297
|
-
/** Empty array when `capabilities.toolSchemas === false`. */
|
|
298
|
-
getToolSchemas?(): MemoryToolSchema[];
|
|
299
|
-
handleToolCall?(name: string, args: Record<string, unknown>, ctx: MemoryContext): Promise<string>;
|
|
300
|
-
/** Graceful shutdown — flush queues, close connections. */
|
|
301
|
-
shutdown?(): Promise<void>;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Direct memory API exposed on `SDKAgent.memory`. Resolves to whichever
|
|
305
|
-
* memory adapter(s) are registered via `Agent.create({ plugins: [...] })`.
|
|
306
|
-
*
|
|
307
|
-
* @public
|
|
308
|
-
*/
|
|
309
|
-
interface AgentMemory {
|
|
310
|
-
/**
|
|
311
|
-
* Persist a fact. Returns the first adapter's id; in multi-adapter
|
|
312
|
-
* setups all adapters receive the write (fan-out).
|
|
313
|
-
*/
|
|
314
|
-
write(content: string | MemoryTurnMessage[], ctx?: Partial<MemoryContext>): Promise<MemoryId>;
|
|
315
|
-
/** Semantic recall — merged + deduped across registered adapters. */
|
|
316
|
-
recall(query: string, ctx?: Partial<MemoryContext>, k?: number): Promise<MemoryFact[]>;
|
|
317
|
-
/** Delete a memory by id — routes to the owning adapter via prefix. */
|
|
318
|
-
delete(id: MemoryId): Promise<void>;
|
|
319
|
-
/** Returns the first registered adapter or `null` when none exists. */
|
|
320
|
-
adapter(): MemoryAdapter | null;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
164
|
/**
|
|
324
165
|
* A discovered skill's metadata. The skill BODY is never included — only the
|
|
325
166
|
* strict frontmatter fields plus the resolved `source` path.
|
|
@@ -453,665 +294,6 @@ interface BudgetTracker {
|
|
|
453
294
|
nextIteration?(): void;
|
|
454
295
|
}
|
|
455
296
|
|
|
456
|
-
/**
|
|
457
|
-
* Context manager backend.
|
|
458
|
-
*
|
|
459
|
-
* - `"file"` — Read `.theokit/context.json` from the workspace (local) or the
|
|
460
|
-
* cloned repo (cloud).
|
|
461
|
-
*
|
|
462
|
-
* @public
|
|
463
|
-
*/
|
|
464
|
-
type ContextManagerKind = "file";
|
|
465
|
-
/**
|
|
466
|
-
* Context configuration accepted by `Agent.create()` via {@link AgentOptions.context}.
|
|
467
|
-
*
|
|
468
|
-
* @public
|
|
469
|
-
*/
|
|
470
|
-
interface ContextSettings {
|
|
471
|
-
/** Which backend reads context. Defaults to `"file"`. */
|
|
472
|
-
manager?: ContextManagerKind;
|
|
473
|
-
/** Hard cap on tokens emitted into the agent's system prompt. */
|
|
474
|
-
maxTokens?: number;
|
|
475
|
-
/**
|
|
476
|
-
* Per-file truncation cap in characters. Default 40_000 (~10k tokens).
|
|
477
|
-
* Larger files are truncated with 70%/20% head/tail + marker (ADR D155).
|
|
478
|
-
*
|
|
479
|
-
* @public
|
|
480
|
-
*/
|
|
481
|
-
maxBytesPerFile?: number;
|
|
482
|
-
/**
|
|
483
|
-
* Aggregate cap across all context files in characters. Default 120_000.
|
|
484
|
-
* When total exceeds this, lower-priority sources are dropped (ADR D155).
|
|
485
|
-
*
|
|
486
|
-
* Note: context snapshot is **refresh-time** (EC-T); modifying context
|
|
487
|
-
* files mid-flight does not auto-update. Call `agent.reload()` to pick
|
|
488
|
-
* up changes.
|
|
489
|
-
*
|
|
490
|
-
* @public
|
|
491
|
-
*/
|
|
492
|
-
maxBytesTotal?: number;
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Inclusion state of a single context source in a {@link ContextSnapshot}.
|
|
496
|
-
*
|
|
497
|
-
* @public
|
|
498
|
-
*/
|
|
499
|
-
type ContextSourceStatus = "included" | "excluded" | "summarized";
|
|
500
|
-
/**
|
|
501
|
-
* A single context source resolved by the context manager.
|
|
502
|
-
*
|
|
503
|
-
* @public
|
|
504
|
-
*/
|
|
505
|
-
interface ContextSource {
|
|
506
|
-
/** Stable identifier — usually the filename without extension. */
|
|
507
|
-
name: string;
|
|
508
|
-
/** Path relative to the workspace root, when applicable. */
|
|
509
|
-
path?: string;
|
|
510
|
-
/** Whether the source was included, dropped, or summarized to fit the budget. */
|
|
511
|
-
status: ContextSourceStatus;
|
|
512
|
-
/** Free-text reason when `status !== "included"`. */
|
|
513
|
-
reason?: string;
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
* Token budget used by the context manager for a single agent.
|
|
517
|
-
*
|
|
518
|
-
* @public
|
|
519
|
-
*/
|
|
520
|
-
interface ContextBudget {
|
|
521
|
-
maxTokens?: number;
|
|
522
|
-
/**
|
|
523
|
-
* Either a token count or a list of token strings extracted from source
|
|
524
|
-
* content. Normalized to `<tokens>` in golden comparisons.
|
|
525
|
-
*/
|
|
526
|
-
usedTokens?: number | string[];
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Result of `agent.context.snapshot()`. Public and secret-free by design — safe
|
|
530
|
-
* to log and persist. Raw secrets, local absolute paths, and exact token values
|
|
531
|
-
* are never present.
|
|
532
|
-
*
|
|
533
|
-
* @public
|
|
534
|
-
*/
|
|
535
|
-
interface ContextSnapshot {
|
|
536
|
-
runtime: "local" | "cloud";
|
|
537
|
-
sources: ContextSource[];
|
|
538
|
-
budget?: ContextBudget;
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Public context manager handle exposed as `agent.context`.
|
|
542
|
-
*
|
|
543
|
-
* @public
|
|
544
|
-
*/
|
|
545
|
-
interface SDKContextManager {
|
|
546
|
-
/** Inspect what the context manager actually loaded for the agent. */
|
|
547
|
-
snapshot(): Promise<ContextSnapshot>;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Fork primitive public type contracts (T1.2, ADRs D110-D114).
|
|
552
|
-
*
|
|
553
|
-
* Extracted into a leaf type module (arch-review ADR 0001) so the public
|
|
554
|
-
* `types/agent.ts` barrel can reference `ForkOptions`/`ForkResult` without
|
|
555
|
-
* importing the `internal/runtime/lifecycle/fork-agent.ts` implementation — which in
|
|
556
|
-
* turn imports back from `types/agent.ts`. That mutual reference created a
|
|
557
|
-
* type-only `madge` cycle. These interfaces are self-contained (no SDKAgent
|
|
558
|
-
* / AgentOptions references), so co-locating them here breaks the cycle with
|
|
559
|
-
* no runtime change. `fork-agent.ts` re-exports them for back-compat.
|
|
560
|
-
*/
|
|
561
|
-
/**
|
|
562
|
-
* Caller-supplied fork configuration. See `forkAgentImpl`.
|
|
563
|
-
*
|
|
564
|
-
* @public
|
|
565
|
-
*/
|
|
566
|
-
interface ForkOptions {
|
|
567
|
-
/**
|
|
568
|
-
* Tool subset visible to the fork. Names must match the canonical (post-repair)
|
|
569
|
-
* tool name — typically lowercase. Tools not in this set return a `tool_result`
|
|
570
|
-
* with `"Tool blocked by fork whitelist"` content (EC-H).
|
|
571
|
-
*/
|
|
572
|
-
allowedTools: Set<string>;
|
|
573
|
-
/** Task prompt sent to the fork. */
|
|
574
|
-
prompt: string;
|
|
575
|
-
/** Override system prompt. Default: byte-identical inheritance from parent (D112). */
|
|
576
|
-
systemPrompt?: string;
|
|
577
|
-
/** Memory write provenance tag (D114). Default `"fork"`. */
|
|
578
|
-
forkOrigin?: string;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Outcome of a fork run.
|
|
582
|
-
*
|
|
583
|
-
* @public
|
|
584
|
-
*/
|
|
585
|
-
interface ForkResult {
|
|
586
|
-
/** Final agent response text (`undefined` when the fork produced no result). */
|
|
587
|
-
result: string | undefined;
|
|
588
|
-
/** Tool calls executed inside the fork. */
|
|
589
|
-
toolCalls: ReadonlyArray<{
|
|
590
|
-
name: string;
|
|
591
|
-
input: Record<string, unknown>;
|
|
592
|
-
}>;
|
|
593
|
-
/** Aggregate token usage reported by the run. */
|
|
594
|
-
usage: {
|
|
595
|
-
inputTokens: number;
|
|
596
|
-
outputTokens: number;
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
/**
|
|
601
|
-
* M80 — the terminal verdicts a judge can return.
|
|
602
|
-
*
|
|
603
|
-
* `"blocked"` was added here in this milestone. `GoalResult.status` already carried it, but the
|
|
604
|
-
* judge had no way to EMIT it: its vocabulary was `done | continue | skipped`, so facing a real
|
|
605
|
-
* blocker it could only say `continue` — and the loop repeated the same turn until it blew the
|
|
606
|
-
* budget, reporting `failed` on a limit rather than `blocked` on impossibility. Two different causes
|
|
607
|
-
* with the same visible outcome.
|
|
608
|
-
*
|
|
609
|
-
* @public
|
|
610
|
-
*/
|
|
611
|
-
type Verdict = "done" | "continue" | "skipped" | "blocked";
|
|
612
|
-
/**
|
|
613
|
-
* M80 — the result of a judge call, now public.
|
|
614
|
-
*
|
|
615
|
-
* It was `internal/`, so a consumer wanting to type the return — to react to `blocked` without a
|
|
616
|
-
* magic string — had to redeclare the shape. It is the same duplication M78 closed for the error
|
|
617
|
-
* hierarchy: without a public surface, reimplementing is the only legal way out for anyone behind
|
|
618
|
-
* the layer boundary.
|
|
619
|
-
*
|
|
620
|
-
* @public
|
|
621
|
-
*/
|
|
622
|
-
interface JudgeResult {
|
|
623
|
-
verdict: Verdict;
|
|
624
|
-
reason: string;
|
|
625
|
-
/**
|
|
626
|
-
* `true` when the text did not start with one of the canonical prefixes. The verdict becomes
|
|
627
|
-
* `"continue"` (fail-safe) so the loop does not stop too early; the caller counts consecutive
|
|
628
|
-
* failures and gives up via `maxConsecutiveJudgeFailures`.
|
|
629
|
-
*/
|
|
630
|
-
parseFailed: boolean;
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* Public event types emitted by {@link SDKAgent.runUntil} (ADRs D115-D117).
|
|
634
|
-
*
|
|
635
|
-
* Discriminated union by `type` field so consumers can `switch (event.type)`
|
|
636
|
-
* with full TypeScript exhaustiveness. Mirrors the
|
|
637
|
-
* {@link import("../stream-object.js").StreamObjectEvent} pattern (ADR D39).
|
|
638
|
-
*
|
|
639
|
-
* @public
|
|
640
|
-
*/
|
|
641
|
-
/**
|
|
642
|
-
* Single event emitted while iterating a goal-driven loop. Five variants:
|
|
643
|
-
*
|
|
644
|
-
* - `turn_start` — the agent is about to invoke `send()`. Emitted once
|
|
645
|
-
* per turn.
|
|
646
|
-
* - `agent_response` — the agent's `send()` resolved; carries the text
|
|
647
|
-
* reply.
|
|
648
|
-
* - `judge_verdict` — the auxiliary judge model evaluated the response.
|
|
649
|
-
* `parseFailed: true` indicates the judge returned a malformed reply
|
|
650
|
-
* (fail-safe verdict = `continue`, see ADR D121).
|
|
651
|
-
* - `continuation` — the judge ruled `continue`; carries the prompt that
|
|
652
|
-
* was sent on THIS turn (i.e., the input that produced the agent
|
|
653
|
-
* response just yielded). Useful for consumers who want to audit the
|
|
654
|
-
* exact continuation message that drove each iteration. The prompt
|
|
655
|
-
* for the NEXT turn is composed lazily at the start of that turn
|
|
656
|
-
* from the latest `agent_response.content`.
|
|
657
|
-
* - `status_change` — transition of the overall goal state. Always
|
|
658
|
-
* emitted once at start (`active`) and once at end
|
|
659
|
-
* (`completed | failed | paused`).
|
|
660
|
-
*
|
|
661
|
-
* @public
|
|
662
|
-
*/
|
|
663
|
-
type GoalEvent = {
|
|
664
|
-
type: "turn_start";
|
|
665
|
-
turn: number;
|
|
666
|
-
goal: string;
|
|
667
|
-
} | {
|
|
668
|
-
type: "agent_response";
|
|
669
|
-
turn: number;
|
|
670
|
-
content: string;
|
|
671
|
-
} | {
|
|
672
|
-
type: "judge_verdict";
|
|
673
|
-
turn: number;
|
|
674
|
-
/** M80 — `"blocked"` was added: the judge can declare impossibility, not just "continue". */
|
|
675
|
-
verdict: "done" | "continue" | "skipped" | "blocked";
|
|
676
|
-
reason: string;
|
|
677
|
-
parseFailed: boolean;
|
|
678
|
-
} | {
|
|
679
|
-
type: "continuation";
|
|
680
|
-
turn: number;
|
|
681
|
-
prompt: string;
|
|
682
|
-
} | {
|
|
683
|
-
type: "status_change";
|
|
684
|
-
status: "active" | "paused" | "completed" | "failed" | "budget_limited" | "blocked";
|
|
685
|
-
reason: string;
|
|
686
|
-
};
|
|
687
|
-
/**
|
|
688
|
-
* Return value of the `runUntil` async generator. Consumer reads via
|
|
689
|
-
* `const { value } = await gen.next()` (when `done: true`).
|
|
690
|
-
*
|
|
691
|
-
* @public
|
|
692
|
-
*/
|
|
693
|
-
interface GoalResult {
|
|
694
|
-
status: "completed" | "failed" | "paused" | "budget_limited" | "blocked";
|
|
695
|
-
turnsUsed: number;
|
|
696
|
-
/** M55 — tokens summed across the loop (0 when `usage` was absent — fail-open). */
|
|
697
|
-
tokensUsed: number;
|
|
698
|
-
finalResponse: string | undefined;
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* Return type of {@link import("../internal/local-agent/local-agent.js").LocalAgent.runUntil}.
|
|
702
|
-
* Extracted so the LocalAgent method signature stays a single line (G8 LoC budget).
|
|
703
|
-
*
|
|
704
|
-
* @public
|
|
705
|
-
*/
|
|
706
|
-
type RunUntilIterator = AsyncGenerator<GoalEvent, GoalResult, void>;
|
|
707
|
-
/**
|
|
708
|
-
* Per-call configuration for `Agent.runUntil`.
|
|
709
|
-
*
|
|
710
|
-
* @public
|
|
711
|
-
*/
|
|
712
|
-
interface GoalOptions {
|
|
713
|
-
/** Hard cap on iterations (safety net against runaway). Default `20`. */
|
|
714
|
-
maxTurns?: number;
|
|
715
|
-
/**
|
|
716
|
-
* M55 — token budget (Codex ext/goal parity, tool.rs:454-465). Sums `run.wait().usage.totalTokens`
|
|
717
|
-
* per turn; on crossing it, the loop stops with status `budget_limited`. Omitted => unlimited (only
|
|
718
|
-
* maxTurns). A missing `usage` never blows the budget (fail-open).
|
|
719
|
-
*/
|
|
720
|
-
tokenBudget?: number;
|
|
721
|
-
/** Bail after N consecutive judge parse failures. Default `3` (ADR D121). */
|
|
722
|
-
maxConsecutiveJudgeFailures?: number;
|
|
723
|
-
/** Judge model identifier. Default `"openai/gpt-4o-mini"` (ADR D119). */
|
|
724
|
-
judgeModel?: string;
|
|
725
|
-
/** Override env for the judge auxiliary agent. Default `OPENROUTER_API_KEY` (EC-A). */
|
|
726
|
-
judgeApiKey?: string;
|
|
727
|
-
/**
|
|
728
|
-
* M80 — the model of the DRIVEN agent, the basis for deriving the judge when `judgeModel` is
|
|
729
|
-
* omitted.
|
|
730
|
-
*
|
|
731
|
-
* It exists because the fixed default (`openai/gpt-4o-mini`) only resolves on OpenRouter: an
|
|
732
|
-
* Anthropic key gives 404, an OAuth bearer gives 401, and the goal burned 3 turns before failing
|
|
733
|
-
* with a misleading reason. A judge running on the chat's own model works wherever chat works.
|
|
734
|
-
*/
|
|
735
|
-
agentModel?: string;
|
|
736
|
-
/** Optional subgoals fed to the judge prompt. */
|
|
737
|
-
subgoals?: string[];
|
|
738
|
-
/**
|
|
739
|
-
* Cancel mid-loop via `AbortController.signal`. The generator yields
|
|
740
|
-
* a `status_change: paused` event and returns at the next turn
|
|
741
|
-
* boundary (ADR D117).
|
|
742
|
-
*/
|
|
743
|
-
signal?: AbortSignal;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
/**
|
|
747
|
-
* Capability slot a provider can fulfill.
|
|
748
|
-
*
|
|
749
|
-
* @public
|
|
750
|
-
*/
|
|
751
|
-
type ProviderCapability = "chat" | "web_search" | "image" | "embedding";
|
|
752
|
-
/**
|
|
753
|
-
* A single user-declared routing rule. Maps a capability to a provider, and
|
|
754
|
-
* optionally pins a specific model.
|
|
755
|
-
*
|
|
756
|
-
* @public
|
|
757
|
-
*/
|
|
758
|
-
interface ProviderRoute {
|
|
759
|
-
capability: ProviderCapability;
|
|
760
|
-
provider: string;
|
|
761
|
-
model?: string;
|
|
762
|
-
/**
|
|
763
|
-
* Opt-in leaked-dialect safe-parse for this route's provider (theokit#58
|
|
764
|
-
* follow-up). When `true`, a `chat_completions` finish that carries ZERO
|
|
765
|
-
* native `tool_calls` has its assistant text scanned for the Hermes
|
|
766
|
-
* `<function=…></tool_call>` dialect, and any recovered calls are surfaced as
|
|
767
|
-
* real `tool_calls` so the loop executes them — for models (qwen3-coder via
|
|
768
|
-
* OpenRouter) that intermittently leak tool calls as text. Default `false`;
|
|
769
|
-
* fail-open (a partial/unclosed block never fabricates a call). Scoped to the
|
|
770
|
-
* resolved chat chain, so a non-leaking route is unaffected.
|
|
771
|
-
*/
|
|
772
|
-
extractToolCallsFromContent?: boolean;
|
|
773
|
-
}
|
|
774
|
-
/**
|
|
775
|
-
* Provider routing configuration accepted by `Agent.create()` via
|
|
776
|
-
* {@link AgentOptions.providers}.
|
|
777
|
-
*
|
|
778
|
-
* @public
|
|
779
|
-
*/
|
|
780
|
-
interface ProviderRoutingSettings {
|
|
781
|
-
/** Explicit `{ capability → provider }` map. First match wins per capability. */
|
|
782
|
-
routes: ProviderRoute[];
|
|
783
|
-
/** Provider names to try in order when a route has no provider available. */
|
|
784
|
-
fallback?: string[];
|
|
785
|
-
/**
|
|
786
|
-
* Multiple API keys per provider for same-provider key rotation
|
|
787
|
-
* (credential pool — ADRs D123-D133). When a key hits HTTP 429, 402,
|
|
788
|
-
* or 401, the SDK rotates to the next entry transparently before
|
|
789
|
-
* falling back to a different provider.
|
|
790
|
-
*
|
|
791
|
-
* Example:
|
|
792
|
-
* ```ts
|
|
793
|
-
* apiKeys: { openrouter: ["sk-or-...", "sk-or-..."], anthropic: ["..."] }
|
|
794
|
-
* ```
|
|
795
|
-
*
|
|
796
|
-
* Empty arrays and empty strings are filtered out. If a provider has
|
|
797
|
-
* exactly 1 effective key, the pool is transparent (no rotation behavior).
|
|
798
|
-
*
|
|
799
|
-
* Conflicts with the single-key shape `AgentOptions.apiKey: "..."` —
|
|
800
|
-
* use one OR the other, not both.
|
|
801
|
-
*
|
|
802
|
-
* @public
|
|
803
|
-
*/
|
|
804
|
-
apiKeys?: Record<string, string[]>;
|
|
805
|
-
/**
|
|
806
|
-
* Rotation strategy per provider for the credential pool. Default is
|
|
807
|
-
* `"fill_first"` (use entries[0] until exhausted). Only consulted when
|
|
808
|
-
* `apiKeys[provider]` has ≥2 entries.
|
|
809
|
-
*
|
|
810
|
-
* @public
|
|
811
|
-
*/
|
|
812
|
-
credentialPoolStrategy?: Record<string, "fill_first" | "round_robin" | "least_used" | "random">;
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Plugins configuration accepted by `Agent.create()` via
|
|
816
|
-
* {@link AgentOptions.plugins}.
|
|
817
|
-
*
|
|
818
|
-
* @public
|
|
819
|
-
*/
|
|
820
|
-
interface PluginsSettings {
|
|
821
|
-
/** Plugin names to enable. Plugin discovery is plugin-provider specific. */
|
|
822
|
-
enabled?: string[];
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Resolved routing decision returned by `agent.providers.routes()`. Public and
|
|
826
|
-
* secret-free by design — safe to log.
|
|
827
|
-
*
|
|
828
|
-
* @public
|
|
829
|
-
*/
|
|
830
|
-
interface ResolvedProviderRoute {
|
|
831
|
-
capability: string;
|
|
832
|
-
provider: string;
|
|
833
|
-
model?: string;
|
|
834
|
-
/** Why the runtime picked this provider (e.g. `"explicit-model-provider"`). */
|
|
835
|
-
reason: string;
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Public providers manager handle exposed as `agent.providers`.
|
|
839
|
-
*
|
|
840
|
-
* @public
|
|
841
|
-
*/
|
|
842
|
-
interface SDKProvidersManager {
|
|
843
|
-
/** Inspect which provider serves each capability for this agent. */
|
|
844
|
-
routes(): Promise<ResolvedProviderRoute[]>;
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* Provider catalog entry returned by `Theokit.providers.list()`.
|
|
848
|
-
*
|
|
849
|
-
* @public
|
|
850
|
-
*/
|
|
851
|
-
interface SDKProvider {
|
|
852
|
-
name: string;
|
|
853
|
-
displayName: string;
|
|
854
|
-
capabilities: string[];
|
|
855
|
-
isAvailable: boolean;
|
|
856
|
-
/** JSON Schema describing the env vars / fields needed to enable this provider. */
|
|
857
|
-
setupSchema: object;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* Public skill metadata exposed to the system-prompt resolver. Mirrors the
|
|
862
|
-
* shape returned by `agent.skills.list()` — name + description only, never
|
|
863
|
-
* full skill bodies.
|
|
864
|
-
*
|
|
865
|
-
* @public
|
|
866
|
-
*/
|
|
867
|
-
interface SystemPromptSkillRef {
|
|
868
|
-
name: string;
|
|
869
|
-
description: string;
|
|
870
|
-
}
|
|
871
|
-
/**
|
|
872
|
-
* A skill resolved WITH its body, returned by {@link SDKAgentSkills.get}. Unlike
|
|
873
|
-
* {@link SystemPromptSkillRef} (name + description only), this carries the full
|
|
874
|
-
* `instructions` — read from the SKILL.md for filesystem skills or the inline
|
|
875
|
-
* `createSkill` body. @public
|
|
876
|
-
*/
|
|
877
|
-
interface SDKAgentSkillDetail {
|
|
878
|
-
name: string;
|
|
879
|
-
description: string;
|
|
880
|
-
instructions: string;
|
|
881
|
-
/** SE21 — supporting documents bundled with the skill (filename → content), when present. */
|
|
882
|
-
references?: Record<string, string>;
|
|
883
|
-
}
|
|
884
|
-
interface SDKAgentSkills {
|
|
885
|
-
list(): Promise<ReadonlyArray<SystemPromptSkillRef>>;
|
|
886
|
-
/**
|
|
887
|
-
* SE20 — resolve a skill by name INCLUDING its body (`instructions`). Returns
|
|
888
|
-
* `undefined` when no enabled skill matches. `list()` stays lean (name +
|
|
889
|
-
* description); full bodies come only through `get`.
|
|
890
|
-
*/
|
|
891
|
-
get(name: string): Promise<SDKAgentSkillDetail | undefined>;
|
|
892
|
-
}
|
|
893
|
-
/**
|
|
894
|
-
* Public plugin metadata returned by `agent.plugins.list()`. Mirrors the
|
|
895
|
-
* `.theokit/plugins/<name>/MANIFEST.json` allow-listed shape; never exposes
|
|
896
|
-
* raw plugin bodies, credentials, or internal hooks.
|
|
897
|
-
*
|
|
898
|
-
* @public
|
|
899
|
-
*/
|
|
900
|
-
interface SDKPluginMetadata {
|
|
901
|
-
name: string;
|
|
902
|
-
description?: string;
|
|
903
|
-
}
|
|
904
|
-
/**
|
|
905
|
-
* Public plugin listing handle exposed as `agent.plugins`. Populated when
|
|
906
|
-
* `settingSources` includes `"plugins"` OR when `plugins.enabled` is set
|
|
907
|
-
* on the agent options.
|
|
908
|
-
*
|
|
909
|
-
* @public
|
|
910
|
-
*/
|
|
911
|
-
interface SDKAgentPlugins {
|
|
912
|
-
list(): Promise<ReadonlyArray<SDKPluginMetadata>>;
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Artifact produced inside an agent's workspace. Cloud-only.
|
|
916
|
-
*
|
|
917
|
-
* @public
|
|
918
|
-
*/
|
|
919
|
-
interface SDKArtifact {
|
|
920
|
-
path: string;
|
|
921
|
-
sizeBytes: number;
|
|
922
|
-
updatedAt: string;
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* Handle returned by `Agent.create()` and `Agent.resume()`.
|
|
926
|
-
*
|
|
927
|
-
* @public
|
|
928
|
-
*/
|
|
929
|
-
interface SDKAgent {
|
|
930
|
-
readonly agentId: string;
|
|
931
|
-
readonly model: ModelSelection | undefined;
|
|
932
|
-
/**
|
|
933
|
-
* Context manager for this agent. Populated when context is enabled via
|
|
934
|
-
* {@link AgentOptions.context}. See {@link SDKContextManager}.
|
|
935
|
-
*/
|
|
936
|
-
readonly context?: SDKContextManager;
|
|
937
|
-
/**
|
|
938
|
-
* Provider routing inspector for this agent. Populated when at least one
|
|
939
|
-
* provider route is configured (via {@link AgentOptions.providers}, plugins,
|
|
940
|
-
* or model-implied providers). See {@link SDKProvidersManager}.
|
|
941
|
-
*/
|
|
942
|
-
readonly providers?: SDKProvidersManager;
|
|
943
|
-
/**
|
|
944
|
-
* Skill listing for this agent. Populated when project-scoped skills are
|
|
945
|
-
* enabled (`settingSources: ["project"]`) or when `skills.enabled` is set.
|
|
946
|
-
* See {@link SDKAgentSkills}.
|
|
947
|
-
*/
|
|
948
|
-
readonly skills?: SDKAgentSkills;
|
|
949
|
-
/**
|
|
950
|
-
* Plugin listing for this agent. Populated when project-scoped plugins are
|
|
951
|
-
* enabled (`settingSources: ["plugins"]`) or when `plugins.enabled` is set.
|
|
952
|
-
* See {@link SDKAgentPlugins}.
|
|
953
|
-
*/
|
|
954
|
-
readonly plugins?: SDKAgentPlugins;
|
|
955
|
-
send(message: string | SDKUserMessage, options?: SendOptions): Promise<Run>;
|
|
956
|
-
/**
|
|
957
|
-
* SE9 — integrated structured output. Runs the normal tool loop (the tools run
|
|
958
|
-
* first) then coerces the final answer into the `output` Zod schema, returning a
|
|
959
|
-
* validated, inferred-typed object. Sugar over `Agent.generateObject` (ADR D33).
|
|
960
|
-
*/
|
|
961
|
-
generate<T extends zod.ZodType>(message: string | SDKUserMessage, options: GenerateOptions<T>): Promise<GenerateRunResult<zod.z.infer<T>>>;
|
|
962
|
-
/** Fire-and-forget disposal. */
|
|
963
|
-
close(): void;
|
|
964
|
-
/** Re-read filesystem config (context, hooks, project MCP, subagents) without disposing. */
|
|
965
|
-
reload(): Promise<void>;
|
|
966
|
-
/**
|
|
967
|
-
* Async disposal. Idempotent — calling more than once is a no-op (per ADR D5).
|
|
968
|
-
* Prefer `await using agent = await Agent.create(...)` over explicit
|
|
969
|
-
* `dispose()` for resource safety.
|
|
970
|
-
*/
|
|
971
|
-
dispose(): Promise<void>;
|
|
972
|
-
/**
|
|
973
|
-
* `await using` support per ADR D5. Identical semantics to `dispose()` —
|
|
974
|
-
* idempotent across both surfaces.
|
|
975
|
-
*/
|
|
976
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
977
|
-
/** Cloud-only. Local returns an empty array. */
|
|
978
|
-
listArtifacts(): Promise<SDKArtifact[]>;
|
|
979
|
-
/** Cloud-only. Local throws `UnsupportedRunOperationError`. */
|
|
980
|
-
downloadArtifact(path: string): Promise<Buffer>;
|
|
981
|
-
/**
|
|
982
|
-
* Signal that prompt cache should be invalidated. By default deferred —
|
|
983
|
-
* applied at the start of the next `send()`. Pass `{ applyNow: true }` to
|
|
984
|
-
* force immediate disposal (caller must `Agent.create()` again to use).
|
|
985
|
-
*
|
|
986
|
-
* Cache invalidation is a cost regression (provider charges full price
|
|
987
|
-
* for the rebuilt cache; see ADRs D94-D95). Use sparingly and deliberately.
|
|
988
|
-
*
|
|
989
|
-
* Cloud agents: no-op (cloud runtime reconstructs state per request).
|
|
990
|
-
*
|
|
991
|
-
* @public
|
|
992
|
-
*/
|
|
993
|
-
invalidateCache?(reason: string, options?: InvalidateCacheOptions): Promise<void>;
|
|
994
|
-
/**
|
|
995
|
-
* Goal-driven Ralph loop (ADRs D115-D121). Iterates `agent.send` →
|
|
996
|
-
* judge → continuation until the auxiliary judge model returns `done`,
|
|
997
|
-
* the judge fails too many times in a row, max turns are exhausted,
|
|
998
|
-
* or the caller aborts via `AbortSignal`.
|
|
999
|
-
*
|
|
1000
|
-
* Yields {@link import("./goal-events.js").GoalEvent} per state
|
|
1001
|
-
* transition; returns a {@link import("./goal-events.js").GoalResult}
|
|
1002
|
-
* summary as the generator's final value.
|
|
1003
|
-
*
|
|
1004
|
-
* Cloud agents throw {@link import("../errors.js").UnsupportedRunOperationError}
|
|
1005
|
-
* **synchronously** (no AsyncGenerator returned) — wrap in try/catch
|
|
1006
|
-
* if you support both runtimes.
|
|
1007
|
-
*
|
|
1008
|
-
* Caveat: do not call `agent.dispose()` mid-iteration; the next `send`
|
|
1009
|
-
* propagates the disposal error through the generator to the consumer.
|
|
1010
|
-
*
|
|
1011
|
-
* @public
|
|
1012
|
-
*/
|
|
1013
|
-
runUntil?(goal?: string, options?: GoalOptions): RunUntilIterator;
|
|
1014
|
-
/**
|
|
1015
|
-
* Fork a short-lived sub-agent with parent's credentials + system
|
|
1016
|
-
* prompt byte-identical (ADR D112 — cache hit) and a restricted tool
|
|
1017
|
-
* whitelist (ADR D111 — AsyncLocalStorage isolation).
|
|
1018
|
-
*
|
|
1019
|
-
* Cloud agents throw {@link import("../errors.js").UnsupportedRunOperationError}.
|
|
1020
|
-
*
|
|
1021
|
-
* @public
|
|
1022
|
-
*/
|
|
1023
|
-
fork?(options: ForkOptions): Promise<ForkResult>;
|
|
1024
|
-
/**
|
|
1025
|
-
* Drive `send` to completion across iteration-ceiling truncations (M1 Phase 3).
|
|
1026
|
-
* When a `send` stops at the loop's iteration cap (`RunResult.stoppedAtIterationLimit`),
|
|
1027
|
-
* this re-sends a short continuation prompt — the agent's stateful session
|
|
1028
|
-
* preserves the conversation — until a genuine terminal: `done` (finished),
|
|
1029
|
-
* `step_limit` (`maxRounds` exhausted), or `no_progress` (two empty rounds).
|
|
1030
|
-
*
|
|
1031
|
-
* Local agents only. Cloud agents throw
|
|
1032
|
-
* {@link import("../errors.js").UnsupportedRunOperationError} (the cloud
|
|
1033
|
-
* runtime manages its own continuation policy server-side).
|
|
1034
|
-
*
|
|
1035
|
-
* @public
|
|
1036
|
-
*/
|
|
1037
|
-
runToCompletion?(message: string, options?: RunToCompletionOptions): Promise<RunToCompletionResult>;
|
|
1038
|
-
/**
|
|
1039
|
-
* STREAMING continuation driver (V3-4) — the streaming twin of
|
|
1040
|
-
* {@link SDKAgent.runToCompletion}. Returns an `AsyncGenerator` that yields each
|
|
1041
|
-
* round's {@link import("./messages.js").SDKMessage}s LIVE (for a UI), reusing the
|
|
1042
|
-
* same terminal policy (`done`/`step_limit`/`no_progress` + bounded re-prompt).
|
|
1043
|
-
*
|
|
1044
|
-
* The {@link import("./run.js").StreamToCompletionResult} is the generator's RETURN
|
|
1045
|
-
* value — read it via a manual `gen.next()` loop (`while (!res.done) res = await
|
|
1046
|
-
* gen.next()` → `res.value`); a plain `for await...of` consumes the yielded
|
|
1047
|
-
* messages but discards the return value.
|
|
1048
|
-
*
|
|
1049
|
-
* Local agents only. Cloud agents throw
|
|
1050
|
-
* {@link import("../errors.js").UnsupportedRunOperationError}.
|
|
1051
|
-
*
|
|
1052
|
-
* @public
|
|
1053
|
-
*/
|
|
1054
|
-
streamToCompletion?(message: string, options?: RunToCompletionOptions): AsyncGenerator<SDKMessage, StreamToCompletionResult>;
|
|
1055
|
-
/**
|
|
1056
|
-
* Direct API to third-party memory adapter(s) registered via
|
|
1057
|
-
* `plugins: [...]` (ADR D141 / D142). Returns `null` when no adapter
|
|
1058
|
-
* is registered. In multi-adapter setups `write` fans out to all;
|
|
1059
|
-
* `recall` merges + dedupes; `delete` routes by `MemoryId` prefix.
|
|
1060
|
-
*
|
|
1061
|
-
* @public
|
|
1062
|
-
*/
|
|
1063
|
-
memory?: AgentMemory;
|
|
1064
|
-
/**
|
|
1065
|
-
* Activate a personality preset for the next `send` (Hermes #26).
|
|
1066
|
-
* Reserved names `"none"`, `"default"`, and `"neutral"` clear the
|
|
1067
|
-
* active preset. Returns the resolved preset (or `null` when cleared).
|
|
1068
|
-
*
|
|
1069
|
-
* Persistence: pass `{ save: true }` to persist across process
|
|
1070
|
-
* restarts (stored under `$THEOKIT_HOME/personality.json`).
|
|
1071
|
-
*
|
|
1072
|
-
* History: by default the conversation history is preserved across
|
|
1073
|
-
* the switch. Pass `{ reset: true }` to also clear the session.
|
|
1074
|
-
*
|
|
1075
|
-
* Cloud agents throw {@link import("../errors.js").UnsupportedRunOperationError}.
|
|
1076
|
-
*
|
|
1077
|
-
* @public
|
|
1078
|
-
*/
|
|
1079
|
-
usePersonality?(name: string, opts?: {
|
|
1080
|
-
save?: boolean;
|
|
1081
|
-
reset?: boolean;
|
|
1082
|
-
}): Promise<PersonalityPreset | null>;
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Resolved personality preset surfaced via {@link SDKAgent.usePersonality}
|
|
1086
|
-
* (Hermes #26, ADRs D160-D169). Re-declared here so the public DTS bundle
|
|
1087
|
-
* never crosses the `internal/` path boundary. The implementation type in
|
|
1088
|
-
* `internal/personality/types.ts` is structurally identical.
|
|
1089
|
-
*
|
|
1090
|
-
* @public
|
|
1091
|
-
*/
|
|
1092
|
-
interface PersonalityPreset {
|
|
1093
|
-
readonly name: string;
|
|
1094
|
-
readonly description: string | undefined;
|
|
1095
|
-
readonly tools: ReadonlyArray<string> | undefined;
|
|
1096
|
-
readonly model: string | undefined;
|
|
1097
|
-
readonly tags: ReadonlyArray<string> | undefined;
|
|
1098
|
-
readonly systemPrompt: string;
|
|
1099
|
-
readonly source: "project" | "user";
|
|
1100
|
-
readonly sourcePath: string;
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* Options for {@link SDKAgent.invalidateCache}.
|
|
1104
|
-
*
|
|
1105
|
-
* @public
|
|
1106
|
-
*/
|
|
1107
|
-
interface InvalidateCacheOptions {
|
|
1108
|
-
/**
|
|
1109
|
-
* When `true`, dispose the agent immediately so caller must recreate it
|
|
1110
|
-
* to continue. Default `false` (deferred — applied on next `send()`).
|
|
1111
|
-
*/
|
|
1112
|
-
applyNow?: boolean;
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
297
|
/**
|
|
1116
298
|
* `MemoryProvider` — kernel-facing port for the memory subsystem
|
|
1117
299
|
* (SDK 2.0 Phase 1 / T1.1 — Hexagonal Architecture / Ports & Adapters,
|
|
@@ -1316,6 +498,25 @@ interface ProviderTransform {
|
|
|
1316
498
|
/** A fetch to use for this provider's requests (refresh-aware / fully provider-controlled). */
|
|
1317
499
|
fetch?(ctx: ProviderTransformContext): typeof fetch;
|
|
1318
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* A data-only declaration of an LLM provider: its name, HTTP dialect, auth style, base URL and
|
|
503
|
+
* fallback models. There is nothing to implement — the router selects the transport from `apiMode` —
|
|
504
|
+
* so any OpenAI- or Anthropic-compatible endpoint (Groq, Together, Fireworks, a private gateway)
|
|
505
|
+
* becomes a provider without new code.
|
|
506
|
+
*
|
|
507
|
+
* A profile does nothing by itself. Wrap it with `Provider.create(profile)` and pass the resulting
|
|
508
|
+
* plugin to `Agent.create({ plugins: [...] })`; from there you route to it with the `provider/model`
|
|
509
|
+
* id prefix or through `providers.routes`.
|
|
510
|
+
*
|
|
511
|
+
* `name` is the routing prefix and `aliases` adds alternatives to it. `envVars` lists the environment
|
|
512
|
+
* variables that may supply the credential, and `authType` says what kind of credential that is.
|
|
513
|
+
*
|
|
514
|
+
* Reach for `transform` only when static data genuinely is not enough — a provider that computes
|
|
515
|
+
* headers per request or refreshes its own token. Leaving it absent keeps the profile on the pure
|
|
516
|
+
* data path. If you do supply `headers`, note that they are spread AFTER the transport's own
|
|
517
|
+
* `authorization` and `content-type`, so returning either key replaces the base header rather than
|
|
518
|
+
* adding to it.
|
|
519
|
+
*/
|
|
1319
520
|
interface ProviderProfile {
|
|
1320
521
|
name: string;
|
|
1321
522
|
apiMode: ApiMode;
|
|
@@ -1350,9 +551,58 @@ interface ProviderProfile {
|
|
|
1350
551
|
* Default off — only enable for routes/models known to leak (e.g. a qwen3-coder profile variant).
|
|
1351
552
|
*/
|
|
1352
553
|
extractToolCallsFromContent?: boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Opt-in encrypted-reasoning carry for `apiMode: "responses_api"` (usetheokit/theokit-sdk#383).
|
|
556
|
+
* When `true`, the request adds `include: ["reasoning.encrypted_content"]` and
|
|
557
|
+
* `reasoning.context: "all_turns"`, and the transport replays the ciphertext the provider returned
|
|
558
|
+
* so the model does not re-derive its chain of thought on every round of a turn.
|
|
559
|
+
*
|
|
560
|
+
* Default off, and deliberately per-profile rather than per-`apiMode`: `include` is a documented
|
|
561
|
+
* Responses-API field but `reasoning.context` is not, so a provider that validates strictly
|
|
562
|
+
* answers it with `400`. Enable it only for a backend measured to accept both — the builtin
|
|
563
|
+
* `openai-chatgpt` profile is one, because issue #383 captured OpenAI Codex sending exactly these
|
|
564
|
+
* fields to that endpoint. Ignored by every other `apiMode`.
|
|
565
|
+
*/
|
|
566
|
+
encryptedReasoning?: boolean;
|
|
1353
567
|
}
|
|
1354
568
|
|
|
569
|
+
/**
|
|
570
|
+
* The fixed set of points a `"general"` plugin may attach to through `PluginContext.on`. A closed
|
|
571
|
+
* enum rather than an open string, so a plugin cannot register for a hook the loop never fires.
|
|
572
|
+
*
|
|
573
|
+
* What separates them is what the SDK does with the handler's return value, and that is the thing to
|
|
574
|
+
* settle before writing one:
|
|
575
|
+
*
|
|
576
|
+
* - `pre_tool_call` is the only VETO point. Return `{ block: true, message }` to stop the call; the
|
|
577
|
+
* first handler that blocks wins and the remaining handlers are not consulted.
|
|
578
|
+
* - `transform_tool_result` and `transform_llm_output` are CHAINED. Each handler receives what the
|
|
579
|
+
* previous one returned; `undefined` keeps the current value and anything else — `null` included —
|
|
580
|
+
* replaces it.
|
|
581
|
+
* - `pre_user_send` returns `{ recalledContext }`, which the loop concatenates across handlers and
|
|
582
|
+
* injects ahead of the user prompt.
|
|
583
|
+
* - Everything else (`post_tool_call`, `pre_llm_call`, `post_llm_call`, `on_session_start`,
|
|
584
|
+
* `on_session_end`, `post_assistant_reply`) is fire-and-forget: the return value is DISCARDED. A
|
|
585
|
+
* policy that needs to change a tool result belongs on `transform_tool_result` — put it on
|
|
586
|
+
* `post_tool_call` and it quietly degrades to observation.
|
|
587
|
+
*
|
|
588
|
+
* Failure is asymmetric too. A fire-and-forget or transform handler that throws is caught, logged to
|
|
589
|
+
* stderr, and the run continues. A `pre_tool_call` handler that throws is NOT caught by the hook
|
|
590
|
+
* dispatcher, so its exception escapes into the tool-dispatch path — a permission-style handler
|
|
591
|
+
* should resolve its own errors to an explicit block rather than relying on that.
|
|
592
|
+
*/
|
|
1355
593
|
type HookName = "pre_tool_call" | "post_tool_call" | "pre_llm_call" | "post_llm_call" | "on_session_start" | "on_session_end" | "transform_tool_result" | "transform_llm_output" | "pre_user_send" | "post_assistant_reply";
|
|
594
|
+
/**
|
|
595
|
+
* What a `pre_tool_call` handler is given: the tool about to run, the arguments the model produced
|
|
596
|
+
* for it, and the identity of the run asking.
|
|
597
|
+
*
|
|
598
|
+
* `args` came from the model, not from a validated caller. A handler that gates on argument values
|
|
599
|
+
* must treat every field as untrusted and survive one that is missing or of the wrong type.
|
|
600
|
+
*
|
|
601
|
+
* `permissionMode` is the run's resolved mode — `SendOptions.permissionMode` falling back to
|
|
602
|
+
* `AgentOptions.permissionMode` — threaded here so a permission-style plugin can gate per run rather
|
|
603
|
+
* than at construction time. Absent means neither was set, and the plugin's own default applies;
|
|
604
|
+
* plugins that are not about permissions ignore it.
|
|
605
|
+
*/
|
|
1356
606
|
interface PreToolCallContext {
|
|
1357
607
|
name: string;
|
|
1358
608
|
args: Record<string, unknown>;
|
|
@@ -1366,6 +616,19 @@ interface PreToolCallContext {
|
|
|
1366
616
|
*/
|
|
1367
617
|
permissionMode?: PermissionMode;
|
|
1368
618
|
}
|
|
619
|
+
/**
|
|
620
|
+
* The veto a `pre_tool_call` handler returns to stop a tool call. Returning `undefined` allows it —
|
|
621
|
+
* there is no approval value, and `block` is the literal `true`, so `{ block: false }` is not
|
|
622
|
+
* expressible and cannot be used to force a call through.
|
|
623
|
+
*
|
|
624
|
+
* The first blocking handler decides; later `pre_tool_call` handlers never run.
|
|
625
|
+
*
|
|
626
|
+
* `message` is not a log line. The loop turns the veto into a `tool_result` reading "Plugin blocked
|
|
627
|
+
* this tool call: <message>", deliberately NOT flagged as an error, so the model reads it and can
|
|
628
|
+
* choose another route instead of the run failing. Write it for the model: say what was refused and
|
|
629
|
+
* what it might do instead. It also reaches observability — as the `stderr` of a tool-completed event
|
|
630
|
+
* with exit code 126, and as the message on a `permission_denied` run event.
|
|
631
|
+
*/
|
|
1369
632
|
interface PreToolCallDecision {
|
|
1370
633
|
block: true;
|
|
1371
634
|
message: string;
|
|
@@ -1460,6 +723,18 @@ interface PostAssistantReplyContext {
|
|
|
1460
723
|
reply: string;
|
|
1461
724
|
agentId: string;
|
|
1462
725
|
runId: string;
|
|
726
|
+
/**
|
|
727
|
+
* `true` when the run that produced `reply` called at least one tool (#358).
|
|
728
|
+
*
|
|
729
|
+
* A reply produced by a tool call is not safely replayable: re-serving the text hands a later
|
|
730
|
+
* caller the RESULT of a `write_file` / HTTP POST / payment without the side effect having
|
|
731
|
+
* happened. A semantic cache must skip storing such a reply, and before this field existed it
|
|
732
|
+
* had nothing to key on and assumed `false`.
|
|
733
|
+
*
|
|
734
|
+
* Derived from the run's replayed event stream, so it counts tool calls the run actually made,
|
|
735
|
+
* not tools the agent merely has.
|
|
736
|
+
*/
|
|
737
|
+
usedTools: boolean;
|
|
1463
738
|
memoryContext?: MemoryContext;
|
|
1464
739
|
}
|
|
1465
740
|
type HookHandler = (ctx: unknown) => unknown | Promise<unknown>;
|
|
@@ -1467,6 +742,21 @@ type CommandHandler = (args: Record<string, unknown>) => Promise<string> | strin
|
|
|
1467
742
|
interface CommandOptions {
|
|
1468
743
|
description?: string;
|
|
1469
744
|
}
|
|
745
|
+
/**
|
|
746
|
+
* The registration surface passed to a `"general"` plugin's `register(ctx)`, and the plugin's only
|
|
747
|
+
* route into the agent. Outside production it is a sealed Proxy that throws when a plugin assigns a
|
|
748
|
+
* property of its own, so smuggling state onto the context fails loudly in development.
|
|
749
|
+
*
|
|
750
|
+
* `register` runs ONCE, when the plugin is registered — never per run. Anything the plugin wants to
|
|
751
|
+
* do during a turn has to be attached here as a hook; there is no later entry point. Each plugin gets
|
|
752
|
+
* its own context, so registrations stay attributable to the plugin that made them.
|
|
753
|
+
*
|
|
754
|
+
* Two things worth knowing before writing one. Commands registered here are consumed by CLI and bot
|
|
755
|
+
* wrappers only — the agent loop never dispatches them, so a plugin that ships nothing but commands
|
|
756
|
+
* has no effect on a programmatic run. And `on` drops a handler that is not a function, with a
|
|
757
|
+
* warning on stderr rather than an error at registration: the gentler failure, and the easier one to
|
|
758
|
+
* miss.
|
|
759
|
+
*/
|
|
1470
760
|
interface PluginContext {
|
|
1471
761
|
/** Register a custom tool. Equivalent to passing in `AgentOptions.tools`. */
|
|
1472
762
|
registerTool(tool: CustomTool): void;
|
|
@@ -1481,6 +771,30 @@ interface BasePlugin {
|
|
|
1481
771
|
name: string;
|
|
1482
772
|
version: string;
|
|
1483
773
|
}
|
|
774
|
+
/**
|
|
775
|
+
* Memory provider factory shape (ADR D141). Returns a `MemoryAdapter`
|
|
776
|
+
* (sync) or a Promise resolving to one (lazy HTTP probe / config load).
|
|
777
|
+
*
|
|
778
|
+
* Adapters live in `@theokit-memory-*` packages; the SDK never imports
|
|
779
|
+
* them. Factory rejection is caught by the plugin manager and surfaced
|
|
780
|
+
* as `ConfigurationError(code: "plugin_factory_failed")` (EC-F) — never
|
|
781
|
+
* an unhandled rejection.
|
|
782
|
+
*
|
|
783
|
+
* PUBLIC, deliberately (#335). This type is the shape a consumer must satisfy
|
|
784
|
+
* to write a memory plugin: it is named by the PUBLIC `Plugin` union below, in
|
|
785
|
+
* the `createProvider` position. It used to carry the internal-visibility JSDoc
|
|
786
|
+
* tag, which made `stripInternal` delete the declaration while the union went
|
|
787
|
+
* on referencing it — so the published `.d.ts` named a type it did not declare.
|
|
788
|
+
* Invisible under `skipLibCheck`, and an `error`-typed graph for any consumer
|
|
789
|
+
* running type-aware lint. A type reachable from a public signature is public
|
|
790
|
+
* whatever the tag says; the tag was the thing that was wrong.
|
|
791
|
+
*
|
|
792
|
+
* Do NOT write that tag's literal spelling anywhere in this comment. It is
|
|
793
|
+
* matched as text, so a JSDoc block that merely MENTIONS it is stripped exactly
|
|
794
|
+
* as if it had declared it — which is how the first attempt at this fix failed,
|
|
795
|
+
* with a build error naming a symbol whose own explanation had re-hidden it.
|
|
796
|
+
*/
|
|
797
|
+
type MemoryProviderFactory = (cwd: string) => MemoryAdapter | Promise<MemoryAdapter>;
|
|
1484
798
|
type Plugin = (BasePlugin & {
|
|
1485
799
|
kind: "general";
|
|
1486
800
|
register: (ctx: PluginContext) => void | Promise<void>;
|
|
@@ -1498,12 +812,48 @@ type Plugin = (BasePlugin & {
|
|
|
1498
812
|
* @public
|
|
1499
813
|
*/
|
|
1500
814
|
type SettingSource = "project" | "user" | "team" | "mdm" | "plugins" | "all";
|
|
815
|
+
/**
|
|
816
|
+
* A tool the SDK declares to the model on its own initiative — not one the consumer passed in
|
|
817
|
+
* {@link AgentOptions.tools}, and not one an MCP server exposed.
|
|
818
|
+
*
|
|
819
|
+
* These three names are also the ones the SDK reserves: a custom tool may not claim them. Listing
|
|
820
|
+
* one in {@link AgentOptions.withheldBuiltinTools} both stops it being declared and releases the
|
|
821
|
+
* name, because nothing of the SDK's is occupying it any more.
|
|
822
|
+
*
|
|
823
|
+
* Named for usetheokit/theokit-sdk#381, which is the report that the catalog had no opt-out.
|
|
824
|
+
*
|
|
825
|
+
* @public
|
|
826
|
+
*/
|
|
827
|
+
type BuiltinToolName = "shell" | "memory_search" | "memory_get";
|
|
1501
828
|
/**
|
|
1502
829
|
* Local agent configuration.
|
|
1503
830
|
*
|
|
831
|
+
* TWO THINGS A LOCAL AGENT DOES BY DEFAULT, both reported as surprises (#338):
|
|
832
|
+
*
|
|
833
|
+
* 1. **A `shell` tool is always registered**, including when you pass `tools: []`. Every local
|
|
834
|
+
* agent can therefore read any file reachable from {@link LocalOptions.cwd}. One report describes
|
|
835
|
+
* an evaluation invalidated this way: the working directory held the benchmark's answer key, and
|
|
836
|
+
* two transcripts show the model citing it. Deny it explicitly if that matters —
|
|
837
|
+
* `{ tool: "shell", action: "deny" }` on a {@link PermissionEngine} rule is terminal under every
|
|
838
|
+
* permission mode, including `bypass`. A deny rule still leaves the tool in the advertised
|
|
839
|
+
* catalog, so the model may attempt it and be refused; to keep it out of the catalog entirely,
|
|
840
|
+
* pass `withheldBuiltinTools: ["shell"]` on {@link AgentOptions} (usetheokit/theokit-sdk#381).
|
|
841
|
+
*
|
|
842
|
+
* 2. **Finished runs write a transcript to disk**, at `.theokit/memory/sessions/<runId>.md` under
|
|
843
|
+
* the workspace `cwd`, with the full prompt and reply. This happens with no `memory` config and
|
|
844
|
+
* with `settingSources: []` — it is what `memory_search({ corpus: "sessions" })` reads. Opt out
|
|
845
|
+
* with `memory: { enabled: false }`, which suppresses the write entirely
|
|
846
|
+
* (usetheokit/theokit-sdk#382). Leaving `memory`
|
|
847
|
+
* unset still writes, so if the workspace is a git repository, add `.theokit/` to `.gitignore`:
|
|
848
|
+
* one report describes a transcript reaching a public repo before it was noticed.
|
|
849
|
+
*
|
|
1504
850
|
* @public
|
|
1505
851
|
*/
|
|
1506
852
|
interface LocalOptions {
|
|
853
|
+
/**
|
|
854
|
+
* Workspace root(s). Also the reach of the always-present `shell` tool — see the note on
|
|
855
|
+
* {@link LocalOptions}, and the transcript written under `.theokit/memory/sessions/` here.
|
|
856
|
+
*/
|
|
1507
857
|
cwd?: string | string[];
|
|
1508
858
|
settingSources?: SettingSource[];
|
|
1509
859
|
sandboxOptions?: {
|
|
@@ -1765,8 +1115,11 @@ interface MemorySettings {
|
|
|
1765
1115
|
* to add prompt/response/args events to the spans (consumer's
|
|
1766
1116
|
* responsibility to sanitize PII).
|
|
1767
1117
|
*
|
|
1768
|
-
* `@opentelemetry/api` is an OPTIONAL peer dependency
|
|
1769
|
-
* installed, telemetry is a
|
|
1118
|
+
* `@opentelemetry/api` is an OPTIONAL peer dependency — declared, so your package manager can
|
|
1119
|
+
* tell you the version range, and not installed for you. Without it, telemetry is a NO-OP even
|
|
1120
|
+
* when `enabled: true`: the tracer is loaded lazily inside a try/catch, so nothing throws and
|
|
1121
|
+
* nothing is recorded. A run that reports no spans with `enabled: true` is almost always this,
|
|
1122
|
+
* not a misconfigured collector.
|
|
1770
1123
|
*
|
|
1771
1124
|
* @public
|
|
1772
1125
|
*/
|
|
@@ -1896,6 +1249,32 @@ interface AgentOptions {
|
|
|
1896
1249
|
* See {@link CustomTool}.
|
|
1897
1250
|
*/
|
|
1898
1251
|
tools?: CustomTool[];
|
|
1252
|
+
/**
|
|
1253
|
+
* Builtin tools this agent must NOT declare to the model. Absent or empty ⇒ every builtin the
|
|
1254
|
+
* rest of the configuration would register is declared, exactly as before this option existed.
|
|
1255
|
+
*
|
|
1256
|
+
* WHY WITHHOLDING IS NOT THE SAME AS DENYING. A consumer that cannot allow `shell` — because it
|
|
1257
|
+
* reaches outside their own sandbox scope — can already refuse the call in a `pre_tool_call` hook
|
|
1258
|
+
* or with a {@link PermissionEngine} deny rule. That stops the execution and pays for the offer
|
|
1259
|
+
* twice over: the schema rides in EVERY request of EVERY round (measured at 267 characters for
|
|
1260
|
+
* `shell`, 1,462 for `memory_search` + `memory_get` together — usetheokit/theokit-sdk#381), and
|
|
1261
|
+
* the model can spend a whole round discovering a refusal it had no way to anticipate. Declaring
|
|
1262
|
+
* a tool that is guaranteed to be refused is the wrong shape; withholding removes it from the
|
|
1263
|
+
* catalog, so the model is never offered what it cannot have.
|
|
1264
|
+
*
|
|
1265
|
+
* WITHHOLDING RELEASES THE NAME. `withheldBuiltinTools: ["shell"]` lets {@link AgentOptions.tools}
|
|
1266
|
+
* declare a tool called `shell` without the `tool_reserved_name` error — the reservation exists to
|
|
1267
|
+
* stop a collision with the SDK's own tool, and there is no longer one to collide with. Every
|
|
1268
|
+
* builtin still declared stays reserved.
|
|
1269
|
+
*
|
|
1270
|
+
* This governs DECLARATION, not authorization. A withheld builtin is simply absent from the
|
|
1271
|
+
* catalog: a model that invents the name anyway gets `Unknown tool <name>` (exit 127) rather than
|
|
1272
|
+
* an execution, but nothing here evaluates a policy. Keep the deny rule if you need one that a
|
|
1273
|
+
* per-send `tools` override cannot reopen.
|
|
1274
|
+
*
|
|
1275
|
+
* @public
|
|
1276
|
+
*/
|
|
1277
|
+
withheldBuiltinTools?: readonly BuiltinToolName[];
|
|
1899
1278
|
/**
|
|
1900
1279
|
* SE37 — opt-in reasoning. When `true`, the agent gets a chain-of-thought
|
|
1901
1280
|
* preamble prepended to its system prompt AND the `think` reasoning tool
|
|
@@ -2171,6 +1550,12 @@ interface AgentDescription {
|
|
|
2171
1550
|
/**
|
|
2172
1551
|
* Options for `Agent.list()`.
|
|
2173
1552
|
*
|
|
1553
|
+
* `limit`/`cursor` paginate (B-115): a `limit` bounds the page and, when more agents remain,
|
|
1554
|
+
* `ListResult.nextCursor` is set — pass it back as `cursor` for the next page. Omitting `limit`
|
|
1555
|
+
* returns every matching agent in one page, unpaginated, exactly as before (M107 declared imposing
|
|
1556
|
+
* pagination order unconditionally a breaking change to every caller's observed order; pagination
|
|
1557
|
+
* here is opt-in and only reorders the page it returns, never the unlimited default).
|
|
1558
|
+
*
|
|
2174
1559
|
* @public
|
|
2175
1560
|
*/
|
|
2176
1561
|
type ListAgentsOptions = {
|
|
@@ -2183,13 +1568,19 @@ type ListAgentsOptions = {
|
|
|
2183
1568
|
cwd?: string;
|
|
2184
1569
|
} | {
|
|
2185
1570
|
runtime: "cloud";
|
|
2186
|
-
|
|
1571
|
+
/**
|
|
1572
|
+
* Hide archived agents unless `true`. Default `false` (hidden) — B-115, this used to be
|
|
1573
|
+
* accepted and silently ignored; every archived agent was always included.
|
|
1574
|
+
*/
|
|
2187
1575
|
includeArchived?: boolean;
|
|
2188
1576
|
apiKey?: string;
|
|
2189
1577
|
});
|
|
2190
1578
|
/**
|
|
2191
1579
|
* Options for `Agent.get()`.
|
|
2192
1580
|
*
|
|
1581
|
+
* `cwd` (default `process.cwd()`) selects which workspace's on-disk registry to hydrate before the
|
|
1582
|
+
* lookup — same rule `Agent.list` uses (B-115; this used to be accepted and silently ignored).
|
|
1583
|
+
*
|
|
2193
1584
|
* @public
|
|
2194
1585
|
*/
|
|
2195
1586
|
interface GetAgentOptions {
|
|
@@ -2199,18 +1590,22 @@ interface GetAgentOptions {
|
|
|
2199
1590
|
/**
|
|
2200
1591
|
* Options for `Agent.listRuns()`.
|
|
2201
1592
|
*
|
|
1593
|
+
* `cwd` (default `process.cwd()`) hydrates that workspace's registry before validating the agent
|
|
1594
|
+
* exists — same rule as `Agent.get` (B-115). `limit`/`cursor` paginate the SAME way as
|
|
1595
|
+
* `Agent.list` — see its doc — except no reordering is ever needed: a single agent's runs are
|
|
1596
|
+
* already returned in the stable order they were created.
|
|
1597
|
+
*
|
|
1598
|
+
* B-115 — `runtime` removed 2026-08-19. A single `agentId` already pins exactly one runtime;
|
|
1599
|
+
* filtering an already-single-agent's runs by runtime filtered nothing and was never checked.
|
|
1600
|
+
*
|
|
2202
1601
|
* @public
|
|
2203
1602
|
*/
|
|
2204
|
-
|
|
2205
|
-
limit?: number;
|
|
2206
|
-
cursor?: string;
|
|
2207
|
-
} & ({
|
|
2208
|
-
runtime?: "local";
|
|
1603
|
+
interface ListRunsOptions {
|
|
2209
1604
|
cwd?: string;
|
|
2210
|
-
} | {
|
|
2211
|
-
runtime: "cloud";
|
|
2212
1605
|
apiKey?: string;
|
|
2213
|
-
|
|
1606
|
+
limit?: number;
|
|
1607
|
+
cursor?: string;
|
|
1608
|
+
}
|
|
2214
1609
|
/**
|
|
2215
1610
|
* Options for `Agent.getRun()`. Cloud requires the parent `agentId`.
|
|
2216
1611
|
*
|
|
@@ -2243,4 +1638,4 @@ interface ListResult<T> {
|
|
|
2243
1638
|
nextCursor?: string;
|
|
2244
1639
|
}
|
|
2245
1640
|
|
|
2246
|
-
export { type
|
|
1641
|
+
export { type SystemPromptMemoryFact as $, type AgentOptions as A, type BudgetTracker as B, type CloudOptions as C, type PluginContext as D, type PostAssistantReplyContext as E, type PostToolCallContext as F, type GetAgentOptions as G, type HookName as H, type InlineSkill as I, type PreToolCallContext as J, type PreUserSendContext as K, type LocalOptions as L, type MemorySettings as M, type PreUserSendResult as N, type ProviderTransform as O, type Plugin as P, type ProviderTransformContext as Q, type RecordSessionSummaryArgs as R, type SystemPromptResolver as S, type SessionLifecycleContext as T, type SessionRecord as U, type SessionStore as V, type SettingSource as W, Skill as X, type SkillsResolver as Y, type SkillsResolverContext as Z, type SystemPromptContext as _, type AgentDefinition as a, type TelemetrySettings as a0, type ToolCallSummary as a1, type ToolResultTransformContext as a2, type TransformContext as a3, type SkillsSettings as b, type ListAgentsOptions as c, type ListResult as d, type SDKAgentInfo as e, type ListRunsOptions as f, type GetRunOptions as g, type AgentOperationOptions as h, type AgentDescription as i, type ProviderProfile as j, type MemoryProvider as k, type PreToolCallDecision as l, type ActiveMemoryPassArgs as m, type ActiveMemoryPassResult as n, type AgentSubagentDescription as o, type AgentToolDescription as p, type BudgetCheck as q, type BudgetTotal as r, type BudgetUsageEvent as s, type BuiltinToolName as t, type CloudEnv as u, type CloudRepo as v, type CreateSkillSpec as w, type MemoryProviderFactory as x, type MemoryProviderHandle as y, type MemoryProviderInitOptions as z };
|