eser 4.1.48 → 4.1.50

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 (168) hide show
  1. package/chunks/{anthropic-QBGNUIP3.js → anthropic-YMZNUQKZ.js} +1 -1
  2. package/chunks/approve-PXC7FMDI.js +2 -0
  3. package/chunks/{ask-M3VS3GIJ.js → ask-6DWHUCLO.js} +1 -1
  4. package/chunks/block-CSVO3R47.js +2 -0
  5. package/chunks/{build-DPBRNANI.js → build-S4DSRSSR.js} +1 -1
  6. package/chunks/cancel-AJOYWYV5.js +2 -0
  7. package/chunks/{changelog-gen-627BV77Z.js → changelog-gen-TE6FXELA.js} +1 -1
  8. package/chunks/{chunk-7NKYCWAA.js → chunk-2PWSTO7A.js} +1 -1
  9. package/chunks/{chunk-H6P3EACV.js → chunk-3CE7GA2P.js} +1 -1
  10. package/chunks/{chunk-FNPBHLLZ.js → chunk-3KGG2I2A.js} +1 -1
  11. package/chunks/{chunk-73IMECRI.js → chunk-3SBAWBWS.js} +1 -1
  12. package/chunks/chunk-4NNSMDFH.js +2 -0
  13. package/chunks/{chunk-R4GKIRAI.js → chunk-4QMRLILJ.js} +1 -1
  14. package/chunks/chunk-4TTJVJEI.js +2 -0
  15. package/chunks/{chunk-7KFSTOXR.js → chunk-4XXI5LYN.js} +1 -1
  16. package/chunks/{chunk-4LQG2WOJ.js → chunk-66VSO643.js} +1 -1
  17. package/chunks/chunk-67AFLWXV.js +4 -0
  18. package/chunks/{chunk-C7NZBKCW.js → chunk-72R6CKNY.js} +1 -1
  19. package/chunks/{chunk-TFRONHJA.js → chunk-AUDMKDAA.js} +1 -1
  20. package/chunks/{chunk-RHVDIXOM.js → chunk-BESTYZQY.js} +1 -1
  21. package/chunks/{chunk-2YTW3JQ6.js → chunk-BJ45FF6F.js} +1 -1
  22. package/chunks/{chunk-DM6U63HP.js → chunk-BNZPRQUS.js} +1 -1
  23. package/chunks/{chunk-KHBIOZJE.js → chunk-BVIGTD2Z.js} +1 -1
  24. package/chunks/{chunk-5JV6KQMP.js → chunk-CE6UVD6F.js} +1 -1
  25. package/chunks/{chunk-WI2RW3YL.js → chunk-DHNS2KLJ.js} +1 -1
  26. package/chunks/{chunk-WTMV5GTZ.js → chunk-DTDUHDLM.js} +1 -1
  27. package/chunks/{chunk-MTCPFQ5I.js → chunk-FVXGVHUR.js} +1 -1
  28. package/chunks/{chunk-3D5TBTM3.js → chunk-HTC2FO4I.js} +2 -2
  29. package/chunks/{chunk-J5HFD7AQ.js → chunk-HV3EYAGF.js} +1 -1
  30. package/chunks/{chunk-XUV7CW3L.js → chunk-IY3YRKJJ.js} +1 -1
  31. package/chunks/{chunk-O325ZU5M.js → chunk-JTSRGXS4.js} +1 -1
  32. package/chunks/{chunk-CVDLYIOW.js → chunk-KFSZ6MDH.js} +1 -1
  33. package/chunks/chunk-KNIM3QST.js +10 -0
  34. package/chunks/chunk-L32KHQVT.js +3 -0
  35. package/chunks/chunk-LS5MCZUM.js +2 -0
  36. package/chunks/{chunk-ATYDQCCJ.js → chunk-MGNBNMJZ.js} +1 -1
  37. package/chunks/chunk-MX5DKVDI.js +2 -0
  38. package/chunks/{chunk-JO4JKJ7R.js → chunk-N6PXARPJ.js} +1 -1
  39. package/chunks/{chunk-2LF7QSIN.js → chunk-NWWXAZFA.js} +8 -8
  40. package/chunks/{chunk-MW3RJU6I.js → chunk-OSNPAAYT.js} +1 -1
  41. package/chunks/{chunk-6BILFSH2.js → chunk-PBZV2KA3.js} +1 -1
  42. package/chunks/{chunk-YKEVDAWS.js → chunk-PG7KG7NX.js} +1 -1
  43. package/chunks/{chunk-UGYRUVUH.js → chunk-PY6ZNQ4B.js} +1 -1
  44. package/chunks/{chunk-PPSDIDOI.js → chunk-QHVTWYZJ.js} +1 -1
  45. package/chunks/chunk-QL5FA3P3.js +2 -0
  46. package/chunks/{chunk-ULIMXXRY.js → chunk-QRNSYEPI.js} +1 -1
  47. package/chunks/{chunk-N4NDBIQS.js → chunk-QXSFQQGJ.js} +1 -1
  48. package/chunks/{chunk-OLHBVIWG.js → chunk-TBRDRQQK.js} +1 -1
  49. package/chunks/{chunk-DLBRD3UT.js → chunk-TTLUVJIR.js} +1 -1
  50. package/chunks/chunk-UTWYRNI6.js +17 -0
  51. package/chunks/{chunk-JFKHBLJB.js → chunk-UYGKTA3C.js} +1 -1
  52. package/chunks/chunk-VKB3B2FE.js +4 -0
  53. package/chunks/{chunk-IIFFSCDJ.js → chunk-VXVW4UNH.js} +1 -1
  54. package/chunks/{chunk-TZDEJTLC.js → chunk-WJI2X6IA.js} +1 -1
  55. package/chunks/{chunk-LYPDFFKK.js → chunk-YCI2VITZ.js} +1 -1
  56. package/chunks/chunk-YXETE4S3.js +4 -0
  57. package/chunks/chunk-Z2RL2SFY.js +4 -0
  58. package/chunks/{chunk-R3UCRXDC.js → chunk-ZQ7KN4HT.js} +1 -1
  59. package/chunks/{claude-code-UJYCO6CN.js → claude-code-RN3Q2VCK.js} +1 -1
  60. package/chunks/commitmsg-BRWGZ26L.js +15 -0
  61. package/chunks/{concern-I6LCWEIC.js → concern-DXCLVP5Y.js} +1 -1
  62. package/chunks/config-O3OOS5BQ.js +2 -0
  63. package/chunks/{dev-JM7NU24M.js → dev-NJVFMPTE.js} +1 -1
  64. package/chunks/done-HGZT3ZOT.js +2 -0
  65. package/chunks/{file-tools-shared-YKDNDDHR.js → file-tools-shared-IIW7WSUM.js} +1 -1
  66. package/chunks/free-IPJPYOJS.js +2 -0
  67. package/chunks/{gh-DJ2YTDQX.js → gh-YLYXDL2X.js} +2 -2
  68. package/chunks/{gh-contributors-SXUFX3SO.js → gh-contributors-YFATSPSW.js} +1 -1
  69. package/chunks/{init-GBMYF3YG.js → init-BZ6B74SY.js} +1 -1
  70. package/chunks/{init-M3P2QCX2.js → init-X6KNS3NC.js} +1 -1
  71. package/chunks/invoke-hook-KLJOYZF5.js +12 -0
  72. package/chunks/{kiro-V6SMU4OL.js → kiro-JS5UVLRL.js} +1 -1
  73. package/chunks/{list-NX7RRO6R.js → list-COFD6OUQ.js} +1 -1
  74. package/chunks/{list-ZVCGDRUH.js → list-RI4IF5TD.js} +1 -1
  75. package/chunks/{main-JAGIKKVD.js → main-JZTE4B4L.js} +1 -1
  76. package/chunks/manager-FMP6PKIR.js +7 -0
  77. package/chunks/{mod-VZT7JWPZ.js → mod-64M47KGW.js} +1 -1
  78. package/chunks/{mod-NSL6IJRQ.js → mod-CTW3YE4Q.js} +1 -1
  79. package/chunks/{mod-7ICCX4OY.js → mod-D5IDWU35.js} +1 -1
  80. package/chunks/{mod-5NDTGNVM.js → mod-DESWHMN6.js} +1 -1
  81. package/chunks/{mod-QCXWBSGJ.js → mod-MC2WNSB2.js} +1 -1
  82. package/chunks/{mod-2WMXZZGJ.js → mod-TUZZQKGZ.js} +1 -1
  83. package/chunks/{mod-KPIOBBDD.js → mod-YNYASB66.js} +1 -1
  84. package/chunks/next-6K3PS64Z.js +9 -0
  85. package/chunks/{ollama-DFG5G467.js → ollama-PL4UHEF2.js} +1 -1
  86. package/chunks/{opencode-UA45VV3W.js → opencode-K4G7UMAE.js} +1 -1
  87. package/chunks/{pack-7TGKWDRO.js → pack-YQVWUWCL.js} +1 -1
  88. package/chunks/{purge-IKPQWHBC.js → purge-ZQ23VDGR.js} +1 -1
  89. package/chunks/{release-SEKFNXRA.js → release-XACZAR6J.js} +2 -2
  90. package/chunks/{release-notes-UUCPVHBQ.js → release-notes-W6MNV6OT.js} +1 -1
  91. package/chunks/{release-tag-F4B6ICW4.js → release-tag-HSZX6WYU.js} +1 -1
  92. package/chunks/reopen-Z3MPVAGR.js +2 -0
  93. package/chunks/reset-NWO3MNAG.js +2 -0
  94. package/chunks/{rule-PQ6WRV5W.js → rule-CH5GMFKE.js} +1 -1
  95. package/chunks/run-5YOXFMP2.js +4 -0
  96. package/chunks/{run-DAKF5SJN.js → run-IMXYUDHS.js} +1 -1
  97. package/chunks/{scripts-VRQQ24O3.js → scripts-XTXYY5MJ.js} +1 -1
  98. package/chunks/{sdk-L2SQCWYV.js → sdk-EJKXYVDC.js} +8 -8
  99. package/chunks/{serve-OGJIE344.js → serve-3PZ7RBQY.js} +1 -1
  100. package/chunks/session-22XFZLH2.js +2 -0
  101. package/chunks/spec-PWS2UYVL.js +2 -0
  102. package/chunks/status-G5D6BYFF.js +2 -0
  103. package/chunks/{sync-N5STAT6M.js → sync-URY32B7Y.js} +1 -1
  104. package/chunks/{system-6GEEPUXD.js → system-CP5L6XUP.js} +1 -1
  105. package/chunks/{system-3236RFTI.js → system-N5A3SM5G.js} +1 -1
  106. package/chunks/{validate-bom-ME2NQAP3.js → validate-bom-EH5Z5TVU.js} +1 -1
  107. package/chunks/{validate-case-conflict-QUNIB43P.js → validate-case-conflict-XN4KQDSK.js} +1 -1
  108. package/chunks/{validate-circular-deps-DLUCIW7T.js → validate-circular-deps-YZ4DIXIM.js} +1 -1
  109. package/chunks/{validate-commit-msg-SRLJRTKU.js → validate-commit-msg-MXTBUPTC.js} +1 -1
  110. package/chunks/{validate-docs-43LWHLVW.js → validate-docs-BE32R2UM.js} +1 -1
  111. package/chunks/{validate-filenames-WNLZI2S6.js → validate-eof-JPKT2D3D.js} +1 -1
  112. package/chunks/{validate-export-names-D5I5DZTN.js → validate-export-names-D3QNF6VB.js} +1 -1
  113. package/chunks/{validate-eof-RV3IK6ZM.js → validate-filenames-DMZ46CRH.js} +1 -1
  114. package/chunks/{validate-json-6KIMBNBJ.js → validate-json-KG3U4NLK.js} +1 -1
  115. package/chunks/validate-large-files-C2ILVCDB.js +2 -0
  116. package/chunks/validate-licenses-P24RTTYG.js +2 -0
  117. package/chunks/validate-line-endings-F65GG2PC.js +2 -0
  118. package/chunks/validate-merge-conflict-PVT6WR2W.js +2 -0
  119. package/chunks/{validate-mod-exports-VCV4VZ5F.js → validate-mod-exports-J6KLADGR.js} +1 -1
  120. package/chunks/{validate-package-configs-6PGL2YGD.js → validate-package-configs-BFCQMBEI.js} +1 -1
  121. package/chunks/validate-secrets-RBD2KJ3R.js +2 -0
  122. package/chunks/validate-shebangs-L5YR7AGC.js +2 -0
  123. package/chunks/validate-submodules-HD7CSBOG.js +2 -0
  124. package/chunks/validate-symlinks-RPSZMV5Y.js +2 -0
  125. package/chunks/{validate-toml-PV3G7EFD.js → validate-toml-OMUYIHX2.js} +1 -1
  126. package/chunks/validate-trailing-whitespace-BIG3YYFY.js +2 -0
  127. package/chunks/{validate-yaml-IOMFQTSQ.js → validate-yaml-VTE42YLF.js} +1 -1
  128. package/chunks/{versions-ROLQITT5.js → versions-GXSXTSSG.js} +1 -1
  129. package/chunks/{watch-4NXY7JEX.js → watch-EVUCQISN.js} +6 -6
  130. package/chunks/wontfix-4R2ESAR5.js +2 -0
  131. package/eser.js +1 -1
  132. package/package.json +1 -1
  133. package/chunks/approve-UWBYGXCF.js +0 -2
  134. package/chunks/block-W76WKMS3.js +0 -2
  135. package/chunks/cancel-46C7E5N7.js +0 -2
  136. package/chunks/chunk-2HSGE3TL.js +0 -2
  137. package/chunks/chunk-2TANTKYS.js +0 -4
  138. package/chunks/chunk-C2IORZTF.js +0 -4
  139. package/chunks/chunk-DPZJWN2Y.js +0 -2
  140. package/chunks/chunk-EQUPVWVY.js +0 -2
  141. package/chunks/chunk-GVTM4EOU.js +0 -4
  142. package/chunks/chunk-LJ7A5HYR.js +0 -2
  143. package/chunks/chunk-TMMAF763.js +0 -10
  144. package/chunks/chunk-WZHVKEPB.js +0 -17
  145. package/chunks/chunk-XOMPQOI6.js +0 -4
  146. package/chunks/chunk-YACXTCWF.js +0 -2
  147. package/chunks/commitmsg-57EMHAFY.js +0 -11
  148. package/chunks/done-A5VWIFOF.js +0 -2
  149. package/chunks/free-5NMWMMYS.js +0 -2
  150. package/chunks/invoke-hook-6BKTP2JY.js +0 -12
  151. package/chunks/manager-GN6J4AUV.js +0 -7
  152. package/chunks/next-TIUOHHFS.js +0 -9
  153. package/chunks/reopen-G4IUIH73.js +0 -2
  154. package/chunks/reset-BJZ263XC.js +0 -2
  155. package/chunks/run-Y4ESAQUK.js +0 -4
  156. package/chunks/session-CFDY73RJ.js +0 -2
  157. package/chunks/spec-CYRR2XUA.js +0 -2
  158. package/chunks/status-ZE2SA6FP.js +0 -2
  159. package/chunks/validate-large-files-UXP7AZCW.js +0 -2
  160. package/chunks/validate-licenses-BL6PNSBP.js +0 -2
  161. package/chunks/validate-line-endings-NYHXORRG.js +0 -2
  162. package/chunks/validate-merge-conflict-IWUP4ZMW.js +0 -2
  163. package/chunks/validate-secrets-JV4ZSOVR.js +0 -2
  164. package/chunks/validate-shebangs-YACNWUG7.js +0 -2
  165. package/chunks/validate-submodules-ZXID3VEK.js +0 -2
  166. package/chunks/validate-symlinks-QNMKPYUY.js +0 -2
  167. package/chunks/validate-trailing-whitespace-5Q5SEHOD.js +0 -2
  168. package/chunks/wontfix-YSXRDPKA.js +0 -2
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as y}from"./chunk-IZUADMIU.js";import{c as d}from"./chunk-KNIM3QST.js";import{i as h}from"./chunk-6DBKPC2O.js";var S=p=>{let n=p.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return n.length>1?n:p.split(/\.(?=\s+[A-Z])|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},A=(p,n=[])=>{let t=[],c=p.find(r=>r.questionId==="ambition");if(c!==void 0){let r=c.answer,a=r.match(/10[- ]?star[:\s]+(.+?)(?:\n|$)/is),l=r.match(/5[- ]?star[:\s]+(.+?)(?:\n|$)/is),o=(a!==null?a[1].trim():l!==null?l[1].trim():r.replace(/1[- ]?star[:\s]+[^.]*\.\s*/i,"").trim()).replace(/^(the|a|an|with|plus|also)\s+/i,"").replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim();o.length>0&&(o=o.charAt(0).toUpperCase()+o.slice(1)),o=o.replace(/[.\u2026]+$/,"").trim(),o.length>140&&(o=o.slice(0,137)+"..."),o.length>3&&t.push(o)}let i=p.find(r=>r.questionId==="verification");if(i!==void 0){let r=i.answer.split(/\n/).map(a=>a.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(a=>a.length>0);for(let a of r)t.push(a)}for(let r of n){let a=r.choice.toLowerCase();if(a.includes("accepted")||a.includes("add to scope")){let l=r.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),e=l.charAt(0).toUpperCase()+l.slice(1);t.push(e)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t.push("Write or update tests for all new and changed behavior"),t.push("Update documentation for all public-facing changes (README, API docs, CHANGELOG)"),t},C=(p,n)=>{let t={};if(n===null){for(let c of p.specSections)t[c]=!1;return t}for(let c of p.specSections){let i=c.toLowerCase();i.includes("design")||i.includes("mobile")||i.includes("layout")||i.includes("interaction")?t[c]=n.involvesWebUI:i.includes("contributor")||i.includes("public api")||i.includes("api surface")?t[c]=n.involvesPublicAPI:i.includes("migration")||i.includes("deprecation")||i.includes("backward")||i.includes("compatibility")?t[c]=n.involvesMigration:i.includes("audit")||i.includes("access control")||i.includes("data handling")?t[c]=n.involvesDataHandling:t[c]=!0}return t},b=(p,n,t,c,i,r,a,l)=>{let e=[];e.push(`# Spec: ${p}`),e.push(""),e.push("## Status: draft"),e.push(""),t.length>0&&(e.push(`## Concerns: ${t.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of n){if(e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),"user"in s&&s.user!=="Unknown User"){let u=s;e.push(""),e.push(`_-- ${u.user}_`)}e.push("")}for(let s of t)if(s.specSections.length>0){let u=C(s,i??null);for(let w of s.specSections)u[w]!==!1&&(e.push(`## ${w} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(c.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<c.length;s++){let u=c[s];e.push(`| ${s+1} | ${u.question} | ${u.choice} | ${u.promoted?"yes":"no"} |`)}e.push("")}let o=n.find(s=>s.questionId==="scope_boundary");if(o!==void 0){e.push("## Out of Scope"),e.push("");let s=S(o.answer);for(let u of s)e.push(`- ${u}`);e.push("")}let f=A(n,c);e.push("## Tasks"),e.push("");for(let s=0;s<f.length;s++)e.push(`- [ ] task-${s+1}: ${f[s]}`);e.push("");let m=n.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),m!==void 0){let s=S(m.answer);for(let u of s)e.push(`- ${u}`)}else e.push("_To be defined._");e.push("");let g=r??[];if(g.length>0){e.push("## Custom Acceptance Criteria"),e.push("");for(let s of g)e.push(`- ${s.text} _-- ${s.user}, ${s.addedInPhase}_`);e.push("")}let $=(a??[]).filter(s=>!s.text.startsWith("[TASK] "));if($.length>0){e.push("## Notes"),e.push("");for(let s of $)e.push(`- ${s.text} _-- ${s.user}, ${s.phase}_`);e.push("")}let v=l??[];if(v.length>0){e.push("## Transition History"),e.push(""),e.push("| From | To | User | Timestamp | Reason |"),e.push("|------|----|------|-----------|--------|");for(let s of v)e.push(`| ${s.from} | ${s.to} | ${s.user} | ${s.timestamp} | ${s.reason??"-"} |`);e.push("")}return e.join(`
3
+ `)};var _=async(p,n,t)=>{if(n.spec===null)throw new Error("No active spec");let c=`${p}/${d.specDir(n.spec)}`,i=`${p}/${d.specFile(n.spec)}`;await h.fs.mkdir(c,{recursive:!0});let r=b(n.spec,n.discovery.answers,t,n.decisions,n.classification,n.customACs,n.specNotes,n.transitionHistory);await h.fs.writeTextFile(i,r);let a=y(n.spec,r),l=`${c}/progress.json`,e={spec:n.spec,status:"draft",tasks:a.tasks.map(o=>({id:o.id,title:o.title,status:"pending"})),decisions:n.decisions.map(o=>({question:o.question,choice:o.choice,promoted:o.promoted})),debt:[],updatedAt:new Date().toISOString()};return await h.fs.writeTextFile(l,JSON.stringify(e,null,2)+`
4
+ `),i};export{_ as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as o}from"./chunk-ATYDQCCJ.js";import{a as l}from"./chunk-2XNFZXHY.js";import{e as n}from"./chunk-5WJ6AUNY.js";var i=n(l(),1);var a=o({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:["yml","yaml"],checkFile(e,r){if(r===void 0)return[];try{return i.parse(r),[]}catch(t){let s=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:s}]}}}),d=a.run,u=a.validator,f=a.main;export{a,d as b,u as c,f as d};
2
+ import{a as o}from"./chunk-MGNBNMJZ.js";import{a as l}from"./chunk-2XNFZXHY.js";import{e as n}from"./chunk-5WJ6AUNY.js";var i=n(l(),1);var a=o({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:["yml","yaml"],checkFile(e,r){if(r===void 0)return[];try{return i.parse(r),[]}catch(t){let s=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:s}]}}}),d=a.run,u=a.validator,f=a.main;export{a,d as b,u as c,f as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-EQUPVWVY.js";import"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as ClaudeCodeModel,b as claudeCodeFactory};
2
+ import{a,b}from"./chunk-MX5DKVDI.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as ClaudeCodeModel,b as claudeCodeFactory};
@@ -0,0 +1,15 @@
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-QXSFQQGJ.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f as u,h as f,k as p}from"./chunk-SHN5MT56.js";import{c as n,d,f as g}from"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as r}from"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var b=`Output ONLY a conventional commit message. Nothing else.
3
+
4
+ STRICT RULES:
5
+ - One line only. Max 72 characters.
6
+ - Format: type(scope): description
7
+ - Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
8
+ - No body. No explanation. No markdown. No code blocks. No bullet points.
9
+ - No quotes. No backticks. No decorative formatting. No insight blocks.
10
+ - No preamble. No commentary. Just the commit message line.
11
+
12
+ Example of correct output (the ENTIRE response is this one line):
13
+ feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=u({renderer:p.ansi(),sink:f.stdout()});try{let t=await r`git diff --cached`.noThrow().text();if(t.length===0&&(t=await r`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),o=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 "${o}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${o}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(g(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-YNYASB66.js")).defaultFactories(),o=new w({factories:s}),a=e;if(a===void 0)try{await r`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await o.addModel("default",{provider:a,model:"default"});let c=o.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:
14
+
15
+ ${i}`)],maxTokens:256});return await o.close(),x(k).trim()},$={name:"ai-commitmsg",description:"Generate commit message from git diff using AI",run:async i=>{try{let e=i.provider,t=await r`git diff --cached`.noThrow().text();return t.length===0&&(t=await r`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,$ 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-2HSGE3TL.js";import{k,l as y,m as x,n as P}from"./chunk-TMMAF763.js";import{b as $,c as b}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-SHN5MT56.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-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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-4NNSMDFH.js";import{k,l as y,m as x,n as P}from"./chunk-KNIM3QST.js";import{b as $,c as b}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-SHN5MT56.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-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as p,b as h,c as k,d as C,e as P,f as w}from"./chunk-L32KHQVT.js";import{b as m}from"./chunk-UEMWZOIU.js";import{f as l,h as o,k as u}from"./chunk-SHN5MT56.js";import{c as d,d as n,f,g}from"./chunk-YVN2NZL4.js";import{a,b as c}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var G=async s=>{let e=s?.[0];if(e==="set-user")return await v(s?.slice(1));if(e==="get-user")return await x();if(e==="clear-user")return await A();let r=m(),i=l({renderer:u.ansi(),sink:o.stdout()});return i.writeln(`Usage: ${r} config <set-user | get-user | clear-user>`),await i.close(),a(void 0)},v=async s=>{let e=l({renderer:u.ansi(),sink:o.stdout()}),r=null,i=null,y=!1;for(let t of s??[])t.startsWith("--name=")?r=t.slice(7):t.startsWith("--email=")?i=t.slice(8):t==="--from-git"&&(y=!0);if(y){let t=await P();if(t===null)return e.writeln(f("Could not read git user config.")),await e.close(),c({exitCode:1});r=t.name,i=t.email}if(r===null||r.length===0)return e.writeln(f("Please provide a name: "),d(`${m()} config set-user --name="Your Name" --email="you@example.com"`)),await e.close(),c({exitCode:1});let U={name:r,email:i??""};return await k(U),e.writeln(g("User set: "),d(w(U))),e.writeln(n(` Stored in: ${p()}`)),await e.close(),a(void 0)},x=async()=>{let s=l({renderer:u.ansi(),sink:o.stdout()}),e=await h();return e===null?(s.writeln(n("No user configured.")),s.writeln(n(`Set one with: ${m()} config set-user --name="Your Name"`))):(s.writeln(d("User: "),w(e)),s.writeln(n(` File: ${p()}`))),await s.close(),a(void 0)},A=async()=>{let s=l({renderer:u.ansi(),sink:o.stdout()});return await C()?s.writeln(g("User identity cleared.")):s.writeln(n("No user configured.")),await s.close(),a(void 0)};export{G as main};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
2
  import{f as a,h as l,k as i}from"./chunk-SHN5MT56.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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-JAGIKKVD.js"),import("./mod-OG7BBJP4.js"),import("./mod-NSL6IJRQ.js"),import("./mod-VZT7JWPZ.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-JZTE4B4L.js"),import("./mod-OG7BBJP4.js"),import("./mod-CTW3YE4Q.js"),import("./mod-64M47KGW.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 D,d as I}from"./chunk-2PWSTO7A.js";import{h as x}from"./chunk-L32KHQVT.js";import{p as k,s as T,v as U}from"./chunk-QL5FA3P3.js";import{c as S,e as g,g as C,h as E,i as y}from"./chunk-KNIM3QST.js";import{c as $}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as h}from"./chunk-SHN5MT56.js";import{c as m,d as o,f as a,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async P=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),c=C(P);if(!c.ok)return e.writeln(a(c.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,c.spec)}catch(r){let p=r instanceof Error?r.message:String(r);return e.writeln(a(p)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let r=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(r)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to idle.")),await e.close(),n({exitCode:1})}}let v=await x(i),s=k(t,"done");s=T(s,"EXECUTING","COMPLETED",v),s.spec!==null&&await y(i,s.spec,s);let A=U(s);if(await E(i,A),s.spec!==null&&(await D(i,s.spec,"completed"),await I(i,s.spec,"completed")),e.writeln(u("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",m(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let r=t.decisions.filter(p=>p.promoted);r.length>0&&e.writeln(o(` Promoted to rules: ${r.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(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,b,c,d,e,f,g,h}from"./chunk-KHBIOZJE.js";import"./chunk-NBA6EFWU.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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-BVIGTD2Z.js";import"./chunk-NBA6EFWU.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{c as a}from"./chunk-UEMWZOIU.js";import{f as o,h as n,k as i}from"./chunk-SHN5MT56.js";import{c as e,d as t}from"./chunk-YVN2NZL4.js";import{a as r}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var c=async m=>{let s=o({renderer:i.ansi(),sink:n.stdout()});return s.writeln(t("noskills starts in idle mode with no enforcement. To work on a spec, run:")),s.writeln(e(` ${a('spec new "description"')}`)),await s.close(),r(void 0)};export{c as main};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-O325ZU5M.js";import{o as t}from"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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-JTSRGXS4.js";import{o as t}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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-SXUFX3SO.js")).main(s);case"release-notes":return await(await import("./release-notes-UUCPVHBQ.js")).main(s);case"release-tag":return await(await import("./release-tag-F4B6ICW4.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-YFATSPSW.js")).main(s);case"release-notes":return await(await import("./release-notes-W6MNV6OT.js")).main(s);case"release-tag":return await(await import("./release-tag-HSZX6WYU.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-O325ZU5M.js";import{o as c}from"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as l}from"./chunk-GVTM4EOU.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.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-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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-JTSRGXS4.js";import{o as c}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as l}from"./chunk-VKB3B2FE.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.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-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.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
  `)}
@@ -6,7 +6,7 @@ Available templates: ${S.join(", ")}`,exitCode:1});e.writeln(v(`
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
8
  `));try{let a=await import("./registry-fetcher-TGWYJ5GN.js"),u=await import("./recipe-applier-I2VBGHZU.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-5NDTGNVM.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(`
9
+ \u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-DESWHMN6.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,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as oe,b as ie}from"./chunk-NTY267SI.js";import{d as ne}from"./chunk-L5OC7F24.js";import{d as Y}from"./chunk-WZHVKEPB.js";import"./chunk-NY4W44PI.js";import{b as P}from"./chunk-2HSGE3TL.js";import{d as se}from"./chunk-2ZYCRMUT.js";import{c as Z,d as ee,e as te}from"./chunk-2LF7QSIN.js";import{a as H,b as _,h as q,l as B,n as K,p as U,z as V}from"./chunk-TMMAF763.js";import{a as Q,c as S,d as X}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as k,b as M,i as I,j as W,k as z,l as J,m as G,n as h,o as r,p as w}from"./chunk-YACXTCWF.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-N4NDBIQS.js";import"./chunk-BNQAZLIQ.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6BILFSH2.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as b}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var re=F;var me=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},he=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],ae=async t=>{let e=[];for(let o of he)for(let s of o.paths)if(await me(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},ye=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},Ce=async t=>{let e=[],o=await ce(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},ve=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},$e=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ce(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},le=async t=>{let[e,o,s,d]=await Promise.all([ye(t),Ce(t),ve(t),$e(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Ge=async t=>{let e=f.process.cwd(),o=oe(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=ie(t),y=de(d,"--concerns"),g=de(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${S("sync")}\` to regenerate tool files.`),b(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await le(e);D.succeed("Project scanned");for(let n of m.languages)r.step(s,` ${n}`);for(let n of m.frameworks)r.step(s,` ${n}`);for(let n of m.ci)r.step(s,` ${n}`);m.testRunner!==null&&r.step(s,` test runner: ${m.testRunner}`),h(s);let j=w(s,"Detecting coding tools...");j.start();let A=await ae(e),C=ne(),L=C!==null&&!A.includes(C)?[C]:[],v=[...new Set([...L,...A])];j.succeed(`${v.length} coding tool(s) detected`);for(let n of v){let i=n===C?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],i=g.filter(l=>n.includes(l));p=[...new Set([...L,...i])]}else u?p=[...v]:(h(s),p=await be(s,v,C));h(s);let O=w(s,"Detecting AI providers...");O.start();let x=(await re()).filter(n=>n.available).map(n=>n.name);O.succeed(`${x.length} provider(s) detected`),h(s);let T=await P(),c;if(y!==null){let n=T.map(i=>i.id);c=y.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=T.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=k(i)?[]:[...i]}c.length>0?r.success(s,` Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(s);let E=w(s,"Initializing...");E.start(),await U(e);let ue=T.filter(n=>c.includes(n.id));for(let n of ue)await K(e,n);let N=await X();Q(N);let $={..._(c,p,x,m),command:N};await B(e,$);let R=H();if(await q(e,R),E.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let i=await te(e,p,$);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(z(s,`Done. ${p.length} tool(s), ${x.length} provider(s), ${c.length} concern(s).`),o==="agent"){let i=(await P()).filter(ge=>c.includes(ge.id)),l=await Z(e),pe=ee($?.tools??[]),fe=Y(R,i,l,$,void 0,void 0,void 0,pe);await se(fe,"json")}else J(s),G(s,`Start a spec with: ${S('spec new "..."')}`);return b(void 0)},Te=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],be=async(t,e,o)=>{let s=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),y=await I(t,{message:s,options:Te.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(k(y))return[...e];let g=[...y];return o!==null&&!g.includes(o)&&g.unshift(o),g},de=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{Ge as main};
2
+ import{a as oe,b as ie}from"./chunk-NTY267SI.js";import{d as ne}from"./chunk-L5OC7F24.js";import{d as Y}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import{b as P}from"./chunk-4NNSMDFH.js";import{d as se}from"./chunk-2ZYCRMUT.js";import{c as Z,d as ee,e as te}from"./chunk-NWWXAZFA.js";import{a as H,b as _,h as q,l as B,n as K,p as U,z as V}from"./chunk-KNIM3QST.js";import{a as Q,c as S,d as X}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as k,b as M,i as I,j as W,k as z,l as J,m as G,n as h,o as r,p as w}from"./chunk-4TTJVJEI.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-QXSFQQGJ.js";import"./chunk-BNQAZLIQ.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as b}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var re=F;var me=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},he=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],ae=async t=>{let e=[];for(let o of he)for(let s of o.paths)if(await me(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},ye=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},Ce=async t=>{let e=[],o=await ce(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},ve=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},$e=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ce(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},le=async t=>{let[e,o,s,d]=await Promise.all([ye(t),Ce(t),ve(t),$e(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Ge=async t=>{let e=f.process.cwd(),o=oe(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=ie(t),y=de(d,"--concerns"),g=de(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${S("sync")}\` to regenerate tool files.`),b(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await le(e);D.succeed("Project scanned");for(let n of m.languages)r.step(s,` ${n}`);for(let n of m.frameworks)r.step(s,` ${n}`);for(let n of m.ci)r.step(s,` ${n}`);m.testRunner!==null&&r.step(s,` test runner: ${m.testRunner}`),h(s);let j=w(s,"Detecting coding tools...");j.start();let A=await ae(e),C=ne(),L=C!==null&&!A.includes(C)?[C]:[],v=[...new Set([...L,...A])];j.succeed(`${v.length} coding tool(s) detected`);for(let n of v){let i=n===C?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],i=g.filter(l=>n.includes(l));p=[...new Set([...L,...i])]}else u?p=[...v]:(h(s),p=await be(s,v,C));h(s);let O=w(s,"Detecting AI providers...");O.start();let x=(await re()).filter(n=>n.available).map(n=>n.name);O.succeed(`${x.length} provider(s) detected`),h(s);let T=await P(),c;if(y!==null){let n=T.map(i=>i.id);c=y.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=T.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=k(i)?[]:[...i]}c.length>0?r.success(s,` Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(s);let E=w(s,"Initializing...");E.start(),await U(e);let ue=T.filter(n=>c.includes(n.id));for(let n of ue)await K(e,n);let N=await X();Q(N);let $={..._(c,p,x,m),command:N};await B(e,$);let R=H();if(await q(e,R),E.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let i=await te(e,p,$);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(z(s,`Done. ${p.length} tool(s), ${x.length} provider(s), ${c.length} concern(s).`),o==="agent"){let i=(await P()).filter(ge=>c.includes(ge.id)),l=await Z(e),pe=ee($?.tools??[]),fe=await Y(R,i,l,$,void 0,void 0,void 0,pe);await se(fe,"json")}else J(s),G(s,`Start a spec with: ${S('spec new "..."')}`);return b(void 0)},Te=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],be=async(t,e,o)=>{let s=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),y=await I(t,{message:s,options:Te.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(k(y))return[...e];let g=[...y];return o!==null&&!g.includes(o)&&g.unshift(o),g},de=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{Ge as main};
@@ -0,0 +1,12 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{d as P}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{c as _,d as A}from"./chunk-NWWXAZFA.js";import{c as p,d as x,e as T,k as R,o as C,s as I,t as $,z as N}from"./chunk-KNIM3QST.js";import{c as m}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as l}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),U=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),V=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),M=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),Y=t=>{let s=0;for(;s<t.length;){let e=t[s];if(V.has(e)){s+=2;continue}if(M.has(e)){s+=1;continue}if(e.startsWith("--git-dir=")||e.startsWith("--work-tree=")||e.startsWith("--namespace=")||e.startsWith("--super-prefix=")||e.startsWith("--config-env=")){s+=1;continue}if(e.startsWith("-C")&&e.length>2){s+=1;continue}if(e.startsWith("-c")&&e.length>2&&e.includes("=")){s+=1;continue}return e}return null},S=t=>{let s=t.trim();if(!s.startsWith("git"))return!0;let e=s.slice(3).trim();if(e.length===0)return!0;let n=e.split(/\s+/),o=Y(n)??"";if(B.has(o))return!0;let i=U.get(o);if(i!==void 0){let r=n.indexOf(o),g=r>=0&&r+1<n.length?n[r+1]:"";if(i.has(g))return!0}return!1};var G=t=>{let s=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let o of s){let i;for(;(i=o.exec(t))!==null;){let r=i[1]??"";if(r.includes("git")&&!S(r))return!0}}let e=t.split(/\s*\|\s*/);for(let o of e){let i=o.trim();if(i.startsWith("git")&&!S(i))return!0}let n=t.matchAll(/(?:^|[\s($`(])git\b/g);for(let o of n){let r=o[0].indexOf("git"),g=(o.index??0)+r,f=(t.slice(g).split(/[;&|$)`'"]/)[0]??"").trim();if(f.startsWith("git")&&!S(f))return!0}return!1};var E=async()=>{let t=a.process.stdin.getReader(),s=[];try{for(;;){let{done:i,value:r}=await t.read();if(i||r===void 0)break;s.push(r)}}finally{t.releaseLock()}let e=0,n=new Uint8Array(s.reduce((i,r)=>i+r.length,0));for(let i of s)n.set(i,e),e+=i.length;let o=new TextDecoder().decode(n);try{return JSON.parse(o)}catch{return{}}},W=async t=>{let s=new TextEncoder,e=a.process.stdout.getWriter();await e.write(s.encode(JSON.stringify(t))),e.releaseLock()},ne=async t=>{switch(t?.[0]){case"pre-tool-use":return await K();case"stop":return await j();case"post-file-write":return await X();case"post-bash":return await H();case"session-start":return await z();default:return l(void 0)}},O=async t=>{await W({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${t}`}})},F=(t,s)=>{if(s||!t.includes("git"))return null;let e=t.split(/\s*(?:&&|;)\s*/);for(let n of e){let o=n.trim();if(o.startsWith("git")&&!S(o))return"Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."}return G(t)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},K=async()=>{let t=await E(),s=t.tool_name??"unknown",e=t.tool_input??{},n=t.cwd??a.process.cwd(),o=await R(n),i=a.env.get("NOSKILLS_SESSION")??null;if(i!==null){let c=await I(n,i);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(e.command??"").trim(),d=o?.allowGit??!1;if(!d&&u.includes("git")){let h=F(u,d);if(h!==null)return await O(h),l(void 0)}}return l(void 0)}}let r={};if(i!==null){let c=await I(n,i);if(c!==null&&c.mode==="spec"&&c.phase!==null)r={phase:c.phase};else if(c!==null&&c.spec!==null)try{r=await T(n,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await $(n);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let L of c){let v=L.phase??"IDLE",b=u[v]??0;b>h&&(h=b,d=v)}r={phase:d};let y=new TextEncoder,D=a.process.stderr.getWriter();await D.write(y.encode(`noskills: WARNING \u2014 ${c.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
3
+ `)),D.releaseLock()}else try{r=await x(n)}catch{return l(void 0)}}if(s==="Bash"){let c=(e.command??"").trim(),u=o?.allowGit??!1,d=F(c,u);return d!==null?(await O(d),l(void 0)):l(void 0)}let g=["Write","Edit","MultiEdit"];if(!g.includes(s))return l(void 0);let w=e.file_path??e.path??"";if(w.includes(".eser/")||w.includes(".claude/"))return l(void 0);let f=r.phase??"UNKNOWN";if(f==="EXECUTING"||f==="IDLE"||f==="COMPLETED"||f==="UNKNOWN"){if(f==="EXECUTING"&&g.includes(s)){let c=`${n}/${p.stateDir}/executor-warned.flag`;try{await a.fs.readTextFile(c)}catch{try{await a.fs.mkdir(`${n}/${p.stateDir}`,{recursive:!0}),await a.fs.writeTextFile(c,new Date().toISOString());let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
4
+ `)),d.releaseLock()}catch{}}}return l(void 0)}let k={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await O(k[f]??`Run \`${m("next")}\` first.`),l(void 0)},j=async()=>{let t=await E();if(t.stop_hook_active===!0)return l(void 0);let s=t.cwd??a.process.cwd(),e;try{let u=await a.fs.readTextFile(`${s}/${p.stateFile}`);e=JSON.parse(u)}catch{return l(void 0)}if(e.phase!=="EXECUTING")return l(void 0);let n=e.execution??{},o=`${s}/${p.stateDir}/files-changed.jsonl`,i=[];try{let d=(await a.fs.readTextFile(o)).trim().split(`
5
+ `).filter(Boolean);i=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let r=[],g="no changes";try{let{execSync:u}=await import("node:child_process");r=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
6
+ `).filter(Boolean);let y=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
7
+ `);g=y[y.length-1]??"no changes"}catch{}let w=[...new Set([...i,...r])],f=(n.iteration??0)+1,k=`${s}/${p.stateDir}/iterations`;try{await a.fs.mkdir(k,{recursive:!0}),await a.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:w,gitStat:g.trim(),timestamp:new Date().toISOString()},null,2)+`
8
+ `)}catch{}let c=15;try{let u=await R(s);u!==null&&(c=u.maxIterationsBeforeRestart)}catch{}e.execution={...n,iteration:f,modifiedFiles:w,lastProgress:g.trim()||n.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await a.fs.writeTextFile(`${s}/${p.stateFile}`,JSON.stringify(e,null,2)+`
9
+ `)}catch{}try{await a.fs.writeTextFile(o,"")}catch{}try{await a.fs.remove(`${s}/${p.stateDir}/executor-warned.flag`)}catch{}if(f>=c){let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${c}). Consider starting a fresh conversation.
10
+ `)),d.releaseLock()}return l(void 0)},X=async()=>{let t=await E(),s=t.tool_input??{},e=s.file_path??s.path??"";if(!e||e.includes(".eser/")||e.includes(".claude/"))return l(void 0);let n=t.cwd??a.process.cwd(),o=`${n}/${p.stateDir}/files-changed.jsonl`,i=JSON.stringify({file:e,tool:t.tool_name,ts:new Date().toISOString()});try{await a.fs.mkdir(`${n}/${p.stateDir}`,{recursive:!0});let r="";try{r=await a.fs.readTextFile(o)}catch{}await a.fs.writeTextFile(o,r+i+`
11
+ `)}catch{}return l(void 0)},H=async()=>{let t=await E(),e=(t.tool_input??{}).command??"";if(!e.includes("noskills"))return l(void 0);let n=t.cwd??a.process.cwd(),o=`${n}/${p.stateDir}/noskills-calls.jsonl`,i=JSON.stringify({command:e,ts:new Date().toISOString()});try{await a.fs.mkdir(`${n}/${p.stateDir}`,{recursive:!0});let r="";try{r=await a.fs.readTextFile(o)}catch{}await a.fs.writeTextFile(o,r+i+`
12
+ `)}catch{}return l(void 0)},z=async()=>{let t=a.process.cwd();if(!await N(t))return l(void 0);let s=await x(t),e=await R(t),o=(await C(t)).filter(w=>e!==null&&e.concerns.includes(w.id)),i=await _(t),r=A(e?.tools??[]),g=await P(s,o,i,e,void 0,void 0,void 0,r);return await W(g),l(void 0)};export{ne as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-C2IORZTF.js";import"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as KiroModel,b as kiroFactory};
2
+ import{a,b}from"./chunk-67AFLWXV.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as KiroModel,b as kiroFactory};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as p}from"./chunk-N4NDBIQS.js";import{f as o,h as m,k as d}from"./chunk-SHN5MT56.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
2
+ import{a as p}from"./chunk-QXSFQQGJ.js";import{f as o,h as m,k as d}from"./chunk-SHN5MT56.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as h,b as u,c as k}from"./chunk-WTMV5GTZ.js";import"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-SHN5MT56.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
2
+ import{a as h,b as u,c as k}from"./chunk-DTDUHDLM.js";import"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-SHN5MT56.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
3
3
  `),console.log("Options:"),console.log(" --config <path> Config directory (default: .)"),console.log(" -h, --help Show this help"),i(void 0);let o=m({renderer:w.ansi(),sink:c.stdout()}),A=d.config??".",r=await u(A),n=h();if(n.register(k),p?.tools!==void 0&&n.registerAll(p.tools),r!==null&&r.workflows.length>0){o.writeln(a("Workflows:"));for(let s of r.workflows){let x=s.on.length>0?s.on.join(", "):"(no events)",f=s.steps.length,C=f===1?"step":"steps";o.writeln(t(` ${s.id.padEnd(20)} `),e(x.padEnd(25)),t(` ${f} ${C}`))}}else o.writeln(e("No workflows defined."));o.writeln();let l=n.getAll();if(l.length>0){o.writeln(a(`Registered tools (${l.length}):`));for(let s of l)o.writeln(t(` ${s.name.padEnd(28)} `),e(s.description))}else o.writeln(e("No tools registered."));return await o.close(),i(void 0)};export{R as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as K,b as j,c as M,d as F,f as N}from"./chunk-5JV6KQMP.js";import{a as Q}from"./chunk-LLA75EMV.js";import"./chunk-LWQPFCWC.js";import"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-3D5TBTM3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-YTF3BAQS.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-5DWJ7WEE.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{m as W}from"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
2
+ import{a as K,b as j,c as M,d as F,f as N}from"./chunk-CE6UVD6F.js";import"./chunk-NVPQJFAI.js";import{a as Q}from"./chunk-LLA75EMV.js";import"./chunk-LWQPFCWC.js";import"./chunk-3OG2MEF2.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-YTF3BAQS.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-5DWJ7WEE.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{m as W}from"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
3
3
  ${p}`);let u=f=>f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),a=`
4
4
  console.error("Runtime bundling failed:", ${JSON.stringify(l)});
5
5
  document.getElementById("root").innerHTML = '<div class="error"><h2>Bundle Error</h2><pre>${u(l)}</pre></div>';
@@ -0,0 +1,7 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{e as oe,j as ce,r as q,u as le,w as ue,y as j,z as de}from"./chunk-KNIM3QST.js";import{b as K}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as _,d as re,e as ie,r as w,s as c,t as M,u as ae,v as P,w as W}from"./chunk-4TTJVJEI.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as se,e as N,f as ne}from"./chunk-VKB3B2FE.js";import{a as V,b as te}from"./chunk-FFWPJP7A.js";import{i as L}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var pe=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0});var Se=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"}[e]??e.slice(0,4),Te=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},v=(e,s)=>{let r=new Set(s.filter(a=>a.spec!==null).map(a=>a.spec)),n=e.map(a=>({label:a.name,badge:Se(a.phase),badgeColor:Te(a.phase),active:r.has(a.name),dimmed:a.phase==="COMPLETED"}));return n.length===0&&n.push({label:"No specs yet",dimmed:!0,selectable:!1}),n.push({label:"\u2500".repeat(20),dimmed:!0,selectable:!1}),n.push({label:"[n] New spec",badge:"+",badgeColor:"green"}),n.push({label:"[f] Idle mode",badge:"~",badgeColor:"cyan"}),n},X=(e,s,r,n)=>{let a=v(e,s),t=M.drawBox({x:n.x,y:n.y,width:n.width,height:n.height,title:"Specs",borderStyle:"rounded"}),y=P.renderList(a,r,n);return t+y};var Ie=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],Me=e=>{if(e===null||e==="IDLE")return"IDLE";let r={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return Ie.map(n=>n===r?c.bold(`\u2726${n}\u2726`):c.dim(n)).join("\u2192")},Ee=(e,s,r)=>{if(s===0)return c.dim("no tasks");let n=Math.round(e/s*r),a=r-n;return c.green("\u2588".repeat(n))+c.dim("\u2591".repeat(a))+` ${e}/${s}`},Y=(e,s,r)=>{let n=[];return e===null?(n.push(c.dim("No spec selected")),n.push(""),n.push(c.dim("Select a spec from the list or press [n] for new"))):e.mode==="free"?(n.push(c.bold("Mode: ")+c.cyan("IDLE")),n.push(c.dim("No active spec")),n.push(""),n.push(c.dim(`Session: ${e.sessionId}`))):(n.push(c.bold("Spec: ")+(e.spec??"unknown")),n.push(c.bold("Phase: ")+(e.phase??"unknown")),n.push(""),n.push(Me(e.phase)),n.push(""),r!==void 0&&n.push(c.bold("Progress: ")+Ee(r.completed,r.total,15)),n.push(""),n.push(c.dim(`Session: ${e.sessionId}`))),M.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:"Monitor",borderStyle:"rounded"},n)};var z=(e,s)=>{let r=e!==null?e.mode==="free"?"Terminal (IDLE)":`Terminal (${e.spec??"?"})`:"Terminal",n=e!==null&&e.widget!==null,a=M.drawBox({x:s.x,y:s.y,width:s.width,height:s.height,title:r,borderStyle:"rounded",skipInterior:n});if(e===null||e.widget===null&&e.buffer.length===0){let S=c.dim("Waiting for output..."),B=" ".repeat(s.width-2),d="";for(let k=1;k<s.height-1;k++)d+=c.moveTo(s.y+k,s.x+1),d+=k===1?c.truncate(S,s.width-2)+" ".repeat(Math.max(0,s.width-2-c.visibleLength(S))):B;return a+d}if(e.widget!==null)return a+e.widget.render(s);let t=s.height-2,y=e.buffer.slice(-t);return M.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:r,borderStyle:"rounded"},y)};var U=(e,s)=>({...e,tabs:[...e.tabs,s],selectedTabIndex:e.tabs.length}),me=(e,s)=>{let r=e.tabs.findIndex(t=>t.id===s);if(r===-1)return e;let n=e.tabs[r];n.process!==null&&n.process.kill();let a=e.tabs.filter(t=>t.id!==s);return{...e,tabs:a,selectedTabIndex:Math.min(e.selectedTabIndex,a.length-1)}},ge=(e,s)=>s<0||s>=e.tabs.length?e:{...e,selectedTabIndex:s},G=(e,s)=>{let r=s.split(`
3
+ `);for(let n of r)e.buffer.push(n);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},E=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var fe=(e,s,r)=>{if(r&&s==="c")return{type:"quit"};if(s==="tab")return{type:"toggleFocus"};if(e.focus==="list")switch(s){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newSpec"};case"f":return{type:"freeMode"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:s}},be=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),J=(e,s,r)=>{let n=P.nextSelectableIndex(r,e.selectedTabIndex,s);return{...e,selectedTabIndex:n}},H=(e,s,r)=>e>=r.x&&e<r.x+r.width&&s>=r.y&&s<r.y+r.height,ye=(e,s,r,n)=>{let a=e.x+1,t=e.y+1;if(H(a,t,s.left)){if(e.type==="wheel")return{type:"scrollSpecs",direction:e.direction==="up"?"up":"down"};if(e.type==="mousedown"&&e.button===0){let y=e.y+1-s.left.y-1;if(y>=0&&y<r.length){let S=r[y];if(S.selectable!==!1)return S.label.includes("[n]")?{type:"clickNewSpec"}:S.label.includes("[f]")?{type:"clickFreeMode"}:{type:"clickSpec",index:y}}}return{type:"none"}}return H(a,t,s.rightBottom)?e.type==="wheel"?{type:"scrollTerminal",direction:e.direction==="up"?"up":"down"}:n!=="terminal"?{type:"clickTerminal"}:{type:"forwardMouse",event:e}:H(a,t,s.rightTop)?{type:"clickMonitor"}:{type:"none"}};var Be=async e=>{let s=e?.includes("--dry-run")??!1,r=L.process.cwd();if(!await de(r))return console.error("noskills is not initialized. Run:",K(),"init"),te({exitCode:1});let a=(await ce(r)).map(i=>({name:i.name,phase:i.state.phase,hasActiveSession:!1})),t=pe(),{cols:y,rows:S}=w.getTerminalSize(),B={leftWidth:.25,rightTopHeight:.35},d=ae.calculateLayout(y,S,B),k=new TextEncoder,g=i=>{L.process.writeToStdout(k.encode(i))};if(s){g(w.clearScreenSeq());let i=` noskills manager | ${a.length} spec(s) | ${K()} | Ctrl+C to quit`;g(c.moveTo(d.statusBar.y,d.statusBar.x)),g(c.inverse(c.truncate(i,d.statusBar.width))),g(X(a,t.tabs,t.selectedTabIndex,d.left));let l=E(t);return g(Y(l,d.rightTop)),g(z(l,d.rightBottom)),g(c.moveTo(S,1)),g(`
4
+ `),V(void 0)}let D=new ne,F=null,Q=async()=>{for(let i of["claude","claude-code"])try{if(await se`which ${i}`.noThrow().code()===0)return i}catch{}return"claude"},T=v(a,t.tabs);t.selectedTabIndex=P.nextSelectableIndex(T,-1,"down");let A=async()=>{let i=j();await q(r,{id:i,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let l=d.rightBottom.width-2,p=d.rightBottom.height-2,o=new W(p,l),f={id:`tab-${i}`,spec:null,mode:"free",sessionId:i,process:null,buffer:[],widget:o,active:!0,phase:null};try{let m=await Q(),b=await N({command:m,cwd:r,env:{...L.env.toObject(),NOSKILLS_SESSION:i},cols:l,rows:p});f.process=b,D.add(f.id,b),b.onData(I=>{o.write(I),G(f,I),F?.()})}catch(m){let b=m instanceof Error?m.message:String(m);o.write(`[noskills manager] Failed to spawn claude: ${b}\r
5
+ `),o.write(`Is Claude Code installed? Set command in manifest.yml\r
6
+ `)}Object.assign(t,U(t,f)),t.focus="terminal",T=v(a,t.tabs)},Z=async i=>{let l=t.tabs.find(h=>h.spec===i);if(l!==void 0){let h=t.tabs.indexOf(l);Object.assign(t,ge(t,h)),t.focus="terminal";return}let p=null;try{p=(await oe(r,i)).phase}catch{}let o=j();await q(r,{id:o,spec:i,mode:"spec",phase:p,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let f=d.rightBottom.width-2,m=d.rightBottom.height-2,b=new W(m,f),I={id:`tab-${o}`,spec:i,mode:"spec",sessionId:o,process:null,buffer:[],widget:b,active:!0,phase:p};try{let h=await Q(),R=await N({command:h,cwd:r,env:{...L.env.toObject(),NOSKILLS_SESSION:o},cols:f,rows:m});I.process=R,D.add(I.id,R),R.onData(ee=>{b.write(ee),G(I,ee),F?.()})}catch(h){let R=h instanceof Error?h.message:String(h);b.write(`[noskills manager] Failed to spawn claude for spec "${i}": ${R}\r
7
+ `)}Object.assign(t,U(t,I)),t.focus="terminal",T=v(a,t.tabs)};g(w.enterAlternateScreen()),g(w.hideCursorSeq()),g(w.clearScreenSeq()),g(_.enableMouse());let u=new Set(["specs","monitor","terminal","status"]),C=()=>{let i=E(t),l=[];if(l.push(w.hideCursorSeq()),u.has("status")||u.size===0){let p=t.focus==="list"?"LIST":"TERM",o=` noskills manager | ${a.length} spec(s) | ${t.tabs.length} tab(s) | [${p}] Tab: toggle | q: quit | n: new | f: free`;l.push(c.moveTo(d.statusBar.y,d.statusBar.x)),l.push(c.inverse(c.truncate(o,d.statusBar.width)+" ".repeat(Math.max(0,d.statusBar.width-c.visibleLength(o)))))}u.has("specs")&&l.push(X(a,t.tabs,t.selectedTabIndex,d.left)),u.has("monitor")&&l.push(Y(i,d.rightTop)),u.has("terminal")&&l.push(z(i,d.rightBottom)),l.push(w.showCursorSeq()),u.clear(),g(l.join(""))},x=()=>{u.add("specs"),u.add("monitor"),u.add("terminal"),u.add("status")},$=!1;F=()=>{u.add("terminal"),!$&&($=!0,setTimeout(()=>{$=!1,t.running&&C()},16))},x(),C();let he=async i=>{let l=ye(i,d,T,t.focus);switch(l.type){case"clickSpec":{t.focus="list",t.selectedTabIndex=l.index;let p=a.find(o=>o.name===T[l.index]?.label)?.name;if(p!==void 0){await Z(p),x();return}u.add("specs"),u.add("monitor"),u.add("status");break}case"clickNewSpec":case"clickFreeMode":{t.focus="list",await A(),x();return}case"clickTerminal":{t.focus="terminal",u.add("status");break}case"clickMonitor":{t.focus="list",u.add("status");break}case"scrollSpecs":{Object.assign(t,J(t,l.direction,T)),u.add("specs"),u.add("monitor");break}case"scrollTerminal":{let p=E(t);if(p?.process!==null&&p!==null){let o=l.direction==="up"?"\x1B[A":"\x1B[B";p.process?.write(o.repeat(3))}break}case"forwardMouse":{t.focus="terminal",u.add("status");let p=E(t);if(p?.process!==null&&p!==null){let o=i.x+1-d.rightBottom.x,f=i.y+1-d.rightBottom.y,m=i.button;i.type==="mousemove"&&(m|=32),i.type==="wheel"&&(m=64|(i.direction==="down"?1:0)),i.shift&&(m|=4),i.ctrl&&(m|=16);let b=i.type==="mouseup"?"m":"M";p.process?.write(`\x1B[<${m};${o};${f}${b}`)}break}case"none":break}};try{await re(async()=>{for await(let i of ie(L.process.stdin)){if(!t.running)break;if(i.kind==="mouse"){await he(i.event),u.size>0&&C();continue}let l=i.event,p=fe(t,l.name,l.ctrl);switch(p.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,be(t)),u.add("status");break;case"navigate":Object.assign(t,J(t,p.direction,T)),u.add("specs"),u.add("monitor"),u.add("terminal");break;case"freeMode":await A(),x();break;case"newSpec":await A(),x();break;case"select":{let o=T[t.selectedTabIndex];if(o===void 0)break;let f=o.label;if(f.includes("[n]")||f.includes("[f]"))await A();else{let m=a.find(b=>b.name===f)?.name;m!==void 0&&await Z(m)}x();break}case"closeTab":{let o=E(t);o!==null&&(o.process!==null&&D.remove(o.id),await le(r,o.sessionId),Object.assign(t,me(t,o.id)),T=v(a,t.tabs),t.focus="list"),x();break}case"passthrough":{let o=E(t);o?.process!==null&&o!==null&&o.process?.write(new TextDecoder().decode(l.raw));break}case"none":break}if(!t.running)break;u.size>0&&C()}})}finally{await D.killAll(),D.forceKillAll(),await ue(r),g(_.disableMouse()),g(w.showCursorSeq()),g(w.exitAlternateScreen())}return V(void 0)};export{Be as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
2
+ import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
3
3
  "./${t.relativePath}",
4
4
  "default"
5
5
  );`:`export const ${n} = createClientReference(
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f}from"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{b as CommandBuilder,a as CommandError,f as ProcessGroup,d as exec,c as parseCommand,e as spawnPty};
2
+ import{a,b,c,d,e,f}from"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{b as CommandBuilder,a as CommandError,f as ProcessGroup,d as exec,c as parseCommand,e as spawnPty};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-SHN5MT56.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-GVTM4EOU.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{b as v}from"./chunk-6G6UVWJN.js";import{e as te}from"./chunk-5WJ6AUNY.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
2
+ import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-SHN5MT56.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-VKB3B2FE.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{b as v}from"./chunk-6G6UVWJN.js";import{e as te}from"./chunk-5WJ6AUNY.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
3
3
  ${n.join(`
4
4
  `)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\0GLOBSTAR\0").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(de(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!pe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".eser/manifest.yml",".eser/manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var Ge=async r=>{let t=O(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
5
5
 
@@ -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}from"./chunk-TZDEJTLC.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-DM6U63HP.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as completionsHandler,f as doctorHandler,g as infoHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
2
+ import{a,b,c,d,e,f,g}from"./chunk-WJI2X6IA.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-BNZPRQUS.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as completionsHandler,f as doctorHandler,g as infoHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as Le}from"./chunk-WI2RW3YL.js";import{a as qe}from"./chunk-H6P3EACV.js";import{a as _e,c as Je}from"./chunk-2YTW3JQ6.js";import{a as We}from"./chunk-TFRONHJA.js";import{a as ze}from"./chunk-YKEVDAWS.js";import{a as Se,c as $e}from"./chunk-R3UCRXDC.js";import{a as Re,c as Te}from"./chunk-JO4JKJ7R.js";import{a as De,c as Fe}from"./chunk-4LQG2WOJ.js";import{a as Pe,c as je}from"./chunk-7KFSTOXR.js";import{a as Ie,c as Ee}from"./chunk-J5HFD7AQ.js";import{a as Me,c as Ne}from"./chunk-ULIMXXRY.js";import{a as Oe}from"./chunk-73IMECRI.js";import{a as Ae}from"./chunk-OLHBVIWG.js";import"./chunk-IIFFSCDJ.js";import{a as de,c as ce}from"./chunk-UGYRUVUH.js";import{a as pe,c as me}from"./chunk-DLBRD3UT.js";import{a as ue,c as fe}from"./chunk-MW3RJU6I.js";import{a as ge,c as ve}from"./chunk-JFKHBLJB.js";import{a as ye,c as he}from"./chunk-R4GKIRAI.js";import{a as ke,c as be}from"./chunk-RHVDIXOM.js";import{a as xe,c as Ve}from"./chunk-XUV7CW3L.js";import{a as Ce,c as we}from"./chunk-LYPDFFKK.js";import"./chunk-3D5TBTM3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-C7NZBKCW.js";import{a as re}from"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import{b as H,c as Q}from"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-O325ZU5M.js";import{a as q,b as Z,f as ee,h as te,j as ae,k as _,o as m,p as se,q as oe}from"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import{a as K}from"./chunk-MG65QJY6.js";import{a as P,b as L}from"./chunk-FFWPJP7A.js";import{i as j}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var I=async a=>{let s=await H(a);return s===null?null:s},Ke=async a=>await Q(a);var J={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let s=await Le({root:a.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(e=>({severity:"error",message:`Circular dependency: ${e.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var W={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let s=await We({root:a.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(e=>({severity:"error",message:`Missing export in ${e.packageName}: ${e.file}`,file:e.file})),stats:{packagesChecked:s.packagesChecked}}}};var z={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let s=await qe({root:a.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(e=>({severity:"error",message:`${e.packageName}: "${e.exportPath}" should be "${e.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var Y={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let s=a.options?.requireExamples,e=await Ae({root:a.root,requireExamples:s});return{name:"validate-docs",passed:e.isValid,issues:e.issues.map(t=>({severity:"error",message:`${t.symbol}: ${t.issue}`,file:t.file,line:t.line})),stats:{filesChecked:e.filesChecked,symbolsChecked:e.symbolsChecked}}}};var B={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let s=await ze({root:a.root}),e=[];for(let t of s.inconsistencies)e.push({severity:"error",message:`${t.packageName}: ${t.field} mismatch - deno.json: ${JSON.stringify(t.denoValue)}, package.json: ${JSON.stringify(t.packageValue)}`});for(let t of s.dependencyInconsistencies){let c=`${t.packageName}: ${t.dependencyName} - ${t.issue}`;t.expected!==void 0&&t.actual!==void 0&&(c+=` (expected: ${t.expected}, actual: ${t.actual})`),e.push({severity:"error",message:c})}return{name:"validate-package-configs",passed:s.isConsistent,issues:e,stats:{packagesChecked:s.packagesChecked}}}};var tt=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],at=[],st=a=>at.some(s=>s.test(a)),ot=(a,s)=>{let e=a.slice(0,s);return e.includes("//")||e.includes("/*")&&!e.includes("*/")},it=(a,s)=>{let e=!1,t=!1,c=!1;for(let p=0;p<s;p++){let u=a[p];(p>0?a[p-1]:"")!=="\\"&&(u==="'"&&!t&&!c&&(e=!e),u==='"'&&!e&&!c&&(t=!t),u==="`"&&!e&&!t&&(c=!c))}return e||t||c},w=re({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:X,checkFile(a,s){if(s===void 0)return[];if(st(a.path))return[];let e=[],t=s.split(`
2
+ import{a as Le}from"./chunk-DHNS2KLJ.js";import{a as qe}from"./chunk-3CE7GA2P.js";import{a as _e,c as Je}from"./chunk-BJ45FF6F.js";import{a as We}from"./chunk-AUDMKDAA.js";import{a as ze}from"./chunk-PG7KG7NX.js";import{a as Se,c as $e}from"./chunk-ZQ7KN4HT.js";import{a as Re,c as Te}from"./chunk-N6PXARPJ.js";import{a as De,c as Fe}from"./chunk-66VSO643.js";import{a as Pe,c as je}from"./chunk-4XXI5LYN.js";import{a as Ie,c as Ee}from"./chunk-HV3EYAGF.js";import{a as Me,c as Ne}from"./chunk-QRNSYEPI.js";import{a as Oe}from"./chunk-3SBAWBWS.js";import{a as Ae}from"./chunk-TBRDRQQK.js";import"./chunk-VXVW4UNH.js";import{a as de,c as ce}from"./chunk-PY6ZNQ4B.js";import{a as pe,c as me}from"./chunk-TTLUVJIR.js";import{a as ue,c as fe}from"./chunk-OSNPAAYT.js";import{a as ge,c as ve}from"./chunk-UYGKTA3C.js";import{a as ye,c as he}from"./chunk-4QMRLILJ.js";import{a as ke,c as be}from"./chunk-BESTYZQY.js";import{a as xe,c as Ve}from"./chunk-IY3YRKJJ.js";import{a as Ce,c as we}from"./chunk-YCI2VITZ.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-72R6CKNY.js";import{a as re}from"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import{b as H,c as Q}from"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-JTSRGXS4.js";import{a as q,b as Z,f as ee,h as te,j as ae,k as _,o as m,p as se,q as oe}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as K}from"./chunk-MG65QJY6.js";import{a as P,b as L}from"./chunk-FFWPJP7A.js";import{i as j}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var I=async a=>{let s=await H(a);return s===null?null:s},Ke=async a=>await Q(a);var J={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let s=await Le({root:a.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(e=>({severity:"error",message:`Circular dependency: ${e.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var W={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let s=await We({root:a.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(e=>({severity:"error",message:`Missing export in ${e.packageName}: ${e.file}`,file:e.file})),stats:{packagesChecked:s.packagesChecked}}}};var z={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let s=await qe({root:a.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(e=>({severity:"error",message:`${e.packageName}: "${e.exportPath}" should be "${e.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var Y={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let s=a.options?.requireExamples,e=await Ae({root:a.root,requireExamples:s});return{name:"validate-docs",passed:e.isValid,issues:e.issues.map(t=>({severity:"error",message:`${t.symbol}: ${t.issue}`,file:t.file,line:t.line})),stats:{filesChecked:e.filesChecked,symbolsChecked:e.symbolsChecked}}}};var B={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let s=await ze({root:a.root}),e=[];for(let t of s.inconsistencies)e.push({severity:"error",message:`${t.packageName}: ${t.field} mismatch - deno.json: ${JSON.stringify(t.denoValue)}, package.json: ${JSON.stringify(t.packageValue)}`});for(let t of s.dependencyInconsistencies){let c=`${t.packageName}: ${t.dependencyName} - ${t.issue}`;t.expected!==void 0&&t.actual!==void 0&&(c+=` (expected: ${t.expected}, actual: ${t.actual})`),e.push({severity:"error",message:c})}return{name:"validate-package-configs",passed:s.isConsistent,issues:e,stats:{packagesChecked:s.packagesChecked}}}};var tt=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],at=[],st=a=>at.some(s=>s.test(a)),ot=(a,s)=>{let e=a.slice(0,s);return e.includes("//")||e.includes("/*")&&!e.includes("*/")},it=(a,s)=>{let e=!1,t=!1,c=!1;for(let p=0;p<s;p++){let u=a[p];(p>0?a[p-1]:"")!=="\\"&&(u==="'"&&!t&&!c&&(e=!e),u==='"'&&!e&&!c&&(t=!t),u==="`"&&!e&&!t&&(c=!c))}return e||t||c},w=re({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:X,checkFile(a,s){if(s===void 0)return[];if(st(a.path))return[];let e=[],t=s.split(`
3
3
  `);for(let c=0;c<t.length;c++){let p=t[c];for(let{pattern:u,replacement:f}of tt){let g=u.exec(p);g!==null&&(ot(p,g.index)||it(p,g.index)||e.push({path:a.path,line:c+1,message:`direct Deno API usage: ${g[0]} \u2014 use @eser/standards/cross-runtime (${f})`}))}}return e}}),St=w.run,Ye=w.validator,$t=w.main;var x={validators:new Map,initialized:!1},nt=()=>{n(J),n(W),n(z),n(Y),n(B),n(le),n(ce),n(me),n(fe),n(ve),n(he),n(be),n(Ve),n(we),n($e),n(Te),n(Fe),n(je),n(Ee),n(Ne),n(Je),n(Ye)},U=()=>{x.initialized||(x.initialized=!0,nt())},n=a=>{x.validators.set(a.name,a)},lt=a=>(U(),x.validators.get(a)??null),E=()=>(U(),[...x.validators.values()]),dt=()=>(U(),[...x.validators.keys()]),ct=a=>({name:a.config.name,description:a.config.description,run:async s=>{let e=await a.run(s);return{name:e.name,passed:e.issues.length===0,issues:e.issues.map(t=>({path:t.path,line:t.line,message:t.message,fixed:t.fixed})),mutations:e.mutations.map(t=>({path:t.path,oldContent:t.oldContent,newContent:t.newContent})),stats:{filesChecked:e.filesChecked,issuesFound:e.issues.length}}}}),pt=a=>({name:a.name,description:a.description,run:async s=>{let e=await a.validate({root:s.root??".",options:s});return{name:e.name,passed:e.passed,issues:e.issues.map(t=>({path:t.file,line:t.line,message:t.message})),mutations:[],stats:e.stats}}}),mt=()=>{let a=[],s=[ne,de,pe,ue,ge,ye,ke,xe,Ce,Se,Re,De,Pe,Ie,Me,_e,w];for(let t of s)a.push(ct(t));let e=[J,W,z,Y,B];for(let t of e)a.push(pt(t));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async t=>{let c=t.commitMsgFile??t._args?.[0]??".git/COMMIT_EDITMSG",{runtime:p}=await import("./mod-4XKQZL6W.js"),u;try{u=await p.fs.readTextFile(c)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${c}`}],mutations:[],stats:{}}}let f=Oe(u,{allowAsterisk:t.allowAsterisk,allowMultipleScopes:t.allowMultipleScopes,forceScope:t.forceScope,types:t.types});return{name:"validate-commit-msg",passed:f.valid,issues:f.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ut=8,Zt=async(a={})=>{let s=a.root??j.process.cwd(),t=(await I(s))?.stack??[],c=[...a.skip??[]],p=a.only??[],u=E(),f=[],g=[],S=[];for(let i of u){if(p.length>0&&!p.includes(i.name))continue;if(c.includes(i.name)){S.push(i.name);continue}if(i.requiredStacks.length>0&&t.length>0&&!i.requiredStacks.some(G=>t.includes(G))){g.push({name:i.name,reason:`Requires '${i.requiredStacks.join("' or '")}' stack`});continue}let $={...a.fix!==void 0?{fix:a.fix}:{}},h=await i.validate({root:s,options:$});f.push(h)}return{passed:f.every(i=>i.passed),results:f,skipped:g,disabled:S}},ea=async a=>{let s=K(a??j.process.args,{string:["root","only","skip"],boolean:["fix","help","json","yes"],alias:{h:"help",y:"yes"}});if(s.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -y, --yes Auto-confirm all fix prompts (no interactive prompts)"),console.log(" --json Output results as JSON (suppresses TUI output)"),console.log(" -h, --help Show this help message"),P(void 0);let e=s.json,t=s.yes,c=s.root,p=s.fix,u=s.only,f=s.skip,g=u!==void 0?u.split(",").map(o=>o.trim()):[],S=f!==void 0?f.split(",").map(o=>o.trim()):[],{ctx:i}=e?{ctx:Z({interaction:"non-interactive"})}:ie(),$=i.interaction==="interactive",h=c??j.process.cwd();e||ae(i,"Validating codebase...");let M=e?void 0:se(i,"Loading config...");M?.start();let R=(await I(h))?.stack??[],Be=R.length>0?R.join(", "):"all (no .eser/manifest.yml)";M?.succeed("Config loaded"),e||m.info(i,`Stack: ${Be}`);let Ue=E(),k=[],T=[],D=[];for(let o of Ue)if(!(g.length>0&&!g.includes(o.name))){if(S.includes(o.name)){D.push(o.name);continue}if(o.requiredStacks.length>0&&R.length>0&&!o.requiredStacks.some(d=>R.includes(d))){T.push({name:o.name,reason:`Requires '${o.requiredStacks.join("' or '")}' stack`});continue}k.push(o)}let V=[],N=e?void 0:oe(i,{total:k.length,label:"Validating..."});N?.start();let O=o=>{if(V.push(o),!e){let l=Object.entries(o.stats).map(([r,y])=>`${y} ${r}`).join(", "),d=`${o.name.padEnd(18)} (${l})`;o.passed?m.success(i,`PASS ${d}`):m.error(i,`FAIL ${d}`)}N?.advance(1)};if(p)for(let o of k){let l=await o.validate({root:h,options:{}}),d=l;if(!l.passed){let r=!0;if($&&!t&&!e){let y=l.issues.length,v=await ee(i,{message:`Fix ${y} issue(s) found by ${o.name}?`,initialValue:!0});(q(v)||!v)&&(r=!1)}r&&(d=await o.validate({root:h,options:{fix:!0}}))}O(d)}else{let o=0,l=async()=>{for(;o<k.length;){let y=o++,v=k[y];if(v===void 0)break;try{let b=await v.validate({root:h,options:{}});O(b)}catch(b){let Ge={name:v.name,passed:!1,issues:[{severity:"error",message:String(b)}],stats:{filesChecked:0,issuesFound:1,fixedCount:0}};O(Ge)}}},d=Math.min(ut,k.length),r=Array.from({length:d},()=>l());await Promise.allSettled(r)}if(N?.stop("Validation complete"),!e&&T.length>0){m.step(i,"Skipped (stack not configured):");for(let o of T)m.step(i,` - ${o.name}: ${o.reason}`)}if(!e&&D.length>0){m.step(i,"Disabled:");for(let o of D)m.step(i,` - ${o}`)}let C=V.flatMap(o=>o.issues.map(l=>({validator:o.name,...l})));if(!e&&C.length>0){m.warn(i,`Issues (${C.length}):`);let o=new Map;for(let l of C){let d=l.file??l.validator,r=o.get(d)??[];r.push(l),o.set(d,r)}for(let[l,d]of o){m.step(i,` ${l}`);for(let r of d){let y=r.severity==="error"?"error":"warning",v=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${y}${v}: ${r.message}`):m.warn(i,` ${y}${v}: ${r.message}`)}}}let F=V.filter(o=>!o.passed);if(!e&&$&&F.length>0)for(;;){let o=[...F.map(r=>({value:r.name,label:`${r.name} (${r.issues.length} issue(s))`})),{value:"__done__",label:"Done"}],l=await te(i,{message:"View details for which validator?",options:o});if(q(l)||l==="__done__")break;let d=F.find(r=>r.name===l);if(d!==void 0){m.info(i,`Details for ${d.name} (${d.issues.length} issue(s)):`);for(let r of d.issues){let y=r.severity==="error"?"error":"warning",v=r.file??d.name,b=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${v}${b} [${y}]: ${r.message}`):m.warn(i,` ${v}${b} [${y}]: ${r.message}`)}}}if(e){let o=V.every(d=>d.passed),l=JSON.stringify({passed:o,results:V,skipped:T,disabled:D},null,2);return console.log(l),o?P(void 0):L({message:"",exitCode:1})}let A=F.length;return A>0?(_(i,`${A} check(s) failed with ${C.length} issue(s)`),L({message:`${A} check(s) failed with ${C.length} issue(s)`,exitCode:1})):(_(i,"All checks passed!"),P(void 0))};export{Ke as getProjectConfigPath,lt as getValidator,dt as getValidatorNames,E as getValidators,mt as getWorkflowTools,I as loadProjectConfig,ea as main,n as registerValidator,Zt as validate};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-PPSDIDOI.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-EQUPVWVY.js";import{a as A,b as C}from"./chunk-FNPBHLLZ.js";import{a as M,b as w}from"./chunk-LJ7A5HYR.js";import{a as I,b as T}from"./chunk-C2IORZTF.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-QBGNUIP3.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-UJYCO6CN.js"),{ollamaFactory:c}=await import("./ollama-DFG5G467.js"),{openCodeFactory:n}=await import("./opencode-UA45VV3W.js"),{kiroFactory:p}=await import("./kiro-V6SMU4OL.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
2
+ import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-QHVTWYZJ.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-MX5DKVDI.js";import{a as A,b as C}from"./chunk-3KGG2I2A.js";import{a as M,b as w}from"./chunk-LS5MCZUM.js";import{a as I,b as T}from"./chunk-67AFLWXV.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-YMZNUQKZ.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-RN3Q2VCK.js"),{ollamaFactory:c}=await import("./ollama-PL4UHEF2.js"),{openCodeFactory:n}=await import("./opencode-K4G7UMAE.js"),{kiroFactory:p}=await import("./kiro-JS5UVLRL.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
@@ -0,0 +1,9 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as ye}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as ge,b as he,c as Se,d as K}from"./chunk-UTWYRNI6.js";import{a as z}from"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{a as ve,b as we,d as C}from"./chunk-2ZYCRMUT.js";import{a as Y,b as B,d as X}from"./chunk-NWWXAZFA.js";import{a as be}from"./chunk-Z2RL2SFY.js";import{a as _}from"./chunk-IZUADMIU.js";import{a as Pe,b as Ae,c as Fe,d as Ee}from"./chunk-2PWSTO7A.js";import{h as V}from"./chunk-L32KHQVT.js";import{a as xe,b as Ie,c as Z,d as ee,e as De,f as te,g as O,h as se,i as q,j as ne,k as Ce,m as ke,o as ie,p as Re}from"./chunk-QL5FA3P3.js";import{a as ae,c as E,e as ce,f as le,i as de,j as pe,k as ue,o as me,q as M,v as G,z as fe}from"./chunk-KNIM3QST.js";import{c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as N,b as A}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Te=a=>a.split(`
3
+ `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),Le=async(a,e)=>{let r=[],n=(e.startsWith(a)?e.slice(a.length+1):e).split("/");n.pop();for(let s=n.length;s>=0;s--){let c=`${s===0?a:`${a}/${n.slice(0,s).join("/")}`}/.folder-rules.md`,i=s===0?".":n.slice(0,s).join("/");try{let l=await y.fs.readTextFile(c),d=Te(l);for(let o of d)r.push({folder:i,rule:o})}catch{}}return r},re=async(a,e)=>{let r=new Set,p=[];for(let n of e){let s=await Le(a,n);for(let t of s){let c=`${t.folder}::${t.rule}`;r.has(c)||(r.add(c),p.push(t))}}return p};var ot=async a=>{let e=y.process.cwd(),r=ve(a),p=we(a);if(!await fe(e))return await C({error:`noskills not initialized. Run: ${j("init")}`},r),A({exitCode:1});let n=null;for(let m of p)m.startsWith("--answer=")&&(n=m.slice(9));let s=le(p),t;try{t=await ce(e,s)}catch(m){let f=m instanceof Error?m.message:String(m);return await C({error:f},r),A({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED")return await C({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),A({exitCode:1});let c=await ue(e);if(c?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-QE4P4DS4.js");m(c.command)}if(c===null)return await C({error:"No config found"},r),A({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let m=`${e}/${E.specDir(t.spec)}`;try{await y.fs.stat(m)}catch{return await C({error:!0,message:`Active spec '${t.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${j("reset")}\` to return to idle, or \`${j("cancel")}\` to mark as cancelled.`},r),A({exitCode:1})}}let i=ye(p,c);t.phase==="DISCOVERY"&&t.discovery.audience!==i&&(t={...t,discovery:{...t.discovery,audience:i}});let d=(await me(e)).filter(m=>c.concerns.includes(m.id));if(n!==null){let m=await V(e),f=await Ne(e,t,c,d,n,m);await M(e,f);let g={...f,lastCalledAt:new Date().toISOString()};await M(e,g);let R=y.env.get("NOSKILLS_SESSION")??null;R!==null&&await G(e,R,g.phase);let H=await Y(e),L=B(H,g.phase),U=g.spec!==null?await _(e,g.spec):null,v=await Oe(e,g),k=await re(e,v),b=X(c?.tools??[]),D=await V(e),I=await K(g,d,L,c,U,k,void 0,b,D),S=n.trim().toLowerCase()==="save",P=g.phase===t.phase;if(S&&P&&(g.phase==="SPEC_DRAFT"||g.phase==="SPEC_APPROVED")){let Q=g.phase==="SPEC_DRAFT"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',$e={...I,instruction:Q,saved:!0};return await C($e,r),N(void 0)}return await C(I,r),N(void 0)}let o={...t,lastCalledAt:new Date().toISOString()};await M(e,o);let u=y.env.get("NOSKILLS_SESSION")??null;u!==null&&await G(e,u,o.phase);let h=await Y(e),w=B(h,o.phase),x=o.spec!==null?await _(e,o.spec):null,W=await Oe(e,o),$=await re(e,W),F;o.phase==="IDLE"&&(F={existingSpecs:(await pe(e)).map(f=>({name:f.name,phase:f.state.phase,iteration:f.state.execution.iteration,detail:f.state.phase==="EXECUTING"?`${f.state.execution.completedTasks.length} tasks done, iteration ${f.state.execution.iteration}`:f.state.phase==="SPEC_DRAFT"?"awaiting approval":f.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let J=X(c?.tools??[]),T=await V(e),oe=await K(o,d,w,c,x,$,F,J,T);return await C(oe,r),N(void 0)},Ne=async(a,e,r,p,n,s)=>{switch(e.phase){case"DISCOVERY":{let t=e.specDescription!==null&&e.specDescription.length>0,c=e.discovery.mode;if(c===void 0&&t)return["full","validate","technical-depth","ship-fast","explore"].includes(n)?Z(e,n):Z(e,"full");let i=e.discovery.premisesCompleted===!0;if(c!==void 0&&!i){try{let u=JSON.parse(n);if(u!==null&&typeof u=="object"&&"premises"in u){let w=u.premises.map(x=>({text:x.text??"",agreed:x.agreed??!0,revision:x.revision,user:s?.name??"Unknown User",timestamp:new Date().toISOString()}));return ee(e,w)}}catch{}return ee(e,[])}let l=e.discovery.audience==="agent",d=null;try{let u=JSON.parse(n);typeof u=="object"&&u!==null&&!Array.isArray(u)&&(l?ge.map(x=>x.id).every(x=>x in u)&&(d=u):d=u)}catch{}let o=e;if(d!==null)for(let[u,h]of Object.entries(d))typeof h=="string"&&h.length>0&&(o=O(o,u,h,s));else{let u=he(p),h=o.discovery.currentQuestion,w=u[h];if(w===void 0)return e;o=O(o,w.id,n,s),o=Ce(o)}return Se(o.discovery.answers)&&(o=se(o)),o}case"DISCOVERY_REVIEW":{let t=n.trim().toLowerCase();if(t==="approve"){let i=z(e.discovery.answers);return i.detected&&i.proposals.length>=2?ne(e):e.discovery.mode!==void 0?ne(e):q(e)}if(t==="split")return await Me(a,e);if(t==="keep"){let i=ie(e,{id:`decision-split-keep-${Date.now()}`,question:"Split spec into separate areas?",choice:"Chose to keep as single spec despite multiple areas detected",promoted:!1,timestamp:new Date().toISOString()});return q(i)}let c=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!c){let i;if(t==="skip"||t==="none")i=te(e);else{let l=!1;try{let d=JSON.parse(n);if(d!==null&&typeof d=="object"&&"approach"in d){let o={id:String(d.approach),name:String(d.name??d.approach),summary:String(d.summary??""),effort:String(d.effort??""),risk:String(d.risk??""),user:s?.name??"Unknown User",timestamp:new Date().toISOString()};i=De(e,o),l=!0}}catch{}l||(i=te(e))}return q(i)}try{let i=JSON.parse(n);if(typeof i.revise=="object"&&i.revise!==null){let l=e;for(let[d,o]of Object.entries(i.revise))typeof o=="string"&&o.length>0&&(l=O(l,d,o,s));return l}}catch{}return e}case"SPEC_DRAFT":{if(n.trim().toLowerCase()==="save")return e;if(e.classification===null){let t,c=n.trim().toLowerCase();if(c==="none"||c==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let l=JSON.parse(n);t={involvesWebUI:l.involvesWebUI===!0||l.involvesUI===!0,involvesCLI:l.involvesCLI===!0||l.involvesUI===!0,involvesPublicAPI:l.involvesPublicAPI===!0,involvesMigration:l.involvesMigration===!0,involvesDataHandling:l.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let i={...e,classification:t};try{await be(a,i,p)}catch{}return i}try{let t=JSON.parse(n);if(typeof t.refinement=="string"&&t.refinement.length>0){let c=t.refinement;if(e.spec!==null){let i=`${a}/${E.specFile(e.spec)}`,l=await y.fs.readTextFile(i);if(c.includes("task-")){let o=je(c).map(w=>`- [ ] ${w}`).join(`
4
+ `),u=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,h=l.replace(u,`## Tasks
5
+
6
+ ${o}
7
+ `);await y.fs.writeTextFile(i,h)}}return e}}catch{}return e}case"SPEC_APPROVED":{if(n.trim().toLowerCase()==="save")return e;let t=ke(e);return t.spec!==null&&(await Pe(a,t.spec,"executing"),await Ee(a,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let c=await Ve(a,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:c}},!c.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await qe(a,e,n,p)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",c={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=ie(e,c);return i=xe(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},Me=async(a,e)=>{let r=z(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let p=[];for(let s of r.proposals){let t=`${a}/${E.specDir(s.name)}`;await y.fs.mkdir(t,{recursive:!0});let c=e.discovery.answers.filter(d=>s.relevantAnswers.includes(d.questionId)),l=Ie(ae(),s.name,`spec/${s.name}`);for(let d of c)l=O(l,d.questionId,d.answer);l=se(l),await de(a,s.name,l),p.push(s.name)}return Re(e,"cancelled",`Split into: ${p.join(", ")}`)},je=a=>a.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),qe=async(a,e,r,p)=>{let n;try{n=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let s=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let k=e.execution.debt.items.map((I,S)=>({id:`legacy-${S+1}`,text:I,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:k}}};let b=new TextEncoder,D=y.process.stderr.getWriter();await D.write(b.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
8
+ `)),D.releaseLock()}let t=new Set(["mandatory-tests","mandatory-docs"]),i=(n.na??[]).filter(v=>t.has(v));if(i.length>0)return{...s,execution:{...s.execution,lastProgress:`REJECTED: Tests and documentation ACs require explicit justification to mark as N/A. Explain why tests or docs are not needed for this spec. Rejected IDs: ${i.join(", ")}`,awaitingStatusReport:!0}};let l=n.completed??[],d=new Set(l),o=n.na??[],u=new Set(o),h=n.newIssues??[],w=n.remaining??[],x=n.blocked??[],W=s.execution.debt?.unaddressedIterations??0,$=s.execution.debt!==null?s.execution.debt.items.filter(v=>!d.has(v.id)&&!u.has(v.id)):[],F=s.execution.debtCounter??0,J=h.map((v,k)=>({id:`debt-${F+k+1}`,text:v,since:s.execution.iteration})),T=[...$,...J],m=w.length===0&&x.length===0&&h.length===0||T.length===0?null:{items:T,fromIteration:s.execution.debt?.fromIteration??s.execution.iteration,unaddressedIterations:$.length>0?W+1:1},f=[...new Set([...s.execution.naItems??[],...o])],g=[];l.length>0&&g.push(`Completed: ${l.join(", ")}`),o.length>0&&g.push(`N/A: ${o.join(", ")}`);let R=g.length>0?g.join("; "):"Status report submitted",H=s.execution.lastVerification===null||s.execution.lastVerification.passed===!0,L=m===null&&H,U=F+h.length;if(L&&s.spec!==null){let v=await _(a,s.spec);if(v!==null){let k=s.execution.completedTasks??[],b=new Set(k),D=[];try{let S=JSON.parse(s.execution.lastProgress??"");Array.isArray(S.completed)&&(D=S.completed.filter(P=>!b.has(P)&&v.tasks.some(Q=>Q.id===P)))}catch{}if(D.length===0){let S=v.tasks.find(P=>!b.has(P.id));S!==void 0&&(D=[S.id])}let I=[];for(let S of D)await Ae(a,s.spec,S),await Fe(a,s.spec,S,"done"),I.push(S);if(I.length>0){let S=I.length===1?`Task ${I[0]} accepted`:`Tasks ${I.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${S}: ${R}`,awaitingStatusReport:!1,debt:m,completedTasks:[...k,...I],debtCounter:U,naItems:f}}}}}return{...s,execution:{...s.execution,lastProgress:L?R:`Task not accepted \u2014 remaining items must be addressed first. ${R}`,awaitingStatusReport:!1,debt:m,debtCounter:U,naItems:f}}},Ve=async(a,e)=>{try{let{execSync:r}=await import("node:child_process"),p=r(e,{cwd:a,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(p).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let p=r,n=((p.stdout??"")+(p.stderr??"")).slice(0,4e3);return p.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${r instanceof Error?r.message:String(r)}`,timestamp:new Date().toISOString()}}},Oe=async(a,e)=>{let r=[...e.execution.modifiedFiles??[]],p=await _e(a);return[...new Set([...r,...p])]},_e=async a=>{let e=`${a}/${E.stateDir}/files-changed.jsonl`;try{let p=(await y.fs.readTextFile(e)).trim().split(`
9
+ `).filter(Boolean),n=[];for(let s of p)try{let t=JSON.parse(s);n.includes(t.file)||n.push(t.file)}catch{}return n}catch{return[]}};export{Ne as handleAnswer,ot as main,je as parseRefinementTasks};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-FNPBHLLZ.js";import"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OllamaModel,b as ollamaFactory};
2
+ import{a,b}from"./chunk-3KGG2I2A.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OllamaModel,b as ollamaFactory};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-LJ7A5HYR.js";import"./chunk-2TANTKYS.js";import"./chunk-J7YTWK67.js";import"./chunk-GVTM4EOU.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OpenCodeModel,b as openCodeFactory};
2
+ import{a,b}from"./chunk-LS5MCZUM.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OpenCodeModel,b as openCodeFactory};