@theokit/sdk 0.0.0-compat-580-20260905204608
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 +7923 -0
- package/LICENSE +201 -0
- package/README.md +114 -0
- package/dist/a2a/agent-mailbox.d.cts +54 -0
- package/dist/a2a/agent-mailbox.d.ts +54 -0
- package/dist/a2a/index.cjs +138 -0
- package/dist/a2a/index.cjs.map +1 -0
- package/dist/a2a/index.d.cts +10 -0
- package/dist/a2a/index.d.ts +10 -0
- package/dist/a2a/index.js +125 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/a2a/message-bus.d.cts +118 -0
- package/dist/a2a/message-bus.d.ts +118 -0
- package/dist/a2a/subagent.d.cts +231 -0
- package/dist/a2a/subagent.d.ts +231 -0
- package/dist/a2a/types.d.cts +45 -0
- package/dist/a2a/types.d.ts +45 -0
- package/dist/agent-ARLOD4JX.cjs +67 -0
- package/dist/agent-ARLOD4JX.cjs.map +1 -0
- package/dist/agent-C3KO5LKm.d.cts +1871 -0
- package/dist/agent-CvmTR9uf.d.ts +1871 -0
- package/dist/agent-N6WJ54ML.js +58 -0
- package/dist/agent-N6WJ54ML.js.map +1 -0
- package/dist/agent-builder.d.ts +72 -0
- package/dist/agent-factory-registry-UU46BUMU.cjs +16 -0
- package/dist/agent-factory-registry-UU46BUMU.cjs.map +1 -0
- package/dist/agent-factory-registry-ZVTABLEY.js +3 -0
- package/dist/agent-factory-registry-ZVTABLEY.js.map +1 -0
- package/dist/agent-factory.d.ts +24 -0
- package/dist/agent-generate.d.ts +12 -0
- package/dist/agent-session-store-AFML3AXC.js +6 -0
- package/dist/agent-session-store-AFML3AXC.js.map +1 -0
- package/dist/agent-session-store-MTSIY3MH.cjs +23 -0
- package/dist/agent-session-store-MTSIY3MH.cjs.map +1 -0
- package/dist/agent.d.ts +276 -0
- package/dist/auth/index.cjs +306 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +34 -0
- package/dist/auth/index.d.ts +34 -0
- package/dist/auth/index.js +247 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/batch-I6T6MXZO.cjs +263 -0
- package/dist/batch-I6T6MXZO.cjs.map +1 -0
- package/dist/batch-US4F6WPK.js +260 -0
- package/dist/batch-US4F6WPK.js.map +1 -0
- package/dist/chunk-24MGQDK3.js +31 -0
- package/dist/chunk-24MGQDK3.js.map +1 -0
- package/dist/chunk-24SYBZPL.cjs +121 -0
- package/dist/chunk-24SYBZPL.cjs.map +1 -0
- package/dist/chunk-2HPNT6HH.cjs +3373 -0
- package/dist/chunk-2HPNT6HH.cjs.map +1 -0
- package/dist/chunk-2SFBB54R.js +23 -0
- package/dist/chunk-2SFBB54R.js.map +1 -0
- package/dist/chunk-2WXHA33T.js +105 -0
- package/dist/chunk-2WXHA33T.js.map +1 -0
- package/dist/chunk-2XC6KDJM.js +22 -0
- package/dist/chunk-2XC6KDJM.js.map +1 -0
- package/dist/chunk-2XRAWOZZ.js +172 -0
- package/dist/chunk-2XRAWOZZ.js.map +1 -0
- package/dist/chunk-2ZPEDVLM.cjs +59 -0
- package/dist/chunk-2ZPEDVLM.cjs.map +1 -0
- package/dist/chunk-3EE6LVWT.cjs +29 -0
- package/dist/chunk-3EE6LVWT.cjs.map +1 -0
- package/dist/chunk-3JHIFQ4I.js +102 -0
- package/dist/chunk-3JHIFQ4I.js.map +1 -0
- package/dist/chunk-44I6UYVH.js +133 -0
- package/dist/chunk-44I6UYVH.js.map +1 -0
- package/dist/chunk-47TF32NQ.js +79 -0
- package/dist/chunk-47TF32NQ.js.map +1 -0
- package/dist/chunk-4A3SKJ53.cjs +297 -0
- package/dist/chunk-4A3SKJ53.cjs.map +1 -0
- package/dist/chunk-4HS6FFGL.cjs +433 -0
- package/dist/chunk-4HS6FFGL.cjs.map +1 -0
- package/dist/chunk-4MMWFSCD.js +25 -0
- package/dist/chunk-4MMWFSCD.js.map +1 -0
- package/dist/chunk-4NLCWGH7.cjs +177 -0
- package/dist/chunk-4NLCWGH7.cjs.map +1 -0
- package/dist/chunk-55GB6JYQ.js +208 -0
- package/dist/chunk-55GB6JYQ.js.map +1 -0
- package/dist/chunk-5WKQDIGO.js +136 -0
- package/dist/chunk-5WKQDIGO.js.map +1 -0
- package/dist/chunk-67SBTGMA.cjs +457 -0
- package/dist/chunk-67SBTGMA.cjs.map +1 -0
- package/dist/chunk-6LHQPOMI.cjs +193 -0
- package/dist/chunk-6LHQPOMI.cjs.map +1 -0
- package/dist/chunk-6M2OIS4Y.js +158 -0
- package/dist/chunk-6M2OIS4Y.js.map +1 -0
- package/dist/chunk-6PWOWXMC.js +121 -0
- package/dist/chunk-6PWOWXMC.js.map +1 -0
- package/dist/chunk-6X6ID4MO.js +20 -0
- package/dist/chunk-6X6ID4MO.js.map +1 -0
- package/dist/chunk-7A6535RA.cjs +231 -0
- package/dist/chunk-7A6535RA.cjs.map +1 -0
- package/dist/chunk-7FDKWDA2.cjs +135 -0
- package/dist/chunk-7FDKWDA2.cjs.map +1 -0
- package/dist/chunk-7I5Z3UBJ.js +10 -0
- package/dist/chunk-7I5Z3UBJ.js.map +1 -0
- package/dist/chunk-7JJ3A6AT.cjs +88 -0
- package/dist/chunk-7JJ3A6AT.cjs.map +1 -0
- package/dist/chunk-7SZAV6QG.js +593 -0
- package/dist/chunk-7SZAV6QG.js.map +1 -0
- package/dist/chunk-A4RAL2ER.cjs +51 -0
- package/dist/chunk-A4RAL2ER.cjs.map +1 -0
- package/dist/chunk-AA27GEYS.cjs +12 -0
- package/dist/chunk-AA27GEYS.cjs.map +1 -0
- package/dist/chunk-AAEZSPTC.js +133 -0
- package/dist/chunk-AAEZSPTC.js.map +1 -0
- package/dist/chunk-AGACYRJ2.js +11 -0
- package/dist/chunk-AGACYRJ2.js.map +1 -0
- package/dist/chunk-ALUN2B4W.js +356 -0
- package/dist/chunk-ALUN2B4W.js.map +1 -0
- package/dist/chunk-ANMJJD6D.cjs +18 -0
- package/dist/chunk-ANMJJD6D.cjs.map +1 -0
- package/dist/chunk-ATT276RD.cjs +173 -0
- package/dist/chunk-ATT276RD.cjs.map +1 -0
- package/dist/chunk-AW6F6HZR.js +166 -0
- package/dist/chunk-AW6F6HZR.js.map +1 -0
- package/dist/chunk-AWINL3ZC.js +109 -0
- package/dist/chunk-AWINL3ZC.js.map +1 -0
- package/dist/chunk-BJUJT5ED.cjs +186 -0
- package/dist/chunk-BJUJT5ED.cjs.map +1 -0
- package/dist/chunk-BUUUWQMB.cjs +34 -0
- package/dist/chunk-BUUUWQMB.cjs.map +1 -0
- package/dist/chunk-BV2MWEMV.cjs +26 -0
- package/dist/chunk-BV2MWEMV.cjs.map +1 -0
- package/dist/chunk-CFE6QF2Q.js +221 -0
- package/dist/chunk-CFE6QF2Q.js.map +1 -0
- package/dist/chunk-CZJ6Q7CW.js +183 -0
- package/dist/chunk-CZJ6Q7CW.js.map +1 -0
- package/dist/chunk-D3CCY3A2.cjs +10995 -0
- package/dist/chunk-D3CCY3A2.cjs.map +1 -0
- package/dist/chunk-D6POWE7E.cjs +210 -0
- package/dist/chunk-D6POWE7E.cjs.map +1 -0
- package/dist/chunk-DMRT67Y6.js +100 -0
- package/dist/chunk-DMRT67Y6.js.map +1 -0
- package/dist/chunk-DQZU7JK6.cjs +125 -0
- package/dist/chunk-DQZU7JK6.cjs.map +1 -0
- package/dist/chunk-EFMFILPG.js +77 -0
- package/dist/chunk-EFMFILPG.js.map +1 -0
- package/dist/chunk-EH6XD3FY.js +222 -0
- package/dist/chunk-EH6XD3FY.js.map +1 -0
- package/dist/chunk-EIQFAOFD.js +229 -0
- package/dist/chunk-EIQFAOFD.js.map +1 -0
- package/dist/chunk-EPSICJLZ.js +79 -0
- package/dist/chunk-EPSICJLZ.js.map +1 -0
- package/dist/chunk-EXTRW7GW.cjs +155 -0
- package/dist/chunk-EXTRW7GW.cjs.map +1 -0
- package/dist/chunk-FD2UT76F.js +3 -0
- package/dist/chunk-FD2UT76F.js.map +1 -0
- package/dist/chunk-FJWQP6EE.js +122 -0
- package/dist/chunk-FJWQP6EE.js.map +1 -0
- package/dist/chunk-FRITRLZQ.cjs +24 -0
- package/dist/chunk-FRITRLZQ.cjs.map +1 -0
- package/dist/chunk-FUSDYC2B.cjs +280 -0
- package/dist/chunk-FUSDYC2B.cjs.map +1 -0
- package/dist/chunk-G7BLGBRN.js +43 -0
- package/dist/chunk-G7BLGBRN.js.map +1 -0
- package/dist/chunk-GBCVPKHE.js +282 -0
- package/dist/chunk-GBCVPKHE.js.map +1 -0
- package/dist/chunk-GHX4P3V2.cjs +34 -0
- package/dist/chunk-GHX4P3V2.cjs.map +1 -0
- package/dist/chunk-GZV6AVRL.cjs +282 -0
- package/dist/chunk-GZV6AVRL.cjs.map +1 -0
- package/dist/chunk-H73MEMQB.js +31 -0
- package/dist/chunk-H73MEMQB.js.map +1 -0
- package/dist/chunk-HCT4HPCL.cjs +235 -0
- package/dist/chunk-HCT4HPCL.cjs.map +1 -0
- package/dist/chunk-HFEJE7AC.js +424 -0
- package/dist/chunk-HFEJE7AC.js.map +1 -0
- package/dist/chunk-HKCKOAIO.js +57 -0
- package/dist/chunk-HKCKOAIO.js.map +1 -0
- package/dist/chunk-HUFSABUZ.cjs +48 -0
- package/dist/chunk-HUFSABUZ.cjs.map +1 -0
- package/dist/chunk-HW7SEELD.cjs +46 -0
- package/dist/chunk-HW7SEELD.cjs.map +1 -0
- package/dist/chunk-HY66GLM6.js +13 -0
- package/dist/chunk-HY66GLM6.js.map +1 -0
- package/dist/chunk-I2PWY7VM.cjs +27 -0
- package/dist/chunk-I2PWY7VM.cjs.map +1 -0
- package/dist/chunk-IJ7M6GOG.cjs +28 -0
- package/dist/chunk-IJ7M6GOG.cjs.map +1 -0
- package/dist/chunk-IU5N5224.cjs +288 -0
- package/dist/chunk-IU5N5224.cjs.map +1 -0
- package/dist/chunk-IUMAQURF.js +130 -0
- package/dist/chunk-IUMAQURF.js.map +1 -0
- package/dist/chunk-J7J7J2GN.cjs +377 -0
- package/dist/chunk-J7J7J2GN.cjs.map +1 -0
- package/dist/chunk-JLRLCBJ4.cjs +108 -0
- package/dist/chunk-JLRLCBJ4.cjs.map +1 -0
- package/dist/chunk-JMDDYA22.js +171 -0
- package/dist/chunk-JMDDYA22.js.map +1 -0
- package/dist/chunk-JNAA4G4H.js +43 -0
- package/dist/chunk-JNAA4G4H.js.map +1 -0
- package/dist/chunk-JOFVLOFY.js +268 -0
- package/dist/chunk-JOFVLOFY.js.map +1 -0
- package/dist/chunk-K2BQQ445.js +30 -0
- package/dist/chunk-K2BQQ445.js.map +1 -0
- package/dist/chunk-K2VMFZQ5.js +487 -0
- package/dist/chunk-K2VMFZQ5.js.map +1 -0
- package/dist/chunk-K3NH62DG.js +3343 -0
- package/dist/chunk-K3NH62DG.js.map +1 -0
- package/dist/chunk-KGANQYP7.cjs +172 -0
- package/dist/chunk-KGANQYP7.cjs.map +1 -0
- package/dist/chunk-KRD3GQAA.cjs +71 -0
- package/dist/chunk-KRD3GQAA.cjs.map +1 -0
- package/dist/chunk-KTTHHYEW.cjs +45 -0
- package/dist/chunk-KTTHHYEW.cjs.map +1 -0
- package/dist/chunk-KVNWIAO4.js +68 -0
- package/dist/chunk-KVNWIAO4.js.map +1 -0
- package/dist/chunk-KVSAY6NZ.cjs +497 -0
- package/dist/chunk-KVSAY6NZ.cjs.map +1 -0
- package/dist/chunk-LOHMT36V.cjs +178 -0
- package/dist/chunk-LOHMT36V.cjs.map +1 -0
- package/dist/chunk-LX7SEXOQ.js +152 -0
- package/dist/chunk-LX7SEXOQ.js.map +1 -0
- package/dist/chunk-MUUQ2WFJ.cjs +4 -0
- package/dist/chunk-MUUQ2WFJ.cjs.map +1 -0
- package/dist/chunk-N6OOOYFZ.js +281 -0
- package/dist/chunk-N6OOOYFZ.js.map +1 -0
- package/dist/chunk-NAF4L3T6.js +22 -0
- package/dist/chunk-NAF4L3T6.js.map +1 -0
- package/dist/chunk-NINIJCHU.cjs +23 -0
- package/dist/chunk-NINIJCHU.cjs.map +1 -0
- package/dist/chunk-NJWYQWDL.js +43 -0
- package/dist/chunk-NJWYQWDL.js.map +1 -0
- package/dist/chunk-NQTD6QOW.cjs +226 -0
- package/dist/chunk-NQTD6QOW.cjs.map +1 -0
- package/dist/chunk-NQTNSHSB.cjs +843 -0
- package/dist/chunk-NQTNSHSB.cjs.map +1 -0
- package/dist/chunk-NVXXWAU7.cjs +13 -0
- package/dist/chunk-NVXXWAU7.cjs.map +1 -0
- package/dist/chunk-NYQ3IS7K.cjs +130 -0
- package/dist/chunk-NYQ3IS7K.cjs.map +1 -0
- package/dist/chunk-O6USDERH.js +165 -0
- package/dist/chunk-O6USDERH.js.map +1 -0
- package/dist/chunk-OBA6YK2R.cjs +8 -0
- package/dist/chunk-OBA6YK2R.cjs.map +1 -0
- package/dist/chunk-OQRGVTQF.js +169 -0
- package/dist/chunk-OQRGVTQF.js.map +1 -0
- package/dist/chunk-OR6XIWLB.js +19 -0
- package/dist/chunk-OR6XIWLB.js.map +1 -0
- package/dist/chunk-OYD3U3LY.js +10981 -0
- package/dist/chunk-OYD3U3LY.js.map +1 -0
- package/dist/chunk-PRZ3BES7.cjs +79 -0
- package/dist/chunk-PRZ3BES7.cjs.map +1 -0
- package/dist/chunk-PY2RQOA7.js +6 -0
- package/dist/chunk-PY2RQOA7.js.map +1 -0
- package/dist/chunk-Q5EWJPRY.js +18 -0
- package/dist/chunk-Q5EWJPRY.js.map +1 -0
- package/dist/chunk-QATRS7JD.cjs +158 -0
- package/dist/chunk-QATRS7JD.cjs.map +1 -0
- package/dist/chunk-QC55H6RJ.cjs +601 -0
- package/dist/chunk-QC55H6RJ.cjs.map +1 -0
- package/dist/chunk-QDM3OHUT.cjs +134 -0
- package/dist/chunk-QDM3OHUT.cjs.map +1 -0
- package/dist/chunk-QKLOP4VC.cjs +90 -0
- package/dist/chunk-QKLOP4VC.cjs.map +1 -0
- package/dist/chunk-QOGNZMHD.cjs +34 -0
- package/dist/chunk-QOGNZMHD.cjs.map +1 -0
- package/dist/chunk-QWD3CZWE.cjs +108 -0
- package/dist/chunk-QWD3CZWE.cjs.map +1 -0
- package/dist/chunk-QWD4RDZ3.cjs +136 -0
- package/dist/chunk-QWD4RDZ3.cjs.map +1 -0
- package/dist/chunk-QYLZQ43D.cjs +172 -0
- package/dist/chunk-QYLZQ43D.cjs.map +1 -0
- package/dist/chunk-R7WIIPUR.js +27 -0
- package/dist/chunk-R7WIIPUR.js.map +1 -0
- package/dist/chunk-RQMCOFAI.cjs +85 -0
- package/dist/chunk-RQMCOFAI.cjs.map +1 -0
- package/dist/chunk-SA6K24NB.cjs +25 -0
- package/dist/chunk-SA6K24NB.cjs.map +1 -0
- package/dist/chunk-SADXXGWU.js +809 -0
- package/dist/chunk-SADXXGWU.js.map +1 -0
- package/dist/chunk-SAGRF4IB.js +25 -0
- package/dist/chunk-SAGRF4IB.js.map +1 -0
- package/dist/chunk-SVQIW5RJ.js +81 -0
- package/dist/chunk-SVQIW5RJ.js.map +1 -0
- package/dist/chunk-TA3K7SBK.js +180 -0
- package/dist/chunk-TA3K7SBK.js.map +1 -0
- package/dist/chunk-TFG5IBZS.cjs +139 -0
- package/dist/chunk-TFG5IBZS.cjs.map +1 -0
- package/dist/chunk-TMKTSYDS.cjs +21 -0
- package/dist/chunk-TMKTSYDS.cjs.map +1 -0
- package/dist/chunk-UADQJBHR.cjs +172 -0
- package/dist/chunk-UADQJBHR.cjs.map +1 -0
- package/dist/chunk-UBR5PWD7.js +275 -0
- package/dist/chunk-UBR5PWD7.js.map +1 -0
- package/dist/chunk-UKMBRMGT.js +22 -0
- package/dist/chunk-UKMBRMGT.js.map +1 -0
- package/dist/chunk-V22DZIXO.js +147 -0
- package/dist/chunk-V22DZIXO.js.map +1 -0
- package/dist/chunk-VE6DFSKU.js +107 -0
- package/dist/chunk-VE6DFSKU.js.map +1 -0
- package/dist/chunk-VPK6PHIE.cjs +211 -0
- package/dist/chunk-VPK6PHIE.cjs.map +1 -0
- package/dist/chunk-VTYY7XL5.cjs +15 -0
- package/dist/chunk-VTYY7XL5.cjs.map +1 -0
- package/dist/chunk-VWUXIVEI.js +583 -0
- package/dist/chunk-VWUXIVEI.js.map +1 -0
- package/dist/chunk-WE22OXQA.js +48 -0
- package/dist/chunk-WE22OXQA.js.map +1 -0
- package/dist/chunk-WMWEI3NS.js +120 -0
- package/dist/chunk-WMWEI3NS.js.map +1 -0
- package/dist/chunk-WS5ULCL4.js +204 -0
- package/dist/chunk-WS5ULCL4.js.map +1 -0
- package/dist/chunk-XB4GI5RZ.js +115 -0
- package/dist/chunk-XB4GI5RZ.js.map +1 -0
- package/dist/chunk-XU6MLSC6.js +455 -0
- package/dist/chunk-XU6MLSC6.js.map +1 -0
- package/dist/chunk-XYFGKVZ7.js +15 -0
- package/dist/chunk-XYFGKVZ7.js.map +1 -0
- package/dist/chunk-Y2KYR2ED.cjs +118 -0
- package/dist/chunk-Y2KYR2ED.cjs.map +1 -0
- package/dist/chunk-YIFFF23U.cjs +109 -0
- package/dist/chunk-YIFFF23U.cjs.map +1 -0
- package/dist/chunk-YJNYDJ2T.cjs +27 -0
- package/dist/chunk-YJNYDJ2T.cjs.map +1 -0
- package/dist/chunk-YSTXFWQE.cjs +127 -0
- package/dist/chunk-YSTXFWQE.cjs.map +1 -0
- package/dist/chunk-Z2JFX372.cjs +595 -0
- package/dist/chunk-Z2JFX372.cjs.map +1 -0
- package/dist/chunk-Z3NTRKIC.cjs +111 -0
- package/dist/chunk-Z3NTRKIC.cjs.map +1 -0
- package/dist/chunk-ZF2LDKQQ.cjs +20 -0
- package/dist/chunk-ZF2LDKQQ.cjs.map +1 -0
- package/dist/client/index.cjs +73 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +12 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/index.js +71 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/theokit-client.d.cts +60 -0
- package/dist/client/theokit-client.d.ts +60 -0
- package/dist/client/types.d.cts +51 -0
- package/dist/client/types.d.ts +51 -0
- package/dist/compact-session-BHTPCIHA.cjs +61 -0
- package/dist/compact-session-BHTPCIHA.cjs.map +1 -0
- package/dist/compact-session-W4WLJTHA.js +24 -0
- package/dist/compact-session-W4WLJTHA.js.map +1 -0
- package/dist/compaction.cjs +66 -0
- package/dist/compaction.cjs.map +1 -0
- package/dist/compaction.d.cts +240 -0
- package/dist/compaction.d.ts +240 -0
- package/dist/compaction.js +5 -0
- package/dist/compaction.js.map +1 -0
- package/dist/concurrency.cjs +23 -0
- package/dist/concurrency.cjs.map +1 -0
- package/dist/concurrency.d.cts +22 -0
- package/dist/concurrency.d.ts +22 -0
- package/dist/concurrency.js +17 -0
- package/dist/concurrency.js.map +1 -0
- package/dist/context/index.cjs +37 -0
- package/dist/context/index.cjs.map +1 -0
- package/dist/context/index.d.cts +78 -0
- package/dist/context/index.d.ts +78 -0
- package/dist/context/index.js +20 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context-4QOEWRDF.cjs +23 -0
- package/dist/context-4QOEWRDF.cjs.map +1 -0
- package/dist/context-Z3CFTT3H.js +6 -0
- package/dist/context-Z3CFTT3H.js.map +1 -0
- package/dist/create-skill.d.ts +40 -0
- package/dist/cron-C3PhZED0.d.cts +246 -0
- package/dist/cron-crfMMdAw.d.ts +246 -0
- package/dist/cron.cjs +68 -0
- package/dist/cron.cjs.map +1 -0
- package/dist/cron.d.cts +7 -0
- package/dist/cron.d.ts +7 -0
- package/dist/cron.js +59 -0
- package/dist/cron.js.map +1 -0
- package/dist/define-tool.d.ts +86 -0
- package/dist/errors-CLOAyuiv.d.ts +569 -0
- package/dist/errors-DrDEgyz1.d.cts +569 -0
- package/dist/errors-base-B5g01neU.d.cts +75 -0
- package/dist/errors-base-B5g01neU.d.ts +75 -0
- package/dist/errors-base.d.ts +73 -0
- package/dist/errors.cjs +89 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +4 -0
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +4 -0
- package/dist/errors.js.map +1 -0
- package/dist/eval.cjs +1056 -0
- package/dist/eval.cjs.map +1 -0
- package/dist/eval.d.cts +77 -0
- package/dist/eval.d.ts +77 -0
- package/dist/eval.js +1042 -0
- package/dist/eval.js.map +1 -0
- package/dist/event-bus.d.ts +42 -0
- package/dist/executor-XQAOQOHD.cjs +993 -0
- package/dist/executor-XQAOQOHD.cjs.map +1 -0
- package/dist/executor-ZNDQDX6Q.js +989 -0
- package/dist/executor-ZNDQDX6Q.js.map +1 -0
- package/dist/filesystem/index.cjs +204 -0
- package/dist/filesystem/index.cjs.map +1 -0
- package/dist/filesystem/index.d.cts +12 -0
- package/dist/filesystem/index.d.ts +12 -0
- package/dist/filesystem/index.js +195 -0
- package/dist/filesystem/index.js.map +1 -0
- package/dist/filesystem/local-filesystem.d.cts +54 -0
- package/dist/filesystem/local-filesystem.d.ts +54 -0
- package/dist/filesystem/types.d.cts +136 -0
- package/dist/filesystem/types.d.ts +136 -0
- package/dist/fork-agent-S2EPIML7.js +61 -0
- package/dist/fork-agent-S2EPIML7.js.map +1 -0
- package/dist/fork-agent-WAEQI2DL.cjs +64 -0
- package/dist/fork-agent-WAEQI2DL.cjs.map +1 -0
- package/dist/fs-session-store-77JU46UZ.js +10 -0
- package/dist/fs-session-store-77JU46UZ.js.map +1 -0
- package/dist/fs-session-store-E4U3P56L.cjs +19 -0
- package/dist/fs-session-store-E4U3P56L.cjs.map +1 -0
- package/dist/generate-object-BXV7BZRP.js +7 -0
- package/dist/generate-object-BXV7BZRP.js.map +1 -0
- package/dist/generate-object-YBI2TDJ3.cjs +20 -0
- package/dist/generate-object-YBI2TDJ3.cjs.map +1 -0
- package/dist/generate-object.d.ts +111 -0
- package/dist/index-manager-3UNPYH34.cjs +26 -0
- package/dist/index-manager-3UNPYH34.cjs.map +1 -0
- package/dist/index-manager-W7FDMGEG.js +17 -0
- package/dist/index-manager-W7FDMGEG.js.map +1 -0
- package/dist/index.cjs +2487 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4166 -0
- package/dist/index.d.ts +4166 -0
- package/dist/index.js +2289 -0
- package/dist/index.js.map +1 -0
- package/dist/inject-session-SUM6TDJF.js +27 -0
- package/dist/inject-session-SUM6TDJF.js.map +1 -0
- package/dist/inject-session-W6A46J3E.cjs +29 -0
- package/dist/inject-session-W6A46J3E.cjs.map +1 -0
- package/dist/interactive/index.cjs +35 -0
- package/dist/interactive/index.cjs.map +1 -0
- package/dist/interactive/index.d.cts +12 -0
- package/dist/interactive/index.d.ts +12 -0
- package/dist/interactive/index.js +30 -0
- package/dist/interactive/index.js.map +1 -0
- package/dist/interactive/types.d.cts +95 -0
- package/dist/interactive/types.d.ts +95 -0
- package/dist/internal/agent/batch.d.ts +11 -0
- package/dist/internal/agent/helpers.d.ts +1 -0
- package/dist/internal/agent-loop/budget-gate.d.ts +1 -0
- package/dist/internal/agent-loop/doom-loop-tracker.d.ts +22 -0
- package/dist/internal/agent-loop/live-events.d.ts +46 -0
- package/dist/internal/agent-loop/loop-context-init.d.ts +2 -0
- package/dist/internal/agent-loop/loop-finalize.d.ts +25 -0
- package/dist/internal/agent-loop/loop-llm-stream.d.ts +1 -0
- package/dist/internal/agent-loop/loop-thinking-steps.d.ts +28 -0
- package/dist/internal/agent-loop/loop.d.ts +7 -0
- package/dist/internal/agent-loop/message-builders.d.ts +21 -0
- package/dist/internal/agent-loop/replay-messages.d.ts +41 -0
- package/dist/internal/agent-loop/tool-dispatch.d.ts +27 -0
- package/dist/internal/agent-loop/tool-executors.d.ts +1 -0
- package/dist/internal/agent-loop/tool-result-guard.d.ts +20 -0
- package/dist/internal/agent-loop/tool-timeout.d.ts +23 -0
- package/dist/internal/agent-loop/types.d.ts +43 -0
- package/dist/internal/agent-loop/usage-and-cost.d.ts +25 -0
- package/dist/internal/auth/api-key-prefix.d.ts +23 -0
- package/dist/internal/auth/api-key-validator.d.ts +46 -0
- package/dist/internal/auth/credential-availability.d.ts +61 -0
- package/dist/internal/auth/credential-store.d.ts +77 -0
- package/dist/internal/auth/oauth-device.d.ts +54 -0
- package/dist/internal/auth/oauth-engine.d.ts +21 -0
- package/dist/internal/auth/resolve-credential.d.ts +56 -0
- package/dist/internal/auth/types.d.ts +175 -0
- package/dist/internal/base-url.d.ts +14 -0
- package/dist/internal/budget/compute-cost.d.ts +28 -0
- package/dist/internal/budget/pricing-registry.d.ts +36 -0
- package/dist/internal/budget/tracker/budget-tracker.d.ts +11 -0
- package/dist/internal/budget/tracker/budget.d.ts +34 -0
- package/dist/internal/budget/usage-accumulator.d.ts +46 -0
- package/dist/internal/cloud-agent/cloud-agent.d.ts +1 -0
- package/dist/internal/cloud-agent/cloud-config-serializer.d.ts +3 -0
- package/dist/internal/cloud-agent/cloud-run.d.ts +1 -0
- package/dist/internal/cloud-agent/cloud-tool-parity.d.ts +1 -0
- package/dist/internal/cloud-agent/index.d.ts +7 -0
- package/dist/internal/cloud-agent/real-cloud-run.d.ts +2 -0
- package/dist/internal/cloud-agent/types.d.ts +56 -0
- package/dist/internal/concurrency/abort-utils.d.ts +21 -0
- package/dist/internal/concurrency/async-local-storage.d.ts +20 -0
- package/dist/internal/concurrency/async-semaphore.d.ts +24 -0
- package/dist/internal/concurrency/delegation-depth.d.ts +27 -0
- package/dist/internal/concurrency/map-with-concurrency.d.ts +28 -0
- package/dist/internal/concurrency/subagent-credentials.d.ts +112 -0
- package/dist/internal/diagnostics.d.ts +69 -0
- package/dist/internal/emit-run-event.d.ts +16 -0
- package/dist/internal/env.d.ts +1 -0
- package/dist/internal/error-mappers/anthropic.d.ts +30 -0
- package/dist/internal/error-mappers/bedrock.d.ts +16 -0
- package/dist/internal/error-mappers/default-retriable.d.ts +1 -0
- package/dist/internal/error-mappers/ollama.d.ts +41 -0
- package/dist/internal/error-mappers/openai-compatible.d.ts +25 -0
- package/dist/internal/error-mappers/shared.d.ts +23 -0
- package/dist/internal/error-mappers/vertex.d.ts +15 -0
- package/dist/internal/eval/aggregate.d.ts +9 -0
- package/dist/internal/eval/assert.d.ts +27 -0
- package/dist/internal/eval/code-runner.d.ts +28 -0
- package/dist/internal/eval/dataset-iter.d.ts +9 -0
- package/dist/internal/eval/runner.d.ts +9 -0
- package/dist/internal/eval/single-flight.d.ts +17 -0
- package/dist/internal/eval/telemetry.d.ts +23 -0
- package/dist/internal/eval/trials.d.ts +19 -0
- package/dist/internal/global-singleton.d.ts +16 -0
- package/dist/internal/http.d.ts +1 -0
- package/dist/internal/ids.d.ts +1 -0
- package/dist/internal/judge/judge-call.d.ts +48 -0
- package/dist/internal/judge/parse-verdict.d.ts +11 -0
- package/dist/internal/llm/abort-error.d.ts +1 -0
- package/dist/internal/llm/anthropic-shared.d.ts +100 -0
- package/dist/internal/llm/anthropic.d.ts +9 -0
- package/dist/internal/llm/bedrock-anthropic.d.ts +36 -0
- package/dist/internal/llm/bedrock-token-cache.d.ts +18 -0
- package/dist/internal/llm/credential-pool-context.d.ts +11 -0
- package/dist/internal/llm/credential-pool-types.d.ts +22 -0
- package/dist/internal/llm/credential-pool.d.ts +18 -0
- package/dist/internal/llm/fallback-client.d.ts +1 -0
- package/dist/internal/llm/fault-injection.d.ts +50 -0
- package/dist/internal/llm/finish.d.ts +1 -0
- package/dist/internal/llm/hermes-tool-extract.d.ts +11 -0
- package/dist/internal/llm/model-capabilities.d.ts +40 -0
- package/dist/internal/llm/model-identifier.d.ts +58 -0
- package/dist/internal/llm/model-option.d.ts +38 -0
- package/dist/internal/llm/ollama-native.d.ts +27 -0
- package/dist/internal/llm/openai-messages.d.ts +2 -0
- package/dist/internal/llm/openai.d.ts +146 -0
- package/dist/internal/llm/pool-aware-client.d.ts +16 -0
- package/dist/internal/llm/prompt-cache-key.d.ts +1 -0
- package/dist/internal/llm/responses.d.ts +97 -0
- package/dist/internal/llm/retry.d.ts +22 -0
- package/dist/internal/llm/retrying-client.d.ts +53 -0
- package/dist/internal/llm/router.d.ts +40 -0
- package/dist/internal/llm/sse.d.ts +21 -0
- package/dist/internal/llm/stream-relay.d.ts +17 -0
- package/dist/internal/llm/tool-result-content.d.ts +40 -0
- package/dist/internal/llm/transport-error.d.ts +9 -0
- package/dist/internal/llm/types.d.ts +226 -0
- package/dist/internal/llm/vertex-anthropic.d.ts +40 -0
- package/dist/internal/llm/vertex-auth.d.ts +30 -0
- package/dist/internal/llm/vertex-gemini.d.ts +28 -0
- package/dist/internal/llm/vertex-router.d.ts +21 -0
- package/dist/internal/local-agent/index.d.ts +6 -0
- package/dist/internal/local-agent/local-agent-bootstrap.d.ts +37 -0
- package/dist/internal/local-agent/local-agent-capabilities.d.ts +38 -0
- package/dist/internal/local-agent/local-agent-dispatch.d.ts +57 -0
- package/dist/internal/local-agent/local-agent-invalidate.d.ts +1 -0
- package/dist/internal/local-agent/local-agent-lifecycle.d.ts +13 -0
- package/dist/internal/local-agent/local-agent-memory-direct.d.ts +12 -0
- package/dist/internal/local-agent/local-agent-memory-hooks.d.ts +41 -0
- package/dist/internal/local-agent/local-agent-memory-provider.d.ts +57 -0
- package/dist/internal/local-agent/local-agent-memory.d.ts +1 -0
- package/dist/internal/local-agent/local-agent-personality-extensions.d.ts +43 -0
- package/dist/internal/local-agent/local-agent-runtime-extensions.d.ts +13 -0
- package/dist/internal/local-agent/local-agent-send.d.ts +42 -0
- package/dist/internal/local-agent/local-agent-task-wrap.d.ts +11 -0
- package/dist/internal/local-agent/local-agent.d.ts +1 -0
- package/dist/internal/local-agent/local-option-keys.d.ts +2 -0
- package/dist/internal/local-agent/local-run.d.ts +1 -0
- package/dist/internal/local-agent/mcp-pool.d.ts +43 -0
- package/dist/internal/local-agent/real-local-run-mcp.d.ts +26 -0
- package/dist/internal/local-agent/real-local-run-options.d.ts +26 -0
- package/dist/internal/local-agent/real-local-run-provider.d.ts +13 -0
- package/dist/internal/local-agent/real-local-run-tools.d.ts +55 -0
- package/dist/internal/local-agent/real-local-run.d.ts +4 -0
- package/dist/internal/mcp/client.d.ts +16 -0
- package/dist/internal/mcp/handshake-timeout.d.ts +53 -0
- package/dist/internal/mcp/oauth.d.ts +19 -0
- package/dist/internal/mcp/token-storage.d.ts +52 -0
- package/dist/internal/memory/active-memory-cache.d.ts +10 -0
- package/dist/internal/memory/active-memory-types.d.ts +8 -0
- package/dist/internal/memory/active-memory.d.ts +56 -0
- package/dist/internal/memory/adapters/azure-openai-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/azure-openai-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/catalog.d.cts +1 -0
- package/dist/internal/memory/adapters/catalog.d.ts +1 -0
- package/dist/internal/memory/adapters/cohere-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/cohere-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/deepinfra-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/deepinfra-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/gemini-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/gemini-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/index.cjs +30 -0
- package/dist/internal/memory/adapters/index.cjs.map +1 -0
- package/dist/internal/memory/adapters/index.d.cts +18 -0
- package/dist/internal/memory/adapters/index.d.ts +18 -0
- package/dist/internal/memory/adapters/index.js +13 -0
- package/dist/internal/memory/adapters/index.js.map +1 -0
- package/dist/internal/memory/adapters/jina-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/jina-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/mistral-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/mistral-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/ollama-embedding.d.cts +34 -0
- package/dist/internal/memory/adapters/ollama-embedding.d.ts +34 -0
- package/dist/internal/memory/adapters/openai-compatible.d.cts +96 -0
- package/dist/internal/memory/adapters/openai-compatible.d.ts +96 -0
- package/dist/internal/memory/adapters/openai-embedding.d.cts +12 -0
- package/dist/internal/memory/adapters/openai-embedding.d.ts +12 -0
- package/dist/internal/memory/adapters/openrouter-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/openrouter-embedding.d.ts +2 -0
- package/dist/internal/memory/adapters/voyage-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/voyage-embedding.d.ts +2 -0
- package/dist/internal/memory/corpus-sync.d.ts +23 -0
- package/dist/internal/memory/dreaming/diary.d.ts +41 -0
- package/dist/internal/memory/dreaming/phases.d.ts +35 -0
- package/dist/internal/memory/dreaming/run.d.ts +10 -0
- package/dist/internal/memory/embedding-adapter.d.ts +42 -0
- package/dist/internal/memory/embedding-cache.d.ts +42 -0
- package/dist/internal/memory/escape-like-pattern.d.ts +22 -0
- package/dist/internal/memory/index-db.d.ts +67 -0
- package/dist/internal/memory/index-manager-contract.d.ts +48 -0
- package/dist/internal/memory/index-manager-dispatch.d.ts +23 -0
- package/dist/internal/memory/index-manager-helpers.d.ts +20 -0
- package/dist/internal/memory/index-manager.d.ts +44 -0
- package/dist/internal/memory/index-repository.d.ts +58 -0
- package/dist/internal/memory/index-schema.d.ts +21 -0
- package/dist/internal/memory/lance-index.d.ts +46 -0
- package/dist/internal/memory/lance-memory-adapter.d.ts +45 -0
- package/dist/internal/memory/memory-index.d.ts +67 -0
- package/dist/internal/memory/migrate-sqlite-to-lance.d.ts +58 -0
- package/dist/internal/memory/migration.d.ts +9 -0
- package/dist/internal/memory/sdk-memory-peer-loader.d.ts +74 -0
- package/dist/internal/memory/sqlite-vec-loader.d.ts +1 -0
- package/dist/internal/memory/storage/chunk-markdown.d.cts +2 -0
- package/dist/internal/memory/storage/chunk-markdown.d.ts +2 -0
- package/dist/internal/memory/storage/index.cjs +141 -0
- package/dist/internal/memory/storage/index.cjs.map +1 -0
- package/dist/internal/memory/storage/index.d.cts +28 -0
- package/dist/internal/memory/storage/index.d.ts +28 -0
- package/dist/internal/memory/storage/index.js +16 -0
- package/dist/internal/memory/storage/index.js.map +1 -0
- package/dist/internal/memory/storage/list-markdown.d.cts +1 -0
- package/dist/internal/memory/storage/list-markdown.d.ts +1 -0
- package/dist/internal/memory/storage/markdown-store.d.cts +48 -0
- package/dist/internal/memory/storage/markdown-store.d.ts +48 -0
- package/dist/internal/memory/storage/memory-file.d.cts +90 -0
- package/dist/internal/memory/storage/memory-file.d.ts +90 -0
- package/dist/internal/memory/storage/memory-root.d.cts +119 -0
- package/dist/internal/memory/storage/memory-root.d.ts +119 -0
- package/dist/internal/memory/storage/reader.d.cts +8 -0
- package/dist/internal/memory/storage/reader.d.ts +8 -0
- package/dist/internal/memory/storage/session-loader.d.cts +35 -0
- package/dist/internal/memory/storage/session-loader.d.ts +35 -0
- package/dist/internal/memory/storage/session-summary-writer.d.cts +50 -0
- package/dist/internal/memory/storage/session-summary-writer.d.ts +50 -0
- package/dist/internal/memory/storage/threat-scan.d.cts +62 -0
- package/dist/internal/memory/storage/threat-scan.d.ts +62 -0
- package/dist/internal/memory/storage/transcript-store.d.cts +38 -0
- package/dist/internal/memory/storage/transcript-store.d.ts +38 -0
- package/dist/internal/memory/storage/wiki-loader.d.cts +27 -0
- package/dist/internal/memory/storage/wiki-loader.d.ts +27 -0
- package/dist/internal/memory/tools.d.ts +21 -0
- package/dist/internal/memory/types.d.ts +78 -0
- package/dist/internal/memory/vec-index.d.ts +28 -0
- package/dist/internal/persistence/atomic-write.d.cts +107 -0
- package/dist/internal/persistence/atomic-write.d.ts +107 -0
- package/dist/internal/persistence/cwd-mutex.d.cts +35 -0
- package/dist/internal/persistence/cwd-mutex.d.ts +35 -0
- package/dist/internal/persistence/exclusive-create.d.cts +53 -0
- package/dist/internal/persistence/exclusive-create.d.ts +53 -0
- package/dist/internal/persistence/file-lock.d.cts +54 -0
- package/dist/internal/persistence/file-lock.d.ts +54 -0
- package/dist/internal/persistence/fs-session-store.d.cts +68 -0
- package/dist/internal/persistence/fs-session-store.d.ts +68 -0
- package/dist/internal/persistence/fts5-sanitize.d.cts +44 -0
- package/dist/internal/persistence/fts5-sanitize.d.ts +44 -0
- package/dist/internal/persistence/index.cjs +127 -0
- package/dist/internal/persistence/index.cjs.map +1 -0
- package/dist/internal/persistence/index.d.cts +33 -0
- package/dist/internal/persistence/index.d.ts +33 -0
- package/dist/internal/persistence/index.js +40 -0
- package/dist/internal/persistence/index.js.map +1 -0
- package/dist/internal/persistence/jsonl.d.cts +43 -0
- package/dist/internal/persistence/jsonl.d.ts +43 -0
- package/dist/internal/persistence/markdown-config-loader.d.cts +35 -0
- package/dist/internal/persistence/markdown-config-loader.d.ts +35 -0
- package/dist/internal/persistence/pagination.d.cts +21 -0
- package/dist/internal/persistence/pagination.d.ts +21 -0
- package/dist/internal/persistence/paths.d.cts +137 -0
- package/dist/internal/persistence/paths.d.ts +137 -0
- package/dist/internal/persistence/persistence-schema.d.cts +29 -0
- package/dist/internal/persistence/persistence-schema.d.ts +29 -0
- package/dist/internal/persistence/schema-version.d.cts +227 -0
- package/dist/internal/persistence/schema-version.d.ts +227 -0
- package/dist/internal/persistence/session-artifacts.d.cts +27 -0
- package/dist/internal/persistence/session-artifacts.d.ts +27 -0
- package/dist/internal/persistence/session-dir.d.cts +1 -0
- package/dist/internal/persistence/session-dir.d.ts +1 -0
- package/dist/internal/persistence/session-transcript.d.cts +128 -0
- package/dist/internal/persistence/session-transcript.d.ts +128 -0
- package/dist/internal/persistence/session-writer.d.cts +104 -0
- package/dist/internal/persistence/session-writer.d.ts +104 -0
- package/dist/internal/persistence/sqlite-cas.d.cts +61 -0
- package/dist/internal/persistence/sqlite-cas.d.ts +61 -0
- package/dist/internal/persistence/sqlite-open.d.cts +61 -0
- package/dist/internal/persistence/sqlite-open.d.ts +61 -0
- package/dist/internal/persistence/sqlite-wal.d.cts +54 -0
- package/dist/internal/persistence/sqlite-wal.d.ts +54 -0
- package/dist/internal/persistence/transcript-ops.d.cts +99 -0
- package/dist/internal/persistence/transcript-ops.d.ts +99 -0
- package/dist/internal/personality/context.d.ts +17 -0
- package/dist/internal/personality/registry.d.ts +17 -0
- package/dist/internal/personality/store.d.ts +27 -0
- package/dist/internal/personality/switch.d.ts +36 -0
- package/dist/internal/personality/types.d.ts +18 -0
- package/dist/internal/plugins/context.d.cts +21 -0
- package/dist/internal/plugins/context.d.ts +21 -0
- package/dist/internal/plugins/enabled-names.d.cts +1 -0
- package/dist/internal/plugins/enabled-names.d.ts +1 -0
- package/dist/internal/plugins/index.d.cts +9 -0
- package/dist/internal/plugins/index.d.ts +9 -0
- package/dist/internal/plugins/lifecycle.d.cts +15 -0
- package/dist/internal/plugins/lifecycle.d.ts +15 -0
- package/dist/internal/plugins/manager.d.cts +57 -0
- package/dist/internal/plugins/manager.d.ts +57 -0
- package/dist/internal/plugins/plugin-guards.d.cts +13 -0
- package/dist/internal/plugins/plugin-guards.d.ts +13 -0
- package/dist/internal/plugins/types.d.cts +26 -0
- package/dist/internal/plugins/types.d.ts +26 -0
- package/dist/internal/providers/builtin/anthropic.d.ts +2 -0
- package/dist/internal/providers/builtin/bedrock.d.ts +25 -0
- package/dist/internal/providers/builtin/cerebras.d.ts +5 -0
- package/dist/internal/providers/builtin/cohere.d.ts +8 -0
- package/dist/internal/providers/builtin/deepinfra.d.ts +2 -0
- package/dist/internal/providers/builtin/gemini.d.ts +10 -0
- package/dist/internal/providers/builtin/google.d.ts +6 -0
- package/dist/internal/providers/builtin/groq.d.ts +2 -0
- package/dist/internal/providers/builtin/index.d.ts +20 -0
- package/dist/internal/providers/builtin/llamacpp.d.ts +1 -0
- package/dist/internal/providers/builtin/lmstudio.d.ts +1 -0
- package/dist/internal/providers/builtin/mistral.d.ts +2 -0
- package/dist/internal/providers/builtin/ollama.d.ts +17 -0
- package/dist/internal/providers/builtin/openai-chatgpt.d.ts +14 -0
- package/dist/internal/providers/builtin/openai-compatible.d.ts +1 -0
- package/dist/internal/providers/builtin/openai.d.ts +2 -0
- package/dist/internal/providers/builtin/openrouter.d.ts +2 -0
- package/dist/internal/providers/builtin/perplexity.d.ts +5 -0
- package/dist/internal/providers/builtin/together.d.ts +2 -0
- package/dist/internal/providers/builtin/vertex.d.ts +27 -0
- package/dist/internal/providers/builtin/xai.d.ts +2 -0
- package/dist/internal/providers/catalog-loader.d.ts +55 -0
- package/dist/internal/providers/catalog-schema.d.ts +202 -0
- package/dist/internal/providers/catalog-source-models-dev.d.ts +80 -0
- package/dist/internal/providers/discovery.d.ts +14 -0
- package/dist/internal/providers/index.d.ts +8 -0
- package/dist/internal/providers/register-plugin-providers.d.ts +22 -0
- package/dist/internal/providers/registry.d.ts +13 -0
- package/dist/internal/providers/types.d.ts +11 -0
- package/dist/internal/retry/circuit-breaker.d.ts +26 -0
- package/dist/internal/retry/with-retry.d.ts +40 -0
- package/dist/internal/runtime/compat/compat-config-file.d.ts +31 -0
- package/dist/internal/runtime/compat/foreign-config-sources.d.ts +139 -0
- package/dist/internal/runtime/compression/compression-attempt.d.ts +24 -0
- package/dist/internal/runtime/compression/compression-config.d.ts +33 -0
- package/dist/internal/runtime/compression/compression-decision.d.ts +10 -0
- package/dist/internal/runtime/compression/compression-helpers.d.ts +18 -0
- package/dist/internal/runtime/compression/compression-model-registry.d.ts +41 -0
- package/dist/internal/runtime/compression/compression-summarizer.d.ts +34 -0
- package/dist/internal/runtime/config/default-model.d.ts +1 -0
- package/dist/internal/runtime/config/providers-manager.d.ts +1 -0
- package/dist/internal/runtime/config/workspace-dir.d.ts +9 -0
- package/dist/internal/runtime/context/context-aggregator.d.ts +26 -0
- package/dist/internal/runtime/context/context-discovery-runner.d.ts +80 -0
- package/dist/internal/runtime/context/context-discovery.d.ts +79 -0
- package/dist/internal/runtime/context/context-frontmatter.d.ts +16 -0
- package/dist/internal/runtime/context/context-glob.d.ts +1 -0
- package/dist/internal/runtime/context/context-import-resolver.d.ts +41 -0
- package/dist/internal/runtime/context/context-loaders.d.ts +42 -0
- package/dist/internal/runtime/context/context-manager.d.ts +28 -0
- package/dist/internal/runtime/context/context-mdc-parser.d.ts +25 -0
- package/dist/internal/runtime/context/context-rules-frontmatter.d.ts +99 -0
- package/dist/internal/runtime/context/context-yaml-lite.d.ts +26 -0
- package/dist/internal/runtime/context/project-instructions.d.ts +66 -0
- package/dist/internal/runtime/context/yaml-frontmatter.d.ts +20 -0
- package/dist/internal/runtime/fixtures/fixture-events.d.ts +12 -0
- package/dist/internal/runtime/fixtures/fixture-mode.d.ts +24 -0
- package/dist/internal/runtime/fixtures/fixture-responder.d.ts +1 -0
- package/dist/internal/runtime/fixtures/fixture-run-base.d.ts +96 -0
- package/dist/internal/runtime/fixtures/fixture-scripts.d.ts +21 -0
- package/dist/internal/runtime/fixtures/types.d.ts +1 -0
- package/dist/internal/runtime/hooks/hooks-executor.d.ts +49 -0
- package/dist/internal/runtime/hooks/hooks-source.d.ts +35 -0
- package/dist/internal/runtime/lifecycle/context-budget-event.d.ts +25 -0
- package/dist/internal/runtime/lifecycle/env-policy.d.ts +29 -0
- package/dist/internal/runtime/lifecycle/fork-agent.d.ts +15 -0
- package/dist/internal/runtime/lifecycle/goal-marker.d.ts +13 -0
- package/dist/internal/runtime/lifecycle/post-run-lifecycle.d.ts +16 -0
- package/dist/internal/runtime/lifecycle/run-to-completion.d.ts +22 -0
- package/dist/internal/runtime/lifecycle/run-until.d.ts +21 -0
- package/dist/internal/runtime/lifecycle/spawn-collect.d.ts +8 -0
- package/dist/internal/runtime/lifecycle/stream-to-completion.d.ts +31 -0
- package/dist/internal/runtime/lifecycle/wrap-completion-check-run.d.ts +30 -0
- package/dist/internal/runtime/memory-glue/memory-provider.d.ts +11 -0
- package/dist/internal/runtime/memory-glue/memory-store.d.ts +4 -0
- package/dist/internal/runtime/memory-glue/select-facts.d.ts +63 -0
- package/dist/internal/runtime/model-selection.d.ts +14 -0
- package/dist/internal/runtime/plugin-loader/plugin-bundles.d.ts +22 -0
- package/dist/internal/runtime/plugin-loader/plugin-frontmatter.d.ts +17 -0
- package/dist/internal/runtime/plugin-loader/plugins-manager.d.ts +1 -0
- package/dist/internal/runtime/processors/run-processors.d.ts +10 -0
- package/dist/internal/runtime/processors/tripwire-run.d.ts +16 -0
- package/dist/internal/runtime/processors/wrap-output-run.d.ts +18 -0
- package/dist/internal/runtime/registry/agent-factory-registry.d.ts +19 -0
- package/dist/internal/runtime/registry/agent-registry-contract.d.ts +31 -0
- package/dist/internal/runtime/registry/agent-registry-store.d.ts +75 -0
- package/dist/internal/runtime/registry/agent-registry.d.ts +6 -0
- package/dist/internal/runtime/registry/live-agent-registry.d.ts +132 -0
- package/dist/internal/runtime/registry/run-registry.d.ts +4 -0
- package/dist/internal/runtime/skills/discover-skills.d.ts +103 -0
- package/dist/internal/runtime/skills/skill-frontmatter.d.ts +6 -0
- package/dist/internal/runtime/skills/skills-block.d.ts +18 -0
- package/dist/internal/runtime/skills/skills-manager.d.ts +1 -0
- package/dist/internal/runtime/skills/subagent-tool-scope.d.ts +25 -0
- package/dist/internal/runtime/skills/subagents-loader.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/escape.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/local-assembly.d.ts +2 -0
- package/dist/internal/runtime/system-prompt/native-reasoning.d.ts +25 -0
- package/dist/internal/runtime/system-prompt/pipeline.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/safe-call.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/sources/active-memory-provider.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/sources/base-provider.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/sources/context-provider.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/sources/memory-provider.d.ts +6 -0
- package/dist/internal/runtime/system-prompt/sources/reasoning-provider.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/sources/skills-provider.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/system-prompt.d.ts +1 -0
- package/dist/internal/runtime/system-prompt/types.d.ts +5 -0
- package/dist/internal/runtime/tools/shell-tool.d.ts +7 -0
- package/dist/internal/runtime/validation/validate-agent-options.d.ts +1 -0
- package/dist/internal/runtime/validation/validate-response.d.ts +18 -0
- package/dist/internal/scorers/levenshtein.d.ts +11 -0
- package/dist/internal/scorers/llm-judge.d.ts +41 -0
- package/dist/internal/security/index.cjs +52 -0
- package/dist/internal/security/index.cjs.map +1 -0
- package/dist/internal/security/index.d.cts +19 -0
- package/dist/internal/security/index.d.ts +19 -0
- package/dist/internal/security/index.js +7 -0
- package/dist/internal/security/index.js.map +1 -0
- package/dist/internal/security/path-containment.d.cts +24 -0
- package/dist/internal/security/path-containment.d.ts +24 -0
- package/dist/internal/security/path-guard.d.cts +166 -0
- package/dist/internal/security/path-guard.d.ts +166 -0
- package/dist/internal/security/redact.d.cts +74 -0
- package/dist/internal/security/redact.d.ts +74 -0
- package/dist/internal/security/test-reset.d.cts +10 -0
- package/dist/internal/security/test-reset.d.ts +10 -0
- package/dist/internal/session/agent-session-store.d.ts +65 -0
- package/dist/internal/session/agent-session.d.ts +48 -0
- package/dist/internal/session/compact-session.d.ts +97 -0
- package/dist/internal/session/index.d.ts +7 -0
- package/dist/internal/session/inject-session.d.ts +15 -0
- package/dist/internal/session/session-cache.d.ts +31 -0
- package/dist/internal/session/types.d.ts +46 -0
- package/dist/internal/structured-output-helpers.d.ts +54 -0
- package/dist/internal/task/registry.d.ts +60 -0
- package/dist/internal/task/ring-buffer.d.ts +10 -0
- package/dist/internal/task/store.d.ts +145 -0
- package/dist/internal/task/subscribe.d.ts +15 -0
- package/dist/internal/task/task-id.d.ts +22 -0
- package/dist/internal/task/task-run-event-bridge.d.ts +10 -0
- package/dist/internal/task/telemetry.d.ts +27 -0
- package/dist/internal/telemetry/adapter-registry.d.ts +12 -0
- package/dist/internal/telemetry/adapters/arize.d.ts +2 -0
- package/dist/internal/telemetry/adapters/braintrust.d.ts +7 -0
- package/dist/internal/telemetry/adapters/datadog.d.ts +2 -0
- package/dist/internal/telemetry/adapters/langfuse.d.ts +2 -0
- package/dist/internal/telemetry/adapters/langsmith.d.ts +7 -0
- package/dist/internal/telemetry/adapters/posthog.d.ts +2 -0
- package/dist/internal/telemetry/adapters/sentry.d.ts +2 -0
- package/dist/internal/telemetry/safe-require.d.ts +1 -0
- package/dist/internal/telemetry/span-names.d.ts +10 -0
- package/dist/internal/telemetry/tracer-loader.d.ts +20 -0
- package/dist/internal/telemetry/tracer.d.ts +57 -0
- package/dist/internal/tool-dispatch/repair-middleware.d.ts +34 -0
- package/dist/internal/tool-dispatch/strip-think.d.ts +22 -0
- package/dist/internal/tool-registry/personality-filter.d.ts +37 -0
- package/dist/internal/workflow/ctx.d.ts +24 -0
- package/dist/internal/workflow/error-shape.d.ts +7 -0
- package/dist/internal/workflow/event-stream.d.ts +13 -0
- package/dist/internal/workflow/evented-executor.d.ts +42 -0
- package/dist/internal/workflow/executor-helpers.d.ts +30 -0
- package/dist/internal/workflow/executor.d.ts +16 -0
- package/dist/internal/workflow/retry-policy.d.ts +14 -0
- package/dist/internal/workflow/run-id.d.ts +9 -0
- package/dist/internal/workflow/scheduler.d.ts +23 -0
- package/dist/internal/workflow/single-flight.d.ts +18 -0
- package/dist/internal/workflow/snapshot-store.d.ts +23 -0
- package/dist/internal/workflow/step-agent.d.ts +12 -0
- package/dist/internal/workflow/step-branch.d.ts +10 -0
- package/dist/internal/workflow/step-dowhile.d.ts +8 -0
- package/dist/internal/workflow/step-execution.d.ts +25 -0
- package/dist/internal/workflow/step-fn.d.ts +10 -0
- package/dist/internal/workflow/step-foreach.d.ts +11 -0
- package/dist/internal/workflow/step-parallel.d.ts +17 -0
- package/dist/internal/workflow/step-sleep.d.ts +7 -0
- package/dist/internal/workflow/telemetry.d.ts +21 -0
- package/dist/internal/zod-to-json-schema.d.ts +11 -0
- package/dist/job-queue.d.ts +68 -0
- package/dist/judge-call-46M2E5FA.cjs +22 -0
- package/dist/judge-call-46M2E5FA.cjs.map +1 -0
- package/dist/judge-call-FGUNNWEI.js +5 -0
- package/dist/judge-call-FGUNNWEI.js.map +1 -0
- package/dist/mcp-auth.cjs +314 -0
- package/dist/mcp-auth.cjs.map +1 -0
- package/dist/mcp-auth.d.cts +19 -0
- package/dist/mcp-auth.d.ts +19 -0
- package/dist/mcp-auth.js +307 -0
- package/dist/mcp-auth.js.map +1 -0
- package/dist/messages.cjs +24 -0
- package/dist/messages.cjs.map +1 -0
- package/dist/messages.d.cts +33 -0
- package/dist/messages.d.ts +33 -0
- package/dist/messages.js +20 -0
- package/dist/messages.js.map +1 -0
- package/dist/models.cjs +295 -0
- package/dist/models.cjs.map +1 -0
- package/dist/models.d.cts +18 -0
- package/dist/models.d.ts +18 -0
- package/dist/models.js +286 -0
- package/dist/models.js.map +1 -0
- package/dist/oauth-transaction-store-5RIR6D5C.js +5 -0
- package/dist/oauth-transaction-store-5RIR6D5C.js.map +1 -0
- package/dist/oauth-transaction-store-SXIE57OD.cjs +38 -0
- package/dist/oauth-transaction-store-SXIE57OD.cjs.map +1 -0
- package/dist/path-safety.cjs +39 -0
- package/dist/path-safety.cjs.map +1 -0
- package/dist/path-safety.d.cts +16 -0
- package/dist/path-safety.d.ts +16 -0
- package/dist/path-safety.js +6 -0
- package/dist/path-safety.js.map +1 -0
- package/dist/permission-engine.d.ts +134 -0
- package/dist/persistence.cjs +197 -0
- package/dist/persistence.cjs.map +1 -0
- package/dist/persistence.d.cts +40 -0
- package/dist/persistence.d.ts +40 -0
- package/dist/persistence.js +100 -0
- package/dist/persistence.js.map +1 -0
- package/dist/project.cjs +45 -0
- package/dist/project.cjs.map +1 -0
- package/dist/project.d.cts +14 -0
- package/dist/project.d.ts +14 -0
- package/dist/project.js +42 -0
- package/dist/project.js.map +1 -0
- package/dist/provider-catalog.json +1295 -0
- package/dist/providers.cjs +23 -0
- package/dist/providers.cjs.map +1 -0
- package/dist/providers.d.cts +31 -0
- package/dist/providers.d.ts +31 -0
- package/dist/providers.js +10 -0
- package/dist/providers.js.map +1 -0
- package/dist/registry-BZQFYRTL.cjs +46 -0
- package/dist/registry-BZQFYRTL.cjs.map +1 -0
- package/dist/registry-DMWCJKRF.js +9 -0
- package/dist/registry-DMWCJKRF.js.map +1 -0
- package/dist/retry.cjs +14 -0
- package/dist/retry.cjs.map +1 -0
- package/dist/retry.d.cts +35 -0
- package/dist/retry.d.ts +35 -0
- package/dist/retry.js +5 -0
- package/dist/retry.js.map +1 -0
- package/dist/run-CTAdRU3U.d.cts +1813 -0
- package/dist/run-CTAdRU3U.d.ts +1813 -0
- package/dist/run-to-completion-DRO77625.js +3 -0
- package/dist/run-to-completion-DRO77625.js.map +1 -0
- package/dist/run-to-completion-X4OWM673.cjs +48 -0
- package/dist/run-to-completion-X4OWM673.cjs.map +1 -0
- package/dist/run-until-6D6TQ4JN.js +146 -0
- package/dist/run-until-6D6TQ4JN.js.map +1 -0
- package/dist/run-until-DG2KXWB2.cjs +149 -0
- package/dist/run-until-DG2KXWB2.cjs.map +1 -0
- package/dist/sandbox/bwrap.d.cts +112 -0
- package/dist/sandbox/bwrap.d.ts +112 -0
- package/dist/sandbox/index.cjs +495 -0
- package/dist/sandbox/index.cjs.map +1 -0
- package/dist/sandbox/index.d.cts +13 -0
- package/dist/sandbox/index.d.ts +13 -0
- package/dist/sandbox/index.js +451 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/linux-sandbox.d.cts +218 -0
- package/dist/sandbox/linux-sandbox.d.ts +218 -0
- package/dist/sandbox/local-sandbox.d.cts +66 -0
- package/dist/sandbox/local-sandbox.d.ts +66 -0
- package/dist/sandbox/provision.d.cts +60 -0
- package/dist/sandbox/provision.d.ts +60 -0
- package/dist/sandbox/seccomp.d.cts +16 -0
- package/dist/sandbox/seccomp.d.ts +16 -0
- package/dist/sandbox/shell-escape.d.cts +8 -0
- package/dist/sandbox/shell-escape.d.ts +8 -0
- package/dist/sandbox/types.d.cts +143 -0
- package/dist/sandbox/types.d.ts +143 -0
- package/dist/sanitize/coerce.d.cts +1 -0
- package/dist/sanitize/coerce.d.ts +1 -0
- package/dist/sanitize/index.cjs +12 -0
- package/dist/sanitize/index.cjs.map +1 -0
- package/dist/sanitize/index.d.cts +9 -0
- package/dist/sanitize/index.d.ts +9 -0
- package/dist/sanitize/index.js +3 -0
- package/dist/sanitize/index.js.map +1 -0
- package/dist/sanitize/sanitize-tool-input.d.cts +11 -0
- package/dist/sanitize/sanitize-tool-input.d.ts +11 -0
- package/dist/sanitize/types.d.cts +52 -0
- package/dist/sanitize/types.d.ts +52 -0
- package/dist/scorers.d.ts +181 -0
- package/dist/sdk-agent-BOiKqOgL.d.cts +940 -0
- package/dist/sdk-agent-D4a_BR_6.d.ts +940 -0
- package/dist/server/auth/errors.d.cts +54 -0
- package/dist/server/auth/errors.d.ts +54 -0
- package/dist/server/auth/index.cjs +210 -0
- package/dist/server/auth/index.cjs.map +1 -0
- package/dist/server/auth/index.d.cts +244 -0
- package/dist/server/auth/index.d.ts +244 -0
- package/dist/server/auth/index.js +189 -0
- package/dist/server/auth/index.js.map +1 -0
- package/dist/server/auth/oauth-transaction-store.d.cts +52 -0
- package/dist/server/auth/oauth-transaction-store.d.ts +52 -0
- package/dist/server/auth/orchestrator.d.cts +15 -0
- package/dist/server/auth/orchestrator.d.ts +15 -0
- package/dist/server/auth/types.d.cts +109 -0
- package/dist/server/auth/types.d.ts +109 -0
- package/dist/server/auth/validate-return-to.d.cts +27 -0
- package/dist/server/auth/validate-return-to.d.ts +27 -0
- package/dist/server/errors-envelope.cjs +101 -0
- package/dist/server/errors-envelope.cjs.map +1 -0
- package/dist/server/errors-envelope.d.cts +67 -0
- package/dist/server/errors-envelope.d.ts +67 -0
- package/dist/server/errors-envelope.js +95 -0
- package/dist/server/errors-envelope.js.map +1 -0
- package/dist/session-transcript-LGHSNVY5.cjs +62 -0
- package/dist/session-transcript-LGHSNVY5.cjs.map +1 -0
- package/dist/session-transcript-VTBTCGQX.js +5 -0
- package/dist/session-transcript-VTBTCGQX.js.map +1 -0
- package/dist/skills.cjs +25 -0
- package/dist/skills.cjs.map +1 -0
- package/dist/skills.d.cts +19 -0
- package/dist/skills.d.ts +19 -0
- package/dist/skills.js +8 -0
- package/dist/skills.js.map +1 -0
- package/dist/stream-object-HBFMIZLD.js +7 -0
- package/dist/stream-object-HBFMIZLD.js.map +1 -0
- package/dist/stream-object-QSKHISDJ.cjs +20 -0
- package/dist/stream-object-QSKHISDJ.cjs.map +1 -0
- package/dist/stream-object.d.ts +73 -0
- package/dist/stream-to-completion-QV5HCL3J.js +30 -0
- package/dist/stream-to-completion-QV5HCL3J.js.map +1 -0
- package/dist/stream-to-completion-SRISU5AB.cjs +32 -0
- package/dist/stream-to-completion-SRISU5AB.cjs.map +1 -0
- package/dist/subagents-loader-DOBTTICM.js +7 -0
- package/dist/subagents-loader-DOBTTICM.js.map +1 -0
- package/dist/subagents-loader-GEHYCMEX.cjs +16 -0
- package/dist/subagents-loader-GEHYCMEX.cjs.map +1 -0
- package/dist/subagents-loader.cjs +35 -0
- package/dist/subagents-loader.cjs.map +1 -0
- package/dist/subagents-loader.d.cts +90 -0
- package/dist/subagents-loader.d.ts +90 -0
- package/dist/subagents-loader.js +32 -0
- package/dist/subagents-loader.js.map +1 -0
- package/dist/subagents.cjs +18 -0
- package/dist/subagents.cjs.map +1 -0
- package/dist/subagents.d.cts +14 -0
- package/dist/subagents.d.ts +14 -0
- package/dist/subagents.js +15 -0
- package/dist/subagents.js.map +1 -0
- package/dist/subscription/define-subscription.d.cts +71 -0
- package/dist/subscription/define-subscription.d.ts +71 -0
- package/dist/subscription/index.cjs +408 -0
- package/dist/subscription/index.cjs.map +1 -0
- package/dist/subscription/index.d.cts +20 -0
- package/dist/subscription/index.d.ts +20 -0
- package/dist/subscription/index.js +400 -0
- package/dist/subscription/index.js.map +1 -0
- package/dist/subscription/internal/backpressure.d.cts +24 -0
- package/dist/subscription/internal/backpressure.d.ts +24 -0
- package/dist/subscription/internal/server-integration.d.cts +22 -0
- package/dist/subscription/internal/server-integration.d.ts +22 -0
- package/dist/subscription/internal/sse-encoder.d.cts +13 -0
- package/dist/subscription/internal/sse-encoder.d.ts +13 -0
- package/dist/subscription/internal/sse-parser.d.cts +15 -0
- package/dist/subscription/internal/sse-parser.d.ts +15 -0
- package/dist/subscription/internal/subscription-runtime.d.cts +21 -0
- package/dist/subscription/internal/subscription-runtime.d.ts +21 -0
- package/dist/subscription/internal/types.d.cts +11 -0
- package/dist/subscription/internal/types.d.ts +11 -0
- package/dist/subscription/internal/ws-adapter-node.d.cts +10 -0
- package/dist/subscription/internal/ws-adapter-node.d.ts +10 -0
- package/dist/subscription/theokit-subscribe.d.cts +54 -0
- package/dist/subscription/theokit-subscribe.d.ts +54 -0
- package/dist/subscription/types.d.cts +158 -0
- package/dist/subscription/types.d.ts +158 -0
- package/dist/task-errors.d.ts +58 -0
- package/dist/task-store.cjs +23 -0
- package/dist/task-store.cjs.map +1 -0
- package/dist/task-store.d.cts +10 -0
- package/dist/task-store.d.ts +10 -0
- package/dist/task-store.js +6 -0
- package/dist/task-store.js.map +1 -0
- package/dist/tool-error.d.ts +30 -0
- package/dist/types/agent-prims.d.ts +137 -0
- package/dist/types/agent.d.ts +947 -0
- package/dist/types/batch.d.ts +121 -0
- package/dist/types/budget-tracker.d.ts +80 -0
- package/dist/types/budget.d.ts +97 -0
- package/dist/types/content-blocks.d.ts +50 -0
- package/dist/types/context.d.ts +96 -0
- package/dist/types/conversation.d.ts +127 -0
- package/dist/types/cron.d.ts +172 -0
- package/dist/types/env-policy.d.ts +21 -0
- package/dist/types/eval.d.ts +255 -0
- package/dist/types/fork.d.ts +52 -0
- package/dist/types/goal-events.d.ts +144 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/mcp.d.ts +90 -0
- package/dist/types/memory-adapter.d.ts +189 -0
- package/dist/types/memory-provider.d.ts +206 -0
- package/dist/types/messages-base.d.ts +24 -0
- package/dist/types/messages.d.ts +161 -0
- package/dist/types/plugin.d.ts +308 -0
- package/dist/types/processors.d.ts +87 -0
- package/dist/types/provider-profile.d.ts +116 -0
- package/dist/types/providers.d.ts +116 -0
- package/dist/types/run-events.d.ts +197 -0
- package/dist/types/run.d.ts +671 -0
- package/dist/types/sdk-agent.d.ts +342 -0
- package/dist/types/session-message.d.ts +62 -0
- package/dist/types/session-record.d.ts +103 -0
- package/dist/types/session-store.d.ts +104 -0
- package/dist/types/task.d.ts +146 -0
- package/dist/types/theokit.d.ts +73 -0
- package/dist/types/trajectory.d.ts +52 -0
- package/dist/types/updates.d.ts +184 -0
- package/dist/types/usage.d.ts +64 -0
- package/dist/types/workflow.d.ts +426 -0
- package/dist/workflow-as-tool.d.ts +66 -0
- package/dist/workflow-errors.d.ts +164 -0
- package/dist/workflow.cjs +100 -0
- package/dist/workflow.cjs.map +1 -0
- package/dist/workflow.d.cts +911 -0
- package/dist/workflow.d.ts +911 -0
- package/dist/workflow.js +11 -0
- package/dist/workflow.js.map +1 -0
- package/docs/adr/README.md +2604 -0
- package/docs/error-codes.md +253 -0
- package/docs/harness-capability-map.md +1435 -0
- package/docs/memory-decisions.md +265 -0
- package/package.json +455 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { enqueueSessionWrite } from './chunk-AWINL3ZC.js';
|
|
2
|
+
import { invalidateSessionCache } from './chunk-2XC6KDJM.js';
|
|
3
|
+
import './chunk-2WXHA33T.js';
|
|
4
|
+
import { SessionTranscript } from './chunk-JOFVLOFY.js';
|
|
5
|
+
import './chunk-3JHIFQ4I.js';
|
|
6
|
+
import './chunk-AGACYRJ2.js';
|
|
7
|
+
import './chunk-CZJ6Q7CW.js';
|
|
8
|
+
|
|
9
|
+
// src/internal/session/inject-session.ts
|
|
10
|
+
async function injectSessionTurn(opts) {
|
|
11
|
+
await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
|
|
12
|
+
const prior = await opts.store.readRecords(opts.loc.agentId);
|
|
13
|
+
const transcript = SessionTranscript.fromRecords(prior, {
|
|
14
|
+
cwd: opts.loc.cwd,
|
|
15
|
+
sessionId: opts.sessionId,
|
|
16
|
+
model: opts.loc.model ?? "unknown"
|
|
17
|
+
});
|
|
18
|
+
transcript.appendUserTurn(opts.userText);
|
|
19
|
+
transcript.appendAssistantTurn({ text: opts.assistantText });
|
|
20
|
+
await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));
|
|
21
|
+
invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { injectSessionTurn };
|
|
26
|
+
//# sourceMappingURL=inject-session-SUM6TDJF.js.map
|
|
27
|
+
//# sourceMappingURL=inject-session-SUM6TDJF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-SUM6TDJF.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkY2KYR2ED_cjs = require('./chunk-Y2KYR2ED.cjs');
|
|
4
|
+
var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
|
|
5
|
+
require('./chunk-YIFFF23U.cjs');
|
|
6
|
+
var chunkGZV6AVRL_cjs = require('./chunk-GZV6AVRL.cjs');
|
|
7
|
+
require('./chunk-JLRLCBJ4.cjs');
|
|
8
|
+
require('./chunk-NVXXWAU7.cjs');
|
|
9
|
+
require('./chunk-6LHQPOMI.cjs');
|
|
10
|
+
|
|
11
|
+
// src/internal/session/inject-session.ts
|
|
12
|
+
async function injectSessionTurn(opts) {
|
|
13
|
+
await chunkY2KYR2ED_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
|
|
14
|
+
const prior = await opts.store.readRecords(opts.loc.agentId);
|
|
15
|
+
const transcript = chunkGZV6AVRL_cjs.SessionTranscript.fromRecords(prior, {
|
|
16
|
+
cwd: opts.loc.cwd,
|
|
17
|
+
sessionId: opts.sessionId,
|
|
18
|
+
model: opts.loc.model ?? "unknown"
|
|
19
|
+
});
|
|
20
|
+
transcript.appendUserTurn(opts.userText);
|
|
21
|
+
transcript.appendAssistantTurn({ text: opts.assistantText });
|
|
22
|
+
await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));
|
|
23
|
+
chunkYJNYDJ2T_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.injectSessionTurn = injectSessionTurn;
|
|
28
|
+
//# sourceMappingURL=inject-session-W6A46J3E.cjs.map
|
|
29
|
+
//# sourceMappingURL=inject-session-W6A46J3E.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-W6A46J3E.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkJ7J7J2GN_cjs = require('../chunk-J7J7J2GN.cjs');
|
|
4
|
+
require('../chunk-6LHQPOMI.cjs');
|
|
5
|
+
|
|
6
|
+
// src/interactive/types.ts
|
|
7
|
+
var InteractiveUnavailableError = class extends chunkJ7J7J2GN_cjs.TheokitAgentError {
|
|
8
|
+
name = "InteractiveUnavailableError";
|
|
9
|
+
code = "interactive_unavailable";
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message, { code: "interactive_unavailable", isRetryable: false });
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var NoSuchSessionError = class extends chunkJ7J7J2GN_cjs.TheokitAgentError {
|
|
15
|
+
name = "NoSuchSessionError";
|
|
16
|
+
code = "no_such_session";
|
|
17
|
+
constructor(sessionId) {
|
|
18
|
+
super(`no such live session "${sessionId}" (it may have exited or been killed)`, {
|
|
19
|
+
code: "no_such_session",
|
|
20
|
+
isRetryable: false
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
var InteractiveBackend = class {
|
|
25
|
+
};
|
|
26
|
+
async function resolveInteractive(provider, ctx) {
|
|
27
|
+
return provider instanceof InteractiveBackend ? provider : provider(ctx);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.InteractiveBackend = InteractiveBackend;
|
|
31
|
+
exports.InteractiveUnavailableError = InteractiveUnavailableError;
|
|
32
|
+
exports.NoSuchSessionError = NoSuchSessionError;
|
|
33
|
+
exports.resolveInteractive = resolveInteractive;
|
|
34
|
+
//# sourceMappingURL=index.cjs.map
|
|
35
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/interactive/types.ts"],"names":["TheokitAgentError"],"mappings":";;;;;;AAyBO,IAAM,2BAAA,GAAN,cAA0CA,mCAAA,CAAkB;AAAA,EAC/C,IAAA,GAAO,6BAAA;AAAA,EACP,IAAA,GAAO,yBAAA;AAAA,EACzB,YAAY,OAAA,EAAiB;AAE3B,IAAA,KAAA,CAAM,SAAS,EAAE,IAAA,EAAM,yBAAA,EAA2B,WAAA,EAAa,OAAO,CAAA;AAAA,EACxE;AACF;AAMO,IAAM,kBAAA,GAAN,cAAiCA,mCAAA,CAAkB;AAAA,EACtC,IAAA,GAAO,oBAAA;AAAA,EACP,IAAA,GAAO,iBAAA;AAAA,EACzB,YAAY,SAAA,EAAmB;AAE7B,IAAA,KAAA,CAAM,CAAA,sBAAA,EAAyB,SAAS,CAAA,qCAAA,CAAA,EAAyC;AAAA,MAC/E,IAAA,EAAM,iBAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACd,CAAA;AAAA,EACH;AACF;AA2CO,IAAe,qBAAf,MAAkC;AAmBzC;AAcA,eAAsB,kBAAA,CACpB,UACA,GAAA,EAC6B;AAC7B,EAAA,OAAO,QAAA,YAAoB,kBAAA,GAAqB,QAAA,GAAW,QAAA,CAAS,GAAG,CAAA;AACzE","file":"index.cjs","sourcesContent":["/**\n * Interactive-session backend protocol — the streaming twin of `SandboxBackend`\n * (which is one-shot `execute`). A surface-agnostic contract for driving a\n * long-lived interactive process (a REPL, `git rebase -i`, any command that\n * PROMPTS for stdin): start → `session_id`, write to stdin, read incremental\n * output, kill.\n *\n * Injected exactly like {@link FilesystemProvider} (SE31) — the tool depends on\n * the interface, the HOST supplies the implementation, so the SAME tool runs on\n * a local PTY (`@theokit/sdk-pty`), a container/E2B backend (cluster/web), or a\n * desktop backend (Tauri) with NO tool change and NO native dependency in core.\n *\n * @public\n */\n\nimport { TheokitAgentError } from \"../errors.js\";\n\n/** Thrown when the interactive path is requested but no backend can provide it\n * (no provider injected, or a local backend whose native module / spawn failed).\n * The caller falls back to non-interactive exec.\n *\n * Extends {@link TheokitAgentError} like every other typed error the SDK publishes: it used to\n * extend bare `Error`, so a consumer catching `TheokitAgentError` — the documented way to catch\n * anything this SDK throws — missed it, and it carried no `isRetryable`. Additive: `instanceof\n * Error` and the `code` literal are unchanged. */\nexport class InteractiveUnavailableError extends TheokitAgentError {\n override readonly name = \"InteractiveUnavailableError\";\n override readonly code = \"interactive_unavailable\" as const;\n constructor(message: string) {\n // Not retryable: no backend is a configuration fact, and retrying re-asks the same question.\n super(message, { code: \"interactive_unavailable\", isRetryable: false });\n }\n}\n\n/** Thrown (typed) when a write/kill targets an unknown or already-exited session,\n * so callers branch on the type instead of string-matching a message.\n *\n * Extends {@link TheokitAgentError} — see {@link InteractiveUnavailableError} for why. */\nexport class NoSuchSessionError extends TheokitAgentError {\n override readonly name = \"NoSuchSessionError\";\n override readonly code = \"no_such_session\" as const;\n constructor(sessionId: string) {\n // Not retryable: the session is gone, and it does not come back.\n super(`no such live session \"${sessionId}\" (it may have exited or been killed)`, {\n code: \"no_such_session\",\n isRetryable: false,\n });\n }\n}\n\n/** Result of starting a session: its id + whatever the program printed on startup. */\nexport interface StartInteractiveResult {\n sessionId: string;\n output: string;\n}\n\n/** Result of writing to a session: the output produced during the yield window + liveness. */\nexport interface WriteStdinResult {\n output: string;\n alive: boolean;\n}\n\n/** Bounds a start call. All optional; a backend clamps/defaults each. */\nexport interface StartInteractiveOptions {\n /** Working directory for the session. Defaults to the backend's root. */\n cwd?: string;\n /** How long to wait, in ms, before returning the startup output (clamped by the backend). */\n yieldMs?: number;\n /** Idle time, in ms, after which the backend reaps a forgotten session. */\n ttlMs?: number;\n /** Cap on the returned output bytes (tail kept). */\n maxBytes?: number;\n /** Terminal geometry, when the backend allocates a real TTY. */\n cols?: number;\n rows?: number;\n}\n\n/** Bounds a write call. */\nexport interface WriteStdinOptions {\n yieldMs?: number;\n ttlMs?: number;\n maxBytes?: number;\n}\n\n/**\n * Pluggable interactive-session backend. Implement the three abstract methods.\n * A backend that cannot provide interactive sessions should not be constructed —\n * callers detect absence by catching {@link InteractiveUnavailableError}.\n *\n * @public\n */\nexport abstract class InteractiveBackend {\n /** Spawn `command` as an interactive session; resolve after the yield window with the\n * `session_id` + startup output. Throws {@link InteractiveUnavailableError} when the\n * session cannot be allocated. */\n abstract startInteractive(\n command: string,\n opts?: StartInteractiveOptions,\n ): Promise<StartInteractiveResult>;\n\n /** Write `chars` to a live session's stdin; resolve after the yield window with the output it\n * produced + whether it is still alive. Throws {@link NoSuchSessionError} on an unknown session. */\n abstract writeStdin(\n sessionId: string,\n chars: string,\n opts?: WriteStdinOptions,\n ): Promise<WriteStdinResult>;\n\n /** Kill a session (idempotent) and free its slot. */\n abstract kill(sessionId: string): void;\n}\n\n/**\n * A backend OR a per-request resolver of one — mirrors {@link FilesystemProvider}. A resolver runs\n * at tool-execution time (request scope), so multi-tenant / multi-role agents get a distinct backend\n * per request without a shared mutable one.\n *\n * @public\n */\nexport type InteractiveProvider<Ctx = unknown> =\n | InteractiveBackend\n | ((ctx: Ctx) => InteractiveBackend | Promise<InteractiveBackend>);\n\n/** Resolve an {@link InteractiveProvider} to a concrete backend for `ctx`. */\nexport async function resolveInteractive<Ctx>(\n provider: InteractiveProvider<Ctx>,\n ctx: Ctx,\n): Promise<InteractiveBackend> {\n return provider instanceof InteractiveBackend ? provider : provider(ctx);\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@theokit/sdk/interactive` — pluggable interactive-session backend seam.
|
|
3
|
+
*
|
|
4
|
+
* The streaming twin of `@theokit/sdk/sandbox` (one-shot `execute`) and sibling
|
|
5
|
+
* of `@theokit/sdk/filesystem`. Ship an `InteractiveBackend` (e.g. the local
|
|
6
|
+
* `@theokit/sdk-pty`, a container/E2B backend for the cluster, or a Tauri
|
|
7
|
+
* backend) to give agent shell tools a surface-agnostic REPL/stdin capability —
|
|
8
|
+
* with NO native dependency in core.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export { InteractiveBackend, type InteractiveProvider, InteractiveUnavailableError, NoSuchSessionError, resolveInteractive, type StartInteractiveOptions, type StartInteractiveResult, type WriteStdinOptions, type WriteStdinResult, } from "./types.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@theokit/sdk/interactive` — pluggable interactive-session backend seam.
|
|
3
|
+
*
|
|
4
|
+
* The streaming twin of `@theokit/sdk/sandbox` (one-shot `execute`) and sibling
|
|
5
|
+
* of `@theokit/sdk/filesystem`. Ship an `InteractiveBackend` (e.g. the local
|
|
6
|
+
* `@theokit/sdk-pty`, a container/E2B backend for the cluster, or a Tauri
|
|
7
|
+
* backend) to give agent shell tools a surface-agnostic REPL/stdin capability —
|
|
8
|
+
* with NO native dependency in core.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export { InteractiveBackend, type InteractiveProvider, InteractiveUnavailableError, NoSuchSessionError, resolveInteractive, type StartInteractiveOptions, type StartInteractiveResult, type WriteStdinOptions, type WriteStdinResult, } from "./types.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TheokitAgentError } from '../chunk-ALUN2B4W.js';
|
|
2
|
+
import '../chunk-CZJ6Q7CW.js';
|
|
3
|
+
|
|
4
|
+
// src/interactive/types.ts
|
|
5
|
+
var InteractiveUnavailableError = class extends TheokitAgentError {
|
|
6
|
+
name = "InteractiveUnavailableError";
|
|
7
|
+
code = "interactive_unavailable";
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message, { code: "interactive_unavailable", isRetryable: false });
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var NoSuchSessionError = class extends TheokitAgentError {
|
|
13
|
+
name = "NoSuchSessionError";
|
|
14
|
+
code = "no_such_session";
|
|
15
|
+
constructor(sessionId) {
|
|
16
|
+
super(`no such live session "${sessionId}" (it may have exited or been killed)`, {
|
|
17
|
+
code: "no_such_session",
|
|
18
|
+
isRetryable: false
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var InteractiveBackend = class {
|
|
23
|
+
};
|
|
24
|
+
async function resolveInteractive(provider, ctx) {
|
|
25
|
+
return provider instanceof InteractiveBackend ? provider : provider(ctx);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { InteractiveBackend, InteractiveUnavailableError, NoSuchSessionError, resolveInteractive };
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/interactive/types.ts"],"names":[],"mappings":";;;;AAyBO,IAAM,2BAAA,GAAN,cAA0C,iBAAA,CAAkB;AAAA,EAC/C,IAAA,GAAO,6BAAA;AAAA,EACP,IAAA,GAAO,yBAAA;AAAA,EACzB,YAAY,OAAA,EAAiB;AAE3B,IAAA,KAAA,CAAM,SAAS,EAAE,IAAA,EAAM,yBAAA,EAA2B,WAAA,EAAa,OAAO,CAAA;AAAA,EACxE;AACF;AAMO,IAAM,kBAAA,GAAN,cAAiC,iBAAA,CAAkB;AAAA,EACtC,IAAA,GAAO,oBAAA;AAAA,EACP,IAAA,GAAO,iBAAA;AAAA,EACzB,YAAY,SAAA,EAAmB;AAE7B,IAAA,KAAA,CAAM,CAAA,sBAAA,EAAyB,SAAS,CAAA,qCAAA,CAAA,EAAyC;AAAA,MAC/E,IAAA,EAAM,iBAAA;AAAA,MACN,WAAA,EAAa;AAAA,KACd,CAAA;AAAA,EACH;AACF;AA2CO,IAAe,qBAAf,MAAkC;AAmBzC;AAcA,eAAsB,kBAAA,CACpB,UACA,GAAA,EAC6B;AAC7B,EAAA,OAAO,QAAA,YAAoB,kBAAA,GAAqB,QAAA,GAAW,QAAA,CAAS,GAAG,CAAA;AACzE","file":"index.js","sourcesContent":["/**\n * Interactive-session backend protocol — the streaming twin of `SandboxBackend`\n * (which is one-shot `execute`). A surface-agnostic contract for driving a\n * long-lived interactive process (a REPL, `git rebase -i`, any command that\n * PROMPTS for stdin): start → `session_id`, write to stdin, read incremental\n * output, kill.\n *\n * Injected exactly like {@link FilesystemProvider} (SE31) — the tool depends on\n * the interface, the HOST supplies the implementation, so the SAME tool runs on\n * a local PTY (`@theokit/sdk-pty`), a container/E2B backend (cluster/web), or a\n * desktop backend (Tauri) with NO tool change and NO native dependency in core.\n *\n * @public\n */\n\nimport { TheokitAgentError } from \"../errors.js\";\n\n/** Thrown when the interactive path is requested but no backend can provide it\n * (no provider injected, or a local backend whose native module / spawn failed).\n * The caller falls back to non-interactive exec.\n *\n * Extends {@link TheokitAgentError} like every other typed error the SDK publishes: it used to\n * extend bare `Error`, so a consumer catching `TheokitAgentError` — the documented way to catch\n * anything this SDK throws — missed it, and it carried no `isRetryable`. Additive: `instanceof\n * Error` and the `code` literal are unchanged. */\nexport class InteractiveUnavailableError extends TheokitAgentError {\n override readonly name = \"InteractiveUnavailableError\";\n override readonly code = \"interactive_unavailable\" as const;\n constructor(message: string) {\n // Not retryable: no backend is a configuration fact, and retrying re-asks the same question.\n super(message, { code: \"interactive_unavailable\", isRetryable: false });\n }\n}\n\n/** Thrown (typed) when a write/kill targets an unknown or already-exited session,\n * so callers branch on the type instead of string-matching a message.\n *\n * Extends {@link TheokitAgentError} — see {@link InteractiveUnavailableError} for why. */\nexport class NoSuchSessionError extends TheokitAgentError {\n override readonly name = \"NoSuchSessionError\";\n override readonly code = \"no_such_session\" as const;\n constructor(sessionId: string) {\n // Not retryable: the session is gone, and it does not come back.\n super(`no such live session \"${sessionId}\" (it may have exited or been killed)`, {\n code: \"no_such_session\",\n isRetryable: false,\n });\n }\n}\n\n/** Result of starting a session: its id + whatever the program printed on startup. */\nexport interface StartInteractiveResult {\n sessionId: string;\n output: string;\n}\n\n/** Result of writing to a session: the output produced during the yield window + liveness. */\nexport interface WriteStdinResult {\n output: string;\n alive: boolean;\n}\n\n/** Bounds a start call. All optional; a backend clamps/defaults each. */\nexport interface StartInteractiveOptions {\n /** Working directory for the session. Defaults to the backend's root. */\n cwd?: string;\n /** How long to wait, in ms, before returning the startup output (clamped by the backend). */\n yieldMs?: number;\n /** Idle time, in ms, after which the backend reaps a forgotten session. */\n ttlMs?: number;\n /** Cap on the returned output bytes (tail kept). */\n maxBytes?: number;\n /** Terminal geometry, when the backend allocates a real TTY. */\n cols?: number;\n rows?: number;\n}\n\n/** Bounds a write call. */\nexport interface WriteStdinOptions {\n yieldMs?: number;\n ttlMs?: number;\n maxBytes?: number;\n}\n\n/**\n * Pluggable interactive-session backend. Implement the three abstract methods.\n * A backend that cannot provide interactive sessions should not be constructed —\n * callers detect absence by catching {@link InteractiveUnavailableError}.\n *\n * @public\n */\nexport abstract class InteractiveBackend {\n /** Spawn `command` as an interactive session; resolve after the yield window with the\n * `session_id` + startup output. Throws {@link InteractiveUnavailableError} when the\n * session cannot be allocated. */\n abstract startInteractive(\n command: string,\n opts?: StartInteractiveOptions,\n ): Promise<StartInteractiveResult>;\n\n /** Write `chars` to a live session's stdin; resolve after the yield window with the output it\n * produced + whether it is still alive. Throws {@link NoSuchSessionError} on an unknown session. */\n abstract writeStdin(\n sessionId: string,\n chars: string,\n opts?: WriteStdinOptions,\n ): Promise<WriteStdinResult>;\n\n /** Kill a session (idempotent) and free its slot. */\n abstract kill(sessionId: string): void;\n}\n\n/**\n * A backend OR a per-request resolver of one — mirrors {@link FilesystemProvider}. A resolver runs\n * at tool-execution time (request scope), so multi-tenant / multi-role agents get a distinct backend\n * per request without a shared mutable one.\n *\n * @public\n */\nexport type InteractiveProvider<Ctx = unknown> =\n | InteractiveBackend\n | ((ctx: Ctx) => InteractiveBackend | Promise<InteractiveBackend>);\n\n/** Resolve an {@link InteractiveProvider} to a concrete backend for `ctx`. */\nexport async function resolveInteractive<Ctx>(\n provider: InteractiveProvider<Ctx>,\n ctx: Ctx,\n): Promise<InteractiveBackend> {\n return provider instanceof InteractiveBackend ? provider : provider(ctx);\n}\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive-session backend protocol — the streaming twin of `SandboxBackend`
|
|
3
|
+
* (which is one-shot `execute`). A surface-agnostic contract for driving a
|
|
4
|
+
* long-lived interactive process (a REPL, `git rebase -i`, any command that
|
|
5
|
+
* PROMPTS for stdin): start → `session_id`, write to stdin, read incremental
|
|
6
|
+
* output, kill.
|
|
7
|
+
*
|
|
8
|
+
* Injected exactly like {@link FilesystemProvider} (SE31) — the tool depends on
|
|
9
|
+
* the interface, the HOST supplies the implementation, so the SAME tool runs on
|
|
10
|
+
* a local PTY (`@theokit/sdk-pty`), a container/E2B backend (cluster/web), or a
|
|
11
|
+
* desktop backend (Tauri) with NO tool change and NO native dependency in core.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
import { TheokitAgentError } from "../errors.js";
|
|
16
|
+
/** Thrown when the interactive path is requested but no backend can provide it
|
|
17
|
+
* (no provider injected, or a local backend whose native module / spawn failed).
|
|
18
|
+
* The caller falls back to non-interactive exec.
|
|
19
|
+
*
|
|
20
|
+
* Extends {@link TheokitAgentError} like every other typed error the SDK publishes: it used to
|
|
21
|
+
* extend bare `Error`, so a consumer catching `TheokitAgentError` — the documented way to catch
|
|
22
|
+
* anything this SDK throws — missed it, and it carried no `isRetryable`. Additive: `instanceof
|
|
23
|
+
* Error` and the `code` literal are unchanged. */
|
|
24
|
+
export declare class InteractiveUnavailableError extends TheokitAgentError {
|
|
25
|
+
readonly name = "InteractiveUnavailableError";
|
|
26
|
+
readonly code: "interactive_unavailable";
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
/** Thrown (typed) when a write/kill targets an unknown or already-exited session,
|
|
30
|
+
* so callers branch on the type instead of string-matching a message.
|
|
31
|
+
*
|
|
32
|
+
* Extends {@link TheokitAgentError} — see {@link InteractiveUnavailableError} for why. */
|
|
33
|
+
export declare class NoSuchSessionError extends TheokitAgentError {
|
|
34
|
+
readonly name = "NoSuchSessionError";
|
|
35
|
+
readonly code: "no_such_session";
|
|
36
|
+
constructor(sessionId: string);
|
|
37
|
+
}
|
|
38
|
+
/** Result of starting a session: its id + whatever the program printed on startup. */
|
|
39
|
+
export interface StartInteractiveResult {
|
|
40
|
+
sessionId: string;
|
|
41
|
+
output: string;
|
|
42
|
+
}
|
|
43
|
+
/** Result of writing to a session: the output produced during the yield window + liveness. */
|
|
44
|
+
export interface WriteStdinResult {
|
|
45
|
+
output: string;
|
|
46
|
+
alive: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Bounds a start call. All optional; a backend clamps/defaults each. */
|
|
49
|
+
export interface StartInteractiveOptions {
|
|
50
|
+
/** Working directory for the session. Defaults to the backend's root. */
|
|
51
|
+
cwd?: string;
|
|
52
|
+
/** How long to wait, in ms, before returning the startup output (clamped by the backend). */
|
|
53
|
+
yieldMs?: number;
|
|
54
|
+
/** Idle time, in ms, after which the backend reaps a forgotten session. */
|
|
55
|
+
ttlMs?: number;
|
|
56
|
+
/** Cap on the returned output bytes (tail kept). */
|
|
57
|
+
maxBytes?: number;
|
|
58
|
+
/** Terminal geometry, when the backend allocates a real TTY. */
|
|
59
|
+
cols?: number;
|
|
60
|
+
rows?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Bounds a write call. */
|
|
63
|
+
export interface WriteStdinOptions {
|
|
64
|
+
yieldMs?: number;
|
|
65
|
+
ttlMs?: number;
|
|
66
|
+
maxBytes?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Pluggable interactive-session backend. Implement the three abstract methods.
|
|
70
|
+
* A backend that cannot provide interactive sessions should not be constructed —
|
|
71
|
+
* callers detect absence by catching {@link InteractiveUnavailableError}.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare abstract class InteractiveBackend {
|
|
76
|
+
/** Spawn `command` as an interactive session; resolve after the yield window with the
|
|
77
|
+
* `session_id` + startup output. Throws {@link InteractiveUnavailableError} when the
|
|
78
|
+
* session cannot be allocated. */
|
|
79
|
+
abstract startInteractive(command: string, opts?: StartInteractiveOptions): Promise<StartInteractiveResult>;
|
|
80
|
+
/** Write `chars` to a live session's stdin; resolve after the yield window with the output it
|
|
81
|
+
* produced + whether it is still alive. Throws {@link NoSuchSessionError} on an unknown session. */
|
|
82
|
+
abstract writeStdin(sessionId: string, chars: string, opts?: WriteStdinOptions): Promise<WriteStdinResult>;
|
|
83
|
+
/** Kill a session (idempotent) and free its slot. */
|
|
84
|
+
abstract kill(sessionId: string): void;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A backend OR a per-request resolver of one — mirrors {@link FilesystemProvider}. A resolver runs
|
|
88
|
+
* at tool-execution time (request scope), so multi-tenant / multi-role agents get a distinct backend
|
|
89
|
+
* per request without a shared mutable one.
|
|
90
|
+
*
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
export type InteractiveProvider<Ctx = unknown> = InteractiveBackend | ((ctx: Ctx) => InteractiveBackend | Promise<InteractiveBackend>);
|
|
94
|
+
/** Resolve an {@link InteractiveProvider} to a concrete backend for `ctx`. */
|
|
95
|
+
export declare function resolveInteractive<Ctx>(provider: InteractiveProvider<Ctx>, ctx: Ctx): Promise<InteractiveBackend>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive-session backend protocol — the streaming twin of `SandboxBackend`
|
|
3
|
+
* (which is one-shot `execute`). A surface-agnostic contract for driving a
|
|
4
|
+
* long-lived interactive process (a REPL, `git rebase -i`, any command that
|
|
5
|
+
* PROMPTS for stdin): start → `session_id`, write to stdin, read incremental
|
|
6
|
+
* output, kill.
|
|
7
|
+
*
|
|
8
|
+
* Injected exactly like {@link FilesystemProvider} (SE31) — the tool depends on
|
|
9
|
+
* the interface, the HOST supplies the implementation, so the SAME tool runs on
|
|
10
|
+
* a local PTY (`@theokit/sdk-pty`), a container/E2B backend (cluster/web), or a
|
|
11
|
+
* desktop backend (Tauri) with NO tool change and NO native dependency in core.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
import { TheokitAgentError } from "../errors.js";
|
|
16
|
+
/** Thrown when the interactive path is requested but no backend can provide it
|
|
17
|
+
* (no provider injected, or a local backend whose native module / spawn failed).
|
|
18
|
+
* The caller falls back to non-interactive exec.
|
|
19
|
+
*
|
|
20
|
+
* Extends {@link TheokitAgentError} like every other typed error the SDK publishes: it used to
|
|
21
|
+
* extend bare `Error`, so a consumer catching `TheokitAgentError` — the documented way to catch
|
|
22
|
+
* anything this SDK throws — missed it, and it carried no `isRetryable`. Additive: `instanceof
|
|
23
|
+
* Error` and the `code` literal are unchanged. */
|
|
24
|
+
export declare class InteractiveUnavailableError extends TheokitAgentError {
|
|
25
|
+
readonly name = "InteractiveUnavailableError";
|
|
26
|
+
readonly code: "interactive_unavailable";
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
/** Thrown (typed) when a write/kill targets an unknown or already-exited session,
|
|
30
|
+
* so callers branch on the type instead of string-matching a message.
|
|
31
|
+
*
|
|
32
|
+
* Extends {@link TheokitAgentError} — see {@link InteractiveUnavailableError} for why. */
|
|
33
|
+
export declare class NoSuchSessionError extends TheokitAgentError {
|
|
34
|
+
readonly name = "NoSuchSessionError";
|
|
35
|
+
readonly code: "no_such_session";
|
|
36
|
+
constructor(sessionId: string);
|
|
37
|
+
}
|
|
38
|
+
/** Result of starting a session: its id + whatever the program printed on startup. */
|
|
39
|
+
export interface StartInteractiveResult {
|
|
40
|
+
sessionId: string;
|
|
41
|
+
output: string;
|
|
42
|
+
}
|
|
43
|
+
/** Result of writing to a session: the output produced during the yield window + liveness. */
|
|
44
|
+
export interface WriteStdinResult {
|
|
45
|
+
output: string;
|
|
46
|
+
alive: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Bounds a start call. All optional; a backend clamps/defaults each. */
|
|
49
|
+
export interface StartInteractiveOptions {
|
|
50
|
+
/** Working directory for the session. Defaults to the backend's root. */
|
|
51
|
+
cwd?: string;
|
|
52
|
+
/** How long to wait, in ms, before returning the startup output (clamped by the backend). */
|
|
53
|
+
yieldMs?: number;
|
|
54
|
+
/** Idle time, in ms, after which the backend reaps a forgotten session. */
|
|
55
|
+
ttlMs?: number;
|
|
56
|
+
/** Cap on the returned output bytes (tail kept). */
|
|
57
|
+
maxBytes?: number;
|
|
58
|
+
/** Terminal geometry, when the backend allocates a real TTY. */
|
|
59
|
+
cols?: number;
|
|
60
|
+
rows?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Bounds a write call. */
|
|
63
|
+
export interface WriteStdinOptions {
|
|
64
|
+
yieldMs?: number;
|
|
65
|
+
ttlMs?: number;
|
|
66
|
+
maxBytes?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Pluggable interactive-session backend. Implement the three abstract methods.
|
|
70
|
+
* A backend that cannot provide interactive sessions should not be constructed —
|
|
71
|
+
* callers detect absence by catching {@link InteractiveUnavailableError}.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare abstract class InteractiveBackend {
|
|
76
|
+
/** Spawn `command` as an interactive session; resolve after the yield window with the
|
|
77
|
+
* `session_id` + startup output. Throws {@link InteractiveUnavailableError} when the
|
|
78
|
+
* session cannot be allocated. */
|
|
79
|
+
abstract startInteractive(command: string, opts?: StartInteractiveOptions): Promise<StartInteractiveResult>;
|
|
80
|
+
/** Write `chars` to a live session's stdin; resolve after the yield window with the output it
|
|
81
|
+
* produced + whether it is still alive. Throws {@link NoSuchSessionError} on an unknown session. */
|
|
82
|
+
abstract writeStdin(sessionId: string, chars: string, opts?: WriteStdinOptions): Promise<WriteStdinResult>;
|
|
83
|
+
/** Kill a session (idempotent) and free its slot. */
|
|
84
|
+
abstract kill(sessionId: string): void;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A backend OR a per-request resolver of one — mirrors {@link FilesystemProvider}. A resolver runs
|
|
88
|
+
* at tool-execution time (request scope), so multi-tenant / multi-role agents get a distinct backend
|
|
89
|
+
* per request without a shared mutable one.
|
|
90
|
+
*
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
export type InteractiveProvider<Ctx = unknown> = InteractiveBackend | ((ctx: Ctx) => InteractiveBackend | Promise<InteractiveBackend>);
|
|
94
|
+
/** Resolve an {@link InteractiveProvider} to a concrete backend for `ctx`. */
|
|
95
|
+
export declare function resolveInteractive<Ctx>(provider: InteractiveProvider<Ctx>, ctx: Ctx): Promise<InteractiveBackend>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Agent.batch(prompts, options)` core (ADRs D134-D140).
|
|
3
|
+
*
|
|
4
|
+
* Fans out N prompts via bounded concurrency, isolates failures per-prompt,
|
|
5
|
+
* preserves input order in the result array, supports streaming callbacks
|
|
6
|
+
* + AbortSignal. The credential pool (D131) is shared across all
|
|
7
|
+
* in-flight agents via `withCredentialPool` ALS scope (EC-A fix).
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Doom-loop guard — detects consecutive IDENTICAL tool calls (same name + same canonical input)
|
|
3
|
+
* and escalates `ok` → `soft` (one-time nudge) → `hard` (stop). Inspection is TOTAL — `signatureOf`
|
|
4
|
+
* and `inspect` never throw on any tool-call input. The constructor validates thresholds and throws
|
|
5
|
+
* a typed `ConfigurationError` on invalid config (fail-fast at the boundary — a 0/negative/non-integer
|
|
6
|
+
* threshold is a caller bug, not a loop input). Ported in shape from a peer `LoopDetectionTracker`.
|
|
7
|
+
* Complements the empty-round `no_progress` terminal (a DIFFERENT failure mode: model stuck repeating
|
|
8
|
+
* vs model gone silent).
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
/** Verdict from {@link DoomLoopTracker.inspect}. `soft` carries a guidance message, `hard` a stop message. */
|
|
12
|
+
export interface DoomLoopVerdict {
|
|
13
|
+
kind: "ok" | "soft" | "hard";
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Consecutive-identical thresholds. `soft` fires once (at exactly the count); `hard` stops. */
|
|
17
|
+
export interface DoomLoopConfig {
|
|
18
|
+
softThreshold: number;
|
|
19
|
+
hardThreshold: number;
|
|
20
|
+
}
|
|
21
|
+
/** Public config on a send: `false` disables the guard; an object tunes the thresholds; absent = on. */
|
|
22
|
+
export type DoomLoopOption = false | Partial<DoomLoopConfig>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SDKMessage } from "../../types/messages.js";
|
|
2
|
+
/**
|
|
3
|
+
* theokit#140 — the loop's event log, reporting each event AS IT HAPPENS.
|
|
4
|
+
*
|
|
5
|
+
* ## The defect this closes
|
|
6
|
+
*
|
|
7
|
+
* `runAgentLoop` collected events into a plain array and returned it, so nothing reached the run
|
|
8
|
+
* until the loop had finished. `RealLocalRun.applyAgentLoopOutput` then copied the whole batch in
|
|
9
|
+
* one pass. Meanwhile `SendOptions.onDelta` fired live from inside that same loop.
|
|
10
|
+
*
|
|
11
|
+
* Two clocks, one of which does not start until the other has stopped. A consumer that wanted tool
|
|
12
|
+
* calls interleaved with tokens in true order had to fuse both surfaces itself — which is exactly
|
|
13
|
+
* what `@theokit/agents` was doing, and the documented root of its ordering bug (theokit#47), its
|
|
14
|
+
* namespace-dedup bug (theokit#138) and its missing terminal frame (theokit#142).
|
|
15
|
+
*
|
|
16
|
+
* ## Why a subclass, and not a callback threaded through nine call sites
|
|
17
|
+
*
|
|
18
|
+
* The events are appended from nine places across `loop.ts`, `loop-llm-stream.ts` and
|
|
19
|
+
* `tool-dispatch.ts`. Threading an `onEvent` parameter to each would touch every one of them and,
|
|
20
|
+
* worse, would leave the NEXT `events.push(...)` silently un-notified — a defect that reintroduces
|
|
21
|
+
* itself by omission, which is the failure mode this whole issue is about.
|
|
22
|
+
*
|
|
23
|
+
* Extending `Array` moves the decision to the single place the log is CREATED. Every existing push
|
|
24
|
+
* becomes live with no call-site change, and any push added later is live for free.
|
|
25
|
+
*
|
|
26
|
+
* It stays a real `Array`: `AgentLoopOutput.events` is still `SDKMessage[]`, `instanceof Array`
|
|
27
|
+
* still holds, and every downstream consumer — including the batch copy in `applyAgentLoopOutput` —
|
|
28
|
+
* is unchanged. This is additive; nothing that worked before observes a difference.
|
|
29
|
+
*
|
|
30
|
+
* `push` is the only override, deliberately. The loop only ever appends; overriding the rest of the
|
|
31
|
+
* mutation surface would be guarding against callers that do not exist (YAGNI), and a subscriber
|
|
32
|
+
* that must reason about splices is a worse contract than one that receives appends.
|
|
33
|
+
*/
|
|
34
|
+
export declare class LiveEventLog extends Array<SDKMessage> {
|
|
35
|
+
#private;
|
|
36
|
+
/** Attach the live subscriber. One sink: the run that owns this loop. */
|
|
37
|
+
subscribe(sink: (event: SDKMessage) => void): void;
|
|
38
|
+
push(...events: SDKMessage[]): number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Build the loop's event log, seeded with the events that exist before the loop starts.
|
|
42
|
+
*
|
|
43
|
+
* `LiveEventLog.from` rather than `new LiveEventLog(...seed)`: the `Array` constructor treats a
|
|
44
|
+
* single numeric argument as a length, and a seed is a list of events, never a count.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createEventLog(seed: readonly SDKMessage[]): LiveEventLog;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tail of `runAgentLoop`: everything that happens after its last turn.
|
|
3
|
+
*
|
|
4
|
+
* Its own module rather than four more functions in `loop.ts` for two reasons that agree. The file
|
|
5
|
+
* was 12 logical lines over the 400-line budget with them inline, and more importantly the split is
|
|
6
|
+
* real: nothing here runs during a turn, so none of it is covered by the argument the loop's
|
|
7
|
+
* `biome-ignore` makes about keeping the streaming contract linear.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
import type { LoopContext } from "./loop-context-init.js";
|
|
12
|
+
import type { AgentLoopInputs, AgentLoopOutput } from "./types.js";
|
|
13
|
+
/** The span type the telemetry handle hands back, or nothing when telemetry is off. */
|
|
14
|
+
export type SendSpan = ReturnType<NonNullable<AgentLoopInputs["telemetry"]>["startSpan"]> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Everything `runAgentLoop` does AFTER its last turn: diagnose why the loop ended, stamp the span,
|
|
17
|
+
* total usage and cost, flush the memory provider, and shape the output.
|
|
18
|
+
*
|
|
19
|
+
* Extracted because the biome-ignore on `runAgentLoop` argues that context build, LLM round trip,
|
|
20
|
+
* tool dispatch, stop condition and span lifecycle stay co-located so the streaming contract reads
|
|
21
|
+
* linearly — and that argument, which has real force, covers none of this. None of it runs during a
|
|
22
|
+
* turn, so removing it takes roughly 55 of the function's 123 lines and 12 of its decision points
|
|
23
|
+
* out of the narrative the ignore defends, without moving a single branch of the round trip.
|
|
24
|
+
*/
|
|
25
|
+
export declare function finalizeLoopOutput(inputs: AgentLoopInputs, ctx: LoopContext, budget: IterationBudget, sendSpan: SendSpan, lastTurnDecision: "continue" | "done" | "error" | undefined): Promise<AgentLoopOutput>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* theokit#122 — where a round's thinking block becomes a conversation step.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `loop.ts` when it crossed the G8 400-LoC cap. These two belong together: both
|
|
5
|
+
* answer "the round produced a thinking block — where does it land in the persisted conversation",
|
|
6
|
+
* and the answer differs by which path closes the round.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
import type { LlmThinkingPart } from "../llm/types.js";
|
|
11
|
+
import type { LoopContext } from "./loop-context-init.js";
|
|
12
|
+
/**
|
|
13
|
+
* theokit#122 — the round's thinking block as a conversation step.
|
|
14
|
+
*
|
|
15
|
+
* Shared by the two paths that can close a round: the assistant-text path and the tool_use path.
|
|
16
|
+
* The tool_use path is the one that matters — a round of thinking + a tool call with NO preamble
|
|
17
|
+
* text is the common Anthropic shape, and it is exactly the case the first version of this fix
|
|
18
|
+
* dropped (the block stayed on the context and was persisted against the NEXT round's text).
|
|
19
|
+
*/
|
|
20
|
+
export declare function thinkingStep(thinking: LlmThinkingPart): ConversationStep;
|
|
21
|
+
/**
|
|
22
|
+
* theokit#122 — persist the block for a round that called a tool and said nothing.
|
|
23
|
+
*
|
|
24
|
+
* Such a round emits no assistant-text step, so without this the block is never recorded for it —
|
|
25
|
+
* which is exactly how the first version of this fix let round N's signature reach round N+1.
|
|
26
|
+
* No-op when the round had text (the text path already recorded it) or produced no thinking.
|
|
27
|
+
*/
|
|
28
|
+
export declare function recordThinkingOnSilentToolRound(ctx: LoopContext, text: string, thinking: LlmThinkingPart | undefined): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LoopContext } from "./loop-context-init.js";
|
|
2
|
+
import { type LlmTurnOutput } from "./loop-llm-stream.js";
|
|
3
|
+
import type { AgentLoopInputs, AgentLoopOutput } from "./types.js";
|
|
4
|
+
/** M1-4 — maximum number of `stop`-hook feedback re-prompts (reflection ceiling), mirroring MAX_NUDGE_ATTEMPTS. */
|
|
5
|
+
export declare const MAX_STOP_FEEDBACK_ATTEMPTS = 2;
|
|
6
|
+
export declare function runAgentLoop(inputs: AgentLoopInputs): Promise<AgentLoopOutput>;
|
|
7
|
+
export declare function continueOrTerminate(inputs: AgentLoopInputs, ctx: LoopContext, llmOutput: LlmTurnOutput): Promise<"continue" | "done" | "error">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SDKAssistantMessage, SDKThinkingMessage, SDKUserMessageEvent } from "../../types/messages.js";
|
|
2
|
+
import type { LlmMessage, LlmThinkingPart, LlmToolCallPart } from "../llm/types.js";
|
|
3
|
+
import type { AgentLoopInputs } from "./types.js";
|
|
4
|
+
export declare function buildUserEvent(inputs: AgentLoopInputs): SDKUserMessageEvent;
|
|
5
|
+
export declare function buildAssistantEvent(inputs: AgentLoopInputs, text: string): SDKAssistantMessage;
|
|
6
|
+
/**
|
|
7
|
+
* issue #47: the reasoning the model produced this turn, as a `thinking` SDKMessage.
|
|
8
|
+
* issue #48: when the reasoning duration was measured, carry it as `thinking_duration_ms`
|
|
9
|
+
* so a `Run.stream()` replay can render how long the model reasoned.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildThinkingEvent(inputs: AgentLoopInputs, text: string, thinkingDurationMs?: number, signature?: string): SDKThinkingMessage;
|
|
12
|
+
/**
|
|
13
|
+
* theokit#122 — `thinking` is FIRST, and that ordering is a provider requirement, not a preference.
|
|
14
|
+
*
|
|
15
|
+
* Anthropic verifies the signed block on the next request and requires it to lead the assistant
|
|
16
|
+
* message it belongs to. Omitting it (which this builder did until theokit#122's follow-up) makes
|
|
17
|
+
* round 2 of any thinking + tools run fail with `400 "thinking blocks cannot be modified"` — the
|
|
18
|
+
* exact failure the issue exists to remove. An unsigned block is passed through here and dropped at
|
|
19
|
+
* the wire by `thinkingToWireBlock`, which is where that policy belongs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildAssistantTurn(text: string, toolCalls: LlmToolCallPart[], thinking?: LlmThinkingPart): LlmMessage;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SessionMessage } from "../../types/session-message.js";
|
|
2
|
+
import type { LlmMessage } from "../llm/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Rebuild the model's history from a session's stored turns.
|
|
5
|
+
*
|
|
6
|
+
* ## Why this exists
|
|
7
|
+
*
|
|
8
|
+
* The replay used to be one line — `content: [{ type: "text", text: msg.text }]` — and `text` is the
|
|
9
|
+
* FLAT projection, in which a tool call folds to `[tool call] NAME` and a result to
|
|
10
|
+
* `[tool result] <body>`. So a resumed session showed the model its own prior turn as prose
|
|
11
|
+
* containing a marker, and the model did the reasonable thing with a pattern it is shown: it wrote
|
|
12
|
+
* the marker instead of calling the tool (usetheokit/theokit#631). A consumer saw
|
|
13
|
+
* `"…report its output.[tool call] run_shell"` in the assistant's reply, with no tool call behind it.
|
|
14
|
+
*
|
|
15
|
+
* The structured projection was already there. `narrowToSessionMessage` returns BOTH `text` and
|
|
16
|
+
* `parts`, and `parts` carries the call id, the tool name and the arguments — everything the flat
|
|
17
|
+
* form destroys. Nothing read it: `msg.parts` appeared nowhere in the shipped bundle.
|
|
18
|
+
*
|
|
19
|
+
* ## The shape it produces
|
|
20
|
+
*
|
|
21
|
+
* `SessionMessagePart` and `LlmContentPart` agree field for field on all three cases, which is what
|
|
22
|
+
* makes this a mapping rather than a translation. What does NOT carry over is the grouping: a
|
|
23
|
+
* `tool_result` may not travel in an assistant message. The live loop already settles that —
|
|
24
|
+
* `loop.ts` pushes results as `{ role: "user", content: toolResults }` — so a replayed turn is split
|
|
25
|
+
* the same way rather than inventing a second convention for the same provider wire.
|
|
26
|
+
*
|
|
27
|
+
* ## When it falls back
|
|
28
|
+
*
|
|
29
|
+
* `parts` is optional and its absence means "this projection carries no structure", never "this turn
|
|
30
|
+
* had none" — a `SessionMessage` built in memory during a live turn has only `text`. So a message
|
|
31
|
+
* without parts replays exactly as before. That is also what keeps this safe for a session stored by
|
|
32
|
+
* an older SDK: those rows have no `parts`, and they keep the behaviour they were written under.
|
|
33
|
+
*
|
|
34
|
+
* ## An empty text part is dropped
|
|
35
|
+
*
|
|
36
|
+
* A `{ type: "text", text: "" }` survives the projection — a turn that was only a tool call has one,
|
|
37
|
+
* because `partToText` folds the call and leaves the text empty. Several provider wires reject an
|
|
38
|
+
* empty text block outright, and none of them need it, so it does not travel. Dropping it is also
|
|
39
|
+
* what makes the `own.length > 0` guard below meaningful rather than incidental.
|
|
40
|
+
*/
|
|
41
|
+
export declare function replayMessages(prior: readonly SessionMessage[]): LlmMessage[];
|