@theokit/sdk 4.52.1 → 4.53.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 (385) hide show
  1. package/CHANGELOG.md +48 -8
  2. package/LICENSE +2 -2
  3. package/README.md +5 -5
  4. package/bin/theokit-migrate-config.mjs +11 -2
  5. package/dist/{agent-BiCINq25.d.ts → agent-B9HXlwID.d.ts} +21 -8
  6. package/dist/agent-FFVV4U5N.js +50 -0
  7. package/dist/{agent-RDHK6MVT.js.map → agent-FFVV4U5N.js.map} +1 -1
  8. package/dist/agent-YLAHVHEH.cjs +59 -0
  9. package/dist/{agent-U2R2R5JP.cjs.map → agent-YLAHVHEH.cjs.map} +1 -1
  10. package/dist/{agent-Zta1kvGH.d.cts → agent-nLqeXKIX.d.cts} +21 -8
  11. package/dist/agent-session-store-DUGBAX5V.cjs +23 -0
  12. package/dist/{agent-session-store-EPX2WQI4.cjs.map → agent-session-store-DUGBAX5V.cjs.map} +1 -1
  13. package/dist/agent-session-store-TNCGL5RN.js +6 -0
  14. package/dist/{agent-session-store-JMU7ASDB.js.map → agent-session-store-TNCGL5RN.js.map} +1 -1
  15. package/dist/agent.d.ts +16 -1
  16. package/dist/auth/index.cjs +29 -28
  17. package/dist/auth/index.cjs.map +1 -1
  18. package/dist/auth/index.d.cts +1 -1
  19. package/dist/auth/index.d.ts +1 -1
  20. package/dist/auth/index.js +6 -5
  21. package/dist/auth/index.js.map +1 -1
  22. package/dist/{batch-NLIS4QTW.js → batch-UPKN4SG6.js} +9 -9
  23. package/dist/{batch-NLIS4QTW.js.map → batch-UPKN4SG6.js.map} +1 -1
  24. package/dist/{batch-WQ3AJCDV.cjs → batch-ZEFN5SO7.cjs} +26 -26
  25. package/dist/{batch-WQ3AJCDV.cjs.map → batch-ZEFN5SO7.cjs.map} +1 -1
  26. package/dist/{chunk-CY7MIMI4.cjs → chunk-2D43RD5D.cjs} +8 -8
  27. package/dist/{chunk-CY7MIMI4.cjs.map → chunk-2D43RD5D.cjs.map} +1 -1
  28. package/dist/{chunk-WLESQ3ZQ.cjs → chunk-2FYEVT2B.cjs} +121 -121
  29. package/dist/{chunk-WLESQ3ZQ.cjs.map → chunk-2FYEVT2B.cjs.map} +1 -1
  30. package/dist/{chunk-BBZYXVLZ.cjs → chunk-2ZPEDVLM.cjs} +2 -2
  31. package/dist/chunk-2ZPEDVLM.cjs.map +1 -0
  32. package/dist/{chunk-T6QUCG7L.cjs → chunk-3BK6YR5P.cjs} +4 -4
  33. package/dist/{chunk-T6QUCG7L.cjs.map → chunk-3BK6YR5P.cjs.map} +1 -1
  34. package/dist/chunk-3V7UJLQT.js +147 -0
  35. package/dist/chunk-3V7UJLQT.js.map +1 -0
  36. package/dist/{chunk-ITQ4NO4P.js → chunk-3WVMJY7F.js} +3 -3
  37. package/dist/{chunk-ITQ4NO4P.js.map → chunk-3WVMJY7F.js.map} +1 -1
  38. package/dist/{chunk-RAACTJ7C.cjs → chunk-3X6PM7DU.cjs} +4 -4
  39. package/dist/{chunk-RAACTJ7C.cjs.map → chunk-3X6PM7DU.cjs.map} +1 -1
  40. package/dist/{chunk-DEZ75ET5.js → chunk-4Q4K4WB5.js} +3 -3
  41. package/dist/{chunk-DEZ75ET5.js.map → chunk-4Q4K4WB5.js.map} +1 -1
  42. package/dist/{chunk-4X3SBHPK.js → chunk-5F5NWKPN.js} +20 -4
  43. package/dist/chunk-5F5NWKPN.js.map +1 -0
  44. package/dist/chunk-5YKNEMXR.cjs +155 -0
  45. package/dist/chunk-5YKNEMXR.cjs.map +1 -0
  46. package/dist/{chunk-3YYDHUNH.cjs → chunk-665SFFFR.cjs} +11 -11
  47. package/dist/{chunk-3YYDHUNH.cjs.map → chunk-665SFFFR.cjs.map} +1 -1
  48. package/dist/{chunk-CHVSMEKM.js → chunk-6AZDM6LK.js} +3 -3
  49. package/dist/chunk-6AZDM6LK.js.map +1 -0
  50. package/dist/{chunk-AMYY3JHQ.cjs → chunk-ADLLFY3H.cjs} +9 -9
  51. package/dist/{chunk-AMYY3JHQ.cjs.map → chunk-ADLLFY3H.cjs.map} +1 -1
  52. package/dist/{chunk-J4RY5DTI.js → chunk-B6HOIWQ6.js} +5 -5
  53. package/dist/{chunk-J4RY5DTI.js.map → chunk-B6HOIWQ6.js.map} +1 -1
  54. package/dist/{chunk-EQMLJ52C.cjs → chunk-BDTVFIPB.cjs} +26 -26
  55. package/dist/{chunk-EQMLJ52C.cjs.map → chunk-BDTVFIPB.cjs.map} +1 -1
  56. package/dist/{chunk-UJ3SXRZZ.js → chunk-BERBYXFH.js} +3 -3
  57. package/dist/{chunk-UJ3SXRZZ.js.map → chunk-BERBYXFH.js.map} +1 -1
  58. package/dist/{chunk-KZBB4YKU.js → chunk-BFYGJGC5.js} +3 -3
  59. package/dist/{chunk-KZBB4YKU.js.map → chunk-BFYGJGC5.js.map} +1 -1
  60. package/dist/{chunk-SXSPMRSV.cjs → chunk-BM6N4KHO.cjs} +21 -3
  61. package/dist/chunk-BM6N4KHO.cjs.map +1 -0
  62. package/dist/{chunk-2CFEET3Y.cjs → chunk-C4H6PB5J.cjs} +4 -4
  63. package/dist/chunk-C4H6PB5J.cjs.map +1 -0
  64. package/dist/{chunk-NFATC6ZF.cjs → chunk-C5DEO6OI.cjs} +4 -4
  65. package/dist/{chunk-NFATC6ZF.cjs.map → chunk-C5DEO6OI.cjs.map} +1 -1
  66. package/dist/{chunk-EUBGGYPH.cjs → chunk-CZ2GKKYL.cjs} +5 -5
  67. package/dist/{chunk-EUBGGYPH.cjs.map → chunk-CZ2GKKYL.cjs.map} +1 -1
  68. package/dist/{chunk-I732VEDW.js → chunk-D24WJWN2.js} +3 -3
  69. package/dist/{chunk-I732VEDW.js.map → chunk-D24WJWN2.js.map} +1 -1
  70. package/dist/{chunk-3R4ZCQAZ.cjs → chunk-D75S2X6I.cjs} +5 -5
  71. package/dist/{chunk-3R4ZCQAZ.cjs.map → chunk-D75S2X6I.cjs.map} +1 -1
  72. package/dist/{chunk-5XXUYU3M.js → chunk-DGOG5NXR.js} +3 -3
  73. package/dist/{chunk-5XXUYU3M.js.map → chunk-DGOG5NXR.js.map} +1 -1
  74. package/dist/{chunk-RTLUZKDL.cjs → chunk-E7FJOO4G.cjs} +11 -11
  75. package/dist/{chunk-RTLUZKDL.cjs.map → chunk-E7FJOO4G.cjs.map} +1 -1
  76. package/dist/{chunk-BWGXYOBZ.cjs → chunk-ELKO4ZLR.cjs} +4 -4
  77. package/dist/{chunk-BWGXYOBZ.cjs.map → chunk-ELKO4ZLR.cjs.map} +1 -1
  78. package/dist/{chunk-FBZMSLDC.cjs → chunk-EZ2YEF4F.cjs} +4 -4
  79. package/dist/{chunk-FBZMSLDC.cjs.map → chunk-EZ2YEF4F.cjs.map} +1 -1
  80. package/dist/{chunk-6GS7JI64.cjs → chunk-F77UENR6.cjs} +343 -324
  81. package/dist/chunk-F77UENR6.cjs.map +1 -0
  82. package/dist/{chunk-OZXPA3ME.js → chunk-FFM3SJTQ.js} +4 -4
  83. package/dist/{chunk-OZXPA3ME.js.map → chunk-FFM3SJTQ.js.map} +1 -1
  84. package/dist/{chunk-PLUCC4N5.js → chunk-FIOCJYLA.js} +3 -3
  85. package/dist/{chunk-PLUCC4N5.js.map → chunk-FIOCJYLA.js.map} +1 -1
  86. package/dist/{chunk-Z5U2JGEK.cjs → chunk-FOXKFTVZ.cjs} +11 -11
  87. package/dist/{chunk-Z5U2JGEK.cjs.map → chunk-FOXKFTVZ.cjs.map} +1 -1
  88. package/dist/{chunk-K42QGAKM.cjs → chunk-FPYT5WZP.cjs} +10 -10
  89. package/dist/{chunk-K42QGAKM.cjs.map → chunk-FPYT5WZP.cjs.map} +1 -1
  90. package/dist/{chunk-KELIQH7K.js → chunk-G3JWXOGY.js} +78 -58
  91. package/dist/chunk-G3JWXOGY.js.map +1 -0
  92. package/dist/{chunk-DHVNJYTO.js → chunk-GBBDINFK.js} +3 -3
  93. package/dist/{chunk-DHVNJYTO.js.map → chunk-GBBDINFK.js.map} +1 -1
  94. package/dist/{chunk-V45L2OYP.cjs → chunk-GD63JPGC.cjs} +9 -9
  95. package/dist/{chunk-V45L2OYP.cjs.map → chunk-GD63JPGC.cjs.map} +1 -1
  96. package/dist/{chunk-42PLABFU.js → chunk-GOVJO4YE.js} +5 -5
  97. package/dist/{chunk-42PLABFU.js.map → chunk-GOVJO4YE.js.map} +1 -1
  98. package/dist/{chunk-CZHPR2G7.cjs → chunk-HAWE74GQ.cjs} +8 -8
  99. package/dist/{chunk-CZHPR2G7.cjs.map → chunk-HAWE74GQ.cjs.map} +1 -1
  100. package/dist/{chunk-KIX45IKP.js → chunk-HE4BIAOS.js} +4 -4
  101. package/dist/{chunk-KIX45IKP.js.map → chunk-HE4BIAOS.js.map} +1 -1
  102. package/dist/{chunk-AM2CNBKE.js → chunk-HKCKOAIO.js} +2 -2
  103. package/dist/chunk-HKCKOAIO.js.map +1 -0
  104. package/dist/{chunk-V2EJLKGA.js → chunk-HSQ5Q3I5.js} +10 -11
  105. package/dist/chunk-HSQ5Q3I5.js.map +1 -0
  106. package/dist/{chunk-QLAWEGTZ.cjs → chunk-JIQRXKTA.cjs} +7 -7
  107. package/dist/chunk-JIQRXKTA.cjs.map +1 -0
  108. package/dist/{chunk-EFXJ5C7X.js → chunk-KSWHTR54.js} +5 -5
  109. package/dist/{chunk-EFXJ5C7X.js.map → chunk-KSWHTR54.js.map} +1 -1
  110. package/dist/{chunk-6PTCKXD3.js → chunk-LD4MOBFX.js} +8 -8
  111. package/dist/{chunk-6PTCKXD3.js.map → chunk-LD4MOBFX.js.map} +1 -1
  112. package/dist/{chunk-2YGIBOUH.cjs → chunk-LPVIRJVF.cjs} +9 -9
  113. package/dist/chunk-LPVIRJVF.cjs.map +1 -0
  114. package/dist/{chunk-M5EK7N6R.js → chunk-LS3LMQ23.js} +9 -9
  115. package/dist/{chunk-M5EK7N6R.js.map → chunk-LS3LMQ23.js.map} +1 -1
  116. package/dist/{chunk-N43XLTHZ.js → chunk-LTSTGCL6.js} +3 -3
  117. package/dist/{chunk-N43XLTHZ.js.map → chunk-LTSTGCL6.js.map} +1 -1
  118. package/dist/{chunk-W4FV7JBH.js → chunk-MSFLYJDY.js} +4 -4
  119. package/dist/chunk-MSFLYJDY.js.map +1 -0
  120. package/dist/{chunk-C4EU627W.js → chunk-N5CR3TJZ.js} +4 -4
  121. package/dist/{chunk-C4EU627W.js.map → chunk-N5CR3TJZ.js.map} +1 -1
  122. package/dist/{chunk-NACDF3PK.js → chunk-NZL4BNFQ.js} +4 -4
  123. package/dist/chunk-NZL4BNFQ.js.map +1 -0
  124. package/dist/{chunk-OI6RHLGC.cjs → chunk-OUOXM36O.cjs} +11 -11
  125. package/dist/{chunk-OI6RHLGC.cjs.map → chunk-OUOXM36O.cjs.map} +1 -1
  126. package/dist/{chunk-BXVSBYGW.js → chunk-OY7O3Q6R.js} +5 -5
  127. package/dist/{chunk-BXVSBYGW.js.map → chunk-OY7O3Q6R.js.map} +1 -1
  128. package/dist/{chunk-L7EGRCKJ.js → chunk-PBZ7HMBP.js} +4 -4
  129. package/dist/{chunk-L7EGRCKJ.js.map → chunk-PBZ7HMBP.js.map} +1 -1
  130. package/dist/{chunk-OIBHY6JQ.js → chunk-PGP7IOJ2.js} +4 -4
  131. package/dist/{chunk-OIBHY6JQ.js.map → chunk-PGP7IOJ2.js.map} +1 -1
  132. package/dist/{chunk-R7TKOQMJ.js → chunk-POWRZSK4.js} +3 -3
  133. package/dist/{chunk-R7TKOQMJ.js.map → chunk-POWRZSK4.js.map} +1 -1
  134. package/dist/{chunk-R3CKCRK3.cjs → chunk-Q4RESANI.cjs} +4 -4
  135. package/dist/{chunk-R3CKCRK3.cjs.map → chunk-Q4RESANI.cjs.map} +1 -1
  136. package/dist/{chunk-ZNEE4WWQ.cjs → chunk-QBTVATSF.cjs} +25 -24
  137. package/dist/chunk-QBTVATSF.cjs.map +1 -0
  138. package/dist/{chunk-ZSJPRPN7.js → chunk-R5YZACGK.js} +3 -3
  139. package/dist/{chunk-ZSJPRPN7.js.map → chunk-R5YZACGK.js.map} +1 -1
  140. package/dist/{chunk-ADVZIC43.cjs → chunk-RAHSWE5C.cjs} +10 -10
  141. package/dist/{chunk-ADVZIC43.cjs.map → chunk-RAHSWE5C.cjs.map} +1 -1
  142. package/dist/{chunk-NOS7PTKP.js → chunk-SEL2ZQMT.js} +7 -7
  143. package/dist/{chunk-NOS7PTKP.js.map → chunk-SEL2ZQMT.js.map} +1 -1
  144. package/dist/{chunk-XWCTBGYK.js → chunk-SK4QLUBK.js} +3 -3
  145. package/dist/chunk-SK4QLUBK.js.map +1 -0
  146. package/dist/chunk-SSDD676S.js +171 -0
  147. package/dist/chunk-SSDD676S.js.map +1 -0
  148. package/dist/{chunk-E3OCRJU6.cjs → chunk-SVO5WPZX.cjs} +11 -11
  149. package/dist/{chunk-E3OCRJU6.cjs.map → chunk-SVO5WPZX.cjs.map} +1 -1
  150. package/dist/{chunk-44IISBRZ.cjs → chunk-SZHU7A5B.cjs} +4 -4
  151. package/dist/{chunk-44IISBRZ.cjs.map → chunk-SZHU7A5B.cjs.map} +1 -1
  152. package/dist/{chunk-SDJYLCJK.cjs → chunk-TTJ54H3E.cjs} +6 -6
  153. package/dist/chunk-TTJ54H3E.cjs.map +1 -0
  154. package/dist/{chunk-HI4ZW62S.js → chunk-U4UJHOSH.js} +4 -4
  155. package/dist/chunk-U4UJHOSH.js.map +1 -0
  156. package/dist/{chunk-XGYI2KQH.js → chunk-UFIXH26P.js} +4 -4
  157. package/dist/{chunk-XGYI2KQH.js.map → chunk-UFIXH26P.js.map} +1 -1
  158. package/dist/{chunk-JJZ4NIAG.js → chunk-V26QVGUG.js} +7 -6
  159. package/dist/chunk-V26QVGUG.js.map +1 -0
  160. package/dist/{chunk-GNPI5IWZ.js → chunk-V6HWJQQV.js} +6 -5
  161. package/dist/chunk-V6HWJQQV.js.map +1 -0
  162. package/dist/{chunk-MV4TOCUK.js → chunk-VC5ABJXC.js} +3 -3
  163. package/dist/{chunk-MV4TOCUK.js.map → chunk-VC5ABJXC.js.map} +1 -1
  164. package/dist/chunk-VF7X6HDR.cjs +177 -0
  165. package/dist/chunk-VF7X6HDR.cjs.map +1 -0
  166. package/dist/{chunk-7HQVDLFI.cjs → chunk-VGPXHHF3.cjs} +11 -9
  167. package/dist/chunk-VGPXHHF3.cjs.map +1 -0
  168. package/dist/{chunk-T6ZCG5AP.cjs → chunk-VUKQL3L2.cjs} +18 -19
  169. package/dist/chunk-VUKQL3L2.cjs.map +1 -0
  170. package/dist/{chunk-PVBANCWU.cjs → chunk-VW6M4B3Z.cjs} +5 -5
  171. package/dist/{chunk-PVBANCWU.cjs.map → chunk-VW6M4B3Z.cjs.map} +1 -1
  172. package/dist/{chunk-KNZU4YO5.cjs → chunk-WQ53UQL4.cjs} +4 -4
  173. package/dist/{chunk-KNZU4YO5.cjs.map → chunk-WQ53UQL4.cjs.map} +1 -1
  174. package/dist/{chunk-6DCTL32L.cjs → chunk-XPR366DL.cjs} +17 -17
  175. package/dist/{chunk-6DCTL32L.cjs.map → chunk-XPR366DL.cjs.map} +1 -1
  176. package/dist/{chunk-7TB5U7RK.js → chunk-XROIW6BH.js} +6 -6
  177. package/dist/{chunk-7TB5U7RK.js.map → chunk-XROIW6BH.js.map} +1 -1
  178. package/dist/{chunk-ECPL5RV6.cjs → chunk-Y4AXQOT4.cjs} +8 -8
  179. package/dist/{chunk-ECPL5RV6.cjs.map → chunk-Y4AXQOT4.cjs.map} +1 -1
  180. package/dist/{chunk-E6T264NS.js → chunk-Y4I4EQFK.js} +3 -3
  181. package/dist/{chunk-E6T264NS.js.map → chunk-Y4I4EQFK.js.map} +1 -1
  182. package/dist/{chunk-FUASIT3E.cjs → chunk-ZN2DGEY3.cjs} +15 -15
  183. package/dist/{chunk-FUASIT3E.cjs.map → chunk-ZN2DGEY3.cjs.map} +1 -1
  184. package/dist/{chunk-YTO5BRBD.cjs → chunk-ZT57WTUJ.cjs} +8 -8
  185. package/dist/chunk-ZT57WTUJ.cjs.map +1 -0
  186. package/dist/compact-session-4MNKNMO2.js +21 -0
  187. package/dist/{compact-session-XLXC2CZN.js.map → compact-session-4MNKNMO2.js.map} +1 -1
  188. package/dist/compact-session-EPFBQ46Z.cjs +58 -0
  189. package/dist/{compact-session-FBVWO6B3.cjs.map → compact-session-EPFBQ46Z.cjs.map} +1 -1
  190. package/dist/compaction.cjs +16 -16
  191. package/dist/compaction.js +3 -3
  192. package/dist/concurrency.cjs +6 -6
  193. package/dist/concurrency.js +4 -4
  194. package/dist/context-7USNN6LP.cjs +22 -0
  195. package/dist/{context-4HGPCOH6.cjs.map → context-7USNN6LP.cjs.map} +1 -1
  196. package/dist/context-ENXZNF6J.js +5 -0
  197. package/dist/{context-DCECDKWN.js.map → context-ENXZNF6J.js.map} +1 -1
  198. package/dist/{cron-DyWQsEG6.d.ts → cron-BMjgFH-_.d.ts} +1 -1
  199. package/dist/{cron-DgHJnMAK.d.cts → cron-DFDdCdMM.d.cts} +1 -1
  200. package/dist/cron.cjs +33 -32
  201. package/dist/cron.d.cts +2 -2
  202. package/dist/cron.d.ts +2 -2
  203. package/dist/cron.js +32 -31
  204. package/dist/errors.cjs +21 -21
  205. package/dist/errors.js +2 -2
  206. package/dist/eval.cjs +43 -42
  207. package/dist/eval.cjs.map +1 -1
  208. package/dist/eval.js +33 -32
  209. package/dist/eval.js.map +1 -1
  210. package/dist/{executor-4SW7QGZ4.cjs → executor-2Z3LGG3I.cjs} +24 -24
  211. package/dist/{executor-4SW7QGZ4.cjs.map → executor-2Z3LGG3I.cjs.map} +1 -1
  212. package/dist/{executor-3CGPLVJL.js → executor-2Z6XJJJG.js} +7 -7
  213. package/dist/{executor-3CGPLVJL.js.map → executor-2Z6XJJJG.js.map} +1 -1
  214. package/dist/filesystem/index.cjs +7 -7
  215. package/dist/filesystem/index.js +3 -3
  216. package/dist/fs-session-store-R5FD3EN6.js +10 -0
  217. package/dist/{fs-session-store-2TF3ZWMT.js.map → fs-session-store-R5FD3EN6.js.map} +1 -1
  218. package/dist/fs-session-store-VVY2AHWG.cjs +19 -0
  219. package/dist/{fs-session-store-TL4RJTXZ.cjs.map → fs-session-store-VVY2AHWG.cjs.map} +1 -1
  220. package/dist/generate-object-AVXOJK2I.cjs +20 -0
  221. package/dist/{generate-object-E465DX5I.cjs.map → generate-object-AVXOJK2I.cjs.map} +1 -1
  222. package/dist/generate-object-WQRCXFD2.js +7 -0
  223. package/dist/{generate-object-TVQCW2IZ.js.map → generate-object-WQRCXFD2.js.map} +1 -1
  224. package/dist/index-manager-VRU3A2YL.cjs +21 -0
  225. package/dist/{index-manager-HGGL4DD5.cjs.map → index-manager-VRU3A2YL.cjs.map} +1 -1
  226. package/dist/index-manager-WS7TVKUW.js +12 -0
  227. package/dist/{index-manager-EA6FGIQG.js.map → index-manager-WS7TVKUW.js.map} +1 -1
  228. package/dist/index.cjs +143 -134
  229. package/dist/index.cjs.map +1 -1
  230. package/dist/index.d.cts +64 -8
  231. package/dist/index.d.ts +64 -8
  232. package/dist/index.js +45 -44
  233. package/dist/index.js.map +1 -1
  234. package/dist/{inject-session-UBAQ7I3G.cjs → inject-session-AUQLBDRS.cjs} +9 -9
  235. package/dist/{inject-session-UBAQ7I3G.cjs.map → inject-session-AUQLBDRS.cjs.map} +1 -1
  236. package/dist/{inject-session-UEH5MAKU.js → inject-session-GMBMJVNZ.js} +7 -7
  237. package/dist/{inject-session-UEH5MAKU.js.map → inject-session-GMBMJVNZ.js.map} +1 -1
  238. package/dist/internal/auth/auth-types.d.ts +1 -1
  239. package/dist/internal/auth/oauth-device.d.ts +2 -2
  240. package/dist/internal/local-agent/mcp-pool.d.ts +2 -4
  241. package/dist/internal/mcp/oauth.d.ts +14 -0
  242. package/dist/internal/mcp/token-storage.d.ts +18 -0
  243. package/dist/internal/memory/adapters/index.cjs +8 -8
  244. package/dist/internal/memory/adapters/index.js +7 -7
  245. package/dist/internal/persistence/atomic-write.d.cts +93 -0
  246. package/dist/internal/persistence/atomic-write.d.ts +93 -0
  247. package/dist/internal/persistence/file-lock.d.cts +13 -1
  248. package/dist/internal/persistence/file-lock.d.ts +13 -1
  249. package/dist/internal/persistence/fts5-sanitize.d.cts +9 -1
  250. package/dist/internal/persistence/fts5-sanitize.d.ts +9 -1
  251. package/dist/internal/persistence/index.cjs +25 -25
  252. package/dist/internal/persistence/index.js +6 -6
  253. package/dist/internal/persistence/session-dir.d.cts +1 -0
  254. package/dist/internal/persistence/session-dir.d.ts +1 -0
  255. package/dist/internal/persistence/session-writer.d.cts +13 -0
  256. package/dist/internal/persistence/session-writer.d.ts +13 -0
  257. package/dist/internal/persistence/sqlite-wal.d.cts +9 -1
  258. package/dist/internal/persistence/sqlite-wal.d.ts +9 -1
  259. package/dist/internal/persistence/transcript-ops.d.cts +6 -7
  260. package/dist/internal/persistence/transcript-ops.d.ts +6 -7
  261. package/dist/internal/providers/builtin/cerebras.d.ts +2 -2
  262. package/dist/internal/providers/builtin/deepinfra.d.ts +1 -1
  263. package/dist/internal/providers/catalog-source-models-dev.d.ts +1 -1
  264. package/dist/internal/runtime/lifecycle/env-policy.d.ts +1 -3
  265. package/dist/internal/security/index.cjs +13 -13
  266. package/dist/internal/security/index.js +3 -3
  267. package/dist/internal/security/path-guard.d.cts +61 -0
  268. package/dist/internal/security/path-guard.d.ts +61 -0
  269. package/dist/internal/session/compact-session.d.ts +2 -2
  270. package/dist/internal/telemetry/tracer.d.ts +24 -0
  271. package/dist/judge-call-G5SGV2M2.cjs +22 -0
  272. package/dist/{judge-call-GVIJWQVE.cjs.map → judge-call-G5SGV2M2.cjs.map} +1 -1
  273. package/dist/judge-call-MDIPTBJI.js +5 -0
  274. package/dist/{judge-call-QMKGC2ZK.js.map → judge-call-MDIPTBJI.js.map} +1 -1
  275. package/dist/mcp-auth.cjs +299 -0
  276. package/dist/mcp-auth.cjs.map +1 -0
  277. package/dist/mcp-auth.d.cts +17 -0
  278. package/dist/mcp-auth.d.ts +17 -0
  279. package/dist/mcp-auth.js +292 -0
  280. package/dist/mcp-auth.js.map +1 -0
  281. package/dist/models.cjs +22 -21
  282. package/dist/models.cjs.map +1 -1
  283. package/dist/models.js +7 -6
  284. package/dist/models.js.map +1 -1
  285. package/dist/path-safety.cjs +10 -10
  286. package/dist/path-safety.js +3 -3
  287. package/dist/persistence.cjs +38 -29
  288. package/dist/persistence.cjs.map +1 -1
  289. package/dist/persistence.js +18 -9
  290. package/dist/persistence.js.map +1 -1
  291. package/dist/project.cjs +5 -5
  292. package/dist/project.js +3 -3
  293. package/dist/registry-63ASMXT4.cjs +46 -0
  294. package/dist/{registry-UBY26R4I.cjs.map → registry-63ASMXT4.cjs.map} +1 -1
  295. package/dist/registry-O7FJ2MPM.js +9 -0
  296. package/dist/{registry-GC7BQMSV.js.map → registry-O7FJ2MPM.js.map} +1 -1
  297. package/dist/retry.cjs +4 -4
  298. package/dist/retry.js +3 -3
  299. package/dist/sandbox/bwrap.d.cts +1 -2
  300. package/dist/sandbox/bwrap.d.ts +1 -2
  301. package/dist/sandbox/index.cjs +20 -20
  302. package/dist/sandbox/index.cjs.map +1 -1
  303. package/dist/sandbox/index.js +5 -5
  304. package/dist/sandbox/index.js.map +1 -1
  305. package/dist/server/errors-envelope.cjs +14 -14
  306. package/dist/server/errors-envelope.js +3 -3
  307. package/dist/session-transcript-DOM3UTXR.cjs +50 -0
  308. package/dist/{session-transcript-TNAJ4O3M.cjs.map → session-transcript-DOM3UTXR.cjs.map} +1 -1
  309. package/dist/session-transcript-RAKEK76V.js +5 -0
  310. package/dist/{session-transcript-SKIRBEJE.js.map → session-transcript-RAKEK76V.js.map} +1 -1
  311. package/dist/skills.cjs +7 -7
  312. package/dist/skills.js +5 -5
  313. package/dist/stream-object-L3Q7PBMF.cjs +20 -0
  314. package/dist/{stream-object-T4DAMNVB.cjs.map → stream-object-L3Q7PBMF.cjs.map} +1 -1
  315. package/dist/stream-object-ZYXWS4B2.js +7 -0
  316. package/dist/{stream-object-QMNR3YFF.js.map → stream-object-ZYXWS4B2.js.map} +1 -1
  317. package/dist/subagents-loader-I56GSKAQ.js +6 -0
  318. package/dist/{subagents-loader-WN2SB6PV.js.map → subagents-loader-I56GSKAQ.js.map} +1 -1
  319. package/dist/subagents-loader-VRW73QQT.cjs +15 -0
  320. package/dist/{subagents-loader-3CXBQWWY.cjs.map → subagents-loader-VRW73QQT.cjs.map} +1 -1
  321. package/dist/subagents-loader.cjs +6 -6
  322. package/dist/subagents-loader.d.cts +1 -1
  323. package/dist/subagents-loader.d.ts +1 -1
  324. package/dist/subagents-loader.js +4 -4
  325. package/dist/subscription/index.cjs +3 -3
  326. package/dist/subscription/index.js +2 -2
  327. package/dist/task-store.cjs +7 -7
  328. package/dist/task-store.js +4 -4
  329. package/dist/types/agent.d.ts +19 -6
  330. package/dist/types/provider-profile.d.ts +2 -2
  331. package/dist/workflow.cjs +27 -27
  332. package/dist/workflow.js +6 -6
  333. package/package.json +28 -18
  334. package/dist/agent-RDHK6MVT.js +0 -49
  335. package/dist/agent-U2R2R5JP.cjs +0 -58
  336. package/dist/agent-session-store-EPX2WQI4.cjs +0 -23
  337. package/dist/agent-session-store-JMU7ASDB.js +0 -6
  338. package/dist/chunk-2CFEET3Y.cjs.map +0 -1
  339. package/dist/chunk-2YGIBOUH.cjs.map +0 -1
  340. package/dist/chunk-4X3SBHPK.js.map +0 -1
  341. package/dist/chunk-6GS7JI64.cjs.map +0 -1
  342. package/dist/chunk-7HQVDLFI.cjs.map +0 -1
  343. package/dist/chunk-AM2CNBKE.js.map +0 -1
  344. package/dist/chunk-BBZYXVLZ.cjs.map +0 -1
  345. package/dist/chunk-BKRTYDVN.js +0 -312
  346. package/dist/chunk-BKRTYDVN.js.map +0 -1
  347. package/dist/chunk-CHVSMEKM.js.map +0 -1
  348. package/dist/chunk-GNPI5IWZ.js.map +0 -1
  349. package/dist/chunk-HI4ZW62S.js.map +0 -1
  350. package/dist/chunk-JJZ4NIAG.js.map +0 -1
  351. package/dist/chunk-KELIQH7K.js.map +0 -1
  352. package/dist/chunk-NACDF3PK.js.map +0 -1
  353. package/dist/chunk-QLAWEGTZ.cjs.map +0 -1
  354. package/dist/chunk-SDJYLCJK.cjs.map +0 -1
  355. package/dist/chunk-SXSPMRSV.cjs.map +0 -1
  356. package/dist/chunk-T6ZCG5AP.cjs.map +0 -1
  357. package/dist/chunk-V2EJLKGA.js.map +0 -1
  358. package/dist/chunk-W4FV7JBH.js.map +0 -1
  359. package/dist/chunk-XK54DTRF.cjs +0 -325
  360. package/dist/chunk-XK54DTRF.cjs.map +0 -1
  361. package/dist/chunk-XWCTBGYK.js.map +0 -1
  362. package/dist/chunk-YTO5BRBD.cjs.map +0 -1
  363. package/dist/chunk-ZNEE4WWQ.cjs.map +0 -1
  364. package/dist/compact-session-FBVWO6B3.cjs +0 -57
  365. package/dist/compact-session-XLXC2CZN.js +0 -20
  366. package/dist/context-4HGPCOH6.cjs +0 -22
  367. package/dist/context-DCECDKWN.js +0 -5
  368. package/dist/fs-session-store-2TF3ZWMT.js +0 -10
  369. package/dist/fs-session-store-TL4RJTXZ.cjs +0 -19
  370. package/dist/generate-object-E465DX5I.cjs +0 -20
  371. package/dist/generate-object-TVQCW2IZ.js +0 -7
  372. package/dist/index-manager-EA6FGIQG.js +0 -12
  373. package/dist/index-manager-HGGL4DD5.cjs +0 -21
  374. package/dist/judge-call-GVIJWQVE.cjs +0 -22
  375. package/dist/judge-call-QMKGC2ZK.js +0 -5
  376. package/dist/registry-GC7BQMSV.js +0 -9
  377. package/dist/registry-UBY26R4I.cjs +0 -46
  378. package/dist/session-transcript-SKIRBEJE.js +0 -5
  379. package/dist/session-transcript-TNAJ4O3M.cjs +0 -50
  380. package/dist/stream-object-QMNR3YFF.js +0 -7
  381. package/dist/stream-object-T4DAMNVB.cjs +0 -20
  382. package/dist/subagents-loader-3CXBQWWY.cjs +0 -15
  383. package/dist/subagents-loader-WN2SB6PV.js +0 -6
  384. package/docs/error-codes.md +0 -179
  385. package/docs/harness-capability-map.md +0 -304
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.53.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5cc5a81: Adds the `@theokit/sdk/mcp-auth` subpath: the OAuth PKCE flow for remote MCP servers
8
+ (`runPkceFlow`, `refreshAccessToken`) plus the token storage the two of them need
9
+ (`getTokens`, `setTokens`, `lockedRefresh`).
10
+
11
+ The implementation already existed and was tested; nothing exported it. A consumer
12
+ connecting to an MCP server that requires OAuth had to write RFC 7636 PKCE by hand — not
13
+ because the package lacked the code, but because there was no way in.
14
+
15
+ `lockedRefresh` ships alongside deliberately: two callers noticing an expired token at the
16
+ same moment will both refresh, and under a rotating refresh token the second one loses.
17
+
18
+ - 5112ac3: Two fixes on the transcript persistence path.
19
+
20
+ `readJsonlTail`'s `sinceMarker` matched the marker as a substring of the raw line, so a
21
+ transcript entry whose own text contained the marker word truncated the read there. The
22
+ caller asks for everything after the last compaction and silently got less. The marker is
23
+ now matched as a record FIELD (`subtype`, then `type`), which is what it always meant.
24
+
25
+ `appendJsonl` created the transcript directory with the umask, so under `umask 002` it was
26
+ born `0775` — group-writable — while the file inside it was carefully pinned to `0600`. A
27
+ private file in a directory others can write can be replaced wholesale. The directory is now
28
+ created `0700`, matching the file, and matching what `assertSecureModes` demands of the
29
+ shared `~/.theokit` tree.
30
+
31
+ ### Patch Changes
32
+
33
+ - cbb70c5: Security: the MCP OAuth token store now locks down its directory, and the shared permission gate stops refusing every store on Windows.
34
+
35
+ `setTokens` wrote through `atomicWriteJson`, whose parent-directory `mkdir` carries no mode, so `~/.theokit` was born 0775 under the common umask 002. The `chmod 600` on `mcp-tokens.json` then protects the wrong thing: write permission on a DIRECTORY is permission to unlink and recreate its contents, so another local user could replace the file wholesale — and the secret is a refresh token, so replacing it changes which account the agent authenticates as. The read path had no permission check at all, so the swap would be picked up silently.
36
+
37
+ The directory is created 0700 and `chmod`-ed unconditionally, because `mkdir`'s mode applies only at creation and the machines that need this fix already have the loose directory. Reads go through `assertSecureModes` — the same gate the credential file uses, deliberately the same implementation rather than a second dialect of the same rule.
38
+
39
+ Separately, `assertSecureModes` was unconditional and Windows has no POSIX mode bits: `statSync().mode` is synthetic there, so the gate refused every valid store and the credential path was unreadable on that platform. It now returns early on `win32`.
40
+
41
+ Behaviour change worth knowing: `getTokens` now THROWS `CredentialError` on a group- or world-writable store directory where it previously returned the tokens. That is intentional — returning them would hand back what may be an attacker's refresh token as if it were the user's — but a consumer catching nothing around `getTokens` will see the error surface. The fix on the operator side is `chmod 700 ~/.theokit`.
42
+
3
43
  ## 4.52.1
4
44
 
5
45
  ### Patch Changes
@@ -433,7 +473,7 @@
433
473
 
434
474
  The profile shipped `originator: "codex_cli_rs"` — the value the official Codex CLI sends for itself.
435
475
  Presenting another vendor's client name is a false statement of identity, and it diverged from the
436
- prior art this provider was adapted from: OpenCode sends its own name against the same endpoint,
476
+ prior art: third-party clients send their own name against the same endpoint,
437
477
  which also shows the route is not restricted to the official client.
438
478
 
439
479
  A test pinned the old value as the contract, which is how it survived review — correcting the
@@ -1037,7 +1077,7 @@ cwd })` previously compiled and was silently ignored — it hydrated the process
1037
1077
 
1038
1078
  ### Minor Changes
1039
1079
 
1040
- - Data-provider fleet (agent-builder M45): 9 new first-party builtins on a data-only `openAiCompatibleProfile` base — `google` (DIRECT Gemini via the OpenAI-compat endpoint, `GOOGLE_API_KEY`/`GEMINI_API_KEY`; distinct from the `gemini` OpenRouter passthrough), `mistral`, `groq`, `cohere` (via `api.cohere.ai/compatibility/v1`), `deepinfra`, `together` (alias `togetherai`), `xai` (alias `grok`), `perplexity`, `cerebras` — each ~10 lines with source-cited values. Two defects fixed: the chat_completions URL-join no longer doubles version segments (`…/v1/v1/chat/completions` — every version-suffixed catalog baseUrl was broken for streaming) via version-segment detection + a data-only `ProviderProfile.chatCompletionsPath` escape (existing builtins byte-identical, contract-asserted), and Google is finally reachable (the `google-gemini` catalog entry was silently skipped by an alias collision). The `anthropic_messages` transport now consumes `extraHeaders` + the provider `transform` (mirror of the M41 chat_completions wiring) and the anthropic builtin ships `anthropic-beta: interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14` (the sanctioned behavior delta); openrouter gains theokit's own attribution headers (`HTTP-Referer: https://usetheo.dev`, `X-Title: theokit`); cerebras sends `X-Cerebras-3rd-Party-Integration: theokit`. A table-driven contract suite asserts identity + the EXACT wire URL and headers per provider. Values adapted from OpenCode (MIT); see NOTICE.
1080
+ - Data-provider fleet (agent-builder M45): 9 new first-party builtins on a data-only `openAiCompatibleProfile` base — `google` (DIRECT Gemini via the OpenAI-compat endpoint, `GOOGLE_API_KEY`/`GEMINI_API_KEY`; distinct from the `gemini` OpenRouter passthrough), `mistral`, `groq`, `cohere` (via `api.cohere.ai/compatibility/v1`), `deepinfra`, `together` (alias `togetherai`), `xai` (alias `grok`), `perplexity`, `cerebras` — each ~10 lines with source-cited values. Two defects fixed: the chat_completions URL-join no longer doubles version segments (`…/v1/v1/chat/completions` — every version-suffixed catalog baseUrl was broken for streaming) via version-segment detection + a data-only `ProviderProfile.chatCompletionsPath` escape (existing builtins byte-identical, contract-asserted), and Google is finally reachable (the `google-gemini` catalog entry was silently skipped by an alias collision). The `anthropic_messages` transport now consumes `extraHeaders` + the provider `transform` (mirror of the M41 chat_completions wiring) and the anthropic builtin ships `anthropic-beta: interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14` (the sanctioned behavior delta); openrouter gains theokit's own attribution headers (`HTTP-Referer: https://usetheo.dev`, `X-Title: theokit`); cerebras sends `X-Cerebras-3rd-Party-Integration: theokit`. A table-driven contract suite asserts identity + the EXACT wire URL and headers per provider.
1041
1081
 
1042
1082
  ## 4.13.1
1043
1083
 
@@ -1049,7 +1089,7 @@ cwd })` previously compiled and was silently ignored — it hydrated the process
1049
1089
 
1050
1090
  ### Minor Changes
1051
1091
 
1052
- - Model catalog enrichment (agent-builder M44): the vendored `provider-catalog.json` now carries OPTIONAL per-model data (`models` block — models.dev shape verbatim: `cost{input,output,cache_read,cache_write}` USD-per-1M, `limit{context,input,output}`, `modalities`, `tool_call`/`reasoning`/`structured_output`/`cache_control`, `release_date`, `status`), loaded into an internal model-info index keyed `provider/model` (entry id + aliases). Fully additive: entries without `models` behave byte-identically, `ProviderProfile` is untouched, the 10 builtins + all 43 catalog entries keep resolving, and a malformed model sub-entry drops that model with WARN keeping the provider. DRY reconciliation: `resolveModelCapabilities` is now catalog-backed (the hand-curated EXACT map migrated into the catalog and was deleted — parity-tested over the full old-map snapshot), and `getPricingEntry` gains a step-5 catalog fallback on total LiteLLM miss (provenance `pricingVersion:"catalog-vendored"`; the LiteLLM snapshot keeps absolute precedence — and the new drift advisory caught a real stale rate: `openai/o3` corrected 10/40 → 2/8). New on `@theokit/sdk/models`: `getModelInfo(modelId)` (the enriched per-model view) and `refreshModelCatalog({url?, force?})` — an EXPLICIT opt-in models.dev refresh with a 1h-TTL atomic disk cache under `~/.theokit/cache/models-dev/`, kill-switch `THEOKIT_DISABLE_MODELS_FETCH`, and the vendored catalog as offline fallback; startup and requests never touch the network. Mechanism adapted from OpenCode's models.dev consumption (MIT); see NOTICE. Maintenance: `scripts/refresh-catalog.mjs` regenerates the curated vendored subset (30 models, +36KB).
1092
+ - Model catalog enrichment (agent-builder M44): the vendored `provider-catalog.json` now carries OPTIONAL per-model data (`models` block — models.dev shape verbatim: `cost{input,output,cache_read,cache_write}` USD-per-1M, `limit{context,input,output}`, `modalities`, `tool_call`/`reasoning`/`structured_output`/`cache_control`, `release_date`, `status`), loaded into an internal model-info index keyed `provider/model` (entry id + aliases). Fully additive: entries without `models` behave byte-identically, `ProviderProfile` is untouched, the 10 builtins + all 43 catalog entries keep resolving, and a malformed model sub-entry drops that model with WARN keeping the provider. DRY reconciliation: `resolveModelCapabilities` is now catalog-backed (the hand-curated EXACT map migrated into the catalog and was deleted — parity-tested over the full old-map snapshot), and `getPricingEntry` gains a step-5 catalog fallback on total LiteLLM miss (provenance `pricingVersion:"catalog-vendored"`; the LiteLLM snapshot keeps absolute precedence — and the new drift advisory caught a real stale rate: `openai/o3` corrected 10/40 → 2/8). New on `@theokit/sdk/models`: `getModelInfo(modelId)` (the enriched per-model view) and `refreshModelCatalog({url?, force?})` — an EXPLICIT opt-in models.dev refresh with a 1h-TTL atomic disk cache under `~/.theokit/cache/models-dev/`, kill-switch `THEOKIT_DISABLE_MODELS_FETCH`, and the vendored catalog as offline fallback; startup and requests never touch the network. Maintenance: `scripts/refresh-catalog.mjs` regenerates the curated vendored subset (30 models, +36KB).
1053
1093
 
1054
1094
  ## 4.12.2
1055
1095
 
@@ -1067,19 +1107,19 @@ cwd })` previously compiled and was silently ignored — it hydrated the process
1067
1107
 
1068
1108
  ### Minor Changes
1069
1109
 
1070
- - Codex provider as a builtin (agent-builder M43): a new first-class `openai-chatgpt` builtin `ProviderProfile` routes `openai-chatgpt/<model>` ids to the ChatGPT "Codex" backend (`https://chatgpt.com/backend-api/codex`, `responses_api`). Its `transform.fetch` resolves the LIVE credential from the ambient store per HTTP request — a freshly-refreshed Bearer + a dynamic `ChatGPT-Account-Id` header — so a mid-turn token expiry refreshes transparently with NO agent rebuild, and a not-logged-in request fails fast (no placeholder on the wire). The ambient store is `~/.theokit/auth.json` with a `THEOKIT_HOME` override so a consumer points it at its own store. Two account_id lifecycle fixes ship alongside: `ensureFreshCredential` now PRESERVES a stored `account_id` across refresh (OpenAI's refresh JWTs carry no top-level `account_id`), and `openaiDeviceLogin` JWT-extracts `chatgpt_account_id` at login. Protocol values + the OAuth config adapted from OpenCode (MIT); see NOTICE. Consumers add a provider in one SDK file; the Codex backend needs zero provider logic in the app.
1110
+ - Codex provider as a builtin (agent-builder M43): a new first-class `openai-chatgpt` builtin `ProviderProfile` routes `openai-chatgpt/<model>` ids to the ChatGPT "Codex" backend (`https://chatgpt.com/backend-api/codex`, `responses_api`). Its `transform.fetch` resolves the LIVE credential from the ambient store per HTTP request — a freshly-refreshed Bearer + a dynamic `ChatGPT-Account-Id` header — so a mid-turn token expiry refreshes transparently with NO agent rebuild, and a not-logged-in request fails fast (no placeholder on the wire). The ambient store is `~/.theokit/auth.json` with a `THEOKIT_HOME` override so a consumer points it at its own store. Two account_id lifecycle fixes ship alongside: `ensureFreshCredential` now PRESERVES a stored `account_id` across refresh (OpenAI's refresh JWTs carry no top-level `account_id`), and `openaiDeviceLogin` JWT-extracts `chatgpt_account_id` at login. Consumers add a provider in one SDK file; the Codex backend needs zero provider logic in the app.
1071
1111
 
1072
1112
  ## 4.11.1
1073
1113
 
1074
1114
  ### Patch Changes
1075
1115
 
1076
- - Auth subsystem review fixes (agent-builder M42), grounded in OpenCode's provider-auth model: (1) an oauth provider that resolves NO credential now fails fast with a `ConfigurationError` (the `MissingCredentialError` analog) instead of putting the `__oauth_lazy_token__` placeholder on the wire — OpenCode never sends a placeholder; (2) `resolveCredential` no longer attributes a provider-less or mismatched-provider stored key to the requested provider (fail-closed — prevents cross-vendor key exposure, e.g. an Anthropic key POSTed to api.openai.com). The credential store/engine mechanics are unchanged.
1116
+ - Auth subsystem review fixes (agent-builder M42), grounded in the provider-auth model: (1) an oauth provider that resolves NO credential now fails fast with a `ConfigurationError` (the `MissingCredentialError` analog) instead of putting the `__oauth_lazy_token__` placeholder on the wire — a placeholder is never sent; (2) `resolveCredential` no longer attributes a provider-less or mismatched-provider stored key to the requested provider (fail-closed — prevents cross-vendor key exposure, e.g. an Anthropic key POSTed to api.openai.com). The credential store/engine mechanics are unchanged.
1077
1117
 
1078
1118
  ## 4.11.0
1079
1119
 
1080
1120
  ### Minor Changes
1081
1121
 
1082
- - Auth subsystem (agent-builder M42): a new `@theokit/sdk/auth` sub-entry ships a credential store + OAuth engine, promoted DOWN from agent-builder's hardened M37 code, generalized to `provider: string` + a caller-supplied `CredentialStoreConfig` (no hardcoded client IDs). Public surface (`import { … } from "@theokit/sdk/auth"`): `resolveCredential(name)` returns a fresh (transparently-refreshed) `ResolvedCredential`; the credential store (`writeCredential`/`readAuthFile`/`readStoredOAuth`/`authFilePath`/`credentialHome`/`CredentialError`), the OAuth engine (`exchangeCode`/`refreshOAuthTokens`/`ensureFreshCredential`/`persistOAuthTokens`), the device flows (`deviceLogin`/`openaiDeviceLogin`/`requestDeviceCode`/`pollDeviceToken`/`requestOpenAIUsercode`/`parseJwtClaims`/`extractAccountId`), and the contract types (`CredentialStoreConfig`, `ResolvedCredential`, `StoredOAuthCredential`, `OAuthProviderConfig`, `OAuthTokens`, `HttpDeps`, `DeviceOAuthConfig`, `OpenAIDeviceConfig`, …). It sits at a dedicated sub-entry (DTS via tsc) — the same isolation as `@theokit/sdk/messages` / `/subscription` / `/sanitize` — because rollup-plugin-dts cannot bundle the modules into the main barrel. The credential store does an atomic O_EXCL + rename + fsync write at mode 0600 with 0700/0600 mode gates; the OAuth engine implements RFC 8628 device-grant + the OpenAI two-step headless flow + token exchange/refresh with in-flight-refresh coalescing (keyed by store path, rejected promise evicted — single-use refresh tokens are never double-spent) and a no-token-in-error discipline. The router's lazy-sentinel path now covers `oauth_device_code` / `oauth_external` so an oauth provider builds a client whose M41 `transform.fetch(ctx)` owns the fresh bearer at stream time — a mid-turn expiry refreshes without rebuilding the agent, and plain (api-key/env) profiles resolve byte-for-byte unchanged. Device-grant + JWT extraction + OpenAI two-step adapted from OpenCode (MIT); see NOTICE.
1122
+ - Auth subsystem (agent-builder M42): a new `@theokit/sdk/auth` sub-entry ships a credential store + OAuth engine, promoted DOWN from agent-builder's hardened M37 code, generalized to `provider: string` + a caller-supplied `CredentialStoreConfig` (no hardcoded client IDs). Public surface (`import { … } from "@theokit/sdk/auth"`): `resolveCredential(name)` returns a fresh (transparently-refreshed) `ResolvedCredential`; the credential store (`writeCredential`/`readAuthFile`/`readStoredOAuth`/`authFilePath`/`credentialHome`/`CredentialError`), the OAuth engine (`exchangeCode`/`refreshOAuthTokens`/`ensureFreshCredential`/`persistOAuthTokens`), the device flows (`deviceLogin`/`openaiDeviceLogin`/`requestDeviceCode`/`pollDeviceToken`/`requestOpenAIUsercode`/`parseJwtClaims`/`extractAccountId`), and the contract types (`CredentialStoreConfig`, `ResolvedCredential`, `StoredOAuthCredential`, `OAuthProviderConfig`, `OAuthTokens`, `HttpDeps`, `DeviceOAuthConfig`, `OpenAIDeviceConfig`, …). It sits at a dedicated sub-entry (DTS via tsc) — the same isolation as `@theokit/sdk/messages` / `/subscription` / `/sanitize` — because rollup-plugin-dts cannot bundle the modules into the main barrel. The credential store does an atomic O_EXCL + rename + fsync write at mode 0600 with 0700/0600 mode gates; the OAuth engine implements RFC 8628 device-grant + the OpenAI two-step headless flow + token exchange/refresh with in-flight-refresh coalescing (keyed by store path, rejected promise evicted — single-use refresh tokens are never double-spent) and a no-token-in-error discipline. The router's lazy-sentinel path now covers `oauth_device_code` / `oauth_external` so an oauth provider builds a client whose M41 `transform.fetch(ctx)` owns the fresh bearer at stream time — a mid-turn expiry refreshes without rebuilding the agent, and plain (api-key/env) profiles resolve byte-for-byte unchanged.
1083
1123
 
1084
1124
  ## 4.10.1
1085
1125
 
@@ -1091,7 +1131,7 @@ cwd })` previously compiled and was silently ignored — it hydrated the process
1091
1131
 
1092
1132
  ### Minor Changes
1093
1133
 
1094
- - Provider `transform` seam (agent-builder M41): `ProviderProfile` gains an optional `transform` (dynamic `headers(ctx)` + refresh-aware `fetch(ctx)`), fed through `selectTransport` into the `chat_completions` + `responses_api` transports — a provider can now own its per-request auth/headers. A profile without `transform` takes the static path byte-for-byte. Contract-shape adaptation of OpenCode's provider `auth.loader` (MIT).
1134
+ - Provider `transform` seam (agent-builder M41): `ProviderProfile` gains an optional `transform` (dynamic `headers(ctx)` + refresh-aware `fetch(ctx)`), fed through `selectTransport` into the `chat_completions` + `responses_api` transports — a provider can now own its per-request auth/headers. A profile without `transform` takes the static path byte-for-byte.
1095
1135
 
1096
1136
  ## 4.9.1
1097
1137
 
@@ -1103,7 +1143,7 @@ cwd })` previously compiled and was silently ignored — it hydrated the process
1103
1143
 
1104
1144
  ### Minor Changes
1105
1145
 
1106
- - `responses_api` transport (agent-builder M40): a `ResponsesApiClient` for the OpenAI Responses API (ChatGPT Codex backend + any responses provider). The `responses_api` apiMode was declared but had no transport (`selectTransport` threw); this ships it — body build + SSE state machine, consuming `baseUrl` + `extraHeaders`. Protocol shape adapted from OpenCode's `openai-responses.ts` (MIT), recorded fixtures as golden tests.
1146
+ - `responses_api` transport (agent-builder M40): a `ResponsesApiClient` for the OpenAI Responses API (ChatGPT Codex backend + any responses provider). The `responses_api` apiMode was declared but had no transport (`selectTransport` threw); this ships it — body build + SSE state machine, consuming `baseUrl` + `extraHeaders`. Recorded fixtures serve as golden tests.
1107
1147
 
1108
1148
  ## 4.8.0
1109
1149
 
package/LICENSE CHANGED
@@ -137,8 +137,8 @@
137
137
 
138
138
  6. Trademarks. This License does not grant permission to use the trade
139
139
  names, trademarks, service marks, or product names of the Licensor,
140
- except as required for describing the origin of the Work and
141
- reproducing the content of the NOTICE file.
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
142
 
143
143
  7. Disclaimer of Warranty. Unless required by applicable law or
144
144
  agreed to in writing, Licensor provides the Work (and each
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <p align="center">
2
- <a href="https://usetheo.dev">
3
- <img src="https://usetheo.dev/logo-128.png" alt="Theo" height="80" />
2
+ <a href="https://github.com/usetheokit/theokit-sdk">
3
+ <img src="https://raw.githubusercontent.com/usetheodev/theokit-sdk/main/assets/logo.png" alt="TheoKit" height="96" />
4
4
  </a>
5
5
  </p>
6
6
 
@@ -13,7 +13,7 @@
13
13
  Same agent surface, local or cloud. No vendor lock-in.
14
14
  </p>
15
15
  <p align="center">
16
- <a href="LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square"></a>
16
+ <a href="https://github.com/usetheokit/theokit-sdk/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-DE2329?style=flat-square"></a>
17
17
  <img alt="TypeScript" src="https://img.shields.io/badge/typescript-5.8%2B-3178C6?style=flat-square&logo=typescript&logoColor=white">
18
18
  <img alt="Node" src="https://img.shields.io/badge/node-22.12%2B-339933?style=flat-square&logo=node.js&logoColor=white">
19
19
  <img alt="Status" src="https://img.shields.io/badge/status-public%20beta-orange?style=flat-square">
@@ -24,11 +24,11 @@
24
24
 
25
25
  > **Public beta.** APIs may change before general availability.
26
26
 
27
- For the full reference, see the [root README](https://github.com/usetheodev/theokit-sdk#readme) and the [**Harness Capability Map**](https://github.com/usetheodev/theokit-sdk/blob/main/wiki/reference/harness-capability-map.md). The exported TypeScript types are the canonical contract.
27
+ For the full reference, see the [root README](https://github.com/usetheokit/theokit-sdk#readme). The exported TypeScript types are the canonical contract.
28
28
 
29
29
  ## Capability map
30
30
 
31
- New here? The [**Theo Harness Capability Map**](https://github.com/usetheodev/theokit-sdk/blob/main/wiki/reference/harness-capability-map.md) is the discovery front-door — every harness primitive with its import path, signature, and a one-line example (find `compactTranscript`, `buildRepoMap`, `isTransientError`, `@theokit/sdk/persistence`, ... without reading source). The exported TypeScript types are the canonical contract.
31
+ New here? The exported TypeScript types are the discovery front-door and the canonical contract — every harness primitive with its import path, signature and JSDoc example (`compactTranscript`, `buildRepoMap`, `isTransientError`, `@theokit/sdk/persistence`, ...), surfaced by your editor.
32
32
 
33
33
  It also **ships inside this package** — no network needed, and pinned to the version you installed:
34
34
 
@@ -7,6 +7,7 @@
7
7
  //
8
8
  // Usage: theokit-migrate-config [--cwd <path>] [--apply] [--no-backup] [--help]
9
9
 
10
+ import { randomBytes } from "node:crypto";
10
11
  import { existsSync } from "node:fs";
11
12
  import { mkdir, readdir, readFile, rename, writeFile } from "node:fs/promises";
12
13
  import { join } from "node:path";
@@ -53,10 +54,18 @@ manual edits). Atomic write per file (crash mid-write is safe).
53
54
  );
54
55
  }
55
56
 
56
- /** Atomic write: tmpfile + rename. Mirrors atomicWriteText in the SDK. */
57
+ /**
58
+ * Atomic write: tmpfile + rename. Mirrors atomicWriteText in the SDK.
59
+ *
60
+ * The suffix comes from `randomBytes`, matching `atomicWriteTempPath` in
61
+ * src/internal/persistence/atomic-write.ts — `<file>.<pid>.<16 hex>.tmp`. It used
62
+ * `Math.random()`, which this comment already claimed it did not: a temp name in a
63
+ * directory an attacker can also write to is guessable, and the window between
64
+ * choosing the name and `rename` is where a symlink gets planted.
65
+ */
57
66
  async function atomicWriteText(filePath, content) {
58
67
  await mkdir(join(filePath, ".."), { recursive: true });
59
- const tmp = `${filePath}.${process.pid}.${Math.random().toString(36).slice(2, 10)}.tmp`;
68
+ const tmp = `${filePath}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
60
69
  await writeFile(tmp, content, "utf8");
61
70
  await rename(tmp, filePath);
62
71
  }
@@ -1299,8 +1299,8 @@ interface ProviderTransformContext {
1299
1299
  * M41 — the one OPTIONAL behavior seam on a provider profile. It lets a provider own its per-request auth:
1300
1300
  * `fetch` is the universal seam (a provider that returns its own fetch fully controls headers + refresh, for
1301
1301
  * every transport that accepts a fetch); `headers` is a convenience merged over `extraHeaders` on transports
1302
- * that carry them (responses_api). This is the CONTRACT-shape adaptation of OpenCode's provider `auth.loader`
1303
- * (MIT © 2025 opencode — `packages/core/src/plugin/provider/*.ts`), retargeted to theokit's transport model.
1302
+ * that carry them (responses_api). A provider owns its per-request auth material plus transparent token
1303
+ * refresh, expressed against theokit's transport model.
1304
1304
  * Closes the gap where a `ProviderProfile` could only declare STATIC headers.
1305
1305
  *
1306
1306
  * @public
@@ -1510,9 +1510,25 @@ interface LocalOptions {
1510
1510
  enabled: boolean;
1511
1511
  };
1512
1512
  /**
1513
- * SE40 — base directory for the native Claude-shaped session transcript
1514
- * (`<baseDir>/projects/<encoded-cwd>/<agentId>.jsonl`). Default `~/.theokit`.
1513
+ * Directory for the native Claude-shaped session transcript
1514
+ * (`<sessionDir>/projects/<encoded-cwd>/<agentId>.jsonl`). Default `~/.theokit`.
1515
1515
  * Set to `~/.claude` to write sessions the Claude Code CLI can `--continue`.
1516
+ *
1517
+ * **This is not the working directory** — that is {@link LocalOptions.cwd},
1518
+ * four lines above. Only transcripts are written here.
1519
+ *
1520
+ * Introduced in #301 as the unambiguous name for what `baseDir` always meant.
1521
+ */
1522
+ sessionDir?: string;
1523
+ /**
1524
+ * @deprecated Renamed to {@link LocalOptions.sessionDir} (#301). Still honoured,
1525
+ * and `sessionDir` wins when both are set.
1526
+ *
1527
+ * "Base directory" reads as the directory the agent works in, sitting in an
1528
+ * interface whose `cwd` is the one that actually means that. Setting it to
1529
+ * `"./"` — which is what the name invites — runs without error and writes
1530
+ * `./projects/<encoded-cwd>/<agentId>.jsonl` into the caller's repository root.
1531
+ * Nothing warns, because nothing is wrong from the code's point of view.
1516
1532
  */
1517
1533
  baseDir?: string;
1518
1534
  /**
@@ -1820,10 +1836,7 @@ interface AgentOptions {
1820
1836
  *
1821
1837
  * `'run'` (DEFAULT, and the historical behaviour) spawns a client per `send` and drops it when the
1822
1838
  * run ends. `'session'` pools clients per `(agentId, server, config)` and keeps them across turns,
1823
- * which is what the reference does Codex holds its MCP runtime in `SessionServices`
1824
- * (`codex-rs/core/src/state/service.rs:51-58`; theokit#155 corrected the earlier
1825
- * `core/src/state/service.rs:116`, which named a parameter of `install_mcp_runtime`, not the
1826
- * owning field). Measured cost of the per-run path: 193 / 138 / 134 ms of spawn + handshake on
1839
+ * which keeps the MCP runtime alive across turns. Measured cost of the per-run path: 193 / 138 / 134 ms of spawn + handshake on
1827
1840
  * every turn.
1828
1841
  *
1829
1842
  * Opt-in rather than default because it changes the FAILURE model: a server that dies mid-session
@@ -0,0 +1,50 @@
1
+ export { Agent } from './chunk-G3JWXOGY.js';
2
+ import './chunk-GOVJO4YE.js';
3
+ import './chunk-PGP7IOJ2.js';
4
+ import './chunk-2SFBB54R.js';
5
+ import './chunk-XROIW6BH.js';
6
+ import './chunk-K2BQQ445.js';
7
+ import './chunk-B6HOIWQ6.js';
8
+ import './chunk-LS3LMQ23.js';
9
+ import './chunk-GBBDINFK.js';
10
+ import './chunk-4QEC4CCS.js';
11
+ import './chunk-BERBYXFH.js';
12
+ import './chunk-SEL2ZQMT.js';
13
+ import './chunk-HKCKOAIO.js';
14
+ import './chunk-34XOCZJO.js';
15
+ import './chunk-PBZ7HMBP.js';
16
+ import './chunk-KSWHTR54.js';
17
+ import './chunk-FFM3SJTQ.js';
18
+ import './chunk-OXNYIMZZ.js';
19
+ import './chunk-FD2UT76F.js';
20
+ import './chunk-U54XCYG3.js';
21
+ import './chunk-NAF4L3T6.js';
22
+ import './chunk-RP5HQVLD.js';
23
+ import './chunk-6X6ID4MO.js';
24
+ import './chunk-4NAKHID5.js';
25
+ import './chunk-7AD3ZTZL.js';
26
+ import './chunk-3WVMJY7F.js';
27
+ import './chunk-R5YZACGK.js';
28
+ import './chunk-POWRZSK4.js';
29
+ import './chunk-N5CR3TJZ.js';
30
+ import './chunk-NZL4BNFQ.js';
31
+ import './chunk-MSFLYJDY.js';
32
+ import './chunk-2XLKLVVR.js';
33
+ import './chunk-V26QVGUG.js';
34
+ import './chunk-4VPXM6UU.js';
35
+ import './chunk-6AZDM6LK.js';
36
+ import './chunk-UFIXH26P.js';
37
+ import './chunk-HE4BIAOS.js';
38
+ import './chunk-X2FR4OIT.js';
39
+ import './chunk-HSQ5Q3I5.js';
40
+ import './chunk-SSDD676S.js';
41
+ import './chunk-3V7UJLQT.js';
42
+ import './chunk-5NBUH3NO.js';
43
+ import './chunk-OY7O3Q6R.js';
44
+ import './chunk-SK4QLUBK.js';
45
+ import './chunk-RIAM53CP.js';
46
+ import './chunk-DGOG5NXR.js';
47
+ import './chunk-U4UJHOSH.js';
48
+ import './chunk-5F5NWKPN.js';
49
+ //# sourceMappingURL=agent-FFVV4U5N.js.map
50
+ //# sourceMappingURL=agent-FFVV4U5N.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-RDHK6MVT.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-FFVV4U5N.js"}
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var chunkF77UENR6_cjs = require('./chunk-F77UENR6.cjs');
4
+ require('./chunk-2D43RD5D.cjs');
5
+ require('./chunk-665SFFFR.cjs');
6
+ require('./chunk-BV2MWEMV.cjs');
7
+ require('./chunk-XPR366DL.cjs');
8
+ require('./chunk-BUUUWQMB.cjs');
9
+ require('./chunk-OUOXM36O.cjs');
10
+ require('./chunk-2FYEVT2B.cjs');
11
+ require('./chunk-3X6PM7DU.cjs');
12
+ require('./chunk-4JBHSLQO.cjs');
13
+ require('./chunk-D75S2X6I.cjs');
14
+ require('./chunk-BDTVFIPB.cjs');
15
+ require('./chunk-2ZPEDVLM.cjs');
16
+ require('./chunk-OKLYRPKL.cjs');
17
+ require('./chunk-HAWE74GQ.cjs');
18
+ require('./chunk-RAHSWE5C.cjs');
19
+ require('./chunk-SVO5WPZX.cjs');
20
+ require('./chunk-2RW7K6FN.cjs');
21
+ require('./chunk-MUUQ2WFJ.cjs');
22
+ require('./chunk-6JSIEDKL.cjs');
23
+ require('./chunk-FRITRLZQ.cjs');
24
+ require('./chunk-B4YA6BRS.cjs');
25
+ require('./chunk-NINIJCHU.cjs');
26
+ require('./chunk-L5YO6PWL.cjs');
27
+ require('./chunk-VJ26EKGJ.cjs');
28
+ require('./chunk-WQ53UQL4.cjs');
29
+ require('./chunk-C5DEO6OI.cjs');
30
+ require('./chunk-3BK6YR5P.cjs');
31
+ require('./chunk-Y4AXQOT4.cjs');
32
+ require('./chunk-TTJ54H3E.cjs');
33
+ require('./chunk-JIQRXKTA.cjs');
34
+ require('./chunk-YLQQX5W2.cjs');
35
+ require('./chunk-VGPXHHF3.cjs');
36
+ require('./chunk-WJVHMTKB.cjs');
37
+ require('./chunk-C4H6PB5J.cjs');
38
+ require('./chunk-E7FJOO4G.cjs');
39
+ require('./chunk-ADLLFY3H.cjs');
40
+ require('./chunk-VYHJZVL5.cjs');
41
+ require('./chunk-VUKQL3L2.cjs');
42
+ require('./chunk-VF7X6HDR.cjs');
43
+ require('./chunk-5YKNEMXR.cjs');
44
+ require('./chunk-C6Y6CWYD.cjs');
45
+ require('./chunk-ZN2DGEY3.cjs');
46
+ require('./chunk-ZT57WTUJ.cjs');
47
+ require('./chunk-VKJ7V7EB.cjs');
48
+ require('./chunk-SZHU7A5B.cjs');
49
+ require('./chunk-LPVIRJVF.cjs');
50
+ require('./chunk-BM6N4KHO.cjs');
51
+
52
+
53
+
54
+ Object.defineProperty(exports, "Agent", {
55
+ enumerable: true,
56
+ get: function () { return chunkF77UENR6_cjs.Agent; }
57
+ });
58
+ //# sourceMappingURL=agent-YLAHVHEH.cjs.map
59
+ //# sourceMappingURL=agent-YLAHVHEH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-U2R2R5JP.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-YLAHVHEH.cjs"}
@@ -1299,8 +1299,8 @@ interface ProviderTransformContext {
1299
1299
  * M41 — the one OPTIONAL behavior seam on a provider profile. It lets a provider own its per-request auth:
1300
1300
  * `fetch` is the universal seam (a provider that returns its own fetch fully controls headers + refresh, for
1301
1301
  * every transport that accepts a fetch); `headers` is a convenience merged over `extraHeaders` on transports
1302
- * that carry them (responses_api). This is the CONTRACT-shape adaptation of OpenCode's provider `auth.loader`
1303
- * (MIT © 2025 opencode — `packages/core/src/plugin/provider/*.ts`), retargeted to theokit's transport model.
1302
+ * that carry them (responses_api). A provider owns its per-request auth material plus transparent token
1303
+ * refresh, expressed against theokit's transport model.
1304
1304
  * Closes the gap where a `ProviderProfile` could only declare STATIC headers.
1305
1305
  *
1306
1306
  * @public
@@ -1510,9 +1510,25 @@ interface LocalOptions {
1510
1510
  enabled: boolean;
1511
1511
  };
1512
1512
  /**
1513
- * SE40 — base directory for the native Claude-shaped session transcript
1514
- * (`<baseDir>/projects/<encoded-cwd>/<agentId>.jsonl`). Default `~/.theokit`.
1513
+ * Directory for the native Claude-shaped session transcript
1514
+ * (`<sessionDir>/projects/<encoded-cwd>/<agentId>.jsonl`). Default `~/.theokit`.
1515
1515
  * Set to `~/.claude` to write sessions the Claude Code CLI can `--continue`.
1516
+ *
1517
+ * **This is not the working directory** — that is {@link LocalOptions.cwd},
1518
+ * four lines above. Only transcripts are written here.
1519
+ *
1520
+ * Introduced in #301 as the unambiguous name for what `baseDir` always meant.
1521
+ */
1522
+ sessionDir?: string;
1523
+ /**
1524
+ * @deprecated Renamed to {@link LocalOptions.sessionDir} (#301). Still honoured,
1525
+ * and `sessionDir` wins when both are set.
1526
+ *
1527
+ * "Base directory" reads as the directory the agent works in, sitting in an
1528
+ * interface whose `cwd` is the one that actually means that. Setting it to
1529
+ * `"./"` — which is what the name invites — runs without error and writes
1530
+ * `./projects/<encoded-cwd>/<agentId>.jsonl` into the caller's repository root.
1531
+ * Nothing warns, because nothing is wrong from the code's point of view.
1516
1532
  */
1517
1533
  baseDir?: string;
1518
1534
  /**
@@ -1820,10 +1836,7 @@ interface AgentOptions {
1820
1836
  *
1821
1837
  * `'run'` (DEFAULT, and the historical behaviour) spawns a client per `send` and drops it when the
1822
1838
  * run ends. `'session'` pools clients per `(agentId, server, config)` and keeps them across turns,
1823
- * which is what the reference does Codex holds its MCP runtime in `SessionServices`
1824
- * (`codex-rs/core/src/state/service.rs:51-58`; theokit#155 corrected the earlier
1825
- * `core/src/state/service.rs:116`, which named a parameter of `install_mcp_runtime`, not the
1826
- * owning field). Measured cost of the per-run path: 193 / 138 / 134 ms of spawn + handshake on
1839
+ * which keeps the MCP runtime alive across turns. Measured cost of the per-run path: 193 / 138 / 134 ms of spawn + handshake on
1827
1840
  * every turn.
1828
1841
  *
1829
1842
  * Opt-in rather than default because it changes the FAILURE model: a server that dies mid-session
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var chunkD75S2X6I_cjs = require('./chunk-D75S2X6I.cjs');
4
+ require('./chunk-Y4AXQOT4.cjs');
5
+ require('./chunk-C4H6PB5J.cjs');
6
+ require('./chunk-BM6N4KHO.cjs');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "appendCompactBoundaryRecord", {
11
+ enumerable: true,
12
+ get: function () { return chunkD75S2X6I_cjs.appendCompactBoundaryRecord; }
13
+ });
14
+ Object.defineProperty(exports, "persistTurn", {
15
+ enumerable: true,
16
+ get: function () { return chunkD75S2X6I_cjs.persistTurn; }
17
+ });
18
+ Object.defineProperty(exports, "readSessionMessages", {
19
+ enumerable: true,
20
+ get: function () { return chunkD75S2X6I_cjs.readSessionMessages; }
21
+ });
22
+ //# sourceMappingURL=agent-session-store-DUGBAX5V.cjs.map
23
+ //# sourceMappingURL=agent-session-store-DUGBAX5V.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-session-store-EPX2WQI4.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-session-store-DUGBAX5V.cjs"}
@@ -0,0 +1,6 @@
1
+ export { appendCompactBoundaryRecord, persistTurn, readSessionMessages } from './chunk-BERBYXFH.js';
2
+ import './chunk-N5CR3TJZ.js';
3
+ import './chunk-6AZDM6LK.js';
4
+ import './chunk-5F5NWKPN.js';
5
+ //# sourceMappingURL=agent-session-store-TNCGL5RN.js.map
6
+ //# sourceMappingURL=agent-session-store-TNCGL5RN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-session-store-JMU7ASDB.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-session-store-TNCGL5RN.js"}
package/dist/agent.d.ts CHANGED
@@ -45,7 +45,22 @@ export declare class Agent {
45
45
  */
46
46
  static create(options: AgentOptions): Promise<SDKAgent>;
47
47
  /**
48
- * One-shot prompt: create an agent, send a single message, wait, dispose.
48
+ * One-shot prompt: create an agent, send a single message, wait, **dispose**.
49
+ *
50
+ * `Agent.prompt` is STATIC and owns the agent's whole lifecycle. To send to an
51
+ * agent you already hold, use the instance method — `agent.send(message)` —
52
+ * which keeps the conversation and does not dispose anything:
53
+ *
54
+ * ```ts
55
+ * const agent = await Agent.create({ ... });
56
+ * const run = await agent.send("first"); // NOT agent.prompt(...)
57
+ * const run2 = await agent.send("follow-up"); // full context retained
58
+ * ```
59
+ *
60
+ * There is no `agent.prompt()` (#302). The natural sentence for the second
61
+ * operation is "prompt the agent", so it is the method people reach for; the
62
+ * two differ in whether the agent survives the call, which is why they do not
63
+ * share a name.
49
64
  *
50
65
  * When `options.throwOnError === true`, rejects with `AgentRunError` if
51
66
  * the run terminates with `status: 'error'` (instead of resolving with the
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkFRITRLZQ_cjs = require('../chunk-FRITRLZQ.cjs');
4
- var chunkXK54DTRF_cjs = require('../chunk-XK54DTRF.cjs');
4
+ var chunkVF7X6HDR_cjs = require('../chunk-VF7X6HDR.cjs');
5
+ var chunk5YKNEMXR_cjs = require('../chunk-5YKNEMXR.cjs');
5
6
  var chunkC6Y6CWYD_cjs = require('../chunk-C6Y6CWYD.cjs');
6
- require('../chunk-2YGIBOUH.cjs');
7
- require('../chunk-SXSPMRSV.cjs');
7
+ require('../chunk-LPVIRJVF.cjs');
8
+ require('../chunk-BM6N4KHO.cjs');
8
9
 
9
10
  // src/internal/auth/oauth-device.ts
10
11
  var POLLING_SAFETY_MARGIN_MS = 3e3;
@@ -87,7 +88,7 @@ async function pollDeviceToken(config, grant, deps) {
87
88
  return {
88
89
  access: data.access_token,
89
90
  // Some device-grant providers (e.g. GitHub) issue no separate refresh token — reuse the access
90
- // token as the refresh handle, mirroring OpenCode's copilot flow.
91
+ // token as the refresh handle.
91
92
  refresh: data.refresh_token ?? data.access_token,
92
93
  expires: deps.now() + expiresIn * 1e3,
93
94
  ...accountId !== void 0 ? { accountId } : {}
@@ -184,7 +185,7 @@ async function openaiDeviceLogin(config, deps, hooks) {
184
185
  "device poll returned no authorization_code"
185
186
  );
186
187
  }
187
- const tokens = await chunkXK54DTRF_cjs.exchangeCode(
188
+ const tokens = await chunkVF7X6HDR_cjs.exchangeCode(
188
189
  config,
189
190
  { code: data.authorization_code, verifier: data.code_verifier },
190
191
  deps
@@ -230,53 +231,53 @@ Object.defineProperty(exports, "providerFromApiKeyPrefix", {
230
231
  enumerable: true,
231
232
  get: function () { return chunkFRITRLZQ_cjs.providerFromApiKeyPrefix; }
232
233
  });
233
- Object.defineProperty(exports, "CredentialError", {
234
+ Object.defineProperty(exports, "ensureFreshCredential", {
234
235
  enumerable: true,
235
- get: function () { return chunkXK54DTRF_cjs.CredentialError; }
236
+ get: function () { return chunkVF7X6HDR_cjs.ensureFreshCredential; }
236
237
  });
237
- Object.defineProperty(exports, "assertSecureModes", {
238
+ Object.defineProperty(exports, "exchangeCode", {
238
239
  enumerable: true,
239
- get: function () { return chunkXK54DTRF_cjs.assertSecureModes; }
240
+ get: function () { return chunkVF7X6HDR_cjs.exchangeCode; }
240
241
  });
241
- Object.defineProperty(exports, "authFilePath", {
242
+ Object.defineProperty(exports, "persistOAuthTokens", {
242
243
  enumerable: true,
243
- get: function () { return chunkXK54DTRF_cjs.authFilePath; }
244
+ get: function () { return chunkVF7X6HDR_cjs.persistOAuthTokens; }
244
245
  });
245
- Object.defineProperty(exports, "credentialHome", {
246
+ Object.defineProperty(exports, "refreshOAuthTokens", {
246
247
  enumerable: true,
247
- get: function () { return chunkXK54DTRF_cjs.credentialHome; }
248
+ get: function () { return chunkVF7X6HDR_cjs.refreshOAuthTokens; }
248
249
  });
249
- Object.defineProperty(exports, "ensureFreshCredential", {
250
+ Object.defineProperty(exports, "resolveCredential", {
250
251
  enumerable: true,
251
- get: function () { return chunkXK54DTRF_cjs.ensureFreshCredential; }
252
+ get: function () { return chunkVF7X6HDR_cjs.resolveCredential; }
252
253
  });
253
- Object.defineProperty(exports, "exchangeCode", {
254
+ Object.defineProperty(exports, "CredentialError", {
254
255
  enumerable: true,
255
- get: function () { return chunkXK54DTRF_cjs.exchangeCode; }
256
+ get: function () { return chunk5YKNEMXR_cjs.CredentialError; }
256
257
  });
257
- Object.defineProperty(exports, "persistOAuthTokens", {
258
+ Object.defineProperty(exports, "assertSecureModes", {
258
259
  enumerable: true,
259
- get: function () { return chunkXK54DTRF_cjs.persistOAuthTokens; }
260
+ get: function () { return chunk5YKNEMXR_cjs.assertSecureModes; }
260
261
  });
261
- Object.defineProperty(exports, "readAuthFile", {
262
+ Object.defineProperty(exports, "authFilePath", {
262
263
  enumerable: true,
263
- get: function () { return chunkXK54DTRF_cjs.readAuthFile; }
264
+ get: function () { return chunk5YKNEMXR_cjs.authFilePath; }
264
265
  });
265
- Object.defineProperty(exports, "readStoredOAuth", {
266
+ Object.defineProperty(exports, "credentialHome", {
266
267
  enumerable: true,
267
- get: function () { return chunkXK54DTRF_cjs.readStoredOAuth; }
268
+ get: function () { return chunk5YKNEMXR_cjs.credentialHome; }
268
269
  });
269
- Object.defineProperty(exports, "refreshOAuthTokens", {
270
+ Object.defineProperty(exports, "readAuthFile", {
270
271
  enumerable: true,
271
- get: function () { return chunkXK54DTRF_cjs.refreshOAuthTokens; }
272
+ get: function () { return chunk5YKNEMXR_cjs.readAuthFile; }
272
273
  });
273
- Object.defineProperty(exports, "resolveCredential", {
274
+ Object.defineProperty(exports, "readStoredOAuth", {
274
275
  enumerable: true,
275
- get: function () { return chunkXK54DTRF_cjs.resolveCredential; }
276
+ get: function () { return chunk5YKNEMXR_cjs.readStoredOAuth; }
276
277
  });
277
278
  Object.defineProperty(exports, "writeCredential", {
278
279
  enumerable: true,
279
- get: function () { return chunkXK54DTRF_cjs.writeCredential; }
280
+ get: function () { return chunk5YKNEMXR_cjs.writeCredential; }
280
281
  });
281
282
  exports.deviceLogin = deviceLogin;
282
283
  exports.extractAccountId = extractAccountId;