eser 4.1.40 → 4.1.41

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 (198) hide show
  1. package/chunks/{add-V7YYHLFH.js → add-IM5JC6QA.js} +1 -1
  2. package/chunks/approve-RQVNTLFH.js +2 -0
  3. package/chunks/{ask-PMB64QWG.js → ask-UTEI7KGQ.js} +1 -1
  4. package/chunks/block-3NE7YTL7.js +2 -0
  5. package/chunks/{build-HUKFUVPB.js → build-IRLEBMJE.js} +2 -2
  6. package/chunks/cancel-W5FDMXFI.js +2 -0
  7. package/chunks/{changelog-gen-JV3EHOMV.js → changelog-gen-USXHO6PE.js} +1 -1
  8. package/chunks/{chunk-VIQLCQOI.js → chunk-2BEIAJ5J.js} +1 -1
  9. package/chunks/{chunk-XYUJCTPP.js → chunk-2N62LL55.js} +1 -1
  10. package/chunks/{chunk-OPPOHKNZ.js → chunk-2OKCK56H.js} +1 -1
  11. package/chunks/{chunk-HTJLIAH4.js → chunk-2UHHAPKY.js} +1 -1
  12. package/chunks/{chunk-NZRU3N6C.js → chunk-3LDGQFQZ.js} +1 -1
  13. package/chunks/chunk-3PBNSBPA.js +12 -0
  14. package/chunks/{chunk-NJUIBCQR.js → chunk-3U5M6YO6.js} +1 -1
  15. package/chunks/{chunk-F5HQDZLN.js → chunk-4COCZPO5.js} +1 -1
  16. package/chunks/{chunk-BWDCKK63.js → chunk-4EJVA4QA.js} +1 -1
  17. package/chunks/{chunk-ECY4MUD3.js → chunk-5MVJUALI.js} +1 -1
  18. package/chunks/{chunk-AMMTAUXC.js → chunk-5Y5VGPYR.js} +1 -1
  19. package/chunks/chunk-6SSSHLEY.js +2 -0
  20. package/chunks/{chunk-HP5W5XT6.js → chunk-6V6C6MWY.js} +1 -1
  21. package/chunks/{chunk-WJKE6XHF.js → chunk-6VHZQNHX.js} +1 -1
  22. package/chunks/{chunk-UMKCOU3N.js → chunk-7RL5ZFGE.js} +1 -1
  23. package/chunks/{chunk-F35K7YVH.js → chunk-BNMKKNLB.js} +1 -1
  24. package/chunks/{chunk-OAFB4A6D.js → chunk-BSV66I74.js} +1 -1
  25. package/chunks/{chunk-DWLFTRZS.js → chunk-CXTPYPO4.js} +1 -1
  26. package/chunks/{chunk-5RX5V5BA.js → chunk-DRCKMHUI.js} +1 -1
  27. package/chunks/{chunk-4EHAL3NK.js → chunk-E423U2PP.js} +1 -1
  28. package/chunks/chunk-ENNZWOEX.js +4 -0
  29. package/chunks/{chunk-MBCPGD5L.js → chunk-EXP2TZZC.js} +1 -1
  30. package/chunks/{chunk-TEOMM3RD.js → chunk-GKOMIH2B.js} +1 -1
  31. package/chunks/{chunk-BBOEAL63.js → chunk-H5GHXMIT.js} +1 -1
  32. package/chunks/{chunk-MOY4CXAZ.js → chunk-H6HLRKRK.js} +2 -2
  33. package/chunks/chunk-H7FWYKMD.js +82 -0
  34. package/chunks/{chunk-YEWODYET.js → chunk-H7U2VQCK.js} +1 -1
  35. package/chunks/{chunk-L7UCWRDZ.js → chunk-IBB6UZR2.js} +1 -1
  36. package/chunks/{chunk-AHKNU2JM.js → chunk-IBBGWXAI.js} +1 -1
  37. package/chunks/{chunk-ZWMJQZQF.js → chunk-IQQEVKBP.js} +1 -1
  38. package/chunks/{chunk-WILZ4OR2.js → chunk-IWXI3UYI.js} +1 -1
  39. package/chunks/{chunk-H2O5G3XB.js → chunk-JZ7DUWYC.js} +1 -1
  40. package/chunks/{chunk-EGMYM4TM.js → chunk-KZAPWWOT.js} +1 -1
  41. package/chunks/{chunk-4FGLERUG.js → chunk-L7RS6MQ5.js} +1 -1
  42. package/chunks/{chunk-3IZX4OZ7.js → chunk-LSET5TD3.js} +1 -1
  43. package/chunks/{chunk-WAEXOK7L.js → chunk-LYKN5EIM.js} +1 -1
  44. package/chunks/{chunk-ZC4F4MYU.js → chunk-MBG7SPPO.js} +1 -1
  45. package/chunks/{chunk-OAT2D23A.js → chunk-MPGRKZIA.js} +1 -1
  46. package/chunks/{chunk-MQ4EMT35.js → chunk-OEUVCV5C.js} +1 -1
  47. package/chunks/chunk-OM5GSS2H.js +7 -0
  48. package/chunks/{chunk-L2E2H7YT.js → chunk-OWQXQ33F.js} +1 -1
  49. package/chunks/{chunk-RVJZFWN7.js → chunk-QD46ROBD.js} +1 -1
  50. package/chunks/{chunk-HVTJ5LVU.js → chunk-QMRKAC6C.js} +1 -1
  51. package/chunks/{chunk-ILROPD5P.js → chunk-QYMHLTVT.js} +1 -1
  52. package/chunks/{chunk-KEOTIPA6.js → chunk-RFHWH6ZX.js} +1 -1
  53. package/chunks/{chunk-TLVGNOK3.js → chunk-RIOYVPPP.js} +1 -1
  54. package/chunks/{chunk-OWV223WQ.js → chunk-SF6FT44C.js} +1 -1
  55. package/chunks/{chunk-QFFGKP3M.js → chunk-SH4H7OLV.js} +1 -1
  56. package/chunks/{chunk-T4WKRBQZ.js → chunk-SK6QUPJR.js} +1 -1
  57. package/chunks/{chunk-O2TA7OHJ.js → chunk-SMKZDN2Q.js} +1 -1
  58. package/chunks/{chunk-DKFL6XPX.js → chunk-TELZ2ZFI.js} +1 -1
  59. package/chunks/{chunk-4QDEJUAF.js → chunk-TYLYMZQC.js} +1 -1
  60. package/chunks/{chunk-ULNEO3RY.js → chunk-UQRZJPYH.js} +1 -1
  61. package/chunks/{chunk-3AA3RXKD.js → chunk-V3NJTF2Y.js} +1 -1
  62. package/chunks/{chunk-K2MKYDPY.js → chunk-V6YI7YJ4.js} +1 -1
  63. package/chunks/{chunk-LBMJGMDD.js → chunk-VE6XM5OZ.js} +1 -1
  64. package/chunks/{chunk-A6K5L4SG.js → chunk-VNJJQED3.js} +1 -1
  65. package/chunks/{chunk-3QF3I2RD.js → chunk-VVWAUS3D.js} +1 -1
  66. package/chunks/{chunk-CMSPX2RN.js → chunk-WPOZMPUR.js} +1 -1
  67. package/chunks/{chunk-2KKLYXSA.js → chunk-WWI6727S.js} +1 -1
  68. package/chunks/{chunk-PXCM4FHO.js → chunk-XOSAN6PX.js} +1 -1
  69. package/chunks/{chunk-MEZCXQAX.js → chunk-YJ3ICGHV.js} +1 -1
  70. package/chunks/{chunk-P72TUTYK.js → chunk-YURNTYEP.js} +1 -1
  71. package/chunks/{chunk-U5Q5MC74.js → chunk-Z2LXZLZV.js} +1 -1
  72. package/chunks/{chunk-QXATB6Z5.js → chunk-ZEFYMWGZ.js} +1 -1
  73. package/chunks/{chunk-5224ZYEW.js → chunk-ZRUM5PE7.js} +1 -1
  74. package/chunks/claude-code-VX2T4YII.js +2 -0
  75. package/chunks/{clone-YEBQK7CG.js → clone-DSVKII72.js} +1 -1
  76. package/chunks/{cmd-2DAVTVOF.js → cmd-YU4MVRRR.js} +1 -1
  77. package/chunks/{commitmsg-FQ3IZ3TH.js → commitmsg-FS52L6J5.js} +2 -2
  78. package/chunks/{concern-TIGYH5DX.js → concern-BWZV4KBS.js} +1 -1
  79. package/chunks/{deno-XQHOVHKR.js → deno-I5YAWOB6.js} +1 -1
  80. package/chunks/{dev-BNGJJR2O.js → dev-QZF2X7YC.js} +2 -2
  81. package/chunks/done-44REMKQ4.js +2 -0
  82. package/chunks/{file-tools-shared-KBTCO2FV.js → file-tools-shared-LMF72D6S.js} +1 -1
  83. package/chunks/{gh-Q7VEABJS.js → gh-FKZHTNFN.js} +2 -2
  84. package/chunks/{gh-contributors-4KGARSNL.js → gh-contributors-3MFKDSG3.js} +1 -1
  85. package/chunks/{init-45ODFAV3.js → init-RIVFJ2HP.js} +1 -1
  86. package/chunks/{init-RV7K5JC4.js → init-ZOMBOUG3.js} +3 -3
  87. package/chunks/{install-6XIQS5E7.js → install-WD65EAID.js} +1 -1
  88. package/chunks/{invoke-hook-Q3NMJXDO.js → invoke-hook-CPYBTKLO.js} +3 -3
  89. package/chunks/kiro-JGEZGFF3.js +2 -0
  90. package/chunks/{list-NYLFIF2U.js → list-NS7ECFDY.js} +1 -1
  91. package/chunks/{list-UQMPOF5Y.js → list-PSLAM3H6.js} +1 -1
  92. package/chunks/{list-BOLPKAEY.js → list-XFPTCIMR.js} +1 -1
  93. package/chunks/{load-config-G4DHKB5K.js → load-config-OGSPRY4L.js} +1 -1
  94. package/chunks/{main-236QYA7G.js → main-BUEG2IMJ.js} +2 -2
  95. package/chunks/{manifest-3VJ4O6HR.js → manifest-4EA74HMS.js} +1 -1
  96. package/chunks/{mod-QWYXFGRG.js → mod-2PIV6QCE.js} +1 -1
  97. package/chunks/{mod-IHYN4TEM.js → mod-ERJSLSPA.js} +2 -2
  98. package/chunks/{mod-DXA25A4J.js → mod-G7PJEGW6.js} +1 -1
  99. package/chunks/{mod-YH5Z6G4Q.js → mod-II7CSZUT.js} +1 -1
  100. package/chunks/mod-JWUOEEMP.js +2 -0
  101. package/chunks/{mod-BQJDMCYC.js → mod-KTGLCC3R.js} +1 -1
  102. package/chunks/{mod-GSWVSC2C.js → mod-Q6SI6S6S.js} +1 -1
  103. package/chunks/{mod-EWLBSEHA.js → mod-RO7WP3SA.js} +1 -1
  104. package/chunks/{mod-PZSJGUM7.js → mod-U2MNO6EC.js} +1 -1
  105. package/chunks/{mod-IXVUQHXS.js → mod-WOZXOD2F.js} +1 -1
  106. package/chunks/{mod-SXL6PDQM.js → mod-XEK7FROU.js} +1 -1
  107. package/chunks/{new-U5U4E6HR.js → new-3ZN4U7FJ.js} +1 -1
  108. package/chunks/next-QNLI4Z6Y.js +9 -0
  109. package/chunks/ollama-LD6OENM2.js +2 -0
  110. package/chunks/opencode-ECTBCC3O.js +2 -0
  111. package/chunks/{purge-RM6OD5PV.js → purge-565VM3XK.js} +1 -1
  112. package/chunks/{recipe-applier-TTZEZGSC.js → recipe-applier-6SGY2W3A.js} +1 -1
  113. package/chunks/{registry-fetcher-SPENFEOH.js → registry-fetcher-H63ZWZHU.js} +1 -1
  114. package/chunks/{release-UEX6YK4K.js → release-6I5TL34I.js} +2 -2
  115. package/chunks/{release-notes-GA7CTA54.js → release-notes-GJ4EBMTD.js} +1 -1
  116. package/chunks/{release-tag-VJWBXG5G.js → release-tag-IOH5HGAA.js} +1 -1
  117. package/chunks/reopen-T5ZROS7Y.js +2 -0
  118. package/chunks/reset-EDANY7W4.js +2 -0
  119. package/chunks/{rule-ZQOGLQQI.js → rule-SMPE3A72.js} +1 -1
  120. package/chunks/{run-L35K3KRF.js → run-FGMEIO57.js} +1 -1
  121. package/chunks/run-VPRSGIHR.js +4 -0
  122. package/chunks/{scripts-VI2TKQOH.js → scripts-L2FZBUHU.js} +1 -1
  123. package/chunks/{serve-AVVEYGQB.js → serve-R7XGF4EL.js} +2 -2
  124. package/chunks/{server-R347ON4B.js → server-KJW4HWK7.js} +1 -1
  125. package/chunks/spec-WGXL4BOE.js +2 -0
  126. package/chunks/status-65FD7MJB.js +2 -0
  127. package/chunks/{sync-PB4KWB3R.js → sync-EIMJAEA7.js} +1 -1
  128. package/chunks/{system-KMRRIKMQ.js → system-5OWRHFDI.js} +1 -1
  129. package/chunks/{system-BXJ2LV5O.js → system-X4X6JD4X.js} +1 -1
  130. package/chunks/{update-522VXIKX.js → update-CV7JPZGM.js} +1 -1
  131. package/chunks/validate-bom-5IPW3R4O.js +2 -0
  132. package/chunks/validate-case-conflict-5XOPS6HD.js +2 -0
  133. package/chunks/validate-circular-deps-WME7VUO4.js +2 -0
  134. package/chunks/validate-commit-msg-MEQH6ADP.js +2 -0
  135. package/chunks/validate-docs-LBWVCSN2.js +2 -0
  136. package/chunks/validate-eof-56S7THGQ.js +2 -0
  137. package/chunks/validate-export-names-YJGQHPGF.js +2 -0
  138. package/chunks/validate-filenames-DJF7GO3C.js +2 -0
  139. package/chunks/validate-json-2OMEH67D.js +2 -0
  140. package/chunks/validate-large-files-OE4P7FD7.js +2 -0
  141. package/chunks/validate-licenses-BNEQDBKC.js +2 -0
  142. package/chunks/validate-line-endings-PHV2ZK7V.js +2 -0
  143. package/chunks/validate-merge-conflict-XN3376IV.js +2 -0
  144. package/chunks/validate-mod-exports-D2Q5GV76.js +2 -0
  145. package/chunks/{validate-package-configs-3Y55ZLUY.js → validate-package-configs-ZO5YJE2D.js} +1 -1
  146. package/chunks/validate-secrets-ZMBKEXOK.js +2 -0
  147. package/chunks/validate-shebangs-3OR2L3RH.js +2 -0
  148. package/chunks/validate-submodules-HIYYVQDP.js +2 -0
  149. package/chunks/validate-symlinks-QMLLO5R3.js +2 -0
  150. package/chunks/validate-toml-U77NIEDN.js +2 -0
  151. package/chunks/validate-trailing-whitespace-UE7AOZEZ.js +2 -0
  152. package/chunks/validate-yaml-UX2VQJJT.js +2 -0
  153. package/chunks/versions-OKK45EDV.js +2 -0
  154. package/chunks/watch-Y3ARCBAW.js +9 -0
  155. package/chunks/wontfix-FSTUJ7T6.js +2 -0
  156. package/eser.js +1 -1
  157. package/package.json +1 -1
  158. package/chunks/approve-HVIH2A3C.js +0 -2
  159. package/chunks/block-JSK5CJPO.js +0 -2
  160. package/chunks/chunk-7UASU4NU.js +0 -10
  161. package/chunks/chunk-A3JJKZ4C.js +0 -4
  162. package/chunks/chunk-JI536JLJ.js +0 -2
  163. package/chunks/chunk-NEHZOG23.js +0 -7
  164. package/chunks/chunk-RGUPFAEE.js +0 -68
  165. package/chunks/claude-code-ELUDT5TV.js +0 -2
  166. package/chunks/done-GGPPHJW2.js +0 -2
  167. package/chunks/kiro-NZ7LM6HA.js +0 -2
  168. package/chunks/mod-L26IBE5V.js +0 -2
  169. package/chunks/next-AQ4TIEL7.js +0 -9
  170. package/chunks/ollama-LHWMXMLY.js +0 -2
  171. package/chunks/opencode-24O2MW3L.js +0 -2
  172. package/chunks/reset-WHYTPTFB.js +0 -2
  173. package/chunks/run-IX74MQTI.js +0 -4
  174. package/chunks/spec-KMKZDLV2.js +0 -2
  175. package/chunks/status-MLX4O37A.js +0 -2
  176. package/chunks/validate-bom-JCMRVAUT.js +0 -2
  177. package/chunks/validate-case-conflict-WZQCMKSZ.js +0 -2
  178. package/chunks/validate-circular-deps-7R4F2YDV.js +0 -2
  179. package/chunks/validate-commit-msg-PH7Y3JEI.js +0 -2
  180. package/chunks/validate-docs-WCIOHNYP.js +0 -2
  181. package/chunks/validate-eof-KRYQLTFQ.js +0 -2
  182. package/chunks/validate-export-names-OCQ2XSY6.js +0 -2
  183. package/chunks/validate-filenames-46O7FCXF.js +0 -2
  184. package/chunks/validate-json-3EZ2L64H.js +0 -2
  185. package/chunks/validate-large-files-7YX6MSOB.js +0 -2
  186. package/chunks/validate-licenses-OC7JRVAH.js +0 -2
  187. package/chunks/validate-line-endings-2DM5UGCJ.js +0 -2
  188. package/chunks/validate-merge-conflict-UDMWYMJ5.js +0 -2
  189. package/chunks/validate-mod-exports-W24IV367.js +0 -2
  190. package/chunks/validate-secrets-66VXCCUF.js +0 -2
  191. package/chunks/validate-shebangs-AMEAHVLB.js +0 -2
  192. package/chunks/validate-submodules-DYCE27WK.js +0 -2
  193. package/chunks/validate-symlinks-QN744GUH.js +0 -2
  194. package/chunks/validate-toml-5K2XNHAE.js +0 -2
  195. package/chunks/validate-trailing-whitespace-QYWHHIAK.js +0 -2
  196. package/chunks/validate-yaml-VGKLHEAQ.js +0 -2
  197. package/chunks/versions-FYALONNL.js +0 -2
  198. package/chunks/watch-P56QT3Q2.js +0 -9
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as d}from"./chunk-ULNEO3RY.js";import{b as p}from"./chunk-NBA6EFWU.js";var c="2023",u=new RegExp(`// Copyright ([0-9]{4})-present Eser Ozvataf and other contributors\\. All rights reserved\\. ([0-9A-Za-z-.]+) license\\.
2
+ import{a as d}from"./chunk-UQRZJPYH.js";import{b as p}from"./chunk-NBA6EFWU.js";var c="2023",u=new RegExp(`// Copyright ([0-9]{4})-present Eser Ozvataf and other contributors\\. All rights reserved\\. ([0-9A-Za-z-.]+) license\\.
3
3
  `),l=`// Copyright ${c}-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license.`,T=[/docs\//,/etc\/templates\//,/manifest\.gen\.ts$/],g=t=>T.some(e=>e.test(t)),x=(t,e,r)=>{if(e===void 0||g(t.path))return[];let s=e.startsWith("#!")?e.indexOf(`
4
4
  `)+1:0,n=e.slice(s).match(u);return n!==null?n[1]===c?[]:[{path:t.path,message:"incorrect copyright year",fixed:r.fix}]:[{path:t.path,message:"missing copyright header",fixed:r.fix}]},E=(t,e,r)=>{if(g(t.path))return;let a=e.startsWith("#!"),s=a?e.indexOf(`
5
5
  `)+1:0,i=e.slice(s),n=i.match(u);if(n!==null&&n[1]===c)return;let o;if(n!==null){let f=e.slice(0,s),m=i.replace(n[0],"");o=`${f}${l}
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{i as c}from"./chunk-WJKE6XHF.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
2
+ import{i as c}from"./chunk-6VHZQNHX.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
3
3
  `)){let s=l.trim();if(s.startsWith("## ")){i=s.slice(3).trim().toLowerCase();continue}if(i.startsWith("tasks")){let a=s.match(/^-\s*\[[ x]\]\s*(task-\d+):\s*(.+)$/i);a!==null&&e.push({id:a[1],title:a[2].trim()})}i.startsWith("out of scope")&&s.startsWith("- ")&&t.push(s.slice(2).trim()),i.startsWith("verification")&&s.startsWith("- ")&&o.push(s.slice(2).trim())}return{name:n,tasks:e,outOfScope:t,verification:o}},u=(n,r)=>{let e=new Set(r);for(let t of n)if(!e.has(t.id))return t;return null};export{f as a,d as b,u as c};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as F,c as p}from"./chunk-DWLFTRZS.js";import{a as g,c as h}from"./chunk-4FGLERUG.js";import{l as c}from"./chunk-H2O5G3XB.js";import{a as x}from"./chunk-MG65QJY6.js";import{g as d}from"./chunk-FFWPJP7A.js";var{ctx:m,output:E}=g(),b=e=>{let y=async s=>{let i={root:s?.root??".",fix:s?.fix??!1,exclude:s?.exclude??[],...e.defaults,...s},r=s?._changedFiles,t={root:i.root,extensions:e.extensions,exclude:i.exclude,includeOnly:r!==void 0&&r.length>0?r:void 0},l=await F(t),n=[],u=[];if(e.checkAll!==void 0){let o=await e.checkAll(l,i);n.push(...o)}else if(e.checkFile!==void 0)for(let o of l){let a=await p(o),f=e.checkFile(o,a,i);n.push(...f)}if(i.fix&&e.canFix&&e.fixFile!==void 0)for(let o of l){let a=await p(o);if(a===void 0)continue;let f=e.fixFile(o,a,i);f!==void 0&&u.push(f)}return{name:e.name,issues:n,mutations:u,filesChecked:l.length}},k={name:e.name,description:e.description,requiredStacks:e.stacks,async validate(s){let i=s.options?.fix,r=s.options??{},t=await y({root:s.root,fix:i??!1,exclude:[],...r});return{name:e.name,passed:t.issues.length===0,issues:t.issues.map(l=>({severity:"error",message:`${l.message}${l.fixed?" (fixed)":""}`,file:l.path,line:l.line})),stats:{filesChecked:t.filesChecked,issuesFound:t.issues.length,fixedCount:t.mutations.length}}}},T=async s=>{let i=e.canFix&&s.flags.fix===!0,r=s.flags.root??".",t=s.flags.exclude,l=t!==void 0?Array.isArray(t)?t:[t]:[];try{let n=await y({root:r,fix:i,exclude:l});if(n.mutations.length>0){let{writeMutations:o}=await import("./file-tools-shared-KBTCO2FV.js"),a=await o(n.mutations);c.success(m,`Fixed ${a} file(s) for ${e.name}.`)}if(n.issues.length===0&&n.mutations.length===0)return c.success(m,`${e.name}: ${n.filesChecked} files checked, no issues.`),d.ok(void 0);let u=n.issues.filter(o=>!o.fixed);if(u.length>0){for(let o of u){let a=o.line!==void 0?`${o.path}:${o.line}`:o.path;c.error(m,`${a}: ${o.message}`)}return d.fail({exitCode:1})}return d.ok(void 0)}catch(n){return c.error(m,n instanceof Error?n.message:String(n)),d.fail({exitCode:1})}};return{config:e,run:y,validator:k,main:async s=>{let i=e.canFix?["fix"]:[],r=x(s??[],{boolean:[...i,"help"],string:["root","exclude"],alias:{h:"help"}});if(r.help)return console.log(`eser codebase ${e.name} \u2014 ${e.description}
2
+ import{b as F,c as p}from"./chunk-CXTPYPO4.js";import{a as g,c as h}from"./chunk-L7RS6MQ5.js";import{l as c}from"./chunk-JZ7DUWYC.js";import{a as x}from"./chunk-MG65QJY6.js";import{g as d}from"./chunk-FFWPJP7A.js";var{ctx:m,output:E}=g(),b=e=>{let y=async s=>{let i={root:s?.root??".",fix:s?.fix??!1,exclude:s?.exclude??[],...e.defaults,...s},r=s?._changedFiles,t={root:i.root,extensions:e.extensions,exclude:i.exclude,includeOnly:r!==void 0&&r.length>0?r:void 0},l=await F(t),n=[],u=[];if(e.checkAll!==void 0){let o=await e.checkAll(l,i);n.push(...o)}else if(e.checkFile!==void 0)for(let o of l){let a=await p(o),f=e.checkFile(o,a,i);n.push(...f)}if(i.fix&&e.canFix&&e.fixFile!==void 0)for(let o of l){let a=await p(o);if(a===void 0)continue;let f=e.fixFile(o,a,i);f!==void 0&&u.push(f)}return{name:e.name,issues:n,mutations:u,filesChecked:l.length}},k={name:e.name,description:e.description,requiredStacks:e.stacks,async validate(s){let i=s.options?.fix,r=s.options??{},t=await y({root:s.root,fix:i??!1,exclude:[],...r});return{name:e.name,passed:t.issues.length===0,issues:t.issues.map(l=>({severity:"error",message:`${l.message}${l.fixed?" (fixed)":""}`,file:l.path,line:l.line})),stats:{filesChecked:t.filesChecked,issuesFound:t.issues.length,fixedCount:t.mutations.length}}}},T=async s=>{let i=e.canFix&&s.flags.fix===!0,r=s.flags.root??".",t=s.flags.exclude,l=t!==void 0?Array.isArray(t)?t:[t]:[];try{let n=await y({root:r,fix:i,exclude:l});if(n.mutations.length>0){let{writeMutations:o}=await import("./file-tools-shared-LMF72D6S.js"),a=await o(n.mutations);c.success(m,`Fixed ${a} file(s) for ${e.name}.`)}if(n.issues.length===0&&n.mutations.length===0)return c.success(m,`${e.name}: ${n.filesChecked} files checked, no issues.`),d.ok(void 0);let u=n.issues.filter(o=>!o.fixed);if(u.length>0){for(let o of u){let a=o.line!==void 0?`${o.path}:${o.line}`:o.path;c.error(m,`${a}: ${o.message}`)}return d.fail({exitCode:1})}return d.ok(void 0)}catch(n){return c.error(m,n instanceof Error?n.message:String(n)),d.fail({exitCode:1})}};return{config:e,run:y,validator:k,main:async s=>{let i=e.canFix?["fix"]:[],r=x(s??[],{boolean:[...i,"help"],string:["root","exclude"],alias:{h:"help"}});if(r.help)return console.log(`eser codebase ${e.name} \u2014 ${e.description}
3
3
  `),console.log(`Usage: eser codebase ${e.name} [options]
4
4
  `),console.log("Options:"),e.canFix&&console.log(" --fix Auto-fix issues"),console.log(" --root <dir> Root directory (default: .)"),console.log(" --exclude <p> Exclude pattern"),console.log(" -h, --help Show this help"),d.ok(void 0);let t=h(e.name,r);return await T(t)}}};export{b as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{i as l}from"./chunk-WJKE6XHF.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
2
+ import{i as l}from"./chunk-6VHZQNHX.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
3
3
  `)},k=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&t.push(`[${i}]`);let o=e(n,"instruction");o!==void 0&&t.push(o);let a=e(n,"questions");if(a!==void 0&&a.length>0){for(let u of a)if(t.push(""),t.push(`Question [${u.id}]: ${u.text}`),u.extras!==void 0)for(let g of u.extras)t.push(` - ${g}`)}let h=e(n,"statusReport");if(h!==void 0){t.push(""),t.push("Criteria:");for(let u of h.criteria)t.push(` - ${u}`)}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(""),t.push(p.note);for(let u of p.items)t.push(` - ${u}`)}e(n,"verificationFailed")===!0&&(t.push(""),t.push(`Verification failed: ${String(e(n,"verificationOutput")??"").slice(0,200)}`));let c=e(n,"meta");c!==void 0&&(t.push(""),t.push(c.resumeHint));let f=e(n,"summary");f!==void 0&&t.push(`Spec: ${f.spec}, Iterations: ${f.iterations}, Decisions: ${f.decisionsCount}`);let d=e(n,"clearContext");return d!==void 0&&(t.push(""),t.push(d.reason)),t.join(`
4
4
  `)},b=(s,n)=>{switch(n){case"markdown":return w(s);case"text":return k(s);default:return $(s)}},v=async(s,n)=>{let t=b(s,n),i=new TextEncoder,o=l.process.stdout.getWriter();await o.write(i.encode(t+`
5
5
  `)),o.releaseLock()};export{F as a,O as b,b as c,v as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as k}from"./chunk-NBA6EFWU.js";import{d as F,f as T,h as C,j as d,k as L,n as u}from"./chunk-7ATUODBM.js";import{a as g}from"./chunk-AP72BKVG.js";import{i as D}from"./chunk-WJKE6XHF.js";var R={USE_CLIENT:"use client",USE_SERVER:"use server",USE_STRICT:"use strict"},M=[/node_modules/,/\.test\./,/\.spec\./],G=(t,e)=>{let r=t.split(`
2
+ import{b as k}from"./chunk-NBA6EFWU.js";import{d as F,f as T,h as C,j as d,k as L,n as u}from"./chunk-7ATUODBM.js";import{a as g}from"./chunk-AP72BKVG.js";import{i as D}from"./chunk-6VHZQNHX.js";var R={USE_CLIENT:"use client",USE_SERVER:"use server",USE_STRICT:"use strict"},M=[/node_modules/,/\.test\./,/\.spec\./],G=(t,e)=>{let r=t.split(`
3
3
  `),i=e.toLowerCase(),o=!1;for(let s=0;s<Math.min(50,r.length);s++){let n=r[s]?.trim()??"";if(o){n.includes("*/")&&(o=!1);continue}if(n===""||n.startsWith("//"))continue;if(n.startsWith("/*")){n.includes("*/")||(o=!0);continue}let f=`"${i}";`,a=`'${i}';`,l=n.toLowerCase();if(l===f||l===a)return!0;if(n.startsWith("import")||n.startsWith("export")||n.startsWith("const")||n.startsWith("let")||n.startsWith("var")||n.startsWith("function")||n.startsWith("class"))break}return!1},W=t=>{let e=new Set,r=t.matchAll(/export\s+(?:async\s+)?function\s+(\w+)/g);for(let n of r)n[1]!==void 0&&e.add(n[1]);let i=t.matchAll(/export\s+(?:const|let)\s+(\w+)\s*=/g);for(let n of i)n[1]!==void 0&&e.add(n[1]);let o=t.matchAll(/export\s+class\s+(\w+)/g);for(let n of o)n[1]!==void 0&&e.add(n[1]);/export\s+default\s+/.test(t)&&e.add("default");let s=t.matchAll(/export\s*\{([\w\s,]+)\}/g);for(let n of s)if(n[1]!==void 0){let f=n[1].split(",").map(a=>{let l=a.trim().split(/ {1,10}as {1,10}/);return(l[1]??l[0])?.trim()});for(let a of f)a!==void 0&&a!==""&&e.add(a)}return[...e]},O=async t=>{try{return await D.fs.readTextFile(t)}catch{return null}},Q=async(t,e,r={})=>{let i=r.extensions??k,o=r.skip??M,s=r.projectRoot??t,n=[];for await(let f of D.fs.walk(t,{exts:[...i],skip:[...o]})){if(!f.isFile)continue;let a=await O(f.path);if(a!==null&&G(a,e)){let l=D.path.relative(s,f.path),m=W(a);n.push({filePath:f.path,relativePath:l,directive:e,exports:m})}}return n},Y=(t,e={})=>Q(t,R.USE_CLIENT,e),X=(t,e)=>{let r=`"${e}"`,i=`'${e}'`;return t.includes(r)||t.includes(i)},Z=async(t,e={})=>{let r=e.extensions??k,i=e.skip??M,o=e.projectRoot??t,s=[];for await(let n of D.fs.walk(t,{exts:[...r],skip:[...i]})){if(!n.isFile)continue;let f=await O(n.path);if(f!==null&&X(f,R.USE_SERVER)){let a=D.path.relative(o,n.path),l=W(f);s.push({filePath:n.path,relativePath:a,directive:R.USE_SERVER,exports:l})}}return s};function w(t){return t.isFile?"file":t.isDirectory?"dir":t.isSymlink?"symlink":void 0}async function x(t){try{let e=await Deno.stat(t);_(e);return}catch(e){if(!(e instanceof Deno.errors.NotFound))throw e}try{await Deno.mkdir(t,{recursive:!0})}catch(e){if(!(e instanceof Deno.errors.AlreadyExists))throw e;let r=await Deno.stat(t);_(r)}}function _(t){if(!t.isDirectory)throw new Error(`Failed to ensure directory exists: expected 'dir', got '${w(t)}'`)}function c(t){return t instanceof URL?C(t):t}function P(t,e,r=T){if(t=c(t),e=c(e),u(t)===u(e))return!1;let i=t.split(r),o=e.split(r);return i.every((s,n)=>o[n]===s)}function S(t,e){if(t===null)throw new Error(`${e} is unavailable`)}async function I(t,e,r){let i;try{i=await Deno.lstat(e)}catch(o){if(o instanceof Deno.errors.NotFound)return;throw o}if(r.isFolder&&!i.isDirectory)throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'`);if(!r.overwrite)throw new Deno.errors.AlreadyExists(`'${e}' already exists.`);return i}async function N(t,e,r){if(await I(t,e,r),await Deno.copyFile(t,e),r.preserveTimestamps){let i=await Deno.stat(t);S(i.atime,"statInfo.atime"),S(i.mtime,"statInfo.mtime"),await Deno.utime(e,i.atime,i.mtime)}}async function U(t,e,r){await I(t,e,r);let i=await Deno.readLink(t),o=w(await Deno.lstat(t));if(g?await Deno.symlink(i,e,{type:o==="dir"?"dir":"file"}):await Deno.symlink(i,e),r.preserveTimestamps){let s=await Deno.lstat(t);S(s.atime,"statInfo.atime"),S(s.mtime,"statInfo.mtime"),await Deno.utime(e,s.atime,s.mtime)}}async function j(t,e,r){if(await I(t,e,{...r,isFolder:!0})||await x(e),r.preserveTimestamps){let s=await Deno.stat(t);S(s.atime,"statInfo.atime"),S(s.mtime,"statInfo.mtime"),await Deno.utime(e,s.atime,s.mtime)}t=c(t),e=c(e);let o=[];for await(let s of Deno.readDir(t)){let n=d(t,s.name),f=d(e,F(n));s.isSymlink?o.push(U(n,f,r)):s.isDirectory?o.push(j(n,f,r)):s.isFile&&o.push(N(n,f,r))}await Promise.all(o)}async function wt(t,e,r={}){if(t=u(c(t)),e=u(c(e)),t===e)throw new Error("Source and destination cannot be the same");let i=await Deno.lstat(t);if(i.isDirectory&&P(t,e))throw new Error(`Cannot copy '${t}' to a subdirectory of itself: '${e}'`);i.isSymlink?await U(t,e,r):i.isDirectory?await j(t,e,r):i.isFile&&await N(t,e,r)}async function Ft(t){try{let e=await Array.fromAsync(Deno.readDir(t));await Promise.all(e.map(r=>{if(r&&r.name){let i=d(c(t),r.name);return Deno.remove(i,{recursive:!0})}}))}catch(e){if(!(e instanceof Deno.errors.NotFound))throw e;await Deno.mkdir(t,{recursive:!0})}}async function A(t){t=c(t),t=L(t);let e=F(t),r=await Deno.stat(t);return{path:t,name:e,isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink}}function E(t,e,r,i){return!(e&&!e.some(o=>t.endsWith(o))||r&&!r.some(o=>!!t.match(o))||i&&i.some(o=>!!t.match(o)))}async function*V(t,e){let{maxDepth:r=1/0,includeFiles:i=!0,includeDirs:o=!0,includeSymlinks:s=!0,followSymlinks:n=!1,canonicalize:f=!0,exts:a=void 0,match:l=void 0,skip:m=void 0}=e??{};if(!(r<0)&&(t=c(t),a&&(a=a.map(y=>y.startsWith(".")?y:`.${y}`)),o&&E(t,a,l,m)&&(yield await A(t)),!(r<1||!E(t,void 0,void 0,m))))for await(let y of Deno.readDir(t)){let p=d(t,y.name),{isSymlink:v,isDirectory:$}=y;if(v){if(!n){s&&E(p,a,l,m)&&(yield{path:p,...y});continue}let h=await Deno.realPath(p);f&&(p=h),{isSymlink:v,isDirectory:$}=await Deno.lstat(h)}if(v||$){let h={maxDepth:r-1,includeFiles:i,includeDirs:o,includeSymlinks:s,followSymlinks:n};a!==void 0&&(h.exts=a),l!==void 0&&(h.match=l),m!==void 0&&(h.skip=m),yield*V(p,h)}else i&&E(p,a,l,m)&&(yield{path:p,...y})}}var ue=globalThis.Deno?.build.os==="windows"?"`":"\\";var B=`
4
4
  `,J=`\r
5
5
  `,xe=globalThis.Deno?.build.os==="windows"?J:B;export{G as a,W as b,Y as c,Z as d,Ft as e,x as f,V as g,wt as h};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-P72TUTYK.js";import{a as c}from"./chunk-J7YTWK67.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,P as b};
2
+ import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-YURNTYEP.js";import{a as c}from"./chunk-J7YTWK67.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,P as b};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as D}from"./chunk-GTHXGAMQ.js";import{a as j}from"./chunk-3XJLLDR5.js";import{a as O}from"./chunk-P7WCO724.js";import{a as S}from"./chunk-2XNFZXHY.js";import{i as p}from"./chunk-WJKE6XHF.js";import{e as _}from"./chunk-5WJ6AUNY.js";var y={DenoJson:"deno.json",DenoJsonc:"deno.jsonc",JsrJson:"jsr.json",JsrJsonc:"jsr.jsonc",PackageJson:"package.json"},k=[y.DenoJson,y.DenoJsonc,y.JsrJson,y.JsrJsonc,y.PackageJson],P=Symbol.for("baseDir"),F={name:{"deno.json":"name","deno.jsonc":"name","jsr.json":"name","jsr.jsonc":"name","package.json":"name"},version:{"deno.json":"version","deno.jsonc":"version","jsr.json":"version","jsr.jsonc":"version","package.json":"version"},description:{"package.json":"description"},license:{"deno.json":"license","deno.jsonc":"license","package.json":"license"},private:{"package.json":"private"},exports:{"deno.json":"exports","deno.jsonc":"exports","jsr.json":"exports","jsr.jsonc":"exports","package.json":"exports"},workspaces:{"deno.json":"workspace","deno.jsonc":"workspace","package.json":"workspaces"},imports:{"deno.json":"imports","deno.jsonc":"imports"},dependencies:{"package.json":"dependencies"},devDependencies:{"package.json":"devDependencies"}};var A=_(S(),1);var c={Unknown:0,EnvironmentFile:1,Json:2,JsonWithComments:3,Toml:4,Yaml:5};var I={[c.Unknown]:"unknown",[c.EnvironmentFile]:"environment",[c.Json]:"JSON",[c.JsonWithComments]:"JSONC",[c.Toml]:"TOML",[c.Yaml]:"YAML"},h=class extends Error{filepath;format;constructor(n,t,i){super(`Failed to parse ${I[t]??"unknown"} file "${n}": ${i.message}`,{cause:i}),this.name="ConfigParseError",this.filepath=n,this.format=t}};var M=e=>{let n=p.path.extname(e);return n===".json"?c.Json:n===".jsonc"?c.JsonWithComments:n===".yaml"||n===".yml"?c.Yaml:n===".toml"?c.Toml:n===".env"?c.EnvironmentFile:c.Unknown},x=async(e,n)=>{let t=n??M(e),i=await p.fs.readTextFile(e);try{return t===c.Json?{content:JSON.parse(i),filepath:e,format:t}:t===c.JsonWithComments?{content:j(i),filepath:e,format:t}:t===c.Yaml?{content:A.parse(i),filepath:e,format:t}:t===c.Toml?{content:O(i),filepath:e,format:t}:{content:void 0,filepath:e,format:c.Unknown}}catch(r){throw r instanceof Error?new h(e,t,r):new h(e,t,new Error(String(r)))}};var b=(e,n,t)=>{if(e==null)return t;let i=n.length;if(i===0)return e;let r=e;for(let o=0;o<i;o++){if(r==null)return t;let a=n[o];r=r[a]}return r===void 0?t:r};var m=class extends Error{filepath;constructor(n,t,i){super(n,{cause:i}),this.name="PackageLoadError",this.filepath=t}},$=async(e,n)=>{if(await p.fs.exists(e)===!1||(await p.fs.stat(e)).isFile===!1)return;let r=await p.fs.readTextFile(e),a=(await x(e)).content;if(a!==void 0)return{filepath:e,fileType:n,content:a,rawText:r}},Y=async(e,n)=>{let t=[];for(let i of n){let r=p.path.join(e,i),o=await $(r,i);o&&t.push(o)}return t},B=(e,n)=>b(e,n.split(".")),u=(e,n,t)=>{let i,r,o=[];for(let a of n){let l=t[e]?.[a.fileType];if(l===void 0)continue;let s=B(a.content,l);if(s===void 0)continue;let d={filepath:a.filepath,fileType:a.fileType,propertyPath:l};i===void 0?(i=s,r=d):o.push(d)}if(!(i===void 0||r===void 0))return{value:i,origin:r,alternateOrigins:o}},G=e=>e===void 0?F:D(F,e),H=e=>[...e].sort((n,t)=>k.indexOf(n)-k.indexOf(t)),T=async(e={})=>{let{baseDir:n=".",includeFiles:t=k,fieldMappings:i,searchParents:r=!1}=e,o=G(i),a=H(t),l=p.path.resolve(n),s=[];for(;s=await Y(l,a),!(s.length>0||!r);){let g=p.path.dirname(l);if(g===l)break;l=g}if(s.length===0)throw new m(`No config files found in ${n}. Looked for: ${a.join(", ")}`);return{name:u("name",s,o),version:u("version",s,o),description:u("description",s,o),license:u("license",s,o),private:u("private",s,o),exports:u("exports",s,o),workspaces:u("workspaces",s,o),imports:u("imports",s,o),dependencies:u("dependencies",s,o),devDependencies:u("devDependencies",s,o),[P]:l,_loadedFiles:s}},v=async(e={})=>{try{return await T(e)}catch(n){if(n instanceof m)return;throw n}},R=(e,n)=>{let t=e[n];if(!t)return[];let i=new Set([t.origin.filepath,...t.alternateOrigins.map(r=>r.filepath)]);return e._loadedFiles.filter(r=>i.has(r.filepath))},E=e=>e[P];var K=(e,n)=>{let t=n.split("."),i=e;for(let r of t){if(i==null||typeof i!="object")return;i=i[r]}return i},L=new Set(["__proto__","constructor","prototype"]),V=(e,n,t)=>{let i=n.split("."),r=e;for(let a=0;a<i.length-1;a++){let l=i[a];if(l===void 0||L.has(l))return;if(!Object.hasOwn(r,l)||typeof r[l]!="object"||r[l]===null){let s=Object.create(null);r[l]=s}r=r[l]}let o=i[i.length-1];o!==void 0&&!L.has(o)&&(r[o]=t)},q=e=>`${JSON.stringify(e,null,2)}
2
+ import{a as D}from"./chunk-GTHXGAMQ.js";import{a as j}from"./chunk-3XJLLDR5.js";import{a as O}from"./chunk-P7WCO724.js";import{a as S}from"./chunk-2XNFZXHY.js";import{i as p}from"./chunk-6VHZQNHX.js";import{e as _}from"./chunk-5WJ6AUNY.js";var y={DenoJson:"deno.json",DenoJsonc:"deno.jsonc",JsrJson:"jsr.json",JsrJsonc:"jsr.jsonc",PackageJson:"package.json"},k=[y.DenoJson,y.DenoJsonc,y.JsrJson,y.JsrJsonc,y.PackageJson],P=Symbol.for("baseDir"),F={name:{"deno.json":"name","deno.jsonc":"name","jsr.json":"name","jsr.jsonc":"name","package.json":"name"},version:{"deno.json":"version","deno.jsonc":"version","jsr.json":"version","jsr.jsonc":"version","package.json":"version"},description:{"package.json":"description"},license:{"deno.json":"license","deno.jsonc":"license","package.json":"license"},private:{"package.json":"private"},exports:{"deno.json":"exports","deno.jsonc":"exports","jsr.json":"exports","jsr.jsonc":"exports","package.json":"exports"},workspaces:{"deno.json":"workspace","deno.jsonc":"workspace","package.json":"workspaces"},imports:{"deno.json":"imports","deno.jsonc":"imports"},dependencies:{"package.json":"dependencies"},devDependencies:{"package.json":"devDependencies"}};var A=_(S(),1);var c={Unknown:0,EnvironmentFile:1,Json:2,JsonWithComments:3,Toml:4,Yaml:5};var I={[c.Unknown]:"unknown",[c.EnvironmentFile]:"environment",[c.Json]:"JSON",[c.JsonWithComments]:"JSONC",[c.Toml]:"TOML",[c.Yaml]:"YAML"},h=class extends Error{filepath;format;constructor(n,t,i){super(`Failed to parse ${I[t]??"unknown"} file "${n}": ${i.message}`,{cause:i}),this.name="ConfigParseError",this.filepath=n,this.format=t}};var M=e=>{let n=p.path.extname(e);return n===".json"?c.Json:n===".jsonc"?c.JsonWithComments:n===".yaml"||n===".yml"?c.Yaml:n===".toml"?c.Toml:n===".env"?c.EnvironmentFile:c.Unknown},x=async(e,n)=>{let t=n??M(e),i=await p.fs.readTextFile(e);try{return t===c.Json?{content:JSON.parse(i),filepath:e,format:t}:t===c.JsonWithComments?{content:j(i),filepath:e,format:t}:t===c.Yaml?{content:A.parse(i),filepath:e,format:t}:t===c.Toml?{content:O(i),filepath:e,format:t}:{content:void 0,filepath:e,format:c.Unknown}}catch(r){throw r instanceof Error?new h(e,t,r):new h(e,t,new Error(String(r)))}};var b=(e,n,t)=>{if(e==null)return t;let i=n.length;if(i===0)return e;let r=e;for(let o=0;o<i;o++){if(r==null)return t;let a=n[o];r=r[a]}return r===void 0?t:r};var m=class extends Error{filepath;constructor(n,t,i){super(n,{cause:i}),this.name="PackageLoadError",this.filepath=t}},$=async(e,n)=>{if(await p.fs.exists(e)===!1||(await p.fs.stat(e)).isFile===!1)return;let r=await p.fs.readTextFile(e),a=(await x(e)).content;if(a!==void 0)return{filepath:e,fileType:n,content:a,rawText:r}},Y=async(e,n)=>{let t=[];for(let i of n){let r=p.path.join(e,i),o=await $(r,i);o&&t.push(o)}return t},B=(e,n)=>b(e,n.split(".")),u=(e,n,t)=>{let i,r,o=[];for(let a of n){let l=t[e]?.[a.fileType];if(l===void 0)continue;let s=B(a.content,l);if(s===void 0)continue;let d={filepath:a.filepath,fileType:a.fileType,propertyPath:l};i===void 0?(i=s,r=d):o.push(d)}if(!(i===void 0||r===void 0))return{value:i,origin:r,alternateOrigins:o}},G=e=>e===void 0?F:D(F,e),H=e=>[...e].sort((n,t)=>k.indexOf(n)-k.indexOf(t)),T=async(e={})=>{let{baseDir:n=".",includeFiles:t=k,fieldMappings:i,searchParents:r=!1}=e,o=G(i),a=H(t),l=p.path.resolve(n),s=[];for(;s=await Y(l,a),!(s.length>0||!r);){let g=p.path.dirname(l);if(g===l)break;l=g}if(s.length===0)throw new m(`No config files found in ${n}. Looked for: ${a.join(", ")}`);return{name:u("name",s,o),version:u("version",s,o),description:u("description",s,o),license:u("license",s,o),private:u("private",s,o),exports:u("exports",s,o),workspaces:u("workspaces",s,o),imports:u("imports",s,o),dependencies:u("dependencies",s,o),devDependencies:u("devDependencies",s,o),[P]:l,_loadedFiles:s}},v=async(e={})=>{try{return await T(e)}catch(n){if(n instanceof m)return;throw n}},R=(e,n)=>{let t=e[n];if(!t)return[];let i=new Set([t.origin.filepath,...t.alternateOrigins.map(r=>r.filepath)]);return e._loadedFiles.filter(r=>i.has(r.filepath))},E=e=>e[P];var K=(e,n)=>{let t=n.split("."),i=e;for(let r of t){if(i==null||typeof i!="object")return;i=i[r]}return i},L=new Set(["__proto__","constructor","prototype"]),V=(e,n,t)=>{let i=n.split("."),r=e;for(let a=0;a<i.length-1;a++){let l=i[a];if(l===void 0||L.has(l))return;if(!Object.hasOwn(r,l)||typeof r[l]!="object"||r[l]===null){let s=Object.create(null);r[l]=s}r=r[l]}let o=i[i.length-1];o!==void 0&&!L.has(o)&&(r[o]=t)},q=e=>`${JSON.stringify(e,null,2)}
3
3
  `,z=async(e,n)=>{let t=JSON.parse(JSON.stringify(e.content));for(let[r,o]of Object.entries(n))V(t,r,o);let i=q(t);await p.fs.writeTextFile(e.filepath,i),e.content=t,e.rawText=i},Q=(e,n,t)=>{let{targetFiles:i="all",createIfMissing:r=!1}=t,o=e[n];if(i==="origin"){if(o===void 0){let s=e._loadedFiles[0];return r&&s!==void 0?[s]:[]}let l=e._loadedFiles.find(s=>s.filepath===o.origin.filepath);return l?[l]:[]}if(i==="all")return!o&&!r?[]:!o&&r?[...e._loadedFiles]:R(e,n);let a=new Set(i);return e._loadedFiles.filter(l=>a.has(l.fileType))},J=async(e,n,t,i={})=>{let r=[],o=[],a=[],l=Q(e,n,i);if(l.length===0)return{updated:r,failed:o,skipped:a};for(let s of l){let d=F[n]?.[s.fileType];if(!d){a.push(s.filepath);continue}if(K(s.content,d)===t){a.push(s.filepath);continue}try{await z(s,{[d]:t}),r.push(s.filepath)}catch(f){o.push({filepath:s.filepath,reason:f instanceof Error?f.message:String(f)})}}if(r.length>0){let s=e[n];if(s)s.value=t;else{let d=e._loadedFiles.find(g=>r.includes(g.filepath));if(d){let g=F[n]?.[d.fileType];g&&(e[n]={value:t,origin:{filepath:d.filepath,fileType:d.fileType,propertyPath:g},alternateOrigins:[]})}}}return{updated:r,failed:o,skipped:a}};var X=async(e,n,t)=>await J(e,"version",n,{...t,targetFiles:"all"});var w=class extends Error{constructor(n){super(n),this.name="WorkspaceError"}},U=async e=>{try{return await T({baseDir:e})}catch(n){throw n instanceof m?new w(`No package config file found in ${p.path.resolve(e)}`):n}},Z=async(e,n)=>{let t=[];for(let i of n)if(i.endsWith("/*")){let r=p.path.join(e,i.slice(0,-2));try{for await(let o of p.fs.readDir(r))o.isDirectory&&t.push(p.path.join(r,o.name))}catch{}}else if(i.includes("*")||i.includes("?")){let r=i.split("/"),o=[],a=0;for(let f=0;f<r.length;f++){if(r[f].includes("*")||r[f].includes("?")){a=f;break}o.push(r[f])}let l=p.path.join(e,...o),d=r.slice(a).join("/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]"),g=new RegExp(`^${d}$`);try{for await(let f of p.fs.walk(l,{includeDirs:!0,includeFiles:!1})){let C=p.path.relative(l,f.path);C!==""&&g.test(C)&&t.push(f.path)}}catch{}}else t.push(p.path.join(e,i));return t},ee=async e=>{let n=await U(e),t=n.workspaces?.value;if(!Array.isArray(t))throw new w("Package config doesn't have workspace field.");for(let o of t)if(typeof o!="string")throw new w("Package config workspace field should be an array of strings.");let i=await Z(e,t),r=[];for(let o of i){let a=await v({baseDir:o});if(a===void 0)continue;let l=a.name?.value,s=a.version?.value,d=a.private?.value;l!==void 0&&d!==!0&&r.push({name:l,version:s??"0.0.0",config:a})}return[n,r]};export{y as a,T as b,v as c,E as d,X as e,ee as f};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as $}from"./chunk-3IZX4OZ7.js";import{e as x}from"./chunk-5DWJ7WEE.js";import{i as c}from"./chunk-WJKE6XHF.js";import{Scanner as ie}from"@tailwindcss/oxide";import{compile as j}from"tailwindcss";async function L(e,s){if(e.startsWith(".")||e.startsWith("/")){let r=c.path.resolve(s,e),n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}let t=s;for(;t!=="/"&&t!=="";){let r=c.path.resolve(t,"node_modules",e);try{let n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}catch{if(!e.endsWith(".css")){let a=`${r}.css`;try{let o=await c.fs.readTextFile(a);return{path:a,content:o,base:c.path.dirname(a)}}catch{}}let n=c.path.resolve(t,"node_modules",e,"index.css");try{let a=await c.fs.readTextFile(n);return{path:n,content:a,base:c.path.dirname(n)}}catch{t=c.path.dirname(t)}}}let l=c.path.resolve(s,e),i=await c.fs.readTextFile(l);return{path:l,content:i,base:c.path.dirname(l)}}async function w(e,s){let t=await j(e,{base:s.base,loadStylesheet:L}),l=s.candidates??[];return t.build(l)}function v(e,s){return w(e,{base:s,candidates:[]})}var R=["theme","base","properties"],P=[/^\.(flex|grid|block|inline|hidden)/,/^\.(items-|justify-|gap-|space-)/,/^\.(w-|h-|min-h-|max-w-)/,/^\.(p-|px-|py-|pt-|pb-|pl-|pr-)/,/^\.(m-|mx-|my-|mt-|mb-|ml-|mr-)/,/^\.(text-|font-|leading-)/,/^\.(bg-|border-)/,/^\.(from-|via-|to-)/,/^\.(container|wrapper)/,/^\.(rounded|shadow)/,/^\.(overflow-)/,/^\.(sm:|md:|lg:|xl:)/],B=[/--tw-gradient/,/--tw-rotate/,/--tw-scale/,/--tw-skew/,/--tw-translate/,/--tw-shadow/,/--tw-ring/,/--tw-blur/,/--tw-brightness/];function N(){return{criticalLayers:R,aboveFoldPatterns:P,forceInclude:[],forceExclude:[]}}var b=x.getLogger(["laroux-bundler","critical-page-css"]);function W(e,s){let t=s;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)return null;let l=t+1,i=1;for(t++;t<e.length&&i>0;)e[t]==="{"?i++:e[t]==="}"&&i--,t++;return{innerContent:e.slice(l,t-1).trim(),end:t}}function V(e){let s=[],t="@keyframes",l=0;for(;l<e.length;){let i=e.indexOf(t,l);if(i===-1)break;let r=i+t.length;for(;r<e.length&&/\s/.test(e[r]??"");)r++;let n=r;for(;n<e.length&&e[n]!=="{"&&!/\s/.test(e[n]??"");)n++;let a=e.slice(r,n),o=n;for(;o<e.length&&e[o]!=="{";)o++;if(o>=e.length){l=e.length;break}let g=1,u=o+1;for(;u<e.length&&g>0;)e[u]==="{"?g++:e[u]==="}"&&g--,u++;let d=e.slice(i,u);s.push({name:a,block:d}),l=u}return s}function Z(e){let s=new Map,t=new Map,l=new Map,i=/@layer\s+([a-zA-Z_-][a-zA-Z0-9_-]*)\s*[{;]/g,r;for(;(r=i.exec(e))!==null;){let n=r[1];if(n===void 0||r[0].endsWith(";"))continue;let a=W(e,r.index+r[0].length-1);a&&(t.has(n)||(t.set(n,[]),l.set(n,{start:r.index,end:a.end})),t.get(n).push(a.innerContent),l.get(n).end=a.end)}for(let[n,a]of t){let o=a.join(`
2
+ import{a as $}from"./chunk-LSET5TD3.js";import{e as x}from"./chunk-5DWJ7WEE.js";import{i as c}from"./chunk-6VHZQNHX.js";import{Scanner as ie}from"@tailwindcss/oxide";import{compile as j}from"tailwindcss";async function L(e,s){if(e.startsWith(".")||e.startsWith("/")){let r=c.path.resolve(s,e),n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}let t=s;for(;t!=="/"&&t!=="";){let r=c.path.resolve(t,"node_modules",e);try{let n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}catch{if(!e.endsWith(".css")){let a=`${r}.css`;try{let o=await c.fs.readTextFile(a);return{path:a,content:o,base:c.path.dirname(a)}}catch{}}let n=c.path.resolve(t,"node_modules",e,"index.css");try{let a=await c.fs.readTextFile(n);return{path:n,content:a,base:c.path.dirname(n)}}catch{t=c.path.dirname(t)}}}let l=c.path.resolve(s,e),i=await c.fs.readTextFile(l);return{path:l,content:i,base:c.path.dirname(l)}}async function w(e,s){let t=await j(e,{base:s.base,loadStylesheet:L}),l=s.candidates??[];return t.build(l)}function v(e,s){return w(e,{base:s,candidates:[]})}var R=["theme","base","properties"],P=[/^\.(flex|grid|block|inline|hidden)/,/^\.(items-|justify-|gap-|space-)/,/^\.(w-|h-|min-h-|max-w-)/,/^\.(p-|px-|py-|pt-|pb-|pl-|pr-)/,/^\.(m-|mx-|my-|mt-|mb-|ml-|mr-)/,/^\.(text-|font-|leading-)/,/^\.(bg-|border-)/,/^\.(from-|via-|to-)/,/^\.(container|wrapper)/,/^\.(rounded|shadow)/,/^\.(overflow-)/,/^\.(sm:|md:|lg:|xl:)/],B=[/--tw-gradient/,/--tw-rotate/,/--tw-scale/,/--tw-skew/,/--tw-translate/,/--tw-shadow/,/--tw-ring/,/--tw-blur/,/--tw-brightness/];function N(){return{criticalLayers:R,aboveFoldPatterns:P,forceInclude:[],forceExclude:[]}}var b=x.getLogger(["laroux-bundler","critical-page-css"]);function W(e,s){let t=s;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)return null;let l=t+1,i=1;for(t++;t<e.length&&i>0;)e[t]==="{"?i++:e[t]==="}"&&i--,t++;return{innerContent:e.slice(l,t-1).trim(),end:t}}function V(e){let s=[],t="@keyframes",l=0;for(;l<e.length;){let i=e.indexOf(t,l);if(i===-1)break;let r=i+t.length;for(;r<e.length&&/\s/.test(e[r]??"");)r++;let n=r;for(;n<e.length&&e[n]!=="{"&&!/\s/.test(e[n]??"");)n++;let a=e.slice(r,n),o=n;for(;o<e.length&&e[o]!=="{";)o++;if(o>=e.length){l=e.length;break}let g=1,u=o+1;for(;u<e.length&&g>0;)e[u]==="{"?g++:e[u]==="}"&&g--,u++;let d=e.slice(i,u);s.push({name:a,block:d}),l=u}return s}function Z(e){let s=new Map,t=new Map,l=new Map,i=/@layer\s+([a-zA-Z_-][a-zA-Z0-9_-]*)\s*[{;]/g,r;for(;(r=i.exec(e))!==null;){let n=r[1];if(n===void 0||r[0].endsWith(";"))continue;let a=W(e,r.index+r[0].length-1);a&&(t.has(n)||(t.set(n,[]),l.set(n,{start:r.index,end:a.end})),t.get(n).push(a.innerContent),l.get(n).end=a.end)}for(let[n,a]of t){let o=a.join(`
3
3
  `),g=l.get(n);s.set(n,{block:`@layer ${n} {
4
4
  ${o}
5
5
  }`,start:g.start,end:g.end})}return s}function Y(e){let s=[],t=0;for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let l=t;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)break;let i=e.slice(l,t).trim();if(!i){t++;continue}let r=1;for(t++;t<e.length&&r>0;)e[t]==="{"?r++:e[t]==="}"&&r--,t++;let n=e.slice(l,t);i.startsWith("@media")||i.startsWith("@supports")?s.push({selector:"@media",full:n}):i&&!i.startsWith("@")&&s.push({selector:i,full:n})}return s}function H(e,s){let t=e.match(/\.([a-zA-Z_-][a-zA-Z0-9_\-\\:/.[\]]*)/g);if(t)for(let r of t){let n=r.substring(1);if(n=n.replace(/\\/g,""),n=n.split(":")[0]??"",n&&new RegExp(`class=["'][^"']*\\b${q(n)}\\b`,"i").test(s))return!0}let l=e.match(/^([a-zA-Z][a-zA-Z0-9-]*)/);if(l&&l[1]){let r=l[1].toLowerCase();if(new RegExp(`<${r}[\\s>]`,"i").test(s))return!0}let i=e.match(/#([a-zA-Z_-][a-zA-Z0-9_-]*)/g);if(i)for(let r of i){let n=r.substring(1);if(new RegExp(`id=["']${n}["']`,"i").test(s))return!0}return!1}function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e,s){return s.some(t=>typeof t=="string"?e.includes(t):t.test(e))}function K(e){return P.some(s=>s.test(e))}function k(e){let{html:s,css:t,forceInclude:l=[],forceExclude:i=[]}=e;b.debug("Extracting critical page CSS (Tailwind v4 aware)...");let r=[],n=[],a=0,o=0,g=t.match(/^\/\*![\s\S]*?\*\//);g&&r.push(g[0]);let u=t.match(/@layer\s+[\w,-]{1,200}(?:\s+[\w,-]{1,50})*\s*;/);u&&r.push(u[0]);let d=/@property\s+--[\w-]+\s*\{[^}]{0,5000}\}/g,f=t.match(d)??[];f.length>0&&(r.push(f.join(`
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as s}from"./chunk-ULNEO3RY.js";var l=[/^<{7}\s/,/^={7}$/,/^>{7}\s/],i=s({name:"validate-merge-conflict",description:"Detect merge conflict markers",canFix:!1,stacks:[],defaults:{},checkFile(a,o){if(o===void 0)return[];let r=[],e=o.split(`
2
+ import{a as s}from"./chunk-UQRZJPYH.js";var l=[/^<{7}\s/,/^={7}$/,/^>{7}\s/],i=s({name:"validate-merge-conflict",description:"Detect merge conflict markers",canFix:!1,stacks:[],defaults:{},checkFile(a,o){if(o===void 0)return[];let r=[],e=o.split(`
3
3
  `);for(let t=0;t<e.length;t++)for(let n of l)if(n.test(e[t])){r.push({path:a.path,line:t+1,message:`merge conflict marker: ${e[t].slice(0,20)}`});break}return r}}),f=i.run,u=i.validator,d=i.main;export{i as a,f as b,u as c,d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as b,b as w,d as F,f as D}from"./chunk-A6K5L4SG.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-4FGLERUG.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
2
+ import{a as b,b as w,d as F,f as D}from"./chunk-VNJJQED3.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-L7RS6MQ5.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{d as r}from"./chunk-ECY4MUD3.js";import{i}from"./chunk-WJKE6XHF.js";var t=async e=>{try{return await r`which ${e}`.noThrow().code()===0}catch{return!1}},s=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},a=e=>i.env.has(e),d=async()=>{let[e,o,l,n]=await Promise.all([t("claude"),s(),t("opencode"),t("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:e,detail:e?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:o,detail:o?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:l,detail:l?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:n,detail:n?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:a("ANTHROPIC_API_KEY"),detail:a("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:a("OPENAI_API_KEY"),detail:a("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY"),detail:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:a("GOOGLE_CLOUD_PROJECT"),detail:a("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]};export{d as a};
2
+ import{d as r}from"./chunk-5MVJUALI.js";import{i}from"./chunk-6VHZQNHX.js";var t=async e=>{try{return await r`which ${e}`.noThrow().code()===0}catch{return!1}},s=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},a=e=>i.env.has(e),d=async()=>{let[e,o,l,n]=await Promise.all([t("claude"),s(),t("opencode"),t("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:e,detail:e?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:o,detail:o?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:l,detail:l?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:n,detail:n?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:a("ANTHROPIC_API_KEY"),detail:a("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:a("OPENAI_API_KEY"),detail:a("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY"),detail:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:a("GOOGLE_CLOUD_PROJECT"),detail:a("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]};export{d as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as i}from"./chunk-ULNEO3RY.js";import{i as t}from"./chunk-WJKE6XHF.js";var s=i({name:"validate-submodules",description:"Detect new git submodules",canFix:!1,stacks:[],defaults:{},async checkAll(n,a){let o=t.path.join(a.root,".gitmodules");if(!await t.fs.exists(o))return[];let e=((await t.fs.readTextFile(o)).match(/\[submodule\s/g)??[]).length;return e>0?[{path:o,message:`found ${e} submodule(s) \u2014 submodules are not allowed`}]:[]}}),p=s.run,f=s.validator,x=s.main;export{s as a,p as b,f as c,x as d};
2
+ import{a as i}from"./chunk-UQRZJPYH.js";import{i as t}from"./chunk-6VHZQNHX.js";var s=i({name:"validate-submodules",description:"Detect new git submodules",canFix:!1,stacks:[],defaults:{},async checkAll(n,a){let o=t.path.join(a.root,".gitmodules");if(!await t.fs.exists(o))return[];let e=((await t.fs.readTextFile(o)).match(/\[submodule\s/g)??[]).length;return e>0?[{path:o,message:`found ${e} submodule(s) \u2014 submodules are not allowed`}]:[]}}),p=s.run,f=s.validator,x=s.main;export{s as a,p as b,f as c,x as d};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as i}from"./chunk-J7YTWK67.js";import{b as d,d as c}from"./chunk-ECY4MUD3.js";var y=async(r,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let n=await c`which ${r}`.noThrow().text();if(n.length>0)return n}catch{}throw new i(`Binary "${r}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:r})},f=(r,t,e)=>{let s=new d(r,[...t],{stdin:"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(e?.signal!==void 0){let o=e.signal;o.aborted?s.kill("SIGTERM"):o.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let o=await s.status;return{code:o.code,success:o.success}},kill:o=>{s.kill(o??"SIGTERM")}}},a=new TextDecoder;async function*m(r){let t=r.getReader(),e="";try{let n=await t.read();for(;n.done!==!0;){e+=a.decode(n.value,{stream:!0});let o=e.split(`
2
+ import{a as i}from"./chunk-J7YTWK67.js";import{b as d,d as c}from"./chunk-5MVJUALI.js";var y=async(r,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let n=await c`which ${r}`.noThrow().text();if(n.length>0)return n}catch{}throw new i(`Binary "${r}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:r})},f=(r,t,e)=>{let s=new d(r,[...t],{stdin:"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(e?.signal!==void 0){let o=e.signal;o.aborted?s.kill("SIGTERM"):o.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let o=await s.status;return{code:o.code,success:o.success}},kill:o=>{s.kill(o??"SIGTERM")}}},a=new TextDecoder;async function*m(r){let t=r.getReader(),e="";try{let n=await t.read();for(;n.done!==!0;){e+=a.decode(n.value,{stream:!0});let o=e.split(`
3
3
  `);e=o.pop()??"";for(let u of o){let l=u.trim();if(l.length!==0)try{yield JSON.parse(l)}catch{}}n=await t.read()}let s=e.trim();if(s.length>0)try{yield JSON.parse(s)}catch{}}finally{t.releaseLock()}}var h=async(r,t)=>{let e=r.getReader(),n=[],s=await e.read();for(;s.done!==!0;)n.push(a.decode(s.value,{stream:!0})),s=await e.read();return e.releaseLock(),{content:[{kind:"text",text:n.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},w=async r=>{let t=r.getReader(),e=[],n=await t.read();for(;n.done!==!0;)e.push(a.decode(n.value,{stream:!0})),n=await t.read();return t.releaseLock(),e.join("").trim()},x=(r,t,e)=>{if(t===0)return null;let n=e.length>0?`${r} exited with code ${t}: ${e}`:`${r} exited with code ${t}`;return t===1?new i(n,{provider:r}):t===126||t===127?new i(`${r} binary not found or not executable (exit code ${t})`,{provider:r}):new i(n,{provider:r})},b=(r,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let n of r)for(let s of n.content)s.kind==="text"&&e.push(s.text);return e.join(`
4
4
  `)};export{y as a,f as b,m as c,h as d,w as e,x as f,b as g};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as r}from"./chunk-P7WCO724.js";import{a as i}from"./chunk-ULNEO3RY.js";var t=i({name:"validate-toml",description:"Validate TOML syntax",canFix:!1,stacks:[],defaults:{},extensions:["toml"],checkFile(e,o){if(o===void 0)return[];try{return r(o),[]}catch(a){let s=a instanceof Error?a.message:"invalid TOML";return[{path:e.path,message:s}]}}}),p=t.run,d=t.validator,u=t.main;export{t as a,p as b,d as c,u as d};
2
+ import{a as r}from"./chunk-P7WCO724.js";import{a as i}from"./chunk-UQRZJPYH.js";var t=i({name:"validate-toml",description:"Validate TOML syntax",canFix:!1,stacks:[],defaults:{},extensions:["toml"],checkFile(e,o){if(o===void 0)return[];try{return r(o),[]}catch(a){let s=a instanceof Error?a.message:"invalid TOML";return[{path:e.path,message:s}]}}}),p=t.run,d=t.validator,u=t.main;export{t as a,p as b,d as c,u as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as u}from"./chunk-MG65QJY6.js";import{a as p,b as f}from"./chunk-FFWPJP7A.js";import{i as x}from"./chunk-WJKE6XHF.js";var h=t=>{let e=[],n=[],i={},s={};for(let r of t)r.type==="boolean"?e.push(r.name):n.push(r.name),r.short!==void 0&&(i[r.short]=r.name),r.default!==void 0&&(s[r.name]=r.default);return{boolean:e,string:n,alias:i,default:s}},T=t=>t!=null&&t.constructor===String,V={boolean:t=>!!t,number:t=>T(t)?Number(t):t,string:t=>String(t),"string[]":t=>Array.isArray(t)?t.map(String):[String(t)]},v=(t,e)=>{if(t!==void 0)return V[e]?.(t)??t},$=(t,e)=>{let n={};for(let i of e){let s=t[i.name];n[i.name]=v(s,i.type)}return n},ie=(t,e)=>{let n=h(e),i=u(t,n);return{positional:i._,flags:$(i,e)}},_=(t,e)=>{let n=[];for(let i of e)if(i.required===!0){let s=t[i.name];(s===void 0||s===""||s===!1)&&n.push(`Required flag --${i.name} is missing`)}return n};var O=(t,e)=>t+" ".repeat(Math.max(0,e-t.length)),U=t=>{let e=t.short!==void 0?`-${t.short}, `:"",n=t.type!=="boolean"?` <${t.type}>`:"";return`${e}--${t.name}${n}`},q=(t,e)=>[t.description!==void 0?`${e} - ${t.description}`:e,""],B=(t,e)=>{if(t.usage!==void 0)return["Usage:",` ${t.usage}`,""];let n=t.children.length>0?" <command>":"",i=t.flags.length>0?" [options]":"";return["Usage:",` ${e}${n}${i}`,""]},I=t=>{if(t.length===0)return[];let e=s=>s.aliases!==void 0&&s.aliases.length>0?`${s.name}, ${s.aliases.join(", ")}`:s.name,n=Math.max(...t.map(s=>e(s).length));return["Commands:",...t.map(s=>` ${O(e(s),n+2)}${s.description??""}`),""]},Y=t=>{if(t.length===0)return[];let e=t.map(s=>({flag:U(s),desc:s.description})),n=Math.max(...e.map(s=>s.flag.length));return["Options:",...e.map(({flag:s,desc:r})=>` ${O(s,n+2)}${r}`),""]},Z=t=>t?.length?["Examples:",...t.map(e=>` ${e}`),""]:[],M=(t,e)=>{let n=e.join(" "),i=[...q(t,n),...B(t,n),...I(t.children),...Y(t.flags),...Z(t.examples)];return t.children.length>0&&i.push(`Run '${n} <command> --help' for more information on a command.`),i.join(`
2
+ import{a as u}from"./chunk-MG65QJY6.js";import{a as p,b as f}from"./chunk-FFWPJP7A.js";import{i as x}from"./chunk-6VHZQNHX.js";var h=t=>{let e=[],n=[],i={},s={};for(let r of t)r.type==="boolean"?e.push(r.name):n.push(r.name),r.short!==void 0&&(i[r.short]=r.name),r.default!==void 0&&(s[r.name]=r.default);return{boolean:e,string:n,alias:i,default:s}},T=t=>t!=null&&t.constructor===String,V={boolean:t=>!!t,number:t=>T(t)?Number(t):t,string:t=>String(t),"string[]":t=>Array.isArray(t)?t.map(String):[String(t)]},v=(t,e)=>{if(t!==void 0)return V[e]?.(t)??t},$=(t,e)=>{let n={};for(let i of e){let s=t[i.name];n[i.name]=v(s,i.type)}return n},ie=(t,e)=>{let n=h(e),i=u(t,n);return{positional:i._,flags:$(i,e)}},_=(t,e)=>{let n=[];for(let i of e)if(i.required===!0){let s=t[i.name];(s===void 0||s===""||s===!1)&&n.push(`Required flag --${i.name} is missing`)}return n};var O=(t,e)=>t+" ".repeat(Math.max(0,e-t.length)),U=t=>{let e=t.short!==void 0?`-${t.short}, `:"",n=t.type!=="boolean"?` <${t.type}>`:"";return`${e}--${t.name}${n}`},q=(t,e)=>[t.description!==void 0?`${e} - ${t.description}`:e,""],B=(t,e)=>{if(t.usage!==void 0)return["Usage:",` ${t.usage}`,""];let n=t.children.length>0?" <command>":"",i=t.flags.length>0?" [options]":"";return["Usage:",` ${e}${n}${i}`,""]},I=t=>{if(t.length===0)return[];let e=s=>s.aliases!==void 0&&s.aliases.length>0?`${s.name}, ${s.aliases.join(", ")}`:s.name,n=Math.max(...t.map(s=>e(s).length));return["Commands:",...t.map(s=>` ${O(e(s),n+2)}${s.description??""}`),""]},Y=t=>{if(t.length===0)return[];let e=t.map(s=>({flag:U(s),desc:s.description})),n=Math.max(...e.map(s=>s.flag.length));return["Options:",...e.map(({flag:s,desc:r})=>` ${O(s,n+2)}${r}`),""]},Z=t=>t?.length?["Examples:",...t.map(e=>` ${e}`),""]:[],M=(t,e)=>{let n=e.join(" "),i=[...q(t,n),...B(t,n),...I(t.children),...Y(t.flags),...Z(t.examples)];return t.children.length>0&&i.push(`Run '${n} <command> --help' for more information on a command.`),i.join(`
3
3
  `)};var w=t=>{let e=[];for(let n of t)e.push(`--${n.name}`),n.short!==void 0&&e.push(`-${n.short}`);return e.join(" ")},k=(t,e)=>{if(t.children===void 0||t.children.length===0)return"";let n=t.children.map(o=>o.name).join(" "),i=t.flags!==void 0?w(t.flags):"",s=[n,i].filter(o=>o.length>0).join(" "),r=` ${e})
4
4
  `;r+=` COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
5
5
  `,r+=` return 0
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as e}from"./chunk-QFFGKP3M.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-PMB64QWG.js")},list:{description:"List available AI providers",load:()=>import("./list-UQMPOF5Y.js")}}});export{i as a};
2
+ import{a as e}from"./chunk-SH4H7OLV.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-UTEI7KGQ.js")},list:{description:"List available AI providers",load:()=>import("./list-PSLAM3H6.js")}}});export{i as a};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-VE6XM5OZ.js";import"./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";export{a as ClaudeCodeModel,b as claudeCodeFactory};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as E,b as A}from"./chunk-HP5W5XT6.js";import{e as x}from"./chunk-F35K7YVH.js";import{a as P,d as $}from"./chunk-P2MUEKFT.js";import{h as j,p as S}from"./chunk-TEOMM3RD.js";import{f as k,h as b,k as C}from"./chunk-ZC4F4MYU.js";import{d,f as R,g as v,k as h}from"./chunk-YVN2NZL4.js";import{a as w}from"./chunk-MG65QJY6.js";import{a as c,b as l,c as y}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 I=r=>{let t=j(r);if(t.kind==="repo")return t},H=r=>P(async t=>{try{let{specifier:n}=r,e=r.recipePath??"recipe.json",s=await S(n.owner,n.repo,n.ref,e),o=r.cwd;r.projectName!==void 0&&(o=`${r.cwd}/${r.projectName}`,await f.fs.mkdir(o,{recursive:!0}));let a={...r.variables};r.projectName!==void 0&&a.project_name===void 0&&(a.project_name=r.projectName);let m=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}`,i=await x(s,{cwd:o,registryUrl:m,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:a}),u=await E(o),g=A(s,u),O=r.dryRun?"Would write":"Cloned";t.out.writeln(v(`\u2713 ${O} ${i.written.length} file(s) from ${s.name}`));for(let p of i.written)t.out.writeln(` \u2192 ${p}`);if(i.postInstallRan.length>0){t.out.writeln(d(`
2
+ import{a as E,b as A}from"./chunk-6V6C6MWY.js";import{e as x}from"./chunk-BNMKKNLB.js";import{a as P,d as $}from"./chunk-P2MUEKFT.js";import{h as j,p as S}from"./chunk-GKOMIH2B.js";import{f as k,h as b,k as C}from"./chunk-MBG7SPPO.js";import{d,f as R,g as v,k as h}from"./chunk-YVN2NZL4.js";import{a as w}from"./chunk-MG65QJY6.js";import{a as c,b as l,c as y}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var I=r=>{let t=j(r);if(t.kind==="repo")return t},H=r=>P(async t=>{try{let{specifier:n}=r,e=r.recipePath??"recipe.json",s=await S(n.owner,n.repo,n.ref,e),o=r.cwd;r.projectName!==void 0&&(o=`${r.cwd}/${r.projectName}`,await f.fs.mkdir(o,{recursive:!0}));let a={...r.variables};r.projectName!==void 0&&a.project_name===void 0&&(a.project_name=r.projectName);let m=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}`,i=await x(s,{cwd:o,registryUrl:m,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:a}),u=await E(o),g=A(s,u),O=r.dryRun?"Would write":"Cloned";t.out.writeln(v(`\u2713 ${O} ${i.written.length} file(s) from ${s.name}`));for(let p of i.written)t.out.writeln(` \u2192 ${p}`);if(i.postInstallRan.length>0){t.out.writeln(d(`
3
3
  Post-install:`));for(let p of i.postInstallRan)t.out.writeln(d(` \u2713 ${p}`))}if(g.instructions.length>0){t.out.writeln(d(`
4
4
  Dependencies:`));for(let p of g.instructions)t.out.writeln(d(` Run: ${p}`))}return c({recipe:s,result:i,depInfo:g,targetDir:o})}catch(n){let e=n instanceof Error?n.message:String(n);return l({_tag:"ApplyError",message:e})}});var J=async r=>{let t=w(r??[],{string:["recipe","name","var"],boolean:["force","dry-run","skip-existing","verbose"],collect:["var"],alias:{p:"name"}}),n=t._[0],e=k({renderer:C.ansi(),sink:b.stdout()});if(n===void 0)return e.writeln("Usage: eser kit clone <specifier> [options]"),e.writeln(),e.writeln("Specifier formats:"),e.writeln(" owner/repo GitHub repo (default branch)"),e.writeln(" owner/repo#ref GitHub repo at specific tag/branch"),e.writeln(),e.writeln("Options:"),e.writeln(" --recipe <path> Path to recipe.json (default: recipe.json)"),e.writeln(" --name, -p <dir> Target directory"),e.writeln(" --var key=value Template variable (repeatable)"),e.writeln(" --force Overwrite existing files"),e.writeln(" --dry-run Preview without writing"),await e.close(),c(void 0);let s=I(n);if(s===void 0)return e.writeln(R(`Invalid specifier: '${n}'. Use format: owner/repo or gh:owner/repo#ref`)),await e.close(),l({exitCode:1});let o={};for(let m of t.var){let[i,...u]=String(m).split("=");i!==void 0&&i!==""&&(o[i]=u.join("="))}e.writeln(h(`
5
5
  Cloning from ${s.owner}/${s.repo}@${s.ref}...
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-OAT2D23A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{c as cmd,b as cmdPrefix,d as extractPrefix,a as setCommandPrefix};
2
+ import{a,b,c,d}from"./chunk-MPGRKZIA.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{c as cmd,b as cmdPrefix,d as extractPrefix,a as setCommandPrefix};
@@ -1,11 +1,11 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import"./chunk-7ZYDAZBD.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import"./chunk-PXCM4FHO.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f,h as g,k as p}from"./chunk-ZC4F4MYU.js";import{c as n,d,f as u}from"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as o}from"./chunk-ECY4MUD3.js";import"./chunk-5224ZYEW.js";import"./chunk-QFFGKP3M.js";import"./chunk-QXATB6Z5.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var b=`Output ONLY a conventional commit message. No explanation, no markdown, no code blocks, no bullet points.
2
+ import"./chunk-7ZYDAZBD.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import"./chunk-XOSAN6PX.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f,h as g,k as p}from"./chunk-MBG7SPPO.js";import{c as n,d,f as u}from"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as o}from"./chunk-5MVJUALI.js";import"./chunk-ZRUM5PE7.js";import"./chunk-SH4H7OLV.js";import"./chunk-ZEFYMWGZ.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var b=`Output ONLY a conventional commit message. No explanation, no markdown, no code blocks, no bullet points.
3
3
 
4
4
  Format: type(scope): description
5
5
  Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
6
6
  Max 72 characters. One line only. No body. No quotes. No backticks.
7
7
 
8
8
  Example output:
9
- feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=f({renderer:p.ansi(),sink:g.stdout()});try{let t=await o`git diff --cached`.noThrow().text();if(t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0)return e.writeln(d("No changes detected (nothing staged or modified).")),await e.close(),l(void 0);let s=await y(t),r=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/`/g,"\\`").replace(/\$/g,"\\$").replace(/!/g,"\\!");return e.writeln(""),e.writeln(n("Plain Format:")),e.writeln("```"),e.writeln(s),e.writeln("```"),e.writeln(""),e.writeln(n("Shell Command:")),e.writeln("```"),e.writeln(`git commit -m "${r}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${r}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(u(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-IXVUQHXS.js")).defaultFactories(),r=new w({factories:s}),a=e;if(a===void 0)try{await o`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await r.addModel("default",{provider:a,model:"default"});let c=r.getDefault();if(c===null)throw new Error("No AI model available for commit message generation");let k=await c.generateText({system:b,messages:[h("user",`Generate a commit message for this diff:
9
+ feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=f({renderer:p.ansi(),sink:g.stdout()});try{let t=await o`git diff --cached`.noThrow().text();if(t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0)return e.writeln(d("No changes detected (nothing staged or modified).")),await e.close(),l(void 0);let s=await y(t),r=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/`/g,"\\`").replace(/\$/g,"\\$").replace(/!/g,"\\!");return e.writeln(""),e.writeln(n("Plain Format:")),e.writeln("```"),e.writeln(s),e.writeln("```"),e.writeln(""),e.writeln(n("Shell Command:")),e.writeln("```"),e.writeln(`git commit -m "${r}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${r}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(u(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-WOZXOD2F.js")).defaultFactories(),r=new w({factories:s}),a=e;if(a===void 0)try{await o`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await r.addModel("default",{provider:a,model:"default"});let c=r.getDefault();if(c===null)throw new Error("No AI model available for commit message generation");let k=await c.generateText({system:b,messages:[h("user",`Generate a commit message for this diff:
10
10
 
11
11
  ${i}`)],maxTokens:256});return await r.close(),x(k).trim()},O={name:"ai-commitmsg",description:"Generate commit message from git diff using AI",run:async i=>{try{let e=i.provider,t=await o`git diff --cached`.noThrow().text();return t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0?{name:"ai-commitmsg",passed:!0,issues:[],mutations:[],stats:{skipped:1}}:{name:"ai-commitmsg",passed:!0,issues:[{message:`Suggested: ${await y(t,e)}`}],mutations:[],stats:{generated:1}}}catch(e){return{name:"ai-commitmsg",passed:!1,issues:[{message:e instanceof Error?e.message:String(e)}],mutations:[],stats:{errors:1}}}}};export{y as generateCommitMessage,v as main,O as workflowTool};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as A}from"./chunk-OCPEFZBJ.js";import{l as k,m as y,n as x,o as P}from"./chunk-NEHZOG23.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};
2
+ import{b as A}from"./chunk-OCPEFZBJ.js";import{l as k,m as y,n as x,o as P}from"./chunk-OM5GSS2H.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};
@@ -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"./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};
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};
@@ -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-ZC4F4MYU.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-QXATB6Z5.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(`
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(`
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-236QYA7G.js"),import("./mod-QWYXFGRG.js"),import("./mod-SXL6PDQM.js"),import("./mod-EWLBSEHA.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-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};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as E,d as y}from"./chunk-OEUVCV5C.js";import{k as C}from"./chunk-6SSSHLEY.js";import{c as f,e as h,f as g,g as S}from"./chunk-OM5GSS2H.js";import{c as $}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{f as d,h as w,k as u}from"./chunk-MBG7SPPO.js";import{c as p,d as i,f as c,g as m}from"./chunk-YVN2NZL4.js";import{a as l,b as o}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var G=async k=>{let e=d({renderer:u.ansi(),sink:w.stdout()}),s=a.process.cwd(),D=g(k),t=await h(s,D);if(t.phase!=="EXECUTING")return e.writeln(c(`Cannot complete in phase: ${t.phase}`)),e.writeln(i("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),o({exitCode:1});if(t.spec!==null){let n=`${s}/${f.specDir(t.spec)}`;try{await a.fs.stat(n)}catch{return e.writeln(c(`Active spec '${t.spec}' directory not found.`)),e.writeln(i("Run `noskills reset` to return to IDLE.")),await e.close(),o({exitCode:1})}}let r=C(t,"done");if(await S(s,r),r.spec!==null&&(await E(s,r.spec,"completed"),await y(s,r.spec,"completed")),e.writeln(m("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",p(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let n=t.decisions.filter(U=>U.promoted);n.length>0&&e.writeln(i(` Promoted to rules: ${n.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",p(`${$('spec new "..."')}`)),await e.close(),l(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-DWLFTRZS.js";import"./chunk-NBA6EFWU.js";import"./chunk-ECY4MUD3.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};
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};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-4FGLERUG.js";import{l as t}from"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.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
2
+ import{a}from"./chunk-L7RS6MQ5.js";import{l as t}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-VAIRJES2.js";import"./chunk-J2Z7NG2X.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
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-4KGARSNL.js")).main(s);case"release-notes":return await(await import("./release-notes-GA7CTA54.js")).main(s);case"release-tag":return await(await import("./release-tag-VJWBXG5G.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-3MFKDSG3.js")).main(s);case"release-notes":return await(await import("./release-notes-GJ4EBMTD.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};
@@ -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-4FGLERUG.js";import{l as c}from"./chunk-H2O5G3XB.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-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{e as l}from"./chunk-ECY4MUD3.js";import"./chunk-PWLF3WXM.js";import"./chunk-QFFGKP3M.js";import"./chunk-QXATB6Z5.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}
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-VAIRJES2.js";import"./chunk-J2Z7NG2X.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}
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,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as ne,b as ie}from"./chunk-RVJZFWN7.js";import{d as se}from"./chunk-MBCPGD5L.js";import{d as Y}from"./chunk-7UASU4NU.js";import{b}from"./chunk-OCPEFZBJ.js";import{a as Z,b as ee}from"./chunk-RGUPFAEE.js";import{d as te}from"./chunk-3AA3RXKD.js";import{a as _,b as q,g as B,m as H,o as K,q as U,s as V}from"./chunk-NEHZOG23.js";import{a as Q,c as x,d as X}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as S,b as M,f as I,g as W,h as z,i as J,j as G,k as h,l as r,m as w}from"./chunk-H2O5G3XB.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-PXCM4FHO.js";import"./chunk-BNQAZLIQ.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-ECY4MUD3.js";import"./chunk-5224ZYEW.js";import"./chunk-QFFGKP3M.js";import"./chunk-QXATB6Z5.js";import"./chunk-MG65QJY6.js";import{a as P}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 oe=F;var fe=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ge=[{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"]}],re=async t=>{let e=[];for(let i of ge)for(let s of i.paths)if(await fe(`${t}/${s}`)){e.push(i.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ae=async(t,e)=>{try{let i=await f.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},he=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},we=async t=>{let e=[],i=await ae(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},ye=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},ve=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ae(`${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},ce=async t=>{let[e,i,s,d]=await Promise.all([he(t),we(t),ye(t),ve(t)]);return{languages:e,frameworks:i,ci:s,testRunner:d}};var ze=async t=>{let e=f.process.cwd(),i=ne(t),s=M({target:i==="agent"?"non-interactive":"interactive"}),d=ie(t),y=le(d,"--concerns"),g=le(d,"--tools"),u=d.includes("--non-interactive")||i==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${x("sync")}\` to regenerate tool files.`),P(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await ce(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 re(e),v=se(),L=v!==null&&!A.includes(v)?[v]:[],C=[...new Set([...L,...A])];j.succeed(`${C.length} coding tool(s) detected`);for(let n of C){let o=n===v?" (current)":"";r.step(s,` ${n}${o}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf"],o=g.filter(l=>n.includes(l));p=[...new Set([...L,...o])]}else u?p=[...C]:(h(s),p=await Te(s,C,v));h(s);let N=w(s,"Detecting AI providers...");N.start();let $=(await oe()).filter(n=>n.available).map(n=>n.name);N.succeed(`${$.length} provider(s) detected`),h(s);let T=await b(),c;if(y!==null){let n=T.map(o=>o.id);c=y.filter(o=>n.includes(o)).sort((o,l)=>n.indexOf(o)-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)})),o=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=S(o)?[]:[...o]}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 O=w(s,"Initializing...");O.start(),await U(e);let de=T.filter(n=>c.includes(n.id));for(let n of de)await K(e,n);let R=await X();Q(R);let k={...q(c,p,$,m),command:R};await H(e,k);let E=_();if(await B(e,E),O.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let o=await ee(e,p,k);n.succeed(`Synced ${o.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), ${$.length} provider(s), ${c.length} concern(s).`),i==="agent"){let o=(await b()).filter(pe=>c.includes(pe.id)),l=await Z(e),ue=Y(E,o,l,k);await te(ue,"json")}else J(s),G(s,`Start a spec with: ${x('spec new "..."')}`);return P(void 0)},$e=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],Te=async(t,e,i)=>{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:$e.map(u=>({...u,hint:u.value===i?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===i})),initialValues:[...e],required:!1});if(S(y))return[...e];let g=[...y];return i!==null&&!g.includes(i)&&g.unshift(i),g},le=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{ze as main};
2
+ import{a as ne,b as ie}from"./chunk-QD46ROBD.js";import{d as se}from"./chunk-EXP2TZZC.js";import{d as Y}from"./chunk-3PBNSBPA.js";import{b}from"./chunk-OCPEFZBJ.js";import{a as Z,b as ee}from"./chunk-H7FWYKMD.js";import{d as te}from"./chunk-V3NJTF2Y.js";import{a as _,b as q,g as B,m as H,o as K,q as U,s as V}from"./chunk-OM5GSS2H.js";import{a as Q,c as x,d as X}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as S,b as M,f as I,g as W,h as z,i as J,j as G,k as h,l as r,m as w}from"./chunk-JZ7DUWYC.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-XOSAN6PX.js";import"./chunk-BNQAZLIQ.js";import"./chunk-MBG7SPPO.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-5MVJUALI.js";import"./chunk-ZRUM5PE7.js";import"./chunk-SH4H7OLV.js";import"./chunk-ZEFYMWGZ.js";import"./chunk-MG65QJY6.js";import{a as P}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var oe=F;var fe=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ge=[{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"]}],re=async t=>{let e=[];for(let i of ge)for(let s of i.paths)if(await fe(`${t}/${s}`)){e.push(i.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ae=async(t,e)=>{try{let i=await f.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},he=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},we=async t=>{let e=[],i=await ae(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},ye=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},ve=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ae(`${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},ce=async t=>{let[e,i,s,d]=await Promise.all([he(t),we(t),ye(t),ve(t)]);return{languages:e,frameworks:i,ci:s,testRunner:d}};var ze=async t=>{let e=f.process.cwd(),i=ne(t),s=M({target:i==="agent"?"non-interactive":"interactive"}),d=ie(t),y=le(d,"--concerns"),g=le(d,"--tools"),u=d.includes("--non-interactive")||i==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${x("sync")}\` to regenerate tool files.`),P(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await ce(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 re(e),v=se(),L=v!==null&&!A.includes(v)?[v]:[],C=[...new Set([...L,...A])];j.succeed(`${C.length} coding tool(s) detected`);for(let n of C){let o=n===v?" (current)":"";r.step(s,` ${n}${o}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf"],o=g.filter(l=>n.includes(l));p=[...new Set([...L,...o])]}else u?p=[...C]:(h(s),p=await Te(s,C,v));h(s);let N=w(s,"Detecting AI providers...");N.start();let $=(await oe()).filter(n=>n.available).map(n=>n.name);N.succeed(`${$.length} provider(s) detected`),h(s);let T=await b(),c;if(y!==null){let n=T.map(o=>o.id);c=y.filter(o=>n.includes(o)).sort((o,l)=>n.indexOf(o)-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)})),o=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=S(o)?[]:[...o]}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 O=w(s,"Initializing...");O.start(),await U(e);let de=T.filter(n=>c.includes(n.id));for(let n of de)await K(e,n);let R=await X();Q(R);let k={...q(c,p,$,m),command:R};await H(e,k);let E=_();if(await B(e,E),O.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let o=await ee(e,p,k);n.succeed(`Synced ${o.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), ${$.length} provider(s), ${c.length} concern(s).`),i==="agent"){let o=(await b()).filter(pe=>c.includes(pe.id)),l=await Z(e),ue=Y(E,o,l,k);await te(ue,"json")}else J(s),G(s,`Start a spec with: ${x('spec new "..."')}`);return P(void 0)},$e=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],Te=async(t,e,i)=>{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:$e.map(u=>({...u,hint:u.value===i?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===i})),initialValues:[...e],required:!1});if(S(y))return[...e];let g=[...y];return i!==null&&!g.includes(i)&&g.unshift(i),g},le=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{ze as main};
@@ -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-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-QXATB6Z5.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(`
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(`
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-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-GSWVSC2C.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-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(`
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(`
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as j}from"./chunk-L2E2H7YT.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-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(`
2
+ import{b as j}from"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import"./chunk-WF6JNPZS.js";import"./chunk-VAIRJES2.js";import"./chunk-J2Z7NG2X.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(`
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};