@ahmadjavaiddev/aura 0.0.1

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 (3) hide show
  1. package/README.md +124 -0
  2. package/dist/index.js +1177 -0
  3. package/package.json +29 -0
package/dist/index.js ADDED
@@ -0,0 +1,1177 @@
1
+ #!/usr/bin/env node
2
+ var Zr=Object.create;var{getPrototypeOf:Vr,defineProperty:ae,getOwnPropertyNames:Kr}=Object;var Xr=Object.prototype.hasOwnProperty;function Fr(r){return this[r]}var Qr,Dr,k=(r,t,o)=>{var i=r!=null&&typeof r==="object";if(i){var n=t?Qr??=new WeakMap:Dr??=new WeakMap,a=n.get(r);if(a)return a}o=r!=null?Zr(Vr(r)):{};let e=t||!r||!r.__esModule?ae(o,"default",{value:r,enumerable:!0}):o;for(let c of Kr(r))if(!Xr.call(e,c))ae(e,c,{get:Fr.bind(r,c),enumerable:!0});if(i)n.set(r,e);return e};var ce=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var W=ce(($t,me)=>{var j={to(r,t){if(!t)return`\x1B[${r+1}G`;return`\x1B[${t+1};${r+1}H`},move(r,t){let o="";if(r<0)o+=`\x1B[${-r}D`;else if(r>0)o+=`\x1B[${r}C`;if(t<0)o+=`\x1B[${-t}A`;else if(t>0)o+=`\x1B[${t}B`;return o},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},et={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},rt={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let t="";for(let o=0;o<r;o++)t+=this.line+(o<r-1?j.up():"");if(r)t+=j.left;return t}};me.exports={cursor:j,scroll:et,erase:rt,beep:"\x07"}});var J=ce((qt,Y)=>{var B=process||{},le=B.argv||[],M=B.env||{},tt=!(!!M.NO_COLOR||le.includes("--no-color"))&&(!!M.FORCE_COLOR||le.includes("--color")||B.platform==="win32"||(B.stdout||{}).isTTY&&M.TERM!=="dumb"||!!M.CI),ot=(r,t,o=r)=>(i)=>{let n=""+i,a=n.indexOf(t,r.length);return~a?r+nt(n,t,o,a)+t:r+n+t},nt=(r,t,o,i)=>{let n="",a=0;do n+=r.substring(a,i)+o,a=i+t.length,i=r.indexOf(t,a);while(~i);return n+r.substring(a)},pe=(r=tt)=>{let t=r?ot:()=>String;return{isColorSupported:r,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Y.exports=pe();Y.exports.createColors=pe});var E=k(W(),1),z=k(J(),1);import{stdin as ye,stdout as Ie}from"node:process";import*as f from"node:readline";import de from"node:readline";import{WriteStream as it}from"node:tty";function st({onlyFirst:r=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,r?void 0:"g")}var at=st();function fe(r){if(typeof r!="string")throw TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(at,"")}function _e(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ae={exports:{}};(function(r){var t={};r.exports=t,t.eastAsianWidth=function(i){var n=i.charCodeAt(0),a=i.length==2?i.charCodeAt(1):0,e=n;return 55296<=n&&n<=56319&&56320<=a&&a<=57343&&(n&=1023,a&=1023,e=n<<10|a,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},t.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function o(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(i){for(var n=o(i),a=0,e=0;e<n.length;e++)a=a+this.characterLength(n[e]);return a},t.slice=function(i,n,a){textLen=t.length(i),n=n||0,a=a||1,n<0&&(n=textLen+n),a<0&&(a=textLen+a);for(var e="",c=0,d=o(i),u=0;u<d.length;u++){var l=d[u],m=t.length(l);if(c>=n-(m==2?1:0))if(c+m<=a)e+=l;else break;c+=m}return e}})(Ae);var ct=Ae.exports,mt=_e(ct),lt=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},pt=_e(lt);function C(r,t={}){if(typeof r!="string"||r.length===0||(t={ambiguousIsNarrow:!0,...t},r=fe(r),r.length===0))return 0;r=r.replace(pt()," ");let o=t.ambiguousIsNarrow?1:2,i=0;for(let n of r){let a=n.codePointAt(0);if(a<=31||a>=127&&a<=159||a>=768&&a<=879)continue;switch(mt.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=o;break;default:i+=1}}return i}var Z=10,ue=(r=0)=>(t)=>`\x1B[${t+r}m`,be=(r=0)=>(t)=>`\x1B[${38+r};5;${t}m`,ge=(r=0)=>(t,o,i)=>`\x1B[${38+r};2;${t};${o};${i}m`,g={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(g.modifier);var dt=Object.keys(g.color),ut=Object.keys(g.bgColor);[...dt,...ut];function bt(){let r=new Map;for(let[t,o]of Object.entries(g)){for(let[i,n]of Object.entries(o))g[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},o[i]=g[i],r.set(n[0],n[1]);Object.defineProperty(g,t,{value:o,enumerable:!1})}return Object.defineProperty(g,"codes",{value:r,enumerable:!1}),g.color.close="\x1B[39m",g.bgColor.close="\x1B[49m",g.color.ansi=ue(),g.color.ansi256=be(),g.color.ansi16m=ge(),g.bgColor.ansi=ue(Z),g.bgColor.ansi256=be(Z),g.bgColor.ansi16m=ge(Z),Object.defineProperties(g,{rgbToAnsi256:{value:(t,o,i)=>t===o&&o===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:(t)=>{let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!o)return[0,0,0];let[i]=o;i.length===3&&(i=[...i].map((a)=>a+a).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:(t)=>g.rgbToAnsi256(...g.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:(t)=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let o,i,n;if(t>=232)o=((t-232)*10+8)/255,i=o,n=o;else{t-=16;let c=t%36;o=Math.floor(t/36)/5,i=Math.floor(c/6)/5,n=c%6/5}let a=Math.max(o,i,n)*2;if(a===0)return 30;let e=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(o));return a===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(t,o,i)=>g.ansi256ToAnsi(g.rgbToAnsi256(t,o,i)),enumerable:!1},hexToAnsi:{value:(t)=>g.ansi256ToAnsi(g.hexToAnsi256(t)),enumerable:!1}}),g}var gt=bt(),H=new Set(["\x1B","›"]),ht=39,K="\x07",Ne="[",xt="]",Oe="m",X=`${xt}8;;`,he=(r)=>`${H.values().next().value}${Ne}${r}${Oe}`,xe=(r)=>`${H.values().next().value}${X}${r}${K}`,Et=(r)=>r.split(" ").map((t)=>C(t)),V=(r,t,o)=>{let i=[...t],n=!1,a=!1,e=C(fe(r[r.length-1]));for(let[c,d]of i.entries()){let u=C(d);if(e+u<=o?r[r.length-1]+=d:(r.push(d),e=0),H.has(d)&&(n=!0,a=i.slice(c+1).join("").startsWith(X)),n){a?d===K&&(n=!1,a=!1):d===Oe&&(n=!1);continue}e+=u,e===o&&c<i.length-1&&(r.push(""),e=0)}!e&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},vt=(r)=>{let t=r.split(" "),o=t.length;for(;o>0&&!(C(t[o-1])>0);)o--;return o===t.length?r:t.slice(0,o).join(" ")+t.slice(o).join("")},St=(r,t,o={})=>{if(o.trim!==!1&&r.trim()==="")return"";let i="",n,a,e=Et(r),c=[""];for(let[u,l]of r.split(" ").entries()){o.trim!==!1&&(c[c.length-1]=c[c.length-1].trimStart());let m=C(c[c.length-1]);if(u!==0&&(m>=t&&(o.wordWrap===!1||o.trim===!1)&&(c.push(""),m=0),(m>0||o.trim===!1)&&(c[c.length-1]+=" ",m++)),o.hard&&e[u]>t){let p=t-m,x=1+Math.floor((e[u]-p-1)/t);Math.floor((e[u]-1)/t)<x&&c.push(""),V(c,l,t);continue}if(m+e[u]>t&&m>0&&e[u]>0){if(o.wordWrap===!1&&m<t){V(c,l,t);continue}c.push("")}if(m+e[u]>t&&o.wordWrap===!1){V(c,l,t);continue}c[c.length-1]+=l}o.trim!==!1&&(c=c.map((u)=>vt(u)));let d=[...c.join(`
3
+ `)];for(let[u,l]of d.entries()){if(i+=l,H.has(l)){let{groups:p}=new RegExp(`(?:\\${Ne}(?<code>\\d+)m|\\${X}(?<uri>.*)${K})`).exec(d.slice(u).join(""))||{groups:{}};if(p.code!==void 0){let x=Number.parseFloat(p.code);n=x===ht?void 0:x}else p.uri!==void 0&&(a=p.uri.length===0?void 0:p.uri)}let m=gt.codes.get(Number(n));d[u+1]===`
4
+ `?(a&&(i+=xe("")),n&&m&&(i+=he(m))):l===`
5
+ `&&(n&&m&&(i+=he(n)),a&&(i+=xe(a)))}return i};function Ee(r,t,o){return String(r).normalize().replace(/\r\n/g,`
6
+ `).split(`
7
+ `).map((i)=>St(i,t,o)).join(`
8
+ `)}var Rt=Object.defineProperty,yt=(r,t,o)=>(t in r)?Rt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,S=(r,t,o)=>(yt(r,typeof t!="symbol"?t+"":t,o),o);function It(r,t){if(r===t)return;let o=r.split(`
9
+ `),i=t.split(`
10
+ `),n=[];for(let a=0;a<Math.max(o.length,i.length);a++)o[a]!==i[a]&&n.push(a);return n}var we=Symbol("clack:cancel");function O(r){return r===we}function G(r,t){r.isTTY&&r.setRawMode(t)}var ve=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),ft=new Set(["up","down","left","right","space","enter"]);class P{constructor({render:r,input:t=ye,output:o=Ie,...i},n=!0){S(this,"input"),S(this,"output"),S(this,"rl"),S(this,"opts"),S(this,"_track",!1),S(this,"_render"),S(this,"_cursor",0),S(this,"state","initial"),S(this,"value"),S(this,"error",""),S(this,"subscribers",new Map),S(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=n,this.input=t,this.output=o}prompt(){let r=new it(0);return r._write=(t,o,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(r),this.rl=de.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),de.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),G(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((t,o)=>{this.once("submit",()=>{this.output.write(E.cursor.show),this.output.off("resize",this.render),G(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(E.cursor.show),this.output.off("resize",this.render),G(this.input,!1),t(we)})})}on(r,t){let o=this.subscribers.get(r)??[];o.push({cb:t}),this.subscribers.set(r,o)}once(r,t){let o=this.subscribers.get(r)??[];o.push({cb:t,once:!0}),this.subscribers.set(r,o)}emit(r,...t){let o=this.subscribers.get(r)??[],i=[];for(let n of o)n.cb(...t),n.once&&i.push(()=>o.splice(o.indexOf(n),1));for(let n of i)n()}unsubscribe(){this.subscribers.clear()}onKeypress(r,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&ve.has(t.name)&&this.emit("cursor",ve.get(t.name)),t?.name&&ft.has(t.name)&&this.emit("cursor",t.name),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r==="\t"&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),t?.name==="return"){if(this.opts.validate){let o=this.opts.validate(this.value);o&&(this.error=o,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}r==="\x03"&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
11
+ `),G(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=Ee(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
12
+ `).length-1;this.output.write(E.cursor.move(-999,r*-1))}render(){let r=Ee(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(E.cursor.hide);else{let t=It(this._prevFrame,r);if(this.restoreCursor(),t&&t?.length===1){let o=t[0];this.output.write(E.cursor.move(0,o)),this.output.write(E.erase.lines(1));let i=r.split(`
13
+ `);this.output.write(i[o]),this._prevFrame=r,this.output.write(E.cursor.move(0,i.length-o-1));return}else if(t&&t?.length>1){let o=t[0];this.output.write(E.cursor.move(0,o)),this.output.write(E.erase.down());let i=r.split(`
14
+ `).slice(o);this.output.write(i.join(`
15
+ `)),this._prevFrame=r;return}this.output.write(E.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}class F extends P{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(r){super(r,!1),this.value=!!r.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(t)=>{this.output.write(E.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var _t=Object.defineProperty,At=(r,t,o)=>(t in r)?_t(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,Se=(r,t,o)=>(At(r,typeof t!="symbol"?t+"":t,o),o),Te=class extends P{constructor(r){super(r,!1),Se(this,"options"),Se(this,"cursor",0),this.options=r.options,this.value=[...r.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===r.cursorAt),0),this.on("key",(t)=>{t==="a"&&this.toggleAll()}),this.on("cursor",(t)=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let r=this.value.length===this.options.length;this.value=r?[]:this.options.map((t)=>t.value)}toggleValue(){let r=this.value.includes(this._value);this.value=r?this.value.filter((t)=>t!==this._value):[...this.value,this._value]}};var Nt=Object.defineProperty,Ot=(r,t,o)=>(t in r)?Nt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,Re=(r,t,o)=>(Ot(r,typeof t!="symbol"?t+"":t,o),o),Ce=class extends P{constructor(r){super(r,!1),Re(this,"options"),Re(this,"cursor",0),this.options=r.options,this.cursor=this.options.findIndex(({value:t})=>t===r.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(t)=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var wt=Object.defineProperty,Tt=(r,t,o)=>(t in r)?wt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,Ct=(r,t,o)=>(Tt(r,typeof t!="symbol"?t+"":t,o),o);class Q extends P{constructor(r){super(r),Ct(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=r.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${z.default.inverse(z.default.hidden("_"))}`;else{let t=this.value.slice(0,this.cursor),o=this.value.slice(this.cursor);this.valueWithCursor=`${t}${z.default.inverse(o[0])}${o.slice(1)}`}})}get cursor(){return this._cursor}}var Pt=globalThis.process.platform.startsWith("win");function Pe({input:r=ye,output:t=Ie,overwrite:o=!0,hideCursor:i=!0}={}){let n=f.createInterface({input:r,output:t,prompt:"",tabSize:1});f.emitKeypressEvents(r,n),r.isTTY&&r.setRawMode(!0);let a=(e,{name:c})=>{if(String(e)==="\x03"){i&&t.write(E.cursor.show),process.exit(0);return}if(!o)return;f.moveCursor(t,c==="return"?0:-1,c==="return"?-1:0,()=>{f.clearLine(t,1,()=>{r.once("keypress",a)})})};return i&&t.write(E.cursor.hide),r.once("keypress",a),()=>{r.off("keypress",a),i&&t.write(E.cursor.show),r.isTTY&&!Pt&&r.setRawMode(!1),n.terminal=!1,n.close()}}var s=k(J(),1),w=k(W(),1);import y from"node:process";function Lt(){return y.platform!=="win32"?y.env.TERM!=="linux":!!y.env.CI||!!y.env.WT_SESSION||!!y.env.TERMINUS_SUBLIME||y.env.ConEmuTask==="{cmd::Cmder}"||y.env.TERM_PROGRAM==="Terminus-Sublime"||y.env.TERM_PROGRAM==="vscode"||y.env.TERM==="xterm-256color"||y.env.TERM==="alacritty"||y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var D=Lt(),h=(r,t)=>D?r:t,kt=h("◆","*"),ke=h("■","x"),Me=h("▲","x"),Be=h("◇","o"),Mt=h("┌","T"),b=h("│","|"),_=h("└","—"),ee=h("●",">"),re=h("○"," "),Bt=h("◻","[•]"),Le=h("◼","[+]"),Gt=h("◻","[ ]"),eo=h("▪","•"),ro=h("─","-"),to=h("╮","+"),oo=h("├","+"),no=h("╯","+"),io=h("●","•"),so=h("◆","*"),ao=h("▲","!"),co=h("■","x"),U=(r)=>{switch(r){case"initial":case"active":return s.default.cyan(kt);case"cancel":return s.default.red(ke);case"error":return s.default.yellow(Me);case"submit":return s.default.green(Be)}},te=(r)=>{let{cursor:t,options:o,style:i}=r,n=r.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),e=Math.min(a,Math.max(n,5)),c=0;t>=c+e-3?c=Math.max(Math.min(t-e+3,o.length-e),0):t<c+2&&(c=Math.max(t-2,0));let d=e<o.length&&c>0,u=e<o.length&&c+e<o.length;return o.slice(c,c+e).map((l,m,p)=>{let x=m===0&&d,v=m===p.length-1&&u;return x||v?s.default.dim("..."):i(l,m+c===t)})},Ge=(r)=>new Q({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let t=`${s.default.gray(b)}
16
+ ${U(this.state)} ${r.message}
17
+ `,o=r.placeholder?s.default.inverse(r.placeholder[0])+s.default.dim(r.placeholder.slice(1)):s.default.inverse(s.default.hidden("_")),i=this.value?this.valueWithCursor:o;switch(this.state){case"error":return`${t.trim()}
18
+ ${s.default.yellow(b)} ${i}
19
+ ${s.default.yellow(_)} ${s.default.yellow(this.error)}
20
+ `;case"submit":return`${t}${s.default.gray(b)} ${s.default.dim(this.value||r.placeholder)}`;case"cancel":return`${t}${s.default.gray(b)} ${s.default.strikethrough(s.default.dim(this.value??""))}${this.value?.trim()?`
21
+ `+s.default.gray(b):""}`;default:return`${t}${s.default.cyan(b)} ${i}
22
+ ${s.default.cyan(_)}
23
+ `}}}).prompt();var ze=(r)=>{let t=r.active??"Yes",o=r.inactive??"No";return new F({active:t,inactive:o,initialValue:r.initialValue??!0,render(){let i=`${s.default.gray(b)}
24
+ ${U(this.state)} ${r.message}
25
+ `,n=this.value?t:o;switch(this.state){case"submit":return`${i}${s.default.gray(b)} ${s.default.dim(n)}`;case"cancel":return`${i}${s.default.gray(b)} ${s.default.strikethrough(s.default.dim(n))}
26
+ ${s.default.gray(b)}`;default:return`${i}${s.default.cyan(b)} ${this.value?`${s.default.green(ee)} ${t}`:`${s.default.dim(re)} ${s.default.dim(t)}`} ${s.default.dim("/")} ${this.value?`${s.default.dim(re)} ${s.default.dim(o)}`:`${s.default.green(ee)} ${o}`}
27
+ ${s.default.cyan(_)}
28
+ `}}}).prompt()},R=(r)=>{let t=(o,i)=>{let n=o.label??String(o.value);switch(i){case"selected":return`${s.default.dim(n)}`;case"active":return`${s.default.green(ee)} ${n} ${o.hint?s.default.dim(`(${o.hint})`):""}`;case"cancelled":return`${s.default.strikethrough(s.default.dim(n))}`;default:return`${s.default.dim(re)} ${s.default.dim(n)}`}};return new Ce({options:r.options,initialValue:r.initialValue,render(){let o=`${s.default.gray(b)}
29
+ ${U(this.state)} ${r.message}
30
+ `;switch(this.state){case"submit":return`${o}${s.default.gray(b)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${o}${s.default.gray(b)} ${t(this.options[this.cursor],"cancelled")}
31
+ ${s.default.gray(b)}`;default:return`${o}${s.default.cyan(b)} ${te({cursor:this.cursor,options:this.options,maxItems:r.maxItems,style:(i,n)=>t(i,n?"active":"inactive")}).join(`
32
+ ${s.default.cyan(b)} `)}
33
+ ${s.default.cyan(_)}
34
+ `}}}).prompt()};var He=(r)=>{let t=(o,i)=>{let n=o.label??String(o.value);return i==="active"?`${s.default.cyan(Bt)} ${n} ${o.hint?s.default.dim(`(${o.hint})`):""}`:i==="selected"?`${s.default.green(Le)} ${s.default.dim(n)}`:i==="cancelled"?`${s.default.strikethrough(s.default.dim(n))}`:i==="active-selected"?`${s.default.green(Le)} ${n} ${o.hint?s.default.dim(`(${o.hint})`):""}`:i==="submitted"?`${s.default.dim(n)}`:`${s.default.dim(Gt)} ${s.default.dim(n)}`};return new Te({options:r.options,initialValues:r.initialValues,required:r.required??!0,cursorAt:r.cursorAt,validate(o){if(this.required&&o.length===0)return`Please select at least one option.
35
+ ${s.default.reset(s.default.dim(`Press ${s.default.gray(s.default.bgWhite(s.default.inverse(" space ")))} to select, ${s.default.gray(s.default.bgWhite(s.default.inverse(" enter ")))} to submit`))}`},render(){let o=`${s.default.gray(b)}
36
+ ${U(this.state)} ${r.message}
37
+ `,i=(n,a)=>{let e=this.value.includes(n.value);return a&&e?t(n,"active-selected"):e?t(n,"selected"):t(n,a?"active":"inactive")};switch(this.state){case"submit":return`${o}${s.default.gray(b)} ${this.options.filter(({value:n})=>this.value.includes(n)).map((n)=>t(n,"submitted")).join(s.default.dim(", "))||s.default.dim("none")}`;case"cancel":{let n=this.options.filter(({value:a})=>this.value.includes(a)).map((a)=>t(a,"cancelled")).join(s.default.dim(", "));return`${o}${s.default.gray(b)} ${n.trim()?`${n}
38
+ ${s.default.gray(b)}`:""}`}case"error":{let n=this.error.split(`
39
+ `).map((a,e)=>e===0?`${s.default.yellow(_)} ${s.default.yellow(a)}`:` ${a}`).join(`
40
+ `);return o+s.default.yellow(b)+" "+te({options:this.options,cursor:this.cursor,maxItems:r.maxItems,style:i}).join(`
41
+ ${s.default.yellow(b)} `)+`
42
+ `+n+`
43
+ `}default:return`${o}${s.default.cyan(b)} ${te({options:this.options,cursor:this.cursor,maxItems:r.maxItems,style:i}).join(`
44
+ ${s.default.cyan(b)} `)}
45
+ ${s.default.cyan(_)}
46
+ `}}}).prompt()};var L=(r="")=>{process.stdout.write(`${s.default.gray(_)} ${s.default.red(r)}
47
+
48
+ `)},oe=(r="")=>{process.stdout.write(`${s.default.gray(Mt)} ${r}
49
+ `)},ne=(r="")=>{process.stdout.write(`${s.default.gray(b)}
50
+ ${s.default.gray(_)} ${r}
51
+
52
+ `)};var $=()=>{let r=D?["◒","◐","◓","◑"]:["•","o","O","0"],t=D?80:120,o,i,n=!1,a="",e=(x)=>{let v=x>1?"Something went wrong":"Canceled";n&&p(v,x)},c=()=>e(2),d=()=>e(1),u=()=>{process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",e)},l=()=>{process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",e)},m=(x="")=>{n=!0,o=Pe(),a=x.replace(/\.+$/,""),process.stdout.write(`${s.default.gray(b)}
53
+ `);let v=0,N=0;u(),i=setInterval(()=>{let Yr=s.default.magenta(r[v]),Jr=".".repeat(Math.floor(N)).slice(0,3);process.stdout.write(w.cursor.move(-999,0)),process.stdout.write(w.erase.down(1)),process.stdout.write(`${Yr} ${a}${Jr}`),v=v+1<r.length?v+1:0,N=N<r.length?N+0.125:0},t)},p=(x="",v=0)=>{a=x??a,n=!1,clearInterval(i);let N=v===0?s.default.green(Be):v===1?s.default.red(ke):s.default.red(Me);process.stdout.write(w.cursor.move(-999,0)),process.stdout.write(w.erase.down(1)),process.stdout.write(`${N} ${a}
54
+ `),l(),o()};return{start:m,stop:p,message:(x="")=>{a=x??a}}};var Ue=async(r,t)=>{let o={},i=Object.keys(r);for(let n of i){let a=r[n],e=await a({results:o})?.catch((c)=>{throw c});if(typeof t?.onCancel=="function"&&O(e)){o[n]="canceled",t.onCancel({results:o});continue}o[n]=e}return o};async function $e(){let r=await Ue({caching:()=>R({message:"Select Caching strategy:",options:[{value:"none",label:"None"},{value:"memory",label:"In-memory (Local caching)"},{value:"redis",label:"Redis (Distributed caching)"}]}),logger:()=>R({message:"Select Logging strategy:",options:[{value:"none",label:"None"},{value:"console",label:"Console (Basic terminal logs)"},{value:"otel",label:"OpenTelemetry (Advanced logging + PostHog)"}]}),orm:()=>R({message:"Select a Database ORM:",options:[{value:"prisma",label:"Prisma (PostgreSQL + Typed schemas)"},{value:"drizzle",label:"Drizzle (PostgreSQL + Lightweight SQL)"},{value:"mongoose",label:"Mongoose (MongoDB)"},{value:"none",label:"None"}]}),auth:()=>R({message:"Select an Authentication provider:",options:[{value:"clerk",label:"Clerk (Hosted Auth)"},{value:"betterauth",label:"Better-Auth (Self-hosted)"},{value:"custom",label:"Custom JWT Middleware (Starter)"},{value:"none",label:"None"}]}),rateLimit:()=>R({message:"Select Rate Limiting strategy:",options:[{value:"none",label:"None"},{value:"basic",label:"Basic (Memory-based)"},{value:"redis",label:"Redis-based (Distributed)"}]}),inngest:()=>R({message:"Select Inngest support:",options:[{value:"none",label:"None"},{value:"basic",label:"Basic (Event-driven background functions)"}]}),email:()=>R({message:"Select an Email provider:",options:[{value:"resend",label:"Resend (Modern API)"},{value:"nodemailer",label:"Nodemailer (Traditional SMTP)"},{value:"none",label:"None"}]}),features:()=>He({message:"Extra features:",options:[{value:"pagination",label:"Pagination",hint:"Zod pagination helpers"}],required:!1}),formatter:()=>R({message:"Select a formatter/linter:",options:[{value:"biome",label:"Biome (Recommended: Fast formatter & linter)"},{value:"prettier",label:"Prettier + ESLint"},{value:"none",label:"None"}]}),docker:()=>ze({message:"Would you like to include Docker support (Dockerfile, docker-compose)?",initialValue:!0}),ci:()=>R({message:"Select a CI/CD setup:",options:[{value:"github",label:"GitHub Actions (Basic CI)"},{value:"none",label:"None"}]})},{onCancel:()=>{L("Operation cancelled."),process.exit(0)}}),t=r.features;return{caching:r.caching,logger:r.logger,orm:r.orm,rateLimit:r.rateLimit,auth:r.auth,email:r.email,pagination:t.includes("pagination"),formatter:r.formatter,inngest:r.inngest,docker:r.docker,ci:r.ci}}import Hr from"fs/promises";import Ur from"path";var qe=`{
55
+ "compilerOptions": {
56
+ "lib": ["ESNext"],
57
+ "target": "ESNext",
58
+ "module": "Preserve",
59
+ "moduleDetection": "force",
60
+ "jsx": "react-jsx",
61
+ "allowJs": true,
62
+
63
+ "moduleResolution": "bundler",
64
+ "allowImportingTsExtensions": true,
65
+ "verbatimModuleSyntax": true,
66
+ "noEmit": true,
67
+
68
+ "strict": true,
69
+ "skipLibCheck": true,
70
+ "noFallthroughCasesInSwitch": true,
71
+ "noUncheckedIndexedAccess": true,
72
+ "noImplicitOverride": true,
73
+
74
+ "noUnusedLocals": false,
75
+ "noUnusedParameters": false,
76
+ "noPropertyAccessFromIndexSignature": false
77
+ }
78
+ }
79
+ `,je=`# dependencies (bun install)
80
+ node_modules
81
+ generated
82
+
83
+ # output
84
+ out
85
+ dist
86
+ *.tgz
87
+
88
+ # code coverage
89
+ coverage
90
+ *.lcov
91
+
92
+ # logs
93
+ logs
94
+ *.log
95
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
96
+
97
+ # dotenv environment variable files
98
+ .env
99
+ .env.development.local
100
+ .env.test.local
101
+ .env.production.local
102
+ .env.local
103
+
104
+ # caches
105
+ .eslintcache
106
+ .cache
107
+ *.tsbuildinfo
108
+
109
+ # Test output matrix folders
110
+ tests_output_matrix_v*
111
+
112
+ # IDE settings
113
+ .idea
114
+ .vscode/
115
+
116
+ # MacOS files
117
+ .DS_Store
118
+ `,We=`export class AppError extends Error {
119
+ constructor(
120
+ public statusCode: number,
121
+ message: string,
122
+ ) {
123
+ super(message);
124
+ this.name = "AppError";
125
+ }
126
+ }
127
+ `,Ye=`import { join } from "path";
128
+ import type { RouteConfig } from "./define-route";
129
+
130
+ const ROUTES_DIR = join(import.meta.dir, "../routes");
131
+
132
+ function isRouteConfig(
133
+ value: unknown,
134
+ ): value is RouteConfig<any, any, any, any> {
135
+ if (!value || typeof value !== "object") return false;
136
+ const v = value as Record<string, unknown>;
137
+ return (
138
+ typeof v.method === "string" &&
139
+ typeof v.path === "string" &&
140
+ typeof v.handler === "function" &&
141
+ v.output !== undefined
142
+ );
143
+ }
144
+
145
+ export async function loadRoutes(): Promise<RouteConfig<any, any, any, any>[]> {
146
+ const glob = new Bun.Glob("**/*.ts");
147
+ const routes: RouteConfig<any, any, any, any>[] = [];
148
+
149
+ for await (const filePath of glob.scan({
150
+ cwd: ROUTES_DIR,
151
+ absolute: false,
152
+ })) {
153
+ const fullPath = join(ROUTES_DIR, filePath);
154
+ const mod = await import(fullPath);
155
+
156
+ for (const [exportName, exportValue] of Object.entries(mod)) {
157
+ if (isRouteConfig(exportValue)) {
158
+ routes.push(exportValue);
159
+ }
160
+ }
161
+ }
162
+
163
+ return routes;
164
+ }
165
+ `,Je=`{
166
+ "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
167
+ "organizeImports": {
168
+ "enabled": true
169
+ },
170
+ "linter": {
171
+ "enabled": true,
172
+ "rules": {
173
+ "recommended": true
174
+ }
175
+ },
176
+ "formatter": {
177
+ "enabled": true,
178
+ "indentStyle": "space",
179
+ "indentWidth": 2
180
+ }
181
+ }
182
+ `,Ze=`{
183
+ "semi": true,
184
+ "singleQuote": false,
185
+ "tabWidth": 2,
186
+ "trailingComma": "all"
187
+ }
188
+ `,Ve=`import tseslint from 'typescript-eslint';
189
+
190
+ export default tseslint.config(
191
+ ...tseslint.configs.recommended,
192
+ {
193
+ ignores: ['generated/', 'dist/', 'out/', 'node_modules/']
194
+ }
195
+ );
196
+ `;function Ke(r,t){let o={cors:"^2.8.5",dotenv:"^16.4.5",express:"^5.0.0",helmet:"^7.1.0",zod:"^3.23.8"};if(t.caching==="redis"||t.rateLimit==="redis")o.redis="^4.7.0";if(t.logger==="otel")o["@opentelemetry/api-logs"]="^0.53.0",o["@opentelemetry/exporter-logs-otlp-http"]="^0.53.0",o["@opentelemetry/resources"]="^1.26.0",o["@opentelemetry/sdk-logs"]="^0.53.0";if(t.orm==="prisma")o["@prisma/adapter-pg"]="^7.4.2",o["@prisma/client"]="^7.4.2",o.pg="^8.20.0",o.prisma="^7.4.2";else if(t.orm==="drizzle")o["drizzle-orm"]="^0.33.0",o["drizzle-kit"]="^0.24.0",o.pg="^8.12.0";else if(t.orm==="mongoose")o.mongoose="^8.6.0";if(t.auth==="clerk")o["@clerk/express"]="^1.3.11";else if(t.auth==="betterauth")o["better-auth"]="^1.1.18";else if(t.auth==="custom")o.jsonwebtoken="^9.0.2";if(t.rateLimit!=="none")o["express-rate-limit"]="^7.4.0";if(t.email==="resend")o.resend="^3.5.0";else if(t.email==="nodemailer")o.nodemailer="^6.9.14";if(t.inngest!=="none")o.inngest="latest";let i={"@types/bun":"latest","@types/cors":"^2.8.19","@types/express":"^5.0.6","@types/node":"^22.0.0"};if(t.email==="nodemailer")i["@types/nodemailer"]="^6.4.15";if(t.auth==="custom")i["@types/jsonwebtoken"]="^9.0.7";if(t.orm==="prisma"||t.orm==="drizzle")i["@types/pg"]="^8.11.6";let n={dev:"bun run --watch src/app.ts"};if(t.orm==="prisma")n["db:generate"]="prisma generate";if(t.formatter==="biome")i["@biomejs/biome"]="1.8.3",n.format="biome format --write .",n.lint="biome check .";else if(t.formatter==="prettier")i.prettier="^3.3.3",i.eslint="^9.9.0",i["typescript-eslint"]="^8.0.1",n.format="prettier --write .",n.lint="eslint .";return JSON.stringify({name:r,module:"src/app.ts",type:"module",private:!0,scripts:n,devDependencies:i,peerDependencies:{typescript:"^5"},dependencies:o},null,2)}function Xe(r,t){let o=`PORT=8000
197
+ NODE_ENV=development
198
+ IS_DEV=true
199
+ `;if(r.caching==="redis")o+=`CACHE_ENABLED=true
200
+ REDIS_URL=redis://localhost:6379
201
+ `;if(r.logger==="otel")o+=`SERVICE_NAME=${t}
202
+ POSTHOG_URL=https://us.i.posthog.com/i/v1/logs
203
+ POSTHOG_API_KEY=your_key_here
204
+ `;if(r.orm!=="none")if(r.orm==="mongoose")o+=`DATABASE_URL=mongodb://localhost:27017/my_db
205
+ `;else o+=`DATABASE_URL=postgresql://user:pass@localhost:5432/db?schema=public
206
+ DIRECT_URL=postgresql://user:pass@localhost:5432/db
207
+ `;else if(r.auth==="betterauth")o+=`DATABASE_URL=postgresql://user:pass@localhost:5432/db?schema=public
208
+ `;if(r.auth==="betterauth")o+=`BETTER_AUTH_SECRET=super_secret_string
209
+ BETTER_AUTH_URL=http://localhost:8000
210
+ `;else if(r.auth==="custom")o+=`JWT_SECRET=your_super_secret_jwt_key_here
211
+ `;if(r.email==="resend")o+=`RESEND_API_KEY=re_123456789
212
+ `;else if(r.email==="nodemailer")o+=`SMTP_HOST=smtp.mailtrap.io
213
+ SMTP_PORT=2525
214
+ SMTP_USER=user
215
+ SMTP_PASS=pass
216
+ `;if(r.inngest!=="none")o+=`INNGEST_EVENT_KEY=your_event_key_here
217
+ INNGEST_SIGNING_KEY=your_signing_key_here
218
+ `;return o}function Fe(r,t){return`export const env = {
219
+ IS_DEV: process.env.NODE_ENV !== "production",
220
+ NODE_ENV: process.env.NODE_ENV ?? "development",
221
+ PORT: Number(process.env.PORT) || 8000,
222
+ SERVICE_NAME: process.env.SERVICE_NAME ?? "${t}",
223
+ SERVICE_VERSION: process.env.npm_package_version ?? "1.0.0",
224
+ ${r.caching==="redis"?` REDIS_URL: process.env.REDIS_URL,
225
+ IS_CACHE_ENABLED: process.env.CACHE_ENABLED === "true",`:""}
226
+ ${r.caching==="memory"?" IS_CACHE_ENABLED: true,":""}
227
+ ${r.logger==="otel"?` POSTHOG_API_KEY: process.env.POSTHOG_API_KEY,
228
+ POSTHOG_URL: process.env.POSTHOG_URL,`:""}
229
+ ${r.orm!=="none"||r.auth==="betterauth"?" DATABASE_URL: process.env.DATABASE_URL,":""}
230
+ ${r.auth==="clerk"?` CLERK_SECRET_KEY: process.env.CLERK_SECRET_KEY,
231
+ CLERK_PUBLISHABLE_KEY: process.env.CLERK_PUBLISHABLE_KEY,`:""}
232
+ ${r.auth==="betterauth"?` BETTER_AUTH_SECRET: process.env.BETTER_AUTH_SECRET,
233
+ BETTER_AUTH_URL: process.env.BETTER_AUTH_URL,`:""}
234
+ ${r.auth==="custom"?" JWT_SECRET: process.env.JWT_SECRET,":""}
235
+ ${r.email==="resend"?" RESEND_API_KEY: process.env.RESEND_API_KEY,":""}
236
+ ${r.email==="nodemailer"?` SMTP_HOST: process.env.SMTP_HOST,
237
+ SMTP_PORT: Number(process.env.SMTP_PORT) || 587,
238
+ SMTP_USER: process.env.SMTP_USER,
239
+ SMTP_PASS: process.env.SMTP_PASS,`:""}
240
+ ${r.inngest!=="none"?` INNGEST_EVENT_KEY: process.env.INNGEST_EVENT_KEY,
241
+ INNGEST_SIGNING_KEY: process.env.INNGEST_SIGNING_KEY,`:""}
242
+ // [AURA_ENV_KEYS]
243
+ };
244
+ `}function Qe(r){let t=[...new Set(r.imports||[])].join(`
245
+ `),o=[...new Set(r.init||[])].map((e)=>` ${e}`).join(`
246
+ `),i=[...new Set(r.middleware||[])].map((e)=>` ${e}`).join(`
247
+ `),n=[...new Set(r.errorHandler||[])].map((e)=>` ${e}`).join(`
248
+ `),a=[...new Set(r.shutdown||[])].map((e)=>` ${e}`).join(`
249
+ `);return`${t}
250
+ // [AURA_IMPORTS]
251
+
252
+ async function init() {
253
+ ${o}
254
+ // [AURA_INIT]
255
+
256
+ ${i}
257
+ // [AURA_MIDDLEWARE]
258
+
259
+ ${n}
260
+ // [AURA_ERROR_HANDLER]
261
+
262
+ ${a}
263
+ // [AURA_SHUTDOWN]
264
+
265
+ app.listen(env.PORT, () => {
266
+ console.log(\`Server started on port \${env.PORT}\`);
267
+ });
268
+ }
269
+
270
+ init().catch(async (err) => {
271
+ console.error("server.bootstrap_failed", err);
272
+ process.exit(1);
273
+ });
274
+ `}function De(r){return`import { ZodError } from "zod";
275
+ import type { Request, Response, NextFunction } from "express";
276
+ ${r.logger!=="none"?'import { logger } from "./logger";':""}
277
+ import { AppError } from "./app-error";
278
+ import type { ApiResponse } from "../base/define-route";
279
+
280
+ export function errorHandler(
281
+ err: unknown,
282
+ req: Request,
283
+ res: Response,
284
+ next: NextFunction,
285
+ ) {
286
+ const metadata = {
287
+ timestamp: new Date().toISOString(),
288
+ requestId: (req as any).requestId,
289
+ path: req.path,
290
+ };
291
+
292
+ if (err instanceof ZodError) {
293
+ const response: ApiResponse<null> = {
294
+ success: false,
295
+ error: "Validation Error",
296
+ metadata,
297
+ };
298
+ return res.status(400).json({ ...response, issues: err.flatten() });
299
+ }
300
+
301
+ if (err instanceof AppError) {
302
+ const response: ApiResponse<null> = {
303
+ success: false,
304
+ error: err.message,
305
+ metadata,
306
+ };
307
+ return res.status(err.statusCode).json(response);
308
+ }
309
+
310
+ const response: ApiResponse<null> = {
311
+ success: false,
312
+ error: "Internal Server Error",
313
+ metadata,
314
+ };
315
+
316
+ if (process.env.NODE_ENV !== "production") {
317
+ (response as any).stack = err instanceof Error ? err.stack : undefined;
318
+ }
319
+
320
+ res.status(500).json(response);
321
+ }
322
+ `}function er(r){return`import { z, type ZodType } from "zod";
323
+
324
+ export interface ApiResponse<T> {
325
+ success: boolean;
326
+ data?: T;
327
+ error?: string;
328
+ metadata?: {
329
+ timestamp: string;
330
+ requestId?: string;
331
+ path: string;
332
+ };
333
+ }
334
+
335
+ ${r.auth!=="none"?`export interface AuthUser {
336
+ id: string;
337
+ roles: string[];
338
+ }`:""}
339
+
340
+ export type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
341
+
342
+ export interface RouteConfig<
343
+ TBody extends ZodType = ZodType,
344
+ TQuery extends ZodType = ZodType,
345
+ TParams extends ZodType = ZodType,
346
+ TOutput extends ZodType = ZodType,
347
+ > {
348
+ method: HttpMethod;
349
+ path: string;
350
+ input?: {
351
+ body?: TBody;
352
+ query?: TQuery;
353
+ params?: TParams;
354
+ };
355
+ output: TOutput;
356
+ ${r.rateLimit!=="none"?` rateLimit?: {
357
+ enabled: boolean;
358
+ windowMs?: number;
359
+ max?: number;
360
+ };`:""}
361
+ ${r.auth!=="none"?` auth?: {
362
+ required: boolean;
363
+ roles?: string[];
364
+ };`:""}
365
+ ${r.caching!=="none"?` cache?: {
366
+ enabled: boolean;
367
+ ttl: number;
368
+ key: (ctx: { params: any; query: any${r.auth!=="none"?"; user: any":""} }) => string;
369
+ };`:""}
370
+ ${r.logger!=="none"?` logging?: {
371
+ enabled: boolean;
372
+ fields?: Array<keyof z.infer<TOutput>>;
373
+ redact?: Array<keyof z.infer<TOutput>>;
374
+ };`:""}
375
+
376
+ handler: (ctx: {
377
+ body: TBody extends ZodType ? z.infer<TBody> : never;
378
+ query: TQuery extends ZodType ? z.infer<TQuery> : never;
379
+ params: TParams extends ZodType ? z.infer<TParams> : never;
380
+ ${r.auth!=="none"?" user?: AuthUser;":""}
381
+ ${r.logger!=="none"?" log: (attrs: Record<string, unknown>) => void;":""}
382
+ }) => Promise<z.infer<TOutput>>;
383
+ onRequest?: (ctx: {
384
+ body: TBody extends ZodType ? z.infer<TBody> : undefined;
385
+ query: TQuery extends ZodType ? z.infer<TQuery> : undefined;
386
+ params: TParams extends ZodType ? z.infer<TParams> : undefined;
387
+ ${r.auth!=="none"?" user?: AuthUser;":""}
388
+ ${r.logger!=="none"?" log: (attrs: Record<string, unknown>) => void;":""}
389
+ }) => Promise<void> | void;
390
+ }
391
+
392
+ export function defineRoute<
393
+ TBody extends ZodType,
394
+ TQuery extends ZodType,
395
+ TParams extends ZodType,
396
+ TOutput extends ZodType,
397
+ >(config: RouteConfig<TBody, TQuery, TParams, TOutput>) {
398
+ return config;
399
+ }
400
+ `}function rr(r){return`import {
401
+ type Router,
402
+ type Request,
403
+ type Response,
404
+ type NextFunction,
405
+ } from "express";
406
+ ${r.rateLimit!=="none"?'import rateLimit from "express-rate-limit";':""}
407
+ import type { RouteConfig, ApiResponse } from "./define-route";
408
+ ${r.caching!=="none"?'import { getCacheOptions, setCacheOptions } from "../utils/cache";':""}
409
+ ${r.caching!=="none"?'import { cache } from "../utils/cache";':""}
410
+ ${r.auth!=="none"?'import { authMiddleware } from "../middlewares/auth";':""}
411
+
412
+ export function registerRoute(
413
+ router: Router,
414
+ route: RouteConfig<any, any, any, any>,
415
+ ) {
416
+ const middlewares: any[] = [];
417
+
418
+ ${r.rateLimit!=="none"?` if (route.rateLimit?.enabled) {
419
+ middlewares.push(
420
+ rateLimit({
421
+ windowMs: route.rateLimit.windowMs ?? 60_000,
422
+ max: route.rateLimit.max ?? 100,
423
+ standardHeaders: true,
424
+ legacyHeaders: false,
425
+ }),
426
+ );
427
+ }`:""}
428
+
429
+ ${r.auth!=="none"?` if (route.auth?.required) {
430
+ middlewares.push(authMiddleware(route.auth.roles));
431
+ }`:""}
432
+
433
+ const handler = async (req: Request, res: Response, next: NextFunction) => {
434
+ try {
435
+ const body = route.input?.body ? route.input.body.parse(req.body) : undefined;
436
+ const query = route.input?.query ? route.input.query.parse(req.query) : undefined;
437
+ const params = route.input?.params ? route.input.params.parse(req.params) : undefined;
438
+ ${r.auth!=="none"?" const user = (req as any).user;":""}
439
+ ${r.logger!=="none"?` const log = (attrs: Record<string, unknown>) => Object.assign(req._log, attrs);
440
+ req._log.route = route.path;
441
+
442
+ if (route.logging && !route.logging.enabled) {
443
+ (req as any)._disableLogging = true;
444
+ }`:""}
445
+
446
+ if (route.onRequest) {
447
+ await route.onRequest({ body, query, params${r.auth!=="none"?", user":""}${r.logger!=="none"?", log":""} });
448
+ }
449
+
450
+ ${r.caching!=="none"?` if (route.cache?.enabled) {
451
+ const key = route.cache.key({ params, query${r.auth!=="none"?", user":""} });
452
+ const cached = await cache.get(key);
453
+ if (cached) {
454
+ return res.json({ success: true, data: cached, fromCache: true });
455
+ }
456
+ }`:""}
457
+
458
+ const result = await route.handler({ body, query, params${r.auth!=="none"?", user":""}${r.logger!=="none"?", log":""} });
459
+ const validatedOutput = route.output.parse(result);
460
+
461
+ const response: ApiResponse<any> = {
462
+ success: true,
463
+ data: validatedOutput,
464
+ metadata: {
465
+ timestamp: new Date().toISOString(),
466
+ requestId: (req as any).requestId,
467
+ path: req.path,
468
+ },
469
+ };
470
+
471
+ res.json(response);
472
+ } catch (err) {
473
+ next(err);
474
+ }
475
+ };
476
+
477
+ router[route.method](route.path, ...middlewares, handler);
478
+ }
479
+ `}function tr(r){let t=`export { defineRoute } from "./define-route";
480
+ export { loadRoutes } from "./route-loader";
481
+ export { registerRoute } from "./route-registry";
482
+ export { errorHandler } from "../utils/error-handler";
483
+ export { AppError } from "../utils/app-error";
484
+ `;if(r.caching!=="none")t+=`export { cache } from "../utils/cache";
485
+ export { cacheKeys } from "../utils/cache-keys";
486
+ `;if(r.logger!=="none")t+=`export { logger, gracefulShutdown } from "../utils/logger";
487
+ `;if(r.orm==="prisma")t+=`export { prisma } from "../config/prisma";
488
+ `;else if(r.orm==="drizzle")t+=`export { db } from "../config/drizzle";
489
+ `;else if(r.orm==="mongoose")t+=`export { connectDatabase } from "../config/mongoose";
490
+ `;if(r.auth!=="none")t+=`export { authMiddleware${r.auth==="betterauth"?", authHandler":""} } from "../middlewares/auth";
491
+ `;if(r.pagination)t+=`export { paginationInput, paginatedOutput, paginate } from "../utils/pagination";
492
+ `;if(r.email!=="none")t+=`export { sendEmail } from "../utils/email";
493
+ `;return t}function or(r){return`import { z } from "zod";
494
+ import { defineRoute } from "../base/define-route";
495
+ ${r.caching==="redis"?'import { redisClient } from "../config/redis";':""}
496
+ import { env } from "../config/env";
497
+
498
+ const startedAt = Date.now();
499
+
500
+ export const healthRoute = defineRoute({
501
+ method: "get",
502
+ path: "/health",
503
+ output: z.object({
504
+ status: z.string(),
505
+ uptime_s: z.number(),
506
+ version: z.string(),
507
+ ${r.caching==="redis"?' redis: z.enum(["connected", "disconnected", "disabled"]),':""}
508
+ }),
509
+ handler: async () => {
510
+ ${r.caching==="redis"?` let redis: "connected" | "disconnected" | "disabled" = "disabled";
511
+ if (env.IS_CACHE_ENABLED) {
512
+ try {
513
+ await redisClient.ping();
514
+ redis = "connected";
515
+ } catch {
516
+ redis = "disconnected";
517
+ }
518
+ }
519
+ `:""}
520
+ return {
521
+ status: "ok",
522
+ uptime_s: Math.floor((Date.now() - startedAt) / 1000),
523
+ version: env.SERVICE_VERSION || "1.0.0",
524
+ ${r.caching==="redis"?" redis,":""}
525
+ };
526
+ },
527
+ });
528
+ `}var nr={id:"core",getFiles:(r,t)=>{return[{path:"package.json",content:Ke(t,r)},{path:"tsconfig.json",content:qe},{path:".gitignore",content:je},{path:".env",content:Xe(r,t)},{path:"src/config/env.ts",content:Fe(r,t)},{path:"src/utils/app-error.ts",content:We},{path:"src/utils/error-handler.ts",content:De(r)},{path:"src/base/index.ts",content:tr(r)},{path:"src/base/define-route.ts",content:er(r)},{path:"src/base/route-loader.ts",content:Ye},{path:"src/base/route-registry.ts",content:rr(r)},{path:"src/routes/health-route.ts",content:or(r)}]},getSnippets:(r)=>{return{imports:['import express from "express";','import helmet from "helmet";','import cors from "cors";','import { loadRoutes, registerRoute, errorHandler } from "./base";','import { env } from "./config/env";'],init:["const app = express();","app.use(helmet());","app.use(cors());","app.use(express.json());"],middleware:["const router = express.Router();","const routes = await loadRoutes();","routes.forEach((route) => registerRoute(router, route));",'app.use("/api", router);'],errorHandler:["app.use(errorHandler);"]}}};var ir=`generator client {
529
+ provider = "prisma-client"
530
+ output = "../generated/prisma"
531
+ }
532
+
533
+ datasource db {
534
+ provider = "postgresql"
535
+ }
536
+
537
+ model User {
538
+ id String @id @default(cuid())
539
+ name String
540
+ email String @unique
541
+ createdAt DateTime @default(now())
542
+ }
543
+ `,sr=`import "dotenv/config";
544
+ import { defineConfig, env } from "prisma/config";
545
+
546
+ export default defineConfig({
547
+ schema: "prisma/schema.prisma",
548
+ migrations: {
549
+ path: "prisma/migrations",
550
+ },
551
+ datasource: {
552
+ url: env("DIRECT_URL"),
553
+ },
554
+ });
555
+ `,ar=`import { PrismaPg } from "@prisma/adapter-pg";
556
+ import { PrismaClient } from "@prisma/client";
557
+ import { env } from "./env";
558
+
559
+ const connectionString = \`\${env.DATABASE_URL}\`;
560
+
561
+ const adapter = new PrismaPg({ connectionString });
562
+ export const prisma = new PrismaClient({ adapter });
563
+ `;var cr=`import { defineConfig } from "drizzle-kit";
564
+
565
+ export default defineConfig({
566
+ dialect: "postgresql",
567
+ schema: "./src/db/schema.ts",
568
+ out: "./drizzle",
569
+ dbCredentials: {
570
+ url: process.env.DATABASE_URL!,
571
+ },
572
+ });
573
+ `,mr=`import { drizzle } from "drizzle-orm/node-postgres";
574
+ import { Pool } from "pg";
575
+ import { env } from "./env";
576
+ import * as schema from "../db/schema";
577
+
578
+ const pool = new Pool({
579
+ connectionString: env.DATABASE_URL,
580
+ });
581
+
582
+ export const db = drizzle(pool, { schema });
583
+ `,lr=`import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
584
+
585
+ export const users = pgTable("users", {
586
+ id: text("id").primaryKey(),
587
+ name: text("name").notNull(),
588
+ email: text("email").notNull().unique(),
589
+ createdAt: timestamp("created_at").defaultNow().notNull(),
590
+ });
591
+ `;var pr=`import mongoose from "mongoose";
592
+ import { env } from "./env";
593
+
594
+ export async function connectDatabase() {
595
+ try {
596
+ await mongoose.connect(env.DATABASE_URL!);
597
+ console.log("Connected to MongoDB via Mongoose");
598
+ } catch (err) {
599
+ if (env.IS_DEV) {
600
+ console.warn("Failed to connect to MongoDB. App will continue without DB features.");
601
+ } else {
602
+ console.error("Failed to connect to MongoDB", err);
603
+ process.exit(1);
604
+ }
605
+ }
606
+ }
607
+ `,dr=`import mongoose from "mongoose";
608
+
609
+ const userSchema = new mongoose.Schema(
610
+ {
611
+ name: { type: String, required: true },
612
+ email: { type: String, required: true, unique: true },
613
+ },
614
+ { timestamps: true }
615
+ );
616
+
617
+ export const User = mongoose.model("User", userSchema);
618
+ `;var ur={id:"orm",getFiles:(r)=>{let t=[];if(r.orm==="prisma")t.push({path:"prisma/schema.prisma",content:ir},{path:"prisma.config.ts",content:sr},{path:"src/config/prisma.ts",content:ar});else if(r.orm==="drizzle")t.push({path:"drizzle.config.ts",content:cr},{path:"src/db/schema.ts",content:lr},{path:"src/config/drizzle.ts",content:mr});else if(r.orm==="mongoose")t.push({path:"src/config/mongoose.ts",content:pr},{path:"src/models/user.model.ts",content:dr});return t},getSnippets:(r)=>{if(r.orm==="none")return{};return{imports:[r.orm==="mongoose"?'import { connectDatabase } from "./config/mongoose";':null].filter(Boolean),init:[r.orm==="mongoose"?"await connectDatabase();":null].filter(Boolean)}}};var br=`import type { Request, Response, NextFunction } from "express";
619
+ import * as jwt from "jsonwebtoken";
620
+ import { env } from "../config/env";
621
+ import { AppError } from "../utils/app-error";
622
+
623
+ export const authMiddleware = (roles?: string[]) => {
624
+ return (req: Request, res: Response, next: NextFunction) => {
625
+ const authHeader = req.headers.authorization;
626
+ if (!authHeader?.startsWith("Bearer ")) {
627
+ return next(new AppError(401, "Unauthorized"));
628
+ }
629
+
630
+ const token = authHeader.split(" ")[1];
631
+ if (!token) {
632
+ return next(new AppError(401, "Unauthorized"));
633
+ }
634
+
635
+ try {
636
+ const decoded = jwt.verify(token, env.JWT_SECRET!) as any as { id: string; roles: string[] };
637
+ (req as any).user = decoded;
638
+
639
+ if (roles && !roles.some(role => decoded.roles.includes(role))) {
640
+ return next(new AppError(403, "Forbidden"));
641
+ }
642
+
643
+ next();
644
+ } catch (err) {
645
+ next(new AppError(401, "Invalid or expired token"));
646
+ }
647
+ };
648
+ };
649
+ `,gr=`import { requireAuth } from '@clerk/express';
650
+ import type { Request, Response, NextFunction } from "express";
651
+
652
+ // Clerk handles auth via clerkMiddleware() globally in app.ts.
653
+ // requireAuth() ensures the route is protected. Roles are not natively
654
+ // supported by Clerk middleware, use Clerk's RBAC or custom logic.
655
+ export const authMiddleware = (_roles?: string[]) => requireAuth();
656
+ `,hr=`import { betterAuth } from "better-auth";
657
+ import { toNodeHandler } from "better-auth/node";
658
+ import type { Request, Response, NextFunction } from "express";
659
+ import { env } from "../config/env";
660
+ import { AppError } from "../utils/app-error";
661
+
662
+ export const auth = betterAuth({
663
+ database: {
664
+ provider: "postgres", // Change according to your ORM/DB
665
+ url: env.DATABASE_URL!
666
+ },
667
+ emailAndPassword: {
668
+ enabled: true
669
+ }
670
+ });
671
+
672
+ export const authHandler = toNodeHandler(auth);
673
+
674
+ export const authMiddleware = (roles?: string[]) => {
675
+ return async (req: Request, res: Response, next: NextFunction) => {
676
+ try {
677
+ const session = await auth.api.getSession({
678
+ headers: req.headers as any
679
+ });
680
+
681
+ if (!session) {
682
+ return next(new AppError(401, "Unauthorized"));
683
+ }
684
+
685
+ (req as any).user = session.user;
686
+
687
+ if (roles && !roles.some(role => (session.user as any).roles?.includes(role))) {
688
+ return next(new AppError(403, "Forbidden"));
689
+ }
690
+
691
+ next();
692
+ } catch (err) {
693
+ next(err);
694
+ }
695
+ };
696
+ };
697
+ `;var xr={id:"auth",getFiles:(r)=>{let t=[];if(r.auth==="custom")t.push({path:"src/middlewares/auth.ts",content:br});else if(r.auth==="clerk")t.push({path:"src/middlewares/auth.ts",content:gr});else if(r.auth==="betterauth")t.push({path:"src/middlewares/auth.ts",content:hr});return t},getSnippets:(r)=>{if(r.auth==="none")return{};return{imports:[r.auth==="clerk"?'import { clerkMiddleware } from "@clerk/express";':null,r.auth==="betterauth"?'import { authHandler } from "./base";':null].filter(Boolean),middleware:[r.auth==="clerk"?"app.use(clerkMiddleware());":null,r.auth==="betterauth"?'app.all(["/api/auth", "/api/auth/*path"], authHandler);':null].filter(Boolean)}}};var Er=`import { createClient } from "redis";
698
+ import { env } from "./env";
699
+
700
+ export const redisClient = createClient({
701
+ url: env.REDIS_URL,
702
+ });
703
+
704
+ if (env.IS_CACHE_ENABLED) {
705
+ redisClient.on("error", (err) =>
706
+ console.error("Redis client error", { error: err.message }),
707
+ );
708
+ redisClient.on("connect", () => console.log("Redis connected"));
709
+ redisClient.on("reconnecting", () => console.log("Redis reconnecting"));
710
+ }
711
+
712
+ export async function connectRedis() {
713
+ if (env.IS_CACHE_ENABLED) {
714
+ await redisClient.connect();
715
+ } else {
716
+ console.log("Caching is disabled. Redis will not connect.");
717
+ }
718
+ }
719
+ `,vr=`import { redisClient } from "../config/redis";
720
+ import { env } from "../config/env";
721
+
722
+ interface CacheOptions {
723
+ ttl: number;
724
+ }
725
+
726
+ export const cache = {
727
+ async get<T>(key: string): Promise<T | null> {
728
+ if (!env.IS_CACHE_ENABLED) return null;
729
+ const value = await redisClient.get(key);
730
+ if (!value) return null;
731
+ return JSON.parse(value) as T;
732
+ },
733
+
734
+ async set<T>(key: string, value: T, options: CacheOptions): Promise<void> {
735
+ if (!env.IS_CACHE_ENABLED) return;
736
+ await redisClient.set(key, JSON.stringify(value), { EX: options.ttl });
737
+ },
738
+
739
+ async del(key: string): Promise<void> {
740
+ if (!env.IS_CACHE_ENABLED) return;
741
+ await redisClient.del(key);
742
+ },
743
+
744
+ async delPattern(pattern: string): Promise<void> {
745
+ if (!env.IS_CACHE_ENABLED) return;
746
+ const keys = await redisClient.keys(pattern);
747
+ if (keys.length > 0) {
748
+ await redisClient.del(keys);
749
+ }
750
+ },
751
+ };
752
+ `,Sr=`import { env } from "../config/env";
753
+
754
+ interface CacheOptions {
755
+ ttl: number;
756
+ }
757
+
758
+ const store = new Map<string, { value: any; expiresAt: number }>();
759
+
760
+ export const cache = {
761
+ async get<T>(key: string): Promise<T | null> {
762
+ if (!env.IS_CACHE_ENABLED) return null;
763
+ const item = store.get(key);
764
+ if (!item) return null;
765
+ if (Date.now() > item.expiresAt) {
766
+ store.delete(key);
767
+ return null;
768
+ }
769
+ return item.value as T;
770
+ },
771
+
772
+ async set<T>(key: string, value: T, options: CacheOptions): Promise<void> {
773
+ if (!env.IS_CACHE_ENABLED) return;
774
+ store.set(key, {
775
+ value,
776
+ expiresAt: Date.now() + options.ttl * 1000
777
+ });
778
+ },
779
+
780
+ async del(key: string): Promise<void> {
781
+ if (!env.IS_CACHE_ENABLED) return;
782
+ store.delete(key);
783
+ },
784
+
785
+ async delPattern(pattern: string): Promise<void> {
786
+ if (!env.IS_CACHE_ENABLED) return;
787
+ const regex = new RegExp("^" + pattern.replace("*", ".*") + "$");
788
+ for (const key of store.keys()) {
789
+ if (regex.test(key)) {
790
+ store.delete(key);
791
+ }
792
+ }
793
+ },
794
+ };
795
+ `,Rr=`export const cacheKeys = {
796
+ users: {
797
+ detail: (id: string) => \`users:detail:\${id}\`,
798
+ },
799
+ };
800
+ `;var yr={id:"caching",getFiles:(r)=>{let t=[];if(r.caching==="none")return t;if(t.push({path:"src/utils/cache-keys.ts",content:Rr}),r.caching==="redis")t.push({path:"src/config/redis.ts",content:Er}),t.push({path:"src/utils/cache.ts",content:vr});else if(r.caching==="memory")t.push({path:"src/utils/cache.ts",content:Sr});return t},getSnippets:(r)=>{if(r.caching==="none")return{};return{imports:[r.caching==="redis"?'import { connectRedis } from "./config/redis";':null].filter(Boolean),init:[r.caching==="redis"?"await connectRedis();":null].filter(Boolean),envTs:[r.caching==="redis"?" REDIS_URL: process.env.REDIS_URL":null,` IS_CACHE_ENABLED: ${r.caching==="memory"?"true":'process.env.CACHE_ENABLED === "true"'}`].filter(Boolean)}}};var Ir=`import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
801
+ import { resourceFromAttributes } from "@opentelemetry/resources";
802
+ import {
803
+ LoggerProvider,
804
+ BatchLogRecordProcessor,
805
+ } from "@opentelemetry/sdk-logs";
806
+ import { SeverityNumber, logs } from "@opentelemetry/api-logs";
807
+ import type { AnyValueMap } from "@opentelemetry/api-logs";
808
+ import { env } from "../config/env";
809
+
810
+ const resource = resourceFromAttributes({
811
+ "service.name": env.SERVICE_NAME,
812
+ "service.version": env.SERVICE_VERSION,
813
+ "deployment.environment": env.NODE_ENV,
814
+ });
815
+
816
+ const processors = [
817
+ new BatchLogRecordProcessor(
818
+ new OTLPLogExporter({
819
+ url: \`\${env.POSTHOG_URL}\`,
820
+ headers: {
821
+ Authorization: \`Bearer \${env.POSTHOG_API_KEY}\`,
822
+ },
823
+ }),
824
+ ),
825
+ ];
826
+
827
+ const provider = new LoggerProvider({
828
+ resource,
829
+ processors,
830
+ });
831
+
832
+ logs.setGlobalLoggerProvider(provider);
833
+ const otelLogger = logs.getLogger(env.SERVICE_NAME);
834
+
835
+ function emit(
836
+ severityText: string,
837
+ severityNumber: SeverityNumber,
838
+ body: string,
839
+ attrs?: object,
840
+ ) {
841
+ otelLogger.emit({
842
+ severityText,
843
+ severityNumber,
844
+ body,
845
+ attributes: (attrs ?? {}) as AnyValueMap,
846
+ });
847
+
848
+ if (env.IS_DEV) {
849
+ const meta = attrs ? \` \${JSON.stringify(attrs)}\` : "";
850
+ const msg = \`[\${severityText}] \${body}\${meta}\`;
851
+
852
+ switch (severityNumber) {
853
+ case SeverityNumber.ERROR:
854
+ console.error(msg);
855
+ break;
856
+ case SeverityNumber.WARN:
857
+ console.warn(msg);
858
+ break;
859
+ case SeverityNumber.DEBUG:
860
+ console.debug(msg);
861
+ break;
862
+ default:
863
+ console.log(msg);
864
+ }
865
+ }
866
+ }
867
+
868
+ export const logger = {
869
+ info: (body: string, attrs?: object) =>
870
+ emit("INFO", SeverityNumber.INFO, body, attrs),
871
+ warn: (body: string, attrs?: object) =>
872
+ emit("WARN", SeverityNumber.WARN, body, attrs),
873
+ error: (body: string, attrs?: object) =>
874
+ emit("ERROR", SeverityNumber.ERROR, body, attrs),
875
+ debug: (body: string, attrs?: object) => {
876
+ if (env.IS_DEV) emit("DEBUG", SeverityNumber.DEBUG, body, attrs);
877
+ },
878
+ };
879
+
880
+ export async function gracefulShutdown(signal: string) {
881
+ logger.info("server.shutdown", { reason: signal });
882
+ await provider.forceFlush();
883
+ await provider.shutdown();
884
+ process.exit(0);
885
+ }
886
+
887
+ export { provider as loggerProvider };
888
+ `,fr=`import { env } from "../config/env";
889
+
890
+ export const logger = {
891
+ info: (body: string, attrs?: object) => console.log(\`[INFO] \${body}\`, attrs ?? ""),
892
+ warn: (body: string, attrs?: object) => console.warn(\`[WARN] \${body}\`, attrs ?? ""),
893
+ error: (body: string, attrs?: object) => console.error(\`[ERROR] \${body}\`, attrs ?? ""),
894
+ debug: (body: string, attrs?: object) => {
895
+ if (env.IS_DEV) console.debug(\`[DEBUG] \${body}\`, attrs ?? "");
896
+ },
897
+ };
898
+
899
+ export async function gracefulShutdown(signal: string) {
900
+ logger.info("server.shutdown", { reason: signal });
901
+ process.exit(0);
902
+ }
903
+
904
+ export const loggerProvider = {
905
+ forceFlush: async () => {},
906
+ shutdown: async () => {},
907
+ };
908
+ `,_r=`import type { Request, Response, NextFunction } from "express";
909
+ import { randomUUID } from "crypto";
910
+ import { logger } from "../utils/logger";
911
+
912
+ declare global {
913
+ namespace Express {
914
+ interface Request {
915
+ requestId: string;
916
+ _log: Record<string, unknown>;
917
+ _disableLogging?: boolean;
918
+ _errorHandled?: boolean;
919
+ }
920
+ }
921
+ }
922
+
923
+ export function requestLogger(req: Request, res: Response, next: NextFunction) {
924
+ req.requestId = randomUUID();
925
+ res.setHeader("X-Request-Id", req.requestId);
926
+ req._log = { _startMs: Date.now() };
927
+
928
+ const start = Date.now();
929
+
930
+ const originalJson = res.json.bind(res);
931
+ res.json = (body: any) => {
932
+ res.setHeader("X-Response-Time", \`\${Date.now() - start}ms\`);
933
+ return originalJson(body);
934
+ };
935
+
936
+ res.on("finish", () => {
937
+ if (req._disableLogging) return;
938
+
939
+ const { _startMs, ...logFields } = req._log;
940
+ const attrs = {
941
+ requestId: req.requestId,
942
+ method: req.method,
943
+ path: req.path,
944
+ status: res.statusCode,
945
+ duration_ms: Date.now() - start,
946
+ ...logFields,
947
+ };
948
+
949
+ if (res.statusCode < 400) {
950
+ logger.info("request.completed", attrs);
951
+ } else if (!req._errorHandled) {
952
+ logger.warn("request.rejected", attrs);
953
+ }
954
+ });
955
+
956
+ next();
957
+ }
958
+ `;var Ar={id:"logger",getFiles:(r)=>{let t=[];if(r.logger==="none")return t;if(r.logger==="otel")t.push({path:"src/utils/logger.ts",content:Ir});else t.push({path:"src/utils/logger.ts",content:fr});return t.push({path:"src/middlewares/request-logger.ts",content:_r}),t},getSnippets:(r)=>{if(r.logger==="none")return{};return{imports:['import { logger, gracefulShutdown } from "./base";','import { requestLogger } from "./middlewares/request-logger";'],middleware:["app.use(requestLogger);"],shutdown:['process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));','process.on("SIGINT", () => gracefulShutdown("SIGINT"));']}}};var Nr=`import { z, type ZodType } from "zod";
959
+
960
+ export const paginationInput = z.object({
961
+ page: z.coerce.number().int().min(1).default(1),
962
+ limit: z.coerce.number().int().min(1).max(100).default(20),
963
+ });
964
+
965
+ export function paginatedOutput<T extends ZodType>(itemSchema: T) {
966
+ return z.object({
967
+ items: z.array(itemSchema),
968
+ total: z.number(),
969
+ page: z.number(),
970
+ limit: z.number(),
971
+ totalPages: z.number(),
972
+ });
973
+ }
974
+
975
+ export function paginate<T>(
976
+ items: T[],
977
+ total: number,
978
+ page: number,
979
+ limit: number,
980
+ ) {
981
+ return {
982
+ items,
983
+ total,
984
+ page,
985
+ limit,
986
+ totalPages: Math.ceil(total / limit),
987
+ };
988
+ }
989
+ `;var Or=`import { Resend } from "resend";
990
+ import { env } from "../config/env";
991
+
992
+ const resend = new Resend(env.RESEND_API_KEY);
993
+
994
+ interface SendEmailParams {
995
+ to: string;
996
+ subject: string;
997
+ html: string;
998
+ from?: string;
999
+ }
1000
+
1001
+ export async function sendEmail({ to, subject, html, from = "onboarding@resend.dev" }: SendEmailParams) {
1002
+ try {
1003
+ const { data, error } = await resend.emails.send({
1004
+ from,
1005
+ to,
1006
+ subject,
1007
+ html,
1008
+ });
1009
+
1010
+ if (error) {
1011
+ console.error("Resend API Error:", error);
1012
+ return { success: false, error };
1013
+ }
1014
+ return { success: true, data };
1015
+ } catch (error) {
1016
+ console.error("Failed to send email via Resend:", error);
1017
+ return { success: false, error };
1018
+ }
1019
+ }
1020
+ `,wr=`import nodemailer from "nodemailer";
1021
+ import { env } from "../config/env";
1022
+
1023
+ const transporter = nodemailer.createTransport({
1024
+ host: env.SMTP_HOST,
1025
+ port: env.SMTP_PORT,
1026
+ secure: env.SMTP_PORT === 465,
1027
+ auth: {
1028
+ user: env.SMTP_USER,
1029
+ pass: env.SMTP_PASS,
1030
+ },
1031
+ });
1032
+
1033
+ interface SendEmailParams {
1034
+ to: string;
1035
+ subject: string;
1036
+ html: string;
1037
+ from?: string;
1038
+ }
1039
+
1040
+ export async function sendEmail({ to, subject, html, from = '"API" <no-reply@example.com>' }: SendEmailParams) {
1041
+ try {
1042
+ const info = await transporter.sendMail({
1043
+ from,
1044
+ to,
1045
+ subject,
1046
+ html,
1047
+ });
1048
+ return { success: true, messageId: info.messageId };
1049
+ } catch (error) {
1050
+ console.error("Failed to send email via Nodemailer:", error);
1051
+ return { success: false, error };
1052
+ }
1053
+ }
1054
+ `;var Tr=`import { Inngest } from "inngest";
1055
+
1056
+ export const inngest = new Inngest({ id: "my-app" });
1057
+ `,Cr=`import { inngest } from "../client";
1058
+
1059
+ export const helloWorld = inngest.createFunction(
1060
+ { id: "hello-world", triggers: [{ event: "test/hello.world" }] },
1061
+ async ({ event, step }) => {
1062
+ await step.sleep("wait-a-moment", "1s");
1063
+ return { message: \`Hello \${event.data.email}!\` };
1064
+ },
1065
+ );
1066
+ `,Pr=`import { helloWorld } from "./functions/hello-world";
1067
+
1068
+ export const functions = [helloWorld];
1069
+ `,Lr=`import { serve } from "inngest/express";
1070
+ import { inngest } from "../inngest/client";
1071
+ import { functions } from "../inngest";
1072
+ import { healthRoute } from "./health-route";
1073
+ import { defineRoute } from "../base/define-route";
1074
+ import { z } from "zod";
1075
+
1076
+ export const inngestRoute = defineRoute({
1077
+ method: "post",
1078
+ path: "/inngest",
1079
+ output: z.any(),
1080
+ handler: serve({ client: inngest, functions }),
1081
+ });
1082
+ `;var kr={id:"extra",getFiles:(r)=>{let t=[];if(r.pagination)t.push({path:"src/utils/pagination.ts",content:Nr});if(r.email==="resend")t.push({path:"src/utils/email.ts",content:Or});else if(r.email==="nodemailer")t.push({path:"src/utils/email.ts",content:wr});if(r.inngest!=="none")t.push({path:"src/inngest/client.ts",content:Tr},{path:"src/inngest/index.ts",content:Pr},{path:"src/inngest/functions/hello-world.ts",content:Cr},{path:"src/routes/inngest-route.ts",content:Lr});if(r.formatter==="biome")t.push({path:"biome.json",content:Je});else if(r.formatter==="prettier")t.push({path:".prettierrc",content:Ze},{path:"eslint.config.js",content:Ve});return t},getSnippets:(r)=>{let t={imports:[],middleware:[]};if(r.inngest!=="none")t.imports.push('import { inngestRoute } from "./routes/inngest-route";'),t.middleware.push("registerRoute(router, inngestRoute);");return t}};var Mr={id:"infrastructure",getFiles:(r)=>{let t=[];if(r.docker)t.push({path:"Dockerfile",content:`FROM oven/bun:latest as base
1083
+ WORKDIR /usr/src/app
1084
+
1085
+ FROM base AS install
1086
+ RUN mkdir -p /temp/dev
1087
+ COPY package.json bun.lock /temp/dev/
1088
+ RUN cd /temp/dev && bun install --frozen-lockfile
1089
+
1090
+ FROM base AS prerelease
1091
+ COPY --from=install /temp/dev/node_modules node_modules
1092
+ COPY . .
1093
+
1094
+ FROM base AS release
1095
+ COPY --from=prerelease /usr/src/app/src src
1096
+ COPY --from=prerelease /usr/src/app/package.json .
1097
+ COPY --from=prerelease /usr/src/app/tsconfig.json .
1098
+
1099
+ USER bun
1100
+ EXPOSE 8000/tcp
1101
+ ENTRYPOINT [ "bun", "run", "src/app.ts" ]
1102
+ `}),t.push({path:"docker-compose.yml",content:`version: "3.9"
1103
+ services:
1104
+ app:
1105
+ build: .
1106
+ ports:
1107
+ - "8000:8000"
1108
+ environment:
1109
+ - NODE_ENV=development
1110
+ ${r.orm!=="none"?" - DATABASE_URL=postgresql://user:password@db:5432/aura_db":""}
1111
+ ${r.caching==="redis"?" - REDIS_URL=redis://redis:6379":""}
1112
+ depends_on:
1113
+ ${r.orm==="prisma"||r.orm==="drizzle"?" - db":""}
1114
+ ${r.caching==="redis"?" - redis":""}
1115
+
1116
+ ${r.orm==="prisma"||r.orm==="drizzle"?` db:
1117
+ image: postgres:15-alpine
1118
+ environment:
1119
+ - POSTGRES_USER=user
1120
+ - POSTGRES_PASSWORD=password
1121
+ - POSTGRES_DB=aura_db
1122
+ ports:
1123
+ - "5432:5432"
1124
+ `:""}
1125
+
1126
+ ${r.caching==="redis"?` redis:
1127
+ image: redis:7-alpine
1128
+ ports:
1129
+ - "6379:6379"
1130
+ `:""}
1131
+ `});if(r.ci==="github")t.push({path:".github/workflows/ci.yml",content:`name: CI
1132
+
1133
+ on:
1134
+ push:
1135
+ branches: [main]
1136
+ pull_request:
1137
+ branches: [main]
1138
+
1139
+ jobs:
1140
+ build:
1141
+ runs-on: ubuntu-latest
1142
+ steps:
1143
+ - uses: actions/checkout@v4
1144
+ - uses: oven-sh/setup-bun@v1
1145
+ - run: bun install
1146
+ - run: bunx tsc --noEmit
1147
+ ${r.formatter==="biome"?" - run: bun run lint":""}
1148
+ `});return t}};var ie=[nr,ur,xr,yr,Ar,kr,Mr];function Br(r){return ie.filter((t)=>{if(t.id==="core"||t.id==="extra")return!0;if(t.id==="infrastructure"&&(r.docker||r.ci!=="none"))return!0;if(t.id==="orm"&&r.orm!=="none")return!0;if(t.id==="auth"&&r.auth!=="none")return!0;if(t.id==="caching"&&r.caching!=="none")return!0;if(t.id==="logger"&&r.logger!=="none")return!0;return!1})}function Gr(r,t){let o=Br(r),i=[];for(let n of o)i.push(...n.getFiles(r,t));return i}function zr(r){let t=Br(r),o={imports:[],init:[],middleware:[],errorHandler:[],shutdown:[]};for(let i of t){let n=i.getSnippets?.(r);if(n){if(n.imports)o.imports.push(...n.imports);if(n.init)o.init.push(...n.init);if(n.middleware)o.middleware.push(...n.middleware);if(n.errorHandler)o.errorHandler.push(...n.errorHandler);if(n.shutdown)o.shutdown.push(...n.shutdown)}}return o}async function $r(r,t,o){let i=$();i.start("Scaffolding your project...");let n=Gr(o,t),a=zr(o);n.push({path:"src/app.ts",content:Qe(a)});for(let e of n){let c=Ur.join(r,e.path),d=Ur.dirname(c);await Hr.mkdir(d,{recursive:!0}),await Hr.writeFile(c,e.content)}return i.stop("Project generated successfully."),r}import se from"path";var qr={name:"@ahmadjavaiddev/aura",version:"0.0.1",type:"module",description:"Interactive CLI scaffolder to generate custom API structures",main:"./dist/index.js",bin:{aura:"dist/index.js"},files:["dist"],publishConfig:{access:"public"},scripts:{start:"bun run src/cli.ts",build:"bun build ./src/cli.ts --outfile ./dist/index.js --target node --bundle --minify",prepublishOnly:"bun run build"},dependencies:{"@clack/prompts":"^0.8.2"},devDependencies:{"@types/bun":"latest","@types/node":"^22.0.0",typescript:"^5.0.0"}};import I from"fs/promises";import A from"path";async function jr(r,t,o){let i=$();i.start(`Injecting ${t} into your project...`);let n=ie.find((l)=>l.id===t);if(!n)throw Error(`Feature ${t} not found.`);let a=n.getFiles(o,A.basename(r));for(let l of a){let m=A.join(r,l.path),p=A.dirname(m);await I.mkdir(p,{recursive:!0}),await I.writeFile(m,l.content)}let e=n.getDependencies?.(o),c=n.getDevDependencies?.(o);if(e||c){let l=A.join(r,"package.json");try{let m=await I.readFile(l,"utf-8"),p=JSON.parse(m);if(e)p.dependencies={...p.dependencies,...e};if(c)p.devDependencies={...p.devDependencies,...c};await I.writeFile(l,JSON.stringify(p,null,2))}catch(m){console.warn("Could not update package.json, make sure it exists.")}}let d=A.join(r,"src","app.ts");try{let l=await I.readFile(d,"utf-8"),m=n.getSnippets?.(o);if(m){if(l=T(l,"// [AURA_IMPORTS]",m.imports?.join(`
1149
+ `)),l=T(l,"// [AURA_INIT]",m.init?.map((p)=>` ${p}`).join(`
1150
+ `)),l=T(l,"// [AURA_MIDDLEWARE]",m.middleware?.map((p)=>` ${p}`).join(`
1151
+ `)),l=T(l,"// [AURA_ERROR_HANDLER]",m.errorHandler?.map((p)=>` ${p}`).join(`
1152
+ `)),l=T(l,"// [AURA_SHUTDOWN]",m.shutdown?.map((p)=>` ${p}`).join(`
1153
+ `)),await I.writeFile(d,l),m.envTs&&m.envTs.length>0){let p=A.join(r,"src","config","env.ts"),x=await I.readFile(p,"utf-8");x=T(x,"// [AURA_ENV_KEYS]",m.envTs.map((v)=>` ${v},`).join(`
1154
+ `)),await I.writeFile(p,x)}}}catch(l){console.warn("Could not inject snippets. Are you in a valid Aura project directory?")}let u=n.getEnvVars?.(o);if(u){let l=A.join(r,".env");try{await I.appendFile(l,`
1155
+ `+u)}catch(m){console.warn("Could not update .env file.")}}i.stop(`Successfully added ${t} to your project.`)}function T(r,t,o){if(!o||o.trim()==="")return r;if(r.includes(t))return r.replace(t,`${o}
1156
+ ${t}`);return r}import Wr from"fs/promises";async function Ht(){let r=process.argv.slice(2);if(r.includes("--version")||r.includes("-v"))console.log(`v${qr.version}`),process.exit(0);if(r.includes("--help")||r.includes("-h"))console.log(`
1157
+ Usage: aura [project-name]
1158
+ aura add [feature]
1159
+
1160
+ Options:
1161
+ -v, --version Show version number
1162
+ -h, --help Show help information
1163
+
1164
+ Examples:
1165
+ npx @ahmadjavaiddev/aura my-new-app
1166
+ aura .
1167
+ aura add redis
1168
+ `),process.exit(0);if(r[0]==="add"){let n=r[1];if(!n){let d=await R({message:"Select a feature to add to your project:",options:[{value:"redis",label:"Caching: Redis"},{value:"memory",label:"Caching: In-Memory"},{value:"prisma",label:"ORM: Prisma"},{value:"drizzle",label:"ORM: Drizzle"},{value:"mongoose",label:"ORM: Mongoose"},{value:"clerk",label:"Auth: Clerk"},{value:"betterauth",label:"Auth: Better-Auth"},{value:"custom-auth",label:"Auth: Custom JWT"},{value:"otel",label:"Logger: OpenTelemetry"},{value:"console",label:"Logger: Console"},{value:"resend",label:"Email: Resend"},{value:"nodemailer",label:"Email: Nodemailer"},{value:"pagination",label:"Extra: Pagination utils"},{value:"inngest",label:"Extra: Inngest (Background jobs)"},{value:"docker",label:"Infrastructure: Docker (Dockerfile + Compose)"},{value:"github-actions",label:"Infrastructure: GitHub Actions (CI)"}]});if(O(d))L("Operation cancelled."),process.exit(0);n=d}if(!await Wr.access(se.join(process.cwd(),"src/base/index.ts")).then(()=>!0).catch(()=>!1))console.error("This does not appear to be an Aura project. Cannot add features here."),process.exit(1);let e={caching:"none",logger:"none",orm:"none",rateLimit:"none",auth:"none",email:"none",pagination:!1,formatter:"none",inngest:"none",docker:!1,ci:"none"},c="";if(n==="redis")c="caching",e.caching="redis";else if(n==="memory")c="caching",e.caching="memory";else if(n==="prisma")c="orm",e.orm="prisma";else if(n==="drizzle")c="orm",e.orm="drizzle";else if(n==="mongoose")c="orm",e.orm="mongoose";else if(n==="clerk")c="auth",e.auth="clerk";else if(n==="betterauth")c="auth",e.auth="betterauth";else if(n==="custom-auth")c="auth",e.auth="custom";else if(n==="otel")c="logger",e.logger="otel";else if(n==="console")c="logger",e.logger="console";else if(n==="resend")c="extra",e.email="resend";else if(n==="nodemailer")c="extra",e.email="nodemailer";else if(n==="pagination")c="extra",e.pagination=!0;else if(n==="inngest")c="extra",e.inngest="basic";else if(n==="docker")c="infrastructure",e.docker=!0;else if(n==="github-actions")c="infrastructure",e.ci="github";else console.error(`Unknown feature: ${n}`),console.error("Available features: redis, memory, prisma, drizzle, mongoose, clerk, betterauth, custom-auth, otel, console, resend, nodemailer, pagination, inngest, docker, github-actions"),process.exit(1);oe(`\uD83D\uDE80 Adding ${n} to Aura project...`),await jr(process.cwd(),c,e),ne(`✨ ${n} added successfully! Remember to run 'bun install'.`),process.exit(0)}oe("\uD83D\uDE80 Welcome to Aura!");let t=r[0];if(!t){let n=await Ge({message:"What is your project named?",placeholder:"my-api",validate:(a)=>{if(!a)return"Please enter a path.";return}});if(O(n))L("Operation cancelled."),process.exit(0);t=n}let o=await $e(),i=se.resolve(process.cwd(),t);await $r(i,t,o),ne(`✨ Project scaffolding complete!
1169
+
1170
+ Next steps:
1171
+ cd ${t}
1172
+ bun install${o.orm==="prisma"?`
1173
+ bun run db:generate`:""}
1174
+ ${o.orm!=="none"?`# Note: Make sure your ${o.orm} database is running`:""}
1175
+ bun update
1176
+ bun run dev
1177
+ `)}Ht().catch(console.error);