@macintacos/caret 0.11.0 → 0.12.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 (319) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +5 -1
  3. package/commands/debug.md +22 -14
  4. package/dist/cli.js +1021 -909
  5. package/opencode/.greptile/files.json +12 -0
  6. package/opencode/caret.plugin.ts +10 -8
  7. package/opencode/commands/debug.md +14 -8
  8. package/package.json +35 -24
  9. package/ui/dist/assets/actionscript-3-Cs6JJXT5.js +1 -0
  10. package/ui/dist/assets/ahk-CA9gdOdF.js +1 -0
  11. package/ui/dist/assets/ahk2-_6rzW9BS.js +1 -0
  12. package/ui/dist/assets/andromeeda-vGVdxbeo.js +1 -0
  13. package/ui/dist/assets/{angular-html-5RvLUq7Z.js → angular-html-DMUNxAT7.js} +1 -1
  14. package/ui/dist/assets/{angular-ts-H7A3iXyF.js → angular-ts-CjN6OxaN.js} +1 -1
  15. package/ui/dist/assets/apex-KFGFyKwG.js +1 -0
  16. package/ui/dist/assets/{apl-TTxSuUB_.js → apl-Dw4C1Sv3.js} +1 -1
  17. package/ui/dist/assets/{apl-CnwPGSsG.js → apl-gfMMiTNf.js} +1 -1
  18. package/ui/dist/assets/asciiarmor-C_eisQCp.js +1 -0
  19. package/ui/dist/assets/asciidoc-SCjQUq34.js +1 -0
  20. package/ui/dist/assets/{asn1-Dr8qZg38.js → asn1-DCl_8MCW.js} +1 -1
  21. package/ui/dist/assets/{asterisk-Bja0s6e1.js → asterisk-BEn0Cwpx.js} +1 -1
  22. package/ui/dist/assets/{astro-BKz-vRRo.js → astro-DzXQf-F7.js} +1 -1
  23. package/ui/dist/assets/aurora-x-CDeNXAV0.js +1 -0
  24. package/ui/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
  25. package/ui/dist/assets/ayu-light-C3h-C4tm.js +1 -0
  26. package/ui/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  27. package/ui/dist/assets/{bat-Bo4NYOV-.js → bat-qdxAdBWQ.js} +1 -1
  28. package/ui/dist/assets/bird2-CYIUgYqB.js +1 -0
  29. package/ui/dist/assets/{blade-DWrd7tz4.js → blade-CTMS_AXM.js} +1 -1
  30. package/ui/dist/assets/bsl-_VjlB9mv.js +1 -0
  31. package/ui/dist/assets/{c-IGApzdRH.js → c-DBanwSNn.js} +1 -1
  32. package/ui/dist/assets/c3-D0apG41V.js +1 -0
  33. package/ui/dist/assets/chapel-BTstFNqm.js +1 -0
  34. package/ui/dist/assets/clarity-CtfBBspg.js +1 -0
  35. package/ui/dist/assets/clike-D_6L3tnO.js +1 -0
  36. package/ui/dist/assets/cmake-84nbDH0I.js +1 -0
  37. package/ui/dist/assets/{cobol-Cazc7O_T.js → cobol-Ca4PWvOz.js} +1 -1
  38. package/ui/dist/assets/cobol-DHLQUbN7.js +1 -0
  39. package/ui/dist/assets/{coffee-Dd22AwJE.js → coffee-a9u7Cq0q.js} +1 -1
  40. package/ui/dist/assets/coffeescript-De_zI4J0.js +1 -0
  41. package/ui/dist/assets/commonlisp-DgAKBe0r.js +1 -0
  42. package/ui/dist/assets/coq-DuBRPxYg.js +1 -0
  43. package/ui/dist/assets/cpp-oowRqiuJ.js +1 -0
  44. package/ui/dist/assets/crystal-Bsdphhtm.js +1 -0
  45. package/ui/dist/assets/{crystal-4S07s0cd.js → crystal-D7O4UX-i.js} +1 -1
  46. package/ui/dist/assets/{css-1gk7lXYc.js → css-CZVl8Px8.js} +1 -1
  47. package/ui/dist/assets/css-CnaYoQib.js +1 -0
  48. package/ui/dist/assets/{d-BhMjBjQP.js → d-DWkQyNnU.js} +1 -1
  49. package/ui/dist/assets/dark-plus-Cs2F2srj.js +1 -0
  50. package/ui/dist/assets/dist-BAGkWecZ.js +1 -0
  51. package/ui/dist/assets/dist-BbiHto2W.js +2 -0
  52. package/ui/dist/assets/dist-Bc8Y8K-M.js +1 -0
  53. package/ui/dist/assets/dist-ByhlQ0Ut.js +1 -0
  54. package/ui/dist/assets/dist-C3qTFPSx.js +1 -0
  55. package/ui/dist/assets/dist-CWGZKcUs.js +11 -0
  56. package/ui/dist/assets/dist-CaX-VV5u.js +1 -0
  57. package/ui/dist/assets/dist-CdQe3tPj.js +1 -0
  58. package/ui/dist/assets/dist-CikfqRw0.js +1 -0
  59. package/ui/dist/assets/dist-DaoC_D4S.js +1 -0
  60. package/ui/dist/assets/dist-DfISJt9o.js +12 -0
  61. package/ui/dist/assets/dist-DigqW6HL.js +1 -0
  62. package/ui/dist/assets/dist-DpTOg-NC.js +1 -0
  63. package/ui/dist/assets/dist-IHT5kND0.js +1 -0
  64. package/ui/dist/assets/dist-UGYOZkY4.js +1 -0
  65. package/ui/dist/assets/dist-oDQCW51e.js +1 -0
  66. package/ui/dist/assets/dist-pedI8d1Q.js +9 -0
  67. package/ui/dist/assets/dist-vKL_CWkV.js +1 -0
  68. package/ui/dist/assets/{dockerfile-BLkNEvjs.js → dockerfile-DJkHQgkl.js} +1 -1
  69. package/ui/dist/assets/dracula-soft-5eyTD99u.js +1 -0
  70. package/ui/dist/assets/{dylan-C6jEEEk-.js → dylan-BCDoL_-p.js} +1 -1
  71. package/ui/dist/assets/{ecl-BSZaIHnp.js → ecl-BVIeWmwY.js} +1 -1
  72. package/ui/dist/assets/{edge-C2c1CO-6.js → edge-I4NpgvYm.js} +1 -1
  73. package/ui/dist/assets/{elixir-DXn37Fta.js → elixir-BJknh2p7.js} +1 -1
  74. package/ui/dist/assets/{elm-B-bvoD7s.js → elm-CRrD_tPY.js} +1 -1
  75. package/ui/dist/assets/emacs-lisp-c_oH4hRZ.js +1 -0
  76. package/ui/dist/assets/{erb-DCbJLk1z.js → erb-CROtc598.js} +1 -1
  77. package/ui/dist/assets/{erlang-DaB2Rkuy.js → erlang-BV0c4Hdn.js} +1 -1
  78. package/ui/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
  79. package/ui/dist/assets/everforest-light-Df2xbC6M.js +1 -0
  80. package/ui/dist/assets/{factor-D7LVTn2l.js → factor-LKH5gN8L.js} +1 -1
  81. package/ui/dist/assets/{gdresource-C0sCabJj.js → gdresource-xMC7jr7x.js} +1 -1
  82. package/ui/dist/assets/gdscript-DYvRD3hg.js +1 -0
  83. package/ui/dist/assets/{git-rebase-gAHQgEDP.js → git-rebase-BRtkWL3M.js} +1 -1
  84. package/ui/dist/assets/github-dark-C-LZuMrd.js +1 -0
  85. package/ui/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  86. package/ui/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  87. package/ui/dist/assets/github-light-EUqPIrTm.js +1 -0
  88. package/ui/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  89. package/ui/dist/assets/{glimmer-js-BfsyNEr7.js → glimmer-js-lqkYwHrU.js} +1 -1
  90. package/ui/dist/assets/{glimmer-ts-NHB1jiZs.js → glimmer-ts-CB5BuR0n.js} +1 -1
  91. package/ui/dist/assets/{glsl-CKTIh5q1.js → glsl-CBceQiUy.js} +1 -1
  92. package/ui/dist/assets/{graphql-BAVT-Qfu.js → graphql-Qo62WpvI.js} +1 -1
  93. package/ui/dist/assets/groovy-CUpZ7dEl.js +1 -0
  94. package/ui/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  95. package/ui/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  96. package/ui/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  97. package/ui/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  98. package/ui/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  99. package/ui/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  100. package/ui/dist/assets/hack-BNJdjzLU.js +1 -0
  101. package/ui/dist/assets/{haml-CUHOH-NL.js → haml-BMBtqt90.js} +1 -1
  102. package/ui/dist/assets/{handlebars-CNe_S8PQ.js → handlebars-CBP-BQZd.js} +1 -1
  103. package/ui/dist/assets/haxe-C8oCnwJJ.js +1 -0
  104. package/ui/dist/assets/{haxe-DIz0ZZqd.js → haxe-DjVOVvNP.js} +1 -1
  105. package/ui/dist/assets/horizon-CE9ld1lL.js +1 -0
  106. package/ui/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
  107. package/ui/dist/assets/houston-CsvMBhTu.js +1 -0
  108. package/ui/dist/assets/{html-COaRmwrO.js → html-Df586Ko0.js} +1 -1
  109. package/ui/dist/assets/{html-derivative-CinwqZLf.js → html-derivative-yN18G809.js} +1 -1
  110. package/ui/dist/assets/{http-DbQ_t1_2.js → http-YpWiVC6m.js} +1 -1
  111. package/ui/dist/assets/{hurl-BHWvSlwU.js → hurl-BfSO2S_0.js} +1 -1
  112. package/ui/dist/assets/hxml-Dcm88srW.js +1 -0
  113. package/ui/dist/assets/index-Dml6ilmw.css +1 -0
  114. package/ui/dist/assets/index-DxHUxDDf.js +6766 -0
  115. package/ui/dist/assets/{java-C8tTvVpe.js → java-BqL-WKyb.js} +1 -1
  116. package/ui/dist/assets/{javascript-BeAm0j_g.js → javascript-C7z4qtlP.js} +1 -1
  117. package/ui/dist/assets/javascript-DoL9Wb-Q.js +1 -0
  118. package/ui/dist/assets/{jinja-D_xgx2y9.js → jinja-Dt2LjYg4.js} +1 -1
  119. package/ui/dist/assets/{jison-NuLIt77u.js → jison-RhcomYXF.js} +1 -1
  120. package/ui/dist/assets/{json-CV5jRNNK.js → json-C7RFwAc6.js} +1 -1
  121. package/ui/dist/assets/{jsx-HTlBmr1T.js → jsx-DzVoS5cK.js} +1 -1
  122. package/ui/dist/assets/{julia-_z5NZrIG.js → julia-C86cVJ4I.js} +1 -1
  123. package/ui/dist/assets/{just-BCA5G6NT.js → just-DLVt7fko.js} +1 -1
  124. package/ui/dist/assets/kanagawa-dragon-Bozd7klA.js +1 -0
  125. package/ui/dist/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
  126. package/ui/dist/assets/kanagawa-wave-BML5mF2J.js +1 -0
  127. package/ui/dist/assets/laserwave-C_8bwKvT.js +1 -0
  128. package/ui/dist/assets/latex-DRxirEYd.js +1 -0
  129. package/ui/dist/assets/light-plus-DVQuIRkW.js +1 -0
  130. package/ui/dist/assets/{liquid-zb-EmYR_.js → liquid-BR_Lw-Bt.js} +1 -1
  131. package/ui/dist/assets/{llvm-Cm23YOpf.js → llvm-DqHOMS-s.js} +1 -1
  132. package/ui/dist/assets/{lua-Dji9Xdi2.js → lua-CHeMByWu.js} +1 -1
  133. package/ui/dist/assets/luau-C2pBCSgt.js +1 -0
  134. package/ui/dist/assets/{marko-C0oVISAz.js → marko-B9JYg09W.js} +1 -1
  135. package/ui/dist/assets/material-theme-Bm3Qr25_.js +1 -0
  136. package/ui/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
  137. package/ui/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
  138. package/ui/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  139. package/ui/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  140. package/ui/dist/assets/mdc-BkqLhTks.js +1 -0
  141. package/ui/dist/assets/mermaid-BxpfTIzt.js +1 -0
  142. package/ui/dist/assets/min-dark-BSWPekZh.js +1 -0
  143. package/ui/dist/assets/min-light-DDpmG2fV.js +1 -0
  144. package/ui/dist/assets/mojo-fg40_ntQ.js +1 -0
  145. package/ui/dist/assets/monokai-B_bV9PQ9.js +1 -0
  146. package/ui/dist/assets/moonbit-DgjMoLWr.js +1 -0
  147. package/ui/dist/assets/move-BYnGhZoM.js +1 -0
  148. package/ui/dist/assets/{mumps-CW_TBmxz.js → mumps-BSzj6Xyz.js} +1 -1
  149. package/ui/dist/assets/{nginx-DFCvTKJt.js → nginx-Jer0MbpA.js} +1 -1
  150. package/ui/dist/assets/night-owl-DhmEMT88.js +1 -0
  151. package/ui/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
  152. package/ui/dist/assets/{nim-BZjuPzz9.js → nim-Cy_m8HmF.js} +1 -1
  153. package/ui/dist/assets/nord-Cb4Vim4T.js +1 -0
  154. package/ui/dist/assets/{nsis-AQ_alPln.js → nsis-CfSuhXs5.js} +1 -1
  155. package/ui/dist/assets/nsis-CjNLYCLg.js +1 -0
  156. package/ui/dist/assets/{ntriples-d28e9m0E.js → ntriples-B9h1VB_g.js} +1 -1
  157. package/ui/dist/assets/nushell-DHYfO66s.js +1 -0
  158. package/ui/dist/assets/one-dark-pro-CLwyXe_n.js +1 -0
  159. package/ui/dist/assets/one-light-D7Lr4KcI.js +1 -0
  160. package/ui/dist/assets/org-CokmGrbo.js +1 -0
  161. package/ui/dist/assets/perl-BkSkiI9m.js +1 -0
  162. package/ui/dist/assets/{perl-B_Clm_ch.js → perl-C8zK1dLy.js} +1 -1
  163. package/ui/dist/assets/{php-3ilvRbct.js → php-CGPNoYNj.js} +1 -1
  164. package/ui/dist/assets/plastic-DQwYfKfQ.js +1 -0
  165. package/ui/dist/assets/poimandres-DRFjx7u4.js +1 -0
  166. package/ui/dist/assets/{powershell-CzG71I4L.js → powershell-BcIto6Sf.js} +1 -1
  167. package/ui/dist/assets/{powershell-DshXNtvi.js → powershell-CCSX75yM.js} +1 -1
  168. package/ui/dist/assets/prisma-DMgNhnYS.js +1 -0
  169. package/ui/dist/assets/{pug-DztvP6cK.js → pug-5sES-m6u.js} +1 -1
  170. package/ui/dist/assets/{pug-Bugr-47h.js → pug-Gsm0M45u.js} +1 -1
  171. package/ui/dist/assets/puppet-BZyAS7I4.js +1 -0
  172. package/ui/dist/assets/python-B_1Jd8HM.js +1 -0
  173. package/ui/dist/assets/{qml-1bJ9wjdn.js → qml-BJN6wOEM.js} +1 -1
  174. package/ui/dist/assets/r-Byftp3ZA.js +1 -0
  175. package/ui/dist/assets/r-CxDmU1I4.js +1 -0
  176. package/ui/dist/assets/{razor-BjY7GlMn.js → razor-DpZOlAnr.js} +1 -1
  177. package/ui/dist/assets/rbs-C0MpOrj4.js +1 -0
  178. package/ui/dist/assets/red-DX1BQOs8.js +1 -0
  179. package/ui/dist/assets/{regexp-BkIlfW8b.js → regexp-BvqsLg1Y.js} +1 -1
  180. package/ui/dist/assets/rose-pine-aMsaMD1D.js +1 -0
  181. package/ui/dist/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
  182. package/ui/dist/assets/rose-pine-moon-DO-qXg-I.js +1 -0
  183. package/ui/dist/assets/{rst-DyPD805e.js → rst-9vLxmSRm.js} +1 -1
  184. package/ui/dist/assets/{ruby-C9tcEn71.js → ruby-B0g6MeYE.js} +1 -1
  185. package/ui/dist/assets/ruby-BjXV7-Qa.js +1 -0
  186. package/ui/dist/assets/{sas-oyddpUVQ.js → sas-ho_fqc91.js} +1 -1
  187. package/ui/dist/assets/{scala-DKOlJaKm.js → scala-BiFt_7mu.js} +1 -1
  188. package/ui/dist/assets/scheme-D9qYN0V5.js +1 -0
  189. package/ui/dist/assets/{scss-HITFHPDF.js → scss-CXllYR3p.js} +1 -1
  190. package/ui/dist/assets/{shell-Du5Qg9im.js → shell-DwuoZtxw.js} +1 -1
  191. package/ui/dist/assets/{shellscript-x1x9neoG.js → shellscript-CS4mUnIg.js} +1 -1
  192. package/ui/dist/assets/{shellsession-DGuaRj5a.js → shellsession-BErKFUp0.js} +1 -1
  193. package/ui/dist/assets/{simple-mode-DRpGK0lJ.js → simple-mode-DXiLM1-G.js} +1 -1
  194. package/ui/dist/assets/slack-dark-DnToyrRv.js +1 -0
  195. package/ui/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
  196. package/ui/dist/assets/smalltalk-BHpQb5nM.js +1 -0
  197. package/ui/dist/assets/smithy-Dgaz7aur.js +1 -0
  198. package/ui/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
  199. package/ui/dist/assets/solarized-dark-UdsmMDCL.js +1 -0
  200. package/ui/dist/assets/solarized-light-C1IUL_tW.js +1 -0
  201. package/ui/dist/assets/solidity-Bj7E1mRn.js +1 -0
  202. package/ui/dist/assets/{soy-BDcTtkxw.js → soy-DLadX5Sh.js} +1 -1
  203. package/ui/dist/assets/{sql-BNkgB3gD.js → sql-D2_tJtd9.js} +1 -1
  204. package/ui/dist/assets/sql-DuQMFDvy.js +1 -0
  205. package/ui/dist/assets/{stata-BqJ-ReAl.js → stata-DeuspBBD.js} +1 -1
  206. package/ui/dist/assets/{stex-sDrdk2BW.js → stex-DNzd62Q_.js} +1 -1
  207. package/ui/dist/assets/{stylus-DLLZ8dgm.js → stylus-BOVgKnng.js} +1 -1
  208. package/ui/dist/assets/surrealql-Dsg6kBYD.js +1 -0
  209. package/ui/dist/assets/{svelte-DFzyyr9O.js → svelte-BLUhg5N2.js} +1 -1
  210. package/ui/dist/assets/swift-CyEgAFGc.js +1 -0
  211. package/ui/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
  212. package/ui/dist/assets/system-verilog-Dh5ihWbf.js +1 -0
  213. package/ui/dist/assets/{templ-C6322Zc6.js → templ-DmwzJEXE.js} +1 -1
  214. package/ui/dist/assets/tex-DvJatE2t.js +1 -0
  215. package/ui/dist/assets/textile-C4jVoHG1.js +1 -0
  216. package/ui/dist/assets/tiki-AK6FwT8q.js +1 -0
  217. package/ui/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
  218. package/ui/dist/assets/toml-BPTmHmyx.js +1 -0
  219. package/ui/dist/assets/{ts-tags-pjZ_FkRd.js → ts-tags-DopPyAVy.js} +1 -1
  220. package/ui/dist/assets/{tsx-D7E88Xp5.js → tsx-Df8h3iwb.js} +1 -1
  221. package/ui/dist/assets/{ttcn-BePYh-hG.js → ttcn-PPSTk1ow.js} +1 -1
  222. package/ui/dist/assets/{ttcn-cfg-CY0aot7Q.js → ttcn-cfg-2b4Gb5sE.js} +1 -1
  223. package/ui/dist/assets/turtle-Cx3rYX2g.js +1 -0
  224. package/ui/dist/assets/twig-D-FWilfB.js +1 -0
  225. package/ui/dist/assets/{typescript-BWgdaVLK.js → typescript-GaY7hgCy.js} +1 -1
  226. package/ui/dist/assets/typst-NzoQLrPM.js +1 -0
  227. package/ui/dist/assets/{v-DETTlOr0.js → v-DBj4K9d_.js} +1 -1
  228. package/ui/dist/assets/{vb-Djn5o6TS.js → vb-DOwzaHZ0.js} +1 -1
  229. package/ui/dist/assets/{verilog-D-x6ne0Z.js → verilog-7LoJAqYT.js} +1 -1
  230. package/ui/dist/assets/verilog-B2gwz-sJ.js +1 -0
  231. package/ui/dist/assets/vesper-DdrHHSXu.js +1 -0
  232. package/ui/dist/assets/vhdl-kS471soi.js +1 -0
  233. package/ui/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
  234. package/ui/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
  235. package/ui/dist/assets/vitesse-light-VbXTXTou.js +1 -0
  236. package/ui/dist/assets/{vue-VFPf5VDL.js → vue-DlAEzgCu.js} +1 -1
  237. package/ui/dist/assets/{vue-html-D1bRfEwp.js → vue-html-ZDj41605.js} +1 -1
  238. package/ui/dist/assets/{vue-vine-CEAW1Fs_.js → vue-vine-cO7C1w8g.js} +1 -1
  239. package/ui/dist/assets/{xml-T1VYFptl.js → xml-Cw5Gpdej.js} +1 -1
  240. package/ui/dist/assets/{xquery-fj_R-kMw.js → xquery-BKJx4mf9.js} +1 -1
  241. package/ui/dist/assets/{xsl-DpQuzNtk.js → xsl-BJg3bH1H.js} +1 -1
  242. package/ui/dist/assets/{yaml-Ds8gJ67a.js → yaml-kOrEV2t6.js} +1 -1
  243. package/ui/dist/assets/z80-Co3PbHdE.js +1 -0
  244. package/ui/dist/index.html +3 -2
  245. package/ui/dist/assets/actionscript-3--17pq3dv.js +0 -1
  246. package/ui/dist/assets/apex-VAyPSnFM.js +0 -1
  247. package/ui/dist/assets/asciiarmor-qTkVPQu6.js +0 -1
  248. package/ui/dist/assets/asciidoc-DE70LPWp.js +0 -1
  249. package/ui/dist/assets/bird2-C6vDhewU.js +0 -1
  250. package/ui/dist/assets/bsl-BkkzgIyY.js +0 -1
  251. package/ui/dist/assets/c3-BFHwR3_K.js +0 -1
  252. package/ui/dist/assets/clarity-SemFz856.js +0 -1
  253. package/ui/dist/assets/clike-DHH8Ad3s.js +0 -1
  254. package/ui/dist/assets/cmake-CyVbuzPu.js +0 -1
  255. package/ui/dist/assets/cobol-B_OZ4V-R.js +0 -1
  256. package/ui/dist/assets/coffeescript-B2pKbFk8.js +0 -1
  257. package/ui/dist/assets/commonlisp-CcllspGY.js +0 -1
  258. package/ui/dist/assets/coq-BrsZFFmf.js +0 -1
  259. package/ui/dist/assets/cpp-BDjV8GMs.js +0 -1
  260. package/ui/dist/assets/crystal-M5-qzICs.js +0 -1
  261. package/ui/dist/assets/css-CYpP4FRV.js +0 -1
  262. package/ui/dist/assets/dist--bc2PnyK.js +0 -1
  263. package/ui/dist/assets/dist-BGBwiuT6.js +0 -1
  264. package/ui/dist/assets/dist-BGuWRPi1.js +0 -1
  265. package/ui/dist/assets/dist-BIDT62JM.js +0 -1
  266. package/ui/dist/assets/dist-BcmAlNPx.js +0 -1
  267. package/ui/dist/assets/dist-Be8oTfP4.js +0 -9
  268. package/ui/dist/assets/dist-Bw95B0_z.js +0 -2
  269. package/ui/dist/assets/dist-BydijwDA.js +0 -1
  270. package/ui/dist/assets/dist-CQluSlUy.js +0 -1
  271. package/ui/dist/assets/dist-CU4ehwGW.js +0 -1
  272. package/ui/dist/assets/dist-Cc8VJ54F.js +0 -1
  273. package/ui/dist/assets/dist-DR5uGjyJ.js +0 -1
  274. package/ui/dist/assets/dist-DZeAClcR.js +0 -1
  275. package/ui/dist/assets/dist-DbsGRkRt.js +0 -1
  276. package/ui/dist/assets/dist-cqKXvOJB.js +0 -1
  277. package/ui/dist/assets/dist-j6YQuVcV.js +0 -1
  278. package/ui/dist/assets/dist-wWa669u6.js +0 -11
  279. package/ui/dist/assets/emacs-lisp-B4R74twV.js +0 -1
  280. package/ui/dist/assets/gdscript-Cp2uCuqX.js +0 -1
  281. package/ui/dist/assets/groovy-BC3IOsC8.js +0 -1
  282. package/ui/dist/assets/hack-BOJXdhzo.js +0 -1
  283. package/ui/dist/assets/haxe-OTjmBuCE.js +0 -1
  284. package/ui/dist/assets/hxml-B0Qn7Nwc.js +0 -1
  285. package/ui/dist/assets/index-C6liS7CI.js +0 -3420
  286. package/ui/dist/assets/index-c2ZxcgJn.css +0 -1
  287. package/ui/dist/assets/javascript-9Tg8ixDm.js +0 -1
  288. package/ui/dist/assets/latex-CqX8jMgP.js +0 -1
  289. package/ui/dist/assets/luau-FMPmPwt6.js +0 -1
  290. package/ui/dist/assets/mdc-CcpeRnqw.js +0 -1
  291. package/ui/dist/assets/mermaid-Bk4SNUv9.js +0 -1
  292. package/ui/dist/assets/mojo-BgCJLMeH.js +0 -1
  293. package/ui/dist/assets/moonbit-CaWjb8XO.js +0 -1
  294. package/ui/dist/assets/move-B1IS1UjX.js +0 -1
  295. package/ui/dist/assets/nushell-DcLAeLz5.js +0 -1
  296. package/ui/dist/assets/perl-CdEHsPfU.js +0 -1
  297. package/ui/dist/assets/prisma-BsRQq5mF.js +0 -1
  298. package/ui/dist/assets/puppet-B4hC2X4m.js +0 -1
  299. package/ui/dist/assets/python-BqYw9LYJ.js +0 -1
  300. package/ui/dist/assets/r-BvZmLpfT.js +0 -1
  301. package/ui/dist/assets/r-DADKenSm.js +0 -1
  302. package/ui/dist/assets/ruby-DsYpTuWg.js +0 -1
  303. package/ui/dist/assets/scheme-CyDdOh7e.js +0 -1
  304. package/ui/dist/assets/smalltalk-B16xEiuN.js +0 -1
  305. package/ui/dist/assets/solidity-CKzVLygQ.js +0 -1
  306. package/ui/dist/assets/sql-DcCJ9jop.js +0 -1
  307. package/ui/dist/assets/surrealql-Cq1d2uiF.js +0 -1
  308. package/ui/dist/assets/swift-DonLKvLd.js +0 -1
  309. package/ui/dist/assets/system-verilog-DJ5XKQeo.js +0 -1
  310. package/ui/dist/assets/tex-ChOOnEH8.js +0 -1
  311. package/ui/dist/assets/textile-DWBqthVk.js +0 -1
  312. package/ui/dist/assets/tiki-CxVlf5KZ.js +0 -1
  313. package/ui/dist/assets/toml-LvoKBwCs.js +0 -1
  314. package/ui/dist/assets/turtle-BDLWE2cD.js +0 -1
  315. package/ui/dist/assets/twig-CJAbKsCA.js +0 -1
  316. package/ui/dist/assets/typst-DI99ib-x.js +0 -1
  317. package/ui/dist/assets/verilog-CiiDBU1e.js +0 -1
  318. package/ui/dist/assets/vhdl-CMrOq2q1.js +0 -1
  319. package/ui/dist/assets/z80-CL1naaMV.js +0 -1
package/dist/cli.js CHANGED
@@ -2508,7 +2508,7 @@ var require_thread_stream = __commonJS((exports, module) => {
2508
2508
  var require_transport = __commonJS((exports, module) => {
2509
2509
  var __dirname = "/Users/juliantorres/GitLocal/Play/caret/trunk/node_modules/.bun/pino@10.3.1/node_modules/pino/lib";
2510
2510
  var { createRequire } = __require("module");
2511
- var { existsSync: existsSync4 } = __require("fs");
2511
+ var { existsSync: existsSync5 } = __require("fs");
2512
2512
  var getCallers = require_caller();
2513
2513
  var { join: join7, isAbsolute, sep } = __require("path");
2514
2514
  var { fileURLToPath: fileURLToPath2 } = __require("url");
@@ -2582,7 +2582,7 @@ var require_transport = __commonJS((exports, module) => {
2582
2582
  return false;
2583
2583
  }
2584
2584
  }
2585
- return isAbsolute(path) && !existsSync4(path);
2585
+ return isAbsolute(path) && !existsSync5(path);
2586
2586
  }
2587
2587
  function stripQuotes(value) {
2588
2588
  const first = value[0];
@@ -5803,7 +5803,7 @@ __export(exports_dist, {
5803
5803
  });
5804
5804
  import { styleText as styleText2, stripVTControlCharacters } from "util";
5805
5805
  import process$1 from "process";
5806
- import { existsSync as existsSync10, lstatSync, readdirSync as readdirSync5 } from "fs";
5806
+ import { existsSync as existsSync11, lstatSync, readdirSync as readdirSync6 } from "fs";
5807
5807
  import { dirname as dirname8, join as join14 } from "path";
5808
5808
  function isUnicodeSupported() {
5809
5809
  if (process$1.platform !== "win32") {
@@ -6515,9 +6515,9 @@ ${n3}
6515
6515
  return [];
6516
6516
  try {
6517
6517
  let i;
6518
- existsSync10(t2) ? lstatSync(t2).isDirectory() && (!e.directory || t2.endsWith("/")) ? i = t2 : i = dirname8(t2) : i = dirname8(t2);
6518
+ existsSync11(t2) ? lstatSync(t2).isDirectory() && (!e.directory || t2.endsWith("/")) ? i = t2 : i = dirname8(t2) : i = dirname8(t2);
6519
6519
  const c2 = t2.length > 1 && t2.endsWith("/") ? t2.slice(0, -1) : t2;
6520
- return readdirSync5(i).map((r2) => {
6520
+ return readdirSync6(i).map((r2) => {
6521
6521
  const n3 = join14(i, r2), m3 = lstatSync(n3);
6522
6522
  return {
6523
6523
  name: r2,
@@ -7216,190 +7216,7 @@ import { readFileSync as readFileSync2 } from "fs";
7216
7216
  import { homedir as homedir2 } from "os";
7217
7217
  import { join as join2 } from "path";
7218
7218
 
7219
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/error.js
7220
- /*!
7221
- * Copyright (c) Squirrel Chat et al., All rights reserved.
7222
- * SPDX-License-Identifier: BSD-3-Clause
7223
- *
7224
- * Redistribution and use in source and binary forms, with or without
7225
- * modification, are permitted provided that the following conditions are met:
7226
- *
7227
- * 1. Redistributions of source code must retain the above copyright notice, this
7228
- * list of conditions and the following disclaimer.
7229
- * 2. Redistributions in binary form must reproduce the above copyright notice,
7230
- * this list of conditions and the following disclaimer in the
7231
- * documentation and/or other materials provided with the distribution.
7232
- * 3. Neither the name of the copyright holder nor the names of its contributors
7233
- * may be used to endorse or promote products derived from this software without
7234
- * specific prior written permission.
7235
- *
7236
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7237
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7238
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7239
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7240
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7241
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7242
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7243
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7244
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7245
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7246
- */
7247
- function getLineColFromPtr(string, ptr) {
7248
- let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
7249
- return [lines.length, lines.pop().length + 1];
7250
- }
7251
- function makeCodeBlock(string, line, column) {
7252
- let lines = string.split(/\r\n|\n|\r/g);
7253
- let codeblock = "";
7254
- let numberLen = (Math.log10(line + 1) | 0) + 1;
7255
- for (let i = line - 1;i <= line + 1; i++) {
7256
- let l = lines[i - 1];
7257
- if (!l)
7258
- continue;
7259
- codeblock += i.toString().padEnd(numberLen, " ");
7260
- codeblock += ": ";
7261
- codeblock += l;
7262
- codeblock += `
7263
- `;
7264
- if (i === line) {
7265
- codeblock += " ".repeat(numberLen + column + 2);
7266
- codeblock += `^
7267
- `;
7268
- }
7269
- }
7270
- return codeblock;
7271
- }
7272
-
7273
- class TomlError extends Error {
7274
- line;
7275
- column;
7276
- codeblock;
7277
- constructor(message, options) {
7278
- const [line, column] = getLineColFromPtr(options.toml, options.ptr);
7279
- const codeblock = makeCodeBlock(options.toml, line, column);
7280
- super(`Invalid TOML document: ${message}
7281
-
7282
- ${codeblock}`, options);
7283
- this.line = line;
7284
- this.column = column;
7285
- this.codeblock = codeblock;
7286
- }
7287
- }
7288
-
7289
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/util.js
7290
- /*!
7291
- * Copyright (c) Squirrel Chat et al., All rights reserved.
7292
- * SPDX-License-Identifier: BSD-3-Clause
7293
- *
7294
- * Redistribution and use in source and binary forms, with or without
7295
- * modification, are permitted provided that the following conditions are met:
7296
- *
7297
- * 1. Redistributions of source code must retain the above copyright notice, this
7298
- * list of conditions and the following disclaimer.
7299
- * 2. Redistributions in binary form must reproduce the above copyright notice,
7300
- * this list of conditions and the following disclaimer in the
7301
- * documentation and/or other materials provided with the distribution.
7302
- * 3. Neither the name of the copyright holder nor the names of its contributors
7303
- * may be used to endorse or promote products derived from this software without
7304
- * specific prior written permission.
7305
- *
7306
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7307
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7308
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7309
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7310
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7311
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7312
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7313
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7314
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7315
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7316
- */
7317
- function isEscaped(str, ptr) {
7318
- let i = 0;
7319
- while (str[ptr - ++i] === "\\")
7320
- ;
7321
- return --i && i % 2;
7322
- }
7323
- function indexOfNewline(str, start = 0, end = str.length) {
7324
- let idx = str.indexOf(`
7325
- `, start);
7326
- if (str[idx - 1] === "\r")
7327
- idx--;
7328
- return idx <= end ? idx : -1;
7329
- }
7330
- function skipComment(str, ptr) {
7331
- for (let i = ptr;i < str.length; i++) {
7332
- let c = str[i];
7333
- if (c === `
7334
- `)
7335
- return i;
7336
- if (c === "\r" && str[i + 1] === `
7337
- `)
7338
- return i + 1;
7339
- if (c < " " && c !== "\t" || c === "\x7F") {
7340
- throw new TomlError("control characters are not allowed in comments", {
7341
- toml: str,
7342
- ptr
7343
- });
7344
- }
7345
- }
7346
- return str.length;
7347
- }
7348
- function skipVoid(str, ptr, banNewLines, banComments) {
7349
- let c;
7350
- while (true) {
7351
- while ((c = str[ptr]) === " " || c === "\t" || !banNewLines && (c === `
7352
- ` || c === "\r" && str[ptr + 1] === `
7353
- `))
7354
- ptr++;
7355
- if (banComments || c !== "#")
7356
- break;
7357
- ptr = skipComment(str, ptr);
7358
- }
7359
- return ptr;
7360
- }
7361
- function skipUntil(str, ptr, sep, end, banNewLines = false) {
7362
- if (!end) {
7363
- ptr = indexOfNewline(str, ptr);
7364
- return ptr < 0 ? str.length : ptr;
7365
- }
7366
- for (let i = ptr;i < str.length; i++) {
7367
- let c = str[i];
7368
- if (c === "#") {
7369
- i = indexOfNewline(str, i);
7370
- } else if (c === sep) {
7371
- return i + 1;
7372
- } else if (c === end || banNewLines && (c === `
7373
- ` || c === "\r" && str[i + 1] === `
7374
- `)) {
7375
- return i;
7376
- }
7377
- }
7378
- throw new TomlError("cannot find end of structure", {
7379
- toml: str,
7380
- ptr
7381
- });
7382
- }
7383
- function getStringEnd(str, seek) {
7384
- let first = str[seek];
7385
- let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
7386
- seek += target.length - 1;
7387
- do
7388
- seek = str.indexOf(target, ++seek);
7389
- while (seek > -1 && first !== "'" && isEscaped(str, seek));
7390
- if (seek > -1) {
7391
- seek += target.length;
7392
- if (target.length > 1) {
7393
- if (str[seek] === first)
7394
- seek++;
7395
- if (str[seek] === first)
7396
- seek++;
7397
- }
7398
- }
7399
- return seek;
7400
- }
7401
-
7402
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/date.js
7219
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/date.js
7403
7220
  /*!
7404
7221
  * Copyright (c) Squirrel Chat et al., All rights reserved.
7405
7222
  * SPDX-License-Identifier: BSD-3-Clause
@@ -7519,7 +7336,160 @@ class TomlDate extends Date {
7519
7336
  }
7520
7337
  }
7521
7338
 
7522
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/primitive.js
7339
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/error.js
7340
+ /*!
7341
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7342
+ * SPDX-License-Identifier: BSD-3-Clause
7343
+ *
7344
+ * Redistribution and use in source and binary forms, with or without
7345
+ * modification, are permitted provided that the following conditions are met:
7346
+ *
7347
+ * 1. Redistributions of source code must retain the above copyright notice, this
7348
+ * list of conditions and the following disclaimer.
7349
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7350
+ * this list of conditions and the following disclaimer in the
7351
+ * documentation and/or other materials provided with the distribution.
7352
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7353
+ * may be used to endorse or promote products derived from this software without
7354
+ * specific prior written permission.
7355
+ *
7356
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7357
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7358
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7359
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7360
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7361
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7362
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7363
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7364
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7365
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7366
+ */
7367
+ function getLineColFromPtr(string, ptr) {
7368
+ let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
7369
+ return [lines.length, lines.pop().length + 1];
7370
+ }
7371
+ function makeCodeBlock(string, line, column) {
7372
+ let lines = string.split(/\r\n|\n|\r/g);
7373
+ let codeblock = "";
7374
+ let numberLen = (Math.log10(line + 1) | 0) + 1;
7375
+ for (let i = line - 1;i <= line + 1; i++) {
7376
+ let l = lines[i - 1];
7377
+ if (!l)
7378
+ continue;
7379
+ codeblock += i.toString().padEnd(numberLen, " ");
7380
+ codeblock += ": ";
7381
+ codeblock += l;
7382
+ codeblock += `
7383
+ `;
7384
+ if (i === line) {
7385
+ codeblock += " ".repeat(numberLen + column + 2);
7386
+ codeblock += `^
7387
+ `;
7388
+ }
7389
+ }
7390
+ return codeblock;
7391
+ }
7392
+
7393
+ class TomlError extends Error {
7394
+ line;
7395
+ column;
7396
+ codeblock;
7397
+ constructor(message, options) {
7398
+ const [line, column] = getLineColFromPtr(options.toml, options.ptr);
7399
+ const codeblock = makeCodeBlock(options.toml, line, column);
7400
+ super(`Invalid TOML document: ${message}
7401
+
7402
+ ${codeblock}`, options);
7403
+ this.line = line;
7404
+ this.column = column;
7405
+ this.codeblock = codeblock;
7406
+ }
7407
+ }
7408
+
7409
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/util.js
7410
+ /*!
7411
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7412
+ * SPDX-License-Identifier: BSD-3-Clause
7413
+ *
7414
+ * Redistribution and use in source and binary forms, with or without
7415
+ * modification, are permitted provided that the following conditions are met:
7416
+ *
7417
+ * 1. Redistributions of source code must retain the above copyright notice, this
7418
+ * list of conditions and the following disclaimer.
7419
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
7420
+ * this list of conditions and the following disclaimer in the
7421
+ * documentation and/or other materials provided with the distribution.
7422
+ * 3. Neither the name of the copyright holder nor the names of its contributors
7423
+ * may be used to endorse or promote products derived from this software without
7424
+ * specific prior written permission.
7425
+ *
7426
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
7427
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7428
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7429
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7430
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7431
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7432
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7433
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7434
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7435
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7436
+ */
7437
+ function indexOfNewline(str, start = 0) {
7438
+ let idx = str.indexOf(`
7439
+ `, start);
7440
+ if (str.charCodeAt(idx - 1) === 13)
7441
+ idx--;
7442
+ return idx;
7443
+ }
7444
+ function skipComment(ctx) {
7445
+ for (;ctx.p < ctx.s.length; ctx.p++) {
7446
+ let c = ctx.s.charCodeAt(ctx.p);
7447
+ if (c === 10)
7448
+ break;
7449
+ if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
7450
+ ctx.p++;
7451
+ break;
7452
+ }
7453
+ if (c < 32 && c !== 9 || c === 127) {
7454
+ throw new TomlError("control characters are not allowed in comments", {
7455
+ toml: ctx.s,
7456
+ ptr: ctx.p
7457
+ });
7458
+ }
7459
+ }
7460
+ }
7461
+ function skipVoid(ctx, banNewLines, banComments) {
7462
+ let c;
7463
+ while (true) {
7464
+ while ((c = ctx.s.charCodeAt(ctx.p)) === 32 || c === 9 || !banNewLines && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
7465
+ ctx.p++;
7466
+ if (banComments || c !== 35)
7467
+ break;
7468
+ skipComment(ctx);
7469
+ }
7470
+ }
7471
+ function skipUntil(ctx, sep, end) {
7472
+ let ptr = ctx.p;
7473
+ if (!end) {
7474
+ ptr = indexOfNewline(ctx.s, ptr);
7475
+ ctx.p = ptr < 0 ? ctx.s.length : ptr;
7476
+ return;
7477
+ }
7478
+ for (;ctx.p < ctx.s.length; ctx.p++) {
7479
+ let c = ctx.s.charCodeAt(ctx.p);
7480
+ if (c === 35) {
7481
+ skipComment(ctx);
7482
+ } else if (c === end || c === sep) {
7483
+ return;
7484
+ }
7485
+ }
7486
+ throw new TomlError("cannot find end of structure", {
7487
+ toml: ctx.s,
7488
+ ptr
7489
+ });
7490
+ }
7491
+
7492
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/primitive.js
7523
7493
  /*!
7524
7494
  * Copyright (c) Squirrel Chat et al., All rights reserved.
7525
7495
  * SPDX-License-Identifier: BSD-3-Clause
@@ -7550,101 +7520,117 @@ class TomlDate extends Date {
7550
7520
  var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
7551
7521
  var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
7552
7522
  var LEADING_ZERO = /^[+-]?0[0-9_]/;
7553
- var ESCAPE_REGEX = /^[0-9a-f]{2,8}$/i;
7554
- var ESC_MAP = {
7555
- b: "\b",
7556
- t: "\t",
7557
- n: `
7558
- `,
7559
- f: "\f",
7560
- r: "\r",
7561
- e: "\x1B",
7562
- '"': '"',
7563
- "\\": "\\"
7564
- };
7565
- function parseString(str, ptr = 0, endPtr = str.length) {
7566
- let isLiteral = str[ptr] === "'";
7567
- let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
7523
+ function parseString(ctx) {
7524
+ let start = ctx.p;
7525
+ let c = ctx.s.charCodeAt(ctx.p++);
7526
+ let first = c;
7527
+ let isLiteral = c === 39;
7528
+ let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1);
7568
7529
  if (isMultiline) {
7569
- endPtr -= 2;
7570
- if (str[ptr += 2] === "\r")
7571
- ptr++;
7572
- if (str[ptr] === `
7573
- `)
7574
- ptr++;
7575
- }
7576
- let tmp = 0;
7577
- let isEscape;
7530
+ if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 10)
7531
+ ctx.p++;
7532
+ else if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)
7533
+ ctx.p += 2;
7534
+ }
7578
7535
  let parsed = "";
7579
- let sliceStart = ptr;
7580
- while (ptr < endPtr - 1) {
7581
- let c = str[ptr++];
7582
- if (c === `
7583
- ` || c === "\r" && str[ptr] === `
7584
- `) {
7585
- if (!isMultiline) {
7586
- throw new TomlError("newlines are not allowed in strings", {
7587
- toml: str,
7588
- ptr: ptr - 1
7589
- });
7590
- }
7591
- } else if (c < " " && c !== "\t" || c === "\x7F") {
7536
+ let sliceStart = ctx.p;
7537
+ let state = 0;
7538
+ for (;ctx.p < ctx.s.length; ctx.p++) {
7539
+ c = ctx.s.charCodeAt(ctx.p);
7540
+ if (isMultiline && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
7541
+ state = state && 3;
7542
+ } else if (c < 32 && c !== 9 || c === 127) {
7592
7543
  throw new TomlError("control characters are not allowed in strings", {
7593
- toml: str,
7594
- ptr: ptr - 1
7544
+ toml: ctx.s,
7545
+ ptr: ctx.p
7595
7546
  });
7596
- }
7597
- if (isEscape) {
7598
- isEscape = false;
7599
- if (c === "x" || c === "u" || c === "U") {
7600
- let code = str.slice(ptr, ptr += c === "x" ? 2 : c === "u" ? 4 : 8);
7601
- if (!ESCAPE_REGEX.test(code)) {
7602
- throw new TomlError("invalid unicode escape", {
7603
- toml: str,
7604
- ptr: tmp
7605
- });
7606
- }
7607
- try {
7608
- parsed += String.fromCodePoint(parseInt(code, 16));
7609
- } catch {
7610
- throw new TomlError("invalid unicode escape", {
7611
- toml: str,
7612
- ptr: tmp
7613
- });
7614
- }
7615
- } else if (isMultiline && (c === `
7616
- ` || c === " " || c === "\t" || c === "\r")) {
7617
- ptr = skipVoid(str, ptr - 1, true);
7618
- if (str[ptr] !== `
7619
- ` && str[ptr] !== "\r") {
7620
- throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
7621
- toml: str,
7622
- ptr: tmp
7623
- });
7624
- }
7625
- ptr = skipVoid(str, ptr);
7626
- } else if (c in ESC_MAP) {
7627
- parsed += ESC_MAP[c];
7547
+ } else if ((!state || state === 3) && c === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
7548
+ if (isMultiline) {
7549
+ if (ctx.s.charCodeAt(ctx.p + 3) === first)
7550
+ ctx.p++;
7551
+ if (ctx.s.charCodeAt(ctx.p + 3) === first)
7552
+ ctx.p++;
7553
+ }
7554
+ if (!state)
7555
+ parsed += ctx.s.slice(sliceStart, ctx.p);
7556
+ ctx.p += isMultiline ? 3 : 1;
7557
+ return parsed;
7558
+ } else if (!state) {
7559
+ if (!isLiteral && c === 92) {
7560
+ parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
7561
+ state = 1;
7562
+ }
7563
+ } else if (state === 1) {
7564
+ if (c === 120 || c === 117 || c === 85) {
7565
+ let value = 0;
7566
+ let len = c === 120 ? 2 : c === 117 ? 4 : 8;
7567
+ for (let j = 0;j < len; j++, ctx.p++) {
7568
+ let hex = ctx.s.charCodeAt(ctx.p + 1);
7569
+ let digit = hex >= 48 && hex <= 57 ? hex - 48 : hex >= 65 && hex <= 70 ? hex - 65 + 10 : hex >= 97 && hex <= 102 ? hex - 97 + 10 : -1;
7570
+ if (digit < 0)
7571
+ throw new TomlError("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
7572
+ value = value << 4 | digit;
7573
+ }
7574
+ if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
7575
+ throw new TomlError("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
7576
+ }
7577
+ parsed += String.fromCodePoint(value);
7578
+ sliceStart = ctx.p + 1;
7579
+ state = 0;
7580
+ } else if (c === 32 || c === 9) {
7581
+ state = 2;
7628
7582
  } else {
7629
- throw new TomlError("unrecognized escape sequence", {
7630
- toml: str,
7631
- ptr: tmp
7583
+ if (c === 98)
7584
+ parsed += "\b";
7585
+ else if (c === 116)
7586
+ parsed += "\t";
7587
+ else if (c === 110)
7588
+ parsed += `
7589
+ `;
7590
+ else if (c === 102)
7591
+ parsed += "\f";
7592
+ else if (c === 114)
7593
+ parsed += "\r";
7594
+ else if (c === 101)
7595
+ parsed += "\x1B";
7596
+ else if (c === 34)
7597
+ parsed += '"';
7598
+ else if (c === 92)
7599
+ parsed += "\\";
7600
+ else
7601
+ throw new TomlError("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
7602
+ sliceStart = ctx.p + 1;
7603
+ state = 0;
7604
+ }
7605
+ } else if (c !== 32 && c !== 9) {
7606
+ if (state === 2) {
7607
+ throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
7608
+ toml: ctx.s,
7609
+ ptr: sliceStart
7632
7610
  });
7633
7611
  }
7634
- sliceStart = ptr;
7635
- } else if (!isLiteral && c === "\\") {
7636
- tmp = ptr - 1;
7637
- isEscape = true;
7638
- parsed += str.slice(sliceStart, tmp);
7612
+ state = !isLiteral && c === 92 ? 1 : 0;
7613
+ sliceStart = ctx.p;
7639
7614
  }
7640
7615
  }
7641
- return parsed + str.slice(sliceStart, endPtr - 1);
7616
+ throw new TomlError("unfinished string", { toml: ctx.s, ptr: start });
7642
7617
  }
7643
- function parseValue(value, toml, ptr, integersAsBigInt) {
7644
- if (value === "true")
7645
- return true;
7646
- if (value === "false")
7647
- return false;
7618
+ function sliceAndTrimEndOf(ctx, start, end) {
7619
+ let value = ctx.s.slice(start, end);
7620
+ let commentIdx = value.indexOf("#");
7621
+ if (commentIdx > 0) {
7622
+ skipComment({ s: value, p: commentIdx, d: 0 });
7623
+ value = value.slice(0, commentIdx);
7624
+ }
7625
+ return value.trimEnd();
7626
+ }
7627
+ function parseValue(ctx, integersAsBigInt, end) {
7628
+ let ptr = ctx.p;
7629
+ let err = { toml: ctx.s, ptr };
7630
+ skipUntil(ctx, 44, end);
7631
+ let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
7632
+ if (!value)
7633
+ throw new TomlError("incomplete declaration: value expected", err);
7648
7634
  if (value === "-inf")
7649
7635
  return -Infinity;
7650
7636
  if (value === "inf" || value === "+inf")
@@ -7656,25 +7642,16 @@ function parseValue(value, toml, ptr, integersAsBigInt) {
7656
7642
  let isInt = INT_REGEX.test(value);
7657
7643
  if (isInt || FLOAT_REGEX.test(value)) {
7658
7644
  if (LEADING_ZERO.test(value)) {
7659
- throw new TomlError("leading zeroes are not allowed", {
7660
- toml,
7661
- ptr
7662
- });
7645
+ throw new TomlError("leading zeroes are not allowed", err);
7663
7646
  }
7664
7647
  value = value.replace(/_/g, "");
7665
7648
  let numeric = +value;
7666
7649
  if (isNaN(numeric)) {
7667
- throw new TomlError("invalid number", {
7668
- toml,
7669
- ptr
7670
- });
7650
+ throw new TomlError("invalid number", err);
7671
7651
  }
7672
7652
  if (isInt) {
7673
7653
  if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
7674
- throw new TomlError("integer value cannot be represented losslessly", {
7675
- toml,
7676
- ptr
7677
- });
7654
+ throw new TomlError("integer value cannot be represented losslessly", err);
7678
7655
  }
7679
7656
  if (isInt || integersAsBigInt === true)
7680
7657
  numeric = BigInt(value);
@@ -7682,16 +7659,12 @@ function parseValue(value, toml, ptr, integersAsBigInt) {
7682
7659
  return numeric;
7683
7660
  }
7684
7661
  const date = new TomlDate(value);
7685
- if (!date.isValid()) {
7686
- throw new TomlError("invalid value", {
7687
- toml,
7688
- ptr
7689
- });
7690
- }
7662
+ if (!date.isValid())
7663
+ throw new TomlError("invalid value", err);
7691
7664
  return date;
7692
7665
  }
7693
7666
 
7694
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/extract.js
7667
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/extract.js
7695
7668
  /*!
7696
7669
  * Copyright (c) Squirrel Chat et al., All rights reserved.
7697
7670
  * SPDX-License-Identifier: BSD-3-Clause
@@ -7719,74 +7692,39 @@ function parseValue(value, toml, ptr, integersAsBigInt) {
7719
7692
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7720
7693
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7721
7694
  */
7722
- function sliceAndTrimEndOf(str, startPtr, endPtr) {
7723
- let value = str.slice(startPtr, endPtr);
7724
- let commentIdx = value.indexOf("#");
7725
- if (commentIdx > -1) {
7726
- skipComment(str, commentIdx);
7727
- value = value.slice(0, commentIdx);
7728
- }
7729
- return [value.trimEnd(), commentIdx];
7730
- }
7731
- function extractValue(str, ptr, end, depth, integersAsBigInt) {
7732
- if (depth === 0) {
7733
- throw new TomlError("document contains excessively nested structures. aborting.", {
7734
- toml: str,
7735
- ptr
7736
- });
7737
- }
7738
- let c = str[ptr];
7739
- if (c === "[" || c === "{") {
7740
- let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
7741
- if (end) {
7742
- endPtr2 = skipVoid(str, endPtr2);
7743
- if (str[endPtr2] === ",")
7744
- endPtr2++;
7745
- else if (str[endPtr2] !== end) {
7746
- throw new TomlError("expected comma or end of structure", {
7747
- toml: str,
7748
- ptr: endPtr2
7749
- });
7750
- }
7695
+ function extractValue(ctx, end, integersAsBigInt) {
7696
+ let ptr = ctx.p;
7697
+ let c = ctx.s.charCodeAt(ptr);
7698
+ if (c === 91 || c === 123) {
7699
+ if (!ctx.d--) {
7700
+ throw new TomlError("document contains excessively nested structures. aborting.", {
7701
+ toml: ctx.s,
7702
+ ptr
7703
+ });
7751
7704
  }
7752
- return [value, endPtr2];
7705
+ let value = c === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
7706
+ ctx.d++;
7707
+ return value;
7753
7708
  }
7754
- let endPtr;
7755
- if (c === '"' || c === "'") {
7756
- endPtr = getStringEnd(str, ptr);
7757
- let parsed = parseString(str, ptr, endPtr);
7758
- if (end) {
7759
- endPtr = skipVoid(str, endPtr);
7760
- if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== `
7761
- ` && str[endPtr] !== "\r") {
7762
- throw new TomlError("unexpected character encountered", {
7763
- toml: str,
7764
- ptr: endPtr
7765
- });
7766
- }
7767
- endPtr += +(str[endPtr] === ",");
7768
- }
7769
- return [parsed, endPtr];
7709
+ if (c === 34 || c === 39) {
7710
+ return parseString(ctx);
7770
7711
  }
7771
- endPtr = skipUntil(str, ptr, ",", end);
7772
- let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ","));
7773
- if (!slice[0]) {
7774
- throw new TomlError("incomplete key-value declaration: no value specified", {
7775
- toml: str,
7776
- ptr
7777
- });
7712
+ if (c === 116) {
7713
+ if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
7714
+ throw new TomlError("invalid value", { toml: ctx.s, ptr });
7715
+ ctx.p++;
7716
+ return true;
7778
7717
  }
7779
- if (end && slice[1] > -1) {
7780
- endPtr = skipVoid(str, ptr + slice[1]);
7781
- endPtr += +(str[endPtr] === ",");
7718
+ if (c === 102) {
7719
+ if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
7720
+ throw new TomlError("invalid value", { toml: ctx.s, ptr });
7721
+ ctx.p++;
7722
+ return false;
7782
7723
  }
7783
- return [
7784
- parseValue(slice[0], str, ptr, integersAsBigInt),
7785
- endPtr
7786
- ];
7724
+ return parseValue(ctx, integersAsBigInt, end);
7787
7725
  }
7788
7726
 
7789
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/struct.js
7727
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/struct.js
7790
7728
  /*!
7791
7729
  * Copyright (c) Squirrel Chat et al., All rights reserved.
7792
7730
  * SPDX-License-Identifier: BSD-3-Clause
@@ -7815,155 +7753,147 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) {
7815
7753
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7816
7754
  */
7817
7755
  var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
7818
- function parseKey(str, ptr, end = "=") {
7819
- let dot = ptr - 1;
7756
+ function parseKey(ctx, end = "=") {
7757
+ let start = ctx.p;
7758
+ let dot = start - 1;
7820
7759
  let parsed = [];
7821
- let endPtr = str.indexOf(end, ptr);
7760
+ let endPtr = ctx.s.indexOf(end, start);
7822
7761
  if (endPtr < 0) {
7823
7762
  throw new TomlError("incomplete key-value: cannot find end of key", {
7824
- toml: str,
7825
- ptr
7763
+ toml: ctx.s,
7764
+ ptr: start
7826
7765
  });
7827
7766
  }
7828
7767
  do {
7829
- let c = str[ptr = ++dot];
7830
- if (c !== " " && c !== "\t") {
7831
- if (c === '"' || c === "'") {
7832
- if (c === str[ptr + 1] && c === str[ptr + 2]) {
7768
+ let c = ctx.s.charCodeAt(ctx.p = ++dot);
7769
+ if (c !== 32 && c !== 9) {
7770
+ if (c === 34 || c === 39) {
7771
+ if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) {
7833
7772
  throw new TomlError("multiline strings are not allowed in keys", {
7834
- toml: str,
7835
- ptr
7773
+ toml: ctx.s,
7774
+ ptr: ctx.p
7836
7775
  });
7837
7776
  }
7838
- let eos = getStringEnd(str, ptr);
7839
- if (eos < 0) {
7840
- throw new TomlError("unfinished string encountered", {
7841
- toml: str,
7842
- ptr
7843
- });
7844
- }
7845
- dot = str.indexOf(".", eos);
7846
- let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
7777
+ let part = parseString(ctx);
7778
+ dot = ctx.s.indexOf(".", ctx.p);
7779
+ let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
7847
7780
  let newLine = indexOfNewline(strEnd);
7848
7781
  if (newLine > -1) {
7849
7782
  throw new TomlError("newlines are not allowed in keys", {
7850
- toml: str,
7851
- ptr: ptr + dot + newLine
7783
+ toml: ctx.s,
7784
+ ptr: newLine
7852
7785
  });
7853
7786
  }
7854
7787
  if (strEnd.trimStart()) {
7855
7788
  throw new TomlError("found extra tokens after the string part", {
7856
- toml: str,
7857
- ptr: eos
7789
+ toml: ctx.s,
7790
+ ptr: ctx.p
7858
7791
  });
7859
7792
  }
7860
- if (endPtr < eos) {
7861
- endPtr = str.indexOf(end, eos);
7793
+ if (endPtr < ctx.p) {
7794
+ endPtr = ctx.s.indexOf(end, ctx.p);
7862
7795
  if (endPtr < 0) {
7863
7796
  throw new TomlError("incomplete key-value: cannot find end of key", {
7864
- toml: str,
7865
- ptr
7797
+ toml: ctx.s,
7798
+ ptr: start
7866
7799
  });
7867
7800
  }
7868
7801
  }
7869
- parsed.push(parseString(str, ptr, eos));
7802
+ parsed.push(part);
7870
7803
  } else {
7871
- dot = str.indexOf(".", ptr);
7872
- let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
7804
+ dot = ctx.s.indexOf(".", ctx.p);
7805
+ let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
7873
7806
  if (!KEY_PART_RE.test(part)) {
7874
7807
  throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
7875
- toml: str,
7876
- ptr
7808
+ toml: ctx.s,
7809
+ ptr: ctx.p
7877
7810
  });
7878
7811
  }
7879
7812
  parsed.push(part.trimEnd());
7880
7813
  }
7881
7814
  }
7882
7815
  } while (dot + 1 && dot < endPtr);
7883
- return [parsed, skipVoid(str, endPtr + 1, true, true)];
7816
+ ctx.p = endPtr + 1;
7817
+ skipVoid(ctx, true, true);
7818
+ return parsed;
7884
7819
  }
7885
- function parseInlineTable(str, ptr, depth, integersAsBigInt) {
7820
+ function parseInlineTable(ctx, integersAsBigInt) {
7886
7821
  let res = {};
7887
7822
  let seen = new Set;
7888
7823
  let c;
7889
- ptr++;
7890
- while ((c = str[ptr++]) !== "}" && c) {
7891
- if (c === ",") {
7892
- throw new TomlError("expected value, found comma", {
7893
- toml: str,
7894
- ptr: ptr - 1
7895
- });
7896
- } else if (c === "#")
7897
- ptr = skipComment(str, ptr);
7898
- else if (c !== " " && c !== "\t" && c !== `
7899
- ` && c !== "\r") {
7900
- let k;
7901
- let t = res;
7902
- let hasOwn = false;
7903
- let [key, keyEndPtr] = parseKey(str, ptr - 1);
7904
- for (let i = 0;i < key.length; i++) {
7905
- if (i)
7906
- t = hasOwn ? t[k] : t[k] = {};
7907
- k = key[i];
7908
- if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
7909
- throw new TomlError("trying to redefine an already defined value", {
7910
- toml: str,
7911
- ptr
7912
- });
7913
- }
7914
- if (!hasOwn && k === "__proto__") {
7915
- Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
7916
- }
7917
- }
7918
- if (hasOwn) {
7824
+ ctx.p++;
7825
+ while (ctx.p < ctx.s.length) {
7826
+ skipVoid(ctx);
7827
+ if ((c = ctx.s.charCodeAt(ctx.p)) === 125) {
7828
+ ctx.p++;
7829
+ return res;
7830
+ }
7831
+ let k;
7832
+ let t = res;
7833
+ let hasOwn = false;
7834
+ let p = ctx.p;
7835
+ let key = parseKey(ctx);
7836
+ for (let i = 0;i < key.length; i++) {
7837
+ if (i)
7838
+ t = hasOwn ? t[k] : t[k] = {};
7839
+ k = key[i];
7840
+ if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
7919
7841
  throw new TomlError("trying to redefine an already defined value", {
7920
- toml: str,
7921
- ptr
7842
+ toml: ctx.s,
7843
+ ptr: p
7922
7844
  });
7923
7845
  }
7924
- let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
7925
- seen.add(value);
7926
- t[k] = value;
7927
- ptr = valueEndPtr;
7846
+ if (!hasOwn && k === "__proto__") {
7847
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
7848
+ }
7849
+ }
7850
+ if (hasOwn) {
7851
+ throw new TomlError("trying to redefine an already defined value", {
7852
+ toml: ctx.s,
7853
+ ptr: ctx.p
7854
+ });
7855
+ }
7856
+ let value = extractValue(ctx, 125, integersAsBigInt);
7857
+ seen.add(t[k] = value);
7858
+ skipVoid(ctx);
7859
+ if ((c = ctx.s.charCodeAt(ctx.p++)) === 125) {
7860
+ return res;
7861
+ }
7862
+ if (c !== 44) {
7863
+ throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
7928
7864
  }
7929
7865
  }
7930
- if (!c) {
7931
- throw new TomlError("unfinished table encountered", {
7932
- toml: str,
7933
- ptr
7934
- });
7935
- }
7936
- return [res, ptr];
7866
+ throw new TomlError("unfinished table encountered", {
7867
+ toml: ctx.s,
7868
+ ptr: ctx.p
7869
+ });
7937
7870
  }
7938
- function parseArray(str, ptr, depth, integersAsBigInt) {
7871
+ function parseArray(ctx, integersAsBigInt) {
7939
7872
  let res = [];
7940
7873
  let c;
7941
- ptr++;
7942
- while ((c = str[ptr++]) !== "]" && c) {
7943
- if (c === ",") {
7944
- throw new TomlError("expected value, found comma", {
7945
- toml: str,
7946
- ptr: ptr - 1
7947
- });
7948
- } else if (c === "#")
7949
- ptr = skipComment(str, ptr);
7950
- else if (c !== " " && c !== "\t" && c !== `
7951
- ` && c !== "\r") {
7952
- let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt);
7953
- res.push(e[0]);
7954
- ptr = e[1];
7955
- }
7956
- }
7957
- if (!c) {
7958
- throw new TomlError("unfinished array encountered", {
7959
- toml: str,
7960
- ptr
7961
- });
7874
+ ctx.p++;
7875
+ while (ctx.p < ctx.s.length) {
7876
+ skipVoid(ctx);
7877
+ if ((c = ctx.s.charCodeAt(ctx.p)) === 93) {
7878
+ ctx.p++;
7879
+ return res;
7880
+ }
7881
+ res.push(extractValue(ctx, 93, integersAsBigInt));
7882
+ skipVoid(ctx);
7883
+ if ((c = ctx.s.charCodeAt(ctx.p++)) === 93) {
7884
+ return res;
7885
+ }
7886
+ if (c !== 44) {
7887
+ throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
7888
+ }
7962
7889
  }
7963
- return [res, ptr];
7890
+ throw new TomlError("unfinished array encountered", {
7891
+ toml: ctx.s,
7892
+ ptr: ctx.p
7893
+ });
7964
7894
  }
7965
7895
 
7966
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/parse.js
7896
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/parse.js
7967
7897
  /*!
7968
7898
  * Copyright (c) Squirrel Chat et al., All rights reserved.
7969
7899
  * SPDX-License-Identifier: BSD-3-Clause
@@ -8051,60 +7981,61 @@ function peekTable(key, table, meta, type) {
8051
7981
  return [k, t, state.c];
8052
7982
  }
8053
7983
  function parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
7984
+ let ctx = { s: toml, p: 0, d: maxDepth };
8054
7985
  let res = {};
8055
7986
  let meta = {};
7987
+ let tmp;
8056
7988
  let tbl = res;
8057
7989
  let m = meta;
8058
- for (let ptr = skipVoid(toml, 0);ptr < toml.length; ) {
8059
- if (toml[ptr] === "[") {
8060
- let isTableArray = toml[++ptr] === "[";
8061
- let k = parseKey(toml, ptr += +isTableArray, "]");
7990
+ skipVoid(ctx);
7991
+ while (ctx.p < toml.length) {
7992
+ if (toml.charCodeAt(ctx.p) === 91) {
7993
+ let isTableArray = toml.charCodeAt(++ctx.p) === 91;
7994
+ tmp = ctx.p += +isTableArray;
7995
+ let k = parseKey(ctx, "]");
8062
7996
  if (isTableArray) {
8063
- if (toml[k[1] - 1] !== "]") {
7997
+ if (toml.charCodeAt(ctx.p - 1) !== 93) {
8064
7998
  throw new TomlError("expected end of table declaration", {
8065
7999
  toml,
8066
- ptr: k[1] - 1
8000
+ ptr: ctx.p - 1
8067
8001
  });
8068
8002
  }
8069
- k[1]++;
8003
+ ctx.p++;
8070
8004
  }
8071
- let p = peekTable(k[0], res, meta, isTableArray ? 2 : 1);
8005
+ let p = peekTable(k, res, meta, isTableArray ? 2 : 1);
8072
8006
  if (!p) {
8073
8007
  throw new TomlError("trying to redefine an already defined table or value", {
8074
8008
  toml,
8075
- ptr
8009
+ ptr: tmp
8076
8010
  });
8077
8011
  }
8078
8012
  m = p[2];
8079
8013
  tbl = p[1];
8080
- ptr = k[1];
8081
8014
  } else {
8082
- let k = parseKey(toml, ptr);
8083
- let p = peekTable(k[0], tbl, m, 0);
8015
+ tmp = ctx.p;
8016
+ let k = parseKey(ctx);
8017
+ let p = peekTable(k, tbl, m, 0);
8084
8018
  if (!p) {
8085
8019
  throw new TomlError("trying to redefine an already defined table or value", {
8086
8020
  toml,
8087
- ptr
8021
+ ptr: tmp
8088
8022
  });
8089
8023
  }
8090
- let v = extractValue(toml, k[1], undefined, maxDepth, integersAsBigInt);
8091
- p[1][p[0]] = v[0];
8092
- ptr = v[1];
8024
+ p[1][p[0]] = extractValue(ctx, undefined, integersAsBigInt);
8093
8025
  }
8094
- ptr = skipVoid(toml, ptr, true);
8095
- if (toml[ptr] && toml[ptr] !== `
8096
- ` && toml[ptr] !== "\r") {
8026
+ skipVoid(ctx, true);
8027
+ if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
8097
8028
  throw new TomlError("each key-value declaration must be followed by an end-of-line", {
8098
8029
  toml,
8099
- ptr
8030
+ ptr: ctx.p
8100
8031
  });
8101
8032
  }
8102
- ptr = skipVoid(toml, ptr);
8033
+ skipVoid(ctx);
8103
8034
  }
8104
8035
  return res;
8105
8036
  }
8106
8037
 
8107
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/stringify.js
8038
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/stringify.js
8108
8039
  /*!
8109
8040
  * Copyright (c) Squirrel Chat et al., All rights reserved.
8110
8041
  * SPDX-License-Identifier: BSD-3-Clause
@@ -8133,7 +8064,7 @@ function parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
8133
8064
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8134
8065
  */
8135
8066
 
8136
- // node_modules/.bun/smol-toml@1.6.1/node_modules/smol-toml/dist/index.js
8067
+ // node_modules/.bun/smol-toml@1.8.0/node_modules/smol-toml/dist/index.js
8137
8068
  /*!
8138
8069
  * Copyright (c) Squirrel Chat et al., All rights reserved.
8139
8070
  * SPDX-License-Identifier: BSD-3-Clause
@@ -9893,10 +9824,10 @@ function fatalDeny(reason) {
9893
9824
 
9894
9825
  // src/commands/daemon.ts
9895
9826
  import { randomUUID } from "crypto";
9896
- import { existsSync as existsSync6, unlinkSync as unlinkSync3 } from "fs";
9827
+ import { existsSync as existsSync7, unlinkSync as unlinkSync4 } from "fs";
9897
9828
 
9898
9829
  // src/config/settings.ts
9899
- import { readFileSync as readFileSync6, statSync } from "fs";
9830
+ import { readFileSync as readFileSync7, statSync as statSync2 } from "fs";
9900
9831
 
9901
9832
  // node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
9902
9833
  var exports_external = {};
@@ -24176,6 +24107,10 @@ function date4(params) {
24176
24107
  config(en_default());
24177
24108
  // src/config/constants.ts
24178
24109
  var DEFAULT_PORT = 42718;
24110
+ var DEFAULT_LOG_MAX_SIZE = 5 * 1024 * 1024;
24111
+ var DEFAULT_LOG_KEEP = 10;
24112
+ var MIN_LOG_MAX_SIZE = 64 * 1024;
24113
+ var MAX_LOG_MAX_SIZE = 256 * 1024 * 1024;
24179
24114
  var VANITY_HOST = "caret.localhost";
24180
24115
  var HOOK_TIMEOUT_S = 3900;
24181
24116
  var EXCERPT_RADIUS = 30;
@@ -24243,7 +24178,7 @@ function deriveIdleTimeoutSec(heartbeatMs) {
24243
24178
  }
24244
24179
 
24245
24180
  // src/config/paths.ts
24246
- import { chmodSync, mkdirSync } from "fs";
24181
+ import { chmodSync, existsSync as existsSync4, mkdirSync, renameSync } from "fs";
24247
24182
  import { homedir as homedir4 } from "os";
24248
24183
  function xdgDir(envVar, fallback) {
24249
24184
  const base = process.env[envVar] || `${homedir4()}/${fallback}`;
@@ -24273,11 +24208,20 @@ function configFile() {
24273
24208
  function prefsFile() {
24274
24209
  return `${stateDir()}/prefs.json`;
24275
24210
  }
24211
+ function logsDir() {
24212
+ return `${stateDir()}/logs`;
24213
+ }
24214
+ function logArchiveDir() {
24215
+ return `${logsDir()}/archive`;
24216
+ }
24276
24217
  function logFile() {
24277
- return `${stateDir()}/caret.log`;
24218
+ return `${logsDir()}/caret.log`;
24278
24219
  }
24279
24220
  function daemonLogFile() {
24280
- return `${stateDir()}/daemon.log`;
24221
+ return `${logsDir()}/daemon.log`;
24222
+ }
24223
+ function daemonStderrLogFile() {
24224
+ return `${logsDir()}/daemon-stderr.log`;
24281
24225
  }
24282
24226
  function daemonLock() {
24283
24227
  return `${stateDir()}/daemon.lock`;
@@ -24291,6 +24235,19 @@ function ensureStateDir(target = stateDir()) {
24291
24235
  chmodSync(root, 448);
24292
24236
  }
24293
24237
  }
24238
+ function ensureLogsDir() {
24239
+ ensureStateDir(logsDir());
24240
+ for (const name of ["caret.log", "daemon.log"]) {
24241
+ const from = `${stateDir()}/${name}`;
24242
+ const to = `${logsDir()}/${name}`;
24243
+ if (!existsSync4(from) || existsSync4(to))
24244
+ continue;
24245
+ try {
24246
+ renameSync(from, to);
24247
+ chmodSync(to, 384);
24248
+ } catch {}
24249
+ }
24250
+ }
24294
24251
 
24295
24252
  // src/lib/build-id.ts
24296
24253
  import { createHash } from "crypto";
@@ -24351,7 +24308,7 @@ async function loadUiAssets() {
24351
24308
  // package.json
24352
24309
  var package_default = {
24353
24310
  name: "@macintacos/caret",
24354
- version: "0.11.0",
24311
+ version: "0.12.0",
24355
24312
  license: "MIT",
24356
24313
  type: "module",
24357
24314
  description: "A Claude Code plugin that replaces the terminal plan-approval prompt with a local web UI for inline review, annotation, and approval.",
@@ -24386,24 +24343,6 @@ var package_default = {
24386
24343
  build: "mise run build"
24387
24344
  },
24388
24345
  devDependencies: {
24389
- "@happy-dom/global-registrator": "^20.9.0",
24390
- "@laststance/tailwind-suggest-canonical-classes": "^0.1.1",
24391
- "@playwright/test": "^1.60.0",
24392
- "@sveltejs/vite-plugin-svelte": "^7.1.2",
24393
- "@tailwindcss/vite": "^4.3.2",
24394
- "@types/bun": "^1.3.14",
24395
- "@types/semver": "^7.7.1",
24396
- "happy-dom": "^20.9.0",
24397
- listr2: "^10.2.1",
24398
- "pino-pretty": "^13.1.3",
24399
- svelte: "^5.55.9",
24400
- "svelte-check": "^4.4.8",
24401
- tailwindcss: "^4.3.2",
24402
- "tw-animate-css": "^1.4.0",
24403
- typescript: "^6.0.3",
24404
- vite: "^8.0.14"
24405
- },
24406
- dependencies: {
24407
24346
  "@clack/prompts": "^1.7.0",
24408
24347
  "@codemirror/commands": "^6.10.3",
24409
24348
  "@codemirror/lang-markdown": "^6.5.0",
@@ -24412,24 +24351,53 @@ var package_default = {
24412
24351
  "@codemirror/state": "^6.6.0",
24413
24352
  "@codemirror/view": "^6.43.0",
24414
24353
  "@commander-js/extra-typings": "^15.0.0",
24354
+ "@happy-dom/global-registrator": "^20.11.2",
24415
24355
  "@internationalized/date": "^3.12.2",
24356
+ "@laststance/tailwind-suggest-canonical-classes": "^0.1.1",
24416
24357
  "@lezer/highlight": "^1.2.3",
24417
- "@opencode-ai/plugin": "^1.16.2",
24418
- "@pierre/diffs": "1.2.7",
24358
+ "@pierre/diffs": "1.3.5",
24419
24359
  "@pierre/trees": "1.0.0-beta.6",
24360
+ "@playwright/test": "^1.62.1",
24361
+ "@sveltejs/vite-plugin-svelte": "^7.3.0",
24362
+ "@tailwindcss/vite": "^4.3.3",
24363
+ "@types/bun": "^1.3.14",
24364
+ "@types/semver": "^7.7.1",
24365
+ "@typescript/native": "npm:typescript@^7.0.2",
24420
24366
  "bits-ui": "^2.18.1",
24421
24367
  clsx: "^2.1.1",
24422
24368
  commander: "^15.0.0",
24369
+ cuelume: "^0.2.2",
24370
+ "happy-dom": "^20.11.2",
24423
24371
  "jsonc-parser": "^3.3.1",
24372
+ listr2: "^11.0.0",
24424
24373
  marked: "^18.0.4",
24425
24374
  pino: "^10.3.1",
24375
+ "pino-pretty": "^13.1.3",
24426
24376
  semver: "^7.8.1",
24427
- shiki: "^4.1.0",
24428
- "smol-toml": "1.6.1",
24377
+ shiki: "^4.4.3",
24378
+ "smol-toml": "^1.8.0",
24379
+ svelte: "^5.56.9",
24380
+ "svelte-check": "^4.7.5",
24429
24381
  "tailwind-merge": "^3.6.0",
24430
24382
  "tailwind-variants": "^3.2.2",
24383
+ tailwindcss: "^4.3.3",
24384
+ "tw-animate-css": "^1.4.0",
24385
+ typescript: "^6.0.3",
24386
+ vite: "^8.2.1",
24431
24387
  xss: "^1.0.15",
24432
- zod: "4.4.3"
24388
+ zod: "^4.4.3"
24389
+ },
24390
+ dependencies: {
24391
+ "@opencode-ai/plugin": "^1.18.17"
24392
+ },
24393
+ pinned: {
24394
+ "//": "bun.lock is committed, so it is what pins every dependency exactly; a range above is the upgrade policy, not the resolved version. A bare version therefore means `bun update` must never move this one on its own, and these entries are the whole set. Everything else takes a range deliberately \u2014 zod and the TOML parser reading the config.toml trust boundary included: the lockfile already holds them, so a range costs no reproducibility and keeps them visible to an upgrade sweep. test/structure/exact-pin.test.ts fails on an exact pin with no reason, and on a reason that outlived its pin.",
24395
+ "@pierre/diffs": "Version-coupled to shiki through the resolve.alias block in ui/vite.config.ts, where an alias that stops matching grows the bundle by ~600 KB silently rather than failing anything. The pair moves as one reviewed bump, never on a sweep.",
24396
+ "@pierre/trees": "No stable release exists \u2014 the `latest` and `beta` dist-tags both point at the same prerelease. Exact rather than caret because a prerelease under a caret range is still a caret range: `^1.0.0-beta.6` expands to `>=1.0.0-beta.6 <2.0.0-0`, so a sweep would take a stable 1.0.0 the day it lands, and beta-to-stable is the jump that wants a human."
24397
+ },
24398
+ held: {
24399
+ "//": "A dependency whose range deliberately stops below the current major, with the evidence for that and the condition that lifts it. Distinct from `pinned` above, which is about exact versions: an entry here names a range that is doing its job by excluding something. Unlike a pin, a held range is self-describing to `bun outdated` \u2014 it shows up as a major behind \u2014 so this block answers the question it raises rather than surfacing a decision nothing else would show.",
24400
+ typescript: "NOT a hold on adoption \u2014 TypeScript 7 IS what type-checks this tree (EXC-1089). It arrives as the `@typescript/native` alias above; hk.pkl runs the backend program through node_modules/@typescript/native/bin/tsc and the UI program through `svelte-check --tsgo`, and both were proved live against injected type errors rather than trusted because they exited 0. This range stops at ^6 because svelte-check requires BOTH majors installed: 4.7.5 hard-throws from bin/ts-version-check.js once `typescript` is major >= 7, and the recipe it throws is the arrangement used here verbatim \u2014 `typescript@~6 @typescript/native@npm:typescript@7`, plus --tsgo. Its README repeats it and dist/src/index.js resolves `@typescript/native` before `@typescript/native-preview`, so this is upstream's supported setup rather than a workaround. A second reason keeps 6.x honest even so: test/structure/e2e-conventions.test.ts and test/structure/tokenize-conventions.test.ts import the compiler API as a PARSING LIBRARY, and 7.x exports lib/version.cjs as `.` with the API behind ./unstable/* subpaths that offer no standalone parse (unstable/ast's createSourceFile is a factory over Statement[]; the only SourceFile producer is Program.getSourceFile). With 6.x installed those two files need no port, and `tsc` 7 type-checks them clean \u2014 the 50 errors EXC-1083 measured were never caret's code, only two files typed against a package whose `.` export had moved. What lifts this: a svelte-check release whose peerDependencies.typescript admits ^7 \u2014 but that clears only the first reason. Collapsing to a single `typescript@7` means dropping the alias, moving this range to ^7, AND porting those two suites off the compiler API in the same pass, or they break on `ts.ScriptTarget` being undefined. test/structure/typescript-arrangement.test.ts reds on exactly that widening, and also pins the tsc path, the --tsgo flag, and this entry's own existence, because losing any of them silently reverts the adoption. Full evidence: EXC-1089, and the trial in EXC-1083."
24433
24401
  }
24434
24402
  };
24435
24403
 
@@ -24545,6 +24513,79 @@ function callerLocation() {
24545
24513
  }
24546
24514
  }
24547
24515
 
24516
+ // src/lib/log-rotate.ts
24517
+ import {
24518
+ closeSync,
24519
+ openSync,
24520
+ readdirSync as readdirSync3,
24521
+ readFileSync as readFileSync5,
24522
+ statSync,
24523
+ truncateSync,
24524
+ unlinkSync,
24525
+ writeFileSync
24526
+ } from "fs";
24527
+ import { basename as basename2 } from "path";
24528
+ var STALE_LOCK_MS = 60000;
24529
+ function stamp() {
24530
+ return new Date().toISOString().replace(/[-:.]/g, "");
24531
+ }
24532
+ function sizeOf(path) {
24533
+ try {
24534
+ return statSync(path).size;
24535
+ } catch {
24536
+ return -1;
24537
+ }
24538
+ }
24539
+ function claimLock(lock) {
24540
+ try {
24541
+ closeSync(openSync(lock, "wx", 384));
24542
+ return true;
24543
+ } catch (e) {
24544
+ if (e.code !== "EEXIST")
24545
+ return false;
24546
+ if (Date.now() - statSync(lock).mtimeMs >= STALE_LOCK_MS)
24547
+ unlinkSync(lock);
24548
+ return false;
24549
+ }
24550
+ }
24551
+ function prune(name, keep) {
24552
+ const dir = logArchiveDir();
24553
+ const pattern = new RegExp(`^${name}-\\d{8}T\\d{9}Z\\.log\\.gz$`);
24554
+ const found = readdirSync3(dir).filter((f) => pattern.test(f)).sort();
24555
+ for (const old of found.slice(0, Math.max(0, found.length - keep))) {
24556
+ try {
24557
+ unlinkSync(`${dir}/${old}`);
24558
+ } catch {}
24559
+ }
24560
+ }
24561
+ function rotateIfOversized(path, maxSize, keep) {
24562
+ try {
24563
+ if (sizeOf(path) <= maxSize)
24564
+ return;
24565
+ const name = basename2(path, ".log");
24566
+ const lock = `${logsDir()}/.rotate-${name}.lock`;
24567
+ if (!claimLock(lock))
24568
+ return;
24569
+ try {
24570
+ if (sizeOf(path) <= maxSize)
24571
+ return;
24572
+ ensureStateDir(logArchiveDir());
24573
+ const raw = readFileSync5(path);
24574
+ truncateSync(path, 0);
24575
+ if (keep > 0) {
24576
+ writeFileSync(`${logArchiveDir()}/${name}-${stamp()}.log.gz`, Bun.gzipSync(raw), {
24577
+ mode: 384
24578
+ });
24579
+ }
24580
+ prune(name, keep);
24581
+ } finally {
24582
+ try {
24583
+ unlinkSync(lock);
24584
+ } catch {}
24585
+ }
24586
+ } catch {}
24587
+ }
24588
+
24548
24589
  // src/lib/types.ts
24549
24590
  function errorMessage(err) {
24550
24591
  return err instanceof Error ? err.message : String(err);
@@ -24614,7 +24655,7 @@ function shortId(id) {
24614
24655
  }
24615
24656
 
24616
24657
  // src/redact/node.ts
24617
- import { readFileSync as readFileSync5, writeFileSync } from "fs";
24658
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync2 } from "fs";
24618
24659
  import { homedir as homedir5 } from "os";
24619
24660
  var FOREIGN_HOME = /(\/Users\/|\/home\/)[^/\s"']+/g;
24620
24661
  function scrubString(s, home = homedir5()) {
@@ -24636,17 +24677,17 @@ function redactLogText(text) {
24636
24677
  }).join(`
24637
24678
  `);
24638
24679
  }
24639
- function redactLogFiles(files = [logFile(), daemonLogFile()]) {
24680
+ function redactLogFiles(files = [logFile(), daemonLogFile(), daemonStderrLogFile()]) {
24640
24681
  const written = [];
24641
24682
  for (const file2 of files) {
24642
24683
  let text;
24643
24684
  try {
24644
- text = readFileSync5(file2, "utf-8");
24685
+ text = readFileSync6(file2, "utf-8");
24645
24686
  } catch {
24646
24687
  continue;
24647
24688
  }
24648
24689
  const sibling = `${file2.replace(/\.log$/, "")}.redacted.log`;
24649
- writeFileSync(sibling, redactLogText(text), { mode: 384 });
24690
+ writeFileSync2(sibling, redactLogText(text), { mode: 384 });
24650
24691
  written.push(sibling);
24651
24692
  }
24652
24693
  return written;
@@ -24658,7 +24699,7 @@ var pinoOpts = {
24658
24699
  timestamp: import_pino.default.stdTimeFunctions.isoTime,
24659
24700
  serializers: { err: (v) => v }
24660
24701
  };
24661
- function wrap(logger, liveLevel, liveRedact, source) {
24702
+ function wrap(logger, liveLevel, liveRedact, source, rotate) {
24662
24703
  function fields(extra, step, redact) {
24663
24704
  const out = scrubValue({ ...extra }, redact);
24664
24705
  out.step = step;
@@ -24677,6 +24718,7 @@ function wrap(logger, liveLevel, liveRedact, source) {
24677
24718
  logger.level = next;
24678
24719
  if (!logger.isLevelEnabled(method))
24679
24720
  return;
24721
+ rotate?.();
24680
24722
  const r = liveRedact();
24681
24723
  logger[method](fields(extra, step, r), r ? scrubString(msg) : msg);
24682
24724
  } catch {}
@@ -24687,6 +24729,7 @@ function wrap(logger, liveLevel, liveRedact, source) {
24687
24729
  warn: (step, msg, extra) => emit("warn", step, msg, extra),
24688
24730
  error(step, err, extra) {
24689
24731
  try {
24732
+ rotate?.();
24690
24733
  const r = liveRedact();
24691
24734
  const f = fields(extra, step, r);
24692
24735
  if (err instanceof Error)
@@ -24703,17 +24746,24 @@ var noopLogger = {
24703
24746
  warn: () => {},
24704
24747
  error: () => {}
24705
24748
  };
24706
- function createHookLogger(level, redact) {
24749
+ function createHookLogger(level, redact, limits) {
24707
24750
  const path = logFile();
24708
24751
  try {
24709
- ensureStateDir();
24752
+ ensureLogsDir();
24710
24753
  const dest = import_pino.default.destination({ dest: path, sync: true, mode: 384 });
24711
- return { log: wrap(import_pino.default(pinoOpts, dest), level, redact, "hook"), dest, path };
24754
+ const rotate = () => rotateIfOversized(path, limits.maxSize(), limits.keep());
24755
+ return { log: wrap(import_pino.default(pinoOpts, dest), level, redact, "hook", rotate), dest, path };
24712
24756
  } catch {
24713
24757
  return { log: noopLogger, dest: null, path };
24714
24758
  }
24715
24759
  }
24716
- var hookState = { level: "info", redact: false, instance: null };
24760
+ var hookState = {
24761
+ level: "info",
24762
+ redact: false,
24763
+ maxSize: DEFAULT_LOG_MAX_SIZE,
24764
+ keep: DEFAULT_LOG_KEEP,
24765
+ instance: null
24766
+ };
24717
24767
  function hook() {
24718
24768
  const path = logFile();
24719
24769
  if (hookState.instance && hookState.instance.path === path) {
@@ -24722,7 +24772,7 @@ function hook() {
24722
24772
  try {
24723
24773
  hookState.instance?.dest?.destroy();
24724
24774
  } catch {}
24725
- const next = createHookLogger(() => hookState.level, () => hookState.redact);
24775
+ const next = createHookLogger(() => hookState.level, () => hookState.redact, { maxSize: () => hookState.maxSize, keep: () => hookState.keep });
24726
24776
  hookState.instance = next.dest ? next : null;
24727
24777
  return next.log;
24728
24778
  }
@@ -24732,6 +24782,10 @@ function setLogLevel(level) {
24732
24782
  function setRedact(on) {
24733
24783
  hookState.redact = on;
24734
24784
  }
24785
+ function setLogRotation(maxSize, keep) {
24786
+ hookState.maxSize = maxSize;
24787
+ hookState.keep = keep;
24788
+ }
24735
24789
  function logDebug(step, msg, extra) {
24736
24790
  hook().debug(step, msg, extra);
24737
24791
  }
@@ -24744,14 +24798,17 @@ function logWarn(step, msg, extra) {
24744
24798
  function logError(step, err, ctx) {
24745
24799
  hook().error(step, err, ctx);
24746
24800
  }
24747
- function createDaemonLogger(level, dest, redact = () => false) {
24801
+ function createDaemonLogger(level, dest = daemonLogFile(), redact = () => false, limits) {
24748
24802
  try {
24803
+ if (typeof dest === "string")
24804
+ ensureLogsDir();
24749
24805
  const target = import_pino.default.destination({
24750
- ...dest === undefined ? { fd: 2 } : { dest },
24806
+ ...typeof dest === "number" ? { fd: dest } : { dest, mode: 384 },
24751
24807
  sync: true
24752
24808
  });
24753
24809
  const logger = import_pino.default({ ...pinoOpts, base: { pid: process.pid } }, target);
24754
- return wrap(logger, level, redact, "daemon");
24810
+ const rotate = limits && typeof dest === "string" ? () => rotateIfOversized(dest, limits.maxSize(), limits.keep()) : undefined;
24811
+ return wrap(logger, level, redact, "daemon", rotate);
24755
24812
  } catch {
24756
24813
  return noopLogger;
24757
24814
  }
@@ -24762,6 +24819,8 @@ var Port = exports_external.number().int().positive();
24762
24819
  var TimeoutS = exports_external.number().positive().lt(HOOK_TIMEOUT_S);
24763
24820
  var IdleMs = exports_external.number().int().nonnegative();
24764
24821
  var HeartbeatMs = exports_external.number().int().positive().lt(MAX_HEARTBEAT_MS);
24822
+ var LogMaxSize = exports_external.number().int().min(MIN_LOG_MAX_SIZE).max(MAX_LOG_MAX_SIZE);
24823
+ var LogKeep = exports_external.number().int().nonnegative();
24765
24824
  var DevIntervalMs = exports_external.number().int().positive();
24766
24825
  var Dev = exports_external.object({
24767
24826
  port: Port.optional(),
@@ -24775,7 +24834,9 @@ var Dev = exports_external.object({
24775
24834
  var SettingsSchema = exports_external.object({
24776
24835
  logging: exports_external.object({
24777
24836
  level: exports_external.enum(["debug", "info", "warn", "error"]).default("info"),
24778
- redact: exports_external.boolean().default(false)
24837
+ redact: exports_external.boolean().default(false),
24838
+ max_size: LogMaxSize.default(DEFAULT_LOG_MAX_SIZE),
24839
+ keep: LogKeep.default(DEFAULT_LOG_KEEP)
24779
24840
  }).prefault({}),
24780
24841
  daemon: exports_external.object({
24781
24842
  port: Port.default(DEFAULT_PORT),
@@ -24819,7 +24880,7 @@ function parseAndValidate(text, isCompiled) {
24819
24880
  function loadSettings(file2 = configFile(), isCompiled = isCompiledBinary()) {
24820
24881
  let text;
24821
24882
  try {
24822
- text = readFileSync6(file2, "utf-8");
24883
+ text = readFileSync7(file2, "utf-8");
24823
24884
  } catch {
24824
24885
  return DEFAULTS;
24825
24886
  }
@@ -24832,7 +24893,7 @@ function createSettings(file2 = configFile(), isCompiled = isCompiledBinary()) {
24832
24893
  current() {
24833
24894
  let st;
24834
24895
  try {
24835
- st = statSync(file2);
24896
+ st = statSync2(file2);
24836
24897
  } catch {
24837
24898
  return lastGood;
24838
24899
  }
@@ -24841,7 +24902,7 @@ function createSettings(file2 = configFile(), isCompiled = isCompiledBinary()) {
24841
24902
  }
24842
24903
  let text;
24843
24904
  try {
24844
- text = readFileSync6(file2, "utf-8");
24905
+ text = readFileSync7(file2, "utf-8");
24845
24906
  } catch {
24846
24907
  return lastGood;
24847
24908
  }
@@ -24894,7 +24955,9 @@ var ENV_VARS = [
24894
24955
  ["CARET_PORT", Port],
24895
24956
  ["CARET_TIMEOUT", TimeoutS],
24896
24957
  ["CARET_IDLE_MS", IdleMs],
24897
- ["CARET_HEARTBEAT_MS", HeartbeatMs]
24958
+ ["CARET_HEARTBEAT_MS", HeartbeatMs],
24959
+ ["CARET_LOG_MAX_SIZE", LogMaxSize],
24960
+ ["CARET_LOG_KEEP", LogKeep]
24898
24961
  ];
24899
24962
  function classifyEnv(raw, schema) {
24900
24963
  if (raw === undefined || raw.trim() === "")
@@ -24937,6 +25000,12 @@ function reviewTimeoutMs(s = settings().current()) {
24937
25000
  function heartbeatMs(s = settings().current()) {
24938
25001
  return envValue("CARET_HEARTBEAT_MS", HeartbeatMs) ?? s.daemon.heartbeat_ms;
24939
25002
  }
25003
+ function logMaxSize(s = settings().current()) {
25004
+ return envValue("CARET_LOG_MAX_SIZE", LogMaxSize) ?? s.logging.max_size;
25005
+ }
25006
+ function logKeep(s = settings().current()) {
25007
+ return envValue("CARET_LOG_KEEP", LogKeep) ?? s.logging.keep;
25008
+ }
24940
25009
 
24941
25010
  // src/commands/boot.ts
24942
25011
  function warnInvalidEnvVars(warn) {
@@ -24959,7 +25028,7 @@ function buildDiagnostics(deps) {
24959
25028
  }
24960
25029
 
24961
25030
  // src/daemon/lifecycle.ts
24962
- import { openSync, unlinkSync } from "fs";
25031
+ import { chmodSync as chmodSync2, openSync as openSync2, unlinkSync as unlinkSync2 } from "fs";
24963
25032
  import { normalize } from "path";
24964
25033
 
24965
25034
  // src/daemon/client.ts
@@ -25093,7 +25162,7 @@ function isPidAlive(pid) {
25093
25162
  }
25094
25163
  function removeDaemonLock() {
25095
25164
  try {
25096
- unlinkSync(daemonLock());
25165
+ unlinkSync2(daemonLock());
25097
25166
  } catch {}
25098
25167
  }
25099
25168
  async function retireDaemon(baseUrl, lock, currentStateDir, kill = (pid, sig) => process.kill(pid, sig)) {
@@ -25119,15 +25188,24 @@ function daemonCommand() {
25119
25188
  return [process.execPath, "daemon"];
25120
25189
  return [process.execPath, process.argv[1], "daemon"];
25121
25190
  }
25122
- function spawnDaemon() {
25123
- let out = "ignore";
25191
+ function openDaemonStderr(s) {
25192
+ const path = daemonStderrLogFile();
25124
25193
  try {
25125
- ensureStateDir();
25126
- out = openSync(daemonLogFile(), "a");
25194
+ ensureLogsDir();
25195
+ rotateIfOversized(path, logMaxSize(s), logKeep(s));
25196
+ const fd = openSync2(path, "a", 384);
25197
+ chmodSync2(path, 384);
25198
+ return fd;
25127
25199
  } catch {
25128
- logWarn("spawn", "daemon log unopenable; discarding daemon output");
25200
+ logWarn("spawn", "daemon stderr log unopenable; discarding output");
25201
+ return "ignore";
25129
25202
  }
25130
- Bun.spawn(daemonCommand(), {
25203
+ }
25204
+ var DAEMON_CWD = "/";
25205
+ function spawnDaemon(s, spawn = Bun.spawn) {
25206
+ const out = openDaemonStderr(s);
25207
+ spawn(daemonCommand(), {
25208
+ cwd: DAEMON_CWD,
25131
25209
  stdio: ["ignore", out, out],
25132
25210
  detached: true,
25133
25211
  env: process.env
@@ -25149,14 +25227,14 @@ async function prodEnsureDeps(s) {
25149
25227
  isAlive: isPidAlive,
25150
25228
  retire: (baseUrl, lock) => retireDaemon(baseUrl, lock, world),
25151
25229
  removeLock: removeDaemonLock,
25152
- spawn: spawnDaemon,
25230
+ spawn: () => spawnDaemon(s),
25153
25231
  backoff,
25154
25232
  maxAttempts: 12
25155
25233
  };
25156
25234
  }
25157
25235
 
25158
25236
  // src/daemon/server.ts
25159
- import { renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync4 } from "fs";
25237
+ import { renameSync as renameSync3, unlinkSync as unlinkSync3, writeFileSync as writeFileSync5 } from "fs";
25160
25238
  import { dirname as dirname6 } from "path";
25161
25239
 
25162
25240
  // src/config/prefs.ts
@@ -25315,7 +25393,7 @@ import { readdir as readdir2 } from "fs/promises";
25315
25393
  import { join as join8, relative as relative3, sep as sep2 } from "path";
25316
25394
 
25317
25395
  // src/plan/excerpt.ts
25318
- import { readFileSync as readFileSync7 } from "fs";
25396
+ import { readFileSync as readFileSync8 } from "fs";
25319
25397
  import { readdir, realpath, stat } from "fs/promises";
25320
25398
  import { extname, isAbsolute, join as join7, relative as relative2, resolve, sep } from "path";
25321
25399
  var EXCERPT_HEAD_LINES = 60;
@@ -25456,7 +25534,7 @@ function readLines(abs, stats) {
25456
25534
  return memo.lines;
25457
25535
  let content;
25458
25536
  try {
25459
- content = readFileSync7(abs, "utf-8");
25537
+ content = readFileSync8(abs, "utf-8");
25460
25538
  } catch {
25461
25539
  return null;
25462
25540
  }
@@ -25602,12 +25680,12 @@ function createDecisions(log = noopLogger) {
25602
25680
  import { randomBytes } from "crypto";
25603
25681
 
25604
25682
  // src/plan/canonical-file.ts
25605
- import { appendFileSync, existsSync as existsSync4, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
25683
+ import { appendFileSync, existsSync as existsSync5, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
25606
25684
  function guardedPlanFileWrite(planFilePath, log, failMsg, write) {
25607
25685
  try {
25608
25686
  if (!planFilePath.endsWith(".md"))
25609
25687
  return;
25610
- if (!existsSync4(planFilePath) || !statSync2(planFilePath).isFile())
25688
+ if (!existsSync5(planFilePath) || !statSync3(planFilePath).isFile())
25611
25689
  return;
25612
25690
  write(planFilePath);
25613
25691
  } catch (err) {
@@ -25618,7 +25696,7 @@ function guardedPlanFileWrite(planFilePath, log, failMsg, write) {
25618
25696
  function writeCanonicalPlanFile(planFilePath, canonical, log) {
25619
25697
  if (!planFilePath)
25620
25698
  return;
25621
- guardedPlanFileWrite(planFilePath, log, "plan file canonicalize failed", (p) => writeFileSync2(p, canonical));
25699
+ guardedPlanFileWrite(planFilePath, log, "plan file canonicalize failed", (p) => writeFileSync3(p, canonical));
25622
25700
  }
25623
25701
  function appendReviewerNotesToPlanFile(planFilePath, notes, log) {
25624
25702
  const section = reviewerNotesSection(notes);
@@ -25629,27 +25707,27 @@ function appendReviewerNotesToPlanFile(planFilePath, notes, log) {
25629
25707
 
25630
25708
  // src/plan/rumdl.ts
25631
25709
  import { createHash as createHash2 } from "crypto";
25632
- import { chmodSync as chmodSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, renameSync, writeFileSync as writeFileSync3 } from "fs";
25710
+ import { chmodSync as chmodSync3, existsSync as existsSync6, mkdirSync as mkdirSync2, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "fs";
25633
25711
  import { mkdtemp, rm } from "fs/promises";
25634
25712
  import { tmpdir } from "os";
25635
25713
  import { dirname as dirname5, join as join9 } from "path";
25636
- var RUMDL_VERSION = "0.2.47";
25714
+ var RUMDL_VERSION = "0.2.54";
25637
25715
  var ASSETS = {
25638
25716
  "darwin-arm64": {
25639
25717
  url: `https://github.com/rvben/rumdl/releases/download/v${RUMDL_VERSION}/rumdl-v${RUMDL_VERSION}-aarch64-apple-darwin.tar.gz`,
25640
- sha256: "10dc23e994327ecc6e98d285802fcad1174608f203062cb18bac55b51976e0cb"
25718
+ sha256: "e2e005d6824d41402567feb5af21e1cfcd0ee47ea52a8ea53695479822ef4094"
25641
25719
  },
25642
25720
  "darwin-x64": {
25643
25721
  url: `https://github.com/rvben/rumdl/releases/download/v${RUMDL_VERSION}/rumdl-v${RUMDL_VERSION}-x86_64-apple-darwin.tar.gz`,
25644
- sha256: "9a2bf0c692310e0469fdc66fa83f74579cf0331cc1f9b306b25849cffd146c0f"
25722
+ sha256: "b3035da193b40a0247a9a88d07679bf248919a3e1f2664ad7ef822d97e65cc1d"
25645
25723
  },
25646
25724
  "linux-arm64": {
25647
25725
  url: `https://github.com/rvben/rumdl/releases/download/v${RUMDL_VERSION}/rumdl-v${RUMDL_VERSION}-aarch64-unknown-linux-musl.tar.gz`,
25648
- sha256: "b5ab4207b92c0bf0ea6d8946f15545c787e8cf6ecf2176d9e7f26c43aead86a8"
25726
+ sha256: "c27a96495f66415489d61346efef69bee4cf700d3739a9c5ba89bd477f9249ba"
25649
25727
  },
25650
25728
  "linux-x64": {
25651
25729
  url: `https://github.com/rvben/rumdl/releases/download/v${RUMDL_VERSION}/rumdl-v${RUMDL_VERSION}-x86_64-unknown-linux-musl.tar.gz`,
25652
- sha256: "bd4049763e93d6c25420ec086dee6690af31efc85af463c3ecf5d686a5fcf762"
25730
+ sha256: "a58c8de71484d4587f2a138476d70b3b2595366941d37b00606e80f86912aabb"
25653
25731
  }
25654
25732
  };
25655
25733
  function rumdlAsset(platform = process.platform, arch = process.arch) {
@@ -25683,13 +25761,13 @@ async function downloadRumdl(binPath, asset, fetchImpl = fetch) {
25683
25761
  if (await tar.exited !== 0)
25684
25762
  throw new Error(`rumdl: failed to extract ${asset.url}`);
25685
25763
  const extracted = join9(work, "rumdl");
25686
- if (!existsSync5(extracted))
25764
+ if (!existsSync6(extracted))
25687
25765
  throw new Error(`rumdl: binary not found in ${asset.url}`);
25688
25766
  mkdirSync2(dirname5(binPath), { recursive: true });
25689
25767
  const tmp = `${binPath}.${process.pid}.tmp`;
25690
25768
  await Bun.write(tmp, Bun.file(extracted));
25691
- chmodSync2(tmp, 493);
25692
- renameSync(tmp, binPath);
25769
+ chmodSync3(tmp, 493);
25770
+ renameSync2(tmp, binPath);
25693
25771
  return binPath;
25694
25772
  } finally {
25695
25773
  await rm(work, { recursive: true, force: true });
@@ -25697,7 +25775,7 @@ async function downloadRumdl(binPath, asset, fetchImpl = fetch) {
25697
25775
  }
25698
25776
  var installPinnedRumdl = (binPath) => downloadRumdl(binPath, rumdlAsset());
25699
25777
  async function installedVersion(bin) {
25700
- if (!existsSync5(bin))
25778
+ if (!existsSync6(bin))
25701
25779
  return null;
25702
25780
  try {
25703
25781
  const proc = Bun.spawn([bin, "--version"], { stdout: "pipe", stderr: "ignore" });
@@ -25709,11 +25787,12 @@ async function installedVersion(bin) {
25709
25787
  return null;
25710
25788
  }
25711
25789
  }
25712
- var inFlightInstall;
25713
- async function ensureRumdl(install = installPinnedRumdl) {
25790
+ var RUMDL_RETRY_COOLDOWN_MS = 10 * 60000;
25791
+ var acquisition = { cooldownUntil: 0 };
25792
+ async function ensureRumdl(install = installPinnedRumdl, now = Date.now, state = acquisition) {
25714
25793
  ensureStateDir(rumdlDir());
25715
25794
  const config2 = rumdlConfig();
25716
- writeFileSync3(config2, RUMDL_CONFIG);
25795
+ writeFileSync4(config2, RUMDL_CONFIG);
25717
25796
  const override = process.env.CARET_RUMDL_BIN?.trim();
25718
25797
  if (override && await installedVersion(override) === RUMDL_VERSION) {
25719
25798
  return { bin: override, config: config2, installed: false };
@@ -25721,10 +25800,19 @@ async function ensureRumdl(install = installPinnedRumdl) {
25721
25800
  const bin = rumdlBin();
25722
25801
  if (await installedVersion(bin) === RUMDL_VERSION)
25723
25802
  return { bin, config: config2, installed: false };
25724
- inFlightInstall ??= install(bin).finally(() => {
25725
- inFlightInstall = undefined;
25726
- });
25727
- return { bin: await inFlightInstall, config: config2, installed: true };
25803
+ if (now() < state.cooldownUntil) {
25804
+ throw new Error("rumdl: install on cooldown after a recent failure");
25805
+ }
25806
+ if (!state.inFlight) {
25807
+ state.inFlight = install(bin).catch((err) => {
25808
+ state.cooldownUntil = now() + RUMDL_RETRY_COOLDOWN_MS;
25809
+ throw err;
25810
+ }).finally(() => {
25811
+ state.inFlight = undefined;
25812
+ });
25813
+ }
25814
+ const pending = state.inFlight;
25815
+ return { bin: await pending, config: config2, installed: true };
25728
25816
  }
25729
25817
  async function rumdlFormatPlan(text) {
25730
25818
  if (text.trim() === "")
@@ -25746,7 +25834,8 @@ async function rumdlFormatPlan(text) {
25746
25834
 
25747
25835
  // src/plan/markdown.ts
25748
25836
  var MAX_FORMAT_BYTES = 1024 * 1024;
25749
- async function formatPlanMarkdown(plan, log = noopLogger, doFormat = rumdlFormatPlan) {
25837
+ var FORMAT_BUDGET_MS = 2000;
25838
+ async function formatPlanMarkdown(plan, log = noopLogger, doFormat = rumdlFormatPlan, budgetMs = FORMAT_BUDGET_MS) {
25750
25839
  const bytes = Buffer.byteLength(plan, "utf-8");
25751
25840
  if (bytes > MAX_FORMAT_BYTES) {
25752
25841
  log.warn("review", "plan too large to format, storing raw", {
@@ -25755,13 +25844,19 @@ async function formatPlanMarkdown(plan, log = noopLogger, doFormat = rumdlFormat
25755
25844
  });
25756
25845
  return plan;
25757
25846
  }
25847
+ let timer;
25758
25848
  try {
25759
- return await doFormat(plan);
25849
+ const deadline = new Promise((_, reject) => {
25850
+ timer = setTimeout(() => reject(new Error(`plan format exceeded ${budgetMs}ms`)), budgetMs);
25851
+ });
25852
+ return await Promise.race([doFormat(plan), deadline]);
25760
25853
  } catch (err) {
25761
25854
  const reason = errorMessage(err).split(`
25762
25855
  `, 1)[0] ?? "";
25763
25856
  log.warn("review", "plan format failed, storing raw", { reason });
25764
25857
  return plan;
25858
+ } finally {
25859
+ clearTimeout(timer);
25765
25860
  }
25766
25861
  }
25767
25862
 
@@ -26336,15 +26431,15 @@ function createServer(opts) {
26336
26431
  instanceId
26337
26432
  };
26338
26433
  const tmp = `${lockPath}.tmp.${process.pid}`;
26339
- writeFileSync4(tmp, JSON.stringify(lock));
26340
- renameSync2(tmp, lockPath);
26434
+ writeFileSync5(tmp, JSON.stringify(lock));
26435
+ renameSync3(tmp, lockPath);
26341
26436
  } catch {}
26342
26437
  }
26343
26438
  function removeLock() {
26344
26439
  if (!lockPath)
26345
26440
  return;
26346
26441
  try {
26347
- unlinkSync2(lockPath);
26442
+ unlinkSync3(lockPath);
26348
26443
  } catch {}
26349
26444
  }
26350
26445
  writeLock();
@@ -26467,10 +26562,10 @@ function createStore(dir, log = noopLogger) {
26467
26562
  async function runDaemon(opts) {
26468
26563
  const startedAt = Date.now();
26469
26564
  const svc = watchSettings(settings(), (changes) => log.info("settings", `settings changed: ${changes.join("; ")}`));
26470
- const log = createDaemonLogger(() => svc.current().logging.level, undefined, () => svc.current().logging.redact);
26565
+ const log = createDaemonLogger(() => svc.current().logging.level, undefined, () => svc.current().logging.redact, { maxSize: () => logMaxSize(svc.current()), keep: () => logKeep(svc.current()) });
26471
26566
  const cfg = configFile();
26472
26567
  const boot = svc.current();
26473
- log.info("settings", existsSync6(cfg) ? `settings: reading ${cfg}` : `settings: no config at ${cfg}; using defaults`, { settings: boot });
26568
+ log.info("settings", existsSync7(cfg) ? `settings: reading ${cfg}` : `settings: no config at ${cfg}; using defaults`, { settings: boot });
26474
26569
  warnInvalidEnvVars((msg) => log.warn("env", msg));
26475
26570
  const adapter = selectAdapter();
26476
26571
  const store = createStore(reviewsDir(), log);
@@ -26504,7 +26599,7 @@ async function runDaemon(opts) {
26504
26599
  }),
26505
26600
  settings: () => settings().current(),
26506
26601
  configPath: cfg,
26507
- configExists: () => existsSync6(cfg),
26602
+ configExists: () => existsSync7(cfg),
26508
26603
  envOverrides
26509
26604
  }),
26510
26605
  log
@@ -26537,18 +26632,18 @@ async function runDaemon(opts) {
26537
26632
  process.once("unhandledRejection", onFatal("unhandledRejection"));
26538
26633
  process.once("exit", () => {
26539
26634
  try {
26540
- unlinkSync3(daemonLock());
26635
+ unlinkSync4(daemonLock());
26541
26636
  } catch {}
26542
26637
  });
26543
26638
  }
26544
26639
 
26545
26640
  // src/commands/discovery.ts
26546
- import { existsSync as existsSync7 } from "fs";
26641
+ import { existsSync as existsSync8 } from "fs";
26547
26642
  import { release } from "os";
26548
26643
 
26549
26644
  // src/discovery.ts
26550
- import { readdirSync as readdirSync3, statSync as statSync3 } from "fs";
26551
- import { basename as basename2, join as join11 } from "path";
26645
+ import { readdirSync as readdirSync4, statSync as statSync4 } from "fs";
26646
+ import { basename as basename3, join as join11 } from "path";
26552
26647
  var CARET_BIN = "caret-native";
26553
26648
  async function safe(build) {
26554
26649
  try {
@@ -26646,11 +26741,12 @@ function buildProcesses(deps) {
26646
26741
  return { count: items.length, items };
26647
26742
  }
26648
26743
  async function buildLogs(deps) {
26649
- const [caret, daemon] = await Promise.all([
26744
+ const [caret, daemon, daemonStderr] = await Promise.all([
26650
26745
  deps.logStats(deps.logPaths.caret),
26651
- deps.logStats(deps.logPaths.daemon)
26746
+ deps.logStats(deps.logPaths.daemon),
26747
+ deps.logStats(deps.logPaths.daemonStderr)
26652
26748
  ]);
26653
- return { caret, daemon };
26749
+ return { caret, daemon, daemonStderr };
26654
26750
  }
26655
26751
  function tallyReviews(records) {
26656
26752
  const counts = { pending: 0, approved: 0, rejected: 0, expired: 0, other: 0 };
@@ -26728,7 +26824,7 @@ function parsePsLines(text) {
26728
26824
  const [, pidStr, comm] = m ?? [];
26729
26825
  if (pidStr === undefined || comm === undefined)
26730
26826
  continue;
26731
- const name = basename2(comm.trim());
26827
+ const name = basename3(comm.trim());
26732
26828
  if (name === CARET_BIN)
26733
26829
  out.push({ pid: Number(pidStr), name });
26734
26830
  }
@@ -26748,7 +26844,7 @@ function listReviewFiles() {
26748
26844
  const dir = reviewsDir();
26749
26845
  let files;
26750
26846
  try {
26751
- files = readdirSync3(dir);
26847
+ files = readdirSync4(dir);
26752
26848
  } catch {
26753
26849
  return [];
26754
26850
  }
@@ -26769,7 +26865,7 @@ var TAIL_BYTES = 256 * 1024;
26769
26865
  async function logStats(path) {
26770
26866
  let size;
26771
26867
  try {
26772
- size = statSync3(path).size;
26868
+ size = statSync4(path).size;
26773
26869
  } catch {
26774
26870
  return { path, exists: false, size: 0, errors: 0, warns: 0 };
26775
26871
  }
@@ -26821,7 +26917,7 @@ function prodDiscoveryDeps(s) {
26821
26917
  }),
26822
26918
  settings: () => s,
26823
26919
  configPath: configFile(),
26824
- configExists: () => existsSync7(configFile()),
26920
+ configExists: () => existsSync8(configFile()),
26825
26921
  effective: () => ({
26826
26922
  port: getPort(s),
26827
26923
  idleMs: idleMs(s),
@@ -26836,7 +26932,11 @@ function prodDiscoveryDeps(s) {
26836
26932
  listReviewFiles,
26837
26933
  readAgentInstallState: () => selectAdapter().readInstallState(),
26838
26934
  logStats,
26839
- logPaths: { caret: logFile(), daemon: daemonLogFile() }
26935
+ logPaths: {
26936
+ caret: logFile(),
26937
+ daemon: daemonLogFile(),
26938
+ daemonStderr: daemonStderrLogFile()
26939
+ }
26840
26940
  };
26841
26941
  }
26842
26942
  async function runDiscoverySubcommand(opts) {
@@ -26859,17 +26959,17 @@ async function runDiscoverySubcommand(opts) {
26859
26959
  import {
26860
26960
  accessSync,
26861
26961
  constants,
26862
- existsSync as existsSync9,
26962
+ existsSync as existsSync10,
26863
26963
  mkdirSync as mkdirSync3,
26864
26964
  rmSync as rmSync2,
26865
- statSync as statSync4,
26965
+ statSync as statSync5,
26866
26966
  symlinkSync,
26867
- writeFileSync as writeFileSync5
26967
+ writeFileSync as writeFileSync6
26868
26968
  } from "fs";
26869
26969
  import { join as join13, resolve as resolve2 } from "path";
26870
26970
 
26871
26971
  // src/adapters/opencode/packaging.ts
26872
- import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
26972
+ import { existsSync as existsSync9, readdirSync as readdirSync5, readFileSync as readFileSync9 } from "fs";
26873
26973
  import { dirname as dirname7, join as join12 } from "path";
26874
26974
  function resolveCaretRoot() {
26875
26975
  const candidates = [];
@@ -26878,7 +26978,7 @@ function resolveCaretRoot() {
26878
26978
  candidates.push(join12(dirname7(script), ".."));
26879
26979
  candidates.push(join12(dirname7(process.execPath), ".."));
26880
26980
  for (const root of candidates) {
26881
- if (existsSync8(join12(root, "opencode", "caret.plugin.ts")))
26981
+ if (existsSync9(join12(root, "opencode", "caret.plugin.ts")))
26882
26982
  return root;
26883
26983
  }
26884
26984
  throw new Error(`caret OpenCode packaging not found (no opencode/caret.plugin.ts under: ${candidates.join(", ") || "(none)"}). The OpenCode plugin source must ship with caret.`);
@@ -26888,7 +26988,7 @@ function loadOpencodePackaging(root = resolveCaretRoot()) {
26888
26988
  const commandsDir = join12(root, "opencode", "commands");
26889
26989
  let commands = [];
26890
26990
  try {
26891
- commands = readdirSync4(commandsDir).filter((f) => f.endsWith(".md")).sort().map((f) => ({ name: f, contents: readFileSync8(join12(commandsDir, f), "utf-8") }));
26991
+ commands = readdirSync5(commandsDir).filter((f) => f.endsWith(".md")).sort().map((f) => ({ name: f, contents: readFileSync9(join12(commandsDir, f), "utf-8") }));
26892
26992
  } catch {
26893
26993
  commands = [];
26894
26994
  }
@@ -26901,7 +27001,7 @@ function devMarketplaceDir() {
26901
27001
  }
26902
27002
  function resolveLocalCheckout(opts = {}, deps = {}) {
26903
27003
  const repoDir = resolve2(caretRoot(deps));
26904
- if (!existsSync9(join13(repoDir, ".claude-plugin", "marketplace.json"))) {
27004
+ if (!existsSync10(join13(repoDir, ".claude-plugin", "marketplace.json"))) {
26905
27005
  throw new Error(`--from-local must run from a caret checkout (no .claude-plugin/marketplace.json at ${repoDir}). A published caret installs with a plain \`caret install\`.`);
26906
27006
  }
26907
27007
  if (opts.requireArtifacts !== false) {
@@ -26928,7 +27028,7 @@ function writeDevMarketplace(repoDir, outDir) {
26928
27028
  rmSync2(outDir, { recursive: true, force: true });
26929
27029
  mkdirSync3(join13(outDir, ".claude-plugin"), { recursive: true });
26930
27030
  symlinkSync(resolve2(repoDir), join13(outDir, "caret"));
26931
- writeFileSync5(join13(outDir, ".claude-plugin", "marketplace.json"), `${JSON.stringify({
27031
+ writeFileSync6(join13(outDir, ".claude-plugin", "marketplace.json"), `${JSON.stringify({
26932
27032
  name: "caret",
26933
27033
  description: "Local caret dev build (generated by caret install --from-local).",
26934
27034
  owner: { name: "macintacos" },
@@ -26945,14 +27045,14 @@ async function prewarmLocalBuild(repoDir, deps = {}) {
26945
27045
  function isExecutable(path) {
26946
27046
  try {
26947
27047
  accessSync(path, constants.X_OK);
26948
- return statSync4(path).isFile();
27048
+ return statSync5(path).isFile();
26949
27049
  } catch {
26950
27050
  return false;
26951
27051
  }
26952
27052
  }
26953
27053
  function isDirectory(path) {
26954
27054
  try {
26955
- return statSync4(path).isDirectory();
27055
+ return statSync5(path).isDirectory();
26956
27056
  } catch {
26957
27057
  return false;
26958
27058
  }
@@ -27213,11 +27313,11 @@ async function runInstallClaudeTarget(opts, deps = {}) {
27213
27313
  }
27214
27314
 
27215
27315
  // src/commands/install/opencode.ts
27216
- import { existsSync as existsSync13, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "fs";
27217
- import { basename as basename3, join as join15 } from "path";
27316
+ import { existsSync as existsSync14, readFileSync as readFileSync10, writeFileSync as writeFileSync8 } from "fs";
27317
+ import { basename as basename4, join as join15 } from "path";
27218
27318
 
27219
27319
  // src/adapters/opencode/deploy.ts
27220
- import { existsSync as existsSync11, mkdirSync as mkdirSync4, rmSync as rmSync3, writeFileSync as writeFileSync6 } from "fs";
27320
+ import { existsSync as existsSync12, mkdirSync as mkdirSync4, rmSync as rmSync3, writeFileSync as writeFileSync7 } from "fs";
27221
27321
  import { dirname as dirname9 } from "path";
27222
27322
  function renderPlugin(source, opts) {
27223
27323
  return source.replaceAll("__CARET_VERSION__", () => opts.version).replaceAll("__CARET_BIN__", () => opts.binPath);
@@ -27227,7 +27327,7 @@ function deployFiles(files, opts) {
27227
27327
  for (const f2 of files) {
27228
27328
  if (!opts.dryRun) {
27229
27329
  mkdirSync4(dirname9(f2.path), { recursive: true });
27230
- writeFileSync6(f2.path, f2.contents);
27330
+ writeFileSync7(f2.path, f2.contents);
27231
27331
  }
27232
27332
  paths.push(f2.path);
27233
27333
  }
@@ -27236,7 +27336,7 @@ function deployFiles(files, opts) {
27236
27336
  function removeFiles(targets, opts) {
27237
27337
  const paths = [];
27238
27338
  for (const p3 of targets) {
27239
- if (!existsSync11(p3))
27339
+ if (!existsSync12(p3))
27240
27340
  continue;
27241
27341
  if (!opts.dryRun)
27242
27342
  rmSync3(p3, { force: true });
@@ -27246,7 +27346,7 @@ function removeFiles(targets, opts) {
27246
27346
  }
27247
27347
 
27248
27348
  // src/commands/install/targets.ts
27249
- import { existsSync as existsSync12 } from "fs";
27349
+ import { existsSync as existsSync13 } from "fs";
27250
27350
  var INSTALL_TARGET_IDS = ["claude", "opencode"];
27251
27351
  var INSTALL_TARGETS = [
27252
27352
  {
@@ -27264,7 +27364,7 @@ var INSTALL_TARGETS = [
27264
27364
  ];
27265
27365
  var systemProbe = {
27266
27366
  hasCommand: (name) => Bun.which(name) !== null,
27267
- hasPath: existsSync12
27367
+ hasPath: existsSync13
27268
27368
  };
27269
27369
  function detectTargets(probe = systemProbe) {
27270
27370
  return INSTALL_TARGETS.filter((t2) => t2.detect(probe)).map((t2) => t2.id);
@@ -27317,7 +27417,7 @@ async function promptUpgrade(verdict, clack) {
27317
27417
 
27318
27418
  // src/commands/install/opencode.ts
27319
27419
  function isCaretCheckout(dir) {
27320
- return existsSync13(join15(dir, "opencode", "caret.plugin.ts"));
27420
+ return existsSync14(join15(dir, "opencode", "caret.plugin.ts"));
27321
27421
  }
27322
27422
  function caretEntries(text2, isCheckout) {
27323
27423
  return pluginEntries(text2).filter((entry) => {
@@ -27356,12 +27456,12 @@ async function runInstallOpencodeTarget(opts, deps = {}) {
27356
27456
  return;
27357
27457
  }
27358
27458
  if (opts.uninstall) {
27359
- await ui.step("Removing caret from OpenCode's plugin array", async () => editConfig(configFile2, (text2) => text2 === null ? null : caretEntries(text2, isCheckout).reduce((acc, entry) => removePluginFromConfigText(acc, entry), text2)), (changed) => changed.length > 0 ? `Removed caret from ${basename3(configFile2)}` : `caret was not in ${basename3(configFile2)}`);
27459
+ await ui.step("Removing caret from OpenCode's plugin array", async () => editConfig(configFile2, (text2) => text2 === null ? null : caretEntries(text2, isCheckout).reduce((acc, entry) => removePluginFromConfigText(acc, entry), text2)), (changed) => changed.length > 0 ? `Removed caret from ${basename4(configFile2)}` : `caret was not in ${basename4(configFile2)}`);
27360
27460
  await ui.step("Removing the /caret:* command files", async () => removeFiles(commandPaths, { dryRun: false }), (removed) => `Removed ${removed.paths.length} command file(s) from ${dir}`);
27361
27461
  await sweepLegacy(legacy, dir, ui);
27362
27462
  return;
27363
27463
  }
27364
- await ui.step(`Adding ${specifier} to OpenCode's plugin array`, async () => editConfig(configFile2, (text2) => setCaretPluginEntry(text2, specifier, isCheckout)), (changed) => changed.length > 0 ? `Added ${specifier} to ${basename3(configFile2)}` : `${specifier} was already in ${basename3(configFile2)}`);
27464
+ await ui.step(`Adding ${specifier} to OpenCode's plugin array`, async () => editConfig(configFile2, (text2) => setCaretPluginEntry(text2, specifier, isCheckout)), (changed) => changed.length > 0 ? `Added ${specifier} to ${basename4(configFile2)}` : `${specifier} was already in ${basename4(configFile2)}`);
27365
27465
  if (checks3(opts))
27366
27466
  await upgradeStep(configFile2, opts, deps, ui);
27367
27467
  await sweepLegacy(legacy, dir, ui);
@@ -27412,17 +27512,17 @@ async function upgradeStep(configFile2, opts, deps, ui) {
27412
27512
  await ui.step("Clearing OpenCode's cached caret", async () => (deps.clearCache ?? clearCachedCaret)(dirs), (cleared) => `Cleared ${cleared.length} cached ${cleared.length === 1 ? "copy" : "copies"} \u2014 OpenCode re-resolves on next start`);
27413
27513
  return;
27414
27514
  }
27415
- await ui.step(`Bumping ${CARET_PACKAGE} to ${verdict.published}`, async () => editConfig(configFile2, (text2) => text2 === null ? null : setPluginVersionInConfigText(text2, CARET_PACKAGE, verdict.published)), (changed) => changed.length > 0 ? `Bumped the pin to ${CARET_PACKAGE}@${verdict.published}` : `Left ${basename3(configFile2)} unchanged`);
27515
+ await ui.step(`Bumping ${CARET_PACKAGE} to ${verdict.published}`, async () => editConfig(configFile2, (text2) => text2 === null ? null : setPluginVersionInConfigText(text2, CARET_PACKAGE, verdict.published)), (changed) => changed.length > 0 ? `Bumped the pin to ${CARET_PACKAGE}@${verdict.published}` : `Left ${basename4(configFile2)} unchanged`);
27416
27516
  }
27417
27517
  function readConfigText(path2) {
27418
- return existsSync13(path2) ? readFileSync9(path2, "utf-8") : null;
27518
+ return existsSync14(path2) ? readFileSync10(path2, "utf-8") : null;
27419
27519
  }
27420
27520
  function editConfig(path2, transform2) {
27421
27521
  const existing = readConfigText(path2);
27422
27522
  const next = transform2(existing);
27423
27523
  if (next === null || next === existing)
27424
27524
  return [];
27425
- writeFileSync7(path2, next);
27525
+ writeFileSync8(path2, next);
27426
27526
  return [path2];
27427
27527
  }
27428
27528
 
@@ -27530,7 +27630,7 @@ async function rumdlStep(opts, deps, ui) {
27530
27630
  try {
27531
27631
  await ui.step("Installing the rumdl plan formatter", () => (deps.ensureRumdl ?? ensureRumdl)(), ({ bin, installed }) => `rumdl ${RUMDL_VERSION} ${installed ? "installed" : "already present"} at ${bin}`);
27532
27632
  } catch (e) {
27533
- ui.warn(`Could not install rumdl (${errorMessage(e)}) \u2014 caret will retry on your first plan.`);
27633
+ ui.warn(`Could not install rumdl (${errorMessage(e)}) \u2014 plans are stored unformatted until it installs.`);
27534
27634
  }
27535
27635
  }
27536
27636
  function closingLine(targets, opts, local = false) {
@@ -27615,6 +27715,7 @@ async function runReconcileSubcommand() {
27615
27715
  const loaded = loadSettings();
27616
27716
  setLogLevel(loaded.logging.level);
27617
27717
  setRedact(loaded.logging.redact);
27718
+ setLogRotation(logMaxSize(loaded), logKeep(loaded));
27618
27719
  warnInvalidEnvVars((msg) => logWarn("env", msg));
27619
27720
  const adapter = selectAdapter();
27620
27721
  const baseUrl = `http://localhost:${getPort(loaded)}`;
@@ -27646,23 +27747,23 @@ function runRedactSubcommand() {
27646
27747
  }
27647
27748
  }
27648
27749
 
27649
- // node_modules/.bun/marked@18.0.4/node_modules/marked/lib/marked.esm.js
27650
- function M2() {
27750
+ // node_modules/.bun/marked@18.0.9/node_modules/marked/lib/marked.esm.js
27751
+ function C3() {
27651
27752
  return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
27652
27753
  }
27653
- var T3 = M2();
27654
- function N2(l2) {
27655
- T3 = l2;
27754
+ var R2 = C3();
27755
+ function j(l2) {
27756
+ R2 = l2;
27656
27757
  }
27657
- var _2 = { exec: () => null };
27658
- function E2(l2) {
27758
+ var z2 = { exec: () => null };
27759
+ function A2(l2) {
27659
27760
  let e = [];
27660
27761
  return (t2) => {
27661
27762
  let n3 = Math.max(0, Math.min(3, t2 - 1)), s = e[n3];
27662
27763
  return s || (s = l2(n3), e[n3] = s), s;
27663
27764
  };
27664
27765
  }
27665
- function d(l2, e = "") {
27766
+ function k(l2, e = "") {
27666
27767
  let t2 = typeof l2 == "string" ? l2 : l2.source, n3 = { replace: (s, r2) => {
27667
27768
  let i2 = typeof r2 == "string" ? r2 : r2.source;
27668
27769
  return i2 = i2.replace(m3.caret, "$1"), t2 = t2.replace(s, i2), n3;
@@ -27676,71 +27777,80 @@ var Te = ((l2 = "") => {
27676
27777
  return false;
27677
27778
  }
27678
27779
  })();
27679
- var m3 = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l2) => new RegExp(`^( {0,3}${l2})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: E2((l2) => new RegExp(`^ {0,${l2}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: E2((l2) => new RegExp(`^ {0,${l2}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: E2((l2) => new RegExp(`^ {0,${l2}}(?:\`\`\`|~~~)`)), headingBeginRegex: E2((l2) => new RegExp(`^ {0,${l2}}#`)), htmlBeginRegex: E2((l2) => new RegExp(`^ {0,${l2}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: E2((l2) => new RegExp(`^ {0,${l2}}>`)) };
27780
+ var m3 = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l2) => new RegExp(`^( {0,3}${l2})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: A2((l2) => new RegExp(`^ {0,${l2}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: A2((l2) => new RegExp(`^ {0,${l2}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: A2((l2) => new RegExp(`^ {0,${l2}}(?:\`\`\`|~~~)`)), headingBeginRegex: A2((l2) => new RegExp(`^ {0,${l2}}#`)), htmlBeginRegex: A2((l2) => new RegExp(`^ {0,${l2}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: A2((l2) => new RegExp(`^ {0,${l2}}>`)) };
27680
27781
  var Oe = /^(?:[ \t]*(?:\n|$))+/;
27681
27782
  var we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
27682
27783
  var ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
27683
- var B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
27784
+ var q = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
27684
27785
  var Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
27685
- var j = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
27786
+ var U2 = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
27686
27787
  var oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
27687
- var ae = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
27688
- var Se = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
27689
- var F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
27690
- var $e = /^[^\n]+/;
27691
- var U2 = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
27692
- var Le = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U2).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
27693
- var _e = d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex();
27694
- var H = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
27695
- var K2 = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
27696
- var ze = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", K2).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
27697
- var le = d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
27698
- var Me = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex();
27699
- var W2 = { blockquote: Me, code: we, def: Le, fences: ye, heading: Pe, hr: B, html: ze, lheading: ae, list: _e, newline: Oe, paragraph: le, table: _2, text: $e };
27700
- var se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
27701
- var Ee = { ...W2, lheading: Se, table: se, paragraph: d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex() };
27702
- var Ie = { ...W2, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", K2).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _2, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
27788
+ var ae = k(oe).replace(/bull/g, U2).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
27789
+ var Se = k(oe).replace(/bull/g, U2).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
27790
+ var K2 = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
27791
+ var _e = /^[^\n]+/;
27792
+ var W2 = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
27793
+ var $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W2).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
27794
+ var Le = k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, U2).getRegex();
27795
+ var Q2 = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
27796
+ var X = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
27797
+ var Me = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", X).replace("tag", Q2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
27798
+ var le = (l2) => k(K2).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", l2).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q2).getRegex();
27799
+ var ze = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
27800
+ var Ee = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
27801
+ var Ce = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ee).getRegex();
27802
+ var J2 = { blockquote: Ce, code: we, def: $e, fences: ye, heading: Pe, hr: q, html: Me, lheading: ae, list: Le, newline: Oe, paragraph: ze, table: z2, text: _e };
27803
+ var se = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q2).getRegex();
27804
+ var Ae = { ...J2, lheading: Se, table: se, paragraph: k(K2).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q2).getRegex() };
27805
+ var Ie = { ...J2, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", X).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: z2, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(K2).replace("hr", q).replace("heading", ` *#{1,6} *[^
27703
27806
  ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
27704
- var Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
27705
- var Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
27706
- var ue = /^( {2,}|\\)\n(?!\s*$)/;
27707
- var Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
27708
- var I2 = /[\p{P}\p{S}]/u;
27709
- var Z = /[\s\p{P}\p{S}]/u;
27710
- var X = /[^\s\p{P}\p{S}]/u;
27711
- var De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex();
27712
- var pe = /(?!~)[\p{P}\p{S}]/u;
27713
- var qe = /(?!~)[\s\p{P}\p{S}]/u;
27714
- var ve = /(?:[^\s\p{P}\p{S}]|~)/u;
27715
- var He = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
27807
+ var Be = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
27808
+ var De = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
27809
+ var pe = /^( {2,}|\\)\n(?!\s*$)/;
27810
+ var qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
27811
+ var _2 = /[\p{P}\p{S}]/u;
27812
+ var I2 = /[\s\p{P}\p{S}]/u;
27813
+ var v = /[^\s\p{P}\p{S}]/u;
27814
+ var ve = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, I2).getRegex();
27815
+ var He = /[\p{Pi}\p{Ps}"']/u;
27816
+ var ue = /(?!~)[\p{P}\p{S}]/u;
27817
+ var Ze = /(?!~)[\s\p{P}\p{S}]/u;
27818
+ var Ge = /(?:[^\s\p{P}\p{S}]|~)/u;
27819
+ var Qe = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
27716
27820
  var ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
27717
- var Ze = d(ce, "u").replace(/punct/g, I2).getRegex();
27718
- var Ge = d(ce, "u").replace(/punct/g, pe).getRegex();
27821
+ var Ne = k(ce, "u").replace(/punct/g, _2).getRegex();
27822
+ var je = k(ce, "u").replace(/punct/g, ue).getRegex();
27823
+ var Fe = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
27824
+ var Ue = k(Fe, "u").replace(/openQuote/g, He).replace(/punct/g, _2).getRegex();
27719
27825
  var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
27720
- var Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I2).getRegex();
27721
- var Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex();
27722
- var je = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I2).getRegex();
27723
- var Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I2).getRegex();
27724
- var Ue = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
27725
- var Ke = d(Ue, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I2).getRegex();
27726
- var We = d(/\\(punct)/, "gu").replace(/punct/g, I2).getRegex();
27727
- var Xe = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
27728
- var Je = d(K2).replace("(?:-->|$)", "-->").getRegex();
27729
- var Ve = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
27730
- var v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
27731
- var Ye = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", v).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
27732
- var ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U2).getRegex();
27733
- var de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U2).getRegex();
27734
- var et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex();
27826
+ var Ke = k(he, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I2).replace(/punct/g, _2).getRegex();
27827
+ var We = k(he, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, Ze).replace(/punct/g, ue).getRegex();
27828
+ var Xe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
27829
+ var Je = k(Xe, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I2).replace(/punct/g, _2).getRegex();
27830
+ var Ve = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I2).replace(/punct/g, _2).getRegex();
27831
+ var Ye = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
27832
+ var et = k(Ye, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I2).replace(/punct/g, _2).getRegex();
27833
+ var tt = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _2).getRegex();
27834
+ var nt = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
27835
+ var rt = k(nt, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, I2).replace(/punct/g, _2).getRegex();
27836
+ var st = k(/\\(punct)/, "gu").replace(/punct/g, _2).getRegex();
27837
+ var it = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
27838
+ var ot = k(X).replace("(?:-->|$)", "-->").getRegex();
27839
+ var at = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ot).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
27840
+ var G = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
27841
+ var lt = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", G).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
27842
+ var de = k(/^!?\[(label)\]\[(ref)\]/).replace("label", G).replace("ref", W2).getRegex();
27843
+ var ke = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", W2).getRegex();
27844
+ var pt = k("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
27735
27845
  var ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
27736
- var J2 = { _backpedal: _2, anyPunctuation: We, autolink: Xe, blockSkip: He, br: ue, code: Ce, del: _2, delLDelim: _2, delRDelim: _2, emStrongLDelim: Ze, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Ae, link: Ye, nolink: de, punctuation: De, reflink: ke, reflinkSearch: et, tag: Ve, text: Be, url: _2 };
27737
- var tt = { ...J2, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex() };
27738
- var Q2 = { ...J2, emStrongRDelimAst: Qe, emStrongLDelim: Ge, delLDelim: Fe, delRDelim: Ke, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() };
27739
- var nt = { ...Q2, br: d(ue).replace("{2,}", "*").getRegex(), text: d(Q2.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
27740
- var D = { normal: W2, gfm: Ee, pedantic: Ie };
27741
- var A2 = { normal: J2, gfm: Q2, breaks: nt, pedantic: tt };
27742
- var rt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
27743
- var ge = (l2) => rt[l2];
27846
+ var V2 = { _backpedal: z2, anyPunctuation: st, autolink: it, blockSkip: Qe, br: pe, code: De, del: z2, delLDelim: z2, delRDelim: z2, emStrongLDelim: Ne, emStrongRDelimAst: Ke, emStrongRDelimUnd: Ve, escape: Be, link: lt, nolink: ke, punctuation: ve, reflink: de, reflinkSearch: pt, tag: at, text: qe, url: z2 };
27847
+ var ut = { ...V2, emStrongLDelim: Ue, emStrongRDelimAst: Je, emStrongRDelimUnd: et, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", G).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", G).getRegex() };
27848
+ var F = { ...V2, emStrongRDelimAst: We, emStrongLDelim: je, delLDelim: tt, delRDelim: rt, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() };
27849
+ var ct = { ...F, br: k(pe).replace("{2,}", "*").getRegex(), text: k(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
27850
+ var H = { normal: J2, gfm: Ae, pedantic: Ie };
27851
+ var B = { normal: V2, gfm: F, breaks: ct, pedantic: ut };
27852
+ var ht = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
27853
+ var ge = (l2) => ht[l2];
27744
27854
  function O(l2, e) {
27745
27855
  if (e) {
27746
27856
  if (m3.escapeTest.test(l2))
@@ -27749,7 +27859,7 @@ function O(l2, e) {
27749
27859
  return l2.replace(m3.escapeReplaceNoEncode, ge);
27750
27860
  return l2;
27751
27861
  }
27752
- function V2(l2) {
27862
+ function Y(l2) {
27753
27863
  try {
27754
27864
  l2 = encodeURI(l2).replace(m3.percentDecode, "%");
27755
27865
  } catch {
@@ -27757,12 +27867,12 @@ function V2(l2) {
27757
27867
  }
27758
27868
  return l2;
27759
27869
  }
27760
- function Y(l2, e) {
27870
+ function ee(l2, e) {
27761
27871
  let t2 = l2.replace(m3.findPipe, (r2, i2, o2) => {
27762
- let u5 = false, a2 = i2;
27872
+ let p3 = false, a2 = i2;
27763
27873
  for (;--a2 >= 0 && o2[a2] === "\\"; )
27764
- u5 = !u5;
27765
- return u5 ? "|" : " |";
27874
+ p3 = !p3;
27875
+ return p3 ? "|" : " |";
27766
27876
  }), n3 = t2.split(m3.splitPipe), s = 0;
27767
27877
  if (n3[0].trim() || n3.shift(), n3.length > 0 && !n3.at(-1)?.trim() && n3.pop(), e)
27768
27878
  if (n3.length > e)
@@ -27790,7 +27900,7 @@ function $(l2, e, t2) {
27790
27900
  }
27791
27901
  return l2.slice(0, n3 - s);
27792
27902
  }
27793
- function ee(l2) {
27903
+ function te(l2) {
27794
27904
  let e = l2.split(`
27795
27905
  `), t2 = e.length - 1;
27796
27906
  for (;t2 >= 0 && m3.blankLine.test(e[t2]); )
@@ -27824,10 +27934,10 @@ function me(l2, e = 0) {
27824
27934
  function xe(l2, e, t2, n3, s) {
27825
27935
  let r2 = e.href, i2 = e.title || null, o2 = l2[1].replace(s.other.outputLinkReplace, "$1");
27826
27936
  n3.state.inLink = true;
27827
- let u5 = { type: l2[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: r2, title: i2, text: o2, tokens: n3.inlineTokens(o2) };
27828
- return n3.state.inLink = false, u5;
27937
+ let p3 = { type: l2[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: r2, title: i2, text: o2, tokens: n3.inlineTokens(o2) };
27938
+ return n3.state.inLink = false, p3;
27829
27939
  }
27830
- function st(l2, e, t2) {
27940
+ function dt(l2, e, t2) {
27831
27941
  let n3 = l2.match(t2.other.indentCodeCompensation);
27832
27942
  if (n3 === null)
27833
27943
  return e;
@@ -27842,12 +27952,12 @@ function st(l2, e, t2) {
27842
27952
  }).join(`
27843
27953
  `);
27844
27954
  }
27845
- var w = class {
27955
+ var y = class {
27846
27956
  options;
27847
27957
  rules;
27848
27958
  lexer;
27849
27959
  constructor(e) {
27850
- this.options = e || T3;
27960
+ this.options = e || R2;
27851
27961
  }
27852
27962
  space(e) {
27853
27963
  let t2 = this.rules.block.newline.exec(e);
@@ -27857,14 +27967,14 @@ var w = class {
27857
27967
  code(e) {
27858
27968
  let t2 = this.rules.block.code.exec(e);
27859
27969
  if (t2) {
27860
- let n3 = this.options.pedantic ? t2[0] : ee(t2[0]), s = n3.replace(this.rules.other.codeRemoveIndent, "");
27970
+ let n3 = this.options.pedantic ? t2[0] : te(t2[0]), s = n3.replace(this.rules.other.codeRemoveIndent, "");
27861
27971
  return { type: "code", raw: n3, codeBlockStyle: "indented", text: s };
27862
27972
  }
27863
27973
  }
27864
27974
  fences(e) {
27865
27975
  let t2 = this.rules.block.fences.exec(e);
27866
27976
  if (t2) {
27867
- let n3 = t2[0], s = st(n3, t2[3] || "", this.rules);
27977
+ let n3 = t2[0], s = dt(n3, t2[3] || "", this.rules);
27868
27978
  return { type: "code", raw: n3, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: s };
27869
27979
  }
27870
27980
  }
@@ -27893,38 +28003,39 @@ var w = class {
27893
28003
  `).split(`
27894
28004
  `), s = "", r2 = "", i2 = [];
27895
28005
  for (;n3.length > 0; ) {
27896
- let o2 = false, u5 = [], a2;
28006
+ let o2 = false, p3 = [], a2;
27897
28007
  for (a2 = 0;a2 < n3.length; a2++)
27898
28008
  if (this.rules.other.blockquoteStart.test(n3[a2]))
27899
- u5.push(n3[a2]), o2 = true;
28009
+ p3.push(n3[a2]), o2 = true;
27900
28010
  else if (!o2)
27901
- u5.push(n3[a2]);
28011
+ p3.push(n3[a2]);
27902
28012
  else
27903
28013
  break;
27904
28014
  n3 = n3.slice(a2);
27905
- let c3 = u5.join(`
27906
- `), p3 = c3.replace(this.rules.other.blockquoteSetextReplace, `
28015
+ let u5 = p3.join(`
28016
+ `), c3 = u5.replace(this.rules.other.blockquoteSetextReplace, `
27907
28017
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
27908
28018
  s = s ? `${s}
27909
- ${c3}` : c3, r2 = r2 ? `${r2}
27910
- ${p3}` : p3;
27911
- let k = this.lexer.state.top;
27912
- if (this.lexer.state.top = true, this.lexer.blockTokens(p3, i2, true), this.lexer.state.top = k, n3.length === 0)
28019
+ ${u5}` : u5, r2 = r2 ? `${r2}
28020
+ ${c3}` : c3;
28021
+ let h2 = this.lexer.state.top;
28022
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c3, i2, true), this.lexer.state.top = h2, n3.length === 0)
27913
28023
  break;
27914
- let h2 = i2.at(-1);
27915
- if (h2?.type === "code")
28024
+ let d = i2.at(-1);
28025
+ if (d?.type === "code")
27916
28026
  break;
27917
- if (h2?.type === "blockquote") {
27918
- let R2 = h2, f2 = R2.raw + `
27919
- ` + n3.join(`
27920
- `), S = this.blockquote(f2);
27921
- i2[i2.length - 1] = S, s = s.substring(0, s.length - R2.raw.length) + S.raw, r2 = r2.substring(0, r2.length - R2.text.length) + S.text;
28027
+ if (d?.type === "blockquote") {
28028
+ let T3 = d, g2 = n3.join(`
28029
+ `), w = T3.raw + `
28030
+ ` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), M2 = this.blockquote(w);
28031
+ i2[i2.length - 1] = M2, s = `${s}
28032
+ ${g2}`, r2 = r2.substring(0, r2.length - T3.text.length) + M2.text;
27922
28033
  break;
27923
- } else if (h2?.type === "list") {
27924
- let R2 = h2, f2 = R2.raw + `
28034
+ } else if (d?.type === "list") {
28035
+ let T3 = d, g2 = T3.raw + `
27925
28036
  ` + n3.join(`
27926
- `), S = this.list(f2);
27927
- i2[i2.length - 1] = S, s = s.substring(0, s.length - h2.raw.length) + S.raw, r2 = r2.substring(0, r2.length - R2.raw.length) + S.raw, n3 = f2.substring(i2.at(-1).raw.length).split(`
28037
+ `), w = this.list(g2);
28038
+ i2[i2.length - 1] = w, s = s.substring(0, s.length - d.raw.length) + w.raw, r2 = r2.substring(0, r2.length - T3.raw.length) + w.raw, n3 = g2.substring(i2.at(-1).raw.length).split(`
27928
28039
  `);
27929
28040
  continue;
27930
28041
  }
@@ -27939,69 +28050,69 @@ ${p3}` : p3;
27939
28050
  n3 = s ? `\\d{1,9}\\${n3.slice(-1)}` : `\\${n3}`, this.options.pedantic && (n3 = s ? n3 : "[*+-]");
27940
28051
  let i2 = this.rules.other.listItemRegex(n3), o2 = false;
27941
28052
  for (;e; ) {
27942
- let a2 = false, c3 = "", p3 = "";
28053
+ let a2 = false, u5 = "", c3 = "";
27943
28054
  if (!(t2 = i2.exec(e)) || this.rules.block.hr.test(e))
27944
28055
  break;
27945
- c3 = t2[0], e = e.substring(c3.length);
27946
- let k = me(t2[2].split(`
27947
- `, 1)[0], t2[1].length), h2 = e.split(`
27948
- `, 1)[0], R2 = !k.trim(), f2 = 0;
27949
- if (this.options.pedantic ? (f2 = 2, p3 = k.trimStart()) : R2 ? f2 = t2[1].length + 1 : (f2 = k.search(this.rules.other.nonSpaceChar), f2 = f2 > 4 ? 1 : f2, p3 = k.slice(f2), f2 += t2[1].length), R2 && this.rules.other.blankLine.test(h2) && (c3 += h2 + `
27950
- `, e = e.substring(h2.length + 1), a2 = true), !a2) {
27951
- let S = this.rules.other.nextBulletRegex(f2), te = this.rules.other.hrRegex(f2), ne = this.rules.other.fencesBeginRegex(f2), re = this.rules.other.headingBeginRegex(f2), be = this.rules.other.htmlBeginRegex(f2), Re = this.rules.other.blockquoteBeginRegex(f2);
28056
+ u5 = t2[0], e = e.substring(u5.length);
28057
+ let h2 = me(t2[2].split(`
28058
+ `, 1)[0], t2[1].length), d = e.split(`
28059
+ `, 1)[0], T3 = !h2.trim(), g2 = 0;
28060
+ if (this.options.pedantic ? (g2 = 2, c3 = h2.trimStart()) : T3 ? g2 = t2[1].length + 1 : (g2 = h2.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c3 = h2.slice(g2), g2 += t2[1].length), T3 && this.rules.other.blankLine.test(d) && (u5 += d + `
28061
+ `, e = e.substring(d.length + 1), a2 = true), !a2) {
28062
+ let w = this.rules.other.nextBulletRegex(g2), M2 = this.rules.other.hrRegex(g2), ne = this.rules.other.fencesBeginRegex(g2), re = this.rules.other.headingBeginRegex(g2), be = this.rules.other.htmlBeginRegex(g2), Re = this.rules.other.blockquoteBeginRegex(g2);
27952
28063
  for (;e; ) {
27953
- let G = e.split(`
27954
- `, 1)[0], C3;
27955
- if (h2 = G, this.options.pedantic ? (h2 = h2.replace(this.rules.other.listReplaceNesting, " "), C3 = h2) : C3 = h2.replace(this.rules.other.tabCharGlobal, " "), ne.test(h2) || re.test(h2) || be.test(h2) || Re.test(h2) || S.test(h2) || te.test(h2))
28064
+ let N2 = e.split(`
28065
+ `, 1)[0], D;
28066
+ if (d = N2, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), D = d) : D = d.replace(this.rules.other.tabCharGlobal, " "), ne.test(d) || re.test(d) || be.test(d) || Re.test(d) || w.test(d) || M2.test(d))
27956
28067
  break;
27957
- if (C3.search(this.rules.other.nonSpaceChar) >= f2 || !h2.trim())
27958
- p3 += `
27959
- ` + C3.slice(f2);
28068
+ if (D.search(this.rules.other.nonSpaceChar) >= g2 || !d.trim())
28069
+ c3 += `
28070
+ ` + D.slice(g2);
27960
28071
  else {
27961
- if (R2 || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(k) || re.test(k) || te.test(k))
28072
+ if (T3 || h2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(h2) || re.test(h2) || M2.test(h2))
27962
28073
  break;
27963
- p3 += `
27964
- ` + h2;
28074
+ c3 += `
28075
+ ` + d;
27965
28076
  }
27966
- R2 = !h2.trim(), c3 += G + `
27967
- `, e = e.substring(G.length + 1), k = C3.slice(f2);
28077
+ T3 = !d.trim(), u5 += N2 + `
28078
+ `, e = e.substring(N2.length + 1), h2 = D.slice(g2);
27968
28079
  }
27969
28080
  }
27970
- r2.loose || (o2 ? r2.loose = true : this.rules.other.doubleBlankLine.test(c3) && (o2 = true)), r2.items.push({ type: "list_item", raw: c3, task: !!this.options.gfm && this.rules.other.listIsTask.test(p3), loose: false, text: p3, tokens: [] }), r2.raw += c3;
28081
+ r2.loose || (o2 ? r2.loose = true : this.rules.other.doubleBlankLine.test(u5) && (o2 = true)), r2.items.push({ type: "list_item", raw: u5, task: !!this.options.gfm && this.rules.other.listIsTask.test(c3), loose: false, text: c3, tokens: [] }), r2.raw += u5;
27971
28082
  }
27972
- let u5 = r2.items.at(-1);
27973
- if (u5)
27974
- u5.raw = u5.raw.trimEnd(), u5.text = u5.text.trimEnd();
28083
+ let p3 = r2.items.at(-1);
28084
+ if (p3)
28085
+ p3.raw = p3.raw.trimEnd(), p3.text = p3.text.trimEnd();
27975
28086
  else
27976
28087
  return;
27977
28088
  r2.raw = r2.raw.trimEnd();
27978
28089
  for (let a2 of r2.items) {
27979
28090
  this.lexer.state.top = false, a2.tokens = this.lexer.blockTokens(a2.text, []);
27980
- let c3 = a2.tokens[0];
27981
- if (a2.task && (c3?.type === "text" || c3?.type === "paragraph")) {
27982
- a2.text = a2.text.replace(this.rules.other.listReplaceTask, ""), c3.raw = c3.raw.replace(this.rules.other.listReplaceTask, ""), c3.text = c3.text.replace(this.rules.other.listReplaceTask, "");
27983
- for (let k = this.lexer.inlineQueue.length - 1;k >= 0; k--)
27984
- if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
27985
- this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
28091
+ let u5 = a2.tokens[0];
28092
+ if (a2.task && (u5?.type === "text" || u5?.type === "paragraph")) {
28093
+ a2.text = a2.text.replace(this.rules.other.listReplaceTask, ""), u5.raw = u5.raw.replace(this.rules.other.listReplaceTask, ""), u5.text = u5.text.replace(this.rules.other.listReplaceTask, "");
28094
+ for (let h2 = this.lexer.inlineQueue.length - 1;h2 >= 0; h2--)
28095
+ if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h2].src)) {
28096
+ this.lexer.inlineQueue[h2].src = this.lexer.inlineQueue[h2].src.replace(this.rules.other.listReplaceTask, "");
27986
28097
  break;
27987
28098
  }
27988
- let p3 = this.rules.other.listTaskCheckbox.exec(a2.raw);
27989
- if (p3) {
27990
- let k = { type: "checkbox", raw: p3[0] + " ", checked: p3[0] !== "[ ]" };
27991
- a2.checked = k.checked, r2.loose ? a2.tokens[0] && ["paragraph", "text"].includes(a2.tokens[0].type) && "tokens" in a2.tokens[0] && a2.tokens[0].tokens ? (a2.tokens[0].raw = k.raw + a2.tokens[0].raw, a2.tokens[0].text = k.raw + a2.tokens[0].text, a2.tokens[0].tokens.unshift(k)) : a2.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : a2.tokens.unshift(k);
28099
+ let c3 = this.rules.other.listTaskCheckbox.exec(a2.raw);
28100
+ if (c3) {
28101
+ let h2 = { type: "checkbox", raw: c3[0] + " ", checked: c3[0] !== "[ ]" };
28102
+ a2.checked = h2.checked, r2.loose ? a2.tokens[0] && ["paragraph", "text"].includes(a2.tokens[0].type) && "tokens" in a2.tokens[0] && a2.tokens[0].tokens ? (a2.tokens[0].raw = h2.raw + a2.tokens[0].raw, a2.tokens[0].text = h2.raw + a2.tokens[0].text, a2.tokens[0].tokens.unshift(h2)) : a2.tokens.unshift({ type: "paragraph", raw: h2.raw, text: h2.raw, tokens: [h2] }) : a2.tokens.unshift(h2);
27992
28103
  }
27993
28104
  } else
27994
28105
  a2.task && (a2.task = false);
27995
28106
  if (!r2.loose) {
27996
- let p3 = a2.tokens.filter((h2) => h2.type === "space"), k = p3.length > 0 && p3.some((h2) => this.rules.other.anyLine.test(h2.raw));
27997
- r2.loose = k;
28107
+ let c3 = a2.tokens.filter((d) => d.type === "space"), h2 = c3.length > 0 && c3.some((d) => this.rules.other.anyLine.test(d.raw));
28108
+ r2.loose = h2;
27998
28109
  }
27999
28110
  }
28000
28111
  if (r2.loose)
28001
28112
  for (let a2 of r2.items) {
28002
28113
  a2.loose = true;
28003
- for (let c3 of a2.tokens)
28004
- c3.type === "text" && (c3.type = "paragraph");
28114
+ for (let u5 of a2.tokens)
28115
+ u5.type === "text" && (u5.type = "paragraph");
28005
28116
  }
28006
28117
  return r2;
28007
28118
  }
@@ -28009,7 +28120,7 @@ ${p3}` : p3;
28009
28120
  html(e) {
28010
28121
  let t2 = this.rules.block.html.exec(e);
28011
28122
  if (t2) {
28012
- let n3 = ee(t2[0]);
28123
+ let n3 = te(t2[0]);
28013
28124
  return { type: "html", block: true, raw: n3, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n3 };
28014
28125
  }
28015
28126
  }
@@ -28025,7 +28136,7 @@ ${p3}` : p3;
28025
28136
  let t2 = this.rules.block.table.exec(e);
28026
28137
  if (!t2 || !this.rules.other.tableDelimiter.test(t2[2]))
28027
28138
  return;
28028
- let n3 = Y(t2[1]), s = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
28139
+ let n3 = ee(t2[1]), s = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
28029
28140
  `) : [], i2 = { type: "table", raw: $(t2[0], `
28030
28141
  `), header: [], align: [], rows: [] };
28031
28142
  if (n3.length === s.length) {
@@ -28034,7 +28145,7 @@ ${p3}` : p3;
28034
28145
  for (let o2 = 0;o2 < n3.length; o2++)
28035
28146
  i2.header.push({ text: n3[o2], tokens: this.lexer.inline(n3[o2]), header: true, align: i2.align[o2] });
28036
28147
  for (let o2 of r2)
28037
- i2.rows.push(Y(o2, i2.header.length).map((u5, a2) => ({ text: u5, tokens: this.lexer.inline(u5), header: false, align: i2.align[a2] })));
28148
+ i2.rows.push(ee(o2, i2.header.length).map((p3, a2) => ({ text: p3, tokens: this.lexer.inline(p3), header: false, align: i2.align[a2] })));
28038
28149
  return i2;
28039
28150
  }
28040
28151
  }
@@ -28084,8 +28195,8 @@ ${p3}` : p3;
28084
28195
  if (i2 === -2)
28085
28196
  return;
28086
28197
  if (i2 > -1) {
28087
- let u5 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + i2;
28088
- t2[2] = t2[2].substring(0, i2), t2[0] = t2[0].substring(0, u5).trim(), t2[3] = "";
28198
+ let p3 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + i2;
28199
+ t2[2] = t2[2].substring(0, i2), t2[0] = t2[0].substring(0, p3).trim(), t2[3] = "";
28089
28200
  }
28090
28201
  }
28091
28202
  let s = t2[2], r2 = "";
@@ -28113,27 +28224,31 @@ ${p3}` : p3;
28113
28224
  if (!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n3.match(this.rules.other.unicodeAlphaNumeric))
28114
28225
  return;
28115
28226
  if (!(s[1] || s[3] || "") || !n3 || this.rules.inline.punctuation.exec(n3)) {
28116
- let i2 = [...s[0]].length - 1, o2, u5, a2 = i2, c3 = 0, p3 = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
28117
- for (p3.lastIndex = 0, t2 = t2.slice(-1 * e.length + i2);(s = p3.exec(t2)) !== null; ) {
28227
+ let i2 = [...s[0]].length - 1, o2, p3, a2 = i2, u5 = 0, c3 = s[0][0], h2 = n3 === c3, d = c3 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
28228
+ for (d.lastIndex = 0, t2 = t2.slice(-1 * e.length + i2);(s = d.exec(t2)) !== null; ) {
28118
28229
  if (o2 = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o2)
28119
28230
  continue;
28120
- if (u5 = [...o2].length, s[3] || s[4]) {
28121
- a2 += u5;
28122
- continue;
28123
- } else if ((s[5] || s[6]) && i2 % 3 && !((i2 + u5) % 3)) {
28124
- c3 += u5;
28231
+ if (p3 = [...o2].length, s[3] || s[4]) {
28232
+ a2 += p3;
28125
28233
  continue;
28234
+ } else if (s[5] || s[6]) {
28235
+ if (i2 % 3 && !((i2 + p3) % 3)) {
28236
+ u5 += p3;
28237
+ continue;
28238
+ }
28239
+ if (h2)
28240
+ break;
28126
28241
  }
28127
- if (a2 -= u5, a2 > 0)
28242
+ if (a2 -= p3, a2 > 0)
28128
28243
  continue;
28129
- u5 = Math.min(u5, u5 + a2 + c3);
28130
- let k = [...s[0]][0].length, h2 = e.slice(0, i2 + s.index + k + u5);
28131
- if (Math.min(i2, u5) % 2) {
28132
- let f2 = h2.slice(1, -1);
28133
- return { type: "em", raw: h2, text: f2, tokens: this.lexer.inlineTokens(f2) };
28244
+ p3 = Math.min(p3, p3 + a2 + u5);
28245
+ let T3 = [...s[0]][0].length, g2 = e.slice(0, i2 + s.index + T3 + p3);
28246
+ if (Math.min(i2, p3) % 2) {
28247
+ let M2 = g2.slice(1, -1);
28248
+ return { type: "em", raw: g2, text: M2, tokens: this.lexer.inlineTokens(M2) };
28134
28249
  }
28135
- let R2 = h2.slice(2, -2);
28136
- return { type: "strong", raw: h2, text: R2, tokens: this.lexer.inlineTokens(R2) };
28250
+ let w = g2.slice(2, -2);
28251
+ return { type: "strong", raw: g2, text: w, tokens: this.lexer.inlineTokens(w) };
28137
28252
  }
28138
28253
  }
28139
28254
  }
@@ -28154,19 +28269,19 @@ ${p3}` : p3;
28154
28269
  if (!s)
28155
28270
  return;
28156
28271
  if (!(s[1] || "") || !n3 || this.rules.inline.punctuation.exec(n3)) {
28157
- let i2 = [...s[0]].length - 1, o2, u5, a2 = i2, c3 = this.rules.inline.delRDelim;
28158
- for (c3.lastIndex = 0, t2 = t2.slice(-1 * e.length + i2);(s = c3.exec(t2)) !== null; ) {
28159
- if (o2 = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o2 || (u5 = [...o2].length, u5 !== i2))
28272
+ let i2 = [...s[0]].length - 1, o2, p3, a2 = i2, u5 = this.rules.inline.delRDelim;
28273
+ for (u5.lastIndex = 0, t2 = t2.slice(-1 * e.length + i2);(s = u5.exec(t2)) !== null; ) {
28274
+ if (o2 = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o2 || (p3 = [...o2].length, p3 !== i2))
28160
28275
  continue;
28161
28276
  if (s[3] || s[4]) {
28162
- a2 += u5;
28277
+ a2 += p3;
28163
28278
  continue;
28164
28279
  }
28165
- if (a2 -= u5, a2 > 0)
28280
+ if (a2 -= p3, a2 > 0)
28166
28281
  continue;
28167
- u5 = Math.min(u5, u5 + a2);
28168
- let p3 = [...s[0]][0].length, k = e.slice(0, i2 + s.index + p3 + u5), h2 = k.slice(i2, -i2);
28169
- return { type: "del", raw: k, text: h2, tokens: this.lexer.inlineTokens(h2) };
28282
+ p3 = Math.min(p3, p3 + a2);
28283
+ let c3 = [...s[0]][0].length, h2 = e.slice(0, i2 + s.index + c3 + p3), d = h2.slice(i2, -i2);
28284
+ return { type: "del", raw: h2, text: d, tokens: this.lexer.inlineTokens(d) };
28170
28285
  }
28171
28286
  }
28172
28287
  }
@@ -28208,12 +28323,12 @@ var x2 = class l2 {
28208
28323
  inlineQueue;
28209
28324
  tokenizer;
28210
28325
  constructor(e) {
28211
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T3, this.options.tokenizer = this.options.tokenizer || new w, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
28212
- let t2 = { other: m3, block: D.normal, inline: A2.normal };
28213
- this.options.pedantic ? (t2.block = D.pedantic, t2.inline = A2.pedantic) : this.options.gfm && (t2.block = D.gfm, this.options.breaks ? t2.inline = A2.breaks : t2.inline = A2.gfm), this.tokenizer.rules = t2;
28326
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || R2, this.options.tokenizer = this.options.tokenizer || new y, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
28327
+ let t2 = { other: m3, block: H.normal, inline: B.normal };
28328
+ this.options.pedantic ? (t2.block = H.pedantic, t2.inline = B.pedantic) : this.options.gfm && (t2.block = H.gfm, this.options.breaks ? t2.inline = B.breaks : t2.inline = B.gfm), this.tokenizer.rules = t2;
28214
28329
  }
28215
28330
  static get rules() {
28216
- return { block: D, inline: A2 };
28331
+ return { block: H, inline: B };
28217
28332
  }
28218
28333
  static lex(e, t2) {
28219
28334
  return new l2(t2).lex(e);
@@ -28302,9 +28417,9 @@ var x2 = class l2 {
28302
28417
  }
28303
28418
  let i2 = e;
28304
28419
  if (this.options.extensions?.startBlock) {
28305
- let o2 = 1 / 0, u5 = e.slice(1), a2;
28306
- this.options.extensions.startBlock.forEach((c3) => {
28307
- a2 = c3.call({ lexer: this }, u5), typeof a2 == "number" && a2 >= 0 && (o2 = Math.min(o2, a2));
28420
+ let o2 = 1 / 0, p3 = e.slice(1), a2;
28421
+ this.options.extensions.startBlock.forEach((u5) => {
28422
+ a2 = u5.call({ lexer: this }, p3), typeof a2 == "number" && a2 >= 0 && (o2 = Math.min(o2, a2));
28308
28423
  }), o2 < 1 / 0 && o2 >= 0 && (i2 = e.substring(0, o2 + 1));
28309
28424
  }
28310
28425
  if (this.state.top && (r2 = this.tokenizer.paragraph(i2))) {
@@ -28336,84 +28451,80 @@ var x2 = class l2 {
28336
28451
  }
28337
28452
  inlineTokens(e, t2 = []) {
28338
28453
  this.tokenizer.lexer = this;
28339
- let n3 = e, s = null;
28454
+ let n3 = e;
28340
28455
  if (this.tokens.links) {
28341
- let a2 = Object.keys(this.tokens.links);
28342
- if (a2.length > 0)
28343
- for (;(s = this.tokenizer.rules.inline.reflinkSearch.exec(n3)) !== null; )
28344
- a2.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (n3 = n3.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + n3.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
28345
- }
28346
- for (;(s = this.tokenizer.rules.inline.anyPunctuation.exec(n3)) !== null; )
28347
- n3 = n3.slice(0, s.index) + "++" + n3.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
28348
- let r2;
28349
- for (;(s = this.tokenizer.rules.inline.blockSkip.exec(n3)) !== null; )
28350
- r2 = s[2] ? s[2].length : 0, n3 = n3.slice(0, s.index + r2) + "[" + "a".repeat(s[0].length - r2 - 2) + "]" + n3.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
28351
- n3 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n3) ?? n3;
28352
- let i2 = false, o2 = "", u5 = 1 / 0;
28456
+ let o2 = Object.keys(this.tokens.links);
28457
+ o2.length > 0 && (n3 = n3.replace(this.tokenizer.rules.inline.reflinkSearch, (p3) => o2.includes(p3.slice(p3.lastIndexOf("[") + 1, -1)) ? "[" + "a".repeat(p3.length - 2) + "]" : p3));
28458
+ }
28459
+ n3 = n3.replace(this.tokenizer.rules.inline.anyPunctuation, "++"), n3 = n3.replace(this.tokenizer.rules.inline.blockSkip, (o2, p3, a2) => {
28460
+ let u5 = a2 ? a2.length : 0;
28461
+ return o2.slice(0, u5) + "[" + "a".repeat(o2.length - u5 - 2) + "]";
28462
+ }), n3 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n3) ?? n3;
28463
+ let s = false, r2 = "", i2 = 1 / 0;
28353
28464
  for (;e; ) {
28354
- if (e.length < u5)
28355
- u5 = e.length;
28465
+ if (e.length < i2)
28466
+ i2 = e.length;
28356
28467
  else {
28357
28468
  this.infiniteLoopError(e.charCodeAt(0));
28358
28469
  break;
28359
28470
  }
28360
- i2 || (o2 = ""), i2 = false;
28361
- let a2;
28362
- if (this.options.extensions?.inline?.some((p3) => (a2 = p3.call({ lexer: this }, e, t2)) ? (e = e.substring(a2.raw.length), t2.push(a2), true) : false))
28471
+ s || (r2 = ""), s = false;
28472
+ let o2;
28473
+ if (this.options.extensions?.inline?.some((a2) => (o2 = a2.call({ lexer: this }, e, t2)) ? (e = e.substring(o2.raw.length), t2.push(o2), true) : false))
28363
28474
  continue;
28364
- if (a2 = this.tokenizer.escape(e)) {
28365
- e = e.substring(a2.raw.length), t2.push(a2);
28475
+ if (o2 = this.tokenizer.escape(e)) {
28476
+ e = e.substring(o2.raw.length), t2.push(o2);
28366
28477
  continue;
28367
28478
  }
28368
- if (a2 = this.tokenizer.tag(e)) {
28369
- e = e.substring(a2.raw.length), t2.push(a2);
28479
+ if (o2 = this.tokenizer.tag(e)) {
28480
+ e = e.substring(o2.raw.length), t2.push(o2);
28370
28481
  continue;
28371
28482
  }
28372
- if (a2 = this.tokenizer.link(e)) {
28373
- e = e.substring(a2.raw.length), t2.push(a2);
28483
+ if (o2 = this.tokenizer.link(e)) {
28484
+ e = e.substring(o2.raw.length), t2.push(o2);
28374
28485
  continue;
28375
28486
  }
28376
- if (a2 = this.tokenizer.reflink(e, this.tokens.links)) {
28377
- e = e.substring(a2.raw.length);
28378
- let p3 = t2.at(-1);
28379
- a2.type === "text" && p3?.type === "text" ? (p3.raw += a2.raw, p3.text += a2.text) : t2.push(a2);
28487
+ if (o2 = this.tokenizer.reflink(e, this.tokens.links)) {
28488
+ e = e.substring(o2.raw.length);
28489
+ let a2 = t2.at(-1);
28490
+ o2.type === "text" && a2?.type === "text" ? (a2.raw += o2.raw, a2.text += o2.text) : t2.push(o2);
28380
28491
  continue;
28381
28492
  }
28382
- if (a2 = this.tokenizer.emStrong(e, n3, o2)) {
28383
- e = e.substring(a2.raw.length), t2.push(a2);
28493
+ if (o2 = this.tokenizer.emStrong(e, n3, r2)) {
28494
+ e = e.substring(o2.raw.length), t2.push(o2);
28384
28495
  continue;
28385
28496
  }
28386
- if (a2 = this.tokenizer.codespan(e)) {
28387
- e = e.substring(a2.raw.length), t2.push(a2);
28497
+ if (o2 = this.tokenizer.codespan(e)) {
28498
+ e = e.substring(o2.raw.length), t2.push(o2);
28388
28499
  continue;
28389
28500
  }
28390
- if (a2 = this.tokenizer.br(e)) {
28391
- e = e.substring(a2.raw.length), t2.push(a2);
28501
+ if (o2 = this.tokenizer.br(e)) {
28502
+ e = e.substring(o2.raw.length), t2.push(o2);
28392
28503
  continue;
28393
28504
  }
28394
- if (a2 = this.tokenizer.del(e, n3, o2)) {
28395
- e = e.substring(a2.raw.length), t2.push(a2);
28505
+ if (o2 = this.tokenizer.del(e, n3, r2)) {
28506
+ e = e.substring(o2.raw.length), t2.push(o2);
28396
28507
  continue;
28397
28508
  }
28398
- if (a2 = this.tokenizer.autolink(e)) {
28399
- e = e.substring(a2.raw.length), t2.push(a2);
28509
+ if (o2 = this.tokenizer.autolink(e)) {
28510
+ e = e.substring(o2.raw.length), t2.push(o2);
28400
28511
  continue;
28401
28512
  }
28402
- if (!this.state.inLink && (a2 = this.tokenizer.url(e))) {
28403
- e = e.substring(a2.raw.length), t2.push(a2);
28513
+ if (!this.state.inLink && (o2 = this.tokenizer.url(e))) {
28514
+ e = e.substring(o2.raw.length), t2.push(o2);
28404
28515
  continue;
28405
28516
  }
28406
- let c3 = e;
28517
+ let p3 = e;
28407
28518
  if (this.options.extensions?.startInline) {
28408
- let p3 = 1 / 0, k = e.slice(1), h2;
28409
- this.options.extensions.startInline.forEach((R2) => {
28410
- h2 = R2.call({ lexer: this }, k), typeof h2 == "number" && h2 >= 0 && (p3 = Math.min(p3, h2));
28411
- }), p3 < 1 / 0 && p3 >= 0 && (c3 = e.substring(0, p3 + 1));
28412
- }
28413
- if (a2 = this.tokenizer.inlineText(c3)) {
28414
- e = e.substring(a2.raw.length), a2.raw.slice(-1) !== "_" && (o2 = a2.raw.slice(-1)), i2 = true;
28415
- let p3 = t2.at(-1);
28416
- p3?.type === "text" ? (p3.raw += a2.raw, p3.text += a2.text) : t2.push(a2);
28519
+ let a2 = 1 / 0, u5 = e.slice(1), c3;
28520
+ this.options.extensions.startInline.forEach((h2) => {
28521
+ c3 = h2.call({ lexer: this }, u5), typeof c3 == "number" && c3 >= 0 && (a2 = Math.min(a2, c3));
28522
+ }), a2 < 1 / 0 && a2 >= 0 && (p3 = e.substring(0, a2 + 1));
28523
+ }
28524
+ if (o2 = this.tokenizer.inlineText(p3)) {
28525
+ e = e.substring(o2.raw.length), o2.raw.slice(-1) !== "_" && (r2 = o2.raw.slice(-1)), s = true;
28526
+ let a2 = t2.at(-1);
28527
+ a2?.type === "text" ? (a2.raw += o2.raw, a2.text += o2.text) : t2.push(o2);
28417
28528
  continue;
28418
28529
  }
28419
28530
  if (e) {
@@ -28431,11 +28542,11 @@ var x2 = class l2 {
28431
28542
  throw new Error(t2);
28432
28543
  }
28433
28544
  };
28434
- var y = class {
28545
+ var P3 = class {
28435
28546
  options;
28436
28547
  parser;
28437
28548
  constructor(e) {
28438
- this.options = e || T3;
28549
+ this.options = e || R2;
28439
28550
  }
28440
28551
  space(e) {
28441
28552
  return "";
@@ -28469,8 +28580,8 @@ ${this.parser.parse(e)}</blockquote>
28469
28580
  list(e) {
28470
28581
  let { ordered: t2, start: n3 } = e, s = "";
28471
28582
  for (let o2 = 0;o2 < e.items.length; o2++) {
28472
- let u5 = e.items[o2];
28473
- s += this.listitem(u5);
28583
+ let p3 = e.items[o2];
28584
+ s += this.listitem(p3);
28474
28585
  }
28475
28586
  let r2 = t2 ? "ol" : "ul", i2 = t2 && n3 !== 1 ? ' start="' + n3 + '"' : "";
28476
28587
  return "<" + r2 + i2 + `>
@@ -28533,7 +28644,7 @@ ${e}</tr>
28533
28644
  return `<del>${this.parser.parseInline(e)}</del>`;
28534
28645
  }
28535
28646
  link({ href: e, title: t2, tokens: n3 }) {
28536
- let s = this.parser.parseInline(n3), r2 = V2(e);
28647
+ let s = this.parser.parseInline(n3), r2 = Y(e);
28537
28648
  if (r2 === null)
28538
28649
  return s;
28539
28650
  e = r2;
@@ -28542,7 +28653,7 @@ ${e}</tr>
28542
28653
  }
28543
28654
  image({ href: e, title: t2, text: n3, tokens: s }) {
28544
28655
  s && (n3 = this.parser.parseInline(s, this.parser.textRenderer));
28545
- let r2 = V2(e);
28656
+ let r2 = Y(e);
28546
28657
  if (r2 === null)
28547
28658
  return O(n3);
28548
28659
  e = r2;
@@ -28590,7 +28701,7 @@ var b3 = class l3 {
28590
28701
  renderer;
28591
28702
  textRenderer;
28592
28703
  constructor(e) {
28593
- this.options = e || T3, this.options.renderer = this.options.renderer || new y, this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L;
28704
+ this.options = e || R2, this.options.renderer = this.options.renderer || new P3, this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L;
28594
28705
  }
28595
28706
  static parse(e, t2) {
28596
28707
  return new l3(t2).parse(e);
@@ -28605,7 +28716,7 @@ var b3 = class l3 {
28605
28716
  let s = e[n3];
28606
28717
  if (this.options.extensions?.renderers?.[s.type]) {
28607
28718
  let i2 = s, o2 = this.options.extensions.renderers[i2.type].call({ parser: this }, i2);
28608
- if (o2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(i2.type)) {
28719
+ if (o2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(i2.type)) {
28609
28720
  t2 += o2 || "";
28610
28721
  continue;
28611
28722
  }
@@ -28677,7 +28788,7 @@ var b3 = class l3 {
28677
28788
  let r2 = e[s];
28678
28789
  if (this.options.extensions?.renderers?.[r2.type]) {
28679
28790
  let o2 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
28680
- if (o2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
28791
+ if (o2 !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
28681
28792
  n3 += o2 || "";
28682
28793
  continue;
28683
28794
  }
@@ -28739,11 +28850,11 @@ var b3 = class l3 {
28739
28850
  return n3;
28740
28851
  }
28741
28852
  };
28742
- var P3 = class {
28853
+ var S = class {
28743
28854
  options;
28744
28855
  block;
28745
28856
  constructor(e) {
28746
- this.options = e || T3;
28857
+ this.options = e || R2;
28747
28858
  }
28748
28859
  static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
28749
28860
  static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
@@ -28766,17 +28877,17 @@ var P3 = class {
28766
28877
  return e ? b3.parse : b3.parseInline;
28767
28878
  }
28768
28879
  };
28769
- var q = class {
28770
- defaults = M2();
28880
+ var Z = class {
28881
+ defaults = C3();
28771
28882
  options = this.setOptions;
28772
28883
  parse = this.parseMarkdown(true);
28773
28884
  parseInline = this.parseMarkdown(false);
28774
28885
  Parser = b3;
28775
- Renderer = y;
28886
+ Renderer = P3;
28776
28887
  TextRenderer = L;
28777
28888
  Lexer = x2;
28778
- Tokenizer = w;
28779
- Hooks = P3;
28889
+ Tokenizer = y;
28890
+ Hooks = S;
28780
28891
  constructor(...e) {
28781
28892
  this.use(...e);
28782
28893
  }
@@ -28818,8 +28929,8 @@ var q = class {
28818
28929
  if ("renderer" in r2) {
28819
28930
  let i2 = t2.renderers[r2.name];
28820
28931
  i2 ? t2.renderers[r2.name] = function(...o2) {
28821
- let u5 = r2.renderer.apply(this, o2);
28822
- return u5 === false && (u5 = i2.apply(this, o2)), u5;
28932
+ let p3 = r2.renderer.apply(this, o2);
28933
+ return p3 === false && (p3 = i2.apply(this, o2)), p3;
28823
28934
  } : t2.renderers[r2.name] = r2.renderer;
28824
28935
  }
28825
28936
  if ("tokenizer" in r2) {
@@ -28830,59 +28941,59 @@ var q = class {
28830
28941
  }
28831
28942
  "childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
28832
28943
  }), s.extensions = t2), n3.renderer) {
28833
- let r2 = this.defaults.renderer || new y(this.defaults);
28944
+ let r2 = this.defaults.renderer || new P3(this.defaults);
28834
28945
  for (let i2 in n3.renderer) {
28835
28946
  if (!(i2 in r2))
28836
28947
  throw new Error(`renderer '${i2}' does not exist`);
28837
28948
  if (["options", "parser"].includes(i2))
28838
28949
  continue;
28839
- let o2 = i2, u5 = n3.renderer[o2], a2 = r2[o2];
28840
- r2[o2] = (...c3) => {
28841
- let p3 = u5.apply(r2, c3);
28842
- return p3 === false && (p3 = a2.apply(r2, c3)), p3 || "";
28950
+ let o2 = i2, p3 = n3.renderer[o2], a2 = r2[o2];
28951
+ r2[o2] = (...u5) => {
28952
+ let c3 = p3.apply(r2, u5);
28953
+ return c3 === false && (c3 = a2.apply(r2, u5)), c3 || "";
28843
28954
  };
28844
28955
  }
28845
28956
  s.renderer = r2;
28846
28957
  }
28847
28958
  if (n3.tokenizer) {
28848
- let r2 = this.defaults.tokenizer || new w(this.defaults);
28959
+ let r2 = this.defaults.tokenizer || new y(this.defaults);
28849
28960
  for (let i2 in n3.tokenizer) {
28850
28961
  if (!(i2 in r2))
28851
28962
  throw new Error(`tokenizer '${i2}' does not exist`);
28852
28963
  if (["options", "rules", "lexer"].includes(i2))
28853
28964
  continue;
28854
- let o2 = i2, u5 = n3.tokenizer[o2], a2 = r2[o2];
28855
- r2[o2] = (...c3) => {
28856
- let p3 = u5.apply(r2, c3);
28857
- return p3 === false && (p3 = a2.apply(r2, c3)), p3;
28965
+ let o2 = i2, p3 = n3.tokenizer[o2], a2 = r2[o2];
28966
+ r2[o2] = (...u5) => {
28967
+ let c3 = p3.apply(r2, u5);
28968
+ return c3 === false && (c3 = a2.apply(r2, u5)), c3;
28858
28969
  };
28859
28970
  }
28860
28971
  s.tokenizer = r2;
28861
28972
  }
28862
28973
  if (n3.hooks) {
28863
- let r2 = this.defaults.hooks || new P3;
28974
+ let r2 = this.defaults.hooks || new S;
28864
28975
  for (let i2 in n3.hooks) {
28865
28976
  if (!(i2 in r2))
28866
28977
  throw new Error(`hook '${i2}' does not exist`);
28867
28978
  if (["options", "block"].includes(i2))
28868
28979
  continue;
28869
- let o2 = i2, u5 = n3.hooks[o2], a2 = r2[o2];
28870
- P3.passThroughHooks.has(i2) ? r2[o2] = (c3) => {
28871
- if (this.defaults.async && P3.passThroughHooksRespectAsync.has(i2))
28980
+ let o2 = i2, p3 = n3.hooks[o2], a2 = r2[o2];
28981
+ S.passThroughHooks.has(i2) ? r2[o2] = (u5) => {
28982
+ if (this.defaults.async && S.passThroughHooksRespectAsync.has(i2))
28872
28983
  return (async () => {
28873
- let k = await u5.call(r2, c3);
28874
- return a2.call(r2, k);
28984
+ let h2 = await p3.call(r2, u5);
28985
+ return a2.call(r2, h2);
28875
28986
  })();
28876
- let p3 = u5.call(r2, c3);
28877
- return a2.call(r2, p3);
28878
- } : r2[o2] = (...c3) => {
28987
+ let c3 = p3.call(r2, u5);
28988
+ return a2.call(r2, c3);
28989
+ } : r2[o2] = (...u5) => {
28879
28990
  if (this.defaults.async)
28880
28991
  return (async () => {
28881
- let k = await u5.apply(r2, c3);
28882
- return k === false && (k = await a2.apply(r2, c3)), k;
28992
+ let h2 = await p3.apply(r2, u5);
28993
+ return h2 === false && (h2 = await a2.apply(r2, u5)), h2;
28883
28994
  })();
28884
- let p3 = u5.apply(r2, c3);
28885
- return p3 === false && (p3 = a2.apply(r2, c3)), p3;
28995
+ let c3 = p3.apply(r2, u5);
28996
+ return c3 === false && (c3 = a2.apply(r2, u5)), c3;
28886
28997
  };
28887
28998
  }
28888
28999
  s.hooks = r2;
@@ -28890,8 +29001,8 @@ var q = class {
28890
29001
  if (n3.walkTokens) {
28891
29002
  let r2 = this.defaults.walkTokens, i2 = n3.walkTokens;
28892
29003
  s.walkTokens = function(o2) {
28893
- let u5 = [];
28894
- return u5.push(i2.call(this, o2)), r2 && (u5 = u5.concat(r2.call(this, o2))), u5;
29004
+ let p3 = [];
29005
+ return p3.push(i2.call(this, o2)), r2 && (p3 = p3.concat(r2.call(this, o2))), p3;
28895
29006
  };
28896
29007
  }
28897
29008
  this.defaults = { ...this.defaults, ...s };
@@ -28917,19 +29028,19 @@ var q = class {
28917
29028
  return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n3) + ", string expected"));
28918
29029
  if (i2.hooks && (i2.hooks.options = i2, i2.hooks.block = e), i2.async)
28919
29030
  return (async () => {
28920
- let u5 = i2.hooks ? await i2.hooks.preprocess(n3) : n3, c3 = await (i2.hooks ? await i2.hooks.provideLexer(e) : e ? x2.lex : x2.lexInline)(u5, i2), p3 = i2.hooks ? await i2.hooks.processAllTokens(c3) : c3;
28921
- i2.walkTokens && await Promise.all(this.walkTokens(p3, i2.walkTokens));
28922
- let h2 = await (i2.hooks ? await i2.hooks.provideParser(e) : e ? b3.parse : b3.parseInline)(p3, i2);
28923
- return i2.hooks ? await i2.hooks.postprocess(h2) : h2;
29031
+ let p3 = i2.hooks ? await i2.hooks.preprocess(n3) : n3, u5 = await (i2.hooks ? await i2.hooks.provideLexer(e) : e ? x2.lex : x2.lexInline)(p3, i2), c3 = i2.hooks ? await i2.hooks.processAllTokens(u5) : u5;
29032
+ i2.walkTokens && await Promise.all(this.walkTokens(c3, i2.walkTokens));
29033
+ let d = await (i2.hooks ? await i2.hooks.provideParser(e) : e ? b3.parse : b3.parseInline)(c3, i2);
29034
+ return i2.hooks ? await i2.hooks.postprocess(d) : d;
28924
29035
  })().catch(o2);
28925
29036
  try {
28926
29037
  i2.hooks && (n3 = i2.hooks.preprocess(n3));
28927
29038
  let a2 = (i2.hooks ? i2.hooks.provideLexer(e) : e ? x2.lex : x2.lexInline)(n3, i2);
28928
29039
  i2.hooks && (a2 = i2.hooks.processAllTokens(a2)), i2.walkTokens && this.walkTokens(a2, i2.walkTokens);
28929
- let p3 = (i2.hooks ? i2.hooks.provideParser(e) : e ? b3.parse : b3.parseInline)(a2, i2);
28930
- return i2.hooks && (p3 = i2.hooks.postprocess(p3)), p3;
28931
- } catch (u5) {
28932
- return o2(u5);
29040
+ let c3 = (i2.hooks ? i2.hooks.provideParser(e) : e ? b3.parse : b3.parseInline)(a2, i2);
29041
+ return i2.hooks && (c3 = i2.hooks.postprocess(c3)), c3;
29042
+ } catch (p3) {
29043
+ return o2(p3);
28933
29044
  }
28934
29045
  };
28935
29046
  }
@@ -28946,45 +29057,45 @@ Please report this to https://github.com/markedjs/marked.`, e) {
28946
29057
  };
28947
29058
  }
28948
29059
  };
28949
- var z2 = new q;
28950
- function g2(l4, e) {
28951
- return z2.parse(l4, e);
29060
+ var E2 = new Z;
29061
+ function f2(l4, e) {
29062
+ return E2.parse(l4, e);
28952
29063
  }
28953
- g2.options = g2.setOptions = function(l4) {
28954
- return z2.setOptions(l4), g2.defaults = z2.defaults, N2(g2.defaults), g2;
28955
- };
28956
- g2.getDefaults = M2;
28957
- g2.defaults = T3;
28958
- g2.use = function(...l4) {
28959
- return z2.use(...l4), g2.defaults = z2.defaults, N2(g2.defaults), g2;
29064
+ f2.options = f2.setOptions = function(l4) {
29065
+ return E2.setOptions(l4), f2.defaults = E2.defaults, j(f2.defaults), f2;
28960
29066
  };
28961
- g2.walkTokens = function(l4, e) {
28962
- return z2.walkTokens(l4, e);
29067
+ f2.getDefaults = C3;
29068
+ f2.defaults = R2;
29069
+ function kt(...l4) {
29070
+ return E2.use(...l4), f2.defaults = E2.defaults, j(f2.defaults), f2;
29071
+ }
29072
+ f2.use = kt;
29073
+ f2.walkTokens = function(l4, e) {
29074
+ return E2.walkTokens(l4, e);
28963
29075
  };
28964
- g2.parseInline = z2.parseInline;
28965
- g2.Parser = b3;
28966
- g2.parser = b3.parse;
28967
- g2.Renderer = y;
28968
- g2.TextRenderer = L;
28969
- g2.Lexer = x2;
28970
- g2.lexer = x2.lex;
28971
- g2.Tokenizer = w;
28972
- g2.Hooks = P3;
28973
- g2.parse = g2;
28974
- var Ft = g2.options;
28975
- var Ut = g2.setOptions;
28976
- var Kt = g2.use;
28977
- var Wt = g2.walkTokens;
28978
- var Xt = g2.parseInline;
28979
- var Vt = b3.parse;
28980
- var Yt = x2.lex;
29076
+ f2.parseInline = E2.parseInline;
29077
+ f2.Parser = b3;
29078
+ f2.parser = b3.parse;
29079
+ f2.Renderer = P3;
29080
+ f2.TextRenderer = L;
29081
+ f2.Lexer = x2;
29082
+ f2.lexer = x2.lex;
29083
+ f2.Tokenizer = y;
29084
+ f2.Hooks = S;
29085
+ f2.parse = f2;
29086
+ var nn = f2.options;
29087
+ var rn = f2.setOptions;
29088
+ var sn = f2.walkTokens;
29089
+ var on = f2.parseInline;
29090
+ var ln = b3.parse;
29091
+ var pn = x2.lex;
28981
29092
 
28982
29093
  // src/plan/format.ts
28983
29094
  var PLAN_FORMAT_DENY_MESSAGE = "caret: this plan has a code block with no language marker, so it can't be " + "syntax-highlighted in the review UI. Add a language tag to every code block's " + "opening fence (e.g. ```ts, ```bash, ```json), and use `text` for non-code " + "blocks like directory trees, console output, or ASCII art. Then resubmit the plan.";
28984
29095
  function hasUntaggedCodeBlock(plan) {
28985
29096
  if (!plan?.trim())
28986
29097
  return false;
28987
- const marked = new q({ gfm: true, breaks: false });
29098
+ const marked = new Z({ gfm: true, breaks: false });
28988
29099
  let untagged = false;
28989
29100
  marked.walkTokens(marked.lexer(plan), (token) => {
28990
29101
  if (token.type === "code" && !(token.lang ?? "").trim())
@@ -29115,6 +29226,7 @@ async function runReviewSubcommand() {
29115
29226
  const loaded = loadSettings();
29116
29227
  setLogLevel(loaded.logging.level);
29117
29228
  setRedact(loaded.logging.redact);
29229
+ setLogRotation(logMaxSize(loaded), logKeep(loaded));
29118
29230
  warnInvalidEnvVars((msg) => logWarn("env", msg));
29119
29231
  const adapter = selectAdapter();
29120
29232
  let hookInput;
@@ -29788,12 +29900,12 @@ var maxDistance = 3;
29788
29900
  function editDistance(a2, b4) {
29789
29901
  if (Math.abs(a2.length - b4.length) > maxDistance)
29790
29902
  return Math.max(a2.length, b4.length);
29791
- const d2 = [];
29903
+ const d = [];
29792
29904
  for (let i2 = 0;i2 <= a2.length; i2++) {
29793
- d2[i2] = [i2];
29905
+ d[i2] = [i2];
29794
29906
  }
29795
29907
  for (let j2 = 0;j2 <= b4.length; j2++) {
29796
- d2[0][j2] = j2;
29908
+ d[0][j2] = j2;
29797
29909
  }
29798
29910
  for (let j2 = 1;j2 <= b4.length; j2++) {
29799
29911
  for (let i2 = 1;i2 <= a2.length; i2++) {
@@ -29803,13 +29915,13 @@ function editDistance(a2, b4) {
29803
29915
  } else {
29804
29916
  cost = 1;
29805
29917
  }
29806
- d2[i2][j2] = Math.min(d2[i2 - 1][j2] + 1, d2[i2][j2 - 1] + 1, d2[i2 - 1][j2 - 1] + cost);
29918
+ d[i2][j2] = Math.min(d[i2 - 1][j2] + 1, d[i2][j2 - 1] + 1, d[i2 - 1][j2 - 1] + cost);
29807
29919
  if (i2 > 1 && j2 > 1 && a2[i2 - 1] === b4[j2 - 2] && a2[i2 - 2] === b4[j2 - 1]) {
29808
- d2[i2][j2] = Math.min(d2[i2][j2], d2[i2 - 2][j2 - 2] + 1);
29920
+ d[i2][j2] = Math.min(d[i2][j2], d[i2 - 2][j2 - 2] + 1);
29809
29921
  }
29810
29922
  }
29811
29923
  }
29812
- return d2[a2.length][b4.length];
29924
+ return d[a2.length][b4.length];
29813
29925
  }
29814
29926
  function suggestSimilar(word, candidates) {
29815
29927
  if (!candidates || candidates.length === 0)