eser 4.1.26 → 4.1.27

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.
@@ -0,0 +1,9 @@
1
+ import{a as $,b as S}from"./chunk-C3PZVQ3Z.js";import{a as O}from"./chunk-RBB5ITAS.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as E}from"./chunk-6U2VEZEM.js";import{a as w,b as A}from"./chunk-KAEAT6A4.js";import"./chunk-ZH37DSUQ.js";import"./chunk-LOFP256P.js";import"./chunk-ZF2XYULB.js";import"./chunk-4S7QYPS6.js";import{f as R}from"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import"./chunk-2J2PXBOC.js";import"./chunk-TTYO2XJO.js";import"./chunk-USCAYIWL.js";import{b as u,e as h,f as y,g as v,h as x}from"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import{a as C}from"./chunk-HPPFA3XU.js";import{g as p}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{v as m}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var f=w(),G={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},T=new Set(["chore","ci","test"]),N=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}(.+)$/,I=/\s{0,100}\(take\s{1,100}[IVXLCDM\d]+\)\s{0,100}\.?$/i,P=(n,t)=>{let o=n.match(N);if(o!==null)return{type:o[1].toLowerCase(),scope:o[2],message:o[3].trim(),hash:t}},b=n=>n.replace(I,"").trim(),M=n=>{let t=[];for(let o of n){let e=P(o.subject,o.hash);e!==void 0&&t.push(e)}return t},k=n=>{let t=new Set,o=[];for(let e of n){let s=b(e.message),a=s.replace(/[.\s]{1,20}$/,"").toLowerCase(),l=`${e.type}:${a}`;t.has(l)||(t.add(l),o.push({...e,message:s}))}return o},L=n=>{let t=new Map;for(let o of n){if(T.has(o.type))continue;let e=G[o.type];if(e===void 0)continue;let s=t.get(e);s!==void 0?s.push(o):t.set(e,[o])}return t},F=n=>n.scope!==void 0?`- **${n.scope}:** ${n.message}`:`- ${n.message}`,H=(n,t)=>{let o=L(t);if(o.size===0){let l=new Date().toISOString().split("T")[0];return`## ${n} - ${l}
2
+
3
+ _Maintenance release._`}let e=new Date().toISOString().split("T")[0],s=[`## ${n} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let r=o.get(l);if(!(r===void 0||r.length===0)){s.push("",`### ${l}`,"");for(let g of r)s.push(F(g))}}return s.join(`
4
+ `)},j=(n,t,o)=>{let e=n.split(`
5
+ `);if(o!==void 0){let r=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=new RegExp(`^##\\s+${r}\\b`),i=e.findIndex(d=>g.test(d));if(i!==-1){let d=e.length;for(let c=i+1;c<e.length;c++)if(/^##\s+/.test(e[c])){d=c;break}return e.splice(i,d-i,t),e.join(`
6
+ `)}}let s=e.findIndex(r=>/^##\s+\[Unreleased\]/i.test(r));if(s===-1){let r=e.findIndex((i,d)=>d>0&&i.startsWith("## ")),g=r===-1?e.length:r;return e.splice(g,0,"",t,""),e.join(`
7
+ `)}let a=-1;for(let r=s+1;r<e.length;r++)if(/^##\s+/.test(e[r])){a=r;break}let l=a===-1?e.length:a;return e.splice(l,0,t,""),e.join(`
8
+ `)},_=async(n={})=>{let{root:t=".",dryRun:o=!1}=n,e=await O({root:t});if(e===void 0||e==="")throw new Error("VERSION file is missing or empty.");let s;try{s=await $()}catch{throw new Error("No git tags found. Create an initial tag first (e.g., git tag v0.0.0).")}let a=await S(s,"HEAD");if(a.length===0)throw new Error(`No commits found since ${s}. Nothing to release.`);let l=M(a),r=k(l),g=H(e,r);if(!o){let i=m.runtime.path.join(t,"CHANGELOG.md"),d;try{d=await m.runtime.fs.readTextFile(i)}catch{throw new Error(`CHANGELOG.md not found at ${i}. Create one first.`)}let c=j(d,g,e);await m.runtime.fs.writeTextFile(i,c)}return{version:e,commitCount:a.length,entryCount:r.filter(i=>!T.has(i.type)).length,content:g,dryRun:o}},D=n=>R.fromPromise(()=>_(n)),V=n=>p.ok({dryRun:n.flags["dry-run"]===!0}),z=n=>{if(p.isFail(n))return f.writeln(h("\u2717"),u(" "+(n.error instanceof Error?n.error.message:String(n.error)))),p.fail({exitCode:1});let{value:t}=n;return t.dryRun?(f.writeln(v("\u26A0"),u(" [DRY RUN] Generated changelog preview:")),f.writeln(x("\u2139"),u(`
9
+ ${t.content}`))):f.writeln(y("\u2713"),u(` Added ${t.entryCount} entries to CHANGELOG.md for v${t.version}`)),p.ok(void 0)},B=E.createTrigger({handler:D,adaptInput:V,adaptOutput:z}),ee=async n=>{let t=C(n??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),o=A("changelog-gen",t);return await B(o)};export{k as deduplicateCommits,_ as generateChangelog,D as generateChangelogHandler,H as generateChangelogSection,L as groupBySection,B as handleCli,j as insertIntoChangelog,ee as main,P as parseConventionalCommit,M as parseConventionalCommits,b as stripTakeSuffix};
@@ -1 +1 @@
1
- var r={name:"@eser/cli",version:"4.1.26",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
1
+ var r={name:"@eser/cli",version:"4.1.27",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
@@ -1,4 +1,4 @@
1
- import{e as Q}from"./chunk-LOFP256P.js";import{f as p,h as u,k as d}from"./chunk-TTYO2XJO.js";import{b as r,d as c,e as m,f as w,g as Y,j as a}from"./chunk-PLJNPQFC.js";import{b as x}from"./chunk-BCHXUKWW.js";import{a as v}from"./chunk-MBC2JM7F.js";import{a as h,b as g}from"./chunk-DQAEQEXD.js";import{a as oe,g as z,h as K,i as B,r as U,t as i}from"./chunk-YXSB6RET.js";var X=()=>i.env.get("HOME")??"",k=()=>{let e=i.env.get("SHELL")??"";return e.includes("zsh")?"zsh":e.includes("fish")?"fish":"bash"},ae=e=>{let t=X();switch(e){case"zsh":return i.path.join(t,".zshrc");case"bash":return i.path.join(t,".bashrc");case"fish":return i.path.join(t,".config","fish","config.fish")}},ie=(e,t)=>{let s=X();switch(e){case"zsh":return i.path.join(s,".zshrc");case"bash":return i.path.join(s,".bashrc");case"fish":return i.path.join(s,".config","fish","completions",`${t}.fish`)}},A=(e,t)=>`eval "$(${t} system completions --shell ${e})"`,le=e=>e==="fish"?"file":"eval",E=(e,t="eser")=>{let s=e??k(),n=le(s);return{shell:s,rcFile:ae(s),completionType:n,completionsFile:n==="file"?ie(s,t):void 0}};var ce="# eser CLI completions",j="eser",ee=async e=>{try{return await i.fs.readTextFile(e)}catch{return""}},de=async e=>{try{return await i.fs.stat(e),!0}catch{return!1}},te=async e=>{let t=E(e,j);if(t.completionType==="file")return await de(t.completionsFile);let s=await ee(t.rcFile),n=A(e,j);return s.includes(n)},se=async e=>{let t=E(e,j),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=i.path.dirname(n);try{await i.fs.mkdir(o,{recursive:!0})}catch{}await i.fs.writeTextFile(n,`# eser CLI completions
1
+ import{e as Q}from"./chunk-LOFP256P.js";import{f as p,h as u,k as d}from"./chunk-TTYO2XJO.js";import{b as r,d as c,e as m,f as w,g as Y,j as a}from"./chunk-PLJNPQFC.js";import{b as x}from"./chunk-BCHXUKWW.js";import{a as v}from"./chunk-EBYJBBYV.js";import{a as h,b as g}from"./chunk-DQAEQEXD.js";import{a as oe,g as z,h as K,i as B,r as U,t as i}from"./chunk-YXSB6RET.js";var X=()=>i.env.get("HOME")??"",k=()=>{let e=i.env.get("SHELL")??"";return e.includes("zsh")?"zsh":e.includes("fish")?"fish":"bash"},ae=e=>{let t=X();switch(e){case"zsh":return i.path.join(t,".zshrc");case"bash":return i.path.join(t,".bashrc");case"fish":return i.path.join(t,".config","fish","config.fish")}},ie=(e,t)=>{let s=X();switch(e){case"zsh":return i.path.join(s,".zshrc");case"bash":return i.path.join(s,".bashrc");case"fish":return i.path.join(s,".config","fish","completions",`${t}.fish`)}},A=(e,t)=>`eval "$(${t} system completions --shell ${e})"`,le=e=>e==="fish"?"file":"eval",E=(e,t="eser")=>{let s=e??k(),n=le(s);return{shell:s,rcFile:ae(s),completionType:n,completionsFile:n==="file"?ie(s,t):void 0}};var ce="# eser CLI completions",j="eser",ee=async e=>{try{return await i.fs.readTextFile(e)}catch{return""}},de=async e=>{try{return await i.fs.stat(e),!0}catch{return!1}},te=async e=>{let t=E(e,j);if(t.completionType==="file")return await de(t.completionsFile);let s=await ee(t.rcFile),n=A(e,j);return s.includes(n)},se=async e=>{let t=E(e,j),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=i.path.dirname(n);try{await i.fs.mkdir(o,{recursive:!0})}catch{}await i.fs.writeTextFile(n,`# eser CLI completions
2
2
  # This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
3
3
  complete -c eser -f
4
4
  complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"./chunk-LO424HF3.js";import"./chunk-LOFP256P.js";import"./chunk-TTYO2XJO.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-MBC2JM7F.js";import"./chunk-DQAEQEXD.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
1
+ import{a,b,c,d,e,f}from"./chunk-ZO7RUTSQ.js";import"./chunk-LOFP256P.js";import"./chunk-TTYO2XJO.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-EBYJBBYV.js";import"./chunk-DQAEQEXD.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
@@ -3,6 +3,6 @@ import{a as c}from"./chunk-RBB5ITAS.js";import"./chunk-V2N5L24J.js";import"./chu
3
3
  ${a.join(`
4
4
  `)}
5
5
 
6
- Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-KW5UTMNV.js")).versions(s,{dryRun:r});let d=await c()??p,u=!1;try{await(await import("./changelog-gen-LV5VWTZS.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.
6
+ Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-KW5UTMNV.js")).versions(s,{dryRun:r});let d=await c()??p,u=!1;try{await(await import("./changelog-gen-QDUA5G5K.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
7
  ${r.join(`
8
8
  `)}`);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 +1 @@
1
- import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-LO424HF3.js";import"./chunk-LOFP256P.js";import"./chunk-TTYO2XJO.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-MBC2JM7F.js";import"./chunk-ZOZYBQX2.js";import{b as n}from"./chunk-DWYVBWBP.js";import"./chunk-HPPFA3XU.js";import"./chunk-DQAEQEXD.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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
+ import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-ZO7RUTSQ.js";import"./chunk-LOFP256P.js";import"./chunk-TTYO2XJO.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-EBYJBBYV.js";import"./chunk-ZOZYBQX2.js";import{b as n}from"./chunk-DWYVBWBP.js";import"./chunk-HPPFA3XU.js";import"./chunk-DQAEQEXD.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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};
package/eser.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as u}from"./chunks/chunk-MBC2JM7F.js";import{a as m}from"./chunks/chunk-RYLOB2JU.js";import"./chunks/chunk-ZOZYBQX2.js";import{a as o}from"./chunks/chunk-UNL4H5EY.js";import{b as a}from"./chunks/chunk-DWYVBWBP.js";import"./chunks/chunk-HPPFA3XU.js";import{b as d,e as c}from"./chunks/chunk-DQAEQEXD.js";import{t as p}from"./chunks/chunk-YXSB6RET.js";import"./chunks/chunk-SG4G3OOO.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var g=new o({description:"Kit \u2014 recipes, templates, project creation",modules:{add:{description:"Add a recipe to your project",category:"Distribution",load:()=>import("./chunks/add-ORJYWG26.js")},list:{description:"Browse available recipes and templates",category:"Distribution",load:()=>import("./chunks/list-2RZIQZGH.js")},new:{description:"Create a new project from a template",category:"Distribution",load:()=>import("./chunks/new-EAETGSIR.js")},clone:{description:"Clone a recipe from any GitHub repo",category:"Distribution",load:()=>import("./chunks/clone-PAQMCIA3.js")},update:{description:"Re-fetch and update an applied recipe",category:"Distribution",load:()=>import("./chunks/update-O75M4SDJ.js")}},aliases:{create:"new"}});var f=new o({description:"Codebase management tools",modules:{scaffolding:{description:"Initialize project from template",category:"Setup",load:()=>import("./chunks/mod-NSY6WUYH.js")},install:{description:"Install git hooks from .manifest.yml",category:"Setup",load:()=>import("./chunks/install-VY2L6NDB.js")},uninstall:{description:"Remove managed git hooks",category:"Setup",load:async()=>({main:(await import("./chunks/install-VY2L6NDB.js")).uninstallMain})},status:{description:"Show git hook installation status",category:"Setup",load:async()=>({main:(await import("./chunks/install-VY2L6NDB.js")).statusMain})},commitmsg:{description:"Generate commit message from git diff",category:"AI",load:()=>import("./chunks/commitmsg-ZGOEO5YG.js")},gh:{description:"GitHub operations (contributors, releases, tags)",category:"GitHub",load:()=>import("./chunks/gh-SXEDNWHD.js")},versions:{description:"Manage workspace package versions",category:"Release",load:()=>import("./chunks/versions-KW5UTMNV.js")},"changelog-gen":{description:"Generate CHANGELOG from commits",category:"Release",load:()=>import("./chunks/changelog-gen-LV5VWTZS.js")},release:{description:"Create a release (bump, changelog, commit, push)",category:"Release",load:()=>import("./chunks/release-6PVE4O6P.js")},rerelease:{description:"Delete and recreate the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-6PVE4O6P.js")).rereleaseMain})},unrelease:{description:"Delete the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-6PVE4O6P.js")).unreleaseMain})},"validate-eof":{description:"Ensure files end with newline",category:"Validation",load:()=>import("./chunks/validate-eof-6RMNMAWI.js")},"validate-trailing-whitespace":{description:"Remove trailing whitespace",category:"Validation",load:()=>import("./chunks/validate-trailing-whitespace-RO42VWQG.js")},"validate-bom":{description:"Remove UTF-8 byte order markers",category:"Validation",load:()=>import("./chunks/validate-bom-6G7EYFOP.js")},"validate-line-endings":{description:"Normalize line endings to LF",category:"Validation",load:()=>import("./chunks/validate-line-endings-KNFYAVBG.js")},"validate-large-files":{description:"Detect files exceeding size limit",category:"Validation",load:()=>import("./chunks/validate-large-files-KEMHYWKH.js")},"validate-case-conflict":{description:"Detect case-conflicting filenames",category:"Validation",load:()=>import("./chunks/validate-case-conflict-OWHWRTSQ.js")},"validate-merge-conflict":{description:"Detect merge conflict markers",category:"Validation",load:()=>import("./chunks/validate-merge-conflict-PYKGIFY5.js")},"validate-json":{description:"Validate JSON syntax",category:"Validation",load:()=>import("./chunks/validate-json-6CLTN4AN.js")},"validate-toml":{description:"Validate TOML syntax",category:"Validation",load:()=>import("./chunks/validate-toml-KJZK7QVM.js")},"validate-yaml":{description:"Validate YAML syntax",category:"Validation",load:()=>import("./chunks/validate-yaml-H7G726ZM.js")},"validate-symlinks":{description:"Detect broken symlinks",category:"Validation",load:()=>import("./chunks/validate-symlinks-IPRYMDZD.js")},"validate-shebangs":{description:"Validate shebang consistency",category:"Validation",load:()=>import("./chunks/validate-shebangs-MP6VTLWO.js")},"validate-secrets":{description:"Detect credentials and private keys",category:"Validation",load:()=>import("./chunks/validate-secrets-BWDFWN64.js")},"validate-filenames":{description:"Enforce filename conventions",category:"Validation",load:()=>import("./chunks/validate-filenames-5YB27RN4.js")},"validate-submodules":{description:"Detect git submodules",category:"Validation",load:()=>import("./chunks/validate-submodules-RQXISWKG.js")},"validate-commit-msg":{description:"Validate conventional commit format",category:"Validation",load:()=>import("./chunks/validate-commit-msg-UPJJ7E4M.js")},"validate-docs":{description:"Validate JSDoc documentation",category:"Validation",load:()=>import("./chunks/validate-docs-ZTCE5XLF.js")},"validate-circular-deps":{description:"Detect circular dependencies",category:"Validation",load:()=>import("./chunks/validate-circular-deps-TCYSZKME.js")},"validate-export-names":{description:"Validate export naming conventions",category:"Validation",load:()=>import("./chunks/validate-export-names-5ZVQ4PGM.js")},"validate-licenses":{description:"Validate license headers",category:"Validation",load:()=>import("./chunks/validate-licenses-WIVY6G5Z.js")},"validate-mod-exports":{description:"Validate mod.ts export coverage",category:"Validation",load:()=>import("./chunks/validate-mod-exports-X5UZPD7J.js")},"validate-package-configs":{description:"Validate package configurations",category:"Validation",load:()=>import("./chunks/validate-package-configs-SYKEIB53.js")}},aliases:{init:"scaffolding"}});var l=e=>new o({description:"Workflow engine \u2014 run tool pipelines",modules:{run:{description:"Run workflows by event or id",load:async()=>{let t=await import("./chunks/run-ES4BLQQX.js");return{main:r=>t.main(r,{tools:e??[]})}}},list:{description:"List available workflows and tools",load:async()=>{let t=await import("./chunks/list-DSVIPH45.js");return{main:r=>t.main(r,{tools:e??[]})}}}}}),R=l();var y=new o({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-3GXDO32O.js")},status:{description:"Show current state",load:()=>import("./chunks/status-CY5IKIYS.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-SNAUMQSR.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-F2BIIAZC.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-5NJ4JWD3.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-ADHHHUFZ.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-PAPDZIDC.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-OAPV43JS.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-4GNOR3GE.js")}}});var w=new o({description:"laroux.js framework commands",modules:{init:{description:"Create a new laroux.js project",load:()=>import("./chunks/init-IPZHDMAH.js"),flags:[{name:"template",short:"t",type:"string",description:"Project template (minimal, blog, dashboard, docs)",default:"minimal"},{name:"force",short:"f",type:"boolean",description:"Overwrite existing files"},{name:"no-git",type:"boolean",description:"Skip git initialization"},{name:"no-install",type:"boolean",description:"Skip dependency installation"}]},dev:{description:"Start development server with hot reload",load:()=>import("./chunks/dev-JHAHGTZP.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"no-hmr",type:"boolean",description:"Disable hot module replacement"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"},{name:"open",short:"o",type:"boolean",description:"Open browser automatically"}]},build:{description:"Build for production",load:()=>import("./chunks/build-2W7YVR7J.js"),flags:[{name:"out-dir",type:"string",description:"Output directory",default:"dist"},{name:"clean",type:"boolean",description:"Clean output directory first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]},serve:{description:"Serve production build locally",load:()=>import("./chunks/serve-B4V2BCWM.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]}}});var i=new o({description:"Terminal client for Eser's work"});i.addSubmodule({name:"ai"},m);i.addSubmodule({name:"kit"},g);i.addSubmodule({name:"codebase",aliases:["cb","."]},f);await i.addSubmoduleAsync({name:"workflows",aliases:["wf"]},(async()=>{let{getWorkflowTools:e}=await import("./chunks/mod-QJMMYECF.js");return l(e())})());i.addSubmodule({name:"noskills",aliases:["nos"]},y);i.addSubmodule({name:"laroux"},w);var k=i.toCommand("eser",u.version).lazyCommand("system",{description:"Commands related with this CLI",load:async()=>(await import("./chunks/system-5LLFPIWV.js")).systemCommand}).lazyCommand("install",{description:"Install eser CLI globally (alias for system install)",load:async()=>{let e=await import("./chunks/mod-T76TRJWM.js");return new a("install").run(e.installHandler)}}).lazyCommand("update",{description:"Update eser CLI to latest version (alias for system update)",load:async()=>{let e=await import("./chunks/mod-T76TRJWM.js");return new a("update").run(e.updateHandler)}}).lazyCommand("version",{description:"Show version number",load:async()=>{let e=await import("./chunks/mod-T76TRJWM.js");return new a("version").flag({name:"bare",type:"boolean",description:"Print raw version only"}).run(e.versionHandler)}}).lazyCommand("doctor",{description:"Run diagnostic checks",load:async()=>{let e=await import("./chunks/mod-T76TRJWM.js");return new a("doctor").run(e.doctorHandler)}}).fallback(async(e,t)=>{let n=(await(await import("./chunks/manifest-5CYL3HR3.js")).loadManifest("."))?.scripts;if(n!=null&&typeof n=="object"){let s=n;if(e in s){let b=s[e],{runScript:v}=await import("./chunks/scripts-COIXD5AD.js");return await v(e,b,s,t)}}return console.error(`Unknown subcommand "${e}"`),d({exitCode:1})}),h=async()=>await k.parse();if(import.meta.main){let e=await h();c(e,{ok:()=>{},fail:t=>{t.message!==void 0&&console.error(t.message),p.process.setExitCode(t.exitCode)}})}export{h as main};
2
+ import{a as u}from"./chunks/chunk-EBYJBBYV.js";import{a as m}from"./chunks/chunk-RYLOB2JU.js";import"./chunks/chunk-ZOZYBQX2.js";import{a as o}from"./chunks/chunk-UNL4H5EY.js";import{b as a}from"./chunks/chunk-DWYVBWBP.js";import"./chunks/chunk-HPPFA3XU.js";import{b as d,e as c}from"./chunks/chunk-DQAEQEXD.js";import{t as p}from"./chunks/chunk-YXSB6RET.js";import"./chunks/chunk-SG4G3OOO.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var g=new o({description:"Kit \u2014 recipes, templates, project creation",modules:{add:{description:"Add a recipe to your project",category:"Distribution",load:()=>import("./chunks/add-ORJYWG26.js")},list:{description:"Browse available recipes and templates",category:"Distribution",load:()=>import("./chunks/list-2RZIQZGH.js")},new:{description:"Create a new project from a template",category:"Distribution",load:()=>import("./chunks/new-EAETGSIR.js")},clone:{description:"Clone a recipe from any GitHub repo",category:"Distribution",load:()=>import("./chunks/clone-PAQMCIA3.js")},update:{description:"Re-fetch and update an applied recipe",category:"Distribution",load:()=>import("./chunks/update-O75M4SDJ.js")}},aliases:{create:"new"}});var f=new o({description:"Codebase management tools",modules:{scaffolding:{description:"Initialize project from template",category:"Setup",load:()=>import("./chunks/mod-NSY6WUYH.js")},install:{description:"Install git hooks from .manifest.yml",category:"Setup",load:()=>import("./chunks/install-VY2L6NDB.js")},uninstall:{description:"Remove managed git hooks",category:"Setup",load:async()=>({main:(await import("./chunks/install-VY2L6NDB.js")).uninstallMain})},status:{description:"Show git hook installation status",category:"Setup",load:async()=>({main:(await import("./chunks/install-VY2L6NDB.js")).statusMain})},commitmsg:{description:"Generate commit message from git diff",category:"AI",load:()=>import("./chunks/commitmsg-ZGOEO5YG.js")},gh:{description:"GitHub operations (contributors, releases, tags)",category:"GitHub",load:()=>import("./chunks/gh-SXEDNWHD.js")},versions:{description:"Manage workspace package versions",category:"Release",load:()=>import("./chunks/versions-KW5UTMNV.js")},"changelog-gen":{description:"Generate CHANGELOG from commits",category:"Release",load:()=>import("./chunks/changelog-gen-QDUA5G5K.js")},release:{description:"Create a release (bump, changelog, commit, push)",category:"Release",load:()=>import("./chunks/release-3BKLVESS.js")},rerelease:{description:"Delete and recreate the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-3BKLVESS.js")).rereleaseMain})},unrelease:{description:"Delete the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-3BKLVESS.js")).unreleaseMain})},"validate-eof":{description:"Ensure files end with newline",category:"Validation",load:()=>import("./chunks/validate-eof-6RMNMAWI.js")},"validate-trailing-whitespace":{description:"Remove trailing whitespace",category:"Validation",load:()=>import("./chunks/validate-trailing-whitespace-RO42VWQG.js")},"validate-bom":{description:"Remove UTF-8 byte order markers",category:"Validation",load:()=>import("./chunks/validate-bom-6G7EYFOP.js")},"validate-line-endings":{description:"Normalize line endings to LF",category:"Validation",load:()=>import("./chunks/validate-line-endings-KNFYAVBG.js")},"validate-large-files":{description:"Detect files exceeding size limit",category:"Validation",load:()=>import("./chunks/validate-large-files-KEMHYWKH.js")},"validate-case-conflict":{description:"Detect case-conflicting filenames",category:"Validation",load:()=>import("./chunks/validate-case-conflict-OWHWRTSQ.js")},"validate-merge-conflict":{description:"Detect merge conflict markers",category:"Validation",load:()=>import("./chunks/validate-merge-conflict-PYKGIFY5.js")},"validate-json":{description:"Validate JSON syntax",category:"Validation",load:()=>import("./chunks/validate-json-6CLTN4AN.js")},"validate-toml":{description:"Validate TOML syntax",category:"Validation",load:()=>import("./chunks/validate-toml-KJZK7QVM.js")},"validate-yaml":{description:"Validate YAML syntax",category:"Validation",load:()=>import("./chunks/validate-yaml-H7G726ZM.js")},"validate-symlinks":{description:"Detect broken symlinks",category:"Validation",load:()=>import("./chunks/validate-symlinks-IPRYMDZD.js")},"validate-shebangs":{description:"Validate shebang consistency",category:"Validation",load:()=>import("./chunks/validate-shebangs-MP6VTLWO.js")},"validate-secrets":{description:"Detect credentials and private keys",category:"Validation",load:()=>import("./chunks/validate-secrets-BWDFWN64.js")},"validate-filenames":{description:"Enforce filename conventions",category:"Validation",load:()=>import("./chunks/validate-filenames-5YB27RN4.js")},"validate-submodules":{description:"Detect git submodules",category:"Validation",load:()=>import("./chunks/validate-submodules-RQXISWKG.js")},"validate-commit-msg":{description:"Validate conventional commit format",category:"Validation",load:()=>import("./chunks/validate-commit-msg-UPJJ7E4M.js")},"validate-docs":{description:"Validate JSDoc documentation",category:"Validation",load:()=>import("./chunks/validate-docs-ZTCE5XLF.js")},"validate-circular-deps":{description:"Detect circular dependencies",category:"Validation",load:()=>import("./chunks/validate-circular-deps-TCYSZKME.js")},"validate-export-names":{description:"Validate export naming conventions",category:"Validation",load:()=>import("./chunks/validate-export-names-5ZVQ4PGM.js")},"validate-licenses":{description:"Validate license headers",category:"Validation",load:()=>import("./chunks/validate-licenses-WIVY6G5Z.js")},"validate-mod-exports":{description:"Validate mod.ts export coverage",category:"Validation",load:()=>import("./chunks/validate-mod-exports-X5UZPD7J.js")},"validate-package-configs":{description:"Validate package configurations",category:"Validation",load:()=>import("./chunks/validate-package-configs-SYKEIB53.js")}},aliases:{init:"scaffolding"}});var l=e=>new o({description:"Workflow engine \u2014 run tool pipelines",modules:{run:{description:"Run workflows by event or id",load:async()=>{let t=await import("./chunks/run-ES4BLQQX.js");return{main:r=>t.main(r,{tools:e??[]})}}},list:{description:"List available workflows and tools",load:async()=>{let t=await import("./chunks/list-DSVIPH45.js");return{main:r=>t.main(r,{tools:e??[]})}}}}}),R=l();var y=new o({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-3GXDO32O.js")},status:{description:"Show current state",load:()=>import("./chunks/status-CY5IKIYS.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-SNAUMQSR.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-F2BIIAZC.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-5NJ4JWD3.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-ADHHHUFZ.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-PAPDZIDC.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-OAPV43JS.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-4GNOR3GE.js")}}});var w=new o({description:"laroux.js framework commands",modules:{init:{description:"Create a new laroux.js project",load:()=>import("./chunks/init-IPZHDMAH.js"),flags:[{name:"template",short:"t",type:"string",description:"Project template (minimal, blog, dashboard, docs)",default:"minimal"},{name:"force",short:"f",type:"boolean",description:"Overwrite existing files"},{name:"no-git",type:"boolean",description:"Skip git initialization"},{name:"no-install",type:"boolean",description:"Skip dependency installation"}]},dev:{description:"Start development server with hot reload",load:()=>import("./chunks/dev-JHAHGTZP.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"no-hmr",type:"boolean",description:"Disable hot module replacement"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"},{name:"open",short:"o",type:"boolean",description:"Open browser automatically"}]},build:{description:"Build for production",load:()=>import("./chunks/build-2W7YVR7J.js"),flags:[{name:"out-dir",type:"string",description:"Output directory",default:"dist"},{name:"clean",type:"boolean",description:"Clean output directory first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]},serve:{description:"Serve production build locally",load:()=>import("./chunks/serve-B4V2BCWM.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]}}});var i=new o({description:"Terminal client for Eser's work"});i.addSubmodule({name:"ai"},m);i.addSubmodule({name:"kit"},g);i.addSubmodule({name:"codebase",aliases:["cb","."]},f);await i.addSubmoduleAsync({name:"workflows",aliases:["wf"]},(async()=>{let{getWorkflowTools:e}=await import("./chunks/mod-QJMMYECF.js");return l(e())})());i.addSubmodule({name:"noskills",aliases:["nos"]},y);i.addSubmodule({name:"laroux"},w);var k=i.toCommand("eser",u.version).lazyCommand("system",{description:"Commands related with this CLI",load:async()=>(await import("./chunks/system-JWO27FMA.js")).systemCommand}).lazyCommand("install",{description:"Install eser CLI globally (alias for system install)",load:async()=>{let e=await import("./chunks/mod-WX4P6LGJ.js");return new a("install").run(e.installHandler)}}).lazyCommand("update",{description:"Update eser CLI to latest version (alias for system update)",load:async()=>{let e=await import("./chunks/mod-WX4P6LGJ.js");return new a("update").run(e.updateHandler)}}).lazyCommand("version",{description:"Show version number",load:async()=>{let e=await import("./chunks/mod-WX4P6LGJ.js");return new a("version").flag({name:"bare",type:"boolean",description:"Print raw version only"}).run(e.versionHandler)}}).lazyCommand("doctor",{description:"Run diagnostic checks",load:async()=>{let e=await import("./chunks/mod-WX4P6LGJ.js");return new a("doctor").run(e.doctorHandler)}}).fallback(async(e,t)=>{let n=(await(await import("./chunks/manifest-5CYL3HR3.js")).loadManifest("."))?.scripts;if(n!=null&&typeof n=="object"){let s=n;if(e in s){let b=s[e],{runScript:v}=await import("./chunks/scripts-COIXD5AD.js");return await v(e,b,s,t)}}return console.error(`Unknown subcommand "${e}"`),d({exitCode:1})}),h=async()=>await k.parse();if(import.meta.main){let e=await h();c(e,{ok:()=>{},fail:t=>{t.message!==void 0&&console.error(t.message),p.process.setExitCode(t.exitCode)}})}export{h as main};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eser",
3
- "version": "4.1.26",
3
+ "version": "4.1.27",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "eser": "./eser.js"
@@ -1,7 +0,0 @@
1
- import{a as $,b as G}from"./chunk-C3PZVQ3Z.js";import{a as N}from"./chunk-RBB5ITAS.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as E}from"./chunk-6U2VEZEM.js";import{a as w,b as A}from"./chunk-KAEAT6A4.js";import"./chunk-ZH37DSUQ.js";import"./chunk-LOFP256P.js";import"./chunk-ZF2XYULB.js";import"./chunk-4S7QYPS6.js";import{f as R}from"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import"./chunk-2J2PXBOC.js";import"./chunk-TTYO2XJO.js";import"./chunk-USCAYIWL.js";import{b as u,e as h,f as y,g as v,h as x}from"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import{a as C}from"./chunk-HPPFA3XU.js";import{g as p}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{v as m}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var f=w(),S={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},O=new Set(["chore","ci","test"]),T=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}(.+)$/,P=/\s{0,100}\(take\s{1,100}[IVXLCDM\d]+\)\s{0,100}\.?$/i,I=(n,t)=>{let o=n.match(T);if(o!==null)return{type:o[1].toLowerCase(),scope:o[2],message:o[3].trim(),hash:t}},b=n=>n.replace(P,"").trim(),k=n=>{let t=[];for(let o of n){let e=I(o.subject,o.hash);e!==void 0&&t.push(e)}return t},L=n=>{let t=new Set,o=[];for(let e of n){let s=b(e.message),a=s.replace(/[.\s]{1,20}$/,"").toLowerCase(),l=`${e.type}:${a}`;t.has(l)||(t.add(l),o.push({...e,message:s}))}return o},M=n=>{let t=new Map;for(let o of n){if(O.has(o.type))continue;let e=S[o.type];if(e===void 0)continue;let s=t.get(e);s!==void 0?s.push(o):t.set(e,[o])}return t},H=n=>n.scope!==void 0?`- **${n.scope}:** ${n.message}`:`- ${n.message}`,F=(n,t)=>{let o=M(t);if(o.size===0)return"";let e=new Date().toISOString().split("T")[0],s=[`## ${n} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let r=o.get(l);if(!(r===void 0||r.length===0)){s.push("",`### ${l}`,"");for(let d of r)s.push(H(d))}}return s.join(`
2
- `)},j=(n,t,o)=>{let e=n.split(`
3
- `);if(o!==void 0){let r=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`^##\\s+${r}\\b`),i=e.findIndex(g=>d.test(g));if(i!==-1){let g=e.length;for(let c=i+1;c<e.length;c++)if(/^##\s+/.test(e[c])){g=c;break}return e.splice(i,g-i,t),e.join(`
4
- `)}}let s=e.findIndex(r=>/^##\s+\[Unreleased\]/i.test(r));if(s===-1){let r=e.findIndex((i,g)=>g>0&&i.startsWith("## ")),d=r===-1?e.length:r;return e.splice(d,0,"",t,""),e.join(`
5
- `)}let a=-1;for(let r=s+1;r<e.length;r++)if(/^##\s+/.test(e[r])){a=r;break}let l=a===-1?e.length:a;return e.splice(l,0,t,""),e.join(`
6
- `)},V=async(n={})=>{let{root:t=".",dryRun:o=!1}=n,e=await N({root:t});if(e===void 0||e==="")throw new Error("VERSION file is missing or empty.");let s;try{s=await $()}catch{throw new Error("No git tags found. Create an initial tag first (e.g., git tag v0.0.0).")}let a=await G(s,"HEAD");if(a.length===0)throw new Error(`No commits found since ${s}. Nothing to release.`);let l=k(a),r=L(l),d=F(e,r);if(d==="")throw new Error("No user-facing changes found (all commits are chore/ci/test). Nothing to add to CHANGELOG.");if(!o){let i=m.runtime.path.join(t,"CHANGELOG.md"),g;try{g=await m.runtime.fs.readTextFile(i)}catch{throw new Error(`CHANGELOG.md not found at ${i}. Create one first.`)}let c=j(g,d,e);await m.runtime.fs.writeTextFile(i,c)}return{version:e,commitCount:a.length,entryCount:r.filter(i=>!O.has(i.type)).length,content:d,dryRun:o}},D=n=>R.fromPromise(()=>V(n)),_=n=>p.ok({dryRun:n.flags["dry-run"]===!0}),z=n=>{if(p.isFail(n))return f.writeln(h("\u2717"),u(" "+(n.error instanceof Error?n.error.message:String(n.error)))),p.fail({exitCode:1});let{value:t}=n;return t.dryRun?(f.writeln(v("\u26A0"),u(" [DRY RUN] Generated changelog preview:")),f.writeln(x("\u2139"),u(`
7
- ${t.content}`))):f.writeln(y("\u2713"),u(` Added ${t.entryCount} entries to CHANGELOG.md for v${t.version}`)),p.ok(void 0)},B=E.createTrigger({handler:D,adaptInput:_,adaptOutput:z}),ee=async n=>{let t=C(n??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),o=A("changelog-gen",t);return await B(o)};export{L as deduplicateCommits,V as generateChangelog,D as generateChangelogHandler,F as generateChangelogSection,M as groupBySection,B as handleCli,j as insertIntoChangelog,ee as main,I as parseConventionalCommit,k as parseConventionalCommits,b as stripTakeSuffix};