eser 4.1.43 → 4.1.47

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 (216) hide show
  1. package/chunks/{add-IM5JC6QA.js → add-V7YYHLFH.js} +1 -1
  2. package/chunks/ajan-JKACPKCP.js +2 -0
  3. package/chunks/{approve-4CQFJU5A.js → approve-URMQ77UE.js} +1 -1
  4. package/chunks/{ask-UTEI7KGQ.js → ask-UCPMMIAF.js} +1 -1
  5. package/chunks/{block-MQTVULY3.js → block-5NWZBEXW.js} +1 -1
  6. package/chunks/{build-IRLEBMJE.js → build-BUB6OJCI.js} +2 -2
  7. package/chunks/cancel-V6OK6U73.js +2 -0
  8. package/chunks/{changelog-gen-USXHO6PE.js → changelog-gen-TEI4IBNO.js} +1 -1
  9. package/chunks/chunk-26ZFSXSK.js +3 -0
  10. package/chunks/{chunk-IWXI3UYI.js → chunk-37GFWQQ3.js} +1 -1
  11. package/chunks/{chunk-V3NJTF2Y.js → chunk-3AA3RXKD.js} +1 -1
  12. package/chunks/{chunk-LSET5TD3.js → chunk-3IZX4OZ7.js} +1 -1
  13. package/chunks/{chunk-3U5M6YO6.js → chunk-3PCHQM4S.js} +1 -1
  14. package/chunks/{chunk-VVWAUS3D.js → chunk-3QF3I2RD.js} +1 -1
  15. package/chunks/{chunk-C7EBLUGW.js → chunk-3QH27NOC.js} +1 -1
  16. package/chunks/{chunk-4COCZPO5.js → chunk-4HXAC4WN.js} +1 -1
  17. package/chunks/{chunk-TYLYMZQC.js → chunk-4QDEJUAF.js} +1 -1
  18. package/chunks/{chunk-RIOYVPPP.js → chunk-4ZVFKZ5S.js} +1 -1
  19. package/chunks/{chunk-CXTPYPO4.js → chunk-5PH7JRXR.js} +1 -1
  20. package/chunks/{chunk-E423U2PP.js → chunk-5QRJ7OJK.js} +1 -1
  21. package/chunks/chunk-6PRIUPN4.js +5 -0
  22. package/chunks/{chunk-KZAPWWOT.js → chunk-7XVIW7H6.js} +1 -1
  23. package/chunks/{chunk-IBBGWXAI.js → chunk-A2IW6BXT.js} +1 -1
  24. package/chunks/{chunk-YJ3ICGHV.js → chunk-AP7A6Y5Z.js} +1 -1
  25. package/chunks/{chunk-YURNTYEP.js → chunk-BJLUDX4R.js} +1 -1
  26. package/chunks/chunk-BLXGL5MA.js +4 -0
  27. package/chunks/{chunk-WPOZMPUR.js → chunk-CNHUVWV5.js} +1 -1
  28. package/chunks/{chunk-LYKN5EIM.js → chunk-CXTOTN4Z.js} +1 -1
  29. package/chunks/{chunk-IQQEVKBP.js → chunk-EGEJQP7D.js} +1 -1
  30. package/chunks/{chunk-7RL5ZFGE.js → chunk-EKUJSZIR.js} +1 -1
  31. package/chunks/{chunk-2UHHAPKY.js → chunk-ENTSZDR6.js} +1 -1
  32. package/chunks/{chunk-UCLOGVMF.js → chunk-F2YHX6DL.js} +30 -30
  33. package/chunks/{chunk-BNMKKNLB.js → chunk-F35K7YVH.js} +1 -1
  34. package/chunks/{chunk-H6HLRKRK.js → chunk-F44CX3KC.js} +4 -4
  35. package/chunks/{chunk-WWI6727S.js → chunk-F4G6QSSJ.js} +1 -1
  36. package/chunks/chunk-FW3ETRQ5.js +17 -0
  37. package/chunks/{chunk-SH4H7OLV.js → chunk-G5VGZMKA.js} +1 -1
  38. package/chunks/{chunk-VE6XM5OZ.js → chunk-GWZUQPFD.js} +1 -1
  39. package/chunks/{chunk-SK6QUPJR.js → chunk-HCYIL6IJ.js} +1 -1
  40. package/chunks/{chunk-6V6C6MWY.js → chunk-HP5W5XT6.js} +1 -1
  41. package/chunks/{chunk-QMRKAC6C.js → chunk-HVTJ5LVU.js} +1 -1
  42. package/chunks/{chunk-XOSAN6PX.js → chunk-JHEL4OFF.js} +1 -1
  43. package/chunks/{chunk-UQRZJPYH.js → chunk-JLRVMMMH.js} +1 -1
  44. package/chunks/{chunk-2N62LL55.js → chunk-JUOSGSVB.js} +1 -1
  45. package/chunks/{chunk-OWQXQ33F.js → chunk-L2E2H7YT.js} +1 -1
  46. package/chunks/{chunk-L7RS6MQ5.js → chunk-LGNGLAV3.js} +1 -1
  47. package/chunks/{chunk-2OKCK56H.js → chunk-LWWZT2AB.js} +1 -1
  48. package/chunks/{chunk-EXP2TZZC.js → chunk-MBCPGD5L.js} +1 -1
  49. package/chunks/{chunk-ZRUM5PE7.js → chunk-MCWDLVWU.js} +1 -1
  50. package/chunks/{chunk-ZEFYMWGZ.js → chunk-MJ2IPSAE.js} +2 -2
  51. package/chunks/{chunk-Z2LXZLZV.js → chunk-NFZWSVJM.js} +1 -1
  52. package/chunks/chunk-NY4W44PI.js +2 -0
  53. package/chunks/{chunk-MPGRKZIA.js → chunk-OAT2D23A.js} +1 -1
  54. package/chunks/chunk-ORAOSL2W.js +2 -0
  55. package/chunks/{chunk-SF6FT44C.js → chunk-OWV223WQ.js} +1 -1
  56. package/chunks/{chunk-FODF5MI2.js → chunk-PLMZ3FYS.js} +1 -1
  57. package/chunks/chunk-R2W7BL7V.js +2 -0
  58. package/chunks/{chunk-BSV66I74.js → chunk-R7FADWXC.js} +1 -1
  59. package/chunks/chunk-RGT7SMKJ.js +4 -0
  60. package/chunks/{chunk-4EJVA4QA.js → chunk-RHEYIO4O.js} +1 -1
  61. package/chunks/{chunk-QD46ROBD.js → chunk-RVJZFWN7.js} +1 -1
  62. package/chunks/{chunk-H5GHXMIT.js → chunk-SRWZLNT6.js} +1 -1
  63. package/chunks/{chunk-GKOMIH2B.js → chunk-TEOMM3RD.js} +1 -1
  64. package/chunks/{chunk-QYMHLTVT.js → chunk-TYUSWY27.js} +1 -1
  65. package/chunks/{chunk-2BEIAJ5J.js → chunk-VSTGSR3G.js} +1 -1
  66. package/chunks/{chunk-WF6JNPZS.js → chunk-VV47GXU5.js} +1 -1
  67. package/chunks/{chunk-TELZ2ZFI.js → chunk-W724KQYO.js} +1 -1
  68. package/chunks/{chunk-3F23SLJA.js → chunk-W7OYXLGD.js} +28 -27
  69. package/chunks/{chunk-6VHZQNHX.js → chunk-WJKE6XHF.js} +1 -1
  70. package/chunks/{chunk-H7U2VQCK.js → chunk-Y3XXSUFP.js} +1 -1
  71. package/chunks/{chunk-SMKZDN2Q.js → chunk-YA4IPF62.js} +1 -1
  72. package/chunks/{chunk-IBB6UZR2.js → chunk-YBCZC5KZ.js} +1 -1
  73. package/chunks/chunk-YTF3BAQS.js +2 -0
  74. package/chunks/chunk-YW377352.js +10 -0
  75. package/chunks/{chunk-RFHWH6ZX.js → chunk-Z5P6PXQV.js} +1 -1
  76. package/chunks/{chunk-MBG7SPPO.js → chunk-ZC4F4MYU.js} +1 -1
  77. package/chunks/{chunk-3LDGQFQZ.js → chunk-ZCQ5CISX.js} +1 -1
  78. package/chunks/chunk-ZER2RYWJ.js +2 -0
  79. package/chunks/claude-code-S2SGKOBE.js +2 -0
  80. package/chunks/{clone-DSVKII72.js → clone-YEBQK7CG.js} +1 -1
  81. package/chunks/{cmd-YU4MVRRR.js → cmd-2DAVTVOF.js} +1 -1
  82. package/chunks/{commitmsg-FS52L6J5.js → commitmsg-3NLTGBA7.js} +2 -2
  83. package/chunks/{concern-4HFEHA2X.js → concern-RNNRCADI.js} +1 -1
  84. package/chunks/{deno-I5YAWOB6.js → deno-XQHOVHKR.js} +1 -1
  85. package/chunks/{dev-JQS5G6PA.js → dev-GHSKFRDU.js} +2 -2
  86. package/chunks/{done-OSUBA7YO.js → done-VSVUSYIS.js} +1 -1
  87. package/chunks/{file-tools-shared-LMF72D6S.js → file-tools-shared-BGQUI7QP.js} +1 -1
  88. package/chunks/{free-WTJTBNOK.js → free-L4KB3WSS.js} +1 -1
  89. package/chunks/{gh-PJ2JDGXG.js → gh-L3FPMN5H.js} +2 -2
  90. package/chunks/{gh-contributors-EIM2PLGS.js → gh-contributors-NT5WW72V.js} +1 -1
  91. package/chunks/{init-ZOMBOUG3.js → init-EL6YCHIE.js} +3 -3
  92. package/chunks/init-II65LYMV.js +2 -0
  93. package/chunks/{install-J4D2DGTQ.js → install-YVHT6UAG.js} +1 -1
  94. package/chunks/invoke-hook-QEE3PJBH.js +12 -0
  95. package/chunks/kiro-LNQTCWQU.js +2 -0
  96. package/chunks/{list-NS7ECFDY.js → list-AKS7CUO3.js} +1 -1
  97. package/chunks/{list-XFPTCIMR.js → list-BOLPKAEY.js} +1 -1
  98. package/chunks/{list-PSLAM3H6.js → list-VEGVTAKQ.js} +1 -1
  99. package/chunks/{load-config-OGSPRY4L.js → load-config-G4DHKB5K.js} +1 -1
  100. package/chunks/loader-command-I5DTYP25.js +2 -0
  101. package/chunks/loader-reactor-P6I3MX5L.js +2 -0
  102. package/chunks/{main-BUEG2IMJ.js → main-PTEEAWXX.js} +2 -2
  103. package/chunks/manager-ARXVYR4H.js +7 -0
  104. package/chunks/{manifest-4EA74HMS.js → manifest-3VJ4O6HR.js} +1 -1
  105. package/chunks/{mod-WOZXOD2F.js → mod-AD5UWQSM.js} +1 -1
  106. package/chunks/{mod-RO7WP3SA.js → mod-BKHQAEVL.js} +1 -1
  107. package/chunks/{mod-G7PJEGW6.js → mod-DXA25A4J.js} +1 -1
  108. package/chunks/mod-GXNNOTTG.js +2 -0
  109. package/chunks/mod-IALKEUJL.js +9 -0
  110. package/chunks/mod-ICWGLZBQ.js +2 -0
  111. package/chunks/{mod-Q6SI6S6S.js → mod-MVH3RFS3.js} +2 -2
  112. package/chunks/{mod-U2MNO6EC.js → mod-PZSJGUM7.js} +1 -1
  113. package/chunks/{mod-2PIV6QCE.js → mod-QWYXFGRG.js} +1 -1
  114. package/chunks/{mod-VRTH35WZ.js → mod-RF5F5WS2.js} +2 -2
  115. package/chunks/{mod-XEK7FROU.js → mod-RMDGRCBK.js} +1 -1
  116. package/chunks/mod-TB73AJG3.js +23 -0
  117. package/chunks/{mod-II7CSZUT.js → mod-YH5Z6G4Q.js} +1 -1
  118. package/chunks/{new-3ZN4U7FJ.js → new-VGL3IRFP.js} +3 -3
  119. package/chunks/next-RYENG2XC.js +9 -0
  120. package/chunks/{ollama-LD6OENM2.js → ollama-IRQSLTDB.js} +1 -1
  121. package/chunks/opencode-74XXXUQ2.js +2 -0
  122. package/chunks/purge-6IOKNHG6.js +5 -0
  123. package/chunks/{recipe-applier-6SGY2W3A.js → recipe-applier-TTZEZGSC.js} +1 -1
  124. package/chunks/{registry-fetcher-H63ZWZHU.js → registry-fetcher-SPENFEOH.js} +1 -1
  125. package/chunks/release-6GDD5THZ.js +9 -0
  126. package/chunks/{release-notes-FSDHH2Y2.js → release-notes-MZFILXWE.js} +1 -1
  127. package/chunks/{release-tag-IOH5HGAA.js → release-tag-LGZEFMKJ.js} +1 -1
  128. package/chunks/{reopen-7EX6OJ6E.js → reopen-XDNX2XRX.js} +1 -1
  129. package/chunks/{reset-IZ76OH4F.js → reset-TDBHFTWW.js} +1 -1
  130. package/chunks/rule-DUOZIDNM.js +7 -0
  131. package/chunks/{run-FGMEIO57.js → run-OCYNXRVD.js} +1 -1
  132. package/chunks/run-YK7DTHKW.js +4 -0
  133. package/chunks/{scripts-L2FZBUHU.js → scripts-7VDHDKFK.js} +1 -1
  134. package/chunks/{serve-VXA7O546.js → serve-5V65OPB2.js} +2 -2
  135. package/chunks/{server-KJW4HWK7.js → server-R347ON4B.js} +1 -1
  136. package/chunks/session-SOIP6NHS.js +2 -0
  137. package/chunks/spec-Y6K7CSBK.js +2 -0
  138. package/chunks/status-SXWEDQTL.js +2 -0
  139. package/chunks/{sync-M6DR7ZI4.js → sync-5XW5FTWS.js} +1 -1
  140. package/chunks/{system-DLK4HRFA.js → system-HNZLRJLH.js} +1 -1
  141. package/chunks/{system-X4X6JD4X.js → system-WX4PNZSQ.js} +1 -1
  142. package/chunks/{update-CV7JPZGM.js → update-522VXIKX.js} +1 -1
  143. package/chunks/validate-bom-XA7KZWTH.js +2 -0
  144. package/chunks/validate-case-conflict-QWOT7276.js +2 -0
  145. package/chunks/validate-circular-deps-IAC3BSYO.js +2 -0
  146. package/chunks/validate-commit-msg-M42NIQLD.js +2 -0
  147. package/chunks/validate-docs-DXY4C23P.js +2 -0
  148. package/chunks/validate-eof-M3LGJL64.js +2 -0
  149. package/chunks/validate-export-names-BQAH7J4F.js +2 -0
  150. package/chunks/validate-filenames-WYIWPR5V.js +2 -0
  151. package/chunks/validate-json-S2J5SSZS.js +2 -0
  152. package/chunks/validate-large-files-X4D3CL42.js +2 -0
  153. package/chunks/validate-licenses-6LB6MLQU.js +2 -0
  154. package/chunks/validate-line-endings-NX2XXGTH.js +2 -0
  155. package/chunks/validate-merge-conflict-3ZNS7HS2.js +2 -0
  156. package/chunks/validate-mod-exports-72EWWWMT.js +2 -0
  157. package/chunks/{validate-package-configs-ZO5YJE2D.js → validate-package-configs-55XAXICZ.js} +1 -1
  158. package/chunks/validate-secrets-5V7V65JA.js +2 -0
  159. package/chunks/validate-shebangs-XVHLZJKY.js +2 -0
  160. package/chunks/validate-submodules-Z6WRSMS5.js +2 -0
  161. package/chunks/validate-symlinks-FWV2RFCM.js +2 -0
  162. package/chunks/validate-toml-DTGDAUSH.js +2 -0
  163. package/chunks/validate-trailing-whitespace-5QSYKA6L.js +2 -0
  164. package/chunks/validate-yaml-SKE7CDCP.js +2 -0
  165. package/chunks/versions-MFY62V25.js +2 -0
  166. package/chunks/{watch-LW6FU2EL.js → watch-DBB4W5AE.js} +1 -1
  167. package/chunks/wontfix-D2ZHBGNH.js +2 -0
  168. package/eser.js +1 -1
  169. package/package.json +10 -1
  170. package/chunks/cancel-2QOM5WPD.js +0 -2
  171. package/chunks/chunk-5MVJUALI.js +0 -4
  172. package/chunks/chunk-GUPRQ2PC.js +0 -17
  173. package/chunks/chunk-JZ7DUWYC.js +0 -2
  174. package/chunks/chunk-OYNFK77H.js +0 -2
  175. package/chunks/chunk-PIV56NIC.js +0 -7
  176. package/chunks/chunk-V6YI7YJ4.js +0 -5
  177. package/chunks/chunk-VAIRJES2.js +0 -2
  178. package/chunks/chunk-VNJJQED3.js +0 -3
  179. package/chunks/chunk-ZJMX5J6E.js +0 -4
  180. package/chunks/claude-code-VX2T4YII.js +0 -2
  181. package/chunks/init-FEOHKH5H.js +0 -2
  182. package/chunks/invoke-hook-VIVTX5OJ.js +0 -11
  183. package/chunks/kiro-JGEZGFF3.js +0 -2
  184. package/chunks/mod-2J7TZ2PG.js +0 -2
  185. package/chunks/mod-KTGLCC3R.js +0 -2
  186. package/chunks/next-B7T3JEVA.js +0 -9
  187. package/chunks/opencode-ECTBCC3O.js +0 -2
  188. package/chunks/purge-GV7LXDF3.js +0 -5
  189. package/chunks/release-6I5TL34I.js +0 -9
  190. package/chunks/rule-CNBMT5LD.js +0 -3
  191. package/chunks/run-ZCVAL2V6.js +0 -4
  192. package/chunks/spec-TT5ZFPZF.js +0 -2
  193. package/chunks/status-TUG52D3I.js +0 -2
  194. package/chunks/validate-bom-MYISC3IT.js +0 -2
  195. package/chunks/validate-case-conflict-B737FXF2.js +0 -2
  196. package/chunks/validate-circular-deps-WME7VUO4.js +0 -2
  197. package/chunks/validate-commit-msg-HJ5MXYNE.js +0 -2
  198. package/chunks/validate-docs-CCYMKDXS.js +0 -2
  199. package/chunks/validate-eof-6WAM6VAY.js +0 -2
  200. package/chunks/validate-export-names-Q5FSXTV5.js +0 -2
  201. package/chunks/validate-filenames-JVBT2GXA.js +0 -2
  202. package/chunks/validate-json-UPGBABYE.js +0 -2
  203. package/chunks/validate-large-files-RJLMJSWM.js +0 -2
  204. package/chunks/validate-licenses-YW5CK3QF.js +0 -2
  205. package/chunks/validate-line-endings-3VNZ7KT6.js +0 -2
  206. package/chunks/validate-merge-conflict-SKWYYHFS.js +0 -2
  207. package/chunks/validate-mod-exports-OMUDATXK.js +0 -2
  208. package/chunks/validate-secrets-FV6672MD.js +0 -2
  209. package/chunks/validate-shebangs-N55SME72.js +0 -2
  210. package/chunks/validate-submodules-ADHLOUGA.js +0 -2
  211. package/chunks/validate-symlinks-4IIIP6AQ.js +0 -2
  212. package/chunks/validate-toml-OVIYGLPR.js +0 -2
  213. package/chunks/validate-trailing-whitespace-LWP5QEXS.js +0 -2
  214. package/chunks/validate-yaml-L7JCSGXY.js +0 -2
  215. package/chunks/versions-OKK45EDV.js +0 -2
  216. package/chunks/wontfix-JRU2EDAB.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as b,b as G,c as R}from"./chunk-EXP2TZZC.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-MBG7SPPO.js";import{b as r,d as i,f as w,g as C,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as y}from"./chunk-5MVJUALI.js";import{a as k}from"./chunk-C7EBLUGW.js";import{a as f,b as g}from"./chunk-FFWPJP7A.js";import{g as T,i as m}from"./chunk-6VHZQNHX.js";import{g as ie,m as O,n as J,o as I,p as le}from"./chunk-BQT5RJZB.js";var de="# eser CLI completions",B="eser",te=async e=>{try{return await m.fs.readTextFile(e)}catch{return""}},me=async e=>{try{return await m.fs.stat(e),!0}catch{return!1}},se=async e=>{let t=R(e,B);if(t.completionType==="file")return await me(t.completionsFile);let s=await te(t.rcFile),n=G(e,B);return s.includes(n)},ne=async e=>{let t=R(e,B),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=m.path.dirname(n);try{await m.fs.mkdir(o,{recursive:!0})}catch{}await m.fs.writeTextFile(n,`# eser CLI completions
2
+ import{a as S,b as G,c as R}from"./chunk-MBCPGD5L.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-ZC4F4MYU.js";import{b as r,d as i,f as w,g as y,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as v}from"./chunk-BLXGL5MA.js";import{a as k}from"./chunk-3QH27NOC.js";import{a as f,b as g}from"./chunk-FFWPJP7A.js";import{g as T,i as m}from"./chunk-WJKE6XHF.js";import{g as ie,m as O,n as K,o as I,p as le}from"./chunk-BQT5RJZB.js";var de="# eser CLI completions",B="eser",te=async e=>{try{return await m.fs.readTextFile(e)}catch{return""}},me=async e=>{try{return await m.fs.stat(e),!0}catch{return!1}},se=async e=>{let t=R(e,B);if(t.completionType==="file")return await me(t.completionsFile);let s=await te(t.rcFile),n=G(e,B);return s.includes(n)},ne=async e=>{let t=R(e,B),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=m.path.dirname(n);try{await m.fs.mkdir(o,{recursive:!0})}catch{}await m.fs.writeTextFile(n,`# eser CLI completions
3
3
  # This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
4
4
  complete -c eser -f
5
5
  complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
@@ -17,37 +17,37 @@ ${o}
17
17
  `).filter(a=>!a.includes("eser system completions")).filter(a=>a!==de).join(`
18
18
  `).replace(/\n{3,}/g,`
19
19
 
20
- `);await m.fs.writeTextFile(t.rcFile,c),s.writeln(r(" "),i("Removed completions from"),r(" "),l(t.rcFile))}}catch(n){s.writeln(Z(` Warning: Could not remove shell completions: ${n instanceof Error?n.message:String(n)}`))}await s.close()};var M=m,ye={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},ue={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"]}},ve=async()=>{let e=I(),t=M.path.join(e,".local","bin");try{return await M.fs.stat(t),t}catch{}return"/usr/local/bin"},ke=async()=>{let e=M.process.execPath(),t=await ve(),s=M.path.join(t,"eser"),n=p({renderer:d.ansi(),sink:u.stdout()});n.writeln(r("Install method: "),l("compiled binary")),n.writeln(i(`Copying to ${s}...`));try{await M.fs.copyFile(e,s),await M.fs.chmod(s,493)}catch(a){if(a instanceof Deno.errors.PermissionDenied)return n.writeln(w(`
20
+ `);await m.fs.writeTextFile(t.rcFile,c),s.writeln(r(" "),i("Removed completions from"),r(" "),l(t.rcFile))}}catch(n){s.writeln(Z(` Warning: Could not remove shell completions: ${n instanceof Error?n.message:String(n)}`))}await s.close()};var M=m,ye={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},ue={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"]}},ve=async()=>{let e=I(),t=M.path.join(e,".local","bin");try{return await M.fs.stat(t),t}catch{}return"/usr/local/bin"},Ee=async()=>{let e=M.process.execPath(),t=await ve(),s=M.path.join(t,"eser"),n=p({renderer:d.ansi(),sink:u.stdout()});n.writeln(r("Install method: "),l("compiled binary")),n.writeln(i(`Copying to ${s}...`));try{await M.fs.copyFile(e,s),await M.fs.chmod(s,493)}catch(a){if(a instanceof Error&&"code"in a&&a.code==="EACCES"||typeof Deno<"u"&&a instanceof Deno.errors.PermissionDenied)return n.writeln(w(`
21
21
  Permission denied writing to ${t}.
22
- Try: sudo eser install`)),await n.close(),g({exitCode:1});throw await n.close(),a}n.writeln(C(`
23
- Installation complete!`)),n.writeln(r("You can now use "),l("eser"),r(" from anywhere in your terminal."));let o=b();if(!await se(o)){n.writeln(r(`
24
- Setting up `),l(o),r(" completions...")),await ne(o);let a=R(o);a.completionType==="eval"&&n.writeln(i(` Restart your shell or run 'source ${a.rcFile}' to enable completions.`))}return await n.close(),f(void 0)},Ee=async e=>{let t=await T(ye);if(t.invoker==="binary")return await ke();let s=p({renderer:d.ansi(),sink:u.stdout()});s.writeln(r("Detected runtime: "),l(t.runtime));let n=ue[t.runtime]??ue.node,{cmd:o,args:c}=n;s.writeln(i(`Running: ${o} ${c.join(" ")}`)),s.writeln();let a=await y`${o} ${c}`.stdout("inherit").stderr("inherit").noThrow().spawn();if(!a.success)return s.writeln(w(`
25
- Installation failed.`)),await s.close(),g({exitCode:a.code});s.writeln(C(`
26
- Installation complete!`)),s.writeln(r("You can now use "),l("eser"),r(" from anywhere in your terminal."));let x=b();if(!await se(x)){s.writeln(r(`
27
- Setting up `),l(x),r(" completions...")),await ne(x);let K=R(x);K.completionType==="eval"&&s.writeln(i(` Restart your shell or run 'source ${K.rcFile}' to enable completions.`))}return await s.close(),f(void 0)};var Pe={deno:{cmd:"deno",args:["uninstall","-g","eser"]},node:{cmd:"npm",args:["uninstall","-g","eser"]},bun:{cmd:"bun",args:["remove","-g","eser"]}},$e=async e=>{let t=ie(),s=p({renderer:d.ansi(),sink:u.stdout()});s.writeln(r("Detected runtime: "),l(t));let n=Pe[t];if(n===void 0){let H=d.ansi();return await s.close(),g({message:`${H.render([w(`
22
+ Try: sudo eser install`)),await n.close(),g({exitCode:1});throw await n.close(),a}n.writeln(y(`
23
+ Installation complete!`)),n.writeln(r("You can now use "),l("eser"),r(" from anywhere in your terminal."));let o=S();if(!await se(o)){n.writeln(r(`
24
+ Setting up `),l(o),r(" completions...")),await ne(o);let a=R(o);a.completionType==="eval"&&n.writeln(i(` Restart your shell or run 'source ${a.rcFile}' to enable completions.`))}return await n.close(),f(void 0)},ke=async e=>{let t=await T(ye);if(t.invoker==="binary")return await Ee();let s=p({renderer:d.ansi(),sink:u.stdout()});s.writeln(r("Detected runtime: "),l(t.runtime));let n=ue[t.runtime]??ue.node,{cmd:o,args:c}=n;s.writeln(i(`Running: ${o} ${c.join(" ")}`)),s.writeln();let a=await v`${o} ${c}`.stdout("inherit").stderr("inherit").noThrow().spawn();if(!a.success)return s.writeln(w(`
25
+ Installation failed.`)),await s.close(),g({exitCode:a.code});s.writeln(y(`
26
+ Installation complete!`)),s.writeln(r("You can now use "),l("eser"),r(" from anywhere in your terminal."));let x=S();if(!await se(x)){s.writeln(r(`
27
+ Setting up `),l(x),r(" completions...")),await ne(x);let q=R(x);q.completionType==="eval"&&s.writeln(i(` Restart your shell or run 'source ${q.rcFile}' to enable completions.`))}return await s.close(),f(void 0)};var Pe={deno:{cmd:"deno",args:["uninstall","-g","eser"]},node:{cmd:"npm",args:["uninstall","-g","eser"]},bun:{cmd:"bun",args:["remove","-g","eser"]}},$e=async e=>{let t=ie(),s=p({renderer:d.ansi(),sink:u.stdout()});s.writeln(r("Detected runtime: "),l(t));let n=Pe[t];if(n===void 0){let H=d.ansi();return await s.close(),g({message:`${H.render([w(`
28
28
  Unsupported runtime: ${t}`)])}
29
- Global uninstallation is only supported for Deno, Node.js, and Bun.`,exitCode:1})}let{cmd:o,args:c}=n,a=b();s.writeln(r(`
29
+ Global uninstallation is only supported for Deno, Node.js, and Bun.`,exitCode:1})}let{cmd:o,args:c}=n,a=S();s.writeln(r(`
30
30
  Removing `),l(a),r(" completions...")),await pe(a),s.writeln(i(`
31
- Running: ${o} ${c.join(" ")}`)),s.writeln();let x=await y`${o} ${c}`.stdout("inherit").stderr("inherit").noThrow().spawn();return x.success?(s.writeln(C(`
31
+ Running: ${o} ${c.join(" ")}`)),s.writeln();let x=await v`${o} ${c}`.stdout("inherit").stderr("inherit").noThrow().spawn();return x.success?(s.writeln(y(`
32
32
  Uninstallation complete!`)),s.writeln(r("The "),l("eser"),r(" command has been removed from your system.")),await s.close(),f(void 0)):(s.writeln(w(`
33
- Uninstallation failed.`)),await s.close(),g({exitCode:x.code}))};var z=m,fe=".cache/eser",Re="latest-version.json",_e=24*60*60*1e3,Ae="https://api.github.com/repos/eser/stack/releases/latest",he=()=>{let e=I();return z.path.join(e,fe,Re)},Te=()=>{let e=I();return z.path.join(e,fe)},be=async()=>{try{let e=he();if(!await z.fs.exists(e))return;let s=await z.fs.readTextFile(e),n=JSON.parse(s);return typeof n.latestVersion!="string"||typeof n.checkedAt!="number"?void 0:n}catch{return}},Se=async e=>{try{let t=Te();await z.fs.ensureDir(t);let s=he(),n={latestVersion:e,checkedAt:Date.now()};await z.fs.writeTextFile(s,JSON.stringify(n))}catch{}},He=async()=>{try{let e=await fetch(Ae,{headers:{Accept:"application/vnd.github.v3+json"}});if(!e.ok)return;let s=(await e.json()).tag_name;return typeof s!="string"?void 0:s.startsWith("v")?s.slice(1):s}catch{return}},q=async()=>{try{let e=k.version,t=await be();if(t!==void 0&&Date.now()-t.checkedAt<_e)return{latestVersion:t.latestVersion,currentVersion:e,updateAvailable:ee(e,t.latestVersion)};let s=await He();return s===void 0?void 0:(await Se(s),{latestVersion:s,currentVersion:e,updateAvailable:ee(e,s)})}catch{return}};var v=m,Ie={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},we={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"]}},De={"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"},Fe=()=>{let e=O(),t=J(),s=`${e}-${t}`;return De[s]},Ue=async()=>{let e=p({renderer:d.ansi(),sink:u.stdout()});e.writeln(r("Install method: "),l("compiled binary")),e.writeln(r("Current version: "),l(k.version),r(`
34
- `)),e.writeln(r("Checking for updates..."));let t=await q();if(t===void 0)return e.writeln(w("Could not check for updates.")),await e.close(),g({exitCode:1});if(!t.updateAvailable)return e.writeln(C(`
33
+ Uninstallation failed.`)),await s.close(),g({exitCode:x.code}))};var z=m,fe=".cache/eser",Re="latest-version.json",Ae=24*60*60*1e3,_e="https://api.github.com/repos/eser/stack/releases/latest",he=()=>{let e=I();return z.path.join(e,fe,Re)},Te=()=>{let e=I();return z.path.join(e,fe)},Se=async()=>{try{let e=he();if(!await z.fs.exists(e))return;let s=await z.fs.readTextFile(e),n=JSON.parse(s);return typeof n.latestVersion!="string"||typeof n.checkedAt!="number"?void 0:n}catch{return}},be=async e=>{try{let t=Te();await z.fs.ensureDir(t);let s=he(),n={latestVersion:e,checkedAt:Date.now()};await z.fs.writeTextFile(s,JSON.stringify(n))}catch{}},He=async()=>{try{let e=await fetch(_e,{headers:{Accept:"application/vnd.github.v3+json"}});if(!e.ok)return;let s=(await e.json()).tag_name;return typeof s!="string"?void 0:s.startsWith("v")?s.slice(1):s}catch{return}},J=async()=>{try{let e=k.version,t=await Se();if(t!==void 0&&Date.now()-t.checkedAt<Ae)return{latestVersion:t.latestVersion,currentVersion:e,updateAvailable:ee(e,t.latestVersion)};let s=await He();return s===void 0?void 0:(await be(s),{latestVersion:s,currentVersion:e,updateAvailable:ee(e,s)})}catch{return}};var E=m,Ie={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},we={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"]}},De={"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"},Fe=()=>{let e=O(),t=K(),s=`${e}-${t}`;return De[s]},Ue=async()=>{let e=p({renderer:d.ansi(),sink:u.stdout()});e.writeln(r("Install method: "),l("compiled binary")),e.writeln(r("Current version: "),l(k.version),r(`
34
+ `)),e.writeln(r("Checking for updates..."));let t=await J();if(t===void 0)return e.writeln(w("Could not check for updates.")),await e.close(),g({exitCode:1});if(!t.updateAvailable)return e.writeln(y(`
35
35
  Already up to date (v${k.version}).`)),await e.close(),f(void 0);e.writeln(r(`
36
- New version available: `),l(`v${t.latestVersion}`));let s=Fe();if(s===void 0){let $=O(),N=J();return e.writeln(w(`
37
- Unsupported platform: ${$}-${N}`)),await e.close(),g({exitCode:1})}let n=`v${t.latestVersion}`,o=O()==="windows",a=`eser-${n}-${s}.${o?"zip":"tar.gz"}`,x=`https://github.com/eser/stack/releases/download/${n}`;e.writeln(i(`Downloading ${a}...`));let H=await fetch(`${x}/${a}`);if(!H.ok)return e.writeln(w(`
38
- Failed to download: HTTP ${H.status}`)),await e.close(),g({exitCode:1});let K=await fetch(`${x}/SHA256SUMS.txt`);if(K.ok){let N=(await K.text()).split(`
39
- `).find(j=>j.includes(a));if(N!==void 0){let j=N.split(/\s+/)[0],V=new Uint8Array(await H.clone().arrayBuffer()),A=await crypto.subtle.digest("SHA-256",V);if(Array.from(new Uint8Array(A)).map(Ce=>Ce.toString(16).padStart(2,"0")).join("")!==j)return e.writeln(w(`
40
- SHA256 checksum verification failed.`)),await e.close(),g({exitCode:1});e.writeln(i("Checksum verified."))}}let L=await v.fs.makeTempDir({prefix:"eser-update-"});try{let $=v.path.join(L,a),N=new Uint8Array(await H.arrayBuffer());await v.fs.writeFile($,N),o?await y`powershell -Command "Expand-Archive -Path ${$} -DestinationPath ${L}"`.spawn():await y`tar -xzf ${$} -C ${L}`.spawn();let j=o?v.path.join(L,"eser.exe"):v.path.join(L,"eser"),V=v.process.execPath();if(o){let A=V.replace(/\.exe$/i,".new.exe");await v.fs.copyFile(j,A),e.writeln(C(`
36
+ New version available: `),l(`v${t.latestVersion}`));let s=Fe();if(s===void 0){let C=O(),L=K();return e.writeln(w(`
37
+ Unsupported platform: ${C}-${L}`)),await e.close(),g({exitCode:1})}let n=`v${t.latestVersion}`,o=O()==="windows",a=`eser-${n}-${s}.${o?"zip":"tar.gz"}`,x=`https://github.com/eser/stack/releases/download/${n}`;e.writeln(i(`Downloading ${a}...`));let H=await fetch(`${x}/${a}`);if(!H.ok)return e.writeln(w(`
38
+ Failed to download: HTTP ${H.status}`)),await e.close(),g({exitCode:1});let q=await fetch(`${x}/SHA256SUMS.txt`);if(q.ok){let L=(await q.text()).split(`
39
+ `).find(j=>j.includes(a));if(L!==void 0){let j=L.split(/\s+/)[0],V=new Uint8Array(await H.clone().arrayBuffer()),_=await crypto.subtle.digest("SHA-256",V);if(Array.from(new Uint8Array(_)).map(Ce=>Ce.toString(16).padStart(2,"0")).join("")!==j)return e.writeln(w(`
40
+ SHA256 checksum verification failed.`)),await e.close(),g({exitCode:1});e.writeln(i("Checksum verified."))}}let N=await E.fs.makeTempDir({prefix:"eser-update-"});try{let C=E.path.join(N,a),L=new Uint8Array(await H.arrayBuffer());await E.fs.writeFile(C,L),o?await v`powershell -Command "Expand-Archive -Path ${C} -DestinationPath ${N}"`.spawn():await v`tar -xzf ${C} -C ${N}`.spawn();let j=o?E.path.join(N,"eser.exe"):E.path.join(N,"eser"),V=E.process.execPath();if(o){let _=V.replace(/\.exe$/i,".new.exe");await E.fs.copyFile(j,_),e.writeln(y(`
41
41
  Downloaded v${t.latestVersion}!`)),e.writeln(r(`
42
42
  To complete the update, close this terminal and rename:
43
- `),l(A),r(`
43
+ `),l(_),r(`
44
44
  to:
45
- `),l(V))}else{let A=`${V}.new`;await v.fs.copyFile(j,A),await v.fs.chmod(A,493),await v.fs.rename(A,V),e.writeln(C(`
46
- Updated to v${t.latestVersion}!`))}}catch($){if($ instanceof Deno.errors.PermissionDenied)return e.writeln(w(`
45
+ `),l(V))}else{let _=`${V}.new`;await E.fs.copyFile(j,_),await E.fs.chmod(_,493),await E.fs.rename(_,V),e.writeln(y(`
46
+ Updated to v${t.latestVersion}!`))}}catch(C){if(C instanceof Error&&"code"in C&&C.code==="EACCES"||typeof Deno<"u"&&C instanceof Deno.errors.PermissionDenied)return e.writeln(w(`
47
47
  Permission denied. Try running with sudo:
48
- sudo eser update`)),await e.close(),g({exitCode:1});throw await e.close(),$}finally{try{await v.fs.remove(L,{recursive:!0})}catch{}}return await e.close(),f(void 0)},Le=async e=>{let t=await T(Ie);if(t.invoker==="binary")return await Ue();let s=p({renderer:d.ansi(),sink:u.stdout()});s.writeln(r("Detected runtime: "),l(t.runtime));let n=we[t.runtime]??we.node,{cmd:o,args:c}=n;s.writeln(i(`Running: ${o} ${c.join(" ")}`)),s.writeln();let a=await y`${o} ${c}`.stdout("inherit").stderr("inherit").noThrow().spawn();return a.success?(s.writeln(C(`
48
+ sudo eser update`)),await e.close(),g({exitCode:1});throw await e.close(),C}finally{try{await E.fs.remove(N,{recursive:!0})}catch{}}return await e.close(),f(void 0)},Ne=async e=>{let t=await T(Ie);if(t.invoker==="binary")return await Ue();let s=p({renderer:d.ansi(),sink:u.stdout()});s.writeln(r("Detected runtime: "),l(t.runtime));let n=we[t.runtime]??we.node,{cmd:o,args:c}=n;s.writeln(i(`Running: ${o} ${c.join(" ")}`)),s.writeln();let a=await v`${o} ${c}`.stdout("inherit").stderr("inherit").noThrow().spawn();return a.success?(s.writeln(y(`
49
49
  Update complete!`)),s.writeln(r("The "),l("eser"),r(" command has been updated to the latest version.")),await s.close(),f(void 0)):(s.writeln(w(`
50
- Update failed.`)),await s.close(),g({exitCode:a.code}))};var Ne=e=>{let t=R(e,"eser"),s=d.ansi();if(t.completionType==="file")return`
50
+ Update failed.`)),await s.close(),g({exitCode:a.code}))};var Le=e=>{let t=R(e,"eser"),s=d.ansi();if(t.completionType==="file")return`
51
51
  To install, run:
52
52
 
53
53
  ${s.render([i(`eser system completions --shell fish > ${t.completionsFile}`)])}
@@ -56,11 +56,11 @@ To install, add the following to your ${s.render([l(t.rcFile)])}:
56
56
 
57
57
  ${s.render([i(n)])}
58
58
  `},je=e=>{let t=e.flags.shell,s=d.ansi(),n=p({renderer:s,sink:u.stdout()}),o;if(t!==void 0){if(!["bash","zsh","fish"].includes(t))return g({message:`${s.render([w(`Invalid shell: ${t}`)])}
59
- Supported shells: bash, zsh, fish`,exitCode:1});o=t}else o=b();let a=e.root.completions(o);return t===void 0&&(n.writeln(r("Generating "),l(o),r(" completions...")),console.log(Ne(o)),n.writeln(i(`--- Completion script ---
60
- `))),console.log(a),f(void 0)};var Ve=200,Oe=async e=>{let t=p({renderer:d.ansi(),sink:u.stdout()});if(e.flags.bare===!0)return t.writeln(r(k.version)),await t.close(),f(void 0);t.writeln(r(`eser ${k.version}`));try{let s=new Promise(o=>{setTimeout(()=>o(void 0),Ve)}),n=await Promise.race([q(),s]);n!==void 0&&n.updateAvailable&&t.writeln(i(` Update available: v${n.latestVersion} \u2014 run 'eser update'`))}catch{}return await t.close(),f(void 0)};var Q=m,Ge={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},X=17,S=p({renderer:d.ansi(),sink:u.stdout()}),U=(e,t)=>{let s=`${e}:`.padEnd(X);S.writeln(r(` ${s}`),C("\u2713"),r(` ${t}`))},E=(e,t)=>{let s=`${e}:`.padEnd(X);S.writeln(r(` ${s}`),w("\u2717"),r(` ${t}`))},ge=(e,t)=>{let s=`${e}:`.padEnd(X);S.writeln(r(` ${s}${t}`))},Be=(e,t)=>{let s=`${e}:`.padEnd(X);S.writeln(r(` ${s}`),i("-"),r(` ${t}`))},ae=async e=>{try{return await Q.fs.stat(e),!0}catch{return!1}},Me=async e=>{try{return await Q.fs.readTextFile(e)}catch{return""}},xe=(e,t)=>e.match(t)?.[1],We=async()=>{let e=Q.path.join(".",".git","hooks","pre-commit");if(!await ae(e)){E("Git hooks","Not installed");return}(await Me(e)).includes("eser")?U("Git hooks","Installed"):E("Git hooks","Not installed")},ze=async()=>{let e=Q.path.join(".",".eser","manifest.yml"),t=Q.path.join(".",".manifest.yml");if(await ae(e)){U("Manifest",".eser/manifest.yml found");return}if(await ae(t)){U("Manifest",".manifest.yml found (legacy path)");return}E("Manifest",".eser/manifest.yml not found")},qe=async()=>{try{let e=await y`deno --version`.noThrow().quiet().text(),t=xe(e,/deno\s+(\S+)/);t!==void 0?U("Deno",t):E("Deno","Not found")}catch{E("Deno","Not found")}},Ke=async()=>{try{let e=await y`go version`.noThrow().quiet().text(),t=xe(e,/go(\d+\.\d+(?:\.\d+)?)/);t!==void 0?U("Go",t):E("Go","Not found")}catch{E("Go","Not found")}},Je=async()=>{try{let t=(await y`node --version`.noThrow().quiet().text()).trim();t.length>0?U("Node",t):E("Node","Not found")}catch{E("Node","Not found")}},Ye=async e=>{S.writeln(r(`eser doctor
61
- `));let t=await T(Ge);ge("Install method",`${t.invoker} (${t.mode})`),ge("Version",k.version);let s=await q();return s===void 0?Be("Update","Could not check for updates"):s.updateAvailable?E("Update",`Update available: v${s.latestVersion}`):U("Update","Up to date"),S.writeln(),await We(),await ze(),S.writeln(),await qe(),await Ke(),await Je(),await S.close(),f(void 0)};var P=m,Qe={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},Xe=20,_=p({renderer:d.ansi(),sink:u.stdout()}),h=(e,t)=>{let s=`${e}:`.padEnd(Xe);_.writeln(r(` ${s}${t}`))},Ze=async e=>{_.writeln(r("eser system info")),_.writeln(i(`
62
- Runtime`)),h("Name",P.name),h("Version",P.version),h("Platform",O()),h("Arch",J());let t=P.capabilities,s=Object.entries(t).map(([c,a])=>`${c}=${a?"yes":"no"}`).join(", ");h("Capabilities",s),_.writeln(i(`
63
- Locations`)),h("Homedir",I()),h("Tmpdir",le()),h("CWD",P.process.cwd()),h("PID",String(P.process.pid)),h("Exec path",P.process.execPath()),_.writeln(i(`
64
- Process`)),h("argv0",P.process.argv0),h("argv",P.process.argv.join(" ")),h("args",P.process.args.join(" ")),_.writeln(i(`
65
- Execution Context`));let n=await T(Qe);h("Runtime",n.runtime),h("Invoker",`${n.invoker} (${n.mode})`),h("Command",n.command),h("In PATH",n.isInPath?"yes":"no"),_.writeln(i(`
66
- Environment`));let o=["PATH","HOME","SHELL","TERM","DENO_DIR","BUN_INSTALL","NODE_ENV"];for(let c of o){let a=P.env.get(c);if(a!==void 0){let x=c==="PATH"?`(${a.split(":").length} entries)`:a;h(c,x)}}return _.writeln(),await _.close(),f(void 0)};export{Ee as a,$e as b,Le as c,je as d,Oe as e,Ye as f,Ze as g};
59
+ Supported shells: bash, zsh, fish`,exitCode:1});o=t}else o=S();let a=e.root.completions(o);return t===void 0&&(n.writeln(r("Generating "),l(o),r(" completions...")),console.log(Le(o)),n.writeln(i(`--- Completion script ---
60
+ `))),console.log(a),f(void 0)};var Ve=200,Oe=async e=>{let t=p({renderer:d.ansi(),sink:u.stdout()});if(e.flags.bare===!0)return t.writeln(r(k.version)),await t.close(),f(void 0);t.writeln(r(`eser ${k.version}`));try{let s=new Promise(o=>{setTimeout(()=>o(void 0),Ve)}),n=await Promise.race([J(),s]);n!==void 0&&n.updateAvailable&&t.writeln(i(` Update available: v${n.latestVersion} \u2014 run 'eser update'`))}catch{}return await t.close(),f(void 0)};var Q=m,Ge={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},X=17,b=p({renderer:d.ansi(),sink:u.stdout()}),U=(e,t)=>{let s=`${e}:`.padEnd(X);b.writeln(r(` ${s}`),y("\u2713"),r(` ${t}`))},P=(e,t)=>{let s=`${e}:`.padEnd(X);b.writeln(r(` ${s}`),w("\u2717"),r(` ${t}`))},ge=(e,t)=>{let s=`${e}:`.padEnd(X);b.writeln(r(` ${s}${t}`))},Be=(e,t)=>{let s=`${e}:`.padEnd(X);b.writeln(r(` ${s}`),i("-"),r(` ${t}`))},ae=async e=>{try{return await Q.fs.stat(e),!0}catch{return!1}},Me=async e=>{try{return await Q.fs.readTextFile(e)}catch{return""}},xe=(e,t)=>e.match(t)?.[1],We=async()=>{let e=Q.path.join(".",".git","hooks","pre-commit");if(!await ae(e)){P("Git hooks","Not installed");return}(await Me(e)).includes("eser")?U("Git hooks","Installed"):P("Git hooks","Not installed")},ze=async()=>{let e=Q.path.join(".",".eser","manifest.yml"),t=Q.path.join(".",".manifest.yml");if(await ae(e)){U("Manifest",".eser/manifest.yml found");return}if(await ae(t)){U("Manifest",".manifest.yml found (legacy path)");return}P("Manifest",".eser/manifest.yml not found")},Je=async()=>{try{let e=await v`deno --version`.noThrow().quiet().text(),t=xe(e,/deno\s+(\S+)/);t!==void 0?U("Deno",t):P("Deno","Not found")}catch{P("Deno","Not found")}},qe=async()=>{try{let e=await v`go version`.noThrow().quiet().text(),t=xe(e,/go(\d+\.\d+(?:\.\d+)?)/);t!==void 0?U("Go",t):P("Go","Not found")}catch{P("Go","Not found")}},Ke=async()=>{try{let t=(await v`node --version`.noThrow().quiet().text()).trim();t.length>0?U("Node",t):P("Node","Not found")}catch{P("Node","Not found")}},Ye=async e=>{b.writeln(r(`eser doctor
61
+ `));let t=await T(Ge);ge("Install method",`${t.invoker} (${t.mode})`),ge("Version",k.version);let s=await J();return s===void 0?Be("Update","Could not check for updates"):s.updateAvailable?P("Update",`Update available: v${s.latestVersion}`):U("Update","Up to date"),b.writeln(),await We(),await ze(),b.writeln(),await Je(),await qe(),await Ke(),await b.close(),f(void 0)};var $=m,Qe={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},Xe=20,A=p({renderer:d.ansi(),sink:u.stdout()}),h=(e,t)=>{let s=`${e}:`.padEnd(Xe);A.writeln(r(` ${s}${t}`))},Ze=async e=>{A.writeln(r("eser system info")),A.writeln(i(`
62
+ Runtime`)),h("Name",$.name),h("Version",$.version),h("Platform",O()),h("Arch",K());let t=$.capabilities,s=Object.entries(t).map(([c,a])=>`${c}=${a?"yes":"no"}`).join(", ");h("Capabilities",s),A.writeln(i(`
63
+ Locations`)),h("Homedir",I()),h("Tmpdir",le()),h("CWD",$.process.cwd()),h("PID",String($.process.pid)),h("Exec path",$.process.execPath()),A.writeln(i(`
64
+ Process`)),h("argv0",$.process.argv0),h("argv",$.process.argv.join(" ")),h("args",$.process.args.join(" ")),A.writeln(i(`
65
+ Execution Context`));let n=await T(Qe);h("Runtime",n.runtime),h("Invoker",`${n.invoker} (${n.mode})`),h("Command",n.command),h("In PATH",n.isInPath?"yes":"no"),A.writeln(i(`
66
+ Environment`));let o=["PATH","HOME","SHELL","TERM","DENO_DIR","BUN_INSTALL","NODE_ENV"];for(let c of o){let a=$.env.get(c);if(a!==void 0){let x=c==="PATH"?`(${a.split(":").length} entries)`:a;h(c,x)}}return A.writeln(),await A.close(),f(void 0)};export{ke as a,$e as b,Ne as c,je as d,Oe as e,Ye as f,Ze as g};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{m as w,o as R}from"./chunk-GKOMIH2B.js";import{i as g}from"./chunk-6VHZQNHX.js";var p=class extends Error{constructor(r){super(`Required variable '${r}' has no value and no default`),this.name="MissingVariableError"}},m=(e,r)=>{let t={};for(let n of e){let a=r[n.name];if(a!==void 0)t[n.name]=a;else if(n.default!==void 0)t[n.name]=n.default;else throw new p(n.name)}return t},v=(e,r)=>e.replace(/\{\{\s*\.(\w+)\s*\}\}/g,(t,n)=>n in r?r[n]:t);var y=class extends Error{constructor(r){super(`Circular dependency detected: ${r.join(" \u2192 ")}`),this.name="CyclicDependencyError"}},f=class extends Error{constructor(r,t){super(`Recipe '${r}' requires '${t}', which is not in the registry`),this.name="MissingDependencyError"}},b=(e,r)=>{let t=new Map;for(let s of r)t.set(s.name,s);if(t.get(e)===void 0)throw new f("<root>",e);let a=[],i=new Set,o=new Set,l=(s,d)=>{if(i.has(s))return;if(o.has(s))throw new y([...d,s]);let c=t.get(s);if(c===void 0)throw new f(d[d.length-1]??"<root>",s);if(o.add(s),c.requires!==void 0)for(let u of c.requires)l(u,[...d,s]);o.delete(s),i.add(s),a.push(c)};return l(e,[]),a};var $=(e,r)=>{let t=e.endsWith("/")?e:`${e}/`,n=new URL(r,`file://${t}`).pathname;return n.startsWith(t)||n===e},x=async e=>{let r=e.split("/");r.pop();let t=r.join("/");t!==""&&t!=="."&&await g.fs.mkdir(t,{recursive:!0})},h=async e=>{try{return await g.fs.stat(e),!0}catch{return!1}},k=(e,r)=>r===void 0||Object.keys(r).length===0?e:v(e,r),F=async(e,r,t,n)=>{let a=`${r.cwd}/${e.target}`;if(n.includes(e.target))return;if(r.skipExisting===!0&&await h(a)){r.verbose===!0&&console.log(` [skip] ${e.target} (already exists)`),n.push(e.target);return}if(r.dryRun===!0){console.log(` [dry-run] would write ${e.target}`),t.push(e.target);return}r.verbose===!0&&console.log(` [write] ${e.target}`);let i=await w(r.registryUrl,e.source),o=k(i,r.variables);await x(a),await g.fs.writeTextFile(a,o),t.push(e.target)},E=async(e,r,t,n)=>{let a=await R(r.registryUrl,e.source);for(let i of a){let o=`${e.target}/${i.path}`;if(!$(r.cwd,o))throw new Error(`Folder recipe contains path traversal in '${o}'. Aborting.`)}for(let i of a){let o=`${e.target}/${i.path}`,l=`${r.cwd}/${o}`;if(r.skipExisting===!0&&await h(l)){n.push(o);continue}if(r.dryRun===!0){console.log(` [dry-run] would write ${o}`),t.push(o);continue}r.verbose===!0&&console.log(` [write] ${o}`);let s=k(i.content,r.variables);await x(l),await g.fs.writeTextFile(l,s),t.push(o)}},S=async(e,r,t,n)=>{let a=[];for(let i of e){if(t===!0){console.log(` [dry-run] would run: ${i}`),a.push(i);continue}n===!0&&console.log(` [post-install] ${i}`);let o=i.split(/\s+/),l=await g.exec.spawn(o[0],o.slice(1),{cwd:r,stdout:"inherit",stderr:"inherit"});if(!l.success)throw new Error(`Post-install command failed: '${i}' (exit code ${l.code})`);a.push(i)}return a},q=async(e,r)=>{let t=[],n=[],a=e.files.length,i=r.variables;e.variables!==void 0&&e.variables.length>0&&(i=m(e.variables,r.variables??{}));let o={...r,variables:i};for(let s of e.files)if((s.kind??"file")==="file"&&!$(r.cwd,s.target))throw new Error(`Recipe '${e.name}' contains path traversal in target '${s.target}'. Aborting.`);if(r.force!==!0&&r.skipExisting!==!0)for(let s of e.files){if((s.kind??"file")!=="file")continue;let c=`${r.cwd}/${s.target}`;await h(c)&&(r.dryRun===!0?console.log(` [conflict] ${s.target} (already exists)`):(console.warn(` Warning: ${s.target} already exists. Use --force to overwrite or --skip-existing to skip.`),n.push(s.target)))}for(let s of e.files){let d=s.kind??"file";try{d==="folder"?await E(s,o,t,n):await F(s,o,t,n)}catch(c){let u=c instanceof Error?c.message:String(c);throw new Error(`Failed applying '${s.target}'. ${t.length} files written so far. Retry with \`eser kit add ${e.name} --force\`. Cause: ${u}`)}}let l=[];return e.postInstall!==void 0&&e.postInstall.length>0&&(l=await S(e.postInstall,r.cwd,r.dryRun,r.verbose)),{written:t,skipped:n,total:a,postInstallRan:l}},V=async(e,r,t)=>{let n=b(e,r),a=[];for(let i of n){t.verbose===!0&&console.log(`
2
+ import{m as w,o as R}from"./chunk-TEOMM3RD.js";import{i as g}from"./chunk-WJKE6XHF.js";var p=class extends Error{constructor(r){super(`Required variable '${r}' has no value and no default`),this.name="MissingVariableError"}},m=(e,r)=>{let t={};for(let n of e){let a=r[n.name];if(a!==void 0)t[n.name]=a;else if(n.default!==void 0)t[n.name]=n.default;else throw new p(n.name)}return t},v=(e,r)=>e.replace(/\{\{\s*\.(\w+)\s*\}\}/g,(t,n)=>n in r?r[n]:t);var y=class extends Error{constructor(r){super(`Circular dependency detected: ${r.join(" \u2192 ")}`),this.name="CyclicDependencyError"}},f=class extends Error{constructor(r,t){super(`Recipe '${r}' requires '${t}', which is not in the registry`),this.name="MissingDependencyError"}},b=(e,r)=>{let t=new Map;for(let s of r)t.set(s.name,s);if(t.get(e)===void 0)throw new f("<root>",e);let a=[],i=new Set,o=new Set,l=(s,d)=>{if(i.has(s))return;if(o.has(s))throw new y([...d,s]);let c=t.get(s);if(c===void 0)throw new f(d[d.length-1]??"<root>",s);if(o.add(s),c.requires!==void 0)for(let u of c.requires)l(u,[...d,s]);o.delete(s),i.add(s),a.push(c)};return l(e,[]),a};var $=(e,r)=>{let t=e.endsWith("/")?e:`${e}/`,n=new URL(r,`file://${t}`).pathname;return n.startsWith(t)||n===e},x=async e=>{let r=e.split("/");r.pop();let t=r.join("/");t!==""&&t!=="."&&await g.fs.mkdir(t,{recursive:!0})},h=async e=>{try{return await g.fs.stat(e),!0}catch{return!1}},k=(e,r)=>r===void 0||Object.keys(r).length===0?e:v(e,r),F=async(e,r,t,n)=>{let a=`${r.cwd}/${e.target}`;if(n.includes(e.target))return;if(r.skipExisting===!0&&await h(a)){r.verbose===!0&&console.log(` [skip] ${e.target} (already exists)`),n.push(e.target);return}if(r.dryRun===!0){console.log(` [dry-run] would write ${e.target}`),t.push(e.target);return}r.verbose===!0&&console.log(` [write] ${e.target}`);let i=await w(r.registryUrl,e.source),o=k(i,r.variables);await x(a),await g.fs.writeTextFile(a,o),t.push(e.target)},E=async(e,r,t,n)=>{let a=await R(r.registryUrl,e.source);for(let i of a){let o=`${e.target}/${i.path}`;if(!$(r.cwd,o))throw new Error(`Folder recipe contains path traversal in '${o}'. Aborting.`)}for(let i of a){let o=`${e.target}/${i.path}`,l=`${r.cwd}/${o}`;if(r.skipExisting===!0&&await h(l)){n.push(o);continue}if(r.dryRun===!0){console.log(` [dry-run] would write ${o}`),t.push(o);continue}r.verbose===!0&&console.log(` [write] ${o}`);let s=k(i.content,r.variables);await x(l),await g.fs.writeTextFile(l,s),t.push(o)}},S=async(e,r,t,n)=>{let a=[];for(let i of e){if(t===!0){console.log(` [dry-run] would run: ${i}`),a.push(i);continue}n===!0&&console.log(` [post-install] ${i}`);let o=i.split(/\s+/),l=await g.exec.spawn(o[0],o.slice(1),{cwd:r,stdout:"inherit",stderr:"inherit"});if(!l.success)throw new Error(`Post-install command failed: '${i}' (exit code ${l.code})`);a.push(i)}return a},q=async(e,r)=>{let t=[],n=[],a=e.files.length,i=r.variables;e.variables!==void 0&&e.variables.length>0&&(i=m(e.variables,r.variables??{}));let o={...r,variables:i};for(let s of e.files)if((s.kind??"file")==="file"&&!$(r.cwd,s.target))throw new Error(`Recipe '${e.name}' contains path traversal in target '${s.target}'. Aborting.`);if(r.force!==!0&&r.skipExisting!==!0)for(let s of e.files){if((s.kind??"file")!=="file")continue;let c=`${r.cwd}/${s.target}`;await h(c)&&(r.dryRun===!0?console.log(` [conflict] ${s.target} (already exists)`):(console.warn(` Warning: ${s.target} already exists. Use --force to overwrite or --skip-existing to skip.`),n.push(s.target)))}for(let s of e.files){let d=s.kind??"file";try{d==="folder"?await E(s,o,t,n):await F(s,o,t,n)}catch(c){let u=c instanceof Error?c.message:String(c);throw new Error(`Failed applying '${s.target}'. ${t.length} files written so far. Retry with \`eser kit add ${e.name} --force\`. Cause: ${u}`)}}let l=[];return e.postInstall!==void 0&&e.postInstall.length>0&&(l=await S(e.postInstall,r.cwd,r.dryRun,r.verbose)),{written:t,skipped:n,total:a,postInstallRan:l}},V=async(e,r,t)=>{let n=b(e,r),a=[];for(let i of n){t.verbose===!0&&console.log(`
3
3
  Applying recipe: ${i.name}`);let o=await q(i,t);a.push({name:i.name,result:o})}return{recipes:a}};export{$ as a,h as b,k as c,S as d,q as e,V as f};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as ge,b as me,d as X,e as Ye,f as et,g as tt,h as U}from"./chunk-V6YI7YJ4.js";import{n as $e}from"./chunk-VVWAUS3D.js";import{a as nt}from"./chunk-LSET5TD3.js";import{c as fe}from"./chunk-VNJJQED3.js";import{a as pe,b as re,c as z,d as Be}from"./chunk-NBA6EFWU.js";import{e as S}from"./chunk-5DWJ7WEE.js";import{i as o}from"./chunk-6VHZQNHX.js";import{e as H,i as Qe}from"./chunk-BQT5RJZB.js";var I=S.getLogger(["laroux-bundler","server-action-transform"]);function mn(e,t){return`${e.replace(/\.[cm]?[jt]sx?$/,"")}#${t}`}function hn(e,t){let n=mn(e,t);return`Object.defineProperties(${t}, {
2
+ import{a as ge,b as me,d as X,e as Ye,f as et,g as tt,h as U}from"./chunk-6PRIUPN4.js";import{n as $e}from"./chunk-3QF3I2RD.js";import{a as nt}from"./chunk-3IZX4OZ7.js";import{c as fe}from"./chunk-26ZFSXSK.js";import{a as pe,b as re,c as z,d as Be}from"./chunk-NBA6EFWU.js";import{e as S}from"./chunk-5DWJ7WEE.js";import{i as o}from"./chunk-WJKE6XHF.js";import{e as H,i as Qe}from"./chunk-BQT5RJZB.js";var I=S.getLogger(["laroux-bundler","server-action-transform"]);function mn(e,t){return`${e.replace(/\.[cm]?[jt]sx?$/,"")}#${t}`}function hn(e,t){let n=mn(e,t);return`Object.defineProperties(${t}, {
3
3
  $$typeof: { value: Symbol.for("react.server.reference"), enumerable: false },
4
4
  $$id: { value: "${n}", enumerable: false },
5
5
  $$bound: { value: null, enumerable: false, writable: true }
@@ -77,8 +77,8 @@ ${s.join(`,
77
77
  `)},
78
78
  ];
79
79
  `;await o.fs.writeTextFile(t,i),_.debug(`Generated ${r.length} proxy definition(s)`)}async function Rt(e){try{let t=await o.fs.readTextFile(e),n=[],r=t.matchAll(/export\s+(?:async\s+)?function\s+(\w+)/g);for(let i of r)i[1]!==void 0&&n.push(i[1]);let s=t.matchAll(/export\s+const\s+(\w+)\s*=/g);for(let i of s)i[1]!==void 0&&n.push(i[1]);return t.match(/export\s+default\s+/)&&n.push("default"),[...new Set(n)]}catch{return[]}}async function Wn(e,t){let n=await Rt(e);if(n.length===0)return t;let r=n.find(i=>i!=="default"&&i.endsWith("Page"));if(r)return r;let s=n.find(i=>i!=="default");return s||t}async function Un(e,t){let n=await Rt(e);if(n.length===0)return t;let r=n.find(i=>i!=="default"&&i.endsWith("Layout"));if(r)return r;let s=n.find(i=>i!=="default");return s||t}function _n(e){let t=o.path.basename(o.path.dirname(e));return`${kt(Pt(t))}Page`}function Jn(e){let t=o.path.basename(o.path.dirname(e));return`${kt(Pt(t))}Layout`}function Pt(e){return e.startsWith("[...")?e.slice(4,-1):e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}function kt(e){return e.split(/[-_\s]+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Mt(e,t){let n=H(o.path.relative(e,t));return n.startsWith(".")?n:`./${n}`}function Gn(e,t,n){let r=[`path: "${e.routePath}"`,`component: ${t}`];return n&&r.push(`layout: ${n}`),`{ ${r.join(", ")} }`}var Hn=/(?:node_modules|\/\.|^\.|\\\.)/,W=S.getLogger(["laroux-bundler","virtual-source"]),we="_bundle_src";function Vn(e,t){return o.path.relative(t,e)}async function Ft(e){let{projectRoot:t,distDir:n,srcDir:r,changedFiles:s}=e,i=Vn(r,t),a=o.path.resolve(n,we),c=o.path.resolve(a,i);W.debug(`Creating virtual source: ${a}`),W.debug(` Virtual src subdir: ${c}`);let u=await o.fs.exists(c);if(s&&s.size>0&&u)W.debug(`Incremental update: ${s.size} file(s) changed`),await Kn(s,r,c),W.debug(`Virtual source updated incrementally: ${s.size} file(s)`);else{try{await Ye(a)}catch{}await qn(r,c,t),W.debug(`Virtual source created: ${a}`)}return{virtualSrcDir:a,cleanup:async()=>{W.debug(`Cleaning up virtual source: ${a}`);try{await o.fs.remove(a,{recursive:!0}),W.debug("Virtual source cleaned up")}catch(l){W.warn("Failed to clean up virtual source:",{error:l})}}}}async function Kn(e,t,n){let r=[...re,"json","css"],s=0,i=0;for(let a of e){if(!a.startsWith(t)||!Be(a,r))continue;let c=o.path.relative(t,a),u=o.path.resolve(n,c);try{await o.fs.stat(a),await et(o.path.dirname(u)),await U(a,u,{overwrite:!0}),s++}catch{try{await o.fs.remove(u),i++}catch{}}}(s>0||i>0)&&W.debug(`Incremental update: ${s} copied, ${i} deleted`)}async function qn(e,t,n){let r=0,s=[...re,"json","css"];for await(let i of tt(e,{includeDirs:!1})){if(!Be(i.path,s))continue;let a=o.path.relative(e,i.path);if(Hn.test(a))continue;let c=o.path.resolve(t,a);await o.fs.ensureDir(o.path.dirname(c)),await U(i.path,c),r++}W.debug(`Copied ${r} source file(s) to virtual source`)}function le(e,t,n,r){let s=o.path.relative(t,e),i=r??o.path.basename(t);return o.path.resolve(n,i,s)}function Bt(e,t,n){return e.map(r=>{let s=le(r.filePath,t,n),i=`${we}/${r.relativePath}`;return{...r,filePath:s,relativePath:i}})}var J=S.getLogger(["laroux-bundler","build-cache"]),Ae=class{clientComponentCache=new Map;cssModuleCache=new Map;routeCache=null;getClientComponent(t,n){let r=this.clientComponentCache.get(t);return r&&r.mtime>=n?(J.debug(`Cache hit: client component ${t}`),r):null}setClientComponent(t,n,r,s){this.clientComponentCache.set(t,{isClient:n,exportNames:r,mtime:s})}getCssModuleResult(t,n){let r=this.cssModuleCache.get(t);return r&&r.mtime>=n?(J.debug(`Cache hit: CSS module ${t}`),r):null}setCssModuleResult(t,n,r,s){this.cssModuleCache.set(t,{code:n,exports:r,mtime:s})}getRouteCache(t){return this.routeCache&&this.routeCache.mtime>=t?(J.debug("Cache hit: route scan"),this.routeCache):null}setRouteCache(t,n,r,s){this.routeCache={routes:t,apiRoutes:n,proxies:r,mtime:s}}invalidateFile(t){this.clientComponentCache.has(t)&&(this.clientComponentCache.delete(t),J.debug(`Invalidated: client component ${t}`)),this.cssModuleCache.has(t)&&(this.cssModuleCache.delete(t),J.debug(`Invalidated: CSS module ${t}`)),(t.includes("/routes/")||t.includes("\\routes\\"))&&(this.routeCache=null,wt(),J.debug("Invalidated: route cache"))}invalidateFiles(t){for(let n of t)this.invalidateFile(n)}clear(){this.clientComponentCache.clear(),this.cssModuleCache.clear(),this.routeCache=null,J.debug("All caches cleared")}getStats(){return{clientComponents:this.clientComponentCache.size,cssModules:this.cssModuleCache.size,hasRoutes:this.routeCache!==null}}},Ie=null;function $t(){return Ie||(Ie=new Ae,J.debug("Created global build cache")),Ie}var Xn=new TextEncoder().encode("0123456789abcdef"),Et=new Uint8Array(128).fill(16);Xn.forEach((e,t)=>Et[e]=t);new TextEncoder().encode("ABCDEF").forEach((e,t)=>Et[e]=t+10);function Ot(e){return e*2}function Dt(e,t,n,r){for(;t<e.length;++t){let s=e[t];e[n++]=r[s>>4],e[n++]=r[s&15]}return n}function Tt(e,t){let n=e.length;if(e.byteOffset){let r=new Uint8Array(e.buffer);r.set(e),e=r.subarray(0,n)}return e=new Uint8Array(e.buffer.transfer(t)),e.set(e.subarray(0,n),t-n),[e,t-n]}var jt=new TextEncoder().encode("0123456789abcdef"),Nt=new Uint8Array(128).fill(16);jt.forEach((e,t)=>Nt[e]=t);new TextEncoder().encode("ABCDEF").forEach((e,t)=>Nt[e]=t+10);function be(e){typeof e=="string"?e=new TextEncoder().encode(e):e instanceof ArrayBuffer?e=new Uint8Array(e).slice():e=e.slice();let[t,n]=Tt(e,Ot(e.length));return Dt(t,n,0,jt),new TextDecoder().decode(t)}var Ce=(e,t)=>({success:!0,outputs:e,metafile:t?.metafile,entrypointManifest:t?.entrypointManifest,entrypoint:t?.entrypoint,totalSize:t?.totalSize}),Q=e=>({success:!1,outputs:new Map,errors:e});var ve=S.getLogger(["bundler","deno-bundler"]),Se=class{name="deno-bundler";options;constructor(t={}){this.options=t}async bundle(t){let n=await o.fs.makeTempDir({prefix:"deno-bundle-"});try{let r=Object.values(t.entrypoints),s=Object.keys(t.entrypoints),i=[...r];if(this.options.buildId!==void 0){let p=o.path.join(n,"_build-id-entry.ts");await o.fs.writeTextFile(p,`export const BUILD_ID = "${this.options.buildId}";
80
- `),i.unshift(p)}let a=t.platform==="browser"?"browser":"deno",c=t.sourcemap===!0?"external":t.sourcemap===!1?void 0:t.sourcemap,u={entrypoints:i,outputDir:n,format:"esm",codeSplitting:t.codeSplitting,minify:t.minify,platform:a,sourcemap:c};t.external!==void 0&&(u.external=t.external),ve.debug("Calling Deno.bundle",{entrypoints:i.slice(0,3),outputDir:n,external:u.external,platform:u.platform});let l=await Deno.bundle(u);if(ve.debug("Deno.bundle result",{success:l.success,errors:l.errors?.length??0}),!l.success){let f=(l.errors??[]).map(d=>({message:d.text??this.extractErrorMessage(d),severity:"error"}));return Q(f)}return await this.processOutput(n,t,s,r)}catch(r){return Q([{message:r instanceof Error?r.message:String(r),severity:"fatal"}])}finally{try{await o.fs.remove(n,{recursive:!0})}catch{}}}watch(t,n){let r=!0,s=Object.values(t.entrypoints).map(u=>o.path.dirname(u)),i=[...new Set(s)],a=Deno.watchFs(i,{recursive:!0});return(async()=>{for await(let u of a){if(!r)break;let l=await this.bundle(t);n(l)}})().catch(u=>{console.error("Watch loop error:",u)}),Promise.resolve({stop:()=>(r=!1,a.close(),Promise.resolve())})}extractErrorMessage(t){return t==null?"Unknown error":typeof t=="object"&&"message"in t?String(t.message):String(t)}async processOutput(t,n,r,s){let i=this.options.entryName??"main",a=new Map,c={},u={},l=null,p=0,f=new Map,d=new Map;for(let b=0;b<s.length;b++){let w=s[b],x=r[b];if(w!==void 0&&x!==void 0){let P=o.path.basename(w).replace(/\.[^.]+$/,"");f.set(P,x),d.set(z(w,".js"),x)}}let m=o.path.join(t,"dist"),h=t;try{(await o.fs.stat(m)).isDirectory&&(h=m)}catch{}let y=[];ve.debug(`Scanning output dir: ${h}`);let C=async(b,w="")=>{for await(let x of o.fs.readDir(b)){let P=o.path.join(b,x.name),F=w?`${w}/${x.name}`:x.name;x.isDirectory?await C(P,F):x.isFile&&(x.name.endsWith(".js")||x.name.endsWith(".map"))&&y.push({name:F,path:P})}};if(await C(h),h!==t){for await(let b of o.fs.readDir(t))if(b.isFile&&(b.name.endsWith(".js")||b.name.endsWith(".map"))&&(b.name.startsWith("chunk-")||b.name.endsWith(".map"))){let w=o.path.join(t,b.name);y.some(x=>x.path===w)||y.push({name:b.name,path:w})}}ve.debug(`Found ${y.length} output files`,y.map(b=>b.name));let R=new Map;for(let b of y)if(b.name.endsWith(".map")){let w=await o.fs.readFile(b.path),x=b.name;b.name.startsWith("_client-entry")?x=`${i}.js.map`:b.name.startsWith("_build-id-entry")&&(x="build-id.js.map"),R.set(x,w)}for(let b of y){if(b.name.endsWith(".map"))continue;let w=await o.fs.readTextFile(b.path);n.basePath!==void 0&&(w=w.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`)),n.define!==void 0&&(w=Zn(w,n.define)),w=w.replace(/from\s{0,5}["']\.\.\/chunk-/g,'from"./chunk-'),w=w.replace(/from\s{0,5}["']\.\.chunk-/g,'from"./chunk-'),w=w.replace(/import\s{0,5}\(["']\.\.\/chunk-/g,'import("./chunk-'),w=w.replace(/import\s{0,5}\(["']\.\.chunk-/g,'import("./chunk-');let x=b.name,P=x.startsWith("_client-entry");if(P)x=`${i}.js`,l=`${i}.js`;else if(x.startsWith("_build-id-entry"))x="build-id.js";else if(!x.startsWith("chunk-")){let j;for(let[ee,Fe]of d)if(ee.endsWith(x)){j=Fe;break}if(j===void 0){let ee=o.path.basename(x).replace(/\.js$/,"");j=f.get(ee)}j!==void 0&&(x=`${j}.js`)}P&&R.has(`${i}.js.map`)&&(w=w.replace(/\/\/# sourceMappingURL=.*$/m,`//# sourceMappingURL=${i}.js.map`),w.includes("//# sourceMappingURL=")||(w+=`
81
- //# sourceMappingURL=${i}.js.map`));let F=new TextEncoder().encode(w),de=await this.computeHash(F),D=this.parseImports(w),Me=`${x}.map`,Y=R.get(Me);a.set(x,{path:x,code:F,map:Y,size:F.length,hash:de,isEntry:!x.startsWith("chunk-")}),p+=F.length,c[x]={bytes:F.length,inputs:{},imports:D.map(j=>({path:j,kind:"import-statement"}))}}for(let[b,w]of R)if(!a.has(b)){let x=await this.computeHash(w);a.set(b,{path:b,code:w,size:w.length,hash:x,isEntry:!1}),p+=w.length}if(n.outputDir!==void 0){await o.fs.mkdir(n.outputDir,{recursive:!0});for(let[b,w]of a){let x=o.path.join(n.outputDir,b),P=o.path.dirname(x);P!==n.outputDir&&await o.fs.mkdir(P,{recursive:!0}),await o.fs.writeFile(x,w.code)}}for(let[b,w]of Object.entries(n.entrypoints)){if(b==="client"||b==="main")continue;let x=await this.findEntrypointChunks(b,h,t,a);x.length>0&&(u[w]=x)}return Ce(a,{metafile:{inputs:{},outputs:c},entrypointManifest:u,entrypoint:l??"main.js",totalSize:p})}async findEntrypointChunks(t,n,r,s){let i=z(t,".js"),a=o.path.join(n,i),c=null;try{c=await o.fs.readTextFile(a)}catch{try{let u=o.path.join(r,"dist",i);c=await o.fs.readTextFile(u)}catch{}}return c!==null?this.extractChunksFromProxyFile(c,s):this.findChunksForComponentName(t,s)}findChunksForComponentName(t,n){let r=[],s=o.path.basename(t).replace(/\.[^.]+$/,""),i=s.charAt(0).toUpperCase()+s.slice(1).replace(/-([a-z])/g,(a,c)=>c.toUpperCase());for(let[a,c]of n){if(!a.startsWith("chunk-")||!a.endsWith(".js"))continue;let u=new TextDecoder().decode(c.code);if([new RegExp(`export\\s{0,5}\\{[^}]*\\b${i}\\b[^}]*\\}`),new RegExp(`export\\s+(?:function|const|let|var|class)\\s+${i}\\b`),new RegExp(`\\b\\w+\\s+as\\s+${i}\\b`)].some(f=>f.test(u))){r.unshift(a);let f=/from\s{0,5}["']\.?\/?([^"']*chunk-[A-Z0-9]+\.js)["']/gi,d;for(;(d=f.exec(u))!==null;){let m=o.path.basename(d[1]??"");m&&!r.includes(m)&&r.push(m)}break}}return r}extractChunksFromProxyFile(t,n){let r=[],s=/import(?:\{[\w\s,]{0,500}\})?\s{0,100}from\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,i=/import\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,a;for(;(a=s.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}for(;(a=i.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}let c=t.match(/export\s{0,5}\{([\w\s,]+)\}/);if(c!==null){let p=c[1]?.match(/(\w+)(?:\s+as\s+\w+)?/)?.[1]??null;if(p!==null){let f=null;for(let[d,m]of n){if(!d.startsWith("chunk-")||!d.endsWith(".js"))continue;let h=new TextDecoder().decode(m.code);if([new RegExp(`export\\s{0,5}\\{[^}]*\\b${p}\\b[^}]*\\}`),new RegExp(`export\\s+(?:function|const|let|var|class)\\s+${p}\\b`),new RegExp(`\\b\\w+\\s+as\\s+${p}\\b`)].some(R=>R.test(h))){f=d;break}}if(f!==null){let d=r.indexOf(f);d>0?(r.splice(d,1),r.unshift(f)):d===-1&&r.unshift(f)}}}return r}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}parseImports(t){let n=[],r=/import\s{1,100}[^\n"']{1,500}\s{1,100}from\s{0,100}["']([\w./@-]+)["']/g,s;for(;(s=r.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}let i=/import\s{0,5}\(\s{0,5}["']([^"']+)["']\s{0,5}\)/g;for(;(s=i.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}return[...new Set(n)]}};function Zn(e,t){let n=Object.keys(t);if(n.length===0)return e;n.sort((a,c)=>c.length-a.length);let r=!1;for(let a of n)if(e.includes(a)){r=!0;break}if(!r)return e;let s=n.map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i=new RegExp(`\\b(${s.join("|")})\\b`,"g");return e.replace(i,a=>t[a]??a)}var ze=(e={})=>new Se(e);function Qn(e){let t=Object.keys(e).sort((s,i)=>i.length-s.length);if(t.length===0)return{name:"define"};let n=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp(`\\b(${n.join("|")})\\b`,"g");return{name:"define",transform(s,i){if(i.includes("node_modules"))return null;let a=!1;for(let u of t)if(s.includes(u)){a=!0;break}if(!a)return null;let c=s.replace(r,u=>e[u]??u);return c===s?null:{code:c}}}}var Re=class{name="rolldown";options;rolldownModule=null;constructor(t={}){this.options=t}async bundle(t){try{let n=await this.loadRolldown(),r=this.adaptPlugins(t.plugins);t.define!==void 0&&Object.keys(t.define).length>0&&r.push(Qn(t.define));let s=t.projectRoot!==void 0?[`${t.projectRoot}/node_modules`,"node_modules"]:["node_modules"],i=await n.rolldown({input:t.entrypoints,external:t.external,plugins:r,resolve:{modules:s}}),a=t.sourcemap===!0?!0:t.sourcemap==="inline"?"inline":t.sourcemap==="external"?!0:void 0,c={dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:a,minify:t.minify,...this.options.advancedChunks!==void 0?{advancedChunks:{minSize:this.options.advancedChunks.minSize??2e4,groups:this.options.advancedChunks.groups?.map(l=>({name:l.name,test:l.test,priority:l.priority??0}))}}:{}},u=await i.write(c);return await i.close(),await this.processRolldownOutput(u,t)}catch(n){return Q([{message:n instanceof Error?n.message:String(n),severity:"fatal"}])}}async watch(t,n){let s=await(await this.loadRolldown()).watch({input:t.entrypoints,external:t.external,plugins:this.adaptPlugins(t.plugins),output:{dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:t.sourcemap===!0||t.sourcemap==="external",minify:t.minify}});return s.on("event",async i=>{if(i.code==="BUNDLE_END"){let a=await this.bundle(t);n(a)}else i.code==="ERROR"&&n(Q([{message:i.error?.message??"Watch error",severity:"error"}]))}),{stop:async()=>{await s.close()}}}async loadRolldown(){if(this.rolldownModule!==null)return this.rolldownModule;try{let t=await import("npm:rolldown@latest"),n={rolldown:r=>t.rolldown(r),watch:r=>{let s=t.watch(r);return Promise.resolve(s)}};return this.rolldownModule=n,n}catch(t){throw new Error(`Failed to load Rolldown. Make sure it's installed: ${t instanceof Error?t.message:String(t)}`)}}adaptPlugins(t){return t===void 0||t.length===0?[]:t.map(n=>{let r={name:n.name},s={resolvers:[],loaders:[],transformers:[]},i=n.setup({onResolve:(a,c)=>{s.resolvers.push({options:a,callback:c})},onLoad:(a,c)=>{s.loaders.push({options:a,callback:c})},onTransform:(a,c)=>{s.transformers.push({options:a,callback:c})}});return i instanceof Promise&&(r.buildStart=async function(){await i}),r.resolveId=async(a,c)=>{for(let u of s.resolvers)if(u.options.filter.test(a)){let l=await u.callback({path:a,importer:c??"",namespace:u.options.namespace??"file",kind:"import-statement"});if(l?.path!==void 0||l?.external===!0)return{id:l.path??a,external:l.external}}return null},r.load=async a=>{for(let c of s.loaders)if(c.options.filter.test(a)){let u=await c.callback({path:a,namespace:c.options.namespace??"file"});if(u?.contents!==void 0)return{code:typeof u.contents=="string"?u.contents:new TextDecoder().decode(u.contents)}}return null},r.transform=async(a,c)=>{let u=a;for(let l of s.transformers)if(l.options.filter.test(c)){let p=await l.callback({path:c,code:u});p?.code!==void 0&&(u=p.code)}return u!==a?{code:u}:null},r})}async processRolldownOutput(t,n){let s=`${this.options.entryName??"main"}.js`,i=new Map,a={},c={},u=null,l=0;for(let d of t.output)if(d.type==="chunk"){let m=d.code;n.basePath!==void 0&&(m=m.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`));let h=new TextEncoder().encode(m),y=await this.computeHash(h),C={path:d.fileName,code:h,size:h.length,hash:y,isEntry:d.isEntry,...d.map!==void 0?{map:new TextEncoder().encode(JSON.stringify(d.map))}:{}};if(i.set(d.fileName,C),l+=h.length,d.isEntry&&(d.fileName===s||u===null)&&(u=d.fileName),d.isEntry&&d.facadeModuleId!==void 0){let R=[d.fileName];if(d.imports!==void 0)for(let E of d.imports)R.includes(E)||R.push(E);c[d.facadeModuleId]=R}a[d.fileName]={bytes:h.length,inputs:{},imports:(d.imports??[]).map(R=>({path:R,kind:"import-statement"})),...d.isEntry&&d.facadeModuleId!==void 0?{entryPoint:d.facadeModuleId}:{}}}else if(d.type==="asset"){let m=typeof d.source=="string"?new TextEncoder().encode(d.source):d.source,h=await this.computeHash(m);i.set(d.fileName,{path:d.fileName,code:m,size:m.length,hash:h}),l+=m.length}return Ce(i,{metafile:{inputs:{},outputs:a},entrypointManifest:c,entrypoint:u??s,totalSize:l})}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}},Le=(e={})=>new Re(e);function Pe(e,t){if(typeof e=="object"&&e!==null&&"backend"in e){let r=e;return Pe(r.backend,r.options)}let n=e??"rolldown";switch(n){case"rolldown":return Le(t);case"deno-bundler":return ze(t);default:throw new Error(`Unknown bundler backend: ${n}`)}}var O=S.getLogger(["laroux-bundler","bundler"]);function Yn(e,t){let n={},r=0;for(let[s,i]of e.outputs)n[s]={fileName:s,size:i.size},r+=i.size;return{entrypoint:e.entrypoint??"client.js",outputs:n,manifest:t,totalSize:e.totalSize??r}}function er(e){let t=Object.values(e.outputs);if(t.length===0)return{chunkCount:0,largestChunk:{name:"",size:0},smallestChunk:{name:"",size:0},averageChunkSize:0};let n=t.sort((i,a)=>a.size-i.size),r=n[0],s=n[n.length-1];return{chunkCount:t.length,largestChunk:r?{name:r.fileName,size:r.size}:{name:"",size:0},smallestChunk:s?{name:s.fileName,size:s.size}:{name:"",size:0},averageChunkSize:t.length>0?e.totalSize/t.length:0}}function At(e){let t=er(e);O.debug("\u{1F4CA} Bundle Statistics:",{totalSizeKB:(e.totalSize/1024).toFixed(2),chunkCount:t.chunkCount,largestChunk:{name:t.largestChunk.name,sizeKB:(t.largestChunk.size/1024).toFixed(2)},smallestChunk:{name:t.smallestChunk.name,sizeKB:(t.smallestChunk.size/1024).toFixed(2)},averageChunkSizeKB:(t.averageChunkSize/1024).toFixed(2)})}async function zt(e,t,n){O.info(`\u{1F4E6} Using bundler backend: ${n}`),O.debug(`Bundling with @eser/bundler (${n})...`),O.debug(` Entrypoints: ${e.entrypoints.length}`),O.debug(` Output: ${e.outputDir}`),O.debug(`Creating bundler: ${n}`);let r=Pe(n,{entryName:"client"}),s={};for(let l=0;l<e.entrypoints.length;l++){let p=e.entrypoints[l];if(p!==void 0)if(l===0)s.client=p;else{let f=t.find(d=>d.filePath===p);f!==void 0?s[f.relativePath]=p:s[`entry-${l}`]=p}}let i=e.sourcemap===!0||e.sourcemap==="external"||e.sourcemap==="inline",a={entrypoints:s,outputDir:e.outputDir,projectRoot:e.projectRoot,format:"esm",platform:e.platform==="deno"?"node":"browser",codeSplitting:e.splitting!==!1,minify:e.minify??!1,sourcemap:i,plugins:e.plugins,define:e.define},c=await r.bundle(a);if(!c.success){let l=c.errors?.map(p=>p.message).join(`
80
+ `),i.unshift(p)}let a=t.platform==="browser"?"browser":"deno",c=t.sourcemap===!0?"external":t.sourcemap===!1?void 0:t.sourcemap,u={entrypoints:i,outputDir:n,format:"esm",codeSplitting:t.codeSplitting,minify:t.minify,platform:a,sourcemap:c};t.external!==void 0&&(u.external=t.external),ve.debug("Calling Deno.bundle",{entrypoints:i.slice(0,3),outputDir:n,external:u.external,platform:u.platform});let l=await Deno.bundle(u);if(ve.debug("Deno.bundle result",{success:l.success,errors:l.errors?.length??0}),!l.success){let f=(l.errors??[]).map(d=>({message:d.text??this.extractErrorMessage(d),severity:"error"}));return Q(f)}return await this.processOutput(n,t,s,r)}catch(r){return Q([{message:r instanceof Error?r.message:String(r),severity:"fatal"}])}finally{try{await o.fs.remove(n,{recursive:!0})}catch{}}}watch(t,n){let r=!0,s=Object.values(t.entrypoints).map(u=>o.path.dirname(u)),i=[...new Set(s)],a=o.fs.watch(i,{recursive:!0});return(async()=>{for await(let u of a){if(!r)break;let l=await this.bundle(t);n(l)}})().catch(u=>{console.error("Watch loop error:",u)}),Promise.resolve({stop:()=>(r=!1,a.close(),Promise.resolve())})}extractErrorMessage(t){return t==null?"Unknown error":typeof t=="object"&&"message"in t?String(t.message):String(t)}async processOutput(t,n,r,s){let i=this.options.entryName??"main",a=new Map,c={},u={},l=null,p=0,f=new Map,d=new Map;for(let b=0;b<s.length;b++){let w=s[b],x=r[b];if(w!==void 0&&x!==void 0){let P=o.path.basename(w).replace(/\.[^.]+$/,"");f.set(P,x),d.set(z(w,".js"),x)}}let m=o.path.join(t,"dist"),h=t;try{(await o.fs.stat(m)).isDirectory&&(h=m)}catch{}let y=[];ve.debug(`Scanning output dir: ${h}`);let C=async(b,w="")=>{for await(let x of o.fs.readDir(b)){let P=o.path.join(b,x.name),F=w?`${w}/${x.name}`:x.name;x.isDirectory?await C(P,F):x.isFile&&(x.name.endsWith(".js")||x.name.endsWith(".map"))&&y.push({name:F,path:P})}};if(await C(h),h!==t){for await(let b of o.fs.readDir(t))if(b.isFile&&(b.name.endsWith(".js")||b.name.endsWith(".map"))&&(b.name.startsWith("chunk-")||b.name.endsWith(".map"))){let w=o.path.join(t,b.name);y.some(x=>x.path===w)||y.push({name:b.name,path:w})}}ve.debug(`Found ${y.length} output files`,y.map(b=>b.name));let R=new Map;for(let b of y)if(b.name.endsWith(".map")){let w=await o.fs.readFile(b.path),x=b.name;b.name.startsWith("_client-entry")?x=`${i}.js.map`:b.name.startsWith("_build-id-entry")&&(x="build-id.js.map"),R.set(x,w)}for(let b of y){if(b.name.endsWith(".map"))continue;let w=await o.fs.readTextFile(b.path);n.basePath!==void 0&&(w=w.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`)),n.define!==void 0&&(w=Zn(w,n.define)),w=w.replace(/from\s{0,5}["']\.\.\/chunk-/g,'from"./chunk-'),w=w.replace(/from\s{0,5}["']\.\.chunk-/g,'from"./chunk-'),w=w.replace(/import\s{0,5}\(["']\.\.\/chunk-/g,'import("./chunk-'),w=w.replace(/import\s{0,5}\(["']\.\.chunk-/g,'import("./chunk-');let x=b.name,P=x.startsWith("_client-entry");if(P)x=`${i}.js`,l=`${i}.js`;else if(x.startsWith("_build-id-entry"))x="build-id.js";else if(!x.startsWith("chunk-")){let j;for(let[ee,Fe]of d)if(ee.endsWith(x)){j=Fe;break}if(j===void 0){let ee=o.path.basename(x).replace(/\.js$/,"");j=f.get(ee)}j!==void 0&&(x=`${j}.js`)}P&&R.has(`${i}.js.map`)&&(w=w.replace(/\/\/# sourceMappingURL=.*$/m,`//# sourceMappingURL=${i}.js.map`),w.includes("//# sourceMappingURL=")||(w+=`
81
+ //# sourceMappingURL=${i}.js.map`));let F=new TextEncoder().encode(w),de=await this.computeHash(F),D=this.parseImports(w),Me=`${x}.map`,Y=R.get(Me);a.set(x,{path:x,code:F,map:Y,size:F.length,hash:de,isEntry:!x.startsWith("chunk-")}),p+=F.length,c[x]={bytes:F.length,inputs:{},imports:D.map(j=>({path:j,kind:"import-statement"}))}}for(let[b,w]of R)if(!a.has(b)){let x=await this.computeHash(w);a.set(b,{path:b,code:w,size:w.length,hash:x,isEntry:!1}),p+=w.length}if(n.outputDir!==void 0){await o.fs.mkdir(n.outputDir,{recursive:!0});for(let[b,w]of a){let x=o.path.join(n.outputDir,b),P=o.path.dirname(x);P!==n.outputDir&&await o.fs.mkdir(P,{recursive:!0}),await o.fs.writeFile(x,w.code)}}for(let[b,w]of Object.entries(n.entrypoints)){if(b==="client"||b==="main")continue;let x=await this.findEntrypointChunks(b,h,t,a);x.length>0&&(u[w]=x)}return Ce(a,{metafile:{inputs:{},outputs:c},entrypointManifest:u,entrypoint:l??"main.js",totalSize:p})}async findEntrypointChunks(t,n,r,s){let i=z(t,".js"),a=o.path.join(n,i),c=null;try{c=await o.fs.readTextFile(a)}catch{try{let u=o.path.join(r,"dist",i);c=await o.fs.readTextFile(u)}catch{}}return c!==null?this.extractChunksFromProxyFile(c,s):this.findChunksForComponentName(t,s)}findChunksForComponentName(t,n){let r=[],s=o.path.basename(t).replace(/\.[^.]+$/,""),i=s.charAt(0).toUpperCase()+s.slice(1).replace(/-([a-z])/g,(a,c)=>c.toUpperCase());for(let[a,c]of n){if(!a.startsWith("chunk-")||!a.endsWith(".js"))continue;let u=new TextDecoder().decode(c.code);if([new RegExp(`export\\s{0,5}\\{[^}]{0,500}\\b${i}\\b[^}]{0,500}\\}`),new RegExp(`export\\s{1,20}(?:function|const|let|var|class)\\s{1,20}${i}\\b`),new RegExp(`\\b\\w+\\s{1,10}as\\s{1,10}${i}\\b`)].some(f=>f.test(u))){r.unshift(a);let f=/from\s{0,5}["']\.?\/?([^"']{0,500}chunk-[A-Z0-9]+\.js)["']/gi,d;for(;(d=f.exec(u))!==null;){let m=o.path.basename(d[1]??"");m&&!r.includes(m)&&r.push(m)}break}}return r}extractChunksFromProxyFile(t,n){let r=[],s=/import(?:\{[\w\s,]{0,500}\})?\s{0,100}from\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,i=/import\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,a;for(;(a=s.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}for(;(a=i.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}let c=t.match(/export\s{0,5}\{([\w\s,]{1,500})\}/);if(c!==null){let p=c[1]?.match(/(\w+)(?:\s+as\s+\w+)?/)?.[1]??null;if(p!==null){let f=null;for(let[d,m]of n){if(!d.startsWith("chunk-")||!d.endsWith(".js"))continue;let h=new TextDecoder().decode(m.code);if([new RegExp(`export\\s{0,5}\\{[^}]{0,500}\\b${p}\\b[^}]{0,500}\\}`),new RegExp(`export\\s{1,20}(?:function|const|let|var|class)\\s{1,20}${p}\\b`),new RegExp(`\\b\\w+\\s{1,10}as\\s{1,10}${p}\\b`)].some(R=>R.test(h))){f=d;break}}if(f!==null){let d=r.indexOf(f);d>0?(r.splice(d,1),r.unshift(f)):d===-1&&r.unshift(f)}}}return r}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}parseImports(t){let n=[],r=/import\s{1,100}[^\n"']{1,500}from\s{0,100}["']([\w./@-]+)["']/g,s;for(;(s=r.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}let i=/import\s{0,5}\(\s{0,5}["']([^"']+)["']\s{0,5}\)/g;for(;(s=i.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}return[...new Set(n)]}};function Zn(e,t){let n=Object.keys(t);if(n.length===0)return e;n.sort((a,c)=>c.length-a.length);let r=!1;for(let a of n)if(e.includes(a)){r=!0;break}if(!r)return e;let s=n.map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i=new RegExp(`\\b(${s.join("|")})\\b`,"g");return e.replace(i,a=>t[a]??a)}var ze=(e={})=>new Se(e);function Qn(e){let t=Object.keys(e).sort((s,i)=>i.length-s.length);if(t.length===0)return{name:"define"};let n=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp(`\\b(${n.join("|")})\\b`,"g");return{name:"define",transform(s,i){if(i.includes("node_modules"))return null;let a=!1;for(let u of t)if(s.includes(u)){a=!0;break}if(!a)return null;let c=s.replace(r,u=>e[u]??u);return c===s?null:{code:c}}}}var Re=class{name="rolldown";options;rolldownModule=null;constructor(t={}){this.options=t}async bundle(t){try{let n=await this.loadRolldown(),r=this.adaptPlugins(t.plugins);t.define!==void 0&&Object.keys(t.define).length>0&&r.push(Qn(t.define));let s=t.projectRoot!==void 0?[`${t.projectRoot}/node_modules`,"node_modules"]:["node_modules"],i=await n.rolldown({input:t.entrypoints,external:t.external,plugins:r,resolve:{modules:s}}),a=t.sourcemap===!0?!0:t.sourcemap==="inline"?"inline":t.sourcemap==="external"?!0:void 0,c={dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:a,minify:t.minify,...this.options.advancedChunks!==void 0?{advancedChunks:{minSize:this.options.advancedChunks.minSize??2e4,groups:this.options.advancedChunks.groups?.map(l=>({name:l.name,test:l.test,priority:l.priority??0}))}}:{}},u=await i.write(c);return await i.close(),await this.processRolldownOutput(u,t)}catch(n){return Q([{message:n instanceof Error?n.message:String(n),severity:"fatal"}])}}async watch(t,n){let s=await(await this.loadRolldown()).watch({input:t.entrypoints,external:t.external,plugins:this.adaptPlugins(t.plugins),output:{dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:t.sourcemap===!0||t.sourcemap==="external",minify:t.minify}});return s.on("event",async i=>{if(i.code==="BUNDLE_END"){let a=await this.bundle(t);n(a)}else i.code==="ERROR"&&n(Q([{message:i.error?.message??"Watch error",severity:"error"}]))}),{stop:async()=>{await s.close()}}}async loadRolldown(){if(this.rolldownModule!==null)return this.rolldownModule;try{let t=await import("npm:rolldown@latest"),n={rolldown:r=>t.rolldown(r),watch:r=>{let s=t.watch(r);return Promise.resolve(s)}};return this.rolldownModule=n,n}catch(t){throw new Error(`Failed to load Rolldown. Make sure it's installed: ${t instanceof Error?t.message:String(t)}`)}}adaptPlugins(t){return t===void 0||t.length===0?[]:t.map(n=>{let r={name:n.name},s={resolvers:[],loaders:[],transformers:[]},i=n.setup({onResolve:(a,c)=>{s.resolvers.push({options:a,callback:c})},onLoad:(a,c)=>{s.loaders.push({options:a,callback:c})},onTransform:(a,c)=>{s.transformers.push({options:a,callback:c})}});return i instanceof Promise&&(r.buildStart=async function(){await i}),r.resolveId=async(a,c)=>{for(let u of s.resolvers)if(u.options.filter.test(a)){let l=await u.callback({path:a,importer:c??"",namespace:u.options.namespace??"file",kind:"import-statement"});if(l?.path!==void 0||l?.external===!0)return{id:l.path??a,external:l.external}}return null},r.load=async a=>{for(let c of s.loaders)if(c.options.filter.test(a)){let u=await c.callback({path:a,namespace:c.options.namespace??"file"});if(u?.contents!==void 0)return{code:typeof u.contents=="string"?u.contents:new TextDecoder().decode(u.contents)}}return null},r.transform=async(a,c)=>{let u=a;for(let l of s.transformers)if(l.options.filter.test(c)){let p=await l.callback({path:c,code:u});p?.code!==void 0&&(u=p.code)}return u!==a?{code:u}:null},r})}async processRolldownOutput(t,n){let s=`${this.options.entryName??"main"}.js`,i=new Map,a={},c={},u=null,l=0;for(let d of t.output)if(d.type==="chunk"){let m=d.code;n.basePath!==void 0&&(m=m.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`));let h=new TextEncoder().encode(m),y=await this.computeHash(h),C={path:d.fileName,code:h,size:h.length,hash:y,isEntry:d.isEntry,...d.map!==void 0?{map:new TextEncoder().encode(JSON.stringify(d.map))}:{}};if(i.set(d.fileName,C),l+=h.length,d.isEntry&&(d.fileName===s||u===null)&&(u=d.fileName),d.isEntry&&d.facadeModuleId!==void 0){let R=[d.fileName];if(d.imports!==void 0)for(let E of d.imports)R.includes(E)||R.push(E);c[d.facadeModuleId]=R}a[d.fileName]={bytes:h.length,inputs:{},imports:(d.imports??[]).map(R=>({path:R,kind:"import-statement"})),...d.isEntry&&d.facadeModuleId!==void 0?{entryPoint:d.facadeModuleId}:{}}}else if(d.type==="asset"){let m=typeof d.source=="string"?new TextEncoder().encode(d.source):d.source,h=await this.computeHash(m);i.set(d.fileName,{path:d.fileName,code:m,size:m.length,hash:h}),l+=m.length}return Ce(i,{metafile:{inputs:{},outputs:a},entrypointManifest:c,entrypoint:u??s,totalSize:l})}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}},Le=(e={})=>new Re(e);function Pe(e,t){if(typeof e=="object"&&e!==null&&"backend"in e){let r=e;return Pe(r.backend,r.options)}let n=e??"rolldown";switch(n){case"rolldown":return Le(t);case"deno-bundler":return ze(t);default:throw new Error(`Unknown bundler backend: ${n}`)}}var O=S.getLogger(["laroux-bundler","bundler"]);function Yn(e,t){let n={},r=0;for(let[s,i]of e.outputs)n[s]={fileName:s,size:i.size},r+=i.size;return{entrypoint:e.entrypoint??"client.js",outputs:n,manifest:t,totalSize:e.totalSize??r}}function er(e){let t=Object.values(e.outputs);if(t.length===0)return{chunkCount:0,largestChunk:{name:"",size:0},smallestChunk:{name:"",size:0},averageChunkSize:0};let n=t.sort((i,a)=>a.size-i.size),r=n[0],s=n[n.length-1];return{chunkCount:t.length,largestChunk:r?{name:r.fileName,size:r.size}:{name:"",size:0},smallestChunk:s?{name:s.fileName,size:s.size}:{name:"",size:0},averageChunkSize:t.length>0?e.totalSize/t.length:0}}function At(e){let t=er(e);O.debug("\u{1F4CA} Bundle Statistics:",{totalSizeKB:(e.totalSize/1024).toFixed(2),chunkCount:t.chunkCount,largestChunk:{name:t.largestChunk.name,sizeKB:(t.largestChunk.size/1024).toFixed(2)},smallestChunk:{name:t.smallestChunk.name,sizeKB:(t.smallestChunk.size/1024).toFixed(2)},averageChunkSizeKB:(t.averageChunkSize/1024).toFixed(2)})}async function zt(e,t,n){O.info(`\u{1F4E6} Using bundler backend: ${n}`),O.debug(`Bundling with @eser/bundler (${n})...`),O.debug(` Entrypoints: ${e.entrypoints.length}`),O.debug(` Output: ${e.outputDir}`),O.debug(`Creating bundler: ${n}`);let r=Pe(n,{entryName:"client"}),s={};for(let l=0;l<e.entrypoints.length;l++){let p=e.entrypoints[l];if(p!==void 0)if(l===0)s.client=p;else{let f=t.find(d=>d.filePath===p);f!==void 0?s[f.relativePath]=p:s[`entry-${l}`]=p}}let i=e.sourcemap===!0||e.sourcemap==="external"||e.sourcemap==="inline",a={entrypoints:s,outputDir:e.outputDir,projectRoot:e.projectRoot,format:"esm",platform:e.platform==="deno"?"node":"browser",codeSplitting:e.splitting!==!1,minify:e.minify??!1,sourcemap:i,plugins:e.plugins,define:e.define},c=await r.bundle(a);if(!c.success){let l=c.errors?.map(p=>p.message).join(`
82
82
  `)??"Unknown error";throw new Error(`Bundle failed: ${l}`)}let u={};for(let l of t){let p=c.entrypointManifest?.[l.filePath]??[];p.length>0&&(u[l.filePath]=[...p])}return O.debug(` Outputs: ${c.outputs.size} files`),O.debug(` Total size: ${((c.totalSize??0)/1024).toFixed(2)} KB`),Yn(c,u)}async function Lt(e,t){O.info(`\u{1F4E6} Bundling server components with ${t}`),O.debug(` Entrypoints: ${e.entrypoints.length}`),O.debug(` Output: ${e.outputDir}`),O.debug(` Externals: ${e.externals?.length??0}`);let n=Pe(t,{entryName:"server"}),r={};for(let c of e.entrypoints){let u=c.replace(e.projectRoot,"").replace(/^\//,"");u=z(u,""),r[u]=c}let s={entrypoints:r,outputDir:e.outputDir,format:"esm",platform:"node",codeSplitting:!1,minify:e.minify??!1,sourcemap:e.sourcemap??!1,external:e.externals,plugins:e.plugins},i=await n.bundle(s);if(!i.success){let c=i.errors?.map(u=>u.message).join(`
83
83
  `)??"Unknown error";throw new Error(`Server bundle failed: ${c}`)}let a=new Map;for(let[c,u]of i.outputs)if(u.isEntry&&i.entrypointManifest!==void 0){for(let[l,p]of Object.entries(i.entrypointManifest))if(p.includes(c)){a.set(l,c);break}}return O.debug(` Outputs: ${i.outputs.size} files`),O.debug(` Total size: ${((i.totalSize??0)/1024).toFixed(2)} KB`),{outputMap:a,totalSize:i.totalSize??0,fileCount:i.outputs.size}}var $=S.getLogger(["laroux-bundler","chunk-manifest"]),tr="1.0";function Ut(e,t,n,r,s="info",i=!1){$.debug("\u{1F4CB} Generating chunk manifest...");let a={version:tr,buildId:e,timestamp:t,entrypoint:n.entrypoint,logLevel:s,hmrEnabled:i,chunks:{},files:{}};for(let[u,l]of Object.entries(n.outputs))a.files[l.fileName]={name:l.fileName,size:l.size,hash:sr(l.fileName)??void 0};let c=[];for(let u of r){let l=nr(u,n),[p,...f]=l;if(!p){$.warn(`No chunks found for ${u.relativePath}`);continue}let d=[p,...f];for(let y of d)a.files[y]||c.push(`${u.relativePath} references ${y}, but it's not in bundle outputs`);let m=or(u.relativePath);a.chunks[m]={main:Wt(p),deps:f.map(Wt),size:rr(l,a.files)};let h=u.exportNames[0]??"default";h!=="default"&&(a.chunks[m].exportName=h),$.debug(` ${m} \u2192 main: ${p}, deps: [${f.join(", ")}]`)}if(c.length>0){$.error("\u274C Chunk manifest validation failed!"),$.error(" Missing chunks:");for(let u of c)$.error(` - ${u}`);throw $.error(` Available files: ${Object.keys(a.files).join(", ")}`),new Error(`Chunk manifest validation failed: ${c.length} chunk(s) referenced but not found in bundle outputs`)}return $.debug("\u2705 Manifest generated"),$.debug(` Components: ${Object.keys(a.chunks).length}`),$.debug(` Chunks: ${Object.keys(a.files).length}`),$.debug(" Validation: All referenced chunks exist"),a}function nr(e,t){let n=t.manifest[e.filePath];if(!n||n.length===0)throw $.error(`\u274C No chunk mapping found for component: ${e.filePath}`),$.error(` Available mappings: ${Object.keys(t.manifest).join(", ")}`),new Error(`Chunk manifest incomplete: No chunks found for ${e.relativePath}. This indicates the bundler failed to analyze the component's dependencies.`);return n}function rr(e,t){return e.reduce((n,r)=>{let s=t[r];return n+(s?.size??0)},0)}function sr(e){return e.match(/-([a-f0-9]+)\./i)?.[1]??null}function Wt(e){return e.replace(/^chunk-/,"").replace(/\.js$/,"")}function or(e){let t=`${we}/`;return e.startsWith(t)?e.slice(t.length):e}async function _t(e,t){await o.fs.writeTextFile(t,JSON.stringify(e,null,2)),$.debug(`\u{1F4DD} Chunk manifest saved: ${t}`)}function Jt(e){$.debug("\u{1F4E6} Chunk Manifest:",{entrypoint:e.entrypoint,components:Object.keys(e.chunks).length,files:Object.keys(e.files).length,chunks:Object.fromEntries(Object.entries(e.chunks).map(([t,n])=>[t,{main:n.main,deps:n.deps,exportName:n.exportName,sizeKB:(n.size/1024).toFixed(2)}]))})}var ue={minify:!0,sourceMaps:!1,codeSplitting:!0,define:{"process.env.NODE_ENV":'"production"',"process.env.DEBUG":'"false"'}},_s={minify:!1,sourceMaps:!0,codeSplitting:!1,define:{"process.env.NODE_ENV":'"development"',"process.env.DEBUG":'"false"'}};import{transform as ar}from"lightningcss";import{Buffer as Gt}from"node:buffer";function lr(e){if(e===void 0)return{chrome:90<<16,firefox:88<<16,safari:917504};let t={};return e.chrome!==void 0&&(t.chrome=e.chrome),e.firefox!==void 0&&(t.firefox=e.firefox),e.safari!==void 0&&(t.safari=e.safari),e.edge!==void 0&&(t.edge=e.edge),t}function Ht(e){if(e==null)throw new TypeError(`Expected Uint8Array from Lightning CSS, got ${e===null?"null":"undefined"}`);if(Qe("node")&&typeof Gt<"u"&&Gt.isBuffer(e))return e.toString("utf-8");if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(typeof e=="string")return e;throw new TypeError(`Expected Uint8Array from Lightning CSS, got ${typeof e}`)}function Vt(e,t={}){let{filename:n="styles.css",minify:r=!1,targets:s,cssModules:i=!1,unusedSymbols:a=[]}=t,c={filename:n,code:new TextEncoder().encode(e),minify:r,targets:lr(s),cssModules:i,unusedSymbols:[...a]},u=ar(c),l;if(u.exports!==null&&u.exports!==void 0){l={};for(let[p,f]of Object.entries(u.exports))l[p]={name:f.name,composes:f.composes?.map(d=>({name:d.name,from:d.from!==void 0?String(d.from):void 0}))}}return{code:Ht(u.code),map:u.map!=null?Ht(u.map):void 0,exports:l}}function We(e,t,n={}){return Vt(e,{...n,filename:t,cssModules:!0})}async function Ue(e,t={}){let{generateDts:n=!1,minify:r=!0,targets:s,tailwind:i}=t,a=await o.fs.readTextFile(e);if(i!==void 0){let f=await i.compile(a,e);f!==null&&(a=f.code)}let c=o.path.basename(e),u=We(a,c,{minify:r,targets:s,nesting:!0}),l={};if(u.exports!==void 0)for(let[f,d]of Object.entries(u.exports))l[f]=d.name;let p=n?_e(l):void 0;return{code:u.code,exports:l,dts:p}}function _e(e){return`// This file is auto-generated by CSS modules processor
84
84
  declare const styles: {
@@ -125,4 +125,4 @@ ${l}`),{success:!1,clientBundle:"",moduleMap:{},clientComponents:0,duration:perf
125
125
  </html>
126
126
  `,{forceInclude:[/^\.flex/,/^\.grid/,/^\.block/,/^\.inline/,/^\.items-/,/^\.justify-/,/^\.gap-/,/^\.space-/,/^\.min-h-/,/^\.max-w-/,/^\.w-/,/^\.h-/,/^\.mx-/,/^\.my-/,/^\.px-/,/^\.py-/,/^\.p-/,/^\.m-/,/^\.mt-/,/^\.mb-/,/^\.ml-/,/^\.mr-/,/^\.pt-/,/^\.pb-/,/^\.pl-/,/^\.pr-/,/^\.sm:/,/^\.md:/,/^\.lg:/,/^\.xl:/,/^\.2xl:/,/^\.bg-neutral-/,/^\.bg-surface/,/^\.bg-primary-/,/^\.text-neutral-/,/^\.text-primary-/,/^\.text-white/,/^\.border/,/^\.rounded/,/^\.text-sm/,/^\.text-lg/,/^\.text-xl/,/^\.text-2xl/,/^\.text-3xl/,/^\.text-4xl/,/^\.text-5xl/,/^\.font-/,/^\.leading-/,/^\.overflow-/,/^\.visible/,/^\.invisible/,/^\.hidden/,/^\.relative/,/^\.absolute/,/^\.fixed/,/^\.sticky/,/^\.shadow/,/^html/,/^body/,/^#root/,/^\*/]}),a=o.path.resolve(t,"styles.critical.css"),c=o.path.resolve(t,"styles.deferred.css");await o.fs.writeTextFile(a,i.critical),await o.fs.writeTextFile(c,i.deferred);let u=i.stats;return u?g.debug(`\u2713 Critical CSS extracted: ${u.criticalSize} bytes critical, ${u.deferredSize} bytes deferred`):g.debug("\u2713 Critical CSS extracted"),{criticalPath:a,deferredPath:c}}catch(r){return g.error("Critical CSS extraction failed:",{error:r}),null}}async function Cr(e,t){if(!e.extractUniversalCss)return g.debug("CSS plugin doesn't support universal CSS extraction, skipping"),null;let n=o.path.resolve(t,"styles.css");if(!await o.fs.exists(n))return g.debug("No styles.css found, skipping universal CSS generation"),null;try{let r=await o.fs.readTextFile(n),s=e.extractUniversalCss(r),i=o.path.resolve(t,"styles.universal.css");return await o.fs.writeTextFile(i,s.css),g.debug(`\u2713 Universal CSS generated: ${s.css.length} bytes`),i}catch(r){return g.error("Universal CSS generation failed:",{error:r}),null}}async function vr(e,t){if(await o.fs.exists(e))if(t){g.debug("\u{1F9F9} Cleaning build directory (preserving CSS)");let n=o.path.resolve(e,G);await o.fs.exists(n)&&await o.fs.remove(n,{recursive:!0});let r=o.path.resolve(e,ke);if(await o.fs.exists(r))for await(let s of o.fs.readDir(r)){if(s.name.endsWith(".css")||s.name==="fonts"||s.name==="fonts.css"||s.name==="font-preloads.json")continue;let i=o.path.resolve(r,s.name);await o.fs.remove(i,{recursive:!0})}}else await o.fs.remove(e,{recursive:!0}),g.debug("\u{1F9F9} Cleaned build directory")}async function Sr(e,t){let r=Ve(t)[0];if(!r){g.debug("\u2713 No fonts configured, skipping font optimization");return}let s=o.path.resolve(e,"fonts"),i="/fonts";try{let a=await He(r,s,i),c=o.path.resolve(e,"fonts.css");await o.fs.writeTextFile(c,a.fontFaceCSS);let u=o.path.resolve(e,"font-preloads.json");await o.fs.writeTextFile(u,JSON.stringify(a.preloadHints,null,2)),g.debug(`\u2713 Fonts optimized: ${a.files.length} file(s), ${(a.totalSize/1024).toFixed(2)} KB`)}catch(a){g.error("Font optimization failed:",{error:a}),g.warn("Continuing build without font optimization")}}async function qe(e){let t=[];async function n(r){for await(let s of o.fs.readDir(r)){let i=o.path.resolve(r,s.name);s.isDirectory?await n(i):s.isFile&&s.name.endsWith(".module.css")&&t.push(i)}}return await n(e),t}async function an(e,t,n,r){let s=r?.cssModulePaths??await qe(n.srcDir);if(s.length===0)return g.debug("No CSS modules found, skipping CSS module processing"),new Map;g.debug(`Found ${s.length} CSS module(s)`);try{let i=await Ke(s,{generateDTS:n.cssModuleTypes,projectRoot:e,cache:r?.cache});for(let[a,c]of i)await nn(a,c,t,{skipCss:r?.skipCss,projectRoot:e});return g.debug(`\u2713 Processed ${s.length} CSS module(s)${n.cssModuleTypes?" with TypeScript definitions":""}`),i}catch(i){throw g.error("CSS module processing failed:",{error:i}),i}}async function ln(e,t,n){let r=0;for(let s of e){let i=o.path.relative(t,s),a=o.path.basename(s)+".json",c=o.path.join(t,o.path.dirname(i),a),u=o.path.join(n,o.path.dirname(i),a);await o.fs.ensureDir(o.path.dirname(u));try{await U(c,u,{overwrite:!0}),r++}catch(l){g.warn(` \u26A0 Failed to copy JSON for ${o.path.relative(t,s)}:`,{error:l})}}r>0&&g.debug(`\u2713 Copied ${r} CSS module JSON file(s)`)}async function Rr(e,t,n,r){if(e.length===0)return;let s;r?s=r:s=await Ke(e,{generateDTS:!1,projectRoot:t});let i=[];for(let[,a]of s)i.push(a.code);if(i.length>0){let a=o.path.resolve(n,"styles.css"),c="";try{c=await o.fs.readTextFile(a)}catch{}c=c.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,"");let u=i.map(p=>p.replace(/\x1B\[[0-9;]*[a-zA-Z]/g,"")),l=c+`
127
127
  `+u.join(`
128
- `);await o.fs.writeTextFile(a,l),g.debug(`\u2713 Appended ${i.length} CSS module(s) to styles.css`)}}async function Pr(e,t,n){let{optimizeImages:r,scanImages:s}=await import("./mod-U2MNO6EC.js"),i=o.path.resolve(e,"public"),a=o.path.resolve(i,"images");if(!await o.fs.exists(a)){g.debug("\u2713 No images directory found, skipping image optimization");return}if((await s(a)).length===0){g.debug("\u2713 No images found, skipping image optimization");return}try{let u=o.path.resolve(t,"images"),l=await r(a,u,"/images",{formats:n.images.formats,widths:n.images.widths,quality:n.images.quality,generateBlurPlaceholder:n.images.placeholder==="blur"}),p=Object.keys(l.images).length;p>0&&g.debug(`\u2713 Optimized ${p} image(s)`)}catch(u){g.error("Image optimization failed:",{error:u}),g.warn("Continuing build without image optimization")}}export{Pe as a,_s as b,ai as c,dn as d,li as e,ui as f};
128
+ `);await o.fs.writeTextFile(a,l),g.debug(`\u2713 Appended ${i.length} CSS module(s) to styles.css`)}}async function Pr(e,t,n){let{optimizeImages:r,scanImages:s}=await import("./mod-PZSJGUM7.js"),i=o.path.resolve(e,"public"),a=o.path.resolve(i,"images");if(!await o.fs.exists(a)){g.debug("\u2713 No images directory found, skipping image optimization");return}if((await s(a)).length===0){g.debug("\u2713 No images found, skipping image optimization");return}try{let u=o.path.resolve(t,"images"),l=await r(a,u,"/images",{formats:n.images.formats,widths:n.images.widths,quality:n.images.quality,generateBlurPlaceholder:n.images.placeholder==="blur"}),p=Object.keys(l.images).length;p>0&&g.debug(`\u2713 Optimized ${p} image(s)`)}catch(u){g.error("Image optimization failed:",{error:u}),g.warn("Continuing build without image optimization")}}export{Pe as a,_s as b,ai as c,dn as d,li as e,ui as f};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as b,b as w,d as F,f as D}from"./chunk-VNJJQED3.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-L7RS6MQ5.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
2
+ import{a as b,b as w,d as F,f as D}from"./chunk-26ZFSXSK.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-LGNGLAV3.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
@@ -0,0 +1,17 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as q}from"./chunk-NY4W44PI.js";import{a as S,c as N,d as T,e as L}from"./chunk-2HSGE3TL.js";import{c as U}from"./chunk-OAT2D23A.js";var _=[{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"]}],B=[{questionId:"verification",text:"What tests should be written? (unit, integration, e2e \u2014 be specific about what behavior to test)"},{questionId:"verification",text:"What documentation needs updating? (README, API docs, CHANGELOG, inline comments)"}],C=e=>_.map(t=>{let s=B.filter(r=>r.questionId===t.id),n=N(e,t.id);return{...t,extras:[...s,...n]}});var F=e=>{let t=new Set(e.map(s=>s.questionId));return _.every(s=>t.has(s.id))};var x=e=>U(e),o=(e,t)=>x(t===null?e:`spec ${t} ${e}`),j="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",Y={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},G=(e,t,s,n,r=Y)=>{let m=e.execution.iteration>=t,l="You are a senior engineer and a scrum master who takes pride in honest reporting. Your reputation depends on accuracy, not speed. You are responsible for others' toil, and you are a perfect example of a servant leader. When reporting progress: if something is NOT implemented, say so \u2014 don't hide it. If partially done, say 'partially done: [what works] / [what doesn't]'. If untested, say 'implemented but untested'. NEVER say 'done' for something you haven't verified yourself. Underpromise \u2014 4 of 6 done means '4 of 6 done, 2 remaining', not 'almost done'.",u="Never skip steps or make decisions without asking the user. If you think something can be skipped or inferred, ask first. Explicit > Clever.",y=r.hasAskUserTool?"At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST use AskUserQuestion to get the user's input. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.":"At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST ask the user. Present options as a numbered list and ask the user to pick a number. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.",g="At every decision point where you present options to the user, share your recommendation BEFORE asking. Say what you think and why, then ask if the user agrees. Format: 'I'd recommend X because [reason]. Agree, or would you prefer Y?' The user always has the final word, but you save them cognitive load by proposing first.",w="noskills is a live state machine the user watches in real-time. Call noskills ONCE per interaction. Ask ONE question, wait for the user's answer, submit it. Never batch-submit, never backfill, never answer questions yourself.",c=s?[l,u,y,g,w]:[j,l,u,y,g,w];c.push("When noskills output contains a `roadmap` field, display it to the user BEFORE any other content. When output contains a `gate` field, display the gate message prominently \u2014 do NOT bury it in prose.");let v=n?.outOfScope??[],a=e.spec;switch(e.phase){case"FREE":return{rules:[],tone:"Quiet. No enforcement."};case"IDLE":{let i=r.optionPresentation==="tool"?["When interactiveOptions are present, pass them DIRECTLY as the `options` array in AskUserQuestion \u2014 they are already in the correct {label, description} format. You MUST also provide a `header` field (max 12 chars, e.g. 'Action') and a `question` field. When the user picks an option, look up its label in the `commandMap` object to find the command to execute.","For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions."]:[`When interactiveOptions are present, present them as a numbered list. For each option show the number, label, and description. Ask the user to pick a number. When the user picks an option, look up its label in the \`commandMap\` object to find the command to execute. Example format:
3
+
4
+ 1. Start a new spec \u2014 Begin discovery questions for a new feature
5
+ 2. Add concerns \u2014 Shape how discovery and specs work
6
+
7
+ Pick a number:`,"For availableConcerns: present ALL available concerns as a numbered list. NEVER silently drop concerns \u2014 present ALL available concerns to the user. Ask the user to enter the numbers of the concerns they want to activate (comma-separated)."],d=r.hasAskUserTool?"For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions.":void 0,h=d!==void 0?[i[0],d]:i;return{rules:["You MUST NOT create, edit, or delete any project file until you have either entered free mode or created and approved a spec. No exceptions. No 'quick fixes'. Choose: `noskills free` for unstructured work, or `noskills spec new` for structured work.",...c,...h,"Do not take action without the user choosing an option first.","When the user wants to create a new spec, they can provide anything: a one-line description, a full task list, meeting notes, a kanban card, a customer email, or a detailed requirements document. Accept whatever format they provide. If it's long, summarize it into a spec title for the slug but preserve the full text as context for discovery.","After running spec new, ask the user if they want full discovery, quick discovery, or skip to spec draft. Full discovery: pre-scan, premise challenge, 6 questions, expansions, architecture, error map, synthesis. Quick discovery: only questions relevant to active concerns, skip expansions and error map. Skip to spec draft: classification \u2192 approve \u2192 execute. Never skip discovery without asking."],tone:"Welcoming. Present choices, then wait."}}case"DISCOVERY":{let i=r.hasAskUserTool?"You MUST ask each discovery question using AskUserQuestion tool. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer through AskUserQuestion. Each question \u2192 one AskUserQuestion call \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers as option descriptions in AskUserQuestion \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.":"You MUST ask each discovery question by presenting it to the user as text. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer. Each question \u2192 present it \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.";return{modeOverride:"You are in plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to think and talk. Read code to understand. Ask questions to discover. Challenge assumptions. Propose ideas. Debate tradeoffs. But NEVER create, edit, or delete project files. Discovery exists to catch what you don't yet know you don't know.",rules:[...c,i,"DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","BEFORE asking any discovery questions, conduct a pre-discovery codebase scan: read the project README, CLAUDE.md, and any design docs; check the last 20 git commits (git log --oneline -20); look for TODO files, open issue references, and existing specs; scan the directory structure to understand the project shape. Then present a brief 'Pre-discovery audit' summary: stack detected, recent work themes, open TODOs, existing specs. This gives you CONTEXT to ask INFORMED questions, not blind ones.","If the noskills output contains `preDiscoveryResearch` with `required: true`, you MUST research every term in `extractedTerms` using web search before asking the first question. Present findings as a brief: current stable versions, API changes, deprecations, and anything that might affect the spec's assumptions.","After the pre-discovery codebase scan and BEFORE starting questions, ask the user: 'What kind of discovery do you need? A) Explore scope \u2014 I'll help expand, find opportunities, think bigger. B) Technical depth \u2014 I'll focus on architecture, error handling, implementation strategy. C) Validate my plan \u2014 I already know what I want, challenge my assumptions. D) Ship fast \u2014 minimal scope, cut the fat, get to tasks quickly.' Adapt your discovery emphasis accordingly: Explore \u2192 heavy on expansion proposals and dream state; Technical \u2192 heavy on architectural decisions and error/rescue map; Validate \u2192 heavy on premise challenge and pushback; Ship fast \u2192 minimal questions, skip expansions, go direct to classification and tasks.","Before starting discovery questions, challenge the user's initial spec description against what you learned from the codebase scan. Look for: hidden complexity they haven't mentioned, conflicts with existing code, scope that's bigger or smaller than they think, existing modules that overlap with what they're asking for. Share your observations and ask clarifying follow-ups, then proceed to questions.","When asking discovery questions, use your codebase knowledge to offer concrete options alongside the open-ended question. For example, instead of just 'What does the user do today?' present: 'Based on the codebase, I see three likely scenarios: A) ... B) ... C) ... D) Something else \u2014 describe it. Which is closest?' The user can always pick 'something else' but concrete options speed up the conversation and force specificity.",r.hasAskUserTool?"Ask one question at a time using AskUserQuestion tool.":"Ask one question at a time. Present it as text and wait for the user's response.","Push back on vague answers \u2014 you will be the one executing this spec, vague answers make your job harder.","When the user gives a short answer, follow up: 'Can you be more specific?'","After collecting discovery answers, synthesize a CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision before generating the spec. Show three columns: where the project is now, what this spec achieves, and where it could go in 6 months. Note: 'This spec moves you from column 1 to column 2. Column 3 is out of scope but worth knowing \u2014 every decision in this spec should keep column 3 possible.' This helps the user see if the scope is right.","When you spot expansion opportunities during discovery (from codebase scan, TODOs, concern requirements, synergies with the current plan), present each as a numbered proposal (1/N, 2/N...). Every proposal MUST include: clear description of WHAT and WHY (how it connects to the current plan); effort estimate as S/M/L/XL with human time and CC time estimates (e.g., 'S (human: ~1 day / CC: ~15 min)' \u2014 not just 'small'); risk assessment as Low/Low-Med/Med/Med-High/High naming the specific risk factor; completeness delta showing X/10 without this and Y/10 with this. Every proposal gets three options: A) Add to scope B) Defer to future spec C) Skip \u2014 not interested, plus 'Chat about this' and 'Skip remaining proposals' escape hatches.","After discovery questions and expansion proposals, identify architectural decisions that must be resolved before implementation. These are decisions where choosing A vs B changes the shape of multiple tasks, the data model, the API surface, or system boundaries. Present each as a concrete technical question with options, a RECOMMENDATION with reasoning, and completeness scores. Show how each option affects downstream work (e.g., 'If you choose B, tasks 3 and 4 need a job queue setup step added'). Only surface decisions that BLOCK implementation \u2014 not preferences or nice-to-haves. If the user says 'I don't know yet', mark it as a risk: 'UNRESOLVED: [decision] TBD. Tasks X-Y may change.' Never allow implementation to start with unresolved architectural decisions \u2014 flag them prominently in the spec.","Before finalizing, map error and rescue paths for every significant codepath in the planned work. Create a table: codepath | what can go wrong | how it's handled. Identify CRITICAL GAPS \u2014 failure modes that the plan doesn't address. Present each critical gap as a decision with options, a recommendation, and completeness scores, just like architectural decisions. Resolved gaps become tasks or acceptance criteria. Unresolved gaps become risk flags. Think like an SRE reviewing a design doc \u2014 what fails at 3am?","After all discovery questions, expansion proposals, architectural decisions, and error mapping are complete, present a DISCOVERY SUMMARY for the user to review: intent, ambition, reversibility, impact, verification, out of scope, the dream state table (current \u2192 this spec \u2192 future), accepted/deferred/skipped expansions, resolved architectural decisions, and the error/rescue map. Ask for confirmation before generating the spec. This is the last chance to catch misunderstandings.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object."],tone:"Curious interviewer who has a stake in the answers and comes PREPARED. You've read the codebase before asking. Challenge assumptions, offer concrete options, think about architecture and failure modes. Think deeply before asking each question."}}case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...c,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.",r.hasAskUserTool?"Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'":"Ask the user: 'Are these answers correct, or would you like to revise any?' Present approval and revision as numbered options.","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm.","If noskills output contains a splitProposal, present it to the user with the exact options shown. Do NOT split or merge specs on your own. Do NOT recommend one option over the other unless the user asks for your opinion. The user decides."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":return{modeOverride:"You are in plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to think and talk. Read code to understand. Ask questions to discover. Challenge assumptions. Propose ideas. Debate tradeoffs. But NEVER create, edit, or delete project files. Discovery exists to catch what you don't yet know you don't know.",rules:[...c,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","Ask the user if they want to refine before approving.",r.hasAskUserTool?"When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.":"When presenting classification options, present them as a numbered list with multiselect (user picks multiple numbers). Do NOT infer classification yourself.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+o(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`,a)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."};case"SPEC_APPROVED":return{rules:[...c,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec.",r.hasAskUserTool?"Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion.":"Before starting execution, show the spec summary to the user and ask for final confirmation. Present 'Start execution' and 'Not yet' as numbered options."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let i=[];r.subAgentMethod==="task"?i.push(`When you receive a task from noskills next, do NOT execute it yourself. Spawn the noskills-executor sub-agent using the Agent tool. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the sub-agent completes, review its results briefly, then report to noskills via \`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,a)}\`. You are the orchestrator \u2014 the sub-agent is the implementer.`,"If the sub-agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the sub-agent failure in your next status report so it can be investigated.","After the noskills-executor sub-agent completes a task, spawn a noskills-verifier sub-agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.",`After spawning sub-agents, ALWAYS present a dispatch table showing the FULL pipeline \u2014 not just executors, but also verification and test steps:
8
+
9
+ | Step | Agent | Files | Tasks | Est. Time |
10
+ |------|-------|-------|-------|-----------|
11
+ | 1. Implement | noskills-executor | purge.ts | Tasks 1-6 | ~3 min |
12
+ | 2. Verify | noskills-verifier | purge.ts (read-only) | Validate ACs | ~1 min |
13
+ | 3. Write tests | noskills-executor | purge.test.ts | Task 7 | ~2 min |
14
+
15
+ When agents complete, update with actual time and status (Done / Failed / Found N issues). The user should see the complete plan upfront.
16
+
17
+ Estimate: S ~1min, M ~2min, L ~5min, XL ~10min.`,"The agent that writes implementation code must NOT write tests for that code. Spawn a SEPARATE sub-agent for test writing. This prevents the implementer from writing tests that only confirm what it already knows. The test writer reads the code fresh and tests what it actually does, not what the implementer intended.","When deciding how to split work across sub-agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused sub-agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):r.subAgentMethod==="spawn"?i.push(`When you receive a task from noskills next, use spawn_agent to delegate to the noskills-executor agent. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. Use wait_agent to collect results. Then report to noskills via \`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,a)}\`. You are the orchestrator \u2014 the spawned agent is the implementer.`,"If the spawned agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the noskills-executor agent completes a task, spawn a noskills-verifier agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.","When deciding how to split work across spawned agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):r.subAgentMethod==="fleet"?i.push(`When you receive a task from noskills next, use /fleet to run parallel sub-agents for implementation tasks. Pass each agent: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. Collect results and report to noskills via \`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,a)}\`. You are the orchestrator \u2014 the fleet agents are the implementers.`,"If a fleet agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the fleet agents complete, run a verification pass to independently check the work. Verify: changed files, acceptance criteria, test commands. Report PASS/FAIL per criterion with evidence.","When deciding how to split work across fleet agents: if all tasks touch the same file or tightly coupled files, batch them into one agent. If tasks touch independent files or modules, run parallel agents. Always err toward smaller, focused agents over large batched ones."):r.subAgentMethod==="delegation"?i.push(`When you receive a task from noskills next, use Kiro's agent delegation to spawn the noskills-executor agent. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the agent completes, review its results briefly, then report to noskills via \`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,a)}\`. You are the orchestrator \u2014 the delegated agent is the implementer.`,"If the delegated agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the noskills-executor agent completes a task, delegate to the noskills-verifier agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.","When deciding how to split work across delegated agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):i.push("Execute tasks sequentially in this context. Do not attempt to spawn sub-agents \u2014 this tool does not support agent delegation. Complete each task yourself, verify your work (run type checks and tests), then report progress.",`After completing a task, report to noskills via \`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,a)}\`.`);let d=[...c,"You are the orchestrator, not the implementer. NEVER create, edit, or delete project files directly. ALWAYS delegate to noskills-executor sub-agent, even for single-line changes. There is no 'minor change' \u2014 every edit goes through the executor\u2192verifier pipeline. Your job: read noskills output, spawn sub-agents, report status.","Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",...i,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${x('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`,"FORCED VERIFICATION: After every file edit, run the project's type-check command (e.g., `tsc --noEmit`, `deno check`, `go build`) and lint command. Report results in AC status. Do NOT mark any AC as passed if type-check fails. If no type-checker is configured, state that explicitly.","FILE READ BUDGET: Files over 500 lines must be read in chunks using offset and limit. Never assume a single read captured the full file. When you read a partial file, state which lines you read.","TOOL RESULT AWARENESS: If any search or command returns suspiciously few results, re-run with narrower scope (single directory, stricter pattern). State when you suspect results were truncated.","PRE-EDIT RE-READ: Before EVERY file edit, re-read the target file to get current content. After editing, read the file again to confirm the change applied correctly. Never edit against stale context.","DEAD CODE FIRST: Before structural refactors on files over 300 LOC, first remove dead imports, unused exports, and orphaned props. Commit cleanup separately before starting the real work.","Do NOT suggest pausing, checkpointing, committing mid-spec, or stopping execution. The spec was scoped during discovery as a meaningful deliverable \u2014 execute it to completion. A half-delivered increment has no value. If scope feels too large, finish this spec and note the concern for future specs. The user decides when to stop, not you."];e.execution.lastVerification?.passed===!1&&d.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let h={rules:d,tone:"Direct. Orchestrate immediately \u2014 spawn sub-agents.",outOfScope:v.length>0?v:void 0};return m?{...h,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:h}case"BLOCKED":return{rules:[...c,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"COMPLETED":return{rules:[...c,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...c,`Run \`${o("next",a)}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},H=5*60*1e3,X=(e,t)=>{let s=e.spec,n;switch(e.phase){case"IDLE":n=`No active spec. Start one with: \`${x('spec new --name=<slug> "description"')}\``;break;case"DISCOVERY":n=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":n=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":n=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":n=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":n=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":n=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"COMPLETED":n=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:n=`Run \`${o("next",s)}\` to get started.`}return{protocol:`Run \`${o('next --answer="..."',s)}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:t.map(r=>r.id),resumeHint:n}},K=e=>{let t=e.spec;if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 COMPLETED",how:`Run \`${o("next",t)}\` for instructions. Submit results with \`${o('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let s=new Date(e.lastCalledAt).getTime();if(Date.now()-s>H)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 COMPLETED",how:`Run \`${o("next",t)}\` for instructions. Submit results with \`${o('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},V=[{key:"IDLE",label:"IDLE"},{key:"DISCOVERY",label:"DISCOVERY"},{key:"DISCOVERY_REVIEW",label:"REVIEW"},{key:"SPEC_DRAFT",label:"DRAFT"},{key:"SPEC_APPROVED",label:"APPROVED"},{key:"EXECUTING",label:"EXECUTING"},{key:"COMPLETED",label:"DONE"}],z=e=>e==="FREE"?"\u2726 FREE \u2726 (no enforcement)":e==="BLOCKED"?V.map(t=>t.key==="EXECUTING"?"\u2726 EXECUTING (BLOCKED) \u2726":t.label).join(" \u2192 "):V.map(t=>t.key===e?`\u2726 ${t.label} \u2726`:t.label).join(" \u2192 "),J=(e,t)=>{switch(e.phase){case"DISCOVERY_REVIEW":return{message:`${e.discovery.answers.length}/6 answers collected.`,action:"Type APPROVE to generate spec, or REVISE to correct answers.",phase:"DISCOVERY_REVIEW"};case"SPEC_APPROVED":return{message:`Spec approved. ${t?.tasks?.length??0} tasks ready.`,action:"Type START to begin execution.",phase:"SPEC_APPROVED"};default:return}},fe=(e,t,s,n,r,m,l,u)=>{let y=X(e,t),g=n?.maxIterationsBeforeRestart??15,w=n?.allowGit??!1,c=u??Y,p=G(e,g,w,r,c),v=K(e),a;switch(e.phase){case"IDLE":a=W(t,S,s.length,l);break;case"DISCOVERY":a=ne(e,t,s);break;case"DISCOVERY_REVIEW":a=oe(e,t);break;case"SPEC_DRAFT":a=re(e);break;case"SPEC_APPROVED":a=ie(e);break;case"EXECUTING":a=le(e,t,s,g,r,m);break;case"BLOCKED":a=de(e);break;case"COMPLETED":a=ue(e);break;case"FREE":a={phase:"FREE",instruction:"Free mode \u2014 no enforcement active. Work as you wish."};break;default:a=W(t,S,s.length,l)}let i=z(e.phase),d=J(e,r),h={...a,meta:y,behavioral:p,roadmap:i};d!==void 0&&(h={...h,gate:d}),v!==void 0&&(h={...h,protocolGuide:v});let b=Z(e,t,l);if(b.length>0){let I=b.map(({label:f,description:E})=>({label:f,description:E})),A={};for(let f of b)A[f.label]=f.command;let k=c.optionPresentation==="tool"?"AskUserQuestion":"prose-numbered-list",R=c.optionPresentation==="tool"?"Use AskUserQuestion tool to present these options. Do NOT use prose.":"Present options as a numbered list. Ask user to pick a number.";h={...h,interactiveOptions:I,commandMap:A,toolHint:k,toolHintInstruction:R}}return h},Z=(e,t,s)=>{let n=e.spec;switch(e.phase){case"IDLE":{let r=[],l=(s?.existingSpecs??[]).filter(u=>u.phase!=="COMPLETED");t.length===0&&r.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:x("concern add <id> [<id2> ...]")}),r.push({label:"Start a new spec",description:"Begin discovery questions for a new feature",command:x('spec new --name=<slug> "description"')}),r.push({label:"Free mode",description:"No enforcement \u2014 work freely until you want structure",command:x("free")});for(let u of l.slice(0,2))r.push({label:`Continue: ${u.name} (${u.phase})`,description:u.detail??`Iteration ${u.iteration}`,command:o("next",u.name)});return t.length>0&&r.push({label:"Edit concerns",description:`Currently: ${t.map(u=>u.id).join(", ")}`,command:x("concern list")}),r.slice(0,4)}case"DISCOVERY_REVIEW":return e.discovery.approved?[{label:"Keep as one spec",description:"All work in a single spec",command:o('next --answer="keep"',n)},{label:"Split into separate specs",description:"Create one spec per independent area",command:o('next --answer="split"',n)}]:[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:o('next --answer="approve"',n)},{label:"Revise answers",description:"Correct one or more discovery answers",command:o(`next --answer='{"revise":{...}}'`,n)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:o("approve",n)},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:o(`next --answer='{"refinement":"..."}'`,n)},{label:"Start over",description:"Reset the spec and start fresh",command:o("reset",n)}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin implementing the tasks",command:o('next --answer="start"',n)},{label:"Not yet",description:'Save for later \u2014 resume with noskills next --answer="start"',command:""}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:o('next --answer="resolution"',n)},{label:"Reset spec",description:"Abandon this spec and start over",command:o("reset",n)}];case"COMPLETED":return[{label:"New spec",description:"Start a new feature spec",command:x('spec new --name=<slug> "description"')},{label:"Reopen spec",description:"Reopen this spec for revision",command:o("reopen",n)},{label:"Check status",description:"Review completed spec summary",command:x("status")}];default:return[]}},ee="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",W=(e,t,s,n)=>({phase:"IDLE",instruction:"Present the welcome dashboard and interactive options to the user. Show existing specs if any, then present choices. IMPORTANT: Present ALL available concerns to the user \u2014 never truncate the list. Split across multiple AskUserQuestion calls if needed.",welcome:ee,existingSpecs:n?.existingSpecs??[],availableConcerns:t.map(r=>({id:r.id,description:r.description})),activeConcerns:e.map(r=>r.id),activeRulesCount:n?.rulesCount??s,hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),te=/\b(Node\.?js|Deno|Bun|Go|Rust|Python|Ruby|Java|Kotlin|Swift|PHP|React|Vue|Angular|Svelte|Next\.?js|Nuxt|Remix|Astro|SolidJS|Qwik|TypeScript|Webpack|Vite|esbuild|Rollup|Terraform|Docker|Kubernetes|PostgreSQL|MySQL|Redis|MongoDB|SQLite|Prisma|Drizzle|gRPC|GraphQL|tRPC)\s+v?(\d+(?:\.\d+)?(?:\.\d+)?\+?)\b/gi,se=e=>{if(e===null||e.length===0)return[];let t=[],s,n=new RegExp(te.source,"gi");for(;(s=n.exec(e))!==null;)t.push(`${s[1]} ${s[2]}`);return t},M=e=>{let t=se(e);if(t.length!==0)return{required:!0,instruction:"Before asking discovery questions, research the current state of all platforms, runtimes, libraries, and APIs mentioned in the spec description. Use web search and Context7 MCP if available. Report findings as a pre-discovery brief to the user. Do NOT assume your training data is current \u2014 versions change, APIs get added, features get deprecated.",extractedTerms:t}},ne=(e,t,s)=>{let n=e.spec,r=C(t),m=e.discovery.answers.length,l=F(e.discovery.answers),u=e.discovery.audience==="agent";if(l){let i=e.revisitHistory??[],d=i.length>0?i[i.length-1]:null,h={phase:"DISCOVERY",instruction:d!==null?"This spec was revisited from EXECUTING. All previous answers are preserved. Review and approve, or revise answers before regenerating the spec.":`All discovery questions answered. Run: \`${o("approve",n)}\``,questions:[],answeredCount:m,context:{rules:s,concernReminders:[]},transition:{onComplete:o("approve",n)}};if(d!=null){let b=d;return{...h,revisited:!0,revisitReason:b.reason,previousProgress:{completedTasks:[...b.completedTasks],totalTasks:b.completedTasks.length}}}return h}if(u){let i=e.discovery.currentQuestion,d=r[i];if(d===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${o("approve",n)}\``,questions:[],answeredCount:m,context:{rules:s,concernReminders:[]},transition:{onComplete:o("approve",n)}};let h={id:d.id,text:d.text,concerns:[...d.concerns],extras:d.extras.map(I=>I.text)},b={phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${o('next --agent --answer="<answer>"',n)}\``,questions:[h],answeredCount:m,currentQuestion:i,totalQuestions:r.length,context:{rules:s,concernReminders:T(t)},transition:{onComplete:`${o('next --agent --answer="<answer>"',n)}`}};if(i===0){let I=M(e.specDescription??null);if(I!==void 0)return{...b,preDiscoveryResearch:I}}return b}let y=new Set(e.discovery.answers.map(i=>i.questionId)),g=r.filter(i=>!y.has(i.id)).map(i=>({id:i.id,text:i.text,concerns:[...i.concerns],extras:i.extras.map(d=>d.text)})),w=e.revisitHistory??[],c=w.length>0?w[w.length-1]:null,p=c!==null,a={phase:"DISCOVERY",instruction:p?"This spec was revisited from EXECUTING. Previous discovery answers are preserved \u2014 review and revise as needed, or approve to regenerate tasks.":"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:g,answeredCount:m,context:{rules:s,concernReminders:T(t)},transition:{onComplete:`${o(`next --answer='{"status_quo":"...","ambition":"...",...}'`,n)}`}};if(p&&c!==void 0)return{...a,revisited:!0,revisitReason:c.reason,previousProgress:{completedTasks:[...c.completedTasks],totalTasks:c.completedTasks.length}};if(m===0){let i=M(e.specDescription??null);if(i!==void 0)return{...a,preDiscoveryResearch:i}}return a},oe=(e,t)=>{let s=e.spec,n=C(t),r=e.discovery.answers.map(l=>{let u=n.find(y=>y.id===l.questionId);return{questionId:l.questionId,question:u?.text??l.questionId,answer:l.answer}}),m=q(e.discovery.answers);return e.discovery.approved&&m.detected?{phase:"DISCOVERY_REVIEW",instruction:"Discovery answers are approved. noskills detected multiple independent work areas in this spec. Present the split proposal to the user and let them decide whether to keep as one spec or split into separate specs.",answers:r,transition:{onApprove:o('next --answer="keep"',s),onRevise:o(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,s)},splitProposal:m}:{phase:"DISCOVERY_REVIEW",instruction:m.detected?"Present ALL discovery answers to the user for review. ALSO present the split proposal \u2014 noskills detected multiple independent areas.":"Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.",answers:r,transition:{onApprove:o('next --answer="approve"',s),onRevise:o(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,s)},splitProposal:m.detected?m:void 0}},re=e=>{let t=e.spec;return e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${o(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`,t)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+o(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`,t)+"`. If none apply, answer with: `"+o('next --answer="none"',t)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:o("approve",t)}}},ie=e=>{let t=e.spec;return{phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${o('next --answer="start"',t)}`}}},ae=(e,t)=>{if(t===null)return!1;let s=e.toLowerCase();return s.includes("mobile")||s.includes("layout")||s.includes("interaction design")?t.involvesWebUI:s.includes("ui state")||s.includes("skeleton ui")?t.involvesWebUI||t.involvesCLI:s.includes("readme")||s.includes("documentation updated")||s.includes("reflected in")&&s.includes("docs")?!0:s.includes("api doc")||s.includes("public api")?t.involvesPublicAPI:s.includes("migration")||s.includes("backward compat")||s.includes("deprecat")?t.involvesMigration:s.includes("audit trail")||s.includes("access control")||s.includes("data handling")||s.includes("data retention")?t.involvesDataHandling:!0},ce=(e,t,s,n,r,m,l,u)=>{let y=[],g=new Set(u??[]),w=0,c=()=>`ac-${++w}`;if(n!==null)for(let p of n.items)g.has(p.id)||y.push({id:p.id,text:`[DEBT from iteration ${p.since}] ${p.text}`});if(t&&y.push({id:c(),text:`[FAILED] Tests \u2014 fix this first: ${s.slice(0,200)}`}),m!=null)for(let p of m.verification){let v=c();g.has(v)||y.push({id:v,text:p})}for(let p of e)if(p.acceptanceCriteria!==void 0&&p.acceptanceCriteria.length>0)for(let v of p.acceptanceCriteria){if(!ae(v,r))continue;let a=c();g.has(a)||y.push({id:a,text:`(${p.id}) ${v}`})}if(l!==void 0)for(let p of l){let v=c();g.has(v)||y.push({id:v,text:`(folder: ${p.folder}) ${p.rule}`})}return y.push({id:"mandatory-tests",text:"Tests written and passing for all new and changed behavior"}),y.push({id:"mandatory-docs",text:"Documentation updated for all public-facing changes"}),y},le=(e,t,s,n,r,m)=>{let l=e.spec,u=L(t),y=e.execution.iteration>=n,g=e.execution.lastVerification?.passed===!1,w=e.execution.lastVerification?.output??"",c=r?.tasks??[],p=e.execution.completedTasks??[],v=new Set(p),a=c.find(f=>!v.has(f.id))??null,i=a!==null?{id:a.id,title:a.title,totalTasks:c.length,completedTasks:p.length}:void 0;if(e.execution.awaitingStatusReport){let f=ce(t,g,w,e.execution.debt,e.classification,r,m,e.execution.naItems),E=[];try{let O=JSON.parse(e.execution.lastProgress??"");Array.isArray(O.completed)&&(E=O.completed.filter(P=>typeof P=="string"&&P.startsWith("task-")))}catch{}let D={phase:"EXECUTING",instruction:E.length>=2?`${E.length} tasks reported complete. Report status against ALL relevant acceptance criteria.`:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:s,concernReminders:T(t)},transition:{onComplete:`${o(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,l)}`,onBlocked:`${o('block "reason"',l)}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:f,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return E.length>=2&&(D={...D,batchTasks:E}),g&&(D={...D,verificationFailed:!0,verificationOutput:w.slice(0,2e3)}),D}let d=(e.execution.lastProgress??"").includes("Task not accepted"),h=e.execution.debt?.items??[],b=e.execution.debt?.unaddressedIterations??0,I=i!==void 0?`Execute task ${i.id}: ${i.title} (${i.completedTasks}/${i.totalTasks} completed)`:"All tasks completed. Run `"+o("done",l)+"` to finish.",A;if(g)A="Verification FAILED. Fix the failing tests before continuing.";else if(d&&h.length>0){let f=b>=3?` These items have been outstanding for ${b} iterations.`:"";A=`Task not accepted \u2014 ${h.length} remaining item(s) must be addressed before this task can be completed.${f} Address them, then submit a new status report.`}else A=I;let k={phase:"EXECUTING",instruction:A,task:i,context:{rules:s,concernReminders:T(t)},transition:{onComplete:`${o('next --answer="..."',l)}`,onBlocked:`${o('block "reason"',l)}`,iteration:e.execution.iteration}};if(d&&h.length>0&&(k={...k,taskRejected:!0,rejectionReason:`${h.length} remaining item(s) must be addressed.`,rejectionRemaining:h.map(f=>f.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let f=e.execution.debt.unaddressedIterations??0,E=f>=3?`URGENT: These items have been unaddressed for ${f} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";k={...k,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:E}}}if(g){let f=w.slice(0,2e3);k={...k,verificationFailed:!0,verificationOutput:f}}u.length>0&&(k={...k,concernTensions:u}),y&&(k={...k,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${o("next",l)}\` to resume - your progress is saved.`});let R=[...e.decisions].reverse().find(f=>!f.promoted);return R!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(k={...k,promotePrompt:{decisionId:R.id,question:R.question,choice:R.choice,prompt:`You just resolved a decision: "${R.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${x(`rule add "${R.choice}"`)}\``}}),k},de=e=>{let t=e.spec;return{phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${o('next --answer="..."',t)}`}}},ue=e=>({phase:"COMPLETED",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length,completionReason:e.completionReason,completionNote:e.completionNote}});export{_ as a,C as b,F as c,fe as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as r}from"./chunk-ZEFYMWGZ.js";var n=class{description;#o;#s;#e=[];constructor(o){this.description=o.description,this.#o=o.modules??{},this.#s=o.aliases??{}}addSubmodule(o,e){return this.#e.push({registration:o,module:e}),this}async addSubmoduleAsync(o,e){let s=await e;return this.#e.push({registration:o,module:s}),this}toGroupOptions(){return{description:this.description,modules:this.#o,aliases:Object.keys(this.#s).length>0?this.#s:void 0}}toCommand(o,e){let s=new r(o).description(this.description);e!==void 0&&s.version(e),Object.keys(this.#o).length>0&&s.modules(this.toGroupOptions());for(let{registration:t,module:d}of this.#e){let i=d.toGroupOptions();if(s.group(t.name,i),t.aliases!==void 0)for(let a of t.aliases)s.groupAlias(a,t.name,i)}return s}};export{n as a};
2
+ import{b as r}from"./chunk-MJ2IPSAE.js";var n=class{description;#o;#s;#e=[];constructor(o){this.description=o.description,this.#o=o.modules??{},this.#s=o.aliases??{}}addSubmodule(o,e){return this.#e.push({registration:o,module:e}),this}async addSubmoduleAsync(o,e){let s=await e;return this.#e.push({registration:o,module:s}),this}toGroupOptions(){return{description:this.description,modules:this.#o,aliases:Object.keys(this.#s).length>0?this.#s:void 0}}toCommand(o,e){let s=new r(o).description(this.description);e!==void 0&&s.version(e),Object.keys(this.#o).length>0&&s.modules(this.toGroupOptions());for(let{registration:t,module:d}of this.#e){let i=d.toGroupOptions();if(s.group(t.name,i),t.aliases!==void 0)for(let a of t.aliases)s.groupAlias(a,t.name,i)}return s}};export{n as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-YURNTYEP.js";import{a as c}from"./chunk-J7YTWK67.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,P as b};
2
+ import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-BJLUDX4R.js";import{a as c}from"./chunk-J7YTWK67.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,P as b};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as o}from"./chunk-UQRZJPYH.js";var p=[{name:"AWS Access Key ID",pattern:/AKIA[0-9A-Z]{16}/},{name:"Private Key",pattern:/-----BEGIN\s{1,5}(RSA\s{1,5}|EC\s{1,5}|DSA\s{1,5}|OPENSSH\s{1,5})?PRIVATE KEY-----/},{name:"Generic secret assignment",pattern:/(?:secret|password|api_key|apikey|access_token|auth_token|private_key)\s{0,5}[=:]\s{0,5}["'][^"']{8,}["']/i}],d=[/\.lock$/,/package-lock\.json$/,/\.test\./,/testdata\//,/\.snap$/,/\.min\./],t=o({name:"validate-secrets",description:"Detect credentials and private keys",canFix:!1,stacks:[],defaults:{},checkFile(a,s){if(s===void 0)return[];for(let e of d)if(e.test(a.path))return[];let n=[],r=s.split(`
2
+ import{a as o}from"./chunk-JLRVMMMH.js";var p=[{name:"AWS Access Key ID",pattern:/AKIA[0-9A-Z]{16}/},{name:"Private Key",pattern:/-----BEGIN\s{1,5}(RSA\s{1,5}|EC\s{1,5}|DSA\s{1,5}|OPENSSH\s{1,5})?PRIVATE KEY-----/},{name:"Generic secret assignment",pattern:/(?:secret|password|api_key|apikey|access_token|auth_token|private_key)\s{0,5}[=:]\s{0,5}["'][^"']{8,}["']/i}],d=[/\.lock$/,/package-lock\.json$/,/\.test\./,/testdata\//,/\.snap$/,/\.min\./],t=o({name:"validate-secrets",description:"Detect credentials and private keys",canFix:!1,stacks:[],defaults:{},checkFile(a,s){if(s===void 0)return[];for(let e of d)if(e.test(a.path))return[];let n=[],r=s.split(`
3
3
  `);for(let e=0;e<r.length;e++){let i=r[e];for(let{name:c,pattern:l}of p)if(l.test(i)){n.push({path:a.path,line:e+1,message:`potential ${c} detected`});break}}return n}}),k=t.run,T=t.validator,y=t.main;export{t as a,k as b,T as c,y as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{i as d}from"./chunk-6VHZQNHX.js";var l=[["go.mod","go"],["deno.json","deno"],["deno.jsonc","deno"],["package.json","node"]],g=async r=>{for(let[c,n]of l)try{return await d.fs.stat(`${r}/${c}`),{type:n,configFile:c}}catch{}return{type:"unknown",configFile:void 0}},f=(r,c)=>{let n=[],t=[],e=r.dependencies;if(e===void 0)return{instructions:n,warnings:t};let i=r.language,o=c.type;if(o!=="unknown"&&(i==="go"&&o==="go"||i==="typescript"&&(o==="deno"||o==="node")||i==="javascript"&&(o==="deno"||o==="node")||t.push(`Recipe '${r.name}' is for ${i}, but detected ${o} project (${c.configFile}).`)),e.go!==void 0&&e.go.length>0)for(let s of e.go)n.push(`go get ${s}`);if(e.jsr!==void 0&&e.jsr.length>0)for(let s of e.jsr)n.push(`deno add ${s}`);if(e.npm!==void 0&&e.npm.length>0)for(let s of e.npm)n.push(`npm install ${s}`);return{instructions:n,warnings:t}},y=async(r,c,n)=>{let t=[];for(let e of r){if(n?.dryRun===!0){t.push({command:e,success:!0});continue}n?.verbose===!0&&console.log(` [install] ${e}`);let i=e.split(/\s+/),o=i[0],s=i.slice(1);try{let a=await d.exec.spawn(o,s,{cwd:c,stdout:"inherit",stderr:"inherit"});if(!a.success){t.push({command:e,success:!1,error:`Exit code ${a.code}`});break}t.push({command:e,success:!0})}catch(a){let u=a instanceof Error?a.message:String(a);t.push({command:e,success:!1,error:u});break}}return t};export{g as a,f as b,y as c};
2
+ import{i as d}from"./chunk-WJKE6XHF.js";var l=[["go.mod","go"],["deno.json","deno"],["deno.jsonc","deno"],["package.json","node"]],g=async r=>{for(let[c,n]of l)try{return await d.fs.stat(`${r}/${c}`),{type:n,configFile:c}}catch{}return{type:"unknown",configFile:void 0}},f=(r,c)=>{let n=[],t=[],e=r.dependencies;if(e===void 0)return{instructions:n,warnings:t};let i=r.language,o=c.type;if(o!=="unknown"&&(i==="go"&&o==="go"||i==="typescript"&&(o==="deno"||o==="node")||i==="javascript"&&(o==="deno"||o==="node")||t.push(`Recipe '${r.name}' is for ${i}, but detected ${o} project (${c.configFile}).`)),e.go!==void 0&&e.go.length>0)for(let s of e.go)n.push(`go get ${s}`);if(e.jsr!==void 0&&e.jsr.length>0)for(let s of e.jsr)n.push(`deno add ${s}`);if(e.npm!==void 0&&e.npm.length>0)for(let s of e.npm)n.push(`npm install ${s}`);return{instructions:n,warnings:t}},y=async(r,c,n)=>{let t=[];for(let e of r){if(n?.dryRun===!0){t.push({command:e,success:!0});continue}n?.verbose===!0&&console.log(` [install] ${e}`);let i=e.split(/\s+/),o=i[0],s=i.slice(1);try{let a=await d.exec.spawn(o,s,{cwd:c,stdout:"inherit",stderr:"inherit"});if(!a.success){t.push({command:e,success:!1,error:`Exit code ${a.code}`});break}t.push({command:e,success:!0})}catch(a){let u=a instanceof Error?a.message:String(a);t.push({command:e,success:!1,error:u});break}}return t};export{g as a,f as b,y as c};