@theokit/sdk 4.38.0 → 4.39.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 (378) hide show
  1. package/CHANGELOG.md +237 -0
  2. package/dist/a2a/index.cjs +3 -3
  3. package/dist/a2a/index.js +1 -1
  4. package/dist/a2a/subagent.d.cts +1 -0
  5. package/dist/a2a/subagent.d.ts +1 -0
  6. package/dist/{agent-U3lBX-5t.d.cts → agent-D7bRK9Kg.d.cts} +70 -5
  7. package/dist/agent-I3EZZR6S.cjs +55 -0
  8. package/dist/{agent-2GZC4W2A.cjs.map → agent-I3EZZR6S.cjs.map} +1 -1
  9. package/dist/agent-KKZYLY5D.js +46 -0
  10. package/dist/{agent-3H3UKD6U.js.map → agent-KKZYLY5D.js.map} +1 -1
  11. package/dist/{agent-C3AEtM-W.d.ts → agent-ZCZa7YQv.d.ts} +70 -5
  12. package/dist/agent-session-store-N4TVKHBU.cjs +23 -0
  13. package/dist/agent-session-store-N4TVKHBU.cjs.map +1 -0
  14. package/dist/agent-session-store-RHMHP5DG.js +6 -0
  15. package/dist/agent-session-store-RHMHP5DG.js.map +1 -0
  16. package/dist/agent.d.ts +37 -1
  17. package/dist/auth/index.cjs +15 -15
  18. package/dist/auth/index.js +4 -4
  19. package/dist/{batch-LXSALQC3.js → batch-6KQM3EBA.js} +12 -12
  20. package/dist/batch-6KQM3EBA.js.map +1 -0
  21. package/dist/{batch-NZGN6SFV.cjs → batch-X6JKGDPK.cjs} +26 -26
  22. package/dist/batch-X6JKGDPK.cjs.map +1 -0
  23. package/dist/chunk-2RW7K6FN.cjs +34 -0
  24. package/dist/chunk-2RW7K6FN.cjs.map +1 -0
  25. package/dist/chunk-3I4B3OIX.js +105 -0
  26. package/dist/chunk-3I4B3OIX.js.map +1 -0
  27. package/dist/{chunk-KWXC6ERT.js → chunk-42IFCKQZ.js} +5 -5
  28. package/dist/{chunk-KWXC6ERT.js.map → chunk-42IFCKQZ.js.map} +1 -1
  29. package/dist/{chunk-4APWS2YF.js → chunk-4F7JQZOX.js} +9 -36
  30. package/dist/chunk-4F7JQZOX.js.map +1 -0
  31. package/dist/{chunk-VYD6BGKK.js → chunk-4JSZYSGW.js} +3 -3
  32. package/dist/{chunk-VYD6BGKK.js.map → chunk-4JSZYSGW.js.map} +1 -1
  33. package/dist/{chunk-A6GXYF2Q.js → chunk-65ONFZWM.js} +7 -6
  34. package/dist/chunk-65ONFZWM.js.map +1 -0
  35. package/dist/{chunk-SGTMDQ4O.js → chunk-6EEYRFJC.js} +5 -5
  36. package/dist/{chunk-SGTMDQ4O.js.map → chunk-6EEYRFJC.js.map} +1 -1
  37. package/dist/{chunk-M4OGSS66.cjs → chunk-6LGQECT7.cjs} +11 -11
  38. package/dist/{chunk-M4OGSS66.cjs.map → chunk-6LGQECT7.cjs.map} +1 -1
  39. package/dist/{chunk-KTXOHCAE.cjs → chunk-6NEHIHFU.cjs} +4 -4
  40. package/dist/{chunk-KTXOHCAE.cjs.map → chunk-6NEHIHFU.cjs.map} +1 -1
  41. package/dist/chunk-6YNYA7GD.cjs +103 -0
  42. package/dist/chunk-6YNYA7GD.cjs.map +1 -0
  43. package/dist/{chunk-2R6NBT5F.cjs → chunk-74D7KSBP.cjs} +11 -11
  44. package/dist/{chunk-2R6NBT5F.cjs.map → chunk-74D7KSBP.cjs.map} +1 -1
  45. package/dist/{chunk-6OIO4FYX.cjs → chunk-75DSEWTJ.cjs} +7 -7
  46. package/dist/{chunk-6OIO4FYX.cjs.map → chunk-75DSEWTJ.cjs.map} +1 -1
  47. package/dist/{chunk-3XRXORBS.cjs → chunk-7OLG7VI4.cjs} +4 -4
  48. package/dist/{chunk-3XRXORBS.cjs.map → chunk-7OLG7VI4.cjs.map} +1 -1
  49. package/dist/chunk-7U2HAAWB.cjs +199 -0
  50. package/dist/chunk-7U2HAAWB.cjs.map +1 -0
  51. package/dist/{chunk-QJQ2MAZF.cjs → chunk-7YBJZS5P.cjs} +8 -8
  52. package/dist/{chunk-QJQ2MAZF.cjs.map → chunk-7YBJZS5P.cjs.map} +1 -1
  53. package/dist/{chunk-ZFZYPLQI.js → chunk-AECV3G5Z.js} +4 -4
  54. package/dist/{chunk-ZFZYPLQI.js.map → chunk-AECV3G5Z.js.map} +1 -1
  55. package/dist/{chunk-QFWQLXCL.js → chunk-AR5MQZ3J.js} +3 -3
  56. package/dist/{chunk-QFWQLXCL.js.map → chunk-AR5MQZ3J.js.map} +1 -1
  57. package/dist/{chunk-G2F67XUR.cjs → chunk-B4YA6BRS.cjs} +13 -14
  58. package/dist/chunk-B4YA6BRS.cjs.map +1 -0
  59. package/dist/{chunk-BE3W4HYV.cjs → chunk-BCQ3E2ZG.cjs} +12 -3
  60. package/dist/chunk-BCQ3E2ZG.cjs.map +1 -0
  61. package/dist/{chunk-G7X2Y7Y2.cjs → chunk-BPN5ONSW.cjs} +182 -236
  62. package/dist/chunk-BPN5ONSW.cjs.map +1 -0
  63. package/dist/{chunk-XJ5TMOGA.js → chunk-BQDUEG4C.js} +3 -3
  64. package/dist/{chunk-XJ5TMOGA.js.map → chunk-BQDUEG4C.js.map} +1 -1
  65. package/dist/{chunk-OFWU6UKF.cjs → chunk-C7OP3FAK.cjs} +47 -11
  66. package/dist/chunk-C7OP3FAK.cjs.map +1 -0
  67. package/dist/{chunk-BUGVDCI5.cjs → chunk-CEIHCKTO.cjs} +4 -4
  68. package/dist/chunk-CEIHCKTO.cjs.map +1 -0
  69. package/dist/{chunk-3BSP7LSG.cjs → chunk-CN6UX5EV.cjs} +28 -56
  70. package/dist/chunk-CN6UX5EV.cjs.map +1 -0
  71. package/dist/{chunk-5BVBNE2F.js → chunk-D7IULBF2.js} +3 -3
  72. package/dist/{chunk-5BVBNE2F.js.map → chunk-D7IULBF2.js.map} +1 -1
  73. package/dist/{chunk-6ZGD7R27.cjs → chunk-DCXRHCZJ.cjs} +8 -75
  74. package/dist/chunk-DCXRHCZJ.cjs.map +1 -0
  75. package/dist/{chunk-YVI4YPUP.cjs → chunk-DGLLVCNB.cjs} +4 -4
  76. package/dist/{chunk-YVI4YPUP.cjs.map → chunk-DGLLVCNB.cjs.map} +1 -1
  77. package/dist/{chunk-JI34KBNC.js → chunk-DKFGUOWL.js} +3 -3
  78. package/dist/{chunk-JI34KBNC.js.map → chunk-DKFGUOWL.js.map} +1 -1
  79. package/dist/{chunk-ZET34IZE.cjs → chunk-DMTZ3FII.cjs} +5 -5
  80. package/dist/{chunk-ZET34IZE.cjs.map → chunk-DMTZ3FII.cjs.map} +1 -1
  81. package/dist/{chunk-6XZBKFQ7.js → chunk-DU7DE543.js} +3 -3
  82. package/dist/{chunk-6XZBKFQ7.js.map → chunk-DU7DE543.js.map} +1 -1
  83. package/dist/{chunk-VVMLMKYZ.cjs → chunk-DWY25VLP.cjs} +9 -9
  84. package/dist/{chunk-VVMLMKYZ.cjs.map → chunk-DWY25VLP.cjs.map} +1 -1
  85. package/dist/{chunk-A4XXV2C6.js → chunk-E2FFG33C.js} +5 -72
  86. package/dist/chunk-E2FFG33C.js.map +1 -0
  87. package/dist/{chunk-R4AMI7KD.cjs → chunk-E4IUN3JB.cjs} +15 -15
  88. package/dist/{chunk-R4AMI7KD.cjs.map → chunk-E4IUN3JB.cjs.map} +1 -1
  89. package/dist/{chunk-TKDWD3MU.cjs → chunk-ECHGWE47.cjs} +4 -4
  90. package/dist/{chunk-TKDWD3MU.cjs.map → chunk-ECHGWE47.cjs.map} +1 -1
  91. package/dist/{chunk-KL7E244K.cjs → chunk-ECW2MLEW.cjs} +4 -4
  92. package/dist/{chunk-KL7E244K.cjs.map → chunk-ECW2MLEW.cjs.map} +1 -1
  93. package/dist/{chunk-EDI7DBWO.js → chunk-ET6PHZRX.js} +3 -3
  94. package/dist/{chunk-EDI7DBWO.js.map → chunk-ET6PHZRX.js.map} +1 -1
  95. package/dist/{chunk-HLK35TD7.cjs → chunk-FRUBE44B.cjs} +24 -24
  96. package/dist/{chunk-HLK35TD7.cjs.map → chunk-FRUBE44B.cjs.map} +1 -1
  97. package/dist/{chunk-SRIF7HMN.cjs → chunk-FWBSDQZ7.cjs} +5 -5
  98. package/dist/{chunk-SRIF7HMN.cjs.map → chunk-FWBSDQZ7.cjs.map} +1 -1
  99. package/dist/{chunk-XKBJT7WI.cjs → chunk-G2Q3ZC6C.cjs} +4 -4
  100. package/dist/{chunk-XKBJT7WI.cjs.map → chunk-G2Q3ZC6C.cjs.map} +1 -1
  101. package/dist/{chunk-4MWBKBS4.cjs → chunk-G4XUXSRN.cjs} +12 -12
  102. package/dist/{chunk-4MWBKBS4.cjs.map → chunk-G4XUXSRN.cjs.map} +1 -1
  103. package/dist/{chunk-VUDH4D2M.js → chunk-GIRD3RWH.js} +282 -276
  104. package/dist/chunk-GIRD3RWH.js.map +1 -0
  105. package/dist/{chunk-BT6DFWZB.cjs → chunk-HIQFVHC6.cjs} +9 -9
  106. package/dist/{chunk-BT6DFWZB.cjs.map → chunk-HIQFVHC6.cjs.map} +1 -1
  107. package/dist/{chunk-UWEALKAN.js → chunk-HWNVAUK4.js} +3 -3
  108. package/dist/{chunk-UWEALKAN.js.map → chunk-HWNVAUK4.js.map} +1 -1
  109. package/dist/{chunk-3VKTDQMX.cjs → chunk-I53ZQHU6.cjs} +4 -4
  110. package/dist/{chunk-3VKTDQMX.cjs.map → chunk-I53ZQHU6.cjs.map} +1 -1
  111. package/dist/{chunk-A3MHE2MQ.cjs → chunk-IHFNRNTJ.cjs} +8 -8
  112. package/dist/{chunk-A3MHE2MQ.cjs.map → chunk-IHFNRNTJ.cjs.map} +1 -1
  113. package/dist/{chunk-UZBA6YYP.cjs → chunk-INSFS5GT.cjs} +540 -534
  114. package/dist/chunk-INSFS5GT.cjs.map +1 -0
  115. package/dist/{chunk-KCZW75PI.js → chunk-IVSD7L22.js} +12 -4
  116. package/dist/chunk-IVSD7L22.js.map +1 -0
  117. package/dist/{chunk-JCXIDFRI.js → chunk-J3UK2GMN.js} +3 -3
  118. package/dist/{chunk-JCXIDFRI.js.map → chunk-J3UK2GMN.js.map} +1 -1
  119. package/dist/{chunk-IBDE4R5L.cjs → chunk-J6T5LWJ4.cjs} +10 -9
  120. package/dist/chunk-J6T5LWJ4.cjs.map +1 -0
  121. package/dist/{chunk-AOZYORH7.js → chunk-JRLXEYR4.js} +21 -5
  122. package/dist/chunk-JRLXEYR4.js.map +1 -0
  123. package/dist/{chunk-EUB7YLU2.js → chunk-JZUPMTJY.js} +3 -3
  124. package/dist/{chunk-EUB7YLU2.js.map → chunk-JZUPMTJY.js.map} +1 -1
  125. package/dist/{chunk-ZK3BJ4XQ.js → chunk-KE6XKRLQ.js} +3 -3
  126. package/dist/{chunk-ZK3BJ4XQ.js.map → chunk-KE6XKRLQ.js.map} +1 -1
  127. package/dist/{chunk-4NVV3GRU.js → chunk-KGRIHEDT.js} +5 -5
  128. package/dist/{chunk-4NVV3GRU.js.map → chunk-KGRIHEDT.js.map} +1 -1
  129. package/dist/{chunk-EE24WJJR.js → chunk-KWUNN5J2.js} +5 -5
  130. package/dist/{chunk-EE24WJJR.js.map → chunk-KWUNN5J2.js.map} +1 -1
  131. package/dist/{chunk-LGCEYEU2.js → chunk-KX7JV5KM.js} +3 -3
  132. package/dist/{chunk-LGCEYEU2.js.map → chunk-KX7JV5KM.js.map} +1 -1
  133. package/dist/{chunk-2K7PRHDB.cjs → chunk-LALG2K33.cjs} +8 -8
  134. package/dist/{chunk-2K7PRHDB.cjs.map → chunk-LALG2K33.cjs.map} +1 -1
  135. package/dist/{chunk-4WIJSKFA.js → chunk-LGILIGV3.js} +3 -3
  136. package/dist/{chunk-4WIJSKFA.js.map → chunk-LGILIGV3.js.map} +1 -1
  137. package/dist/{chunk-7QDTZJRV.js → chunk-LJX2SQV2.js} +6 -6
  138. package/dist/{chunk-7QDTZJRV.js.map → chunk-LJX2SQV2.js.map} +1 -1
  139. package/dist/{chunk-ACHGT3D2.js → chunk-MC5EINBV.js} +44 -8
  140. package/dist/chunk-MC5EINBV.js.map +1 -0
  141. package/dist/{chunk-M6UUTNDT.js → chunk-ML5A5DOJ.js} +4 -4
  142. package/dist/{chunk-M6UUTNDT.js.map → chunk-ML5A5DOJ.js.map} +1 -1
  143. package/dist/{chunk-3MUIYMUG.cjs → chunk-N475ETD6.cjs} +17 -17
  144. package/dist/{chunk-3MUIYMUG.cjs.map → chunk-N475ETD6.cjs.map} +1 -1
  145. package/dist/chunk-OXNYIMZZ.js +31 -0
  146. package/dist/chunk-OXNYIMZZ.js.map +1 -0
  147. package/dist/{chunk-YCHC45BY.js → chunk-PI4RO4GR.js} +3 -3
  148. package/dist/{chunk-YCHC45BY.js.map → chunk-PI4RO4GR.js.map} +1 -1
  149. package/dist/chunk-QKE556YD.js +197 -0
  150. package/dist/chunk-QKE556YD.js.map +1 -0
  151. package/dist/{chunk-FV3YEMQ7.js → chunk-RP5HQVLD.js} +13 -14
  152. package/dist/chunk-RP5HQVLD.js.map +1 -0
  153. package/dist/chunk-SCFW5MJZ.js +100 -0
  154. package/dist/chunk-SCFW5MJZ.js.map +1 -0
  155. package/dist/{chunk-ZYOHF37V.js → chunk-SG5ZWT6C.js} +3 -3
  156. package/dist/{chunk-ZYOHF37V.js.map → chunk-SG5ZWT6C.js.map} +1 -1
  157. package/dist/{chunk-ED7ANP6W.cjs → chunk-TIMPJL5V.cjs} +4 -4
  158. package/dist/{chunk-ED7ANP6W.cjs.map → chunk-TIMPJL5V.cjs.map} +1 -1
  159. package/dist/{chunk-3XKVRLR2.js → chunk-TOTP24P6.js} +4 -4
  160. package/dist/{chunk-3XKVRLR2.js.map → chunk-TOTP24P6.js.map} +1 -1
  161. package/dist/{chunk-PG3QQLWS.cjs → chunk-USZTVNUQ.cjs} +5 -5
  162. package/dist/{chunk-PG3QQLWS.cjs.map → chunk-USZTVNUQ.cjs.map} +1 -1
  163. package/dist/{chunk-XS7SKY2F.js → chunk-V2RBCCN5.js} +3 -3
  164. package/dist/chunk-V2RBCCN5.js.map +1 -0
  165. package/dist/{chunk-D3SJLXYZ.cjs → chunk-VJYSQXN6.cjs} +10 -10
  166. package/dist/{chunk-D3SJLXYZ.cjs.map → chunk-VJYSQXN6.cjs.map} +1 -1
  167. package/dist/{chunk-MXRBNJ6D.cjs → chunk-W4WKVOOQ.cjs} +11 -11
  168. package/dist/{chunk-MXRBNJ6D.cjs.map → chunk-W4WKVOOQ.cjs.map} +1 -1
  169. package/dist/chunk-XYOHKCYG.cjs +109 -0
  170. package/dist/chunk-XYOHKCYG.cjs.map +1 -0
  171. package/dist/{chunk-UD2T7ISG.js → chunk-YP67XZES.js} +4 -4
  172. package/dist/{chunk-UD2T7ISG.js.map → chunk-YP67XZES.js.map} +1 -1
  173. package/dist/{chunk-HHUDNTZC.js → chunk-YRXY2A5L.js} +4 -4
  174. package/dist/{chunk-HHUDNTZC.js.map → chunk-YRXY2A5L.js.map} +1 -1
  175. package/dist/{chunk-6OKPJZMX.cjs → chunk-Z2CUEBXV.cjs} +25 -9
  176. package/dist/chunk-Z2CUEBXV.cjs.map +1 -0
  177. package/dist/{chunk-HI6G3SNY.js → chunk-ZYB6B7QJ.js} +72 -125
  178. package/dist/chunk-ZYB6B7QJ.js.map +1 -0
  179. package/dist/compact-session-PYEC3NZV.js +18 -0
  180. package/dist/{compact-session-RR3ILTES.js.map → compact-session-PYEC3NZV.js.map} +1 -1
  181. package/dist/compact-session-VVT6IBJG.cjs +55 -0
  182. package/dist/{compact-session-YOWJJPPB.cjs.map → compact-session-VVT6IBJG.cjs.map} +1 -1
  183. package/dist/compaction.cjs +16 -16
  184. package/dist/compaction.js +3 -3
  185. package/dist/concurrency.cjs +6 -6
  186. package/dist/concurrency.js +4 -4
  187. package/dist/context-2FZSC6VQ.cjs +22 -0
  188. package/dist/{context-Q6ISOCN2.cjs.map → context-2FZSC6VQ.cjs.map} +1 -1
  189. package/dist/context-ATJJAFOS.js +5 -0
  190. package/dist/{context-ZDBBPIHY.js.map → context-ATJJAFOS.js.map} +1 -1
  191. package/dist/{cron-ChQ6zcW2.d.ts → cron-Bx7tzm5R.d.ts} +54 -2
  192. package/dist/{cron-BdXOZco9.d.cts → cron-D-DVjGQe.d.cts} +54 -2
  193. package/dist/cron.cjs +33 -29
  194. package/dist/cron.d.cts +3 -3
  195. package/dist/cron.d.ts +3 -3
  196. package/dist/cron.js +32 -28
  197. package/dist/{errors-BUVjJGJA.d.cts → errors-DMY-gLSK.d.cts} +1 -1
  198. package/dist/{errors-CZIUKLHt.d.ts → errors-DjBQ4Tn8.d.ts} +1 -1
  199. package/dist/errors.cjs +21 -21
  200. package/dist/errors.d.cts +2 -2
  201. package/dist/errors.d.ts +2 -2
  202. package/dist/errors.js +2 -2
  203. package/dist/eval.cjs +41 -36
  204. package/dist/eval.cjs.map +1 -1
  205. package/dist/eval.js +37 -32
  206. package/dist/eval.js.map +1 -1
  207. package/dist/{executor-DPCBSI35.cjs → executor-BMRICN46.cjs} +26 -25
  208. package/dist/executor-BMRICN46.cjs.map +1 -0
  209. package/dist/{executor-ASDDIM2X.js → executor-T65PPOPT.js} +10 -9
  210. package/dist/executor-T65PPOPT.js.map +1 -0
  211. package/dist/filesystem/index.cjs +7 -7
  212. package/dist/filesystem/index.js +3 -3
  213. package/dist/fs-session-store-J5MCFFUM.cjs +19 -0
  214. package/dist/{fs-session-store-T5ZLQX42.cjs.map → fs-session-store-J5MCFFUM.cjs.map} +1 -1
  215. package/dist/fs-session-store-O6FNHECD.js +10 -0
  216. package/dist/{fs-session-store-K5QUPNJZ.js.map → fs-session-store-O6FNHECD.js.map} +1 -1
  217. package/dist/generate-object-UF6WIZLF.cjs +20 -0
  218. package/dist/{generate-object-F56VIZ6U.cjs.map → generate-object-UF6WIZLF.cjs.map} +1 -1
  219. package/dist/generate-object-XDCBYVK3.js +7 -0
  220. package/dist/{generate-object-LPSO6GVW.js.map → generate-object-XDCBYVK3.js.map} +1 -1
  221. package/dist/index-manager-N7RQYUKT.cjs +20 -0
  222. package/dist/{index-manager-DBJ55ZSO.cjs.map → index-manager-N7RQYUKT.cjs.map} +1 -1
  223. package/dist/index-manager-ZVZUHPP7.js +11 -0
  224. package/dist/{index-manager-F2H2RCZU.js.map → index-manager-ZVZUHPP7.js.map} +1 -1
  225. package/dist/index.cjs +138 -132
  226. package/dist/index.cjs.map +1 -1
  227. package/dist/index.d.cts +167 -9
  228. package/dist/index.d.ts +167 -9
  229. package/dist/index.js +47 -44
  230. package/dist/index.js.map +1 -1
  231. package/dist/{inject-session-RKNLUE72.js → inject-session-GQMTDZUN.js} +7 -6
  232. package/dist/inject-session-GQMTDZUN.js.map +1 -0
  233. package/dist/{inject-session-25EC74WV.cjs → inject-session-LFCYVSLJ.cjs} +9 -8
  234. package/dist/inject-session-LFCYVSLJ.cjs.map +1 -0
  235. package/dist/internal/agent-loop/loop-thinking-steps.d.ts +28 -0
  236. package/dist/internal/agent-loop/message-builders.d.ts +12 -3
  237. package/dist/internal/diagnostics.d.ts +24 -11
  238. package/dist/internal/llm/anthropic-shared.d.ts +4 -4
  239. package/dist/internal/llm/types.d.ts +49 -9
  240. package/dist/internal/local-agent/mcp-pool.d.ts +7 -3
  241. package/dist/internal/memory/adapters/azure-openai-embedding.d.cts +2 -0
  242. package/dist/internal/memory/adapters/catalog.d.cts +1 -0
  243. package/dist/internal/memory/adapters/cohere-embedding.d.cts +2 -0
  244. package/dist/internal/memory/adapters/deepinfra-embedding.d.cts +2 -0
  245. package/dist/internal/memory/adapters/gemini-embedding.d.cts +2 -0
  246. package/dist/internal/memory/adapters/index.cjs +28 -0
  247. package/dist/internal/memory/adapters/index.cjs.map +1 -0
  248. package/dist/internal/memory/adapters/index.d.cts +16 -0
  249. package/dist/internal/memory/adapters/index.d.ts +16 -0
  250. package/dist/internal/memory/adapters/index.js +11 -0
  251. package/dist/internal/memory/adapters/index.js.map +1 -0
  252. package/dist/internal/memory/adapters/jina-embedding.d.cts +2 -0
  253. package/dist/internal/memory/adapters/mistral-embedding.d.cts +2 -0
  254. package/dist/internal/memory/adapters/ollama-embedding.d.cts +34 -0
  255. package/dist/internal/memory/adapters/openai-compatible.d.cts +51 -0
  256. package/dist/internal/memory/adapters/openai-compatible.d.ts +28 -0
  257. package/dist/internal/memory/adapters/openai-embedding.d.cts +2 -0
  258. package/dist/internal/memory/adapters/openrouter-embedding.d.cts +2 -0
  259. package/dist/internal/memory/adapters/voyage-embedding.d.cts +2 -0
  260. package/dist/internal/memory/dreaming/diary.d.ts +4 -0
  261. package/dist/internal/memory/dreaming/phases.d.ts +15 -0
  262. package/dist/internal/memory/dreaming/run.d.ts +10 -0
  263. package/dist/internal/memory/migrate-sqlite-to-lance.d.ts +15 -0
  264. package/dist/internal/memory/sdk-memory-peer-loader.d.ts +21 -0
  265. package/dist/internal/persistence/index.cjs +25 -25
  266. package/dist/internal/persistence/index.js +6 -6
  267. package/dist/internal/persistence/session-transcript.d.cts +6 -0
  268. package/dist/internal/persistence/session-transcript.d.ts +6 -0
  269. package/dist/internal/runtime/concurrency/subagent-credentials.d.ts +35 -0
  270. package/dist/internal/security/index.cjs +13 -13
  271. package/dist/internal/security/index.js +3 -3
  272. package/dist/internal/session/agent-session-store.d.ts +1 -0
  273. package/dist/internal/session/session-types.d.ts +6 -1
  274. package/dist/judge-call-NA2G6ZMJ.js +5 -0
  275. package/dist/{judge-call-3S3T6O2Z.js.map → judge-call-NA2G6ZMJ.js.map} +1 -1
  276. package/dist/judge-call-U2D33JOW.cjs +22 -0
  277. package/dist/{judge-call-XIQJ5GIE.cjs.map → judge-call-U2D33JOW.cjs.map} +1 -1
  278. package/dist/models.cjs +20 -20
  279. package/dist/models.js +5 -5
  280. package/dist/path-safety.cjs +10 -10
  281. package/dist/path-safety.js +3 -3
  282. package/dist/persistence.cjs +35 -35
  283. package/dist/persistence.js +7 -7
  284. package/dist/project.cjs +5 -5
  285. package/dist/project.js +3 -3
  286. package/dist/registry-CAS6Y5ZY.js +9 -0
  287. package/dist/{registry-KMI5RA22.js.map → registry-CAS6Y5ZY.js.map} +1 -1
  288. package/dist/registry-JSDI4WKA.cjs +46 -0
  289. package/dist/{registry-BA3SLAN7.cjs.map → registry-JSDI4WKA.cjs.map} +1 -1
  290. package/dist/retry.cjs +4 -4
  291. package/dist/retry.js +3 -3
  292. package/dist/{run-vJHg2eGw.d.cts → run-i2-fUohR.d.cts} +16 -0
  293. package/dist/{run-vJHg2eGw.d.ts → run-i2-fUohR.d.ts} +16 -0
  294. package/dist/sandbox/index.cjs +6 -6
  295. package/dist/sandbox/index.js +2 -2
  296. package/dist/server/errors-envelope.cjs +14 -14
  297. package/dist/server/errors-envelope.d.cts +3 -3
  298. package/dist/server/errors-envelope.d.ts +3 -3
  299. package/dist/server/errors-envelope.js +3 -3
  300. package/dist/session-transcript-3B52DKTG.js +5 -0
  301. package/dist/{session-transcript-MMPWCESR.js.map → session-transcript-3B52DKTG.js.map} +1 -1
  302. package/dist/session-transcript-H7NUFXXM.cjs +50 -0
  303. package/dist/{session-transcript-DFGX6WNL.cjs.map → session-transcript-H7NUFXXM.cjs.map} +1 -1
  304. package/dist/skills.cjs +7 -7
  305. package/dist/skills.js +5 -5
  306. package/dist/stream-object-4FDU76YW.cjs +20 -0
  307. package/dist/{stream-object-YPXZ4F5P.cjs.map → stream-object-4FDU76YW.cjs.map} +1 -1
  308. package/dist/stream-object-HWDEEQN4.js +7 -0
  309. package/dist/{stream-object-AFERZU63.js.map → stream-object-HWDEEQN4.js.map} +1 -1
  310. package/dist/subagents-loader-A4W6C3QP.cjs +15 -0
  311. package/dist/subagents-loader-A4W6C3QP.cjs.map +1 -0
  312. package/dist/subagents-loader-X33KH2SZ.js +6 -0
  313. package/dist/subagents-loader-X33KH2SZ.js.map +1 -0
  314. package/dist/subagents-loader.cjs +6 -6
  315. package/dist/subagents-loader.d.cts +2 -2
  316. package/dist/subagents-loader.d.ts +2 -2
  317. package/dist/subagents-loader.js +4 -4
  318. package/dist/subscription/index.cjs +3 -3
  319. package/dist/subscription/index.js +2 -2
  320. package/dist/task-store.cjs +7 -7
  321. package/dist/task-store.js +4 -4
  322. package/dist/types/agent.d.ts +68 -3
  323. package/dist/types/conversation.d.ts +7 -0
  324. package/dist/types/messages.d.ts +9 -0
  325. package/dist/types/session-message.d.ts +59 -0
  326. package/dist/types/workflow.d.ts +36 -0
  327. package/dist/workflow.cjs +27 -27
  328. package/dist/workflow.d.cts +17 -1
  329. package/dist/workflow.d.ts +17 -1
  330. package/dist/workflow.js +6 -6
  331. package/docs/harness-capability-map.md +22 -0
  332. package/package.json +11 -1
  333. package/dist/agent-2GZC4W2A.cjs +0 -51
  334. package/dist/agent-3H3UKD6U.js +0 -42
  335. package/dist/batch-LXSALQC3.js.map +0 -1
  336. package/dist/batch-NZGN6SFV.cjs.map +0 -1
  337. package/dist/chunk-3BSP7LSG.cjs.map +0 -1
  338. package/dist/chunk-4APWS2YF.js.map +0 -1
  339. package/dist/chunk-6OKPJZMX.cjs.map +0 -1
  340. package/dist/chunk-6ZGD7R27.cjs.map +0 -1
  341. package/dist/chunk-A4XXV2C6.js.map +0 -1
  342. package/dist/chunk-A6GXYF2Q.js.map +0 -1
  343. package/dist/chunk-ACHGT3D2.js.map +0 -1
  344. package/dist/chunk-AOZYORH7.js.map +0 -1
  345. package/dist/chunk-BE3W4HYV.cjs.map +0 -1
  346. package/dist/chunk-BUGVDCI5.cjs.map +0 -1
  347. package/dist/chunk-FV3YEMQ7.js.map +0 -1
  348. package/dist/chunk-G2F67XUR.cjs.map +0 -1
  349. package/dist/chunk-G7X2Y7Y2.cjs.map +0 -1
  350. package/dist/chunk-HI6G3SNY.js.map +0 -1
  351. package/dist/chunk-IBDE4R5L.cjs.map +0 -1
  352. package/dist/chunk-KCZW75PI.js.map +0 -1
  353. package/dist/chunk-OFWU6UKF.cjs.map +0 -1
  354. package/dist/chunk-UZBA6YYP.cjs.map +0 -1
  355. package/dist/chunk-VUDH4D2M.js.map +0 -1
  356. package/dist/chunk-XS7SKY2F.js.map +0 -1
  357. package/dist/compact-session-RR3ILTES.js +0 -17
  358. package/dist/compact-session-YOWJJPPB.cjs +0 -54
  359. package/dist/context-Q6ISOCN2.cjs +0 -22
  360. package/dist/context-ZDBBPIHY.js +0 -5
  361. package/dist/executor-ASDDIM2X.js.map +0 -1
  362. package/dist/executor-DPCBSI35.cjs.map +0 -1
  363. package/dist/fs-session-store-K5QUPNJZ.js +0 -10
  364. package/dist/fs-session-store-T5ZLQX42.cjs +0 -19
  365. package/dist/generate-object-F56VIZ6U.cjs +0 -20
  366. package/dist/generate-object-LPSO6GVW.js +0 -7
  367. package/dist/index-manager-DBJ55ZSO.cjs +0 -19
  368. package/dist/index-manager-F2H2RCZU.js +0 -10
  369. package/dist/inject-session-25EC74WV.cjs.map +0 -1
  370. package/dist/inject-session-RKNLUE72.js.map +0 -1
  371. package/dist/judge-call-3S3T6O2Z.js +0 -5
  372. package/dist/judge-call-XIQJ5GIE.cjs +0 -22
  373. package/dist/registry-BA3SLAN7.cjs +0 -46
  374. package/dist/registry-KMI5RA22.js +0 -9
  375. package/dist/session-transcript-DFGX6WNL.cjs +0 -50
  376. package/dist/session-transcript-MMPWCESR.js +0 -5
  377. package/dist/stream-object-AFERZU63.js +0 -7
  378. package/dist/stream-object-YPXZ4F5P.cjs +0 -20
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
- import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-BUVjJGJA.cjs';
2
- export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-BUVjJGJA.cjs';
3
- import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as SDKProvider } from './agent-U3lBX-5t.cjs';
4
- export { u as ActiveMemoryPassArgs, v as ActiveMemoryPassResult, w as AgentMemory, x as BudgetCheck, y as BudgetTotal, z as BudgetUsageEvent, D as CloudEnv, E as CloudRepo, F as ContextBudget, H as ContextManagerKind, K as ContextSnapshot, N as ContextSource, O as ContextSourceStatus, Q as CreateSkillSpec, R as HookName, T as InvalidateCacheOptions, U as MemoryAdapter, V as MemoryAdapterCapabilities, W as MemoryContext, X as MemoryFact, Y as MemoryProviderHandle, Z as MemoryProviderInitOptions, _ as MemoryRevision, $ as MemoryToolSchema, a0 as MemoryTurnMessage, a1 as PersonalityPreset, a2 as PluginContext, a3 as PostAssistantReplyContext, a4 as PostToolCallContext, a5 as PreToolCallContext, a6 as PreUserSendContext, a7 as PreUserSendResult, a8 as ProviderCapability, a9 as ProviderRoute, aa as ProviderTransform, ab as ProviderTransformContext, ac as RecordSessionSummaryArgs, ad as ResolvedProviderRoute, ae as RunUntilIterator, af as SDKAgentPlugins, ag as SDKAgentSkillDetail, ah as SDKAgentSkills, ai as SDKArtifact, aj as SDKContextManager, ak as SDKPluginMetadata, al as SDKProvidersManager, am as SessionLifecycleContext, an as SessionRecord, ao as SessionStore, ap as SettingSource, aq as Skill, ar as SkillsResolver, as as SkillsResolverContext, at as SystemPromptContext, au as SystemPromptMemoryFact, av as SystemPromptSkillRef, aw as TelemetrySettings, ax as ToolCallSummary, ay as ToolResultTransformContext, az as TransformContext, aA as Verdict } from './agent-U3lBX-5t.cjs';
5
- import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-vJHg2eGw.cjs';
6
- export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-vJHg2eGw.cjs';
1
+ import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DMY-gLSK.cjs';
2
+ export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DMY-gLSK.cjs';
3
+ import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as AgentDescription, m as Plugin$1, n as ProviderProfile, I as InlineSkill, J as JudgeResult, o as GoalOptions, p as GoalEvent, q as GoalResult, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as SDKProvider } from './agent-D7bRK9Kg.cjs';
4
+ export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as AgentSubagentDescription, z as AgentToolDescription, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, K as CloudRepo, N as ContextBudget, O as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as HookName, W as InvalidateCacheOptions, X as MemoryAdapter, Y as MemoryAdapterCapabilities, Z as MemoryContext, _ as MemoryFact, $ as MemoryProviderHandle, a0 as MemoryProviderInitOptions, a1 as MemoryRevision, a2 as MemoryToolSchema, a3 as MemoryTurnMessage, a4 as PersonalityPreset, a5 as PluginContext, a6 as PostAssistantReplyContext, a7 as PostToolCallContext, a8 as PreToolCallContext, a9 as PreUserSendContext, aa as PreUserSendResult, ab as ProviderCapability, ac as ProviderRoute, ad as ProviderTransform, ae as ProviderTransformContext, af as RecordSessionSummaryArgs, ag as ResolvedProviderRoute, ah as RunUntilIterator, ai as SDKAgentPlugins, aj as SDKAgentSkillDetail, ak as SDKAgentSkills, al as SDKArtifact, am as SDKContextManager, an as SDKPluginMetadata, ao as SDKProvidersManager, ap as SessionLifecycleContext, aq as SessionRecord, ar as SessionStore, as as SettingSource, at as Skill, au as SkillsResolver, av as SkillsResolverContext, aw as SystemPromptContext, ax as SystemPromptMemoryFact, ay as SystemPromptSkillRef, az as TelemetrySettings, aA as ToolCallSummary, aB as ToolResultTransformContext, aC as TransformContext, aD as Verdict } from './agent-D7bRK9Kg.cjs';
5
+ import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-i2-fUohR.cjs';
6
+ export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-i2-fUohR.cjs';
7
7
  import * as zod from 'zod';
8
8
  import { ZodType, z } from 'zod';
9
- import { S as StepResult } from './cron-BdXOZco9.cjs';
10
- export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-BdXOZco9.cjs';
9
+ import { S as StepResult } from './cron-D-DVjGQe.cjs';
10
+ export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-D-DVjGQe.cjs';
11
11
 
12
12
  /**
13
13
  * Public compaction / context-management helpers (M2-1, extended V3-3).
@@ -468,6 +468,66 @@ declare class LiveAgentRegistry {
468
468
  ids(): readonly string[];
469
469
  }
470
470
 
471
+ /**
472
+ * The shape of a persisted session turn, as a HOST reads it.
473
+ *
474
+ * Lives in `types/` because it is public contract — `Agent.transcript()` returns it (theokit#146).
475
+ * `internal/session/session-types.ts` re-exports it so the runtime and the store keep importing
476
+ * from the leaf they always did.
477
+ *
478
+ * @public
479
+ */
480
+
481
+ /**
482
+ * One turn of a session.
483
+ *
484
+ * Two projections of the same turn, and they answer different questions:
485
+ *
486
+ * - `text` is the flat rendering the model replay uses. A tool call folds to `[tool call] NAME` and
487
+ * a result to `[tool result] <body>`.
488
+ * - `parts` is the same turn unflattened, for a host that draws tool CARDS: the call id, the tool
489
+ * name, the arguments, and the `toolUseId` that ties a result back to its call — none of which
490
+ * survive the flat form.
491
+ *
492
+ * `parts` was added in theokit#146 and is additive: `text` is byte-identical to what it always was,
493
+ * so every existing reader is untouched.
494
+ *
495
+ * @public
496
+ */
497
+ interface SessionMessage {
498
+ role: "user" | "assistant";
499
+ text: string;
500
+ /**
501
+ * The structured view. Optional because a `SessionMessage` can also be built in memory during a
502
+ * live turn, where only the text projection exists. Absent means "this projection carries no
503
+ * structure", never "this turn had none".
504
+ */
505
+ parts?: readonly SessionMessagePart[];
506
+ }
507
+ /**
508
+ * One structured element of a {@link SessionMessage}.
509
+ *
510
+ * Deliberately a session-DISPLAY shape rather than a re-export of the internal LLM part union: the
511
+ * two answer different questions (what to send a provider vs. what to draw), and coupling them
512
+ * would make every provider-wire change a change to what hosts render.
513
+ *
514
+ * @public
515
+ */
516
+ type SessionMessagePart = {
517
+ readonly type: "text";
518
+ readonly text: string;
519
+ } | {
520
+ readonly type: "tool_use";
521
+ readonly id: string;
522
+ readonly name: string;
523
+ readonly input: Record<string, unknown>;
524
+ } | {
525
+ readonly type: "tool_result";
526
+ readonly toolUseId: string;
527
+ readonly content: string | ReadonlyArray<ToolResultContentBlock>;
528
+ readonly isError?: boolean;
529
+ };
530
+
471
531
  /**
472
532
  * Result of a one-shot {@link Agent.prompt} call.
473
533
  *
@@ -679,6 +739,41 @@ declare class Agent {
679
739
  userText: string;
680
740
  assistantText: string;
681
741
  }): Promise<void>;
742
+ /**
743
+ * theokit#146 — read a LOCAL agent's persisted transcript as STRUCTURE, for rendering.
744
+ *
745
+ * A resumed session already replays correctly to the model, but a host had no way to draw it:
746
+ * the only projection available folded a tool call to the string `[tool call] NAME`, dropping the
747
+ * call id and every argument. A card UI got prose, so cross-restart resume was worth less than
748
+ * starting fresh — which is what at least one consumer did.
749
+ *
750
+ * Each returned message carries both projections: `text` (unchanged, what the model replay uses)
751
+ * and `parts` (`text` / `tool_use` / `tool_result` with ids, names, arguments and the
752
+ * `toolUseId` that correlates a result back to its call).
753
+ *
754
+ * Read-only and local-only: it opens the agent's session store and walks the transcript, exactly
755
+ * as {@link Agent.compact} and {@link Agent.injectSessionTurn} do. It appends nothing.
756
+ *
757
+ * @throws UnknownAgentError when `agentId` names no local agent.
758
+ * @public
759
+ */
760
+ static transcript(agentId: string): Promise<readonly SessionMessage[]>;
761
+ /**
762
+ * theokit#123 — read-only introspection of a registered agent's tools and subagents.
763
+ *
764
+ * `Agent.list()` / `Agent.get()` enumerate agents and `agent.skills.list()` covers skills, but
765
+ * tools and subagents lived only on `RegisteredAgent.options` — an internal contract. A
766
+ * reflection endpoint (theokit-studio's `theokit dev`) therefore had to report empty lists for
767
+ * both, and say so with an `unavailable_reason`.
768
+ *
769
+ * A PROJECTION, not the options object. Tool handlers and subagent prompts are stripped: a
770
+ * handler is an executable that cannot cross a process boundary, and a prompt is the agent's
771
+ * instructions rather than its signature — a reflection endpoint serializes what it is handed.
772
+ *
773
+ * @throws UnknownAgentError when `agentId` names no registered agent.
774
+ * @public
775
+ */
776
+ static describe(agentId: string): Promise<AgentDescription>;
682
777
  /**
683
778
  * Permanently delete a cloud agent.
684
779
  *
@@ -1339,6 +1434,69 @@ declare function createCounterBudgetTracker(options?: CounterBudgetTrackerOption
1339
1434
  nextIteration(): void;
1340
1435
  };
1341
1436
 
1437
+ /**
1438
+ * The library's single diagnostics channel — silent by default (#147).
1439
+ *
1440
+ * ## O problema
1441
+ *
1442
+ * The SDK wrote diagnostics straight to `process.stderr` from hot paths — 92 sites across 51
1443
+ * files under `internal/`. In a TUI host (Ink, alternate screen), those writes interleave with the
1444
+ * render and **corrupt the frame**. And the host had no way to intercept them: there was no
1445
+ * injectable logger. One consumer went as far as installing `proper-lockfile` just to silence ONE
1446
+ * of them.
1447
+ *
1448
+ * A library cannot assume `stdout`/`stderr` are free sinks. The application owns the terminal, not
1449
+ * the dependency.
1450
+ *
1451
+ * ## O contrato
1452
+ *
1453
+ * - **`setDiagnosticsSink(fn)`** hands the messages to the application, which decides where to put
1454
+ * them (a status line, a file, a panel). It is what was missing for a TUI to coexist with the SDK.
1455
+ * - **With no sink, nothing is emitted.** A library does not own the host's terminal.
1456
+ *
1457
+ * ## Silent by default, and how 36 suites survived the flip
1458
+ *
1459
+ * The default WAS `stderr`, and 36 test files spy on `process.stderr.write` to assert a given
1460
+ * warning is emitted. That contract is real and had to survive; migrating all 36 by hand, across
1461
+ * four different spy styles, is how you weaken 36 suites in one commit.
1462
+ *
1463
+ * So the flip happened at the default, and `vitest.setup.ts` installs a sink that FORWARDS to
1464
+ * `stderr` for the duration of every test. Those assertions still test what they always tested —
1465
+ * "this condition emits a diagnostic" — through the channel a host would use, while production
1466
+ * emits nothing unless asked.
1467
+ *
1468
+ * The cost is stated rather than hidden: no test observes the production default by accident, so
1469
+ * `tests/diagnostics-public-entry.test.ts` pins it explicitly by clearing the sink first.
1470
+ *
1471
+ * ## Coverage is the whole guarantee
1472
+ *
1473
+ * The first sweep migrated the 92 sites under `internal/` and left `src/`'s own modules —
1474
+ * `event-bus.ts`, `batch.ts`, `compaction.ts`, `internal/workflow/step-branch.ts`. A host could
1475
+ * therefore install a sink and still have its frame corrupted by a batch run, which is the reported
1476
+ * defect with a smaller blast radius. Those are routed here too, and
1477
+ * `tests/lint/no-direct-terminal-write.test.ts` is what keeps the next hot path from
1478
+ * reintroducing one. "Mostly interceptable" is not interceptable.
1479
+ *
1480
+ * The remaining direct writers are allowlisted there with a reason, and every one of them is a seam
1481
+ * whose destination the CALLER already chooses (`opts.warn`, `opts.logger`, the Workflow logger).
1482
+ *
1483
+ * ## What this is NOT
1484
+ *
1485
+ * It is not a logger with levels, formatting or multiple destinations. It is the minimum that
1486
+ * resolves the reported blocker; a full logger here would be inventing a requirement nobody asked
1487
+ * for.
1488
+ */
1489
+ /** Receives each diagnostic message already formatted, with the trailing `\n`. */
1490
+ type DiagnosticsSink = (message: string) => void;
1491
+ /**
1492
+ * Installs (or removes, by passing `undefined`) the diagnostics destination.
1493
+ *
1494
+ * When a sink is present it is the ONLY destination — `stderr` gets no copy. Duplicating
1495
+ * destinations would hand the problem back to the TUI that installed the sink precisely to get the
1496
+ * messages out of the terminal.
1497
+ */
1498
+ declare function setDiagnosticsSink(next: DiagnosticsSink | undefined): void;
1499
+
1342
1500
  declare function withCwdMutex<T>(key: string, fn: () => Promise<T>): Promise<T>;
1343
1501
 
1344
1502
  /**
@@ -2352,4 +2510,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2352
2510
  model?: string;
2353
2511
  }): ShareGptTrajectory | null;
2354
2512
 
2355
- export { Agent, AgentBuilder, AgentDefinition, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, withCwdMutex };
2513
+ export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-CZIUKLHt.js';
2
- export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-CZIUKLHt.js';
3
- import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as SDKProvider } from './agent-C3AEtM-W.js';
4
- export { u as ActiveMemoryPassArgs, v as ActiveMemoryPassResult, w as AgentMemory, x as BudgetCheck, y as BudgetTotal, z as BudgetUsageEvent, D as CloudEnv, E as CloudRepo, F as ContextBudget, H as ContextManagerKind, K as ContextSnapshot, N as ContextSource, O as ContextSourceStatus, Q as CreateSkillSpec, R as HookName, T as InvalidateCacheOptions, U as MemoryAdapter, V as MemoryAdapterCapabilities, W as MemoryContext, X as MemoryFact, Y as MemoryProviderHandle, Z as MemoryProviderInitOptions, _ as MemoryRevision, $ as MemoryToolSchema, a0 as MemoryTurnMessage, a1 as PersonalityPreset, a2 as PluginContext, a3 as PostAssistantReplyContext, a4 as PostToolCallContext, a5 as PreToolCallContext, a6 as PreUserSendContext, a7 as PreUserSendResult, a8 as ProviderCapability, a9 as ProviderRoute, aa as ProviderTransform, ab as ProviderTransformContext, ac as RecordSessionSummaryArgs, ad as ResolvedProviderRoute, ae as RunUntilIterator, af as SDKAgentPlugins, ag as SDKAgentSkillDetail, ah as SDKAgentSkills, ai as SDKArtifact, aj as SDKContextManager, ak as SDKPluginMetadata, al as SDKProvidersManager, am as SessionLifecycleContext, an as SessionRecord, ao as SessionStore, ap as SettingSource, aq as Skill, ar as SkillsResolver, as as SkillsResolverContext, at as SystemPromptContext, au as SystemPromptMemoryFact, av as SystemPromptSkillRef, aw as TelemetrySettings, ax as ToolCallSummary, ay as ToolResultTransformContext, az as TransformContext, aA as Verdict } from './agent-C3AEtM-W.js';
5
- import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-vJHg2eGw.js';
6
- export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-vJHg2eGw.js';
1
+ import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DjBQ4Tn8.js';
2
+ export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-DjBQ4Tn8.js';
3
+ import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as AgentDescription, m as Plugin$1, n as ProviderProfile, I as InlineSkill, J as JudgeResult, o as GoalOptions, p as GoalEvent, q as GoalResult, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as SDKProvider } from './agent-ZCZa7YQv.js';
4
+ export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as AgentSubagentDescription, z as AgentToolDescription, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, K as CloudRepo, N as ContextBudget, O as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as HookName, W as InvalidateCacheOptions, X as MemoryAdapter, Y as MemoryAdapterCapabilities, Z as MemoryContext, _ as MemoryFact, $ as MemoryProviderHandle, a0 as MemoryProviderInitOptions, a1 as MemoryRevision, a2 as MemoryToolSchema, a3 as MemoryTurnMessage, a4 as PersonalityPreset, a5 as PluginContext, a6 as PostAssistantReplyContext, a7 as PostToolCallContext, a8 as PreToolCallContext, a9 as PreUserSendContext, aa as PreUserSendResult, ab as ProviderCapability, ac as ProviderRoute, ad as ProviderTransform, ae as ProviderTransformContext, af as RecordSessionSummaryArgs, ag as ResolvedProviderRoute, ah as RunUntilIterator, ai as SDKAgentPlugins, aj as SDKAgentSkillDetail, ak as SDKAgentSkills, al as SDKArtifact, am as SDKContextManager, an as SDKPluginMetadata, ao as SDKProvidersManager, ap as SessionLifecycleContext, aq as SessionRecord, ar as SessionStore, as as SettingSource, at as Skill, au as SkillsResolver, av as SkillsResolverContext, aw as SystemPromptContext, ax as SystemPromptMemoryFact, ay as SystemPromptSkillRef, az as TelemetrySettings, aA as ToolCallSummary, aB as ToolResultTransformContext, aC as TransformContext, aD as Verdict } from './agent-ZCZa7YQv.js';
5
+ import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, T as ToolResultContentBlock, b as Run, P as Processor, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-i2-fUohR.js';
6
+ export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunTimelineEvent, $ as RunToCompletionOptions, a0 as RunToCompletionResult, a1 as RunToolProgressEvent, a2 as RunTripwireEvent, a3 as SDKAssistantMessage, a4 as SDKImage, a5 as SDKImageDimension, a6 as SDKObjectDelta, a7 as SDKRequestMessage, a8 as SDKStatusMessage, a9 as SDKSystemMessage, aa as SDKTaskMessage, ab as SDKThinkingMessage, ac as SDKToolUseMessage, ad as SDKUserMessage, ae as SDKUserMessageEvent, af as SendOptions, ag as ShellCommand, ah as ShellConversationTurn, ai as ShellOutput, aj as ShellOutputDeltaUpdate, ak as StepCompletedUpdate, al as StepStartedUpdate, am as StreamToCompletionResult, an as SummaryCompletedUpdate, ao as SummaryStartedUpdate, ap as SummaryUpdate, aq as TextBlock, ar as TextDeltaUpdate, as as ThinkingCompletedUpdate, at as ThinkingDeltaUpdate, au as ThinkingMessage, av as TokenDeltaUpdate, aw as TokenUsage, ax as ToolCall, ay as ToolCallCompletedUpdate, az as ToolCallStartedUpdate, aA as ToolContextMessage, aB as ToolResult, aC as ToolResultGuardOptions, aD as ToolUseBlock, aE as TurnEndedUpdate, aF as UserMessage, aG as UserMessageAppendedUpdate, aH as applyMode, aI as emitRunEvent } from './run-i2-fUohR.js';
7
7
  import * as zod from 'zod';
8
8
  import { ZodType, z } from 'zod';
9
- import { S as StepResult } from './cron-ChQ6zcW2.js';
10
- export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-ChQ6zcW2.js';
9
+ import { S as StepResult } from './cron-Bx7tzm5R.js';
10
+ export { C as Cron, a as CronCreateOptions, b as CronGetOptions, c as CronJob, d as CronJobStatus, e as CronListOptions, f as CronOperationOptions, g as CronRunOptions, h as CronRuntime, i as CronSchedulerStatus, j as CronStartOptions } from './cron-Bx7tzm5R.js';
11
11
 
12
12
  /**
13
13
  * Public compaction / context-management helpers (M2-1, extended V3-3).
@@ -468,6 +468,66 @@ declare class LiveAgentRegistry {
468
468
  ids(): readonly string[];
469
469
  }
470
470
 
471
+ /**
472
+ * The shape of a persisted session turn, as a HOST reads it.
473
+ *
474
+ * Lives in `types/` because it is public contract — `Agent.transcript()` returns it (theokit#146).
475
+ * `internal/session/session-types.ts` re-exports it so the runtime and the store keep importing
476
+ * from the leaf they always did.
477
+ *
478
+ * @public
479
+ */
480
+
481
+ /**
482
+ * One turn of a session.
483
+ *
484
+ * Two projections of the same turn, and they answer different questions:
485
+ *
486
+ * - `text` is the flat rendering the model replay uses. A tool call folds to `[tool call] NAME` and
487
+ * a result to `[tool result] <body>`.
488
+ * - `parts` is the same turn unflattened, for a host that draws tool CARDS: the call id, the tool
489
+ * name, the arguments, and the `toolUseId` that ties a result back to its call — none of which
490
+ * survive the flat form.
491
+ *
492
+ * `parts` was added in theokit#146 and is additive: `text` is byte-identical to what it always was,
493
+ * so every existing reader is untouched.
494
+ *
495
+ * @public
496
+ */
497
+ interface SessionMessage {
498
+ role: "user" | "assistant";
499
+ text: string;
500
+ /**
501
+ * The structured view. Optional because a `SessionMessage` can also be built in memory during a
502
+ * live turn, where only the text projection exists. Absent means "this projection carries no
503
+ * structure", never "this turn had none".
504
+ */
505
+ parts?: readonly SessionMessagePart[];
506
+ }
507
+ /**
508
+ * One structured element of a {@link SessionMessage}.
509
+ *
510
+ * Deliberately a session-DISPLAY shape rather than a re-export of the internal LLM part union: the
511
+ * two answer different questions (what to send a provider vs. what to draw), and coupling them
512
+ * would make every provider-wire change a change to what hosts render.
513
+ *
514
+ * @public
515
+ */
516
+ type SessionMessagePart = {
517
+ readonly type: "text";
518
+ readonly text: string;
519
+ } | {
520
+ readonly type: "tool_use";
521
+ readonly id: string;
522
+ readonly name: string;
523
+ readonly input: Record<string, unknown>;
524
+ } | {
525
+ readonly type: "tool_result";
526
+ readonly toolUseId: string;
527
+ readonly content: string | ReadonlyArray<ToolResultContentBlock>;
528
+ readonly isError?: boolean;
529
+ };
530
+
471
531
  /**
472
532
  * Result of a one-shot {@link Agent.prompt} call.
473
533
  *
@@ -679,6 +739,41 @@ declare class Agent {
679
739
  userText: string;
680
740
  assistantText: string;
681
741
  }): Promise<void>;
742
+ /**
743
+ * theokit#146 — read a LOCAL agent's persisted transcript as STRUCTURE, for rendering.
744
+ *
745
+ * A resumed session already replays correctly to the model, but a host had no way to draw it:
746
+ * the only projection available folded a tool call to the string `[tool call] NAME`, dropping the
747
+ * call id and every argument. A card UI got prose, so cross-restart resume was worth less than
748
+ * starting fresh — which is what at least one consumer did.
749
+ *
750
+ * Each returned message carries both projections: `text` (unchanged, what the model replay uses)
751
+ * and `parts` (`text` / `tool_use` / `tool_result` with ids, names, arguments and the
752
+ * `toolUseId` that correlates a result back to its call).
753
+ *
754
+ * Read-only and local-only: it opens the agent's session store and walks the transcript, exactly
755
+ * as {@link Agent.compact} and {@link Agent.injectSessionTurn} do. It appends nothing.
756
+ *
757
+ * @throws UnknownAgentError when `agentId` names no local agent.
758
+ * @public
759
+ */
760
+ static transcript(agentId: string): Promise<readonly SessionMessage[]>;
761
+ /**
762
+ * theokit#123 — read-only introspection of a registered agent's tools and subagents.
763
+ *
764
+ * `Agent.list()` / `Agent.get()` enumerate agents and `agent.skills.list()` covers skills, but
765
+ * tools and subagents lived only on `RegisteredAgent.options` — an internal contract. A
766
+ * reflection endpoint (theokit-studio's `theokit dev`) therefore had to report empty lists for
767
+ * both, and say so with an `unavailable_reason`.
768
+ *
769
+ * A PROJECTION, not the options object. Tool handlers and subagent prompts are stripped: a
770
+ * handler is an executable that cannot cross a process boundary, and a prompt is the agent's
771
+ * instructions rather than its signature — a reflection endpoint serializes what it is handed.
772
+ *
773
+ * @throws UnknownAgentError when `agentId` names no registered agent.
774
+ * @public
775
+ */
776
+ static describe(agentId: string): Promise<AgentDescription>;
682
777
  /**
683
778
  * Permanently delete a cloud agent.
684
779
  *
@@ -1339,6 +1434,69 @@ declare function createCounterBudgetTracker(options?: CounterBudgetTrackerOption
1339
1434
  nextIteration(): void;
1340
1435
  };
1341
1436
 
1437
+ /**
1438
+ * The library's single diagnostics channel — silent by default (#147).
1439
+ *
1440
+ * ## O problema
1441
+ *
1442
+ * The SDK wrote diagnostics straight to `process.stderr` from hot paths — 92 sites across 51
1443
+ * files under `internal/`. In a TUI host (Ink, alternate screen), those writes interleave with the
1444
+ * render and **corrupt the frame**. And the host had no way to intercept them: there was no
1445
+ * injectable logger. One consumer went as far as installing `proper-lockfile` just to silence ONE
1446
+ * of them.
1447
+ *
1448
+ * A library cannot assume `stdout`/`stderr` are free sinks. The application owns the terminal, not
1449
+ * the dependency.
1450
+ *
1451
+ * ## O contrato
1452
+ *
1453
+ * - **`setDiagnosticsSink(fn)`** hands the messages to the application, which decides where to put
1454
+ * them (a status line, a file, a panel). It is what was missing for a TUI to coexist with the SDK.
1455
+ * - **With no sink, nothing is emitted.** A library does not own the host's terminal.
1456
+ *
1457
+ * ## Silent by default, and how 36 suites survived the flip
1458
+ *
1459
+ * The default WAS `stderr`, and 36 test files spy on `process.stderr.write` to assert a given
1460
+ * warning is emitted. That contract is real and had to survive; migrating all 36 by hand, across
1461
+ * four different spy styles, is how you weaken 36 suites in one commit.
1462
+ *
1463
+ * So the flip happened at the default, and `vitest.setup.ts` installs a sink that FORWARDS to
1464
+ * `stderr` for the duration of every test. Those assertions still test what they always tested —
1465
+ * "this condition emits a diagnostic" — through the channel a host would use, while production
1466
+ * emits nothing unless asked.
1467
+ *
1468
+ * The cost is stated rather than hidden: no test observes the production default by accident, so
1469
+ * `tests/diagnostics-public-entry.test.ts` pins it explicitly by clearing the sink first.
1470
+ *
1471
+ * ## Coverage is the whole guarantee
1472
+ *
1473
+ * The first sweep migrated the 92 sites under `internal/` and left `src/`'s own modules —
1474
+ * `event-bus.ts`, `batch.ts`, `compaction.ts`, `internal/workflow/step-branch.ts`. A host could
1475
+ * therefore install a sink and still have its frame corrupted by a batch run, which is the reported
1476
+ * defect with a smaller blast radius. Those are routed here too, and
1477
+ * `tests/lint/no-direct-terminal-write.test.ts` is what keeps the next hot path from
1478
+ * reintroducing one. "Mostly interceptable" is not interceptable.
1479
+ *
1480
+ * The remaining direct writers are allowlisted there with a reason, and every one of them is a seam
1481
+ * whose destination the CALLER already chooses (`opts.warn`, `opts.logger`, the Workflow logger).
1482
+ *
1483
+ * ## What this is NOT
1484
+ *
1485
+ * It is not a logger with levels, formatting or multiple destinations. It is the minimum that
1486
+ * resolves the reported blocker; a full logger here would be inventing a requirement nobody asked
1487
+ * for.
1488
+ */
1489
+ /** Receives each diagnostic message already formatted, with the trailing `\n`. */
1490
+ type DiagnosticsSink = (message: string) => void;
1491
+ /**
1492
+ * Installs (or removes, by passing `undefined`) the diagnostics destination.
1493
+ *
1494
+ * When a sink is present it is the ONLY destination — `stderr` gets no copy. Duplicating
1495
+ * destinations would hand the problem back to the TUI that installed the sink precisely to get the
1496
+ * messages out of the terminal.
1497
+ */
1498
+ declare function setDiagnosticsSink(next: DiagnosticsSink | undefined): void;
1499
+
1342
1500
  declare function withCwdMutex<T>(key: string, fn: () => Promise<T>): Promise<T>;
1343
1501
 
1344
1502
  /**
@@ -2352,4 +2510,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2352
2510
  model?: string;
2353
2511
  }): ShareGptTrajectory | null;
2354
2512
 
2355
- export { Agent, AgentBuilder, AgentDefinition, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, withCwdMutex };
2513
+ export { Agent, AgentBuilder, AgentDefinition, AgentDescription, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DiagnosticsSink, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionMessage, type SessionMessagePart, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, setDiagnosticsSink, toShareGptTrajectory, withCwdMutex };
package/dist/index.js CHANGED
@@ -1,56 +1,61 @@
1
- export { StreamObjectError } from './chunk-6XZBKFQ7.js';
1
+ export { JudgeCredentialError } from './chunk-D7IULBF2.js';
2
+ export { StreamObjectError } from './chunk-DU7DE543.js';
2
3
  export { GOAL_CONTINUATION_MARKER } from './chunk-PY2RQOA7.js';
3
- export { JudgeCredentialError } from './chunk-5BVBNE2F.js';
4
- export { GenerateObjectError } from './chunk-ZK3BJ4XQ.js';
5
- import './chunk-EUB7YLU2.js';
6
- import { Workflow, agentStep } from './chunk-ACHGT3D2.js';
7
- import './chunk-XS7SKY2F.js';
4
+ export { GenerateObjectError } from './chunk-KE6XKRLQ.js';
5
+ import './chunk-JZUPMTJY.js';
6
+ import { Workflow, agentStep } from './chunk-MC5EINBV.js';
7
+ import './chunk-V2RBCCN5.js';
8
8
  import './chunk-CAH3G4IS.js';
9
- export { Cron } from './chunk-EE24WJJR.js';
10
- import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-VUDH4D2M.js';
11
- export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-VUDH4D2M.js';
9
+ export { Cron } from './chunk-KWUNN5J2.js';
10
+ import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-GIRD3RWH.js';
11
+ export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-GIRD3RWH.js';
12
12
  import './chunk-2SFBB54R.js';
13
- import { configure, submit, list, get, cancel, subscribe } from './chunk-7QDTZJRV.js';
14
- export { emitRunEvent } from './chunk-7QDTZJRV.js';
15
- import './chunk-A4XXV2C6.js';
13
+ import { configure, submit, list, get, cancel, subscribe } from './chunk-LJX2SQV2.js';
14
+ export { emitRunEvent } from './chunk-LJX2SQV2.js';
16
15
  import './chunk-K2BQQ445.js';
17
- import './chunk-4NVV3GRU.js';
18
- import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-HI6G3SNY.js';
19
- import './chunk-UWEALKAN.js';
16
+ import './chunk-E2FFG33C.js';
17
+ import './chunk-KGRIHEDT.js';
18
+ import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-ZYB6B7QJ.js';
19
+ import './chunk-HWNVAUK4.js';
20
20
  import './chunk-5KOW3GLE.js';
21
- import { lanceStoragePath, LanceIndex, readFactsFromMarkdown, defaultIndexPath, openMemoryDb, memoryDir } from './chunk-4APWS2YF.js';
22
- import './chunk-M6UUTNDT.js';
21
+ import './chunk-3I4B3OIX.js';
22
+ import { lanceStoragePath, LanceIndex, readFactsFromMarkdown, defaultIndexPath, openMemoryDb, memoryDir } from './chunk-4F7JQZOX.js';
23
+ import './chunk-ML5A5DOJ.js';
23
24
  import './chunk-7GFX45DD.js';
24
- import './chunk-UD2T7ISG.js';
25
+ import './chunk-YP67XZES.js';
26
+ import './chunk-QKE556YD.js';
27
+ import './chunk-SCFW5MJZ.js';
28
+ import './chunk-OXNYIMZZ.js';
25
29
  import './chunk-FD2UT76F.js';
26
30
  import './chunk-U54XCYG3.js';
27
- import './chunk-FV3YEMQ7.js';
31
+ import './chunk-RP5HQVLD.js';
28
32
  import './chunk-6X6ID4MO.js';
29
33
  import './chunk-UJ7IQJAG.js';
30
34
  import './chunk-7AD3ZTZL.js';
31
- import './chunk-4WIJSKFA.js';
32
- import './chunk-YCHC45BY.js';
33
- import './chunk-EDI7DBWO.js';
34
- import './chunk-XJ5TMOGA.js';
35
- import './chunk-ZFZYPLQI.js';
35
+ import './chunk-LGILIGV3.js';
36
+ import './chunk-PI4RO4GR.js';
37
+ import './chunk-ET6PHZRX.js';
38
+ import './chunk-JRLXEYR4.js';
39
+ import './chunk-BQDUEG4C.js';
40
+ import './chunk-AECV3G5Z.js';
36
41
  import { withCwdMutex } from './chunk-2XLKLVVR.js';
37
42
  export { withCwdMutex } from './chunk-2XLKLVVR.js';
38
- import './chunk-AOZYORH7.js';
39
- import './chunk-SGTMDQ4O.js';
43
+ import './chunk-6EEYRFJC.js';
40
44
  import { toJsonSchema } from './chunk-4VPXM6UU.js';
41
- import { replaceFileAtomic } from './chunk-LGCEYEU2.js';
42
- import './chunk-HHUDNTZC.js';
43
- import './chunk-A6GXYF2Q.js';
45
+ import { replaceFileAtomic } from './chunk-KX7JV5KM.js';
46
+ import './chunk-YRXY2A5L.js';
47
+ import './chunk-65ONFZWM.js';
44
48
  import { parseModelId } from './chunk-X2FR4OIT.js';
45
- import { registerBuiltins, listProviders, getCatalogCapabilities, getProviderProfile } from './chunk-3XKVRLR2.js';
46
- import './chunk-JI34KBNC.js';
49
+ import { registerBuiltins, listProviders, getCatalogCapabilities, getProviderProfile } from './chunk-TOTP24P6.js';
50
+ import './chunk-DKFGUOWL.js';
47
51
  import './chunk-5NBUH3NO.js';
48
- import './chunk-KWXC6ERT.js';
49
- import './chunk-JCXIDFRI.js';
50
- import './chunk-QFWQLXCL.js';
51
- import { BudgetExceededError, MemoryAdapterError, AuthenticationError, ConfigurationError } from './chunk-ZYOHF37V.js';
52
- export { AgentDisposedError, AgentRunError, AuthenticationError, BudgetExceededError, ConfigurationError, IntegrationNotConnectedError, InvalidTaskIdError, MemoryAdapterError, NetworkError, RateLimitError, TaskNotFoundError, TheokitAgentError, UnknownAgentError, UnsupportedBudgetOperationError, UnsupportedRunOperationError, UnsupportedTaskOperationError, isTransientError } from './chunk-ZYOHF37V.js';
53
- import { diag, redactSecrets, addPattern } from './chunk-KCZW75PI.js';
52
+ import './chunk-42IFCKQZ.js';
53
+ import './chunk-J3UK2GMN.js';
54
+ import './chunk-AR5MQZ3J.js';
55
+ import { BudgetExceededError, MemoryAdapterError, AuthenticationError, ConfigurationError } from './chunk-SG5ZWT6C.js';
56
+ export { AgentDisposedError, AgentRunError, AuthenticationError, BudgetExceededError, ConfigurationError, IntegrationNotConnectedError, InvalidTaskIdError, MemoryAdapterError, NetworkError, RateLimitError, TaskNotFoundError, TheokitAgentError, UnknownAgentError, UnsupportedBudgetOperationError, UnsupportedRunOperationError, UnsupportedTaskOperationError, isTransientError } from './chunk-SG5ZWT6C.js';
57
+ import { diag, redactSecrets, addPattern } from './chunk-IVSD7L22.js';
58
+ export { setDiagnosticsSink } from './chunk-IVSD7L22.js';
54
59
  import { z } from 'zod';
55
60
  import { randomUUID, createHash } from 'crypto';
56
61
  import { mkdir, readFile } from 'fs/promises';
@@ -694,10 +699,8 @@ var EventBus = class {
694
699
  } catch (cause) {
695
700
  this.#handlerErrorCount += 1;
696
701
  const message = cause instanceof Error ? cause.message : String(cause);
697
- process.stderr.write(
698
- `[theokit-sdk] event-bus: handler for "${String(event)}" threw: ${message}
699
- `
700
- );
702
+ diag(`[theokit-sdk] event-bus: handler for "${String(event)}" threw: ${message}
703
+ `);
701
704
  }
702
705
  }
703
706
  }
@@ -719,7 +722,7 @@ function runGoalLoop(agent, goal, options, depsOverride) {
719
722
  async function* wrap() {
720
723
  const { runUntilImpl } = await import('./run-until-BK56WG4P.js');
721
724
  const deps = depsOverride ?? await (async () => {
722
- const { judgeCallImpl } = await import('./judge-call-3S3T6O2Z.js');
725
+ const { judgeCallImpl } = await import('./judge-call-NA2G6ZMJ.js');
723
726
  const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
724
727
  const create = getAgentFacade().create;
725
728
  return {
@@ -1166,7 +1169,7 @@ var Memory = {
1166
1169
  openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
1167
1170
  return await peer.IndexManager.open(openArgs);
1168
1171
  }
1169
- const { IndexManager } = await import('./index-manager-F2H2RCZU.js');
1172
+ const { IndexManager } = await import('./index-manager-ZVZUHPP7.js');
1170
1173
  openArgs.embedding = await resolveEmbedding(opts.embedding, MEMORY_EMBEDDING_ADAPTERS);
1171
1174
  return await IndexManager.open(openArgs);
1172
1175
  },
@@ -1600,7 +1603,7 @@ function ehAgenteConstruido(m) {
1600
1603
  return typeof m.send === "function";
1601
1604
  }
1602
1605
  async function materializar(def, indice) {
1603
- const { Agent: Agent2 } = await import('./agent-3H3UKD6U.js');
1606
+ const { Agent: Agent2 } = await import('./agent-KKZYLY5D.js');
1604
1607
  return Agent2.create({
1605
1608
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1606
1609
  // here means "declare nothing and let the default apply" — forwarding the literal would create