@theokit/sdk 4.36.0 → 4.37.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 (301) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/agent-4MHQUGO5.cjs +51 -0
  3. package/dist/{agent-P77NPBF4.cjs.map → agent-4MHQUGO5.cjs.map} +1 -1
  4. package/dist/agent-GV36S2CF.js +42 -0
  5. package/dist/{agent-H6HL5ITH.js.map → agent-GV36S2CF.js.map} +1 -1
  6. package/dist/agent.d.ts +2 -1
  7. package/dist/auth/index.cjs +15 -15
  8. package/dist/auth/index.js +4 -4
  9. package/dist/{batch-2FSD2UNL.cjs → batch-3SEPDXCU.cjs} +23 -23
  10. package/dist/{batch-2FSD2UNL.cjs.map → batch-3SEPDXCU.cjs.map} +1 -1
  11. package/dist/{batch-MR2HKYMS.js → batch-SY5GZLFD.js} +9 -9
  12. package/dist/{batch-MR2HKYMS.js.map → batch-SY5GZLFD.js.map} +1 -1
  13. package/dist/{chunk-JLMXKTBX.cjs → chunk-2423XDPT.cjs} +26 -26
  14. package/dist/{chunk-JLMXKTBX.cjs.map → chunk-2423XDPT.cjs.map} +1 -1
  15. package/dist/{chunk-5IB2UKSN.js → chunk-2WFB5ZOX.js} +5 -5
  16. package/dist/{chunk-5IB2UKSN.js.map → chunk-2WFB5ZOX.js.map} +1 -1
  17. package/dist/{chunk-EPYZOCOL.cjs → chunk-3ILFUXNE.cjs} +5 -5
  18. package/dist/{chunk-EPYZOCOL.cjs.map → chunk-3ILFUXNE.cjs.map} +1 -1
  19. package/dist/{chunk-KSKU6JY6.cjs → chunk-3O2ELBST.cjs} +5 -5
  20. package/dist/{chunk-KSKU6JY6.cjs.map → chunk-3O2ELBST.cjs.map} +1 -1
  21. package/dist/{chunk-M2PU44HP.cjs → chunk-4YB7B3RP.cjs} +8 -8
  22. package/dist/{chunk-M2PU44HP.cjs.map → chunk-4YB7B3RP.cjs.map} +1 -1
  23. package/dist/{chunk-S2BBRVQX.js → chunk-56OXYUZE.js} +8 -7
  24. package/dist/chunk-56OXYUZE.js.map +1 -0
  25. package/dist/{chunk-D42XHI4O.cjs → chunk-56ZM6P7Z.cjs} +13 -14
  26. package/dist/chunk-56ZM6P7Z.cjs.map +1 -0
  27. package/dist/{chunk-7BTE3RXJ.js → chunk-5SB4V74H.js} +7 -8
  28. package/dist/chunk-5SB4V74H.js.map +1 -0
  29. package/dist/{chunk-MZ5ZRORA.cjs → chunk-6EDQBX7U.cjs} +17 -16
  30. package/dist/chunk-6EDQBX7U.cjs.map +1 -0
  31. package/dist/{chunk-RKG6QFCJ.js → chunk-6VP3XGEK.js} +4 -4
  32. package/dist/{chunk-RKG6QFCJ.js.map → chunk-6VP3XGEK.js.map} +1 -1
  33. package/dist/{chunk-KAP4GJHO.js → chunk-77WHPVXE.js} +10 -11
  34. package/dist/chunk-77WHPVXE.js.map +1 -0
  35. package/dist/{chunk-LALRCFSN.cjs → chunk-7DXLNNKH.cjs} +4 -4
  36. package/dist/{chunk-LALRCFSN.cjs.map → chunk-7DXLNNKH.cjs.map} +1 -1
  37. package/dist/{chunk-WEHUJ7ZS.cjs → chunk-ALU3KC4G.cjs} +267 -120
  38. package/dist/chunk-ALU3KC4G.cjs.map +1 -0
  39. package/dist/{chunk-Z2OC3UIW.cjs → chunk-BJMKQOY2.cjs} +11 -11
  40. package/dist/{chunk-Z2OC3UIW.cjs.map → chunk-BJMKQOY2.cjs.map} +1 -1
  41. package/dist/{chunk-WLKFWQSJ.js → chunk-CD73YHEH.js} +3 -3
  42. package/dist/{chunk-WLKFWQSJ.js.map → chunk-CD73YHEH.js.map} +1 -1
  43. package/dist/{chunk-BXV2QUIC.js → chunk-CSZRJ4RE.js} +6 -5
  44. package/dist/chunk-CSZRJ4RE.js.map +1 -0
  45. package/dist/{chunk-6M6A6WWW.cjs → chunk-D4ZUJTFB.cjs} +9 -10
  46. package/dist/chunk-D4ZUJTFB.cjs.map +1 -0
  47. package/dist/{chunk-XAUBQMQU.js → chunk-DCJ5MCJ3.js} +7 -7
  48. package/dist/{chunk-XAUBQMQU.js.map → chunk-DCJ5MCJ3.js.map} +1 -1
  49. package/dist/{chunk-6CLRANZA.js → chunk-EXQV452X.js} +3 -3
  50. package/dist/{chunk-6CLRANZA.js.map → chunk-EXQV452X.js.map} +1 -1
  51. package/dist/{chunk-XIG2IE3L.js → chunk-F6Y4IEQM.js} +5 -4
  52. package/dist/chunk-F6Y4IEQM.js.map +1 -0
  53. package/dist/{chunk-N24XBYNX.cjs → chunk-FAY3QDGC.cjs} +11 -10
  54. package/dist/chunk-FAY3QDGC.cjs.map +1 -0
  55. package/dist/{chunk-JD74LN7R.cjs → chunk-FK4EJD2I.cjs} +7 -6
  56. package/dist/chunk-FK4EJD2I.cjs.map +1 -0
  57. package/dist/{chunk-IX2LKBCD.js → chunk-GL7CFBVC.js} +176 -35
  58. package/dist/chunk-GL7CFBVC.js.map +1 -0
  59. package/dist/{chunk-77FOZCOT.js → chunk-GLUWH6JO.js} +6 -5
  60. package/dist/chunk-GLUWH6JO.js.map +1 -0
  61. package/dist/{chunk-RZQ6E5YZ.cjs → chunk-GM7QDQ24.cjs} +11 -11
  62. package/dist/{chunk-RZQ6E5YZ.cjs.map → chunk-GM7QDQ24.cjs.map} +1 -1
  63. package/dist/{chunk-G4WI3VW2.cjs → chunk-H5YVJB4K.cjs} +9 -10
  64. package/dist/chunk-H5YVJB4K.cjs.map +1 -0
  65. package/dist/{chunk-HRA3CPGG.js → chunk-HEN5WXXI.js} +9 -8
  66. package/dist/chunk-HEN5WXXI.js.map +1 -0
  67. package/dist/{chunk-LU7VALW5.js → chunk-I35DI7ES.js} +3 -3
  68. package/dist/{chunk-LU7VALW5.js.map → chunk-I35DI7ES.js.map} +1 -1
  69. package/dist/{chunk-TIZ4TS5V.cjs → chunk-ICYBIC6N.cjs} +8 -7
  70. package/dist/chunk-ICYBIC6N.cjs.map +1 -0
  71. package/dist/{chunk-2DYI7MIF.cjs → chunk-IEUDKUPM.cjs} +8 -8
  72. package/dist/{chunk-2DYI7MIF.cjs.map → chunk-IEUDKUPM.cjs.map} +1 -1
  73. package/dist/{chunk-AIDNODHJ.cjs → chunk-ITLS5LRF.cjs} +11 -11
  74. package/dist/{chunk-AIDNODHJ.cjs.map → chunk-ITLS5LRF.cjs.map} +1 -1
  75. package/dist/{chunk-M72RJVPC.js → chunk-JNIWFCKI.js} +3 -3
  76. package/dist/{chunk-M72RJVPC.js.map → chunk-JNIWFCKI.js.map} +1 -1
  77. package/dist/{chunk-Y66627E4.cjs → chunk-KDDL5HKQ.cjs} +24 -24
  78. package/dist/{chunk-Y66627E4.cjs.map → chunk-KDDL5HKQ.cjs.map} +1 -1
  79. package/dist/{chunk-BEURCLDV.cjs → chunk-LTCOPATU.cjs} +9 -3
  80. package/dist/chunk-LTCOPATU.cjs.map +1 -0
  81. package/dist/{chunk-TQKCU7CL.js → chunk-M5ZQBOIZ.js} +3 -3
  82. package/dist/{chunk-TQKCU7CL.js.map → chunk-M5ZQBOIZ.js.map} +1 -1
  83. package/dist/{chunk-A44COQJJ.cjs → chunk-MHCKWQR3.cjs} +8 -8
  84. package/dist/{chunk-A44COQJJ.cjs.map → chunk-MHCKWQR3.cjs.map} +1 -1
  85. package/dist/{chunk-7S7KKUO6.cjs → chunk-MRODLUGY.cjs} +4 -4
  86. package/dist/{chunk-7S7KKUO6.cjs.map → chunk-MRODLUGY.cjs.map} +1 -1
  87. package/dist/{chunk-BOTK6ZUP.js → chunk-MXSMAGDU.js} +3 -3
  88. package/dist/{chunk-BOTK6ZUP.js.map → chunk-MXSMAGDU.js.map} +1 -1
  89. package/dist/{chunk-5PZMMF4H.js → chunk-NFCKEBHI.js} +3 -3
  90. package/dist/{chunk-5PZMMF4H.js.map → chunk-NFCKEBHI.js.map} +1 -1
  91. package/dist/{chunk-6M4ODB2V.cjs → chunk-NNSKJCBM.cjs} +10 -10
  92. package/dist/{chunk-6M4ODB2V.cjs.map → chunk-NNSKJCBM.cjs.map} +1 -1
  93. package/dist/{chunk-4WL52CXU.cjs → chunk-NQ4AC2U4.cjs} +9 -9
  94. package/dist/{chunk-4WL52CXU.cjs.map → chunk-NQ4AC2U4.cjs.map} +1 -1
  95. package/dist/{chunk-YRXTIESB.cjs → chunk-P34DHHYQ.cjs} +4 -4
  96. package/dist/{chunk-YRXTIESB.cjs.map → chunk-P34DHHYQ.cjs.map} +1 -1
  97. package/dist/{chunk-HFPGOTVF.cjs → chunk-PAEJPLVN.cjs} +4 -4
  98. package/dist/{chunk-HFPGOTVF.cjs.map → chunk-PAEJPLVN.cjs.map} +1 -1
  99. package/dist/{chunk-S5RCBTSF.js → chunk-QFMXXUUT.js} +3 -3
  100. package/dist/{chunk-S5RCBTSF.js.map → chunk-QFMXXUUT.js.map} +1 -1
  101. package/dist/{chunk-V4XRLPEF.js → chunk-QGDKZDPN.js} +3 -3
  102. package/dist/{chunk-V4XRLPEF.js.map → chunk-QGDKZDPN.js.map} +1 -1
  103. package/dist/{chunk-DHLZIMP6.cjs → chunk-QUFSDDNU.cjs} +15 -15
  104. package/dist/{chunk-DHLZIMP6.cjs.map → chunk-QUFSDDNU.cjs.map} +1 -1
  105. package/dist/{chunk-3XJ7CS2C.cjs → chunk-S3WZ7NHF.cjs} +597 -671
  106. package/dist/chunk-S3WZ7NHF.cjs.map +1 -0
  107. package/dist/{chunk-BFWPZMG7.js → chunk-SDIBMLL5.js} +8 -8
  108. package/dist/{chunk-BFWPZMG7.js.map → chunk-SDIBMLL5.js.map} +1 -1
  109. package/dist/{chunk-LEJXBUBD.js → chunk-SSH2ZAZF.js} +5 -5
  110. package/dist/{chunk-LEJXBUBD.js.map → chunk-SSH2ZAZF.js.map} +1 -1
  111. package/dist/{chunk-GIW4L6HY.cjs → chunk-SWIBQFPH.cjs} +4 -4
  112. package/dist/{chunk-GIW4L6HY.cjs.map → chunk-SWIBQFPH.cjs.map} +1 -1
  113. package/dist/{chunk-JTFYYKDT.js → chunk-TAPQWDW2.js} +9 -4
  114. package/dist/chunk-TAPQWDW2.js.map +1 -0
  115. package/dist/{chunk-4GTXATWK.cjs → chunk-THEYGCYS.cjs} +4 -4
  116. package/dist/{chunk-4GTXATWK.cjs.map → chunk-THEYGCYS.cjs.map} +1 -1
  117. package/dist/{chunk-CJVMDRQB.cjs → chunk-TQI3KRXZ.cjs} +5 -4
  118. package/dist/chunk-TQI3KRXZ.cjs.map +1 -0
  119. package/dist/{chunk-LUSXDZPV.cjs → chunk-U2WLFOA3.cjs} +4 -4
  120. package/dist/{chunk-LUSXDZPV.cjs.map → chunk-U2WLFOA3.cjs.map} +1 -1
  121. package/dist/{chunk-FKCC2MED.js → chunk-UQPDFW4E.js} +3 -3
  122. package/dist/{chunk-FKCC2MED.js.map → chunk-UQPDFW4E.js.map} +1 -1
  123. package/dist/{chunk-CR3DGWUQ.js → chunk-VNNK6AKU.js} +3 -3
  124. package/dist/{chunk-CR3DGWUQ.js.map → chunk-VNNK6AKU.js.map} +1 -1
  125. package/dist/{chunk-ANIZEWTU.cjs → chunk-W4QN5CMG.cjs} +9 -8
  126. package/dist/chunk-W4QN5CMG.cjs.map +1 -0
  127. package/dist/{chunk-POQT2OIF.js → chunk-WDGCZDRG.js} +3 -3
  128. package/dist/{chunk-POQT2OIF.js.map → chunk-WDGCZDRG.js.map} +1 -1
  129. package/dist/{chunk-Q56IYTBZ.js → chunk-XAEAMI5H.js} +4 -4
  130. package/dist/{chunk-Q56IYTBZ.js.map → chunk-XAEAMI5H.js.map} +1 -1
  131. package/dist/{chunk-BWT67BI4.cjs → chunk-XAYVHS2B.cjs} +4 -4
  132. package/dist/{chunk-BWT67BI4.cjs.map → chunk-XAYVHS2B.cjs.map} +1 -1
  133. package/dist/{chunk-EKFA76N4.js → chunk-XJLGRJ7K.js} +387 -458
  134. package/dist/chunk-XJLGRJ7K.js.map +1 -0
  135. package/dist/{chunk-KIO7QFIV.cjs → chunk-YBFDBOUN.cjs} +8 -8
  136. package/dist/{chunk-KIO7QFIV.cjs.map → chunk-YBFDBOUN.cjs.map} +1 -1
  137. package/dist/{chunk-BNIFFFH3.js → chunk-YCXMSDSP.js} +4 -4
  138. package/dist/{chunk-BNIFFFH3.js.map → chunk-YCXMSDSP.js.map} +1 -1
  139. package/dist/{chunk-UVNG67DG.js → chunk-YDLNI7J6.js} +3 -3
  140. package/dist/{chunk-UVNG67DG.js.map → chunk-YDLNI7J6.js.map} +1 -1
  141. package/dist/{chunk-UAYYNWYJ.js → chunk-YHZXBDAW.js} +5 -4
  142. package/dist/chunk-YHZXBDAW.js.map +1 -0
  143. package/dist/{chunk-OKXUMCGM.js → chunk-YVTNFKZO.js} +5 -5
  144. package/dist/{chunk-OKXUMCGM.js.map → chunk-YVTNFKZO.js.map} +1 -1
  145. package/dist/{chunk-GJAGKFTR.js → chunk-ZJN6NTHE.js} +3 -3
  146. package/dist/{chunk-GJAGKFTR.js.map → chunk-ZJN6NTHE.js.map} +1 -1
  147. package/dist/{chunk-XV2RBL6D.js → chunk-ZW345YOI.js} +8 -9
  148. package/dist/chunk-ZW345YOI.js.map +1 -0
  149. package/dist/compact-session-H5TKLD55.cjs +54 -0
  150. package/dist/{compact-session-BEA3IOON.cjs.map → compact-session-H5TKLD55.cjs.map} +1 -1
  151. package/dist/compact-session-WNKKIIDW.js +17 -0
  152. package/dist/{compact-session-5BDD4HIB.js.map → compact-session-WNKKIIDW.js.map} +1 -1
  153. package/dist/compaction.cjs +16 -16
  154. package/dist/compaction.js +3 -3
  155. package/dist/concurrency.cjs +6 -6
  156. package/dist/concurrency.js +4 -4
  157. package/dist/context-VAYLPT4O.js +5 -0
  158. package/dist/{context-GWANQLX4.js.map → context-VAYLPT4O.js.map} +1 -1
  159. package/dist/context-ZV33V4DC.cjs +22 -0
  160. package/dist/{context-KNWVTZSY.cjs.map → context-ZV33V4DC.cjs.map} +1 -1
  161. package/dist/cron.cjs +28 -28
  162. package/dist/cron.js +27 -27
  163. package/dist/errors.cjs +21 -21
  164. package/dist/errors.js +2 -2
  165. package/dist/eval.cjs +31 -31
  166. package/dist/eval.js +27 -27
  167. package/dist/{executor-Y4MKPIUD.cjs → executor-OZSYXDKF.cjs} +23 -23
  168. package/dist/{executor-Y4MKPIUD.cjs.map → executor-OZSYXDKF.cjs.map} +1 -1
  169. package/dist/{executor-ORJS5GV2.js → executor-PAH72CB5.js} +7 -7
  170. package/dist/{executor-ORJS5GV2.js.map → executor-PAH72CB5.js.map} +1 -1
  171. package/dist/filesystem/index.cjs +7 -7
  172. package/dist/filesystem/index.js +3 -3
  173. package/dist/fs-session-store-6MY7PNI2.js +10 -0
  174. package/dist/{fs-session-store-4ALCDU3K.js.map → fs-session-store-6MY7PNI2.js.map} +1 -1
  175. package/dist/fs-session-store-7E7UPLF2.cjs +19 -0
  176. package/dist/{fs-session-store-IQYE35HX.cjs.map → fs-session-store-7E7UPLF2.cjs.map} +1 -1
  177. package/dist/generate-object-5SCEH2EE.cjs +20 -0
  178. package/dist/{generate-object-H3RNAM6S.cjs.map → generate-object-5SCEH2EE.cjs.map} +1 -1
  179. package/dist/generate-object-I7UD4NWN.js +7 -0
  180. package/dist/{generate-object-YJPDV5BS.js.map → generate-object-I7UD4NWN.js.map} +1 -1
  181. package/dist/index-manager-KKAK7NT3.js +10 -0
  182. package/dist/{index-manager-P7ZUX2RG.js.map → index-manager-KKAK7NT3.js.map} +1 -1
  183. package/dist/index-manager-R6ZJFEZF.cjs +19 -0
  184. package/dist/{index-manager-H7HUMW52.cjs.map → index-manager-R6ZJFEZF.cjs.map} +1 -1
  185. package/dist/index.cjs +124 -129
  186. package/dist/index.cjs.map +1 -1
  187. package/dist/index.d.cts +2 -1
  188. package/dist/index.d.ts +2 -1
  189. package/dist/index.js +45 -50
  190. package/dist/index.js.map +1 -1
  191. package/dist/{inject-session-SMH56NXP.cjs → inject-session-DM4SKTZO.cjs} +8 -8
  192. package/dist/{inject-session-SMH56NXP.cjs.map → inject-session-DM4SKTZO.cjs.map} +1 -1
  193. package/dist/{inject-session-V5FTK72N.js → inject-session-UXNJQTZ6.js} +6 -6
  194. package/dist/{inject-session-V5FTK72N.js.map → inject-session-UXNJQTZ6.js.map} +1 -1
  195. package/dist/internal/diagnostics.d.ts +54 -0
  196. package/dist/internal/local-agent/local-agent-invalidate.d.ts +0 -7
  197. package/dist/internal/local-agent/local-agent-lifecycle.d.ts +13 -0
  198. package/dist/internal/local-agent/local-agent.d.ts +1 -93
  199. package/dist/internal/persistence/index.cjs +25 -25
  200. package/dist/internal/persistence/index.js +6 -6
  201. package/dist/internal/persistence/sqlite-wal.d.cts +0 -9
  202. package/dist/internal/persistence/sqlite-wal.d.ts +0 -9
  203. package/dist/internal/persistence/transcript-ops.d.cts +14 -0
  204. package/dist/internal/persistence/transcript-ops.d.ts +14 -0
  205. package/dist/internal/plugins/lifecycle.d.cts +1 -0
  206. package/dist/internal/plugins/lifecycle.d.ts +1 -0
  207. package/dist/internal/runtime/fixtures/fixture-run-base.d.ts +19 -0
  208. package/dist/internal/runtime/registry/agent-registry.d.ts +0 -1
  209. package/dist/internal/security/index.cjs +13 -13
  210. package/dist/internal/security/index.js +3 -3
  211. package/dist/internal/security/redact.d.cts +0 -18
  212. package/dist/internal/security/redact.d.ts +0 -18
  213. package/dist/judge-call-SP3G3X2Y.cjs +22 -0
  214. package/dist/{judge-call-2FULQ6KL.cjs.map → judge-call-SP3G3X2Y.cjs.map} +1 -1
  215. package/dist/judge-call-TAEIXMYG.js +5 -0
  216. package/dist/{judge-call-D7R3ZTZS.js.map → judge-call-TAEIXMYG.js.map} +1 -1
  217. package/dist/models.cjs +22 -26
  218. package/dist/models.cjs.map +1 -1
  219. package/dist/models.js +13 -17
  220. package/dist/models.js.map +1 -1
  221. package/dist/path-safety.cjs +10 -10
  222. package/dist/path-safety.js +3 -3
  223. package/dist/persistence.cjs +27 -27
  224. package/dist/persistence.cjs.map +1 -1
  225. package/dist/persistence.js +8 -8
  226. package/dist/persistence.js.map +1 -1
  227. package/dist/project.cjs +5 -5
  228. package/dist/project.js +3 -3
  229. package/dist/registry-N3GTKYCI.cjs +46 -0
  230. package/dist/{registry-APYDISL6.cjs.map → registry-N3GTKYCI.cjs.map} +1 -1
  231. package/dist/registry-SOXE4RY6.js +9 -0
  232. package/dist/{registry-34IWWDQQ.js.map → registry-SOXE4RY6.js.map} +1 -1
  233. package/dist/retry.cjs +4 -4
  234. package/dist/retry.js +3 -3
  235. package/dist/sandbox/index.cjs +6 -6
  236. package/dist/sandbox/index.js +2 -2
  237. package/dist/server/errors-envelope.cjs +14 -14
  238. package/dist/server/errors-envelope.js +3 -3
  239. package/dist/session-transcript-6WKLYIN4.js +5 -0
  240. package/dist/{session-transcript-F2ANTA2M.js.map → session-transcript-6WKLYIN4.js.map} +1 -1
  241. package/dist/session-transcript-EAKR4D2W.cjs +50 -0
  242. package/dist/{session-transcript-JXFMPLOT.cjs.map → session-transcript-EAKR4D2W.cjs.map} +1 -1
  243. package/dist/skills.cjs +7 -7
  244. package/dist/skills.js +5 -5
  245. package/dist/stream-object-OFM66VUT.js +7 -0
  246. package/dist/{stream-object-WUQSSRY2.js.map → stream-object-OFM66VUT.js.map} +1 -1
  247. package/dist/stream-object-Y7YCX3BI.cjs +20 -0
  248. package/dist/{stream-object-QEQJJDTI.cjs.map → stream-object-Y7YCX3BI.cjs.map} +1 -1
  249. package/dist/subagents-loader.cjs +6 -6
  250. package/dist/subagents-loader.js +4 -4
  251. package/dist/subscription/index.cjs +3 -3
  252. package/dist/subscription/index.js +2 -2
  253. package/dist/task-store.cjs +7 -7
  254. package/dist/task-store.js +4 -4
  255. package/dist/workflow.cjs +27 -27
  256. package/dist/workflow.js +6 -6
  257. package/package.json +13 -12
  258. package/dist/agent-H6HL5ITH.js +0 -42
  259. package/dist/agent-P77NPBF4.cjs +0 -51
  260. package/dist/chunk-3XJ7CS2C.cjs.map +0 -1
  261. package/dist/chunk-6M6A6WWW.cjs.map +0 -1
  262. package/dist/chunk-77FOZCOT.js.map +0 -1
  263. package/dist/chunk-7BTE3RXJ.js.map +0 -1
  264. package/dist/chunk-ANIZEWTU.cjs.map +0 -1
  265. package/dist/chunk-BEURCLDV.cjs.map +0 -1
  266. package/dist/chunk-BXV2QUIC.js.map +0 -1
  267. package/dist/chunk-CJVMDRQB.cjs.map +0 -1
  268. package/dist/chunk-D42XHI4O.cjs.map +0 -1
  269. package/dist/chunk-EKFA76N4.js.map +0 -1
  270. package/dist/chunk-G4WI3VW2.cjs.map +0 -1
  271. package/dist/chunk-HRA3CPGG.js.map +0 -1
  272. package/dist/chunk-IX2LKBCD.js.map +0 -1
  273. package/dist/chunk-JD74LN7R.cjs.map +0 -1
  274. package/dist/chunk-JTFYYKDT.js.map +0 -1
  275. package/dist/chunk-KAP4GJHO.js.map +0 -1
  276. package/dist/chunk-MZ5ZRORA.cjs.map +0 -1
  277. package/dist/chunk-N24XBYNX.cjs.map +0 -1
  278. package/dist/chunk-S2BBRVQX.js.map +0 -1
  279. package/dist/chunk-TIZ4TS5V.cjs.map +0 -1
  280. package/dist/chunk-UAYYNWYJ.js.map +0 -1
  281. package/dist/chunk-WEHUJ7ZS.cjs.map +0 -1
  282. package/dist/chunk-XIG2IE3L.js.map +0 -1
  283. package/dist/chunk-XV2RBL6D.js.map +0 -1
  284. package/dist/compact-session-5BDD4HIB.js +0 -17
  285. package/dist/compact-session-BEA3IOON.cjs +0 -54
  286. package/dist/context-GWANQLX4.js +0 -5
  287. package/dist/context-KNWVTZSY.cjs +0 -22
  288. package/dist/fs-session-store-4ALCDU3K.js +0 -10
  289. package/dist/fs-session-store-IQYE35HX.cjs +0 -19
  290. package/dist/generate-object-H3RNAM6S.cjs +0 -20
  291. package/dist/generate-object-YJPDV5BS.js +0 -7
  292. package/dist/index-manager-H7HUMW52.cjs +0 -19
  293. package/dist/index-manager-P7ZUX2RG.js +0 -10
  294. package/dist/judge-call-2FULQ6KL.cjs +0 -22
  295. package/dist/judge-call-D7R3ZTZS.js +0 -5
  296. package/dist/registry-34IWWDQQ.js +0 -9
  297. package/dist/registry-APYDISL6.cjs +0 -46
  298. package/dist/session-transcript-F2ANTA2M.js +0 -5
  299. package/dist/session-transcript-JXFMPLOT.cjs +0 -50
  300. package/dist/stream-object-QEQJJDTI.cjs +0 -20
  301. package/dist/stream-object-WUQSSRY2.js +0 -7
@@ -1,11 +1,11 @@
1
- import { currentCredentialPool, computeBackoffMs, sleepWithAbort, newPooledCredential, CredentialPool } from './chunk-6CLRANZA.js';
1
+ import { currentCredentialPool, computeBackoffMs, sleepWithAbort, newPooledCredential, CredentialPool } from './chunk-EXQV452X.js';
2
2
  import { invalidateSessionCache } from './chunk-EEZ7CFMM.js';
3
3
  import { tryJson, isPlainObject, sanitizeToolInput } from './chunk-U54XCYG3.js';
4
- import { reconstructMessages, SessionTranscript } from './chunk-Q56IYTBZ.js';
5
- import { estimateTokens } from './chunk-RKG6QFCJ.js';
6
- import { globalSingleton, registerProvider, registerBuiltins, getProviderProfile, inferModelDialect, inferRegionFromModelId, stripBedrockPrefix, resolveBedrockBaseUrl, resolveVertexBaseUrl, stripVertexPrefix } from './chunk-KAP4GJHO.js';
7
- import { NetworkError, AuthenticationError, RateLimitError, ConfigurationError, UnknownAgentError, CredentialPoolExhaustedError, isTransientError, TheokitAgentError } from './chunk-WLKFWQSJ.js';
8
- import { redactSecrets } from './chunk-JTFYYKDT.js';
4
+ import { reconstructMessages, SessionTranscript } from './chunk-XAEAMI5H.js';
5
+ import { estimateTokens } from './chunk-6VP3XGEK.js';
6
+ import { globalSingleton, registerProvider, registerBuiltins, getProviderProfile, inferModelDialect, inferRegionFromModelId, stripBedrockPrefix, resolveBedrockBaseUrl, resolveVertexBaseUrl, stripVertexPrefix } from './chunk-77WHPVXE.js';
7
+ import { NetworkError, AuthenticationError, RateLimitError, ConfigurationError, UnknownAgentError, IntegrationNotConnectedError, CredentialPoolExhaustedError, isTransientError, TheokitAgentError } from './chunk-CD73YHEH.js';
8
+ import { diag, redactSecrets } from './chunk-TAPQWDW2.js';
9
9
  import { existsSync, readFileSync } from 'fs';
10
10
  import { readdir } from 'fs/promises';
11
11
  import { homedir } from 'os';
@@ -35,19 +35,19 @@ function loadTrustedNames() {
35
35
  else discarded += 1;
36
36
  }
37
37
  if (discarded > 0) {
38
- process.stderr.write(
38
+ diag(
39
39
  `[theokit-sdk] WARN: ${path} contains ${discarded} non-string entr${discarded === 1 ? "y" : "ies"} \u2014 discarded (entries must be plugin-name strings)
40
40
  `
41
41
  );
42
42
  }
43
43
  } else {
44
- process.stderr.write(
44
+ diag(
45
45
  `[theokit-sdk] WARN: ${path} is not a JSON array \u2014 trusting NO provider plugins (fail-closed)
46
46
  `
47
47
  );
48
48
  }
49
49
  } catch {
50
- process.stderr.write(
50
+ diag(
51
51
  `[theokit-sdk] WARN: ${path} is not valid JSON \u2014 trusting NO provider plugins (fail-closed)
52
52
  `
53
53
  );
@@ -73,7 +73,7 @@ async function discoverProviderPlugins() {
73
73
  const trusted = loadTrustedNames();
74
74
  for (const entry of entries) {
75
75
  if (!trusted.has(entry)) {
76
- process.stderr.write(
76
+ diag(
77
77
  `[theokit-sdk] WARN: provider plugin "${entry}" is present but NOT trusted \u2014 skipped. To trust it, add "${entry}" to ${trustFilePath()} (JSON array of names) or THEOKIT_TRUSTED_PROVIDERS (comma-separated), then restart the process.
78
78
  `
79
79
  );
@@ -98,7 +98,7 @@ async function loadOne(dir, entryName) {
98
98
  return;
99
99
  } catch (err) {
100
100
  const msg = err instanceof Error ? err.message : String(err);
101
- process.stderr.write(`[theokit-sdk] failed to load provider plugin "${entryName}": ${msg}
101
+ diag(`[theokit-sdk] failed to load provider plugin "${entryName}": ${msg}
102
102
  `);
103
103
  return;
104
104
  }
@@ -926,7 +926,7 @@ function parseOverrideOrWarnOnce() {
926
926
  function warnInvalidJsonOnce(_raw) {
927
927
  if (warnedInvalidJson) return;
928
928
  warnedInvalidJson = true;
929
- process.stderr.write(
929
+ diag(
930
930
  `[theokit-sdk] ${ENV_OVERRIDE_KEY} is set but value is not valid JSON of shape \`{"status": number, "body": object | string}\`. Falling back to real LLM call. This warning is shown once per process.
931
931
  `
932
932
  );
@@ -1263,6 +1263,156 @@ function toOllamaTools(tools) {
1263
1263
  }
1264
1264
  }));
1265
1265
  }
1266
+ var FIXTURE_API_KEY_PREFIX = "theo_test_";
1267
+ function isFixtureApiKey(apiKey) {
1268
+ if (apiKey === void 0) return false;
1269
+ return apiKey.startsWith(FIXTURE_API_KEY_PREFIX);
1270
+ }
1271
+ function getConfiguredBaseUrl() {
1272
+ const value = process.env.THEOKIT_API_BASE_URL;
1273
+ if (value === void 0 || value.length === 0) return void 0;
1274
+ return value;
1275
+ }
1276
+ function shouldUseFixtureMode(apiKey) {
1277
+ if (getConfiguredBaseUrl() !== void 0) return false;
1278
+ return isFixtureApiKey(apiKey);
1279
+ }
1280
+ function shouldUseRealLocalRuntime(apiKey) {
1281
+ if (isFixtureApiKey(apiKey)) return false;
1282
+ if (apiKey === void 0 || apiKey.length === 0) return false;
1283
+ return typeof process.env.ANTHROPIC_API_KEY === "string" && process.env.ANTHROPIC_API_KEY.length > 0 || typeof process.env.OPENAI_API_KEY === "string" && process.env.OPENAI_API_KEY.length > 0 || typeof process.env.OPENROUTER_API_KEY === "string" && process.env.OPENROUTER_API_KEY.length > 0 || isAwsBedrockAuthAvailable() || isGcpVertexAuthAvailable() || isLocalNoAuthProviderAvailable();
1284
+ }
1285
+ function isAwsBedrockAuthAvailable() {
1286
+ if (typeof process.env.AWS_BEARER_TOKEN_BEDROCK === "string" && process.env.AWS_BEARER_TOKEN_BEDROCK.length > 0) {
1287
+ return true;
1288
+ }
1289
+ if (typeof process.env.AWS_ACCESS_KEY_ID === "string" && process.env.AWS_ACCESS_KEY_ID.length > 0) {
1290
+ return true;
1291
+ }
1292
+ if (typeof process.env.AWS_PROFILE === "string" && process.env.AWS_PROFILE.length > 0) {
1293
+ return true;
1294
+ }
1295
+ return awsCredentialsFileExists();
1296
+ }
1297
+ function awsCredentialsFileExists() {
1298
+ try {
1299
+ const home = process.env.HOME ?? process.env.USERPROFILE;
1300
+ if (home === void 0 || home.length === 0) return false;
1301
+ return existsSync(`${home}/.aws/credentials`) || existsSync(`${home}/.aws/config`);
1302
+ } catch {
1303
+ return false;
1304
+ }
1305
+ }
1306
+ function isGcpVertexAuthAvailable() {
1307
+ if (typeof process.env.GOOGLE_APPLICATION_CREDENTIALS === "string" && process.env.GOOGLE_APPLICATION_CREDENTIALS.length > 0) {
1308
+ return true;
1309
+ }
1310
+ if (typeof process.env.GOOGLE_CLOUD_PROJECT === "string" && process.env.GOOGLE_CLOUD_PROJECT.length > 0) {
1311
+ return true;
1312
+ }
1313
+ return false;
1314
+ }
1315
+ function isLocalNoAuthProviderAvailable() {
1316
+ return true;
1317
+ }
1318
+
1319
+ // src/internal/http.ts
1320
+ var DEFAULT_BASE_URL = "https://api.usetheo.dev";
1321
+ function resolveBaseUrl() {
1322
+ return getConfiguredBaseUrl() ?? DEFAULT_BASE_URL;
1323
+ }
1324
+ async function httpRequest(path, options) {
1325
+ const url = `${resolveBaseUrl()}${path}`;
1326
+ const fetchFn = options.fetchFn ?? globalThis.fetch;
1327
+ const headers = {
1328
+ "content-type": "application/json",
1329
+ authorization: `Bearer ${options.apiKey}`,
1330
+ ...options.headers ?? {}
1331
+ };
1332
+ const body = options.body !== void 0 ? JSON.stringify(options.body) : void 0;
1333
+ const response = await safeFetch(fetchFn, url, {
1334
+ method: options.method ?? "GET",
1335
+ headers,
1336
+ body
1337
+ });
1338
+ if (!response.ok) {
1339
+ const parsed = await safeParseJsonResponse(response);
1340
+ throw mapHttpStatusToError(response.status, parsed);
1341
+ }
1342
+ return await safeParseJsonResponse(response);
1343
+ }
1344
+ async function safeFetch(fetchFn, url, init) {
1345
+ try {
1346
+ return await fetchFn(url, init);
1347
+ } catch (cause) {
1348
+ throw new NetworkError("HTTP request failed", { code: "network_error", cause });
1349
+ }
1350
+ }
1351
+ async function safeParseJsonResponse(response) {
1352
+ try {
1353
+ return await response.json();
1354
+ } catch {
1355
+ return void 0;
1356
+ }
1357
+ }
1358
+ async function readErrorResponseBody(response) {
1359
+ const text = await response.text().catch(() => "");
1360
+ try {
1361
+ return JSON.parse(text);
1362
+ } catch {
1363
+ return text;
1364
+ }
1365
+ }
1366
+ function mapHttpStatusToError(status, body) {
1367
+ const envelope = extractErrorEnvelope(body);
1368
+ const message = envelope.message ?? `HTTP ${status}`;
1369
+ const errorOptions = {
1370
+ code: envelope.code,
1371
+ protoErrorCode: envelope.protoErrorCode,
1372
+ cause: body
1373
+ };
1374
+ if (envelope.code === "integration_not_connected") {
1375
+ return new IntegrationNotConnectedError(message, {
1376
+ provider: envelope.provider ?? "unknown",
1377
+ helpUrl: envelope.helpUrl ?? "",
1378
+ code: envelope.code,
1379
+ cause: body
1380
+ });
1381
+ }
1382
+ if (status === 401 || status === 403) {
1383
+ return new AuthenticationError(message, errorOptions);
1384
+ }
1385
+ if (status === 429) {
1386
+ return new RateLimitError(message, errorOptions);
1387
+ }
1388
+ if (status >= 400 && status < 500) {
1389
+ return new ConfigurationError(message, errorOptions);
1390
+ }
1391
+ if (status >= 500) {
1392
+ return new NetworkError(message, errorOptions);
1393
+ }
1394
+ return new UnknownAgentError(message, errorOptions);
1395
+ }
1396
+ function extractErrorEnvelope(body) {
1397
+ if (!body || typeof body !== "object") return {};
1398
+ const record = body;
1399
+ const inner = record.error;
1400
+ const source = inner && typeof inner === "object" ? inner : record;
1401
+ return readEnvelopeFields(source);
1402
+ }
1403
+ function readEnvelopeFields(record) {
1404
+ return {
1405
+ code: pickString(record, "code"),
1406
+ message: pickString(record, "message"),
1407
+ protoErrorCode: pickString(record, "protoErrorCode"),
1408
+ provider: pickString(record, "provider"),
1409
+ helpUrl: pickString(record, "helpUrl")
1410
+ };
1411
+ }
1412
+ function pickString(record, key) {
1413
+ const value = record[key];
1414
+ return typeof value === "string" ? value : void 0;
1415
+ }
1266
1416
 
1267
1417
  // src/internal/llm/hermes-tool-extract.ts
1268
1418
  var HERMES_BLOCK = /<function=\s*([^>\s]+)\s*>([\s\S]*?)<\/tool_call>/g;
@@ -1486,12 +1636,7 @@ var OpenAIClient = class {
1486
1636
  throw wrapTransportError(fetchErr, { providerId, endpoint: "/v1/chat/completions" });
1487
1637
  }
1488
1638
  if (!response.ok) {
1489
- const text = await response.text().catch(() => "");
1490
- let body = text;
1491
- try {
1492
- body = JSON.parse(text);
1493
- } catch {
1494
- }
1639
+ const body = await readErrorResponseBody(response);
1495
1640
  const ollamaMapped = mapOllamaHttpError({
1496
1641
  providerId,
1497
1642
  status: response.status,
@@ -1673,13 +1818,13 @@ var OpenAIStreamAccumulator = class {
1673
1818
  toolCalls.push(...recovered.toolCalls);
1674
1819
  text = recovered.residualText;
1675
1820
  stopReason = "tool_use";
1676
- process.stderr.write(
1821
+ diag(
1677
1822
  `[theokit-sdk] recovered ${recovered.toolCalls.length} leaked tool call(s) from assistant content (provider="${this.providerName}", names=${recovered.toolCalls.map((c) => c.name).join(",")})
1678
1823
  `
1679
1824
  );
1680
1825
  }
1681
1826
  if (recovered.droppedNames.length > 0) {
1682
- process.stderr.write(
1827
+ diag(
1683
1828
  `[theokit-sdk] dropped ${recovered.droppedNames.length} leaked block(s) whose name is not a tool in the request (provider="${this.providerName}", names=${recovered.droppedNames.join(",")})
1684
1829
  `
1685
1830
  );
@@ -1804,10 +1949,8 @@ async function tryFirstEvent(client, request, signal, logFallback = false) {
1804
1949
  if (cause instanceof NetworkError || cause instanceof RateLimitError || cause instanceof AuthenticationError) {
1805
1950
  if (logFallback) {
1806
1951
  const errCode = cause.metadata?.code ?? cause.code ?? "unknown";
1807
- process.stderr.write(
1808
- `[theokit-sdk] provider ${client.name} failed (${errCode}): falling back
1809
- `
1810
- );
1952
+ diag(`[theokit-sdk] provider ${client.name} failed (${errCode}): falling back
1953
+ `);
1811
1954
  }
1812
1955
  return { kind: "handshake_error", error: cause };
1813
1956
  }
@@ -1899,7 +2042,7 @@ var PoolAwareLlmClient = class {
1899
2042
  ...parseRetryAfterMs(attempt.error) !== void 0 ? { resetAtMs: parseRetryAfterMs(attempt.error) } : {}
1900
2043
  });
1901
2044
  } catch (persistErr) {
1902
- process.stderr.write(
2045
+ diag(
1903
2046
  `[theokit-sdk] credential-pool: persist failed during rotate; continuing in-memory: ${persistErr instanceof Error ? persistErr.message : String(persistErr)}
1904
2047
  `
1905
2048
  );
@@ -2322,7 +2465,7 @@ async function getAuthClientOrThrow() {
2322
2465
  const auth = new mod.GoogleAuth({ scopes: [SCOPE_CLOUD_PLATFORM] });
2323
2466
  return await auth.getClient();
2324
2467
  } catch (err) {
2325
- process.stderr.write(
2468
+ diag(
2326
2469
  `[theokit-sdk] Vertex ADC initialization failed: ${err instanceof Error ? err.message : String(err)}
2327
2470
  `
2328
2471
  );
@@ -2551,7 +2694,7 @@ var warnedNoAuthApiKeys = /* @__PURE__ */ new Set();
2551
2694
  function warnNoAuthApiKeysIgnoredOnce(provider) {
2552
2695
  if (warnedNoAuthApiKeys.has(provider)) return;
2553
2696
  warnedNoAuthApiKeys.add(provider);
2554
- process.stderr.write(
2697
+ diag(
2555
2698
  `[theokit-sdk] provider "${provider}" has authType: "none" \u2014 apiKeys ignored (no auth required for local runtime).
2556
2699
  `
2557
2700
  );
@@ -2580,7 +2723,7 @@ function warnUnknownProvidersInApiKeys(apiKeys) {
2580
2723
  const profile = getProviderProfile(name);
2581
2724
  if (profile === void 0) {
2582
2725
  warnedProviders.add(name);
2583
- process.stderr.write(
2726
+ diag(
2584
2727
  `[theokit-sdk] credential-pool: unknown provider "${name}" in apiKeys (no profile registered)
2585
2728
  `
2586
2729
  );
@@ -2939,14 +3082,12 @@ async function autoCompactIfNeeded(opts) {
2939
3082
  return true;
2940
3083
  } catch (cause) {
2941
3084
  const msg = cause instanceof Error ? cause.message : String(cause);
2942
- process.stderr.write(
2943
- `[theokit-sdk] auto-compaction failed (left transcript untouched): ${msg}
2944
- `
2945
- );
3085
+ diag(`[theokit-sdk] auto-compaction failed (left transcript untouched): ${msg}
3086
+ `);
2946
3087
  return false;
2947
3088
  }
2948
3089
  }
2949
3090
 
2950
- export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, CircuitBreaker, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, detectPrimaryProvider, discoverProviderPlugins, inferProviderFromApiKey, isCompactSummary, mapOllamaHttpError, mapOllamaTransportError, mapOpenAICompatibleError, parseSseStream, relayStream, renderToolResultContentText, resolveProviderChain, resolveSummarizerRoute, shouldAutoCompact, tryFirstEvent };
2951
- //# sourceMappingURL=chunk-IX2LKBCD.js.map
2952
- //# sourceMappingURL=chunk-IX2LKBCD.js.map
3091
+ export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, CircuitBreaker, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, detectPrimaryProvider, discoverProviderPlugins, getConfiguredBaseUrl, httpRequest, inferProviderFromApiKey, isCompactSummary, isFixtureApiKey, mapOllamaHttpError, mapOllamaTransportError, mapOpenAICompatibleError, parseSseStream, readErrorResponseBody, relayStream, renderToolResultContentText, resolveProviderChain, resolveSummarizerRoute, shouldAutoCompact, shouldUseFixtureMode, shouldUseRealLocalRuntime, tryFirstEvent };
3092
+ //# sourceMappingURL=chunk-GL7CFBVC.js.map
3093
+ //# sourceMappingURL=chunk-GL7CFBVC.js.map