eser 4.1.22 → 4.1.26

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 (245) hide show
  1. package/chunks/add-ORJYWG26.js +7 -0
  2. package/chunks/{anthropic-GBDSASP5.js → anthropic-SL274RBQ.js} +1 -1
  3. package/chunks/approve-5NJ4JWD3.js +1 -0
  4. package/chunks/ask-TFJCKH5G.js +2 -0
  5. package/chunks/block-ADHHHUFZ.js +1 -0
  6. package/chunks/{browser-6UKLTPJO.js → browser-XCMD2IZQ.js} +1 -1
  7. package/chunks/{build-VKOO2WEA.js → build-2W7YVR7J.js} +2 -2
  8. package/chunks/{bun-N3TIWBPP.js → bun-YFFBDKUJ.js} +1 -1
  9. package/chunks/changelog-gen-LV5VWTZS.js +7 -0
  10. package/chunks/chunk-2J2PXBOC.js +1 -0
  11. package/chunks/{chunk-NIX3WX3O.js → chunk-3EFU5R2M.js} +1 -1
  12. package/chunks/{chunk-7GS5KPVF.js → chunk-3I4JG3PJ.js} +1 -1
  13. package/chunks/{chunk-7QNRH7OR.js → chunk-3K42AALS.js} +1 -1
  14. package/chunks/{chunk-TMFPDVYN.js → chunk-3OEM65F2.js} +17 -17
  15. package/chunks/{chunk-RGUC6KAZ.js → chunk-4H4O3TGK.js} +1 -1
  16. package/chunks/{chunk-V5HTJPFW.js → chunk-4HAIX3WN.js} +3 -3
  17. package/chunks/chunk-4VL2RZIN.js +1 -0
  18. package/chunks/chunk-5AK4OGCO.js +1 -0
  19. package/chunks/chunk-5MN3MWQN.js +1 -0
  20. package/chunks/chunk-5RK3346P.js +4 -0
  21. package/chunks/chunk-6HYGGBEQ.js +1 -0
  22. package/chunks/{chunk-PLRSDG6G.js → chunk-762C2IM6.js} +1 -1
  23. package/chunks/{chunk-NZFUFGOC.js → chunk-AAV7D6DF.js} +1 -1
  24. package/chunks/{chunk-DLVQNMNV.js → chunk-AKJB4CER.js} +1 -1
  25. package/chunks/{chunk-NSZ4HGDI.js → chunk-ANY26ROY.js} +1 -1
  26. package/chunks/{chunk-IAWIWTDY.js → chunk-AYSPDG4K.js} +1 -1
  27. package/chunks/{chunk-DOV5776P.js → chunk-BCHXUKWW.js} +2 -2
  28. package/chunks/{chunk-3DMTTLUJ.js → chunk-BDTJR6UH.js} +1 -1
  29. package/chunks/{chunk-BP2MZX2P.js → chunk-C3PZVQ3Z.js} +1 -1
  30. package/chunks/{chunk-M5TBBQQC.js → chunk-CKD2KOHA.js} +3 -3
  31. package/chunks/chunk-CPRLAMEG.js +1 -0
  32. package/chunks/chunk-DWYVBWBP.js +91 -0
  33. package/chunks/{chunk-PBSR4XR2.js → chunk-ETMOOGY2.js} +1 -1
  34. package/chunks/chunk-G34MS4XJ.js +1 -0
  35. package/chunks/chunk-GVSBZ6JV.js +1 -0
  36. package/chunks/{chunk-C3OSYHJY.js → chunk-H4OFOQQ2.js} +1 -1
  37. package/chunks/{chunk-XWYLEYLY.js → chunk-HTBLWLKV.js} +1 -1
  38. package/chunks/chunk-JOXKA7TJ.js +7 -0
  39. package/chunks/{chunk-JQHMDTPL.js → chunk-KAEAT6A4.js} +1 -1
  40. package/chunks/chunk-LO424HF3.js +60 -0
  41. package/chunks/chunk-LOFP256P.js +1 -0
  42. package/chunks/{chunk-4HNB3UTC.js → chunk-MBC2JM7F.js} +1 -1
  43. package/chunks/{chunk-2R4MK2KR.js → chunk-MYSTBVWT.js} +1 -1
  44. package/chunks/chunk-NGZZAQ7G.js +1 -0
  45. package/chunks/chunk-NLNSK3KE.js +1 -0
  46. package/chunks/chunk-NT2MQK7O.js +6 -0
  47. package/chunks/{chunk-SJQWPBMJ.js → chunk-NTPOK5H6.js} +1 -1
  48. package/chunks/{chunk-DZD6MI45.js → chunk-PO3SXFUE.js} +1 -1
  49. package/chunks/chunk-Q54LOR4S.js +2 -0
  50. package/chunks/{chunk-5C7ZQN6X.js → chunk-QIODVVTY.js} +1 -1
  51. package/chunks/{chunk-ZY72QNKZ.js → chunk-QIYWONJL.js} +1 -1
  52. package/chunks/chunk-QZY4BKI7.js +1 -0
  53. package/chunks/chunk-RBB5ITAS.js +2 -0
  54. package/chunks/chunk-RYLOB2JU.js +1 -0
  55. package/chunks/{chunk-VFMYWG2I.js → chunk-SBOTNOWZ.js} +1 -1
  56. package/chunks/{chunk-Z7742D7Q.js → chunk-SG4G3OOO.js} +1 -1
  57. package/chunks/{chunk-FGDJVQG3.js → chunk-TTYO2XJO.js} +1 -1
  58. package/chunks/{chunk-EW5NCPPE.js → chunk-TUTRX7VR.js} +3 -3
  59. package/chunks/{chunk-UJX2S56V.js → chunk-TXL6YOFL.js} +1 -1
  60. package/chunks/{chunk-4Q3SEHPE.js → chunk-U47ABJCC.js} +1 -1
  61. package/chunks/chunk-U65FD6J3.js +1 -0
  62. package/chunks/{chunk-7M3ONEMO.js → chunk-UKYKMDYU.js} +1 -1
  63. package/chunks/{chunk-DRQWYJMH.js → chunk-UNL4H5EY.js} +1 -1
  64. package/chunks/{chunk-ATLUGTI7.js → chunk-V2N5L24J.js} +2 -2
  65. package/chunks/chunk-VVHXAOEH.js +1 -0
  66. package/chunks/{chunk-HPVL4BVQ.js → chunk-W3REWI3H.js} +2 -2
  67. package/chunks/{chunk-MQH4XBFN.js → chunk-XMCQMTAA.js} +1 -1
  68. package/chunks/chunk-YMY2URYM.js +1 -0
  69. package/chunks/{chunk-XJ3VEVYL.js → chunk-YQU3TEIG.js} +1 -1
  70. package/chunks/chunk-YWCEHTZB.js +2 -0
  71. package/chunks/chunk-YXSB6RET.js +1 -0
  72. package/chunks/chunk-Z4WPWVC7.js +10 -0
  73. package/chunks/chunk-ZED5RIVL.js +1 -0
  74. package/chunks/chunk-ZH37DSUQ.js +1 -0
  75. package/chunks/claude-code-K37KYX7W.js +1 -0
  76. package/chunks/clone-PAQMCIA3.js +5 -0
  77. package/chunks/{commitmsg-SQRQONCS.js → commitmsg-ZGOEO5YG.js} +2 -2
  78. package/chunks/{deno-PZXN5K3J.js → deno-MMJLKXAE.js} +1 -1
  79. package/chunks/{dev-FLO2KEPZ.js → dev-JHAHGTZP.js} +2 -2
  80. package/chunks/file-tools-shared-77P7MI54.js +1 -0
  81. package/chunks/gemini-ARTUPDPZ.js +1 -0
  82. package/chunks/gh-SXEDNWHD.js +4 -0
  83. package/chunks/{gh-contributors-5SHGJHAQ.js → gh-contributors-G3QZZAUO.js} +3 -3
  84. package/chunks/init-3GXDO32O.js +1 -0
  85. package/chunks/init-IPZHDMAH.js +12 -0
  86. package/chunks/install-VY2L6NDB.js +2 -0
  87. package/chunks/kiro-XQDHURLU.js +1 -0
  88. package/chunks/{list-MN7OUE52.js → list-2RZIQZGH.js} +1 -1
  89. package/chunks/{list-B7L4FZKG.js → list-DSVIPH45.js} +1 -1
  90. package/chunks/{list-UZKWSA4S.js → list-V2HZCPDN.js} +1 -1
  91. package/chunks/load-config-KG4RTCR2.js +1 -0
  92. package/chunks/{main-WVXCURBF.js → main-FQFNY7SM.js} +2 -2
  93. package/chunks/manifest-5CYL3HR3.js +1 -0
  94. package/chunks/mod-5ACKR2OE.js +1 -0
  95. package/chunks/{mod-PEAFMI6F.js → mod-CUIGNRIK.js} +1 -1
  96. package/chunks/mod-NSY6WUYH.js +27 -0
  97. package/chunks/mod-QJMMYECF.js +10 -0
  98. package/chunks/mod-T76TRJWM.js +1 -0
  99. package/chunks/{mod-CI56JMO4.js → mod-TLLZ3NAM.js} +2 -2
  100. package/chunks/mod-TSU5UWXA.js +1 -0
  101. package/chunks/{mod-JTBNNSZZ.js → mod-U6LEXPVR.js} +1 -1
  102. package/chunks/{mod-MKMQWZ6G.js → mod-VZPKQ7DG.js} +1 -1
  103. package/chunks/mod-WYRORC72.js +1 -0
  104. package/chunks/new-EAETGSIR.js +4 -0
  105. package/chunks/next-F2BIIAZC.js +3 -0
  106. package/chunks/{node-VPHAK3FD.js → node-SMAAGOR3.js} +1 -1
  107. package/chunks/ollama-6JZ2IKR7.js +1 -0
  108. package/chunks/opencode-CHIAJALZ.js +1 -0
  109. package/chunks/recipe-applier-R4YJPGQR.js +1 -0
  110. package/chunks/registry-fetcher-J6X32PGP.js +1 -0
  111. package/chunks/{release-YJOLKWDT.js → release-6PVE4O6P.js} +2 -2
  112. package/chunks/release-notes-734LKEJB.js +3 -0
  113. package/chunks/release-tag-YX727TXO.js +1 -0
  114. package/chunks/reset-PAPDZIDC.js +1 -0
  115. package/chunks/rule-4GNOR3GE.js +2 -0
  116. package/chunks/{run-7JXDS75G.js → run-ES4BLQQX.js} +1 -1
  117. package/chunks/{scripts-RSK5XDRW.js → scripts-COIXD5AD.js} +1 -1
  118. package/chunks/{serve-U6IXMGXQ.js → serve-B4V2BCWM.js} +2 -2
  119. package/chunks/{server-PXE4DB3V.js → server-RYWDAYED.js} +1 -1
  120. package/chunks/spec-SNAUMQSR.js +1 -0
  121. package/chunks/status-CY5IKIYS.js +1 -0
  122. package/chunks/sync-OAPV43JS.js +1 -0
  123. package/chunks/system-5A6DQLM5.js +1 -0
  124. package/chunks/system-5LLFPIWV.js +1 -0
  125. package/chunks/update-O75M4SDJ.js +5 -0
  126. package/chunks/validate-bom-6G7EYFOP.js +1 -0
  127. package/chunks/validate-case-conflict-OWHWRTSQ.js +1 -0
  128. package/chunks/validate-circular-deps-TCYSZKME.js +1 -0
  129. package/chunks/validate-commit-msg-UPJJ7E4M.js +1 -0
  130. package/chunks/validate-docs-ZTCE5XLF.js +1 -0
  131. package/chunks/validate-eof-6RMNMAWI.js +1 -0
  132. package/chunks/validate-export-names-5ZVQ4PGM.js +1 -0
  133. package/chunks/validate-filenames-5YB27RN4.js +1 -0
  134. package/chunks/validate-json-6CLTN4AN.js +1 -0
  135. package/chunks/validate-large-files-KEMHYWKH.js +1 -0
  136. package/chunks/validate-licenses-WIVY6G5Z.js +1 -0
  137. package/chunks/validate-line-endings-KNFYAVBG.js +1 -0
  138. package/chunks/validate-merge-conflict-PYKGIFY5.js +1 -0
  139. package/chunks/validate-mod-exports-X5UZPD7J.js +1 -0
  140. package/chunks/validate-package-configs-SYKEIB53.js +1 -0
  141. package/chunks/validate-secrets-BWDFWN64.js +1 -0
  142. package/chunks/validate-shebangs-MP6VTLWO.js +1 -0
  143. package/chunks/validate-submodules-RQXISWKG.js +1 -0
  144. package/chunks/validate-symlinks-IPRYMDZD.js +1 -0
  145. package/chunks/validate-toml-KJZK7QVM.js +1 -0
  146. package/chunks/validate-trailing-whitespace-RO42VWQG.js +1 -0
  147. package/chunks/validate-yaml-H7G726ZM.js +1 -0
  148. package/chunks/versions-KW5UTMNV.js +1 -0
  149. package/chunks/vertexai-TPGIAJNA.js +1 -0
  150. package/chunks/workerd-LKKH32SO.js +1 -0
  151. package/eser.js +1 -1
  152. package/package.json +1 -1
  153. package/chunks/add-4LRHVBEC.js +0 -7
  154. package/chunks/approve-364KOMLB.js +0 -1
  155. package/chunks/ask-752YJEHO.js +0 -2
  156. package/chunks/block-JVJQU723.js +0 -1
  157. package/chunks/changelog-gen-ZCNNOY7G.js +0 -7
  158. package/chunks/chunk-2TRQKCFC.js +0 -1
  159. package/chunks/chunk-3TYZYY77.js +0 -1
  160. package/chunks/chunk-4HMEWMWL.js +0 -1
  161. package/chunks/chunk-5O7V5P53.js +0 -1
  162. package/chunks/chunk-5UGVJVIQ.js +0 -1
  163. package/chunks/chunk-6YRN6OJC.js +0 -2
  164. package/chunks/chunk-BKVQBSFV.js +0 -6
  165. package/chunks/chunk-CDLEA2PD.js +0 -1
  166. package/chunks/chunk-GRTR6TNJ.js +0 -1
  167. package/chunks/chunk-H2JGLZIR.js +0 -1
  168. package/chunks/chunk-HGNGFAAY.js +0 -60
  169. package/chunks/chunk-HVMMNGY5.js +0 -7
  170. package/chunks/chunk-L2BYHWDC.js +0 -1
  171. package/chunks/chunk-LRL56YFE.js +0 -1
  172. package/chunks/chunk-LU3DHXOC.js +0 -2
  173. package/chunks/chunk-NADES3GN.js +0 -1
  174. package/chunks/chunk-QIUIPRJP.js +0 -1
  175. package/chunks/chunk-R6F4EK2B.js +0 -4
  176. package/chunks/chunk-SCCNNGD4.js +0 -2
  177. package/chunks/chunk-SCULX2ND.js +0 -1
  178. package/chunks/chunk-VGFZXQMW.js +0 -1
  179. package/chunks/chunk-WE7PSSAQ.js +0 -91
  180. package/chunks/chunk-X4ZCYXOT.js +0 -1
  181. package/chunks/chunk-XMTGT2NJ.js +0 -10
  182. package/chunks/chunk-Y6DLCHJN.js +0 -1
  183. package/chunks/chunk-YUXQ7JNG.js +0 -1
  184. package/chunks/chunk-ZTLJ775S.js +0 -1
  185. package/chunks/claude-code-PWTLM554.js +0 -1
  186. package/chunks/clone-DASXIL35.js +0 -5
  187. package/chunks/file-tools-shared-ESMPLZVJ.js +0 -1
  188. package/chunks/gemini-I6F5N7PS.js +0 -1
  189. package/chunks/gh-Y4BXDXR5.js +0 -4
  190. package/chunks/init-GXBXQGGV.js +0 -1
  191. package/chunks/init-UFJL24PW.js +0 -12
  192. package/chunks/install-Q2KQZM62.js +0 -2
  193. package/chunks/kiro-NMTIFMT4.js +0 -1
  194. package/chunks/load-config-TSM3AAQ6.js +0 -1
  195. package/chunks/manifest-VJQJG2LS.js +0 -1
  196. package/chunks/mod-3PJAIZ2O.js +0 -1
  197. package/chunks/mod-7X3BOO5H.js +0 -1
  198. package/chunks/mod-FKPTF5D5.js +0 -1
  199. package/chunks/mod-GZ6BSK2P.js +0 -1
  200. package/chunks/mod-QODEWK3G.js +0 -9
  201. package/chunks/mod-STKIZYZ3.js +0 -27
  202. package/chunks/new-W5YBJFGW.js +0 -4
  203. package/chunks/next-773GX25N.js +0 -3
  204. package/chunks/ollama-DQ5VM4HI.js +0 -1
  205. package/chunks/opencode-IZMQZ4ZK.js +0 -1
  206. package/chunks/recipe-applier-F2REROYS.js +0 -1
  207. package/chunks/registry-fetcher-ZJ76EHBA.js +0 -1
  208. package/chunks/release-notes-Z53AFCII.js +0 -3
  209. package/chunks/release-tag-QRIKYVQB.js +0 -1
  210. package/chunks/reset-5LQGIOGB.js +0 -1
  211. package/chunks/rule-K42YEAMO.js +0 -2
  212. package/chunks/spec-5446CSQC.js +0 -1
  213. package/chunks/status-HK3P6J6G.js +0 -1
  214. package/chunks/sync-4FSA5257.js +0 -1
  215. package/chunks/system-3MH6OCP6.js +0 -1
  216. package/chunks/system-KWFBSQYQ.js +0 -1
  217. package/chunks/update-QD5S73WT.js +0 -5
  218. package/chunks/validate-bom-IVALGNGE.js +0 -1
  219. package/chunks/validate-case-conflict-LKECKLD5.js +0 -1
  220. package/chunks/validate-circular-deps-PXFPCBXA.js +0 -1
  221. package/chunks/validate-commit-msg-77CBKGOF.js +0 -1
  222. package/chunks/validate-docs-3UGB7LN7.js +0 -1
  223. package/chunks/validate-eof-ZSIYNHO5.js +0 -1
  224. package/chunks/validate-export-names-BPSCBX7B.js +0 -1
  225. package/chunks/validate-filenames-G4XJ2LHN.js +0 -1
  226. package/chunks/validate-json-YRCFW2O7.js +0 -1
  227. package/chunks/validate-large-files-MWWSFDOE.js +0 -1
  228. package/chunks/validate-licenses-Q2YA2MND.js +0 -1
  229. package/chunks/validate-line-endings-C6NHWHGI.js +0 -1
  230. package/chunks/validate-merge-conflict-KTBL4FUY.js +0 -1
  231. package/chunks/validate-mod-exports-LQIIQRIS.js +0 -1
  232. package/chunks/validate-package-configs-36PYXIWC.js +0 -1
  233. package/chunks/validate-secrets-UFDJ7ITY.js +0 -1
  234. package/chunks/validate-shebangs-3UO4MDMZ.js +0 -1
  235. package/chunks/validate-submodules-YA654D3B.js +0 -1
  236. package/chunks/validate-symlinks-R2PNE5TG.js +0 -1
  237. package/chunks/validate-toml-7H2N5AKI.js +0 -1
  238. package/chunks/validate-trailing-whitespace-HXO7M3ED.js +0 -1
  239. package/chunks/validate-yaml-ZJJCQVBB.js +0 -1
  240. package/chunks/versions-CWT5S7G4.js +0 -1
  241. package/chunks/vertexai-2SMP54AR.js +0 -1
  242. package/chunks/workerd-NXKZMQPV.js +0 -1
  243. /package/chunks/{chunk-QXTK62N4.js → chunk-ACQUINWH.js} +0 -0
  244. /package/chunks/{chunk-VTQ72OK7.js → chunk-FDZP7B5Y.js} +0 -0
  245. /package/chunks/{chunk-4OIKB2P5.js → chunk-T7K64JD5.js} +0 -0
@@ -1,60 +0,0 @@
1
- import{f as u,h as f,k as d}from"./chunk-FGDJVQG3.js";import{b as r,d as c,e as p,f as x,g as W,j as i}from"./chunk-PLJNPQFC.js";import{b as y}from"./chunk-DOV5776P.js";import{a as C}from"./chunk-4HNB3UTC.js";import{a as g,b as w}from"./chunk-DQAEQEXD.js";import{a as te,g as G,h as z,i as V,r as H,t as o}from"./chunk-GRTR6TNJ.js";var q=()=>o.env.get("HOME")??"",v=()=>{let n=o.env.get("SHELL")??"";return n.includes("zsh")?"zsh":n.includes("fish")?"fish":"bash"},ne=n=>{let e=q();switch(n){case"zsh":return o.path.join(e,".zshrc");case"bash":return o.path.join(e,".bashrc");case"fish":return o.path.join(e,".config","fish","config.fish")}},se=(n,e)=>{let t=q();switch(n){case"zsh":return o.path.join(t,".zshrc");case"bash":return o.path.join(t,".bashrc");case"fish":return o.path.join(t,".config","fish","completions",`${e}.fish`)}},_=(n,e)=>`eval "$(${e} system completions --shell ${n})"`,re=n=>n==="fish"?"file":"eval",k=(n,e="eser")=>{let t=n??v(),s=re(t);return{shell:t,rcFile:ne(t),completionType:s,completionsFile:s==="file"?se(t,e):void 0}};var ae="# eser CLI completions",U="eser",K=async n=>{try{return await o.fs.readTextFile(n)}catch{return""}},oe=async n=>{try{return await o.fs.stat(n),!0}catch{return!1}},Y=async n=>{let e=k(n,U);if(e.completionType==="file")return await oe(e.completionsFile);let t=await K(e.rcFile),s=_(n,U);return t.includes(s)},Q=async n=>{let e=k(n,U),t=u({renderer:d.ansi(),sink:f.stdout()});try{if(e.completionType==="file"){let s=e.completionsFile,a=o.path.dirname(s);try{await o.fs.mkdir(a,{recursive:!0})}catch{}await o.fs.writeTextFile(s,`# eser CLI completions
2
- # This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
3
- complete -c eser -f
4
- complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
5
- complete -c eser -n "__fish_use_subcommand" -a "system" -d "Commands related with this CLI"
6
- complete -c eser -n "__fish_use_subcommand" -a "install" -d "Install eser CLI globally"
7
- complete -c eser -n "__fish_use_subcommand" -a "update" -d "Update eser CLI to latest version"
8
- complete -c eser -n "__fish_seen_subcommand_from system" -a "install" -d "Install eser CLI globally"
9
- complete -c eser -n "__fish_seen_subcommand_from system" -a "uninstall" -d "Uninstall eser CLI globally"
10
- complete -c eser -n "__fish_seen_subcommand_from system" -a "update" -d "Update eser CLI to latest version"
11
- complete -c eser -n "__fish_seen_subcommand_from system" -a "completions" -d "Generate shell completion scripts"
12
- `),t.writeln(r(" "),c("Created"),r(" "),i(s))}else{let s=await K(e.rcFile),a=_(n,U);if(!s.includes(a)){let l=`
13
- ${ae}
14
- ${a}
15
- `;await o.fs.writeTextFile(e.rcFile,s+l),t.writeln(r(" "),c("Added completions to"),r(" "),i(e.rcFile))}}}catch(s){t.writeln(W(` Warning: Could not add shell completions: ${s instanceof Error?s.message:String(s)}`))}await t.close()},ie=async n=>{let e=k(n,U),t=u({renderer:d.ansi(),sink:f.stdout()});try{if(e.completionType==="file"){let s=e.completionsFile;await oe(s)&&(await o.fs.remove(s),t.writeln(r(" "),c("Removed"),r(" "),i(s)))}else{let s=await K(e.rcFile);if(s===""){await t.close();return}let a=_(n,U);if(!s.includes(a)){await t.close();return}let l=s.split(`
16
- `).filter(h=>!h.includes("eser system completions")).filter(h=>h!==ae).join(`
17
- `).replace(/\n{3,}/g,`
18
-
19
- `);await o.fs.writeTextFile(e.rcFile,l),t.writeln(r(" "),c("Removed completions from"),r(" "),i(e.rcFile))}}catch(s){t.writeln(W(` Warning: Could not remove shell completions: ${s instanceof Error?s.message:String(s)}`))}await t.close()};var ge={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},le={deno:{cmd:"deno",args:["install","-r","-g","-A","--name","eser","jsr:@eser/cli"]},node:{cmd:"npm",args:["install","-g","-f","eser"]},bun:{cmd:"bun",args:["install","-g","-f","eser"]}},we=async()=>{let n=o,e=V(),t=n.path.join(e,".local","bin");try{return await n.fs.stat(t),t}catch{}return"/usr/local/bin"},xe=async()=>{let n=o,e=n.process.execPath(),t=await we(),s=n.path.join(t,"eser"),a=u({renderer:d.ansi(),sink:f.stdout()});a.writeln(r("Install method: "),i("compiled binary")),a.writeln(c(`Copying to ${s}...`));try{await n.fs.copyFile(e,s),await n.fs.chmod(s,493)}catch(m){if(m instanceof Deno.errors.PermissionDenied)return a.writeln(p(`
20
- Permission denied writing to ${t}.
21
- Try: sudo eser install`)),await a.close(),w({exitCode:1});throw await a.close(),m}a.writeln(x(`
22
- Installation complete!`)),a.writeln(r("You can now use "),i("eser"),r(" from anywhere in your terminal."));let l=v();if(!await Y(l)){a.writeln(r(`
23
- Setting up `),i(l),r(" completions...")),await Q(l);let m=k(l);m.completionType==="eval"&&a.writeln(c(` Restart your shell or run 'source ${m.rcFile}' to enable completions.`))}return await a.close(),g(void 0)},ye=async n=>{let e=await H(ge);if(e.invoker==="binary")return await xe();let t=u({renderer:d.ansi(),sink:f.stdout()});t.writeln(r("Detected runtime: "),i(e.runtime));let s=le[e.runtime]??le.node,{cmd:a,args:l}=s;t.writeln(c(`Running: ${a} ${l.join(" ")}`)),t.writeln();let h=await y`${a} ${l}`.stdout("inherit").stderr("inherit").noThrow().spawn();if(!h.success)return t.writeln(p(`
24
- Installation failed.`)),await t.close(),w({exitCode:h.code});t.writeln(x(`
25
- Installation complete!`)),t.writeln(r("You can now use "),i("eser"),r(" from anywhere in your terminal."));let m=v();if(!await Y(m)){t.writeln(r(`
26
- Setting up `),i(m),r(" completions...")),await Q(m);let S=k(m);S.completionType==="eval"&&t.writeln(c(` Restart your shell or run 'source ${S.rcFile}' to enable completions.`))}return await t.close(),g(void 0)};var Ce={deno:{cmd:"deno",args:["uninstall","-g","eser"]},node:{cmd:"npm",args:["uninstall","-g","eser"]},bun:{cmd:"bun",args:["remove","-g","eser"]}},ve=async n=>{let e=te(),t=u({renderer:d.ansi(),sink:f.stdout()});t.writeln(r("Detected runtime: "),i(e));let s=Ce[e];if(s===void 0){let N=d.ansi();return await t.close(),w({message:`${N.render([p(`
27
- Unsupported runtime: ${e}`)])}
28
- Global uninstallation is only supported for Deno, Node.js, and Bun.`,exitCode:1})}let{cmd:a,args:l}=s,h=v();t.writeln(r(`
29
- Removing `),i(h),r(" completions...")),await ie(h),t.writeln(c(`
30
- Running: ${a} ${l.join(" ")}`)),t.writeln();let m=await y`${a} ${l}`.stdout("inherit").stderr("inherit").noThrow().spawn();return m.success?(t.writeln(x(`
31
- Uninstallation complete!`)),t.writeln(r("The "),i("eser"),r(" command has been removed from your system.")),await t.close(),g(void 0)):(t.writeln(p(`
32
- Uninstallation failed.`)),await t.close(),w({exitCode:m.code}))};var ce=".cache/eser",ke="latest-version.json",Ee=24*60*60*1e3,Pe="https://api.github.com/repos/eser/stack/releases/latest",de=()=>{let n=V();return o.path.join(n,ce,ke)},$e=()=>{let n=V();return o.path.join(n,ce)},Re=async()=>{let n=o;try{let e=de();if(!await n.fs.exists(e))return;let s=await n.fs.readTextFile(e),a=JSON.parse(s);return typeof a.latestVersion!="string"||typeof a.checkedAt!="number"?void 0:a}catch{return}},Se=async n=>{let e=o;try{let t=$e();await e.fs.ensureDir(t);let s=de(),a={latestVersion:n,checkedAt:Date.now()};await e.fs.writeTextFile(s,JSON.stringify(a))}catch{}},_e=async()=>{try{let n=await fetch(Pe,{headers:{Accept:"application/vnd.github.v3+json"}});if(!n.ok)return;let t=(await n.json()).tag_name;return typeof t!="string"?void 0:t.startsWith("v")?t.slice(1):t}catch{return}},I=async()=>{try{let n=C.version,e=await Re();if(e!==void 0&&Date.now()-e.checkedAt<Ee)return{latestVersion:e.latestVersion,currentVersion:n,updateAvailable:e.latestVersion!==n};let t=await _e();return t===void 0?void 0:(await Se(t),{latestVersion:t,currentVersion:n,updateAvailable:t!==n})}catch{return}};var Ae={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},me={deno:{cmd:"deno",args:["install","-r","-g","-A","-f","--name","eser","jsr:@eser/cli"]},node:{cmd:"npm",args:["update","-g","-f","eser"]},bun:{cmd:"bun",args:["update","-g","-f","eser"]}},be={"linux-amd64":"x86_64-unknown-linux-gnu","linux-arm64":"aarch64-unknown-linux-gnu","darwin-amd64":"x86_64-apple-darwin","darwin-arm64":"aarch64-apple-darwin","windows-amd64":"x86_64-pc-windows-msvc"},Te=()=>{let n=G(),e=z(),t=`${n}-${e}`;return be[t]},Fe=async()=>{let n=o,e=u({renderer:d.ansi(),sink:f.stdout()});e.writeln(r("Install method: "),i("compiled binary")),e.writeln(r("Current version: "),i(C.version),r(`
33
- `)),e.writeln(r("Checking for updates..."));let t=await I();if(t===void 0)return e.writeln(p("Could not check for updates.")),await e.close(),w({exitCode:1});if(!t.updateAvailable)return e.writeln(x(`
34
- Already up to date (v${C.version}).`)),await e.close(),g(void 0);e.writeln(r(`
35
- New version available: `),i(`v${t.latestVersion}`));let s=Te();if(s===void 0){let P=G(),b=z();return e.writeln(p(`
36
- Unsupported platform: ${P}-${b}`)),await e.close(),w({exitCode:1})}let a=`v${t.latestVersion}`,l=G()==="windows",m=`eser-${a}-${s}.${l?"zip":"tar.gz"}`,N=`https://github.com/eser/stack/releases/download/${a}`;e.writeln(c(`Downloading ${m}...`));let S=await fetch(`${N}/${m}`);if(!S.ok)return e.writeln(p(`
37
- Failed to download: HTTP ${S.status}`)),await e.close(),w({exitCode:1});let ee=await fetch(`${N}/SHA256SUMS.txt`);if(ee.ok){let b=(await ee.text()).split(`
38
- `).find(T=>T.includes(m));if(b!==void 0){let T=b.split(/\s+/)[0],F=new Uint8Array(await S.clone().arrayBuffer()),$=await crypto.subtle.digest("SHA-256",F);if(Array.from(new Uint8Array($)).map(he=>he.toString(16).padStart(2,"0")).join("")!==T)return e.writeln(p(`
39
- SHA256 checksum verification failed.`)),await e.close(),w({exitCode:1});e.writeln(c("Checksum verified."))}}let A=await n.fs.makeTempDir({prefix:"eser-update-"});try{let P=n.path.join(A,m),b=new Uint8Array(await S.arrayBuffer());await n.fs.writeFile(P,b),l?await y`powershell -Command "Expand-Archive -Path ${P} -DestinationPath ${A}"`.spawn():await y`tar -xzf ${P} -C ${A}`.spawn();let T=l?n.path.join(A,"eser.exe"):n.path.join(A,"eser"),F=n.process.execPath();if(l){let $=F.replace(/\.exe$/i,".new.exe");await n.fs.copyFile(T,$),e.writeln(x(`
40
- Downloaded v${t.latestVersion}!`)),e.writeln(r(`
41
- To complete the update, close this terminal and rename:
42
- `),i($),r(`
43
- to:
44
- `),i(F))}else{let $=`${F}.new`;await n.fs.copyFile(T,$),await n.fs.chmod($,493),await n.fs.rename($,F),e.writeln(x(`
45
- Updated to v${t.latestVersion}!`))}}catch(P){if(P instanceof Deno.errors.PermissionDenied)return e.writeln(p(`
46
- Permission denied. Try running with sudo:
47
- sudo eser update`)),await e.close(),w({exitCode:1});throw await e.close(),P}finally{try{await n.fs.remove(A,{recursive:!0})}catch{}}return await e.close(),g(void 0)},He=async n=>{let e=await H(Ae);if(e.invoker==="binary")return await Fe();let t=u({renderer:d.ansi(),sink:f.stdout()});t.writeln(r("Detected runtime: "),i(e.runtime));let s=me[e.runtime]??me.node,{cmd:a,args:l}=s;t.writeln(c(`Running: ${a} ${l.join(" ")}`)),t.writeln();let h=await y`${a} ${l}`.stdout("inherit").stderr("inherit").noThrow().spawn();return h.success?(t.writeln(x(`
48
- Update complete!`)),t.writeln(r("The "),i("eser"),r(" command has been updated to the latest version.")),await t.close(),g(void 0)):(t.writeln(p(`
49
- Update failed.`)),await t.close(),w({exitCode:h.code}))};var Ue=n=>{let e=k(n,"eser"),t=d.ansi();if(e.completionType==="file")return`
50
- To install, run:
51
-
52
- ${t.render([c(`eser system completions --shell fish > ${e.completionsFile}`)])}
53
- `;let s=_(n,"eser");return`
54
- To install, add the following to your ${t.render([i(e.rcFile)])}:
55
-
56
- ${t.render([c(s)])}
57
- `},je=n=>{let e=n.flags.shell,t=d.ansi(),s=u({renderer:t,sink:f.stdout()}),a;if(e!==void 0){if(!["bash","zsh","fish"].includes(e))return w({message:`${t.render([p(`Invalid shell: ${e}`)])}
58
- Supported shells: bash, zsh, fish`,exitCode:1});a=e}else a=v();let h=n.root.completions(a);return e===void 0&&(s.writeln(r("Generating "),i(a),r(" completions...")),console.log(Ue(a)),s.writeln(c(`--- Completion script ---
59
- `))),console.log(h),g(void 0)};var De=200,Ie=async n=>{let e=u({renderer:d.ansi(),sink:f.stdout()});if(n.flags.bare===!0)return e.writeln(r(C.version)),await e.close(),g(void 0);e.writeln(r(`eser ${C.version}`));try{let t=new Promise(a=>{setTimeout(()=>a(void 0),De)}),s=await Promise.race([I(),t]);s!==void 0&&s.updateAvailable&&e.writeln(c(` Update available: v${s.latestVersion} \u2014 run 'eser update'`))}catch{}return await e.close(),g(void 0)};var Le={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},M=17,R=u({renderer:d.ansi(),sink:f.stdout()}),L=(n,e)=>{let t=`${n}:`.padEnd(M);R.writeln(r(` ${t}`),x("\u2713"),r(` ${e}`))},E=(n,e)=>{let t=`${n}:`.padEnd(M);R.writeln(r(` ${t}`),p("\u2717"),r(` ${e}`))},pe=(n,e)=>{let t=`${n}:`.padEnd(M);R.writeln(r(` ${t}${e}`))},Ne=(n,e)=>{let t=`${n}:`.padEnd(M);R.writeln(r(` ${t}`),c("-"),r(` ${e}`))},ue=async n=>{try{return await o.fs.stat(n),!0}catch{return!1}},Ve=async n=>{try{return await o.fs.readTextFile(n)}catch{return""}},fe=(n,e)=>n.match(e)?.[1],Oe=async()=>{let n=o.path.join(".",".git","hooks","pre-commit");if(!await ue(n)){E("Git hooks","Not installed");return}(await Ve(n)).includes("eser")?L("Git hooks","Installed"):E("Git hooks","Not installed")},Ge=async()=>{let n=o.path.join(".",".manifest.yml");await ue(n)?L("Manifest",".manifest.yml found"):E("Manifest",".manifest.yml not found")},Be=async()=>{try{let n=await y`deno --version`.noThrow().quiet().text(),e=fe(n,/deno\s+(\S+)/);e!==void 0?L("Deno",e):E("Deno","Not found")}catch{E("Deno","Not found")}},Me=async()=>{try{let n=await y`go version`.noThrow().quiet().text(),e=fe(n,/go(\d+\.\d+(?:\.\d+)?)/);e!==void 0?L("Go",e):E("Go","Not found")}catch{E("Go","Not found")}},ze=async()=>{try{let e=(await y`node --version`.noThrow().quiet().text()).trim();e.length>0?L("Node",e):E("Node","Not found")}catch{E("Node","Not found")}},We=async n=>{R.writeln(r(`eser doctor
60
- `));let e=await H(Le);pe("Install method",`${e.invoker} (${e.mode})`),pe("Version",C.version);let t=await I();return t===void 0?Ne("Update","Could not check for updates"):t.updateAvailable?E("Update",`Update available: v${t.latestVersion}`):L("Update","Up to date"),R.writeln(),await Oe(),await Ge(),R.writeln(),await Be(),await Me(),await ze(),await R.close(),g(void 0)};export{ye as a,ve as b,He as c,je as d,Ie as e,We as f};
@@ -1,7 +0,0 @@
1
- import{a as d}from"./chunk-VFMYWG2I.js";var c="2023",p=new RegExp(`// Copyright ([0-9]{4})-present Eser Ozvataf and other contributors\\. All rights reserved\\. ([0-9A-Za-z-.]+) license\\.
2
- `),l=`// Copyright ${c}-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license.`,m=[/docs\//,/etc\/templates\//,/manifest\.gen\.ts$/],u=t=>m.some(e=>e.test(t)),x=(t,e,r)=>{if(e===void 0||u(t.path))return[];let n=e.startsWith("#!")?e.indexOf(`
3
- `)+1:0,s=e.slice(n).match(p);return s!==null?s[1]===c?[]:[{path:t.path,message:"incorrect copyright year",fixed:r.fix}]:[{path:t.path,message:"missing copyright header",fixed:r.fix}]},T=(t,e,r)=>{if(u(t.path))return;let a=e.startsWith("#!"),n=a?e.indexOf(`
4
- `)+1:0,i=e.slice(n),s=i.match(p);if(s!==null&&s[1]===c)return;let o;if(s!==null){let g=e.slice(0,n),f=i.replace(s[0],"");o=`${g}${l}
5
- ${f}`}else o=a?`${e.slice(0,n)}${l}
6
- ${i}`:`${l}
7
- ${e}`;return{path:t.path,oldContent:e,newContent:o}},h=d({name:"validate-licenses",description:"Validate license headers",canFix:!0,stacks:["javascript"],defaults:{},extensions:[".tsx",".jsx",".ts",".js",".mts",".mjs",".cts",".cjs"],checkFile:x,fixFile:T}),E=h.run,C=h.validator,S=h.main;export{h as a,E as b,C as c,S as d};
@@ -1 +0,0 @@
1
- import{a as i}from"./chunk-VFMYWG2I.js";import{u as s}from"./chunk-GRTR6TNJ.js";var a=i({name:"validate-symlinks",description:"Detect broken symlinks",canFix:!1,stacks:[],defaults:{},async checkAll(n){let o=[];for(let t of n)if(t.isSymlink)try{await s.current.fs.stat(t.path)}catch{o.push({path:t.path,message:"broken symlink \u2014 target not found"})}return o}}),l=a.run,c=a.validator,m=a.main;export{a,l as b,c,m as d};
@@ -1 +0,0 @@
1
- var c=(t,e)=>({role:t,content:[{kind:"text",text:e}]});var l="data:",i=";base64,",u=t=>t.startsWith(l),d=t=>{if(!t.startsWith(l))return null;let e=t.slice(l.length),o=e.indexOf(i);if(o===-1)return null;let s=e.slice(0,o),g=e.slice(o+i.length),r=atob(g),a=new Uint8Array(r.length);for(let n=0;n<r.length;n++)a[n]=r.charCodeAt(n);return{mimeType:s,data:a}},p={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".flac":"audio/flac",".m4a":"audio/mp4",".webm":"audio/webm",".pdf":"application/pdf",".json":"application/json",".txt":"text/plain"},m=t=>{let e=t.split("?")[0]??t,o=e.lastIndexOf(".");if(o===-1)return null;let s=e.slice(o).toLowerCase();return p[s]??null};export{c as a,u as b,d as c,m as d};
@@ -1,2 +0,0 @@
1
- import{e as w,f as C}from"./chunk-ATLUGTI7.js";import{a as A}from"./chunk-6U2VEZEM.js";import{a as O,b as U}from"./chunk-JQHMDTPL.js";import{a as b,b as x,c as F,d as m}from"./chunk-2TRQKCFC.js";import{f as v}from"./chunk-NUSNMQPL.js";import{b as i,f as P,h as l}from"./chunk-PLJNPQFC.js";import{a as S}from"./chunk-HPPFA3XU.js";import{g as a}from"./chunk-DQAEQEXD.js";import{j as h}from"./chunk-GLSCZGXA.js";import{u as V}from"./chunk-GRTR6TNJ.js";var d=O(),M=async(s={})=>{let{root:e="."}=s,n=h(e,"VERSION");try{return(await V.current.fs.readTextFile(n)).trim()}catch{return}},T=async(s,e)=>{let n=h(s,"VERSION");await V.current.fs.writeTextFile(n,e+`
2
- `)},j=s=>{let e=m("0.0.0");for(let n of s){let r=m(n);b(r,e)>0&&(e=r)}return x(e)},H=async(s={})=>{let{root:e="."}=s,[n,r]=await C(e),p=n.version?.value??"0.0.0";return{packages:[{name:n.name?.value??"(root)",version:p},...r.map(u=>({name:u.name,version:u.version}))]}},D=async(s,e={})=>{let{root:n=".",dryRun:r=!1,updateVersionFile:p=!0}=e,[c,y]=await C(n),u=c.version?.value??"0.0.0",E=c.name?.value??"(root)",$=[u,...y.map(o=>o.version)],k=j($),t;if(s==="explicit"){if(e.explicitVersion===void 0)throw new Error('explicitVersion is required when command is "explicit".');m(e.explicitVersion),t=e.explicitVersion}else s==="sync"?t=k:t=x(F(m(k),s));let g=[],I=u!==t;r||await w(c,t),g.push({name:E,from:u,to:t,changed:I});for(let o of y){let f=o.version!==t;r||await w(o.config,t),g.push({name:o.name,from:o.version,to:t,changed:f})}let R=[];if(p){let o=await M({root:n}),f=o!==t;!r&&f&&await T(n,t),R.push({path:"VERSION",from:o??"",to:t,changed:f})}let N=g.filter(o=>o.changed).length;return{command:s,targetVersion:t,updates:g,fileUpdates:R,changedCount:N,dryRun:r}},W=s=>s.mode==="show"?v.fromPromise(async()=>({mode:"show",result:await H()})):v.fromPromise(async()=>({mode:"update",result:await D(s.command,s.options)})),q=s=>{let e=s.args[0];if(e===void 0)return a.ok({mode:"show"});let n=["sync","patch","minor","major"],r,p;n.includes(e)?r=e:(r="explicit",p=e);let c=s.flags["dry-run"]===!0;return a.ok({mode:"update",command:r,options:{dryRun:c,explicitVersion:p}})},B=s=>{if(a.isFail(s))return a.fail({exitCode:1,message:String(s.error)});let e=s.value;if(e.mode==="show")return console.table(e.result.packages),a.ok(void 0);let{result:n}=e;n.command==="sync"?d.writeln(l("\u2139"),i(" Syncing all versions...")):n.command==="explicit"?d.writeln(l("\u2139"),i(` Setting all versions to ${n.targetVersion}...`)):d.writeln(l("\u2139"),i(` Bumping all versions (${n.command})...`)),d.writeln(l("\u2139"),i(` Target version: ${n.targetVersion}`)),console.table(n.updates);for(let r of n.fileUpdates)r.changed&&d.writeln(l("\u2139"),i(` ${r.path} (${r.from} \u2192 ${r.to})`));return n.dryRun?d.writeln(l("\u2139"),i(` Dry run - ${n.changedCount} packages would be modified.`)):d.writeln(P("\u2713"),i(` Done. Updated ${n.changedCount} packages.`)),a.ok(void 0)},z=A.createTrigger({handler:W,adaptInput:q,adaptOutput:B}),ne=async s=>{let e=S(s??[],{boolean:["dry-run"]}),n=U("versions",e);return await z(n)};export{M as a,H as b,D as c,W as d,z as e,ne as f};
@@ -1 +0,0 @@
1
- import{a as i}from"./chunk-VFMYWG2I.js";var a="\uFEFF",e=i({name:"validate-bom",description:"Remove UTF-8 byte order markers",canFix:!0,stacks:[],defaults:{},checkFile(r,t){return t===void 0?[]:t.startsWith(a)?[{path:r.path,message:"file has UTF-8 BOM"}]:[]},fixFile(r,t){if(!t.startsWith(a))return;let o=t.slice(1);return{path:r.path,oldContent:t,newContent:o}}}),u=e.run,d=e.validator,p=e.main;export{e as a,u as b,d as c,p as d};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-VFMYWG2I.js";import{t}from"./chunk-GRTR6TNJ.js";var e=a({name:"validate-submodules",description:"Detect new git submodules",canFix:!1,stacks:[],defaults:{},async checkAll(n,i){let o=t.path.join(i.root,".gitmodules");if(!await t.fs.exists(o))return[];let s=((await t.fs.readTextFile(o)).match(/\[submodule\s/g)??[]).length;return s>0?[{path:o,message:`found ${s} submodule(s) \u2014 submodules are not allowed`}]:[]}}),p=e.run,f=e.validator,x=e.main;export{e as a,p as b,f as c,x as d};
@@ -1,4 +0,0 @@
1
- import{b as k}from"./chunk-5UGVJVIQ.js";import{d as F,f as T,h as C,j as d,k as L,n as u}from"./chunk-GLSCZGXA.js";import{a as g}from"./chunk-ZE5T64HQ.js";import{t as D}from"./chunk-GRTR6TNJ.js";var R={USE_CLIENT:"use client",USE_SERVER:"use server",USE_STRICT:"use strict"},M=[/node_modules/,/\.test\./,/\.spec\./],G=(t,e)=>{let r=t.split(`
2
- `),i=e.toLowerCase(),o=!1;for(let s=0;s<Math.min(50,r.length);s++){let n=r[s]?.trim()??"";if(o){n.includes("*/")&&(o=!1);continue}if(n===""||n.startsWith("//"))continue;if(n.startsWith("/*")){n.includes("*/")||(o=!0);continue}let f=`"${i}";`,a=`'${i}';`,l=n.toLowerCase();if(l===f||l===a)return!0;if(n.startsWith("import")||n.startsWith("export")||n.startsWith("const")||n.startsWith("let")||n.startsWith("var")||n.startsWith("function")||n.startsWith("class"))break}return!1},W=t=>{let e=new Set,r=t.matchAll(/export\s+(?:async\s+)?function\s+(\w+)/g);for(let n of r)n[1]!==void 0&&e.add(n[1]);let i=t.matchAll(/export\s+(?:const|let)\s+(\w+)\s*=/g);for(let n of i)n[1]!==void 0&&e.add(n[1]);let o=t.matchAll(/export\s+class\s+(\w+)/g);for(let n of o)n[1]!==void 0&&e.add(n[1]);/export\s+default\s+/.test(t)&&e.add("default");let s=t.matchAll(/export\s*\{([\w\s,]+)\}/g);for(let n of s)if(n[1]!==void 0){let f=n[1].split(",").map(a=>{let l=a.trim().split(/ {1,10}as {1,10}/);return(l[1]??l[0])?.trim()});for(let a of f)a!==void 0&&a!==""&&e.add(a)}return[...e]},O=async t=>{try{return await D.fs.readTextFile(t)}catch{return null}},Q=async(t,e,r={})=>{let i=r.extensions??k,o=r.skip??M,s=r.projectRoot??t,n=[];for await(let f of D.fs.walk(t,{exts:[...i],skip:[...o]})){if(!f.isFile)continue;let a=await O(f.path);if(a!==null&&G(a,e)){let l=D.path.relative(s,f.path),m=W(a);n.push({filePath:f.path,relativePath:l,directive:e,exports:m})}}return n},Y=(t,e={})=>Q(t,R.USE_CLIENT,e),X=(t,e)=>{let r=`"${e}"`,i=`'${e}'`;return t.includes(r)||t.includes(i)},Z=async(t,e={})=>{let r=e.extensions??k,i=e.skip??M,o=e.projectRoot??t,s=[];for await(let n of D.fs.walk(t,{exts:[...r],skip:[...i]})){if(!n.isFile)continue;let f=await O(n.path);if(f!==null&&X(f,R.USE_SERVER)){let a=D.path.relative(o,n.path),l=W(f);s.push({filePath:n.path,relativePath:a,directive:R.USE_SERVER,exports:l})}}return s};function w(t){return t.isFile?"file":t.isDirectory?"dir":t.isSymlink?"symlink":void 0}async function x(t){try{let e=await Deno.stat(t);_(e);return}catch(e){if(!(e instanceof Deno.errors.NotFound))throw e}try{await Deno.mkdir(t,{recursive:!0})}catch(e){if(!(e instanceof Deno.errors.AlreadyExists))throw e;let r=await Deno.stat(t);_(r)}}function _(t){if(!t.isDirectory)throw new Error(`Failed to ensure directory exists: expected 'dir', got '${w(t)}'`)}function c(t){return t instanceof URL?C(t):t}function P(t,e,r=T){if(t=c(t),e=c(e),u(t)===u(e))return!1;let i=t.split(r),o=e.split(r);return i.every((s,n)=>o[n]===s)}function S(t,e){if(t===null)throw new Error(`${e} is unavailable`)}async function I(t,e,r){let i;try{i=await Deno.lstat(e)}catch(o){if(o instanceof Deno.errors.NotFound)return;throw o}if(r.isFolder&&!i.isDirectory)throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'`);if(!r.overwrite)throw new Deno.errors.AlreadyExists(`'${e}' already exists.`);return i}async function N(t,e,r){if(await I(t,e,r),await Deno.copyFile(t,e),r.preserveTimestamps){let i=await Deno.stat(t);S(i.atime,"statInfo.atime"),S(i.mtime,"statInfo.mtime"),await Deno.utime(e,i.atime,i.mtime)}}async function U(t,e,r){await I(t,e,r);let i=await Deno.readLink(t),o=w(await Deno.lstat(t));if(g?await Deno.symlink(i,e,{type:o==="dir"?"dir":"file"}):await Deno.symlink(i,e),r.preserveTimestamps){let s=await Deno.lstat(t);S(s.atime,"statInfo.atime"),S(s.mtime,"statInfo.mtime"),await Deno.utime(e,s.atime,s.mtime)}}async function j(t,e,r){if(await I(t,e,{...r,isFolder:!0})||await x(e),r.preserveTimestamps){let s=await Deno.stat(t);S(s.atime,"statInfo.atime"),S(s.mtime,"statInfo.mtime"),await Deno.utime(e,s.atime,s.mtime)}t=c(t),e=c(e);let o=[];for await(let s of Deno.readDir(t)){let n=d(t,s.name),f=d(e,F(n));s.isSymlink?o.push(U(n,f,r)):s.isDirectory?o.push(j(n,f,r)):s.isFile&&o.push(N(n,f,r))}await Promise.all(o)}async function wt(t,e,r={}){if(t=u(c(t)),e=u(c(e)),t===e)throw new Error("Source and destination cannot be the same");let i=await Deno.lstat(t);if(i.isDirectory&&P(t,e))throw new Error(`Cannot copy '${t}' to a subdirectory of itself: '${e}'`);i.isSymlink?await U(t,e,r):i.isDirectory?await j(t,e,r):i.isFile&&await N(t,e,r)}async function Ft(t){try{let e=await Array.fromAsync(Deno.readDir(t));await Promise.all(e.map(r=>{if(r&&r.name){let i=d(c(t),r.name);return Deno.remove(i,{recursive:!0})}}))}catch(e){if(!(e instanceof Deno.errors.NotFound))throw e;await Deno.mkdir(t,{recursive:!0})}}async function A(t){t=c(t),t=L(t);let e=F(t),r=await Deno.stat(t);return{path:t,name:e,isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink}}function E(t,e,r,i){return!(e&&!e.some(o=>t.endsWith(o))||r&&!r.some(o=>!!t.match(o))||i&&i.some(o=>!!t.match(o)))}async function*V(t,e){let{maxDepth:r=1/0,includeFiles:i=!0,includeDirs:o=!0,includeSymlinks:s=!0,followSymlinks:n=!1,canonicalize:f=!0,exts:a=void 0,match:l=void 0,skip:m=void 0}=e??{};if(!(r<0)&&(t=c(t),a&&(a=a.map(y=>y.startsWith(".")?y:`.${y}`)),o&&E(t,a,l,m)&&(yield await A(t)),!(r<1||!E(t,void 0,void 0,m))))for await(let y of Deno.readDir(t)){let p=d(t,y.name),{isSymlink:v,isDirectory:$}=y;if(v){if(!n){s&&E(p,a,l,m)&&(yield{path:p,...y});continue}let h=await Deno.realPath(p);f&&(p=h),{isSymlink:v,isDirectory:$}=await Deno.lstat(h)}if(v||$){let h={maxDepth:r-1,includeFiles:i,includeDirs:o,includeSymlinks:s,followSymlinks:n};a!==void 0&&(h.exts=a),l!==void 0&&(h.match=l),m!==void 0&&(h.skip=m),yield*V(p,h)}else i&&E(p,a,l,m)&&(yield{path:p,...y})}}var ue=globalThis.Deno?.build.os==="windows"?"`":"\\";var B=`
3
- `,J=`\r
4
- `,xe=globalThis.Deno?.build.os==="windows"?J:B;export{G as a,W as b,Y as c,Z as d,Ft as e,x as f,V as g,wt as h};
@@ -1,2 +0,0 @@
1
- import{a as o}from"./chunk-VFMYWG2I.js";var r=o({name:"validate-trailing-whitespace",description:"Remove trailing whitespace from lines",canFix:!0,stacks:[],defaults:{},checkFile(a,i){if(i===void 0)return[];let t=[],n=i.split(`
2
- `);for(let e=0;e<n.length;e++)/[ \t]+$/.test(n[e])&&t.push({path:a.path,line:e+1,message:"trailing whitespace"});return t},fixFile(a,i){let t=i.replace(/[ \t]+$/gm,"");if(t!==i)return{path:a.path,oldContent:i,newContent:t}}}),c=r.run,u=r.validator,d=r.main;export{r as a,c as b,u as c,d};
@@ -1 +0,0 @@
1
- var g=["registry/v1"],h=["file","folder"],w=["local","github"],m=r=>r==="project"||r==="structure"||r==="utility",R=r=>{if(typeof r!="object"||r===null)return!1;let e=r;return!(typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!h.includes(e.kind)||e.provider!==void 0&&!w.includes(e.provider))},$=r=>{if(typeof r!="object"||r===null)return!1;let e=r;return!(e.go!==void 0&&!Array.isArray(e.go)||e.jsr!==void 0&&!Array.isArray(e.jsr)||e.npm!==void 0&&!Array.isArray(e.npm))},b=r=>{if(typeof r!="object"||r===null)return!1;let e=r;return!(typeof e.name!="string"||e.name===""||typeof e.description!="string"||e.default!==void 0&&typeof e.default!="string"||e.prompt!==void 0&&typeof e.prompt!="string")},f=r=>{if(typeof r!="object"||r===null)return!1;let e=r;if(typeof e.name!="string"||e.name===""||typeof e.description!="string"||typeof e.language!="string"||!m(e.scale)||!Array.isArray(e.files)||e.files.length===0)return!1;for(let t of e.files)if(!R(t))return!1;if(e.dependencies!==void 0&&!$(e.dependencies)||e.tags!==void 0&&!Array.isArray(e.tags))return!1;if(e.requires!==void 0){if(!Array.isArray(e.requires))return!1;for(let t of e.requires)if(typeof t!="string")return!1}if(e.variables!==void 0){if(!Array.isArray(e.variables))return!1;for(let t of e.variables)if(!b(t))return!1}if(e.postInstall!==void 0){if(!Array.isArray(e.postInstall))return!1;for(let t of e.postInstall)if(typeof t!="string")return!1}return!0},d=r=>{if(typeof r!="object"||r===null)throw new Error("Registry manifest must be a JSON object");let e=r;if(e.$schema!==void 0){let i=String(e.$schema);g.some(s=>i.includes(s))||console.warn(`Warning: Registry uses unknown schema "${i}". This CLI supports v1.`)}if(typeof e.name!="string"||e.name==="")throw new Error("Registry manifest requires a non-empty 'name' field");if(typeof e.description!="string")throw new Error("Registry manifest requires a 'description' field");if(typeof e.author!="string")throw new Error("Registry manifest requires an 'author' field");if(typeof e.registryUrl!="string"||e.registryUrl==="")throw new Error("Registry manifest requires a non-empty 'registryUrl' field");if(!Array.isArray(e.recipes))throw new Error("Registry manifest requires a 'recipes' array");for(let i of e.recipes)if(!f(i)){let o=typeof i=="object"&&i!==null?i.name??"<unknown>":"<invalid>";throw new Error(`Invalid recipe definition: '${o}'`)}let t=e.recipes,n=new Set;for(let i of t){if(n.has(i.name))throw new Error(`Duplicate recipe name '${i.name}' in registry`);n.add(i.name)}return r},p=r=>{if(!f(r))throw new Error("Invalid recipe definition");return r},u=(r,e)=>{let t=r.replace(/\/+$/,""),n=e.replace(/^\/+/,"");return`${t}/${n}`};var F=3e4,S="https://raw.githubusercontent.com/eser/stack/main/etc/registry/eser-registry.json",k="etc/registry/eser-registry.json",l=async r=>await globalThis.fetch(r,{signal:AbortSignal.timeout(F)}),A=async()=>{let r=Deno.cwd();for(let e=0;e<10;e++){let t=`${r}/${k}`;try{return await Deno.stat(t),t}catch{let n=r.replace(/\/[^/]+$/,"");if(n===r)break;r=n}}},j=async(r,e)=>{let t=r??S;if(e?.local===!0&&r===void 0){let s=await A();s!==void 0&&(t=s,e?.verbose===!0&&console.log(`Using local registry: ${s}`))}let n=t.startsWith("http://")||t.startsWith("https://");e?.verbose===!0&&console.log(`Fetching registry from: ${t}`);let i;if(n){let s=await l(t);if(!s.ok)throw new Error(`Could not reach registry at ${t}. HTTP ${s.status}`);i=await s.text()}else try{i=await Deno.readTextFile(t)}catch{throw new Error(`Could not read registry file at ${t}`)}let o;try{o=JSON.parse(i)}catch{throw new Error(`Registry at ${t} is not valid JSON`)}return d(o)},I=async(r,e)=>{let t=u(r,e),n=await l(t);if(!n.ok)throw new Error(`Could not fetch recipe file at ${t}. HTTP ${n.status}`);return await n.text()},P=r=>{let e=r.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)(?:\/(.*))?$/);if(e!==null)return{owner:e[1],repo:e[2],ref:e[3],basePath:e[4]??""}},U=async(r,e)=>{let t=P(r);if(t===void 0)throw new Error(`Cannot fetch folder: registry URL '${r}' is not a GitHub raw URL`);let n=t.basePath?`${t.basePath}/${e}`.replace(/\/+/g,"/"):e,i=`https://api.github.com/repos/${t.owner}/${t.repo}/contents/${n}?ref=${t.ref}`,o=await l(i);if(!o.ok)throw new Error(`Could not list folder '${n}' from ${t.owner}/${t.repo}. HTTP ${o.status}`);let s=await o.json();if(!Array.isArray(s))throw new Error(`Expected directory listing for '${n}', got a file instead`);let y=s.filter(a=>a.type==="file").map(async a=>{if(a.download_url===null)throw new Error(`File '${a.path}' has no download URL (may be too large)`);let c=await l(a.download_url);if(!c.ok)throw new Error(`Could not fetch file '${a.path}'. HTTP ${c.status}`);return{path:a.path.startsWith(n)?a.path.slice(n.length).replace(/^\//,""):a.path,content:await c.text()}});return await Promise.all(y)},_=async(r,e,t="main",n="recipe.json")=>{let i=`https://raw.githubusercontent.com/${r}/${e}/${t}/${n}`,o=await l(i);if(!o.ok)throw new Error(`Could not fetch recipe from ${r}/${e}@${t}/${n}. HTTP ${o.status}`);let s;try{s=JSON.parse(await o.text())}catch{throw new Error(`Recipe file at ${r}/${e}@${t}/${n} is not valid JSON`)}return p(s)};export{F as a,S as b,k as c,l as d,A as e,j as f,I as g,P as h,U as i,_ as j};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-VFMYWG2I.js";var o=1024,i=a({name:"validate-large-files",description:"Detect files exceeding size limit",canFix:!1,stacks:[],defaults:{maxKb:o},checkAll(n,r){let t=r.maxKb??o,l=t*1024,s=[];for(let e of n)if(e.size>l){let c=Math.round(e.size/1024);s.push({path:e.path,message:`file is ${c}KB (max: ${t}KB)`})}return s}}),d=i.run,f=i.validator,x=i.main;export{i as a,d as b,f as c,x as d};
@@ -1,91 +0,0 @@
1
- import{a as u}from"./chunk-HPPFA3XU.js";import{a as p,b as f}from"./chunk-DQAEQEXD.js";import{t as x}from"./chunk-GRTR6TNJ.js";var h=t=>{let e=[],n=[],r={},s={};for(let i of t)i.type==="boolean"?e.push(i.name):n.push(i.name),i.short!==void 0&&(r[i.short]=i.name),i.default!==void 0&&(s[i.name]=i.default);return{boolean:e,string:n,alias:r,default:s}},T=t=>t!=null&&t.constructor===String,V={boolean:t=>!!t,number:t=>T(t)?Number(t):t,string:t=>String(t),"string[]":t=>Array.isArray(t)?t.map(String):[String(t)]},v=(t,e)=>{if(t!==void 0)return V[e]?.(t)??t},$=(t,e)=>{let n={};for(let r of e){let s=t[r.name];n[r.name]=v(s,r.type)}return n},re=(t,e)=>{let n=h(e),r=u(t,n);return{positional:r._,flags:$(r,e)}},_=(t,e)=>{let n=[];for(let r of e)if(r.required===!0){let s=t[r.name];(s===void 0||s===""||s===!1)&&n.push(`Required flag --${r.name} is missing`)}return n};var O=(t,e)=>t+" ".repeat(Math.max(0,e-t.length)),U=t=>{let e=t.short!==void 0?`-${t.short}, `:"",n=t.type!=="boolean"?` <${t.type}>`:"";return`${e}--${t.name}${n}`},q=(t,e)=>[t.description!==void 0?`${e} - ${t.description}`:e,""],B=(t,e)=>{if(t.usage!==void 0)return["Usage:",` ${t.usage}`,""];let n=t.children.length>0?" <command>":"",r=t.flags.length>0?" [options]":"";return["Usage:",` ${e}${n}${r}`,""]},I=t=>{if(t.length===0)return[];let e=Math.max(...t.map(r=>r.name.length));return["Commands:",...t.map(r=>` ${O(r.name,e+2)}${r.description??""}`),""]},Y=t=>{if(t.length===0)return[];let e=t.map(s=>({flag:U(s),desc:s.description})),n=Math.max(...e.map(s=>s.flag.length));return["Options:",...e.map(({flag:s,desc:i})=>` ${O(s,n+2)}${i}`),""]},Z=t=>t?.length?["Examples:",...t.map(e=>` ${e}`),""]:[],k=(t,e)=>{let n=e.join(" "),r=[...q(t,n),...B(t,n),...I(t.children),...Y(t.flags),...Z(t.examples)];return t.children.length>0&&r.push(`Run '${n} <command> --help' for more information on a command.`),r.join(`
2
- `)};var w=t=>{let e=[];for(let n of t)e.push(`--${n.name}`),n.short!==void 0&&e.push(`-${n.short}`);return e.join(" ")},M=(t,e)=>{if(t.children===void 0||t.children.length===0)return"";let n=t.children.map(o=>o.name).join(" "),r=t.flags!==void 0?w(t.flags):"",s=[n,r].filter(o=>o.length>0).join(" "),i=` ${e})
3
- `;i+=` COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
4
- `,i+=` return 0
5
- `,i+=` ;;
6
- `;for(let o of t.children)o.children!==void 0&&o.children.length>0&&(i+=M(o,`${e} ${o.name}`));return i},R=(t,e)=>{let n=e.children?.map(o=>o.name).join(" ")??"",r=e.flags!==void 0?w(e.flags):"",s=[n,r].filter(o=>o.length>0).join(" "),i="";if(e.children!==void 0)for(let o of e.children)i+=M(o,o.name);return`# ${t} bash completion
7
- # Generated by @eser/shell/completions
8
-
9
- _${t}_completions() {
10
- local cur prev words cword
11
- _init_completion || return
12
-
13
- COMPREPLY=()
14
- cur="\${COMP_WORDS[COMP_CWORD]}"
15
- prev="\${COMP_WORDS[COMP_CWORD-1]}"
16
-
17
- # Build the command path from words
18
- local cmd_path=""
19
- local i
20
- for ((i=1; i<COMP_CWORD; i++)); do
21
- case "\${COMP_WORDS[i]}" in
22
- -*)
23
- # Skip flags
24
- ;;
25
- *)
26
- if [[ -n "$cmd_path" ]]; then
27
- cmd_path="$cmd_path \${COMP_WORDS[i]}"
28
- else
29
- cmd_path="\${COMP_WORDS[i]}"
30
- fi
31
- ;;
32
- esac
33
- done
34
-
35
- case "$cmd_path" in
36
- ${i} "")
37
- COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
38
- return 0
39
- ;;
40
- esac
41
- }
42
-
43
- complete -F _${t}_completions ${t}
44
- `};var D=t=>t.replace(/'/g,"'\\''"),K=t=>{let e=[];for(let n of t){let r=D(n.description??`${n.name} flag`);n.takesValue===!0?(e.push(`'--${n.name}=[${r}]'`),n.short!==void 0&&e.push(`'-${n.short}=[${r}]'`)):(e.push(`'--${n.name}[${r}]'`),n.short!==void 0&&e.push(`'-${n.short}[${r}]'`))}return e},Q=t=>t.map(n=>{let r=D(n.description??n.name);return`'${n.name}:${r}'`}).join(`
45
- `),P=(t,e,n)=>{let s=`${n.length===0?`_${t}`:`_${t}_${n.join("_")}`}() {
46
- `;if(s+=` local -a commands
47
- `,s+=` local -a flags
48
-
49
- `,e.flags!==void 0&&e.flags.length>0){let i=K(e.flags);s+=` flags=(
50
- ${i.join(`
51
- `)}
52
- )
53
-
54
- `}if(e.children!==void 0&&e.children.length>0){s+=` commands=(
55
- `,s+=` ${Q(e.children)}
56
- `,s+=` )
57
-
58
- `,s+=` _arguments -C \\
59
- `,e.flags!==void 0&&e.flags.length>0&&(s+=' "${flags[@]}" \\\n'),s+=` '1: :->command' \\
60
- `,s+=` '*::arg:->args'
61
-
62
- `,s+=` case "$state" in
63
- `,s+=` command)
64
- `,s+=` _describe -t commands 'command' commands
65
- `,s+=` ;;
66
- `,s+=` args)
67
- `,s+=' case "${words[1]}" in\n';for(let i of e.children){let o=[...n,i.name],a=`_${t}_${o.join("_")}`;s+=` ${i.name})
68
- `,s+=` ${a}
69
- `,s+=` ;;
70
- `}s+=` esac
71
- `,s+=` ;;
72
- `,s+=` esac
73
- `}else e.flags!==void 0&&e.flags.length>0&&(s+=' _arguments "${flags[@]}"\n');if(s+=`}
74
-
75
- `,e.children!==void 0)for(let i of e.children)s+=P(t,i,[...n,i.name]);return s},S=(t,e)=>{let n=`#compdef ${t}
76
- `;return n+=`# ${t} zsh completion
77
- `,n+=`# Generated by @eser/shell/completions
78
-
79
- `,n+=P(t,e,[]),n};var H=t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),ee=(t,e,n)=>{let r="";for(let s of e){let i=H(s.description??`${s.name} flag`),o=`complete -c ${t} ${n}`;o+=` -l ${s.name}`,s.short!==void 0&&(o+=` -s ${s.short}`),s.takesValue===!0&&(o+=" -r"),o+=` -d '${i}'`,r+=o+`
80
- `}return r},A=(t,e,n)=>{let r="",s;if(n.length===0?s="-n __fish_use_subcommand":s=`-n "${n.map(o=>`__fish_seen_subcommand_from ${o}`).join("; and ")}"`,e.children!==void 0&&e.children.length>0){for(let i of e.children){let o=H(i.description??i.name);if(n.length===0)r+=`complete -c ${t} -f ${s} `,r+=`-a "${i.name}" -d '${o}'
81
- `;else{let a=`-n "__fish_seen_subcommand_from ${n[n.length-1]}"`;r+=`complete -c ${t} -f ${a} `,r+=`-a "${i.name}" -d '${o}'
82
- `}}for(let i of e.children)r+=A(t,i,[...n,i.name])}return e.flags!==void 0&&e.flags.length>0&&(r+=ee(t,e.flags,s)),r},j=(t,e)=>{let n=`# ${t} fish completion
83
- `;return n+=`# Generated by @eser/shell/completions
84
-
85
- `,n+=`complete -c ${t} -f
86
-
87
- `,n+=A(t,e,[]),n};var E=(t,e,n)=>{switch(t){case"bash":return R(e,n);case"zsh":return S(e,n);case"fish":return j(e,n)}};var N=class t{#e;#a;#d;#c=[];#u=[];#h=[];#g=[];#i=[];#s=new Map;#o=new Map;#n;#m;#p;#r={validation:"none"};#f;#t;constructor(e){this.#e=e}get name(){return this.#e}description(e){return this.#a=e,this}usage(e){return this.#d=e,this}example(e){return this.#c.push(e),this}aliases(...e){return this.#u=e,this}version(e){return this.#f=e,this}flag(e){return this.#h.push(e),this}persistentFlag(e){return this.#g.push({...e,persistent:!0}),this}args(e,n){return e==="exact"&&typeof n=="number"?this.#r={validation:e,count:n}:e==="min"&&typeof n=="number"?this.#r={validation:e,min:n}:e==="max"&&typeof n=="number"?this.#r={validation:e,max:n}:e==="range"&&Array.isArray(n)?this.#r={validation:e,min:n[0],max:n[1]}:this.#r={validation:e},this}command(e){return e.#t=this,this.#i.push(e),this}commands(...e){for(let n of e)this.command(n);return this}run(e){return this.#p=e,this}lazyCommand(e,n){return this.#s.set(e,n),this}group(e,n){return this.#o.set(e,n),this}modules(e){return this.#n=e,this}fallback(e){return this.#m=e,this}static#b=[{name:"help",short:"h",type:"boolean",description:"Show help for this command"}];#l(){let e=[],n=this.#t;for(;n!==void 0;)e.push(...n.#g),n=n.#t;return[...t.#b,...e,...this.#g,...this.#h]}#$(){return this.#t===void 0?this:this.#t.#$()}#C(){return this.#t===void 0?[this.#e]:[...this.#t.#C(),this.#e]}#x(e){return this.#i.find(n=>n.#e===e||n.#u.includes(e))}#_(e){let{validation:n,count:r,min:s,max:i}=this.#r,o=e.length;switch(n){case"no-args":if(o>0)return"This command takes no arguments";break;case"exact":if(o!==r)return`Expected exactly ${r} argument(s), got ${o}`;break;case"min":if(o<(s??0))return`Expected at least ${s} argument(s), got ${o}`;break;case"max":if(o>(i??1/0))return`Expected at most ${i} argument(s), got ${o}`;break;case"range":if(o<(s??0)||o>(i??1/0))return`Expected ${s}-${i} arguments, got ${o}`;break}}async parse(e){let n=e??x.process.args;return await this.#y(n,[])}async#y(e,n){let r=this.#l(),s=h(r),i=this.#i.length>0||this.#s.size>0||this.#o.size>0||this.#n!==void 0,o=u(e,{...s,stopEarly:i}),a=$(o,r),d=o._;if(this.#f!==void 0&&a.version===!0)return console.log(`${this.#e} ${this.#f}`),p(void 0);if(a.help===!0)return console.log(this.help()),p(void 0);let c=d[0];if(c!==void 0&&i){let F=this.#x(c);if(F!==void 0)return await F.#y(d.slice(1),[...n,this.#e]);if(this.#s.has(c)){let l=await this.#s.get(c).load();return l instanceof t?(l.#t=this,await l.parse(d.slice(1))):"parse"in l&&typeof l.parse=="function"?await l.parse(d.slice(1)):(console.log(l.help()),p(void 0))}if(this.#n!==void 0){let g=this.#n.aliases?.[c]??c,l=this.#n.modules[g];if(l!==void 0)return await(await l.load()).main(d.slice(1))}for(let[g,l]of this.#o)if(c===g){let m=d[1];if(m===void 0||m==="--help"||m==="-h")return this.#F(g,l),p(void 0);let G=l.aliases?.[m]??m,b=l.modules[G];return b===void 0?(console.error(`Unknown module: ${g} ${m}
88
- `),this.#F(g,l),f({exitCode:1})):await(await b.load()).main(d.slice(2))}if(this.#m!==void 0)return await this.#m(c,d.slice(1))}if(this.#p===void 0)return console.log(this.help()),p(void 0);let C=_(a,r);if(C.length>0)return f({message:C.join(`
89
- `),exitCode:1});let y=this.#_(d);if(y!==void 0)return f({message:y,exitCode:1});let L=[...n,this.#e],z={args:d,flags:a,root:this.#$(),commandPath:L};return await this.#p(z)}#F(e,n){console.log(`${this.#e} ${e} - ${n.description}
90
- `),console.log(`Usage: ${this.#e} ${e} <module> [options]
91
- `);let r=new Map;for(let[s,i]of Object.entries(n.modules)){let o=i.category??"Modules",a=r.get(o)??[];a.push([s,i]),r.set(o,a)}for(let[s,i]of r){console.log(`${s}:`);for(let[o,a]of i)console.log(` ${o.padEnd(24)} ${a.description}`);console.log()}if(n.aliases!==void 0&&Object.keys(n.aliases).length>0){console.log("Aliases:");for(let[s,i]of Object.entries(n.aliases))console.log(` ${s.padEnd(24)} \u2192 ${i}`)}}help(){let e=[...this.#i.map(r=>({name:r.#e,description:r.#a,usage:r.#d,examples:r.#c,flags:r.#l(),children:[]})),...[...this.#s.entries()].map(([r,s])=>({name:r,description:s.description,flags:[],children:[]})),...this.#n!==void 0?Object.entries(this.#n.modules).map(([r,s])=>({name:r,description:s.description,flags:s.flags??[],children:[]})):[],...[...this.#o.entries()].map(([r,s])=>({name:r,description:s.description,flags:[],children:[]}))],n={name:this.#e,description:this.#a,usage:this.#d,examples:this.#c,flags:this.#l(),children:e};return k(n,this.#C())}#O(){let e=r=>r.map(s=>({name:s.name,short:s.short,description:s.description,takesValue:s.type!=="boolean"})),n=r=>{let s=r.#i.map(n);for(let[i,o]of r.#s)s.push({name:i,description:o.description,children:[],flags:[]});if(r.#n!==void 0)for(let[i,o]of Object.entries(r.#n.modules))s.push({name:i,description:o.description,children:[],flags:o.flags!==void 0?e(o.flags):[]});for(let[i,o]of r.#o){let a=Object.entries(o.modules).map(([d,c])=>({name:d,description:c.description,children:[],flags:c.flags!==void 0?e(c.flags):[]}));s.push({name:i,description:o.description,children:a,flags:[]})}return{name:r.#e,description:r.#a,children:s,flags:e(r.#l())}};return n(this)}completions(e){let n=this.#O();return E(e,this.#e,n)}};export{re as a,N as b};
@@ -1 +0,0 @@
1
- import{b as i}from"./chunk-DOV5776P.js";var t=async a=>{try{return await i`which ${a}`.noThrow().code()===0}catch{return!1}},r=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},e=a=>typeof globalThis.Deno<"u"?Deno.env.get(a)!==void 0:!1,c=async()=>{let[a,o,n,l]=await Promise.all([t("claude"),r(),t("opencode"),t("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:a,detail:a?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:o,detail:o?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:n,detail:n?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:l,detail:l?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:e("ANTHROPIC_API_KEY"),detail:e("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:e("OPENAI_API_KEY"),detail:e("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:e("GEMINI_API_KEY")||e("GOOGLE_API_KEY"),detail:e("GEMINI_API_KEY")||e("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:e("GOOGLE_CLOUD_PROJECT"),detail:e("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]};export{c as a};
@@ -1,10 +0,0 @@
1
- var c="<!-- noskills:start -->",i="<!-- noskills:end -->",y=n=>{let e=[c,"## noskills orchestrator","","This project uses noskills. Do not read skill files, concern files,","or rule files directly.","","At every step, run:",""," npx eser noskills next","","Follow the output. To submit a result or answer:","",' npx eser noskills next --answer="your response here"',"","Do not make architectural decisions independently.","noskills will tell you what to do next."];if(n.length>0){e.push("","### Active Rules","");for(let s of n)e.push(`- ${s}`)}return e.push(i),e.join(`
2
- `)},a=async(n,e)=>{let s=`${n}/CLAUDE.md`,t=y(e),o;try{o=await Deno.readTextFile(s);let r=o.indexOf(c),l=o.indexOf(i);r!==-1&&l!==-1?o=o.slice(0,r)+t+o.slice(l+i.length):o=o.trimEnd()+`
3
-
4
- `+t+`
5
- `}catch{o=t+`
6
- `}await Deno.writeTextFile(s,o)};var u=async(n,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",'Follow the JSON output. Submit results with `npx eser noskills next --answer="..."`',""];if(e.length>0){s.push("## Rules","");for(let t of e)s.push(`- ${t}`);s.push("")}await Deno.writeTextFile(`${n}/.cursorrules`,s.join(`
7
- `))};var d=async(n,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let t of e)s.push(`- ${t}`);s.push("")}await Deno.mkdir(`${n}/.kiro/steering`,{recursive:!0}),await Deno.writeTextFile(`${n}/.kiro/steering/conventions.md`,s.join(`
8
- `))};var p=async(n,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let t of e)s.push(`- ${t}`);s.push("")}await Deno.mkdir(`${n}/.github`,{recursive:!0}),await Deno.writeTextFile(`${n}/.github/copilot-instructions.md`,s.join(`
9
- `))};var h=async(n,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let t of e)s.push(`- ${t}`);s.push("")}await Deno.writeTextFile(`${n}/.windsurfrules`,s.join(`
10
- `))};var w=async n=>{let e=`${n}/.nos/rules`,s=[];try{for await(let t of Deno.readDir(e))if(t.isFile&&(t.name.endsWith(".md")||t.name.endsWith(".txt"))){let o=await Deno.readTextFile(`${e}/${t.name}`);s.push(o.trim())}}catch{}return s},T={"claude-code":a,cursor:u,kiro:d,copilot:p,windsurf:h},D=async(n,e)=>{let s=await w(n),t=[];for(let o of e){let r=T[o];r!==void 0&&(await r(n,s),t.push(o))}return t};export{w as a,D as b};
@@ -1 +0,0 @@
1
- import{b as x}from"./chunk-DOV5776P.js";import{t as i}from"./chunk-GRTR6TNJ.js";var m=[/node_modules/,/\.git\//,/\/dist\//,/etc\/coverage/,/etc\/temp/,/\.output\//],g=async t=>{try{let n=await x`git ls-files --cached --others --exclude-standard`.cwd(t).noThrow().lines();return n.length>0?n:null}catch{return null}},k=async(t={})=>{let{root:n=".",extensions:e,exclude:o=[]}=t,l=[...m,...o.map(r=>typeof r=="string"?new RegExp(r):r)],d=[],y=await g(n);if(y!==null)for(let r of y){let s=i.path.join(n,r),c=i.path.basename(r);if(e!==void 0&&e.length>0){let a=i.path.extname(r);if(!e.map(u=>u.startsWith(".")?u:`.${u}`).includes(a))continue}if(l.some(a=>a.test(s)||a.test(r)))continue;let f=0,p=!1;try{let a=await i.fs.lstat(s);if(f=a.size,p=a.isSymlink,a.isDirectory&&!(t.includeDirs??!1))continue}catch{continue}d.push({path:s,name:c,size:f,isSymlink:p})}else for await(let r of i.fs.walk(n,{includeDirs:t.includeDirs??!1,includeFiles:!0,exts:e,skip:l})){if(!r.isFile&&!r.isSymlink)continue;let s=0;try{s=(await i.fs.stat(r.path)).size}catch{continue}d.push({path:r.path,name:r.name,size:s,isSymlink:r.isSymlink})}if(t.includeOnly!==void 0&&t.includeOnly.length>0){let r=t.includeOnly;return d.filter(s=>r.some(c=>s.path.endsWith(c)||s.path.includes(c)))}return d},B=async t=>{if(t.textContent!==void 0)return t.textContent;try{let n=await h(t);if(w(n))return;let e=new TextDecoder().decode(n);return t.textContent=e,e}catch{return}},h=async t=>{if(t.rawBytes!==void 0)return t.rawBytes;let n=await i.fs.readFile(t.path);return t.rawBytes=n,n},w=t=>{let n=Math.min(t.length,8192);for(let e=0;e<n;e++)if(t[e]===0)return!0;return!1},M=(t,n)=>{for(let e of n)if(typeof e=="string"){if(t.includes(e)||t.endsWith(e))return!0}else if(e.test(t))return!0;return!1},b=(t,n)=>{let e=new Map;for(let o of n)e.set(o.path,o);for(let o of t){let l=e.get(o.path);l!==void 0&&(o.textContent=l.newContent,o.rawBytes=void 0)}},D=async t=>{let n=0;for(let e of t)e.oldContent!==e.newContent&&(await i.fs.writeTextFile(e.path,e.newContent),n++);return n};export{m as a,k as b,B as c,h as d,w as e,M as f,b as g,D as h};
@@ -1 +0,0 @@
1
- import{a as i}from"./chunk-VFMYWG2I.js";import{a as r}from"./chunk-3APERFKY.js";var t=i({name:"validate-toml",description:"Validate TOML syntax",canFix:!1,stacks:[],defaults:{},extensions:[".toml"],checkFile(e,a){if(a===void 0)return[];try{return r(a),[]}catch(o){let n=o instanceof Error?o.message:"invalid TOML";return[{path:e.path,message:n}]}}}),p=t.run,d=t.validator,u=t.main;export{t as a,p as b,d as c,u as d};
@@ -1 +0,0 @@
1
- import{a as E}from"./chunk-DLVQNMNV.js";import{a as y}from"./chunk-6U2VEZEM.js";import{a as C}from"./chunk-JQHMDTPL.js";import{f as v}from"./chunk-NUSNMQPL.js";import{b as a,e as m,f as x,g as k,h as g}from"./chunk-PLJNPQFC.js";import{g as p}from"./chunk-DQAEQEXD.js";import{u as h}from"./chunk-GRTR6TNJ.js";var l=C(),d=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase(),f=(e,o=[])=>{let s=e.split("/").filter(r=>r.length>0);for(let r of s){let t=r.startsWith(".")?r.slice(1):r;if(t.length===0)continue;let i=h.current.path.extname(t);if(i.length>0&&(t=t.slice(0,-i.length)),t.length!==0&&!o.includes(t)&&!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(t))return!1}return!0},N=async(e={})=>{let{root:o=".",ignoreWords:s=[]}=e,r=await E(o),t=[];for(let i of r){let n=i.config.exports?.value;if(n!=null){if(typeof n=="string"){f(n,s)||t.push({packageName:i.name,exportPath:n,suggestion:d(n)});continue}if(n!==null&&typeof n=="object")for(let[u,c]of Object.entries(n))f(u,s)||t.push({packageName:i.name,exportPath:u,suggestion:d(u)}),typeof c=="string"&&!f(c,s)&&t.push({packageName:i.name,exportPath:c,suggestion:d(c)})}}return{isValid:t.length===0,violations:t,packagesChecked:r.length}},w=e=>v.fromPromise(()=>N(e)),b=e=>p.ok({root:"."}),A=e=>{if(p.isFail(e))return l.writeln(m("\u2717"),a(" "+String(e.error))),p.fail({exitCode:1});let{value:o}=e;if(l.writeln(g("\u2139"),a(` Checked ${o.packagesChecked} packages.`)),!o.isValid){l.writeln(m("\u2717"),a(` Found ${o.violations.length} naming violations:`));for(let s of o.violations)l.writeln(k("\u26A0"),a(" "+s.packageName)),l.writeln(g("\u2139"),a(` Export: ${s.exportPath}`)),l.writeln(g("\u2139"),a(` Suggestion: ${s.suggestion}`));return p.fail({exitCode:1})}return l.writeln(x("\u2713"),a(" All export names follow conventions.")),p.ok(void 0)},P=y.createTrigger({handler:w,adaptInput:b,adaptOutput:A}),W=async e=>await P({command:"validate-export-names",args:[],flags:{}});export{N as a,w as b,P as c,W as d};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-3DMTTLUJ.js";import"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as ClaudeCodeModel,b as claudeCodeFactory};
@@ -1,5 +0,0 @@
1
- import{a as x,b as E}from"./chunk-3TYZYY77.js";import{e as $}from"./chunk-6YRN6OJC.js";import{a as C,d as P}from"./chunk-NUSNMQPL.js";import{j}from"./chunk-SCULX2ND.js";import{f as v,h as k,k as b}from"./chunk-FGDJVQG3.js";import{d,e as w,f as R,j as h}from"./chunk-PLJNPQFC.js";import{a as y}from"./chunk-HPPFA3XU.js";import{a as p,b as c,c as g}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var A=r=>{let n=r.replace(/^gh:/,""),[t,e]=n.split("#");if(t===void 0)return;let s=t.split("/");if(!(s.length!==2||s[0]===""||s[1]===""))return{owner:s[0],repo:s[1],ref:e??"main"}},S=r=>C(async n=>{try{let{specifier:t}=r,e=r.recipePath??"recipe.json",s=await j(t.owner,t.repo,t.ref,e),o=r.cwd;r.projectName!==void 0&&(o=`${r.cwd}/${r.projectName}`,await Deno.mkdir(o,{recursive:!0}));let a={...r.variables};r.projectName!==void 0&&a.project_name===void 0&&(a.project_name=r.projectName);let f=`https://raw.githubusercontent.com/${t.owner}/${t.repo}/${t.ref}`,i=await $(s,{cwd:o,registryUrl:f,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:a}),u=await x(o),m=E(s,u),I=r.dryRun?"Would write":"Cloned";n.out.writeln(R(`\u2713 ${I} ${i.written.length} file(s) from ${s.name}`));for(let l of i.written)n.out.writeln(` \u2192 ${l}`);if(i.postInstallRan.length>0){n.out.writeln(d(`
2
- Post-install:`));for(let l of i.postInstallRan)n.out.writeln(d(` \u2713 ${l}`))}if(m.instructions.length>0){n.out.writeln(d(`
3
- Dependencies:`));for(let l of m.instructions)n.out.writeln(d(` Run: ${l}`))}return p({recipe:s,result:i,depInfo:m,targetDir:o})}catch(t){let e=t instanceof Error?t.message:String(t);return c({_tag:"ApplyError",message:e})}});var W=async r=>{let n=y(r??[],{string:["recipe","name","var"],boolean:["force","dry-run","skip-existing","verbose"],collect:["var"],alias:{p:"name"}}),t=n._[0],e=v({renderer:b.ansi(),sink:k.stdout()});if(t===void 0)return e.writeln("Usage: eser kit clone <specifier> [options]"),e.writeln(),e.writeln("Specifier formats:"),e.writeln(" eser/ajan GitHub repo (default branch)"),e.writeln(" gh:eser/ajan#v1.0 GitHub repo at specific tag/branch"),e.writeln(),e.writeln("Options:"),e.writeln(" --recipe <path> Path to recipe.json (default: recipe.json)"),e.writeln(" --name, -p <dir> Target directory"),e.writeln(" --var key=value Template variable (repeatable)"),e.writeln(" --force Overwrite existing files"),e.writeln(" --dry-run Preview without writing"),await e.close(),p(void 0);let s=A(t);if(s===void 0)return e.writeln(w(`Invalid specifier: '${t}'. Use format: owner/repo or gh:owner/repo#ref`)),await e.close(),c({exitCode:1});let o={};for(let f of n.var){let[i,...u]=String(f).split("=");i!==void 0&&i!==""&&(o[i]=u.join("="))}e.writeln(h(`
4
- Cloning from ${s.owner}/${s.repo}@${s.ref}...
5
- `));let a=await P(S({specifier:s,recipePath:n.recipe,cwd:Deno.cwd(),projectName:n.name,dryRun:n["dry-run"]===!0,force:n.force===!0,skipExisting:n["skip-existing"]===!0,verbose:n.verbose===!0,variables:o}),{out:e});return await e.close(),g(a)?p(void 0):c({exitCode:1})};export{W as main};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h}from"./chunk-Y6DLCHJN.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as DEFAULT_EXCLUDES,g as applyMutations,e as isBinaryBytes,d as loadBytes,c as loadContent,f as matchesAnyPattern,b as walkSourceFiles,h as writeMutations};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-NIX3WX3O.js";import"./chunk-PLRSDG6G.js";import"./chunk-LRL56YFE.js";import"./chunk-OLM5RTFK.js";import"./chunk-DXB73IDG.js";export{a as GeminiModel,b as geminiFactory};
@@ -1,4 +0,0 @@
1
- import{a as l}from"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as o,e as r,h as i}from"./chunk-PLJNPQFC.js";import{g as t}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var c=l(),m=()=>{c.writeln(i("\u2139"),o(` eser codebase gh \u2014 GitHub operations
2
- `)),console.log("Subcommands:"),console.log(" contributors Update contributor list in README.md"),console.log(" release-notes Sync CHANGELOG to GitHub Releases"),console.log(" release-tag Create and push release git tags"),console.log(`
3
- Run 'eser codebase gh <subcommand> --help' for details.`)},w=async u=>{let n=u??[],e=n[0],s=n.slice(1);if(e===void 0||e==="--help"||e==="-h")return m(),t.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-5SHGJHAQ.js")).main(s);case"release-notes":return await(await import("./release-notes-Z53AFCII.js")).main(s);case"release-tag":return await(await import("./release-tag-QRIKYVQB.js")).main(s);default:return c.writeln(r("\u2717"),o(` Unknown gh subcommand: ${e}
4
- `)),m(),t.fail({exitCode:1})}};export{w as main};
@@ -1 +0,0 @@
1
- import{a as d}from"./chunk-BK2BDHKB.js";import{a as y,b as $,e as v,g as k,h as P,j,k as b}from"./chunk-BKVQBSFV.js";import"./chunk-Q7QMINSQ.js";import"./chunk-6FMPNAZ3.js";import"./chunk-LRL56YFE.js";import{a as h}from"./chunk-X4ZCYXOT.js";import{f as m,h as w,k as g}from"./chunk-FGDJVQG3.js";import{c as l,d as a,f as o,g as f}from"./chunk-PLJNPQFC.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-5O7V5P53.js";import"./chunk-DRQWYJMH.js";import"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as p}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var D=h;var i=async t=>{try{return await Deno.stat(t),!0}catch{return!1}},C=async(t,e)=>{try{let n=await Deno.readTextFile(t);return JSON.parse(n)[e]??null}catch{return null}},A=async t=>{let e=[];return(await i(`${t}/package.json`)||await i(`${t}/deno.json`))&&e.push("typescript"),await i(`${t}/go.mod`)&&e.push("go"),await i(`${t}/Cargo.toml`)&&e.push("rust"),(await i(`${t}/pyproject.toml`)||await i(`${t}/setup.py`))&&e.push("python"),e},T=async t=>{let e=[],n=await C(`${t}/package.json`,"dependencies");return n!==null&&("react"in n&&e.push("react"),"vue"in n&&e.push("vue"),"svelte"in n&&e.push("svelte"),"next"in n&&e.push("nextjs"),"express"in n&&e.push("express"),"hono"in n&&e.push("hono")),e},z=async t=>{let e=[];return await i(`${t}/.github/workflows`)&&e.push("github-actions"),await i(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await i(`${t}/Jenkinsfile`)&&e.push("jenkins"),await i(`${t}/.circleci`)&&e.push("circleci"),e},B=async t=>{if(await i(`${t}/deno.json`))return"deno";let e=await C(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},x=async t=>{let[e,n,r,c]=await Promise.all([A(t),T(t),z(t),B(t)]);return{languages:e,frameworks:n,ci:r,testRunner:c}};var H=async t=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),n=Deno.cwd();if(await b(n))return e.writeln(f("noskills is already initialized in this project.")),e.writeln(a("Run `noskills sync` to regenerate tool files.")),await e.close(),p(void 0);e.writeln(l("noskills init")),e.writeln(""),e.writeln(a("Scanning project..."));let r=await x(n);for(let s of r.languages)e.writeln(" ",o("\u2714"),` ${s}`);for(let s of r.frameworks)e.writeln(" ",o("\u2714"),` ${s}`);for(let s of r.ci)e.writeln(" ",o("\u2714"),` ${s}`);r.testRunner!==null&&e.writeln(" ",o("\u2714"),` test runner: ${r.testRunner}`),e.writeln(""),e.writeln(a("Detecting AI providers..."));let c=await D();for(let s of c)s.available?e.writeln(" ",o("\u25CF")," ",l(`${s.name} (${s.alias})`),a(` ${s.detail}`)):e.writeln(" ",a("\u25CB")," ",a(`${s.name} (${s.alias}) ${s.detail}`));let u=c.filter(s=>s.available).map(s=>s.name);e.writeln(""),e.writeln(a("Initializing...")),await j(n),e.writeln(" Created .nos/");for(let s of d)await P(n,s);e.writeln(` Bootstrapped ${d.length} concerns into .nos/concerns/`);let I=$([],u,r);await k(n,I),e.writeln(" Created .nos/config.json");let N=y();await v(n,N),e.writeln(" Created .nos/.state/state.json"),e.writeln("");let R=u.length;return e.writeln(o("Done."),` ${R} AI provider(s) detected.`),e.writeln("Start a spec with: ",l('noskills spec new "..."')),await e.close(),p(void 0)};export{H as main};
@@ -1,12 +0,0 @@
1
- import{f as E,h as P,k as R}from"./chunk-FGDJVQG3.js";import{b as t,c as T,d as s,e as o,f as b,j as x}from"./chunk-PLJNPQFC.js";import"./chunk-ZOZYBQX2.js";import{a as A}from"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as C,b as i,f as $}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var F=["minimal","blog","dashboard","docs"],U=async S=>{let{positional:O,flags:m}=A(S??[],[{name:"template",short:"t",type:"string",default:"minimal",description:"Project template"},{name:"force",short:"f",type:"boolean",description:"Overwrite"},{name:"no-git",type:"boolean",description:"Skip git"},{name:"no-install",type:"boolean",description:"Skip install"}]),r=O[0]??"my-laroux-app",l=m.template,v=m.force,D=m["no-git"],n=R.ansi(),e=E({renderer:n,sink:P.stdout()});if(!F.includes(l))return await e.close(),i({message:`${n.render([o(`
2
- Error: Invalid template "${l}"`)])}
3
- Available templates: ${F.join(", ")}`,exitCode:1});e.writeln(x(`
4
- \u2728 Creating new laroux.js project in ./${r}
5
- `)),e.writeln(s(` Template: ${l}`));let c="eser",p=`laroux-template-${l}`,j="main",d=`${Deno.cwd()}/${r}`;try{await Deno.mkdir(d,{recursive:!0})}catch{return await e.close(),i({message:n.render([o(`
6
- Could not create directory: ${d}`)]),exitCode:1})}e.writeln(s(` Fetching from gh:${c}/${p}...
7
- `));try{let a=await import("./registry-fetcher-ZJ76EHBA.js"),u=await import("./recipe-applier-F2REROYS.js"),f=await $(()=>a.fetchRecipeFromRepo(c,p,j,"recipe.json"),()=>{});if(f._tag==="Ok"&&f.value!==void 0){let g=`https://raw.githubusercontent.com/${c}/${p}/${j}`,w=await u.applyRecipe(f.value,{cwd:d,registryUrl:g,force:v,variables:{project_name:r}});e.writeln(b(`
8
- \u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-STKIZYZ3.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:v,skipPostInstall:D,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
9
- Scaffolding failed: ${y.error.message}`)]),exitCode:1});let k=y.value;if(e.writeln(b(`
10
- \u{1F389} Project created successfully!`)),Object.keys(k.variables).length>0){e.writeln(t(`
11
- Variables applied:`));for(let[h,N]of Object.entries(k.variables))e.writeln(t(" "),s(h),t(`: ${N}`))}}}catch(a){let u=a instanceof Error?a.message:String(a);return await e.close(),i({message:n.render([o(`
12
- Failed: ${u}`)]),exitCode:1})}return e.writeln(),e.writeln(T("Next steps:")),e.writeln(),e.writeln(t(` cd ${r}`)),e.writeln(t(" laroux dev")),e.writeln(),e.writeln(t("Then open "),x("http://localhost:8000"),t(" in your browser.")),e.writeln(),e.writeln(s("Learn more at https://laroux.now/")),e.writeln(),await e.close(),C(void 0)};export{U as main};
@@ -1,2 +0,0 @@
1
- import{b as M}from"./chunk-7GS5KPVF.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-GXPLME3K.js";import{f as C,h as P,k as H}from"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as A,c as O,d as l,e as k,f as w,g as y,h as E}from"./chunk-PLJNPQFC.js";import{a as b}from"./chunk-HPPFA3XU.js";import{g as r}from"./chunk-DQAEQEXD.js";import{u as t}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var R={precommit:{hookName:"pre-commit",args:""},commitmsg:{hookName:"commit-msg",args:'-- "$1"'},prepush:{hookName:"pre-push",args:""}},N="# @eser managed hook",I=async(i,n)=>{let e=await t.getCliCommand({command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"}),s=n.length>0?` ${n}`:"",o=`${e} workflows run -e ${i}${s}`;return["#!/bin/sh",`${N} \u2014 generated by \`eser codebase install\``,"# Do not edit. Re-run `eser codebase install` to update.","",o,""].join(`
2
- `)},S=async()=>{try{let s=(await t.current.exec.exec("git",["rev-parse","--git-dir"])).trim();if(s.length>0)return s}catch{}let i=t.current.process.cwd(),n=t.current.path.join(i,".git");try{if((await t.current.fs.stat(n)).isDirectory)return n}catch{}return null},G=i=>{let n=i.workflows;if(!Array.isArray(n))return[];let e=new Set;for(let s of n)if(Array.isArray(s.on))for(let o of s.on)typeof o=="string"&&e.add(o);return[...e]},T=H.ansi(),U=async i=>{let n=b(i??[],{boolean:["force","dry-run","help"],alias:{h:"help",f:"force",n:"dry-run"}});if(n.help)return console.log("eser codebase install \u2014 Install git hooks from .manifest.yml"),console.log(""),console.log("Flags:"),console.log(" --force, -f Overwrite non-managed hooks"),console.log(" --dry-run, -n Show what would happen without writing"),console.log(" --help, -h Show this help"),r.ok(void 0);let e=C({renderer:T,sink:P.stdout()}),s=n.force,o=n["dry-run"],d=await S();if(d===null)return e.writeln(k("Error: not inside a git repository")),await e.close(),r.fail({exitCode:1});let m=t.current.path.join(d,"hooks"),g=t.current.process.cwd(),a=await M(g);if(a===null)return e.writeln(k("Error: no .manifest.yml found in current directory")),await e.close(),r.fail({exitCode:1});let c=G(a);if(c.length===0)return e.writeln(y("No workflow events found \u2014 nothing to install.")),await e.close(),r.ok(void 0);o||await t.current.fs.ensureDir(m);let f=0,v=0,u=0;for(let D of c){let F=R[D];if(F===void 0){e.writeln(l(` skip ${D} (unknown event, no hook mapping)`));continue}let{hookName:p,args:K}=F,j=t.current.path.join(m,p),_=await I(D,K),x=!1,$=!1;try{let q=await t.current.fs.readTextFile(j);x=!0,$=q.includes(N)}catch{}if(o){x?$?e.writeln(E(` would update ${p} (managed)`)):s?e.writeln(y(` would overwrite ${p} (--force)`)):e.writeln(y(` would skip ${p} (user hook; use --force to overwrite)`)):e.writeln(E(` would create ${p}`));continue}if(x&&!$&&!s){e.writeln(y(` skip ${p} \u2014 user hook exists (use --force to overwrite)`)),v++;continue}await t.current.fs.writeTextFile(j,_);try{await t.current.fs.chmod(j,493)}catch{}x&&$?(e.writeln(w(` updated ${p}`)),u++):(e.writeln(w(` installed ${p}`)),f++)}e.writeln();let h=[];return f>0&&h.push(`${f} installed`),u>0&&h.push(`${u} updated`),v>0&&h.push(`${v} skipped`),o?e.writeln(l("(dry run \u2014 no changes made)")):h.length>0?e.writeln(w(`Done: ${h.join(", ")}.`)):e.writeln(l("Nothing to do.")),await e.close(),r.ok(void 0)},W=async i=>{if(b(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase uninstall \u2014 Remove managed git hooks"),r.ok(void 0);let e=C({renderer:T,sink:P.stdout()}),s=await S();if(s===null)return e.writeln(k("Error: not inside a git repository")),await e.close(),r.fail({exitCode:1});let o=t.current.path.join(s,"hooks"),d=0,m=Object.values(R).map(a=>a.hookName),g=[...new Set(m)];for(let a of g){let c=t.current.path.join(o,a);try{(await t.current.fs.readTextFile(c)).includes(N)&&(await t.current.fs.remove(c),e.writeln(w(` removed ${a}`)),d++)}catch{}}return e.writeln(),d>0?e.writeln(w(`Done: ${d} hook(s) removed.`)):e.writeln(l("No managed hooks found.")),await e.close(),r.ok(void 0)},X=async i=>{if(b(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase status \u2014 Show git hook installation status"),r.ok(void 0);let e=C({renderer:T,sink:P.stdout()}),s=await S();if(s===null)return e.writeln(k("Error: not inside a git repository")),await e.close(),r.fail({exitCode:1});let o=t.current.path.join(s,"hooks"),d=t.current.process.cwd(),m=await M(d);if(m===null)return e.writeln(k("Error: no .manifest.yml found in current directory")),await e.close(),r.fail({exitCode:1});let g=G(m);if(g.length===0)return e.writeln(l("No workflow events found in manifest.")),await e.close(),r.ok(void 0);e.writeln(O("Git hook status:")),e.writeln();for(let a of g){let c=R[a];if(c===void 0){e.writeln(A(" "),l(a.padEnd(14)),A(" "),l("(no hook mapping)"));continue}let{hookName:f}=c,v=t.current.path.join(o,f),u;try{(await t.current.fs.readTextFile(v)).includes(N)?u=w("managed (@eser)"):u=y("user hook")}catch{u=l("not installed")}e.writeln(A(` ${f.padEnd(14)} `),u)}return e.writeln(),await e.close(),r.ok(void 0)};export{U as main,X as statusMain,W as uninstallMain};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-5C7ZQN6X.js";import"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as KiroModel,b as kiroFactory};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-M5TBBQQC.js";import"./chunk-Y6DZEK4W.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-A2GDVOQP.js";import"./chunk-ZE5T64HQ.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as loadConfig};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-7GS5KPVF.js";import"./chunk-GXPLME3K.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
@@ -1 +0,0 @@
1
- import{e as P}from"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import{t as a}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var h=P.getLogger(["laroux","image-optimizer"]),$=null;async function q(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var C={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function S(t){let r=[],o=[".jpg",".jpeg",".png",".gif",".webp"];async function n(e){try{for await(let i of a.fs.readDir(e)){let s=a.path.resolve(e,i.name);if(i.isDirectory)await n(s);else if(i.isFile){let g=a.path.extname(i.name).toLowerCase();o.includes(g)&&r.push(s)}}}catch{}}return await n(t),r}async function B(t,r){return`data:image/webp;base64,${(await(await q())(t).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function j(t,r,o,n={}){let e=await q(),i={...C,...n},s=e(t),g=await s.metadata();if(g.width===void 0||g.height===void 0)throw new Error(`Could not read image dimensions: ${t}`);let c=g.width,w=g.height,y=c/w,m=a.path.basename(t,a.path.extname(t)),f=`${o}/${m}`,u=[];for(let l of i.widths){if(l>c)continue;let v=Math.round(l/y);for(let b of i.formats){let z,d;if(b==="original"){let O=a.path.extname(t).toLowerCase();d=O.replace(".",""),z=a.path.resolve(r,`${m}-${l}w${O}`)}else d=b,z=a.path.resolve(r,`${m}-${l}w.${b}`);await a.fs.ensureDir(a.path.dirname(z));let p=s.clone().resize(l,v,{fit:"cover"});b==="webp"?p=p.webp({quality:i.quality.webp}):b==="avif"?p=p.avif({quality:i.quality.avif}):d==="jpg"||d==="jpeg"?p=p.jpeg({quality:i.quality.jpeg}):d==="png"&&(p=p.png({quality:i.quality.png}));let x=await p.toBuffer();await a.fs.writeFile(z,x),u.push({path:z,format:d,width:l,height:v,size:x.length})}}let I;return i.generateBlurPlaceholder&&(I=await B(t,i.placeholderWidth)),{originalPath:t,publicPath:f,originalWidth:c,originalHeight:w,variants:u,blurDataUrl:I,aspectRatio:y}}async function F(t,r,o="/images",n={}){h.info(`Scanning for images in ${t}...`);let e=await S(t);if(e.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${e.length} image(s) to optimize`);let i={},s=0,g=0;for(let m of e)try{let f=await a.fs.stat(m);s+=f.size;let u=await j(m,r,o,n);i[m]=u;let I=u.variants.reduce((l,v)=>l+v.size,0);g+=I,h.debug(`Optimized: ${a.path.basename(m)} \u2192 ${u.variants.length} variants`)}catch(f){h.warn(`Failed to optimize ${m}: ${f instanceof Error?f.message:String(f)}`)}let c={timestamp:Date.now(),images:i},w=a.path.resolve(r,"image-manifest.json");await a.fs.ensureDir(a.path.dirname(w)),await a.fs.writeTextFile(w,JSON.stringify(c,null,2));let y=s>0?((1-g/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${e.length} images, ${y}% size reduction`),c}function V(t,r="webp"){return t.variants.filter(n=>n.format===r).sort((n,e)=>n.width-e.width).map(n=>`${n.path} ${n.width}w`).join(", ")}function M(t,r,o="webp"){let n=t.variants.filter(e=>e.format===o).sort((e,i)=>e.width-i.width);return n.find(e=>e.width>=r)??n.at(-1)}export{V as generateSrcset,M as getBestVariant,j as optimizeImage,F as optimizeImages,S as scanImages};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f}from"./chunk-HGNGFAAY.js";import"./chunk-FGDJVQG3.js";import"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import"./chunk-4HNB3UTC.js";import"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
@@ -1 +0,0 @@
1
- import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as r,m as s,n as t,o as u,p as v,q as w,r as x,s as A,t as B}from"./chunk-GRTR6TNJ.js";import{b as y,c as z}from"./chunk-Z7742D7Q.js";import{a as p,b as q}from"./chunk-VTQ72OK7.js";import{a,b,c,d}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,u as buildCommand,z as clearWorkerdEnv,A as createRuntime,B as current,x as detectExecutionContext,t as detectInvoker,e as detectRuntime,l as getArch,w as getCliCommand,m as getHomedir,k as getPlatform,o as getPlatformInfo,f as getRuntimeVersion,n as getTmpdir,h as isBrowser,v as isCommandInPath,j as isEdge,g as isRuntime,i as isServer,y as populateEnvFromContext,q as posixPath,s as resolvePathDirs,r as searchFileHierarchy,p as toPosix};
@@ -1 +0,0 @@
1
- import{a as G,b as v}from"./chunk-UJX2S56V.js";import{a as P,b as g}from"./chunk-GETSWLMF.js";import{a as S,b as J}from"./chunk-NIX3WX3O.js";import{a as K,b as V}from"./chunk-4Q3SEHPE.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-PLRSDG6G.js";import"./chunk-LRL56YFE.js";import{a as f,b as u}from"./chunk-3DMTTLUJ.js";import{a as A,b as C}from"./chunk-ZY72QNKZ.js";import{a as M,b as w}from"./chunk-NZFUFGOC.js";import{a as I,b as T}from"./chunk-5C7ZQN6X.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-GBDSASP5.js"),{openaiFactory:r}=await import("./openai-XMIVMDDL.js"),{geminiFactory:t}=await import("./gemini-I6F5N7PS.js"),{vertexaiFactory:a}=await import("./vertexai-2SMP54AR.js"),{claudeCodeFactory:i}=await import("./claude-code-PWTLM554.js"),{ollamaFactory:c}=await import("./ollama-DQ5VM4HI.js"),{openCodeFactory:n}=await import("./opencode-IZMQZ4ZK.js"),{kiroFactory:p}=await import("./kiro-NMTIFMT4.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,9 +0,0 @@
1
- import{a as Re}from"./chunk-IAWIWTDY.js";import{a as Pe}from"./chunk-SJQWPBMJ.js";import{a as ge,c as ve}from"./chunk-HPVL4BVQ.js";import{a as ke,c as ye}from"./chunk-MQH4XBFN.js";import{a as Ve,c as he}from"./chunk-QIUIPRJP.js";import{a as xe}from"./chunk-EW5NCPPE.js";import{a as Ce}from"./chunk-V5HTJPFW.js";import{a as we}from"./chunk-XWYLEYLY.js";import{a as Se}from"./chunk-ZTLJ775S.js";import"./chunk-DLVQNMNV.js";import{a as be,c as $e}from"./chunk-HVMMNGY5.js";import{a as Z,c as ee}from"./chunk-VGFZXQMW.js";import{a as ae,c as te}from"./chunk-NSZ4HGDI.js";import{a as se,c as oe}from"./chunk-C3OSYHJY.js";import{a as ie,c as re}from"./chunk-CDLEA2PD.js";import{a as ne,c as le}from"./chunk-YUXQ7JNG.js";import{a as de,c as ce}from"./chunk-4HMEWMWL.js";import{a as pe,c as me}from"./chunk-L2BYHWDC.js";import{a as ue,c as fe}from"./chunk-H2JGLZIR.js";import{a as Y,c as _}from"./chunk-DZD6MI45.js";import{a as G,c as U}from"./chunk-SCCNNGD4.js";import{a as H,c as K}from"./chunk-NADES3GN.js";import{a as Q,c as X}from"./chunk-XJ3VEVYL.js";import"./chunk-VFMYWG2I.js";import"./chunk-Y6DLCHJN.js";import{b as J,c as B}from"./chunk-7GS5KPVF.js";import"./chunk-ATLUGTI7.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import"./chunk-6U2VEZEM.js";import"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import{f as A,h as W,k as z}from"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as m,d as k,e as h,f as P,g as O,j as q}from"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import{a as L}from"./chunk-HPPFA3XU.js";import{a as R,b as D}from"./chunk-DQAEQEXD.js";import{t as w}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var S=async a=>{let t=await J(a);return t===null?null:t},je=async a=>await B(a);var M={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let t=await we({root:a.root});return{name:"validate-circular-deps",passed:!t.hasCycles,issues:t.cycles.map(s=>({severity:"error",message:`Circular dependency: ${s.join(" \u2192 ")}`})),stats:{packagesChecked:t.packagesChecked}}}};var j={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let t=await Re({root:a.root});return{name:"validate-mod-exports",passed:t.isComplete,issues:t.missingExports.map(s=>({severity:"error",message:`Missing export in ${s.packageName}: ${s.file}`,file:s.file})),stats:{packagesChecked:t.packagesChecked}}}};var T={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let t=await Se({root:a.root});return{name:"validate-export-names",passed:t.isValid,issues:t.violations.map(s=>({severity:"error",message:`${s.packageName}: "${s.exportPath}" should be "${s.suggestion}"`})),stats:{packagesChecked:t.packagesChecked}}}};var E={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let t=a.options?.requireExamples,s=await Ce({root:a.root,requireExamples:t});return{name:"validate-docs",passed:s.isValid,issues:s.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:s.filesChecked,symbolsChecked:s.symbolsChecked}}}};var I={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let t=await Pe({root:a.root}),s=[];for(let e of t.inconsistencies)s.push({severity:"error",message:`${e.packageName}: ${e.field} mismatch - deno.json: ${JSON.stringify(e.denoValue)}, package.json: ${JSON.stringify(e.packageValue)}`});for(let e of t.dependencyInconsistencies){let n=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(n+=` (expected: ${e.expected}, actual: ${e.actual})`),s.push({severity:"error",message:n})}return{name:"validate-package-configs",passed:t.isConsistent,issues:s,stats:{packagesChecked:t.packagesChecked}}}};var y={validators:new Map,initialized:!1},De=()=>{o(M),o(j),o(T),o(E),o(I),o(_),o(U),o(K),o(X),o(ee),o(te),o(oe),o(re),o(le),o(ce),o(me),o(fe),o(ve),o(ye),o(he),o($e)},N=()=>{y.initialized||(y.initialized=!0,De())},o=a=>{y.validators.set(a.name,a)},Le=a=>(N(),y.validators.get(a)??null),F=()=>(N(),[...y.validators.values()]),Oe=()=>(N(),[...y.validators.keys()]),qe=a=>({name:a.config.name,description:a.config.description,run:async t=>{let s=await a.run(t);return{name:s.name,passed:s.issues.length===0,issues:s.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:s.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:s.filesChecked,issuesFound:s.issues.length}}}}),Ae=a=>({name:a.name,description:a.description,run:async t=>{let s=await a.validate({root:t.root??".",options:t});return{name:s.name,passed:s.passed,issues:s.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:s.stats}}}),We=()=>{let a=[],t=[Y,G,H,Q,Z,ae,se,ie,ne,de,pe,ue,ge,ke,Ve,be];for(let e of t)a.push(qe(e));let s=[M,j,T,E,I];for(let e of s)a.push(Ae(e));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let n=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{current:f}=await import("./mod-FKPTF5D5.js"),u;try{u=await f.fs.readTextFile(n)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${n}`}],mutations:[],stats:{}}}let l=xe(u,{allowAsterisk:e.allowAsterisk,allowMultipleScopes:e.allowMultipleScopes,forceScope:e.forceScope,types:e.types});return{name:"validate-commit-msg",passed:l.valid,issues:l.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ze=async(a={})=>{let t=a.root??w.process.cwd(),e=(await S(t))?.stack??[],n=[...a.skip??[]],f=a.only??[],u=F(),l=[],g=[],x=[];for(let r of u){if(f.length>0&&!f.includes(r.name))continue;if(n.includes(r.name)){x.push(r.name);continue}if(r.requiredStacks.length>0&&e.length>0&&!r.requiredStacks.some(C=>e.includes(C))){g.push({name:r.name,reason:`Requires '${r.requiredStacks.join("' or '")}' stack`});continue}let b={...a.fix!==void 0?{fix:a.fix}:{}},d=await r.validate({root:t,options:b});l.push(d)}return{passed:l.every(r=>r.passed),results:l,skipped:g,disabled:x}},wa=async a=>{let t=L(a??w.process.args,{string:["root","only","skip"],boolean:["fix","help"],alias:{h:"help"}});if(t.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(" -h, --help Show this help message"),R(void 0);let s=z.ansi(),e=A({renderer:s,sink:W.stdout()}),n=t.root,f=t.fix,u=t.only,l=t.skip,g=u!==void 0?u.split(",").map(i=>i.trim()):void 0,x=l!==void 0?l.split(",").map(i=>i.trim()):void 0,b=(await S(n??"."))?.stack?.join(", ")??"all (no .manifest.yml)";e.writeln(m(`Validating codebase...
2
- `)),e.writeln(m("Stack: "),q(b),m(`
3
- `));let d=await ze({root:n,only:g,skip:x,fix:f});for(let i of d.results){let c=i.passed?P("PASS"):h("FAIL"),v=Object.entries(i.stats).map(([p,$])=>`${$} ${p}`).join(", ");e.writeln(m(` ${i.name.padEnd(18)} `),c,m(` (${v})`))}if(d.skipped.length>0){e.writeln(k(`
4
- Skipped (stack not configured):`));for(let i of d.skipped)e.writeln(k(` - ${i.name}: ${i.reason}`))}if(d.disabled.length>0){e.writeln(k(`
5
- Disabled:`));for(let i of d.disabled)e.writeln(k(` - ${i}`))}let V=d.results.flatMap(i=>i.issues.map(c=>({validator:i.name,...c})));if(V.length>0){e.writeln(h(`
6
- Issues (${V.length}):
7
- `));let i=new Map;for(let c of V){let v=c.file??c.validator,p=i.get(v)??[];p.push(c),i.set(v,p)}for(let[c,v]of i){e.writeln(k(` ${c}`));for(let p of v){let $=p.severity==="error"?h("error"):O("warning"),Me=p.line!==void 0?`:${p.line}`:"";e.writeln(m(" "),$,m(`${Me}: ${p.message}`))}e.writeln()}}let C=d.results.filter(i=>!i.passed).length;return C>0?(await e.close(),D({message:s.render([h(`
8
- ${C} check(s) failed with ${V.length} issue(s)`)]),exitCode:1})):(e.writeln(P(`
9
- All checks passed!`)),await e.close(),R(void 0))};export{je as getProjectConfigPath,Le as getValidator,Oe as getValidatorNames,F as getValidators,We as getWorkflowTools,S as loadProjectConfig,wa as main,o as registerValidator,ze as validate};
@@ -1,27 +0,0 @@
1
- import{a as _}from"./chunk-GXPLME3K.js";import{f as U,h as H,k as G}from"./chunk-FGDJVQG3.js";import{b as w,d as S,e as C,f as O,j as z}from"./chunk-PLJNPQFC.js";import{b as N}from"./chunk-DOV5776P.js";import{a as q}from"./chunk-HPPFA3XU.js";import{a as E,b as $,d as V,f as D}from"./chunk-DQAEQEXD.js";import{t as l}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import{b as v}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var te="main",re=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??te,path:n.length>0?n.join("/"):void 0}},se=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},M={name:"github",prefixes:["github","gh"],isDefault:!0,parse:re,fetch:se};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,W(M))},W=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},ne=r=>(A(),g.providers.get(r)??null),ae=()=>(A(),g.defaultProvider),B=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=B(r);return await e.fetch(s,t),s};var Y=[".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of Y){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=_(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},ie=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=ie(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
2
- ${n.join(`
3
- `)}`);return f},J=async r=>{for(let t of Y){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var K=/\{\{\s*\.(\w+)\s*\}\}/g,oe=new Set([".png",".jpg",".jpeg",".gif",".ico",".webp",".svg",".woff",".woff2",".ttf",".eot",".otf",".zip",".tar",".gz",".bz2",".xz",".7z",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".exe",".dll",".so",".dylib",".mp3",".mp4",".avi",".mov",".webm"]),le=r=>{let t=l.path.extname(r).toLowerCase();return oe.has(t)},fe=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},R=(r,t)=>r.replace(K,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),T=r=>K.test(r),Q=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(fe(o,s)||(n.isDirectory?T(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!le(n))try{let c=await l.fs.readTextFile(n);if(T(c)){let p=R(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(T(o)){let c=R(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=R(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},Z=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".manifest.yml",".manifest.yaml",...i?.ignore??[]];await Q(o,{variables:p,ignore:u});let d=await J(o);d!==null&&await Z(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var qe=async r=>{let t=q(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
4
-
5
- Options:
6
- -p, --path <dir> Target directory (default: .)
7
- -f, --force Overwrite existing files
8
- -i, --interactive Prompt for missing variables
9
- --var key=value Set a template variable (repeatable)
10
- --skip-post-install Skip post-install commands
11
- -h, --help Show this help message
12
-
13
- Examples:
14
- scaffold eser/ajan
15
- scaffold gh:eser/ajan#v1.0 -p ./my-project
16
- scaffold eser/ajan --var name=my-app --var author=me`),E(void 0);let e=G.ansi(),s=U({renderer:e,sink:H.stdout()});if(t._.length===0)return await s.close(),$({message:`${e.render([C("Error: Template specifier is required")])}
17
-
18
- Usage: scaffold <specifier> [options]
19
-
20
- Examples:
21
- scaffold eser/ajan
22
- scaffold gh:eser/ajan#v1.0
23
- scaffold eser/ajan -p ./my-project`,exitCode:1});let a=String(t._[0]),f=t.path??".",n=t.force??!1,o=t["skip-post-install"]??!1,i=t.interactive??!1,c=t.var,p={};if(c!==void 0)for(let h of c){let[b,...m]=String(h).split("=");b!==void 0&&(p[b]=m.join("="))}s.writeln(w("Scaffolding from "),z(a),w("..."));let u=await D(()=>k({specifier:a,targetDir:f,variables:p,force:n,skipPostInstall:o,interactive:i}),h=>({message:h.message}));if(V(u))return await s.close(),$({message:e.render([C(`
24
- Scaffolding failed: ${u.error.message}`)]),exitCode:1});let d=u.value;if(s.writeln(O(`
25
- Scaffolded ${d.templateName} to ${d.targetDir}`)),Object.keys(d.variables).length>0){s.writeln(w(`
26
- Variables applied:`));for(let[h,b]of Object.entries(d.variables))s.writeln(w(" "),S(h),w(`: ${b}`))}if(d.postInstallCommands.length>0){s.writeln(w(`
27
- Post-install commands executed:`));for(let h of d.postInstallCommands)s.writeln(w(" "),S(h))}return await s.close(),E(void 0)};export{I as fetchTemplate,ae as getDefaultProvider,ne as getProvider,T as hasVariables,j as loadTemplateConfig,qe as main,B as parseSpecifier,W as registerProvider,F as resolveVariables,k as scaffold,R as substituteVariables};
@@ -1,4 +0,0 @@
1
- import{a as C,b as D}from"./chunk-3TYZYY77.js";import{e as E}from"./chunk-6YRN6OJC.js";import{a as $,d as A}from"./chunk-NUSNMQPL.js";import{f as y}from"./chunk-SCULX2ND.js";import{f as v,h as k,k as R}from"./chunk-FGDJVQG3.js";import{d as m,e as w,f as P,j as h}from"./chunk-PLJNPQFC.js";import{a as N}from"./chunk-HPPFA3XU.js";import{a as g,b as p,c as j}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var b=r=>$(async t=>{try{let s=await y(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 Deno.mkdir(r.targetDir,{recursive:!0});let u={project_name:r.projectName,...r.variables},e=await E(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:u}),f=await C(r.targetDir),d=D(o,f);t.out.writeln(P(`\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
- 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 q=async r=>{let t=N(r??[],{string:["name","registry","var"],boolean:["local"],collect:["var"]}),s=t._[0],a=t.name??s,o=t.registry,u=t.local===!0,e=v({renderer:R.ansi(),sink:k.stdout()}),f={};for(let c of t.var){let[i,...l]=String(c).split("=");i!==void 0&&i!==""&&(f[i]=l.join("="))}if(s===void 0){try{let i=(await y(o,{local:u})).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(w(`Error: ${i}`))}return await e.close(),g(void 0)}if(a===void 0)return e.writeln(w("Project name is required.")),await e.close(),p({exitCode:1});e.writeln(h(`
3
- Creating ${a} from ${s}...
4
- `));let d=`${Deno.cwd()}/${a}`,n=await A(b({templateName:s,projectName:a,targetDir:d,registrySource:o,local:u,variables:f}),{out:e});return await e.close(),j(n)?g(void 0):p({exitCode:1})};export{q as main};
@@ -1,3 +0,0 @@
1
- import{a as g}from"./chunk-XMTGT2NJ.js";import{b as C,c as y,d as O}from"./chunk-BK2BDHKB.js";import{a as E,c as k,d as _,f as I}from"./chunk-LXVBR775.js";import{c as m,d as x,e as w,f as D,i as S,k as v}from"./chunk-BKVQBSFV.js";import{a as d,b as h}from"./chunk-DQAEQEXD.js";import"./chunk-DXB73IDG.js";var q=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],l=t=>q.map(n=>({...n,extras:C(t,n.id)})),u=(t,n)=>{let s=new Set(n.map(o=>o.questionId));for(let o of t)if(!s.has(o.id))return o;return null},B=t=>{let n=new Set(t.map(s=>s.questionId));return q.every(s=>n.has(s.id))};var f=(t,n,s)=>{switch(t.phase){case"IDLE":return N();case"DISCOVERY":return $(t,n,s);case"SPEC_DRAFT":return L(t);case"SPEC_APPROVED":case"BUILDING":return U(t,n,s);case"BLOCKED":return W(t);case"DONE":return G(t);default:return N()}},N=()=>({phase:"IDLE",instruction:'No active spec. Start one with: noskills spec new "description"'}),$=(t,n,s)=>{let o=l(n),e=u(o,t.discovery.answers);if(e===null)return{phase:"DISCOVERY",instruction:"All discovery questions answered. Run: noskills approve",question:{id:"",text:"",concerns:[],extras:[]},context:{rules:s,concernReminders:[]},transition:{onComplete:"noskills approve",remainingQuestions:0}};let r=t.discovery.answers.length,i=o.length;return{phase:"DISCOVERY",instruction:"Ask the user the following question and relay their answer.",question:{id:e.id,text:e.text,concerns:[...e.concerns],extras:e.extras.map(c=>c.text)},context:{rules:s,concernReminders:y(n)},transition:{onComplete:'noskills next --answer="..."',remainingQuestions:i-r-1}}},L=t=>({phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:t.specState.path??"",transition:{onApprove:"noskills approve"}}),U=(t,n,s)=>{let o=O(n),e={phase:"BUILDING",instruction:"Read the spec and implement the next task. Report progress when done.",context:{rules:s,concernReminders:y(n)},transition:{onComplete:'noskills next --answer="..."',onBlocked:'noskills block "reason"',iteration:t.building.iteration}};return o.length>0?{...e,concernTensions:o}:e},W=t=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:t.building.lastProgress??"Unknown",transition:{onResolved:'noskills next --answer="..."'}}),G=t=>({phase:"DONE",summary:{spec:t.spec,iterations:t.building.iteration,decisionsCount:t.decisions.length}});var b=(t,n,s,o)=>{let e=[];e.push(`# Spec: ${t}`),e.push(""),e.push("## Status: draft"),e.push(""),s.length>0&&(e.push(`## Concerns: ${s.map(r=>r.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let r of n)e.push(`### ${r.questionId}`),e.push(""),e.push(r.answer),e.push("");for(let r of s)if(r.specSections.length>0)for(let i of r.specSections)e.push(`## ${i} (${r.id})`),e.push(""),e.push("_To be filled in during implementation._"),e.push("");if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let r=0;r<o.length;r++){let i=o[r];e.push(`| ${r+1} | ${i.question} | ${i.choice} | ${i.promoted?"yes":"no"} |`)}e.push("")}return e.push("## Tasks"),e.push(""),e.push("_To be generated from discovery answers._"),e.push(""),e.push("## Verification"),e.push(""),e.push("_To be defined based on discovery answers._"),e.push(""),e.join(`
2
- `)};var A=async(t,n,s)=>{if(n.spec===null)throw new Error("No active spec");let o=`${t}/${m.specDir(n.spec)}`,e=`${t}/${m.specFile(n.spec)}`;await Deno.mkdir(o,{recursive:!0});let r=b(n.spec,n.discovery.answers,s,n.decisions);return await Deno.writeTextFile(e,r),e};var X=async t=>{let n=Deno.cwd();if(!await v(n)){let a=JSON.stringify({error:"noskills not initialized. Run: noskills init"});return await p(a),h({exitCode:1})}let s=null;if(t!==void 0)for(let a of t)a.startsWith("--answer=")&&(s=a.slice(9));let o=await x(n),e=await D(n);if(e===null){let a=JSON.stringify({error:"No config found"});return await p(a),h({exitCode:1})}let i=(await S(n)).filter(a=>e.concerns.includes(a.id));if(s!==null){let a=await j(n,o,e,i,s);await w(n,a);let T=await g(n),F=f(a,i,T);return await p(JSON.stringify(F,null,2)),d(void 0)}let c=await g(n),Q=f(o,i,c);return await p(JSON.stringify(Q,null,2)),d(void 0)},j=async(t,n,s,o,e)=>{switch(n.phase){case"DISCOVERY":{let r=l(o),i=u(r,n.discovery.answers);if(i===null)return n;let c=k(n,i.id,e);return B(c.discovery.answers)&&(c=_(c),await A(t,c,o)),c}case"BUILDING":return I(n,e);case"BLOCKED":return E(n,"BUILDING");default:return n}},p=async t=>{let n=new TextEncoder;await Deno.stdout.write(n.encode(t+`
3
- `))};export{X as main};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-ZY72QNKZ.js";import"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as OllamaModel,b as ollamaFactory};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-NZFUFGOC.js";import"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as OpenCodeModel,b as openCodeFactory};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f}from"./chunk-6YRN6OJC.js";import"./chunk-SCULX2ND.js";import"./chunk-DXB73IDG.js";export{e as applyRecipe,f as applyRecipeChain,b as fileExists,a as isPathSafe,c as processContent,d as runPostInstall};