@theokit/sdk 5.11.1 → 5.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/CHANGELOG.md +115 -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-GHHIJEFX.cjs → chunk-BWYC7RZG.cjs} +9 -9
  85. package/dist/{chunk-GHHIJEFX.cjs.map → chunk-BWYC7RZG.cjs.map} +1 -1
  86. package/dist/{chunk-UNFBHV46.cjs → chunk-CEGU5AVD.cjs} +9 -9
  87. package/dist/chunk-CEGU5AVD.cjs.map +1 -0
  88. package/dist/{chunk-JV7JA7BM.cjs → chunk-CGH4BCIY.cjs} +11 -11
  89. package/dist/{chunk-JV7JA7BM.cjs.map → chunk-CGH4BCIY.cjs.map} +1 -1
  90. package/dist/{chunk-L3C6CCBG.cjs → chunk-CWQPQTUZ.cjs} +21 -21
  91. package/dist/{chunk-L3C6CCBG.cjs.map → chunk-CWQPQTUZ.cjs.map} +1 -1
  92. package/dist/{chunk-X3LOJJMO.js → chunk-DF77RBF4.js} +9 -9
  93. package/dist/{chunk-X3LOJJMO.js.map → chunk-DF77RBF4.js.map} +1 -1
  94. package/dist/{chunk-7NQ7HJ3E.cjs → chunk-EPANMGH7.cjs} +8 -7
  95. package/dist/chunk-EPANMGH7.cjs.map +1 -0
  96. package/dist/{chunk-NKIQTLFA.cjs → chunk-EQ5IDL6W.cjs} +4 -4
  97. package/dist/{chunk-NKIQTLFA.cjs.map → chunk-EQ5IDL6W.cjs.map} +1 -1
  98. package/dist/{chunk-D5KXKBEN.cjs → chunk-FEAWEBWN.cjs} +5 -5
  99. package/dist/{chunk-D5KXKBEN.cjs.map → chunk-FEAWEBWN.cjs.map} +1 -1
  100. package/dist/{chunk-NJSIAJEK.cjs → chunk-FLDMPVUC.cjs} +4 -4
  101. package/dist/{chunk-NJSIAJEK.cjs.map → chunk-FLDMPVUC.cjs.map} +1 -1
  102. package/dist/{chunk-ASK2OQM5.cjs → chunk-G7XBVM3T.cjs} +5 -5
  103. package/dist/{chunk-ASK2OQM5.cjs.map → chunk-G7XBVM3T.cjs.map} +1 -1
  104. package/dist/{chunk-U27XHOEF.js → chunk-H7G65PNI.js} +5 -5
  105. package/dist/{chunk-U27XHOEF.js.map → chunk-H7G65PNI.js.map} +1 -1
  106. package/dist/{chunk-JW3GVLM6.cjs → chunk-H7HD6RXO.cjs} +4 -4
  107. package/dist/{chunk-JW3GVLM6.cjs.map → chunk-H7HD6RXO.cjs.map} +1 -1
  108. package/dist/{chunk-ZHWKT2NI.js → chunk-HJ2LV464.js} +3 -3
  109. package/dist/{chunk-ZHWKT2NI.js.map → chunk-HJ2LV464.js.map} +1 -1
  110. package/dist/{chunk-KGZ66JVZ.cjs → chunk-HN4IKB6X.cjs} +14 -14
  111. package/dist/{chunk-KGZ66JVZ.cjs.map → chunk-HN4IKB6X.cjs.map} +1 -1
  112. package/dist/{chunk-XKMVJ443.js → chunk-HWMGR3HA.js} +6 -6
  113. package/dist/{chunk-XKMVJ443.js.map → chunk-HWMGR3HA.js.map} +1 -1
  114. package/dist/{chunk-EQ5NCH2Y.cjs → chunk-IO4RI5ZJ.cjs} +24 -24
  115. package/dist/{chunk-EQ5NCH2Y.cjs.map → chunk-IO4RI5ZJ.cjs.map} +1 -1
  116. package/dist/{chunk-OLSEWLK5.cjs → chunk-IOFMRS6T.cjs} +6 -6
  117. package/dist/{chunk-OLSEWLK5.cjs.map → chunk-IOFMRS6T.cjs.map} +1 -1
  118. package/dist/{chunk-7QJYKVP6.js → chunk-KCM3RMKR.js} +3 -3
  119. package/dist/{chunk-7QJYKVP6.js.map → chunk-KCM3RMKR.js.map} +1 -1
  120. package/dist/{chunk-7KIN3L2S.js → chunk-KU5O7WPK.js} +3 -3
  121. package/dist/{chunk-7KIN3L2S.js.map → chunk-KU5O7WPK.js.map} +1 -1
  122. package/dist/{chunk-J5623RIV.cjs → chunk-KX5QXLBS.cjs} +10 -10
  123. package/dist/{chunk-J5623RIV.cjs.map → chunk-KX5QXLBS.cjs.map} +1 -1
  124. package/dist/{chunk-J6GXS5A2.cjs → chunk-L7JPXZ2C.cjs} +17 -17
  125. package/dist/{chunk-J6GXS5A2.cjs.map → chunk-L7JPXZ2C.cjs.map} +1 -1
  126. package/dist/{chunk-P7NNKEWO.cjs → chunk-L7V4DDIE.cjs} +4 -4
  127. package/dist/{chunk-P7NNKEWO.cjs.map → chunk-L7V4DDIE.cjs.map} +1 -1
  128. package/dist/chunk-LO6LIUZ6.cjs +18 -0
  129. package/dist/{chunk-SGC7LSHF.cjs.map → chunk-LO6LIUZ6.cjs.map} +1 -1
  130. package/dist/{chunk-P5N3Q2NH.cjs → chunk-LSWHDOCL.cjs} +192 -148
  131. package/dist/chunk-LSWHDOCL.cjs.map +1 -0
  132. package/dist/{chunk-3JHIFQ4I.js → chunk-M4U24U6G.js} +3 -3
  133. package/dist/{chunk-3JHIFQ4I.js.map → chunk-M4U24U6G.js.map} +1 -1
  134. package/dist/{chunk-GGRPAQ3B.js → chunk-MLGETTYX.js} +5 -5
  135. package/dist/{chunk-GGRPAQ3B.js.map → chunk-MLGETTYX.js.map} +1 -1
  136. package/dist/{chunk-XZHJYSPB.js → chunk-MLJDW2YK.js} +4 -4
  137. package/dist/{chunk-XZHJYSPB.js.map → chunk-MLJDW2YK.js.map} +1 -1
  138. package/dist/{chunk-5Q4RTLMP.js → chunk-MS3TQSXU.js} +3 -3
  139. package/dist/{chunk-5Q4RTLMP.js.map → chunk-MS3TQSXU.js.map} +1 -1
  140. package/dist/{chunk-W2ZVTEOD.js → chunk-MSEL5E5P.js} +6 -6
  141. package/dist/{chunk-W2ZVTEOD.js.map → chunk-MSEL5E5P.js.map} +1 -1
  142. package/dist/{chunk-ZAM7BJXJ.cjs → chunk-MSW7LB2V.cjs} +5 -5
  143. package/dist/{chunk-ZAM7BJXJ.cjs.map → chunk-MSW7LB2V.cjs.map} +1 -1
  144. package/dist/{chunk-GMSRRJ53.js → chunk-NBNRQN6T.js} +5 -4
  145. package/dist/chunk-NBNRQN6T.js.map +1 -0
  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 +114 -41
  328. package/dist/sandbox/index.cjs.map +1 -1
  329. package/dist/sandbox/index.js +99 -26
  330. package/dist/sandbox/index.js.map +1 -1
  331. package/dist/sandbox/linux-sandbox.d.cts +24 -4
  332. package/dist/sandbox/linux-sandbox.d.ts +24 -4
  333. package/dist/sandbox/seccomp-delivery.d.cts +46 -0
  334. package/dist/sandbox/seccomp-delivery.d.ts +46 -0
  335. package/dist/{run-DsA5Ip2i.d.cts → sdk-agent-4-dXI2GS.d.cts} +1500 -753
  336. package/dist/{run-DsA5Ip2i.d.ts → sdk-agent-CTOJlWA_.d.ts} +1500 -753
  337. package/dist/server/auth/index.cjs +22 -22
  338. package/dist/server/auth/index.js +7 -7
  339. package/dist/server/errors-envelope.cjs +14 -14
  340. package/dist/server/errors-envelope.d.cts +2 -3
  341. package/dist/server/errors-envelope.d.ts +2 -3
  342. package/dist/server/errors-envelope.js +3 -3
  343. package/dist/session-transcript-7TZ6HXSX.cjs +62 -0
  344. package/dist/{session-transcript-RACG7BK2.cjs.map → session-transcript-7TZ6HXSX.cjs.map} +1 -1
  345. package/dist/session-transcript-BSHZYYY6.js +5 -0
  346. package/dist/{session-transcript-AR7IBICT.js.map → session-transcript-BSHZYYY6.js.map} +1 -1
  347. package/dist/skills.cjs +8 -8
  348. package/dist/skills.js +5 -5
  349. package/dist/stream-object-R6SMYV4R.js +7 -0
  350. package/dist/{stream-object-QAEHG4YO.js.map → stream-object-R6SMYV4R.js.map} +1 -1
  351. package/dist/stream-object-TEEK3CAX.cjs +20 -0
  352. package/dist/{stream-object-TKVGGA54.cjs.map → stream-object-TEEK3CAX.cjs.map} +1 -1
  353. package/dist/subagents-loader-TXOA5EJJ.cjs +16 -0
  354. package/dist/{subagents-loader-5TZCAIYQ.cjs.map → subagents-loader-TXOA5EJJ.cjs.map} +1 -1
  355. package/dist/subagents-loader-Z744TAKD.js +7 -0
  356. package/dist/{subagents-loader-PEV3PD4Q.js.map → subagents-loader-Z744TAKD.js.map} +1 -1
  357. package/dist/subagents-loader.cjs +7 -7
  358. package/dist/subagents-loader.d.cts +4 -3
  359. package/dist/subagents-loader.d.ts +4 -3
  360. package/dist/subagents-loader.js +5 -5
  361. package/dist/subscription/index.cjs +3 -3
  362. package/dist/subscription/index.js +2 -2
  363. package/dist/task-store.cjs +7 -7
  364. package/dist/task-store.js +4 -4
  365. package/dist/types/agent-prims.d.ts +16 -0
  366. package/dist/types/agent.d.ts +15 -6
  367. package/dist/types/run.d.ts +14 -14
  368. package/dist/workflow.cjs +27 -27
  369. package/dist/workflow.d.cts +2 -2
  370. package/dist/workflow.d.ts +2 -2
  371. package/dist/workflow.js +6 -6
  372. package/docs/error-codes.md +24 -23
  373. package/docs/harness-capability-map.md +5 -5
  374. package/package.json +1 -1
  375. package/dist/agent-DFV52V6E.js +0 -62
  376. package/dist/agent-OKP4LHG2.cjs +0 -71
  377. package/dist/agent-session-store-ODD3IZCW.js +0 -6
  378. package/dist/agent-session-store-SVEJHSUA.cjs +0 -23
  379. package/dist/chunk-35KBC4BX.cjs.map +0 -1
  380. package/dist/chunk-6LHQPOMI.cjs.map +0 -1
  381. package/dist/chunk-7NQ7HJ3E.cjs.map +0 -1
  382. package/dist/chunk-B5MHRQJZ.js.map +0 -1
  383. package/dist/chunk-BBJ77S62.js.map +0 -1
  384. package/dist/chunk-CZJ6Q7CW.js.map +0 -1
  385. package/dist/chunk-GMSRRJ53.js.map +0 -1
  386. package/dist/chunk-JLIRFWUG.js.map +0 -1
  387. package/dist/chunk-MHIBYKWA.js.map +0 -1
  388. package/dist/chunk-N7KS3TIR.cjs.map +0 -1
  389. package/dist/chunk-P5N3Q2NH.cjs.map +0 -1
  390. package/dist/chunk-SGC7LSHF.cjs +0 -18
  391. package/dist/chunk-UNFBHV46.cjs.map +0 -1
  392. package/dist/compact-session-4HAUP3HK.js +0 -25
  393. package/dist/context-3FZRAO5K.js +0 -7
  394. package/dist/context-B5J4GX2F.cjs +0 -24
  395. package/dist/fs-session-store-3VI4CPTX.js +0 -11
  396. package/dist/fs-session-store-IQ6PEHYF.cjs +0 -20
  397. package/dist/generate-object-NTKAWE7D.js +0 -7
  398. package/dist/generate-object-YHTWG5DB.cjs +0 -20
  399. package/dist/index-manager-JVYIVTZG.js +0 -18
  400. package/dist/index-manager-YGXRFJMZ.cjs +0 -27
  401. package/dist/judge-call-AQQYK6VT.cjs +0 -22
  402. package/dist/judge-call-LOL5FQEX.js +0 -5
  403. package/dist/oauth-transaction-store-NP2YHZ6D.js +0 -5
  404. package/dist/oauth-transaction-store-ZINDV7AF.cjs +0 -38
  405. package/dist/registry-5FK42CRV.js +0 -9
  406. package/dist/registry-BVTNO73E.cjs +0 -46
  407. package/dist/run-until-6D6TQ4JN.js.map +0 -1
  408. package/dist/run-until-DG2KXWB2.cjs.map +0 -1
  409. package/dist/sdk-agent-dNwjwCt5.d.cts +0 -940
  410. package/dist/sdk-agent-wEOLXD3F.d.ts +0 -940
  411. package/dist/session-transcript-AR7IBICT.js +0 -5
  412. package/dist/session-transcript-RACG7BK2.cjs +0 -62
  413. package/dist/stream-object-QAEHG4YO.js +0 -7
  414. package/dist/stream-object-TKVGGA54.cjs +0 -20
  415. package/dist/subagents-loader-5TZCAIYQ.cjs +0 -16
  416. package/dist/subagents-loader-PEV3PD4Q.js +0 -7
@@ -1,940 +0,0 @@
1
- import { M as ModelSelection, ab as SDKUserMessage, ad as SendOptions, b as Run, G as GenerateOptions, m as GenerateRunResult, Z as RunToCompletionOptions, _ as RunToCompletionResult, S as SDKMessage, ak as StreamToCompletionResult } from './run-DsA5Ip2i.js';
2
- import * as zod from 'zod';
3
-
4
- /**
5
- * Owner: `internal/local-agent/` (2 of 4 importers). Derived from the import graph, not declared —
6
- * `tests/lint/types-name-their-owner.test.ts` re-derives it.
7
- *
8
- * Public `MemoryAdapter` contract (T1.1, ADRs D141 / D147).
9
- *
10
- * The plugin extension point `{ kind: "memory" }` (ADR D98) declares a
11
- * `createProvider` factory; this file types its return value formally.
12
- * Adapters implement `write` / `recall` / `delete` plus optional methods
13
- * gated by `capabilities`. `MemoryId` is a branded string prefixed with
14
- * the adapter id so cross-adapter use throws on `extractRawId` (EC-B).
15
- *
16
- * Each provider-specific package (`@theokit-memory-supermemory`, etc)
17
- * exports a factory returning a `Plugin { kind: "memory" }` whose
18
- * `createProvider` resolves to a `MemoryAdapter` instance.
19
- *
20
- * @public
21
- */
22
- /**
23
- * Branded provider memory ID. Format: `${adapterId}:${rawProviderId}`.
24
- * Use `mkMemoryId` / `extractRawId` from `../memory-adapter-helpers.js`
25
- * to construct and unwrap with cross-adapter safety (EC-B).
26
- *
27
- * @public
28
- */
29
- type MemoryId = string & {
30
- readonly __brand: "MemoryId";
31
- };
32
- /**
33
- * Portable identity context. `userId` is the only required field —
34
- * the lowest common denominator across Supermemory / Honcho / Mem0.
35
- * Adapter implementations translate the optional fields to their
36
- * provider's native primitives (Honcho session, Mem0 run_id, etc).
37
- *
38
- * @public
39
- */
40
- interface MemoryContext {
41
- /** End-user identity. */
42
- userId: string;
43
- /** Agent / persona writing the memory. */
44
- agentId?: string;
45
- /** Logical conversation / run boundary. */
46
- sessionId?: string;
47
- /** Tenant / workspace partition. */
48
- tenantId?: string;
49
- /** Free-form tags for filtering / categorization. */
50
- tags?: string[];
51
- /** Provider-passthrough metadata. */
52
- metadata?: Record<string, unknown>;
53
- }
54
- /**
55
- * A single memory fact returned by `recall` or `get`.
56
- *
57
- * @public
58
- */
59
- interface MemoryFact {
60
- id: MemoryId;
61
- content: string;
62
- /** Semantic relevance score (provider-defined scale) when result of `recall`. */
63
- score?: number;
64
- /** ISO 8601 timestamp of creation. */
65
- createdAt?: string;
66
- metadata?: Record<string, unknown>;
67
- }
68
- /**
69
- * Versioned snapshot of a memory's history. Only emitted by providers
70
- * with `capabilities.history === true` (Mem0 today).
71
- *
72
- * @public
73
- */
74
- interface MemoryRevision {
75
- id: MemoryId;
76
- content: string;
77
- version: number;
78
- changedAt: string;
79
- }
80
- /**
81
- * Statically declared adapter feature flags. Consumers feature-detect
82
- * at compile time via `if (adapter.capabilities.history)`.
83
- *
84
- * @public
85
- */
86
- interface MemoryAdapterCapabilities {
87
- /** Returns prior versions of a memory via `history(id)`. */
88
- history: boolean;
89
- /** First-class `sessionId` scoping. */
90
- sessions: boolean;
91
- /** First-class `tenantId` scoping. */
92
- tenancy: boolean;
93
- /** Provider performs reasoning over memory (e.g., Honcho dialectic). */
94
- reasoning: boolean;
95
- /** Exposes LLM-callable function-calling schemas. */
96
- toolSchemas: boolean;
97
- /** Supports background prefetch (currently informational). */
98
- prefetch: boolean;
99
- }
100
- /**
101
- * One assistant-turn message in the canonical `{role, content}` shape
102
- * an adapter may receive instead of a flat string when writing a turn.
103
- *
104
- * @public
105
- */
106
- interface MemoryTurnMessage {
107
- role: "user" | "assistant" | "system";
108
- content: string;
109
- }
110
- /**
111
- * OpenAI-format function-calling schema exposed to the LLM.
112
- *
113
- * @public
114
- */
115
- interface MemoryToolSchema {
116
- name: string;
117
- description: string;
118
- parameters: Record<string, unknown>;
119
- }
120
- /**
121
- * Portable third-party memory adapter contract. Implementations live
122
- * in `@theokit-memory-*` packages; the SDK never imports them.
123
- *
124
- * @public
125
- */
126
- interface MemoryAdapter {
127
- /** Short identifier — matches the `${adapterId}` prefix in `MemoryId`. */
128
- readonly id: string;
129
- readonly capabilities: MemoryAdapterCapabilities;
130
- /**
131
- * Synchronous availability probe — no network, no I/O. Typically "do I have the credentials I
132
- * need".
133
- *
134
- * `false` DISABLES the adapter: the runtime skips it when building the agent's memory, warns
135
- * naming this `id`, and carries on with whatever other adapters said yes. When every registered
136
- * adapter declines, a `write` or `recall` fails with `no_memory_adapter` and a message saying so,
137
- * rather than resolving without storing anything.
138
- *
139
- * It was mandatory and consulted by nothing until #360, which made it a contract that read as a
140
- * guarantee and provided none — a missing key surfaced mid-conversation as `auth_failed` instead.
141
- */
142
- isAvailable(): boolean;
143
- /** One-shot initialization. Idempotent: safe to call multiple times. */
144
- initialize?(): Promise<void>;
145
- /**
146
- * Persist a fact or full turn to memory. Returns the stored
147
- * `MemoryId`. Throws `MemoryAdapterError(code: "invalid_input")` on
148
- * empty content or invalid identifiers in `ctx`.
149
- */
150
- write(content: string | MemoryTurnMessage[], ctx: MemoryContext): Promise<MemoryId>;
151
- /**
152
- * Semantic recall — top-`k` facts ordered by relevance. Returns
153
- * empty array when `k === 0` or no matches.
154
- */
155
- recall(query: string, ctx: MemoryContext, k?: number): Promise<MemoryFact[]>;
156
- /**
157
- * Delete a memory by id. Throws `MemoryAdapterError(code:
158
- * "invalid_input")` when the id was minted by a different adapter
159
- * (EC-B). Throws `code: "not_found"` when the id does not exist.
160
- */
161
- delete(id: MemoryId): Promise<void>;
162
- list?(ctx: MemoryContext, opts?: {
163
- cursor?: string;
164
- limit?: number;
165
- }): AsyncIterable<MemoryFact>;
166
- get?(id: MemoryId): Promise<MemoryFact | null>;
167
- history?(id: MemoryId): Promise<MemoryRevision[]>;
168
- /** Empty array when `capabilities.toolSchemas === false`. */
169
- getToolSchemas?(): MemoryToolSchema[];
170
- handleToolCall?(name: string, args: Record<string, unknown>, ctx: MemoryContext): Promise<string>;
171
- /** Graceful shutdown — flush queues, close connections. */
172
- shutdown?(): Promise<void>;
173
- }
174
- /**
175
- * Direct memory API exposed on `SDKAgent.memory`. Resolves to whichever
176
- * memory adapter(s) are registered via `Agent.create({ plugins: [...] })`.
177
- *
178
- * @public
179
- */
180
- interface AgentMemory {
181
- /**
182
- * Persist a fact. Returns the first adapter's id; in multi-adapter
183
- * setups all adapters receive the write (fan-out).
184
- */
185
- write(content: string | MemoryTurnMessage[], ctx?: Partial<MemoryContext>): Promise<MemoryId>;
186
- /** Semantic recall — merged + deduped across registered adapters. */
187
- recall(query: string, ctx?: Partial<MemoryContext>, k?: number): Promise<MemoryFact[]>;
188
- /** Delete a memory by id — routes to the owning adapter via prefix. */
189
- delete(id: MemoryId): Promise<void>;
190
- /** Returns the first registered adapter or `null` when none exists. */
191
- adapter(): MemoryAdapter | null;
192
- }
193
-
194
- /**
195
- * Owner: `src/` (1 of 2 importers). Derived from the import graph, not declared —
196
- * `tests/lint/types-name-their-owner.test.ts` re-derives it.
197
- *
198
- * Context manager backend.
199
- *
200
- * - `"file"` — Read `.theokit/context.json` from the workspace (local) or the
201
- * cloned repo (cloud).
202
- *
203
- * @public
204
- */
205
- type ContextManagerKind = "file";
206
- /**
207
- * Context configuration accepted by `Agent.create()` via {@link AgentOptions.context}.
208
- *
209
- * @public
210
- */
211
- interface ContextSettings {
212
- /** Which backend reads context. Defaults to `"file"`. */
213
- manager?: ContextManagerKind;
214
- /** Hard cap on tokens emitted into the agent's system prompt. */
215
- maxTokens?: number;
216
- /**
217
- * Per-file truncation cap in characters. Default 40_000 (~10k tokens).
218
- * Larger files are truncated with 70%/20% head/tail + marker (ADR D155).
219
- *
220
- * @public
221
- */
222
- maxBytesPerFile?: number;
223
- /**
224
- * Aggregate cap across all context files in characters. Default 120_000.
225
- * When total exceeds this, lower-priority sources are dropped (ADR D155).
226
- *
227
- * Note: context snapshot is **refresh-time** (EC-T); modifying context
228
- * files mid-flight does not auto-update. Call `agent.reload()` to pick
229
- * up changes.
230
- *
231
- * @public
232
- */
233
- maxBytesTotal?: number;
234
- }
235
- /**
236
- * Inclusion state of a single context source in a {@link ContextSnapshot}.
237
- *
238
- * @public
239
- */
240
- type ContextSourceStatus = "included" | "excluded" | "summarized";
241
- /**
242
- * A single context source resolved by the context manager.
243
- *
244
- * @public
245
- */
246
- interface ContextSource {
247
- /** Stable identifier — usually the filename without extension. */
248
- name: string;
249
- /** Path relative to the workspace root, when applicable. */
250
- path?: string;
251
- /** Whether the source was included, dropped, or summarized to fit the budget. */
252
- status: ContextSourceStatus;
253
- /** Free-text reason when `status !== "included"`. */
254
- reason?: string;
255
- }
256
- /**
257
- * Token budget used by the context manager for a single agent.
258
- *
259
- * @public
260
- */
261
- interface ContextBudget {
262
- maxTokens?: number;
263
- /**
264
- * Either a token count or a list of token strings extracted from source
265
- * content. Normalized to `<tokens>` in golden comparisons.
266
- */
267
- usedTokens?: number | string[];
268
- }
269
- /**
270
- * Result of `agent.context.snapshot()`. Public and secret-free by design — safe
271
- * to log and persist. Raw secrets, local absolute paths, and exact token values
272
- * are never present.
273
- *
274
- * @public
275
- */
276
- interface ContextSnapshot {
277
- runtime: "local" | "cloud";
278
- sources: ContextSource[];
279
- budget?: ContextBudget;
280
- }
281
- /**
282
- * Public context manager handle exposed as `agent.context`.
283
- *
284
- * @public
285
- */
286
- interface SDKContextManager {
287
- /** Inspect what the context manager actually loaded for the agent. */
288
- snapshot(): Promise<ContextSnapshot>;
289
- }
290
-
291
- /**
292
- * Owner: `src/` (4 of 9 importers). Derived from the import graph, not declared —
293
- * `tests/lint/types-name-their-owner.test.ts` re-derives it.
294
- *
295
- * Capability slot a provider can fulfill.
296
- *
297
- * @public
298
- */
299
- type ProviderCapability = "chat" | "web_search" | "image" | "embedding";
300
- /**
301
- * A single user-declared routing rule. Maps a capability to a provider, and
302
- * optionally pins a specific model.
303
- *
304
- * @public
305
- */
306
- interface ProviderRoute {
307
- capability: ProviderCapability;
308
- provider: string;
309
- model?: string;
310
- /**
311
- * Opt-in leaked-dialect safe-parse for this route's provider (theokit#58
312
- * follow-up). When `true`, a `chat_completions` finish that carries ZERO
313
- * native `tool_calls` has its assistant text scanned for the Hermes
314
- * `<function=…></tool_call>` dialect, and any recovered calls are surfaced as
315
- * real `tool_calls` so the loop executes them — for models (qwen3-coder via
316
- * OpenRouter) that intermittently leak tool calls as text. Default `false`;
317
- * fail-open (a partial/unclosed block never fabricates a call). Scoped to the
318
- * resolved chat chain, so a non-leaking route is unaffected.
319
- */
320
- extractToolCallsFromContent?: boolean;
321
- }
322
- /**
323
- * Provider routing configuration accepted by `Agent.create()` via
324
- * {@link AgentOptions.providers}.
325
- *
326
- * @public
327
- */
328
- interface ProviderRoutingSettings {
329
- /** Explicit `{ capability → provider }` map. First match wins per capability. */
330
- routes: ProviderRoute[];
331
- /** Provider names to try in order when a route has no provider available. */
332
- fallback?: string[];
333
- /**
334
- * Multiple API keys per provider for same-provider key rotation
335
- * (credential pool — ADRs D123-D133). When a key hits HTTP 429, 402,
336
- * or 401, the SDK rotates to the next entry transparently before
337
- * falling back to a different provider.
338
- *
339
- * Example:
340
- * ```ts
341
- * apiKeys: { openrouter: ["sk-or-...", "sk-or-..."], anthropic: ["..."] }
342
- * ```
343
- *
344
- * Empty arrays and empty strings are filtered out. If a provider has
345
- * exactly 1 effective key, the pool is transparent (no rotation behavior).
346
- *
347
- * Conflicts with the single-key shape `AgentOptions.apiKey: "..."` —
348
- * use one OR the other, not both.
349
- *
350
- * @public
351
- */
352
- apiKeys?: Record<string, string[]>;
353
- /**
354
- * Rotation strategy per provider for the credential pool. Default is
355
- * `"fill_first"` (use entries[0] until exhausted). Only consulted when
356
- * `apiKeys[provider]` has ≥2 entries.
357
- *
358
- * @public
359
- */
360
- credentialPoolStrategy?: Record<string, "fill_first" | "round_robin" | "least_used" | "random">;
361
- }
362
- /**
363
- * Plugins configuration accepted by `Agent.create()` via
364
- * {@link AgentOptions.plugins}.
365
- *
366
- * @public
367
- */
368
- interface PluginsSettings {
369
- /** Plugin names to enable. Plugin discovery is plugin-provider specific. */
370
- enabled?: string[];
371
- }
372
- /**
373
- * Resolved routing decision returned by `agent.providers.routes()`. Public and
374
- * secret-free by design — safe to log.
375
- *
376
- * @public
377
- */
378
- interface ResolvedProviderRoute {
379
- capability: string;
380
- provider: string;
381
- model?: string;
382
- /** Why the runtime picked this provider (e.g. `"explicit-model-provider"`). */
383
- reason: string;
384
- }
385
- /**
386
- * Public providers manager handle exposed as `agent.providers`.
387
- *
388
- * @public
389
- */
390
- interface SDKProvidersManager {
391
- /** Inspect which provider serves each capability for this agent. */
392
- routes(): Promise<ResolvedProviderRoute[]>;
393
- }
394
- /**
395
- * Provider catalog entry returned by `Theokit.providers.list()`.
396
- *
397
- * @public
398
- */
399
- interface SDKProvider {
400
- name: string;
401
- displayName: string;
402
- capabilities: string[];
403
- isAvailable: boolean;
404
- /** JSON Schema describing the env vars / fields needed to enable this provider. */
405
- setupSchema: object;
406
- }
407
-
408
- /**
409
- * Owner: `internal/runtime/lifecycle/` (1 of 1 importers). Derived from the import graph, not
410
- * declared — `tests/lint/types-name-their-owner.test.ts` re-derives it.
411
- *
412
- * Fork primitive public type contracts (T1.2, ADRs D110-D114).
413
- *
414
- * Extracted into a leaf type module (arch-review ADR 0001) so the public
415
- * `types/agent.ts` barrel can reference `ForkOptions`/`ForkResult` without
416
- * importing the `internal/runtime/lifecycle/fork-agent.ts` implementation — which in
417
- * turn imports back from `types/agent.ts`. That mutual reference created a
418
- * type-only `madge` cycle. These interfaces are self-contained (no SDKAgent
419
- * / AgentOptions references), so co-locating them here breaks the cycle with
420
- * no runtime change. `fork-agent.ts` re-exports them for back-compat.
421
- */
422
- /**
423
- * Caller-supplied fork configuration. See `forkAgentImpl`.
424
- *
425
- * @public
426
- */
427
- interface ForkOptions {
428
- /**
429
- * Tool subset visible to the fork. Names must match the canonical (post-repair)
430
- * tool name — typically lowercase. Tools not in this set return a `tool_result`
431
- * with `"Tool blocked by fork whitelist"` content (EC-H).
432
- */
433
- allowedTools: Set<string>;
434
- /** Task prompt sent to the fork. */
435
- prompt: string;
436
- /** Override system prompt. Default: byte-identical inheritance from parent (D112). */
437
- systemPrompt?: string;
438
- /** Memory write provenance tag (D114). Default `"fork"`. */
439
- forkOrigin?: string;
440
- }
441
- /**
442
- * Outcome of a fork run.
443
- *
444
- * @public
445
- */
446
- interface ForkResult {
447
- /** Final agent response text (`undefined` when the fork produced no result). */
448
- result: string | undefined;
449
- /** Tool calls executed inside the fork. */
450
- toolCalls: ReadonlyArray<{
451
- name: string;
452
- input: Record<string, unknown>;
453
- }>;
454
- /** Aggregate token usage reported by the run. */
455
- usage: {
456
- inputTokens: number;
457
- outputTokens: number;
458
- };
459
- }
460
-
461
- /**
462
- * Owner: `internal/judge/` (3 of 8 importers). Derived from the import graph, not declared —
463
- * `tests/lint/types-name-their-owner.test.ts` re-derives it.
464
- *
465
- * M80 — the terminal verdicts a judge can return.
466
- *
467
- * `"blocked"` was added here in this milestone. `GoalResult.status` already carried it, but the
468
- * judge had no way to EMIT it: its vocabulary was `done | continue | skipped`, so facing a real
469
- * blocker it could only say `continue` — and the loop repeated the same turn until it blew the
470
- * budget, reporting `failed` on a limit rather than `blocked` on impossibility. Two different causes
471
- * with the same visible outcome.
472
- *
473
- * @public
474
- */
475
- type Verdict = "done" | "continue" | "skipped" | "blocked";
476
- /**
477
- * M80 — the result of a judge call, now public.
478
- *
479
- * It was `internal/`, so a consumer wanting to type the return — to react to `blocked` without a
480
- * magic string — had to redeclare the shape. It is the same duplication M78 closed for the error
481
- * hierarchy: without a public surface, reimplementing is the only legal way out for anyone behind
482
- * the layer boundary.
483
- *
484
- * @public
485
- */
486
- interface JudgeResult {
487
- verdict: Verdict;
488
- reason: string;
489
- /**
490
- * `true` when the text did not start with one of the canonical prefixes. The verdict becomes
491
- * `"continue"` (fail-safe) so the loop does not stop too early; the caller counts consecutive
492
- * failures and gives up via `maxConsecutiveJudgeFailures`.
493
- */
494
- parseFailed: boolean;
495
- }
496
- /**
497
- * Single event emitted while iterating a goal-driven loop — the public event type of
498
- * {@link SDKAgent.runUntil} (ADRs D115-D117). Discriminated union by the `type` field so
499
- * consumers can `switch (event.type)` with full TypeScript exhaustiveness; mirrors the
500
- * {@link import("../stream-object.js").StreamObjectEvent} pattern (ADR D39).
501
- *
502
- * Five variants:
503
- *
504
- * - `turn_start` — the agent is about to invoke `send()`. Emitted once
505
- * per turn.
506
- * - `agent_response` — the agent's `send()` resolved; carries the text
507
- * reply.
508
- * - `judge_verdict` — the auxiliary judge model evaluated the response.
509
- * `parseFailed: true` indicates the judge returned a malformed reply
510
- * (fail-safe verdict = `continue`, see ADR D121).
511
- * - `continuation` — the judge ruled `continue`; carries the prompt that
512
- * was sent on THIS turn (i.e., the input that produced the agent
513
- * response just yielded). Useful for consumers who want to audit the
514
- * exact continuation message that drove each iteration. The prompt
515
- * for the NEXT turn is composed lazily at the start of that turn
516
- * from the latest `agent_response.content`.
517
- * - `status_change` — transition of the overall goal state. Always
518
- * emitted once at start (`active`) and once at end
519
- * (`completed | failed | paused`).
520
- *
521
- * @public
522
- */
523
- type GoalEvent = {
524
- type: "turn_start";
525
- turn: number;
526
- goal: string;
527
- } | {
528
- type: "agent_response";
529
- turn: number;
530
- content: string;
531
- } | {
532
- type: "judge_verdict";
533
- turn: number;
534
- /** M80 — `"blocked"` was added: the judge can declare impossibility, not just "continue". */
535
- verdict: "done" | "continue" | "skipped" | "blocked";
536
- reason: string;
537
- parseFailed: boolean;
538
- } | {
539
- type: "continuation";
540
- turn: number;
541
- prompt: string;
542
- } | {
543
- type: "status_change";
544
- status: "active" | "paused" | "completed" | "failed" | "budget_limited" | "blocked";
545
- reason: string;
546
- };
547
- /**
548
- * Return value of the `runUntil` async generator. Consumer reads via
549
- * `const { value } = await gen.next()` (when `done: true`).
550
- *
551
- * @public
552
- */
553
- interface GoalResult {
554
- status: "completed" | "failed" | "paused" | "budget_limited" | "blocked";
555
- turnsUsed: number;
556
- /** M55 — tokens summed across the loop (0 when `usage` was absent — fail-open). */
557
- tokensUsed: number;
558
- finalResponse: string | undefined;
559
- }
560
- /**
561
- * Return type of {@link import("../internal/local-agent/local-agent.js").LocalAgent.runUntil}.
562
- * Extracted so the LocalAgent method signature stays a single line (G8 LoC budget).
563
- *
564
- * @public
565
- */
566
- type RunUntilIterator = AsyncGenerator<GoalEvent, GoalResult, void>;
567
- /**
568
- * Per-call configuration for `Agent.runUntil`.
569
- *
570
- * @public
571
- */
572
- interface GoalOptions {
573
- /** Hard cap on iterations (safety net against runaway). Default `20`. */
574
- maxTurns?: number;
575
- /**
576
- * M55 — token budget (Codex ext/goal parity, tool.rs:454-465). Sums `run.wait().usage.totalTokens`
577
- * per turn; on crossing it, the loop stops with status `budget_limited`. Omitted => unlimited (only
578
- * maxTurns). A missing `usage` never blows the budget (fail-open).
579
- */
580
- tokenBudget?: number;
581
- /** Bail after N consecutive judge parse failures. Default `3` (ADR D121). */
582
- maxConsecutiveJudgeFailures?: number;
583
- /** Judge model identifier. Default `"openai/gpt-4o-mini"` (ADR D119). */
584
- judgeModel?: string;
585
- /** Override env for the judge auxiliary agent. Default `OPENROUTER_API_KEY` (EC-A). */
586
- judgeApiKey?: string;
587
- /**
588
- * M80 — the model of the DRIVEN agent, the basis for deriving the judge when `judgeModel` is
589
- * omitted.
590
- *
591
- * It exists because the fixed default (`openai/gpt-4o-mini`) only resolves on OpenRouter: an
592
- * Anthropic key gives 404, an OAuth bearer gives 401, and the goal burned 3 turns before failing
593
- * with a misleading reason. A judge running on the chat's own model works wherever chat works.
594
- */
595
- agentModel?: string;
596
- /** Optional subgoals fed to the judge prompt. */
597
- subgoals?: string[];
598
- /**
599
- * Cancel mid-loop via `AbortController.signal`. The generator yields
600
- * a `status_change: paused` event and returns at the next turn
601
- * boundary (ADR D117).
602
- */
603
- signal?: AbortSignal;
604
- }
605
-
606
- /**
607
- * Public skill metadata exposed to the system-prompt resolver. Mirrors the
608
- * shape returned by `agent.skills.list()` — name + description only, never
609
- * full skill bodies.
610
- *
611
- * @public
612
- */
613
- interface SystemPromptSkillRef {
614
- name: string;
615
- description: string;
616
- /**
617
- * Where this skill came from: the absolute path to its `SKILL.md` for a skill read from disk,
618
- * or the synthetic `inline://<name>` marker `createSkill` stamps on a code-defined one (see
619
- * `create-skill.ts`) — there is no third case, so this is populated for every skill `list()`
620
- * returns.
621
- *
622
- * It is the ORIGIN and NOT the body: `list()` stays lean by contract, and a skill's instructions
623
- * are reachable only through {@link SDKAgentSkills.get}. What this adds is the answer to
624
- * usetheokit/theokit-sdk#524's visibility question — which root a skill came from, so a listing
625
- * can show that one arrived from `.claude/skills/` rather than the project's own directory, or
626
- * that it was never on disk at all.
627
- *
628
- * Typed optional rather than required because {@link SystemPromptSkillRef} is the shape any
629
- * future skill producer returns, and this SDK should not assert every one of them can name an
630
- * origin.
631
- */
632
- source?: string;
633
- }
634
- /**
635
- * A skill resolved WITH its body, returned by {@link SDKAgentSkills.get}. Unlike
636
- * {@link SystemPromptSkillRef}, which carries metadata only, this carries the full
637
- * `instructions` — read from the SKILL.md for filesystem skills or the inline
638
- * `createSkill` body. @public
639
- */
640
- interface SDKAgentSkillDetail {
641
- name: string;
642
- description: string;
643
- instructions: string;
644
- /** SE21 — supporting documents bundled with the skill (filename → content), when present. */
645
- references?: Record<string, string>;
646
- }
647
- /**
648
- * The skill handle exposed as `agent.skills`, present only when project-scoped skills are enabled
649
- * (`settingSources: ["project"]`) or `skills.enabled` is set. The property is optional on the agent,
650
- * and `undefined` there means skills were never turned on — not that none were found.
651
- *
652
- * The split between its two methods is the choice it asks of a caller. `list()` returns name and
653
- * description only, which is what belongs in a system prompt: it stays cheap and it keeps skill
654
- * bodies out of the context window. `get(name)` resolves one skill WITH its `instructions` — the
655
- * SKILL.md body for a filesystem skill, the inline body for one built with `createSkill` — and
656
- * returns `undefined` when no enabled skill matches that name. Ask for a body only when you are
657
- * about to use it.
658
- *
659
- * @public
660
- */
661
- interface SDKAgentSkills {
662
- list(): Promise<ReadonlyArray<SystemPromptSkillRef>>;
663
- /**
664
- * SE20 — resolve a skill by name INCLUDING its body (`instructions`). Returns
665
- * `undefined` when no enabled skill matches. `list()` stays lean (name +
666
- * description); full bodies come only through `get`.
667
- */
668
- get(name: string): Promise<SDKAgentSkillDetail | undefined>;
669
- }
670
- /**
671
- * Public plugin metadata returned by `agent.plugins.list()`. Mirrors the
672
- * `.theokit/plugins/<name>/MANIFEST.json` allow-listed shape; never exposes
673
- * raw plugin bodies, credentials, or internal hooks.
674
- *
675
- * @public
676
- */
677
- interface SDKPluginMetadata {
678
- name: string;
679
- description?: string;
680
- /**
681
- * Absolute path the plugin manifest was read from.
682
- *
683
- * The runtime has ALWAYS returned this — `agent.plugins.list()` hands back the internal
684
- * `PluginMetadata`, whose own docblock says it carries provenance "so callers can audit where the
685
- * plugin came from". This type simply did not declare it, so the caller received the field and
686
- * the compiler denied it existed. Declaring it is what makes the audit usetheokit/theokit-sdk#524
687
- * asks for reachable in typed code.
688
- */
689
- source?: string;
690
- }
691
- /**
692
- * Public plugin listing handle exposed as `agent.plugins`. Populated when
693
- * `settingSources` includes `"plugins"` OR when `plugins.enabled` is set
694
- * on the agent options.
695
- *
696
- * @public
697
- */
698
- interface SDKAgentPlugins {
699
- list(): Promise<ReadonlyArray<SDKPluginMetadata>>;
700
- }
701
- /**
702
- * Artifact produced inside an agent's workspace. Cloud-only.
703
- *
704
- * @public
705
- */
706
- interface SDKArtifact {
707
- path: string;
708
- sizeBytes: number;
709
- updatedAt: string;
710
- }
711
- /**
712
- * An operation a consumer may ask an {@link SDKAgent} about via `supports()`.
713
- *
714
- * Deliberately the members whose availability DIFFERS between runtimes, plus the core ones a caller
715
- * may want to assert positively. A union rather than `string` so a typo is a compile error instead
716
- * of a silent `false`.
717
- *
718
- * @public
719
- */
720
- type AgentOperation = "send" | "generate" | "listArtifacts" | "downloadArtifact" | "runUntil" | "fork" | "runToCompletion" | "streamToCompletion" | "usePersonality" | "invalidateCache";
721
- /**
722
- * Handle returned by `Agent.create()` and `Agent.resume()`.
723
- *
724
- * @public
725
- */
726
- interface SDKAgent {
727
- readonly agentId: string;
728
- readonly model: ModelSelection | undefined;
729
- /**
730
- * Context manager for this agent. Populated when context is enabled via
731
- * {@link AgentOptions.context}. See {@link SDKContextManager}.
732
- */
733
- readonly context?: SDKContextManager;
734
- /**
735
- * Provider routing inspector for this agent. Populated when at least one
736
- * provider route is configured (via {@link AgentOptions.providers}, plugins,
737
- * or model-implied providers). See {@link SDKProvidersManager}.
738
- */
739
- readonly providers?: SDKProvidersManager;
740
- /**
741
- * Skill listing for this agent. Populated when project-scoped skills are
742
- * enabled (`settingSources: ["project"]`) or when `skills.enabled` is set.
743
- * See {@link SDKAgentSkills}.
744
- */
745
- readonly skills?: SDKAgentSkills;
746
- /**
747
- * Plugin listing for this agent. Populated when project-scoped plugins are
748
- * enabled (`settingSources: ["plugins"]`) or when `plugins.enabled` is set.
749
- * See {@link SDKAgentPlugins}.
750
- */
751
- readonly plugins?: SDKAgentPlugins;
752
- send(message: string | SDKUserMessage, options?: SendOptions): Promise<Run>;
753
- /**
754
- * SE9 — integrated structured output. Runs the normal tool loop (the tools run
755
- * first) then coerces the final answer into the `output` Zod schema, returning a
756
- * validated, inferred-typed object. Sugar over `Agent.generateObject` (ADR D33).
757
- */
758
- generate<T extends zod.ZodType>(message: string | SDKUserMessage, options: GenerateOptions<T>): Promise<GenerateRunResult<zod.z.infer<T>>>;
759
- /** Fire-and-forget disposal. */
760
- close(): void;
761
- /** Re-read filesystem config (context, hooks, project MCP, subagents) without disposing. */
762
- reload(): Promise<void>;
763
- /**
764
- * Async disposal. Idempotent — calling more than once is a no-op (per ADR D5).
765
- * Prefer `await using agent = await Agent.create(...)` over explicit
766
- * `dispose()` for resource safety.
767
- */
768
- dispose(): Promise<void>;
769
- /**
770
- * `await using` support per ADR D5. Identical semantics to `dispose()` —
771
- * idempotent across both surfaces.
772
- */
773
- [Symbol.asyncDispose](): Promise<void>;
774
- /**
775
- * Which operations this agent's runtime actually performs.
776
- *
777
- * `SDKAgent` is one handle over two runtimes that do not offer the same operations, and the type
778
- * does not model the difference: `downloadArtifact` is a REQUIRED member that rejects for every
779
- * input on a local agent, and five optional members are present-but-throwing on a cloud one, so
780
- * `typeof agent.fork === "function"` is true and calling it throws. Neither requiredness nor
781
- * optionality expresses "exists here, not there".
782
- *
783
- * Ask before calling. Mirrors `Run.supports(op)` / `Run.unsupportedReason(op)`, which solved the
784
- * same problem one layer down over the `RunOperation` union.
785
- *
786
- * This is a MITIGATION. The structural fix is to split this interface into a common core plus
787
- * `LocalCapableAgent` / `CloudCapableAgent`, so the compiler refuses the call instead of the
788
- * runtime and a consumer narrows once instead of asking per call. That is breaking on a published
789
- * surface and is deliberately not done here.
790
- *
791
- * @public
792
- */
793
- supports(operation: AgentOperation): boolean;
794
- /**
795
- * Human-readable reason `supports(operation)` returned `false`, or `undefined` when it returned
796
- * `true`. The message names the runtime, so an operator reading a log knows which half of the
797
- * union they are holding.
798
- *
799
- * @public
800
- */
801
- unsupportedReason(operation: AgentOperation): string | undefined;
802
- /** Cloud-only. Local returns an empty array. */
803
- listArtifacts(): Promise<SDKArtifact[]>;
804
- /** Cloud-only. Local throws `UnsupportedRunOperationError`. */
805
- downloadArtifact(path: string): Promise<Buffer>;
806
- /**
807
- * Signal that prompt cache should be invalidated. By default deferred —
808
- * applied at the start of the next `send()`. Pass `{ applyNow: true }` to
809
- * force immediate disposal (caller must `Agent.create()` again to use).
810
- *
811
- * Cache invalidation is a cost regression (provider charges full price
812
- * for the rebuilt cache; see ADRs D94-D95). Use sparingly and deliberately.
813
- *
814
- * Cloud agents: no-op (cloud runtime reconstructs state per request).
815
- *
816
- * @public
817
- */
818
- invalidateCache?(reason: string, options?: InvalidateCacheOptions): Promise<void>;
819
- /**
820
- * Goal-driven Ralph loop (ADRs D115-D121). Iterates `agent.send` →
821
- * judge → continuation until the auxiliary judge model returns `done`,
822
- * the judge fails too many times in a row, max turns are exhausted,
823
- * or the caller aborts via `AbortSignal`.
824
- *
825
- * Yields {@link import("./goal-events.js").GoalEvent} per state
826
- * transition; returns a {@link import("./goal-events.js").GoalResult}
827
- * summary as the generator's final value.
828
- *
829
- * Cloud agents throw {@link import("../errors.js").UnsupportedRunOperationError}
830
- * **synchronously** (no AsyncGenerator returned) — wrap in try/catch
831
- * if you support both runtimes.
832
- *
833
- * Caveat: do not call `agent.dispose()` mid-iteration; the next `send`
834
- * propagates the disposal error through the generator to the consumer.
835
- *
836
- * @public
837
- */
838
- runUntil?(goal?: string, options?: GoalOptions): RunUntilIterator;
839
- /**
840
- * Fork a short-lived sub-agent with parent's credentials + system
841
- * prompt byte-identical (ADR D112 — cache hit) and a restricted tool
842
- * whitelist (ADR D111 — AsyncLocalStorage isolation).
843
- *
844
- * Cloud agents throw {@link import("../errors.js").UnsupportedRunOperationError}.
845
- *
846
- * @public
847
- */
848
- fork?(options: ForkOptions): Promise<ForkResult>;
849
- /**
850
- * Drive `send` to completion across iteration-ceiling truncations (M1 Phase 3).
851
- * When a `send` stops at the loop's iteration cap (`RunResult.stoppedAtIterationLimit`),
852
- * this re-sends a short continuation prompt — the agent's stateful session
853
- * preserves the conversation — until a genuine terminal: `done` (finished),
854
- * `step_limit` (`maxRounds` exhausted), or `no_progress` (two empty rounds).
855
- *
856
- * Local agents only. Cloud agents throw
857
- * {@link import("../errors.js").UnsupportedRunOperationError} (the cloud
858
- * runtime manages its own continuation policy server-side).
859
- *
860
- * @public
861
- */
862
- runToCompletion?(message: string, options?: RunToCompletionOptions): Promise<RunToCompletionResult>;
863
- /**
864
- * STREAMING continuation driver (V3-4) — the streaming twin of
865
- * {@link SDKAgent.runToCompletion}. Returns an `AsyncGenerator` that yields each
866
- * round's {@link import("./messages.js").SDKMessage}s LIVE (for a UI), reusing the
867
- * same terminal policy (`done`/`step_limit`/`no_progress` + bounded re-prompt).
868
- *
869
- * The {@link import("./run.js").StreamToCompletionResult} is the generator's RETURN
870
- * value — read it via a manual `gen.next()` loop (`while (!res.done) res = await
871
- * gen.next()` → `res.value`); a plain `for await...of` consumes the yielded
872
- * messages but discards the return value.
873
- *
874
- * Local agents only. Cloud agents throw
875
- * {@link import("../errors.js").UnsupportedRunOperationError}.
876
- *
877
- * @public
878
- */
879
- streamToCompletion?(message: string, options?: RunToCompletionOptions): AsyncGenerator<SDKMessage, StreamToCompletionResult>;
880
- /**
881
- * Direct API to third-party memory adapter(s) registered via
882
- * `plugins: [...]` (ADR D141 / D142). Returns `null` when no adapter
883
- * is registered. In multi-adapter setups `write` fans out to all;
884
- * `recall` merges + dedupes; `delete` routes by `MemoryId` prefix.
885
- *
886
- * @public
887
- */
888
- memory?: AgentMemory;
889
- /**
890
- * Activate a personality preset for the next `send` (Hermes #26).
891
- * Reserved names `"none"`, `"default"`, and `"neutral"` clear the
892
- * active preset. Returns the resolved preset (or `null` when cleared).
893
- *
894
- * Persistence: pass `{ save: true }` to persist across process
895
- * restarts (stored under `$THEOKIT_HOME/personality.json`).
896
- *
897
- * History: by default the conversation history is preserved across
898
- * the switch. Pass `{ reset: true }` to also clear the session.
899
- *
900
- * Cloud agents throw {@link import("../errors.js").UnsupportedRunOperationError}.
901
- *
902
- * @public
903
- */
904
- usePersonality?(name: string, opts?: {
905
- save?: boolean;
906
- reset?: boolean;
907
- }): Promise<PersonalityPreset | null>;
908
- }
909
- /**
910
- * Resolved personality preset surfaced via {@link SDKAgent.usePersonality}
911
- * (Hermes #26, ADRs D160-D169). Re-declared here so the public DTS bundle
912
- * never crosses the `internal/` path boundary. The implementation type in
913
- * `internal/personality/types.ts` is structurally identical.
914
- *
915
- * @public
916
- */
917
- interface PersonalityPreset {
918
- readonly name: string;
919
- readonly description: string | undefined;
920
- readonly tools: ReadonlyArray<string> | undefined;
921
- readonly model: string | undefined;
922
- readonly tags: ReadonlyArray<string> | undefined;
923
- readonly systemPrompt: string;
924
- readonly source: "project" | "user";
925
- readonly sourcePath: string;
926
- }
927
- /**
928
- * Options for {@link SDKAgent.invalidateCache}.
929
- *
930
- * @public
931
- */
932
- interface InvalidateCacheOptions {
933
- /**
934
- * When `true`, dispose the agent immediately so caller must recreate it
935
- * to continue. Default `false` (deferred — applied on next `send()`).
936
- */
937
- applyNow?: boolean;
938
- }
939
-
940
- export type { AgentMemory as A, SDKContextManager as B, ContextSettings as C, SDKPluginMetadata as D, SDKProvidersManager as E, ForkOptions as F, GoalOptions as G, SystemPromptSkillRef as H, InvalidateCacheOptions as I, JudgeResult as J, MemoryId as M, ProviderRoutingSettings as P, ResolvedProviderRoute as R, SDKAgent as S, Verdict as V, PluginsSettings as a, GoalEvent as b, GoalResult as c, SDKProvider as d, AgentOperation as e, ContextBudget as f, ContextManagerKind as g, ContextSnapshot as h, ContextSource as i, ContextSourceStatus as j, ForkResult as k, MemoryAdapter as l, MemoryAdapterCapabilities as m, MemoryContext as n, MemoryFact as o, MemoryRevision as p, MemoryToolSchema as q, MemoryTurnMessage as r, PersonalityPreset as s, ProviderCapability as t, ProviderRoute as u, RunUntilIterator as v, SDKAgentPlugins as w, SDKAgentSkillDetail as x, SDKAgentSkills as y, SDKArtifact as z };