eser 4.1.34 → 4.1.36

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 (74) hide show
  1. package/chunks/{build-6DCIDFY7.js → build-EJLFNB4I.js} +2 -2
  2. package/chunks/{changelog-gen-7V37P7PE.js → changelog-gen-MX6L2Z24.js} +1 -1
  3. package/chunks/{chunk-NTHP6SND.js → chunk-2HBVIH7V.js} +1 -1
  4. package/chunks/{chunk-CEYKWASA.js → chunk-4MVO4LD5.js} +1 -1
  5. package/chunks/chunk-AHLJCH32.js +2 -0
  6. package/chunks/{chunk-COKZ6MLN.js → chunk-B6EATLKL.js} +3 -3
  7. package/chunks/{chunk-4GQY3STW.js → chunk-DAYSTLLV.js} +1 -1
  8. package/chunks/{chunk-4SYC4WJV.js → chunk-DYRTLYTU.js} +2 -2
  9. package/chunks/{chunk-VC6ERZSI.js → chunk-GJ4LCA6D.js} +1 -1
  10. package/chunks/{chunk-CLL3YG4W.js → chunk-IIIMOOFE.js} +1 -1
  11. package/chunks/{chunk-5PNGVDLV.js → chunk-IZONBJSX.js} +1 -1
  12. package/chunks/{chunk-AGRTWPDI.js → chunk-KBFKBL6A.js} +1 -1
  13. package/chunks/{chunk-KKBIUT5L.js → chunk-KVTG56GS.js} +1 -1
  14. package/chunks/{chunk-N4HITOTN.js → chunk-OCPEFZBJ.js} +1 -1
  15. package/chunks/{chunk-64PIAW3Y.js → chunk-OIZ7HL2C.js} +1 -1
  16. package/chunks/{chunk-SQINSLNL.js → chunk-PZNCE6QK.js} +19 -19
  17. package/chunks/{chunk-5BZG26SF.js → chunk-QSION3QA.js} +1 -1
  18. package/chunks/{chunk-3KCPUYLZ.js → chunk-QZ44TAIY.js} +1 -1
  19. package/chunks/{chunk-K7MYEXOS.js → chunk-T2DRBZ4X.js} +1 -1
  20. package/chunks/chunk-UJPVEQX7.js +5 -0
  21. package/chunks/chunk-VAIRJES2.js +2 -0
  22. package/chunks/{commitmsg-UK2ABB7D.js → commitmsg-7XZGGERO.js} +1 -1
  23. package/chunks/concern-ZO533WR2.js +2 -0
  24. package/chunks/{dev-XBH6C6DH.js → dev-PTMXZEVC.js} +2 -2
  25. package/chunks/{gh-RKKHKA3B.js → gh-L25JQWOY.js} +2 -2
  26. package/chunks/{gh-contributors-X7BW57DD.js → gh-contributors-E7IZ2LFS.js} +1 -1
  27. package/chunks/init-3B7XMH2J.js +2 -0
  28. package/chunks/{init-32DVDSNZ.js → init-J4IHOVZL.js} +2 -2
  29. package/chunks/{install-LM44N3DB.js → install-KNZDCGIB.js} +1 -1
  30. package/chunks/{invoke-hook-PADL4W3J.js → invoke-hook-I2T7HYRT.js} +1 -1
  31. package/chunks/{main-JTYNMHNL.js → main-HJQEBLLN.js} +1 -1
  32. package/chunks/{mod-SA3J2VR5.js → mod-OS3BCM2G.js} +1 -1
  33. package/chunks/{mod-5WXRQGLS.js → mod-PFWQZF3T.js} +5 -5
  34. package/chunks/{mod-JN7WI5P6.js → mod-T5VHCXJT.js} +1 -1
  35. package/chunks/{mod-Y4UHOKMZ.js → mod-W3DBWTCY.js} +1 -1
  36. package/chunks/{next-ARUY5FHZ.js → next-TMHSP2BS.js} +1 -1
  37. package/chunks/{release-WKMSWXDS.js → release-J3PVDROM.js} +2 -2
  38. package/chunks/{release-notes-GOUHBQ2F.js → release-notes-AARDYXYA.js} +1 -1
  39. package/chunks/{release-tag-5WNEA4HM.js → release-tag-H2YWUXRU.js} +1 -1
  40. package/chunks/{run-TL4KPOGO.js → run-NSJ5YV6R.js} +1 -1
  41. package/chunks/{serve-DEYVWV2K.js → serve-XVAIQ37L.js} +2 -2
  42. package/chunks/{status-RCEYJVRQ.js → status-6SC3L7U2.js} +1 -1
  43. package/chunks/{system-LTVAILSL.js → system-L2JVPTCT.js} +1 -1
  44. package/chunks/{system-BJCQKFCP.js → system-WTPEDJU6.js} +1 -1
  45. package/chunks/{validate-bom-KEC4IOKO.js → validate-bom-QVE5HNBO.js} +1 -1
  46. package/chunks/{validate-case-conflict-ZZKZQQX4.js → validate-case-conflict-XFS3URQN.js} +1 -1
  47. package/chunks/{validate-circular-deps-QCJYK5K5.js → validate-circular-deps-BMPAT3PF.js} +1 -1
  48. package/chunks/{validate-commit-msg-PZZ4T4QF.js → validate-commit-msg-BPESCI7P.js} +1 -1
  49. package/chunks/{validate-docs-M55HAXPX.js → validate-docs-ITL4L6KY.js} +1 -1
  50. package/chunks/{validate-eof-MX52AUUT.js → validate-eof-DTFV74VL.js} +1 -1
  51. package/chunks/{validate-export-names-UFXPIDFW.js → validate-export-names-HLOH7D73.js} +1 -1
  52. package/chunks/{validate-filenames-LXIMPWRW.js → validate-filenames-J4RTDEBD.js} +1 -1
  53. package/chunks/{validate-json-TABLVKEH.js → validate-json-KMODGNSU.js} +1 -1
  54. package/chunks/{validate-large-files-CMCMEGYA.js → validate-large-files-X5YF7D7T.js} +1 -1
  55. package/chunks/{validate-licenses-MDGIDYNC.js → validate-licenses-OZ7DXQTY.js} +1 -1
  56. package/chunks/{validate-line-endings-K36HS73S.js → validate-line-endings-PFF6QJ3W.js} +1 -1
  57. package/chunks/{validate-merge-conflict-PMGZYM3B.js → validate-merge-conflict-KB2X6QLW.js} +1 -1
  58. package/chunks/{validate-mod-exports-M3UYNBK7.js → validate-mod-exports-VHK2NVKI.js} +1 -1
  59. package/chunks/{validate-package-configs-V5LR7K5C.js → validate-package-configs-ZNCAIYRO.js} +1 -1
  60. package/chunks/{validate-secrets-IAMY5DB5.js → validate-secrets-RM6DMZVG.js} +1 -1
  61. package/chunks/{validate-shebangs-GUBDNU2N.js → validate-shebangs-WC66D7RK.js} +1 -1
  62. package/chunks/{validate-submodules-ZA2FAF3W.js → validate-submodules-SPAXASAG.js} +1 -1
  63. package/chunks/{validate-symlinks-LSEEVFTR.js → validate-symlinks-4LOWK2MQ.js} +1 -1
  64. package/chunks/{validate-toml-JLQ3BY73.js → validate-toml-SG4IITMN.js} +1 -1
  65. package/chunks/{validate-trailing-whitespace-3UUUKE22.js → validate-trailing-whitespace-GRE2PJ6T.js} +1 -1
  66. package/chunks/{validate-yaml-2BG7G35N.js → validate-yaml-RA22QNW6.js} +1 -1
  67. package/chunks/{versions-IVXYMSAZ.js → versions-ODYWYT7U.js} +1 -1
  68. package/eser.js +1 -1
  69. package/package.json +1 -1
  70. package/chunks/chunk-E5QQGGNF.js +0 -2
  71. package/chunks/chunk-VG72SSDI.js +0 -5
  72. package/chunks/chunk-YTF3BAQS.js +0 -2
  73. package/chunks/concern-UCYEAXJ4.js +0 -2
  74. package/chunks/init-ULJBWJFH.js +0 -2
@@ -0,0 +1,5 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as k}from"./chunk-NBA6EFWU.js";import{d as F,f as T,h as C,j as d,k as L,n as u}from"./chunk-7ATUODBM.js";import{a as g}from"./chunk-AP72BKVG.js";import{t as D}from"./chunk-MRCBHVSB.js";var R={USE_CLIENT:"use client",USE_SERVER:"use server",USE_STRICT:"use strict"},M=[/node_modules/,/\.test\./,/\.spec\./],G=(t,e)=>{let r=t.split(`
3
+ `),i=e.toLowerCase(),o=!1;for(let s=0;s<Math.min(50,r.length);s++){let n=r[s]?.trim()??"";if(o){n.includes("*/")&&(o=!1);continue}if(n===""||n.startsWith("//"))continue;if(n.startsWith("/*")){n.includes("*/")||(o=!0);continue}let f=`"${i}";`,a=`'${i}';`,l=n.toLowerCase();if(l===f||l===a)return!0;if(n.startsWith("import")||n.startsWith("export")||n.startsWith("const")||n.startsWith("let")||n.startsWith("var")||n.startsWith("function")||n.startsWith("class"))break}return!1},W=t=>{let e=new Set,r=t.matchAll(/export\s+(?:async\s+)?function\s+(\w+)/g);for(let n of r)n[1]!==void 0&&e.add(n[1]);let i=t.matchAll(/export\s+(?:const|let)\s+(\w+)\s*=/g);for(let n of i)n[1]!==void 0&&e.add(n[1]);let o=t.matchAll(/export\s+class\s+(\w+)/g);for(let n of o)n[1]!==void 0&&e.add(n[1]);/export\s+default\s+/.test(t)&&e.add("default");let s=t.matchAll(/export\s*\{([\w\s,]+)\}/g);for(let n of s)if(n[1]!==void 0){let f=n[1].split(",").map(a=>{let l=a.trim().split(/ {1,10}as {1,10}/);return(l[1]??l[0])?.trim()});for(let a of f)a!==void 0&&a!==""&&e.add(a)}return[...e]},O=async t=>{try{return await D.fs.readTextFile(t)}catch{return null}},Q=async(t,e,r={})=>{let i=r.extensions??k,o=r.skip??M,s=r.projectRoot??t,n=[];for await(let f of D.fs.walk(t,{exts:[...i],skip:[...o]})){if(!f.isFile)continue;let a=await O(f.path);if(a!==null&&G(a,e)){let l=D.path.relative(s,f.path),m=W(a);n.push({filePath:f.path,relativePath:l,directive:e,exports:m})}}return n},Y=(t,e={})=>Q(t,R.USE_CLIENT,e),X=(t,e)=>{let r=`"${e}"`,i=`'${e}'`;return t.includes(r)||t.includes(i)},Z=async(t,e={})=>{let r=e.extensions??k,i=e.skip??M,o=e.projectRoot??t,s=[];for await(let n of D.fs.walk(t,{exts:[...r],skip:[...i]})){if(!n.isFile)continue;let f=await O(n.path);if(f!==null&&X(f,R.USE_SERVER)){let a=D.path.relative(o,n.path),l=W(f);s.push({filePath:n.path,relativePath:a,directive:R.USE_SERVER,exports:l})}}return s};function w(t){return t.isFile?"file":t.isDirectory?"dir":t.isSymlink?"symlink":void 0}async function x(t){try{let e=await Deno.stat(t);_(e);return}catch(e){if(!(e instanceof Deno.errors.NotFound))throw e}try{await Deno.mkdir(t,{recursive:!0})}catch(e){if(!(e instanceof Deno.errors.AlreadyExists))throw e;let r=await Deno.stat(t);_(r)}}function _(t){if(!t.isDirectory)throw new Error(`Failed to ensure directory exists: expected 'dir', got '${w(t)}'`)}function c(t){return t instanceof URL?C(t):t}function P(t,e,r=T){if(t=c(t),e=c(e),u(t)===u(e))return!1;let i=t.split(r),o=e.split(r);return i.every((s,n)=>o[n]===s)}function S(t,e){if(t===null)throw new Error(`${e} is unavailable`)}async function I(t,e,r){let i;try{i=await Deno.lstat(e)}catch(o){if(o instanceof Deno.errors.NotFound)return;throw o}if(r.isFolder&&!i.isDirectory)throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'`);if(!r.overwrite)throw new Deno.errors.AlreadyExists(`'${e}' already exists.`);return i}async function N(t,e,r){if(await I(t,e,r),await Deno.copyFile(t,e),r.preserveTimestamps){let i=await Deno.stat(t);S(i.atime,"statInfo.atime"),S(i.mtime,"statInfo.mtime"),await Deno.utime(e,i.atime,i.mtime)}}async function U(t,e,r){await I(t,e,r);let i=await Deno.readLink(t),o=w(await Deno.lstat(t));if(g?await Deno.symlink(i,e,{type:o==="dir"?"dir":"file"}):await Deno.symlink(i,e),r.preserveTimestamps){let s=await Deno.lstat(t);S(s.atime,"statInfo.atime"),S(s.mtime,"statInfo.mtime"),await Deno.utime(e,s.atime,s.mtime)}}async function j(t,e,r){if(await I(t,e,{...r,isFolder:!0})||await x(e),r.preserveTimestamps){let s=await Deno.stat(t);S(s.atime,"statInfo.atime"),S(s.mtime,"statInfo.mtime"),await Deno.utime(e,s.atime,s.mtime)}t=c(t),e=c(e);let o=[];for await(let s of Deno.readDir(t)){let n=d(t,s.name),f=d(e,F(n));s.isSymlink?o.push(U(n,f,r)):s.isDirectory?o.push(j(n,f,r)):s.isFile&&o.push(N(n,f,r))}await Promise.all(o)}async function wt(t,e,r={}){if(t=u(c(t)),e=u(c(e)),t===e)throw new Error("Source and destination cannot be the same");let i=await Deno.lstat(t);if(i.isDirectory&&P(t,e))throw new Error(`Cannot copy '${t}' to a subdirectory of itself: '${e}'`);i.isSymlink?await U(t,e,r):i.isDirectory?await j(t,e,r):i.isFile&&await N(t,e,r)}async function Ft(t){try{let e=await Array.fromAsync(Deno.readDir(t));await Promise.all(e.map(r=>{if(r&&r.name){let i=d(c(t),r.name);return Deno.remove(i,{recursive:!0})}}))}catch(e){if(!(e instanceof Deno.errors.NotFound))throw e;await Deno.mkdir(t,{recursive:!0})}}async function A(t){t=c(t),t=L(t);let e=F(t),r=await Deno.stat(t);return{path:t,name:e,isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink}}function E(t,e,r,i){return!(e&&!e.some(o=>t.endsWith(o))||r&&!r.some(o=>!!t.match(o))||i&&i.some(o=>!!t.match(o)))}async function*V(t,e){let{maxDepth:r=1/0,includeFiles:i=!0,includeDirs:o=!0,includeSymlinks:s=!0,followSymlinks:n=!1,canonicalize:f=!0,exts:a=void 0,match:l=void 0,skip:m=void 0}=e??{};if(!(r<0)&&(t=c(t),a&&(a=a.map(y=>y.startsWith(".")?y:`.${y}`)),o&&E(t,a,l,m)&&(yield await A(t)),!(r<1||!E(t,void 0,void 0,m))))for await(let y of Deno.readDir(t)){let p=d(t,y.name),{isSymlink:v,isDirectory:$}=y;if(v){if(!n){s&&E(p,a,l,m)&&(yield{path:p,...y});continue}let h=await Deno.realPath(p);f&&(p=h),{isSymlink:v,isDirectory:$}=await Deno.lstat(h)}if(v||$){let h={maxDepth:r-1,includeFiles:i,includeDirs:o,includeSymlinks:s,followSymlinks:n};a!==void 0&&(h.exts=a),l!==void 0&&(h.match=l),m!==void 0&&(h.skip=m),yield*V(p,h)}else i&&E(p,a,l,m)&&(yield{path:p,...y})}}var ue=globalThis.Deno?.build.os==="windows"?"`":"\\";var B=`
4
+ `,J=`\r
5
+ `,xe=globalThis.Deno?.build.os==="windows"?J:B;export{G as a,W as b,Y as c,Z as d,Ft as e,x as f,V as g,wt as h};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ var l=a=>a.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),c=a=>{let n=[],i=new Set,r="",e=a,o=/\[(\.\.\.)?(\w+)\]/;for(;e.length>0;){let t=o.exec(e);if(t===null){r+=l(e);break}t.index>0&&(r+=l(e.slice(0,t.index)));let m=t[1]==="...",s=t[2];s!==void 0&&(n.push(s),m?(i.add(s),r+="(.*)"):r+="([^/]+)"),e=e.slice(t.index+t[0].length)}return{regex:new RegExp(`^${r}$`),paramNames:n,catchAllParams:i}},u=(a,n)=>{let i=a.match(n.regex);if(i===null)return null;let r={};for(let e=0;e<n.paramNames.length;e++){let o=n.paramNames[e],t=i[e+1];o!==void 0&&(n.catchAllParams.has(o)?r[o]=t!==void 0&&t!==""?t.split("/").filter(Boolean):[]:r[o]=t??"")}return r},g=(a,n)=>{let i=c(n);return u(a,i)};export{g as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import"./chunk-7ZYDAZBD.js";import"./chunk-46ZWBKIW.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f,h as g,k as p}from"./chunk-GBM3TZFD.js";import{c as n,d,f as u}from"./chunk-3SXTMY75.js";import"./chunk-J7YTWK67.js";import{d as o}from"./chunk-PVPMHMKP.js";import"./chunk-CEYKWASA.js";import"./chunk-KKBIUT5L.js";import"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var b=`Output ONLY a conventional commit message. No explanation, no markdown, no code blocks, no bullet points.
2
+ import"./chunk-7ZYDAZBD.js";import"./chunk-46ZWBKIW.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f,h as g,k as p}from"./chunk-GBM3TZFD.js";import{c as n,d,f as u}from"./chunk-3SXTMY75.js";import"./chunk-J7YTWK67.js";import{d as o}from"./chunk-PVPMHMKP.js";import"./chunk-4MVO4LD5.js";import"./chunk-KVTG56GS.js";import"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var b=`Output ONLY a conventional commit message. No explanation, no markdown, no code blocks, no bullet points.
3
3
 
4
4
  Format: type(scope): description
5
5
  Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as A}from"./chunk-OCPEFZBJ.js";import{a as b,b as $}from"./chunk-LNNNLUZT.js";import{j as C,k as y,l as x,m as P}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as w,h as g,k as v}from"./chunk-GBM3TZFD.js";import{c as d,d as a,f as u,g as k}from"./chunk-3SXTMY75.js";import{a as l,b as p}from"./chunk-A6RDYP6R.js";import{t as m}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var q=async r=>{let e=r?.[0];if(e==="add")return await I(r?.slice(1));if(e==="remove")return await M(r?.slice(1));if(e==="list")return await R();let t=await C(m.process.cwd()),s=$(t),n=w({renderer:v.ansi(),sink:g.stdout()});return n.writeln(`Usage: ${s} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async r=>{let e=w({renderer:v.ansi(),sink:g.stdout()}),t=m.process.cwd(),s=(r??[]).filter(i=>!i.startsWith("-")),n=await C(t);if(s.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product",n))),await e.close(),p({exitCode:1});if(n===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let c=await A(),o=[];for(let i of s){let f=await x(t,i);if(f===null&&(f=c.find(h=>h.id===i)??null,f!==null&&await P(t,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(a(` Available: ${c.map(h=>h.id).join(", ")}`));continue}if(n.concerns.includes(i)||o.includes(i)){e.writeln(a(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...n,concerns:[...n.concerns,...o]};await y(t,i),e.writeln(k("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async r=>{let e=w({renderer:v.ansi(),sink:g.stdout()}),t=m.process.cwd(),s=r?.[0],n=await C(t);if(s===void 0||s.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast",n))),await e.close(),p({exitCode:1});if(n===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!n.concerns.includes(s))return e.writeln(a(`Concern "${s}" is not active.`)),await e.close(),l(void 0);let c={...n,concerns:n.concerns.filter(o=>o!==s)};return await y(t,c),e.writeln(k("\u2714")," Deactivated concern: ",d(s)),await e.close(),l(void 0)},R=async()=>{let r=w({renderer:v.ansi(),sink:g.stdout()}),e=m.process.cwd(),t=await C(e),s=await A(),n=t?.concerns??[];if(r.writeln(d("Concerns")),r.writeln(""),s.length===0)r.writeln(a(" No concerns defined."));else for(let c of s){let o=n.includes(c.id);r.writeln(" ",o?k("\u25CF"):a("\u25CB")," ",o?d(c.id):a(c.id),a(` ${c.description.slice(0,60)}...`))}return await r.close(),l(void 0)};export{q as main};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as a,h as l,k as i}from"./chunk-GBM3TZFD.js";import{k as n}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var h=["trace","debug","info","warn","error","fatal"],k=async m=>{let{flags:e}=t(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"no-hmr",type:"boolean",description:"Disable HMR"},{name:"log-level",type:"string",default:"info",description:"Log level"},{name:"open",short:"o",type:"boolean",description:"Open browser"}]),r=a({renderer:i.ansi(),sink:l.stdout()});r.writeln(n(`
2
+ import{f as a,h as l,k as i}from"./chunk-GBM3TZFD.js";import{k as n}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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-JTYNMHNL.js"),import("./mod-NCF6OSXO.js"),import("./mod-SA3J2VR5.js"),import("./mod-JZNE2HH6.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-HJQEBLLN.js"),import("./mod-NCF6OSXO.js"),import("./mod-OS3BCM2G.js"),import("./mod-JZNE2HH6.js")]);return await r.close(),await u({mode:"dev",port:p,logLevel:d,hmr:c,open:g,renderer:L,htmlShell:f,frameworkPlugin:v,cssPlugin:b({globalCssPath:"src/app/styles/global.css"})}),o(void 0)};export{k as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as l}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as o,f as r,i}from"./chunk-3SXTMY75.js";import{g as t}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var c=l(),m=()=>{c.writeln(i("\u2139"),o(` eser codebase gh \u2014 GitHub operations
2
+ import{a as l}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as o,f as r,i}from"./chunk-3SXTMY75.js";import{g as t}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var c=l(),m=()=>{c.writeln(i("\u2139"),o(` 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.`)},w=async u=>{let n=u??[],s=n[0],e=n.slice(1);if(s===void 0||s==="--help"||s==="-h")return m(),t.ok(void 0);switch(s){case"contributors":return await(await import("./gh-contributors-X7BW57DD.js")).main(e);case"release-notes":return await(await import("./release-notes-GOUHBQ2F.js")).main(e);case"release-tag":return await(await import("./release-tag-5WNEA4HM.js")).main(e);default:return c.writeln(r("\u2717"),o(` Unknown gh subcommand: ${s}
4
+ Run 'eser codebase gh <subcommand> --help' for details.`)},w=async u=>{let n=u??[],s=n[0],e=n.slice(1);if(s===void 0||s==="--help"||s==="-h")return m(),t.ok(void 0);switch(s){case"contributors":return await(await import("./gh-contributors-E7IZ2LFS.js")).main(e);case"release-notes":return await(await import("./release-notes-AARDYXYA.js")).main(e);case"release-tag":return await(await import("./release-tag-H2YWUXRU.js")).main(e);default:return c.writeln(r("\u2717"),o(` Unknown gh subcommand: ${s}
5
5
  `)),m(),t.fail({exitCode:1})}};export{w 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"./chunk-JOTAKQMZ.js";import{a as A}from"./chunk-2VEVVX6U.js";import{a as y,b as $}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as R}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as c,f as C,g,i as x}from"./chunk-3SXTMY75.js";import{e as l}from"./chunk-PVPMHMKP.js";import"./chunk-PWLF3WXM.js";import"./chunk-KKBIUT5L.js";import"./chunk-SQINSLNL.js";import{a as w}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{n as b}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{v as p}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var d=y(),m="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",O=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}},U=async(t,e)=>{let n=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(n).filter(o=>!o.login.includes("[bot]"))},M=(t,e=8)=>{if(t.length===0)return`${m}
2
+ import"./chunk-SOSF762G.js";import"./chunk-JOTAKQMZ.js";import{a as A}from"./chunk-2VEVVX6U.js";import{a as y,b as $}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as R}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as c,f as C,g,i as x}from"./chunk-3SXTMY75.js";import{e as l}from"./chunk-PVPMHMKP.js";import"./chunk-PWLF3WXM.js";import"./chunk-KVTG56GS.js";import"./chunk-PZNCE6QK.js";import{a as w}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{n as b}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{v as p}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var d=y(),m="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",O=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}},U=async(t,e)=>{let n=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(n).filter(o=>!o.login.includes("[bot]"))},M=(t,e=8)=>{if(t.length===0)return`${m}
3
3
  ${u}`;let n=[];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>`);n.push(` <tr>
4
4
  ${i.join(`
5
5
  `)}
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as ee,b as te}from"./chunk-SP43S32B.js";import{d as Z}from"./chunk-5GGGQJ4P.js";import{a as V}from"./chunk-AHLJCH32.js";import{a as Q,b as X}from"./chunk-JAQN64PH.js";import"./chunk-DAYSTLLV.js";import{b}from"./chunk-OCPEFZBJ.js";import{a as I}from"./chunk-LNNNLUZT.js";import{d as Y}from"./chunk-2EVWKUN6.js";import{a as J,b as G,e as _,j as q,k as B,m as H,o as K,q as U}from"./chunk-WG6J7DFO.js";import"./chunk-7ZYDAZBD.js";import{a as P,b as M,e as S,f as W,g as z,h as r,i as h}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{a as F}from"./chunk-46ZWBKIW.js";import"./chunk-GE3LJ6QM.js";import"./chunk-BNQAZLIQ.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-J7YTWK67.js";import"./chunk-PVPMHMKP.js";import"./chunk-4MVO4LD5.js";import"./chunk-KVTG56GS.js";import"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as T}from"./chunk-A6RDYP6R.js";import{q as E,t as f}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var se=F;var de=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ue=[{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"]}],ne=async t=>{let e=[];for(let o of ue)for(let s of o.paths)if(await de(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},oe=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},fe=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},me=async t=>{let e=[],o=await oe(`${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},ge=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},he=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await oe(`${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},ie=async t=>{let[e,o,s,d]=await Promise.all([fe(t),me(t),ge(t),he(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Me=async t=>{let e=f.process.cwd(),o=ee(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=te(t),w=re(d,"--concerns"),m=re(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await U(e)){let n=await q(e);return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${I("sync",n)}\` to regenerate tool files.`),T(void 0)}W(s,"noskills init");let x=h(s,"Scanning project...");x.start();let g=await ie(e);x.succeed("Project scanned");for(let n of g.languages)r.step(s,` ${n}`);for(let n of g.frameworks)r.step(s,` ${n}`);for(let n of g.ci)r.step(s,` ${n}`);g.testRunner!==null&&r.step(s,` test runner: ${g.testRunner}`);let j=h(s,"Detecting coding tools...");j.start();let D=await ne(e),y=Z(),A=y!==null&&!D.includes(y)?[y]:[],C=[...new Set([...A,...D])];j.succeed(`${C.length} coding tool(s) detected`);for(let n of C){let i=n===y?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(m!==null){let n=["claude-code","cursor","kiro","copilot","windsurf"],i=m.filter(l=>n.includes(l));p=[...new Set([...A,...i])]}else u?p=[...C]:p=await Ce(s,C,y);let L=h(s,"Detecting AI providers...");L.start();let $=(await se()).filter(n=>n.available).map(n=>n.name);L.succeed(`${$.length} provider(s) detected`);let k=await b(),c;if(w!==null){let n=k.map(i=>i.id);c=w.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=k.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await S(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=P(i)?[]:[...i]}c.length>0?r.success(s,`Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id>`.");let N=await ve(),O=h(s,"Initializing...");O.start(),await K(e);let ae=k.filter(n=>c.includes(n.id));for(let n of ae)await H(e,n);let v={...G(c,p,$,g),command:N};await B(e,v);let R=J();if(await _(e,R),O.succeed("Scaffolded `.eser/`"),p.length>0){let n=h(s,"Syncing tool files...");n.start();let i=await X(e,p,v);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(r.success(s,`Done. ${p.length} tool(s), ${$.length} provider(s), ${c.length} concern(s).`),r.info(s,`Command prefix: ${N}`),o==="agent"){let i=(await b()).filter(le=>c.includes(le.id)),l=await Q(e),ce=V(R,i,l,v);await Y(ce,"json")}else z(s,`Start a spec with: ${I('spec new "..."',v)}`);return T(void 0)},ye=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],Ce=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),w=await S(t,{message:s,options:ye.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(P(w))return[...e];let m=[...w];return o!==null&&!m.includes(o)&&m.unshift(o),m},re=(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},ve=async()=>{try{return`${await E({command:"eser",devCommand:"deno task cli",npmPackage:"eser@latest",jsrPackage:"@eser/cli"})} noskills`}catch{return"npx eser@latest noskills"}};export{Me as main};
@@ -1,12 +1,12 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as P,h as R,k as F}from"./chunk-GBM3TZFD.js";import{b as t,c as E,d as s,f as o,g as x,k as v}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as T}from"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import{a as A,b as i,f as $}from"./chunk-A6RDYP6R.js";import{t as b}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var S=["minimal","blog","dashboard","docs"],V=async O=>{let{positional:N,flags:m}=T(O??[],[{name:"template",short:"t",type:"string",default:"minimal",description:"Project template"},{name:"force",short:"f",type:"boolean",description:"Overwrite"},{name:"no-git",type:"boolean",description:"Skip git"},{name:"no-install",type:"boolean",description:"Skip install"}]),r=N[0]??"my-laroux-app",l=m.template,j=m.force,L=m["no-git"],n=F.ansi(),e=P({renderer:n,sink:R.stdout()});if(!S.includes(l))return await e.close(),i({message:`${n.render([o(`
2
+ import{f as P,h as R,k as F}from"./chunk-GBM3TZFD.js";import{b as t,c as E,d as s,f as o,g as x,k as v}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as T}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as A,b as i,f as $}from"./chunk-A6RDYP6R.js";import{t as b}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var S=["minimal","blog","dashboard","docs"],V=async O=>{let{positional:N,flags:m}=T(O??[],[{name:"template",short:"t",type:"string",default:"minimal",description:"Project template"},{name:"force",short:"f",type:"boolean",description:"Overwrite"},{name:"no-git",type:"boolean",description:"Skip git"},{name:"no-install",type:"boolean",description:"Skip install"}]),r=N[0]??"my-laroux-app",l=m.template,j=m.force,L=m["no-git"],n=F.ansi(),e=P({renderer:n,sink:R.stdout()});if(!S.includes(l))return await e.close(),i({message:`${n.render([o(`
3
3
  Error: Invalid template "${l}"`)])}
4
4
  Available templates: ${S.join(", ")}`,exitCode:1});e.writeln(v(`
5
5
  \u2728 Creating new laroux.js project in ./${r}
6
6
  `)),e.writeln(s(` Template: ${l}`));let c="eser",p=`laroux-template-${l}`,k="main",d=`${b.process.cwd()}/${r}`;try{await b.fs.mkdir(d,{recursive:!0})}catch{return await e.close(),i({message:n.render([o(`
7
7
  Could not create directory: ${d}`)]),exitCode:1})}e.writeln(s(` Fetching from gh:${c}/${p}...
8
8
  `));try{let a=await import("./registry-fetcher-76ISLGRR.js"),u=await import("./recipe-applier-6QZYAZ57.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-5WXRQGLS.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-PFWQZF3T.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:j,skipPostInstall:L,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
10
10
  Scaffolding failed: ${y.error.message}`)]),exitCode:1});let C=y.value;if(e.writeln(x(`
11
11
  \u{1F389} Project created successfully!`)),Object.keys(C.variables).length>0){e.writeln(t(`
12
12
  Variables applied:`));for(let[h,_]of Object.entries(C.variables))e.writeln(t(" "),s(h),t(`: ${_}`))}}}catch(a){let u=a instanceof Error?a.message:String(a);return await e.close(),i({message:n.render([o(`
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as E}from"./chunk-W3RVRCUB.js";import"./chunk-JYNHFD6B.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as A,h as C,k as H}from"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b,c as O,d as l,f as k,g as w,h as y,i as j}from"./chunk-3SXTMY75.js";import{a as $}from"./chunk-MG65QJY6.js";import{g as r}from"./chunk-A6RDYP6R.js";import{v as e}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var M={precommit:{hookName:"pre-commit",args:""},commitmsg:{hookName:"commit-msg",args:'-- "$1"'},prepush:{hookName:"pre-push",args:""}},P="# @eser managed hook",I=async(i,n)=>{let s=await e.getCliCommand({command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"}),t=n.length>0?` ${n}`:"",o=`${s} workflows run -e ${i}${t}`;return["#!/bin/sh",`${P} \u2014 generated by \`eser codebase install\``,"# Do not edit. Re-run `eser codebase install` to update.","",o,""].join(`
2
+ import{b as E}from"./chunk-W3RVRCUB.js";import"./chunk-JYNHFD6B.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as A,h as C,k as H}from"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b,c as O,d as l,f as k,g as w,h as y,i as j}from"./chunk-3SXTMY75.js";import{a as $}from"./chunk-MG65QJY6.js";import{g as r}from"./chunk-A6RDYP6R.js";import{v as e}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var M={precommit:{hookName:"pre-commit",args:""},commitmsg:{hookName:"commit-msg",args:'-- "$1"'},prepush:{hookName:"pre-push",args:""}},P="# @eser managed hook",I=async(i,n)=>{let s=await e.getCliCommand({command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"}),t=n.length>0?` ${n}`:"",o=`${s} workflows run -e ${i}${t}`;return["#!/bin/sh",`${P} \u2014 generated by \`eser codebase install\``,"# Do not edit. Re-run `eser codebase install` to update.","",o,""].join(`
3
3
  `)},S=async()=>{try{let t=(await e.runtime.exec.exec("git",["rev-parse","--git-dir"])).trim();if(t.length>0)return t}catch{}let i=e.runtime.process.cwd(),n=e.runtime.path.join(i,".git");try{if((await e.runtime.fs.stat(n)).isDirectory)return n}catch{}return null},G=i=>{let n=i.workflows;if(!Array.isArray(n))return[];let s=new Set;for(let t of n)if(Array.isArray(t.on))for(let o of t.on)typeof o=="string"&&s.add(o);return[...s]},T=H.ansi(),U=async i=>{let n=$(i??[],{boolean:["force","dry-run","help"],alias:{h:"help",f:"force",n:"dry-run"}});if(n.help)return console.log("eser codebase install \u2014 Install git hooks from .eser/manifest.yml"),console.log(""),console.log("Flags:"),console.log(" --force, -f Overwrite non-managed hooks"),console.log(" --dry-run, -n Show what would happen without writing"),console.log(" --help, -h Show this help"),r.ok(void 0);let s=A({renderer:T,sink:C.stdout()}),t=n.force,o=n["dry-run"],d=await S();if(d===null)return s.writeln(k("Error: not inside a git repository")),await s.close(),r.fail({exitCode:1});let p=e.runtime.path.join(d,"hooks"),g=e.runtime.process.cwd(),a=await E(g);if(a===null)return s.writeln(k("Error: no .eser/manifest.yml found in current directory")),await s.close(),r.fail({exitCode:1});let c=G(a);if(c.length===0)return s.writeln(y("No workflow events found \u2014 nothing to install.")),await s.close(),r.ok(void 0);o||await e.runtime.fs.ensureDir(p);let f=0,v=0,u=0;for(let N of c){let F=M[N];if(F===void 0){s.writeln(l(` skip ${N} (unknown event, no hook mapping)`));continue}let{hookName:m,args:K}=F,D=e.runtime.path.join(p,m),_=await I(N,K),R=!1,x=!1;try{let q=await e.runtime.fs.readTextFile(D);R=!0,x=q.includes(P)}catch{}if(o){R?x?s.writeln(j(` would update ${m} (managed)`)):t?s.writeln(y(` would overwrite ${m} (--force)`)):s.writeln(y(` would skip ${m} (user hook; use --force to overwrite)`)):s.writeln(j(` would create ${m}`));continue}if(R&&!x&&!t){s.writeln(y(` skip ${m} \u2014 user hook exists (use --force to overwrite)`)),v++;continue}await e.runtime.fs.writeTextFile(D,_);try{await e.runtime.fs.chmod(D,493)}catch{}R&&x?(s.writeln(w(` updated ${m}`)),u++):(s.writeln(w(` installed ${m}`)),f++)}s.writeln();let h=[];return f>0&&h.push(`${f} installed`),u>0&&h.push(`${u} updated`),v>0&&h.push(`${v} skipped`),o?s.writeln(l("(dry run \u2014 no changes made)")):h.length>0?s.writeln(w(`Done: ${h.join(", ")}.`)):s.writeln(l("Nothing to do.")),await s.close(),r.ok(void 0)},W=async i=>{if($(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase uninstall \u2014 Remove managed git hooks"),r.ok(void 0);let s=A({renderer:T,sink:C.stdout()}),t=await S();if(t===null)return s.writeln(k("Error: not inside a git repository")),await s.close(),r.fail({exitCode:1});let o=e.runtime.path.join(t,"hooks"),d=0,p=Object.values(M).map(a=>a.hookName),g=[...new Set(p)];for(let a of g){let c=e.runtime.path.join(o,a);try{(await e.runtime.fs.readTextFile(c)).includes(P)&&(await e.runtime.fs.remove(c),s.writeln(w(` removed ${a}`)),d++)}catch{}}return s.writeln(),d>0?s.writeln(w(`Done: ${d} hook(s) removed.`)):s.writeln(l("No managed hooks found.")),await s.close(),r.ok(void 0)},X=async i=>{if($(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase status \u2014 Show git hook installation status"),r.ok(void 0);let s=A({renderer:T,sink:C.stdout()}),t=await S();if(t===null)return s.writeln(k("Error: not inside a git repository")),await s.close(),r.fail({exitCode:1});let o=e.runtime.path.join(t,"hooks"),d=e.runtime.process.cwd(),p=await E(d);if(p===null)return s.writeln(k("Error: no .eser/manifest.yml found in current directory")),await s.close(),r.fail({exitCode:1});let g=G(p);if(g.length===0)return s.writeln(l("No workflow events found in manifest.")),await s.close(),r.ok(void 0);s.writeln(O("Git hook status:")),s.writeln();for(let a of g){let c=M[a];if(c===void 0){s.writeln(b(" "),l(a.padEnd(14)),b(" "),l("(no hook mapping)"));continue}let{hookName:f}=c,v=e.runtime.path.join(o,f),u;try{(await e.runtime.fs.readTextFile(v)).includes(P)?u=w("managed (@eser)"):u=y("user hook")}catch{u=l("not installed")}s.writeln(b(` ${f.padEnd(14)} `),u)}return s.writeln(),await s.close(),r.ok(void 0)};export{U as main,X as statusMain,W as uninstallMain};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as D}from"./chunk-E5QQGGNF.js";import{a as C}from"./chunk-JAQN64PH.js";import"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as d}from"./chunk-LNNNLUZT.js";import{c as g,d as $,j as y,n as x,q as v}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as r}from"./chunk-A6RDYP6R.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var S=async()=>{let e=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:a}=await e.read();if(o||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,c=new Uint8Array(s.reduce((o,a)=>o+a.length,0));for(let o of s)c.set(o,t),t+=o.length;let n=new TextDecoder().decode(c);try{return JSON.parse(n)}catch{return{}}},P=async e=>{let s=new TextEncoder,t=i.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},W=async e=>{switch(e?.[0]){case"pre-tool-use":return await T();case"stop":return await F();case"post-file-write":return await E();case"post-bash":return await I();case"session-start":return await N();default:return r(void 0)}},T=async()=>{let e=await S(),s=e.tool_name??"unknown",t=e.tool_input??{},c=e.cwd??i.process.cwd(),n=await y(c),o={};try{o=await $(c)}catch{return r(void 0)}let a=async u=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${u}`}})};if(o.pendingClear===!0)return await a(`Task accepted. You must run \`/clear\` and then \`${d("next",n)}\` before continuing.`),r(void 0);if(s==="Bash"){let u=(t.command??"").trim();if(!(n?.allowGit??!1)){let w=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let p of w)if(u.startsWith(p)||u.includes(` && ${p}`)||u.includes(`; ${p}`))return await a("git is read-only for agents. The user controls git. You may use `git log`, `git diff`, `git status`, `git show`, `git blame`."),r(void 0)}return r(void 0)}if(!["Write","Edit","MultiEdit"].includes(s))return r(void 0);let m=t.file_path??t.path??"";if(m.includes(".eser/")||m.includes(".claude/"))return r(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING")return r(void 0);let k={IDLE:`No active spec. Run \`${d("spec new",n)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",n)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",n)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",n)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',n)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',n)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",n)}\``};return await a(k[f]??`Run \`${d("next",n)}\` first.`),r(void 0)},F=async()=>{let e=await S();if(e.stop_hook_active===!0)return r(void 0);let s=e.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},n=`${s}/${g.stateDir}/files-changed.jsonl`,o=[];try{let w=(await i.fs.readTextFile(n)).trim().split(`
2
+ import{a as D}from"./chunk-AHLJCH32.js";import{a as C}from"./chunk-JAQN64PH.js";import"./chunk-DAYSTLLV.js";import"./chunk-OCPEFZBJ.js";import{a as d}from"./chunk-LNNNLUZT.js";import{c as g,d as $,j as y,n as x,q as v}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as r}from"./chunk-A6RDYP6R.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var S=async()=>{let e=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:a}=await e.read();if(o||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,c=new Uint8Array(s.reduce((o,a)=>o+a.length,0));for(let o of s)c.set(o,t),t+=o.length;let n=new TextDecoder().decode(c);try{return JSON.parse(n)}catch{return{}}},P=async e=>{let s=new TextEncoder,t=i.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},W=async e=>{switch(e?.[0]){case"pre-tool-use":return await T();case"stop":return await F();case"post-file-write":return await E();case"post-bash":return await I();case"session-start":return await N();default:return r(void 0)}},T=async()=>{let e=await S(),s=e.tool_name??"unknown",t=e.tool_input??{},c=e.cwd??i.process.cwd(),n=await y(c),o={};try{o=await $(c)}catch{return r(void 0)}let a=async u=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${u}`}})};if(o.pendingClear===!0)return await a(`Task accepted. You must run \`/clear\` and then \`${d("next",n)}\` before continuing.`),r(void 0);if(s==="Bash"){let u=(t.command??"").trim();if(!(n?.allowGit??!1)){let w=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let p of w)if(u.startsWith(p)||u.includes(` && ${p}`)||u.includes(`; ${p}`))return await a("git is read-only for agents. The user controls git. You may use `git log`, `git diff`, `git status`, `git show`, `git blame`."),r(void 0)}return r(void 0)}if(!["Write","Edit","MultiEdit"].includes(s))return r(void 0);let m=t.file_path??t.path??"";if(m.includes(".eser/")||m.includes(".claude/"))return r(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING")return r(void 0);let k={IDLE:`No active spec. Run \`${d("spec new",n)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",n)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",n)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",n)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',n)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',n)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",n)}\``};return await a(k[f]??`Run \`${d("next",n)}\` first.`),r(void 0)},F=async()=>{let e=await S();if(e.stop_hook_active===!0)return r(void 0);let s=e.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},n=`${s}/${g.stateDir}/files-changed.jsonl`,o=[];try{let w=(await i.fs.readTextFile(n)).trim().split(`
3
3
  `).filter(Boolean);o=[...new Set(w.map(p=>{try{return JSON.parse(p).file}catch{return null}}).filter(p=>p!==null))]}catch{}let a=[],h="no changes";try{let{execSync:l}=await import("node:child_process");a=l("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
4
4
  `).filter(Boolean);let R=l("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
5
5
  `);h=R[R.length-1]??"no changes"}catch{}let m=[...new Set([...o,...a])],f=(c.iteration??0)+1,k=`${s}/${g.stateDir}/iterations`;try{await i.fs.mkdir(k,{recursive:!0}),await i.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:m,gitStat:h.trim(),timestamp:new Date().toISOString()},null,2)+`
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as Q}from"./chunk-ZNGLZECE.js";import{a as K,b as j,c as M,d as F,f as N}from"./chunk-COKZ6MLN.js";import"./chunk-VG72SSDI.js";import"./chunk-KPWEJXPI.js";import"./chunk-CUIMSX4V.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.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-LCG4SK6K.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{g as W,t as s}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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 Q}from"./chunk-ZNGLZECE.js";import{a as K,b as j,c as M,d as F,f as N}from"./chunk-B6EATLKL.js";import"./chunk-UJPVEQX7.js";import"./chunk-KPWEJXPI.js";import"./chunk-CUIMSX4V.js";import"./chunk-DYRTLYTU.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as X}from"./chunk-VAIRJES2.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-LCG4SK6K.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{g as W,t as s}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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>';
@@ -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-VG72SSDI.js";import{a as S}from"./chunk-CUIMSX4V.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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-UJPVEQX7.js";import{a as S}from"./chunk-CUIMSX4V.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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,7 +1,7 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as re}from"./chunk-JYNHFD6B.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as U,h as H,k as G}from"./chunk-GBM3TZFD.js";import{b as w,d as S,f as C,g as O,k as z}from"./chunk-3SXTMY75.js";import{d as N}from"./chunk-PVPMHMKP.js";import{a as q}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import{b as v}from"./chunk-DTO2YJWZ.js";import{e as te}from"./chunk-G6NAG2EK.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})},M={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,W(M))},W=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),B=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=B(r);return await e.fetch(s,t),s};var Y=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-JYNHFD6B.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-GBM3TZFD.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-3SXTMY75.js";import{d as N}from"./chunk-PVPMHMKP.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import{b as v}from"./chunk-DTO2YJWZ.js";import{e as te}from"./chunk-G6NAG2EK.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
3
3
  ${n.join(`
4
- `)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/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 Ue=async r=>{let t=q(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
4
+ `)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\-]/g,"\\$&").replace(/\*\*/g,"\0GLOBSTAR\0").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(de(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!pe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".eser/manifest.yml",".eser/manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var Ge=async r=>{let t=O(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
5
5
 
6
6
  Options:
7
7
  -p, --path <dir> Target directory (default: .)
@@ -14,7 +14,7 @@ Options:
14
14
  Examples:
15
15
  scaffold eser/ajan
16
16
  scaffold gh:eser/ajan#v1.0 -p ./my-project
17
- scaffold eser/ajan --var name=my-app --var author=me`),E(void 0);let e=G.ansi(),s=U({renderer:e,sink:H.stdout()});if(t._.length===0)return await s.close(),$({message:`${e.render([C("Error: Template specifier is required")])}
17
+ scaffold eser/ajan --var name=my-app --var author=me`),E(void 0);let e=H.ansi(),s=G({renderer:e,sink:U.stdout()});if(t._.length===0)return await s.close(),$({message:`${e.render([C("Error: Template specifier is required")])}
18
18
 
19
19
  Usage: scaffold <specifier> [options]
20
20
 
@@ -22,7 +22,7 @@ Examples:
22
22
  scaffold eser/ajan
23
23
  scaffold gh:eser/ajan#v1.0
24
24
  scaffold eser/ajan -p ./my-project`,exitCode:1});let a=String(t._[0]),f=t.path??".",n=t.force??!1,o=t["skip-post-install"]??!1,i=t.interactive??!1,c=t.var,p={};if(c!==void 0)for(let h of c){let[b,...m]=String(h).split("=");b!==void 0&&(p[b]=m.join("="))}s.writeln(w("Scaffolding from "),z(a),w("..."));let u=await D(()=>k({specifier:a,targetDir:f,variables:p,force:n,skipPostInstall:o,interactive:i}),h=>({message:h.message}));if(V(u))return await s.close(),$({message:e.render([C(`
25
- Scaffolding failed: ${u.error.message}`)]),exitCode:1});let d=u.value;if(s.writeln(O(`
25
+ Scaffolding failed: ${u.error.message}`)]),exitCode:1});let d=u.value;if(s.writeln(q(`
26
26
  Scaffolded ${d.templateName} to ${d.targetDir}`)),Object.keys(d.variables).length>0){s.writeln(w(`
27
27
  Variables applied:`));for(let[h,b]of Object.entries(d.variables))s.writeln(w(" "),S(h),w(`: ${b}`))}if(d.postInstallCommands.length>0){s.writeln(w(`
28
- Post-install commands executed:`));for(let h of d.postInstallCommands)s.writeln(w(" "),S(h))}return await s.close(),E(void 0)};export{I as fetchTemplate,le as getDefaultProvider,oe as getProvider,R as hasVariables,j as loadTemplateConfig,Ue as main,B as parseSpecifier,W as registerProvider,F as resolveVariables,k as scaffold,T as substituteVariables};
28
+ Post-install commands executed:`));for(let h of d.postInstallCommands)s.writeln(w(" "),S(h))}return await s.close(),E(void 0)};export{I as fetchTemplate,le as getDefaultProvider,oe as getProvider,R as hasVariables,j as loadTemplateConfig,Ge as main,W as parseSpecifier,M as registerProvider,F as resolveVariables,k as scaffold,T as substituteVariables};
@@ -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-64PIAW3Y.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-5BZG26SF.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
2
+ import{a,b,c,d,e,f}from"./chunk-OIZ7HL2C.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-QSION3QA.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as Fe,c as Re}from"./chunk-H4SPMUT6.js";import{a as Pe}from"./chunk-K7MYEXOS.js";import{a as $e}from"./chunk-VC6ERZSI.js";import{a as ve,c as ye}from"./chunk-ER4ZWF4Y.js";import{a as ke,c as he}from"./chunk-7NUMDHE2.js";import{a as xe,c as be}from"./chunk-3QIPK7NI.js";import{a as Ve,c as we}from"./chunk-32HV3K27.js";import{a as Ce}from"./chunk-EBCQCAQ7.js";import{a as Se}from"./chunk-3KCPUYLZ.js";import{a as De}from"./chunk-5PNGVDLV.js";import{a as Te}from"./chunk-CLL3YG4W.js";import"./chunk-AGRTWPDI.js";import{a as ee,c as te}from"./chunk-CKNA5LIK.js";import{a as ae,c as se}from"./chunk-5MWX3POX.js";import{a as oe,c as ie}from"./chunk-QOX7VSID.js";import{a as re,c as ne}from"./chunk-FORPNESQ.js";import{a as le,c as de}from"./chunk-HVOPUZOM.js";import{a as ce,c as pe}from"./chunk-HYT26FYU.js";import{a as me,c as ue}from"./chunk-K6H7JTIH.js";import{a as fe,c as ge}from"./chunk-N2VBT43E.js";import{a as K,c as U}from"./chunk-BCPCQHDL.js";import{a as X,c as H}from"./chunk-YQVWAWMO.js";import{a as Q,c as Z}from"./chunk-NP723K5L.js";import{a as G}from"./chunk-RGUETQSC.js";import"./chunk-HVLKXRPA.js";import{b as B,c as Y}from"./chunk-W3RVRCUB.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import"./chunk-2VEVVX6U.js";import"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as _}from"./chunk-NBA6EFWU.js";import"./chunk-3BEX5FYF.js";import{f as W,h as J,k as z}from"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as g,d as y,f as x,g as R,h as L,k as q}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as T,b as A}from"./chunk-A6RDYP6R.js";import{t as F}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var C=async t=>{let s=await B(t);return s===null?null:s},Me=async t=>await Y(t);var P={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(t){let s=await De({root:t.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(a=>({severity:"error",message:`Circular dependency: ${a.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var $={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(t){let s=await Pe({root:t.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(a=>({severity:"error",message:`Missing export in ${a.packageName}: ${a.file}`,file:a.file})),stats:{packagesChecked:s.packagesChecked}}}};var E={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(t){let s=await Te({root:t.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(a=>({severity:"error",message:`${a.packageName}: "${a.exportPath}" should be "${a.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var j={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(t){let s=t.options?.requireExamples,a=await Se({root:t.root,requireExamples:s});return{name:"validate-docs",passed:a.isValid,issues:a.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:a.filesChecked,symbolsChecked:a.symbolsChecked}}}};var M={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(t){let s=await $e({root:t.root}),a=[];for(let e of s.inconsistencies)a.push({severity:"error",message:`${e.packageName}: ${e.field} mismatch - deno.json: ${JSON.stringify(e.denoValue)}, package.json: ${JSON.stringify(e.packageValue)}`});for(let e of s.dependencyInconsistencies){let i=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(i+=` (expected: ${e.expected}, actual: ${e.actual})`),a.push({severity:"error",message:i})}return{name:"validate-package-configs",passed:s.isConsistent,issues:a,stats:{packagesChecked:s.packagesChecked}}}};var qe=[{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"}],We=[],Je=t=>We.some(s=>s.test(t)),ze=(t,s)=>{let a=t.slice(0,s);return a.includes("//")||a.includes("/*")&&!a.includes("*/")},_e=(t,s)=>{let a=!1,e=!1,i=!1;for(let n=0;n<s;n++){let l=t[n];(n>0?t[n-1]:"")!=="\\"&&(l==="'"&&!e&&!i&&(a=!a),l==='"'&&!a&&!i&&(e=!e),l==="`"&&!a&&!e&&(i=!i))}return a||e||i},b=G({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:_,checkFile(t,s){if(s===void 0)return[];if(Je(t.path))return[];let a=[],e=s.split(`
2
+ import{a as Fe,c as Re}from"./chunk-H4SPMUT6.js";import{a as Pe}from"./chunk-T2DRBZ4X.js";import{a as $e}from"./chunk-GJ4LCA6D.js";import{a as ve,c as ye}from"./chunk-ER4ZWF4Y.js";import{a as ke,c as he}from"./chunk-7NUMDHE2.js";import{a as xe,c as be}from"./chunk-3QIPK7NI.js";import{a as Ve,c as we}from"./chunk-32HV3K27.js";import{a as Ce}from"./chunk-EBCQCAQ7.js";import{a as Se}from"./chunk-QZ44TAIY.js";import{a as De}from"./chunk-IZONBJSX.js";import{a as Te}from"./chunk-IIIMOOFE.js";import"./chunk-KBFKBL6A.js";import{a as ee,c as te}from"./chunk-CKNA5LIK.js";import{a as ae,c as se}from"./chunk-5MWX3POX.js";import{a as oe,c as ie}from"./chunk-QOX7VSID.js";import{a as re,c as ne}from"./chunk-FORPNESQ.js";import{a as le,c as de}from"./chunk-HVOPUZOM.js";import{a as ce,c as pe}from"./chunk-HYT26FYU.js";import{a as me,c as ue}from"./chunk-K6H7JTIH.js";import{a as fe,c as ge}from"./chunk-N2VBT43E.js";import{a as K,c as U}from"./chunk-BCPCQHDL.js";import{a as X,c as H}from"./chunk-YQVWAWMO.js";import{a as Q,c as Z}from"./chunk-NP723K5L.js";import{a as G}from"./chunk-RGUETQSC.js";import"./chunk-HVLKXRPA.js";import{b as B,c as Y}from"./chunk-W3RVRCUB.js";import"./chunk-DYRTLYTU.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import"./chunk-2VEVVX6U.js";import"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import{b as _}from"./chunk-NBA6EFWU.js";import"./chunk-3BEX5FYF.js";import{f as W,h as J,k as z}from"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as g,d as y,f as x,g as R,h as L,k as q}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as T,b as A}from"./chunk-A6RDYP6R.js";import{t as F}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var C=async t=>{let s=await B(t);return s===null?null:s},Me=async t=>await Y(t);var P={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(t){let s=await De({root:t.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(a=>({severity:"error",message:`Circular dependency: ${a.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var $={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(t){let s=await Pe({root:t.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(a=>({severity:"error",message:`Missing export in ${a.packageName}: ${a.file}`,file:a.file})),stats:{packagesChecked:s.packagesChecked}}}};var E={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(t){let s=await Te({root:t.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(a=>({severity:"error",message:`${a.packageName}: "${a.exportPath}" should be "${a.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var j={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(t){let s=t.options?.requireExamples,a=await Se({root:t.root,requireExamples:s});return{name:"validate-docs",passed:a.isValid,issues:a.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:a.filesChecked,symbolsChecked:a.symbolsChecked}}}};var M={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(t){let s=await $e({root:t.root}),a=[];for(let e of s.inconsistencies)a.push({severity:"error",message:`${e.packageName}: ${e.field} mismatch - deno.json: ${JSON.stringify(e.denoValue)}, package.json: ${JSON.stringify(e.packageValue)}`});for(let e of s.dependencyInconsistencies){let i=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(i+=` (expected: ${e.expected}, actual: ${e.actual})`),a.push({severity:"error",message:i})}return{name:"validate-package-configs",passed:s.isConsistent,issues:a,stats:{packagesChecked:s.packagesChecked}}}};var qe=[{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"}],We=[],Je=t=>We.some(s=>s.test(t)),ze=(t,s)=>{let a=t.slice(0,s);return a.includes("//")||a.includes("/*")&&!a.includes("*/")},_e=(t,s)=>{let a=!1,e=!1,i=!1;for(let n=0;n<s;n++){let l=t[n];(n>0?t[n-1]:"")!=="\\"&&(l==="'"&&!e&&!i&&(a=!a),l==='"'&&!a&&!i&&(e=!e),l==="`"&&!a&&!e&&(i=!i))}return a||e||i},b=G({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:_,checkFile(t,s){if(s===void 0)return[];if(Je(t.path))return[];let a=[],e=s.split(`
3
3
  `);for(let i=0;i<e.length;i++){let n=e[i];for(let{pattern:l,replacement:d}of qe){let c=l.exec(n);c!==null&&(ze(n,c.index)||_e(n,c.index)||a.push({path:t.path,line:i+1,message:`direct Deno API usage: ${c[0]} \u2014 use @eser/standards/cross-runtime (${d})`}))}}return a}}),ct=b.run,Ee=b.validator,pt=b.main;var k={validators:new Map,initialized:!1},Ye=()=>{o(P),o($),o(E),o(j),o(M),o(U),o(H),o(Z),o(te),o(se),o(ie),o(ne),o(de),o(pe),o(ue),o(ge),o(ye),o(he),o(be),o(we),o(Re),o(Ee)},I=()=>{k.initialized||(k.initialized=!0,Ye())},o=t=>{k.validators.set(t.name,t)},Ge=t=>(I(),k.validators.get(t)??null),N=()=>(I(),[...k.validators.values()]),Ke=()=>(I(),[...k.validators.keys()]),Ue=t=>({name:t.config.name,description:t.config.description,run:async s=>{let a=await t.run(s);return{name:a.name,passed:a.issues.length===0,issues:a.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:a.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:a.filesChecked,issuesFound:a.issues.length}}}}),Xe=t=>({name:t.name,description:t.description,run:async s=>{let a=await t.validate({root:s.root??".",options:s});return{name:a.name,passed:a.passed,issues:a.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:a.stats}}}),He=()=>{let t=[],s=[K,X,Q,ee,ae,oe,re,le,ce,me,fe,ve,ke,xe,Ve,Fe,b];for(let e of s)t.push(Ue(e));let a=[P,$,E,j,M];for(let e of a)t.push(Xe(e));return t.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let i=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{runtime:n}=await import("./mod-MLRQFSBE.js"),l;try{l=await n.fs.readTextFile(i)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${i}`}],mutations:[],stats:{}}}let d=Ce(l,{allowAsterisk:e.allowAsterisk,allowMultipleScopes:e.allowMultipleScopes,forceScope:e.forceScope,types:e.types});return{name:"validate-commit-msg",passed:d.valid,issues:d.issues.map(c=>({message:c})),mutations:[],stats:{}}}}),t};var Qe=async(t={})=>{let s=t.root??F.process.cwd(),e=(await C(s))?.stack??[],i=[...t.skip??[]],n=t.only??[],l=N(),d=[],c=[],V=[];for(let p of l){if(n.length>0&&!n.includes(p.name))continue;if(i.includes(p.name)){V.push(p.name);continue}if(p.requiredStacks.length>0&&e.length>0&&!p.requiredStacks.some(w=>e.includes(w))){c.push({name:p.name,reason:`Requires '${p.requiredStacks.join("' or '")}' stack`});continue}let S={...t.fix!==void 0?{fix:t.fix}:{}},m=await p.validate({root:s,options:S});d.push(m)}return{passed:d.every(p=>p.passed),results:d,skipped:c,disabled:V}},Ot=async t=>{let s=O(t??F.process.args,{string:["root","only","skip"],boolean:["fix","help"],alias:{h:"help"}});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(" -h, --help Show this help message"),T(void 0);let a=z.ansi(),e=W({renderer:a,sink:J.stdout()}),i=s.root,n=s.fix,l=s.only,d=s.skip,c=l!==void 0?l.split(",").map(r=>r.trim()):void 0,V=d!==void 0?d.split(",").map(r=>r.trim()):void 0,S=(await C(i??"."))?.stack?.join(", ")??"all (no .eser/manifest.yml)";e.writeln(g(`Validating codebase...
4
4
  `)),e.writeln(g("Stack: "),q(S),g(`
5
5
  `));let m=await Qe({root:i,only:c,skip:V,fix:n});for(let r of m.results){let u=r.passed?R("PASS"):x("FAIL"),v=Object.entries(r.stats).map(([f,D])=>`${D} ${f}`).join(", ");e.writeln(g(` ${r.name.padEnd(18)} `),u,g(` (${v})`))}if(m.skipped.length>0){e.writeln(y(`
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as _}from"./chunk-XVSIRN6G.js";import{a as B,b as H,c as Q,d as z}from"./chunk-P74JF7XR.js";import{a as v}from"./chunk-IDMI5OBK.js";import{a as P}from"./chunk-E5QQGGNF.js";import{a as b}from"./chunk-JAQN64PH.js";import{b as U,c as L,d as N}from"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as j,c as A,d as G,f as J,h as W}from"./chunk-UESOCN2G.js";import{a as V}from"./chunk-LNNNLUZT.js";import{a as q,b as M,d as x}from"./chunk-2EVWKUN6.js";import{c as O,d as E,j as I,n as $,p as y,q as T}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as F,b as D}from"./chunk-A6RDYP6R.js";import{t as h}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var Z=o=>o.split(`
2
+ import{a as _}from"./chunk-XVSIRN6G.js";import{a as B,b as H,c as Q,d as z}from"./chunk-P74JF7XR.js";import{a as v}from"./chunk-IDMI5OBK.js";import{a as P}from"./chunk-AHLJCH32.js";import{a as b}from"./chunk-JAQN64PH.js";import{b as U,c as L,d as N}from"./chunk-DAYSTLLV.js";import"./chunk-OCPEFZBJ.js";import{a as j,c as A,d as G,f as J,h as W}from"./chunk-UESOCN2G.js";import{a as V}from"./chunk-LNNNLUZT.js";import{a as q,b as M,d as x}from"./chunk-2EVWKUN6.js";import{c as O,d as E,j as I,n as $,p as y,q as T}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as F,b as D}from"./chunk-A6RDYP6R.js";import{t as h}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var Z=o=>o.split(`
3
3
  `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ee=async(o,e)=>{let i=[],n=(e.startsWith(o)?e.slice(o.length+1):e).split("/");n.pop();for(let t=n.length;t>=0;t--){let r=`${t===0?o:`${o}/${n.slice(0,t).join("/")}`}/.folder-rules.md`,c=t===0?".":n.slice(0,t).join("/");try{let p=await h.fs.readTextFile(r),g=Z(p);for(let f of g)i.push({folder:c,rule:f})}catch{}}return i},k=async(o,e)=>{let i=new Set,a=[];for(let n of e){let t=await ee(o,n);for(let s of t){let r=`${s.folder}::${s.rule}`;i.has(r)||(i.add(r),a.push(s))}}return a};var ye=async o=>{let e=h.process.cwd(),i=q(o),a=M(o);if(!await T(e)){let l=await I(e);return await x({error:`noskills not initialized. Run: ${V("init",l)}`},i),D({exitCode:1})}let n=null;for(let l of a)l.startsWith("--answer=")&&(n=l.slice(9));let t=await E(e),s=await I(e);if(t.pendingClear&&(t={...t,pendingClear:!1},await y(e,t)),s===null)return await x({error:"No config found"},i),D({exitCode:1});let c=(await $(e)).filter(l=>s.concerns.includes(l.id));if(n!==null){let l=await se(e,t,s,c,n);await y(e,l);let u={...l,lastCalledAt:new Date().toISOString()};await y(e,u);let m=await b(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=P(u,c,m,s,d,X);return await x(Y,i),F(void 0)}let p={...t,lastCalledAt:new Date().toISOString()};await y(e,p);let g=await b(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=P(p,c,g,s,f,C);return await x(S,i),F(void 0)},se=async(o,e,i,a,n)=>{switch(e.phase){case"DISCOVERY":{let t=null;try{let r=JSON.parse(n);typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=r)}catch{}let s=e;if(t!==null)for(let[r,c]of Object.entries(t))typeof c=="string"&&c.length>0&&(s=A(s,r,c));else{let r=U(a),c=L(r,s.discovery.answers);if(c===null)return e;s=A(s,c.id,n)}return N(s.discovery.answers)&&(s=G(s)),s}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let r=JSON.parse(n);t={involvesUI:r.involvesUI===!0,involvesPublicAPI:r.involvesPublicAPI===!0,involvesMigration:r.involvesMigration===!0,involvesDataHandling:r.involvesDataHandling===!0}}catch{t={involvesUI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let s={...e,classification:t};try{await _(o,s,a)}catch{}return s}return e}case"SPEC_APPROVED":{let t=J(e);return t.spec!==null&&(await B(o,t.spec,"executing"),await z(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(i.verifyCommand!==null&&i.verifyCommand!==void 0&&i.verifyCommand.length>0){let s=await ie(o,i.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ne(o,e,n,a)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},r=W(e,s);return r=j(r,"EXECUTING"),r={...r,execution:{...r.execution,lastProgress:`Resolved: ${n}`}},r}default:return e}},ne=async(o,e,i,a)=>{let n;try{n=JSON.parse(i)}catch{return{...e,execution:{...e.execution,lastProgress:i,awaitingStatusReport:!1}}}let t=n.completed??[],s=n.remaining??[],r=n.blocked??[],c=[...s,...r],p=e.execution.debt?.unaddressedIterations??0,g=c.length>0?{items:c,fromIteration:e.execution.iteration,unaddressedIterations:1}:null,f=g;if(e.execution.debt!==null&&g!==null){let l=new Set(t.map(d=>d.toLowerCase().trim())),u=e.execution.debt.items.filter(d=>!l.has(d.toLowerCase().trim())),m=[...new Set([...u,...c])];f=m.length>0?{items:m,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:u.length>0?p+1:1}:null}else if(e.execution.debt!==null&&g===null){let l=new Set(t.map(m=>m.toLowerCase().trim())),u=e.execution.debt.items.filter(m=>!l.has(m.toLowerCase().trim()));f=u.length>0?{items:u,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:p+1}:null}let w=t.length>0?`Completed: ${t.join(", ")}`:"Status report submitted",C=e.execution.lastVerification===null||e.execution.lastVerification.passed===!0,S=f===null&&C;if(S&&e.spec!==null){let l=await v(o,e.spec);if(l!==null){let u=e.execution.completedTasks??[],m=new Set(u),d=l.tasks.find(R=>!m.has(R.id));if(d!==void 0)return await H(o,e.spec,d.id),await Q(o,e.spec,d.id,"done"),{...e,pendingClear:!0,execution:{...e.execution,lastProgress:`Task ${d.id} accepted: ${w}`,awaitingStatusReport:!1,debt:f,completedTasks:[...u,d.id]}}}}return{...e,pendingClear:S,execution:{...e.execution,lastProgress:S?w:`Task not accepted \u2014 remaining items must be addressed first. ${w}`,awaitingStatusReport:!1,debt:f}}},ie=async(o,e)=>{try{let{execSync:i}=await import("node:child_process"),a=i(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(a).slice(0,4e3),timestamp:new Date().toISOString()}}catch(i){let a=i,n=((a.stdout??"")+(a.stderr??"")).slice(0,4e3);return a.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${i instanceof Error?i.message:String(i)}`,timestamp:new Date().toISOString()}}},K=async(o,e)=>{let i=[...e.execution.modifiedFiles??[]],a=await re(o);return[...new Set([...i,...a])]},re=async o=>{let e=`${o}/${O.stateDir}/files-changed.jsonl`;try{let a=(await h.fs.readTextFile(e)).trim().split(`
4
4
  `).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
@@ -1,9 +1,9 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as c}from"./chunk-NTHP6SND.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as g}from"./chunk-2VEVVX6U.js";import{a as C,b as v}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as n,f as h,g as f,h as y,i as o}from"./chunk-3SXTMY75.js";import{d as l}from"./chunk-PVPMHMKP.js";import{a as m}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var t=C(),A=async()=>(await l`git status --porcelain`.noThrow().text()).length===0,b=async()=>{let e=await l`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
2
+ import{a as c}from"./chunk-2HBVIH7V.js";import"./chunk-DYRTLYTU.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as g}from"./chunk-2VEVVX6U.js";import{a as C,b as v}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as n,f as h,g as f,h as y,i as o}from"./chunk-3SXTMY75.js";import{d as l}from"./chunk-PVPMHMKP.js";import{a as m}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var t=C(),A=async()=>(await l`git status --porcelain`.noThrow().text()).length===0,b=async()=>{let e=await l`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
3
3
  `):[]},P=async(e,s)=>{for(let r of s)await l`git add ${r}`.spawn();await l`git commit -m ${e}`.spawn()},O=async()=>{await l`git push origin HEAD`.spawn()},k=async e=>{await l`git tag -d ${e}`.noThrow().spawn();let s=`:refs/tags/${e}`;await l`git push origin ${s}`.noThrow().spawn()},T=async e=>{let s=new TextEncoder,r=new TextDecoder,a=new Uint8Array(256);await Deno.stderr.write(s.encode(`${e} [y/N] `));let p=await Deno.stdin.read(a),d=r.decode(a.subarray(0,p??0)).trim();return d==="y"||d==="Y"},M=async e=>{let{type:s,dryRun:r=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit or stash changes first.");let a=await b();if(a.length>0&&e.yes!==!0)throw new Error(`You have ${a.length} unpushed commit(s):
4
4
  ${a.join(`
5
5
  `)}
6
6
 
7
- Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-IVXYMSAZ.js")).versions(s,{dryRun:r});let d=await c()??p,u=!1;try{await(await import("./changelog-gen-7V37P7PE.js")).generateChangelog({dryRun:r}),u=!0}catch{u=!1}let x=!1,E=!1;if(!r){u&&await l`deno fmt CHANGELOG.md`.noThrow().spawn();let R=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],$=`chore(codebase): release v${d}`;await P($,R),x=!0,await O(),E=!0}return{version:d,previousVersion:p,changelogGenerated:u,committed:x,pushed:E,dryRun:r}},U=async(e={})=>{let{dryRun:s=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit and push first.");let r=await b();if(r.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
7
+ Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-ODYWYT7U.js")).versions(s,{dryRun:r});let d=await c()??p,u=!1;try{await(await import("./changelog-gen-MX6L2Z24.js")).generateChangelog({dryRun:r}),u=!0}catch{u=!1}let x=!1,E=!1;if(!r){u&&await l`deno fmt CHANGELOG.md`.noThrow().spawn();let R=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],$=`chore(codebase): release v${d}`;await P($,R),x=!0,await O(),E=!0}return{version:d,previousVersion:p,changelogGenerated:u,committed:x,pushed:E,dryRun:r}},U=async(e={})=>{let{dryRun:s=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit and push first.");let r=await b();if(r.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
8
8
  ${r.join(`
9
9
  `)}`);let a=await c();if(a===void 0||!/^\d+\.\d+\.\d+$/.test(a))throw new Error(`Invalid or missing version in VERSION file: "${a}"`);let p=`v${a}`;if(!s){let d=`chore(codebase): release v${a}`;await l`git commit --allow-empty -m ${d}`.spawn(),await l`git push origin HEAD`.spawn()}return{version:a,tag:p,dryRun:s}},H=async(e={})=>{let s=await c();if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let r=`v${s}`;if(e.yes!==!0)throw new Error(`This will delete tag ${r} locally and remotely. Re-run with --yes to confirm.`);return await k(r),{version:s,tag:r,deleted:!0}},I=e=>w.fromPromise(()=>M(e)),V=e=>w.fromPromise(()=>U(e)),D=e=>w.fromPromise(()=>H(e)),j=e=>{let s=e.args[0];return s===void 0||!["patch","minor","major","same"].includes(s)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:s,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},N=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),S=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.dryRun?(t.writeln(y("\u26A0"),n(" [DRY RUN] Release preview:")),t.writeln(o("\u2139"),n(` Version: ${s.previousVersion} -> ${s.version}`)),t.writeln(o("\u2139"),n(` Changelog: ${s.changelogGenerated?"generated":"no user-facing changes"}`)),t.writeln(o("\u2139"),n(" No changes were made."))):(t.writeln(f("\u2713"),n(` Released v${s.version}`)),t.writeln(o("\u2139"),n(` Version: ${s.previousVersion} -> ${s.version}`)),t.writeln(o("\u2139"),n(` Changelog: ${s.changelogGenerated?"updated":"no user-facing changes"}`)),t.writeln(o("\u2139"),n(` Committed: ${s.committed}`)),t.writeln(o("\u2139"),n(` Pushed: ${s.pushed}`)),t.writeln(o("\u2139"),n(" CI will validate, tag, and publish.")),t.writeln(o("\u2139"),n(" Watch: https://github.com/eser/stack/actions"))),i.ok(void 0)},Y=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.dryRun?t.writeln(y("\u26A0"),n(` [DRY RUN] Would delete and recreate tag ${s.tag}`)):(t.writeln(f("\u2713"),n(` Re-tagged ${s.tag}`)),t.writeln(o("\u2139"),n(" CI will validate and publish."))),i.ok(void 0)},F=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.deleted&&t.writeln(f("\u2713"),n(` Deleted tag v${s.version} (local + remote).`)),i.ok(void 0)},W=g.createTrigger({handler:I,adaptInput:j,adaptOutput:S}),L=g.createTrigger({handler:V,adaptInput:N,adaptOutput:Y}),B=g.createTrigger({handler:D,adaptInput:G,adaptOutput:F}),re=async e=>{let s=m(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),r=s._[0],a=s["dry-run"]===!0,p=s.yes===!0;if(r!==void 0&&!a&&!p&&["patch","minor","major","same"].includes(r)){let u=await c()??"0.0.0";if(t.writeln(o("\u2139"),n(` Current version: ${u}`)),t.writeln(o("\u2139"),n(` Bump type: ${r}`)),t.writeln(o("\u2139"),n(" This will bump version, generate changelog, commit, and push.")),await t.flush(),!await T("Proceed?"))return t.writeln(y("\u26A0"),n(" Aborted.")),i.ok(void 0);s.yes=!0}let d=v("release",s);return await W(d)},ne=async e=>{let s=m(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),r=v("rerelease",s);return await L(r)},te=async e=>{let s=m(e??[],{boolean:["yes"],alias:{y:"yes"}}),r=v("unrelease",s);return await B(r)};export{W as handleReleaseCli,L as handleRereleaseCli,B as handleUnreleaseCli,re as main,M as release,I as releaseHandler,U as rerelease,V as rereleaseHandler,ne as rereleaseMain,H as unrelease,D as unreleaseHandler,te as unreleaseMain};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import"./chunk-SOSF762G.js";import"./chunk-JOTAKQMZ.js";import{a as y}from"./chunk-2VEVVX6U.js";import{a as E,b as A}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as $}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as p,f as P,g as m,h as C}from"./chunk-3SXTMY75.js";import{e as u}from"./chunk-PVPMHMKP.js";import"./chunk-PWLF3WXM.js";import"./chunk-KKBIUT5L.js";import"./chunk-SQINSLNL.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as R,n as w}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{v as c}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var h=E(),O=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,T=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},k=t=>{let e=t.split(/\r?\n/),r=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(O);i!==null&&/^\d/.test(i[1])&&r.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return r.length===0?[]:r.map((s,o)=>{let i=r[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,n=e.slice(g,a);for(;n.length>0&&n[0].trim()==="";)n.shift();for(;n.length>0&&n[n.length-1].trim()==="";)n.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return n.length>0&&d.push("",...n),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
2
+ import"./chunk-SOSF762G.js";import"./chunk-JOTAKQMZ.js";import{a as y}from"./chunk-2VEVVX6U.js";import{a as E,b as A}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as $}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as p,f as P,g as m,h as C}from"./chunk-3SXTMY75.js";import{e as u}from"./chunk-PVPMHMKP.js";import"./chunk-PWLF3WXM.js";import"./chunk-KVTG56GS.js";import"./chunk-PZNCE6QK.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as R,n as w}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{v as c}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var h=E(),O=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,T=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},k=t=>{let e=t.split(/\r?\n/),r=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(O);i!==null&&/^\d/.test(i[1])&&r.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return r.length===0?[]:r.map((s,o)=>{let i=r[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,n=e.slice(g,a);for(;n.length>0&&n[0].trim()==="";)n.shift();for(;n.length>0&&n[n.length-1].trim()==="";)n.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return n.length>0&&d.push("",...n),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
3
3
  `).trim()}
4
4
  `}})},I=async(t={})=>{let{changelogPath:e="CHANGELOG.md",root:r="."}=t,s=w(r,e),o=await c.runtime.fs.readTextFile(s);return{entries:k(o)}},S=async(t,e)=>{try{return await u.exec`gh release view ${t} --repo ${e}`.quiet().text(),!0}catch{return!1}},b=async t=>{let{repo:e,createIfMissing:r=!1,changelogPath:s="CHANGELOG.md",root:o=".",releaseTitle:i="eserstack {tag}"}=t,{entries:g}=await I({changelogPath:s,root:o});if(g.length===0)throw new Error("No release headings found in CHANGELOG.md.");let a=t.tag!==void 0?T(t.tag):g[0].tag,n=g.find(x=>x.tag===a);if(n===void 0)throw new Error(`No matching changelog section found for ${a}.`);let d=await c.runtime.fs.makeTempDir({prefix:"eserstack-release-"}),f=R(d,`${a}-notes.md`);await c.runtime.fs.writeTextFile(f,n.notes);try{if(await S(a,e))return await u.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"updated"};if(!r)return{tag:a,entry:n,action:"skipped"};let N=i.replace("{tag}",a);try{return await u.exec`gh release create ${a} --repo ${e} --title ${N} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"created"}}catch{return await u.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"updated"}}}finally{await c.runtime.fs.remove(d,{recursive:!0})}},G=t=>$.fromPromise(()=>b(t)),H=t=>{let e=t.flags.repo??c.runtime.env.get("GITHUB_REPOSITORY")??"";return e===""?l.fail(y.adaptError("Missing repository. Pass --repo or set GITHUB_REPOSITORY.")):l.ok({repo:e,tag:t.flags.tag??void 0,createIfMissing:t.flags["create-if-missing"]===!0})},L=t=>{if(l.isFail(t)){let r=t.error,s=r instanceof Error?r.message:r.message??String(r);return h.writeln(P("\u2717"),p(" "+s)),l.fail({exitCode:1})}let{value:e}=t;switch(e.action){case"created":h.writeln(m("\u2713"),p(` Created release ${e.tag} with changelog notes.`));break;case"updated":h.writeln(m("\u2713"),p(` Updated release notes for ${e.tag}.`));break;case"skipped":h.writeln(C("\u26A0"),p(` Release ${e.tag} not found. Skipping (pass --create-if-missing to create).`));break}return l.ok(void 0)},M=y.createTrigger({handler:G,adaptInput:H,adaptOutput:L}),W=async t=>{let e=v(t??[],{string:["repo","tag"],boolean:["create-if-missing"],alias:{h:"help"}}),r=A("release-notes",e);return await M(r)};export{M as handleCli,S as hasGitHubRelease,W as main,T as normalizeTag,I as parseChangelog,k as parseChangelogText,b as syncReleaseNotes,G as syncReleaseNotesHandler};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as y,d as v}from"./chunk-BP3IFAPO.js";import{a as P}from"./chunk-NTHP6SND.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as h}from"./chunk-2VEVVX6U.js";import{a as f,b as R}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as c}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as a,f as g,g as u,h as d,i as m}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as t}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var o=f(),C=async(e={})=>{let{root:r=".",remote:n="origin",tagPrefix:T="v",messageTemplate:x="Release {tag}",dryRun:l=!1}=e,s=await P({root:r});if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let i=`${T}${s}`,w=x.replace("{tag}",i).replace("{version}",s);return l||(await y(i,w),await v(n,i)),{version:s,tag:i,remote:n,dryRun:l}},A=e=>c.fromPromise(()=>C(e)),E=e=>t.ok({dryRun:e.flags["dry-run"]===!0}),$=e=>{if(t.isFail(e))return o.writeln(g("\u2717"),a(" "+(e.error instanceof Error?e.error.message:String(e.error)))),t.fail({exitCode:1});let{value:r}=e;return r.dryRun?o.writeln(d("\u26A0"),a(` [DRY RUN] Would create and push tag ${r.tag}`)):(o.writeln(u("\u2713"),a(` Created tag ${r.tag}`)),o.writeln(m("\u2139"),a(` Pushed tag ${r.tag} to ${r.remote}`))),t.ok(void 0)},O=h.createTrigger({handler:A,adaptInput:E,adaptOutput:$}),U=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),n=R("release-tag",r);return await O(n)};export{O as handleCli,U as main,C as pushReleaseTag,A as pushReleaseTagHandler};
2
+ import{c as y,d as v}from"./chunk-BP3IFAPO.js";import{a as P}from"./chunk-2HBVIH7V.js";import"./chunk-DYRTLYTU.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as h}from"./chunk-2VEVVX6U.js";import{a as f,b as R}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as c}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as a,f as g,g as u,h as d,i as m}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as t}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var o=f(),C=async(e={})=>{let{root:r=".",remote:n="origin",tagPrefix:T="v",messageTemplate:x="Release {tag}",dryRun:l=!1}=e,s=await P({root:r});if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let i=`${T}${s}`,w=x.replace("{tag}",i).replace("{version}",s);return l||(await y(i,w),await v(n,i)),{version:s,tag:i,remote:n,dryRun:l}},A=e=>c.fromPromise(()=>C(e)),E=e=>t.ok({dryRun:e.flags["dry-run"]===!0}),$=e=>{if(t.isFail(e))return o.writeln(g("\u2717"),a(" "+(e.error instanceof Error?e.error.message:String(e.error)))),t.fail({exitCode:1});let{value:r}=e;return r.dryRun?o.writeln(d("\u26A0"),a(` [DRY RUN] Would create and push tag ${r.tag}`)):(o.writeln(u("\u2713"),a(` Created tag ${r.tag}`)),o.writeln(m("\u2139"),a(` Pushed tag ${r.tag} to ${r.remote}`))),t.ok(void 0)},O=h.createTrigger({handler:A,adaptInput:E,adaptOutput:$}),U=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),n=R("release-tag",r);return await O(n)};export{O as handleCli,U as main,C as pushReleaseTag,A as pushReleaseTagHandler};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as M}from"./chunk-E5QQGGNF.js";import{a as V}from"./chunk-JAQN64PH.js";import"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as B,f as L}from"./chunk-UESOCN2G.js";import{a as G,b as C}from"./chunk-LNNNLUZT.js";import{d as x,e as g,j as $,n as F,q as U}from"./chunk-WG6J7DFO.js";import{a as D,b as A,d as N}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{f as R,h as O,k as T}from"./chunk-GBM3TZFD.js";import{c as P,d as r,f as u,g as v,h,k as I}from"./chunk-3SXTMY75.js";import{a as S,b as w}from"./chunk-A6RDYP6R.js";import{t as y}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${G("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=L(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=B(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await V(e),j=M(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-JI2A2546.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-JI2A2546.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
2
+ import{a as M}from"./chunk-AHLJCH32.js";import{a as V}from"./chunk-JAQN64PH.js";import"./chunk-DAYSTLLV.js";import"./chunk-OCPEFZBJ.js";import{a as B,f as L}from"./chunk-UESOCN2G.js";import{a as G,b as C}from"./chunk-LNNNLUZT.js";import{d as x,e as g,j as $,n as F,q as U}from"./chunk-WG6J7DFO.js";import{a as D,b as A,d as N}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{f as R,h as O,k as T}from"./chunk-GBM3TZFD.js";import{c as P,d as r,f as u,g as v,h,k as I}from"./chunk-3SXTMY75.js";import{a as S,b as w}from"./chunk-A6RDYP6R.js";import{t as y}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${G("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=L(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=B(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await V(e),j=M(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-JI2A2546.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-JI2A2546.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
3
3
  `)},W=(n,t)=>{if(n===void 0)return null;let e=`${t}=`;for(let a of n)if(a.startsWith(e)){let s=parseInt(a.slice(e.length),10);if(!isNaN(s)&&s>0)return s}return null},H=async(n,t,e)=>{let a=`${n}/.eser/.state/blocked.log`,s=`[${new Date().toISOString()}] iteration=${e} reason=${t}
4
4
  `;try{let{appendFileSync:o,mkdirSync:p}=await import("node:fs"),{dirname:c}=await import("node:path");p(c(a),{recursive:!0}),o(a,s)}catch{}};export{ae as main};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as l,h as a,k as i}from"./chunk-GBM3TZFD.js";import{k as n}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as o}from"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import{a as t}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var v=["trace","debug","info","warn","error","fatal"],P=async m=>{let{flags:e}=o(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),r=l({renderer:i.ansi(),sink:a.stdout()});r.writeln(n(`
2
+ import{f as l,h as a,k as i}from"./chunk-GBM3TZFD.js";import{k as n}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as o}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as t}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var v=["trace","debug","info","warn","error","fatal"],P=async m=>{let{flags:e}=o(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),r=l({renderer:i.ansi(),sink:a.stdout()});r.writeln(n(`
3
3
  \u{1F680} Serving production build...
4
- `));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-JTYNMHNL.js"),import("./mod-NCF6OSXO.js"),import("./mod-SA3J2VR5.js"),import("./mod-JZNE2HH6.js")]);return await r.close(),await g({mode:"serve",port:p,logLevel:u,hmr:!1,renderer:c,htmlShell:d,frameworkPlugin:L,cssPlugin:f({globalCssPath:"src/app/styles/global.css"})}),t(void 0)};export{P as main};
4
+ `));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-HJQEBLLN.js"),import("./mod-NCF6OSXO.js"),import("./mod-OS3BCM2G.js"),import("./mod-JZNE2HH6.js")]);return await r.close(),await g({mode:"serve",port:p,logLevel:u,hmr:!1,renderer:c,htmlShell:d,frameworkPlugin:L,cssPlugin:f({globalCssPath:"src/app/styles/global.css"})}),t(void 0)};export{P as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as f}from"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as h}from"./chunk-LNNNLUZT.js";import{a as I,d as w}from"./chunk-2EVWKUN6.js";import{d as y,j as u,q as D}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as p,h as d,k as m}from"./chunk-GBM3TZFD.js";import{c as i,d as r,f as c,g as b,h as o,k as E}from"./chunk-3SXTMY75.js";import{a as g,b as C}from"./chunk-A6RDYP6R.js";import{t as x}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(h("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${h("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};
2
+ import{a as f}from"./chunk-DAYSTLLV.js";import"./chunk-OCPEFZBJ.js";import{a as h}from"./chunk-LNNNLUZT.js";import{a as I,d as w}from"./chunk-2EVWKUN6.js";import{d as y,j as u,q as D}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as p,h as d,k as m}from"./chunk-GBM3TZFD.js";import{c as i,d as r,f as c,g as b,h as o,k as E}from"./chunk-3SXTMY75.js";import{a as g,b as C}from"./chunk-A6RDYP6R.js";import{t as x}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(h("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${h("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-64PIAW3Y.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-5BZG26SF.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var i=new n("system").description("Commands related with this CLI").command(new n("install").description("Install eser CLI globally").run(e)).command(new n("uninstall").description("Uninstall eser CLI globally").run(s)).command(new n("update").description("Update eser CLI to the latest version").run(l)).command(new n("completions").description("Generate shell completion scripts").flag({name:"shell",type:"string",description:"Shell type: bash, zsh, or fish"}).run(o)).command(new n("version").description("Show version and check for updates").flag({name:"bare",type:"boolean",description:"Print version number only"}).run(r)).command(new n("doctor").description("Run diagnostic checks").run(a));export{i as systemCommand};
2
+ import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-OIZ7HL2C.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-QSION3QA.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var i=new n("system").description("Commands related with this CLI").command(new n("install").description("Install eser CLI globally").run(e)).command(new n("uninstall").description("Uninstall eser CLI globally").run(s)).command(new n("update").description("Update eser CLI to the latest version").run(l)).command(new n("completions").description("Generate shell completion scripts").flag({name:"shell",type:"string",description:"Shell type: bash, zsh, or fish"}).run(o)).command(new n("version").description("Show version and check for updates").flag({name:"bare",type:"boolean",description:"Print version number only"}).run(r)).command(new n("doctor").description("Run diagnostic checks").run(a));export{i as systemCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as a,d as b,e as c,f as d}from"./chunk-COKZ6MLN.js";import"./chunk-VG72SSDI.js";import"./chunk-KPWEJXPI.js";import"./chunk-CUIMSX4V.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import"./chunk-NBA6EFWU.js";import"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{b as build,a as createBuildContext,c as ensureBuildIsReady,d as watch};
2
+ import{c as a,d as b,e as c,f as d}from"./chunk-B6EATLKL.js";import"./chunk-UJPVEQX7.js";import"./chunk-KPWEJXPI.js";import"./chunk-CUIMSX4V.js";import"./chunk-DYRTLYTU.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import"./chunk-NBA6EFWU.js";import"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{b as build,a as createBuildContext,c as ensureBuildIsReady,d as watch};