@theokit/sdk 5.11.1 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/a2a/index.cjs +8 -8
  3. package/dist/a2a/index.js +3 -3
  4. package/dist/agent-BVKIUP7F.cjs +71 -0
  5. package/dist/{agent-OKP4LHG2.cjs.map → agent-BVKIUP7F.cjs.map} +1 -1
  6. package/dist/{agent-CmKwSyyD.d.ts → agent-CVzDy_Oj.d.ts} +17 -8
  7. package/dist/{agent-XMkGzff_.d.cts → agent-Cn0sphpA.d.cts} +17 -8
  8. package/dist/agent-IG7BP6GN.js +62 -0
  9. package/dist/{agent-DFV52V6E.js.map → agent-IG7BP6GN.js.map} +1 -1
  10. package/dist/agent-prims-CZyxfCmS.d.cts +206 -0
  11. package/dist/agent-prims-CZyxfCmS.d.ts +206 -0
  12. package/dist/agent-session-store-22GKA7O4.js +6 -0
  13. package/dist/{agent-session-store-ODD3IZCW.js.map → agent-session-store-22GKA7O4.js.map} +1 -1
  14. package/dist/agent-session-store-WP6NGDVX.cjs +23 -0
  15. package/dist/{agent-session-store-SVEJHSUA.cjs.map → agent-session-store-WP6NGDVX.cjs.map} +1 -1
  16. package/dist/auth/index.cjs +33 -33
  17. package/dist/auth/index.js +6 -6
  18. package/dist/{batch-427O54FQ.js → batch-EP3FCL6D.js} +9 -9
  19. package/dist/{batch-427O54FQ.js.map → batch-EP3FCL6D.js.map} +1 -1
  20. package/dist/{batch-U4SO4RLX.cjs → batch-IZ5EDKJ5.cjs} +29 -29
  21. package/dist/{batch-U4SO4RLX.cjs.map → batch-IZ5EDKJ5.cjs.map} +1 -1
  22. package/dist/{chunk-IIYJMXYW.cjs → chunk-27V5I2WW.cjs} +4 -4
  23. package/dist/{chunk-IIYJMXYW.cjs.map → chunk-27V5I2WW.cjs.map} +1 -1
  24. package/dist/{chunk-DPY2M74T.js → chunk-2C24NSNV.js} +5 -5
  25. package/dist/{chunk-DPY2M74T.js.map → chunk-2C24NSNV.js.map} +1 -1
  26. package/dist/{chunk-7F7XE6CM.js → chunk-2S4HQCDF.js} +3 -3
  27. package/dist/{chunk-7F7XE6CM.js.map → chunk-2S4HQCDF.js.map} +1 -1
  28. package/dist/{chunk-LZJXEPEQ.js → chunk-2SFLLOMN.js} +3 -3
  29. package/dist/{chunk-LZJXEPEQ.js.map → chunk-2SFLLOMN.js.map} +1 -1
  30. package/dist/{chunk-RGQICWFU.js → chunk-354F3OF5.js} +3 -3
  31. package/dist/{chunk-RGQICWFU.js.map → chunk-354F3OF5.js.map} +1 -1
  32. package/dist/{chunk-TX56N7FR.js → chunk-3FSBE4PS.js} +4 -4
  33. package/dist/{chunk-TX56N7FR.js.map → chunk-3FSBE4PS.js.map} +1 -1
  34. package/dist/{chunk-RQMCOFAI.cjs → chunk-3HA7N2BB.cjs} +8 -8
  35. package/dist/{chunk-RQMCOFAI.cjs.map → chunk-3HA7N2BB.cjs.map} +1 -1
  36. package/dist/{chunk-GM54F4FE.cjs → chunk-3KIUY67P.cjs} +9 -9
  37. package/dist/{chunk-GM54F4FE.cjs.map → chunk-3KIUY67P.cjs.map} +1 -1
  38. package/dist/{chunk-CZJ6Q7CW.js → chunk-3OY6H3I7.js} +66 -7
  39. package/dist/chunk-3OY6H3I7.js.map +1 -0
  40. package/dist/{chunk-ZWACQM5U.cjs → chunk-3WKWBYPO.cjs} +9 -9
  41. package/dist/{chunk-ZWACQM5U.cjs.map → chunk-3WKWBYPO.cjs.map} +1 -1
  42. package/dist/{chunk-Q34EBNYG.js → chunk-4GUFNDZR.js} +5 -5
  43. package/dist/{chunk-Q34EBNYG.js.map → chunk-4GUFNDZR.js.map} +1 -1
  44. package/dist/{chunk-XDUGSTYJ.cjs → chunk-4YD2WI57.cjs} +15 -15
  45. package/dist/{chunk-XDUGSTYJ.cjs.map → chunk-4YD2WI57.cjs.map} +1 -1
  46. package/dist/{chunk-SKDNCTXG.cjs → chunk-5A4UFBHW.cjs} +15 -15
  47. package/dist/{chunk-SKDNCTXG.cjs.map → chunk-5A4UFBHW.cjs.map} +1 -1
  48. package/dist/{chunk-SUVCHX4L.js → chunk-5AR6O7GW.js} +3 -3
  49. package/dist/{chunk-SUVCHX4L.js.map → chunk-5AR6O7GW.js.map} +1 -1
  50. package/dist/{chunk-SVCPJRUB.js → chunk-5HSMH2ZZ.js} +6 -6
  51. package/dist/{chunk-SVCPJRUB.js.map → chunk-5HSMH2ZZ.js.map} +1 -1
  52. package/dist/{chunk-GTX6FEDP.js → chunk-5IRDK5BC.js} +3 -3
  53. package/dist/{chunk-GTX6FEDP.js.map → chunk-5IRDK5BC.js.map} +1 -1
  54. package/dist/{chunk-H3CVJSFC.js → chunk-5IUDICRK.js} +3 -3
  55. package/dist/{chunk-H3CVJSFC.js.map → chunk-5IUDICRK.js.map} +1 -1
  56. package/dist/{chunk-FYEHYQ7T.cjs → chunk-6CXRYPG7.cjs} +15 -15
  57. package/dist/{chunk-FYEHYQ7T.cjs.map → chunk-6CXRYPG7.cjs.map} +1 -1
  58. package/dist/{chunk-NQVWSSX2.cjs → chunk-6OCJWGVD.cjs} +12 -12
  59. package/dist/{chunk-NQVWSSX2.cjs.map → chunk-6OCJWGVD.cjs.map} +1 -1
  60. package/dist/{chunk-MPR2ISL2.cjs → chunk-6XQLTQB6.cjs} +4 -4
  61. package/dist/{chunk-MPR2ISL2.cjs.map → chunk-6XQLTQB6.cjs.map} +1 -1
  62. package/dist/{chunk-72CPLZPC.cjs → chunk-7INPXUJI.cjs} +5 -5
  63. package/dist/{chunk-72CPLZPC.cjs.map → chunk-7INPXUJI.cjs.map} +1 -1
  64. package/dist/{chunk-HG5LKFG7.cjs → chunk-7WARNHWW.cjs} +16 -16
  65. package/dist/{chunk-HG5LKFG7.cjs.map → chunk-7WARNHWW.cjs.map} +1 -1
  66. package/dist/{chunk-KIKKTW5O.cjs → chunk-7YUPSBDV.cjs} +4 -4
  67. package/dist/{chunk-KIKKTW5O.cjs.map → chunk-7YUPSBDV.cjs.map} +1 -1
  68. package/dist/{chunk-IZDDSLL2.js → chunk-AB4OPJLD.js} +6 -6
  69. package/dist/{chunk-IZDDSLL2.js.map → chunk-AB4OPJLD.js.map} +1 -1
  70. package/dist/{chunk-XERM7PDQ.js → chunk-AGO5S5WD.js} +3 -3
  71. package/dist/{chunk-XERM7PDQ.js.map → chunk-AGO5S5WD.js.map} +1 -1
  72. package/dist/{chunk-ZWFTECOE.js → chunk-AHKS3DKI.js} +3 -3
  73. package/dist/{chunk-ZWFTECOE.js.map → chunk-AHKS3DKI.js.map} +1 -1
  74. package/dist/{chunk-ECD6ER3E.cjs → chunk-AIZ6WXSL.cjs} +4 -4
  75. package/dist/{chunk-ECD6ER3E.cjs.map → chunk-AIZ6WXSL.cjs.map} +1 -1
  76. package/dist/{chunk-KO6SHCEH.js → chunk-AQW54OWQ.js} +3 -3
  77. package/dist/{chunk-KO6SHCEH.js.map → chunk-AQW54OWQ.js.map} +1 -1
  78. package/dist/{chunk-P22BZE7G.cjs → chunk-AT2PESXB.cjs} +7 -7
  79. package/dist/{chunk-P22BZE7G.cjs.map → chunk-AT2PESXB.cjs.map} +1 -1
  80. package/dist/{chunk-MHIBYKWA.js → chunk-BJ7BPLQK.js} +131 -72
  81. package/dist/chunk-BJ7BPLQK.js.map +1 -0
  82. package/dist/{chunk-HV4V63CO.js → chunk-BO3PV3OP.js} +4 -4
  83. package/dist/{chunk-HV4V63CO.js.map → chunk-BO3PV3OP.js.map} +1 -1
  84. package/dist/{chunk-7NQ7HJ3E.cjs → chunk-BRWI4HLK.cjs} +6 -6
  85. package/dist/{chunk-7NQ7HJ3E.cjs.map → chunk-BRWI4HLK.cjs.map} +1 -1
  86. package/dist/{chunk-GHHIJEFX.cjs → chunk-BWYC7RZG.cjs} +9 -9
  87. package/dist/{chunk-GHHIJEFX.cjs.map → chunk-BWYC7RZG.cjs.map} +1 -1
  88. package/dist/{chunk-UNFBHV46.cjs → chunk-CEGU5AVD.cjs} +9 -9
  89. package/dist/chunk-CEGU5AVD.cjs.map +1 -0
  90. package/dist/{chunk-JV7JA7BM.cjs → chunk-CGH4BCIY.cjs} +11 -11
  91. package/dist/{chunk-JV7JA7BM.cjs.map → chunk-CGH4BCIY.cjs.map} +1 -1
  92. package/dist/{chunk-L3C6CCBG.cjs → chunk-CWQPQTUZ.cjs} +21 -21
  93. package/dist/{chunk-L3C6CCBG.cjs.map → chunk-CWQPQTUZ.cjs.map} +1 -1
  94. package/dist/{chunk-X3LOJJMO.js → chunk-DF77RBF4.js} +9 -9
  95. package/dist/{chunk-X3LOJJMO.js.map → chunk-DF77RBF4.js.map} +1 -1
  96. package/dist/{chunk-GMSRRJ53.js → chunk-EEK7S77K.js} +3 -3
  97. package/dist/{chunk-GMSRRJ53.js.map → chunk-EEK7S77K.js.map} +1 -1
  98. package/dist/{chunk-NKIQTLFA.cjs → chunk-EQ5IDL6W.cjs} +4 -4
  99. package/dist/{chunk-NKIQTLFA.cjs.map → chunk-EQ5IDL6W.cjs.map} +1 -1
  100. package/dist/{chunk-D5KXKBEN.cjs → chunk-FEAWEBWN.cjs} +5 -5
  101. package/dist/{chunk-D5KXKBEN.cjs.map → chunk-FEAWEBWN.cjs.map} +1 -1
  102. package/dist/{chunk-NJSIAJEK.cjs → chunk-FLDMPVUC.cjs} +4 -4
  103. package/dist/{chunk-NJSIAJEK.cjs.map → chunk-FLDMPVUC.cjs.map} +1 -1
  104. package/dist/{chunk-ASK2OQM5.cjs → chunk-G7XBVM3T.cjs} +5 -5
  105. package/dist/{chunk-ASK2OQM5.cjs.map → chunk-G7XBVM3T.cjs.map} +1 -1
  106. package/dist/{chunk-U27XHOEF.js → chunk-H7G65PNI.js} +5 -5
  107. package/dist/{chunk-U27XHOEF.js.map → chunk-H7G65PNI.js.map} +1 -1
  108. package/dist/{chunk-JW3GVLM6.cjs → chunk-H7HD6RXO.cjs} +4 -4
  109. package/dist/{chunk-JW3GVLM6.cjs.map → chunk-H7HD6RXO.cjs.map} +1 -1
  110. package/dist/{chunk-ZHWKT2NI.js → chunk-HJ2LV464.js} +3 -3
  111. package/dist/{chunk-ZHWKT2NI.js.map → chunk-HJ2LV464.js.map} +1 -1
  112. package/dist/{chunk-KGZ66JVZ.cjs → chunk-HN4IKB6X.cjs} +14 -14
  113. package/dist/{chunk-KGZ66JVZ.cjs.map → chunk-HN4IKB6X.cjs.map} +1 -1
  114. package/dist/{chunk-XKMVJ443.js → chunk-HWMGR3HA.js} +6 -6
  115. package/dist/{chunk-XKMVJ443.js.map → chunk-HWMGR3HA.js.map} +1 -1
  116. package/dist/{chunk-EQ5NCH2Y.cjs → chunk-IO4RI5ZJ.cjs} +24 -24
  117. package/dist/{chunk-EQ5NCH2Y.cjs.map → chunk-IO4RI5ZJ.cjs.map} +1 -1
  118. package/dist/{chunk-OLSEWLK5.cjs → chunk-IOFMRS6T.cjs} +6 -6
  119. package/dist/{chunk-OLSEWLK5.cjs.map → chunk-IOFMRS6T.cjs.map} +1 -1
  120. package/dist/{chunk-7QJYKVP6.js → chunk-KCM3RMKR.js} +3 -3
  121. package/dist/{chunk-7QJYKVP6.js.map → chunk-KCM3RMKR.js.map} +1 -1
  122. package/dist/{chunk-7KIN3L2S.js → chunk-KU5O7WPK.js} +3 -3
  123. package/dist/{chunk-7KIN3L2S.js.map → chunk-KU5O7WPK.js.map} +1 -1
  124. package/dist/{chunk-J5623RIV.cjs → chunk-KX5QXLBS.cjs} +10 -10
  125. package/dist/{chunk-J5623RIV.cjs.map → chunk-KX5QXLBS.cjs.map} +1 -1
  126. package/dist/{chunk-J6GXS5A2.cjs → chunk-L7JPXZ2C.cjs} +17 -17
  127. package/dist/{chunk-J6GXS5A2.cjs.map → chunk-L7JPXZ2C.cjs.map} +1 -1
  128. package/dist/{chunk-P7NNKEWO.cjs → chunk-L7V4DDIE.cjs} +4 -4
  129. package/dist/{chunk-P7NNKEWO.cjs.map → chunk-L7V4DDIE.cjs.map} +1 -1
  130. package/dist/chunk-LO6LIUZ6.cjs +18 -0
  131. package/dist/{chunk-SGC7LSHF.cjs.map → chunk-LO6LIUZ6.cjs.map} +1 -1
  132. package/dist/{chunk-P5N3Q2NH.cjs → chunk-LSWHDOCL.cjs} +192 -148
  133. package/dist/chunk-LSWHDOCL.cjs.map +1 -0
  134. package/dist/{chunk-3JHIFQ4I.js → chunk-M4U24U6G.js} +3 -3
  135. package/dist/{chunk-3JHIFQ4I.js.map → chunk-M4U24U6G.js.map} +1 -1
  136. package/dist/{chunk-GGRPAQ3B.js → chunk-MLGETTYX.js} +5 -5
  137. package/dist/{chunk-GGRPAQ3B.js.map → chunk-MLGETTYX.js.map} +1 -1
  138. package/dist/{chunk-XZHJYSPB.js → chunk-MLJDW2YK.js} +4 -4
  139. package/dist/{chunk-XZHJYSPB.js.map → chunk-MLJDW2YK.js.map} +1 -1
  140. package/dist/{chunk-5Q4RTLMP.js → chunk-MS3TQSXU.js} +3 -3
  141. package/dist/{chunk-5Q4RTLMP.js.map → chunk-MS3TQSXU.js.map} +1 -1
  142. package/dist/{chunk-W2ZVTEOD.js → chunk-MSEL5E5P.js} +6 -6
  143. package/dist/{chunk-W2ZVTEOD.js.map → chunk-MSEL5E5P.js.map} +1 -1
  144. package/dist/{chunk-ZAM7BJXJ.cjs → chunk-MSW7LB2V.cjs} +5 -5
  145. package/dist/{chunk-ZAM7BJXJ.cjs.map → chunk-MSW7LB2V.cjs.map} +1 -1
  146. package/dist/{chunk-7HUCU3KK.js → chunk-NHOEXFZT.js} +5 -5
  147. package/dist/{chunk-7HUCU3KK.js.map → chunk-NHOEXFZT.js.map} +1 -1
  148. package/dist/{chunk-6G4IRQUD.js → chunk-NJBJ3CUG.js} +6 -6
  149. package/dist/{chunk-6G4IRQUD.js.map → chunk-NJBJ3CUG.js.map} +1 -1
  150. package/dist/{chunk-I2ORT6QD.js → chunk-NKQVLWDF.js} +3 -3
  151. package/dist/{chunk-I2ORT6QD.js.map → chunk-NKQVLWDF.js.map} +1 -1
  152. package/dist/{chunk-N7KS3TIR.cjs → chunk-NP362THY.cjs} +28 -15
  153. package/dist/chunk-NP362THY.cjs.map +1 -0
  154. package/dist/{chunk-NWS2CS3Y.cjs → chunk-NWWTYBD3.cjs} +5 -5
  155. package/dist/{chunk-NWS2CS3Y.cjs.map → chunk-NWWTYBD3.cjs.map} +1 -1
  156. package/dist/{chunk-SVQIW5RJ.js → chunk-OLJOI4LK.js} +4 -4
  157. package/dist/{chunk-SVQIW5RJ.js.map → chunk-OLJOI4LK.js.map} +1 -1
  158. package/dist/{chunk-7JAKO3NM.js → chunk-ORLTGPOS.js} +3 -3
  159. package/dist/{chunk-7JAKO3NM.js.map → chunk-ORLTGPOS.js.map} +1 -1
  160. package/dist/{chunk-5DD4NJN3.js → chunk-PKRPV3R7.js} +3 -3
  161. package/dist/{chunk-5DD4NJN3.js.map → chunk-PKRPV3R7.js.map} +1 -1
  162. package/dist/{chunk-R5YPDAKD.cjs → chunk-POBZXULR.cjs} +4 -4
  163. package/dist/{chunk-R5YPDAKD.cjs.map → chunk-POBZXULR.cjs.map} +1 -1
  164. package/dist/{chunk-35KBC4BX.cjs → chunk-Q6WT5535.cjs} +446 -387
  165. package/dist/chunk-Q6WT5535.cjs.map +1 -0
  166. package/dist/{chunk-MQGSOKR3.js → chunk-Q7UG242V.js} +3 -3
  167. package/dist/{chunk-MQGSOKR3.js.map → chunk-Q7UG242V.js.map} +1 -1
  168. package/dist/{chunk-XKZFIP7Z.cjs → chunk-QG4SXZ2A.cjs} +4 -4
  169. package/dist/{chunk-XKZFIP7Z.cjs.map → chunk-QG4SXZ2A.cjs.map} +1 -1
  170. package/dist/{chunk-NAGPKWOD.cjs → chunk-QISSETTG.cjs} +4 -4
  171. package/dist/{chunk-NAGPKWOD.cjs.map → chunk-QISSETTG.cjs.map} +1 -1
  172. package/dist/{chunk-OR6XIWLB.js → chunk-QK2ERTO3.js} +4 -4
  173. package/dist/{chunk-OR6XIWLB.js.map → chunk-QK2ERTO3.js.map} +1 -1
  174. package/dist/{chunk-ZDYDBXSD.js → chunk-RN3XDZGS.js} +6 -6
  175. package/dist/{chunk-ZDYDBXSD.js.map → chunk-RN3XDZGS.js.map} +1 -1
  176. package/dist/{chunk-6LHQPOMI.cjs → chunk-RNXXYF22.cjs} +66 -7
  177. package/dist/chunk-RNXXYF22.cjs.map +1 -0
  178. package/dist/{chunk-TMKTSYDS.cjs → chunk-RS7YQR4X.cjs} +6 -6
  179. package/dist/{chunk-TMKTSYDS.cjs.map → chunk-RS7YQR4X.cjs.map} +1 -1
  180. package/dist/{chunk-HU666T3Q.cjs → chunk-S46WJTDL.cjs} +14 -14
  181. package/dist/{chunk-HU666T3Q.cjs.map → chunk-S46WJTDL.cjs.map} +1 -1
  182. package/dist/{chunk-ZD66GFH5.cjs → chunk-SDZ4XDWS.cjs} +35 -35
  183. package/dist/{chunk-ZD66GFH5.cjs.map → chunk-SDZ4XDWS.cjs.map} +1 -1
  184. package/dist/{chunk-ZJZ7LV3A.js → chunk-SV63WTA2.js} +3 -3
  185. package/dist/{chunk-ZJZ7LV3A.js.map → chunk-SV63WTA2.js.map} +1 -1
  186. package/dist/{chunk-CQYBJOB2.cjs → chunk-SXH37C7X.cjs} +4 -4
  187. package/dist/{chunk-CQYBJOB2.cjs.map → chunk-SXH37C7X.cjs.map} +1 -1
  188. package/dist/{chunk-GMRFAX4I.js → chunk-SZQFCHU6.js} +4 -4
  189. package/dist/{chunk-GMRFAX4I.js.map → chunk-SZQFCHU6.js.map} +1 -1
  190. package/dist/{chunk-6PB5AQCY.cjs → chunk-TLVI2OQK.cjs} +16 -16
  191. package/dist/{chunk-6PB5AQCY.cjs.map → chunk-TLVI2OQK.cjs.map} +1 -1
  192. package/dist/{chunk-B5MHRQJZ.js → chunk-TNFOU6SB.js} +3 -3
  193. package/dist/chunk-TNFOU6SB.js.map +1 -0
  194. package/dist/{chunk-N6OEX5TN.cjs → chunk-UDAKAE4Z.cjs} +16 -16
  195. package/dist/{chunk-N6OEX5TN.cjs.map → chunk-UDAKAE4Z.cjs.map} +1 -1
  196. package/dist/{chunk-26NEAJ6T.js → chunk-VVGFZQZC.js} +4 -4
  197. package/dist/{chunk-26NEAJ6T.js.map → chunk-VVGFZQZC.js.map} +1 -1
  198. package/dist/{chunk-XCQ432OX.js → chunk-VZGE7NAI.js} +3 -3
  199. package/dist/{chunk-XCQ432OX.js.map → chunk-VZGE7NAI.js.map} +1 -1
  200. package/dist/{chunk-C7GKRGKN.cjs → chunk-WDVG5R2Q.cjs} +19 -19
  201. package/dist/{chunk-C7GKRGKN.cjs.map → chunk-WDVG5R2Q.cjs.map} +1 -1
  202. package/dist/{chunk-FTZTZBCU.js → chunk-XESYJ4JC.js} +4 -4
  203. package/dist/{chunk-FTZTZBCU.js.map → chunk-XESYJ4JC.js.map} +1 -1
  204. package/dist/{chunk-OPAKPEPG.js → chunk-XJ3WU5CZ.js} +5 -5
  205. package/dist/{chunk-OPAKPEPG.js.map → chunk-XJ3WU5CZ.js.map} +1 -1
  206. package/dist/{chunk-BBJ77S62.js → chunk-XJ4C4NFX.js} +64 -20
  207. package/dist/chunk-XJ4C4NFX.js.map +1 -0
  208. package/dist/{chunk-AY43232P.js → chunk-XRPMZ7TO.js} +4 -4
  209. package/dist/{chunk-AY43232P.js.map → chunk-XRPMZ7TO.js.map} +1 -1
  210. package/dist/{chunk-X6DUEDAF.js → chunk-XZKIAENA.js} +3 -3
  211. package/dist/{chunk-X6DUEDAF.js.map → chunk-XZKIAENA.js.map} +1 -1
  212. package/dist/{chunk-X7EUUHXU.js → chunk-YMVTUV5K.js} +3 -3
  213. package/dist/{chunk-X7EUUHXU.js.map → chunk-YMVTUV5K.js.map} +1 -1
  214. package/dist/{chunk-3JANYJYS.cjs → chunk-YOVZMN4P.cjs} +8 -8
  215. package/dist/{chunk-3JANYJYS.cjs.map → chunk-YOVZMN4P.cjs.map} +1 -1
  216. package/dist/{chunk-TY56BKSK.cjs → chunk-YQ3XC6C2.cjs} +4 -4
  217. package/dist/{chunk-TY56BKSK.cjs.map → chunk-YQ3XC6C2.cjs.map} +1 -1
  218. package/dist/{chunk-JLIRFWUG.js → chunk-ZJAYFSVI.js} +22 -9
  219. package/dist/chunk-ZJAYFSVI.js.map +1 -0
  220. package/dist/{chunk-MU7IAA7G.js → chunk-ZLFFDPXC.js} +9 -9
  221. package/dist/{chunk-MU7IAA7G.js.map → chunk-ZLFFDPXC.js.map} +1 -1
  222. package/dist/{chunk-JLRLCBJ4.cjs → chunk-ZOFRNNZD.cjs} +4 -4
  223. package/dist/{chunk-JLRLCBJ4.cjs.map → chunk-ZOFRNNZD.cjs.map} +1 -1
  224. package/dist/{chunk-MPQJE3G4.cjs → chunk-ZWLFHSON.cjs} +15 -15
  225. package/dist/{chunk-MPQJE3G4.cjs.map → chunk-ZWLFHSON.cjs.map} +1 -1
  226. package/dist/compact-session-3U2JYTVG.js +25 -0
  227. package/dist/{compact-session-4HAUP3HK.js.map → compact-session-3U2JYTVG.js.map} +1 -1
  228. package/dist/{compact-session-Y56D3S57.cjs → compact-session-NM56BREJ.cjs} +24 -24
  229. package/dist/{compact-session-Y56D3S57.cjs.map → compact-session-NM56BREJ.cjs.map} +1 -1
  230. package/dist/compaction.cjs +18 -18
  231. package/dist/compaction.js +3 -3
  232. package/dist/concurrency.cjs +6 -6
  233. package/dist/concurrency.js +4 -4
  234. package/dist/context/index.cjs +9 -9
  235. package/dist/context/index.js +6 -6
  236. package/dist/context-4RSI3AXT.cjs +24 -0
  237. package/dist/{context-B5J4GX2F.cjs.map → context-4RSI3AXT.cjs.map} +1 -1
  238. package/dist/context-7EBZST3L.js +7 -0
  239. package/dist/{context-3FZRAO5K.js.map → context-7EBZST3L.js.map} +1 -1
  240. package/dist/{cron-Blj6wMYg.d.cts → cron-BWDYetbq.d.cts} +2 -2
  241. package/dist/{cron-BPccQCO8.d.ts → cron-CHn-F0fC.d.ts} +2 -2
  242. package/dist/cron.cjs +42 -42
  243. package/dist/cron.d.cts +4 -4
  244. package/dist/cron.d.ts +4 -4
  245. package/dist/cron.js +41 -41
  246. package/dist/{errors-BWOJeWTZ.d.cts → errors-BiDQFWTG.d.cts} +10 -7
  247. package/dist/{errors-DDvG18IB.d.ts → errors-Pf22PJJ-.d.ts} +10 -7
  248. package/dist/errors.cjs +23 -23
  249. package/dist/errors.d.cts +2 -3
  250. package/dist/errors.d.ts +2 -3
  251. package/dist/errors.js +2 -2
  252. package/dist/eval.cjs +54 -54
  253. package/dist/eval.js +42 -42
  254. package/dist/{executor-3NI7KNL4.js → executor-3D2UDJHW.js} +8 -8
  255. package/dist/{executor-3NI7KNL4.js.map → executor-3D2UDJHW.js.map} +1 -1
  256. package/dist/{executor-2SUGI3ZT.cjs → executor-HKHT4CWS.cjs} +26 -26
  257. package/dist/{executor-2SUGI3ZT.cjs.map → executor-HKHT4CWS.cjs.map} +1 -1
  258. package/dist/filesystem/index.cjs +12 -12
  259. package/dist/filesystem/index.js +3 -3
  260. package/dist/fs-session-store-6ZCCJX3K.js +11 -0
  261. package/dist/{fs-session-store-3VI4CPTX.js.map → fs-session-store-6ZCCJX3K.js.map} +1 -1
  262. package/dist/fs-session-store-S2AXVJIX.cjs +20 -0
  263. package/dist/{fs-session-store-IQ6PEHYF.cjs.map → fs-session-store-S2AXVJIX.cjs.map} +1 -1
  264. package/dist/generate-object-S7MNVF2V.js +7 -0
  265. package/dist/{generate-object-NTKAWE7D.js.map → generate-object-S7MNVF2V.js.map} +1 -1
  266. package/dist/generate-object-XBWD2PU7.cjs +20 -0
  267. package/dist/{generate-object-YHTWG5DB.cjs.map → generate-object-XBWD2PU7.cjs.map} +1 -1
  268. package/dist/index-manager-HO456AVW.cjs +27 -0
  269. package/dist/{index-manager-YGXRFJMZ.cjs.map → index-manager-HO456AVW.cjs.map} +1 -1
  270. package/dist/index-manager-QDH56FER.js +18 -0
  271. package/dist/{index-manager-JVYIVTZG.js.map → index-manager-QDH56FER.js.map} +1 -1
  272. package/dist/index.cjs +172 -172
  273. package/dist/index.d.cts +9 -9
  274. package/dist/index.d.ts +9 -9
  275. package/dist/index.js +59 -59
  276. package/dist/{inject-session-R73PRM7B.cjs → inject-session-JVTZNQF6.cjs} +9 -9
  277. package/dist/{inject-session-R73PRM7B.cjs.map → inject-session-JVTZNQF6.cjs.map} +1 -1
  278. package/dist/{inject-session-LJX5JGV5.js → inject-session-THABTKJY.js} +7 -7
  279. package/dist/{inject-session-LJX5JGV5.js.map → inject-session-THABTKJY.js.map} +1 -1
  280. package/dist/interactive/index.cjs +4 -4
  281. package/dist/interactive/index.js +2 -2
  282. package/dist/internal/budget/normalize-usage.d.ts +5 -1
  283. package/dist/internal/error-mappers/openai-compatible.d.ts +3 -1
  284. package/dist/internal/memory/adapters/index.cjs +8 -8
  285. package/dist/internal/memory/adapters/index.js +7 -7
  286. package/dist/internal/memory/storage/index.cjs +42 -42
  287. package/dist/internal/memory/storage/index.js +10 -10
  288. package/dist/internal/persistence/index.cjs +25 -25
  289. package/dist/internal/persistence/index.js +8 -8
  290. package/dist/internal/providers/catalog-schema.d.ts +1 -1
  291. package/dist/internal/runtime/lifecycle/throw-on-error-run.d.ts +18 -0
  292. package/dist/internal/runtime/model-selection.d.ts +1 -1
  293. package/dist/internal/runtime/system-prompt/native-reasoning.d.ts +2 -2
  294. package/dist/internal/runtime/typed-run-error.d.ts +16 -0
  295. package/dist/internal/security/index.cjs +13 -13
  296. package/dist/internal/security/index.js +3 -3
  297. package/dist/judge-call-4LR4IFVT.js +5 -0
  298. package/dist/{judge-call-LOL5FQEX.js.map → judge-call-4LR4IFVT.js.map} +1 -1
  299. package/dist/judge-call-ZTUQMQRL.cjs +22 -0
  300. package/dist/{judge-call-AQQYK6VT.cjs.map → judge-call-ZTUQMQRL.cjs.map} +1 -1
  301. package/dist/mcp-auth.cjs +14 -14
  302. package/dist/mcp-auth.js +4 -4
  303. package/dist/models.cjs +22 -22
  304. package/dist/models.js +8 -8
  305. package/dist/oauth-transaction-store-OMX436YB.cjs +38 -0
  306. package/dist/{oauth-transaction-store-ZINDV7AF.cjs.map → oauth-transaction-store-OMX436YB.cjs.map} +1 -1
  307. package/dist/oauth-transaction-store-U34YLEGP.js +5 -0
  308. package/dist/{oauth-transaction-store-NP2YHZ6D.js.map → oauth-transaction-store-U34YLEGP.js.map} +1 -1
  309. package/dist/path-safety.cjs +10 -10
  310. package/dist/path-safety.js +3 -3
  311. package/dist/persistence.cjs +31 -31
  312. package/dist/persistence.js +10 -10
  313. package/dist/project.cjs +5 -5
  314. package/dist/project.js +3 -3
  315. package/dist/providers.cjs +9 -9
  316. package/dist/providers.js +7 -7
  317. package/dist/registry-5TDAF7RK.js +9 -0
  318. package/dist/{registry-5FK42CRV.js.map → registry-5TDAF7RK.js.map} +1 -1
  319. package/dist/registry-W7TSCLQO.cjs +46 -0
  320. package/dist/{registry-BVTNO73E.cjs.map → registry-W7TSCLQO.cjs.map} +1 -1
  321. package/dist/retry.cjs +4 -4
  322. package/dist/retry.js +3 -3
  323. package/dist/{run-until-DG2KXWB2.cjs → run-until-4KHVF7YC.cjs} +8 -4
  324. package/dist/run-until-4KHVF7YC.cjs.map +1 -0
  325. package/dist/{run-until-6D6TQ4JN.js → run-until-G6BW2DWM.js} +8 -4
  326. package/dist/run-until-G6BW2DWM.js.map +1 -0
  327. package/dist/sandbox/index.cjs +22 -22
  328. package/dist/sandbox/index.js +4 -4
  329. package/dist/{run-DsA5Ip2i.d.cts → sdk-agent-4-dXI2GS.d.cts} +1500 -753
  330. package/dist/{run-DsA5Ip2i.d.ts → sdk-agent-CTOJlWA_.d.ts} +1500 -753
  331. package/dist/server/auth/index.cjs +22 -22
  332. package/dist/server/auth/index.js +7 -7
  333. package/dist/server/errors-envelope.cjs +14 -14
  334. package/dist/server/errors-envelope.d.cts +2 -3
  335. package/dist/server/errors-envelope.d.ts +2 -3
  336. package/dist/server/errors-envelope.js +3 -3
  337. package/dist/session-transcript-7TZ6HXSX.cjs +62 -0
  338. package/dist/{session-transcript-RACG7BK2.cjs.map → session-transcript-7TZ6HXSX.cjs.map} +1 -1
  339. package/dist/session-transcript-BSHZYYY6.js +5 -0
  340. package/dist/{session-transcript-AR7IBICT.js.map → session-transcript-BSHZYYY6.js.map} +1 -1
  341. package/dist/skills.cjs +8 -8
  342. package/dist/skills.js +5 -5
  343. package/dist/stream-object-R6SMYV4R.js +7 -0
  344. package/dist/{stream-object-QAEHG4YO.js.map → stream-object-R6SMYV4R.js.map} +1 -1
  345. package/dist/stream-object-TEEK3CAX.cjs +20 -0
  346. package/dist/{stream-object-TKVGGA54.cjs.map → stream-object-TEEK3CAX.cjs.map} +1 -1
  347. package/dist/subagents-loader-TXOA5EJJ.cjs +16 -0
  348. package/dist/{subagents-loader-5TZCAIYQ.cjs.map → subagents-loader-TXOA5EJJ.cjs.map} +1 -1
  349. package/dist/subagents-loader-Z744TAKD.js +7 -0
  350. package/dist/{subagents-loader-PEV3PD4Q.js.map → subagents-loader-Z744TAKD.js.map} +1 -1
  351. package/dist/subagents-loader.cjs +7 -7
  352. package/dist/subagents-loader.d.cts +4 -3
  353. package/dist/subagents-loader.d.ts +4 -3
  354. package/dist/subagents-loader.js +5 -5
  355. package/dist/subscription/index.cjs +3 -3
  356. package/dist/subscription/index.js +2 -2
  357. package/dist/task-store.cjs +7 -7
  358. package/dist/task-store.js +4 -4
  359. package/dist/types/agent-prims.d.ts +16 -0
  360. package/dist/types/agent.d.ts +15 -6
  361. package/dist/types/run.d.ts +14 -14
  362. package/dist/workflow.cjs +27 -27
  363. package/dist/workflow.d.cts +2 -2
  364. package/dist/workflow.d.ts +2 -2
  365. package/dist/workflow.js +6 -6
  366. package/docs/error-codes.md +24 -23
  367. package/docs/harness-capability-map.md +4 -4
  368. package/package.json +1 -1
  369. package/dist/agent-DFV52V6E.js +0 -62
  370. package/dist/agent-OKP4LHG2.cjs +0 -71
  371. package/dist/agent-session-store-ODD3IZCW.js +0 -6
  372. package/dist/agent-session-store-SVEJHSUA.cjs +0 -23
  373. package/dist/chunk-35KBC4BX.cjs.map +0 -1
  374. package/dist/chunk-6LHQPOMI.cjs.map +0 -1
  375. package/dist/chunk-B5MHRQJZ.js.map +0 -1
  376. package/dist/chunk-BBJ77S62.js.map +0 -1
  377. package/dist/chunk-CZJ6Q7CW.js.map +0 -1
  378. package/dist/chunk-JLIRFWUG.js.map +0 -1
  379. package/dist/chunk-MHIBYKWA.js.map +0 -1
  380. package/dist/chunk-N7KS3TIR.cjs.map +0 -1
  381. package/dist/chunk-P5N3Q2NH.cjs.map +0 -1
  382. package/dist/chunk-SGC7LSHF.cjs +0 -18
  383. package/dist/chunk-UNFBHV46.cjs.map +0 -1
  384. package/dist/compact-session-4HAUP3HK.js +0 -25
  385. package/dist/context-3FZRAO5K.js +0 -7
  386. package/dist/context-B5J4GX2F.cjs +0 -24
  387. package/dist/fs-session-store-3VI4CPTX.js +0 -11
  388. package/dist/fs-session-store-IQ6PEHYF.cjs +0 -20
  389. package/dist/generate-object-NTKAWE7D.js +0 -7
  390. package/dist/generate-object-YHTWG5DB.cjs +0 -20
  391. package/dist/index-manager-JVYIVTZG.js +0 -18
  392. package/dist/index-manager-YGXRFJMZ.cjs +0 -27
  393. package/dist/judge-call-AQQYK6VT.cjs +0 -22
  394. package/dist/judge-call-LOL5FQEX.js +0 -5
  395. package/dist/oauth-transaction-store-NP2YHZ6D.js +0 -5
  396. package/dist/oauth-transaction-store-ZINDV7AF.cjs +0 -38
  397. package/dist/registry-5FK42CRV.js +0 -9
  398. package/dist/registry-BVTNO73E.cjs +0 -46
  399. package/dist/run-until-6D6TQ4JN.js.map +0 -1
  400. package/dist/run-until-DG2KXWB2.cjs.map +0 -1
  401. package/dist/sdk-agent-dNwjwCt5.d.cts +0 -940
  402. package/dist/sdk-agent-wEOLXD3F.d.ts +0 -940
  403. package/dist/session-transcript-AR7IBICT.js +0 -5
  404. package/dist/session-transcript-RACG7BK2.cjs +0 -62
  405. package/dist/stream-object-QAEHG4YO.js +0 -7
  406. package/dist/stream-object-TKVGGA54.cjs +0 -20
  407. package/dist/subagents-loader-5TZCAIYQ.cjs +0 -16
  408. package/dist/subagents-loader-PEV3PD4Q.js +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,92 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#763](https://github.com/usetheokit/theokit-sdk/pull/763) [`473616d`](https://github.com/usetheokit/theokit-sdk/commit/473616d2585f11c9c2878a47e17665111279388a) Thanks [@usetheodev](https://github.com/usetheodev)! - `@theokit/acp` and `@theokit/sdk-handoff` keep answering in their protocol when the consumer's agent was created with `throwOnError: true`. When a failed run's `run.wait()` rejects, the ACP handler picks the stop reason from the rejected error's own canonical code (`metadata.code`, else `code`), and the handoff dispatcher replies with `(Handoff target <id> returned status=error: <message>)` using the error's message. This is close to what a resolved error run produces, but not identical: when the run's detail code came from another writer (`agent_loop_failed`, for instance), the error's own code and message are used instead. Any rejection from a run whose status is not `"error"`, such as an abort or an output-processor failure on a finished run, propagates unchanged.
8
+
9
+ `@theokit/sdk`: a failed run's `result.error.cause` is now always a `TheokitAgentError`, and `RunErrorDetail.cause` is typed that way. A failure with no SDK error behind it (a budget denial, the iteration limit, a hook, a cloud run failure, a non-SDK exception) carries an `UnknownAgentError` with the run's message and code, holding the original value at its own `cause`. `result.error.message` and `result.error.code` are unchanged.
10
+
11
+ `AgentOptions.throwOnError` now reaches the run itself, as its doc comment promised. `run.wait()` rejects with `result.error.cause`, and so do `agent.generate`, `agent.fork` and `agent.runToCompletion`. `agent.runUntil` and `agent.streamToCompletion` throw it from their iterator, and `Agent.batch` returns it as the failed item's `error`. A workflow `agentStep`, a cron task and an `Eval` row keep recording the failure, now with the typed error's class name, code or message. `Agent.prompt` still rejects with `AgentRunError`, whose `cause` is the typed error. Cancelled and finished runs still resolve, the `postRun` hook still fires on a failed run, and a run nobody awaits raises no unhandled rejection.
12
+
13
+ ### Patch Changes
14
+
15
+ - [#751](https://github.com/usetheokit/theokit-sdk/pull/751) [`eb80ccd`](https://github.com/usetheokit/theokit-sdk/commit/eb80ccda362b0783e21b3ac24ccab4aa262985b5) Thanks [@usetheodev](https://github.com/usetheodev)! - A `BudgetTracker` whose `track()` throws no longer loses the turn's other event, and the failure is
16
+ reported. The agent loop used to call `track()` for the input and the output events inside one `try`
17
+ with an empty `catch`. An input event that threw skipped the output event, and nothing said so, so a
18
+ `maxTokens` or USD ceiling counted less than the run spent. Each event now gets its own call, and a
19
+ throw is reported through the diagnostics sink, or on stderr when no sink is installed. The message
20
+ names the event type, the model id, the token count and the error. The turn still finishes.
21
+
22
+ - [#751](https://github.com/usetheokit/theokit-sdk/pull/751) [`3547789`](https://github.com/usetheokit/theokit-sdk/commit/35477896d43d8e61f75f0a797556af8bba6bde88) Thanks [@usetheodev](https://github.com/usetheodev)! - A chat-completions stream whose usage carries a negative, non-finite or non-numeric `prompt_tokens`, `cached_tokens` or cache-write count no longer reports that count as 0. The field is left out of the turn's usage and the SDK writes `provider reported an unusable inputTokens (…)` (or `cacheReadTokens`, `cacheWriteTokens`) to the diagnostics sink, as it already did for every other malformed count, so a proxy sending a broken usage object is no longer billed and budgeted as a turn with no input. `normalizeUsage` still reads such a count as 0. (B-412)
23
+
24
+ - [#764](https://github.com/usetheokit/theokit-sdk/pull/764) [`cc5c001`](https://github.com/usetheokit/theokit-sdk/commit/cc5c0011555b56857c1f75f521d2883b470ce0af) Thanks [@usetheodev](https://github.com/usetheodev)! - A `thinking` entry in `model.params` with an empty value is now refused instead of silently
25
+ turning reasoning off. `Agent.create` and a `send` model override throw a `ConfigurationError` with
26
+ code `invalid_model_param` before any request when the `thinking` value is empty, whitespace only,
27
+ missing or not a string, and the message names the param. It used to be accepted, and the chat
28
+ request went out with neither `reasoning_effort` nor `reasoning`, so a UI filling the value from an
29
+ unset setting lost reasoning with no signal. To request no reasoning, leave the `thinking` param
30
+ out. A non-empty value such as `"high"` is forwarded as before.
31
+
32
+ - [#765](https://github.com/usetheokit/theokit-sdk/pull/765) [`6bb4105`](https://github.com/usetheokit/theokit-sdk/commit/6bb410578b631d8db9fb1caf68fab8952f588091) Thanks [@usetheodev](https://github.com/usetheodev)! - A provider error's `metadata.raw` no longer carries the start of a credential that sat across the
33
+ 2048-character cut. The body used to be cut first and redacted after, so a key cut short of the
34
+ length its pattern needs matched nothing: 12 characters of an `sk-` key, or the key lines of a PEM
35
+ block before the cut, reached `metadata.raw` in clear. The whole body is now redacted and the
36
+ redacted text is cut. Two visible differences follow. A body that redaction shrinks to 2048
37
+ characters or fewer comes back whole, with no `…`. And when the text is still longer, the cut can
38
+ fall inside a mask such as `sk-V2w...y5Z6`, which leaves part of the mask and never more of the key
39
+ than the mask itself shows. Redaction reads the whole body, however long, because any bound on
40
+ what it reads would leave a credential cut by that bound in clear. A pattern registered with
41
+ `Security.addPattern` now sees the whole error body, not the first 2048 characters, so it should
42
+ stay linear in its input. The cut also no longer splits a surrogate pair, such as an emoji, at the
43
+ 2048th character.
44
+
45
+ - [#752](https://github.com/usetheokit/theokit-sdk/pull/752) [`cd6dc55`](https://github.com/usetheokit/theokit-sdk/commit/cd6dc555272002965e620267472a09d12d6d49f0) Thanks [@usetheodev](https://github.com/usetheodev)! - An OpenAI-compatible provider's HTTP 400 now ends the run with a `ConfigurationError` whose message says what the provider rejected. OpenRouter answers a model id it does not know with `nosuchvendor/nosuch-model-xyz is not a valid model ID`, and until now the message was only `openrouter API error: invalid_request (HTTP 400)`, so neither the error nor `result.error.message` named the model or the parameter. The 400 message now ends with the provider's `error.message`, for example `openrouter API error: invalid_request (HTTP 400): Expected max_tokens to be at least 1`. The class, the error `code` and `isRetryable` do not change.
46
+
47
+ The provider's text goes through the same secret redaction as `metadata.raw` and is cut at 512 characters, ending with `…` when it is longer. The missing-model 404 message, which already carried the provider's text, gets the same redaction and cap. Every other status (401, 403, 408, 429, 5xx and the rest) keeps its message as it was. Code that compared a 400 message by equality will now see a longer string.
48
+
49
+ - [#753](https://github.com/usetheokit/theokit-sdk/pull/753) [`38ad578`](https://github.com/usetheokit/theokit-sdk/commit/38ad578a4025c66c6b250810164a27c10563ba4b) Thanks [@usetheodev](https://github.com/usetheodev)! - `Security.redact` (and `redactSecrets` on the `@theokit/sdk/internal/security` subpath) no longer
50
+ blocks the event loop on a long run of `eyJ` it cannot complete as a JWT. The JWT pattern was a regex
51
+ that retried from every `eyJ` of such a run, so its time grew with the square of the run: 224000
52
+ characters of `eyJa` took over two minutes, and a string half filled by that run 20 to 40 seconds.
53
+ Callers that redact unbounded text, such as the session transcript, span attributes or a provider
54
+ error body, stalled for that long. JWTs are now found by a scan that reads each run of characters at
55
+ most three times, and the same inputs return in under 100 ms. What gets masked, and how, is
56
+ unchanged.
57
+
58
+ - [#754](https://github.com/usetheokit/theokit-sdk/pull/754) [`c46f6a4`](https://github.com/usetheokit/theokit-sdk/commit/c46f6a40e700d154ea10dc7c820ee7a33f2c3fb4) Thanks [@usetheodev](https://github.com/usetheodev)! - `redactSecrets` no longer stalls on text that holds many PEM `BEGIN ... PRIVATE KEY` headers with no matching `END` header. Such input used to take seconds for a few hundred KB, because the PEM pattern searched to the end of the string once per header; PEM blocks are now found in one linear pass, so the same input takes milliseconds. What gets masked is unchanged.
59
+
60
+ - [#751](https://github.com/usetheokit/theokit-sdk/pull/751) [`eb80ccd`](https://github.com/usetheokit/theokit-sdk/commit/eb80ccda362b0783e21b3ac24ccab4aa262985b5) Thanks [@usetheodev](https://github.com/usetheodev)! - On the OpenAI Responses API, `usage.inputTokens` is now the uncached part of the prompt, as it
61
+ already was on the Anthropic and Chat Completions clients. The client used to pass `input_tokens`
62
+ through as it came, and that total already includes the cache read and cache write buckets. A turn
63
+ that hit the prompt cache therefore counted its cached tokens twice: once in `inputTokens` and once
64
+ in `cacheReadTokens` / `cacheWriteTokens`.
65
+
66
+ Things a caller can observe on a cached turn through a provider whose `apiMode` is
67
+ `"responses_api"`, the built-in `openai-chatgpt` (Codex) provider among them:
68
+
69
+ - `RunResult.usage.inputTokens`, the `inputTokens` attribute of the `llm.call` span and the
70
+ `theokit_llm_tokens` histogram are lower by the cached tokens.
71
+ - The run's computed cost no longer bills the cached tokens a second time at the full input
72
+ price.
73
+ - A `BudgetTracker` input event carries the prompt once, so a `maxTokens` ceiling no longer trips
74
+ early. A USD tracker still prices the cached tokens of that event at the input rate, so it trips
75
+ less early than before but still early. For a prompt of 11 tokens with 3 read from the cache and
76
+ 5 written to it, the event reports 11, where it reported 19 before.
77
+
78
+ - [#767](https://github.com/usetheokit/theokit-sdk/pull/767) [`5696d56`](https://github.com/usetheokit/theokit-sdk/commit/5696d567fe34229a70ebf9f1c6df82e1dc289ae1) Thanks [@usetheodev](https://github.com/usetheodev)! - The unknown-provider error lists the registered provider names in locale order instead of UTF-16 code
79
+ unit order, so a mixed-case name such as `alpha` is no longer listed after `Zeta`. Builtin names are
80
+ lowercase ASCII, so their order does not change.
81
+
82
+ - [#764](https://github.com/usetheokit/theokit-sdk/pull/764) [`ce11001`](https://github.com/usetheokit/theokit-sdk/commit/ce110011cbff61ac4381ae4b040af295debc9989) Thanks [@usetheodev](https://github.com/usetheodev)! - A `model.params` entry with id `reasoning` or `reasoning_effort` no longer switches off
83
+ `reasoning: true`. Only `thinking` is sent to the provider as a reasoning effort, so these two ids
84
+ used to count as native reasoning without being forwarded: the run got neither the provider effort
85
+ nor the reasoning preamble and `think` tool, and no error. `reasoning: true` now applies to such a
86
+ model. To request native reasoning, use `{ id: "thinking", value: "high" }`.
87
+
88
+ - [#760](https://github.com/usetheokit/theokit-sdk/pull/760) [`67390b6`](https://github.com/usetheokit/theokit-sdk/commit/67390b65bc3af25082dabc02d8d53a9f5c286349) Thanks [@usetheodev](https://github.com/usetheodev)! - When a route's provider names no registered profile and no fallback provider resolves, the run now fails with a message that says so. With `providers.routes: [{ capability: "chat", provider: "no-such-provider" }]`, the run used to end with a `ConfigurationError` telling you to set `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` / `OPENROUTER_API_KEY`, even when a key was set. The message now reads `No provider client could be resolved: "no-such-provider" is not a known provider. Registered providers: …`, with the registered names sorted. A provider that a plugin registered is listed too. A provider registered with uppercase letters (for example `AcmeAI`) cannot be routed to, because routes look provider names up in lowercase; the message now says that and names the lowercase spelling to register, instead of calling the name unknown while listing it. An alias registered with uppercase letters gets the same message, naming the provider it belongs to. The class (`ConfigurationError`), the code (`provider_unresolved`) and the opening phrase `No provider client could be resolved` are unchanged, and a registered provider with no key still gets the credentials message, word for word. An unregistered provider next to a fallback that resolves still runs on the fallback, as before.
89
+
3
90
  ## 5.11.1
4
91
 
5
92
  ### Patch Changes
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkJW3GVLM6_cjs = require('../chunk-JW3GVLM6.cjs');
3
+ var chunkH7HD6RXO_cjs = require('../chunk-H7HD6RXO.cjs');
4
4
  require('../chunk-NINIJCHU.cjs');
5
- var chunkUNFBHV46_cjs = require('../chunk-UNFBHV46.cjs');
6
- var chunk6LHQPOMI_cjs = require('../chunk-6LHQPOMI.cjs');
5
+ var chunkCEGU5AVD_cjs = require('../chunk-CEGU5AVD.cjs');
6
+ var chunkRNXXYF22_cjs = require('../chunk-RNXXYF22.cjs');
7
7
 
8
8
  // src/a2a/agent-mailbox.ts
9
9
  var AgentMailbox = class {
@@ -35,7 +35,7 @@ var AgentMailbox = class {
35
35
  };
36
36
 
37
37
  // src/a2a/message-bus.ts
38
- var A2APeerNotRegisteredError = class extends chunkUNFBHV46_cjs.TheokitAgentError {
38
+ var A2APeerNotRegisteredError = class extends chunkCEGU5AVD_cjs.TheokitAgentError {
39
39
  constructor(to) {
40
40
  super(`Agent "${to}" not registered on MessageBus`, {
41
41
  code: "a2a_peer_not_registered",
@@ -47,7 +47,7 @@ var A2APeerNotRegisteredError = class extends chunkUNFBHV46_cjs.TheokitAgentErro
47
47
  name = "A2APeerNotRegisteredError";
48
48
  code = "a2a_peer_not_registered";
49
49
  };
50
- var A2ARequestTimeoutError = class extends chunkUNFBHV46_cjs.TheokitAgentError {
50
+ var A2ARequestTimeoutError = class extends chunkCEGU5AVD_cjs.TheokitAgentError {
51
51
  constructor(to, timeoutMs) {
52
52
  super(`A2A request timeout: ${to} did not respond within ${timeoutMs}ms`, {
53
53
  code: "a2a_request_timeout",
@@ -84,7 +84,7 @@ var MessageBus = class {
84
84
  };
85
85
  void Promise.resolve(handler(message)).catch((cause) => {
86
86
  const reason = cause instanceof Error ? cause.message : String(cause);
87
- chunk6LHQPOMI_cjs.diag(`[theokit-sdk] a2a: handler for "${to}" failed on a fire-and-forget send: ${reason}
87
+ chunkRNXXYF22_cjs.diag(`[theokit-sdk] a2a: handler for "${to}" failed on a fire-and-forget send: ${reason}
88
88
  `);
89
89
  });
90
90
  }
@@ -124,11 +124,11 @@ var MessageBus = class {
124
124
 
125
125
  Object.defineProperty(exports, "MaxDelegationDepthError", {
126
126
  enumerable: true,
127
- get: function () { return chunkJW3GVLM6_cjs.MaxDelegationDepthError; }
127
+ get: function () { return chunkH7HD6RXO_cjs.MaxDelegationDepthError; }
128
128
  });
129
129
  Object.defineProperty(exports, "SubAgent", {
130
130
  enumerable: true,
131
- get: function () { return chunkJW3GVLM6_cjs.SubAgent; }
131
+ get: function () { return chunkH7HD6RXO_cjs.SubAgent; }
132
132
  });
133
133
  exports.A2APeerNotRegisteredError = A2APeerNotRegisteredError;
134
134
  exports.A2ARequestTimeoutError = A2ARequestTimeoutError;
package/dist/a2a/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { MaxDelegationDepthError, SubAgent } from '../chunk-XCQ432OX.js';
1
+ export { MaxDelegationDepthError, SubAgent } from '../chunk-VZGE7NAI.js';
2
2
  import '../chunk-6X6ID4MO.js';
3
- import { TheokitAgentError } from '../chunk-B5MHRQJZ.js';
4
- import { diag } from '../chunk-CZJ6Q7CW.js';
3
+ import { TheokitAgentError } from '../chunk-TNFOU6SB.js';
4
+ import { diag } from '../chunk-3OY6H3I7.js';
5
5
 
6
6
  // src/a2a/agent-mailbox.ts
7
7
  var AgentMailbox = class {
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ var chunkQ6WT5535_cjs = require('./chunk-Q6WT5535.cjs');
4
+ require('./chunk-L7JPXZ2C.cjs');
5
+ require('./chunk-YOVZMN4P.cjs');
6
+ require('./chunk-BUUUWQMB.cjs');
7
+ require('./chunk-CWQPQTUZ.cjs');
8
+ require('./chunk-7YUPSBDV.cjs');
9
+ require('./chunk-BV2MWEMV.cjs');
10
+ require('./chunk-CGH4BCIY.cjs');
11
+ require('./chunk-GHX4P3V2.cjs');
12
+ require('./chunk-RS7YQR4X.cjs');
13
+ require('./chunk-SDZ4XDWS.cjs');
14
+ require('./chunk-6OCJWGVD.cjs');
15
+ require('./chunk-LSWHDOCL.cjs');
16
+ require('./chunk-SXH37C7X.cjs');
17
+ require('./chunk-YJNYDJ2T.cjs');
18
+ require('./chunk-NP362THY.cjs');
19
+ require('./chunk-QOGNZMHD.cjs');
20
+ require('./chunk-MSW7LB2V.cjs');
21
+ require('./chunk-2ZPEDVLM.cjs');
22
+ require('./chunk-QG4SXZ2A.cjs');
23
+ require('./chunk-UDAKAE4Z.cjs');
24
+ require('./chunk-KRD3GQAA.cjs');
25
+ require('./chunk-3HA7N2BB.cjs');
26
+ require('./chunk-MUUQ2WFJ.cjs');
27
+ require('./chunk-AA27GEYS.cjs');
28
+ require('./chunk-YSTXFWQE.cjs');
29
+ require('./chunk-FRITRLZQ.cjs');
30
+ require('./chunk-H7HD6RXO.cjs');
31
+ require('./chunk-NINIJCHU.cjs');
32
+ require('./chunk-7WARNHWW.cjs');
33
+ require('./chunk-SWALPLFQ.cjs');
34
+ require('./chunk-IJ7M6GOG.cjs');
35
+ require('./chunk-3KIUY67P.cjs');
36
+ require('./chunk-SA6K24NB.cjs');
37
+ require('./chunk-27V5I2WW.cjs');
38
+ require('./chunk-FLDMPVUC.cjs');
39
+ require('./chunk-EQ5IDL6W.cjs');
40
+ require('./chunk-3WKWBYPO.cjs');
41
+ require('./chunk-A4RAL2ER.cjs');
42
+ require('./chunk-AT2PESXB.cjs');
43
+ require('./chunk-POBZXULR.cjs');
44
+ require('./chunk-G7XBVM3T.cjs');
45
+ require('./chunk-ZF2LDKQQ.cjs');
46
+ require('./chunk-BWYC7RZG.cjs');
47
+ require('./chunk-ZOFRNNZD.cjs');
48
+ require('./chunk-WDVG5R2Q.cjs');
49
+ require('./chunk-YQ3XC6C2.cjs');
50
+ require('./chunk-6XQLTQB6.cjs');
51
+ require('./chunk-KX5QXLBS.cjs');
52
+ require('./chunk-NWWTYBD3.cjs');
53
+ require('./chunk-3EE6LVWT.cjs');
54
+ require('./chunk-LO6LIUZ6.cjs');
55
+ require('./chunk-S46WJTDL.cjs');
56
+ require('./chunk-NVXXWAU7.cjs');
57
+ require('./chunk-5A4UFBHW.cjs');
58
+ require('./chunk-QISSETTG.cjs');
59
+ require('./chunk-IOFMRS6T.cjs');
60
+ require('./chunk-EHD25JBZ.cjs');
61
+ require('./chunk-CEGU5AVD.cjs');
62
+ require('./chunk-RNXXYF22.cjs');
63
+
64
+
65
+
66
+ Object.defineProperty(exports, "Agent", {
67
+ enumerable: true,
68
+ get: function () { return chunkQ6WT5535_cjs.Agent; }
69
+ });
70
+ //# sourceMappingURL=agent-BVKIUP7F.cjs.map
71
+ //# sourceMappingURL=agent-BVKIUP7F.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-OKP4LHG2.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-BVKIUP7F.cjs"}
@@ -1,5 +1,5 @@
1
- import { o as MemoryFact, l as MemoryAdapter, n as MemoryContext, H as SystemPromptSkillRef, C as ContextSettings, P as ProviderRoutingSettings, a as PluginsSettings, S as SDKAgent } from './sdk-agent-wEOLXD3F.js';
2
- import { M as ModelSelection, C as CustomTool, c as PermissionMode, a as McpServerConfig, P as Processor } from './run-DsA5Ip2i.js';
1
+ import { W as MemoryFact, T as MemoryAdapter, V as MemoryContext, aU as SystemPromptSkillRef, M as McpServerConfig, C as ContextSettings, P as ProviderRoutingSettings, a as PluginsSettings, c as Processor, S as SDKAgent } from './sdk-agent-CTOJlWA_.js';
2
+ import { M as ModelSelection, C as CustomTool, P as PermissionMode } from './agent-prims-CZyxfCmS.js';
3
3
 
4
4
  /**
5
5
  * Owner: `src/` (1 of 2 importers). Derived from the import graph, not
@@ -1559,11 +1559,20 @@ interface AgentOptions {
1559
1559
  apiKey?: string;
1560
1560
  name?: string;
1561
1561
  /**
1562
- * When `true`, `Agent.prompt` (and any helper that goes through `run.wait()`)
1563
- * rejects with `AgentRunError` instead of resolving with `{ status: 'error' }`.
1564
- * Cancelled runs (`status: 'cancelled'`) still resolve — cancel ≠ error.
1565
- * If `result.error` is undefined despite `status: 'error'` (malformed RunResult),
1566
- * the defensive guard resolves normally (no throw).
1562
+ * When `true`, a failed run is surfaced as an error instead of resolving with
1563
+ * `{ status: 'error' }`. The error is `result.error.cause`, the typed
1564
+ * {@link TheokitAgentError} behind the failure:
1565
+ *
1566
+ * - `run.wait()`, `agent.generate`, `agent.fork` and `agent.runToCompletion`
1567
+ * reject with it.
1568
+ * - `agent.runUntil` and `agent.streamToCompletion` throw it from their iterator.
1569
+ * - `Agent.batch` returns it as the failed item's `error`.
1570
+ * - A workflow `agentStep`, a cron task and an `Eval` row keep recording the
1571
+ * failure, with its class name, code or message.
1572
+ * - `Agent.prompt` alone wraps it in `AgentRunError`, whose `cause` is the typed error.
1573
+ *
1574
+ * Cancelled and finished runs still resolve. A run with `status: 'error'` but no
1575
+ * `result.error` (malformed RunResult) also resolves.
1567
1576
  *
1568
1577
  * Default `false` (backwards-compatible).
1569
1578
  *
@@ -1678,7 +1687,7 @@ interface AgentOptions {
1678
1687
  * auto-attached, turning a non-reasoning model into a reason -> act ->
1679
1688
  * observe loop (same model; reuses the existing tool loop). Default `false` —
1680
1689
  * byte-identical behaviour when unset. Inert (with a one-time warn) when a
1681
- * native reasoning model is configured (`model.params: [{ id: "thinking" }]`),
1690
+ * native reasoning model is configured (`model.params: [{ id: "thinking", value: "high" }]`),
1682
1691
  * so native and prompt-based reasoning never stack. See `ReasoningTools` in `@theokit/sdk-tools`.
1683
1692
  */
1684
1693
  reasoning?: boolean;
@@ -1,5 +1,5 @@
1
- import { o as MemoryFact, l as MemoryAdapter, n as MemoryContext, H as SystemPromptSkillRef, C as ContextSettings, P as ProviderRoutingSettings, a as PluginsSettings, S as SDKAgent } from './sdk-agent-dNwjwCt5.cjs';
2
- import { M as ModelSelection, C as CustomTool, c as PermissionMode, a as McpServerConfig, P as Processor } from './run-DsA5Ip2i.cjs';
1
+ import { W as MemoryFact, T as MemoryAdapter, V as MemoryContext, aU as SystemPromptSkillRef, M as McpServerConfig, C as ContextSettings, P as ProviderRoutingSettings, a as PluginsSettings, c as Processor, S as SDKAgent } from './sdk-agent-4-dXI2GS.cjs';
2
+ import { M as ModelSelection, C as CustomTool, P as PermissionMode } from './agent-prims-CZyxfCmS.cjs';
3
3
 
4
4
  /**
5
5
  * Owner: `src/` (1 of 2 importers). Derived from the import graph, not
@@ -1559,11 +1559,20 @@ interface AgentOptions {
1559
1559
  apiKey?: string;
1560
1560
  name?: string;
1561
1561
  /**
1562
- * When `true`, `Agent.prompt` (and any helper that goes through `run.wait()`)
1563
- * rejects with `AgentRunError` instead of resolving with `{ status: 'error' }`.
1564
- * Cancelled runs (`status: 'cancelled'`) still resolve — cancel ≠ error.
1565
- * If `result.error` is undefined despite `status: 'error'` (malformed RunResult),
1566
- * the defensive guard resolves normally (no throw).
1562
+ * When `true`, a failed run is surfaced as an error instead of resolving with
1563
+ * `{ status: 'error' }`. The error is `result.error.cause`, the typed
1564
+ * {@link TheokitAgentError} behind the failure:
1565
+ *
1566
+ * - `run.wait()`, `agent.generate`, `agent.fork` and `agent.runToCompletion`
1567
+ * reject with it.
1568
+ * - `agent.runUntil` and `agent.streamToCompletion` throw it from their iterator.
1569
+ * - `Agent.batch` returns it as the failed item's `error`.
1570
+ * - A workflow `agentStep`, a cron task and an `Eval` row keep recording the
1571
+ * failure, with its class name, code or message.
1572
+ * - `Agent.prompt` alone wraps it in `AgentRunError`, whose `cause` is the typed error.
1573
+ *
1574
+ * Cancelled and finished runs still resolve. A run with `status: 'error'` but no
1575
+ * `result.error` (malformed RunResult) also resolves.
1567
1576
  *
1568
1577
  * Default `false` (backwards-compatible).
1569
1578
  *
@@ -1678,7 +1687,7 @@ interface AgentOptions {
1678
1687
  * auto-attached, turning a non-reasoning model into a reason -> act ->
1679
1688
  * observe loop (same model; reuses the existing tool loop). Default `false` —
1680
1689
  * byte-identical behaviour when unset. Inert (with a one-time warn) when a
1681
- * native reasoning model is configured (`model.params: [{ id: "thinking" }]`),
1690
+ * native reasoning model is configured (`model.params: [{ id: "thinking", value: "high" }]`),
1682
1691
  * so native and prompt-based reasoning never stack. See `ReasoningTools` in `@theokit/sdk-tools`.
1683
1692
  */
1684
1693
  reasoning?: boolean;
@@ -0,0 +1,62 @@
1
+ export { Agent } from './chunk-BJ7BPLQK.js';
2
+ import './chunk-HWMGR3HA.js';
3
+ import './chunk-4GUFNDZR.js';
4
+ import './chunk-K2BQQ445.js';
5
+ import './chunk-2C24NSNV.js';
6
+ import './chunk-HJ2LV464.js';
7
+ import './chunk-2SFBB54R.js';
8
+ import './chunk-H7G65PNI.js';
9
+ import './chunk-H73MEMQB.js';
10
+ import './chunk-QK2ERTO3.js';
11
+ import './chunk-DF77RBF4.js';
12
+ import './chunk-AB4OPJLD.js';
13
+ import './chunk-XJ4C4NFX.js';
14
+ import './chunk-5AR6O7GW.js';
15
+ import './chunk-2XC6KDJM.js';
16
+ import './chunk-ZJAYFSVI.js';
17
+ import './chunk-24MGQDK3.js';
18
+ import './chunk-AGO5S5WD.js';
19
+ import './chunk-HKCKOAIO.js';
20
+ import './chunk-KCM3RMKR.js';
21
+ import './chunk-XJ3WU5CZ.js';
22
+ import './chunk-KVNWIAO4.js';
23
+ import './chunk-OLJOI4LK.js';
24
+ import './chunk-FD2UT76F.js';
25
+ import './chunk-7I5Z3UBJ.js';
26
+ import './chunk-FJWQP6EE.js';
27
+ import './chunk-NAF4L3T6.js';
28
+ import './chunk-VZGE7NAI.js';
29
+ import './chunk-6X6ID4MO.js';
30
+ import './chunk-NHOEXFZT.js';
31
+ import './chunk-4QCJAJAG.js';
32
+ import './chunk-SAGRF4IB.js';
33
+ import './chunk-PKRPV3R7.js';
34
+ import './chunk-UKMBRMGT.js';
35
+ import './chunk-ORLTGPOS.js';
36
+ import './chunk-AHKS3DKI.js';
37
+ import './chunk-5IRDK5BC.js';
38
+ import './chunk-XESYJ4JC.js';
39
+ import './chunk-WE22OXQA.js';
40
+ import './chunk-MLJDW2YK.js';
41
+ import './chunk-KU5O7WPK.js';
42
+ import './chunk-354F3OF5.js';
43
+ import './chunk-Q5EWJPRY.js';
44
+ import './chunk-MLGETTYX.js';
45
+ import './chunk-M4U24U6G.js';
46
+ import './chunk-RN3XDZGS.js';
47
+ import './chunk-YMVTUV5K.js';
48
+ import './chunk-Q7UG242V.js';
49
+ import './chunk-SZQFCHU6.js';
50
+ import './chunk-2SFLLOMN.js';
51
+ import './chunk-R7WIIPUR.js';
52
+ import './chunk-NKQVLWDF.js';
53
+ import './chunk-5HSMH2ZZ.js';
54
+ import './chunk-AGACYRJ2.js';
55
+ import './chunk-3FSBE4PS.js';
56
+ import './chunk-MS3TQSXU.js';
57
+ import './chunk-5IUDICRK.js';
58
+ import './chunk-Q7GYMXVC.js';
59
+ import './chunk-TNFOU6SB.js';
60
+ import './chunk-3OY6H3I7.js';
61
+ //# sourceMappingURL=agent-IG7BP6GN.js.map
62
+ //# sourceMappingURL=agent-IG7BP6GN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-DFV52V6E.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-IG7BP6GN.js"}
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Owner: `src/` (2 of 7 importers). Derived from the import graph, not declared —
3
+ * `tests/lint/types-name-their-owner.test.ts` re-derives it.
4
+ *
5
+ * Leaf module for content-block types shared by `messages.ts` (assistant/user
6
+ * content) and `agent-prims.ts` (`CustomTool` handler results). Kept
7
+ * import-free so both can depend on it WITHOUT the `agent-prims ↔ messages`
8
+ * cycle (#7).
9
+ *
10
+ * @public
11
+ */
12
+ /**
13
+ * Plain text content block emitted by the assistant or user, or returned by a
14
+ * tool.
15
+ *
16
+ * @public
17
+ */
18
+ interface TextBlock {
19
+ type: "text";
20
+ text: string;
21
+ }
22
+ /**
23
+ * SE7 — a base64-encoded image block a tool can hand back as (part of) its
24
+ * result or its `ToolError`. `media_type` is a MIME type (e.g. `"image/png"`);
25
+ * `data` is the base64 payload without a data-URL prefix.
26
+ *
27
+ * Note: when a tool builds this from model- or user-influenced input, treat
28
+ * `media_type` as UNTRUSTED — validate/allow-list it before rendering it in a
29
+ * log or UI (it could carry newlines / control chars). The SDK only forwards it
30
+ * (JSON-serialized onto the wire) and never executes or path-joins it.
31
+ *
32
+ * @public
33
+ */
34
+ interface ImageBlock {
35
+ type: "image";
36
+ source: {
37
+ type: "base64";
38
+ media_type: string;
39
+ data: string;
40
+ };
41
+ }
42
+ /**
43
+ * SE7 — structured content a tool result may carry: text and/or images. A tool
44
+ * `handler` may return this (success) and a `ToolError` may carry it (failure).
45
+ * Block-capable provider wires forward it natively; string-only provider wires
46
+ * flatten text and fail fast on an image.
47
+ *
48
+ * @public
49
+ */
50
+ type ToolResultContentBlock = TextBlock | ImageBlock;
51
+
52
+ /**
53
+ * Owner: `internal/agent-loop/` (3 of 11 importers). Derived from the import graph, not
54
+ * declared — `tests/lint/types-name-their-owner.test.ts` re-derives it.
55
+ *
56
+ * Type-leaf — primitives shared between `agent.ts`, `run.ts`, and
57
+ * `messages.ts`. Extracted to break LOW type-only cycles #5 and #7
58
+ * (audit `architecture-output/final_report.md`) per plan
59
+ * arch-review-fixes-2026-06-06 § Phase 4 / T4.1 (D438).
60
+ *
61
+ * Public surface unchanged — `types/agent.ts` re-exports these from this
62
+ * leaf so `import type { ModelSelection, CustomTool } from "@theokit/sdk"`
63
+ * keeps resolving.
64
+ *
65
+ * @public
66
+ */
67
+ /**
68
+ * One slot in a {@link ModelSelection.params} array.
69
+ *
70
+ * The `thinking` param sets the reasoning effort and takes a non-empty value, for example
71
+ * `{ id: "thinking", value: "high" }`. An empty or whitespace-only value is refused with a
72
+ * `ConfigurationError` (code `invalid_model_param`) at `Agent.create` and at a `send` override,
73
+ * before any request. To request no reasoning, leave the `thinking` param out.
74
+ *
75
+ * @public
76
+ */
77
+ interface ModelParameterValue {
78
+ id: string;
79
+ value: string;
80
+ }
81
+ /**
82
+ * Identifies a model plus optional per-model parameters (e.g. reasoning effort).
83
+ *
84
+ * Use `Theokit.models.list()` to discover valid ids and parameter definitions.
85
+ *
86
+ * @public
87
+ */
88
+ interface ModelSelection {
89
+ id: string;
90
+ params?: ModelParameterValue[];
91
+ /**
92
+ * M94 — the model's context window, in tokens. Becomes the window resolver's `override`.
93
+ *
94
+ * It exists for models with NO catalog entry: without it, a 400k model was budgeted against the
95
+ * 128k floor and compacted ~3x more than it needed to. A value above what the catalog knows is
96
+ * clamped — declaring 10M does not blow past the provider.
97
+ */
98
+ contextWindow?: number;
99
+ /**
100
+ * #332 — the endpoint THIS model should reach, for OpenAI-compatible and local servers.
101
+ *
102
+ * Without it the base URL came only from a process-wide env var (`OLLAMA_HOST`) or the provider
103
+ * profile's shipped default, so every `ollama/*` model in a process shared one host — an app
104
+ * could not run a small model on localhost and a large one on a GPU box.
105
+ *
106
+ * It outranks the env var deliberately: with the env var winning, whoever set it for one model
107
+ * would keep hijacking every other one, which is the same bug wearing a hat.
108
+ *
109
+ * Leaving it unset keeps the zero-config path exactly as it was — `ollama/qwen2.5:3b` still
110
+ * resolves to `http://localhost:11434` from the profile, with no key and no setup.
111
+ */
112
+ url?: string;
113
+ }
114
+ /**
115
+ * SE12 — a read-only, text-only projection of one turn of the run's conversation,
116
+ * exposed to a tool handler via `ctx.messages`. Content is flattened to text; tool
117
+ * calls / results and non-text parts are dropped, and turns that project to empty
118
+ * text are omitted. Consumed by `defineSubAgent`'s `messageFilter` to forward
119
+ * (a subset of) the supervisor transcript to a subagent.
120
+ *
121
+ * `role` includes `"system"` for type-completeness with the wire message shape,
122
+ * but the system prompt travels on a separate request field — a `"system"` entry
123
+ * does NOT appear in the current projection.
124
+ *
125
+ * @public
126
+ */
127
+ interface ToolContextMessage {
128
+ role: "system" | "user" | "assistant";
129
+ content: string;
130
+ }
131
+ /**
132
+ * Local function tool declared per-agent via {@link AgentOptions.tools}. The
133
+ * handler runs in-process; no MCP server is involved. The SDK serializes
134
+ * `name`, `description`, and `inputSchema` into the model's tool catalog.
135
+ *
136
+ * Handlers MUST be re-passed on `Agent.resume()` because closures cannot be
137
+ * persisted. The tool catalog (name + description + schema) is NOT serialized.
138
+ *
139
+ * @public
140
+ */
141
+ interface CustomTool {
142
+ /**
143
+ * Tool name surfaced to the LLM. Must match `^[a-zA-Z][a-zA-Z0-9_-]{0,63}$`
144
+ * and must not collide with `shell`, `memory_search`, `memory_get`, or any
145
+ * `mcp_*` prefix (reserved for the SDK's built-in tools).
146
+ */
147
+ name: string;
148
+ /** Description surfaced to the LLM. Required — drives tool-selection accuracy. */
149
+ description: string;
150
+ /** JSON Schema (Draft-7 subset) describing the `input` argument. Must be `type: "object"`. */
151
+ inputSchema: Record<string, unknown>;
152
+ /**
153
+ * Local handler invoked when the model emits `tool_use` for this tool.
154
+ * Returns a string OR structured content blocks (SE7 — text + image, e.g. a
155
+ * screenshot) that become the `tool_result.content` surfaced back to the
156
+ * model. Throws → SDK converts to `tool_result` with `isError: true` and the
157
+ * error `message` as content; throw a `ToolError` to carry a clean message or
158
+ * multimodal error content. #65 — an optional 2nd `ToolContext` argument
159
+ * carries the run's `AbortSignal`; single-argument handlers are unaffected. M7
160
+ * — the same `ctx` also carries an optional user `context` (provided once via
161
+ * `SendOptions.context`), so shared config like a `projectRoot` is read by
162
+ * every tool instead of baked into each factory. SE12 — `ctx.messages` is a
163
+ * read-only, text-only projection of the current turn's transcript (see
164
+ * {@link ToolContextMessage}); `defineSubAgent`'s `messageFilter` consumes it.
165
+ * #119 — `ctx.threadId` is the run's session identity (the key passed to
166
+ * `Agent.getOrCreate(sessionId, …)`, or the agent's own id), so a stateful tool
167
+ * shared across sessions can scope its state per session instead of leaking it.
168
+ */
169
+ handler: (input: Record<string, unknown>, ctx?: {
170
+ signal?: AbortSignal;
171
+ context?: unknown;
172
+ messages?: readonly ToolContextMessage[];
173
+ threadId?: string;
174
+ }) => string | ToolResultContentBlock[] | Promise<string | ToolResultContentBlock[]>;
175
+ }
176
+ /**
177
+ * How the permission engine treats the UNMATCHED verdict.
178
+ *
179
+ * - `default` — ask.
180
+ * - `plan` — read-only.
181
+ * - `acceptEdits` — auto-approve the unmatched verdict, but still honour an explicit `ask` rule.
182
+ * - `bypass` (alias `bypassPermissions`, the Anthropic-exact name) — everything allowed EXCEPT an
183
+ * explicit `deny`. Never asks.
184
+ *
185
+ * G7 / DIP — defined in this type leaf rather than in `permission-engine.ts`, which is a RUNTIME
186
+ * module. `types/agent.ts`, `types/run.ts` and `types/plugin.ts` all need the union, and each one
187
+ * used to reach into the engine for it: three of the nine violations the `types-dont-import-runtime`
188
+ * rule reported the moment it was able to see type-only edges at all. The engine re-exports it, so
189
+ * `import type { PermissionMode } from "@theokit/sdk"` is unchanged.
190
+ *
191
+ * @public
192
+ */
193
+ type PermissionMode = "default" | "plan" | "acceptEdits" | "bypass" | "bypassPermissions";
194
+ /**
195
+ * Operations that may or may not be supported on a given `Run`, or on
196
+ * its parent agent. Kept in this leaf so `errors.ts` can name it without
197
+ * importing `types/run.ts`, which imports `errors.ts`.
198
+ *
199
+ * Runtime-specific availability — query at runtime with `run.supports(op)` and
200
+ * read the human reason via `run.unsupportedReason(op)`.
201
+ *
202
+ * @public
203
+ */
204
+ type RunOperation = "stream" | "wait" | "cancel" | "conversation" | "listArtifacts" | "downloadArtifact" | "runUntil" | "runToCompletion" | "streamToCompletion" | "fork" | "usePersonality" | "workflow";
205
+
206
+ export type { CustomTool as C, ImageBlock as I, ModelSelection as M, PermissionMode as P, RunOperation as R, ToolResultContentBlock as T, ModelParameterValue as a, TextBlock as b, ToolContextMessage as c };