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,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as A}from"./chunk-2HSGE3TL.js";import{k,l as y,m as x,n as P}from"./chunk-PIV56NIC.js";import{b as $,c as b}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-MBG7SPPO.js";import{c as d,d as c,f as u,g as C}from"./chunk-YVN2NZL4.js";import{a as l,b as p}from"./chunk-FFWPJP7A.js";import{i as v}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var q=async s=>{let e=s?.[0];if(e==="add")return await I(s?.slice(1));if(e==="remove")return await M(s?.slice(1));if(e==="list")return await R();let r=$(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${r} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=(s??[]).filter(i=>!i.startsWith("-")),t=await k(r);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await A(),o=[];for(let i of n){let f=await x(r,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await P(r,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(t.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...t,concerns:[...t.concerns,...o]};await y(r,i),e.writeln(C("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=s?.[0],t=await k(r);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!t.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...t,concerns:t.concerns.filter(o=>o!==n)};return await y(r,a),e.writeln(C("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},R=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),e=v.process.cwd(),r=await k(e),n=await A(),t=r?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=t.includes(a.id);s.writeln(" ",o?C("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{q as main};
2
+ import{b as A}from"./chunk-2HSGE3TL.js";import{k,l as y,m as x,n as P}from"./chunk-YW377352.js";import{b as $,c as b}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-ZC4F4MYU.js";import{c as d,d as c,f as u,g as C}from"./chunk-YVN2NZL4.js";import{a as l,b as p}from"./chunk-FFWPJP7A.js";import{i as v}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var q=async s=>{let e=s?.[0];if(e==="add")return await I(s?.slice(1));if(e==="remove")return await M(s?.slice(1));if(e==="list")return await R();let r=$(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${r} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=(s??[]).filter(i=>!i.startsWith("-")),t=await k(r);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await A(),o=[];for(let i of n){let f=await x(r,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await P(r,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(t.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...t,concerns:[...t.concerns,...o]};await y(r,i),e.writeln(C("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=s?.[0],t=await k(r);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!t.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...t,concerns:t.concerns.filter(o=>o!==n)};return await y(r,a),e.writeln(C("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},R=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),e=v.process.cwd(),r=await k(e),n=await A(),t=r?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=t.includes(a.id);s.writeln(" ",o?C("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{q as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as P,b as v,c as x,d as O}from"./chunk-2BOCLC67.js";import{d as D,e as h,f as g,g as f,i as F,j as y,k,n as b}from"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import{b as d,d as p,r as w}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";import S from"node:process";var R={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},E=()=>{let n=t=>({isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:t.mtime,atime:t.atime,birthtime:t.birthtime});return{async readFile(t,e){try{return await Deno.readFile(t,{signal:e?.signal})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async readTextFile(t,e){try{return await Deno.readTextFile(t,{signal:e?.signal})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async writeFile(t,e,r){await Deno.writeFile(t,e,{signal:r?.signal,mode:r?.mode,create:r?.create??!0,append:r?.append??!1})},async writeTextFile(t,e,r){await Deno.writeTextFile(t,e,{signal:r?.signal,mode:r?.mode,create:r?.create??!0,append:r?.append??!1})},async exists(t){try{return await Deno.stat(t),!0}catch(e){if(e instanceof Deno.errors.NotFound)return!1;throw e}},async stat(t){try{let e=await Deno.stat(t);return n(e)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async lstat(t){try{let e=await Deno.lstat(t);return n(e)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async mkdir(t,e){await Deno.mkdir(t,{recursive:e?.recursive??!1,mode:e?.mode})},async ensureDir(t){try{await Deno.mkdir(t,{recursive:!0})}catch(e){if(!(e instanceof Deno.errors.AlreadyExists))throw e}},async remove(t,e){try{await Deno.remove(t,{recursive:e?.recursive??!1})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async*readDir(t){try{for await(let e of Deno.readDir(t))yield{name:e.name,isFile:e.isFile,isDirectory:e.isDirectory,isSymlink:e.isSymlink}}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async copyFile(t,e){await Deno.copyFile(t,e)},async rename(t,e){await Deno.rename(t,e)},async makeTempDir(t){return await Deno.makeTempDir({dir:t?.dir,prefix:t?.prefix,suffix:t?.suffix})},async realPath(t){try{return await Deno.realPath(t)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},watch(t,e){let r=e?.recursive??!0,a=Deno.watchFs(t,{recursive:r}),s=c=>({kind:c.kind,paths:c.paths,flag:c.flag});return{close:()=>a.close(),[Symbol.asyncIterator]:async function*(){for await(let c of a)yield s(c)}}},async*walk(t,e){let r=e?.includeDirs??!0,a=e?.includeFiles??!0,s=e?.exts,c=e?.skip,o=async function*(l){for await(let i of Deno.readDir(l)){let m=y(l,i.name);if(!c?.some(u=>u.test(m))){if(i.isDirectory)r&&(yield{path:m,name:i.name,isFile:!1,isDirectory:!0,isSymlink:i.isSymlink}),yield*o(m);else if(i.isFile||i.isSymlink){if(!a||s&&!s.some(u=>i.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:m,name:i.name,isFile:i.isFile,isDirectory:!1,isSymlink:i.isSymlink}}}}};yield*o(t)},async chmod(t,e){let{chmod:r}=await import("./unstable_chmod-2W47KJY3.js");await r(t,e)}}},T=()=>({join:y,resolve:b,dirname:f,basename:D,extname:P,normalize:k,isAbsolute:F,relative:O,parse:x,format:v,sep:g,delimiter:h}),A=()=>({async spawn(n,t=[],e){let r=w(e),s=await new Deno.Command(n,{args:t,cwd:e?.cwd,env:e?.env,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,signal:e?.signal}).output();return{success:s.success,code:s.code,stdout:r.stdout==="piped"?s.stdout:new Uint8Array,stderr:r.stderr==="piped"?s.stderr:new Uint8Array}},async exec(n,t=[],e){let r=await this.spawn(n,t,e);if(!r.success){let a=new TextDecoder().decode(r.stderr);throw new p(n,r.code,a)}return new TextDecoder().decode(r.stdout).trim()},async execJson(n,t=[],e){let r=await this.exec(n,t,e);return JSON.parse(r)},spawnChild(n,t=[],e){let r=w(e),s=new Deno.Command(n,{args:t,cwd:e?.cwd,env:e?.env,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,signal:e?.signal}).spawn(),c=(o,l)=>l!=="piped"||!o?Promise.resolve(new Uint8Array):new Response(o).arrayBuffer().then(i=>new Uint8Array(i));return{pid:s.pid,stdin:r.stdin==="piped"?s.stdin:null,stdout:r.stdout==="piped"?s.stdout:null,stderr:r.stderr==="piped"?s.stderr:null,status:s.status.then(o=>({success:o.success,code:o.code,signal:o.signal??void 0})),output:async()=>{let o=r.stdout==="piped"?s.stdout:null,l=r.stderr==="piped"?s.stderr:null,[i,m,u]=await Promise.all([s.status,c(o,r.stdout),c(l,r.stderr)]);return{success:i.success,code:i.code,stdout:m,stderr:u}},kill:o=>{s.kill(o)}}}}),I=()=>({get(n){return Deno.env.get(n)},set(n,t){Deno.env.set(n,t)},delete(n){Deno.env.delete(n)},has(n){return Deno.env.get(n)!==void 0},toObject(){return Deno.env.toObject()}}),W=()=>({exit(n){Deno.exit(n)},setExitCode(n){Deno.exitCode=n},cwd(){return Deno.cwd()},chdir(n){Deno.chdir(n)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},argv:S.argv,argv0:S.argv0,args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable,isTerminal(n){try{switch(n){case"stdin":return Deno.stdin.isTerminal();case"stdout":return Deno.stdout.isTerminal();case"stderr":return Deno.stderr.isTerminal()}}catch{return!1}},setStdinRaw(n){Deno.stdin.setRaw(n)}}),M=()=>{let n=E(),t=T(),e=A(),r=I(),a=W();return{name:"deno",version:Deno.version.deno,capabilities:R,fs:n,path:t,exec:e,env:r,process:a}};export{R as DENO_CAPABILITIES,M as createDenoRuntime};
2
+ import{a as P,b as v,c as x,d as O}from"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{d as D,e as h,f as g,g as f,i as F,j as y,k,n as b}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{b as d,d as p,r as w}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";import S from"node:process";var R={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},E=()=>{let n=t=>({isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:t.mtime,atime:t.atime,birthtime:t.birthtime});return{async readFile(t,e){try{return await Deno.readFile(t,{signal:e?.signal})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async readTextFile(t,e){try{return await Deno.readTextFile(t,{signal:e?.signal})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async writeFile(t,e,r){await Deno.writeFile(t,e,{signal:r?.signal,mode:r?.mode,create:r?.create??!0,append:r?.append??!1})},async writeTextFile(t,e,r){await Deno.writeTextFile(t,e,{signal:r?.signal,mode:r?.mode,create:r?.create??!0,append:r?.append??!1})},async exists(t){try{return await Deno.stat(t),!0}catch(e){if(e instanceof Deno.errors.NotFound)return!1;throw e}},async stat(t){try{let e=await Deno.stat(t);return n(e)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async lstat(t){try{let e=await Deno.lstat(t);return n(e)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async mkdir(t,e){await Deno.mkdir(t,{recursive:e?.recursive??!1,mode:e?.mode})},async ensureDir(t){try{await Deno.mkdir(t,{recursive:!0})}catch(e){if(!(e instanceof Deno.errors.AlreadyExists))throw e}},async remove(t,e){try{await Deno.remove(t,{recursive:e?.recursive??!1})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async*readDir(t){try{for await(let e of Deno.readDir(t))yield{name:e.name,isFile:e.isFile,isDirectory:e.isDirectory,isSymlink:e.isSymlink}}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async copyFile(t,e){await Deno.copyFile(t,e)},async rename(t,e){await Deno.rename(t,e)},async makeTempDir(t){return await Deno.makeTempDir({dir:t?.dir,prefix:t?.prefix,suffix:t?.suffix})},async realPath(t){try{return await Deno.realPath(t)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},watch(t,e){let r=e?.recursive??!0,a=Deno.watchFs(t,{recursive:r}),s=c=>({kind:c.kind,paths:c.paths,flag:c.flag});return{close:()=>a.close(),[Symbol.asyncIterator]:async function*(){for await(let c of a)yield s(c)}}},async*walk(t,e){let r=e?.includeDirs??!0,a=e?.includeFiles??!0,s=e?.exts,c=e?.skip,o=async function*(l){for await(let i of Deno.readDir(l)){let m=y(l,i.name);if(!c?.some(u=>u.test(m))){if(i.isDirectory)r&&(yield{path:m,name:i.name,isFile:!1,isDirectory:!0,isSymlink:i.isSymlink}),yield*o(m);else if(i.isFile||i.isSymlink){if(!a||s&&!s.some(u=>i.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:m,name:i.name,isFile:i.isFile,isDirectory:!1,isSymlink:i.isSymlink}}}}};yield*o(t)},async chmod(t,e){let{chmod:r}=await import("./unstable_chmod-2W47KJY3.js");await r(t,e)}}},T=()=>({join:y,resolve:b,dirname:f,basename:D,extname:P,normalize:k,isAbsolute:F,relative:O,parse:x,format:v,sep:g,delimiter:h}),A=()=>({async spawn(n,t=[],e){let r=w(e),s=await new Deno.Command(n,{args:t,cwd:e?.cwd,env:e?.env,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,signal:e?.signal}).output();return{success:s.success,code:s.code,stdout:r.stdout==="piped"?s.stdout:new Uint8Array,stderr:r.stderr==="piped"?s.stderr:new Uint8Array}},async exec(n,t=[],e){let r=await this.spawn(n,t,e);if(!r.success){let a=new TextDecoder().decode(r.stderr);throw new p(n,r.code,a)}return new TextDecoder().decode(r.stdout).trim()},async execJson(n,t=[],e){let r=await this.exec(n,t,e);return JSON.parse(r)},spawnChild(n,t=[],e){let r=w(e),s=new Deno.Command(n,{args:t,cwd:e?.cwd,env:e?.env,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,signal:e?.signal}).spawn(),c=(o,l)=>l!=="piped"||!o?Promise.resolve(new Uint8Array):new Response(o).arrayBuffer().then(i=>new Uint8Array(i));return{pid:s.pid,stdin:r.stdin==="piped"?s.stdin:null,stdout:r.stdout==="piped"?s.stdout:null,stderr:r.stderr==="piped"?s.stderr:null,status:s.status.then(o=>({success:o.success,code:o.code,signal:o.signal??void 0})),output:async()=>{let o=r.stdout==="piped"?s.stdout:null,l=r.stderr==="piped"?s.stderr:null,[i,m,u]=await Promise.all([s.status,c(o,r.stdout),c(l,r.stderr)]);return{success:i.success,code:i.code,stdout:m,stderr:u}},kill:o=>{s.kill(o)}}}}),I=()=>({get(n){return Deno.env.get(n)},set(n,t){Deno.env.set(n,t)},delete(n){Deno.env.delete(n)},has(n){return Deno.env.get(n)!==void 0},toObject(){return Deno.env.toObject()}}),W=()=>({exit(n){Deno.exit(n)},setExitCode(n){Deno.exitCode=n},cwd(){return Deno.cwd()},chdir(n){Deno.chdir(n)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},argv:S.argv,argv0:S.argv0,args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable,isTerminal(n){try{switch(n){case"stdin":return Deno.stdin.isTerminal();case"stdout":return Deno.stdout.isTerminal();case"stderr":return Deno.stderr.isTerminal()}}catch{return!1}},setStdinRaw(n){Deno.stdin.setRaw(n)}}),M=()=>{let n=E(),t=T(),e=A(),r=I(),a=W();return{name:"deno",version:Deno.version.deno,capabilities:R,fs:n,path:t,exec:e,env:r,process:a}};export{R as DENO_CAPABILITIES,M as createDenoRuntime};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as a,h as l,k as i}from"./chunk-MBG7SPPO.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-ZEFYMWGZ.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var h=["trace","debug","info","warn","error","fatal"],k=async m=>{let{flags:e}=t(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"no-hmr",type:"boolean",description:"Disable HMR"},{name:"log-level",type:"string",default:"info",description:"Log level"},{name:"open",short:"o",type:"boolean",description:"Open browser"}]),r=a({renderer:i.ansi(),sink:l.stdout()});r.writeln(n(`
2
+ import{f as a,h as l,k as i}from"./chunk-ZC4F4MYU.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-MJ2IPSAE.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var h=["trace","debug","info","warn","error","fatal"],k=async m=>{let{flags:e}=t(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"no-hmr",type:"boolean",description:"Disable HMR"},{name:"log-level",type:"string",default:"info",description:"Log level"},{name:"open",short:"o",type:"boolean",description:"Open browser"}]),r=a({renderer:i.ansi(),sink:l.stdout()});r.writeln(n(`
3
3
  \u26A1 Starting development server...
4
- `));let p=e.port,s=e["log-level"]??"info",c=!e["no-hmr"],g=e.open??!1,d=h.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:u},{reactRenderer:L,reactHtmlShellBuilder:f},{reactPlugin:v},{createTailwindPlugin:b}]=await Promise.all([import("./main-BUEG2IMJ.js"),import("./mod-2PIV6QCE.js"),import("./mod-XEK7FROU.js"),import("./mod-RO7WP3SA.js")]);return await r.close(),await u({mode:"dev",port:p,logLevel:d,hmr:c,open:g,renderer:L,htmlShell:f,frameworkPlugin:v,cssPlugin:b({globalCssPath:"src/app/styles/global.css"})}),o(void 0)};export{k as main};
4
+ `));let p=e.port,s=e["log-level"]??"info",c=!e["no-hmr"],g=e.open??!1,d=h.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:u},{reactRenderer:L,reactHtmlShellBuilder:f},{reactPlugin:v},{createTailwindPlugin:b}]=await Promise.all([import("./main-PTEEAWXX.js"),import("./mod-QWYXFGRG.js"),import("./mod-RMDGRCBK.js"),import("./mod-BKHQAEVL.js")]);return await r.close(),await u({mode:"dev",port:p,logLevel:d,hmr:c,open:g,renderer:L,htmlShell:f,frameworkPlugin:v,cssPlugin:b({globalCssPath:"src/app/styles/global.css"})}),o(void 0)};export{k as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as x,d as D}from"./chunk-FODF5MI2.js";import{m as k}from"./chunk-OYNFK77H.js";import{c as S,e as g,g as C,h as y,i as E}from"./chunk-PIV56NIC.js";import{c as $}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as h}from"./chunk-MBG7SPPO.js";import{c as m,d as o,f as a,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var G=async U=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),p=C(U);if(!p.ok)return e.writeln(a(p.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,p.spec)}catch(s){let c=s instanceof Error?s.message:String(s);return e.writeln(a(c)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let s=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(s)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to IDLE.")),await e.close(),n({exitCode:1})}}let r=k(t,"done");if(await y(i,r),r.spec!==null&&await E(i,r.spec,r),r.spec!==null&&(await x(i,r.spec,"completed"),await D(i,r.spec,"completed")),e.writeln(u("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",m(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let s=t.decisions.filter(c=>c.promoted);s.length>0&&e.writeln(o(` Promoted to rules: ${s.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(void 0)};export{G as main};
2
+ import{a as x,d as D}from"./chunk-PLMZ3FYS.js";import{n as k}from"./chunk-ORAOSL2W.js";import{c as S,e as g,g as C,h as y,i as E}from"./chunk-YW377352.js";import{c as $}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as h}from"./chunk-ZC4F4MYU.js";import{c as m,d as o,f as a,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var G=async U=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),p=C(U);if(!p.ok)return e.writeln(a(p.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,p.spec)}catch(s){let c=s instanceof Error?s.message:String(s);return e.writeln(a(c)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let s=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(s)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to IDLE.")),await e.close(),n({exitCode:1})}}let r=k(t,"done");if(await y(i,r),r.spec!==null&&await E(i,r.spec,r),r.spec!==null&&(await x(i,r.spec,"completed"),await D(i,r.spec,"completed")),e.writeln(u("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",m(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let s=t.decisions.filter(c=>c.promoted);s.length>0&&e.writeln(o(` Promoted to rules: ${s.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(void 0)};export{G as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h}from"./chunk-CXTPYPO4.js";import"./chunk-NBA6EFWU.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as DEFAULT_EXCLUDES,g as applyMutations,e as isBinaryBytes,d as loadBytes,c as loadContent,f as matchesAnyPattern,b as walkSourceFiles,h as writeMutations};
2
+ import{a,b,c,d,e,f,g,h}from"./chunk-5PH7JRXR.js";import"./chunk-NBA6EFWU.js";import"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as DEFAULT_EXCLUDES,g as applyMutations,e as isBinaryBytes,d as loadBytes,c as loadContent,f as matchesAnyPattern,b as walkSourceFiles,h as writeMutations};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as x,d as g}from"./chunk-OYNFK77H.js";import{d as E,h as p}from"./chunk-PIV56NIC.js";import{c}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{f,h as u,k as h}from"./chunk-MBG7SPPO.js";import{c as o,d as m,f as n,g as l}from"./chunk-YVN2NZL4.js";import{a as i,b as r}from"./chunk-FFWPJP7A.js";import{i as w}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var b=async d=>{let e=f({renderer:h.ansi(),sink:u.stdout()}),a=w.process.cwd(),S=d!==void 0&&d.some(s=>s==="--exit"),t;try{t=await E(a)}catch(s){let y=s instanceof Error?s.message:String(s);return e.writeln(n(y)),await e.close(),r({exitCode:1})}if(S){if(t.phase!=="FREE")return e.writeln(n(`Cannot exit free mode in phase: ${t.phase}`)),e.writeln(m("Only FREE phase can transition back to IDLE.")),await e.close(),r({exitCode:1});let s=g(t);return await p(a,s),e.writeln(l("\u2714")," Exited free mode. Back to IDLE."),e.writeln(""),e.writeln("Start a spec with: ",o(`${c('spec new "..."')}`)),await e.close(),i(void 0)}if(t.phase!=="IDLE")return e.writeln(n(`Cannot enter free mode in phase: ${t.phase}`)),e.writeln(m("Only IDLE phase can transition to FREE.")),await e.close(),r({exitCode:1});let k=x(t);return await p(a,k),e.writeln(l("\u2714")," Free mode active \u2014 no enforcement."),e.writeln(""),e.writeln("Exit free mode with: ",o(`${c("free --exit")}`)),await e.close(),i(void 0)};export{b as main};
2
+ import{c as x,d as g}from"./chunk-ORAOSL2W.js";import{d as E,h as p}from"./chunk-YW377352.js";import{c}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f,h as u,k as h}from"./chunk-ZC4F4MYU.js";import{c as o,d as m,f as n,g as l}from"./chunk-YVN2NZL4.js";import{a as i,b as r}from"./chunk-FFWPJP7A.js";import{i as w}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var b=async d=>{let e=f({renderer:h.ansi(),sink:u.stdout()}),a=w.process.cwd(),S=d!==void 0&&d.some(s=>s==="--exit"),t;try{t=await E(a)}catch(s){let y=s instanceof Error?s.message:String(s);return e.writeln(n(y)),await e.close(),r({exitCode:1})}if(S){if(t.phase!=="FREE")return e.writeln(n(`Cannot exit free mode in phase: ${t.phase}`)),e.writeln(m("Only FREE phase can transition back to IDLE.")),await e.close(),r({exitCode:1});let s=g(t);return await p(a,s),e.writeln(l("\u2714")," Exited free mode. Back to IDLE."),e.writeln(""),e.writeln("Start a spec with: ",o(`${c('spec new "..."')}`)),await e.close(),i(void 0)}if(t.phase!=="IDLE")return e.writeln(n(`Cannot enter free mode in phase: ${t.phase}`)),e.writeln(m("Only IDLE phase can transition to FREE.")),await e.close(),r({exitCode:1});let k=x(t);return await p(a,k),e.writeln(l("\u2714")," Free mode active \u2014 no enforcement."),e.writeln(""),e.writeln("Exit free mode with: ",o(`${c("free --exit")}`)),await e.close(),i(void 0)};export{b as main};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-L7RS6MQ5.js";import{l as t}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:l,output:h}=a(),n=()=>{t.info(l,`eser codebase gh \u2014 GitHub operations
2
+ import{a}from"./chunk-LGNGLAV3.js";import{o as t}from"./chunk-ZER2RYWJ.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:l,output:h}=a(),n=()=>{t.info(l,`eser codebase gh \u2014 GitHub operations
3
3
  `),console.log("Subcommands:"),console.log(" contributors Update contributor list in README.md"),console.log(" release-notes Sync CHANGELOG to GitHub Releases"),console.log(" release-tag Create and push release git tags"),console.log(`
4
- Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-EIM2PLGS.js")).main(s);case"release-notes":return await(await import("./release-notes-FSDHH2Y2.js")).main(s);case"release-tag":return await(await import("./release-tag-IOH5HGAA.js")).main(s);default:return t.error(l,`Unknown gh subcommand: ${e}`),n(),o.fail({exitCode:1})}};export{b as main};
4
+ Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-NT5WW72V.js")).main(s);case"release-notes":return await(await import("./release-notes-MZFILXWE.js")).main(s);case"release-tag":return await(await import("./release-tag-LGZEFMKJ.js")).main(s);default:return t.error(l,`Unknown gh subcommand: ${e}`),n(),o.fail({exitCode:1})}};export{b as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import"./chunk-SOSF762G.js";import{a as R}from"./chunk-LFNUSULJ.js";import{a as w,c as x}from"./chunk-L7RS6MQ5.js";import{l as c}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{e as l}from"./chunk-5MVJUALI.js";import"./chunk-PWLF3WXM.js";import"./chunk-SH4H7OLV.js";import"./chunk-ZEFYMWGZ.js";import{a as b}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import{n as f}from"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:d,output:K}=w(),m="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",E=async()=>{let t=await l.exec`gh repo view --json owner,name`.text(),e=JSON.parse(t);return{owner:e.owner.login,name:e.name}},P=async(t,e)=>{let o=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(o).filter(n=>!n.login.includes("[bot]"))},v=(t,e=8)=>{if(t.length===0)return`${m}
2
+ import"./chunk-SOSF762G.js";import{a as R}from"./chunk-LFNUSULJ.js";import{a as w,c as x}from"./chunk-LGNGLAV3.js";import{o as c}from"./chunk-ZER2RYWJ.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as l}from"./chunk-BLXGL5MA.js";import"./chunk-PWLF3WXM.js";import"./chunk-G5VGZMKA.js";import"./chunk-MJ2IPSAE.js";import{a as b}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{n as f}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:d,output:K}=w(),m="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",E=async()=>{let t=await l.exec`gh repo view --json owner,name`.text(),e=JSON.parse(t);return{owner:e.owner.login,name:e.name}},P=async(t,e)=>{let o=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(o).filter(n=>!n.login.includes("[bot]"))},v=(t,e=8)=>{if(t.length===0)return`${m}
3
3
  ${u}`;let o=[];for(let r=0;r<t.length;r+=e){let i=t.slice(r,r+e).map(s=>` <td align="center"><a href="${s.html_url}"><img src="${s.avatar_url}?s=80" width="80" /><br /><sub>${s.login}</sub></a></td>`);o.push(` <tr>
4
4
  ${i.join(`
5
5
  `)}
@@ -1,12 +1,12 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as P,h as R,k as F}from"./chunk-MBG7SPPO.js";import{b as t,c as E,d as s,f as o,g as x,k as v}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as T}from"./chunk-ZEFYMWGZ.js";import"./chunk-MG65QJY6.js";import{a as A,b as i,f as $}from"./chunk-FFWPJP7A.js";import{i as b}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var S=["minimal","blog","dashboard","docs"],V=async O=>{let{positional:N,flags:m}=T(O??[],[{name:"template",short:"t",type:"string",default:"minimal",description:"Project template"},{name:"force",short:"f",type:"boolean",description:"Overwrite"},{name:"no-git",type:"boolean",description:"Skip git"},{name:"no-install",type:"boolean",description:"Skip install"}]),r=N[0]??"my-laroux-app",l=m.template,j=m.force,L=m["no-git"],n=F.ansi(),e=P({renderer:n,sink:R.stdout()});if(!S.includes(l))return await e.close(),i({message:`${n.render([o(`
2
+ import{f as P,h as R,k as F}from"./chunk-ZC4F4MYU.js";import{b as t,c as E,d as s,f as o,g as x,k as v}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as T}from"./chunk-MJ2IPSAE.js";import"./chunk-MG65QJY6.js";import{a as A,b as i,f as $}from"./chunk-FFWPJP7A.js";import{i as b}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var S=["minimal","blog","dashboard","docs"],V=async O=>{let{positional:N,flags:m}=T(O??[],[{name:"template",short:"t",type:"string",default:"minimal",description:"Project template"},{name:"force",short:"f",type:"boolean",description:"Overwrite"},{name:"no-git",type:"boolean",description:"Skip git"},{name:"no-install",type:"boolean",description:"Skip install"}]),r=N[0]??"my-laroux-app",l=m.template,j=m.force,L=m["no-git"],n=F.ansi(),e=P({renderer:n,sink:R.stdout()});if(!S.includes(l))return await e.close(),i({message:`${n.render([o(`
3
3
  Error: Invalid template "${l}"`)])}
4
4
  Available templates: ${S.join(", ")}`,exitCode:1});e.writeln(v(`
5
5
  \u2728 Creating new laroux.js project in ./${r}
6
6
  `)),e.writeln(s(` Template: ${l}`));let c="eser",p=`laroux-template-${l}`,k="main",d=`${b.process.cwd()}/${r}`;try{await b.fs.mkdir(d,{recursive:!0})}catch{return await e.close(),i({message:n.render([o(`
7
7
  Could not create directory: ${d}`)]),exitCode:1})}e.writeln(s(` Fetching from gh:${c}/${p}...
8
- `));try{let a=await import("./registry-fetcher-H63ZWZHU.js"),u=await import("./recipe-applier-6SGY2W3A.js"),f=await $(()=>a.fetchRecipeFromRepo(c,p,k,"recipe.json"),()=>{});if(f._tag==="Ok"&&f.value!==void 0){let g=`https://raw.githubusercontent.com/${c}/${p}/${k}`,w=await u.applyRecipe(f.value,{cwd:d,registryUrl:g,force:j,variables:{project_name:r}});e.writeln(x(`
9
- \u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-Q6SI6S6S.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:j,skipPostInstall:L,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
8
+ `));try{let a=await import("./registry-fetcher-SPENFEOH.js"),u=await import("./recipe-applier-TTZEZGSC.js"),f=await $(()=>a.fetchRecipeFromRepo(c,p,k,"recipe.json"),()=>{});if(f._tag==="Ok"&&f.value!==void 0){let g=`https://raw.githubusercontent.com/${c}/${p}/${k}`,w=await u.applyRecipe(f.value,{cwd:d,registryUrl:g,force:j,variables:{project_name:r}});e.writeln(x(`
9
+ \u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-MVH3RFS3.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:j,skipPostInstall:L,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
10
10
  Scaffolding failed: ${y.error.message}`)]),exitCode:1});let C=y.value;if(e.writeln(x(`
11
11
  \u{1F389} Project created successfully!`)),Object.keys(C.variables).length>0){e.writeln(t(`
12
12
  Variables applied:`));for(let[h,_]of Object.entries(C.variables))e.writeln(t(" "),s(h),t(`: ${_}`))}}}catch(a){let u=a instanceof Error?a.message:String(a);return await e.close(),i({message:n.render([o(`
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as oe,b as ie}from"./chunk-RVJZFWN7.js";import{d as ne}from"./chunk-MBCPGD5L.js";import{d as Y}from"./chunk-FW3ETRQ5.js";import"./chunk-NY4W44PI.js";import{b as P}from"./chunk-2HSGE3TL.js";import{d as se}from"./chunk-3AA3RXKD.js";import{c as Z,d as ee,e as te}from"./chunk-W7OYXLGD.js";import{a as H,b as _,h as q,l as B,n as K,p as U,z as V}from"./chunk-YW377352.js";import{a as Q,c as S,d as X}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as k,b as M,i as I,j as W,k as z,l as J,m as G,n as h,o as r,p as w}from"./chunk-ZER2RYWJ.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-JHEL4OFF.js";import"./chunk-BNQAZLIQ.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-BLXGL5MA.js";import"./chunk-MCWDLVWU.js";import"./chunk-G5VGZMKA.js";import"./chunk-MJ2IPSAE.js";import"./chunk-MG65QJY6.js";import{a as b}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var re=F;var me=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},he=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],ae=async t=>{let e=[];for(let o of he)for(let s of o.paths)if(await me(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},ye=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},Ce=async t=>{let e=[],o=await ce(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},ve=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},$e=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ce(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},le=async t=>{let[e,o,s,d]=await Promise.all([ye(t),Ce(t),ve(t),$e(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Ge=async t=>{let e=f.process.cwd(),o=oe(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=ie(t),y=de(d,"--concerns"),g=de(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${S("sync")}\` to regenerate tool files.`),b(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await le(e);D.succeed("Project scanned");for(let n of m.languages)r.step(s,` ${n}`);for(let n of m.frameworks)r.step(s,` ${n}`);for(let n of m.ci)r.step(s,` ${n}`);m.testRunner!==null&&r.step(s,` test runner: ${m.testRunner}`),h(s);let j=w(s,"Detecting coding tools...");j.start();let A=await ae(e),C=ne(),L=C!==null&&!A.includes(C)?[C]:[],v=[...new Set([...L,...A])];j.succeed(`${v.length} coding tool(s) detected`);for(let n of v){let i=n===C?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],i=g.filter(l=>n.includes(l));p=[...new Set([...L,...i])]}else u?p=[...v]:(h(s),p=await be(s,v,C));h(s);let O=w(s,"Detecting AI providers...");O.start();let x=(await re()).filter(n=>n.available).map(n=>n.name);O.succeed(`${x.length} provider(s) detected`),h(s);let T=await P(),c;if(y!==null){let n=T.map(i=>i.id);c=y.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=T.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=k(i)?[]:[...i]}c.length>0?r.success(s,` Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(s);let E=w(s,"Initializing...");E.start(),await U(e);let ue=T.filter(n=>c.includes(n.id));for(let n of ue)await K(e,n);let N=await X();Q(N);let $={..._(c,p,x,m),command:N};await B(e,$);let R=H();if(await q(e,R),E.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let i=await te(e,p,$);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(z(s,`Done. ${p.length} tool(s), ${x.length} provider(s), ${c.length} concern(s).`),o==="agent"){let i=(await P()).filter(ge=>c.includes(ge.id)),l=await Z(e),pe=ee($?.tools??[]),fe=Y(R,i,l,$,void 0,void 0,void 0,pe);await se(fe,"json")}else J(s),G(s,`Start a spec with: ${S('spec new "..."')}`);return b(void 0)},Te=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],be=async(t,e,o)=>{let s=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),y=await I(t,{message:s,options:Te.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(k(y))return[...e];let g=[...y];return o!==null&&!g.includes(o)&&g.unshift(o),g},de=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{Ge as main};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as j}from"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as A,h as P,k as H}from"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import{b,c as O,d,f as k,g as w,h as y,i as E}from"./chunk-YVN2NZL4.js";import{a as $}from"./chunk-MG65QJY6.js";import{g as r}from"./chunk-FFWPJP7A.js";import{j as e}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var M={precommit:{hookName:"pre-commit",args:""},commitmsg:{hookName:"commit-msg",args:'-- "$1"'},prepush:{hookName:"pre-push",args:""}},C="# @eser managed hook",I=async(i,n)=>{let t=(await e.detectExecutionContext({command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"})).command,o=n.length>0?` ${n}`:"",a=`${t} workflows run -e ${i}${o}`;return["#!/bin/sh",`${C} \u2014 generated by \`eser codebase install\``,"# Do not edit. Re-run `eser codebase install` to update.","",a,""].join(`
2
+ import{b as j}from"./chunk-L2E2H7YT.js";import"./chunk-2XNFZXHY.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as A,h as P,k as H}from"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import{b,c as O,d,f as k,g as w,h as y,i as E}from"./chunk-YVN2NZL4.js";import{a as $}from"./chunk-MG65QJY6.js";import{g as r}from"./chunk-FFWPJP7A.js";import{j as e}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var M={precommit:{hookName:"pre-commit",args:""},commitmsg:{hookName:"commit-msg",args:'-- "$1"'},prepush:{hookName:"pre-push",args:""}},C="# @eser managed hook",I=async(i,n)=>{let t=(await e.detectExecutionContext({command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"})).command,o=n.length>0?` ${n}`:"",a=`${t} workflows run -e ${i}${o}`;return["#!/bin/sh",`${C} \u2014 generated by \`eser codebase install\``,"# Do not edit. Re-run `eser codebase install` to update.","",a,""].join(`
3
3
  `)},S=async()=>{try{let t=(await e.runtime.exec.exec("git",["rev-parse","--git-dir"])).trim();if(t.length>0)return t}catch{}let i=e.runtime.process.cwd(),n=e.runtime.path.join(i,".git");try{if((await e.runtime.fs.stat(n)).isDirectory)return n}catch{}return null},G=i=>{let n=i.workflows;if(!Array.isArray(n))return[];let s=new Set;for(let t of n)if(Array.isArray(t.on))for(let o of t.on)typeof o=="string"&&s.add(o);return[...s]},T=H.ansi(),U=async i=>{let n=$(i??[],{boolean:["force","dry-run","help"],alias:{h:"help",f:"force",n:"dry-run"}});if(n.help)return console.log("eser codebase install \u2014 Install git hooks from .eser/manifest.yml"),console.log(""),console.log("Flags:"),console.log(" --force, -f Overwrite non-managed hooks"),console.log(" --dry-run, -n Show what would happen without writing"),console.log(" --help, -h Show this help"),r.ok(void 0);let s=A({renderer:T,sink:P.stdout()}),t=n.force,o=n["dry-run"],a=await S();if(a===null)return s.writeln(k("Error: not inside a git repository")),await s.close(),r.fail({exitCode:1});let p=e.runtime.path.join(a,"hooks"),g=e.runtime.process.cwd(),l=await j(g);if(l===null)return s.writeln(k("Error: no .eser/manifest.yml found in current directory")),await s.close(),r.fail({exitCode:1});let c=G(l);if(c.length===0)return s.writeln(y("No workflow events found \u2014 nothing to install.")),await s.close(),r.ok(void 0);o||await e.runtime.fs.ensureDir(p);let f=0,v=0,u=0;for(let N of c){let F=M[N];if(F===void 0){s.writeln(d(` skip ${N} (unknown event, no hook mapping)`));continue}let{hookName:m,args:K}=F,D=e.runtime.path.join(p,m),_=await I(N,K),R=!1,x=!1;try{let q=await e.runtime.fs.readTextFile(D);R=!0,x=q.includes(C)}catch{}if(o){R?x?s.writeln(E(` would update ${m} (managed)`)):t?s.writeln(y(` would overwrite ${m} (--force)`)):s.writeln(y(` would skip ${m} (user hook; use --force to overwrite)`)):s.writeln(E(` would create ${m}`));continue}if(R&&!x&&!t){s.writeln(y(` skip ${m} \u2014 user hook exists (use --force to overwrite)`)),v++;continue}await e.runtime.fs.writeTextFile(D,_);try{await e.runtime.fs.chmod(D,493)}catch{}R&&x?(s.writeln(w(` updated ${m}`)),u++):(s.writeln(w(` installed ${m}`)),f++)}s.writeln();let h=[];return f>0&&h.push(`${f} installed`),u>0&&h.push(`${u} updated`),v>0&&h.push(`${v} skipped`),o?s.writeln(d("(dry run \u2014 no changes made)")):h.length>0?s.writeln(w(`Done: ${h.join(", ")}.`)):s.writeln(d("Nothing to do.")),await s.close(),r.ok(void 0)},W=async i=>{if($(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase uninstall \u2014 Remove managed git hooks"),r.ok(void 0);let s=A({renderer:T,sink:P.stdout()}),t=await S();if(t===null)return s.writeln(k("Error: not inside a git repository")),await s.close(),r.fail({exitCode:1});let o=e.runtime.path.join(t,"hooks"),a=0,p=Object.values(M).map(l=>l.hookName),g=[...new Set(p)];for(let l of g){let c=e.runtime.path.join(o,l);try{(await e.runtime.fs.readTextFile(c)).includes(C)&&(await e.runtime.fs.remove(c),s.writeln(w(` removed ${l}`)),a++)}catch{}}return s.writeln(),a>0?s.writeln(w(`Done: ${a} hook(s) removed.`)):s.writeln(d("No managed hooks found.")),await s.close(),r.ok(void 0)},X=async i=>{if($(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase status \u2014 Show git hook installation status"),r.ok(void 0);let s=A({renderer:T,sink:P.stdout()}),t=await S();if(t===null)return s.writeln(k("Error: not inside a git repository")),await s.close(),r.fail({exitCode:1});let o=e.runtime.path.join(t,"hooks"),a=e.runtime.process.cwd(),p=await j(a);if(p===null)return s.writeln(k("Error: no .eser/manifest.yml found in current directory")),await s.close(),r.fail({exitCode:1});let g=G(p);if(g.length===0)return s.writeln(d("No workflow events found in manifest.")),await s.close(),r.ok(void 0);s.writeln(O("Git hook status:")),s.writeln();for(let l of g){let c=M[l];if(c===void 0){s.writeln(b(" "),d(l.padEnd(14)),b(" "),d("(no hook mapping)"));continue}let{hookName:f}=c,v=e.runtime.path.join(o,f),u;try{(await e.runtime.fs.readTextFile(v)).includes(C)?u=w("managed (@eser)"):u=y("user hook")}catch{u=d("not installed")}s.writeln(b(` ${f.padEnd(14)} `),u)}return s.writeln(),await s.close(),r.ok(void 0)};export{U as main,X as statusMain,W as uninstallMain};
@@ -0,0 +1,12 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{d as F}from"./chunk-FW3ETRQ5.js";import"./chunk-NY4W44PI.js";import"./chunk-2HSGE3TL.js";import{c as A,d as _}from"./chunk-W7OYXLGD.js";import{c as g,d as D,e as b,k as E,o as $,s as x,t as N,z as P}from"./chunk-YW377352.js";import{c as m}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{a as l}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var L=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),I=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),S=e=>{let s=e.trim();if(!s.startsWith("git"))return!0;let t=s.slice(3).trim();if(t.length===0)return!0;let i=t.split(/\s+/),r=i[0]??"";if(L.has(r))return!0;let n=I.get(r);if(n!==void 0){let o=i[1]??"";if(n.has(o))return!0}return!1};var G=e=>{let s=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let r of s){let n;for(;(n=r.exec(e))!==null;){let o=n[1]??"";if(o.includes("git")&&!S(o))return!0}}let t=e.split(/\s*\|\s*/);for(let r of t){let n=r.trim();if(n.startsWith("git")&&!S(n))return!0}let i=e.matchAll(/\bgit\s+([\w-]+)/g);for(let r of i){let n=r[1]??"";if(!L.has(n)&&!I.has(n))return!0;if(I.has(n)){let o=r.index??0,p=e.slice(o);if(!S(p.split(/[;&|$)`]/)[0]??""))return!0}}return!1};var R=async()=>{let e=a.process.stdin.getReader(),s=[];try{for(;;){let{done:n,value:o}=await e.read();if(n||o===void 0)break;s.push(o)}}finally{e.releaseLock()}let t=0,i=new Uint8Array(s.reduce((n,o)=>n+o.length,0));for(let n of s)i.set(n,t),t+=n.length;let r=new TextDecoder().decode(i);try{return JSON.parse(r)}catch{return{}}},M=async e=>{let s=new TextEncoder,t=a.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},ee=async e=>{switch(e?.[0]){case"pre-tool-use":return await B();case"stop":return await Y();case"post-file-write":return await J();case"post-bash":return await K();case"session-start":return await j();default:return l(void 0)}},v=async e=>{await M({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${e}`}})},W=(e,s)=>{if(s||!e.includes("git"))return null;let t=e.split(/\s*(?:&&|;)\s*/);for(let i of t){let r=i.trim();if(r.startsWith("git")&&!S(r))return"Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."}return G(e)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},B=async()=>{let e=await R(),s=e.tool_name??"unknown",t=e.tool_input??{},i=e.cwd??a.process.cwd(),r=await E(i),n=a.env.get("NOSKILLS_SESSION")??null;if(n!==null){let c=await x(i,n);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(t.command??"").trim(),d=r?.allowGit??!1;if(!d&&u.includes("git")){let h=W(u,d);if(h!==null)return await v(h),l(void 0)}}return l(void 0)}}let o={};if(n!==null){let c=await x(i,n);if(c!==null&&c.mode==="spec"&&c.phase!==null)o={phase:c.phase};else if(c!==null&&c.spec!==null)try{o=await b(i,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await N(i);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,FREE:0,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let U of c){let C=U.phase??"IDLE",T=u[C]??0;T>h&&(h=T,d=C)}o={phase:d};let y=new TextEncoder,O=a.process.stderr.getWriter();await O.write(y.encode(`noskills: WARNING \u2014 ${c.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
3
+ `)),O.releaseLock()}else try{o=await D(i)}catch{return l(void 0)}}if(s==="Bash"){let c=(t.command??"").trim(),u=r?.allowGit??!1,d=W(c,u);return d!==null?(await v(d),l(void 0)):l(void 0)}let p=["Write","Edit","MultiEdit"];if(!p.includes(s))return l(void 0);let w=t.file_path??t.path??"";if(w.includes(".eser/")||w.includes(".claude/"))return l(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING"||f==="IDLE"||f==="FREE"||f==="COMPLETED"||f==="UNKNOWN"){if(f==="EXECUTING"&&p.includes(s)){let c=`${i}/${g.stateDir}/executor-warned.flag`;try{await a.fs.readTextFile(c)}catch{try{await a.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0}),await a.fs.writeTextFile(c,new Date().toISOString());let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
4
+ `)),d.releaseLock()}catch{}}}return l(void 0)}let k={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await v(k[f]??`Run \`${m("next")}\` first.`),l(void 0)},Y=async()=>{let e=await R();if(e.stop_hook_active===!0)return l(void 0);let s=e.cwd??a.process.cwd(),t;try{let u=await a.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(u)}catch{return l(void 0)}if(t.phase!=="EXECUTING")return l(void 0);let i=t.execution??{},r=`${s}/${g.stateDir}/files-changed.jsonl`,n=[];try{let d=(await a.fs.readTextFile(r)).trim().split(`
5
+ `).filter(Boolean);n=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let o=[],p="no changes";try{let{execSync:u}=await import("node:child_process");o=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
6
+ `).filter(Boolean);let y=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
7
+ `);p=y[y.length-1]??"no changes"}catch{}let w=[...new Set([...n,...o])],f=(i.iteration??0)+1,k=`${s}/${g.stateDir}/iterations`;try{await a.fs.mkdir(k,{recursive:!0}),await a.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:w,gitStat:p.trim(),timestamp:new Date().toISOString()},null,2)+`
8
+ `)}catch{}let c=15;try{let u=await E(s);u!==null&&(c=u.maxIterationsBeforeRestart)}catch{}t.execution={...i,iteration:f,modifiedFiles:w,lastProgress:p.trim()||i.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await a.fs.writeTextFile(`${s}/${g.stateFile}`,JSON.stringify(t,null,2)+`
9
+ `)}catch{}try{await a.fs.writeTextFile(r,"")}catch{}try{await a.fs.remove(`${s}/${g.stateDir}/executor-warned.flag`)}catch{}if(f>=c){let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${c}). Consider starting a fresh conversation.
10
+ `)),d.releaseLock()}return l(void 0)},J=async()=>{let e=await R(),s=e.tool_input??{},t=s.file_path??s.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return l(void 0);let i=e.cwd??a.process.cwd(),r=`${i}/${g.stateDir}/files-changed.jsonl`,n=JSON.stringify({file:t,tool:e.tool_name,ts:new Date().toISOString()});try{await a.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let o="";try{o=await a.fs.readTextFile(r)}catch{}await a.fs.writeTextFile(r,o+n+`
11
+ `)}catch{}return l(void 0)},K=async()=>{let e=await R(),t=(e.tool_input??{}).command??"";if(!t.includes("noskills"))return l(void 0);let i=e.cwd??a.process.cwd(),r=`${i}/${g.stateDir}/noskills-calls.jsonl`,n=JSON.stringify({command:t,ts:new Date().toISOString()});try{await a.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let o="";try{o=await a.fs.readTextFile(r)}catch{}await a.fs.writeTextFile(r,o+n+`
12
+ `)}catch{}return l(void 0)},j=async()=>{let e=a.process.cwd();if(!await P(e))return l(void 0);let s=await D(e),t=await E(e),r=(await $(e)).filter(w=>t!==null&&t.concerns.includes(w.id)),n=await A(e),o=_(t?.tools??[]),p=F(s,r,n,t,void 0,void 0,void 0,o);return await M(p),l(void 0)};export{ee as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-A2IW6BXT.js";import"./chunk-BJLUDX4R.js";import"./chunk-J7YTWK67.js";import"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as KiroModel,b as kiroFactory};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as h,b as u,c as k}from"./chunk-H7U2VQCK.js";import"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-MBG7SPPO.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
2
+ import{a as h,b as u,c as k}from"./chunk-Y3XXSUFP.js";import"./chunk-L2E2H7YT.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-ZC4F4MYU.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
3
3
  `),console.log("Options:"),console.log(" --config <path> Config directory (default: .)"),console.log(" -h, --help Show this help"),i(void 0);let o=m({renderer:w.ansi(),sink:c.stdout()}),A=d.config??".",r=await u(A),n=h();if(n.register(k),p?.tools!==void 0&&n.registerAll(p.tools),r!==null&&r.workflows.length>0){o.writeln(a("Workflows:"));for(let s of r.workflows){let x=s.on.length>0?s.on.join(", "):"(no events)",f=s.steps.length,C=f===1?"step":"steps";o.writeln(t(` ${s.id.padEnd(20)} `),e(x.padEnd(25)),t(` ${f} ${C}`))}}else o.writeln(e("No workflows defined."));o.writeln();let l=n.getAll();if(l.length>0){o.writeln(a(`Registered tools (${l.length}):`));for(let s of l)o.writeln(t(` ${s.name.padEnd(28)} `),e(s.description))}else o.writeln(e("No tools registered."));return await o.close(),i(void 0)};export{R as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as R,d as h}from"./chunk-P2MUEKFT.js";import{k as S}from"./chunk-GKOMIH2B.js";import{f as m,h as f,k as y}from"./chunk-MBG7SPPO.js";import{c as p,d as l,k as d}from"./chunk-YVN2NZL4.js";import{a as u}from"./chunk-MG65QJY6.js";import{a as n,b as o,c as g}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var w=["project","structure","utility"],C={project:"PROJECTS",structure:"STRUCTURES",utility:"UTILITIES"},k=t=>R(async r=>{try{let s=await S(t.registrySource,{local:t.local}),e=[...s.recipes];if(t.language!==void 0&&(e=e.filter(i=>i.language===t.language)),t.scale!==void 0&&(e=e.filter(i=>i.scale===t.scale)),t.tag!==void 0&&(e=e.filter(i=>i.tags!==void 0&&i.tags.includes(t.tag))),e.length===0)return r.out.writeln("No recipes found matching your filters."),r.out.writeln("Run ",l("`eser kit list`")," without filters to see all recipes."),n({manifest:s,recipes:e});r.out.writeln(p(`${s.name} \u2014 ${s.description}`)),r.out.writeln();for(let i of w){let c=e.filter(a=>a.scale===i);if(c.length!==0){r.out.writeln(d(C[i]));for(let a of c)r.out.writeln(` ${a.name.padEnd(20)} ${a.description} `,l(`[${a.language}]`));r.out.writeln()}}return n({manifest:s,recipes:e})}catch(s){let e=s instanceof Error?s.message:String(s);return o({_tag:"RegistryError",message:e})}});var $=async t=>{let r=u(t??[],{string:["registry","language","scale","tag"],boolean:["local"]}),s=m({renderer:y.ansi(),sink:f.stdout()}),e=await h(k({registrySource:r.registry,language:r.language,scale:r.scale,tag:r.tag,local:r.local===!0}),{out:s});return await s.close(),g(e)?n(void 0):o({exitCode:1})};export{$ as main};
2
+ import{a as R,d as h}from"./chunk-P2MUEKFT.js";import{k as S}from"./chunk-TEOMM3RD.js";import{f as m,h as f,k as y}from"./chunk-ZC4F4MYU.js";import{c as p,d as l,k as d}from"./chunk-YVN2NZL4.js";import{a as u}from"./chunk-MG65QJY6.js";import{a as n,b as o,c as g}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var w=["project","structure","utility"],C={project:"PROJECTS",structure:"STRUCTURES",utility:"UTILITIES"},k=t=>R(async r=>{try{let s=await S(t.registrySource,{local:t.local}),e=[...s.recipes];if(t.language!==void 0&&(e=e.filter(i=>i.language===t.language)),t.scale!==void 0&&(e=e.filter(i=>i.scale===t.scale)),t.tag!==void 0&&(e=e.filter(i=>i.tags!==void 0&&i.tags.includes(t.tag))),e.length===0)return r.out.writeln("No recipes found matching your filters."),r.out.writeln("Run ",l("`eser kit list`")," without filters to see all recipes."),n({manifest:s,recipes:e});r.out.writeln(p(`${s.name} \u2014 ${s.description}`)),r.out.writeln();for(let i of w){let c=e.filter(a=>a.scale===i);if(c.length!==0){r.out.writeln(d(C[i]));for(let a of c)r.out.writeln(` ${a.name.padEnd(20)} ${a.description} `,l(`[${a.language}]`));r.out.writeln()}}return n({manifest:s,recipes:e})}catch(s){let e=s instanceof Error?s.message:String(s);return o({_tag:"RegistryError",message:e})}});var $=async t=>{let r=u(t??[],{string:["registry","language","scale","tag"],boolean:["local"]}),s=m({renderer:y.ansi(),sink:f.stdout()}),e=await h(k({registrySource:r.registry,language:r.language,scale:r.scale,tag:r.tag,local:r.local===!0}),{out:s});return await s.close(),g(e)?n(void 0):o({exitCode:1})};export{$ as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as p}from"./chunk-XOSAN6PX.js";import{f as o,h as m,k as d}from"./chunk-MBG7SPPO.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
2
+ import{a as p}from"./chunk-JHEL4OFF.js";import{f as o,h as m,k as d}from"./chunk-ZC4F4MYU.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-SF6FT44C.js";import"./chunk-GTHXGAMQ.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as loadConfig};
2
+ import{a}from"./chunk-OWV223WQ.js";import"./chunk-GTHXGAMQ.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as loadConfig};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as i}from"./chunk-R2W7BL7V.js";import"./chunk-5WJ6AUNY.js";var w=async a=>{let c=(await import("node:fs")).readFileSync(a),d=await WebAssembly.compile(c),u=s=>{let r=JSON.stringify(s),t=new TextEncoder().encode(r),e=new i({stdin:t}),l=new WebAssembly.Instance(d,{wasi_snapshot_preview1:e.wasiImport});e.start(l);let o=e.getStdout().trim();return o.length===0?{ok:!1,error:"WASM module produced no output"}:JSON.parse(o)},n=(s,r)=>{let t={fn:s};r!==void 0&&(t.args=r);let e=u(t);if(!e.ok)throw new Error(`eser-ajan WASM call "${s}" failed: ${e.error??"unknown error"}`);return e.result??""};return{symbols:{EserAjanVersion:()=>n("version"),EserAjanInit:()=>(n("init"),0),EserAjanShutdown:()=>{n("shutdown")},EserAjanFree:s=>{},EserAjanConfigLoad:s=>n("configLoad",{path:s}),EserAjanDIResolve:s=>n("diResolve",{name:s})},close:()=>{}}};export{w as loadCommandWasm};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as i}from"./chunk-R2W7BL7V.js";import"./chunk-5WJ6AUNY.js";var d=async _=>{let m=(await import("node:fs")).readFileSync(_),c=await WebAssembly.compile(m),a=new i,t=new WebAssembly.Instance(c,{wasi_snapshot_preview1:a.wasiImport}),n=t.exports;a.initialize(t);let s=e=>{if(e<=0)return"";let r=n.eser_ajan_result_ptr();if(r===0)return"";let u=new Uint8Array(n.memory.buffer,r,e),o=new Uint8Array(e);return o.set(u),new TextDecoder().decode(o)};return{symbols:{EserAjanVersion:()=>{let e=n.eser_ajan_version();return s(e)},EserAjanInit:()=>n.eser_ajan_init(),EserAjanShutdown:()=>{n.eser_ajan_shutdown()},EserAjanFree:e=>{},EserAjanConfigLoad:e=>{let r=n.eser_ajan_config_load();return s(r)},EserAjanDIResolve:e=>{let r=n.eser_ajan_di_resolve();return s(r)}},close:()=>{}}};export{d as loadReactorWasm};
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as K,b as j,c as M,d as F,f as N}from"./chunk-H6HLRKRK.js";import"./chunk-V6YI7YJ4.js";import"./chunk-VVWAUS3D.js";import"./chunk-LSET5TD3.js";import{a as Q}from"./chunk-SF6FT44C.js";import"./chunk-VNJJQED3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-VAIRJES2.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-5DWJ7WEE.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import{m as W}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
2
+ import{a as K,b as j,c as M,d as F,f as N}from"./chunk-F44CX3KC.js";import{a as Q}from"./chunk-OWV223WQ.js";import"./chunk-6PRIUPN4.js";import"./chunk-3QF3I2RD.js";import"./chunk-3IZX4OZ7.js";import"./chunk-26ZFSXSK.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-YTF3BAQS.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-5DWJ7WEE.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import{m as W}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
3
3
  ${p}`);let u=f=>f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),a=`
4
4
  console.error("Runtime bundling failed:", ${JSON.stringify(l)});
5
5
  document.getElementById("root").innerHTML = '<div class="error"><h2>Bundle Error</h2><pre>${u(l)}</pre></div>';
6
- `,d={version:"1.0",buildId:"runtime-error",timestamp:Date.now(),logLevel:"error",entrypoint:"__runtime_bundle.js",hmrEnabled:!1,chunks:{},files:{}};return{code:a,manifest:d}}finally{try{await s.fs.remove(o,{recursive:!0})}catch(i){A.debug("Temp directory cleanup failed",{error:i})}}}clear(){this.clientComponents.clear(),this.moduleMap=null,this.bundleCode=null,this.lastScan=0}};var D=class{cache;constructor(e){this.cache=new _(e)}async getBundle(){let e=await this.cache.getOrCreateBundle();return{clientCode:e.clientCode,moduleMap:e.moduleMap,chunkManifest:e.chunkManifest,entrypoint:"/__runtime_bundle.js"}}async getRuntimeBundle(){return await this.cache.getOrCreateBundle()}async rebuild(){await this.cache.rebuild()}clear(){this.cache.clear()}};var Z={name:"noop",renderPage:()=>Promise.resolve({html:""}),renderRSC:()=>Promise.resolve(new Response("")),generateBootstrapScript:()=>""};var ee={name:"noop",createShell:()=>"<!DOCTYPE html><html><head></head><body></body></html>",createStreamingStart:()=>"<!DOCTYPE html><html><head></head><body>",createStreamingEnd:()=>"</body></html>"};var b=m.getLogger(["laroux-server","hmr"]),$=class{clients=new Set;handleConnection(e){this.clients.add(e),b.debug(`HMR client connected (${this.clients.size} total)`),this.sendToClient(e,{type:"connected"}),e.addEventListener("close",()=>{this.clients.delete(e),b.debug(`HMR client disconnected (${this.clients.size} remaining)`)}),e.addEventListener("error",t=>{b.error("HMR WebSocket error:",{event:t}),this.clients.delete(e)})}notifyUpdate(e=Date.now(),t){let r={type:"update",timestamp:e,changedModules:t};b.debug(`Notifying ${this.clients.size} clients of update${t?` (${t.length} modules changed)`:""}`);for(let o of this.clients)this.sendToClient(o,r)}notifyError(e){let t={type:"error",message:e};b.warn(`Notifying clients of error: ${e}`);for(let r of this.clients)this.sendToClient(r,t)}sendToClient(e,t){if(e.readyState===WebSocket.OPEN)try{e.send(JSON.stringify(t))}catch(r){b.error("Failed to send HMR message:",{error:r})}}getClientCount(){return this.clients.size}close(){for(let e of this.clients)e.close();this.clients.clear()}};var L=m.getLogger(["laroux-server","api-handler"]);function ie(n){let e=new Set;return{pattern:n.replace(/\[\.\.\.(\w+)\]/g,(r,o)=>(e.add(o),`:${o}*`)).replace(/\[(\w+)\]/g,(r,o)=>`:${o}`),catchAllParams:e}}function se(n,e){let{pattern:t,catchAllParams:r}=ie(e),i=new URLPattern({pathname:t}).exec({pathname:n});if(!i)return null;let l={},p=i.pathname.groups;for(let[u,a]of Object.entries(p))r.has(u)?l[u]=a?a.split("/").filter(Boolean):[]:l[u]=a??"";return l}var H=class{routes=[];moduleCache=new Map;registryDir="";async loadRoutes(e){try{let t=`file://${e}/server/api-routes.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.routes=r.apiRoutes||[],L.debug(`Loaded ${this.routes.length} API route(s)`)}catch{this.routes=[],L.debug("No API routes registry found")}}async handleRequest(e,t){let r=new URL(e.url),o=e.method;for(let i of this.routes){let l=se(t,i.path);if(l!==null){L.debug(`API route matched: ${o} ${t} -> ${i.path}`);try{let p=s.path.resolve(this.registryDir,i.modulePath),u=this.moduleCache.get(p);u||(u=await import(`file://${p}`),this.moduleCache.set(p,u));let a=u[o];return a?await a({request:e,params:l,searchParams:r.searchParams}):(L.debug(`Method ${o} not allowed for ${i.path}`),new Response("Method Not Allowed",{status:405,headers:{Allow:this.getAllowedMethods(u).join(", ")}}))}catch(p){return L.error(`API route error: ${i.path}`,{error:p}),new Response(JSON.stringify({error:"Internal Server Error"}),{status:500,headers:{"Content-Type":"application/json"}})}}}return null}getAllowedMethods(e){let t=[];return e.GET&&t.push("GET"),e.POST&&t.push("POST"),e.PUT&&t.push("PUT"),e.DELETE&&t.push("DELETE"),e.PATCH&&t.push("PATCH"),e.HEAD&&t.push("HEAD"),e.OPTIONS&&t.push("OPTIONS"),t}clearCache(){this.moduleCache.clear()}};var P=m.getLogger(["laroux-server","proxy-handler"]),T=class{proxies=[];moduleCache=new Map;registryDir="";async loadProxies(e){try{let t=`file://${e}/server/proxy-registry.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.proxies=r.proxyRegistry||[],P.debug(`Loaded ${this.proxies.length} proxy definition(s)`)}catch{this.proxies=[],P.debug("No proxy registry found")}}async runProxies(e,t){let r=t;for(let o of this.proxies)if(this.matchesPrefix(r,o.pathPrefix)){P.debug(`Running proxy: ${o.pathPrefix} for ${r}`);try{let i=s.path.resolve(this.registryDir,o.modulePath),l=this.moduleCache.get(i);l||(l=await import(`file://${i}`),this.moduleCache.set(i,l));let p=l.default;if(typeof p!="function"){P.warn(`Proxy ${o.modulePath} does not export a default function`);continue}let u=await p({request:e,pathname:r,params:{}});if(u.type==="response")return P.debug(`Proxy ${o.pathPrefix} returned response`),{result:u,finalPathname:r};if(u.type==="redirect")return P.debug(`Proxy ${o.pathPrefix} redirecting to ${u.url}`),{result:u,finalPathname:r};u.type==="rewrite"&&(P.debug(`Proxy ${o.pathPrefix} rewriting to ${u.pathname}`),r=u.pathname)}catch(i){return P.error(`Proxy error: ${o.pathPrefix}`,{error:i}),{result:{type:"response",response:new Response(JSON.stringify({error:"Proxy Error"}),{status:500,headers:{"Content-Type":"application/json"}})},finalPathname:r}}}return{result:{type:"next"},finalPathname:r}}matchesPrefix(e,t){return t==="/"?!0:e===t||e.startsWith(t+"/")}clearCache(){this.moduleCache.clear()}};function te(n,e){let t=X(n,e.path);if(t===null)return null;let r={};for(let[o,i]of Object.entries(t))Array.isArray(i)?r[o]=[...i]:typeof i=="string"&&(r[o]=i);return r}function U(n,e){for(let t of e){let r=te(n,t);if(r!==null)return{route:t,params:r}}return null}var le=["trace","debug","info","warn","error","fatal"];var oe="manifest.json",ue=n=>({trace:v.Debug,debug:v.Debug,info:v.Info,warn:v.Warning,error:v.Error,fatal:v.Critical})[n],R,E;async function pe(n){let e=ue(n),{output:t,renderers:r,sinks:o}=await import("./mod-II7CSZUT.js"),i=t({renderer:r.ansi(),sink:o.stdout()});await G.configure({sinks:{console:V.getOutputSink(i)},loggers:[{category:["laroux-server"],lowestLevel:e,sinks:["console"]},{category:["laroux-bundler"],lowestLevel:e,sinks:["console"]},{category:["laroux"],lowestLevel:e,sinks:["console"]}]}),R=m.getLogger(["laroux-server","server"]),E=m.getLogger(["laroux-server","bundler"])}var O=null;function ot(){O=null}async function ce(n){if(O!==null)return O;let t=`file://${s.path.join(n.distDir,"server","_generated-routes.ts")}?t=${Date.now()}`,{generatedRoutes:r}=await import(t);return O=r,r}async function re(n,e){let t=s.path.resolve(n.distDir,"server","src","app",`${e}.js`);if(await s.fs.exists(t))return t;for(let r of Y){let o=s.path.resolve(n.distDir,"server","src","app",`${e}.${r}`);if(await s.fs.exists(o))return o}return t}async function ne(n,e){let t=Date.now(),o=`file://${await re(e,"layout")}?t=${t}`,{Layout:i}=await import(o),l=await ce(e),p=U(n,l);if(p===null){let a=`file://${await re(e,"not-found")}?t=${t}`,{NotFound:d}=await import(a);return{Layout:i,Page:d,params:{}}}return{Layout:i,Page:p.route.component,params:p.params}}async function de(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.readTextFile(e);return JSON.parse(t).buildId}catch{return"unknown"}}async function me(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.stat(e),r=await s.fs.stat(n.srcDir);return t.mtime===null||r.mtime===null?!1:t.mtime>r.mtime}catch{return!1}}function I(n){return{projectRoot:n.projectRoot,srcDir:n.srcDir,distDir:n.distDir,logLevel:n.logLevel,fonts:n.fonts,images:n.images,cssModuleTypes:n.cssModuleTypes,noCssModuleAutoReference:n.noCssModuleAutoReference,browserShims:n.browserShims,serverExternals:n.build.serverExternals}}async function ge(n,e={}){let{config:t,bundler:r,hmrManager:o}=n,{frameworkPlugin:i,cssPlugin:l}=e;try{let c=s.path.resolve(t.distDir,"server","actions-manifest.json");if(await s.fs.exists(c)){let x=await s.fs.readTextFile(c),z=JSON.parse(x),q=Date.now(),C=0;for(let J of z.actions)try{let k=s.path.resolve(t.distDir,"server",J);await s.fs.exists(k)&&(await import(`file://${k}?t=${q}`),C++)}catch(k){R.warn(`Failed to load action ${J}:`,{error:k})}C>0&&R.debug(`Server actions loaded: ${C} file(s)`)}else R.debug("No actions manifest found (optional)")}catch(c){R.warn("Failed to load server actions:",{error:c})}await ne("/",t);let p=await de(t);E.debug(`Build ID: ${p}`);let a={...n,getApp:c=>ne(c,t),buildId:p},d=await r.getBundle(),f={framework:i,css:l,bundlerBackend:"deno-bundler"};if(d.clientCode!==null&&o!==null){if(i!==void 0){let c=M(I(t),f);N(c,async y=>{if(r instanceof D)try{await r.rebuild()}catch(x){E.error("Compilation failed:",{error:x})}E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`),o?.notifyUpdate(Date.now(),y.changedFiles)})}}else if(t.mode.isWatch&&i!==void 0){let c=M(I(t),f);N(c,y=>{E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`)})}let h="";d.clientCode!==null&&o!==null?h=" HMR":d.clientCode!==null&&(h=" Watch"),R.info(`RSC Server${h}`),R.info(` Local: http://localhost:${t.server.port}`);let{startHTTPServer:g}=await import("./server-KJW4HWK7.js");return g(a),a}async function it(n){let e=n.projectRoot??s.process.cwd(),t=n.logLevel??"info",r=n.mode==="dev",{renderer:o,htmlShell:i,frameworkPlugin:l,cssPlugin:p}=n;await pe(t);let u=await Q(e),a={...u,srcDir:s.path.resolve(e,u.srcDir),distDir:s.path.resolve(e,u.distDir),publicDir:s.path.resolve(e,u.publicDir),logLevel:t,mode:{isDev:r,isBuild:!1,isServe:!r,isWatch:r}};n.port!==void 0&&(a.server.port=n.port),n.hmr!==void 0?a.server.hmr=n.hmr:r&&(a.server.hmr=!0),n.open!==void 0&&(a.server.open=n.open),r&&(a.build.minify=!1);let d=await me(a),f=r||!d,h={framework:l,css:p};if(f&&r&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"deno-bundler"});await F(C)}else if(f&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"rolldown"});await F(C)}let g,c=null;r&&a.server.hmr?(c=new $,g=new w({distDir:a.distDir})):g=new w({distDir:a.distDir});let y=new H;await y.loadRoutes(a.distDir);let x=new T;await x.loadProxies(a.distDir),await ge({config:a,bundler:g,hmrManager:c,apiHandler:y,middlewareDispatcher:x,renderer:o??Z,htmlShell:i??ee},{frameworkPlugin:l,cssPlugin:p}),n.open&&fe(`http://localhost:${a.server.port}`)}function fe(n){let e={darwin:["open"],linux:["xdg-open"],windows:["cmd","/c","start"]},t=W(),r=e[t];r&&r[0]&&s.exec.spawnChild(r[0],[...r.slice(1),n],{stdout:"null",stderr:"null"})}export{le as VALID_LOG_LEVELS,ot as clearRoutesCache,it as startServer};
6
+ `,d={version:"1.0",buildId:"runtime-error",timestamp:Date.now(),logLevel:"error",entrypoint:"__runtime_bundle.js",hmrEnabled:!1,chunks:{},files:{}};return{code:a,manifest:d}}finally{try{await s.fs.remove(o,{recursive:!0})}catch(i){A.debug("Temp directory cleanup failed",{error:i})}}}clear(){this.clientComponents.clear(),this.moduleMap=null,this.bundleCode=null,this.lastScan=0}};var D=class{cache;constructor(e){this.cache=new _(e)}async getBundle(){let e=await this.cache.getOrCreateBundle();return{clientCode:e.clientCode,moduleMap:e.moduleMap,chunkManifest:e.chunkManifest,entrypoint:"/__runtime_bundle.js"}}async getRuntimeBundle(){return await this.cache.getOrCreateBundle()}async rebuild(){await this.cache.rebuild()}clear(){this.cache.clear()}};var Z={name:"noop",renderPage:()=>Promise.resolve({html:""}),renderRSC:()=>Promise.resolve(new Response("")),generateBootstrapScript:()=>""};var ee={name:"noop",createShell:()=>"<!DOCTYPE html><html><head></head><body></body></html>",createStreamingStart:()=>"<!DOCTYPE html><html><head></head><body>",createStreamingEnd:()=>"</body></html>"};var b=m.getLogger(["laroux-server","hmr"]),$=class{clients=new Set;handleConnection(e){this.clients.add(e),b.debug(`HMR client connected (${this.clients.size} total)`),this.sendToClient(e,{type:"connected"}),e.addEventListener("close",()=>{this.clients.delete(e),b.debug(`HMR client disconnected (${this.clients.size} remaining)`)}),e.addEventListener("error",t=>{b.error("HMR WebSocket error:",{event:t}),this.clients.delete(e)})}notifyUpdate(e=Date.now(),t){let r={type:"update",timestamp:e,changedModules:t};b.debug(`Notifying ${this.clients.size} clients of update${t?` (${t.length} modules changed)`:""}`);for(let o of this.clients)this.sendToClient(o,r)}notifyError(e){let t={type:"error",message:e};b.warn(`Notifying clients of error: ${e}`);for(let r of this.clients)this.sendToClient(r,t)}sendToClient(e,t){if(e.readyState===WebSocket.OPEN)try{e.send(JSON.stringify(t))}catch(r){b.error("Failed to send HMR message:",{error:r})}}getClientCount(){return this.clients.size}close(){for(let e of this.clients)e.close();this.clients.clear()}};var L=m.getLogger(["laroux-server","api-handler"]);function ie(n){let e=new Set;return{pattern:n.replace(/\[\.\.\.(\w+)\]/g,(r,o)=>(e.add(o),`:${o}*`)).replace(/\[(\w+)\]/g,(r,o)=>`:${o}`),catchAllParams:e}}function se(n,e){let{pattern:t,catchAllParams:r}=ie(e),i=new URLPattern({pathname:t}).exec({pathname:n});if(!i)return null;let l={},p=i.pathname.groups;for(let[u,a]of Object.entries(p))r.has(u)?l[u]=a?a.split("/").filter(Boolean):[]:l[u]=a??"";return l}var H=class{routes=[];moduleCache=new Map;registryDir="";async loadRoutes(e){try{let t=`file://${e}/server/api-routes.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.routes=r.apiRoutes||[],L.debug(`Loaded ${this.routes.length} API route(s)`)}catch{this.routes=[],L.debug("No API routes registry found")}}async handleRequest(e,t){let r=new URL(e.url),o=e.method;for(let i of this.routes){let l=se(t,i.path);if(l!==null){L.debug(`API route matched: ${o} ${t} -> ${i.path}`);try{let p=s.path.resolve(this.registryDir,i.modulePath),u=this.moduleCache.get(p);u||(u=await import(`file://${p}`),this.moduleCache.set(p,u));let a=u[o];return a?await a({request:e,params:l,searchParams:r.searchParams}):(L.debug(`Method ${o} not allowed for ${i.path}`),new Response("Method Not Allowed",{status:405,headers:{Allow:this.getAllowedMethods(u).join(", ")}}))}catch(p){return L.error(`API route error: ${i.path}`,{error:p}),new Response(JSON.stringify({error:"Internal Server Error"}),{status:500,headers:{"Content-Type":"application/json"}})}}}return null}getAllowedMethods(e){let t=[];return e.GET&&t.push("GET"),e.POST&&t.push("POST"),e.PUT&&t.push("PUT"),e.DELETE&&t.push("DELETE"),e.PATCH&&t.push("PATCH"),e.HEAD&&t.push("HEAD"),e.OPTIONS&&t.push("OPTIONS"),t}clearCache(){this.moduleCache.clear()}};var P=m.getLogger(["laroux-server","proxy-handler"]),T=class{proxies=[];moduleCache=new Map;registryDir="";async loadProxies(e){try{let t=`file://${e}/server/proxy-registry.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.proxies=r.proxyRegistry||[],P.debug(`Loaded ${this.proxies.length} proxy definition(s)`)}catch{this.proxies=[],P.debug("No proxy registry found")}}async runProxies(e,t){let r=t;for(let o of this.proxies)if(this.matchesPrefix(r,o.pathPrefix)){P.debug(`Running proxy: ${o.pathPrefix} for ${r}`);try{let i=s.path.resolve(this.registryDir,o.modulePath),l=this.moduleCache.get(i);l||(l=await import(`file://${i}`),this.moduleCache.set(i,l));let p=l.default;if(typeof p!="function"){P.warn(`Proxy ${o.modulePath} does not export a default function`);continue}let u=await p({request:e,pathname:r,params:{}});if(u.type==="response")return P.debug(`Proxy ${o.pathPrefix} returned response`),{result:u,finalPathname:r};if(u.type==="redirect")return P.debug(`Proxy ${o.pathPrefix} redirecting to ${u.url}`),{result:u,finalPathname:r};u.type==="rewrite"&&(P.debug(`Proxy ${o.pathPrefix} rewriting to ${u.pathname}`),r=u.pathname)}catch(i){return P.error(`Proxy error: ${o.pathPrefix}`,{error:i}),{result:{type:"response",response:new Response(JSON.stringify({error:"Proxy Error"}),{status:500,headers:{"Content-Type":"application/json"}})},finalPathname:r}}}return{result:{type:"next"},finalPathname:r}}matchesPrefix(e,t){return t==="/"?!0:e===t||e.startsWith(t+"/")}clearCache(){this.moduleCache.clear()}};function te(n,e){let t=X(n,e.path);if(t===null)return null;let r={};for(let[o,i]of Object.entries(t))Array.isArray(i)?r[o]=[...i]:typeof i=="string"&&(r[o]=i);return r}function U(n,e){for(let t of e){let r=te(n,t);if(r!==null)return{route:t,params:r}}return null}var le=["trace","debug","info","warn","error","fatal"];var oe="manifest.json",ue=n=>({trace:v.Debug,debug:v.Debug,info:v.Info,warn:v.Warning,error:v.Error,fatal:v.Critical})[n],R,E;async function pe(n){let e=ue(n),{output:t,renderers:r,sinks:o}=await import("./mod-YH5Z6G4Q.js"),i=t({renderer:r.ansi(),sink:o.stdout()});await G.configure({sinks:{console:V.getOutputSink(i)},loggers:[{category:["laroux-server"],lowestLevel:e,sinks:["console"]},{category:["laroux-bundler"],lowestLevel:e,sinks:["console"]},{category:["laroux"],lowestLevel:e,sinks:["console"]}]}),R=m.getLogger(["laroux-server","server"]),E=m.getLogger(["laroux-server","bundler"])}var O=null;function ot(){O=null}async function ce(n){if(O!==null)return O;let t=`file://${s.path.join(n.distDir,"server","_generated-routes.ts")}?t=${Date.now()}`,{generatedRoutes:r}=await import(t);return O=r,r}async function re(n,e){let t=s.path.resolve(n.distDir,"server","src","app",`${e}.js`);if(await s.fs.exists(t))return t;for(let r of Y){let o=s.path.resolve(n.distDir,"server","src","app",`${e}.${r}`);if(await s.fs.exists(o))return o}return t}async function ne(n,e){let t=Date.now(),o=`file://${await re(e,"layout")}?t=${t}`,{Layout:i}=await import(o),l=await ce(e),p=U(n,l);if(p===null){let a=`file://${await re(e,"not-found")}?t=${t}`,{NotFound:d}=await import(a);return{Layout:i,Page:d,params:{}}}return{Layout:i,Page:p.route.component,params:p.params}}async function de(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.readTextFile(e);return JSON.parse(t).buildId}catch{return"unknown"}}async function me(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.stat(e),r=await s.fs.stat(n.srcDir);return t.mtime===null||r.mtime===null?!1:t.mtime>r.mtime}catch{return!1}}function I(n){return{projectRoot:n.projectRoot,srcDir:n.srcDir,distDir:n.distDir,logLevel:n.logLevel,fonts:n.fonts,images:n.images,cssModuleTypes:n.cssModuleTypes,noCssModuleAutoReference:n.noCssModuleAutoReference,browserShims:n.browserShims,serverExternals:n.build.serverExternals}}async function ge(n,e={}){let{config:t,bundler:r,hmrManager:o}=n,{frameworkPlugin:i,cssPlugin:l}=e;try{let c=s.path.resolve(t.distDir,"server","actions-manifest.json");if(await s.fs.exists(c)){let x=await s.fs.readTextFile(c),z=JSON.parse(x),q=Date.now(),C=0;for(let J of z.actions)try{let k=s.path.resolve(t.distDir,"server",J);await s.fs.exists(k)&&(await import(`file://${k}?t=${q}`),C++)}catch(k){R.warn(`Failed to load action ${J}:`,{error:k})}C>0&&R.debug(`Server actions loaded: ${C} file(s)`)}else R.debug("No actions manifest found (optional)")}catch(c){R.warn("Failed to load server actions:",{error:c})}await ne("/",t);let p=await de(t);E.debug(`Build ID: ${p}`);let a={...n,getApp:c=>ne(c,t),buildId:p},d=await r.getBundle(),f={framework:i,css:l,bundlerBackend:"deno-bundler"};if(d.clientCode!==null&&o!==null){if(i!==void 0){let c=M(I(t),f);N(c,async y=>{if(r instanceof D)try{await r.rebuild()}catch(x){E.error("Compilation failed:",{error:x})}E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`),o?.notifyUpdate(Date.now(),y.changedFiles)})}}else if(t.mode.isWatch&&i!==void 0){let c=M(I(t),f);N(c,y=>{E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`)})}let h="";d.clientCode!==null&&o!==null?h=" HMR":d.clientCode!==null&&(h=" Watch"),R.info(`RSC Server${h}`),R.info(` Local: http://localhost:${t.server.port}`);let{startHTTPServer:g}=await import("./server-R347ON4B.js");return g(a),a}async function it(n){let e=n.projectRoot??s.process.cwd(),t=n.logLevel??"info",r=n.mode==="dev",{renderer:o,htmlShell:i,frameworkPlugin:l,cssPlugin:p}=n;await pe(t);let u=await Q(e),a={...u,srcDir:s.path.resolve(e,u.srcDir),distDir:s.path.resolve(e,u.distDir),publicDir:s.path.resolve(e,u.publicDir),logLevel:t,mode:{isDev:r,isBuild:!1,isServe:!r,isWatch:r}};n.port!==void 0&&(a.server.port=n.port),n.hmr!==void 0?a.server.hmr=n.hmr:r&&(a.server.hmr=!0),n.open!==void 0&&(a.server.open=n.open),r&&(a.build.minify=!1);let d=await me(a),f=r||!d,h={framework:l,css:p};if(f&&r&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"deno-bundler"});await F(C)}else if(f&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"rolldown"});await F(C)}let g,c=null;r&&a.server.hmr?(c=new $,g=new w({distDir:a.distDir})):g=new w({distDir:a.distDir});let y=new H;await y.loadRoutes(a.distDir);let x=new T;await x.loadProxies(a.distDir),await ge({config:a,bundler:g,hmrManager:c,apiHandler:y,middlewareDispatcher:x,renderer:o??Z,htmlShell:i??ee},{frameworkPlugin:l,cssPlugin:p}),n.open&&fe(`http://localhost:${a.server.port}`)}function fe(n){let e={darwin:["open"],linux:["xdg-open"],windows:["cmd","/c","start"]},t=W(),r=e[t];r&&r[0]&&s.exec.spawnChild(r[0],[...r.slice(1),n],{stdout:"null",stderr:"null"})}export{le as VALID_LOG_LEVELS,ot as clearRoutesCache,it as startServer};
@@ -0,0 +1,7 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{e as oe,j as ce,r as j,u as le,w as ue,y as K,z as de}from"./chunk-YW377352.js";import{b as X}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{c as W,d as ie,e as re,r as y,s as l,t as x,u as ae,v as I,w as q}from"./chunk-ZER2RYWJ.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import{d as se,e as N,f as ne}from"./chunk-BLXGL5MA.js";import{a as _,b as te}from"./chunk-FFWPJP7A.js";import{i as C}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var pe=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0});var we=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE",FREE:"FREE"}[e]??e.slice(0,4),Se=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},M=(e,n)=>{let a=new Set(n.filter(o=>o.spec!==null).map(o=>o.spec)),i=e.map(o=>({label:o.name,badge:we(o.phase),badgeColor:Se(o.phase),active:a.has(o.name),dimmed:o.phase==="COMPLETED"}));return i.length===0&&i.push({label:"No specs yet",dimmed:!0,selectable:!1}),i.push({label:"\u2500".repeat(20),dimmed:!0,selectable:!1}),i.push({label:"[n] New spec",badge:"+",badgeColor:"green"}),i.push({label:"[f] Free mode",badge:"~",badgeColor:"cyan"}),i},Y=(e,n,a,i)=>{let o=M(e,n),t=x.drawBox({x:i.x,y:i.y,width:i.width,height:i.height,title:"Specs",borderStyle:"rounded"}),R=I.renderList(o,a,i);return t+R};var xe=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE"],Ee=e=>{if(e===null||e==="FREE")return"FREE (no enforcement)";let a={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return xe.map(i=>i===a?l.bold(`\u2726${i}\u2726`):l.dim(i)).join("\u2192")},Ie=(e,n,a)=>{if(n===0)return l.dim("no tasks");let i=Math.round(e/n*a),o=a-i;return l.green("\u2588".repeat(i))+l.dim("\u2591".repeat(o))+` ${e}/${n}`},z=(e,n,a)=>{let i=[];return e===null?(i.push(l.dim("No spec selected")),i.push(""),i.push(l.dim("Select a spec from the list or press [n] for new"))):e.mode==="free"?(i.push(l.bold("Mode: ")+l.cyan("FREE")),i.push(l.dim("No enforcement active")),i.push(""),i.push(l.dim(`Session: ${e.sessionId}`))):(i.push(l.bold("Spec: ")+(e.spec??"unknown")),i.push(l.bold("Phase: ")+(e.phase??"unknown")),i.push(""),i.push(Ee(e.phase)),i.push(""),a!==void 0&&i.push(l.bold("Progress: ")+Ie(a.completed,a.total,15)),i.push(""),i.push(l.dim(`Session: ${e.sessionId}`))),x.fillBox({x:n.x,y:n.y,width:n.width,height:n.height,title:"Monitor",borderStyle:"rounded"},i)};var U=(e,n)=>{let a=e!==null?e.mode==="free"?"Terminal (FREE)":`Terminal (${e.spec??"?"})`:"Terminal",i=e!==null&&e.widget!==null,o=x.drawBox({x:n.x,y:n.y,width:n.width,height:n.height,title:a,borderStyle:"rounded",skipInterior:i});if(e===null||e.widget===null&&e.buffer.length===0){let L=l.dim("Waiting for output..."),k=" ".repeat(n.width-2),u="";for(let E=1;E<n.height-1;E++)u+=l.moveTo(n.y+E,n.x+1),u+=E===1?l.truncate(L,n.width-2)+" ".repeat(Math.max(0,n.width-2-l.visibleLength(L))):k;return o+u}if(e.widget!==null)return o+e.widget.render(n);let t=n.height-2,R=e.buffer.slice(-t);return x.fillBox({x:n.x,y:n.y,width:n.width,height:n.height,title:a,borderStyle:"rounded"},R)};var G=(e,n)=>({...e,tabs:[...e.tabs,n],selectedTabIndex:e.tabs.length}),me=(e,n)=>{let a=e.tabs.findIndex(t=>t.id===n);if(a===-1)return e;let i=e.tabs[a];i.process!==null&&i.process.kill();let o=e.tabs.filter(t=>t.id!==n);return{...e,tabs:o,selectedTabIndex:Math.min(e.selectedTabIndex,o.length-1)}},ge=(e,n)=>n<0||n>=e.tabs.length?e:{...e,selectedTabIndex:n},H=(e,n)=>{let a=n.split(`
3
+ `);for(let i of a)e.buffer.push(i);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},P=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var fe=(e,n,a)=>{if(a&&n==="c")return{type:"quit"};if(n==="tab")return{type:"toggleFocus"};if(e.focus==="list")switch(n){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newSpec"};case"f":return{type:"freeMode"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:n}},be=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),J=(e,n,a)=>{let i=I.nextSelectableIndex(a,e.selectedTabIndex,n);return{...e,selectedTabIndex:i}};var Be=async e=>{let n=e?.includes("--dry-run")??!1,a=C.process.cwd();if(!await de(a))return console.error("noskills is not initialized. Run:",X(),"init"),te({exitCode:1});let o=(await ce(a)).map(s=>({name:s.name,phase:s.state.phase,hasActiveSession:!1})),t=pe(),{cols:R,rows:L}=y.getTerminalSize(),k={leftWidth:.25,rightTopHeight:.35},u=ae.calculateLayout(R,L,k),E=new TextEncoder,g=s=>{Deno.stdout.writeSync(E.encode(s))};if(n){g(y.clearScreenSeq());let s=` noskills manager | ${o.length} spec(s) | ${X()} | Ctrl+C to quit`;g(l.moveTo(u.statusBar.y,u.statusBar.x)),g(l.inverse(l.truncate(s,u.statusBar.width))),g(Y(o,t.tabs,t.selectedTabIndex,u.left));let r=P(t);return g(z(r,u.rightTop)),g(U(r,u.rightBottom)),g(l.moveTo(L,1)),g(`
4
+ `),_(void 0)}let D=new ne,F=null,Q=async()=>{for(let s of["claude","claude-code"])try{if(await se`which ${s}`.noThrow().code()===0)return s}catch{}return"claude"},w=M(o,t.tabs);t.selectedTabIndex=I.nextSelectableIndex(w,-1,"down");let O=async()=>{let s=K();await j(a,{id:s,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let r=u.rightBottom.width-2,d=u.rightBottom.height-2,c=new q(d,r),m={id:`tab-${s}`,spec:null,mode:"free",sessionId:s,process:null,buffer:[],widget:c,active:!0,phase:null};try{let f=await Q(),b=await N({command:f,cwd:a,env:{...C.env.toObject(),NOSKILLS_SESSION:s},cols:r,rows:d});m.process=b,D.add(m.id,b),b.onData(T=>{c.write(T),H(m,T),F?.()})}catch(f){let b=f instanceof Error?f.message:String(f);c.write(`[noskills manager] Failed to spawn claude: ${b}\r
5
+ `),c.write(`Is Claude Code installed? Set command in manifest.yml\r
6
+ `)}Object.assign(t,G(t,m)),t.focus="terminal",w=M(o,t.tabs)},Z=async s=>{let r=t.tabs.find(h=>h.spec===s);if(r!==void 0){let h=t.tabs.indexOf(r);Object.assign(t,ge(t,h)),t.focus="terminal";return}let d=null;try{d=(await oe(a,s)).phase}catch{}let c=K();await j(a,{id:c,spec:s,mode:"spec",phase:d,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let m=u.rightBottom.width-2,f=u.rightBottom.height-2,b=new q(f,m),T={id:`tab-${c}`,spec:s,mode:"spec",sessionId:c,process:null,buffer:[],widget:b,active:!0,phase:d};try{let h=await Q(),A=await N({command:h,cwd:a,env:{...C.env.toObject(),NOSKILLS_SESSION:c},cols:m,rows:f});T.process=A,D.add(T.id,A),A.onData(ee=>{b.write(ee),H(T,ee),F?.()})}catch(h){let A=h instanceof Error?h.message:String(h);b.write(`[noskills manager] Failed to spawn claude for spec "${s}": ${A}\r
7
+ `)}Object.assign(t,G(t,T)),t.focus="terminal",w=M(o,t.tabs)};g(y.enterAlternateScreen()),g(y.hideCursorSeq()),g(y.clearScreenSeq()),g(W.enableMouse());let p=new Set(["specs","monitor","terminal","status"]),v=()=>{let s=P(t),r=[];if(r.push(y.hideCursorSeq()),p.has("status")||p.size===0){let d=t.focus==="list"?"LIST":"TERM",c=` noskills manager | ${o.length} spec(s) | ${t.tabs.length} tab(s) | [${d}] Tab: toggle | q: quit | n: new | f: free`;r.push(l.moveTo(u.statusBar.y,u.statusBar.x)),r.push(l.inverse(l.truncate(c,u.statusBar.width)+" ".repeat(Math.max(0,u.statusBar.width-l.visibleLength(c)))))}p.has("specs")&&r.push(Y(o,t.tabs,t.selectedTabIndex,u.left)),p.has("monitor")&&r.push(z(s,u.rightTop)),p.has("terminal")&&r.push(U(s,u.rightBottom)),r.push(y.showCursorSeq()),p.clear(),g(r.join(""))},S=()=>{p.add("specs"),p.add("monitor"),p.add("terminal"),p.add("status")},$=!1;F=()=>{p.add("terminal"),!$&&($=!0,setTimeout(()=>{$=!1,t.running&&v()},16))},S(),v();let V=(s,r,d)=>s>=d.x&&s<d.x+d.width&&r>=d.y&&r<d.y+d.height,he=async s=>{if(V(s.x+1,s.y+1,u.left)){if(s.type==="mousedown"&&s.button===0){t.focus="list";let r=s.y+1-u.left.y-1;if(r>=0&&r<w.length){let d=w[r];if(d.selectable!==!1){if(t.selectedTabIndex=r,d.label.includes("[n]")||d.label.includes("[f]")){await O(),S();return}let c=o.find(m=>m.name===d.label)?.name;if(c!==void 0){await Z(c),S();return}}}p.add("specs"),p.add("monitor"),p.add("status")}else if(s.type==="wheel"){let r=s.direction==="up"?"up":"down";Object.assign(t,J(t,r,w)),p.add("specs"),p.add("monitor")}return}if(V(s.x+1,s.y+1,u.rightBottom)){t.focus="terminal",p.add("status");let r=P(t);if(r?.process!==null&&r!==null){let d=s.x+1-u.rightBottom.x,c=s.y+1-u.rightBottom.y,m=s.button;s.type==="mousemove"&&(m|=32),s.type==="wheel"&&(m=64|(s.direction==="down"?1:0)),s.shift&&(m|=4),s.ctrl&&(m|=16);let f=s.type==="mouseup"?"m":"M";r.process?.write(`\x1B[<${m};${d};${c}${f}`)}if(s.type==="wheel"&&r?.process!==null&&r!==null){let d=s.direction==="up"?"\x1B[A":"\x1B[B";r.process?.write(d.repeat(3))}return}V(s.x+1,s.y+1,u.rightTop)&&(t.focus="list",p.add("status"))};try{await ie(async()=>{for await(let s of re(C.process.stdin)){if(!t.running)break;if(s.kind==="mouse"){await he(s.event),p.size>0&&v();continue}let r=s.event,d=fe(t,r.name,r.ctrl);switch(d.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,be(t)),p.add("status");break;case"navigate":Object.assign(t,J(t,d.direction,w)),p.add("specs"),p.add("monitor"),p.add("terminal");break;case"freeMode":await O(),S();break;case"newSpec":await O(),S();break;case"select":{let c=w[t.selectedTabIndex];if(c===void 0)break;let m=c.label;if(m.includes("[n]")||m.includes("[f]"))await O();else{let f=o.find(b=>b.name===m)?.name;f!==void 0&&await Z(f)}S();break}case"closeTab":{let c=P(t);c!==null&&(c.process!==null&&D.remove(c.id),await le(a,c.sessionId),Object.assign(t,me(t,c.id)),w=M(o,t.tabs),t.focus="list"),S();break}case"passthrough":{let c=P(t);c?.process!==null&&c!==null&&c.process?.write(new TextDecoder().decode(r.raw));break}case"none":break}if(!t.running)break;p.size>0&&v()}})}finally{await D.killAll(),D.forceKillAll(),await ue(a),g(W.disableMouse()),g(y.showCursorSeq()),g(y.exitAlternateScreen())}return _(void 0)};export{Be as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
2
+ import{a,b,c}from"./chunk-L2E2H7YT.js";import"./chunk-2XNFZXHY.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-PPSDIDOI.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-VE6XM5OZ.js";import{a as A,b as C}from"./chunk-2N62LL55.js";import{a as M,b as w}from"./chunk-7RL5ZFGE.js";import{a as I,b as T}from"./chunk-IBBGWXAI.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-YURNTYEP.js";import"./chunk-J7YTWK67.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-QBGNUIP3.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-VX2T4YII.js"),{ollamaFactory:c}=await import("./ollama-LD6OENM2.js"),{openCodeFactory:n}=await import("./opencode-ECTBCC3O.js"),{kiroFactory:p}=await import("./kiro-JGEZGFF3.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
2
+ import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-PPSDIDOI.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-GWZUQPFD.js";import{a as A,b as C}from"./chunk-JUOSGSVB.js";import{a as M,b as w}from"./chunk-EKUJSZIR.js";import{a as I,b as T}from"./chunk-A2IW6BXT.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-BJLUDX4R.js";import"./chunk-J7YTWK67.js";import"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-QBGNUIP3.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-S2SGKOBE.js"),{ollamaFactory:c}=await import("./ollama-IRQSLTDB.js"),{openCodeFactory:n}=await import("./opencode-74XXXUQ2.js"),{kiroFactory:p}=await import("./kiro-LNQTCWQU.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-VVWAUS3D.js";import"./chunk-LSET5TD3.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-3QF3I2RD.js";import"./chunk-3IZX4OZ7.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as A,i as B}from"./chunk-6VHZQNHX.js";import{b as y,c as z}from"./chunk-6E6JUBFH.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,t as buildCommand,z as clearWorkerdEnv,A as createRuntime,x as detectExecutionContext,s as detectInvoker,g as detectRuntime,n as getArch,w as getCliPrefix,o as getHomedir,m as getPlatform,q as getPlatformInfo,h as getRuntimeVersion,p as getTmpdir,j as isBrowser,u as isCommandInPath,l as isEdge,i as isRuntime,k as isServer,v as matchCliPrefix,y as populateEnvFromContext,f as posixPath,r as resolvePathDirs,B as runtime,e as toPosix};
2
+ import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as A,i as B}from"./chunk-WJKE6XHF.js";import{b as y,c as z}from"./chunk-6E6JUBFH.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,t as buildCommand,z as clearWorkerdEnv,A as createRuntime,x as detectExecutionContext,s as detectInvoker,g as detectRuntime,n as getArch,w as getCliPrefix,o as getHomedir,m as getPlatform,q as getPlatformInfo,h as getRuntimeVersion,p as getTmpdir,j as isBrowser,u as isCommandInPath,l as isEdge,i as isRuntime,k as isServer,v as matchCliPrefix,y as populateEnvFromContext,f as posixPath,r as resolvePathDirs,B as runtime,e as toPosix};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d,e,f,g}from"./chunk-F2YHX6DL.js";import"./chunk-MBCPGD5L.js";import"./chunk-J2Z7NG2X.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import"./chunk-BLXGL5MA.js";import"./chunk-3QH27NOC.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as completionsHandler,f as doctorHandler,g as infoHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
@@ -0,0 +1,9 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import"./chunk-5WJ6AUNY.js";var A=await import("node:fs"),r=t=>{try{return A.statSync(t),!0}catch{return!1}},_=t=>{let s=globalThis;if(typeof s.process<"u"&&typeof s.process.env=="object")return s.process.env[t]??void 0},W=t=>{if(t!==void 0)return t;let s=globalThis;return typeof s.__dirname=="string"?s.__dirname:typeof s.process<"u"&&typeof s.process.cwd=="function"?s.process.cwd():"."},y={command:"eser-ajan.wasm",reactor:"eser-ajan-reactor.wasm"},h=(t="command",s)=>{let e=y[t]??y.command,a=t==="reactor"?"wasi-reactor":"wasi",o=[],c=_("ESER_AJAN_WASM_PATH");if(c!==void 0){if(r(c))return c;o.push(`$ESER_AJAN_WASM_PATH = ${c}`)}let i=W(s),d=`${i}/${e}`;if(o.push(d),r(d))return d;let g=`${i}/..`,m=`${g}/dist/${a}/${e}`;if(o.push(m),r(m))return m;let f=`${i}/dist/${a}/${e}`;if(o.push(f),r(f))return f;let u=globalThis,p=typeof u.process<"u"&&typeof u.process.cwd=="function"?u.process.cwd():".";if(p!==i){let n=`${p}/pkg/@eser/ajan/dist/${a}/${e}`;if(o.push(n),r(n))return n}let $=[i,g,p];for(let n of $){let l=`${n}/node_modules/@eserstack/ajan-wasm/${e}`;if(o.push(l),r(l))return l}let P=[`/usr/local/lib/${e}`,`/usr/lib/${e}`];for(let n of P)if(o.push(n),r(n))return n;throw new Error(`Could not find eser-ajan WASM module (${e}).
3
+ Checked the following locations:
4
+ `+o.map(n=>` - ${n}`).join(`
5
+ `)+`
6
+
7
+ To fix this:
8
+ 1. Install: npm install @eser/ajan
9
+ 2. Or set ESER_AJAN_WASM_PATH to the full path of ${e}`)};var w=import.meta.dirname,b=(t="command")=>{try{return h(t,w),!0}catch{return!1}},S=async t=>{let s=t?.mode??"command",e=t?.wasmPath??h(s,w);if(s==="reactor"){let{loadReactorWasm:o}=await import("./loader-reactor-P6I3MX5L.js");return o(e)}let{loadCommandWasm:a}=await import("./loader-command-I5DTYP25.js");return a(e)};export{b as isWasmAvailable,S as loadEserAjanWasm};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d,e,f}from"./chunk-BLXGL5MA.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as CommandBuilder,a as CommandError,f as ProcessGroup,d as exec,c as parseCommand,e as spawnPty};
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-MBG7SPPO.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-5MVJUALI.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import{b as v}from"./chunk-BQT5RJZB.js";import{e as te}from"./chunk-5WJ6AUNY.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
2
+ import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-ZC4F4MYU.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-BLXGL5MA.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import{b as v}from"./chunk-BQT5RJZB.js";import{e as te}from"./chunk-5WJ6AUNY.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
3
3
  ${n.join(`
4
- `)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\-]/g,"\\$&").replace(/\*\*/g,"\0GLOBSTAR\0").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(de(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!pe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".eser/manifest.yml",".eser/manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var Ge=async r=>{let t=O(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
4
+ `)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\0GLOBSTAR\0").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(de(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!pe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".eser/manifest.yml",".eser/manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var Ge=async r=>{let t=O(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
5
5
 
6
6
  Options:
7
7
  -p, --path <dir> Target directory (default: .)
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as n}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var h=q.getLogger(["laroux","image-optimizer"]),$=null;async function j(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var F={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function B(i){let r=[],o=["jpg","jpeg","png","gif","webp"];async function a(t){try{for await(let e of n.fs.readDir(t)){let s=n.path.resolve(t,e.name);e.isDirectory?await a(s):e.isFile&&S(e.name.toLowerCase(),o)&&r.push(s)}}catch{}}return await a(i),r}async function E(i,r){return`data:image/webp;base64,${(await(await j())(i).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function C(i,r,o,a={}){let t=await j(),e={...F,...a},s=t(i),l=await s.metadata();if(l.width===void 0||l.height===void 0)throw new Error(`Could not read image dimensions: ${i}`);let u=l.width,w=l.height,y=u/w,m=n.path.extname(i),p=m.slice(1).toLowerCase(),f=n.path.basename(i,m),x=`${o}/${f}`,I=[];for(let c of e.widths){if(c>u)continue;let O=Math.round(c/y);for(let b of e.formats){let z,d;b==="original"?(d=p,z=n.path.resolve(r,`${f}-${c}w.${p}`)):(d=b,z=n.path.resolve(r,`${f}-${c}w.${b}`)),await n.fs.ensureDir(n.path.dirname(z));let g=s.clone().resize(c,O,{fit:"cover"});b==="webp"?g=g.webp({quality:e.quality.webp}):b==="avif"?g=g.avif({quality:e.quality.avif}):d==="jpg"||d==="jpeg"?g=g.jpeg({quality:e.quality.jpeg}):d==="png"&&(g=g.png({quality:e.quality.png}));let P=await g.toBuffer();await n.fs.writeFile(z,P),I.push({path:z,format:d,width:c,height:O,size:P.length})}}let v;return e.generateBlurPlaceholder&&(v=await E(i,e.placeholderWidth)),{originalPath:i,publicPath:x,originalWidth:u,originalHeight:w,variants:I,blurDataUrl:v,aspectRatio:y}}async function V(i,r,o="/images",a={}){h.info(`Scanning for images in ${i}...`);let t=await B(i);if(t.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${t.length} image(s) to optimize`);let e={},s=0,l=0;for(let m of t)try{let p=await n.fs.stat(m);s+=p.size;let f=await C(m,r,o,a);e[m]=f;let x=f.variants.reduce((I,v)=>I+v.size,0);l+=x,h.debug(`Optimized: ${n.path.basename(m)} \u2192 ${f.variants.length} variants`)}catch(p){h.warn(`Failed to optimize ${m}: ${p instanceof Error?p.message:String(p)}`)}let u={timestamp:Date.now(),images:e},w=n.path.resolve(r,"image-manifest.json");await n.fs.ensureDir(n.path.dirname(w)),await n.fs.writeTextFile(w,JSON.stringify(u,null,2));let y=s>0?((1-l/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${t.length} images, ${y}% size reduction`),u}function M(i,r="webp"){return i.variants.filter(a=>a.format===r).sort((a,t)=>a.width-t.width).map(a=>`${a.path} ${a.width}w`).join(", ")}function D(i,r,o="webp"){let a=i.variants.filter(t=>t.format===o).sort((t,e)=>t.width-e.width);return a.find(t=>t.width>=r)??a.at(-1)}export{M as generateSrcset,D as getBestVariant,C as optimizeImage,V as optimizeImages,B as scanImages};
2
+ import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as n}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var h=q.getLogger(["laroux","image-optimizer"]),$=null;async function j(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var F={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function B(i){let r=[],o=["jpg","jpeg","png","gif","webp"];async function a(t){try{for await(let e of n.fs.readDir(t)){let s=n.path.resolve(t,e.name);e.isDirectory?await a(s):e.isFile&&S(e.name.toLowerCase(),o)&&r.push(s)}}catch{}}return await a(i),r}async function E(i,r){return`data:image/webp;base64,${(await(await j())(i).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function C(i,r,o,a={}){let t=await j(),e={...F,...a},s=t(i),l=await s.metadata();if(l.width===void 0||l.height===void 0)throw new Error(`Could not read image dimensions: ${i}`);let u=l.width,w=l.height,y=u/w,m=n.path.extname(i),p=m.slice(1).toLowerCase(),f=n.path.basename(i,m),x=`${o}/${f}`,I=[];for(let c of e.widths){if(c>u)continue;let O=Math.round(c/y);for(let b of e.formats){let z,d;b==="original"?(d=p,z=n.path.resolve(r,`${f}-${c}w.${p}`)):(d=b,z=n.path.resolve(r,`${f}-${c}w.${b}`)),await n.fs.ensureDir(n.path.dirname(z));let g=s.clone().resize(c,O,{fit:"cover"});b==="webp"?g=g.webp({quality:e.quality.webp}):b==="avif"?g=g.avif({quality:e.quality.avif}):d==="jpg"||d==="jpeg"?g=g.jpeg({quality:e.quality.jpeg}):d==="png"&&(g=g.png({quality:e.quality.png}));let P=await g.toBuffer();await n.fs.writeFile(z,P),I.push({path:z,format:d,width:c,height:O,size:P.length})}}let v;return e.generateBlurPlaceholder&&(v=await E(i,e.placeholderWidth)),{originalPath:i,publicPath:x,originalWidth:u,originalHeight:w,variants:I,blurDataUrl:v,aspectRatio:y}}async function V(i,r,o="/images",a={}){h.info(`Scanning for images in ${i}...`);let t=await B(i);if(t.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${t.length} image(s) to optimize`);let e={},s=0,l=0;for(let m of t)try{let p=await n.fs.stat(m);s+=p.size;let f=await C(m,r,o,a);e[m]=f;let x=f.variants.reduce((I,v)=>I+v.size,0);l+=x,h.debug(`Optimized: ${n.path.basename(m)} \u2192 ${f.variants.length} variants`)}catch(p){h.warn(`Failed to optimize ${m}: ${p instanceof Error?p.message:String(p)}`)}let u={timestamp:Date.now(),images:e},w=n.path.resolve(r,"image-manifest.json");await n.fs.ensureDir(n.path.dirname(w)),await n.fs.writeTextFile(w,JSON.stringify(u,null,2));let y=s>0?((1-l/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${t.length} images, ${y}% size reduction`),u}function M(i,r="webp"){return i.variants.filter(a=>a.format===r).sort((a,t)=>a.width-t.width).map(a=>`${a.path} ${a.width}w`).join(", ")}function D(i,r,o="webp"){let a=i.variants.filter(t=>t.format===o).sort((t,e)=>t.width-e.width);return a.find(t=>t.width>=r)??a.at(-1)}export{M as generateSrcset,D as getBestVariant,C as optimizeImage,V as optimizeImages,B as scanImages};