eser 4.1.47 → 4.1.49

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 (219) hide show
  1. package/chunks/{add-V7YYHLFH.js → add-HBUORTI5.js} +1 -1
  2. package/chunks/{ajan-JKACPKCP.js → ajan-CL22MZYV.js} +1 -1
  3. package/chunks/approve-HF44PKLL.js +2 -0
  4. package/chunks/{ask-UCPMMIAF.js → ask-M3VS3GIJ.js} +1 -1
  5. package/chunks/block-F7S7PYMQ.js +2 -0
  6. package/chunks/{browser-JGBNWUEQ.js → browser-D536WJU3.js} +1 -1
  7. package/chunks/{build-BUB6OJCI.js → build-Y4OQZN3X.js} +2 -2
  8. package/chunks/{bun-HIMXX54I.js → bun-7XJSUU6Z.js} +1 -1
  9. package/chunks/cancel-Q6LMMZBV.js +2 -0
  10. package/chunks/{changelog-gen-TEI4IBNO.js → changelog-gen-LMXK5T7J.js} +1 -1
  11. package/chunks/{chunk-F2YHX6DL.js → chunk-2DAFGT4S.js} +1 -1
  12. package/chunks/{chunk-BJLUDX4R.js → chunk-2TANTKYS.js} +1 -1
  13. package/chunks/{chunk-3AA3RXKD.js → chunk-2ZYCRMUT.js} +1 -1
  14. package/chunks/{chunk-26ZFSXSK.js → chunk-3D5TBTM3.js} +1 -1
  15. package/chunks/{chunk-4ZVFKZ5S.js → chunk-3MMV2UHT.js} +1 -1
  16. package/chunks/{chunk-3IZX4OZ7.js → chunk-3OG2MEF2.js} +1 -1
  17. package/chunks/{chunk-ZCQ5CISX.js → chunk-3PZVRB75.js} +1 -1
  18. package/chunks/{chunk-RHEYIO4O.js → chunk-3SBAWBWS.js} +1 -1
  19. package/chunks/{chunk-AP7A6Y5Z.js → chunk-3TS5IRPD.js} +1 -1
  20. package/chunks/{chunk-HCYIL6IJ.js → chunk-3VZXRI4F.js} +1 -1
  21. package/chunks/{chunk-PLMZ3FYS.js → chunk-43E7ZXUB.js} +1 -1
  22. package/chunks/chunk-4NNSMDFH.js +2 -0
  23. package/chunks/chunk-4TTJVJEI.js +2 -0
  24. package/chunks/{chunk-L2E2H7YT.js → chunk-4X4NHXFE.js} +1 -1
  25. package/chunks/{chunk-MCWDLVWU.js → chunk-6BILFSH2.js} +1 -1
  26. package/chunks/{chunk-WJKE6XHF.js → chunk-6DBKPC2O.js} +1 -1
  27. package/chunks/{chunk-BQT5RJZB.js → chunk-6G6UVWJN.js} +1 -1
  28. package/chunks/{chunk-6E6JUBFH.js → chunk-ALFFE37K.js} +1 -1
  29. package/chunks/{chunk-5QRJ7OJK.js → chunk-AWMLF355.js} +1 -1
  30. package/chunks/{chunk-A2IW6BXT.js → chunk-C2IORZTF.js} +1 -1
  31. package/chunks/{chunk-NFZWSVJM.js → chunk-C6URCXQM.js} +1 -1
  32. package/chunks/{chunk-7XVIW7H6.js → chunk-D43XK3L2.js} +1 -1
  33. package/chunks/{chunk-3PCHQM4S.js → chunk-DYMKE4R3.js} +1 -1
  34. package/chunks/{chunk-GWZUQPFD.js → chunk-EQUPVWVY.js} +1 -1
  35. package/chunks/{chunk-TYUSWY27.js → chunk-FFEFO7MA.js} +1 -1
  36. package/chunks/{chunk-JUOSGSVB.js → chunk-FNPBHLLZ.js} +1 -1
  37. package/chunks/{chunk-F4G6QSSJ.js → chunk-FQY3JLY2.js} +1 -1
  38. package/chunks/chunk-FXDWRGGR.js +2 -0
  39. package/chunks/{chunk-HVTJ5LVU.js → chunk-FZ5WFU6R.js} +1 -1
  40. package/chunks/{chunk-BLXGL5MA.js → chunk-GVTM4EOU.js} +1 -1
  41. package/chunks/{chunk-JLRVMMMH.js → chunk-HVQK35SO.js} +1 -1
  42. package/chunks/{chunk-EGEJQP7D.js → chunk-IIFFSCDJ.js} +1 -1
  43. package/chunks/{chunk-4QDEJUAF.js → chunk-IZUADMIU.js} +1 -1
  44. package/chunks/{chunk-37GFWQQ3.js → chunk-JMGANJGV.js} +1 -1
  45. package/chunks/{chunk-LGNGLAV3.js → chunk-JTSRGXS4.js} +1 -1
  46. package/chunks/{chunk-CNHUVWV5.js → chunk-K7TY7247.js} +1 -1
  47. package/chunks/{chunk-5PH7JRXR.js → chunk-KHBIOZJE.js} +1 -1
  48. package/chunks/chunk-L32KHQVT.js +3 -0
  49. package/chunks/{chunk-MBCPGD5L.js → chunk-L5OC7F24.js} +1 -1
  50. package/chunks/{chunk-W7OYXLGD.js → chunk-L7ROACZC.js} +8 -8
  51. package/chunks/{chunk-EKUJSZIR.js → chunk-LJ7A5HYR.js} +1 -1
  52. package/chunks/{chunk-OWV223WQ.js → chunk-LLA75EMV.js} +1 -1
  53. package/chunks/{chunk-6PRIUPN4.js → chunk-LWQPFCWC.js} +1 -1
  54. package/chunks/{chunk-W724KQYO.js → chunk-LYM57LLM.js} +1 -1
  55. package/chunks/{chunk-ENTSZDR6.js → chunk-MTCPFQ5I.js} +1 -1
  56. package/chunks/{chunk-JHEL4OFF.js → chunk-N4NDBIQS.js} +1 -1
  57. package/chunks/{chunk-G5VGZMKA.js → chunk-NMEPQK3T.js} +1 -1
  58. package/chunks/{chunk-TEOMM3RD.js → chunk-NMSD4ZXJ.js} +1 -1
  59. package/chunks/{chunk-RVJZFWN7.js → chunk-NTY267SI.js} +1 -1
  60. package/chunks/{chunk-3QF3I2RD.js → chunk-NVPQJFAI.js} +1 -1
  61. package/chunks/{chunk-4HXAC4WN.js → chunk-PHOYLFXC.js} +1 -1
  62. package/chunks/{chunk-CXTOTN4Z.js → chunk-Q56M5KDF.js} +1 -1
  63. package/chunks/{chunk-LWWZT2AB.js → chunk-Q66KA572.js} +1 -1
  64. package/chunks/chunk-RBQ2FOSL.js +17 -0
  65. package/chunks/chunk-RBU3HF66.js +10 -0
  66. package/chunks/{chunk-MJ2IPSAE.js → chunk-RNFCAHVL.js} +1 -1
  67. package/chunks/{chunk-Z5P6PXQV.js → chunk-RSYERFWM.js} +1 -1
  68. package/chunks/{chunk-ZC4F4MYU.js → chunk-SHN5MT56.js} +1 -1
  69. package/chunks/{chunk-F44CX3KC.js → chunk-SNWQNMGD.js} +2 -2
  70. package/chunks/{chunk-YA4IPF62.js → chunk-TDIR6AUJ.js} +1 -1
  71. package/chunks/{chunk-VWQLQJVX.js → chunk-TW23CULJ.js} +1 -1
  72. package/chunks/{chunk-SRWZLNT6.js → chunk-U25GY4AZ.js} +1 -1
  73. package/chunks/chunk-U34MRDPH.js +4 -0
  74. package/chunks/{chunk-OAT2D23A.js → chunk-UEMWZOIU.js} +1 -1
  75. package/chunks/{chunk-Y3XXSUFP.js → chunk-WTMV5GTZ.js} +1 -1
  76. package/chunks/{chunk-F35K7YVH.js → chunk-X3L6GBUX.js} +1 -1
  77. package/chunks/{chunk-YBCZC5KZ.js → chunk-XBCL25QR.js} +1 -1
  78. package/chunks/{chunk-3QH27NOC.js → chunk-XFCBVUI7.js} +1 -1
  79. package/chunks/{chunk-VSTGSR3G.js → chunk-XVH5L5HY.js} +1 -1
  80. package/chunks/{chunk-R7FADWXC.js → chunk-YVKPHSJX.js} +1 -1
  81. package/chunks/{chunk-HP5W5XT6.js → chunk-ZNP3NXAD.js} +1 -1
  82. package/chunks/claude-code-UJYCO6CN.js +2 -0
  83. package/chunks/{clone-YEBQK7CG.js → clone-455UAECS.js} +1 -1
  84. package/chunks/{cmd-2DAVTVOF.js → cmd-QE4P4DS4.js} +1 -1
  85. package/chunks/{commitmsg-3NLTGBA7.js → commitmsg-57EMHAFY.js} +2 -2
  86. package/chunks/{concern-RNNRCADI.js → concern-7ZK3KY54.js} +1 -1
  87. package/chunks/config-O3OOS5BQ.js +2 -0
  88. package/chunks/{deno-XQHOVHKR.js → deno-JAQWMICD.js} +1 -1
  89. package/chunks/{dev-GHSKFRDU.js → dev-XHMBUBQE.js} +2 -2
  90. package/chunks/done-FQQYM27R.js +2 -0
  91. package/chunks/{file-tools-shared-BGQUI7QP.js → file-tools-shared-YKDNDDHR.js} +1 -1
  92. package/chunks/{free-L4KB3WSS.js → free-XOGOSVEQ.js} +1 -1
  93. package/chunks/{gh-L3FPMN5H.js → gh-AWX6I7FO.js} +2 -2
  94. package/chunks/{gh-contributors-NT5WW72V.js → gh-contributors-EDZTKR5E.js} +1 -1
  95. package/chunks/{init-II65LYMV.js → init-3HE3P3N3.js} +1 -1
  96. package/chunks/{init-EL6YCHIE.js → init-GBMYF3YG.js} +3 -3
  97. package/chunks/{install-YVHT6UAG.js → install-USGLFPAU.js} +1 -1
  98. package/chunks/invoke-hook-EIOZ5WSA.js +12 -0
  99. package/chunks/kiro-V6SMU4OL.js +2 -0
  100. package/chunks/{list-BOLPKAEY.js → list-M5DGQG46.js} +1 -1
  101. package/chunks/{list-VEGVTAKQ.js → list-NX7RRO6R.js} +1 -1
  102. package/chunks/{list-AKS7CUO3.js → list-ZVCGDRUH.js} +1 -1
  103. package/chunks/{load-config-G4DHKB5K.js → load-config-JZNJVJXH.js} +1 -1
  104. package/chunks/{main-PTEEAWXX.js → main-NCAKIBQC.js} +2 -2
  105. package/chunks/manager-GC34GK44.js +7 -0
  106. package/chunks/manifest-3GT2RMQL.js +2 -0
  107. package/chunks/{mod-DXA25A4J.js → mod-4XKQZL6W.js} +1 -1
  108. package/chunks/mod-52TIS344.js +2 -0
  109. package/chunks/{mod-MVH3RFS3.js → mod-5NDTGNVM.js} +1 -1
  110. package/chunks/{mod-ICWGLZBQ.js → mod-7ICCX4OY.js} +1 -1
  111. package/chunks/{mod-RF5F5WS2.js → mod-DFDEWFDA.js} +2 -2
  112. package/chunks/{mod-AD5UWQSM.js → mod-KPIOBBDD.js} +1 -1
  113. package/chunks/{mod-RMDGRCBK.js → mod-NSL6IJRQ.js} +1 -1
  114. package/chunks/{mod-QWYXFGRG.js → mod-OG7BBJP4.js} +1 -1
  115. package/chunks/{mod-YH5Z6G4Q.js → mod-TRSW5SEU.js} +1 -1
  116. package/chunks/{mod-BKHQAEVL.js → mod-VZT7JWPZ.js} +1 -1
  117. package/chunks/{mod-PZSJGUM7.js → mod-W225AUFE.js} +1 -1
  118. package/chunks/{new-VGL3IRFP.js → new-SS67ZKMK.js} +1 -1
  119. package/chunks/next-2LOPGEJO.js +9 -0
  120. package/chunks/{node-ZGM6SXXI.js → node-WWA6BHRC.js} +1 -1
  121. package/chunks/ollama-DFG5G467.js +2 -0
  122. package/chunks/opencode-UA45VV3W.js +2 -0
  123. package/chunks/pack-B5VXZEW7.js +6 -0
  124. package/chunks/{purge-6IOKNHG6.js → purge-Q3FI3S5M.js} +1 -1
  125. package/chunks/{recipe-applier-TTZEZGSC.js → recipe-applier-I2VBGHZU.js} +1 -1
  126. package/chunks/{registry-fetcher-SPENFEOH.js → registry-fetcher-TGWYJ5GN.js} +1 -1
  127. package/chunks/{release-6GDD5THZ.js → release-4VI2Y2ZT.js} +2 -2
  128. package/chunks/{release-notes-MZFILXWE.js → release-notes-2ZYPZ6TK.js} +1 -1
  129. package/chunks/{release-tag-LGZEFMKJ.js → release-tag-SG4WPYDZ.js} +1 -1
  130. package/chunks/reopen-6FB7DVV2.js +2 -0
  131. package/chunks/{reset-TDBHFTWW.js → reset-T4YMGQPV.js} +1 -1
  132. package/chunks/{rule-DUOZIDNM.js → rule-EJKPIOLE.js} +1 -1
  133. package/chunks/run-BV6BHCCQ.js +4 -0
  134. package/chunks/{run-OCYNXRVD.js → run-DAKF5SJN.js} +1 -1
  135. package/chunks/{scripts-7VDHDKFK.js → scripts-VRQQ24O3.js} +1 -1
  136. package/chunks/{serve-5V65OPB2.js → serve-5MTJLRIN.js} +2 -2
  137. package/chunks/{server-R347ON4B.js → server-VCPSLFZ2.js} +1 -1
  138. package/chunks/{session-SOIP6NHS.js → session-3HOLYHOY.js} +1 -1
  139. package/chunks/spec-3P3HJT27.js +2 -0
  140. package/chunks/status-6XVLXNA5.js +2 -0
  141. package/chunks/{sync-5XW5FTWS.js → sync-EEH6563X.js} +1 -1
  142. package/chunks/{system-HNZLRJLH.js → system-JBGO2IFD.js} +1 -1
  143. package/chunks/system-QDBQLRO6.js +2 -0
  144. package/chunks/{update-522VXIKX.js → update-VLYRDEH4.js} +1 -1
  145. package/chunks/validate-bom-XTZYCKGP.js +2 -0
  146. package/chunks/validate-case-conflict-CQIPKKHY.js +2 -0
  147. package/chunks/validate-circular-deps-Y6X6GZCG.js +2 -0
  148. package/chunks/validate-commit-msg-MXTBUPTC.js +2 -0
  149. package/chunks/validate-docs-ZOHUOW3I.js +2 -0
  150. package/chunks/validate-eof-4I2QAFTC.js +2 -0
  151. package/chunks/validate-export-names-7V3647EU.js +2 -0
  152. package/chunks/validate-filenames-6E634ZHO.js +2 -0
  153. package/chunks/validate-json-LRWPQ4JX.js +2 -0
  154. package/chunks/validate-large-files-RV7O7ZUR.js +2 -0
  155. package/chunks/validate-licenses-KHDUSBXM.js +2 -0
  156. package/chunks/validate-line-endings-XOCAE22U.js +2 -0
  157. package/chunks/validate-merge-conflict-PDJRAIKU.js +2 -0
  158. package/chunks/validate-mod-exports-Y6W74PAB.js +2 -0
  159. package/chunks/validate-package-configs-VVCKJELU.js +2 -0
  160. package/chunks/validate-secrets-UI5XKJ6B.js +2 -0
  161. package/chunks/validate-shebangs-GE23Z6NU.js +2 -0
  162. package/chunks/validate-submodules-R5JKX3Z6.js +2 -0
  163. package/chunks/validate-symlinks-WBF6VHHT.js +2 -0
  164. package/chunks/validate-toml-FNXGITZJ.js +2 -0
  165. package/chunks/validate-trailing-whitespace-UCMQTQ3B.js +2 -0
  166. package/chunks/validate-yaml-YRAD4HU3.js +2 -0
  167. package/chunks/{versions-MFY62V25.js → versions-LJSQVW77.js} +1 -1
  168. package/chunks/{watch-DBB4W5AE.js → watch-N3KV2ONB.js} +1 -1
  169. package/chunks/wontfix-MJJ2LK6J.js +2 -0
  170. package/chunks/{workerd-LOWXXQEU.js → workerd-LH2MLWIF.js} +1 -1
  171. package/eser.js +1 -1
  172. package/package.json +7 -8
  173. package/chunks/approve-URMQ77UE.js +0 -2
  174. package/chunks/block-5NWZBEXW.js +0 -2
  175. package/chunks/cancel-V6OK6U73.js +0 -2
  176. package/chunks/chunk-2HSGE3TL.js +0 -2
  177. package/chunks/chunk-FW3ETRQ5.js +0 -17
  178. package/chunks/chunk-ORAOSL2W.js +0 -2
  179. package/chunks/chunk-RGT7SMKJ.js +0 -4
  180. package/chunks/chunk-YW377352.js +0 -10
  181. package/chunks/chunk-ZER2RYWJ.js +0 -2
  182. package/chunks/claude-code-S2SGKOBE.js +0 -2
  183. package/chunks/done-VSVUSYIS.js +0 -2
  184. package/chunks/invoke-hook-QEE3PJBH.js +0 -12
  185. package/chunks/kiro-LNQTCWQU.js +0 -2
  186. package/chunks/manager-ARXVYR4H.js +0 -7
  187. package/chunks/manifest-3VJ4O6HR.js +0 -2
  188. package/chunks/mod-GXNNOTTG.js +0 -2
  189. package/chunks/next-RYENG2XC.js +0 -9
  190. package/chunks/ollama-IRQSLTDB.js +0 -2
  191. package/chunks/opencode-74XXXUQ2.js +0 -2
  192. package/chunks/reopen-XDNX2XRX.js +0 -2
  193. package/chunks/run-YK7DTHKW.js +0 -4
  194. package/chunks/spec-Y6K7CSBK.js +0 -2
  195. package/chunks/status-SXWEDQTL.js +0 -2
  196. package/chunks/system-WX4PNZSQ.js +0 -2
  197. package/chunks/validate-bom-XA7KZWTH.js +0 -2
  198. package/chunks/validate-case-conflict-QWOT7276.js +0 -2
  199. package/chunks/validate-circular-deps-IAC3BSYO.js +0 -2
  200. package/chunks/validate-commit-msg-M42NIQLD.js +0 -2
  201. package/chunks/validate-docs-DXY4C23P.js +0 -2
  202. package/chunks/validate-eof-M3LGJL64.js +0 -2
  203. package/chunks/validate-export-names-BQAH7J4F.js +0 -2
  204. package/chunks/validate-filenames-WYIWPR5V.js +0 -2
  205. package/chunks/validate-json-S2J5SSZS.js +0 -2
  206. package/chunks/validate-large-files-X4D3CL42.js +0 -2
  207. package/chunks/validate-licenses-6LB6MLQU.js +0 -2
  208. package/chunks/validate-line-endings-NX2XXGTH.js +0 -2
  209. package/chunks/validate-merge-conflict-3ZNS7HS2.js +0 -2
  210. package/chunks/validate-mod-exports-72EWWWMT.js +0 -2
  211. package/chunks/validate-package-configs-55XAXICZ.js +0 -2
  212. package/chunks/validate-secrets-5V7V65JA.js +0 -2
  213. package/chunks/validate-shebangs-XVHLZJKY.js +0 -2
  214. package/chunks/validate-submodules-Z6WRSMS5.js +0 -2
  215. package/chunks/validate-symlinks-FWV2RFCM.js +0 -2
  216. package/chunks/validate-toml-DTGDAUSH.js +0 -2
  217. package/chunks/validate-trailing-whitespace-5QSYKA6L.js +0 -2
  218. package/chunks/validate-yaml-SKE7CDCP.js +0 -2
  219. package/chunks/wontfix-D2ZHBGNH.js +0 -2
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as Le}from"./chunk-4HXAC4WN.js";import{a as qe}from"./chunk-7XVIW7H6.js";import{a as _e,c as Je}from"./chunk-W724KQYO.js";import{a as We}from"./chunk-Z5P6PXQV.js";import{a as ze}from"./chunk-F4G6QSSJ.js";import{a as Se,c as $e}from"./chunk-5QRJ7OJK.js";import{a as Re,c as Te}from"./chunk-YA4IPF62.js";import{a as De,c as Fe}from"./chunk-R7FADWXC.js";import{a as Pe,c as je}from"./chunk-HCYIL6IJ.js";import{a as Ie,c as Ee}from"./chunk-LWWZT2AB.js";import{a as Me,c as Ne}from"./chunk-AP7A6Y5Z.js";import{a as Oe}from"./chunk-RHEYIO4O.js";import{a as Ae}from"./chunk-3PCHQM4S.js";import"./chunk-EGEJQP7D.js";import{a as de,c as ce}from"./chunk-TYUSWY27.js";import{a as pe,c as me}from"./chunk-37GFWQQ3.js";import{a as ue,c as fe}from"./chunk-CXTOTN4Z.js";import{a as ge,c as ve}from"./chunk-ZCQ5CISX.js";import{a as ye,c as he}from"./chunk-4ZVFKZ5S.js";import{a as ke,c as be}from"./chunk-CNHUVWV5.js";import{a as xe,c as Ve}from"./chunk-VSTGSR3G.js";import{a as Ce,c as we}from"./chunk-NFZWSVJM.js";import"./chunk-26ZFSXSK.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-SRWZLNT6.js";import{a as re}from"./chunk-JLRVMMMH.js";import"./chunk-5PH7JRXR.js";import{b as H,c as Q}from"./chunk-L2E2H7YT.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-LGNGLAV3.js";import{a as q,b as Z,f as ee,h as te,j as ae,k as _,o as m,p as se,q as oe}from"./chunk-ZER2RYWJ.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import{a as K}from"./chunk-MG65QJY6.js";import{a as P,b as L}from"./chunk-FFWPJP7A.js";import{i as j}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var I=async a=>{let s=await H(a);return s===null?null:s},Ke=async a=>await Q(a);var J={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let s=await Le({root:a.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(e=>({severity:"error",message:`Circular dependency: ${e.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var W={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let s=await We({root:a.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(e=>({severity:"error",message:`Missing export in ${e.packageName}: ${e.file}`,file:e.file})),stats:{packagesChecked:s.packagesChecked}}}};var z={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let s=await qe({root:a.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(e=>({severity:"error",message:`${e.packageName}: "${e.exportPath}" should be "${e.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var Y={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let s=a.options?.requireExamples,e=await Ae({root:a.root,requireExamples:s});return{name:"validate-docs",passed:e.isValid,issues:e.issues.map(t=>({severity:"error",message:`${t.symbol}: ${t.issue}`,file:t.file,line:t.line})),stats:{filesChecked:e.filesChecked,symbolsChecked:e.symbolsChecked}}}};var B={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let s=await ze({root:a.root}),e=[];for(let t of s.inconsistencies)e.push({severity:"error",message:`${t.packageName}: ${t.field} mismatch - deno.json: ${JSON.stringify(t.denoValue)}, package.json: ${JSON.stringify(t.packageValue)}`});for(let t of s.dependencyInconsistencies){let c=`${t.packageName}: ${t.dependencyName} - ${t.issue}`;t.expected!==void 0&&t.actual!==void 0&&(c+=` (expected: ${t.expected}, actual: ${t.actual})`),e.push({severity:"error",message:c})}return{name:"validate-package-configs",passed:s.isConsistent,issues:e,stats:{packagesChecked:s.packagesChecked}}}};var tt=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],at=[],st=a=>at.some(s=>s.test(a)),ot=(a,s)=>{let e=a.slice(0,s);return e.includes("//")||e.includes("/*")&&!e.includes("*/")},it=(a,s)=>{let e=!1,t=!1,c=!1;for(let p=0;p<s;p++){let u=a[p];(p>0?a[p-1]:"")!=="\\"&&(u==="'"&&!t&&!c&&(e=!e),u==='"'&&!e&&!c&&(t=!t),u==="`"&&!e&&!t&&(c=!c))}return e||t||c},w=re({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:X,checkFile(a,s){if(s===void 0)return[];if(st(a.path))return[];let e=[],t=s.split(`
3
- `);for(let c=0;c<t.length;c++){let p=t[c];for(let{pattern:u,replacement:f}of tt){let g=u.exec(p);g!==null&&(ot(p,g.index)||it(p,g.index)||e.push({path:a.path,line:c+1,message:`direct Deno API usage: ${g[0]} \u2014 use @eser/standards/cross-runtime (${f})`}))}}return e}}),St=w.run,Ye=w.validator,$t=w.main;var x={validators:new Map,initialized:!1},nt=()=>{n(J),n(W),n(z),n(Y),n(B),n(le),n(ce),n(me),n(fe),n(ve),n(he),n(be),n(Ve),n(we),n($e),n(Te),n(Fe),n(je),n(Ee),n(Ne),n(Je),n(Ye)},U=()=>{x.initialized||(x.initialized=!0,nt())},n=a=>{x.validators.set(a.name,a)},lt=a=>(U(),x.validators.get(a)??null),E=()=>(U(),[...x.validators.values()]),dt=()=>(U(),[...x.validators.keys()]),ct=a=>({name:a.config.name,description:a.config.description,run:async s=>{let e=await a.run(s);return{name:e.name,passed:e.issues.length===0,issues:e.issues.map(t=>({path:t.path,line:t.line,message:t.message,fixed:t.fixed})),mutations:e.mutations.map(t=>({path:t.path,oldContent:t.oldContent,newContent:t.newContent})),stats:{filesChecked:e.filesChecked,issuesFound:e.issues.length}}}}),pt=a=>({name:a.name,description:a.description,run:async s=>{let e=await a.validate({root:s.root??".",options:s});return{name:e.name,passed:e.passed,issues:e.issues.map(t=>({path:t.file,line:t.line,message:t.message})),mutations:[],stats:e.stats}}}),mt=()=>{let a=[],s=[ne,de,pe,ue,ge,ye,ke,xe,Ce,Se,Re,De,Pe,Ie,Me,_e,w];for(let t of s)a.push(ct(t));let e=[J,W,z,Y,B];for(let t of e)a.push(pt(t));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async t=>{let c=t.commitMsgFile??t._args?.[0]??".git/COMMIT_EDITMSG",{runtime:p}=await import("./mod-DXA25A4J.js"),u;try{u=await p.fs.readTextFile(c)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${c}`}],mutations:[],stats:{}}}let f=Oe(u,{allowAsterisk:t.allowAsterisk,allowMultipleScopes:t.allowMultipleScopes,forceScope:t.forceScope,types:t.types});return{name:"validate-commit-msg",passed:f.valid,issues:f.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ut=8,Zt=async(a={})=>{let s=a.root??j.process.cwd(),t=(await I(s))?.stack??[],c=[...a.skip??[]],p=a.only??[],u=E(),f=[],g=[],S=[];for(let i of u){if(p.length>0&&!p.includes(i.name))continue;if(c.includes(i.name)){S.push(i.name);continue}if(i.requiredStacks.length>0&&t.length>0&&!i.requiredStacks.some(G=>t.includes(G))){g.push({name:i.name,reason:`Requires '${i.requiredStacks.join("' or '")}' stack`});continue}let $={...a.fix!==void 0?{fix:a.fix}:{}},h=await i.validate({root:s,options:$});f.push(h)}return{passed:f.every(i=>i.passed),results:f,skipped:g,disabled:S}},ea=async a=>{let s=K(a??j.process.args,{string:["root","only","skip"],boolean:["fix","help","json","yes"],alias:{h:"help",y:"yes"}});if(s.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -y, --yes Auto-confirm all fix prompts (no interactive prompts)"),console.log(" --json Output results as JSON (suppresses TUI output)"),console.log(" -h, --help Show this help message"),P(void 0);let e=s.json,t=s.yes,c=s.root,p=s.fix,u=s.only,f=s.skip,g=u!==void 0?u.split(",").map(o=>o.trim()):[],S=f!==void 0?f.split(",").map(o=>o.trim()):[],{ctx:i}=e?{ctx:Z({interaction:"non-interactive"})}:ie(),$=i.interaction==="interactive",h=c??j.process.cwd();e||ae(i,"Validating codebase...");let M=e?void 0:se(i,"Loading config...");M?.start();let R=(await I(h))?.stack??[],Be=R.length>0?R.join(", "):"all (no .eser/manifest.yml)";M?.succeed("Config loaded"),e||m.info(i,`Stack: ${Be}`);let Ue=E(),k=[],T=[],D=[];for(let o of Ue)if(!(g.length>0&&!g.includes(o.name))){if(S.includes(o.name)){D.push(o.name);continue}if(o.requiredStacks.length>0&&R.length>0&&!o.requiredStacks.some(d=>R.includes(d))){T.push({name:o.name,reason:`Requires '${o.requiredStacks.join("' or '")}' stack`});continue}k.push(o)}let V=[],N=e?void 0:oe(i,{total:k.length,label:"Validating..."});N?.start();let O=o=>{if(V.push(o),!e){let l=Object.entries(o.stats).map(([r,y])=>`${y} ${r}`).join(", "),d=`${o.name.padEnd(18)} (${l})`;o.passed?m.success(i,`PASS ${d}`):m.error(i,`FAIL ${d}`)}N?.advance(1)};if(p)for(let o of k){let l=await o.validate({root:h,options:{}}),d=l;if(!l.passed){let r=!0;if($&&!t&&!e){let y=l.issues.length,v=await ee(i,{message:`Fix ${y} issue(s) found by ${o.name}?`,initialValue:!0});(q(v)||!v)&&(r=!1)}r&&(d=await o.validate({root:h,options:{fix:!0}}))}O(d)}else{let o=0,l=async()=>{for(;o<k.length;){let y=o++,v=k[y];if(v===void 0)break;try{let b=await v.validate({root:h,options:{}});O(b)}catch(b){let Ge={name:v.name,passed:!1,issues:[{severity:"error",message:String(b)}],stats:{filesChecked:0,issuesFound:1,fixedCount:0}};O(Ge)}}},d=Math.min(ut,k.length),r=Array.from({length:d},()=>l());await Promise.allSettled(r)}if(N?.stop("Validation complete"),!e&&T.length>0){m.step(i,"Skipped (stack not configured):");for(let o of T)m.step(i,` - ${o.name}: ${o.reason}`)}if(!e&&D.length>0){m.step(i,"Disabled:");for(let o of D)m.step(i,` - ${o}`)}let C=V.flatMap(o=>o.issues.map(l=>({validator:o.name,...l})));if(!e&&C.length>0){m.warn(i,`Issues (${C.length}):`);let o=new Map;for(let l of C){let d=l.file??l.validator,r=o.get(d)??[];r.push(l),o.set(d,r)}for(let[l,d]of o){m.step(i,` ${l}`);for(let r of d){let y=r.severity==="error"?"error":"warning",v=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${y}${v}: ${r.message}`):m.warn(i,` ${y}${v}: ${r.message}`)}}}let F=V.filter(o=>!o.passed);if(!e&&$&&F.length>0)for(;;){let o=[...F.map(r=>({value:r.name,label:`${r.name} (${r.issues.length} issue(s))`})),{value:"__done__",label:"Done"}],l=await te(i,{message:"View details for which validator?",options:o});if(q(l)||l==="__done__")break;let d=F.find(r=>r.name===l);if(d!==void 0){m.info(i,`Details for ${d.name} (${d.issues.length} issue(s)):`);for(let r of d.issues){let y=r.severity==="error"?"error":"warning",v=r.file??d.name,b=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${v}${b} [${y}]: ${r.message}`):m.warn(i,` ${v}${b} [${y}]: ${r.message}`)}}}if(e){let o=V.every(d=>d.passed),l=JSON.stringify({passed:o,results:V,skipped:T,disabled:D},null,2);return console.log(l),o?P(void 0):L({message:"",exitCode:1})}let A=F.length;return A>0?(_(i,`${A} check(s) failed with ${C.length} issue(s)`),L({message:`${A} check(s) failed with ${C.length} issue(s)`,exitCode:1})):(_(i,"All checks passed!"),P(void 0))};export{Ke as getProjectConfigPath,lt as getValidator,dt as getValidatorNames,E as getValidators,mt as getWorkflowTools,I as loadProjectConfig,ea as main,n as registerValidator,Zt as validate};
2
+ import{a as Le}from"./chunk-PHOYLFXC.js";import{a as qe}from"./chunk-D43XK3L2.js";import{a as _e,c as Je}from"./chunk-LYM57LLM.js";import{a as We}from"./chunk-RSYERFWM.js";import{a as ze}from"./chunk-FQY3JLY2.js";import{a as Se,c as $e}from"./chunk-AWMLF355.js";import{a as Re,c as Te}from"./chunk-TDIR6AUJ.js";import{a as De,c as Fe}from"./chunk-YVKPHSJX.js";import{a as Pe,c as je}from"./chunk-3VZXRI4F.js";import{a as Ie,c as Ee}from"./chunk-Q66KA572.js";import{a as Me,c as Ne}from"./chunk-3TS5IRPD.js";import{a as Oe}from"./chunk-3SBAWBWS.js";import{a as Ae}from"./chunk-DYMKE4R3.js";import"./chunk-IIFFSCDJ.js";import{a as de,c as ce}from"./chunk-FFEFO7MA.js";import{a as pe,c as me}from"./chunk-JMGANJGV.js";import{a as ue,c as fe}from"./chunk-Q56M5KDF.js";import{a as ge,c as ve}from"./chunk-3PZVRB75.js";import{a as ye,c as he}from"./chunk-3MMV2UHT.js";import{a as ke,c as be}from"./chunk-K7TY7247.js";import{a as xe,c as Ve}from"./chunk-XVH5L5HY.js";import{a as Ce,c as we}from"./chunk-C6URCXQM.js";import"./chunk-3D5TBTM3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-U25GY4AZ.js";import{a as re}from"./chunk-HVQK35SO.js";import"./chunk-KHBIOZJE.js";import{b as H,c as Q}from"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-JTSRGXS4.js";import{a as q,b as Z,f as ee,h as te,j as ae,k as _,o as m,p as se,q as oe}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import{a as K}from"./chunk-MG65QJY6.js";import{a as P,b as L}from"./chunk-FFWPJP7A.js";import{i as j}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var I=async a=>{let s=await H(a);return s===null?null:s},Ke=async a=>await Q(a);var J={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let s=await Le({root:a.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(e=>({severity:"error",message:`Circular dependency: ${e.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var W={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let s=await We({root:a.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(e=>({severity:"error",message:`Missing export in ${e.packageName}: ${e.file}`,file:e.file})),stats:{packagesChecked:s.packagesChecked}}}};var z={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let s=await qe({root:a.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(e=>({severity:"error",message:`${e.packageName}: "${e.exportPath}" should be "${e.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var Y={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let s=a.options?.requireExamples,e=await Ae({root:a.root,requireExamples:s});return{name:"validate-docs",passed:e.isValid,issues:e.issues.map(t=>({severity:"error",message:`${t.symbol}: ${t.issue}`,file:t.file,line:t.line})),stats:{filesChecked:e.filesChecked,symbolsChecked:e.symbolsChecked}}}};var B={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let s=await ze({root:a.root}),e=[];for(let t of s.inconsistencies)e.push({severity:"error",message:`${t.packageName}: ${t.field} mismatch - deno.json: ${JSON.stringify(t.denoValue)}, package.json: ${JSON.stringify(t.packageValue)}`});for(let t of s.dependencyInconsistencies){let c=`${t.packageName}: ${t.dependencyName} - ${t.issue}`;t.expected!==void 0&&t.actual!==void 0&&(c+=` (expected: ${t.expected}, actual: ${t.actual})`),e.push({severity:"error",message:c})}return{name:"validate-package-configs",passed:s.isConsistent,issues:e,stats:{packagesChecked:s.packagesChecked}}}};var tt=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],at=[],st=a=>at.some(s=>s.test(a)),ot=(a,s)=>{let e=a.slice(0,s);return e.includes("//")||e.includes("/*")&&!e.includes("*/")},it=(a,s)=>{let e=!1,t=!1,c=!1;for(let p=0;p<s;p++){let u=a[p];(p>0?a[p-1]:"")!=="\\"&&(u==="'"&&!t&&!c&&(e=!e),u==='"'&&!e&&!c&&(t=!t),u==="`"&&!e&&!t&&(c=!c))}return e||t||c},w=re({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:X,checkFile(a,s){if(s===void 0)return[];if(st(a.path))return[];let e=[],t=s.split(`
3
+ `);for(let c=0;c<t.length;c++){let p=t[c];for(let{pattern:u,replacement:f}of tt){let g=u.exec(p);g!==null&&(ot(p,g.index)||it(p,g.index)||e.push({path:a.path,line:c+1,message:`direct Deno API usage: ${g[0]} \u2014 use @eser/standards/cross-runtime (${f})`}))}}return e}}),St=w.run,Ye=w.validator,$t=w.main;var x={validators:new Map,initialized:!1},nt=()=>{n(J),n(W),n(z),n(Y),n(B),n(le),n(ce),n(me),n(fe),n(ve),n(he),n(be),n(Ve),n(we),n($e),n(Te),n(Fe),n(je),n(Ee),n(Ne),n(Je),n(Ye)},U=()=>{x.initialized||(x.initialized=!0,nt())},n=a=>{x.validators.set(a.name,a)},lt=a=>(U(),x.validators.get(a)??null),E=()=>(U(),[...x.validators.values()]),dt=()=>(U(),[...x.validators.keys()]),ct=a=>({name:a.config.name,description:a.config.description,run:async s=>{let e=await a.run(s);return{name:e.name,passed:e.issues.length===0,issues:e.issues.map(t=>({path:t.path,line:t.line,message:t.message,fixed:t.fixed})),mutations:e.mutations.map(t=>({path:t.path,oldContent:t.oldContent,newContent:t.newContent})),stats:{filesChecked:e.filesChecked,issuesFound:e.issues.length}}}}),pt=a=>({name:a.name,description:a.description,run:async s=>{let e=await a.validate({root:s.root??".",options:s});return{name:e.name,passed:e.passed,issues:e.issues.map(t=>({path:t.file,line:t.line,message:t.message})),mutations:[],stats:e.stats}}}),mt=()=>{let a=[],s=[ne,de,pe,ue,ge,ye,ke,xe,Ce,Se,Re,De,Pe,Ie,Me,_e,w];for(let t of s)a.push(ct(t));let e=[J,W,z,Y,B];for(let t of e)a.push(pt(t));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async t=>{let c=t.commitMsgFile??t._args?.[0]??".git/COMMIT_EDITMSG",{runtime:p}=await import("./mod-4XKQZL6W.js"),u;try{u=await p.fs.readTextFile(c)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${c}`}],mutations:[],stats:{}}}let f=Oe(u,{allowAsterisk:t.allowAsterisk,allowMultipleScopes:t.allowMultipleScopes,forceScope:t.forceScope,types:t.types});return{name:"validate-commit-msg",passed:f.valid,issues:f.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ut=8,Zt=async(a={})=>{let s=a.root??j.process.cwd(),t=(await I(s))?.stack??[],c=[...a.skip??[]],p=a.only??[],u=E(),f=[],g=[],S=[];for(let i of u){if(p.length>0&&!p.includes(i.name))continue;if(c.includes(i.name)){S.push(i.name);continue}if(i.requiredStacks.length>0&&t.length>0&&!i.requiredStacks.some(G=>t.includes(G))){g.push({name:i.name,reason:`Requires '${i.requiredStacks.join("' or '")}' stack`});continue}let $={...a.fix!==void 0?{fix:a.fix}:{}},h=await i.validate({root:s,options:$});f.push(h)}return{passed:f.every(i=>i.passed),results:f,skipped:g,disabled:S}},ea=async a=>{let s=K(a??j.process.args,{string:["root","only","skip"],boolean:["fix","help","json","yes"],alias:{h:"help",y:"yes"}});if(s.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -y, --yes Auto-confirm all fix prompts (no interactive prompts)"),console.log(" --json Output results as JSON (suppresses TUI output)"),console.log(" -h, --help Show this help message"),P(void 0);let e=s.json,t=s.yes,c=s.root,p=s.fix,u=s.only,f=s.skip,g=u!==void 0?u.split(",").map(o=>o.trim()):[],S=f!==void 0?f.split(",").map(o=>o.trim()):[],{ctx:i}=e?{ctx:Z({interaction:"non-interactive"})}:ie(),$=i.interaction==="interactive",h=c??j.process.cwd();e||ae(i,"Validating codebase...");let M=e?void 0:se(i,"Loading config...");M?.start();let R=(await I(h))?.stack??[],Be=R.length>0?R.join(", "):"all (no .eser/manifest.yml)";M?.succeed("Config loaded"),e||m.info(i,`Stack: ${Be}`);let Ue=E(),k=[],T=[],D=[];for(let o of Ue)if(!(g.length>0&&!g.includes(o.name))){if(S.includes(o.name)){D.push(o.name);continue}if(o.requiredStacks.length>0&&R.length>0&&!o.requiredStacks.some(d=>R.includes(d))){T.push({name:o.name,reason:`Requires '${o.requiredStacks.join("' or '")}' stack`});continue}k.push(o)}let V=[],N=e?void 0:oe(i,{total:k.length,label:"Validating..."});N?.start();let O=o=>{if(V.push(o),!e){let l=Object.entries(o.stats).map(([r,y])=>`${y} ${r}`).join(", "),d=`${o.name.padEnd(18)} (${l})`;o.passed?m.success(i,`PASS ${d}`):m.error(i,`FAIL ${d}`)}N?.advance(1)};if(p)for(let o of k){let l=await o.validate({root:h,options:{}}),d=l;if(!l.passed){let r=!0;if($&&!t&&!e){let y=l.issues.length,v=await ee(i,{message:`Fix ${y} issue(s) found by ${o.name}?`,initialValue:!0});(q(v)||!v)&&(r=!1)}r&&(d=await o.validate({root:h,options:{fix:!0}}))}O(d)}else{let o=0,l=async()=>{for(;o<k.length;){let y=o++,v=k[y];if(v===void 0)break;try{let b=await v.validate({root:h,options:{}});O(b)}catch(b){let Ge={name:v.name,passed:!1,issues:[{severity:"error",message:String(b)}],stats:{filesChecked:0,issuesFound:1,fixedCount:0}};O(Ge)}}},d=Math.min(ut,k.length),r=Array.from({length:d},()=>l());await Promise.allSettled(r)}if(N?.stop("Validation complete"),!e&&T.length>0){m.step(i,"Skipped (stack not configured):");for(let o of T)m.step(i,` - ${o.name}: ${o.reason}`)}if(!e&&D.length>0){m.step(i,"Disabled:");for(let o of D)m.step(i,` - ${o}`)}let C=V.flatMap(o=>o.issues.map(l=>({validator:o.name,...l})));if(!e&&C.length>0){m.warn(i,`Issues (${C.length}):`);let o=new Map;for(let l of C){let d=l.file??l.validator,r=o.get(d)??[];r.push(l),o.set(d,r)}for(let[l,d]of o){m.step(i,` ${l}`);for(let r of d){let y=r.severity==="error"?"error":"warning",v=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${y}${v}: ${r.message}`):m.warn(i,` ${y}${v}: ${r.message}`)}}}let F=V.filter(o=>!o.passed);if(!e&&$&&F.length>0)for(;;){let o=[...F.map(r=>({value:r.name,label:`${r.name} (${r.issues.length} issue(s))`})),{value:"__done__",label:"Done"}],l=await te(i,{message:"View details for which validator?",options:o});if(q(l)||l==="__done__")break;let d=F.find(r=>r.name===l);if(d!==void 0){m.info(i,`Details for ${d.name} (${d.issues.length} issue(s)):`);for(let r of d.issues){let y=r.severity==="error"?"error":"warning",v=r.file??d.name,b=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${v}${b} [${y}]: ${r.message}`):m.warn(i,` ${v}${b} [${y}]: ${r.message}`)}}}if(e){let o=V.every(d=>d.passed),l=JSON.stringify({passed:o,results:V,skipped:T,disabled:D},null,2);return console.log(l),o?P(void 0):L({message:"",exitCode:1})}let A=F.length;return A>0?(_(i,`${A} check(s) failed with ${C.length} issue(s)`),L({message:`${A} check(s) failed with ${C.length} issue(s)`,exitCode:1})):(_(i,"All checks passed!"),P(void 0))};export{Ke as getProjectConfigPath,lt as getValidator,dt as getValidatorNames,E as getValidators,mt as getWorkflowTools,I as loadProjectConfig,ea as main,n as registerValidator,Zt as validate};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-PPSDIDOI.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-GWZUQPFD.js";import{a as A,b as C}from"./chunk-JUOSGSVB.js";import{a as M,b as w}from"./chunk-EKUJSZIR.js";import{a as I,b as T}from"./chunk-A2IW6BXT.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-BJLUDX4R.js";import"./chunk-J7YTWK67.js";import"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-QBGNUIP3.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-S2SGKOBE.js"),{ollamaFactory:c}=await import("./ollama-IRQSLTDB.js"),{openCodeFactory:n}=await import("./opencode-74XXXUQ2.js"),{kiroFactory:p}=await import("./kiro-LNQTCWQU.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
2
+ import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-PPSDIDOI.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-EQUPVWVY.js";import{a as A,b as C}from"./chunk-FNPBHLLZ.js";import{a as M,b as w}from"./chunk-LJ7A5HYR.js";import{a as I,b as T}from"./chunk-C2IORZTF.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-QBGNUIP3.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-UJYCO6CN.js"),{ollamaFactory:c}=await import("./ollama-DFG5G467.js"),{openCodeFactory:n}=await import("./opencode-UA45VV3W.js"),{kiroFactory:p}=await import("./kiro-V6SMU4OL.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as T,h as J}from"./chunk-6PRIUPN4.js";import{a as S}from"./chunk-3IZX4OZ7.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
2
+ import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
3
3
  "./${t.relativePath}",
4
4
  "default"
5
5
  );`:`export const ${n} = createClientReference(
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,q as o,r as p,s as q,t as r}from"./chunk-HVTJ5LVU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{j as chunkToInlineScript,l as createInlineRSCStream,k as createInlineTransformStream,q as createReactHtmlShellBuilder,o as createReactRenderer,m as generateInlineBootstrapScript,n as generateInlineCompletionScript,c as generateRSCPayloadScript,e as loadModuleMap,r as reactHtmlShellBuilder,p as reactRenderer,i as renderApp,f as renderRSC,h as renderRSCResponse,a as renderSSR,d as renderToReadableStream,b as serializeRSCPayload,g as streamToResponse};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,q as o,r as p,s as q,t as r}from"./chunk-FZ5WFU6R.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{j as chunkToInlineScript,l as createInlineRSCStream,k as createInlineTransformStream,q as createReactHtmlShellBuilder,o as createReactRenderer,m as generateInlineBootstrapScript,n as generateInlineCompletionScript,c as generateRSCPayloadScript,e as loadModuleMap,r as reactHtmlShellBuilder,p as reactRenderer,i as renderApp,f as renderRSC,h as renderRSCResponse,a as renderSSR,d as renderToReadableStream,b as serializeRSCPayload,g as streamToResponse};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-ZC4F4MYU.js";import{q as f}from"./chunk-YVN2NZL4.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as PipelineError,a as StreamError,c as TimeoutError,d as createChunk,e as defineLayer,k as layers,g as output,h as pipeline,l as renderers,i as sinks,j as sources,f as span};
2
+ import{a,b,c,d,e,f as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-SHN5MT56.js";import{q as f}from"./chunk-YVN2NZL4.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{b as PipelineError,a as StreamError,c as TimeoutError,d as createChunk,e as defineLayer,k as layers,g as output,h as pipeline,l as renderers,i as sinks,j as sources,f as span};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-3QF3I2RD.js";import"./chunk-3IZX4OZ7.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as n}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var h=q.getLogger(["laroux","image-optimizer"]),$=null;async function j(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var F={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function B(i){let r=[],o=["jpg","jpeg","png","gif","webp"];async function a(t){try{for await(let e of n.fs.readDir(t)){let s=n.path.resolve(t,e.name);e.isDirectory?await a(s):e.isFile&&S(e.name.toLowerCase(),o)&&r.push(s)}}catch{}}return await a(i),r}async function E(i,r){return`data:image/webp;base64,${(await(await j())(i).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function C(i,r,o,a={}){let t=await j(),e={...F,...a},s=t(i),l=await s.metadata();if(l.width===void 0||l.height===void 0)throw new Error(`Could not read image dimensions: ${i}`);let u=l.width,w=l.height,y=u/w,m=n.path.extname(i),p=m.slice(1).toLowerCase(),f=n.path.basename(i,m),x=`${o}/${f}`,I=[];for(let c of e.widths){if(c>u)continue;let O=Math.round(c/y);for(let b of e.formats){let z,d;b==="original"?(d=p,z=n.path.resolve(r,`${f}-${c}w.${p}`)):(d=b,z=n.path.resolve(r,`${f}-${c}w.${b}`)),await n.fs.ensureDir(n.path.dirname(z));let g=s.clone().resize(c,O,{fit:"cover"});b==="webp"?g=g.webp({quality:e.quality.webp}):b==="avif"?g=g.avif({quality:e.quality.avif}):d==="jpg"||d==="jpeg"?g=g.jpeg({quality:e.quality.jpeg}):d==="png"&&(g=g.png({quality:e.quality.png}));let P=await g.toBuffer();await n.fs.writeFile(z,P),I.push({path:z,format:d,width:c,height:O,size:P.length})}}let v;return e.generateBlurPlaceholder&&(v=await E(i,e.placeholderWidth)),{originalPath:i,publicPath:x,originalWidth:u,originalHeight:w,variants:I,blurDataUrl:v,aspectRatio:y}}async function V(i,r,o="/images",a={}){h.info(`Scanning for images in ${i}...`);let t=await B(i);if(t.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${t.length} image(s) to optimize`);let e={},s=0,l=0;for(let m of t)try{let p=await n.fs.stat(m);s+=p.size;let f=await C(m,r,o,a);e[m]=f;let x=f.variants.reduce((I,v)=>I+v.size,0);l+=x,h.debug(`Optimized: ${n.path.basename(m)} \u2192 ${f.variants.length} variants`)}catch(p){h.warn(`Failed to optimize ${m}: ${p instanceof Error?p.message:String(p)}`)}let u={timestamp:Date.now(),images:e},w=n.path.resolve(r,"image-manifest.json");await n.fs.ensureDir(n.path.dirname(w)),await n.fs.writeTextFile(w,JSON.stringify(u,null,2));let y=s>0?((1-l/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${t.length} images, ${y}% size reduction`),u}function M(i,r="webp"){return i.variants.filter(a=>a.format===r).sort((a,t)=>a.width-t.width).map(a=>`${a.path} ${a.width}w`).join(", ")}function D(i,r,o="webp"){let a=i.variants.filter(t=>t.format===o).sort((t,e)=>t.width-e.width);return a.find(t=>t.width>=r)??a.at(-1)}export{M as generateSrcset,D as getBestVariant,C as optimizeImage,V as optimizeImages,B as scanImages};
2
+ import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as n}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var h=q.getLogger(["laroux","image-optimizer"]),$=null;async function j(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var F={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function B(i){let r=[],o=["jpg","jpeg","png","gif","webp"];async function a(t){try{for await(let e of n.fs.readDir(t)){let s=n.path.resolve(t,e.name);e.isDirectory?await a(s):e.isFile&&S(e.name.toLowerCase(),o)&&r.push(s)}}catch{}}return await a(i),r}async function E(i,r){return`data:image/webp;base64,${(await(await j())(i).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function C(i,r,o,a={}){let t=await j(),e={...F,...a},s=t(i),l=await s.metadata();if(l.width===void 0||l.height===void 0)throw new Error(`Could not read image dimensions: ${i}`);let u=l.width,w=l.height,y=u/w,m=n.path.extname(i),p=m.slice(1).toLowerCase(),f=n.path.basename(i,m),x=`${o}/${f}`,I=[];for(let c of e.widths){if(c>u)continue;let O=Math.round(c/y);for(let b of e.formats){let z,d;b==="original"?(d=p,z=n.path.resolve(r,`${f}-${c}w.${p}`)):(d=b,z=n.path.resolve(r,`${f}-${c}w.${b}`)),await n.fs.ensureDir(n.path.dirname(z));let g=s.clone().resize(c,O,{fit:"cover"});b==="webp"?g=g.webp({quality:e.quality.webp}):b==="avif"?g=g.avif({quality:e.quality.avif}):d==="jpg"||d==="jpeg"?g=g.jpeg({quality:e.quality.jpeg}):d==="png"&&(g=g.png({quality:e.quality.png}));let P=await g.toBuffer();await n.fs.writeFile(z,P),I.push({path:z,format:d,width:c,height:O,size:P.length})}}let v;return e.generateBlurPlaceholder&&(v=await E(i,e.placeholderWidth)),{originalPath:i,publicPath:x,originalWidth:u,originalHeight:w,variants:I,blurDataUrl:v,aspectRatio:y}}async function V(i,r,o="/images",a={}){h.info(`Scanning for images in ${i}...`);let t=await B(i);if(t.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${t.length} image(s) to optimize`);let e={},s=0,l=0;for(let m of t)try{let p=await n.fs.stat(m);s+=p.size;let f=await C(m,r,o,a);e[m]=f;let x=f.variants.reduce((I,v)=>I+v.size,0);l+=x,h.debug(`Optimized: ${n.path.basename(m)} \u2192 ${f.variants.length} variants`)}catch(p){h.warn(`Failed to optimize ${m}: ${p instanceof Error?p.message:String(p)}`)}let u={timestamp:Date.now(),images:e},w=n.path.resolve(r,"image-manifest.json");await n.fs.ensureDir(n.path.dirname(w)),await n.fs.writeTextFile(w,JSON.stringify(u,null,2));let y=s>0?((1-l/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${t.length} images, ${y}% size reduction`),u}function M(i,r="webp"){return i.variants.filter(a=>a.format===r).sort((a,t)=>a.width-t.width).map(a=>`${a.path} ${a.width}w`).join(", ")}function D(i,r,o="webp"){let a=i.variants.filter(t=>t.format===o).sort((t,e)=>t.width-e.width);return a.find(t=>t.width>=r)??a.at(-1)}export{M as generateSrcset,D as getBestVariant,C as optimizeImage,V as optimizeImages,B as scanImages};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as b,b as S}from"./chunk-HP5W5XT6.js";import{e as C}from"./chunk-F35K7YVH.js";import{a as A,d as E}from"./chunk-P2MUEKFT.js";import{k as w}from"./chunk-TEOMM3RD.js";import{f as k,h as R,k as $}from"./chunk-ZC4F4MYU.js";import{d as m,f as j,g as h,k as v}from"./chunk-YVN2NZL4.js";import{a as P}from"./chunk-MG65QJY6.js";import{a as g,b as p,c as N}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var x=r=>A(async t=>{try{let s=await w(r.registrySource,{local:r.local}),a=s.recipes.filter(n=>n.scale==="project"),o=a.find(n=>n.name===r.templateName);if(o===void 0)return p({_tag:"TemplateNotFound",message:`Template '${r.templateName}' not found. Available: ${a.map(n=>n.name).join(", ")}`});await y.fs.mkdir(r.targetDir,{recursive:!0});let f={project_name:r.projectName,...r.variables},e=await C(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:f}),u=await b(r.targetDir),d=S(o,u);t.out.writeln(h(`\u2713 Created ${r.projectName} with ${e.written.length} file(s)`));for(let n of e.written)t.out.writeln(` \u2192 ${n}`);if(d.instructions.length>0){t.out.writeln(m(`
2
+ import{a as b,b as S}from"./chunk-ZNP3NXAD.js";import{e as C}from"./chunk-X3L6GBUX.js";import{a as A,d as E}from"./chunk-P2MUEKFT.js";import{k as w}from"./chunk-NMSD4ZXJ.js";import{f as k,h as R,k as $}from"./chunk-SHN5MT56.js";import{d as m,f as j,g as h,k as v}from"./chunk-YVN2NZL4.js";import{a as P}from"./chunk-MG65QJY6.js";import{a as g,b as p,c as N}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var x=r=>A(async t=>{try{let s=await w(r.registrySource,{local:r.local}),a=s.recipes.filter(n=>n.scale==="project"),o=a.find(n=>n.name===r.templateName);if(o===void 0)return p({_tag:"TemplateNotFound",message:`Template '${r.templateName}' not found. Available: ${a.map(n=>n.name).join(", ")}`});await y.fs.mkdir(r.targetDir,{recursive:!0});let f={project_name:r.projectName,...r.variables},e=await C(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:f}),u=await b(r.targetDir),d=S(o,u);t.out.writeln(h(`\u2713 Created ${r.projectName} with ${e.written.length} file(s)`));for(let n of e.written)t.out.writeln(` \u2192 ${n}`);if(d.instructions.length>0){t.out.writeln(m(`
3
3
  Next steps:`)),t.out.writeln(m(` cd ${r.projectName}`));for(let n of d.instructions)t.out.writeln(m(` ${n}`))}return g({template:o,result:e,depInfo:d})}catch(s){let a=s instanceof Error?s.message:String(s);return p({_tag:"ApplyError",message:a})}});var G=async r=>{let t=P(r??[],{string:["name","registry","var"],boolean:["local"],collect:["var"]}),s=t._[0],a=t.name??s,o=t.registry,f=t.local===!0,e=k({renderer:$.ansi(),sink:R.stdout()}),u={};for(let c of t.var){let[i,...l]=String(c).split("=");i!==void 0&&i!==""&&(u[i]=l.join("="))}if(s===void 0){try{let i=(await w(o,{local:f})).recipes.filter(l=>l.scale==="project");e.writeln("Usage: eser kit new <template> [--name <project-name>] [--var key=value]"),e.writeln(),e.writeln("Available project templates:"),e.writeln();for(let l of i)e.writeln(` ${l.name.padEnd(20)} ${l.description} `,m(`[${l.language}]`))}catch(c){let i=c instanceof Error?c.message:String(c);e.writeln(j(`Error: ${i}`))}return await e.close(),g(void 0)}if(a===void 0)return e.writeln(j("Project name is required.")),await e.close(),p({exitCode:1});e.writeln(v(`
4
4
  Creating ${a} from ${s}...
5
5
  `));let d=`${y.process.cwd()}/${a}`,n=await E(x({templateName:s,projectName:a,targetDir:d,registrySource:o,local:f,variables:u}),{out:e});return await e.close(),N(n)?g(void 0):p({exitCode:1})};export{G as main};
@@ -0,0 +1,9 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as ye}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as ge,b as he,c as Se,d as K}from"./chunk-RBQ2FOSL.js";import{a as z}from"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{a as ve,b as we,d as C}from"./chunk-2ZYCRMUT.js";import{a as Y,b as B,d as X}from"./chunk-L7ROACZC.js";import{a as be}from"./chunk-U34MRDPH.js";import{a as _}from"./chunk-IZUADMIU.js";import{a as Pe,b as Ae,c as Ee,d as Fe}from"./chunk-43E7ZXUB.js";import{h as V}from"./chunk-L32KHQVT.js";import{a as xe,b as Ie,e as Z,f as ee,g as De,h as te,i as O,j as se,k as q,l as ne,m as Ce,o as ke,q as ie,r as Re}from"./chunk-FXDWRGGR.js";import{a as ae,c as F,e as ce,f as le,i as de,j as pe,k as ue,o as me,q as M,v as G,z as fe}from"./chunk-RBU3HF66.js";import{c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as N,b as A}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Te=a=>a.split(`
3
+ `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),Le=async(a,e)=>{let r=[],n=(e.startsWith(a)?e.slice(a.length+1):e).split("/");n.pop();for(let s=n.length;s>=0;s--){let c=`${s===0?a:`${a}/${n.slice(0,s).join("/")}`}/.folder-rules.md`,i=s===0?".":n.slice(0,s).join("/");try{let l=await y.fs.readTextFile(c),d=Te(l);for(let o of d)r.push({folder:i,rule:o})}catch{}}return r},re=async(a,e)=>{let r=new Set,p=[];for(let n of e){let s=await Le(a,n);for(let t of s){let c=`${t.folder}::${t.rule}`;r.has(c)||(r.add(c),p.push(t))}}return p};var ot=async a=>{let e=y.process.cwd(),r=ve(a),p=we(a);if(!await fe(e))return await C({error:`noskills not initialized. Run: ${j("init")}`},r),A({exitCode:1});let n=null;for(let m of p)m.startsWith("--answer=")&&(n=m.slice(9));let s=le(p),t;try{t=await ce(e,s)}catch(m){let f=m instanceof Error?m.message:String(m);return await C({error:f},r),A({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="FREE"&&t.phase!=="COMPLETED")return await C({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),A({exitCode:1});let c=await ue(e);if(c?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-QE4P4DS4.js");m(c.command)}if(c===null)return await C({error:"No config found"},r),A({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let m=`${e}/${F.specDir(t.spec)}`;try{await y.fs.stat(m)}catch{return await C({error:!0,message:`Active spec '${t.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${j("reset")}\` to return to IDLE, or \`${j("cancel")}\` to mark as cancelled.`},r),A({exitCode:1})}}let i=ye(p,c);t.phase==="DISCOVERY"&&t.discovery.audience!==i&&(t={...t,discovery:{...t.discovery,audience:i}});let d=(await me(e)).filter(m=>c.concerns.includes(m.id));if(n!==null){let m=await V(e),f=await Ne(e,t,c,d,n,m);await M(e,f);let g={...f,lastCalledAt:new Date().toISOString()};await M(e,g);let R=y.env.get("NOSKILLS_SESSION")??null;R!==null&&await G(e,R,g.phase);let H=await Y(e),L=B(H,g.phase),U=g.spec!==null?await _(e,g.spec):null,v=await Oe(e,g),k=await re(e,v),b=X(c?.tools??[]),D=await V(e),I=await K(g,d,L,c,U,k,void 0,b,D),S=n.trim().toLowerCase()==="save",P=g.phase===t.phase;if(S&&P&&(g.phase==="SPEC_DRAFT"||g.phase==="SPEC_APPROVED")){let Q=g.phase==="SPEC_DRAFT"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',$e={...I,instruction:Q,saved:!0};return await C($e,r),N(void 0)}return await C(I,r),N(void 0)}let o={...t,lastCalledAt:new Date().toISOString()};await M(e,o);let u=y.env.get("NOSKILLS_SESSION")??null;u!==null&&await G(e,u,o.phase);let h=await Y(e),w=B(h,o.phase),x=o.spec!==null?await _(e,o.spec):null,W=await Oe(e,o),$=await re(e,W),E;o.phase==="IDLE"&&(E={existingSpecs:(await pe(e)).map(f=>({name:f.name,phase:f.state.phase,iteration:f.state.execution.iteration,detail:f.state.phase==="EXECUTING"?`${f.state.execution.completedTasks.length} tasks done, iteration ${f.state.execution.iteration}`:f.state.phase==="SPEC_DRAFT"?"awaiting approval":f.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let J=X(c?.tools??[]),T=await V(e),oe=await K(o,d,w,c,x,$,E,J,T);return await C(oe,r),N(void 0)},Ne=async(a,e,r,p,n,s)=>{switch(e.phase){case"DISCOVERY":{let t=e.specDescription!==null&&e.specDescription.length>0,c=e.discovery.mode;if(c===void 0&&t)return["full","validate","technical-depth","ship-fast","explore"].includes(n)?Z(e,n):Z(e,"full");let i=e.discovery.premisesCompleted===!0;if(c!==void 0&&!i){try{let u=JSON.parse(n);if(u!==null&&typeof u=="object"&&"premises"in u){let w=u.premises.map(x=>({text:x.text??"",agreed:x.agreed??!0,revision:x.revision,user:s?.name??"Unknown User",timestamp:new Date().toISOString()}));return ee(e,w)}}catch{}return ee(e,[])}let l=e.discovery.audience==="agent",d=null;try{let u=JSON.parse(n);typeof u=="object"&&u!==null&&!Array.isArray(u)&&(l?ge.map(x=>x.id).every(x=>x in u)&&(d=u):d=u)}catch{}let o=e;if(d!==null)for(let[u,h]of Object.entries(d))typeof h=="string"&&h.length>0&&(o=O(o,u,h,s));else{let u=he(p),h=o.discovery.currentQuestion,w=u[h];if(w===void 0)return e;o=O(o,w.id,n,s),o=Ce(o)}return Se(o.discovery.answers)&&(o=se(o)),o}case"DISCOVERY_REVIEW":{let t=n.trim().toLowerCase();if(t==="approve"){let i=z(e.discovery.answers);return i.detected&&i.proposals.length>=2?ne(e):e.discovery.mode!==void 0?ne(e):q(e)}if(t==="split")return await Me(a,e);if(t==="keep"){let i=ie(e,{id:`decision-split-keep-${Date.now()}`,question:"Split spec into separate areas?",choice:"Chose to keep as single spec despite multiple areas detected",promoted:!1,timestamp:new Date().toISOString()});return q(i)}let c=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!c){let i;if(t==="skip"||t==="none")i=te(e);else{let l=!1;try{let d=JSON.parse(n);if(d!==null&&typeof d=="object"&&"approach"in d){let o={id:String(d.approach),name:String(d.name??d.approach),summary:String(d.summary??""),effort:String(d.effort??""),risk:String(d.risk??""),user:s?.name??"Unknown User",timestamp:new Date().toISOString()};i=De(e,o),l=!0}}catch{}l||(i=te(e))}return q(i)}try{let i=JSON.parse(n);if(typeof i.revise=="object"&&i.revise!==null){let l=e;for(let[d,o]of Object.entries(i.revise))typeof o=="string"&&o.length>0&&(l=O(l,d,o,s));return l}}catch{}return e}case"SPEC_DRAFT":{if(n.trim().toLowerCase()==="save")return e;if(e.classification===null){let t,c=n.trim().toLowerCase();if(c==="none"||c==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let l=JSON.parse(n);t={involvesWebUI:l.involvesWebUI===!0||l.involvesUI===!0,involvesCLI:l.involvesCLI===!0||l.involvesUI===!0,involvesPublicAPI:l.involvesPublicAPI===!0,involvesMigration:l.involvesMigration===!0,involvesDataHandling:l.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let i={...e,classification:t};try{await be(a,i,p)}catch{}return i}try{let t=JSON.parse(n);if(typeof t.refinement=="string"&&t.refinement.length>0){let c=t.refinement;if(e.spec!==null){let i=`${a}/${F.specFile(e.spec)}`,l=await y.fs.readTextFile(i);if(c.includes("task-")){let o=je(c).map(w=>`- [ ] ${w}`).join(`
4
+ `),u=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,h=l.replace(u,`## Tasks
5
+
6
+ ${o}
7
+ `);await y.fs.writeTextFile(i,h)}}return e}}catch{}return e}case"SPEC_APPROVED":{if(n.trim().toLowerCase()==="save")return e;let t=ke(e);return t.spec!==null&&(await Pe(a,t.spec,"executing"),await Fe(a,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let c=await Ve(a,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:c}},!c.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await qe(a,e,n,p)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",c={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=ie(e,c);return i=xe(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},Me=async(a,e)=>{let r=z(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let p=[];for(let s of r.proposals){let t=`${a}/${F.specDir(s.name)}`;await y.fs.mkdir(t,{recursive:!0});let c=e.discovery.answers.filter(d=>s.relevantAnswers.includes(d.questionId)),l=Ie(ae(),s.name,`spec/${s.name}`);for(let d of c)l=O(l,d.questionId,d.answer);l=se(l),await de(a,s.name,l),p.push(s.name)}return Re(e,"cancelled",`Split into: ${p.join(", ")}`)},je=a=>a.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),qe=async(a,e,r,p)=>{let n;try{n=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let s=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let k=e.execution.debt.items.map((I,S)=>({id:`legacy-${S+1}`,text:I,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:k}}};let b=new TextEncoder,D=y.process.stderr.getWriter();await D.write(b.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
8
+ `)),D.releaseLock()}let t=new Set(["mandatory-tests","mandatory-docs"]),i=(n.na??[]).filter(v=>t.has(v));if(i.length>0)return{...s,execution:{...s.execution,lastProgress:`REJECTED: Tests and documentation ACs require explicit justification to mark as N/A. Explain why tests or docs are not needed for this spec. Rejected IDs: ${i.join(", ")}`,awaitingStatusReport:!0}};let l=n.completed??[],d=new Set(l),o=n.na??[],u=new Set(o),h=n.newIssues??[],w=n.remaining??[],x=n.blocked??[],W=s.execution.debt?.unaddressedIterations??0,$=s.execution.debt!==null?s.execution.debt.items.filter(v=>!d.has(v.id)&&!u.has(v.id)):[],E=s.execution.debtCounter??0,J=h.map((v,k)=>({id:`debt-${E+k+1}`,text:v,since:s.execution.iteration})),T=[...$,...J],m=w.length===0&&x.length===0&&h.length===0||T.length===0?null:{items:T,fromIteration:s.execution.debt?.fromIteration??s.execution.iteration,unaddressedIterations:$.length>0?W+1:1},f=[...new Set([...s.execution.naItems??[],...o])],g=[];l.length>0&&g.push(`Completed: ${l.join(", ")}`),o.length>0&&g.push(`N/A: ${o.join(", ")}`);let R=g.length>0?g.join("; "):"Status report submitted",H=s.execution.lastVerification===null||s.execution.lastVerification.passed===!0,L=m===null&&H,U=E+h.length;if(L&&s.spec!==null){let v=await _(a,s.spec);if(v!==null){let k=s.execution.completedTasks??[],b=new Set(k),D=[];try{let S=JSON.parse(s.execution.lastProgress??"");Array.isArray(S.completed)&&(D=S.completed.filter(P=>!b.has(P)&&v.tasks.some(Q=>Q.id===P)))}catch{}if(D.length===0){let S=v.tasks.find(P=>!b.has(P.id));S!==void 0&&(D=[S.id])}let I=[];for(let S of D)await Ae(a,s.spec,S),await Ee(a,s.spec,S,"done"),I.push(S);if(I.length>0){let S=I.length===1?`Task ${I[0]} accepted`:`Tasks ${I.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${S}: ${R}`,awaitingStatusReport:!1,debt:m,completedTasks:[...k,...I],debtCounter:U,naItems:f}}}}}return{...s,execution:{...s.execution,lastProgress:L?R:`Task not accepted \u2014 remaining items must be addressed first. ${R}`,awaitingStatusReport:!1,debt:m,debtCounter:U,naItems:f}}},Ve=async(a,e)=>{try{let{execSync:r}=await import("node:child_process"),p=r(e,{cwd:a,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(p).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let p=r,n=((p.stdout??"")+(p.stderr??"")).slice(0,4e3);return p.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${r instanceof Error?r.message:String(r)}`,timestamp:new Date().toISOString()}}},Oe=async(a,e)=>{let r=[...e.execution.modifiedFiles??[]],p=await _e(a);return[...new Set([...r,...p])]},_e=async a=>{let e=`${a}/${F.stateDir}/files-changed.jsonl`;try{let p=(await y.fs.readTextFile(e)).trim().split(`
9
+ `).filter(Boolean),n=[];for(let s of p)try{let t=JSON.parse(s);n.includes(t.file)||n.push(t.file)}catch{}return n}catch{return[]}};export{Ne as handleAnswer,ot as main,je as parseRefinementTasks};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as h,b as S,c as P,d as w}from"./chunk-VWQLQJVX.js";import{s as c,t as f}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";import*as p from"node:child_process";import l from"node:process";import{Buffer as d}from"node:buffer";import{Readable as C,Writable as g}from"node:stream";var y={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},b=(i,u=[],s)=>new Promise((e,a)=>{let n=p.spawn(i,u,{cwd:s?.cwd,env:s?.env?{...l.env,...s.env}:void 0,stdio:c(s),signal:s?.signal}),o=[],t=[];n.stdout?.on("data",r=>o.push(r)),n.stderr?.on("data",r=>t.push(r)),n.on("error",a),n.on("close",r=>{e({success:r===0,code:r??1,stdout:new Uint8Array(d.concat(o)),stderr:new Uint8Array(d.concat(t))})})}),A=(i,u=[],s)=>{let e=p.spawn(i,u,{cwd:s?.cwd,env:s?.env?{...l.env,...s.env}:void 0,stdio:c(s),signal:s?.signal}),a=[],n=[];e.stdout?.on("data",t=>a.push(t)),e.stderr?.on("data",t=>n.push(t));let o=new Promise((t,r)=>{e.on("error",r),e.on("close",(m,v)=>{t({success:m===0,code:m??1,signal:v??void 0})})});return{pid:e.pid,stdin:e.stdin?g.toWeb(e.stdin):null,stdout:e.stdout?C.toWeb(e.stdout):null,stderr:e.stderr?C.toWeb(e.stderr):null,status:o,output:async()=>{let t=await o;return{success:t.success,code:t.code,stdout:new Uint8Array(d.concat(a)),stderr:new Uint8Array(d.concat(n))}},kill:t=>{e.kill(t)}}},U=()=>({name:"node",version:l.versions.node,capabilities:y,fs:h(),path:S(),exec:f(b,A),env:P(),process:w()});export{y as NODE_CAPABILITIES,U as createNodeRuntime};
2
+ import{a as h,b as S,c as P,d as w}from"./chunk-TW23CULJ.js";import{s as c,t as f}from"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";import*as p from"node:child_process";import l from"node:process";import{Buffer as d}from"node:buffer";import{Readable as C,Writable as g}from"node:stream";var y={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},b=(i,u=[],s)=>new Promise((e,a)=>{let n=p.spawn(i,u,{cwd:s?.cwd,env:s?.env?{...l.env,...s.env}:void 0,stdio:c(s),signal:s?.signal}),o=[],t=[];n.stdout?.on("data",r=>o.push(r)),n.stderr?.on("data",r=>t.push(r)),n.on("error",a),n.on("close",r=>{e({success:r===0,code:r??1,stdout:new Uint8Array(d.concat(o)),stderr:new Uint8Array(d.concat(t))})})}),A=(i,u=[],s)=>{let e=p.spawn(i,u,{cwd:s?.cwd,env:s?.env?{...l.env,...s.env}:void 0,stdio:c(s),signal:s?.signal}),a=[],n=[];e.stdout?.on("data",t=>a.push(t)),e.stderr?.on("data",t=>n.push(t));let o=new Promise((t,r)=>{e.on("error",r),e.on("close",(m,v)=>{t({success:m===0,code:m??1,signal:v??void 0})})});return{pid:e.pid,stdin:e.stdin?g.toWeb(e.stdin):null,stdout:e.stdout?C.toWeb(e.stdout):null,stderr:e.stderr?C.toWeb(e.stderr):null,status:o,output:async()=>{let t=await o;return{success:t.success,code:t.code,stdout:new Uint8Array(d.concat(a)),stderr:new Uint8Array(d.concat(n))}},kill:t=>{e.kill(t)}}},U=()=>({name:"node",version:l.versions.node,capabilities:y,fs:h(),path:S(),exec:f(b,A),env:P(),process:w()});export{y as NODE_CAPABILITIES,U as createNodeRuntime};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-FNPBHLLZ.js";import"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OllamaModel,b as ollamaFactory};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-LJ7A5HYR.js";import"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OpenCodeModel,b as openCodeFactory};
@@ -0,0 +1,6 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{e as T}from"./chunk-L7ROACZC.js";import{c as y,k as F}from"./chunk-RBU3HF66.js";import{b as v}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as P,h as S,k as C}from"./chunk-SHN5MT56.js";import{c as h,d as m,f as w,g as I}from"./chunk-YVN2NZL4.js";import{a as $,b as g}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=r=>{let e=r;if(typeof e?.name!="string"||e.name.length===0)throw new Error("Pack manifest must have a non-empty 'name' field");if(typeof e?.version!="string"||e.version.length===0)throw new Error("Pack manifest must have a non-empty 'version' field");if(typeof e?.description!="string"||e.description.length===0)throw new Error("Pack manifest must have a non-empty 'description' field");return e},U=()=>({installed:[]});var B={name:"typescript",version:"1.0.0",description:"TypeScript best practices",tags:["typescript","types"],rules:["rules/use-strict-types.md","rules/no-any.md","rules/prefer-const.md"],concerns:["concerns/ts-quality.json"]};var L={id:"ts-quality",name:"TypeScript Quality",description:"Enforces TypeScript best practices",extras:[{questionId:"verification",text:"Does the code pass strict TypeScript checks (noEmit, strict mode)?"}],specSections:[],reminders:["Run tsc --noEmit before reporting task complete"],acceptanceCriteria:["TypeScript strict mode passes with zero errors"]};var _={name:"react",version:"1.0.0",description:"React component conventions",tags:["react","frontend"],rules:["rules/component-structure.md","rules/prefer-function-components.md","rules/state-management.md"]};var J={name:"security",version:"1.0.0",description:"Security audit rules",tags:["security","audit"],rules:["rules/no-secrets-in-code.md","rules/validate-input.md","rules/no-eval.md"],concerns:["concerns/security-audit.json"]};var H={id:"security-audit",name:"Security Audit",description:"Security-focused review for every spec",extras:[{questionId:"verification",text:"Has the change been reviewed for injection, XSS, CSRF, and auth bypass?"},{questionId:"scope_boundary",text:"What security boundaries must NOT be crossed?"}],specSections:["Security Review"],reminders:["Check for hardcoded secrets, unsanitized input, and missing auth checks"],acceptanceCriteria:["No hardcoded secrets","All user input validated","Auth checks present on protected routes"]};var ee={"use-strict-types":"Prefer explicit types over inference for function params and returns","no-any":"Never use 'any'. Use 'unknown' when type is genuinely unknown.","prefer-const":"Use const by default, let only when reassignment is needed"},ne={"component-structure":"One component per file. Name file same as component.","prefer-function-components":"Use function components with hooks. No class components.","state-management":"Keep state as close to where it's used as possible."},te={"no-secrets-in-code":"Never hardcode API keys, passwords, or tokens","validate-input":"Validate and sanitize all user input at API boundaries","no-eval":"Never use eval(), new Function(), or equivalent dynamic code execution"},se={manifest:B,ruleContents:ee,concernContents:[L]},re={manifest:_,ruleContents:ne,concernContents:[]},ie={manifest:J,ruleContents:te,concernContents:[H]},x=new Map([["typescript",se],["react",re],["security",ie]]);var K=".eser/packs.json",j=3e4,Ee=async r=>{let e=r?.[0];if(e==="list")return await oe();if(e==="install")return await ce(r?.slice(1));if(e==="uninstall")return await le(r?.slice(1));if(e==="inspect")return await de(r?.slice(1));if(e==="search")return await ue(r?.slice(1));let n=v(),i=P({renderer:C.ansi(),sink:S.stdout()});return i.writeln(`Usage: ${n} pack <list | install <name> | uninstall <name> | inspect <name> | search <query>>`),await i.close(),$(void 0)},D=async r=>{let e=`${r}/${K}`;try{let n=await f.fs.readTextFile(e);return JSON.parse(n)}catch{return U()}},N=async(r,e)=>{let n=`${r}/${K}`;await f.fs.mkdir(`${r}/.eser`,{recursive:!0}),await f.fs.writeTextFile(n,JSON.stringify(e,null,2)+`
3
+ `)},R=r=>x.get(r),M=r=>{let e=r.replace(/^github:/,"").replace(/^gh:/,""),n=e.indexOf("#");if(n===-1)return null;let i=e.slice(0,n),t=e.slice(n+1),l=i.indexOf("/");if(l===-1)return null;let u=i.slice(0,l),c=i.slice(l+1);return u.length===0||c.length===0||t.length===0?null:{owner:u,repo:c,ref:"main",packPath:t}},z=async r=>{let e=M(r);if(e===null)throw new Error(`Invalid pack specifier: ${r}. Expected format: github:owner/repo#pack-name`);let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.ref}/packs/${e.packPath}/pack.json`,i=await globalThis.fetch(n,{signal:AbortSignal.timeout(j)});if(!i.ok)throw new Error(`Could not fetch pack from ${r}. HTTP ${i.status}`);let t=JSON.parse(await i.text());return q(t)},E=async(r,e)=>{let n=M(r);if(n===null)throw new Error(`Invalid pack specifier: ${r}`);let i=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}/packs/${n.packPath}/${e}`,t=await globalThis.fetch(i,{signal:AbortSignal.timeout(j)});if(!t.ok)throw new Error(`Could not fetch ${e} from ${r}. HTTP ${t.status}`);return await t.text()},W=async r=>{let e=`${r}/${y.concernsDir}`,n=0;try{for await(let i of f.fs.readDir(e))if(i.isFile&&i.name.endsWith(".json")){let t=i.name.match(/^(\d+)-/);if(t!==null){let l=parseInt(t[1],10);l>n&&(n=l)}}}catch{}return n+1},A=async(r,e,n)=>{let i=[],t=[],l=[],u=`${r}/${y.rulesDir}`;await f.fs.mkdir(u,{recursive:!0});for(let[p,o]of Object.entries(n.ruleContents)){let a=`pack-${e}-${p}.md`;await f.fs.writeTextFile(`${u}/${a}`,o+`
4
+ `),i.push(a)}if(n.concernContents.length>0){let p=`${r}/${y.concernsDir}`;await f.fs.mkdir(p,{recursive:!0});let o=await W(r);for(let a of n.concernContents){let d=`${String(o).padStart(3,"0")}-${a.id}.json`;await f.fs.writeTextFile(`${p}/${d}`,JSON.stringify(a,null,2)+`
5
+ `),t.push(d),o++}}if(n.folderRuleContents!==void 0)for(let[p,o]of Object.entries(n.folderRuleContents)){let a=`${r}/${p}/.folder-rules.md`;await f.fs.mkdir(`${r}/${p}`,{recursive:!0}),await f.fs.writeTextFile(a,o+`
6
+ `),l.push(`${p}/.folder-rules.md`)}return{name:e,version:n.manifest.version,installedAt:new Date().toISOString(),source:"builtin",rules:i,concerns:t,folderRules:l}},ae=async(r,e,n)=>{let i=n.name,t=[],l=[],u=[],c=`${r}/${y.rulesDir}`;if(await f.fs.mkdir(c,{recursive:!0}),n.rules!==void 0)for(let o of n.rules){let a=await E(e,o),s=o.replace(/^rules\//,"").replace(/\.md$/,""),d=`pack-${i}-${s}.md`;await f.fs.writeTextFile(`${c}/${d}`,a),t.push(d)}if(n.concerns!==void 0&&n.concerns.length>0){let o=`${r}/${y.concernsDir}`;await f.fs.mkdir(o,{recursive:!0});let a=await W(r);for(let s of n.concerns){let d=await E(e,s),k=JSON.parse(d),O=`${String(a).padStart(3,"0")}-${k.id}.json`;await f.fs.writeTextFile(`${o}/${O}`,d),l.push(O),a++}}if(n.folderRules!==void 0)for(let[o,a]of Object.entries(n.folderRules)){let s=await E(e,a),d=`${r}/${o}/.folder-rules.md`;await f.fs.mkdir(`${r}/${o}`,{recursive:!0}),await f.fs.writeTextFile(d,s),u.push(`${o}/.folder-rules.md`)}return{name:i,version:n.version,installedAt:new Date().toISOString(),source:e,rules:t,concerns:l,folderRules:u}},oe=async()=>{let r=P({renderer:C.ansi(),sink:S.stdout()}),e=f.process.cwd(),n=await D(e),i=new Set(n.installed.map(t=>t.name));r.writeln(h("Built-in packs:"));for(let[t,l]of x){let u=Object.keys(l.ruleContents).length,c=l.concernContents.length,p=[];u>0&&p.push(`${u} rules`),c>0&&p.push(`${c} concern${c>1?"s":""}`),r.writeln(" ",h(t.padEnd(16)),m(l.manifest.description),m(` (${p.join(", ")})`))}if(r.writeln(""),r.writeln(h("Installed packs:")),n.installed.length===0)r.writeln(m(" No packs installed."));else for(let t of n.installed){let l=t.installedAt.slice(0,10);r.writeln(" ",i.has(t.name)?I(t.name.padEnd(16)):h(t.name.padEnd(16)),m(`v${t.version}`),m(` (installed ${l})`))}return await r.close(),$(void 0)},ce=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=f.process.cwd(),i=r?.[0];if(i===void 0||i.length===0){let a=v();return e.writeln(w("Please provide a pack name: "),h(`${a} pack install typescript`)),await e.close(),g({exitCode:1})}let t=await D(n),l=i.includes("/")||i.includes(":"),u=l?M(i)?.packPath??i:i;if(t.installed.some(a=>a.name===u))return e.writeln(w(`Pack "${u}" is already installed.`)),e.writeln(m(" Uninstall first to re-install.")),await e.close(),g({exitCode:1});let c;if(l){e.writeln(m(`Fetching pack from ${i}...`));try{let a=await z(i);if(a.requires!==void 0){for(let s of a.requires)if(!t.installed.some(d=>d.name===s)){e.writeln(m(` Installing dependency: ${s}`));let d=R(s);if(d!==void 0){let k=await A(n,s,d);t.installed.push(k)}}}c=await ae(n,i,a)}catch(a){return e.writeln(w(`Failed to install: ${a instanceof Error?a.message:String(a)}`)),await e.close(),g({exitCode:1})}}else{let a=R(i);if(a===void 0)return e.writeln(w(`Unknown pack: ${i}`)),e.writeln(m(` Available built-in packs: ${[...x.keys()].join(", ")}`)),await e.close(),g({exitCode:1});if(a.manifest.requires!==void 0){for(let s of a.manifest.requires)if(!t.installed.some(d=>d.name===s)){e.writeln(m(` Installing dependency: ${s}`));let d=R(s);if(d!==void 0){let k=await A(n,s,d),b=[...t.installed,k];await N(n,{installed:b})}}}c=await A(n,i,a)}let p={installed:[...t.installed,c]};await N(n,p);let o=await F(n);return o!==null&&o.tools.length>0&&(await T(n,o.tools,o),e.writeln(m(" Tool files synced."))),e.writeln(I("\u2714"),` Pack "${c.name}" v${c.version} installed.`),c.rules.length>0&&e.writeln(m(` Rules: ${c.rules.join(", ")}`)),c.concerns.length>0&&e.writeln(m(` Concerns: ${c.concerns.join(", ")}`)),await e.close(),$(void 0)},le=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=f.process.cwd(),i=r?.[0];if(i===void 0||i.length===0){let s=v();return e.writeln(w("Please provide a pack name: "),h(`${s} pack uninstall typescript`)),await e.close(),g({exitCode:1})}let t=await D(n),l=t.installed.find(s=>s.name===i);if(l===void 0)return e.writeln(w(`Pack "${i}" is not installed.`)),await e.close(),g({exitCode:1});let u=[];for(let s of t.installed){if(s.name===i)continue;let d=R(s.name);d?.manifest.requires!==void 0&&d.manifest.requires.includes(i)&&u.push(s.name)}u.length>0&&e.writeln(w(`Warning: pack "${i}" is required by: ${u.join(", ")}`));let c=`${n}/${y.rulesDir}`;for(let s of l.rules)try{await f.fs.remove(`${c}/${s}`)}catch{}let p=`${n}/${y.concernsDir}`;for(let s of l.concerns)try{await f.fs.remove(`${p}/${s}`)}catch{}for(let s of l.folderRules)try{await f.fs.remove(`${n}/${s}`)}catch{}let o={installed:t.installed.filter(s=>s.name!==i)};await N(n,o);let a=await F(n);return a!==null&&a.tools.length>0&&(await T(n,a.tools,a),e.writeln(m(" Tool files synced."))),e.writeln(I("\u2714"),` Pack "${i}" uninstalled.`),await e.close(),$(void 0)},de=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=r?.[0];if(n===void 0||n.length===0){let s=v();return e.writeln(w("Please provide a pack name: "),h(`${s} pack inspect typescript`)),await e.close(),g({exitCode:1})}let i=n.includes("/")||n.includes(":"),t,l=null,u=null;if(i)try{t=await z(n)}catch(s){return e.writeln(w(`Failed to fetch: ${s instanceof Error?s.message:String(s)}`)),await e.close(),g({exitCode:1})}else{let s=R(n);if(s===void 0)return e.writeln(w(`Unknown pack: ${n}`)),await e.close(),g({exitCode:1});t=s.manifest,l=s.ruleContents,u=s.concernContents}e.writeln(h(`Pack: ${t.name}`),m(` v${t.version}`)),e.writeln(`Description: ${t.description}`),t.author!==void 0&&e.writeln(`Author: ${t.author}`),t.tags!==void 0&&t.tags.length>0&&e.writeln(`Tags: ${t.tags.join(", ")}`),e.writeln("");let c=t.rules?.length??0;if(e.writeln(h(`Rules (${c}):`)),l!==null)for(let[s,d]of Object.entries(l))e.writeln(` - ${s}: `,m(`"${d}"`));else if(t.rules!==void 0)for(let s of t.rules){let d=s.replace(/^rules\//,"").replace(/\.md$/,"");e.writeln(` - ${d}`)}let p=t.concerns?.length??0;if(e.writeln(""),e.writeln(h(`Concerns (${p}):`)),u!==null&&u.length>0)for(let s of u)e.writeln(` - ${s.id}: ${s.name}`),s.acceptanceCriteria.length>0&&e.writeln(m(` ACs: "${s.acceptanceCriteria.join('", "')}"`));else p===0&&e.writeln(m(" none"));let o=t.folderRules!==void 0?Object.keys(t.folderRules).length:0;e.writeln(""),e.writeln(`Folder rules: ${o>0?o:"none"}`);let a=t.requires?.length??0;return e.writeln(`Dependencies: ${a>0?t.requires.join(", "):"none"}`),await e.close(),$(void 0)},ue=async r=>{let e=P({renderer:C.ansi(),sink:S.stdout()}),n=r?.[0]?.toLowerCase();if(n===void 0||n.length===0){let c=v();return e.writeln(w("Please provide a search query: "),h(`${c} pack search typescript`)),await e.close(),g({exitCode:1})}e.writeln(h("Matching packs:"));let i=!1;for(let[c,p]of x){let o=p.manifest.tags??[],a=c.includes(n),s=o.some(k=>k.includes(n)),d=p.manifest.description.toLowerCase().includes(n);(a||s||d)&&(e.writeln(" ",h(c.padEnd(16)),m(p.manifest.description),m(" [builtin]")),i=!0)}let t=f.process.cwd(),u=(await F(t))?.packRegistry;if(u!==void 0)try{let c=await globalThis.fetch(u,{signal:AbortSignal.timeout(j)});if(c.ok){let p=JSON.parse(await c.text());for(let o of p.packs){let a=o.tags??[],s=o.name.includes(n),d=a.some(b=>b.includes(n)),k=o.description.toLowerCase().includes(n);(s||d||k)&&(e.writeln(" ",h(o.name.padEnd(16)),m(o.description),m(` [${o.source}]`)),i=!0)}}}catch{}return i||e.writeln(m(` No packs matching "${n}" found.`)),await e.close(),$(void 0)};export{A as installBuiltinPack,ae as installRemotePack,Ee as main,D as readPacksFile,N as writePacksFile};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as D,b as P}from"./chunk-RVJZFWN7.js";import"./chunk-MBCPGD5L.js";import{c as l,j as R,o as x}from"./chunk-YW377352.js";import{a as E}from"./chunk-2XNFZXHY.js";import{a as k,b as C,f as v,o}from"./chunk-ZER2RYWJ.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import{a as d,b as $}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import{e as j}from"./chunk-5WJ6AUNY.js";var S=j(E(),1);var Y=async e=>{let t=a.process.cwd(),n=D(e),s=C({target:n==="agent"?"non-interactive":"interactive"}),u=P(e).includes("--force");if(!u&&n==="agent")return o.error(s,"Purge requires `--force` flag in agent mode."),$({exitCode:1});if(u)return o.step(s,"Purging noskills content..."),await q(t,s),o.success(s,"Purge complete."),d(void 0);let g=(await N(t)).filter(i=>i.exists);if(g.length===0)return o.info(s,"Nothing to remove."),d(void 0);let p=[];for(let i of g){let y=await v(s,{message:i.message});if(k(y))return o.info(s,"Aborted."),d(void 0);p.push({id:i.id,confirmed:y===!0})}let f=p.filter(i=>i.confirmed),I=p.filter(i=>!i.confirmed);if(f.length===0)return o.info(s,"Nothing selected for removal."),d(void 0);let T=new Set(f.map(i=>i.id)),w=[];for(let i of f)await H(t,i.id)?o.step(s,` Removed ${h(i.id)}`):(w.push(i.id),o.step(s,` Failed to remove ${h(i.id)}`));for(let i of I)o.step(s,` Kept ${h(i.id)}`);T.size>0&&await b(t);let M=f.length-w.length;return o.success(s,`Purge complete (${M} of ${g.length} categories removed).`),d(void 0)},N=async e=>{let[t,n,s,r]=await Promise.all([O(e),L(e),J(e),U(e)]);return[t,n,s,r]},O=async e=>{let t=await x(e),n=t.map(s=>s.id).join(", ");return{id:"concerns",exists:t.length>0,message:`Remove concerns? (${n})`}},L=async e=>{let t=await R(e),n=0;try{for await(let c of a.fs.readDir(`${e}/${l.specsDir}`))c.isDirectory&&n++}catch{}let s=Math.max(t.length,n);if(s===0)return{id:"specs",exists:!1,message:""};let r=t.map(c=>`${c.name} ${c.state.phase}`).join(", ");return{id:"specs",exists:!0,message:t.length>0?`Remove specs? (${s} specs: ${r})`:`Remove specs? (${s} spec directories)`}},J=async e=>{let t=0;try{for await(let n of a.fs.readDir(`${e}/${l.rulesDir}`))n.isFile&&t++}catch{}return{id:"rules",exists:t>0,message:`Remove rules? (${t} active rules)`}},U=async e=>{let t=!1,n=!1,s=!1;try{let c=await a.fs.readTextFile(`${e}/.claude/settings.json`);t=JSON.parse(c).hooks!==void 0}catch{}try{n=(await a.fs.readTextFile(`${e}/CLAUDE.md`)).includes("<!-- noskills:start -->")}catch{}let r=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let c of r)try{await a.fs.stat(c),s=!0;break}catch{}return{id:"agent-integration",exists:t||n||s,message:"Remove agent integration? (.claude/settings.json, CLAUDE.md, .claude/agents/noskills-*.md)"}},h=e=>({concerns:"concerns",specs:"specs",rules:"rules","agent-integration":"agent integration"})[e],H=(e,t)=>{switch(t){case"concerns":return m(`${e}/${l.concernsDir}`);case"specs":return z([`${e}/${l.specsDir}`,`${e}/${l.stateDir}`]);case"rules":return m(`${e}/${l.rulesDir}`);case"agent-integration":return A(e)}},q=async(e,t)=>{await m(`${e}/${l.concernsDir}`)&&o.step(t," Removed `.eser/concerns/`"),await m(`${e}/${l.specsDir}`)&&o.step(t," Removed `.eser/specs/`"),await m(`${e}/${l.rulesDir}`)&&o.step(t," Removed `.eser/rules/`"),await m(`${e}/${l.stateDir}`)&&o.step(t," Removed `.eser/.state/`"),await b(e)&&o.step(t," Removed noskills section from `manifest.yml`"),await A(e)&&o.step(t," Removed agent integration")},m=async e=>{try{await a.fs.stat(e);let{rmSync:t}=await import("node:fs");return t(e,{recursive:!0,force:!0}),!0}catch{return!1}},z=async e=>{let t=!1;for(let n of e)await m(n)&&(t=!0);return t},F=async e=>{try{await a.fs.stat(e);let{unlinkSync:t}=await import("node:fs");return t(e),!0}catch{return!1}},b=async e=>{let t=`${e}/${l.manifestFile}`;try{let n=await a.fs.readTextFile(t),s=S.parseDocument(n);return s.has("noskills")?(s.delete("noskills"),await a.fs.writeTextFile(t,s.toString()),!0):!1}catch{return!1}},B=async e=>{let t=`${e}/CLAUDE.md`,n="<!-- noskills:start -->",s="<!-- noskills:end -->";try{let r=await a.fs.readTextFile(t),u=r.indexOf(n),c=r.indexOf(s);return u!==-1&&c!==-1?(r=r.slice(0,u).trimEnd()+`
2
+ import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,j as R,o as x}from"./chunk-RBU3HF66.js";import{a as E}from"./chunk-2XNFZXHY.js";import{a as k,b as C,f as v,o}from"./chunk-4TTJVJEI.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{a as d,b as $}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import{e as j}from"./chunk-5WJ6AUNY.js";var S=j(E(),1);var Y=async e=>{let t=a.process.cwd(),n=D(e),s=C({target:n==="agent"?"non-interactive":"interactive"}),u=P(e).includes("--force");if(!u&&n==="agent")return o.error(s,"Purge requires `--force` flag in agent mode."),$({exitCode:1});if(u)return o.step(s,"Purging noskills content..."),await q(t,s),o.success(s,"Purge complete."),d(void 0);let g=(await N(t)).filter(i=>i.exists);if(g.length===0)return o.info(s,"Nothing to remove."),d(void 0);let p=[];for(let i of g){let y=await v(s,{message:i.message});if(k(y))return o.info(s,"Aborted."),d(void 0);p.push({id:i.id,confirmed:y===!0})}let f=p.filter(i=>i.confirmed),I=p.filter(i=>!i.confirmed);if(f.length===0)return o.info(s,"Nothing selected for removal."),d(void 0);let T=new Set(f.map(i=>i.id)),w=[];for(let i of f)await H(t,i.id)?o.step(s,` Removed ${h(i.id)}`):(w.push(i.id),o.step(s,` Failed to remove ${h(i.id)}`));for(let i of I)o.step(s,` Kept ${h(i.id)}`);T.size>0&&await b(t);let M=f.length-w.length;return o.success(s,`Purge complete (${M} of ${g.length} categories removed).`),d(void 0)},N=async e=>{let[t,n,s,r]=await Promise.all([O(e),L(e),J(e),U(e)]);return[t,n,s,r]},O=async e=>{let t=await x(e),n=t.map(s=>s.id).join(", ");return{id:"concerns",exists:t.length>0,message:`Remove concerns? (${n})`}},L=async e=>{let t=await R(e),n=0;try{for await(let c of a.fs.readDir(`${e}/${l.specsDir}`))c.isDirectory&&n++}catch{}let s=Math.max(t.length,n);if(s===0)return{id:"specs",exists:!1,message:""};let r=t.map(c=>`${c.name} ${c.state.phase}`).join(", ");return{id:"specs",exists:!0,message:t.length>0?`Remove specs? (${s} specs: ${r})`:`Remove specs? (${s} spec directories)`}},J=async e=>{let t=0;try{for await(let n of a.fs.readDir(`${e}/${l.rulesDir}`))n.isFile&&t++}catch{}return{id:"rules",exists:t>0,message:`Remove rules? (${t} active rules)`}},U=async e=>{let t=!1,n=!1,s=!1;try{let c=await a.fs.readTextFile(`${e}/.claude/settings.json`);t=JSON.parse(c).hooks!==void 0}catch{}try{n=(await a.fs.readTextFile(`${e}/CLAUDE.md`)).includes("<!-- noskills:start -->")}catch{}let r=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let c of r)try{await a.fs.stat(c),s=!0;break}catch{}return{id:"agent-integration",exists:t||n||s,message:"Remove agent integration? (.claude/settings.json, CLAUDE.md, .claude/agents/noskills-*.md)"}},h=e=>({concerns:"concerns",specs:"specs",rules:"rules","agent-integration":"agent integration"})[e],H=(e,t)=>{switch(t){case"concerns":return m(`${e}/${l.concernsDir}`);case"specs":return z([`${e}/${l.specsDir}`,`${e}/${l.stateDir}`]);case"rules":return m(`${e}/${l.rulesDir}`);case"agent-integration":return A(e)}},q=async(e,t)=>{await m(`${e}/${l.concernsDir}`)&&o.step(t," Removed `.eser/concerns/`"),await m(`${e}/${l.specsDir}`)&&o.step(t," Removed `.eser/specs/`"),await m(`${e}/${l.rulesDir}`)&&o.step(t," Removed `.eser/rules/`"),await m(`${e}/${l.stateDir}`)&&o.step(t," Removed `.eser/.state/`"),await b(e)&&o.step(t," Removed noskills section from `manifest.yml`"),await A(e)&&o.step(t," Removed agent integration")},m=async e=>{try{await a.fs.stat(e);let{rmSync:t}=await import("node:fs");return t(e,{recursive:!0,force:!0}),!0}catch{return!1}},z=async e=>{let t=!1;for(let n of e)await m(n)&&(t=!0);return t},F=async e=>{try{await a.fs.stat(e);let{unlinkSync:t}=await import("node:fs");return t(e),!0}catch{return!1}},b=async e=>{let t=`${e}/${l.manifestFile}`;try{let n=await a.fs.readTextFile(t),s=S.parseDocument(n);return s.has("noskills")?(s.delete("noskills"),await a.fs.writeTextFile(t,s.toString()),!0):!1}catch{return!1}},B=async e=>{let t=`${e}/CLAUDE.md`,n="<!-- noskills:start -->",s="<!-- noskills:end -->";try{let r=await a.fs.readTextFile(t),u=r.indexOf(n),c=r.indexOf(s);return u!==-1&&c!==-1?(r=r.slice(0,u).trimEnd()+`
3
3
  `+r.slice(c+s.length).trimStart(),await a.fs.writeTextFile(t,r.trimEnd()+`
4
4
  `),!0):!1}catch{return!1}},K=async e=>{let t=`${e}/.claude/settings.json`;try{let n=await a.fs.readTextFile(t),s=JSON.parse(n);return s.hooks!==void 0?(delete s.hooks,await a.fs.writeTextFile(t,JSON.stringify(s,null,2)+`
5
5
  `),!0):!1}catch{return!1}},A=async e=>{let t=!1;await K(e)&&(t=!0),await B(e)&&(t=!0);let n=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let r of n)await F(r)&&(t=!0);let s=[`${e}/.cursorrules`,`${e}/.windsurfrules`,`${e}/.kiro/steering/conventions.md`,`${e}/.github/copilot-instructions.md`];for(let r of s)await F(r)&&(t=!0);return t};export{Y as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f}from"./chunk-F35K7YVH.js";import"./chunk-TEOMM3RD.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{e as applyRecipe,f as applyRecipeChain,b as fileExists,a as isPathSafe,c as processContent,d as runPostInstall};
2
+ import{a,b,c,d,e,f}from"./chunk-X3L6GBUX.js";import"./chunk-NMSD4ZXJ.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as applyRecipe,f as applyRecipeChain,b as fileExists,a as isPathSafe,c as processContent,d as runPostInstall};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-TEOMM3RD.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as DEFAULT_OWNER,d as DEFAULT_REF,f as DEFAULT_REGISTRY_URL,c as DEFAULT_REPO,a as FETCH_TIMEOUT_MS,g as LOCAL_REGISTRY_PATH,e as RECIPES_FILENAME,j as detectLocalRegistry,m as fetchRecipeFile,o as fetchRecipeFolder,p as fetchRecipeFromRepo,k as fetchRegistry,l as fetchRegistryFromRepo,n as parseGitHubRawUrl,i as registryFetch,h as resolveSpecifier};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-NMSD4ZXJ.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{b as DEFAULT_OWNER,d as DEFAULT_REF,f as DEFAULT_REGISTRY_URL,c as DEFAULT_REPO,a as FETCH_TIMEOUT_MS,g as LOCAL_REGISTRY_PATH,e as RECIPES_FILENAME,j as detectLocalRegistry,m as fetchRecipeFile,o as fetchRecipeFolder,p as fetchRecipeFromRepo,k as fetchRegistry,l as fetchRegistryFromRepo,n as parseGitHubRawUrl,i as registryFetch,h as resolveSpecifier};
@@ -1,9 +1,9 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as c}from"./chunk-YBCZC5KZ.js";import"./chunk-26ZFSXSK.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as g}from"./chunk-LFNUSULJ.js";import{a as R,c as f}from"./chunk-LGNGLAV3.js";import{f as w,o as t}from"./chunk-ZER2RYWJ.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as m}from"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{d as a}from"./chunk-BLXGL5MA.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:n,output:A}=R(),x=async()=>(await a`git status --porcelain`.noThrow().text()).length===0,E=async()=>{let e=await a`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
2
+ import{a as c}from"./chunk-XBCL25QR.js";import"./chunk-3D5TBTM3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as g}from"./chunk-LFNUSULJ.js";import{a as R,c as f}from"./chunk-JTSRGXS4.js";import{f as w,o as t}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as m}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{d as a}from"./chunk-GVTM4EOU.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:n,output:A}=R(),x=async()=>(await a`git status --porcelain`.noThrow().text()).length===0,E=async()=>{let e=await a`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
3
3
  `):[]},$=async(e,r)=>{for(let s of r)await a`git add ${s}`.spawn();await a`git commit -m ${e}`.spawn()},P=async()=>{await a`git push origin HEAD`.spawn()},b=async e=>{await a`git tag -d ${e}`.noThrow().spawn();let r=`:refs/tags/${e}`;await a`git push origin ${r}`.noThrow().spawn()},O=async e=>await w(n,{message:e})===!0,k=async e=>{let{type:r,dryRun:s=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit or stash changes first.");let o=await E();if(o.length>0&&e.yes!==!0)throw new Error(`You have ${o.length} unpushed commit(s):
4
4
  ${o.join(`
5
5
  `)}
6
6
 
7
- Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-MFY62V25.js")).versions(r,{dryRun:s});let u=await c()??l,d=!1;try{await(await import("./changelog-gen-TEI4IBNO.js")).generateChangelog({dryRun:s}),d=!0}catch{d=!1}let h=!1,v=!1;if(!s){d&&await a`deno fmt CHANGELOG.md`.noThrow().spawn();let y=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],C=`chore(codebase): release v${u}`;await $(C,y),h=!0,await P(),v=!0}return{version:u,previousVersion:l,changelogGenerated:d,committed:h,pushed:v,dryRun:s}},M=async(e={})=>{let{dryRun:r=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit and push first.");let s=await E();if(s.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
7
+ Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-LJSQVW77.js")).versions(r,{dryRun:s});let u=await c()??l,d=!1;try{await(await import("./changelog-gen-LMXK5T7J.js")).generateChangelog({dryRun:s}),d=!0}catch{d=!1}let h=!1,v=!1;if(!s){d&&await a`deno fmt CHANGELOG.md`.noThrow().spawn();let y=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],C=`chore(codebase): release v${u}`;await $(C,y),h=!0,await P(),v=!0}return{version:u,previousVersion:l,changelogGenerated:d,committed:h,pushed:v,dryRun:s}},M=async(e={})=>{let{dryRun:r=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit and push first.");let s=await E();if(s.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
8
8
  ${s.join(`
9
9
  `)}`);let o=await c();if(o===void 0||!/^\d+\.\d+\.\d+$/.test(o))throw new Error(`Invalid or missing version in VERSION file: "${o}"`);let l=`v${o}`;if(!r){let u=`chore(codebase): release v${o}`;await a`git commit --allow-empty -m ${u}`.spawn(),await a`git push origin HEAD`.spawn()}return{version:o,tag:l,dryRun:r}},T=async(e={})=>{let r=await c();if(r===void 0||!/^\d+\.\d+\.\d+$/.test(r))throw new Error(`Invalid or missing version in VERSION file: "${r}"`);let s=`v${r}`;if(e.yes!==!0)throw new Error(`This will delete tag ${s} locally and remotely. Re-run with --yes to confirm.`);return await b(s),{version:r,tag:s,deleted:!0}},U=e=>m.fromPromise(()=>k(e)),H=e=>m.fromPromise(()=>M(e)),I=e=>m.fromPromise(()=>T(e)),V=e=>{let r=e.args[0];return r===void 0||!["patch","minor","major","same"].includes(r)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:r,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},j=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),N=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?(t.warn(n,"[DRY RUN] Release preview:"),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"generated":"no user-facing changes"}`),t.info(n," No changes were made.")):(t.success(n,`Released v${r.version}`),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"updated":"no user-facing changes"}`),t.info(n,` Committed: ${r.committed}`),t.info(n,` Pushed: ${r.pushed}`),t.info(n," CI will validate, tag, and publish."),t.info(n," Watch: https://github.com/eser/stack/actions")),i.ok(void 0)},D=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?t.warn(n,`[DRY RUN] Would delete and recreate tag ${r.tag}`):(t.success(n,`Re-tagged ${r.tag}`),t.info(n,"CI will validate and publish.")),i.ok(void 0)},S=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.deleted&&t.success(n,`Deleted tag v${r.version} (local + remote).`),i.ok(void 0)},F=g.createTrigger({handler:U,adaptInput:V,adaptOutput:N}),W=g.createTrigger({handler:H,adaptInput:j,adaptOutput:D}),Y=g.createTrigger({handler:I,adaptInput:G,adaptOutput:S}),ee=async e=>{let r=p(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),s=r._[0],o=r["dry-run"]===!0,l=r.yes===!0;if(s!==void 0&&!o&&!l&&["patch","minor","major","same"].includes(s)){let d=await c()??"0.0.0";if(t.info(n,`Current version: ${d}`),t.info(n,`Bump type: ${s}`),t.info(n,"This will bump version, generate changelog, commit, and push."),await A.flush(),!await O("Proceed?"))return t.warn(n,"Aborted."),i.ok(void 0);r.yes=!0}let u=f("release",r);return await F(u)},re=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=f("rerelease",r);return await W(s)},se=async e=>{let r=p(e??[],{boolean:["yes"],alias:{y:"yes"}}),s=f("unrelease",r);return await Y(s)};export{F as handleReleaseCli,W as handleRereleaseCli,Y as handleUnreleaseCli,ee as main,k as release,U as releaseHandler,M as rerelease,H as rereleaseHandler,re as rereleaseMain,T as unrelease,I as unreleaseHandler,se as unreleaseMain};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-LGNGLAV3.js";import{o as u}from"./chunk-ZER2RYWJ.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as p}from"./chunk-BLXGL5MA.js";import"./chunk-PWLF3WXM.js";import"./chunk-G5VGZMKA.js";import"./chunk-MJ2IPSAE.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as x,n as R}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as c}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:h,output:Y}=C(),E=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,A=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},N=t=>{let e=t.split(/\r?\n/),n=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(E);i!==null&&/^\d/.test(i[1])&&n.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return n.length===0?[]:n.map((s,o)=>{let i=n[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,r=e.slice(g,a);for(;r.length>0&&r[0].trim()==="";)r.shift();for(;r.length>0&&r[r.length-1].trim()==="";)r.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return r.length>0&&d.push("",...r),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
2
+ import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-JTSRGXS4.js";import{o as u}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as p}from"./chunk-GVTM4EOU.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as x,n as R}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:h,output:Y}=C(),E=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,A=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},N=t=>{let e=t.split(/\r?\n/),n=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(E);i!==null&&/^\d/.test(i[1])&&n.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return n.length===0?[]:n.map((s,o)=>{let i=n[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,r=e.slice(g,a);for(;r.length>0&&r[0].trim()==="";)r.shift();for(;r.length>0&&r[r.length-1].trim()==="";)r.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return r.length>0&&d.push("",...r),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
3
3
  `).trim()}
4
4
  `}})},T=async(t={})=>{let{changelogPath:e="CHANGELOG.md",root:n="."}=t,s=R(n,e),o=await c.runtime.fs.readTextFile(s);return{entries:N(o)}},O=async(t,e)=>{try{return await p.exec`gh release view ${t} --repo ${e}`.quiet().text(),!0}catch{return!1}},k=async t=>{let{repo:e,createIfMissing:n=!1,changelogPath:s="CHANGELOG.md",root:o=".",releaseTitle:i="eserstack {tag}"}=t,{entries:g}=await T({changelogPath:s,root:o});if(g.length===0)throw new Error("No release headings found in CHANGELOG.md.");let a=t.tag!==void 0?A(t.tag):g[0].tag,r=g.find(y=>y.tag===a);if(r===void 0)throw new Error(`No matching changelog section found for ${a}.`);let d=await c.runtime.fs.makeTempDir({prefix:"eserstack-release-"}),f=x(d,`${a}-notes.md`);await c.runtime.fs.writeTextFile(f,r.notes);try{if(await O(a,e))return await p.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"updated"};if(!n)return{tag:a,entry:r,action:"skipped"};let $=i.replace("{tag}",a);try{return await p.exec`gh release create ${a} --repo ${e} --title ${$} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"created"}}catch{return await p.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"updated"}}}finally{await c.runtime.fs.remove(d,{recursive:!0})}},I=t=>w.fromPromise(()=>k(t)),S=t=>{let e=t.flags.repo??c.runtime.env.get("GITHUB_REPOSITORY")??"";return e===""?l.fail(m.adaptError("Missing repository. Pass --repo or set GITHUB_REPOSITORY.")):l.ok({repo:e,tag:t.flags.tag??void 0,createIfMissing:t.flags["create-if-missing"]===!0})},b=t=>{if(l.isFail(t)){let n=t.error,s=n instanceof Error?n.message:n.message??String(n);return u.error(h,s),l.fail({exitCode:1})}let{value:e}=t;switch(e.action){case"created":u.success(h,`Created release ${e.tag} with changelog notes.`);break;case"updated":u.success(h,`Updated release notes for ${e.tag}.`);break;case"skipped":u.warn(h,`Release ${e.tag} not found. Skipping (pass --create-if-missing to create).`);break}return l.ok(void 0)},G=m.createTrigger({handler:I,adaptInput:S,adaptOutput:b}),q=async t=>{let e=v(t??[],{string:["repo","tag"],boolean:["create-if-missing"],alias:{h:"help"}}),n=P("release-notes",e);return await G(n)};export{G as handleCli,O as hasGitHubRelease,q as main,A as normalizeTag,T as parseChangelog,N as parseChangelogText,k as syncReleaseNotes,I as syncReleaseNotesHandler};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c,d as f}from"./chunk-ENTSZDR6.js";import{a as R}from"./chunk-YBCZC5KZ.js";import"./chunk-26ZFSXSK.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as d,c as p}from"./chunk-LGNGLAV3.js";import{o as n}from"./chunk-ZER2RYWJ.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as u}from"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import{a as g}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:i,output:N}=d(),P=async(e={})=>{let{root:r=".",remote:s="origin",tagPrefix:h="v",messageTemplate:y="Release {tag}",dryRun:l=!1}=e,t=await R({root:r});if(t===void 0||!/^\d+\.\d+\.\d+$/.test(t))throw new Error(`Invalid or missing version in VERSION file: "${t}"`);let o=`${h}${t}`,v=y.replace("{tag}",o).replace("{version}",t);return l||(await c(o,v),await f(s,o)),{version:t,tag:o,remote:s,dryRun:l}},T=e=>u.fromPromise(()=>P(e)),C=e=>a.ok({dryRun:e.flags["dry-run"]===!0}),x=e=>{if(a.isFail(e)){let s=e.error instanceof Error?e.error.message:String(e.error);return n.error(i,s),a.fail({exitCode:1})}let{value:r}=e;return r.dryRun?n.warn(i,`[DRY RUN] Would create and push tag ${r.tag}`):(n.success(i,`Created tag ${r.tag}`),n.info(i,`Pushed tag ${r.tag} to ${r.remote}`)),a.ok(void 0)},A=m.createTrigger({handler:T,adaptInput:C,adaptOutput:x}),S=async e=>{let r=g(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=p("release-tag",r);return await A(s)};export{A as handleCli,S as main,P as pushReleaseTag,T as pushReleaseTagHandler};
2
+ import{c,d as f}from"./chunk-MTCPFQ5I.js";import{a as R}from"./chunk-XBCL25QR.js";import"./chunk-3D5TBTM3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as d,c as p}from"./chunk-JTSRGXS4.js";import{o as n}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as u}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import{a as g}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:i,output:N}=d(),P=async(e={})=>{let{root:r=".",remote:s="origin",tagPrefix:h="v",messageTemplate:y="Release {tag}",dryRun:l=!1}=e,t=await R({root:r});if(t===void 0||!/^\d+\.\d+\.\d+$/.test(t))throw new Error(`Invalid or missing version in VERSION file: "${t}"`);let o=`${h}${t}`,v=y.replace("{tag}",o).replace("{version}",t);return l||(await c(o,v),await f(s,o)),{version:t,tag:o,remote:s,dryRun:l}},T=e=>u.fromPromise(()=>P(e)),C=e=>a.ok({dryRun:e.flags["dry-run"]===!0}),x=e=>{if(a.isFail(e)){let s=e.error instanceof Error?e.error.message:String(e.error);return n.error(i,s),a.fail({exitCode:1})}let{value:r}=e;return r.dryRun?n.warn(i,`[DRY RUN] Would create and push tag ${r.tag}`):(n.success(i,`Created tag ${r.tag}`),n.info(i,`Pushed tag ${r.tag} to ${r.remote}`)),a.ok(void 0)},A=m.createTrigger({handler:T,adaptInput:C,adaptOutput:x}),S=async e=>{let r=g(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=p("release-tag",r);return await A(s)};export{A as handleCli,S as main,P as pushReleaseTag,T as pushReleaseTagHandler};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{h as E}from"./chunk-L32KHQVT.js";import{s as y,u as C}from"./chunk-FXDWRGGR.js";import{e as f,g as h,h as S,i as g}from"./chunk-RBU3HF66.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as w}from"./chunk-SHN5MT56.js";import{d as l,f as a,g as m}from"./chunk-YVN2NZL4.js";import{a as p,b as n}from"./chunk-FFWPJP7A.js";import{i as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var A=async k=>{let e=d({renderer:w.ansi(),sink:u.stdout()}),r=c.process.cwd(),i=h(k);if(!i.ok)return e.writeln(a(i.error)),await e.close(),n({exitCode:1});let t;try{t=await f(r,i.spec)}catch(o){let x=o instanceof Error?o.message:String(o);return e.writeln(a(x)),await e.close(),n({exitCode:1})}if(t.phase!=="COMPLETED")return e.writeln(a(`Cannot reopen in phase: ${t.phase}`)),e.writeln(l("Only COMPLETED specs can be reopened.")),await e.close(),n({exitCode:1});let v=await E(r),s=y(t);return s=C(s,"COMPLETED","DISCOVERY",v,"reopened"),await S(r,s),s.spec!==null&&await g(r,s.spec,s),e.writeln(m("\u2714")," Spec reopened. Discovery answers preserved \u2014 run `noskills next` to revise."),await e.close(),p(void 0)};export{A as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{q as k}from"./chunk-ORAOSL2W.js";import{c as h,e as g,g as y,h as S,i as I}from"./chunk-YW377352.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-ZC4F4MYU.js";import{d as i,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as p}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var x=async D=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),a=l.process.cwd(),o=y(D);if(!o.ok)return e.writeln(n(o.error)),await e.close(),p({exitCode:1});let s;try{s=await g(a,o.spec)}catch(r){let A=r instanceof Error?r.message:String(r);return e.writeln(n(A)),await e.close(),p({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(i("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${a}/${h.specDir(s.spec)}`;try{await l.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(i("Resetting to IDLE anyway."))}}let t=s.spec,m=k(s);return await S(a,m),t!==null&&await I(a,t,m),e.writeln(d("\u2714")," Reset to IDLE."),t!==null&&e.writeln(i(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{x as main};
2
+ import{x as k}from"./chunk-FXDWRGGR.js";import{c as h,e as g,g as y,h as S,i as I}from"./chunk-RBU3HF66.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-SHN5MT56.js";import{d as i,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as p}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var x=async D=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),a=l.process.cwd(),o=y(D);if(!o.ok)return e.writeln(n(o.error)),await e.close(),p({exitCode:1});let s;try{s=await g(a,o.spec)}catch(r){let A=r instanceof Error?r.message:String(r);return e.writeln(n(A)),await e.close(),p({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(i("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${a}/${h.specDir(s.spec)}`;try{await l.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(i("Resetting to IDLE anyway."))}}let t=s.spec,m=k(s);return await S(a,m),t!==null&&await I(a,t,m),e.writeln(d("\u2714")," Reset to IDLE."),t!==null&&e.writeln(i(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{x as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as v,e as C}from"./chunk-W7OYXLGD.js";import{c as x,k as T}from"./chunk-YW377352.js";import{b as A,c as j}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as c}from"./chunk-ZC4F4MYU.js";import{c as y,d as a,f as k,g as P}from"./chunk-YVN2NZL4.js";import{a as g,b as $}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var q=async e=>{let s=e?.[0];if(s==="add")return await R(e?.slice(1));if(s==="list")return await L();if(s==="promote")return await W(e?.slice(1));let n=A(),t=d({renderer:c.ansi(),sink:u.stdout()});return t.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await t.close(),g(void 0)},R=async e=>{let s=d({renderer:c.ansi(),sink:u.stdout()}),n=p.process.cwd(),t=[],r=[],i=[];if(e!==void 0)for(let o of e)o.startsWith("--phases=")?t=o.slice(9).split(",").map(w=>w.trim()):o.startsWith("--applies-to=")?r=o.slice(13).split(",").map(w=>w.trim().replace(/^["']|["']$/g,"")):o.startsWith("-")||i.push(o);let m=i.join(" "),f=await T(n);if(m.length===0)return s.writeln(k("Please provide a rule: "),y(`${j('rule add "Use Deno Tests for all tests"')}`)),await s.close(),$({exitCode:1});let b=m.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),l="";(t.length>0||r.length>0)&&(l+=`---
2
+ import{a as v,e as C}from"./chunk-L7ROACZC.js";import{c as x,k as T}from"./chunk-RBU3HF66.js";import{b as A,c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as c}from"./chunk-SHN5MT56.js";import{c as y,d as a,f as k,g as P}from"./chunk-YVN2NZL4.js";import{a as g,b as $}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async e=>{let s=e?.[0];if(s==="add")return await R(e?.slice(1));if(s==="list")return await L();if(s==="promote")return await W(e?.slice(1));let n=A(),t=d({renderer:c.ansi(),sink:u.stdout()});return t.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await t.close(),g(void 0)},R=async e=>{let s=d({renderer:c.ansi(),sink:u.stdout()}),n=p.process.cwd(),t=[],r=[],i=[];if(e!==void 0)for(let o of e)o.startsWith("--phases=")?t=o.slice(9).split(",").map(w=>w.trim()):o.startsWith("--applies-to=")?r=o.slice(13).split(",").map(w=>w.trim().replace(/^["']|["']$/g,"")):o.startsWith("-")||i.push(o);let m=i.join(" "),f=await T(n);if(m.length===0)return s.writeln(k("Please provide a rule: "),y(`${j('rule add "Use Deno Tests for all tests"')}`)),await s.close(),$({exitCode:1});let b=m.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),l="";(t.length>0||r.length>0)&&(l+=`---
3
3
  `,t.length>0&&(l+=`phases: [${t.join(", ")}]
4
4
  `),r.length>0&&(l+=`applies_to: [${r.map(o=>`"${o}"`).join(", ")}]
5
5
  `),l+=`---
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{d as B}from"./chunk-RBQ2FOSL.js";import"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{c as W,d as X}from"./chunk-L7ROACZC.js";import{a as _,o as j}from"./chunk-FXDWRGGR.js";import{d as g,e as N,f as U,h as $,k as G,o as L,z as M}from"./chunk-RBU3HF66.js";import{b as E,c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as D,b as A,g as F}from"./chunk-4TTJVJEI.js";import{f as R,h as O,k as T}from"./chunk-SHN5MT56.js";import{c as v,d as o,f as l,g as P,h,k as I}from"./chunk-YVN2NZL4.js";import{a as S,b as w}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var ue=async t=>{let e=R({renderer:T.ansi(),sink:O.stdout()}),i=y.process.cwd(),n=t?.includes("--unattended")??!1,r=z(t,"--max-turns")??10,p=z(t,"--max-iterations")??50;if(!await M(i))return e.writeln(l(`noskills not initialized. Run: ${V("init")}`)),await e.close(),w({exitCode:1});let x=U(t),c=await N(i,x);if(c.phase!=="EXECUTING"&&c.phase!=="SPEC_APPROVED")return e.writeln(l(`Cannot run from phase: ${c.phase}`)),e.writeln(o("Must be in SPEC_APPROVED or EXECUTING to start.")),await e.close(),w({exitCode:1});if(c.phase==="SPEC_APPROVED"){e.writeln(o("Starting execution from approved spec..."));let s=j(c);await $(i,s)}let u=await G(i);if(u===null)return e.writeln(l("Config not found.")),await e.close(),w({exitCode:1});e.writeln(v(`${E()} run`)),e.writeln(o(`Mode: ${n?"unattended":"interactive"}, max-turns: ${r}, max-iterations: ${p}`)),e.writeln("");let m=0,d=0;for(;m<p;){m++;let s=await g(i);if(s.phase==="COMPLETED"){e.writeln(""),e.writeln(P("\u2714")," Spec completed!"),e.writeln(` Iterations: ${s.execution.iteration}`),e.writeln(` Decisions: ${s.decisions.length}`);break}if(s.phase==="BLOCKED"){let a=s.execution.lastProgress??"Unknown";if(e.writeln(""),e.writeln(h("\u26A0")," Execution blocked: ",o(a)),n){await Z(i,a,m),e.writeln(o("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let C=A(),f=await F(C,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){e.writeln(o("Stopped by user."));break}let k=_(s,"EXECUTING");await $(i,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(s.phase!=="EXECUTING"){e.writeln(l(`Unexpected phase: ${s.phase}. Stopping.`)),d=1;break}let H=(await L(i)).filter(a=>u.concerns.includes(a.id)),q=await W(i),K=X(u.tools),J=await B(s,H,q,u,void 0,void 0,void 0,K),Q=Y(J);e.writeln(I(`\u2500\u2500 Iteration ${m}`),o(` (execution: ${s.execution.iteration}, debt: ${s.execution.debt?.items.length??0})`)),s.execution.lastProgress!==null&&e.writeln(o(` Last: ${s.execution.lastProgress}`)),s.execution.lastVerification?.passed===!1&&e.writeln(l(" Verification failed \u2014 agent will fix")),s.execution.debt!==null&&e.writeln(h(` Debt: ${s.execution.debt.items.length} items`)),e.writeln(o(" Spawning agent..."));try{await(await import("./mod-7ICCX4OY.js")).exec`claude -p ${Q} --max-turns ${String(r)} --output-format json`.noThrow().text()}catch{e.writeln(l(" Failed to spawn claude CLI. Is it installed?")),d=1;break}e.writeln(o(" Agent exited. Stop hook captured state."));let b=await g(i);if(u.autoCommit===!0&&u.allowGit!==!1)try{let a=await import("./mod-7ICCX4OY.js");if((await a.exec`git diff --name-only`.noThrow().text()).trim().length>0){await a.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await a.exec`git commit -m ${f}`.noThrow().text(),e.writeln(o(" Auto-committed."))}}catch{e.writeln(o(" Auto-commit failed (non-fatal)."))}}return m>=p&&(e.writeln(""),e.writeln(h("\u26A0"),` Max iterations (${p}) reached. Stopping.`),d=2),await e.close(),d!==0?w({exitCode:d}):S(void 0)},Y=t=>{let e=[];if(e.push(t.meta.resumeHint),e.push(""),t.meta.spec!==null&&(e.push(`Working on spec: ${t.meta.spec}`),e.push("")),"instruction"in t&&(e.push(t.instruction),e.push("")),"previousIterationDebt"in t){let n=t.previousIterationDebt;if(n!==void 0){e.push(`DEBT from iteration ${n.fromIteration} (address first):`);for(let r of n.items)e.push(`- ${r}`);e.push("")}}if("statusReportRequired"in t){let n=t.statusReport;if(n!==void 0){e.push("Report against these acceptance criteria:");for(let r of n.criteria)e.push(`- ${r}`);e.push("")}}if("verificationFailed"in t&&t.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in t?t.verificationOutput:"")??""),e.push("")),t.behavioral.rules.length>0){e.push("Rules:");for(let n of t.behavioral.rules)e.push(`- ${n}`);e.push("")}if("context"in t){let n=t.context;if(n.concernReminders.length>0){e.push("Reminders:");for(let r of n.concernReminders)e.push(`- ${r}`);e.push("")}}let i=E();return e.push(`When done, report progress: ${i} next --answer="your progress"`),e.push(`If blocked, run: ${i} block "reason"`),e.push(`When all tasks are complete: ${i} done`),e.join(`
3
+ `)},z=(t,e)=>{if(t===void 0)return null;let i=`${e}=`;for(let n of t)if(n.startsWith(i)){let r=parseInt(n.slice(i.length),10);if(!isNaN(r)&&r>0)return r}return null},Z=async(t,e,i)=>{let n=`${t}/.eser/.state/blocked.log`,r=`[${new Date().toISOString()}] iteration=${i} reason=${e}
4
+ `;try{let{appendFileSync:p,mkdirSync:x}=await import("node:fs"),{dirname:c}=await import("node:path");x(c(n),{recursive:!0}),p(n,r)}catch{}};export{ue as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as V,b as q,c as z}from"./chunk-Y3XXSUFP.js";import"./chunk-L2E2H7YT.js";import"./chunk-2XNFZXHY.js";import{a as A,c as J,d as k,e as L}from"./chunk-P2MUEKFT.js";import{f as N,h as U,k as B}from"./chunk-ZC4F4MYU.js";import{f as x,g as C,h as F}from"./chunk-YVN2NZL4.js";import{d as H}from"./chunk-BLXGL5MA.js";import{a as I}from"./chunk-MG65QJY6.js";import{a as W,b as c,c as P,d as S}from"./chunk-FFWPJP7A.js";import{i as _}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var O=s=>({_tag:"WorkflowError",message:s}),Z=s=>{if(typeof s=="string")return{name:s,options:{},continueOnError:!1};let o=Object.entries(s);if(o.length!==1)throw new Error(`Invalid step config: expected exactly one key, got ${o.length}`);let[e,n]=o[0],r={},i=!1,l;for(let[a,t]of Object.entries(n))a==="continueOnError"?i=t===!0:a==="timeout"?l=t*1e3:r[a]=t;return{name:e,options:r,continueOnError:i,timeout:l}},ee=(s,o,e)=>L(J(s,n=>O(n instanceof Error?n.message:String(n))),o,O(`Step '${e}' timed out after ${(o/1e3).toFixed(0)}s`)),G=(s,o,e={})=>A(async()=>{let n=performance.now(),r=[],i=e.defaultTimeout??6e4;for(let a of s.steps){let t=Z(a);if(e.only!==void 0&&t.name!==e.only)continue;let T=o.get(t.name);if(T===void 0)return c(O(`Unknown tool '${t.name}' in workflow '${s.id}'. Registered tools: ${o.names().join(", ")||"(none)"}`));let v={...t.options,root:e.root??".",fix:e.fix??!1,_args:e.args??[]};e.changedFiles!==void 0&&(v._changedFiles=e.changedFiles),e.onStepStart?.(t.name);let g=performance.now(),j=t.timeout??i,h=ee(()=>T.run(v),j,t.name),p=await k(h),d;if(P(p))d=p.value;else if(t.continueOnError)d={name:t.name,passed:!1,issues:[{message:p.error.message}],mutations:[],stats:{}};else return p;let b=performance.now()-g,y={...d,durationMs:b};r.push(y),d.mutations.length>0&&e.onMutations!==void 0&&await e.onMutations(d.mutations),e.onStepEnd?.(y)}let l=performance.now()-n;return W({workflowId:s.id,passed:r.every(a=>a.passed),steps:r,totalDurationMs:l})}),D=(s,o,e=new Set)=>{if(s.includes===void 0||s.includes.length===0)return s;let n=new Set(e);n.add(s.id);let r=[];for(let i of s.includes){if(n.has(i))throw new Error(`Circular include detected: workflow '${s.id}' includes '${i}' which is already in the include chain: ${[...n].join(" \u2192 ")}`);let l=o.find(t=>t.id===i);if(l===void 0)throw new Error(`Workflow '${s.id}' includes '${i}' but no workflow with that id exists. Available: ${o.map(t=>t.id).join(", ")||"(none)"}`);let a=D(l,o,n);r.push(...a.steps)}return{...s,steps:[...r,...s.steps],includes:void 0}},K=(s,o,e,n={})=>A(async()=>{let r=o.workflows.find(l=>l.id===s);if(r===void 0)return c(O(`Workflow '${s}' not found. Available: ${o.workflows.map(l=>l.id).join(", ")||"(none)"}`));let i=D(r,o.workflows);return await k(G(i,e,n))}),Q=(s,o,e,n={})=>A(async()=>{let r=o.filter(l=>l.on.includes(s));if(r.length===0)return c(O(`No workflows found for event '${s}'. Available: ${o.map(l=>`${l.id} (${l.on.join(", ")})`).join("; ")||"(none)"}`));let i=[];for(let l of r){let a=D(l,o),t=await k(G(a,e,n));if(S(t))return t;i.push(t.value)}return W(i)});var oe=50,$=B.ansi(),se=(s,o,e)=>{let n=".".repeat(Math.max(1,oe-s.length)),r=`${(o.durationMs/1e3).toFixed(1)}s`,i;if(o.passed&&o.mutations.length>0)i=$.render([F(`Fixed (${o.mutations.length} file${o.mutations.length===1?"":"s"}, ${r})`)]);else if(o.passed)if(e&&Object.keys(o.stats).length>0){let l=Object.entries(o.stats).map(([a,t])=>`${t} ${a}`).join(", ");i=$.render([C(`Passed (${l}, ${r})`)])}else i=$.render([C(`Passed (${r})`)]);else i=$.render([x(`Failed (${r})`)]);return`${s}${n}${i}`},pe=async(s,o)=>{let e=I(s??[],{string:["event","workflow","only","config"],boolean:["fix","dry-run","help","verbose","json","changed"],alias:{e:"event",w:"workflow",h:"help",v:"verbose"}});if(e.help)return console.log(`eser workflows run \u2014 Run workflow pipelines
2
+ import{a as V,b as q,c as z}from"./chunk-WTMV5GTZ.js";import"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import{a as A,c as J,d as k,e as L}from"./chunk-P2MUEKFT.js";import{f as N,h as U,k as B}from"./chunk-SHN5MT56.js";import{f as x,g as C,h as F}from"./chunk-YVN2NZL4.js";import{d as H}from"./chunk-GVTM4EOU.js";import{a as I}from"./chunk-MG65QJY6.js";import{a as W,b as c,c as P,d as S}from"./chunk-FFWPJP7A.js";import{i as _}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var O=s=>({_tag:"WorkflowError",message:s}),Z=s=>{if(typeof s=="string")return{name:s,options:{},continueOnError:!1};let o=Object.entries(s);if(o.length!==1)throw new Error(`Invalid step config: expected exactly one key, got ${o.length}`);let[e,n]=o[0],r={},i=!1,l;for(let[a,t]of Object.entries(n))a==="continueOnError"?i=t===!0:a==="timeout"?l=t*1e3:r[a]=t;return{name:e,options:r,continueOnError:i,timeout:l}},ee=(s,o,e)=>L(J(s,n=>O(n instanceof Error?n.message:String(n))),o,O(`Step '${e}' timed out after ${(o/1e3).toFixed(0)}s`)),G=(s,o,e={})=>A(async()=>{let n=performance.now(),r=[],i=e.defaultTimeout??6e4;for(let a of s.steps){let t=Z(a);if(e.only!==void 0&&t.name!==e.only)continue;let T=o.get(t.name);if(T===void 0)return c(O(`Unknown tool '${t.name}' in workflow '${s.id}'. Registered tools: ${o.names().join(", ")||"(none)"}`));let v={...t.options,root:e.root??".",fix:e.fix??!1,_args:e.args??[]};e.changedFiles!==void 0&&(v._changedFiles=e.changedFiles),e.onStepStart?.(t.name);let g=performance.now(),j=t.timeout??i,h=ee(()=>T.run(v),j,t.name),p=await k(h),d;if(P(p))d=p.value;else if(t.continueOnError)d={name:t.name,passed:!1,issues:[{message:p.error.message}],mutations:[],stats:{}};else return p;let b=performance.now()-g,y={...d,durationMs:b};r.push(y),d.mutations.length>0&&e.onMutations!==void 0&&await e.onMutations(d.mutations),e.onStepEnd?.(y)}let l=performance.now()-n;return W({workflowId:s.id,passed:r.every(a=>a.passed),steps:r,totalDurationMs:l})}),D=(s,o,e=new Set)=>{if(s.includes===void 0||s.includes.length===0)return s;let n=new Set(e);n.add(s.id);let r=[];for(let i of s.includes){if(n.has(i))throw new Error(`Circular include detected: workflow '${s.id}' includes '${i}' which is already in the include chain: ${[...n].join(" \u2192 ")}`);let l=o.find(t=>t.id===i);if(l===void 0)throw new Error(`Workflow '${s.id}' includes '${i}' but no workflow with that id exists. Available: ${o.map(t=>t.id).join(", ")||"(none)"}`);let a=D(l,o,n);r.push(...a.steps)}return{...s,steps:[...r,...s.steps],includes:void 0}},K=(s,o,e,n={})=>A(async()=>{let r=o.workflows.find(l=>l.id===s);if(r===void 0)return c(O(`Workflow '${s}' not found. Available: ${o.workflows.map(l=>l.id).join(", ")||"(none)"}`));let i=D(r,o.workflows);return await k(G(i,e,n))}),Q=(s,o,e,n={})=>A(async()=>{let r=o.filter(l=>l.on.includes(s));if(r.length===0)return c(O(`No workflows found for event '${s}'. Available: ${o.map(l=>`${l.id} (${l.on.join(", ")})`).join("; ")||"(none)"}`));let i=[];for(let l of r){let a=D(l,o),t=await k(G(a,e,n));if(S(t))return t;i.push(t.value)}return W(i)});var oe=50,$=B.ansi(),se=(s,o,e)=>{let n=".".repeat(Math.max(1,oe-s.length)),r=`${(o.durationMs/1e3).toFixed(1)}s`,i;if(o.passed&&o.mutations.length>0)i=$.render([F(`Fixed (${o.mutations.length} file${o.mutations.length===1?"":"s"}, ${r})`)]);else if(o.passed)if(e&&Object.keys(o.stats).length>0){let l=Object.entries(o.stats).map(([a,t])=>`${t} ${a}`).join(", ");i=$.render([C(`Passed (${l}, ${r})`)])}else i=$.render([C(`Passed (${r})`)]);else i=$.render([x(`Failed (${r})`)]);return`${s}${n}${i}`},pe=async(s,o)=>{let e=I(s??[],{string:["event","workflow","only","config"],boolean:["fix","dry-run","help","verbose","json","changed"],alias:{e:"event",w:"workflow",h:"help",v:"verbose"}});if(e.help)return console.log(`eser workflows run \u2014 Run workflow pipelines
3
3
  `),console.log("Usage:"),console.log(" eser workflows run -e <event> Run by event"),console.log(" eser workflows run -w <workflow-id> Run by workflow id"),console.log(),console.log("Options:"),console.log(" -e, --event <name> Event to trigger (precommit, commitmsg, prepush)"),console.log(" -w, --workflow <id> Workflow id to run"),console.log(" --fix Auto-fix issues where supported"),console.log(" --dry-run Preview mutations without writing"),console.log(" --only <step> Run only a specific step"),console.log(" --config <path> Config directory (default: .)"),console.log(" -v, --verbose Show stats and issues for all steps"),console.log(" --json Output results as JSON"),console.log(" --changed Only check files changed in git"),console.log(" -h, --help Show this help"),W(void 0);let n=N({renderer:$,sink:U.stdout()}),r=e.event,i=e.workflow,l=e.fix??!1,a=e["dry-run"]??!1,t=e.only,T=e._,v=e.verbose??!1,g=e.json??!1,j=e.changed??!1;if(r===void 0&&i===void 0)return console.error("Error: specify -e <event> or -w <workflow-id>. Use --help for usage."),await n.close(),c({exitCode:1});let h=V();h.register(z),o?.tools!==void 0&&h.registerAll(o.tools);let p=e.config??".",d=await q(p);if(d===null)return console.error("Error: no .eser/manifest.yml found in current directory."),await n.close(),c({exitCode:1});let b;if(j)try{b=await H`git diff --name-only HEAD`.cwd(p).noThrow().lines()}catch{n.writeln(F("Warning: could not run git, running without file filtering."))}let y=[],M={root:p,fix:l,dryRun:a,only:t,args:T,changedFiles:b,onStepStart:void 0,onStepEnd:g?void 0:f=>{if(console.log(se(f.name,f,v)),!f.passed||v)for(let u of f.issues){let R=u.path!==void 0?u.line!==void 0?`${u.path}:${u.line}`:u.path:"";console.log(` ${$.render([x("\u2717")])} ${R}${R.length>0?": ":""}${u.message}`)}},onMutations:async f=>{if(!a)for(let u of f)u.oldContent!==u.newContent&&await _.fs.writeTextFile(u.path,u.newContent)}};try{let f=!0,u=0,R=0;if(r!==void 0){let w=await k(Q(r,d.workflows,h,M));if(S(w))throw new Error(w.error.message);for(let m of w.value){y.push(m),m.passed||(f=!1);for(let E of m.steps)E.passed||(R++,u+=E.issues.length)}}else{let w=await k(K(i,d,h,M));if(S(w))throw new Error(w.error.message);let m=w.value;y.push(m),f=m.passed;for(let E of m.steps)E.passed||(R++,u+=E.issues.length)}return g&&console.log(JSON.stringify(y,null,2)),f?(g||n.writeln(C(`
4
4
  All checks passed!`)),await n.close(),W(void 0)):(g||n.writeln(x(`
5
5
  ${R} check(s) failed with ${u} issue(s)`)),await n.close(),c({exitCode:1}))}catch(f){return n.writeln(x(`Error: ${f instanceof Error?f.message:String(f)}`)),await n.close(),c({exitCode:1})}};export{pe as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as w,h as g,k as y}from"./chunk-ZC4F4MYU.js";import{b as m,d as p,f as C}from"./chunk-YVN2NZL4.js";import{b as x}from"./chunk-BLXGL5MA.js";import{a as h,b as f}from"./chunk-FFWPJP7A.js";import{i as S}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var l=(e,r)=>typeof r=="string"?{command:r,description:e,workingDirectory:void 0,depends:[]}:{command:r.command,description:r.description??e,workingDirectory:r.workingDirectory,depends:r.depends??[]},k=(e,r,t=new Set,s=new Set)=>{if(s.has(e))return[];if(t.has(e))throw new Error(`Circular dependency detected: ${e} depends on itself (cycle in dependency chain)`);let n=r[e];if(n===void 0)throw new Error(`Unknown script dependency: "${e}"`);t.add(e);let c=l(e,n),o=[];for(let a of c.depends){let i=k(a,r,t,s);for(let d of i)s.has(d)||(o.push(d),s.add(d))}return s.add(e),o},P=()=>{let e=new URL("./main.ts",import.meta.url),r=e.protocol==="file:"?e.pathname:e.href;return`${S.process.execPath()} run --allow-all ${r}`},R=e=>{if(e==="eser"||e.startsWith("eser ")){let r=e.slice(4);return`${P()}${r}`}return e},$=async(e,r,t)=>{let s=R(e),n=t!==void 0&&t.length>0?`${s} ${t.join(" ")}`:s,c=r??".";return(await new x("sh",["-c",n]).cwd(c).stdout("inherit").stderr("inherit").noThrow().spawn()).code},O=async(e,r,t,s)=>{let n=w({renderer:y.ansi(),sink:g.stdout()}),c=k(e,t);for(let i of c){let d=l(i,t[i]);n.writeln(p(`$ ${i}`));let u=await $(d.command,d.workingDirectory);if(u!==0)return n.writeln(C(`Script dependency "${i}" failed with exit code ${u}`)),await n.close(),f({exitCode:u})}let o=l(e,t[e]);n.writeln(p(`$ ${e}`));let a=await $(o.command,o.workingDirectory,s);return a!==0?(await n.close(),f({exitCode:a})):(await n.close(),h(void 0))},B=e=>{let r=w({renderer:y.ansi(),sink:g.stdout()});r.writeln(m("Scripts:"));for(let[t,s]of Object.entries(e)){let n=l(t,s);r.writeln(m(` ${t.padEnd(20)} `),p(n.description))}r.writeln()};export{$ as executeCommand,l as parseScript,k as resolveDependencies,O as runScript,B as showScripts};
2
+ import{f as w,h as g,k as y}from"./chunk-SHN5MT56.js";import{b as m,d as p,f as C}from"./chunk-YVN2NZL4.js";import{b as x}from"./chunk-GVTM4EOU.js";import{a as h,b as f}from"./chunk-FFWPJP7A.js";import{i as S}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var l=(e,r)=>typeof r=="string"?{command:r,description:e,workingDirectory:void 0,depends:[]}:{command:r.command,description:r.description??e,workingDirectory:r.workingDirectory,depends:r.depends??[]},k=(e,r,t=new Set,s=new Set)=>{if(s.has(e))return[];if(t.has(e))throw new Error(`Circular dependency detected: ${e} depends on itself (cycle in dependency chain)`);let n=r[e];if(n===void 0)throw new Error(`Unknown script dependency: "${e}"`);t.add(e);let c=l(e,n),o=[];for(let a of c.depends){let i=k(a,r,t,s);for(let d of i)s.has(d)||(o.push(d),s.add(d))}return s.add(e),o},P=()=>{let e=new URL("./main.ts",import.meta.url),r=e.protocol==="file:"?e.pathname:e.href;return`${S.process.execPath()} run --allow-all ${r}`},R=e=>{if(e==="eser"||e.startsWith("eser ")){let r=e.slice(4);return`${P()}${r}`}return e},$=async(e,r,t)=>{let s=R(e),n=t!==void 0&&t.length>0?`${s} ${t.join(" ")}`:s,c=r??".";return(await new x("sh",["-c",n]).cwd(c).stdout("inherit").stderr("inherit").noThrow().spawn()).code},O=async(e,r,t,s)=>{let n=w({renderer:y.ansi(),sink:g.stdout()}),c=k(e,t);for(let i of c){let d=l(i,t[i]);n.writeln(p(`$ ${i}`));let u=await $(d.command,d.workingDirectory);if(u!==0)return n.writeln(C(`Script dependency "${i}" failed with exit code ${u}`)),await n.close(),f({exitCode:u})}let o=l(e,t[e]);n.writeln(p(`$ ${e}`));let a=await $(o.command,o.workingDirectory,s);return a!==0?(await n.close(),f({exitCode:a})):(await n.close(),h(void 0))},B=e=>{let r=w({renderer:y.ansi(),sink:g.stdout()});r.writeln(m("Scripts:"));for(let[t,s]of Object.entries(e)){let n=l(t,s);r.writeln(m(` ${t.padEnd(20)} `),p(n.description))}r.writeln()};export{$ as executeCommand,l as parseScript,k as resolveDependencies,O as runScript,B as showScripts};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as l,h as a,k as i}from"./chunk-ZC4F4MYU.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as o}from"./chunk-MJ2IPSAE.js";import"./chunk-MG65QJY6.js";import{a as t}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var v=["trace","debug","info","warn","error","fatal"],P=async m=>{let{flags:e}=o(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),r=l({renderer:i.ansi(),sink:a.stdout()});r.writeln(n(`
2
+ import{f as l,h as a,k as i}from"./chunk-SHN5MT56.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as o}from"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as t}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var v=["trace","debug","info","warn","error","fatal"],P=async m=>{let{flags:e}=o(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),r=l({renderer:i.ansi(),sink:a.stdout()});r.writeln(n(`
3
3
  \u{1F680} Serving production build...
4
- `));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-PTEEAWXX.js"),import("./mod-QWYXFGRG.js"),import("./mod-RMDGRCBK.js"),import("./mod-BKHQAEVL.js")]);return await r.close(),await g({mode:"serve",port:p,logLevel:u,hmr:!1,renderer:c,htmlShell:d,frameworkPlugin:L,cssPlugin:f({globalCssPath:"src/app/styles/global.css"})}),t(void 0)};export{P as main};
4
+ `));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-NCAKIBQC.js"),import("./mod-OG7BBJP4.js"),import("./mod-NSL6IJRQ.js"),import("./mod-VZT7JWPZ.js")]);return await r.close(),await g({mode:"serve",port:p,logLevel:u,hmr:!1,renderer:c,htmlShell:d,frameworkPlugin:L,cssPlugin:f({globalCssPath:"src/app/styles/global.css"})}),t(void 0)};export{P as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as L,b as Y,h as G,i as O,m as K,o as A,p as D}from"./chunk-HVTJ5LVU.js";import{e as F}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as f}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import{b as I}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";function q(e,s){let a={...e,...s},i=[];a.description&&i.push(`<meta name="description" content="${j(a.description)}">`),a.keywords&&a.keywords.length>0&&i.push(`<meta name="keywords" content="${j(a.keywords.join(", "))}">`),a.author&&i.push(`<meta name="author" content="${j(a.author)}">`),a.themeColor&&i.push(`<meta name="theme-color" content="${a.themeColor}">`);let n=[];return a.noIndex&&n.push("noindex"),a.noFollow&&n.push("nofollow"),n.length>0&&i.push(`<meta name="robots" content="${n.join(", ")}">`),a.canonicalUrl&&i.push(`<link rel="canonical" href="${j(a.canonicalUrl)}">`),i.push(`<meta property="og:type" content="${a.ogType||"website"}">`),i.push(`<meta property="og:title" content="${j(a.title)}">`),a.description&&i.push(`<meta property="og:description" content="${j(a.description)}">`),a.siteUrl&&i.push(`<meta property="og:url" content="${j(a.siteUrl)}">`),a.siteName&&i.push(`<meta property="og:site_name" content="${j(a.siteName)}">`),a.locale&&i.push(`<meta property="og:locale" content="${a.locale}">`),a.ogImage&&(i.push(`<meta property="og:image" content="${j(a.ogImage)}">`),i.push(`<meta property="og:image:alt" content="${j(a.title)}">`)),i.push('<meta name="twitter:card" content="summary_large_image">'),i.push(`<meta name="twitter:title" content="${j(a.title)}">`),a.description&&i.push(`<meta name="twitter:description" content="${j(a.description)}">`),a.twitterHandle&&(i.push(`<meta name="twitter:site" content="${j(a.twitterHandle)}">`),i.push(`<meta name="twitter:creator" content="${j(a.twitterHandle)}">`)),a.ogImage&&i.push(`<meta name="twitter:image" content="${j(a.ogImage)}">`),a.favicon&&i.push(`<link rel="icon" href="${j(a.favicon)}">`),i.join(`
2
+ import{a as L,b as Y,h as G,i as O,m as K,o as A,p as D}from"./chunk-FZ5WFU6R.js";import{e as F}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{b as I}from"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";function q(e,s){let a={...e,...s},i=[];a.description&&i.push(`<meta name="description" content="${j(a.description)}">`),a.keywords&&a.keywords.length>0&&i.push(`<meta name="keywords" content="${j(a.keywords.join(", "))}">`),a.author&&i.push(`<meta name="author" content="${j(a.author)}">`),a.themeColor&&i.push(`<meta name="theme-color" content="${a.themeColor}">`);let n=[];return a.noIndex&&n.push("noindex"),a.noFollow&&n.push("nofollow"),n.length>0&&i.push(`<meta name="robots" content="${n.join(", ")}">`),a.canonicalUrl&&i.push(`<link rel="canonical" href="${j(a.canonicalUrl)}">`),i.push(`<meta property="og:type" content="${a.ogType||"website"}">`),i.push(`<meta property="og:title" content="${j(a.title)}">`),a.description&&i.push(`<meta property="og:description" content="${j(a.description)}">`),a.siteUrl&&i.push(`<meta property="og:url" content="${j(a.siteUrl)}">`),a.siteName&&i.push(`<meta property="og:site_name" content="${j(a.siteName)}">`),a.locale&&i.push(`<meta property="og:locale" content="${a.locale}">`),a.ogImage&&(i.push(`<meta property="og:image" content="${j(a.ogImage)}">`),i.push(`<meta property="og:image:alt" content="${j(a.title)}">`)),i.push('<meta name="twitter:card" content="summary_large_image">'),i.push(`<meta name="twitter:title" content="${j(a.title)}">`),a.description&&i.push(`<meta name="twitter:description" content="${j(a.description)}">`),a.twitterHandle&&(i.push(`<meta name="twitter:site" content="${j(a.twitterHandle)}">`),i.push(`<meta name="twitter:creator" content="${j(a.twitterHandle)}">`)),a.ogImage&&i.push(`<meta name="twitter:image" content="${j(a.ogImage)}">`),a.favicon&&i.push(`<link rel="icon" href="${j(a.favicon)}">`),i.join(`
3
3
  `)}function M(e,s){let a={...e,...s},i={"@context":"https://schema.org","@type":"WebSite",name:a.siteName,url:a.siteUrl,description:a.description},n={"@context":"https://schema.org","@type":"Organization",name:a.siteName,url:a.siteUrl,logo:a.ogImage},t=[i,n];return a.jsonLd&&t.push({"@context":"https://schema.org",...a.jsonLd}),t.map(p=>`<script type="application/ld+json">${JSON.stringify(p)}</script>`).join(`
4
4
  `)}function j(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var V={title:"laroux.js 3.0",description:"Zero-configuration React Server Components on Deno 2.x. Modern, simple, and built with cutting-edge technology.",siteName:"laroux.js",siteUrl:"https://laroux.now",locale:"en_US",themeColor:"#7c3aed",favicon:"/favicon.svg",twitterHandle:"@eser",ogImage:"https://laroux.now/og-image.png",ogType:"website",keywords:["laroux","open source","community","development","react","server components","server actions","island architecture"],author:"Eser Ozvataf"};function Q(e){let s=e.entrypoint??"/client.js",a=e.chunkManifest?.buildId?`?v=${e.chunkManifest.buildId}`:`?v=${Date.now()}`,i=e.chunkManifest?.hmrEnabled?"":a,n=e.fontPreloads?.join(`
5
5
  `)??"",t=e.fontCSS?`<style>${e.fontCSS}</style>`:"",p=e.criticalChunks?.map(v=>`<link rel="modulepreload" href="${v}${a}">`).join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{e as b,j as y,r as A,t as C,u as N,w as $,x,y as O,z as R}from"./chunk-YW377352.js";import{b as I,c as E}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as S}from"./chunk-ZC4F4MYU.js";import{c as l,d as n,f as c,g as v}from"./chunk-YVN2NZL4.js";import{a as u,b as h}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var F=async t=>{let s=t?.[0];if(s==="start")return await P(t?.slice(1));if(s==="end")return await D(t?.slice(1));if(s==="list")return await M();if(s==="gc")return await K();let i=I(),e=f({renderer:S.ansi(),sink:w.stdout()});return e.writeln(`Usage: ${i} session <start | end | list | gc>`),e.writeln(""),e.writeln(n(" start --spec=<name> Bind to a spec")),e.writeln(n(" start --free Free mode (no enforcement)")),e.writeln(n(" start --auto Auto-detect spec or free")),e.writeln(n(" end [--id=<id>] End current/specific session")),e.writeln(n(" list Show active sessions")),e.writeln(n(" gc Remove stale sessions")),await e.close(),u(void 0)},P=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd();if(!await R(i))return s.writeln(c("noskills is not initialized.")," Run: ",l(E("init"))),await s.close(),h({exitCode:1});let e=null,o=!1,d=!1;for(let r of t??[])r.startsWith("--spec=")?e=r.slice(7):r==="--free"?o=!0:r==="--auto"&&(d=!0);if(d){let p=(await y(i)).filter(L=>L.state.phase!=="COMPLETED"&&L.state.phase!=="IDLE");p.length===1?e=p[0].name:o=!0}if(e===null&&!o)return s.writeln(c("Specify --spec=<name>, --free, or --auto.")),s.writeln(n(`Example: ${I()} session start --spec=my-feature`)),await s.close(),h({exitCode:1});let a=null;if(e!==null)try{a=(await b(i,e)).phase}catch(r){let p=r instanceof Error?r.message:String(r);return s.writeln(c(`Error: ${p}`)),await s.close(),h({exitCode:1})}let g=O(),k={id:g,spec:e,mode:o?"free":"spec",phase:o?null:a,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"};return await A(i,k),s.writeln(v("Session started.")),s.writeln(" ID: ",l(g)),s.writeln(" Mode: ",l(o?"free":"spec")),e!==null&&(s.writeln(" Spec: ",l(e)),a!==null&&s.writeln(" Phase: ",n(a))),s.writeln(""),s.writeln("Run: ",l(`export NOSKILLS_SESSION=${g}`)),await s.close(),u(void 0)},D=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd(),e=null;for(let d of t??[])d.startsWith("--id=")&&(e=d.slice(5));return e===null&&(e=m.env.get("NOSKILLS_SESSION")??null),e===null?(s.writeln(c("No session specified. Use --id=<id> or set NOSKILLS_SESSION env var.")),await s.close(),h({exitCode:1})):(await N(i,e)?s.writeln(v("Session ended: "),n(e)):s.writeln(c(`Session not found: ${e}`)),await s.close(),u(void 0))},M=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await C(s);if(t.writeln(l("Sessions")),t.writeln(""),i.length===0)t.writeln(n(` No active sessions. Start one with: ${E("session start --spec=<name>")}`));else for(let e of i){let o=x(e),d=Date.now()-new Date(e.lastActiveAt).getTime(),a=Math.floor(d/6e4),g=a<60?`${a}min ago`:`${Math.floor(a/60)}h ago`,k=e.mode==="free"?"free":`spec:${e.spec??"?"}`,r=e.phase??"\u2014",p=o?c(" (stale)"):"";t.writeln(" ",l(e.id)," ",n(k.padEnd(25))," ",n(r.padEnd(18))," ",n(g),p)}return await t.close(),u(void 0)},K=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await $(s);if(i.length===0)t.writeln(n("No stale sessions to remove."));else{t.writeln(v(`Removed ${i.length} stale session(s):`));for(let e of i)t.writeln(" ",n(e))}return await t.close(),u(void 0)};export{F as main};
2
+ import{e as b,j as y,r as A,t as C,u as N,w as $,x,y as O,z as R}from"./chunk-RBU3HF66.js";import{b as I,c as E}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as S}from"./chunk-SHN5MT56.js";import{c as l,d as n,f as c,g as v}from"./chunk-YVN2NZL4.js";import{a as u,b as h}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var F=async t=>{let s=t?.[0];if(s==="start")return await P(t?.slice(1));if(s==="end")return await D(t?.slice(1));if(s==="list")return await M();if(s==="gc")return await K();let i=I(),e=f({renderer:S.ansi(),sink:w.stdout()});return e.writeln(`Usage: ${i} session <start | end | list | gc>`),e.writeln(""),e.writeln(n(" start --spec=<name> Bind to a spec")),e.writeln(n(" start --free Free mode (no enforcement)")),e.writeln(n(" start --auto Auto-detect spec or free")),e.writeln(n(" end [--id=<id>] End current/specific session")),e.writeln(n(" list Show active sessions")),e.writeln(n(" gc Remove stale sessions")),await e.close(),u(void 0)},P=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd();if(!await R(i))return s.writeln(c("noskills is not initialized.")," Run: ",l(E("init"))),await s.close(),h({exitCode:1});let e=null,o=!1,d=!1;for(let r of t??[])r.startsWith("--spec=")?e=r.slice(7):r==="--free"?o=!0:r==="--auto"&&(d=!0);if(d){let p=(await y(i)).filter(L=>L.state.phase!=="COMPLETED"&&L.state.phase!=="IDLE");p.length===1?e=p[0].name:o=!0}if(e===null&&!o)return s.writeln(c("Specify --spec=<name>, --free, or --auto.")),s.writeln(n(`Example: ${I()} session start --spec=my-feature`)),await s.close(),h({exitCode:1});let a=null;if(e!==null)try{a=(await b(i,e)).phase}catch(r){let p=r instanceof Error?r.message:String(r);return s.writeln(c(`Error: ${p}`)),await s.close(),h({exitCode:1})}let g=O(),k={id:g,spec:e,mode:o?"free":"spec",phase:o?null:a,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"};return await A(i,k),s.writeln(v("Session started.")),s.writeln(" ID: ",l(g)),s.writeln(" Mode: ",l(o?"free":"spec")),e!==null&&(s.writeln(" Spec: ",l(e)),a!==null&&s.writeln(" Phase: ",n(a))),s.writeln(""),s.writeln("Run: ",l(`export NOSKILLS_SESSION=${g}`)),await s.close(),u(void 0)},D=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd(),e=null;for(let d of t??[])d.startsWith("--id=")&&(e=d.slice(5));return e===null&&(e=m.env.get("NOSKILLS_SESSION")??null),e===null?(s.writeln(c("No session specified. Use --id=<id> or set NOSKILLS_SESSION env var.")),await s.close(),h({exitCode:1})):(await N(i,e)?s.writeln(v("Session ended: "),n(e)):s.writeln(c(`Session not found: ${e}`)),await s.close(),u(void 0))},M=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await C(s);if(t.writeln(l("Sessions")),t.writeln(""),i.length===0)t.writeln(n(` No active sessions. Start one with: ${E("session start --spec=<name>")}`));else for(let e of i){let o=x(e),d=Date.now()-new Date(e.lastActiveAt).getTime(),a=Math.floor(d/6e4),g=a<60?`${a}min ago`:`${Math.floor(a/60)}h ago`,k=e.mode==="free"?"free":`spec:${e.spec??"?"}`,r=e.phase??"\u2014",p=o?c(" (stale)"):"";t.writeln(" ",l(e.id)," ",n(k.padEnd(25))," ",n(r.padEnd(18))," ",n(g),p)}return await t.close(),u(void 0)},K=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await $(s);if(i.length===0)t.writeln(n("No stale sessions to remove."));else{t.writeln(v(`Removed ${i.length} stale session(s):`));for(let e of i)t.writeln(" ",n(e))}return await t.close(),u(void 0)};export{F as main};