@theokit/sdk 5.7.0 → 5.9.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 (355) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/a2a/index.cjs +6 -6
  3. package/dist/a2a/index.js +2 -2
  4. package/dist/agent-6STOEBGQ.js +59 -0
  5. package/dist/{agent-EQ5HKTWV.js.map → agent-6STOEBGQ.js.map} +1 -1
  6. package/dist/{agent-Dya5SmhY.d.cts → agent-Dh2YHSLj.d.cts} +33 -3
  7. package/dist/agent-ZM4FDDL7.cjs +68 -0
  8. package/dist/{agent-KA63WDQH.cjs.map → agent-ZM4FDDL7.cjs.map} +1 -1
  9. package/dist/{agent-Bqzdhkqr.d.ts → agent-enXXu447.d.ts} +33 -3
  10. package/dist/auth/index.cjs +32 -32
  11. package/dist/auth/index.js +5 -5
  12. package/dist/{batch-US4F6WPK.js → batch-427O54FQ.js} +7 -7
  13. package/dist/{batch-US4F6WPK.js.map → batch-427O54FQ.js.map} +1 -1
  14. package/dist/{batch-I6T6MXZO.cjs → batch-U4SO4RLX.cjs} +24 -24
  15. package/dist/{batch-I6T6MXZO.cjs.map → batch-U4SO4RLX.cjs.map} +1 -1
  16. package/dist/{chunk-44I6UYVH.js → chunk-26NEAJ6T.js} +4 -4
  17. package/dist/{chunk-44I6UYVH.js.map → chunk-26NEAJ6T.js.map} +1 -1
  18. package/dist/{chunk-A6PDYH55.js → chunk-4QCJAJAG.js} +2 -2
  19. package/dist/chunk-4QCJAJAG.js.map +1 -0
  20. package/dist/{chunk-XYFGKVZ7.js → chunk-53RDNK3H.js} +3 -3
  21. package/dist/{chunk-XYFGKVZ7.js.map → chunk-53RDNK3H.js.map} +1 -1
  22. package/dist/{chunk-CZWN4C6A.js → chunk-5522X223.js} +3 -3
  23. package/dist/{chunk-CZWN4C6A.js.map → chunk-5522X223.js.map} +1 -1
  24. package/dist/{chunk-EH6XD3FY.js → chunk-5DD4NJN3.js} +3 -3
  25. package/dist/{chunk-EH6XD3FY.js.map → chunk-5DD4NJN3.js.map} +1 -1
  26. package/dist/{chunk-V22DZIXO.js → chunk-5Q4RTLMP.js} +3 -3
  27. package/dist/{chunk-V22DZIXO.js.map → chunk-5Q4RTLMP.js.map} +1 -1
  28. package/dist/{chunk-ER5BOIYD.cjs → chunk-5WR33BHA.cjs} +22 -22
  29. package/dist/{chunk-ER5BOIYD.cjs.map → chunk-5WR33BHA.cjs.map} +1 -1
  30. package/dist/{chunk-4A3SKJ53.cjs → chunk-6PB5AQCY.cjs} +14 -14
  31. package/dist/{chunk-4A3SKJ53.cjs.map → chunk-6PB5AQCY.cjs.map} +1 -1
  32. package/dist/{chunk-PRZ3BES7.cjs → chunk-72CPLZPC.cjs} +5 -5
  33. package/dist/{chunk-PRZ3BES7.cjs.map → chunk-72CPLZPC.cjs.map} +1 -1
  34. package/dist/{chunk-HNAYCTX4.cjs → chunk-76PIKR4P.cjs} +22 -22
  35. package/dist/{chunk-HNAYCTX4.cjs.map → chunk-76PIKR4P.cjs.map} +1 -1
  36. package/dist/{chunk-EFMFILPG.js → chunk-7F7XE6CM.js} +3 -3
  37. package/dist/{chunk-EFMFILPG.js.map → chunk-7F7XE6CM.js.map} +1 -1
  38. package/dist/{chunk-7C3HWGCW.js → chunk-7GDHFV2M.js} +3 -3
  39. package/dist/{chunk-7C3HWGCW.js.map → chunk-7GDHFV2M.js.map} +1 -1
  40. package/dist/{chunk-CA5VUAP3.js → chunk-7HUCU3KK.js} +5 -5
  41. package/dist/{chunk-CA5VUAP3.js.map → chunk-7HUCU3KK.js.map} +1 -1
  42. package/dist/{chunk-4MMWFSCD.js → chunk-7JAKO3NM.js} +3 -3
  43. package/dist/{chunk-4MMWFSCD.js.map → chunk-7JAKO3NM.js.map} +1 -1
  44. package/dist/{chunk-UADQJBHR.cjs → chunk-7NQ7HJ3E.cjs} +6 -6
  45. package/dist/{chunk-UADQJBHR.cjs.map → chunk-7NQ7HJ3E.cjs.map} +1 -1
  46. package/dist/{chunk-ZLMU5EU3.cjs → chunk-ARMFXTY6.cjs} +114 -190
  47. package/dist/chunk-ARMFXTY6.cjs.map +1 -0
  48. package/dist/{chunk-5WKQDIGO.js → chunk-AY43232P.js} +4 -4
  49. package/dist/{chunk-5WKQDIGO.js.map → chunk-AY43232P.js.map} +1 -1
  50. package/dist/{chunk-7FDKWDA2.cjs → chunk-B3XXQX6L.cjs} +7 -7
  51. package/dist/{chunk-7FDKWDA2.cjs.map → chunk-B3XXQX6L.cjs.map} +1 -1
  52. package/dist/{chunk-ALUN2B4W.js → chunk-B5MHRQJZ.js} +9 -3
  53. package/dist/chunk-B5MHRQJZ.js.map +1 -0
  54. package/dist/{chunk-TA3K7SBK.js → chunk-BKMDRBJ7.js} +3 -3
  55. package/dist/{chunk-TA3K7SBK.js.map → chunk-BKMDRBJ7.js.map} +1 -1
  56. package/dist/{chunk-A575WPBL.cjs → chunk-BM6PDJW3.cjs} +260 -260
  57. package/dist/{chunk-A575WPBL.cjs.map → chunk-BM6PDJW3.cjs.map} +1 -1
  58. package/dist/{chunk-RWPLWMCZ.cjs → chunk-C7GKRGKN.cjs} +42 -21
  59. package/dist/chunk-C7GKRGKN.cjs.map +1 -0
  60. package/dist/{chunk-FUSDYC2B.cjs → chunk-CQYBJOB2.cjs} +4 -4
  61. package/dist/{chunk-FUSDYC2B.cjs.map → chunk-CQYBJOB2.cjs.map} +1 -1
  62. package/dist/{chunk-7JJ3A6AT.cjs → chunk-D5KXKBEN.cjs} +5 -5
  63. package/dist/{chunk-7JJ3A6AT.cjs.map → chunk-D5KXKBEN.cjs.map} +1 -1
  64. package/dist/{chunk-3VXQEQE4.js → chunk-DDRX4LYS.js} +4 -4
  65. package/dist/{chunk-3VXQEQE4.js.map → chunk-DDRX4LYS.js.map} +1 -1
  66. package/dist/{chunk-QDM3OHUT.cjs → chunk-ECD6ER3E.cjs} +4 -4
  67. package/dist/{chunk-QDM3OHUT.cjs.map → chunk-ECD6ER3E.cjs.map} +1 -1
  68. package/dist/{chunk-JMDDYA22.js → chunk-EJROML3Q.js} +4 -4
  69. package/dist/{chunk-JMDDYA22.js.map → chunk-EJROML3Q.js.map} +1 -1
  70. package/dist/{chunk-EIQFAOFD.js → chunk-GGRPAQ3B.js} +3 -3
  71. package/dist/{chunk-EIQFAOFD.js.map → chunk-GGRPAQ3B.js.map} +1 -1
  72. package/dist/{chunk-HCT4HPCL.cjs → chunk-GHHIJEFX.cjs} +4 -4
  73. package/dist/{chunk-HCT4HPCL.cjs.map → chunk-GHHIJEFX.cjs.map} +1 -1
  74. package/dist/{chunk-7A6535RA.cjs → chunk-GM54F4FE.cjs} +9 -9
  75. package/dist/{chunk-7A6535RA.cjs.map → chunk-GM54F4FE.cjs.map} +1 -1
  76. package/dist/{chunk-6M2OIS4Y.js → chunk-GMRFAX4I.js} +74 -4
  77. package/dist/chunk-GMRFAX4I.js.map +1 -0
  78. package/dist/{chunk-O6USDERH.js → chunk-GMSRRJ53.js} +3 -3
  79. package/dist/{chunk-O6USDERH.js.map → chunk-GMSRRJ53.js.map} +1 -1
  80. package/dist/{chunk-VE6DFSKU.js → chunk-GTX6FEDP.js} +3 -3
  81. package/dist/{chunk-VE6DFSKU.js.map → chunk-GTX6FEDP.js.map} +1 -1
  82. package/dist/{chunk-NJWYQWDL.js → chunk-H3CVJSFC.js} +3 -3
  83. package/dist/{chunk-NJWYQWDL.js.map → chunk-H3CVJSFC.js.map} +1 -1
  84. package/dist/{chunk-MYJGWS2J.cjs → chunk-HG5LKFG7.cjs} +16 -16
  85. package/dist/{chunk-MYJGWS2J.cjs.map → chunk-HG5LKFG7.cjs.map} +1 -1
  86. package/dist/{chunk-55GB6JYQ.js → chunk-HOHR75KF.js} +5 -5
  87. package/dist/{chunk-55GB6JYQ.js.map → chunk-HOHR75KF.js.map} +1 -1
  88. package/dist/{chunk-GBCVPKHE.js → chunk-HV4V63CO.js} +3 -3
  89. package/dist/{chunk-GBCVPKHE.js.map → chunk-HV4V63CO.js.map} +1 -1
  90. package/dist/{chunk-I2PWY7VM.cjs → chunk-IIYJMXYW.cjs} +4 -4
  91. package/dist/{chunk-I2PWY7VM.cjs.map → chunk-IIYJMXYW.cjs.map} +1 -1
  92. package/dist/{chunk-YYN6BB7R.cjs → chunk-J4SA2ZEJ.cjs} +4 -4
  93. package/dist/{chunk-YYN6BB7R.cjs.map → chunk-J4SA2ZEJ.cjs.map} +1 -1
  94. package/dist/{chunk-ATT276RD.cjs → chunk-J5623RIV.cjs} +78 -6
  95. package/dist/chunk-J5623RIV.cjs.map +1 -0
  96. package/dist/{chunk-KVSAY6NZ.cjs → chunk-J6GXS5A2.cjs} +13 -13
  97. package/dist/{chunk-KVSAY6NZ.cjs.map → chunk-J6GXS5A2.cjs.map} +1 -1
  98. package/dist/{chunk-NQTD6QOW.cjs → chunk-JW3GVLM6.cjs} +4 -4
  99. package/dist/{chunk-NQTD6QOW.cjs.map → chunk-JW3GVLM6.cjs.map} +1 -1
  100. package/dist/{chunk-TFG5IBZS.cjs → chunk-KGZ66JVZ.cjs} +14 -14
  101. package/dist/{chunk-TFG5IBZS.cjs.map → chunk-KGZ66JVZ.cjs.map} +1 -1
  102. package/dist/{chunk-47TF32NQ.js → chunk-KO6SHCEH.js} +3 -3
  103. package/dist/{chunk-47TF32NQ.js.map → chunk-KO6SHCEH.js.map} +1 -1
  104. package/dist/{chunk-EFETPSJZ.cjs → chunk-KTA7YTZQ.cjs} +12 -12
  105. package/dist/{chunk-EFETPSJZ.cjs.map → chunk-KTA7YTZQ.cjs.map} +1 -1
  106. package/dist/{chunk-D6POWE7E.cjs → chunk-MEUBLCM4.cjs} +11 -11
  107. package/dist/{chunk-D6POWE7E.cjs.map → chunk-MEUBLCM4.cjs.map} +1 -1
  108. package/dist/{chunk-VWUXIVEI.js → chunk-MFZODA5Y.js} +5 -5
  109. package/dist/{chunk-VWUXIVEI.js.map → chunk-MFZODA5Y.js.map} +1 -1
  110. package/dist/{chunk-4HS6FFGL.cjs → chunk-MPQJE3G4.cjs} +15 -15
  111. package/dist/{chunk-4HS6FFGL.cjs.map → chunk-MPQJE3G4.cjs.map} +1 -1
  112. package/dist/{chunk-QRVS2PRE.cjs → chunk-MPR2ISL2.cjs} +4 -4
  113. package/dist/{chunk-QRVS2PRE.cjs.map → chunk-MPR2ISL2.cjs.map} +1 -1
  114. package/dist/{chunk-UOLBAPDM.js → chunk-MQGSOKR3.js} +3 -3
  115. package/dist/{chunk-UOLBAPDM.js.map → chunk-MQGSOKR3.js.map} +1 -1
  116. package/dist/{chunk-HFEJE7AC.js → chunk-MU7IAA7G.js} +9 -9
  117. package/dist/{chunk-HFEJE7AC.js.map → chunk-MU7IAA7G.js.map} +1 -1
  118. package/dist/{chunk-EXTRW7GW.cjs → chunk-NAGPKWOD.cjs} +4 -4
  119. package/dist/{chunk-EXTRW7GW.cjs.map → chunk-NAGPKWOD.cjs.map} +1 -1
  120. package/dist/{chunk-KTTHHYEW.cjs → chunk-NJSIAJEK.cjs} +4 -4
  121. package/dist/{chunk-KTTHHYEW.cjs.map → chunk-NJSIAJEK.cjs.map} +1 -1
  122. package/dist/{chunk-Z3NTRKIC.cjs → chunk-NKIQTLFA.cjs} +4 -4
  123. package/dist/{chunk-Z3NTRKIC.cjs.map → chunk-NKIQTLFA.cjs.map} +1 -1
  124. package/dist/{chunk-N7VAE6DZ.js → chunk-NOO6GZTZ.js} +8 -84
  125. package/dist/chunk-NOO6GZTZ.js.map +1 -0
  126. package/dist/{chunk-GK3UG7YQ.cjs → chunk-OCEQ6DW2.cjs} +10 -10
  127. package/dist/{chunk-GK3UG7YQ.cjs.map → chunk-OCEQ6DW2.cjs.map} +1 -1
  128. package/dist/{chunk-BJUJT5ED.cjs → chunk-OF2CLCTH.cjs} +4 -4
  129. package/dist/{chunk-BJUJT5ED.cjs.map → chunk-OF2CLCTH.cjs.map} +1 -1
  130. package/dist/{chunk-HUFSABUZ.cjs → chunk-OLSEWLK5.cjs} +6 -6
  131. package/dist/{chunk-HUFSABUZ.cjs.map → chunk-OLSEWLK5.cjs.map} +1 -1
  132. package/dist/{chunk-DQZU7JK6.cjs → chunk-P22BZE7G.cjs} +4 -4
  133. package/dist/{chunk-DQZU7JK6.cjs.map → chunk-P22BZE7G.cjs.map} +1 -1
  134. package/dist/{chunk-QWD3CZWE.cjs → chunk-P7NNKEWO.cjs} +4 -4
  135. package/dist/{chunk-QWD3CZWE.cjs.map → chunk-P7NNKEWO.cjs.map} +1 -1
  136. package/dist/{chunk-DQNI52VV.js → chunk-PQCTDMUI.js} +3 -3
  137. package/dist/{chunk-DQNI52VV.js.map → chunk-PQCTDMUI.js.map} +1 -1
  138. package/dist/{chunk-3XSWF5AP.cjs → chunk-PSLCVSCS.cjs} +3 -3
  139. package/dist/{chunk-3XSWF5AP.cjs.map → chunk-PSLCVSCS.cjs.map} +1 -1
  140. package/dist/{chunk-FUUSIT2T.js → chunk-PYFBS6OQ.js} +34 -34
  141. package/dist/{chunk-FUUSIT2T.js.map → chunk-PYFBS6OQ.js.map} +1 -1
  142. package/dist/{chunk-YRLI5DVC.js → chunk-QDQQYRJI.js} +4 -4
  143. package/dist/{chunk-YRLI5DVC.js.map → chunk-QDQQYRJI.js.map} +1 -1
  144. package/dist/{chunk-P5S3WCSZ.js → chunk-R2C3HXR3.js} +4 -4
  145. package/dist/{chunk-P5S3WCSZ.js.map → chunk-R2C3HXR3.js.map} +1 -1
  146. package/dist/chunk-R3ZQBPA5.cjs +18 -0
  147. package/dist/{chunk-ANMJJD6D.cjs.map → chunk-R3ZQBPA5.cjs.map} +1 -1
  148. package/dist/{chunk-4NLCWGH7.cjs → chunk-RA7IE4NK.cjs} +15 -15
  149. package/dist/{chunk-4NLCWGH7.cjs.map → chunk-RA7IE4NK.cjs.map} +1 -1
  150. package/dist/{chunk-UBR5PWD7.js → chunk-SUVCHX4L.js} +3 -3
  151. package/dist/{chunk-UBR5PWD7.js.map → chunk-SUVCHX4L.js.map} +1 -1
  152. package/dist/{chunk-7KBNBPFK.cjs → chunk-SWALPLFQ.cjs} +2 -2
  153. package/dist/chunk-SWALPLFQ.cjs.map +1 -0
  154. package/dist/{chunk-E6QXZZKE.cjs → chunk-T5KOSR5Y.cjs} +11 -11
  155. package/dist/{chunk-E6QXZZKE.cjs.map → chunk-T5KOSR5Y.cjs.map} +1 -1
  156. package/dist/{chunk-R3LBRQAN.js → chunk-TC4RWP3Y.js} +6 -6
  157. package/dist/{chunk-R3LBRQAN.js.map → chunk-TC4RWP3Y.js.map} +1 -1
  158. package/dist/{chunk-XB4GI5RZ.js → chunk-TE6XVTOA.js} +3 -3
  159. package/dist/{chunk-XB4GI5RZ.js.map → chunk-TE6XVTOA.js.map} +1 -1
  160. package/dist/{chunk-33A27NFX.cjs → chunk-TTBIQTO5.cjs} +19 -19
  161. package/dist/{chunk-33A27NFX.cjs.map → chunk-TTBIQTO5.cjs.map} +1 -1
  162. package/dist/{chunk-6JG2RFGK.js → chunk-UKBBYVNS.js} +5 -5
  163. package/dist/{chunk-6JG2RFGK.js.map → chunk-UKBBYVNS.js.map} +1 -1
  164. package/dist/{chunk-J7J7J2GN.cjs → chunk-UNFBHV46.cjs} +9 -2
  165. package/dist/chunk-UNFBHV46.cjs.map +1 -0
  166. package/dist/{chunk-AAEZSPTC.js → chunk-UNZOJVVC.js} +4 -4
  167. package/dist/{chunk-AAEZSPTC.js.map → chunk-UNZOJVVC.js.map} +1 -1
  168. package/dist/{chunk-24SYBZPL.cjs → chunk-WPO3VCY4.cjs} +9 -9
  169. package/dist/{chunk-24SYBZPL.cjs.map → chunk-WPO3VCY4.cjs.map} +1 -1
  170. package/dist/{chunk-IUMAQURF.js → chunk-X6DUEDAF.js} +3 -3
  171. package/dist/{chunk-IUMAQURF.js.map → chunk-X6DUEDAF.js.map} +1 -1
  172. package/dist/{chunk-CFE6QF2Q.js → chunk-XCQ432OX.js} +3 -3
  173. package/dist/{chunk-CFE6QF2Q.js.map → chunk-XCQ432OX.js.map} +1 -1
  174. package/dist/{chunk-QWD4RDZ3.cjs → chunk-XDUGSTYJ.cjs} +15 -15
  175. package/dist/{chunk-QWD4RDZ3.cjs.map → chunk-XDUGSTYJ.cjs.map} +1 -1
  176. package/dist/{chunk-K2VMFZQ5.js → chunk-XKMVJ443.js} +5 -5
  177. package/dist/{chunk-K2VMFZQ5.js.map → chunk-XKMVJ443.js.map} +1 -1
  178. package/dist/{chunk-6PWOWXMC.js → chunk-XZHJYSPB.js} +3 -3
  179. package/dist/{chunk-6PWOWXMC.js.map → chunk-XZHJYSPB.js.map} +1 -1
  180. package/dist/{chunk-QC55H6RJ.cjs → chunk-YRJA2POB.cjs} +9 -9
  181. package/dist/{chunk-QC55H6RJ.cjs.map → chunk-YRJA2POB.cjs.map} +1 -1
  182. package/dist/{chunk-T3ZDEYTJ.js → chunk-ZDYDBXSD.js} +36 -15
  183. package/dist/chunk-ZDYDBXSD.js.map +1 -0
  184. package/dist/{chunk-DMRT67Y6.js → chunk-ZJZ7LV3A.js} +3 -3
  185. package/dist/{chunk-DMRT67Y6.js.map → chunk-ZJZ7LV3A.js.map} +1 -1
  186. package/dist/{chunk-G7BLGBRN.js → chunk-ZWFTECOE.js} +3 -3
  187. package/dist/{chunk-G7BLGBRN.js.map → chunk-ZWFTECOE.js.map} +1 -1
  188. package/dist/{compact-session-QT6RJOKO.js → compact-session-2N3ZYJTW.js} +12 -12
  189. package/dist/{compact-session-QT6RJOKO.js.map → compact-session-2N3ZYJTW.js.map} +1 -1
  190. package/dist/{compact-session-75KD2FCM.cjs → compact-session-RBPLUPCK.cjs} +21 -21
  191. package/dist/{compact-session-75KD2FCM.cjs.map → compact-session-RBPLUPCK.cjs.map} +1 -1
  192. package/dist/compaction.cjs +20 -16
  193. package/dist/compaction.d.cts +2 -0
  194. package/dist/compaction.d.ts +2 -0
  195. package/dist/compaction.js +2 -2
  196. package/dist/concurrency.cjs +5 -5
  197. package/dist/concurrency.js +3 -3
  198. package/dist/context/index.cjs +13 -9
  199. package/dist/context/index.cjs.map +1 -1
  200. package/dist/context/index.d.cts +2 -0
  201. package/dist/context/index.d.ts +2 -0
  202. package/dist/context/index.js +5 -5
  203. package/dist/context/index.js.map +1 -1
  204. package/dist/context-SXR2HLHT.js +7 -0
  205. package/dist/{context-OJIIXJCV.js.map → context-SXR2HLHT.js.map} +1 -1
  206. package/dist/context-ZOULM2RB.cjs +24 -0
  207. package/dist/{context-7RP5JXGM.cjs.map → context-ZOULM2RB.cjs.map} +1 -1
  208. package/dist/{cron-D8uB1Xh5.d.ts → cron-DTuaPMVI.d.ts} +2 -2
  209. package/dist/{cron-BwxDUscv.d.cts → cron-QTgcwcZt.d.cts} +2 -2
  210. package/dist/cron.cjs +34 -34
  211. package/dist/cron.d.cts +4 -4
  212. package/dist/cron.d.ts +4 -4
  213. package/dist/cron.js +33 -33
  214. package/dist/{errors-DrDEgyz1.d.cts → errors-BWOJeWTZ.d.cts} +25 -2
  215. package/dist/{errors-CLOAyuiv.d.ts → errors-DDvG18IB.d.ts} +25 -2
  216. package/dist/errors.cjs +25 -21
  217. package/dist/errors.d.cts +2 -2
  218. package/dist/errors.d.ts +2 -2
  219. package/dist/errors.js +1 -1
  220. package/dist/eval.cjs +44 -44
  221. package/dist/eval.js +34 -34
  222. package/dist/{executor-XQAOQOHD.cjs → executor-2SUGI3ZT.cjs} +21 -21
  223. package/dist/{executor-XQAOQOHD.cjs.map → executor-2SUGI3ZT.cjs.map} +1 -1
  224. package/dist/{executor-ZNDQDX6Q.js → executor-3NI7KNL4.js} +6 -6
  225. package/dist/{executor-ZNDQDX6Q.js.map → executor-3NI7KNL4.js.map} +1 -1
  226. package/dist/filesystem/index.cjs +11 -11
  227. package/dist/filesystem/index.js +2 -2
  228. package/dist/fs-session-store-JHBJFKVV.cjs +19 -0
  229. package/dist/{fs-session-store-E4U3P56L.cjs.map → fs-session-store-JHBJFKVV.cjs.map} +1 -1
  230. package/dist/fs-session-store-STZZFXH2.js +10 -0
  231. package/dist/{fs-session-store-77JU46UZ.js.map → fs-session-store-STZZFXH2.js.map} +1 -1
  232. package/dist/generate-object-NTKAWE7D.js +7 -0
  233. package/dist/{generate-object-BXV7BZRP.js.map → generate-object-NTKAWE7D.js.map} +1 -1
  234. package/dist/generate-object-YHTWG5DB.cjs +20 -0
  235. package/dist/{generate-object-YBI2TDJ3.cjs.map → generate-object-YHTWG5DB.cjs.map} +1 -1
  236. package/dist/index-manager-ONQJSWX5.js +17 -0
  237. package/dist/{index-manager-Z4XMRVWQ.js.map → index-manager-ONQJSWX5.js.map} +1 -1
  238. package/dist/{index-manager-W7RHSL6G.cjs → index-manager-ZGJN25FD.cjs} +9 -9
  239. package/dist/{index-manager-W7RHSL6G.cjs.map → index-manager-ZGJN25FD.cjs.map} +1 -1
  240. package/dist/index.cjs +148 -146
  241. package/dist/index.d.cts +28 -10
  242. package/dist/index.d.ts +28 -10
  243. package/dist/index.js +49 -49
  244. package/dist/{inject-session-L6MIIELT.cjs → inject-session-3FPXJDJP.cjs} +4 -4
  245. package/dist/{inject-session-L6MIIELT.cjs.map → inject-session-3FPXJDJP.cjs.map} +1 -1
  246. package/dist/{inject-session-XWWN4DAA.js → inject-session-YNNOE3O6.js} +3 -3
  247. package/dist/{inject-session-XWWN4DAA.js.map → inject-session-YNNOE3O6.js.map} +1 -1
  248. package/dist/interactive/index.cjs +3 -3
  249. package/dist/interactive/index.js +1 -1
  250. package/dist/internal/memory/adapters/index.cjs +7 -7
  251. package/dist/internal/memory/adapters/index.js +6 -6
  252. package/dist/internal/memory/storage/index.cjs +35 -35
  253. package/dist/internal/memory/storage/index.js +6 -6
  254. package/dist/internal/persistence/index.cjs +11 -11
  255. package/dist/internal/persistence/index.js +3 -3
  256. package/dist/internal/runtime/compression/compression-model-registry.d.ts +1 -0
  257. package/dist/internal/runtime/compression/compression-summarizer.d.ts +0 -14
  258. package/dist/internal/runtime/context/context-discovery.d.ts +20 -5
  259. package/dist/internal/runtime/context/context-loaders.d.ts +5 -1
  260. package/dist/internal/security/index.cjs +9 -9
  261. package/dist/internal/security/index.js +2 -2
  262. package/dist/judge-call-AQQYK6VT.cjs +22 -0
  263. package/dist/{judge-call-46M2E5FA.cjs.map → judge-call-AQQYK6VT.cjs.map} +1 -1
  264. package/dist/judge-call-LOL5FQEX.js +5 -0
  265. package/dist/{judge-call-FGUNNWEI.js.map → judge-call-LOL5FQEX.js.map} +1 -1
  266. package/dist/mcp-auth.cjs +9 -9
  267. package/dist/mcp-auth.js +2 -2
  268. package/dist/models.cjs +15 -15
  269. package/dist/models.js +6 -6
  270. package/dist/oauth-transaction-store-NP2YHZ6D.js +5 -0
  271. package/dist/{oauth-transaction-store-5RIR6D5C.js.map → oauth-transaction-store-NP2YHZ6D.js.map} +1 -1
  272. package/dist/oauth-transaction-store-ZINDV7AF.cjs +38 -0
  273. package/dist/{oauth-transaction-store-SXIE57OD.cjs.map → oauth-transaction-store-ZINDV7AF.cjs.map} +1 -1
  274. package/dist/path-safety.cjs +9 -9
  275. package/dist/path-safety.js +2 -2
  276. package/dist/persistence.cjs +16 -16
  277. package/dist/persistence.js +4 -4
  278. package/dist/project.cjs +5 -5
  279. package/dist/project.js +2 -2
  280. package/dist/providers.cjs +8 -8
  281. package/dist/providers.js +6 -6
  282. package/dist/{registry-DMWCJKRF.js → registry-5FK42CRV.js} +6 -6
  283. package/dist/{registry-DMWCJKRF.js.map → registry-5FK42CRV.js.map} +1 -1
  284. package/dist/{registry-BZQFYRTL.cjs → registry-BVTNO73E.cjs} +14 -14
  285. package/dist/{registry-BZQFYRTL.cjs.map → registry-BVTNO73E.cjs.map} +1 -1
  286. package/dist/retry.cjs +3 -3
  287. package/dist/retry.js +2 -2
  288. package/dist/{run-CTAdRU3U.d.ts → run-DsA5Ip2i.d.cts} +1 -1
  289. package/dist/{run-CTAdRU3U.d.cts → run-DsA5Ip2i.d.ts} +1 -1
  290. package/dist/sandbox/index.cjs +18 -18
  291. package/dist/sandbox/index.js +3 -3
  292. package/dist/{sdk-agent-BOiKqOgL.d.cts → sdk-agent-dNwjwCt5.d.cts} +2 -2
  293. package/dist/{sdk-agent-D4a_BR_6.d.ts → sdk-agent-wEOLXD3F.d.ts} +2 -2
  294. package/dist/server/auth/index.cjs +21 -21
  295. package/dist/server/auth/index.js +6 -6
  296. package/dist/server/errors-envelope.cjs +13 -13
  297. package/dist/server/errors-envelope.d.cts +2 -2
  298. package/dist/server/errors-envelope.d.ts +2 -2
  299. package/dist/server/errors-envelope.js +2 -2
  300. package/dist/skills.cjs +7 -7
  301. package/dist/skills.js +4 -4
  302. package/dist/stream-object-QAEHG4YO.js +7 -0
  303. package/dist/{stream-object-HBFMIZLD.js.map → stream-object-QAEHG4YO.js.map} +1 -1
  304. package/dist/stream-object-TKVGGA54.cjs +20 -0
  305. package/dist/{stream-object-QSKHISDJ.cjs.map → stream-object-TKVGGA54.cjs.map} +1 -1
  306. package/dist/subagents-loader-5TZCAIYQ.cjs +16 -0
  307. package/dist/{subagents-loader-MOO7DC4E.cjs.map → subagents-loader-5TZCAIYQ.cjs.map} +1 -1
  308. package/dist/subagents-loader-PEV3PD4Q.js +7 -0
  309. package/dist/{subagents-loader-CJFYQQU2.js.map → subagents-loader-PEV3PD4Q.js.map} +1 -1
  310. package/dist/subagents-loader.cjs +5 -5
  311. package/dist/subagents-loader.d.cts +3 -3
  312. package/dist/subagents-loader.d.ts +3 -3
  313. package/dist/subagents-loader.js +3 -3
  314. package/dist/subscription/index.cjs +3 -2
  315. package/dist/subscription/index.d.cts +1 -1
  316. package/dist/subscription/index.d.ts +1 -1
  317. package/dist/subscription/index.js +2 -2
  318. package/dist/task-store.cjs +5 -5
  319. package/dist/task-store.js +2 -2
  320. package/dist/types/agent.d.ts +12 -0
  321. package/dist/workflow.cjs +25 -25
  322. package/dist/workflow.d.cts +2 -2
  323. package/dist/workflow.d.ts +2 -2
  324. package/dist/workflow.js +4 -4
  325. package/docs/error-codes.md +8 -7
  326. package/docs/harness-capability-map.md +17 -1
  327. package/package.json +1 -1
  328. package/dist/agent-EQ5HKTWV.js +0 -59
  329. package/dist/agent-KA63WDQH.cjs +0 -68
  330. package/dist/chunk-6M2OIS4Y.js.map +0 -1
  331. package/dist/chunk-7KBNBPFK.cjs.map +0 -1
  332. package/dist/chunk-A6PDYH55.js.map +0 -1
  333. package/dist/chunk-ALUN2B4W.js.map +0 -1
  334. package/dist/chunk-ANMJJD6D.cjs +0 -18
  335. package/dist/chunk-ATT276RD.cjs.map +0 -1
  336. package/dist/chunk-J7J7J2GN.cjs.map +0 -1
  337. package/dist/chunk-N7VAE6DZ.js.map +0 -1
  338. package/dist/chunk-RWPLWMCZ.cjs.map +0 -1
  339. package/dist/chunk-T3ZDEYTJ.js.map +0 -1
  340. package/dist/chunk-ZLMU5EU3.cjs.map +0 -1
  341. package/dist/context-7RP5JXGM.cjs +0 -24
  342. package/dist/context-OJIIXJCV.js +0 -7
  343. package/dist/fs-session-store-77JU46UZ.js +0 -10
  344. package/dist/fs-session-store-E4U3P56L.cjs +0 -19
  345. package/dist/generate-object-BXV7BZRP.js +0 -7
  346. package/dist/generate-object-YBI2TDJ3.cjs +0 -20
  347. package/dist/index-manager-Z4XMRVWQ.js +0 -17
  348. package/dist/judge-call-46M2E5FA.cjs +0 -22
  349. package/dist/judge-call-FGUNNWEI.js +0 -5
  350. package/dist/oauth-transaction-store-5RIR6D5C.js +0 -5
  351. package/dist/oauth-transaction-store-SXIE57OD.cjs +0 -38
  352. package/dist/stream-object-HBFMIZLD.js +0 -7
  353. package/dist/stream-object-QSKHISDJ.cjs +0 -20
  354. package/dist/subagents-loader-CJFYQQU2.js +0 -7
  355. package/dist/subagents-loader-MOO7DC4E.cjs +0 -16
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkFUSDYC2B_cjs = require('./chunk-FUSDYC2B.cjs');
3
+ var chunkCQYBJOB2_cjs = require('./chunk-CQYBJOB2.cjs');
4
4
  var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
5
- var chunk24SYBZPL_cjs = require('./chunk-24SYBZPL.cjs');
5
+ var chunkWPO3VCY4_cjs = require('./chunk-WPO3VCY4.cjs');
6
6
  var chunkQOGNZMHD_cjs = require('./chunk-QOGNZMHD.cjs');
7
7
  var chunkYSTXFWQE_cjs = require('./chunk-YSTXFWQE.cjs');
8
8
  var chunkFRITRLZQ_cjs = require('./chunk-FRITRLZQ.cjs');
9
9
  var chunkGZV6AVRL_cjs = require('./chunk-GZV6AVRL.cjs');
10
- var chunkATT276RD_cjs = require('./chunk-ATT276RD.cjs');
10
+ var chunkJ5623RIV_cjs = require('./chunk-J5623RIV.cjs');
11
11
  var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
12
- var chunkQC55H6RJ_cjs = require('./chunk-QC55H6RJ.cjs');
12
+ var chunkYRJA2POB_cjs = require('./chunk-YRJA2POB.cjs');
13
13
  var chunkNVXXWAU7_cjs = require('./chunk-NVXXWAU7.cjs');
14
- var chunkEXTRW7GW_cjs = require('./chunk-EXTRW7GW.cjs');
15
- var chunkJ7J7J2GN_cjs = require('./chunk-J7J7J2GN.cjs');
14
+ var chunkNAGPKWOD_cjs = require('./chunk-NAGPKWOD.cjs');
15
+ var chunkUNFBHV46_cjs = require('./chunk-UNFBHV46.cjs');
16
16
  var chunk6LHQPOMI_cjs = require('./chunk-6LHQPOMI.cjs');
17
17
  var fs = require('fs');
18
18
  var promises = require('fs/promises');
@@ -101,7 +101,7 @@ async function loadOne(dir, entryName) {
101
101
  if (plugin !== null && typeof plugin === "object" && plugin.kind === "model-provider") {
102
102
  const profile = plugin.profile;
103
103
  if (profile !== void 0 && typeof profile === "object") {
104
- chunkQC55H6RJ_cjs.registerProvider(profile);
104
+ chunkYRJA2POB_cjs.registerProvider(profile);
105
105
  }
106
106
  }
107
107
  return;
@@ -119,7 +119,7 @@ function mapAnthropicError(args) {
119
119
  const { status, body, headers, endpoint } = args;
120
120
  const code = mapAnthropicStatusToCode(status, body);
121
121
  const message = formatMessage(status, code);
122
- const metadata = chunk24SYBZPL_cjs.buildErrorMetadata({
122
+ const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
123
123
  provider: "anthropic",
124
124
  endpoint,
125
125
  code,
@@ -128,24 +128,24 @@ function mapAnthropicError(args) {
128
128
  body
129
129
  });
130
130
  if (status === 401 || status === 403) {
131
- return new chunkJ7J7J2GN_cjs.AuthenticationError(message, { code: "anthropic_auth_failed", metadata });
131
+ return new chunkUNFBHV46_cjs.AuthenticationError(message, { code: "anthropic_auth_failed", metadata });
132
132
  }
133
133
  if (status === 429) {
134
- return new chunkJ7J7J2GN_cjs.RateLimitError(message, { code: "anthropic_rate_limit", metadata });
134
+ return new chunkUNFBHV46_cjs.RateLimitError(message, { code: "anthropic_rate_limit", metadata });
135
135
  }
136
136
  if (status === 400) {
137
- return new chunkJ7J7J2GN_cjs.ConfigurationError(message, {
137
+ return new chunkUNFBHV46_cjs.ConfigurationError(message, {
138
138
  code: `anthropic_${code}`,
139
139
  metadata
140
140
  });
141
141
  }
142
142
  if (status === 408) {
143
- return new chunkJ7J7J2GN_cjs.NetworkError(message, { code: "anthropic_timeout", metadata });
143
+ return new chunkUNFBHV46_cjs.NetworkError(message, { code: "anthropic_timeout", metadata });
144
144
  }
145
145
  if (status >= 500 && status < 600) {
146
- return new chunkJ7J7J2GN_cjs.NetworkError(message, { code: "anthropic_server_error", metadata });
146
+ return new chunkUNFBHV46_cjs.NetworkError(message, { code: "anthropic_server_error", metadata });
147
147
  }
148
- return new chunkJ7J7J2GN_cjs.UnknownAgentError(message, { code: "anthropic_unknown", metadata });
148
+ return new chunkUNFBHV46_cjs.UnknownAgentError(message, { code: "anthropic_unknown", metadata });
149
149
  }
150
150
  function mapAnthropicStatusToCode(status, body) {
151
151
  if (status === 400) {
@@ -158,7 +158,7 @@ function mapAnthropicStatusToCode(status, body) {
158
158
  }
159
159
  return "invalid_request";
160
160
  }
161
- return chunk24SYBZPL_cjs.httpStatusToErrorCode(status);
161
+ return chunkWPO3VCY4_cjs.httpStatusToErrorCode(status);
162
162
  }
163
163
  function formatMessage(status, code) {
164
164
  return `Anthropic API error: ${code} (HTTP ${status})`;
@@ -229,7 +229,7 @@ function toBlockToolResultContent(content) {
229
229
  function toStringToolResultContent(content, providerName, toolUseId) {
230
230
  if (typeof content === "string") return content;
231
231
  if (content.some((block) => block.type === "image")) {
232
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
232
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
233
233
  `provider "${providerName}" does not support image content in tool results` + (toolUseId === void 0 ? "" : ` \u2014 the result of tool call ${toolUseId} carried an image`) + `, and this wire carries tool results as text only`
234
234
  );
235
235
  }
@@ -408,7 +408,7 @@ function readWithIdleTimeout(reader, idleTimeoutMs) {
408
408
  (resolve, reject) => {
409
409
  const timer = setTimeout(() => {
410
410
  reject(
411
- new chunkJ7J7J2GN_cjs.NetworkError(`SSE stream idle for ${idleTimeoutMs}ms \u2014 upstream stalled`, {
411
+ new chunkUNFBHV46_cjs.NetworkError(`SSE stream idle for ${idleTimeoutMs}ms \u2014 upstream stalled`, {
412
412
  code: "stream_idle_timeout"
413
413
  })
414
414
  );
@@ -485,9 +485,9 @@ function isAbortError(err) {
485
485
  }
486
486
  function wrapTransportError(err, ctx) {
487
487
  if (isAbortError(err)) return err;
488
- if (err instanceof chunkJ7J7J2GN_cjs.TheokitAgentError) return err;
488
+ if (err instanceof chunkUNFBHV46_cjs.TheokitAgentError) return err;
489
489
  const detail = err instanceof Error ? err.message : String(err);
490
- return new chunkJ7J7J2GN_cjs.NetworkError(`${ctx.providerId} transport failure on ${ctx.endpoint}: ${detail}`, {
490
+ return new chunkUNFBHV46_cjs.NetworkError(`${ctx.providerId} transport failure on ${ctx.endpoint}: ${detail}`, {
491
491
  code: "transport_failure",
492
492
  cause: err
493
493
  });
@@ -551,7 +551,7 @@ var AnthropicClient = class {
551
551
  for (const event of events) yield event;
552
552
  }
553
553
  if (!accumulator.finishReasonSeen) {
554
- throw new chunkJ7J7J2GN_cjs.NetworkError("Anthropic SSE stream truncated (no stop_reason)", {
554
+ throw new chunkUNFBHV46_cjs.NetworkError("Anthropic SSE stream truncated (no stop_reason)", {
555
555
  code: "stream_truncated"
556
556
  });
557
557
  }
@@ -700,10 +700,10 @@ function classifyBedrockError(args, awsType, message) {
700
700
  return "invalid_request";
701
701
  }
702
702
  if (awsType.includes("Timeout")) return "timeout";
703
- return chunk24SYBZPL_cjs.httpStatusToErrorCode(args.status);
703
+ return chunkWPO3VCY4_cjs.httpStatusToErrorCode(args.status);
704
704
  }
705
705
  function buildBedrockMetadata(args, code) {
706
- return chunk24SYBZPL_cjs.buildErrorMetadata({
706
+ return chunkWPO3VCY4_cjs.buildErrorMetadata({
707
707
  provider: "bedrock",
708
708
  endpoint: args.endpoint,
709
709
  code,
@@ -713,28 +713,28 @@ function buildBedrockMetadata(args, code) {
713
713
  });
714
714
  }
715
715
  function mapBedrockError(args) {
716
- const parsed = chunk24SYBZPL_cjs.parseErrorBody(args.body);
716
+ const parsed = chunkWPO3VCY4_cjs.parseErrorBody(args.body);
717
717
  const awsType = parsed.__type ?? "";
718
718
  const message = parsed.message ?? parsed.Message ?? "Bedrock request failed";
719
719
  const code = classifyBedrockError(args, awsType, message);
720
720
  const metadata = buildBedrockMetadata(args, code);
721
721
  switch (code) {
722
722
  case "rate_limit":
723
- return new chunkJ7J7J2GN_cjs.RateLimitError(`Bedrock throttled: ${message}`, { metadata });
723
+ return new chunkUNFBHV46_cjs.RateLimitError(`Bedrock throttled: ${message}`, { metadata });
724
724
  case "auth_failed":
725
- return new chunkJ7J7J2GN_cjs.AuthenticationError(`Bedrock auth: ${message}`, { metadata });
725
+ return new chunkUNFBHV46_cjs.AuthenticationError(`Bedrock auth: ${message}`, { metadata });
726
726
  case "invalid_request": {
727
727
  const friendly = message.includes("use case details") ? `Bedrock account setup required: ${message} (AWS Console \u2192 Bedrock \u2192 Model access \u2192 Anthropic \u2192 Submit use case form, then retry in 15 min.)` : `Bedrock validation: ${message}`;
728
- return new chunkJ7J7J2GN_cjs.ConfigurationError(friendly, { metadata });
728
+ return new chunkUNFBHV46_cjs.ConfigurationError(friendly, { metadata });
729
729
  }
730
730
  case "quota_exceeded":
731
- return new chunkJ7J7J2GN_cjs.RateLimitError(`Bedrock quota exceeded: ${message}`, { metadata });
731
+ return new chunkUNFBHV46_cjs.RateLimitError(`Bedrock quota exceeded: ${message}`, { metadata });
732
732
  case "timeout":
733
- return new chunkJ7J7J2GN_cjs.NetworkError(`Bedrock timeout: ${message}`, { metadata });
733
+ return new chunkUNFBHV46_cjs.NetworkError(`Bedrock timeout: ${message}`, { metadata });
734
734
  case "server_error":
735
- return new chunkJ7J7J2GN_cjs.NetworkError(`Bedrock server error: ${message}`, { metadata });
735
+ return new chunkUNFBHV46_cjs.NetworkError(`Bedrock server error: ${message}`, { metadata });
736
736
  default:
737
- return new chunkJ7J7J2GN_cjs.UnknownAgentError(`Bedrock unknown: ${message}`, { metadata });
737
+ return new chunkUNFBHV46_cjs.UnknownAgentError(`Bedrock unknown: ${message}`, { metadata });
738
738
  }
739
739
  }
740
740
  var cachedToken = null;
@@ -747,7 +747,7 @@ async function resolveBedrockToken(region) {
747
747
  return cachedToken.value;
748
748
  }
749
749
  try {
750
- const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ZLMU5EU3.cjs', document.baseURI).href)));
750
+ const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ARMFXTY6.cjs', document.baseURI).href)));
751
751
  const gen = r("@aws/bedrock-token-generator");
752
752
  if (typeof gen.getToken !== "function") return void 0;
753
753
  const providers = r("@aws-sdk/credential-providers");
@@ -775,16 +775,16 @@ var BedrockAnthropicClient = class {
775
775
  if (fromOpts !== void 0 && fromOpts.length > 0) return fromOpts;
776
776
  const fromEnv = await resolveBedrockToken(region);
777
777
  if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
778
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
778
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
779
779
  "Bedrock requires AWS_BEARER_TOKEN_BEDROCK env var, or install `@aws/bedrock-token-generator` for auto-refresh, or pass apiKey explicitly.",
780
780
  { code: "auth_failed" }
781
781
  );
782
782
  }
783
783
  async *stream(request, signal) {
784
- const region = chunkQC55H6RJ_cjs.inferRegionFromModelId(request.model) ?? process.env.AWS_REGION ?? "us-east-1";
784
+ const region = chunkYRJA2POB_cjs.inferRegionFromModelId(request.model) ?? process.env.AWS_REGION ?? "us-east-1";
785
785
  const token = await this.resolveTokenOrThrow(region);
786
- const bareModel = chunkQC55H6RJ_cjs.stripBedrockPrefix(request.model);
787
- const baseUrl = this.options.baseUrl ?? chunkQC55H6RJ_cjs.resolveBedrockBaseUrl(request.model);
786
+ const bareModel = chunkYRJA2POB_cjs.stripBedrockPrefix(request.model);
787
+ const baseUrl = this.options.baseUrl ?? chunkYRJA2POB_cjs.resolveBedrockBaseUrl(request.model);
788
788
  const endpoint = `/model/${encodeURIComponent(bareModel)}/invoke`;
789
789
  const url = `${baseUrl}${endpoint}`;
790
790
  const response = await postAnthropicRequest({
@@ -839,7 +839,7 @@ var FaultInjectingLlmClient = class {
839
839
  return yield* this.inner.stream(request, signal);
840
840
  }
841
841
  if (parsed.status >= 400) {
842
- throw chunk24SYBZPL_cjs.mapOpenAICompatibleError({
842
+ throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
843
843
  providerId: this.name,
844
844
  status: parsed.status,
845
845
  body: parsed.body,
@@ -914,7 +914,7 @@ function mapOllamaTransportError(args) {
914
914
  if (args.providerId !== "ollama") return void 0;
915
915
  const causeCode = extractCauseCode(args.cause);
916
916
  if (causeCode !== "ECONNREFUSED" && causeCode !== "ENOTFOUND") return void 0;
917
- const metadata = chunk24SYBZPL_cjs.buildErrorMetadata({
917
+ const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
918
918
  provider: "ollama",
919
919
  endpoint: args.endpoint,
920
920
  code: "network",
@@ -922,7 +922,7 @@ function mapOllamaTransportError(args) {
922
922
  headers: void 0,
923
923
  body: { cause: causeCode }
924
924
  });
925
- return new chunkJ7J7J2GN_cjs.ConfigurationError(
925
+ return new chunkUNFBHV46_cjs.ConfigurationError(
926
926
  "Ollama is not reachable. Run `ollama serve` to start the local runtime, or set OLLAMA_HOST to point at a remote Ollama server.",
927
927
  { code: "ollama_unreachable", metadata }
928
928
  );
@@ -932,7 +932,7 @@ function mapOllamaHttpError(args) {
932
932
  const errString = extractErrorString(args.body).toLowerCase();
933
933
  if (args.status === 404 && errString.includes("not found") && errString.includes("pull")) {
934
934
  const modelHint = extractModelName(errString);
935
- const metadata = chunk24SYBZPL_cjs.buildErrorMetadata({
935
+ const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
936
936
  provider: "ollama",
937
937
  endpoint: args.endpoint,
938
938
  code: "model_unavailable",
@@ -941,13 +941,13 @@ function mapOllamaHttpError(args) {
941
941
  body: args.body
942
942
  });
943
943
  const pullCmd = modelHint !== void 0 ? `ollama pull ${modelHint}` : "ollama pull <model>";
944
- return new chunkJ7J7J2GN_cjs.ConfigurationError(
944
+ return new chunkUNFBHV46_cjs.ConfigurationError(
945
945
  `Ollama model is not pulled. Run \`${pullCmd}\` to download it first.`,
946
946
  { code: "ollama_model_not_pulled", metadata }
947
947
  );
948
948
  }
949
949
  if (args.status === 503 && errString.includes("model is loading")) {
950
- const metadata = chunk24SYBZPL_cjs.buildErrorMetadata({
950
+ const metadata = chunkWPO3VCY4_cjs.buildErrorMetadata({
951
951
  provider: "ollama",
952
952
  endpoint: args.endpoint,
953
953
  code: "server_error",
@@ -955,7 +955,7 @@ function mapOllamaHttpError(args) {
955
955
  headers: args.headers,
956
956
  body: args.body
957
957
  });
958
- return new chunkJ7J7J2GN_cjs.NetworkError(
958
+ return new chunkUNFBHV46_cjs.NetworkError(
959
959
  "Ollama model is loading. Retry in a few seconds \u2014 Ollama is warming up the model into memory.",
960
960
  { code: "ollama_model_loading", metadata }
961
961
  );
@@ -1034,7 +1034,7 @@ var OllamaNativeClient = class {
1034
1034
  endpoint: "/api/chat"
1035
1035
  });
1036
1036
  if (mapped !== void 0) throw mapped;
1037
- throw chunk24SYBZPL_cjs.mapOpenAICompatibleError({
1037
+ throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
1038
1038
  providerId: "ollama",
1039
1039
  status: response.status,
1040
1040
  body: bodyJson,
@@ -1182,7 +1182,7 @@ function toOllamaMessages(message) {
1182
1182
  }
1183
1183
  if (message.role === "user") {
1184
1184
  if (message.content.some((p) => p.type === "image")) {
1185
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
1185
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
1186
1186
  "image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
1187
1187
  { code: "ollama_image_unsupported" }
1188
1188
  );
@@ -1266,7 +1266,7 @@ async function safeFetch(fetchFn, url, init) {
1266
1266
  try {
1267
1267
  return await fetchFn(url, init);
1268
1268
  } catch (cause) {
1269
- throw new chunkJ7J7J2GN_cjs.NetworkError("HTTP request failed", { code: "network_error", cause });
1269
+ throw new chunkUNFBHV46_cjs.NetworkError("HTTP request failed", { code: "network_error", cause });
1270
1270
  }
1271
1271
  }
1272
1272
  async function safeParseJsonResponse(response) {
@@ -1293,7 +1293,7 @@ function mapHttpStatusToError(status, body) {
1293
1293
  cause: body
1294
1294
  };
1295
1295
  if (envelope.code === "integration_not_connected") {
1296
- return new chunkJ7J7J2GN_cjs.IntegrationNotConnectedError(message, {
1296
+ return new chunkUNFBHV46_cjs.IntegrationNotConnectedError(message, {
1297
1297
  provider: envelope.provider ?? "unknown",
1298
1298
  helpUrl: envelope.helpUrl ?? "",
1299
1299
  code: envelope.code,
@@ -1304,21 +1304,21 @@ function mapHttpStatusToError(status, body) {
1304
1304
  }
1305
1305
  function statusToError(status, message, errorOptions) {
1306
1306
  if (status === 401 || status === 403) {
1307
- return new chunkJ7J7J2GN_cjs.AuthenticationError(message, errorOptions);
1307
+ return new chunkUNFBHV46_cjs.AuthenticationError(message, errorOptions);
1308
1308
  }
1309
1309
  if (status === 429) {
1310
- return new chunkJ7J7J2GN_cjs.RateLimitError(message, errorOptions);
1310
+ return new chunkUNFBHV46_cjs.RateLimitError(message, errorOptions);
1311
1311
  }
1312
1312
  if (status === 408) {
1313
- return new chunkJ7J7J2GN_cjs.NetworkError(message, { ...errorOptions, code: errorOptions.code ?? "timeout" });
1313
+ return new chunkUNFBHV46_cjs.NetworkError(message, { ...errorOptions, code: errorOptions.code ?? "timeout" });
1314
1314
  }
1315
1315
  if (status >= 400 && status < 500) {
1316
- return new chunkJ7J7J2GN_cjs.ConfigurationError(message, errorOptions);
1316
+ return new chunkUNFBHV46_cjs.ConfigurationError(message, errorOptions);
1317
1317
  }
1318
1318
  if (status >= 500) {
1319
- return new chunkJ7J7J2GN_cjs.NetworkError(message, errorOptions);
1319
+ return new chunkUNFBHV46_cjs.NetworkError(message, errorOptions);
1320
1320
  }
1321
- return new chunkJ7J7J2GN_cjs.UnknownAgentError(message, errorOptions);
1321
+ return new chunkUNFBHV46_cjs.UnknownAgentError(message, errorOptions);
1322
1322
  }
1323
1323
  function extractErrorEnvelope(body) {
1324
1324
  if (!body || typeof body !== "object") return {};
@@ -1572,7 +1572,7 @@ var OpenAIClient = class {
1572
1572
  endpoint: "/v1/chat/completions"
1573
1573
  });
1574
1574
  if (ollamaMapped !== void 0) throw ollamaMapped;
1575
- throw chunk24SYBZPL_cjs.mapOpenAICompatibleError({
1575
+ throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
1576
1576
  providerId,
1577
1577
  status: response.status,
1578
1578
  body,
@@ -1608,7 +1608,7 @@ var OpenAIClient = class {
1608
1608
  }
1609
1609
  if (chunk.error !== void 0 && chunk.error !== null) {
1610
1610
  const status = typeof chunk.error.code === "number" ? chunk.error.code : 502;
1611
- throw chunk24SYBZPL_cjs.mapOpenAICompatibleError({
1611
+ throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
1612
1612
  providerId,
1613
1613
  status,
1614
1614
  body: chunk,
@@ -1620,7 +1620,7 @@ var OpenAIClient = class {
1620
1620
  for (const event of events) yield event;
1621
1621
  }
1622
1622
  if (!sawDone && !accumulator.finishReasonSeen) {
1623
- throw new chunkJ7J7J2GN_cjs.NetworkError("SSE stream truncated (no finish_reason / [DONE])", {
1623
+ throw new chunkUNFBHV46_cjs.NetworkError("SSE stream truncated (no finish_reason / [DONE])", {
1624
1624
  code: "stream_truncated"
1625
1625
  });
1626
1626
  }
@@ -1886,7 +1886,7 @@ async function tryFirstEvent(client, request, signal, logFallback = false) {
1886
1886
  const firstResult = await generator.next();
1887
1887
  return { kind: "ok", generator, firstResult };
1888
1888
  } catch (cause) {
1889
- if (cause instanceof chunkJ7J7J2GN_cjs.NetworkError || cause instanceof chunkJ7J7J2GN_cjs.RateLimitError || cause instanceof chunkJ7J7J2GN_cjs.AuthenticationError) {
1889
+ if (cause instanceof chunkUNFBHV46_cjs.NetworkError || cause instanceof chunkUNFBHV46_cjs.RateLimitError || cause instanceof chunkUNFBHV46_cjs.AuthenticationError) {
1890
1890
  if (logFallback) {
1891
1891
  const errCode = cause.metadata?.code ?? cause.code ?? "unknown";
1892
1892
  chunk6LHQPOMI_cjs.diag(`[theokit-sdk] provider ${client.name} failed (${errCode}): falling back
@@ -1931,7 +1931,7 @@ var PoolAwareLlmClient = class {
1931
1931
  // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: stream() must serialize pool-select → build client → first-event probe → classify → retry/rotate/propagate. Extracting helpers fragments the linear narrative; the comments above each branch keep it readable.
1932
1932
  async *stream(request, signal) {
1933
1933
  if (this.breaker.shouldSkip(this.pool.provider)) {
1934
- throw new chunkJ7J7J2GN_cjs.NetworkError(`${this.pool.provider} circuit open \u2014 failing fast`, {
1934
+ throw new chunkUNFBHV46_cjs.NetworkError(`${this.pool.provider} circuit open \u2014 failing fast`, {
1935
1935
  code: "circuit_open"
1936
1936
  });
1937
1937
  }
@@ -1950,7 +1950,7 @@ var PoolAwareLlmClient = class {
1950
1950
  }
1951
1951
  if (entry === null) {
1952
1952
  this.breaker.recordTimeout(this.pool.provider);
1953
- throw new chunkJ7J7J2GN_cjs.CredentialPoolExhaustedError(
1953
+ throw new chunkUNFBHV46_cjs.CredentialPoolExhaustedError(
1954
1954
  `All ${this.pool.provider} credentials exhausted; next retry available at ${this.nextRetryHint() ?? "unknown"}`,
1955
1955
  { provider: this.pool.provider, nextRetryAt: this.nextRetryHint() }
1956
1956
  );
@@ -2004,8 +2004,8 @@ var PoolAwareLlmClient = class {
2004
2004
  }
2005
2005
  };
2006
2006
  function classifyAndDecide(error, hasRetried429) {
2007
- if (error instanceof chunkJ7J7J2GN_cjs.NetworkError) return "propagate";
2008
- if (error instanceof chunkJ7J7J2GN_cjs.AuthenticationError) return "rotate";
2007
+ if (error instanceof chunkUNFBHV46_cjs.NetworkError) return "propagate";
2008
+ if (error instanceof chunkUNFBHV46_cjs.AuthenticationError) return "rotate";
2009
2009
  const status = error.metadata?.statusCode ?? 429;
2010
2010
  if (status === 402) return "rotate";
2011
2011
  return hasRetried429 ? "rotate" : "retry";
@@ -2018,8 +2018,8 @@ function parseRetryAfterMs(error) {
2018
2018
  return void 0;
2019
2019
  }
2020
2020
  function inferStatusCode(error) {
2021
- if (error instanceof chunkJ7J7J2GN_cjs.AuthenticationError) return 401;
2022
- if (error instanceof chunkJ7J7J2GN_cjs.RateLimitError) return 429;
2021
+ if (error instanceof chunkUNFBHV46_cjs.AuthenticationError) return 401;
2022
+ if (error instanceof chunkUNFBHV46_cjs.RateLimitError) return 429;
2023
2023
  return 0;
2024
2024
  }
2025
2025
 
@@ -2307,7 +2307,7 @@ var ResponsesApiClient = class {
2307
2307
  body = JSON.parse(text);
2308
2308
  } catch {
2309
2309
  }
2310
- return chunk24SYBZPL_cjs.mapOpenAICompatibleError({
2310
+ return chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
2311
2311
  providerId,
2312
2312
  status: response.status,
2313
2313
  body,
@@ -2343,7 +2343,7 @@ var ResponsesApiClient = class {
2343
2343
  const failure = ResponsesStreamAccumulator.failureMessage(event);
2344
2344
  if (failure !== void 0) {
2345
2345
  yield { type: "error", message: failure };
2346
- throw chunk24SYBZPL_cjs.mapOpenAICompatibleError({
2346
+ throw chunkWPO3VCY4_cjs.mapOpenAICompatibleError({
2347
2347
  providerId,
2348
2348
  status: 502,
2349
2349
  body: { error: { message: failure } },
@@ -2361,14 +2361,14 @@ var ResponsesApiClient = class {
2361
2361
  // src/internal/llm/retrying-client.ts
2362
2362
  var MAX_ATTEMPTS = 3;
2363
2363
  function isRetriableError(err) {
2364
- if (!chunkJ7J7J2GN_cjs.isTransientError(err)) return false;
2365
- if (err instanceof chunkJ7J7J2GN_cjs.CredentialPoolExhaustedError) return false;
2366
- if (err instanceof chunkJ7J7J2GN_cjs.TheokitAgentError && err.code === "circuit_open") return false;
2367
- if (err instanceof chunkJ7J7J2GN_cjs.RateLimitError && err.metadata?.statusCode === 402) return false;
2364
+ if (!chunkUNFBHV46_cjs.isTransientError(err)) return false;
2365
+ if (err instanceof chunkUNFBHV46_cjs.CredentialPoolExhaustedError) return false;
2366
+ if (err instanceof chunkUNFBHV46_cjs.TheokitAgentError && err.code === "circuit_open") return false;
2367
+ if (err instanceof chunkUNFBHV46_cjs.RateLimitError && err.metadata?.statusCode === 402) return false;
2368
2368
  return true;
2369
2369
  }
2370
2370
  function retryAfterHintMs(err) {
2371
- if (!(err instanceof chunkJ7J7J2GN_cjs.RateLimitError)) return void 0;
2371
+ if (!(err instanceof chunkUNFBHV46_cjs.RateLimitError)) return void 0;
2372
2372
  const seconds = err.metadata?.retryAfter;
2373
2373
  return typeof seconds === "number" && seconds > 0 ? seconds * 1e3 : void 0;
2374
2374
  }
@@ -2457,11 +2457,11 @@ function classifyVertexError(args, errStatus) {
2457
2457
  for (const rule of VERTEX_RULES) {
2458
2458
  if (rule.test(args.status, errStatus)) return rule.code;
2459
2459
  }
2460
- const shared = chunk24SYBZPL_cjs.httpStatusToErrorCode(args.status);
2460
+ const shared = chunkWPO3VCY4_cjs.httpStatusToErrorCode(args.status);
2461
2461
  return shared === "auth_failed" ? "auth_permission" : shared;
2462
2462
  }
2463
2463
  function vertexMetadata(args, code) {
2464
- return chunk24SYBZPL_cjs.buildErrorMetadata({
2464
+ return chunkWPO3VCY4_cjs.buildErrorMetadata({
2465
2465
  provider: "vertex",
2466
2466
  endpoint: args.endpoint,
2467
2467
  code,
@@ -2471,29 +2471,29 @@ function vertexMetadata(args, code) {
2471
2471
  });
2472
2472
  }
2473
2473
  var VERTEX_ERROR_BUILDERS = {
2474
- rate_limit: (args, msg) => new chunkJ7J7J2GN_cjs.RateLimitError(`Vertex quota exhausted: ${msg}`, {
2474
+ rate_limit: (args, msg) => new chunkUNFBHV46_cjs.RateLimitError(`Vertex quota exhausted: ${msg}`, {
2475
2475
  metadata: vertexMetadata(args, "rate_limit")
2476
2476
  }),
2477
- auth_unauthenticated: (args, msg) => new chunkJ7J7J2GN_cjs.AuthenticationError(`Vertex unauthenticated: ${msg}`, {
2477
+ auth_unauthenticated: (args, msg) => new chunkUNFBHV46_cjs.AuthenticationError(`Vertex unauthenticated: ${msg}`, {
2478
2478
  metadata: vertexMetadata(args, "auth_failed")
2479
2479
  }),
2480
- auth_permission: (args, msg) => new chunkJ7J7J2GN_cjs.AuthenticationError(`Vertex permission denied: ${msg}`, {
2480
+ auth_permission: (args, msg) => new chunkUNFBHV46_cjs.AuthenticationError(`Vertex permission denied: ${msg}`, {
2481
2481
  metadata: vertexMetadata(args, "auth_failed")
2482
2482
  }),
2483
- invalid_request: (args, msg) => new chunkJ7J7J2GN_cjs.ConfigurationError(`Vertex validation: ${msg}`, {
2483
+ invalid_request: (args, msg) => new chunkUNFBHV46_cjs.ConfigurationError(`Vertex validation: ${msg}`, {
2484
2484
  metadata: vertexMetadata(args, "invalid_request")
2485
2485
  }),
2486
- quota_exceeded: (args, msg) => new chunkJ7J7J2GN_cjs.RateLimitError(`Vertex quota exceeded: ${msg}`, {
2486
+ quota_exceeded: (args, msg) => new chunkUNFBHV46_cjs.RateLimitError(`Vertex quota exceeded: ${msg}`, {
2487
2487
  metadata: vertexMetadata(args, "quota_exceeded")
2488
2488
  }),
2489
- timeout: (args, msg) => new chunkJ7J7J2GN_cjs.NetworkError(`Vertex timeout: ${msg}`, { metadata: vertexMetadata(args, "timeout") }),
2490
- server_error: (args, msg) => new chunkJ7J7J2GN_cjs.NetworkError(`Vertex server error: ${msg}`, {
2489
+ timeout: (args, msg) => new chunkUNFBHV46_cjs.NetworkError(`Vertex timeout: ${msg}`, { metadata: vertexMetadata(args, "timeout") }),
2490
+ server_error: (args, msg) => new chunkUNFBHV46_cjs.NetworkError(`Vertex server error: ${msg}`, {
2491
2491
  metadata: vertexMetadata(args, "server_error")
2492
2492
  }),
2493
- unknown: (args, msg) => new chunkJ7J7J2GN_cjs.UnknownAgentError(`Vertex unknown: ${msg}`, { metadata: vertexMetadata(args, "unknown") })
2493
+ unknown: (args, msg) => new chunkUNFBHV46_cjs.UnknownAgentError(`Vertex unknown: ${msg}`, { metadata: vertexMetadata(args, "unknown") })
2494
2494
  };
2495
2495
  function mapVertexError(args) {
2496
- const parsed = chunk24SYBZPL_cjs.parseErrorBody(args.body);
2496
+ const parsed = chunkWPO3VCY4_cjs.parseErrorBody(args.body);
2497
2497
  const errStatus = parsed.error?.status ?? "";
2498
2498
  const message = parsed.error?.message ?? "Vertex request failed";
2499
2499
  const code = classifyVertexError(args, errStatus);
@@ -2515,12 +2515,12 @@ async function resolveVertexAccessToken() {
2515
2515
  async function getAuthClientOrThrow() {
2516
2516
  let mod;
2517
2517
  try {
2518
- const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ZLMU5EU3.cjs', document.baseURI).href)));
2518
+ const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ARMFXTY6.cjs', document.baseURI).href)));
2519
2519
  mod = r("google-auth-library");
2520
2520
  } catch (err) {
2521
2521
  const isModuleMissing = err instanceof Error && (err.message.includes("Cannot find module") || err.code === "MODULE_NOT_FOUND");
2522
2522
  if (isModuleMissing) {
2523
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2523
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2524
2524
  "Vertex provider requires `google-auth-library`. Install: `pnpm add google-auth-library`.",
2525
2525
  { code: "auth_failed", cause: err }
2526
2526
  );
@@ -2557,7 +2557,7 @@ var VertexAnthropicClient = class {
2557
2557
  resolveProjectOrThrow() {
2558
2558
  const projectId = this.options.projectId ?? resolveVertexProjectId();
2559
2559
  if (projectId !== void 0) return projectId;
2560
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2560
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2561
2561
  "Vertex requires a project id. Set GOOGLE_CLOUD_PROJECT env var or run `gcloud config set project <id>`.",
2562
2562
  { code: "auth_failed" }
2563
2563
  );
@@ -2567,7 +2567,7 @@ var VertexAnthropicClient = class {
2567
2567
  if (fromOpts !== void 0 && fromOpts.length > 0) return fromOpts;
2568
2568
  const fromAdc = await resolveVertexAccessToken();
2569
2569
  if (fromAdc !== void 0 && fromAdc.length > 0) return fromAdc;
2570
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2570
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2571
2571
  "Vertex could not resolve an access token. Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS to a service-account JSON path.",
2572
2572
  { code: "auth_failed" }
2573
2573
  );
@@ -2576,8 +2576,8 @@ var VertexAnthropicClient = class {
2576
2576
  const projectId = this.resolveProjectOrThrow();
2577
2577
  const location = this.options.location ?? resolveVertexLocation();
2578
2578
  const accessToken = await this.resolveTokenOrThrow();
2579
- const baseUrl = chunkQC55H6RJ_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "anthropic" });
2580
- const bareModel = chunkQC55H6RJ_cjs.stripVertexPrefix(request.model);
2579
+ const baseUrl = chunkYRJA2POB_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "anthropic" });
2580
+ const bareModel = chunkYRJA2POB_cjs.stripVertexPrefix(request.model);
2581
2581
  const endpoint = `/models/${encodeURIComponent(bareModel)}:rawPredict`;
2582
2582
  const url = `${baseUrl}${endpoint}`;
2583
2583
  const response = await postAnthropicRequest({
@@ -2613,7 +2613,7 @@ var VertexGeminiClient = class {
2613
2613
  async *stream(request, signal) {
2614
2614
  const projectId = this.options.projectId ?? resolveVertexProjectId();
2615
2615
  if (projectId === void 0) {
2616
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2616
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2617
2617
  "Vertex requires a project id. Set GOOGLE_CLOUD_PROJECT env var or run `gcloud config set project <id>`.",
2618
2618
  { code: "auth_failed" }
2619
2619
  );
@@ -2621,12 +2621,12 @@ var VertexGeminiClient = class {
2621
2621
  const location = this.options.location ?? resolveVertexLocation();
2622
2622
  const accessToken = this.options.apiKey !== void 0 && this.options.apiKey.length > 0 ? this.options.apiKey : await resolveVertexAccessToken();
2623
2623
  if (accessToken === void 0 || accessToken.length === 0) {
2624
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2624
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2625
2625
  "Vertex could not resolve an access token. Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS to a service-account JSON path.",
2626
2626
  { code: "auth_failed" }
2627
2627
  );
2628
2628
  }
2629
- const baseUrl = chunkQC55H6RJ_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "gemini" });
2629
+ const baseUrl = chunkYRJA2POB_cjs.resolveVertexBaseUrl({ projectId, location, modelDialect: "gemini" });
2630
2630
  const url = `${baseUrl}/chat/completions`;
2631
2631
  const innerFetch = this.options.fetch ?? fetch;
2632
2632
  const rewriteFetch = (_input, init) => innerFetch(url, init);
@@ -2648,7 +2648,7 @@ var VertexRouterClient = class {
2648
2648
  options;
2649
2649
  name = "vertex";
2650
2650
  async *stream(request, signal) {
2651
- const dialect = chunkQC55H6RJ_cjs.inferModelDialect(request.model);
2651
+ const dialect = chunkYRJA2POB_cjs.inferModelDialect(request.model);
2652
2652
  if (dialect === "anthropic") {
2653
2653
  const inner2 = new VertexAnthropicClient(this.options);
2654
2654
  return yield* inner2.stream(request, signal);
@@ -2660,7 +2660,7 @@ var VertexRouterClient = class {
2660
2660
 
2661
2661
  // src/internal/llm/router.ts
2662
2662
  function resolveProviderChain(options) {
2663
- chunkQC55H6RJ_cjs.registerBuiltins();
2663
+ chunkYRJA2POB_cjs.registerBuiltins();
2664
2664
  return buildChain(options);
2665
2665
  }
2666
2666
  function buildChain(options) {
@@ -2677,7 +2677,7 @@ function buildChain(options) {
2677
2677
  addClient(options.primary, options.baseUrl);
2678
2678
  for (const fallback of options.fallback ?? []) addClient(fallback);
2679
2679
  if (clients.length === 0) {
2680
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2680
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2681
2681
  `No provider client could be resolved (primary=${options.primary}). Set ANTHROPIC_API_KEY or OPENAI_API_KEY / OPENROUTER_API_KEY.`,
2682
2682
  { code: "provider_unresolved" }
2683
2683
  );
@@ -2685,11 +2685,11 @@ function buildChain(options) {
2685
2685
  return clients;
2686
2686
  }
2687
2687
  function buildTransport(name, routerOptions, perCallBaseUrl) {
2688
- const baseProfile = chunkQC55H6RJ_cjs.getProviderProfile(name);
2688
+ const baseProfile = chunkYRJA2POB_cjs.getProviderProfile(name);
2689
2689
  if (baseProfile === void 0) return void 0;
2690
2690
  const profile = routerOptions.extractToolCallsFromContent === true && baseProfile.extractToolCallsFromContent !== true ? { ...baseProfile, extractToolCallsFromContent: true } : baseProfile;
2691
2691
  const resilience = routerOptions.onRateLimit !== void 0 ? { onRateLimit: routerOptions.onRateLimit } : {};
2692
- const ambient = chunkFUSDYC2B_cjs.currentCredentialPool(name);
2692
+ const ambient = chunkCQYBJOB2_cjs.currentCredentialPool(name);
2693
2693
  if (ambient !== void 0) {
2694
2694
  return new PoolAwareLlmClient(
2695
2695
  ambient,
@@ -2721,9 +2721,9 @@ function buildPoolOrSingle(args) {
2721
2721
  if (poolKeys !== void 0 && poolKeys.length >= 2) {
2722
2722
  const strategy = routerOptions.credentialPoolStrategy?.[name] ?? "fill_first";
2723
2723
  const entries = poolKeys.map(
2724
- (accessToken, priority) => chunkFUSDYC2B_cjs.newPooledCredential({ provider: name, accessToken, priority, source: "manual" })
2724
+ (accessToken, priority) => chunkCQYBJOB2_cjs.newPooledCredential({ provider: name, accessToken, priority, source: "manual" })
2725
2725
  );
2726
- const pool = new chunkFUSDYC2B_cjs.CredentialPool(name, entries, strategy);
2726
+ const pool = new chunkCQYBJOB2_cjs.CredentialPool(name, entries, strategy);
2727
2727
  const resilience = routerOptions.onRateLimit !== void 0 ? { onRateLimit: routerOptions.onRateLimit } : {};
2728
2728
  return new PoolAwareLlmClient(
2729
2729
  pool,
@@ -2780,7 +2780,7 @@ function warnUnknownProvidersInApiKeys(apiKeys) {
2780
2780
  if (apiKeys === void 0) return;
2781
2781
  for (const name of Object.keys(apiKeys)) {
2782
2782
  if (warnedProviders.has(name)) continue;
2783
- const profile = chunkQC55H6RJ_cjs.getProviderProfile(name);
2783
+ const profile = chunkYRJA2POB_cjs.getProviderProfile(name);
2784
2784
  if (profile === void 0) {
2785
2785
  warnedProviders.add(name);
2786
2786
  chunk6LHQPOMI_cjs.diag(
@@ -2815,7 +2815,7 @@ function selectTransport(profile, apiKey, baseUrl) {
2815
2815
  if (apiKey !== "__oauth_lazy_token__") return;
2816
2816
  const auth = t.headers?.authorization ?? t.headers?.Authorization;
2817
2817
  if (t.fetch === void 0 && auth === void 0) {
2818
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2818
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2819
2819
  `provider "${profile.name}" uses OAuth (authType: ${profile.authType}) but no credential was resolved. Register a ProviderProfile.transform whose fetch (or headers.authorization) supplies the bearer \u2014 typically via resolveCredential() from "@theokit/sdk/auth".`
2820
2820
  );
2821
2821
  }
@@ -2874,7 +2874,7 @@ function selectTransport(profile, apiKey, baseUrl) {
2874
2874
  providerName: profile.name
2875
2875
  });
2876
2876
  }
2877
- throw new chunkJ7J7J2GN_cjs.ConfigurationError(
2877
+ throw new chunkUNFBHV46_cjs.ConfigurationError(
2878
2878
  `Provider "${profile.name}" declares apiMode "${profile.apiMode}", which this SDK has no transport for. Transports are built in and cannot be extended by a plugin; the supported modes are "chat_completions", "anthropic_messages", "bedrock_anthropic" and "responses_api". Change the provider's apiMode to one of those, or open an issue if the provider genuinely speaks a fifth protocol.`,
2879
2879
  { code: "transport_unavailable" }
2880
2880
  );
@@ -2955,7 +2955,7 @@ function checkProviderPrefix(key, provider) {
2955
2955
  function registerPluginProviderProfiles(entries) {
2956
2956
  let registered = 0;
2957
2957
  for (const entry of entries) {
2958
- chunkQC55H6RJ_cjs.registerProvider(entry.profile);
2958
+ chunkYRJA2POB_cjs.registerProvider(entry.profile);
2959
2959
  registered += 1;
2960
2960
  }
2961
2961
  return registered;
@@ -2979,7 +2979,7 @@ var AMBIENT_STORE = {
2979
2979
  };
2980
2980
  function isStoredOAuthAvailable(env = process.env) {
2981
2981
  try {
2982
- return chunkEXTRW7GW_cjs.readStoredOAuth(AMBIENT_STORE, env) !== void 0;
2982
+ return chunkNAGPKWOD_cjs.readStoredOAuth(AMBIENT_STORE, env) !== void 0;
2983
2983
  } catch {
2984
2984
  return false;
2985
2985
  }
@@ -3039,7 +3039,7 @@ function shouldUseRealLocalRuntime(apiKey) {
3039
3039
  function inferProviderFromApiKey(apiKey) {
3040
3040
  const provider = chunkFRITRLZQ_cjs.providerFromApiKeyPrefix(apiKey);
3041
3041
  if (provider === void 0) return void 0;
3042
- return chunkQC55H6RJ_cjs.getProviderProfile(provider) === void 0 ? void 0 : provider;
3042
+ return chunkYRJA2POB_cjs.getProviderProfile(provider) === void 0 ? void 0 : provider;
3043
3043
  }
3044
3044
  function detectPrimaryProvider() {
3045
3045
  if (process.env.ANTHROPIC_API_KEY !== void 0 && process.env.ANTHROPIC_API_KEY.length > 0) {
@@ -3066,7 +3066,7 @@ function warnProviderPrecedenceOnce(asked, used) {
3066
3066
  }
3067
3067
  var pluginProvidersAnnounced = false;
3068
3068
  function resolveRunProvider(options) {
3069
- chunkQC55H6RJ_cjs.registerBuiltins();
3069
+ chunkYRJA2POB_cjs.registerBuiltins();
3070
3070
  const profiles = options.pluginManager?.aggregated.providerProfiles ?? [];
3071
3071
  const registered = registerPluginProviderProfiles(profiles);
3072
3072
  if (registered > 0 && !pluginProvidersAnnounced) {
@@ -3076,7 +3076,7 @@ function resolveRunProvider(options) {
3076
3076
  `);
3077
3077
  }
3078
3078
  const parsedModel = chunk3EE6LVWT_cjs.parseModelId(options.model?.id);
3079
- const modelInferredProvider = parsedModel.provider !== void 0 && chunkQC55H6RJ_cjs.getProviderProfile(parsedModel.provider) !== void 0 ? parsedModel.provider : void 0;
3079
+ const modelInferredProvider = parsedModel.provider !== void 0 && chunkYRJA2POB_cjs.getProviderProfile(parsedModel.provider) !== void 0 ? parsedModel.provider : void 0;
3080
3080
  const keyInferredProvider = inferProviderFromApiKey(options.agentOptions.apiKey);
3081
3081
  const primary = options.agentOptions.providers?.routes?.[0]?.provider ?? keyInferredProvider ?? modelInferredProvider ?? detectPrimaryProvider();
3082
3082
  warnProviderPrecedenceOnce(modelInferredProvider, primary);
@@ -3091,83 +3091,7 @@ function mergeExplicitApiKey(pools, primary, apiKey) {
3091
3091
  return { ...pools ?? {}, [primary]: [apiKey] };
3092
3092
  }
3093
3093
 
3094
- // src/internal/runtime/compression/compression-model-registry.ts
3095
- var EXACT_REGISTRY = /* @__PURE__ */ new Map([
3096
- // OpenAI family
3097
- ["openai/gpt-4o", "openai/gpt-4o-mini"],
3098
- ["openai/gpt-4-turbo", "openai/gpt-4o-mini"],
3099
- ["openai/gpt-4", "openai/gpt-4o-mini"],
3100
- ["openai/o1-preview", "openai/gpt-4o-mini"],
3101
- ["openai/o1", "openai/gpt-4o-mini"],
3102
- ["openai/o3", "openai/gpt-4o-mini"],
3103
- ["openai/o3-mini", "openai/gpt-4o-mini"],
3104
- // Anthropic family
3105
- ["anthropic/claude-opus-4", "anthropic/claude-3-5-haiku-latest"],
3106
- ["anthropic/claude-sonnet-4", "anthropic/claude-3-5-haiku-latest"],
3107
- ["anthropic/claude-3-5-sonnet", "anthropic/claude-3-5-haiku-latest"],
3108
- ["anthropic/claude-3-5-sonnet-latest", "anthropic/claude-3-5-haiku-latest"],
3109
- ["anthropic/claude-3-opus", "anthropic/claude-3-haiku"],
3110
- ["anthropic/claude-3-sonnet", "anthropic/claude-3-haiku"],
3111
- // Vertex (Gemini + Anthropic-on-Vertex)
3112
- ["vertex/gemini-1.5-pro", "vertex/gemini-1.5-flash"],
3113
- ["vertex/gemini-2.0-pro", "vertex/gemini-1.5-flash"],
3114
- ["vertex/claude-3-5-sonnet", "vertex/claude-3-5-haiku"],
3115
- ["vertex/claude-3-opus", "vertex/claude-3-haiku"],
3116
- // OpenRouter (preserve openrouter prefix, swap tier within same vendor)
3117
- ["openrouter/openai/gpt-4o", "openrouter/openai/gpt-4o-mini"],
3118
- ["openrouter/openai/gpt-4-turbo", "openrouter/openai/gpt-4o-mini"],
3119
- ["openrouter/anthropic/claude-3-5-sonnet", "openrouter/anthropic/claude-3-5-haiku"],
3120
- ["openrouter/anthropic/claude-opus-4", "openrouter/anthropic/claude-3-5-haiku"]
3121
- ]);
3122
- var WILDCARD_REGISTRY = [
3123
- // Bedrock Anthropic: us.anthropic.claude-sonnet-* → us.anthropic.claude-3-haiku-*
3124
- ["bedrock/anthropic.claude-sonnet*", "bedrock/anthropic.claude-3-haiku*"],
3125
- ["bedrock/anthropic.claude-opus*", "bedrock/anthropic.claude-3-haiku*"],
3126
- ["bedrock/anthropic.claude-3-5-sonnet*", "bedrock/anthropic.claude-3-5-haiku*"]
3127
- ];
3128
- var NO_AUTH_PROVIDERS = /* @__PURE__ */ new Set(["ollama", "lmstudio", "llamacpp"]);
3129
- var CompressionModelUnresolvedError = class extends chunkJ7J7J2GN_cjs.TheokitAgentError {
3130
- name = "CompressionModelUnresolvedError";
3131
- agentModel;
3132
- constructor(agentModel) {
3133
- super(
3134
- `Could not resolve a same-family-cheaper-tier compression model for "${agentModel}". Provide Agent.create({compression: {model: "<your-cheaper-model>"}}) OR add "${agentModel}" to the compression-model-registry (see ADR D440).`,
3135
- { code: "compression_model_unresolved", isRetryable: false }
3136
- );
3137
- this.agentModel = agentModel;
3138
- }
3139
- };
3140
- function resolveCompressionModel(agentModel) {
3141
- const exact = EXACT_REGISTRY.get(agentModel);
3142
- if (exact !== void 0) return exact;
3143
- const wildcard = matchWildcard(agentModel);
3144
- if (wildcard !== null) return wildcard;
3145
- if (isNoAuthProvider(agentModel)) return agentModel;
3146
- throw new CompressionModelUnresolvedError(agentModel);
3147
- }
3148
- function matchWildcard(agentModel) {
3149
- for (const [pattern, replacement] of WILDCARD_REGISTRY) {
3150
- const prefix = pattern.endsWith("*") ? pattern.slice(0, -1) : pattern;
3151
- if (!agentModel.startsWith(prefix)) continue;
3152
- const suffix = agentModel.slice(prefix.length);
3153
- const replPrefix = replacement.endsWith("*") ? replacement.slice(0, -1) : replacement;
3154
- return `${replPrefix}${suffix}`;
3155
- }
3156
- return null;
3157
- }
3158
- function isNoAuthProvider(agentModel) {
3159
- const slashIdx = agentModel.indexOf("/");
3160
- if (slashIdx <= 0) return false;
3161
- return NO_AUTH_PROVIDERS.has(agentModel.slice(0, slashIdx));
3162
- }
3163
-
3164
3094
  // src/internal/runtime/compression/compression-summarizer.ts
3165
- var CompressionFailedError = class extends chunkJ7J7J2GN_cjs.TheokitAgentError {
3166
- name = "CompressionFailedError";
3167
- constructor(message, options = {}) {
3168
- super(message, { ...options, code: "compression_failed", isRetryable: true });
3169
- }
3170
- };
3171
3095
  function buildCompressionPrompt(messages) {
3172
3096
  const formatted = messages.map((m) => `[${m.role}]: ${m.content}`).join("\n\n");
3173
3097
  return `Summarize the following ${messages.length} conversation messages into a concise summary that preserves ALL facts, decisions, user preferences, and context needed for the conversation to continue naturally. The summary will replace these messages in the context window. Be thorough but concise.
@@ -3183,13 +3107,13 @@ async function compressConversationWindow(opts) {
3183
3107
  try {
3184
3108
  summary = await opts.callLlm(opts.model, COMPRESSION_SYSTEM, userPrompt);
3185
3109
  } catch (cause) {
3186
- throw new CompressionFailedError(
3110
+ throw new chunkUNFBHV46_cjs.CompressionFailedError(
3187
3111
  `Compression LLM call failed: ${cause instanceof Error ? cause.message : String(cause)}`,
3188
3112
  { cause: cause instanceof Error ? cause : void 0 }
3189
3113
  );
3190
3114
  }
3191
3115
  if (!summary || summary.trim().length === 0) {
3192
- throw new CompressionFailedError(
3116
+ throw new chunkUNFBHV46_cjs.CompressionFailedError(
3193
3117
  "Compression LLM returned empty summary \u2014 reduction ineffective."
3194
3118
  );
3195
3119
  }
@@ -3243,7 +3167,7 @@ async function compactSessionTranscript(opts) {
3243
3167
  compressible.push({ role: m.role, content: text });
3244
3168
  }
3245
3169
  }
3246
- const preTokens = chunkATT276RD_cjs.estimateTokens(compressible.map((m) => m.content).join("\n"));
3170
+ const preTokens = chunkJ5623RIV_cjs.estimateTokens(compressible.map((m) => m.content).join("\n"));
3247
3171
  if (opts.onPreCompact !== void 0) {
3248
3172
  await runPreCompactBounded(
3249
3173
  opts.onPreCompact,
@@ -3258,7 +3182,7 @@ async function compactSessionTranscript(opts) {
3258
3182
  for (let i = compressible.length - 1; i >= 0; i--) {
3259
3183
  const m = compressible[i];
3260
3184
  if (m === void 0 || m.role !== "user" || isCompactSummary(m.content)) continue;
3261
- const cost = chunkATT276RD_cjs.estimateTokens(m.content);
3185
+ const cost = chunkJ5623RIV_cjs.estimateTokens(m.content);
3262
3186
  if (budget + cost > COMPACT_USER_MESSAGE_MAX_TOKENS) {
3263
3187
  const remaining = COMPACT_USER_MESSAGE_MAX_TOKENS - budget;
3264
3188
  if (remaining > 50) {
@@ -3283,7 +3207,7 @@ ${summaryBody}`;
3283
3207
  const delta = transcript.records().slice(prior.length);
3284
3208
  await opts.store.appendRecords(opts.loc.agentId, delta);
3285
3209
  chunkYJNYDJ2T_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
3286
- const postTokens = chunkATT276RD_cjs.estimateTokens([...preserved, summary].join("\n"));
3210
+ const postTokens = chunkJ5623RIV_cjs.estimateTokens([...preserved, summary].join("\n"));
3287
3211
  return { preTokens, postTokens };
3288
3212
  }
3289
3213
  function resolveSummarizerRoute(opts) {
@@ -3292,9 +3216,9 @@ function resolveSummarizerRoute(opts) {
3292
3216
  }
3293
3217
  function buildDefaultSummarizer(opts) {
3294
3218
  return async (messages) => {
3295
- chunkQC55H6RJ_cjs.registerBuiltins();
3219
+ chunkYRJA2POB_cjs.registerBuiltins();
3296
3220
  const modelPrefix = opts.agentModel.includes("/") ? opts.agentModel.slice(0, opts.agentModel.indexOf("/")) : void 0;
3297
- const prefixProfile = modelPrefix !== void 0 ? chunkQC55H6RJ_cjs.getProviderProfile(modelPrefix) : void 0;
3221
+ const prefixProfile = modelPrefix !== void 0 ? chunkYRJA2POB_cjs.getProviderProfile(modelPrefix) : void 0;
3298
3222
  const prefixUsable = prefixProfile !== void 0 && (prefixProfile.authType !== "api_key" || prefixProfile.envVars.some((v) => (process.env[v] ?? "").length > 0));
3299
3223
  const route = resolveSummarizerRoute({
3300
3224
  keyProvider: inferProviderFromApiKey(opts.apiKey),
@@ -3308,7 +3232,7 @@ function buildDefaultSummarizer(opts) {
3308
3232
  model = opts.agentModel;
3309
3233
  } else {
3310
3234
  try {
3311
- model = resolveCompressionModel(opts.agentModel);
3235
+ model = chunkJ5623RIV_cjs.resolveCompressionModel(opts.agentModel);
3312
3236
  } catch {
3313
3237
  model = opts.agentModel;
3314
3238
  }
@@ -3398,5 +3322,5 @@ exports.shouldUseFixtureMode = shouldUseFixtureMode;
3398
3322
  exports.shouldUseRealLocalRuntime = shouldUseRealLocalRuntime;
3399
3323
  exports.tryFirstEvent = tryFirstEvent;
3400
3324
  exports.validateApiKeyShape = validateApiKeyShape;
3401
- //# sourceMappingURL=chunk-ZLMU5EU3.cjs.map
3402
- //# sourceMappingURL=chunk-ZLMU5EU3.cjs.map
3325
+ //# sourceMappingURL=chunk-ARMFXTY6.cjs.map
3326
+ //# sourceMappingURL=chunk-ARMFXTY6.cjs.map