@theokit/sdk 4.37.2 → 4.38.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 (364) hide show
  1. package/CHANGELOG.md +72 -72
  2. package/dist/agent-2GZC4W2A.cjs +51 -0
  3. package/dist/{agent-IE6IE4NW.cjs.map → agent-2GZC4W2A.cjs.map} +1 -1
  4. package/dist/agent-3H3UKD6U.js +42 -0
  5. package/dist/{agent-DW2J37IH.js.map → agent-3H3UKD6U.js.map} +1 -1
  6. package/dist/{agent-SmxntivO.d.ts → agent-C3AEtM-W.d.ts} +39 -37
  7. package/dist/{agent-DGv1-d81.d.cts → agent-U3lBX-5t.d.cts} +39 -37
  8. package/dist/agent.d.ts +1 -1
  9. package/dist/auth/index.cjs +15 -15
  10. package/dist/auth/index.js +4 -4
  11. package/dist/{batch-SY5GZLFD.js → batch-LXSALQC3.js} +9 -9
  12. package/dist/{batch-SY5GZLFD.js.map → batch-LXSALQC3.js.map} +1 -1
  13. package/dist/{batch-3SEPDXCU.cjs → batch-NZGN6SFV.cjs} +23 -23
  14. package/dist/{batch-3SEPDXCU.cjs.map → batch-NZGN6SFV.cjs.map} +1 -1
  15. package/dist/{chunk-D4ZUJTFB.cjs → chunk-2K7PRHDB.cjs} +8 -8
  16. package/dist/{chunk-D4ZUJTFB.cjs.map → chunk-2K7PRHDB.cjs.map} +1 -1
  17. package/dist/chunk-2R6NBT5F.cjs +112 -0
  18. package/dist/chunk-2R6NBT5F.cjs.map +1 -0
  19. package/dist/{chunk-2423XDPT.cjs → chunk-3BSP7LSG.cjs} +26 -26
  20. package/dist/{chunk-2423XDPT.cjs.map → chunk-3BSP7LSG.cjs.map} +1 -1
  21. package/dist/{chunk-6EDQBX7U.cjs → chunk-3MUIYMUG.cjs} +17 -17
  22. package/dist/{chunk-6EDQBX7U.cjs.map → chunk-3MUIYMUG.cjs.map} +1 -1
  23. package/dist/{chunk-P34DHHYQ.cjs → chunk-3VKTDQMX.cjs} +34 -27
  24. package/dist/chunk-3VKTDQMX.cjs.map +1 -0
  25. package/dist/{chunk-77WHPVXE.js → chunk-3XKVRLR2.js} +4 -4
  26. package/dist/chunk-3XKVRLR2.js.map +1 -0
  27. package/dist/{chunk-SWIBQFPH.cjs → chunk-3XRXORBS.cjs} +4 -4
  28. package/dist/{chunk-SWIBQFPH.cjs.map → chunk-3XRXORBS.cjs.map} +1 -1
  29. package/dist/{chunk-DCJ5MCJ3.js → chunk-4APWS2YF.js} +7 -7
  30. package/dist/{chunk-DCJ5MCJ3.js.map → chunk-4APWS2YF.js.map} +1 -1
  31. package/dist/{chunk-56ZM6P7Z.cjs → chunk-4MWBKBS4.cjs} +12 -12
  32. package/dist/chunk-4MWBKBS4.cjs.map +1 -0
  33. package/dist/chunk-4NVV3GRU.js +110 -0
  34. package/dist/chunk-4NVV3GRU.js.map +1 -0
  35. package/dist/{chunk-QGDKZDPN.js → chunk-4WIJSKFA.js} +3 -3
  36. package/dist/{chunk-QGDKZDPN.js.map → chunk-4WIJSKFA.js.map} +1 -1
  37. package/dist/{chunk-VNNK6AKU.js → chunk-5BVBNE2F.js} +3 -3
  38. package/dist/chunk-5BVBNE2F.js.map +1 -0
  39. package/dist/{chunk-EEZ7CFMM.js → chunk-5KOW3GLE.js} +2 -2
  40. package/dist/chunk-5KOW3GLE.js.map +1 -0
  41. package/dist/{chunk-FK4EJD2I.cjs → chunk-6OIO4FYX.cjs} +7 -7
  42. package/dist/{chunk-FK4EJD2I.cjs.map → chunk-6OIO4FYX.cjs.map} +1 -1
  43. package/dist/{chunk-IEUDKUPM.cjs → chunk-6OKPJZMX.cjs} +8 -8
  44. package/dist/{chunk-IEUDKUPM.cjs.map → chunk-6OKPJZMX.cjs.map} +1 -1
  45. package/dist/{chunk-QFMXXUUT.js → chunk-6XZBKFQ7.js} +3 -3
  46. package/dist/{chunk-QFMXXUUT.js.map → chunk-6XZBKFQ7.js.map} +1 -1
  47. package/dist/{chunk-H5YVJB4K.cjs → chunk-6ZGD7R27.cjs} +37 -37
  48. package/dist/chunk-6ZGD7R27.cjs.map +1 -0
  49. package/dist/{chunk-HEN5WXXI.js → chunk-7QDTZJRV.js} +6 -6
  50. package/dist/{chunk-HEN5WXXI.js.map → chunk-7QDTZJRV.js.map} +1 -1
  51. package/dist/{chunk-MHCKWQR3.cjs → chunk-A3MHE2MQ.cjs} +8 -8
  52. package/dist/{chunk-MHCKWQR3.cjs.map → chunk-A3MHE2MQ.cjs.map} +1 -1
  53. package/dist/{chunk-5SB4V74H.js → chunk-A4XXV2C6.js} +18 -18
  54. package/dist/chunk-A4XXV2C6.js.map +1 -0
  55. package/dist/{chunk-6VP3XGEK.js → chunk-A6GXYF2Q.js} +9 -9
  56. package/dist/{chunk-6VP3XGEK.js.map → chunk-A6GXYF2Q.js.map} +1 -1
  57. package/dist/{chunk-SDIBMLL5.js → chunk-ACHGT3D2.js} +8 -8
  58. package/dist/{chunk-SDIBMLL5.js.map → chunk-ACHGT3D2.js.map} +1 -1
  59. package/dist/{chunk-XAEAMI5H.js → chunk-AOZYORH7.js} +4 -4
  60. package/dist/chunk-AOZYORH7.js.map +1 -0
  61. package/dist/{chunk-LTCOPATU.cjs → chunk-BE3W4HYV.cjs} +2 -2
  62. package/dist/chunk-BE3W4HYV.cjs.map +1 -0
  63. package/dist/{chunk-NQ4AC2U4.cjs → chunk-BT6DFWZB.cjs} +9 -9
  64. package/dist/{chunk-NQ4AC2U4.cjs.map → chunk-BT6DFWZB.cjs.map} +1 -1
  65. package/dist/{chunk-XAYVHS2B.cjs → chunk-BUGVDCI5.cjs} +4 -4
  66. package/dist/{chunk-XAYVHS2B.cjs.map → chunk-BUGVDCI5.cjs.map} +1 -1
  67. package/dist/{chunk-IT3PWBW4.cjs → chunk-BURYFNOM.cjs} +2 -2
  68. package/dist/chunk-BURYFNOM.cjs.map +1 -0
  69. package/dist/{chunk-NNSKJCBM.cjs → chunk-D3SJLXYZ.cjs} +10 -10
  70. package/dist/{chunk-NNSKJCBM.cjs.map → chunk-D3SJLXYZ.cjs.map} +1 -1
  71. package/dist/{chunk-MRODLUGY.cjs → chunk-ED7ANP6W.cjs} +4 -4
  72. package/dist/{chunk-MRODLUGY.cjs.map → chunk-ED7ANP6W.cjs.map} +1 -1
  73. package/dist/{chunk-MXSMAGDU.js → chunk-EDI7DBWO.js} +33 -26
  74. package/dist/chunk-EDI7DBWO.js.map +1 -0
  75. package/dist/{chunk-T4QWDOG6.js → chunk-EE24WJJR.js} +5 -5
  76. package/dist/{chunk-T4QWDOG6.js.map → chunk-EE24WJJR.js.map} +1 -1
  77. package/dist/{chunk-ZJN6NTHE.js → chunk-EUB7YLU2.js} +3 -3
  78. package/dist/{chunk-ZJN6NTHE.js.map → chunk-EUB7YLU2.js.map} +1 -1
  79. package/dist/{chunk-ALU3KC4G.cjs → chunk-G7X2Y7Y2.cjs} +156 -156
  80. package/dist/chunk-G7X2Y7Y2.cjs.map +1 -0
  81. package/dist/{chunk-YCXMSDSP.js → chunk-HHUDNTZC.js} +4 -4
  82. package/dist/{chunk-YCXMSDSP.js.map → chunk-HHUDNTZC.js.map} +1 -1
  83. package/dist/{chunk-GL7CFBVC.js → chunk-HI6G3SNY.js} +48 -48
  84. package/dist/chunk-HI6G3SNY.js.map +1 -0
  85. package/dist/{chunk-G6AASL5T.cjs → chunk-HLK35TD7.cjs} +24 -24
  86. package/dist/{chunk-G6AASL5T.cjs.map → chunk-HLK35TD7.cjs.map} +1 -1
  87. package/dist/{chunk-4YB7B3RP.cjs → chunk-IBDE4R5L.cjs} +13 -13
  88. package/dist/{chunk-4YB7B3RP.cjs.map → chunk-IBDE4R5L.cjs.map} +1 -1
  89. package/dist/{chunk-WDGCZDRG.js → chunk-JCXIDFRI.js} +3 -3
  90. package/dist/{chunk-WDGCZDRG.js.map → chunk-JCXIDFRI.js.map} +1 -1
  91. package/dist/{chunk-I35DI7ES.js → chunk-JI34KBNC.js} +3 -3
  92. package/dist/{chunk-I35DI7ES.js.map → chunk-JI34KBNC.js.map} +1 -1
  93. package/dist/{chunk-TAPQWDW2.js → chunk-KCZW75PI.js} +2 -2
  94. package/dist/chunk-KCZW75PI.js.map +1 -0
  95. package/dist/{chunk-U2WLFOA3.cjs → chunk-KL7E244K.cjs} +4 -4
  96. package/dist/{chunk-U2WLFOA3.cjs.map → chunk-KL7E244K.cjs.map} +1 -1
  97. package/dist/{chunk-PAEJPLVN.cjs → chunk-KTXOHCAE.cjs} +4 -4
  98. package/dist/{chunk-PAEJPLVN.cjs.map → chunk-KTXOHCAE.cjs.map} +1 -1
  99. package/dist/{chunk-2WFB5ZOX.js → chunk-KWXC6ERT.js} +5 -5
  100. package/dist/{chunk-2WFB5ZOX.js.map → chunk-KWXC6ERT.js.map} +1 -1
  101. package/dist/{chunk-56OXYUZE.js → chunk-LGCEYEU2.js} +3 -3
  102. package/dist/chunk-LGCEYEU2.js.map +1 -0
  103. package/dist/{chunk-FAY3QDGC.cjs → chunk-M4OGSS66.cjs} +11 -11
  104. package/dist/{chunk-FAY3QDGC.cjs.map → chunk-M4OGSS66.cjs.map} +1 -1
  105. package/dist/{chunk-F6Y4IEQM.js → chunk-M6UUTNDT.js} +4 -4
  106. package/dist/{chunk-F6Y4IEQM.js.map → chunk-M6UUTNDT.js.map} +1 -1
  107. package/dist/{chunk-GM7QDQ24.cjs → chunk-MXRBNJ6D.cjs} +11 -11
  108. package/dist/{chunk-GM7QDQ24.cjs.map → chunk-MXRBNJ6D.cjs.map} +1 -1
  109. package/dist/{chunk-YPQF26X7.cjs → chunk-OBA6YK2R.cjs} +2 -2
  110. package/dist/chunk-OBA6YK2R.cjs.map +1 -0
  111. package/dist/{chunk-BJMKQOY2.cjs → chunk-OFWU6UKF.cjs} +11 -11
  112. package/dist/{chunk-BJMKQOY2.cjs.map → chunk-OFWU6UKF.cjs.map} +1 -1
  113. package/dist/{chunk-3O2ELBST.cjs → chunk-PG3QQLWS.cjs} +5 -5
  114. package/dist/{chunk-3O2ELBST.cjs.map → chunk-PG3QQLWS.cjs.map} +1 -1
  115. package/dist/{chunk-2ONFGMBV.js → chunk-PY2RQOA7.js} +2 -2
  116. package/dist/chunk-PY2RQOA7.js.map +1 -0
  117. package/dist/{chunk-UQPDFW4E.js → chunk-QFWQLXCL.js} +3 -3
  118. package/dist/{chunk-UQPDFW4E.js.map → chunk-QFWQLXCL.js.map} +1 -1
  119. package/dist/{chunk-YBFDBOUN.cjs → chunk-QJQ2MAZF.cjs} +8 -8
  120. package/dist/{chunk-YBFDBOUN.cjs.map → chunk-QJQ2MAZF.cjs.map} +1 -1
  121. package/dist/{chunk-QUFSDDNU.cjs → chunk-R4AMI7KD.cjs} +15 -15
  122. package/dist/{chunk-QUFSDDNU.cjs.map → chunk-R4AMI7KD.cjs.map} +1 -1
  123. package/dist/{chunk-CSZRJ4RE.js → chunk-SGTMDQ4O.js} +5 -5
  124. package/dist/{chunk-CSZRJ4RE.js.map → chunk-SGTMDQ4O.js.map} +1 -1
  125. package/dist/{chunk-3ILFUXNE.cjs → chunk-SRIF7HMN.cjs} +5 -5
  126. package/dist/{chunk-3ILFUXNE.cjs.map → chunk-SRIF7HMN.cjs.map} +1 -1
  127. package/dist/{chunk-THEYGCYS.cjs → chunk-TKDWD3MU.cjs} +4 -4
  128. package/dist/chunk-TKDWD3MU.cjs.map +1 -0
  129. package/dist/{chunk-ZW345YOI.js → chunk-UD2T7ISG.js} +4 -4
  130. package/dist/{chunk-ZW345YOI.js.map → chunk-UD2T7ISG.js.map} +1 -1
  131. package/dist/{chunk-EXQV452X.js → chunk-UWEALKAN.js} +3 -3
  132. package/dist/{chunk-EXQV452X.js.map → chunk-UWEALKAN.js.map} +1 -1
  133. package/dist/{chunk-W52DKZBR.cjs → chunk-UZBA6YYP.cjs} +454 -333
  134. package/dist/chunk-UZBA6YYP.cjs.map +1 -0
  135. package/dist/{chunk-VYJSHGAY.js → chunk-VUDH4D2M.js} +201 -80
  136. package/dist/chunk-VUDH4D2M.js.map +1 -0
  137. package/dist/{chunk-W4QN5CMG.cjs → chunk-VVMLMKYZ.cjs} +9 -9
  138. package/dist/{chunk-W4QN5CMG.cjs.map → chunk-VVMLMKYZ.cjs.map} +1 -1
  139. package/dist/{chunk-JNIWFCKI.js → chunk-VYD6BGKK.js} +3 -3
  140. package/dist/{chunk-JNIWFCKI.js.map → chunk-VYD6BGKK.js.map} +1 -1
  141. package/dist/{chunk-YHZXBDAW.js → chunk-XJ5TMOGA.js} +16 -16
  142. package/dist/{chunk-YHZXBDAW.js.map → chunk-XJ5TMOGA.js.map} +1 -1
  143. package/dist/{chunk-7DXLNNKH.cjs → chunk-XKBJT7WI.cjs} +4 -4
  144. package/dist/{chunk-7DXLNNKH.cjs.map → chunk-XKBJT7WI.cjs.map} +1 -1
  145. package/dist/{chunk-YDLNI7J6.js → chunk-XS7SKY2F.js} +3 -3
  146. package/dist/{chunk-YDLNI7J6.js.map → chunk-XS7SKY2F.js.map} +1 -1
  147. package/dist/{chunk-NFCKEBHI.js → chunk-YCHC45BY.js} +3 -3
  148. package/dist/{chunk-NFCKEBHI.js.map → chunk-YCHC45BY.js.map} +1 -1
  149. package/dist/{chunk-ICYBIC6N.cjs → chunk-YVI4YPUP.cjs} +4 -4
  150. package/dist/chunk-YVI4YPUP.cjs.map +1 -0
  151. package/dist/{chunk-TQI3KRXZ.cjs → chunk-ZET34IZE.cjs} +18 -18
  152. package/dist/{chunk-TQI3KRXZ.cjs.map → chunk-ZET34IZE.cjs.map} +1 -1
  153. package/dist/{chunk-GLUWH6JO.js → chunk-ZFZYPLQI.js} +4 -4
  154. package/dist/{chunk-GLUWH6JO.js.map → chunk-ZFZYPLQI.js.map} +1 -1
  155. package/dist/{chunk-M5ZQBOIZ.js → chunk-ZK3BJ4XQ.js} +3 -3
  156. package/dist/{chunk-M5ZQBOIZ.js.map → chunk-ZK3BJ4XQ.js.map} +1 -1
  157. package/dist/{chunk-CD73YHEH.js → chunk-ZYOHF37V.js} +3 -3
  158. package/dist/{chunk-CD73YHEH.js.map → chunk-ZYOHF37V.js.map} +1 -1
  159. package/dist/compact-session-RR3ILTES.js +17 -0
  160. package/dist/{compact-session-WNKKIIDW.js.map → compact-session-RR3ILTES.js.map} +1 -1
  161. package/dist/compact-session-YOWJJPPB.cjs +54 -0
  162. package/dist/{compact-session-H5TKLD55.cjs.map → compact-session-YOWJJPPB.cjs.map} +1 -1
  163. package/dist/compaction.cjs +19 -19
  164. package/dist/compaction.d.cts +9 -9
  165. package/dist/compaction.d.ts +9 -9
  166. package/dist/compaction.js +3 -3
  167. package/dist/concurrency.cjs +6 -6
  168. package/dist/concurrency.js +4 -4
  169. package/dist/context-Q6ISOCN2.cjs +22 -0
  170. package/dist/{context-ZV33V4DC.cjs.map → context-Q6ISOCN2.cjs.map} +1 -1
  171. package/dist/context-ZDBBPIHY.js +5 -0
  172. package/dist/{context-VAYLPT4O.js.map → context-ZDBBPIHY.js.map} +1 -1
  173. package/dist/{cron-BiK_aNJI.d.cts → cron-BdXOZco9.d.cts} +2 -2
  174. package/dist/{cron-Dx7B-3WB.d.ts → cron-ChQ6zcW2.d.ts} +2 -2
  175. package/dist/cron.cjs +29 -29
  176. package/dist/cron.d.cts +3 -3
  177. package/dist/cron.d.ts +3 -3
  178. package/dist/cron.js +28 -28
  179. package/dist/{errors-DyVbXdR4.d.cts → errors-BUVjJGJA.d.cts} +1 -1
  180. package/dist/{errors-Cua4WC9H.d.ts → errors-CZIUKLHt.d.ts} +1 -1
  181. package/dist/errors.cjs +21 -21
  182. package/dist/errors.d.cts +2 -2
  183. package/dist/errors.d.ts +2 -2
  184. package/dist/errors.js +2 -2
  185. package/dist/eval.cjs +32 -32
  186. package/dist/eval.js +28 -28
  187. package/dist/{executor-PAH72CB5.js → executor-ASDDIM2X.js} +7 -7
  188. package/dist/{executor-PAH72CB5.js.map → executor-ASDDIM2X.js.map} +1 -1
  189. package/dist/{executor-OZSYXDKF.cjs → executor-DPCBSI35.cjs} +23 -23
  190. package/dist/{executor-OZSYXDKF.cjs.map → executor-DPCBSI35.cjs.map} +1 -1
  191. package/dist/filesystem/index.cjs +7 -7
  192. package/dist/filesystem/index.js +3 -3
  193. package/dist/fs-session-store-K5QUPNJZ.js +10 -0
  194. package/dist/{fs-session-store-6MY7PNI2.js.map → fs-session-store-K5QUPNJZ.js.map} +1 -1
  195. package/dist/fs-session-store-T5ZLQX42.cjs +19 -0
  196. package/dist/{fs-session-store-7E7UPLF2.cjs.map → fs-session-store-T5ZLQX42.cjs.map} +1 -1
  197. package/dist/generate-object-F56VIZ6U.cjs +20 -0
  198. package/dist/{generate-object-5SCEH2EE.cjs.map → generate-object-F56VIZ6U.cjs.map} +1 -1
  199. package/dist/generate-object-LPSO6GVW.js +7 -0
  200. package/dist/{generate-object-I7UD4NWN.js.map → generate-object-LPSO6GVW.js.map} +1 -1
  201. package/dist/index-manager-DBJ55ZSO.cjs +19 -0
  202. package/dist/{index-manager-R6ZJFEZF.cjs.map → index-manager-DBJ55ZSO.cjs.map} +1 -1
  203. package/dist/index-manager-F2H2RCZU.js +10 -0
  204. package/dist/{index-manager-KKAK7NT3.js.map → index-manager-F2H2RCZU.js.map} +1 -1
  205. package/dist/index.cjs +140 -140
  206. package/dist/index.cjs.map +1 -1
  207. package/dist/index.d.cts +42 -42
  208. package/dist/index.d.ts +42 -42
  209. package/dist/index.js +54 -54
  210. package/dist/index.js.map +1 -1
  211. package/dist/{inject-session-DM4SKTZO.cjs → inject-session-25EC74WV.cjs} +10 -10
  212. package/dist/{inject-session-DM4SKTZO.cjs.map → inject-session-25EC74WV.cjs.map} +1 -1
  213. package/dist/{inject-session-UXNJQTZ6.js → inject-session-RKNLUE72.js} +7 -7
  214. package/dist/{inject-session-UXNJQTZ6.js.map → inject-session-RKNLUE72.js.map} +1 -1
  215. package/dist/internal/agent-loop/live-events.d.ts +46 -0
  216. package/dist/internal/budget/compute-cost.d.ts +1 -1
  217. package/dist/internal/diagnostics.d.ts +31 -29
  218. package/dist/internal/error-mappers/anthropic.d.ts +1 -1
  219. package/dist/internal/global-singleton.d.ts +7 -7
  220. package/dist/internal/judge/judge-call.d.ts +14 -14
  221. package/dist/internal/llm/retrying-client.d.ts +29 -29
  222. package/dist/internal/llm/transport-error.d.ts +2 -2
  223. package/dist/internal/persistence/exclusive-create.d.cts +2 -2
  224. package/dist/internal/persistence/exclusive-create.d.ts +2 -2
  225. package/dist/internal/persistence/fs-session-store.d.cts +18 -18
  226. package/dist/internal/persistence/fs-session-store.d.ts +18 -18
  227. package/dist/internal/persistence/index.cjs +25 -25
  228. package/dist/internal/persistence/index.cjs.map +1 -1
  229. package/dist/internal/persistence/index.js +6 -6
  230. package/dist/internal/persistence/index.js.map +1 -1
  231. package/dist/internal/persistence/paths.d.cts +7 -7
  232. package/dist/internal/persistence/paths.d.ts +7 -7
  233. package/dist/internal/persistence/session-transcript.d.cts +7 -7
  234. package/dist/internal/persistence/session-transcript.d.ts +7 -7
  235. package/dist/internal/persistence/session-writer.d.cts +30 -13
  236. package/dist/internal/persistence/session-writer.d.ts +30 -13
  237. package/dist/internal/runtime/fixtures/fixture-run-base.d.ts +45 -13
  238. package/dist/internal/runtime/lifecycle/goal-marker.d.ts +8 -8
  239. package/dist/internal/security/index.cjs +13 -13
  240. package/dist/internal/security/index.js +3 -3
  241. package/dist/internal/session/agent-session.d.ts +14 -14
  242. package/dist/internal/session/session-cache.d.ts +9 -9
  243. package/dist/judge-call-3S3T6O2Z.js +5 -0
  244. package/dist/{judge-call-TAEIXMYG.js.map → judge-call-3S3T6O2Z.js.map} +1 -1
  245. package/dist/judge-call-XIQJ5GIE.cjs +22 -0
  246. package/dist/{judge-call-SP3G3X2Y.cjs.map → judge-call-XIQJ5GIE.cjs.map} +1 -1
  247. package/dist/models.cjs +20 -20
  248. package/dist/models.cjs.map +1 -1
  249. package/dist/models.js +5 -5
  250. package/dist/models.js.map +1 -1
  251. package/dist/path-safety.cjs +10 -10
  252. package/dist/path-safety.js +3 -3
  253. package/dist/persistence.cjs +34 -34
  254. package/dist/persistence.cjs.map +1 -1
  255. package/dist/persistence.d.cts +1 -1
  256. package/dist/persistence.d.ts +1 -1
  257. package/dist/persistence.js +14 -14
  258. package/dist/persistence.js.map +1 -1
  259. package/dist/project.cjs +5 -5
  260. package/dist/project.js +3 -3
  261. package/dist/registry-BA3SLAN7.cjs +46 -0
  262. package/dist/{registry-N3GTKYCI.cjs.map → registry-BA3SLAN7.cjs.map} +1 -1
  263. package/dist/registry-KMI5RA22.js +9 -0
  264. package/dist/{registry-SOXE4RY6.js.map → registry-KMI5RA22.js.map} +1 -1
  265. package/dist/retry.cjs +4 -4
  266. package/dist/retry.js +3 -3
  267. package/dist/{run-until-YZ2ODWOF.js → run-until-BK56WG4P.js} +3 -3
  268. package/dist/{run-until-YZ2ODWOF.js.map → run-until-BK56WG4P.js.map} +1 -1
  269. package/dist/{run-until-ZZ2JLPJM.cjs → run-until-L5KQD3PV.cjs} +4 -4
  270. package/dist/{run-until-ZZ2JLPJM.cjs.map → run-until-L5KQD3PV.cjs.map} +1 -1
  271. package/dist/{run-CwEJtLPE.d.ts → run-vJHg2eGw.d.cts} +201 -174
  272. package/dist/{run-CwEJtLPE.d.cts → run-vJHg2eGw.d.ts} +201 -174
  273. package/dist/sandbox/bwrap.d.cts +20 -20
  274. package/dist/sandbox/bwrap.d.ts +20 -20
  275. package/dist/sandbox/index.cjs +39 -39
  276. package/dist/sandbox/index.cjs.map +1 -1
  277. package/dist/sandbox/index.d.cts +1 -1
  278. package/dist/sandbox/index.d.ts +1 -1
  279. package/dist/sandbox/index.js +35 -35
  280. package/dist/sandbox/index.js.map +1 -1
  281. package/dist/sandbox/linux-sandbox.d.cts +26 -21
  282. package/dist/sandbox/linux-sandbox.d.ts +26 -21
  283. package/dist/server/auth/index.cjs.map +1 -1
  284. package/dist/server/auth/index.d.cts +6 -6
  285. package/dist/server/auth/index.d.ts +6 -6
  286. package/dist/server/auth/index.js.map +1 -1
  287. package/dist/server/auth/orchestrator.d.cts +2 -2
  288. package/dist/server/auth/orchestrator.d.ts +2 -2
  289. package/dist/server/auth/types.d.cts +4 -4
  290. package/dist/server/auth/types.d.ts +4 -4
  291. package/dist/server/errors-envelope.cjs +14 -14
  292. package/dist/server/errors-envelope.d.cts +3 -3
  293. package/dist/server/errors-envelope.d.ts +3 -3
  294. package/dist/server/errors-envelope.js +3 -3
  295. package/dist/session-transcript-DFGX6WNL.cjs +50 -0
  296. package/dist/{session-transcript-EAKR4D2W.cjs.map → session-transcript-DFGX6WNL.cjs.map} +1 -1
  297. package/dist/session-transcript-MMPWCESR.js +5 -0
  298. package/dist/{session-transcript-6WKLYIN4.js.map → session-transcript-MMPWCESR.js.map} +1 -1
  299. package/dist/skills.cjs +7 -7
  300. package/dist/skills.js +5 -5
  301. package/dist/stream-object-AFERZU63.js +7 -0
  302. package/dist/{stream-object-OFM66VUT.js.map → stream-object-AFERZU63.js.map} +1 -1
  303. package/dist/stream-object-YPXZ4F5P.cjs +20 -0
  304. package/dist/{stream-object-Y7YCX3BI.cjs.map → stream-object-YPXZ4F5P.cjs.map} +1 -1
  305. package/dist/subagents-loader.cjs +6 -6
  306. package/dist/subagents-loader.d.cts +2 -2
  307. package/dist/subagents-loader.d.ts +2 -2
  308. package/dist/subagents-loader.js +4 -4
  309. package/dist/subscription/index.cjs +3 -3
  310. package/dist/subscription/index.js +2 -2
  311. package/dist/task-store.cjs +7 -7
  312. package/dist/task-store.js +4 -4
  313. package/dist/types/agent-prims.d.ts +4 -4
  314. package/dist/types/goal-events.d.ts +24 -23
  315. package/dist/types/run.d.ts +27 -0
  316. package/dist/types/session-record.d.ts +14 -13
  317. package/dist/workflow.cjs +27 -27
  318. package/dist/workflow.js +6 -6
  319. package/package.json +12 -13
  320. package/dist/agent-DW2J37IH.js +0 -42
  321. package/dist/agent-IE6IE4NW.cjs +0 -51
  322. package/dist/chunk-2ONFGMBV.js.map +0 -1
  323. package/dist/chunk-56OXYUZE.js.map +0 -1
  324. package/dist/chunk-56ZM6P7Z.cjs.map +0 -1
  325. package/dist/chunk-5SB4V74H.js.map +0 -1
  326. package/dist/chunk-77WHPVXE.js.map +0 -1
  327. package/dist/chunk-ALU3KC4G.cjs.map +0 -1
  328. package/dist/chunk-EEZ7CFMM.js.map +0 -1
  329. package/dist/chunk-GL7CFBVC.js.map +0 -1
  330. package/dist/chunk-H5YVJB4K.cjs.map +0 -1
  331. package/dist/chunk-ICYBIC6N.cjs.map +0 -1
  332. package/dist/chunk-IT3PWBW4.cjs.map +0 -1
  333. package/dist/chunk-ITLS5LRF.cjs +0 -105
  334. package/dist/chunk-ITLS5LRF.cjs.map +0 -1
  335. package/dist/chunk-LTCOPATU.cjs.map +0 -1
  336. package/dist/chunk-MXSMAGDU.js.map +0 -1
  337. package/dist/chunk-P34DHHYQ.cjs.map +0 -1
  338. package/dist/chunk-TAPQWDW2.js.map +0 -1
  339. package/dist/chunk-THEYGCYS.cjs.map +0 -1
  340. package/dist/chunk-VNNK6AKU.js.map +0 -1
  341. package/dist/chunk-VYJSHGAY.js.map +0 -1
  342. package/dist/chunk-W52DKZBR.cjs.map +0 -1
  343. package/dist/chunk-XAEAMI5H.js.map +0 -1
  344. package/dist/chunk-YPQF26X7.cjs.map +0 -1
  345. package/dist/chunk-YVTNFKZO.js +0 -103
  346. package/dist/chunk-YVTNFKZO.js.map +0 -1
  347. package/dist/compact-session-H5TKLD55.cjs +0 -54
  348. package/dist/compact-session-WNKKIIDW.js +0 -17
  349. package/dist/context-VAYLPT4O.js +0 -5
  350. package/dist/context-ZV33V4DC.cjs +0 -22
  351. package/dist/fs-session-store-6MY7PNI2.js +0 -10
  352. package/dist/fs-session-store-7E7UPLF2.cjs +0 -19
  353. package/dist/generate-object-5SCEH2EE.cjs +0 -20
  354. package/dist/generate-object-I7UD4NWN.js +0 -7
  355. package/dist/index-manager-KKAK7NT3.js +0 -10
  356. package/dist/index-manager-R6ZJFEZF.cjs +0 -19
  357. package/dist/judge-call-SP3G3X2Y.cjs +0 -22
  358. package/dist/judge-call-TAEIXMYG.js +0 -5
  359. package/dist/registry-N3GTKYCI.cjs +0 -46
  360. package/dist/registry-SOXE4RY6.js +0 -9
  361. package/dist/session-transcript-6WKLYIN4.js +0 -5
  362. package/dist/session-transcript-EAKR4D2W.cjs +0 -50
  363. package/dist/stream-object-OFM66VUT.js +0 -7
  364. package/dist/stream-object-Y7YCX3BI.cjs +0 -20
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkH5YVJB4K_cjs = require('./chunk-H5YVJB4K.cjs');
4
- var chunkIT3PWBW4_cjs = require('./chunk-IT3PWBW4.cjs');
5
- var chunkIEUDKUPM_cjs = require('./chunk-IEUDKUPM.cjs');
6
- require('./chunk-ICYBIC6N.cjs');
7
- require('./chunk-LTCOPATU.cjs');
3
+ var chunk6ZGD7R27_cjs = require('./chunk-6ZGD7R27.cjs');
4
+ var chunkBURYFNOM_cjs = require('./chunk-BURYFNOM.cjs');
5
+ var chunk6OKPJZMX_cjs = require('./chunk-6OKPJZMX.cjs');
6
+ require('./chunk-YVI4YPUP.cjs');
7
+ require('./chunk-BE3W4HYV.cjs');
8
8
 
9
9
  // src/internal/session/inject-session.ts
10
10
  async function injectSessionTurn(opts) {
11
- await chunkH5YVJB4K_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
11
+ await chunk6ZGD7R27_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
12
12
  const prior = await opts.store.readRecords(opts.loc.agentId);
13
- const transcript = chunkIEUDKUPM_cjs.SessionTranscript.fromRecords(prior, {
13
+ const transcript = chunk6OKPJZMX_cjs.SessionTranscript.fromRecords(prior, {
14
14
  cwd: opts.loc.cwd,
15
15
  sessionId: opts.sessionId,
16
16
  model: opts.loc.model ?? "unknown"
@@ -18,10 +18,10 @@ async function injectSessionTurn(opts) {
18
18
  transcript.appendUserTurn(opts.userText);
19
19
  transcript.appendAssistantTurn({ text: opts.assistantText });
20
20
  await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));
21
- chunkIT3PWBW4_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
21
+ chunkBURYFNOM_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
22
22
  });
23
23
  }
24
24
 
25
25
  exports.injectSessionTurn = injectSessionTurn;
26
- //# sourceMappingURL=inject-session-DM4SKTZO.cjs.map
27
- //# sourceMappingURL=inject-session-DM4SKTZO.cjs.map
26
+ //# sourceMappingURL=inject-session-25EC74WV.cjs.map
27
+ //# sourceMappingURL=inject-session-25EC74WV.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-DM4SKTZO.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-25EC74WV.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -1,8 +1,8 @@
1
- import { enqueueSessionWrite } from './chunk-5SB4V74H.js';
2
- import { invalidateSessionCache } from './chunk-EEZ7CFMM.js';
3
- import { SessionTranscript } from './chunk-XAEAMI5H.js';
4
- import './chunk-56OXYUZE.js';
5
- import './chunk-TAPQWDW2.js';
1
+ import { enqueueSessionWrite } from './chunk-A4XXV2C6.js';
2
+ import { invalidateSessionCache } from './chunk-5KOW3GLE.js';
3
+ import { SessionTranscript } from './chunk-AOZYORH7.js';
4
+ import './chunk-LGCEYEU2.js';
5
+ import './chunk-KCZW75PI.js';
6
6
 
7
7
  // src/internal/session/inject-session.ts
8
8
  async function injectSessionTurn(opts) {
@@ -21,5 +21,5 @@ async function injectSessionTurn(opts) {
21
21
  }
22
22
 
23
23
  export { injectSessionTurn };
24
- //# sourceMappingURL=inject-session-UXNJQTZ6.js.map
25
- //# sourceMappingURL=inject-session-UXNJQTZ6.js.map
24
+ //# sourceMappingURL=inject-session-RKNLUE72.js.map
25
+ //# sourceMappingURL=inject-session-RKNLUE72.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-UXNJQTZ6.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-RKNLUE72.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -0,0 +1,46 @@
1
+ import type { SDKMessage } from "../../types/messages.js";
2
+ /**
3
+ * theokit#140 — the loop's event log, reporting each event AS IT HAPPENS.
4
+ *
5
+ * ## The defect this closes
6
+ *
7
+ * `runAgentLoop` collected events into a plain array and returned it, so nothing reached the run
8
+ * until the loop had finished. `RealLocalRun.applyAgentLoopOutput` then copied the whole batch in
9
+ * one pass. Meanwhile `SendOptions.onDelta` fired live from inside that same loop.
10
+ *
11
+ * Two clocks, one of which does not start until the other has stopped. A consumer that wanted tool
12
+ * calls interleaved with tokens in true order had to fuse both surfaces itself — which is exactly
13
+ * what `@theokit/agents` was doing, and the documented root of its ordering bug (theokit#47), its
14
+ * namespace-dedup bug (theokit#138) and its missing terminal frame (theokit#142).
15
+ *
16
+ * ## Why a subclass, and not a callback threaded through nine call sites
17
+ *
18
+ * The events are appended from nine places across `loop.ts`, `loop-llm-stream.ts` and
19
+ * `tool-dispatch.ts`. Threading an `onEvent` parameter to each would touch every one of them and,
20
+ * worse, would leave the NEXT `events.push(...)` silently un-notified — a defect that reintroduces
21
+ * itself by omission, which is the failure mode this whole issue is about.
22
+ *
23
+ * Extending `Array` moves the decision to the single place the log is CREATED. Every existing push
24
+ * becomes live with no call-site change, and any push added later is live for free.
25
+ *
26
+ * It stays a real `Array`: `AgentLoopOutput.events` is still `SDKMessage[]`, `instanceof Array`
27
+ * still holds, and every downstream consumer — including the batch copy in `applyAgentLoopOutput` —
28
+ * is unchanged. This is additive; nothing that worked before observes a difference.
29
+ *
30
+ * `push` is the only override, deliberately. The loop only ever appends; overriding the rest of the
31
+ * mutation surface would be guarding against callers that do not exist (YAGNI), and a subscriber
32
+ * that must reason about splices is a worse contract than one that receives appends.
33
+ */
34
+ export declare class LiveEventLog extends Array<SDKMessage> {
35
+ #private;
36
+ /** Attach the live subscriber. One sink: the run that owns this loop. */
37
+ subscribe(sink: (event: SDKMessage) => void): void;
38
+ push(...events: SDKMessage[]): number;
39
+ }
40
+ /**
41
+ * Build the loop's event log, seeded with the events that exist before the loop starts.
42
+ *
43
+ * `LiveEventLog.from` rather than `new LiveEventLog(...seed)`: the `Array` constructor treats a
44
+ * single numeric argument as a length, and a seed is a list of events, never a count.
45
+ */
46
+ export declare function createEventLog(seed: readonly SDKMessage[]): LiveEventLog;
@@ -10,7 +10,7 @@
10
10
  * - "subscription_included" routes (Codex CLI, future Claude Pro) →
11
11
  * return $0 with status="included".
12
12
  * - Provider unknown / pricing missing → status="unknown" with
13
- * undefined amountUsd (NÃO retorna 0 falso).
13
+ * undefined amountUsd (does NOT return a false 0).
14
14
  *
15
15
  * @internal
16
16
  */
@@ -1,54 +1,56 @@
1
1
  /**
2
- * Canal único de diagnóstico da biblioteca silencioso por padrão (#147).
2
+ * The library's single diagnostics channelsilent by default (#147).
3
3
  *
4
4
  * ## O problema
5
5
  *
6
- * O SDK escrevia diagnósticos direto em `process.stderr` a partir de caminhos quentes
7
- * 92 sítios em 51 arquivos sob `internal/`. Numa host de TUI (Ink, alternate screen), essas
8
- * escritas se intercalam com o render e **corrompem o frame**. E o host não tinha como
9
- * interceptá-las: não havia logger injetável. Um consumidor chegou a instalar
10
- * `proper-lockfile` só para calar UMA delas.
6
+ * The SDK wrote diagnostics straight to `process.stderr` from hot paths 92 sites across 51
7
+ * files under `internal/`. In a TUI host (Ink, alternate screen), those writes interleave with the
8
+ * render and **corrupt the frame**. And the host had no way to intercept them: there was no
9
+ * injectable logger. One consumer went as far as installing `proper-lockfile` just to silence ONE
10
+ * of them.
11
11
  *
12
- * Uma biblioteca não pode assumir que `stdout`/`stderr` são sinks livres. Quem é dono do
13
- * terminal é a aplicação, não a dependência.
12
+ * A library cannot assume `stdout`/`stderr` are free sinks. The application owns the terminal, not
13
+ * the dependency.
14
14
  *
15
15
  * ## O contrato
16
16
  *
17
- * - **`setDiagnosticsSink(fn)`** entrega as mensagens à aplicação, que decide onde colocá-las
18
- * (uma linha de status, um arquivo, um painel). É o que faltava para uma TUI conviver com o SDK.
19
- * - **Sem sink, vai para o `stderr`** — exatamente como antes desta mudança.
17
+ * - **`setDiagnosticsSink(fn)`** hands the messages to the application, which decides where to put
18
+ * them (a status line, a file, a panel). It is what was missing for a TUI to coexist with the SDK.
19
+ * - **With no sink, it goes to `stderr`** — exactly as before this change.
20
20
  *
21
- * ## Por que o padrão NÃO mudou (ainda), e isso é deliberado
21
+ * ## Why the default did NOT change (yet), and why that is deliberate
22
22
  *
23
- * A #147 pede silêncio por padrão, e é o alvo certo. Mas **58 arquivos de teste** asseram hoje
24
- * que estes diagnósticos chegam ao `stderr` — eles codificam o contrato "o aviso É emitido", que
25
- * continua valendo e não deve ser perdido. Virar o padrão sem migrá-los reprovaria ~53 testes, e
26
- * migrá-los às pressas, em quatro formas diferentes de espionar o `stderr`, é a receita para
27
- * enfraquecer 58 suítes de uma vez.
23
+ * #147 asks for silence by default, and that is the right target. But **58 test files** currently
24
+ * assert these diagnostics reach `stderr` — they encode the contract "the warning IS emitted",
25
+ * which still holds and must not be lost. Flipping the default without migrating them would fail
26
+ * ~53 tests, and migrating them in a hurry, across four different ways of spying on `stderr`, is
27
+ * the recipe for weakening 58 suites at once.
28
28
  *
29
- * Então esta mudança entrega a metade que DESTRAVA o consumidoro host de TUI agora consegue
29
+ * So this change delivers the half that UNBLOCKS the consumera TUI host can now
30
30
  * interceptar, que era o bloqueio relatado ("no way to intercept these; no injectable logger") — e
31
- * deixa a virada do padrão como migração própria, com custo medido. Um host que quer silêncio
31
+ * and leaves flipping the default as its own migration, with a measured cost. A host that wants silence
32
32
  * hoje instala `setDiagnosticsSink(() => {})`.
33
33
  *
34
- * ## O que isto NÃO é
34
+ * ## What this is NOT
35
35
  *
36
- * Não é um logger com níveis, formatação ou destinos múltiplos. É o mínimo que resolve o
37
- * bloqueio relatado; um logger completo aqui seria inventar requisito que ninguém pediu.
36
+ * It is not a logger with levels, formatting or multiple destinations. It is the minimum that
37
+ * resolves the reported blocker; a full logger here would be inventing a requirement nobody asked
38
+ * for.
38
39
  */
39
- /** Recebe cada mensagem de diagnóstico já formatada, com o `\n` final. */
40
+ /** Receives each diagnostic message already formatted, with the trailing `\n`. */
40
41
  export type DiagnosticsSink = (message: string) => void;
41
42
  /**
42
- * Instala (ou remove, passando `undefined`) o destino dos diagnósticos.
43
+ * Installs (or removes, by passing `undefined`) the diagnostics destination.
43
44
  *
44
- * Quando sink, ele é o ÚNICO destinoo `stderr` não recebe cópia. Duplicar destinos
45
- * devolveria o problema à TUI que instalou o sink justamente para tirar as mensagens do terminal.
45
+ * When a sink is present it is the ONLY destination — `stderr` gets no copy. Duplicating
46
+ * destinations would hand the problem back to the TUI that installed the sink precisely to get the
47
+ * messages out of the terminal.
46
48
  */
47
49
  export declare function setDiagnosticsSink(next: DiagnosticsSink | undefined): void;
48
50
  /**
49
- * Emite uma mensagem de diagnóstico da biblioteca.
51
+ * Emits a library diagnostic message.
50
52
  *
51
- * Substitui `process.stderr.write` nos caminhos internos. Nunca lança: um sink defeituoso não
52
- * pode derrubar o run que ele apenas observa.
53
+ * Replaces `process.stderr.write` on internal paths. Never throws: a faulty sink must not
54
+ * must not take down the run it merely observes.
53
55
  */
54
56
  export declare function diag(message: string): void;
@@ -12,7 +12,7 @@
12
12
  * `"content_filtered"` for policy.)
13
13
  * 408 → `NetworkError` (`code: "timeout"`)
14
14
  * 5xx → `NetworkError` (`code: "server_error"` — covers 529
15
- * overloaded_error common em horário
15
+ * overloaded_error common at peak
16
16
  * de pico)
17
17
  * other → `UnknownAgentError` (`code: "unknown"`)
18
18
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Singleton por realm, chaveado por `Symbol.for`.
3
3
  *
4
- * Existe porque um pacote pode ser carregado mais de uma vez no mesmo processo (duas cópias em
5
- * `node_modules`, ESM e CJS lado a lado, monorepo com versões distintas) — e `const x = new Map()`
6
- * a nível de módulo produz DUAS caches que não se enxergam. `Symbol.for` usa o registro global de
7
- * símbolos, que é do realm e não do módulo, então todas as cópias convergem para a mesma instância.
4
+ * It exists because a package can be loaded more than once in the same process (two copies in
5
+ * `node_modules`, ESM and CJS side by side, a monorepo with distinct versions) — and then a module-level
6
+ * `const x = new Map()` produces TWO caches that cannot see each other. `Symbol.for` uses the global
7
+ * symbol registry, which belongs to the realm and not the module, so every copy converges on one instance.
8
8
  *
9
- * Estava copiado verbatim em `providers/discovery.ts` e `providers/catalog-loader.ts`. Isso é
10
- * duplicação de CONHECIMENTO, não coincidência de forma: as duas cópias precisam concordar sobre o
11
- * mecanismo, e uma corrigida sem a outra produz exatamente o bug que a função existe para evitar.
9
+ * It was copied verbatim into `providers/discovery.ts` and `providers/catalog-loader.ts`. That is
10
+ * duplicated KNOWLEDGE, not a coincidence of shape: the two copies have to agree on the
11
+ * mechanism, and one fixed without the other produces exactly the bug the function exists to avoid.
12
12
  */
13
13
  export declare function globalSingleton<T>(key: string, create: () => T): T;
@@ -8,32 +8,32 @@ export interface JudgeContext {
8
8
  /** Caller-supplied tuning knobs for the judge call. */
9
9
  export interface JudgeOptions {
10
10
  /**
11
- * Judge model identifier. Quando ausente, DERIVA de {@link agentModel} — e cai no literal
12
- * `"openai/gpt-4o-mini"` se nem esse for informado.
11
+ * Judge model identifier. When absent, it DERIVES from {@link agentModel} — and only falls back to the literal
12
+ * `"openai/gpt-4o-mini"` when neither is provided.
13
13
  *
14
- * M80 — o default fixo era provider-cego: ele resolve em OpenRouter. Com chave Anthropic
15
- * 404, com bearer OAuth 401, e em ambos o goal queimava 3 turnos inteiros antes de falhar com
16
- * razão enganosa. O agent-builder contornava isso derivando por conta própria; o conhecimento
17
- * pertence aqui.
14
+ * M80 — the fixed default was provider-blind: it only resolves on OpenRouter. With an Anthropic key it gives
15
+ * 404, with an OAuth bearer it gives 401, and in both the goal burned 3 whole turns before failing with
16
+ * a misleading reason. The agent-builder already worked around this by deriving on its own; the knowledge
17
+ * belongs here.
18
18
  */
19
19
  judgeModel?: string;
20
20
  /**
21
- * M80 — o modelo do agente CONDUZIDO. É a base da derivação: um judge que roda no mesmo modelo do
22
- * chat funciona onde o chat funciona.
21
+ * M80 — the DRIVEN agent's model. It is the basis of the derivation: a judge running on the same model as the
22
+ * chat works wherever chat works.
23
23
  */
24
24
  agentModel?: string;
25
25
  /** Override env. Default `process.env.OPENROUTER_API_KEY` (EC-A). */
26
26
  apiKey?: string;
27
27
  }
28
28
  /**
29
- * M80 — a credencial ou o modelo do judge não servem: 401/404.
29
+ * M80 — the judge's credential or model does not work: 401/404.
30
30
  *
31
- * Falha RÁPIDA por design. `rules/error-handling.md § 2` separa recuperável de irrecuperável, e um
32
- * modelo inexistente não passa a existir no retry — dobrar isso em `{parseFailed: true}` fazia o loop
33
- * tentar três vezes e reportar "failed" por limite de falhas consecutivas, escondendo que a causa era
34
- * credencial. Falha lenta e opaca trocada por rápida e clara.
31
+ * Fails FAST by design. `rules/error-handling.md` § 2 separates recoverable from unrecoverable, and a
32
+ * nonexistent model does not start existing on retry — folding that into `{parseFailed: true}` made the loop
33
+ * try three times and report "failed" on a consecutive-failure limit, hiding that the cause was the
34
+ * credential. A slow, opaque failure traded for a fast, clear one.
35
35
  *
36
- * Falha de PARSE e erro de rede continuam dobrados: são recuperáveis, e o loop decide por falhas
36
+ * PARSE failures and network errors stay folded: they are recoverable, and the loop already decides on
37
37
  * consecutivas.
38
38
  */
39
39
  export declare class JudgeCredentialError extends TheokitAgentError {
@@ -1,40 +1,40 @@
1
1
  import type { LlmClient, LlmEvent, LlmFinish, LlmRequest } from "./types.js";
2
- /** Teto de tentativas. Fixo em 3 — o DoD do M93 nomeia o número. */
3
- export declare const MAX_TENTATIVAS = 3;
2
+ /** Attempt ceiling. Fixed at 3 — M93's DoD names the number. */
3
+ export declare const MAX_ATTEMPTS = 3;
4
4
  /**
5
- * O erro é transitório, isto é: reexecutar pode mudar o resultado?
5
+ * Is the error transient that is, can retrying change the outcome?
6
6
  *
7
- * ## Delega para `isTransientError`, e diz o que subtrai
7
+ * ## Delegates to `isTransientError`, and states what it subtracts
8
8
  *
9
- * O SDK **já** publica `isTransientError` — documentado como "a single source of truth rather than
10
- * a re-derivation", e com o aviso explícito de que "It never inspects `err.message`". A primeira
11
- * versão desta função ignorou as duas coisas: derivou de novo, por regex sobre a mensagem
12
- * (`/\b4\d\d\b/`). A revisão adversarial mediu o custo — `connect ECONNREFUSED 127.0.0.1:443`
13
- * era classificado como NÃO transitório, porque a **porta** casa a regex. Os erros de rede para os
14
- * quais o retry existe eram exatamente os excluídos.
9
+ * The SDK **already** publishes `isTransientError` — documented as "a single source of truth rather
10
+ * than a re-derivation", with the explicit warning that "It never inspects `err.message`". The first
11
+ * version of this function ignored both: it re-derived, by regex over the message (`/\b4\d\d\b/`).
12
+ * Adversarial review measured the cost — `connect ECONNREFUSED 127.0.0.1:443` was classified as NOT
13
+ * transient, because the **port** matches the regex. The network errors retry exists for were
14
+ * exactly the ones excluded.
15
15
  *
16
- * Reinventar aqui foi violação da rung 4 da parcimônia com a peça pronta à mão. O que sobra desta
17
- * função são **três subtrações** do veredito do dono, cada uma com razão:
16
+ * Reinventing here violated parsimony rung 4 with the part already at hand. What remains of this
17
+ * function are **three subtractions** from the owner's verdict, each with a reason:
18
18
  *
19
- * | Subtração | Por quê |
19
+ * | Subtraction | Why |
20
20
  * |---|---|
21
- * | `CredentialPoolExhaustedError` | o pool gastou o próprio orçamento de tentativas e rotação; o `nextRetryAt` está em dezenas de segundos. Reexecutar multiplicaria a espera por `MAX_TENTATIVAS` sem chance de sucesso. |
22
- * | `code === "circuit_open"` | o breaker existe **para** falhar rápido; envolvê-lo num retry desfaz de fora a decisão que ele acabou de tomar. |
23
- * | `RateLimitError` com 402 | cota de faturamento não se resolve em milissegundosé por isso que o `classifyAndDecide` do pool rotaciona em vez de esperar. |
21
+ * | `CredentialPoolExhaustedError` | the pool already spent its own attempt and rotation budget; `nextRetryAt` is tens of seconds out. Retrying would multiply the wait by `MAX_ATTEMPTS` with no chance of success. |
22
+ * | `code === "circuit_open"` | the breaker exists **in order to** fail fast; wrapping it in a retry undoes from outside the decision it just made. |
23
+ * | `RateLimitError` with 402 | a billing quota does not resolve in millisecondswhich is why the pool's `classifyAndDecide` rotates instead of waiting. |
24
24
  *
25
- * As duas primeiras vieram da medição da revisão: com elas transitórias, o pool inteiro era
26
- * reexecutado 3×, e uma espera de 30 s virava ~90 s.
25
+ * The first two came out of the review's measurements: with them treated as transient, the entire
26
+ * pool was retried 3x, and a 30 s wait became ~90 s.
27
27
  */
28
- export declare function ehTransitorio(err: unknown): boolean;
28
+ export declare function isRetriableError(err: unknown): boolean;
29
29
  /**
30
- * ## Por que NÃO circuit breaker aqui
30
+ * ## Why there is NO circuit breaker here
31
31
  *
32
- * O `CircuitBreaker` do pacote é **chaveado por credencial** (`recordSuccess(key)` /
33
- * `recordTimeout(key)`): existe para o pool marcar uma chave como insalubre e **pular** para outra. Com
34
- * uma chave não para onde pular, então um breaker aqui registraria estado que ninguém consulta.
32
+ * The package's `CircuitBreaker` is **keyed by credential** (`recordSuccess(key)` /
33
+ * `recordTimeout(key)`): it exists so the pool can mark a key unhealthy and **skip** to another.
34
+ * With a single key there is nowhere to skip to, so a breaker here would record state nobody reads.
35
35
  *
36
- * Rung 1 da parcimônia — "isto precisa existir?". Não: seria cerimônia com nome de resiliência. O que
37
- * protege o caminho de chave única é o teto de tentativas e o backoff, e os dois estão abaixo.
36
+ * Parsimony rung 1 — "does this need to exist?". No: it would be ceremony with resilience's name on
37
+ * it. What protects the single-key path is the attempt ceiling and the backoff, and both are below.
38
38
  */
39
39
  export declare class RetryingLlmClient implements LlmClient {
40
40
  #private;
@@ -42,10 +42,10 @@ export declare class RetryingLlmClient implements LlmClient {
42
42
  rng?: () => number;
43
43
  });
44
44
  /**
45
- * O cliente decorado. Público pela mesma convenção de `FaultInjectingLlmClient.inner`: os testes
46
- * de fiação do router afirmam `instanceof PoolAwareLlmClient` e precisam enxergar através dos
47
- * decorators. Sem isto, adicionar um decorator quebra testes cuja intenção continua válidaque
48
- * foi exatamente o que o M93 fez com 4 testes pré-existentes.
45
+ * The decorated client. Public by the same convention as `FaultInjectingLlmClient.inner`: the
46
+ * router's wiring tests assert `instanceof PoolAwareLlmClient` and need to see through the
47
+ * decorators. Without this, adding a decorator breaks tests whose intent is still valid which is
48
+ * exactly what M93 did to 4 pre-existing tests.
49
49
  */
50
50
  get inner(): LlmClient;
51
51
  get name(): string;
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Envolve uma falha de socket num {@link NetworkError}, preservando a causa.
2
+ * Wraps a socket failure in a {@link NetworkError}, preserving the cause.
3
3
  *
4
- * Devolve o erro original — sem envolver quando ele é um abort ou é um erro do SDK.
4
+ * Returns the original error unwrappedwhen it is an abort or already an SDK error.
5
5
  */
6
6
  export declare function wrapTransportError(err: unknown, ctx: {
7
7
  providerId: string;
@@ -11,8 +11,8 @@
11
11
  * readable 0o644 under typical umask 022. Callers writing non-sensitive
12
12
  * files can pass `mode: 0o644` explicitly.
13
13
  *
14
- * NFS sem honor de O_EXCL é documentado (D61 — mesma postura do
15
- * `withFileLock`); SDK target é ext4/APFS/NTFS.
14
+ * NFS not honoring O_EXCL is documented (D61 — same stance as
15
+ * `withFileLock`); the SDK target is ext4/APFS/NTFS.
16
16
  *
17
17
  * @internal
18
18
  */
@@ -11,8 +11,8 @@
11
11
  * readable 0o644 under typical umask 022. Callers writing non-sensitive
12
12
  * files can pass `mode: 0o644` explicitly.
13
13
  *
14
- * NFS sem honor de O_EXCL é documentado (D61 — mesma postura do
15
- * `withFileLock`); SDK target é ext4/APFS/NTFS.
14
+ * NFS not honoring O_EXCL is documented (D61 — same stance as
15
+ * `withFileLock`); the SDK target is ext4/APFS/NTFS.
16
16
  *
17
17
  * @internal
18
18
  */
@@ -32,34 +32,34 @@ export declare class FsSessionStore implements SessionStore {
32
32
  readRecords(agentId: string): Promise<SessionRecord[]>;
33
33
  appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void>;
34
34
  /**
35
- * Toma o lease de escritor da sessão. Lança `SessionBusyError` quando outro processo a detém.
35
+ * Takes the session's writer lease. Throws `SessionBusyError` when another process holds it.
36
36
  *
37
- * **Explícito, e NÃO no `appendRecords`** — a revisão adversarial do M95 mediu por que isso
38
- * importa: o contrato de `SessionStore` diz que "an `appendRecords` rejection is logged to
39
- * stderr, NOT thrown to the caller (best-effort write)". Adquirir ali fazia o `SessionBusyError`
40
- * ser **engolido**, e o resultado era pior que o problema original: em vez de dois escritores
41
- * intercalarem linhas, o perdedor **perdia o turno em silêncio** nada em disco, um aviso em
42
- * stderr invisível sob a TUI, e o chamador sem como reagir.
37
+ * **Explicit, and NOT inside `appendRecords`** — M95's adversarial review measured why that
38
+ * matters: the `SessionStore` contract states that "an `appendRecords` rejection is logged to
39
+ * stderr, NOT thrown to the caller (best-effort write)". Acquiring there made the
40
+ * `SessionBusyError` get **swallowed**, and the result was worse than the original problem:
41
+ * instead of two writers interleaving lines, the loser **lost the turn silently** nothing on
42
+ * disk, a stderr warning invisible under the TUI, and no way for the caller to react.
43
43
  *
44
- * No init o erro chega a quem pode agir: o `exec` forka para um id novo, que é o que a própria
45
- * mensagem do erro prescreve. É a diferença entre falhar onde para decidir e falhar onde só
46
- * para perder.
44
+ * At init the error reaches someone who can act: `exec` forks to a new id, which is exactly what
45
+ * the error message itself prescribes. It is the difference between failing where a decision is
46
+ * possible and failing where only loss is.
47
47
  */
48
48
  acquire(agentId: string): Promise<void>;
49
49
  /**
50
- * Solta o lease de UM agente.
50
+ * Releases ONE agent's lease.
51
51
  *
52
- * Existe porque `dispose()` solta **todos** os leases do store, e um store injetado pelo
53
- * consumidor pode servir vários agentes: um init que falha para o agente B não pode liberar o
54
- * lease do agente A, que segue vivo e escrevendo.
52
+ * It exists because `dispose()` releases **every** lease the store holds, and a store injected by
53
+ * the consumer may serve several agents: an init that fails for agent B must not free agent A's
54
+ * lease, which is still live and writing.
55
55
  */
56
56
  release(agentId: string): Promise<void>;
57
57
  /**
58
- * Solta todo lease que este store detém.
58
+ * Releases every lease this store holds.
59
59
  *
60
- * Sem isto o `.writer.lock` sobrevive ao processo e a próxima abertura teria de esperar a janela
61
- * de heartbeat — recuperável, mas 30 s de espera para um encerramento LIMPO seria um defeito
62
- * evitável. Idempotente: chamar duas vezes não é erro.
60
+ * Without it the `.writer.lock` outlives the process and the next open would have to wait out the
61
+ * heartbeat window recoverable, but 30 s of waiting after a CLEAN shutdown would be an avoidable
62
+ * defect. Idempotent: calling it twice is not an error.
63
63
  */
64
64
  dispose(): Promise<void>;
65
65
  }
@@ -32,34 +32,34 @@ export declare class FsSessionStore implements SessionStore {
32
32
  readRecords(agentId: string): Promise<SessionRecord[]>;
33
33
  appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void>;
34
34
  /**
35
- * Toma o lease de escritor da sessão. Lança `SessionBusyError` quando outro processo a detém.
35
+ * Takes the session's writer lease. Throws `SessionBusyError` when another process holds it.
36
36
  *
37
- * **Explícito, e NÃO no `appendRecords`** — a revisão adversarial do M95 mediu por que isso
38
- * importa: o contrato de `SessionStore` diz que "an `appendRecords` rejection is logged to
39
- * stderr, NOT thrown to the caller (best-effort write)". Adquirir ali fazia o `SessionBusyError`
40
- * ser **engolido**, e o resultado era pior que o problema original: em vez de dois escritores
41
- * intercalarem linhas, o perdedor **perdia o turno em silêncio** nada em disco, um aviso em
42
- * stderr invisível sob a TUI, e o chamador sem como reagir.
37
+ * **Explicit, and NOT inside `appendRecords`** — M95's adversarial review measured why that
38
+ * matters: the `SessionStore` contract states that "an `appendRecords` rejection is logged to
39
+ * stderr, NOT thrown to the caller (best-effort write)". Acquiring there made the
40
+ * `SessionBusyError` get **swallowed**, and the result was worse than the original problem:
41
+ * instead of two writers interleaving lines, the loser **lost the turn silently** nothing on
42
+ * disk, a stderr warning invisible under the TUI, and no way for the caller to react.
43
43
  *
44
- * No init o erro chega a quem pode agir: o `exec` forka para um id novo, que é o que a própria
45
- * mensagem do erro prescreve. É a diferença entre falhar onde para decidir e falhar onde só
46
- * para perder.
44
+ * At init the error reaches someone who can act: `exec` forks to a new id, which is exactly what
45
+ * the error message itself prescribes. It is the difference between failing where a decision is
46
+ * possible and failing where only loss is.
47
47
  */
48
48
  acquire(agentId: string): Promise<void>;
49
49
  /**
50
- * Solta o lease de UM agente.
50
+ * Releases ONE agent's lease.
51
51
  *
52
- * Existe porque `dispose()` solta **todos** os leases do store, e um store injetado pelo
53
- * consumidor pode servir vários agentes: um init que falha para o agente B não pode liberar o
54
- * lease do agente A, que segue vivo e escrevendo.
52
+ * It exists because `dispose()` releases **every** lease the store holds, and a store injected by
53
+ * the consumer may serve several agents: an init that fails for agent B must not free agent A's
54
+ * lease, which is still live and writing.
55
55
  */
56
56
  release(agentId: string): Promise<void>;
57
57
  /**
58
- * Solta todo lease que este store detém.
58
+ * Releases every lease this store holds.
59
59
  *
60
- * Sem isto o `.writer.lock` sobrevive ao processo e a próxima abertura teria de esperar a janela
61
- * de heartbeat — recuperável, mas 30 s de espera para um encerramento LIMPO seria um defeito
62
- * evitável. Idempotente: chamar duas vezes não é erro.
60
+ * Without it the `.writer.lock` outlives the process and the next open would have to wait out the
61
+ * heartbeat window recoverable, but 30 s of waiting after a CLEAN shutdown would be an avoidable
62
+ * defect. Idempotent: calling it twice is not an error.
63
63
  */
64
64
  dispose(): Promise<void>;
65
65
  }