@r5n/sisyphus 0.3.42 → 0.4.0
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.
- package/dist/cli.js +374 -176
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,118 +1,124 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
var
|
|
2
|
+
var ie=Object.create;var{getPrototypeOf:ae,defineProperty:ln,getOwnPropertyNames:ce}=Object;var fe=Object.prototype.hasOwnProperty;var jt=(t,o,s)=>{s=t!=null?ie(ae(t)):{};let e=o||!t||!t.__esModule?ln(s,"default",{value:t,enumerable:!0}):s;for(let r of ce(t))if(!fe.call(e,r))ln(e,r,{get:()=>t[r],enumerable:!0});return e};var oo=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var me=(t,o)=>{for(var s in o)ln(t,s,{get:o[s],enumerable:!0,configurable:!0,set:(e)=>o[s]=()=>e})};var U=(t,o)=>()=>(t&&(o=t(t=0)),o);var le=import.meta.require;function hn(t){return(o)=>he?`${t}${o}${eo.reset}`:o}function so({bright:t=!1,color:o}){let s=Bun.color(o,"ansi");if(!s)return"";return t?ge[s]||s:s}var he,pe,ue,eo,ge,be,ye,h;var pn=U(()=>{he=!process.env.NO_COLOR&&(process.env.FORCE_COLOR||process.stdout.isTTY),pe=["blue","cyan","gray","green","magenta","red","white","yellow"],ue=["bold","dim","italic","underline","reset"],eo={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",reset:"\x1B[0m",underline:"\x1B[4m"},ge={"\x1B[30m":"\x1B[90m","\x1B[31m":"\x1B[91m","\x1B[32m":"\x1B[92m","\x1B[33m":"\x1B[93m","\x1B[34m":"\x1B[94m","\x1B[35m":"\x1B[95m","\x1B[36m":"\x1B[96m","\x1B[37m":"\x1B[97m"};be=pe.reduce((t,o)=>{return t[o]=hn(so({color:o})),t[`${o}Bright`]=hn(so({bright:!0,color:o})),t},{}),ye=ue.reduce((t,o)=>{return t[o]=hn(eo[o]),t},{}),h={...be,...ye}});function Ct({prefix:t,level:o,message:s}){let e=new Date().toISOString().split("T")[1]?.split(".")[0]||"",r=t?`[${t}] `:"";return`${h.dim(e||"")} ${o} ${r}${s}`}var x=({prefix:t="",level:o=process.env.DEBUG?0:1}={})=>{function s(...a){if(o<=0){let c=a.join(" ");console.log(Ct({level:h.dim("DEBUG"),message:c,prefix:t}))}}function e(...a){if(o<=1){let c=a.join(" ");console.info(Ct({level:h.cyan("INFO "),message:c,prefix:t}))}}function r(...a){if(o<=2){let c=a.join(" ");console.warn(Ct({level:h.yellow("WARN "),message:c,prefix:t}))}}function i(...a){if(o<=3){let c=a.join(" ");console.error(Ct({level:h.red("ERROR"),message:c,prefix:t}))}}function n(a){return x({level:o,prefix:`${t}:${a}`})}return{child:n,debug:s,error:i,info:e,warn:r}},un;var ro=U(()=>{pn();un=x()});var P=U(()=>{pn();ro()});var f;var io=U(()=>{P();f={arrow:h.yellow,bold:h.bold,boolean:h.cyan,bullet:h.yellow,busy:h.yellow,command:h.green,dim:h.dim,error:h.red,flag:h.yellow,info:h.cyan,number:h.magenta,offline:h.red,online:h.green,separator:h.dim,string:h.green,success:h.green,value:h.cyan,warning:h.yellow}});var yn=oo((Ca,ao)=>{var bn={to(t,o){if(!o)return`\x1B[${t+1}G`;return`\x1B[${o+1};${t+1}H`},move(t,o){let s="";if(t<0)s+=`\x1B[${-t}D`;else if(t>0)s+=`\x1B[${t}C`;if(o<0)s+=`\x1B[${-o}A`;else if(o>0)s+=`\x1B[${o}B`;return s},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},de={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},we={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let o="";for(let s=0;s<t;s++)o+=this.line+(s<t-1?bn.up():"");if(t)o+=bn.left;return o}};ao.exports={cursor:bn,scroll:de,erase:we,beep:"\x07"}});var wn=oo((La,dn)=>{var Ht=process||{},co=Ht.argv||[],Lt=Ht.env||{},$e=!(!!Lt.NO_COLOR||co.includes("--no-color"))&&(!!Lt.FORCE_COLOR||co.includes("--color")||Ht.platform==="win32"||(Ht.stdout||{}).isTTY&&Lt.TERM!=="dumb"||!!Lt.CI),Se=(t,o,s=t)=>(e)=>{let r=""+e,i=r.indexOf(o,t.length);return~i?t+xe(r,o,s,i)+o:t+r+o},xe=(t,o,s,e)=>{let r="",i=0;do r+=t.substring(i,e)+s,i=e+o.length,e=t.indexOf(o,i);while(~e);return r+t.substring(i)},fo=(t=$e)=>{let o=t?Se:()=>String;return{isColorSupported:t,reset:o("\x1B[0m","\x1B[0m"),bold:o("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:o("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:o("\x1B[3m","\x1B[23m"),underline:o("\x1B[4m","\x1B[24m"),inverse:o("\x1B[7m","\x1B[27m"),hidden:o("\x1B[8m","\x1B[28m"),strikethrough:o("\x1B[9m","\x1B[29m"),black:o("\x1B[30m","\x1B[39m"),red:o("\x1B[31m","\x1B[39m"),green:o("\x1B[32m","\x1B[39m"),yellow:o("\x1B[33m","\x1B[39m"),blue:o("\x1B[34m","\x1B[39m"),magenta:o("\x1B[35m","\x1B[39m"),cyan:o("\x1B[36m","\x1B[39m"),white:o("\x1B[37m","\x1B[39m"),gray:o("\x1B[90m","\x1B[39m"),bgBlack:o("\x1B[40m","\x1B[49m"),bgRed:o("\x1B[41m","\x1B[49m"),bgGreen:o("\x1B[42m","\x1B[49m"),bgYellow:o("\x1B[43m","\x1B[49m"),bgBlue:o("\x1B[44m","\x1B[49m"),bgMagenta:o("\x1B[45m","\x1B[49m"),bgCyan:o("\x1B[46m","\x1B[49m"),bgWhite:o("\x1B[47m","\x1B[49m"),blackBright:o("\x1B[90m","\x1B[39m"),redBright:o("\x1B[91m","\x1B[39m"),greenBright:o("\x1B[92m","\x1B[39m"),yellowBright:o("\x1B[93m","\x1B[39m"),blueBright:o("\x1B[94m","\x1B[39m"),magentaBright:o("\x1B[95m","\x1B[39m"),cyanBright:o("\x1B[96m","\x1B[39m"),whiteBright:o("\x1B[97m","\x1B[39m"),bgBlackBright:o("\x1B[100m","\x1B[49m"),bgRedBright:o("\x1B[101m","\x1B[49m"),bgGreenBright:o("\x1B[102m","\x1B[49m"),bgYellowBright:o("\x1B[103m","\x1B[49m"),bgBlueBright:o("\x1B[104m","\x1B[49m"),bgMagentaBright:o("\x1B[105m","\x1B[49m"),bgCyanBright:o("\x1B[106m","\x1B[49m"),bgWhiteBright:o("\x1B[107m","\x1B[49m")}};dn.exports=fo();dn.exports.createColors=fo});import{stdin as $o,stdout as So}from"process";import*as ot from"readline";import mo from"readline";import{Writable as ve}from"stream";function Ee({onlyFirst:t=!1}={}){let o=["[\\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(o,t?void 0:"g")}function vo(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(je,"")}function Eo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Rt(t,o={}){if(typeof t!="string"||t.length===0||(o={ambiguousIsNarrow:!0,...o},t=vo(t),t.length===0))return 0;t=t.replace(Ie()," ");let s=o.ambiguousIsNarrow?1:2,e=0;for(let r of t){let i=r.codePointAt(0);if(i<=31||i>=127&&i<=159||i>=768&&i<=879)continue;switch(Oe.eastAsianWidth(r)){case"F":case"W":e+=2;break;case"A":e+=s;break;default:e+=1}}return e}function _e(){let t=new Map;for(let[o,s]of Object.entries(M)){for(let[e,r]of Object.entries(s))M[e]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},s[e]=M[e],t.set(r[0],r[1]);Object.defineProperty(M,o,{value:s,enumerable:!1})}return Object.defineProperty(M,"codes",{value:t,enumerable:!1}),M.color.close="\x1B[39m",M.bgColor.close="\x1B[49m",M.color.ansi=lo(),M.color.ansi256=ho(),M.color.ansi16m=po(),M.bgColor.ansi=lo($n),M.bgColor.ansi256=ho($n),M.bgColor.ansi16m=po($n),Object.defineProperties(M,{rgbToAnsi256:{value:(o,s,e)=>o===s&&s===e?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(s/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:(o)=>{let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!s)return[0,0,0];let[e]=s;e.length===3&&(e=[...e].map((i)=>i+i).join(""));let r=Number.parseInt(e,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:(o)=>M.rgbToAnsi256(...M.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value:(o)=>{if(o<8)return 30+o;if(o<16)return 90+(o-8);let s,e,r;if(o>=232)s=((o-232)*10+8)/255,e=s,r=s;else{o-=16;let a=o%36;s=Math.floor(o/36)/5,e=Math.floor(a/6)/5,r=a%6/5}let i=Math.max(s,e,r)*2;if(i===0)return 30;let n=30+(Math.round(r)<<2|Math.round(e)<<1|Math.round(s));return i===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(o,s,e)=>M.ansi256ToAnsi(M.rgbToAnsi256(o,s,e)),enumerable:!1},hexToAnsi:{value:(o)=>M.ansi256ToAnsi(M.hexToAnsi256(o)),enumerable:!1}}),M}function bo(t,o,s){return String(t).normalize().replace(/\r\n/g,`
|
|
3
3
|
`).split(`
|
|
4
|
-
`).map((
|
|
5
|
-
`)}function
|
|
6
|
-
`),
|
|
7
|
-
`),
|
|
8
|
-
`),
|
|
9
|
-
`).length-1;this.output.write(
|
|
10
|
-
`);this.output.write(s
|
|
11
|
-
`).slice(
|
|
12
|
-
`)),this._prevFrame=n;return}this.output.write(P.erase.down())}this.output.write(n),this.state==="initial"&&(this.state="active"),this._prevFrame=n}}}var P,rt,Ir,et,Gr,Ur,Nr=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},Hr,so=10,Zo=(n=0)=>(t)=>`\x1B[${t+n}m`,Qo=(n=0)=>(t)=>`\x1B[${38+n};5;${t}m`,To=(n=0)=>(t,r,s)=>`\x1B[${38+n};2;${t};${r};${s}m`,M,Cr,Lr,Pr,Gn,Jr=39,co="\x07",ct="[",Br="]",at="m",ao,Vo=(n)=>`${Gn.values().next().value}${ct}${n}${at}`,ko=(n)=>`${Gn.values().next().value}${ao}${n}${co}`,Xr=(n)=>n.split(" ").map((t)=>wn(t)),io=(n,t,r)=>{let s=[...t],i=!1,e=!1,o=wn(st(n[n.length-1]));for(let[c,a]of s.entries()){let l=wn(a);if(o+l<=r?n[n.length-1]+=a:(n.push(a),o=0),Gn.has(a)&&(i=!0,e=s.slice(c+1).join("").startsWith(ao)),i){e?a===co&&(i=!1,e=!1):a===at&&(i=!1);continue}o+=l,o===r&&c<s.length-1&&(n.push(""),o=0)}!o&&n[n.length-1].length>0&&n.length>1&&(n[n.length-2]+=n.pop())},Wr=(n)=>{let t=n.split(" "),r=t.length;for(;r>0&&!(wn(t[r-1])>0);)r--;return r===t.length?n:t.slice(0,r).join(" ")+t.slice(r).join("")},zr=(n,t,r={})=>{if(r.trim!==!1&&n.trim()==="")return"";let s="",i,e,o=Xr(n),c=[""];for(let[l,f]of n.split(" ").entries()){r.trim!==!1&&(c[c.length-1]=c[c.length-1].trimStart());let p=wn(c[c.length-1]);if(l!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(c.push(""),p=0),(p>0||r.trim===!1)&&(c[c.length-1]+=" ",p++)),r.hard&&o[l]>t){let d=t-p,w=1+Math.floor((o[l]-d-1)/t);Math.floor((o[l]-1)/t)<w&&c.push(""),io(c,f,t);continue}if(p+o[l]>t&&p>0&&o[l]>0){if(r.wordWrap===!1&&p<t){io(c,f,t);continue}c.push("")}if(p+o[l]>t&&r.wordWrap===!1){io(c,f,t);continue}c[c.length-1]+=f}r.trim!==!1&&(c=c.map((l)=>Wr(l)));let a=[...c.join(`
|
|
13
|
-
`)];for(let[l
|
|
14
|
-
`?(
|
|
15
|
-
`&&(
|
|
16
|
-
${
|
|
17
|
-
`,
|
|
18
|
-
${b.default.yellow(
|
|
19
|
-
${b.default.yellow(
|
|
20
|
-
`;case"submit":return`${
|
|
21
|
-
${b.default.gray(
|
|
22
|
-
${b.default.cyan(
|
|
23
|
-
`}}}).prompt(),
|
|
24
|
-
${
|
|
25
|
-
`,
|
|
26
|
-
${b.default.gray(
|
|
27
|
-
${b.default.cyan(
|
|
28
|
-
`}}}).prompt()},
|
|
29
|
-
${
|
|
30
|
-
`;switch(this.state){case"submit":return`${
|
|
31
|
-
${b.default.gray(
|
|
32
|
-
${b.default.cyan(
|
|
33
|
-
${b.default.cyan(
|
|
34
|
-
`}}}).prompt()},
|
|
35
|
-
${b.default.reset(b.default.dim(`Press ${b.default.gray(b.default.bgWhite(b.default.inverse(" space ")))} to select, ${b.default.gray(b.default.bgWhite(b.default.inverse(" enter ")))} to submit`))}`},render(){let
|
|
36
|
-
${
|
|
37
|
-
`,
|
|
38
|
-
${b.default.gray(
|
|
39
|
-
`).map((
|
|
40
|
-
`);return`${
|
|
41
|
-
${b.default.yellow(
|
|
42
|
-
${
|
|
43
|
-
`}default:return`${
|
|
44
|
-
${b.default.cyan(
|
|
45
|
-
${b.default.cyan(
|
|
46
|
-
`}}}).prompt()},
|
|
47
|
-
${
|
|
4
|
+
`).map((e)=>Ce(e,o,s)).join(`
|
|
5
|
+
`)}function jn(t,o){if(typeof t=="string")return Jt.aliases.get(t)===o;for(let s of t)if(s!==void 0&&jn(s,o))return!0;return!1}function He(t,o){if(t===o)return;let s=t.split(`
|
|
6
|
+
`),e=o.split(`
|
|
7
|
+
`),r=[];for(let i=0;i<Math.max(s.length,e.length);i++)s[i]!==e[i]&&r.push(i);return r}function F(t){return t===xn}function qt(t,o){let s=t;s.isTTY&&s.setRawMode(o)}function Ao({input:t=$o,output:o=So,overwrite:s=!0,hideCursor:e=!0}={}){let r=ot.createInterface({input:t,output:o,prompt:"",tabSize:1});ot.emitKeypressEvents(t,r),t.isTTY&&t.setRawMode(!0);let i=(n,{name:a,sequence:c})=>{let m=String(n);if(jn([m,a,c],"cancel")){e&&o.write(J.cursor.show),process.exit(0);return}if(!s)return;ot.moveCursor(o,a==="return"?0:-1,a==="return"?-1:0,()=>{ot.clearLine(o,1,()=>{t.once("keypress",i)})})};return e&&o.write(J.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),e&&o.write(J.cursor.show),t.isTTY&&!qe&&t.setRawMode(!1),r.terminal=!1,r.close()}}class Ot{constructor(t,o=!0){z(this,"input"),z(this,"output"),z(this,"_abortSignal"),z(this,"rl"),z(this,"opts"),z(this,"_render"),z(this,"_track",!1),z(this,"_prevFrame",""),z(this,"_subscribers",new Map),z(this,"_cursor",0),z(this,"state","initial"),z(this,"error",""),z(this,"value");let{input:s=$o,output:e=So,render:r,signal:i,...n}=t;this.opts=n,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=o,this._abortSignal=i,this.input=s,this.output=e}unsubscribe(){this._subscribers.clear()}setSubscriber(t,o){let s=this._subscribers.get(t)??[];s.push(o),this._subscribers.set(t,s)}on(t,o){this.setSubscriber(t,{cb:o})}once(t,o){this.setSubscriber(t,{cb:o,once:!0})}emit(t,...o){let s=this._subscribers.get(t)??[],e=[];for(let r of s)r.cb(...o),r.once&&e.push(()=>s.splice(s.indexOf(r),1));for(let r of e)r()}prompt(){return new Promise((t,o)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(xn);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let s=new ve;s._write=(e,r,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(s),this.rl=mo.createInterface({input:this.input,output:s,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),mo.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),qt(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(J.cursor.show),this.output.off("resize",this.render),qt(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(J.cursor.show),this.output.off("resize",this.render),qt(this.input,!1),t(xn)})})}onKeypress(t,o){if(this.state==="error"&&(this.state="active"),o?.name&&(!this._track&&Jt.aliases.has(o.name)&&this.emit("cursor",Jt.aliases.get(o.name)),Jt.actions.has(o.name)&&this.emit("cursor",o.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),o?.name==="return"){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}jn([t,o?.name,o?.sequence],"cancel")&&(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(`
|
|
8
|
+
`),qt(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=bo(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
9
|
+
`).length-1;this.output.write(J.cursor.move(-999,t*-1))}render(){let t=bo(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(J.cursor.hide);else{let o=He(this._prevFrame,t);if(this.restoreCursor(),o&&o?.length===1){let s=o[0];this.output.write(J.cursor.move(0,s)),this.output.write(J.erase.lines(1));let e=t.split(`
|
|
10
|
+
`);this.output.write(e[s]),this._prevFrame=t,this.output.write(J.cursor.move(0,e.length-s-1));return}if(o&&o?.length>1){let s=o[0];this.output.write(J.cursor.move(0,s)),this.output.write(J.erase.down());let e=t.split(`
|
|
11
|
+
`).slice(s);this.output.write(e.join(`
|
|
12
|
+
`)),this._prevFrame=t;return}this.output.write(J.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}var J,xo,je,jo,Re,Oe,Ae=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},Ie,$n=10,lo=(t=0)=>(o)=>`\x1B[${o+t}m`,ho=(t=0)=>(o)=>`\x1B[${38+t};5;${o}m`,po=(t=0)=>(o,s,e)=>`\x1B[${38+t};2;${o};${s};${e}m`,M,Pe,Be,Me,Wt,Ge=39,vn="\x07",Ro="[",Ne="]",Oo="m",En,uo=(t)=>`${Wt.values().next().value}${Ro}${t}${Oo}`,go=(t)=>`${Wt.values().next().value}${En}${t}${vn}`,Te=(t)=>t.split(" ").map((o)=>Rt(o)),Sn=(t,o,s)=>{let e=[...o],r=!1,i=!1,n=Rt(vo(t[t.length-1]));for(let[a,c]of e.entries()){let m=Rt(c);if(n+m<=s?t[t.length-1]+=c:(t.push(c),n=0),Wt.has(c)&&(r=!0,i=e.slice(a+1).join("").startsWith(En)),r){i?c===vn&&(r=!1,i=!1):c===Oo&&(r=!1);continue}n+=m,n===s&&a<e.length-1&&(t.push(""),n=0)}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Ue=(t)=>{let o=t.split(" "),s=o.length;for(;s>0&&!(Rt(o[s-1])>0);)s--;return s===o.length?t:o.slice(0,s).join(" ")+o.slice(s).join("")},Ce=(t,o,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let e="",r,i,n=Te(t),a=[""];for(let[m,l]of t.split(" ").entries()){s.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=Rt(a[a.length-1]);if(m!==0&&(p>=o&&(s.wordWrap===!1||s.trim===!1)&&(a.push(""),p=0),(p>0||s.trim===!1)&&(a[a.length-1]+=" ",p++)),s.hard&&n[m]>o){let g=o-p,d=1+Math.floor((n[m]-g-1)/o);Math.floor((n[m]-1)/o)<d&&a.push(""),Sn(a,l,o);continue}if(p+n[m]>o&&p>0&&n[m]>0){if(s.wordWrap===!1&&p<o){Sn(a,l,o);continue}a.push("")}if(p+n[m]>o&&s.wordWrap===!1){Sn(a,l,o);continue}a[a.length-1]+=l}s.trim!==!1&&(a=a.map((m)=>Ue(m)));let c=[...a.join(`
|
|
13
|
+
`)];for(let[m,l]of c.entries()){if(e+=l,Wt.has(l)){let{groups:g}=new RegExp(`(?:\\${Ro}(?<code>\\d+)m|\\${En}(?<uri>.*)${vn})`).exec(c.slice(m).join(""))||{groups:{}};if(g.code!==void 0){let d=Number.parseFloat(g.code);r=d===Ge?void 0:d}else g.uri!==void 0&&(i=g.uri.length===0?void 0:g.uri)}let p=Me.codes.get(Number(r));c[m+1]===`
|
|
14
|
+
`?(i&&(e+=go("")),r&&p&&(e+=uo(p))):l===`
|
|
15
|
+
`&&(r&&p&&(e+=uo(r)),i&&(e+=go(i)))}return e},Le,Jt,qe,xn,Je,We=(t,o,s)=>(o in t)?Je(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,z=(t,o,s)=>(We(t,typeof o!="symbol"?o+"":o,s),s),Rn,Xe,ze,Ye=(t,o,s)=>(o in t)?ze(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,yo=(t,o,s)=>(Ye(t,typeof o!="symbol"?o+"":o,s),s),Io,Ke,Ze=(t,o,s)=>(o in t)?Ke(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,wo=(t,o,s)=>(Ze(t,typeof o!="symbol"?o+"":o,s),s),On,An;var In=U(()=>{J=jt(yn(),1),xo=jt(wn(),1);je=Ee();jo={exports:{}};(function(t){var o={};t.exports=o,o.eastAsianWidth=function(e){var r=e.charCodeAt(0),i=e.length==2?e.charCodeAt(1):0,n=r;return 55296<=r&&r<=56319&&56320<=i&&i<=57343&&(r&=1023,i&=1023,n=r<<10|i,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},o.characterLength=function(e){var r=this.eastAsianWidth(e);return r=="F"||r=="W"||r=="A"?2:1};function s(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}o.length=function(e){for(var r=s(e),i=0,n=0;n<r.length;n++)i=i+this.characterLength(r[n]);return i},o.slice=function(e,r,i){textLen=o.length(e),r=r||0,i=i||1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var n="",a=0,c=s(e),m=0;m<c.length;m++){var l=c[m],p=o.length(l);if(a>=r-(p==2?1:0))if(a+p<=i)n+=l;else break;a+=p}return n}})(jo);Re=jo.exports,Oe=Eo(Re),Ie=Eo(Ae);M={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(M.modifier);Pe=Object.keys(M.color),Be=Object.keys(M.bgColor);[...Pe];Me=_e(),Wt=new Set(["\x1B","\x9B"]),En=`${Ne}8;;`;Le=["up","down","left","right","space","enter","cancel"],Jt={actions:new Set(Le),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};qe=globalThis.process.platform.startsWith("win"),xn=Symbol("clack:cancel");Je=Object.defineProperty;Rn=class Rn extends Ot{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(o)=>{this.output.write(J.cursor.move(0,-1)),this.value=o,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};Xe=new WeakMap;ze=Object.defineProperty,Io=class extends Ot{constructor(t){super(t,!1),yo(this,"options"),yo(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:o})=>o===t.cursorAt),0),this.on("key",(o)=>{o==="a"&&this.toggleAll()}),this.on("cursor",(o)=>{switch(o){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 t=this.value.length===this.options.length;this.value=t?[]:this.options.map((o)=>o.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter((o)=>o!==this._value):[...this.value,this._value]}},Ke=Object.defineProperty;On=class On extends Ot{constructor(t){super(t,!1),wo(this,"options"),wo(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:o})=>o===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(o)=>{switch(o){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}};An=class An extends Ot{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let t=this.value.slice(0,this.cursor),[o,...s]=this.value.slice(this.cursor);return`${t}${xo.default.inverse(o)}${s.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}});import{stripVTControlCharacters as Pn}from"util";import K from"process";function Qe(){return K.platform!=="win32"?K.env.TERM!=="linux":!!K.env.CI||!!K.env.WT_SESSION||!!K.env.TERMINUS_SUBLIME||K.env.ConEmuTask==="{cmd::Cmder}"||K.env.TERM_PROGRAM==="Terminus-Sublime"||K.env.TERM_PROGRAM==="vscode"||K.env.TERM==="xterm-256color"||K.env.TERM==="alacritty"||K.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var b,Xt,Bn,C=(t,o)=>Bn?t:o,Ve,_o,Mo,zt,ke,A,st,_n,Mn,Fe,Po,De,Fa,Bo,tr,nr,or,sr,er,rr,ir,Yt=(t)=>{switch(t){case"initial":case"active":return b.default.cyan(Ve);case"cancel":return b.default.red(_o);case"error":return b.default.yellow(Mo);case"submit":return b.default.green(zt)}},Gn=(t)=>{let{cursor:o,options:s,style:e}=t,r=t.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),n=Math.min(i,Math.max(r,5)),a=0;o>=a+n-3?a=Math.max(Math.min(o-n+3,s.length-n),0):o<a+2&&(a=Math.max(o-2,0));let c=n<s.length&&a>0,m=n<s.length&&a+n<s.length;return s.slice(a,a+n).map((l,p,g)=>{let d=p===0&&c,u=p===g.length-1&&m;return d||u?b.default.dim("..."):e(l,p+a===o)})},W=(t)=>new An({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let o=`${b.default.gray(A)}
|
|
16
|
+
${Yt(this.state)} ${t.message}
|
|
17
|
+
`,s=t.placeholder?b.default.inverse(t.placeholder[0])+b.default.dim(t.placeholder.slice(1)):b.default.inverse(b.default.hidden("_")),e=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${o.trim()}
|
|
18
|
+
${b.default.yellow(A)} ${e}
|
|
19
|
+
${b.default.yellow(st)} ${b.default.yellow(this.error)}
|
|
20
|
+
`;case"submit":return`${o}${b.default.gray(A)} ${b.default.dim(this.value||t.placeholder)}`;case"cancel":return`${o}${b.default.gray(A)} ${b.default.strikethrough(b.default.dim(this.value??""))}${this.value?.trim()?`
|
|
21
|
+
${b.default.gray(A)}`:""}`;default:return`${o}${b.default.cyan(A)} ${e}
|
|
22
|
+
${b.default.cyan(st)}
|
|
23
|
+
`}}}).prompt(),G=(t)=>{let o=t.active??"Yes",s=t.inactive??"No";return new Rn({active:o,inactive:s,initialValue:t.initialValue??!0,render(){let e=`${b.default.gray(A)}
|
|
24
|
+
${Yt(this.state)} ${t.message}
|
|
25
|
+
`,r=this.value?o:s;switch(this.state){case"submit":return`${e}${b.default.gray(A)} ${b.default.dim(r)}`;case"cancel":return`${e}${b.default.gray(A)} ${b.default.strikethrough(b.default.dim(r))}
|
|
26
|
+
${b.default.gray(A)}`;default:return`${e}${b.default.cyan(A)} ${this.value?`${b.default.green(_n)} ${o}`:`${b.default.dim(Mn)} ${b.default.dim(o)}`} ${b.default.dim("/")} ${this.value?`${b.default.dim(Mn)} ${b.default.dim(s)}`:`${b.default.green(_n)} ${s}`}
|
|
27
|
+
${b.default.cyan(st)}
|
|
28
|
+
`}}}).prompt()},et=(t)=>{let o=(s,e)=>{let r=s.label??String(s.value);switch(e){case"selected":return`${b.default.dim(r)}`;case"active":return`${b.default.green(_n)} ${r} ${s.hint?b.default.dim(`(${s.hint})`):""}`;case"cancelled":return`${b.default.strikethrough(b.default.dim(r))}`;default:return`${b.default.dim(Mn)} ${b.default.dim(r)}`}};return new On({options:t.options,initialValue:t.initialValue,render(){let s=`${b.default.gray(A)}
|
|
29
|
+
${Yt(this.state)} ${t.message}
|
|
30
|
+
`;switch(this.state){case"submit":return`${s}${b.default.gray(A)} ${o(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${b.default.gray(A)} ${o(this.options[this.cursor],"cancelled")}
|
|
31
|
+
${b.default.gray(A)}`;default:return`${s}${b.default.cyan(A)} ${Gn({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(e,r)=>o(e,r?"active":"inactive")}).join(`
|
|
32
|
+
${b.default.cyan(A)} `)}
|
|
33
|
+
${b.default.cyan(st)}
|
|
34
|
+
`}}}).prompt()},Kt=(t)=>{let o=(s,e)=>{let r=s.label??String(s.value);return e==="active"?`${b.default.cyan(Fe)} ${r} ${s.hint?b.default.dim(`(${s.hint})`):""}`:e==="selected"?`${b.default.green(Po)} ${b.default.dim(r)} ${s.hint?b.default.dim(`(${s.hint})`):""}`:e==="cancelled"?`${b.default.strikethrough(b.default.dim(r))}`:e==="active-selected"?`${b.default.green(Po)} ${r} ${s.hint?b.default.dim(`(${s.hint})`):""}`:e==="submitted"?`${b.default.dim(r)}`:`${b.default.dim(De)} ${b.default.dim(r)}`};return new Io({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.
|
|
35
|
+
${b.default.reset(b.default.dim(`Press ${b.default.gray(b.default.bgWhite(b.default.inverse(" space ")))} to select, ${b.default.gray(b.default.bgWhite(b.default.inverse(" enter ")))} to submit`))}`},render(){let s=`${b.default.gray(A)}
|
|
36
|
+
${Yt(this.state)} ${t.message}
|
|
37
|
+
`,e=(r,i)=>{let n=this.value.includes(r.value);return i&&n?o(r,"active-selected"):n?o(r,"selected"):o(r,i?"active":"inactive")};switch(this.state){case"submit":return`${s}${b.default.gray(A)} ${this.options.filter(({value:r})=>this.value.includes(r)).map((r)=>o(r,"submitted")).join(b.default.dim(", "))||b.default.dim("none")}`;case"cancel":{let r=this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>o(i,"cancelled")).join(b.default.dim(", "));return`${s}${b.default.gray(A)} ${r.trim()?`${r}
|
|
38
|
+
${b.default.gray(A)}`:""}`}case"error":{let r=this.error.split(`
|
|
39
|
+
`).map((i,n)=>n===0?`${b.default.yellow(st)} ${b.default.yellow(i)}`:` ${i}`).join(`
|
|
40
|
+
`);return`${s+b.default.yellow(A)} ${Gn({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:e}).join(`
|
|
41
|
+
${b.default.yellow(A)} `)}
|
|
42
|
+
${r}
|
|
43
|
+
`}default:return`${s}${b.default.cyan(A)} ${Gn({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:e}).join(`
|
|
44
|
+
${b.default.cyan(A)} `)}
|
|
45
|
+
${b.default.cyan(st)}
|
|
46
|
+
`}}}).prompt()},I=(t="",o="")=>{let s=`
|
|
47
|
+
${t}
|
|
48
48
|
`.split(`
|
|
49
|
-
`),
|
|
50
|
-
`);process.stdout.write(`${b.default.gray(
|
|
51
|
-
${b.default.green(
|
|
52
|
-
${
|
|
53
|
-
${b.default.gray(
|
|
54
|
-
`)},
|
|
55
|
-
|
|
56
|
-
`)}
|
|
57
|
-
`)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`):process.
|
|
61
|
-
`)
|
|
62
|
-
`);
|
|
49
|
+
`),e=Pn(o).length,r=Math.max(s.reduce((n,a)=>{let c=Pn(a);return c.length>n?c.length:n},0),e)+2,i=s.map((n)=>`${b.default.gray(A)} ${b.default.dim(n)}${" ".repeat(r-Pn(n).length)}${b.default.gray(A)}`).join(`
|
|
50
|
+
`);process.stdout.write(`${b.default.gray(A)}
|
|
51
|
+
${b.default.green(zt)} ${b.default.reset(o)} ${b.default.gray(Bo.repeat(Math.max(r-e-1,1))+tr)}
|
|
52
|
+
${i}
|
|
53
|
+
${b.default.gray(nr+Bo.repeat(r+2)+or)}
|
|
54
|
+
`)},Go=(t="")=>{process.stdout.write(`${b.default.gray(st)} ${b.default.red(t)}
|
|
55
|
+
|
|
56
|
+
`)},bt=(t="")=>{process.stdout.write(`${b.default.gray(ke)} ${t}
|
|
57
|
+
`)},H=(t="")=>{process.stdout.write(`${b.default.gray(A)}
|
|
58
|
+
${b.default.gray(st)} ${t}
|
|
59
|
+
|
|
60
|
+
`)},w,Da,yt=({indicator:t="dots"}={})=>{let o=Bn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=Bn?80:120,e=process.env.CI==="true",r,i,n=!1,a="",c,m=performance.now(),l=(S)=>{let E=S>1?"Something went wrong":"Canceled";n&&q(E,S)},p=()=>l(2),g=()=>l(1),d=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",g),process.on("SIGTERM",g),process.on("exit",l)},u=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",g),process.removeListener("SIGTERM",g),process.removeListener("exit",l)},y=()=>{if(c===void 0)return;e&&process.stdout.write(`
|
|
61
|
+
`);let S=c.split(`
|
|
62
|
+
`);process.stdout.write(Xt.cursor.move(-999,S.length-1)),process.stdout.write(Xt.erase.down(S.length))},$=(S)=>S.replace(/\.+$/,""),v=(S)=>{let E=(performance.now()-S)/1000,R=Math.floor(E/60),T=Math.floor(E%60);return R>0?`[${R}m ${T}s]`:`[${T}s]`},j=(S="")=>{n=!0,r=Ao(),a=$(S),m=performance.now(),process.stdout.write(`${b.default.gray(A)}
|
|
63
|
+
`);let E=0,R=0;d(),i=setInterval(()=>{if(e&&a===c)return;y(),c=a;let T=b.default.magenta(o[E]);if(e)process.stdout.write(`${T} ${a}...`);else if(t==="timer")process.stdout.write(`${T} ${a} ${v(m)}`);else{let Y=".".repeat(Math.floor(R)).slice(0,3);process.stdout.write(`${T} ${a}${Y}`)}E=E+1<o.length?E+1:0,R=R<o.length?R+0.125:0},s)},q=(S="",E=0)=>{n=!1,clearInterval(i),y();let R=E===0?b.default.green(zt):E===1?b.default.red(_o):b.default.red(Mo);a=$(S??a),t==="timer"?process.stdout.write(`${R} ${a} ${v(m)}
|
|
64
|
+
`):process.stdout.write(`${R} ${a}
|
|
65
|
+
`),u(),r()};return{start:j,stop:q,message:(S="")=>{a=$(S??a)}}},Nn=async(t,o)=>{let s={},e=Object.keys(t);for(let r of e){let i=t[r],n=await i({results:s})?.catch((a)=>{throw a});if(typeof o?.onCancel=="function"&&F(n)){s[r]="canceled",o.onCancel({results:s});continue}s[r]=n}return s};var N=U(()=>{In();In();b=jt(wn(),1),Xt=jt(yn(),1);Bn=Qe(),Ve=C("\u25C6","*"),_o=C("\u25A0","x"),Mo=C("\u25B2","x"),zt=C("\u25C7","o"),ke=C("\u250C","T"),A=C("\u2502","|"),st=C("\u2514","\u2014"),_n=C("\u25CF",">"),Mn=C("\u25CB"," "),Fe=C("\u25FB","[\u2022]"),Po=C("\u25FC","[+]"),De=C("\u25FB","[ ]"),Fa=C("\u25AA","\u2022"),Bo=C("\u2500","-"),tr=C("\u256E","+"),nr=C("\u251C","+"),or=C("\u256F","+"),sr=C("\u25CF","\u2022"),er=C("\u25C6","*"),rr=C("\u25B2","!"),ir=C("\u25A0","x"),w={message:(t="",{symbol:o=b.default.gray(A)}={})=>{let s=[`${b.default.gray(A)}`];if(t){let[e,...r]=t.split(`
|
|
66
|
+
`);s.push(`${o} ${e}`,...r.map((i)=>`${b.default.gray(A)} ${i}`))}process.stdout.write(`${s.join(`
|
|
63
67
|
`)}
|
|
64
|
-
`)},info:(n)=>{$.message(n,{symbol:b.default.blue(as)})},success:(n)=>{$.message(n,{symbol:b.default.green(ls)})},step:(n)=>{$.message(n,{symbol:b.default.green(Nn)})},warn:(n)=>{$.message(n,{symbol:b.default.yellow(fs)})},warning:(n)=>{$.warn(n)},error:(n)=>{$.message(n,{symbol:b.default.red(ms)})}},me=`${b.default.gray(O)} `});function wt(n,t){let r=hs[n]||"Unknown error";return t?`${r}: ${t}`:r}var hs;var xo=C(()=>{hs={"core.auth.failed":"Authentication failed","core.auth.invalid_token":"Token is invalid or expired","core.fs.cannot_read":"Cannot read file","core.fs.cannot_write":"Cannot write to file","core.fs.directory_not_found":"Directory not found","core.fs.file_not_found":"File not found","core.git.dirty_working_dir":"Working directory has uncommitted changes","core.git.no_commits":"No commits found","core.git.not_repository":"Not a git repository","core.git.operation_failed":"Git operation failed","core.invalid_argument":"Invalid argument","core.invalid_config":"Invalid configuration","core.network.request_failed":"Network request failed","core.operation_cancelled":"Operation cancelled","core.operation_failed":"Operation failed","core.permission_denied":"Permission denied","hydra.config.invalid_format":"Invalid configuration format","hydra.config.missing_required":"Missing required configuration","hydra.config.not_found":"Configuration file not found","hydra.runner.creation_failed":"Runner creation failed","hydra.runner.not_found":"Runner not found","hydra.runner.removal_failed":"Runner removal failed","hydra.token.decryption_failed":"Token decryption failed","hydra.token.encryption_failed":"Token encryption failed","sisyphus.publish.failed":"Publishing failed","sisyphus.release.no_changes":"No changes to release","sisyphus.stone.invalid":"Invalid stone format","sisyphus.stone.not_found":"No stones found","sisyphus.version.conflict":"Version conflict detected","sisyphus.version.invalid_format":"Invalid version format"}});function $t(n={}){let{errorPrefix:t="\u2717"}=n;return function r(s){if(Q(s))ln.info("Operation cancelled"),process.exit(0);if(s instanceof So){if(ln.error(`${t} ${s.message}`),s.code)ln.error(` Error code: ${s.code}`)}else if(s instanceof Error)ln.error(`${t} ${s.message}`);else ln.error(`${t} An unexpected error occurred`),ln.error(String(s));process.exit(1)}}var ln,So;var gt=C(()=>{q();_();xo();ln=v({prefix:"cli-core"}).child("error");So=class So extends Error{code;context;constructor(n,t,r){let s=n.includes(".")&&!n.includes(" ")?wt(n,r):n;super(s);this.code=t;this.context=r;this.name="CLIError"}}});var T,ps=(n,t)=>{let r=n.length,s=t.length,i=1<<r-1,e=-1,o=0,c=r,a=r;while(a--)T[n.charCodeAt(a)]|=1<<a;for(a=0;a<s;a++){let l=T[t.charCodeAt(a)],f=l|o;if(l|=(l&e)+e^e,o|=~(l|e),e&=l,o&i)c++;if(e&i)c--;o=o<<1|1,e=e<<1|~(f|o),o&=f}a=r;while(a--)T[n.charCodeAt(a)]=0;return c},bs=(n,t)=>{let r=t.length,s=n.length,i=[],e=[],o=Math.ceil(r/32),c=Math.ceil(s/32);for(let y=0;y<o;y++)e[y]=-1,i[y]=0;let a=0;for(;a<c-1;a++){let y=0,g=-1,x=a*32,u=Math.min(32,s)+x;for(let S=x;S<u;S++)T[n.charCodeAt(S)]|=1<<S;for(let S=0;S<r;S++){let I=T[t.charCodeAt(S)],E=e[S/32|0]>>>S&1,A=i[S/32|0]>>>S&1,R=I|y,z=((I|A)&g)+g^g|I|A,Z=y|~(z|g),cn=g&z;if(Z>>>31^E)e[S/32|0]^=1<<S;if(cn>>>31^A)i[S/32|0]^=1<<S;Z=Z<<1|E,cn=cn<<1|A,g=cn|~(R|Z),y=Z&R}for(let S=x;S<u;S++)T[n.charCodeAt(S)]=0}let l=0,f=-1,p=a*32,d=Math.min(32,s-p)+p;for(let y=p;y<d;y++)T[n.charCodeAt(y)]|=1<<y;let w=s;for(let y=0;y<r;y++){let g=T[t.charCodeAt(y)],x=e[y/32|0]>>>y&1,u=i[y/32|0]>>>y&1,S=g|l,I=((g|u)&f)+f^f|g|u,E=l|~(I|f),A=f&I;if(w+=E>>>s-1&1,w-=A>>>s-1&1,E>>>31^x)e[y/32|0]^=1<<y;if(A>>>31^u)i[y/32|0]^=1<<y;E=E<<1|x,A=A<<1|u,f=A|~(S|E),l=E&S}for(let y=p;y<d;y++)T[n.charCodeAt(y)]=0;return w},ut=(n,t)=>{if(n.length<t.length){let r=t;t=n,n=r}if(t.length===0)return n.length;if(n.length<=32)return ps(n,t);return bs(n,t)};var xt=C(()=>{T=new Uint32Array(65536)});function Ln(n,t,r=3){return t.map((e)=>({distance:ut(n.toLowerCase(),e.toLowerCase()),option:e})).filter(({distance:e})=>e<=Math.max(3,n.length/2)).sort((e,o)=>e.distance-o.distance).slice(0,r).map(({option:e})=>e)}function qn(n,t){return t[n.toLowerCase()]||null}var St=C(()=>{xt()});async function vo(n,t={}){let{fallback:r,logLevel:s="warn",message:i="Operation failed gracefully"}=t;try{return await n()}catch(e){let o=e instanceof Error?e.message:String(e);if(vt[s](`${i}: ${o}`),r)try{await r()}catch(c){vt.error(`Fallback also failed: ${c instanceof Error?c.message:String(c)}`)}return}}var vt;var Et=C(()=>{_();vt=v({prefix:"cli-core"}).child("graceful")});var Ot=C(()=>{_()});async function jt(n,t={}){let r={...ds,...t},s=new Error("Operation failed");for(let i=1;i<=r.maxAttempts;i++)try{return await n()}catch(e){if(s=e instanceof Error?e:new Error(String(e)),!r.retryableErrors.some((a)=>s.message.toLowerCase().includes(a.toLowerCase()))||i===r.maxAttempts)throw s;r.onRetry(i,s);let c=Math.min(r.initialDelay*r.backoffMultiplier**(i-1),r.maxDelay);await new Promise((a)=>setTimeout(a,c))}throw s}var ds;var Rt=C(()=>{_();ds={backoffMultiplier:2,initialDelay:1000,maxAttempts:3,maxDelay:30000,onRetry:(n,t)=>{Fn.warn(`Retry attempt ${n}: ${t.message}`)},retryableErrors:["ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENOTFOUND","rate limit","429","503","502","504","npm ERR!","EPUBLISHCONFLICT"]}});var fn=(n)=>{return n.map=(t)=>fn((r)=>t(n(r))),n.or=(t)=>fn((r)=>{try{return n(r)}catch(s){return t(r)}}),n},Eo=()=>"bad banditype"(),Oo=(n)=>fn((t)=>typeof t===typeof n?t:Eo()),F=()=>Oo(""),At=()=>Oo(!0),Pn=()=>Oo(),_t=(n)=>fn((t)=>t instanceof n?t:Eo()),on=(n)=>_t(Object).map((t)=>{let r={};for(let s in n){let i=n[s](t[s]);i!==void 0&&(r[s]=i)}return r}),Jn=(n)=>_t(Array).map((t)=>t.map(n));function jo(n,t){return fn((r)=>{try{return n(r)}catch{try{return t(r)}catch{throw new Error("No matching schema in union")}}})}function mn(n,t){return(r)=>{if(r===void 0)return t;return n(r)}}function Mt(n){return{parse(t){try{return n(t)}catch(r){throw new Error(r instanceof Error?r.message:"Validation failed")}},safeParse(t){try{return{data:n(t),success:!0}}catch(r){return{error:r instanceof Error?r:new Error("Validation failed"),success:!1}}},validator:n}}function Ro(){return jo(Pn(),F())}function ys(){return jo(Pn(),At())}function Ao(n){return mn(F(),n)}function Bn(n){return mn(Ro(),n)}function D(n){return mn(ys(),n)}function Xn(n){return jo(Pn(),n)}var It=()=>{};var U=C(()=>{Xo();gt();xo();St();Et();Ot();Rt();It()});var ws,$s,gs,us,_o;var Ut=C(()=>{U();ws=on({commit:F(),date:F()}),$s=on({author:Bn("r5n-bot"),email:Ro(),message:Bn("release(\uD83C\uDF89): <packageName@version>")}),gs=on({commitAndPush:D(!1),github:D(!1),npm:D(!1),tags:D(!1)}),us=on({generate:D(!0),root:D(!1)}),_o=Mt(on({$schema:Ao("https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/cli/sisyphus/schema.json"),changelog:Xn(us),commit:Xn($s),configPath:Bn(".sisyphus"),ignore:mn(Jn(F()),[]),lastStone:ws,release:Xn(gs),single:D(!1),stones:mn(Jn(F()),[]),tag:Ao("latest")}))});var gn=()=>{};var Nt={};yr(Nt,{versionBumper:()=>B,updateSisyphusConfig:()=>Ho,lineSplitter:()=>Go,isInteractive:()=>Uo,handleCancel:()=>hn,getStones:()=>V,getSisyphusConfig:()=>j,getPackages:()=>J,getPackageUpdateLabel:()=>un,ensureDryRunInTest:()=>No,bumpTypeOrder:()=>tn,bumpTypeAnnotation:()=>rn});var{$:Wn}=globalThis.Bun;function Uo({stream:n=process.stdout}={}){return Boolean(n?.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function hn(n){if(typeof n==="function")n();else dt(n||"Operation cancelled by user");process.exit(0)}function No(n){return n}async function j({overwrite:n,tag:t,dryRun:r,silent:s,configPath:i=".sisyphus",...e}={}){let o=`./${i}/config.json`,a=await Bun.file(o).exists(),l=a&&n,f=Bun.spawnSync(["git","rev-parse","HEAD"]).stdout.toString().trim();if(f.length===0)throw new Error("Couldn't find git repository. Have you initialized git repository?");let p;if(a)try{let y=await Bun.file(".sisyphus/config.json").json(),g=_o.safeParse(y);if(!g.success)throw Mo.error("Configuration validation failed:",y,g),g.error instanceof Error?new Error(`Invalid configuration file: ${g.error.message}`):g.error;p=g.data}catch(y){if(y instanceof Error)throw new Error(`Invalid configuration file: ${y.message}`);throw new Error("Failed to parse configuration file")}else p=_o.parse({$schema:"https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/cli/sisyphus/schema.json",ignore:[],lastStone:{commit:f,date:new Date().toISOString().split(".")[0]||""},stones:[],tag:t||"latest"});let d={...p,...e},w=`${JSON.stringify(d,null,2)}
|
|
65
|
-
`;if(
|
|
66
|
-
${
|
|
67
|
-
${
|
|
68
|
-
`;if(
|
|
69
|
-
${
|
|
70
|
-
${
|
|
71
|
-
`).filter(Boolean).map((
|
|
72
|
-
|
|
73
|
-
If you want to run Sisyphus in single-mode/root package, use --single flag or set \`"single": true\` in .sisyphus/config.json.`);let
|
|
74
|
-
`):[`# ${
|
|
75
|
-
${
|
|
76
|
-
`)}`);else if(!await
|
|
68
|
+
`)},info:(t)=>{w.message(t,{symbol:b.default.blue(sr)})},success:(t)=>{w.message(t,{symbol:b.default.green(er)})},step:(t)=>{w.message(t,{symbol:b.default.green(zt)})},warn:(t)=>{w.message(t,{symbol:b.default.yellow(rr)})},warning:(t)=>{w.warn(t)},error:(t)=>{w.message(t,{symbol:b.default.red(ir)})}},Da=`${b.default.gray(A)} `});function No(t,o){let s=ar[t]||"Unknown error";return o?`${s}: ${o}`:s}var ar;var Tn=U(()=>{ar={"core.auth.failed":"Authentication failed","core.auth.invalid_token":"Token is invalid or expired","core.fs.cannot_read":"Cannot read file","core.fs.cannot_write":"Cannot write to file","core.fs.directory_not_found":"Directory not found","core.fs.file_not_found":"File not found","core.git.dirty_working_dir":"Working directory has uncommitted changes","core.git.no_commits":"No commits found","core.git.not_repository":"Not a git repository","core.git.operation_failed":"Git operation failed","core.invalid_argument":"Invalid argument","core.invalid_config":"Invalid configuration","core.network.request_failed":"Network request failed","core.operation_cancelled":"Operation cancelled","core.operation_failed":"Operation failed","core.permission_denied":"Permission denied","hydra.config.invalid_format":"Invalid configuration format","hydra.config.missing_required":"Missing required configuration","hydra.config.not_found":"Configuration file not found","hydra.runner.creation_failed":"Runner creation failed","hydra.runner.not_found":"Runner not found","hydra.runner.removal_failed":"Runner removal failed","hydra.token.decryption_failed":"Token decryption failed","hydra.token.encryption_failed":"Token encryption failed","sisyphus.publish.failed":"Publishing failed","sisyphus.release.no_changes":"No changes to release","sisyphus.stone.invalid":"Invalid stone format","sisyphus.stone.not_found":"No stones found","sisyphus.version.conflict":"Version conflict detected","sisyphus.version.invalid_format":"Invalid version format"}});function To(t={}){let{errorPrefix:o="\u2717"}=t;return function s(e){if(F(e))dt.info("Operation cancelled"),process.exit(0);if(e instanceof Un){if(dt.error(`${o} ${e.message}`),e.code)dt.error(` Error code: ${e.code}`)}else if(e instanceof Error)dt.error(`${o} ${e.message}`);else dt.error(`${o} An unexpected error occurred`),dt.error(String(e));process.exit(1)}}var dt,Un;var Uo=U(()=>{N();P();Tn();dt=x({prefix:"cli-core"}).child("error");Un=class Un extends Error{code;context;constructor(t,o,s){let e=t.includes(".")&&!t.includes(" ")?No(t,s):t;super(e);this.code=o;this.context=s;this.name="CLIError"}}});var D,cr=(t,o)=>{let s=t.length,e=o.length,r=1<<s-1,i=-1,n=0,a=s,c=s;while(c--)D[t.charCodeAt(c)]|=1<<c;for(c=0;c<e;c++){let m=D[o.charCodeAt(c)],l=m|n;if(m|=(m&i)+i^i,n|=~(m|i),i&=m,n&r)a++;if(i&r)a--;n=n<<1|1,i=i<<1|~(l|n),n&=l}c=s;while(c--)D[t.charCodeAt(c)]=0;return a},fr=(t,o)=>{let s=o.length,e=t.length,r=[],i=[],n=Math.ceil(s/32),a=Math.ceil(e/32);for(let u=0;u<n;u++)i[u]=-1,r[u]=0;let c=0;for(;c<a-1;c++){let u=0,y=-1,$=c*32,v=Math.min(32,e)+$;for(let j=$;j<v;j++)D[t.charCodeAt(j)]|=1<<j;for(let j=0;j<s;j++){let q=D[o.charCodeAt(j)],S=i[j/32|0]>>>j&1,E=r[j/32|0]>>>j&1,R=q|u,T=((q|E)&y)+y^y|q|E,Y=u|~(T|y),k=y&T;if(Y>>>31^S)i[j/32|0]^=1<<j;if(k>>>31^E)r[j/32|0]^=1<<j;Y=Y<<1|S,k=k<<1|E,y=k|~(R|Y),u=Y&R}for(let j=$;j<v;j++)D[t.charCodeAt(j)]=0}let m=0,l=-1,p=c*32,g=Math.min(32,e-p)+p;for(let u=p;u<g;u++)D[t.charCodeAt(u)]|=1<<u;let d=e;for(let u=0;u<s;u++){let y=D[o.charCodeAt(u)],$=i[u/32|0]>>>u&1,v=r[u/32|0]>>>u&1,j=y|m,q=((y|v)&l)+l^l|y|v,S=m|~(q|l),E=l&q;if(d+=S>>>e-1&1,d-=E>>>e-1&1,S>>>31^$)i[u/32|0]^=1<<u;if(E>>>31^v)r[u/32|0]^=1<<u;S=S<<1|$,E=E<<1|v,l=E|~(j|S),m=S&j}for(let u=p;u<g;u++)D[t.charCodeAt(u)]=0;return d},Co=(t,o)=>{if(t.length<o.length){let s=o;o=t,t=s}if(o.length===0)return t.length;if(t.length<=32)return cr(t,o);return fr(t,o)};var Lo=U(()=>{D=new Uint32Array(65536)});function Zt(t,o,s=3){return o.map((i)=>({distance:Co(t.toLowerCase(),i.toLowerCase()),option:i})).filter(({distance:i})=>i<=Math.max(3,t.length/2)).sort((i,n)=>i.distance-n.distance).slice(0,s).map(({option:i})=>i)}function Qt(t,o){return o[t.toLowerCase()]||null}var Ho=U(()=>{Lo()});async function Cn(t,o={}){let{fallback:s,logLevel:e="warn",message:r="Operation failed gracefully"}=o;try{return await t()}catch(i){let n=i instanceof Error?i.message:String(i);if(qo[e](`${r}: ${n}`),s)try{await s()}catch(a){qo.error(`Fallback also failed: ${a instanceof Error?a.message:String(a)}`)}return}}var qo;var Jo=U(()=>{P();qo=x({prefix:"cli-core"}).child("graceful")});var Wo=U(()=>{P()});async function Xo(t,o={}){let s={...mr,...o},e=new Error("Operation failed");for(let r=1;r<=s.maxAttempts;r++)try{return await t()}catch(i){if(e=i instanceof Error?i:new Error(String(i)),!s.retryableErrors.some((c)=>e.message.toLowerCase().includes(c.toLowerCase()))||r===s.maxAttempts)throw e;s.onRetry(r,e);let a=Math.min(s.initialDelay*s.backoffMultiplier**(r-1),s.maxDelay);await new Promise((c)=>setTimeout(c,a))}throw e}var mr;var zo=U(()=>{P();mr={backoffMultiplier:2,initialDelay:1000,maxAttempts:3,maxDelay:30000,onRetry:(t,o)=>{un.warn(`Retry attempt ${t}: ${o.message}`)},retryableErrors:["ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENOTFOUND","rate limit","429","503","502","504","npm ERR!","EPUBLISHCONFLICT"]}});var wt=(t)=>{return t.map=(o)=>wt((s)=>o(t(s))),t.or=(o)=>wt((s)=>{try{return t(s)}catch(e){return o(s)}}),t},Ln=()=>"bad banditype"(),Hn=(t)=>wt((o)=>typeof o===typeof t?o:Ln()),tt=()=>Hn(""),Yo=()=>Hn(!0),Vt=()=>Hn(),Ko=(t)=>wt((o)=>o instanceof t?o:Ln()),V=(t)=>Ko(Object).map((o)=>{let s={};for(let e in t){let r=t[e](o[e]);r!==void 0&&(s[e]=r)}return s}),At=(t)=>Ko(Array).map((o)=>o.map(t));function qn(t,o){return wt((s)=>{try{return t(s)}catch{try{return o(s)}catch{throw new Error("No matching schema in union")}}})}function it(t,o){return(s)=>{if(s===void 0)return o;return t(s)}}function Zo(t){return{parse(o){try{return t(o)}catch(s){throw new Error(s instanceof Error?s.message:"Validation failed")}},safeParse(o){try{return{data:t(o),success:!0}}catch(s){return{error:s instanceof Error?s:new Error("Validation failed"),success:!1}}},validator:t}}function kt(){return qn(Vt(),tt())}function lr(){return qn(Vt(),Yo())}function Jn(t){return it(tt(),t)}function It(t){return it(kt(),t)}function nt(t){return it(lr(),t)}function at(t){return qn(Vt(),t)}var Qo=()=>{};var B=U(()=>{io();Uo();Tn();Ho();Jo();Wo();zo();Qo()});import{join as hr}from"path";async function pr(t){let o=ko.get(t);if(o)return o;try{let s=t;if(t.startsWith("@sisyphus/"))s=t;else if(t.startsWith("./")||t.startsWith("../"))s=hr(process.cwd(),t);else if(!t.includes("/"))s=`sisyphus-plugin-${t}`;Ft.info(`Loading plugin: ${t}`);let e=await import(s),r=e.default||e;if(!r.name)throw new Error(`Plugin ${t} must export a 'name' property`);return ko.set(t,r),Ft.info(`Loaded plugin: ${r.name} ${r.version?`v${r.version}`:""}`),r}catch(s){throw Ft.error(`Failed to load plugin ${t}:`,s),new Error(`Failed to load plugin ${t}: ${s}`)}}async function Fo(t){let o=[];for(let s of t)try{let e=await pr(s);o.push(e)}catch(e){Ft.warn(`Skipping plugin ${s} due to error:`,e)}return o}var Ft,ko;var Do=U(()=>{B();Ft=x({prefix:"sisyphus:plugins"}),ko=new Map});async function ts(t,o,...s){for(let e of t)if(e.hooks?.[o])try{$t.info(`Running ${o} hook for plugin: ${e.name}`),await e.hooks[o](...s)}catch(r){throw $t.error(`Error in ${o} hook for plugin ${e.name}:`,r),new Error(`Plugin ${e.name} failed in ${o}: ${r}`)}}async function ns(t,o,s){let e=o;for(let r of t)if(r.hooks?.modifyChangelog)try{$t.info(`Running modifyChangelog hook for plugin: ${r.name}`),e=await r.hooks.modifyChangelog(e,s)}catch(i){$t.error(`Error in modifyChangelog hook for plugin ${r.name}:`,i)}return e}async function os(t,o){let s=o;for(let e of t)if(e.hooks?.modifyConfig)try{$t.info(`Running modifyConfig hook for plugin: ${e.name}`),s=await e.hooks.modifyConfig(s)}catch(r){$t.error(`Error in modifyConfig hook for plugin ${e.name}:`,r)}return s}var $t;var ss=U(()=>{B();$t=x({prefix:"sisyphus:plugins"})});var ur,gr,br,yr,dr,Wn;var es=U(()=>{B();ur=V({commit:tt(),date:tt()}),gr=V({author:It("r5n-bot"),email:kt(),message:It("release(\uD83C\uDF89): <packageName@version>")}),br=V({commitAndPush:nt(!1),github:nt(!1),npm:nt(!1),tags:nt(!1)}),yr=V({append:nt(!0),filename:It("CHANGELOG.md"),generate:nt(!0),root:nt(!1),template:kt()}),dr=V({post:at(V({})),pre:at(V({}))}),Wn=Zo(V({$schema:Jn("https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/cli/sisyphus/schema.json"),changelog:at(yr),commit:at(gr),configPath:It(".sisyphus"),ignore:it(At(tt()),[]),lastStone:ur,plugins:it(At(tt()),[]),release:at(br),scripts:at(dr),single:nt(!1),stones:it(At(tt()),[]),tag:Jn("latest")}))});var{$:is}=globalThis.Bun;async function wr(t,o){let s=o.scripts?.pre?.[t];if(!s)return;ct.info(`Running pre-${t} script: ${s}`);try{await is`${s}`.quiet(),ct.info(`Pre-${t} script completed`)}catch(e){throw ct.error(`Pre-${t} script failed:`,e),new Error(`Pre-${t} script failed: ${e}`)}}async function rs(t,o){let s=o.scripts?.post?.[t];if(!s)return;ct.info(`Running post-${t} script: ${s}`);try{await is`${s}`.quiet(),ct.info(`Post-${t} script completed`)}catch(e){ct.error(`Post-${t} script failed:`,e),ct.warn(`Continuing despite post-${t} script failure`)}}async function as(t,o,s){await wr(t,o);try{let e=await s();return await rs(t,o),e}catch(e){throw await rs(t,o),e}}var ct;var cs=U(()=>{B();ct=x({prefix:"sisyphus:scripts"})});var St=()=>{};function ft(t){let o=t.match(/^([~^]?)(\d+)\.(\d+)\.(\d+)(.*)$/);if(!o)return null;let[,s="",e="0",r="0",i="0"]=o;return{major:parseInt(e,10),minor:parseInt(r,10),patch:parseInt(i,10),prefix:s||"",version:`${e}.${r}.${i}`}}function Xn(t,o){let s=ft(t),e=ft(o);if(!s||!e)return!1;if(!e.prefix)return s.version===e.version;if(e.prefix==="^")if(e.major>0)return s.major===e.major&&(s.minor>e.minor||s.minor===e.minor&&s.patch>=e.patch);else if(e.minor>0)return s.major===0&&s.minor===e.minor&&s.patch>=e.patch;else return s.major===0&&s.minor===0&&s.patch===e.patch;if(e.prefix==="~")return s.major===e.major&&s.minor===e.minor&&s.patch>=e.patch;return!1}function zn(t,o,s){let e=ft(t),r=ft(o);if(!e||!r)return $r.warn(`Could not parse version constraint: ${t} -> ${o}`),o;if(s?.preserveConstraintType&&e.prefix)return`${e.prefix}${o}`;if(r.major>e.major)return r.major===0?o:`^${o}`;else if(r.minor>e.minor)return e.prefix==="^"?`^${o}`:o;else return e.prefix?`${e.prefix}${o}`:o}function fs(t){let o=ft(t);return o?o.version:t}function ms(t,o){return!Xn(o,t)}function ls(t,o,s){let e={...t};for(let[r,i]of Object.entries(o))if(r in e&&e[r])e[r]=zn(e[r],i,s);return e}var $r;var hs=U(()=>{P();$r=x({prefix:"sisyphus"}).child("version-constraints")});var Vn={};me(Vn,{versionBumper:()=>X,updateVersionConstraint:()=>zn,updateSisyphusConfig:()=>Qn,updateDependencyVersions:()=>ls,satisfiesConstraint:()=>Xn,runWithScripts:()=>as,runPluginHook:()=>ts,parseVersionConstraint:()=>ft,modifyConfigWithPlugins:()=>os,modifyChangelogWithPlugins:()=>ns,lineSplitter:()=>Yn,isInteractive:()=>Kn,isBreakingChange:()=>ms,handleCancel:()=>xt,getStones:()=>Z,getSisyphusConfig:()=>O,getPlugins:()=>Sr,getPackages:()=>L,getPackageUpdateLabel:()=>Pt,getMinimumVersion:()=>fs,ensureDryRunInTest:()=>Zn,bumpTypeOrder:()=>mt,bumpTypeAnnotation:()=>lt,SNAPSHOT_DATE_REGEX:()=>us,SNAPSHOT_DATE_LENGTH:()=>gs,ISO_DATE_SEPARATOR:()=>ps,DEFAULT_SNAPSHOT_TAG:()=>bs});var{$:tn}=globalThis.Bun;function Kn({stream:t=process.stdout}={}){return Boolean(t?.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function xt(t){if(typeof t==="function")t();else Go(t||"Operation cancelled by user");process.exit(0)}function Zn(t){return t}async function O({overwrite:t,tag:o,dryRun:s,silent:e,configPath:r=".sisyphus",...i}={}){let n=`./${r}/config.json`,c=await Bun.file(n).exists(),m=c&&t,l=Bun.spawnSync(["git","rev-parse","HEAD"]).stdout.toString().trim();if(l.length===0)throw new Error("Couldn't find git repository. Have you initialized git repository?");let p;if(c)try{let u=await Bun.file(".sisyphus/config.json").json(),y=Wn.safeParse(u);if(!y.success)throw nn.error("Configuration validation failed:",u,y),y.error instanceof Error?new Error(`Invalid configuration file: ${y.error.message}`):y.error;p=y.data}catch(u){if(u instanceof Error)throw new Error(`Invalid configuration file: ${u.message}`);throw new Error("Failed to parse configuration file")}else p=Wn.parse({$schema:"https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/cli/sisyphus/schema.json",ignore:[],lastStone:{commit:l,date:new Date().toISOString().split(ps)[0]||""},stones:[],tag:o||"latest"});let g={...p,...i},d=`${JSON.stringify(g,null,2)}
|
|
69
|
+
`;if(s){if(!e)nn.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
70
|
+
${h.italic(".sisyphus/config.json")}:
|
|
71
|
+
${d}`);return{...p,...i}}if(m)try{await tn`rm -rf ${r}`.quiet()}catch{}if(c&&!t)return g;return await tn`mkdir -p ${r}`.quiet(),await Bun.write(n,d),g}async function Sr(t){if(Dt)return Dt;let o=t||await O();return Dt=await Fo(o.plugins||[]),Dt}async function Qn({dryRun:t,silent:o,configPath:s,...e}){let r=await O({configPath:s}),i=`./${s||r.configPath||".sisyphus"}/config.json`,n=`${JSON.stringify({...r,...e},null,2)}
|
|
72
|
+
`;if(t){if(!o)nn.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
73
|
+
${h.italic(i)} would be updated to
|
|
74
|
+
${n}`);return}await Bun.write(i,n),I(`${h.green("Sisyphus config updated!")}`)}function Pt({name:t,version:o,bump:s,tag:e}){return`${t}@${o} => ${h.green(X({bump:s,tag:e,version:o}))} ${lt[s]}`}function xr({baseVersion:t,bump:o}){let[s="0",e="0",r="0"]=t.split(".");switch(o){case"major":return`${Number.parseInt(s,10)+1}.0.0`;case"minor":return`${s}.${Number.parseInt(e,10)+1}.0`;case"dependency":case"patch":return`${s}.${e}.${Number.parseInt(r,10)+1}`;default:return`${s}.${e}.${r}`}}function X({version:t="",bump:o,tag:s}){let[e="0.0.0",r=""]=t.split("-"),[i="",n="0"]=r.split(".");if(o==="snapshot"){let a=new Date().toISOString().replace(us,"").slice(0,gs);return`0.0.0-${s||bs}-${a}`}if(s&&!o){let a=s===i?Number.parseInt(n,10)+1:1;return`${e}-${s}.${a}`}if(s||o==="dependency"&&i){let a=s===i?Number.parseInt(n,10)+1:1;return`${e}-${s||i}.${a}`}return xr({baseVersion:e,bump:o})}async function Z({dryRun:t,silent:o,configPath:s,testModeEnabled:e}={}){let r=e,i=await O({configPath:s,dryRun:t,silent:o}),n=r&&s?`${s}/stones`:`./${s||i.configPath||".sisyphus"}/stones`;try{let c=(await tn`ls ${n} 2>/dev/null || true`.quiet()).stdout.toString().trim();if(!c)return[];return c.split(`
|
|
75
|
+
`).filter(Boolean).map((l)=>l.replace(".md",""))}catch(a){if(!t)await tn`mkdir -p ${n}`.quiet();return[]}}async function L({filter:t,single:o}={}){let s=process.cwd(),e=await Bun.file("package.json").json();if(o)return Er(e);let r=e?.workspaces||[];if(r.length===0)throw new Error(`Seems like package.json doesn't have \`workspaces\` field or it's empty. Are you sure you are in the root of the workspace? (cwd: ${s})
|
|
76
|
+
|
|
77
|
+
If you want to run Sisyphus in single-mode/root package, use --single flag or set \`"single": true\` in .sisyphus/config.json.`);let{packages:i,privatePackageCount:n}=await vr({cwd:s,workspaces:r}),a=Object.keys(i);return{packageNames:t?a.filter((c)=>c.includes(t)):a,packages:i,privatePackageCount:n}}async function vr({workspaces:t,cwd:o}){let s={},e={},r=0;for(let i of t){let n=new Bun.Glob(`${i}/package.json`).scanSync({cwd:o});for(let a of n){let{name:c,version:m,private:l,dependencies:p={},devDependencies:g={}}=await Bun.file(a).json();if(l){nn.debug(`Skipping private package: ${c}`),r++;continue}let u=Object.entries({...p,...g}).map(([y,$])=>$.startsWith("workspace")?y:"").filter(Boolean);for(let y of u)if(e[y]||=[],!e[y].includes(c))e[y].push(c);s[c]={bump:"dependency",dependencyOf:[],file:a,name:c,version:m}}}for(let[i,n]of Object.entries(e))if(s[i])s[i].dependencyOf=n;return{packages:s,privatePackageCount:r}}function Er({name:t,version:o}){return{packageNames:[t],packages:{[t]:{bump:"dependency",dependencyOf:[],file:"package.json",name:t,version:o||"0.0.0"}},privatePackageCount:0}}var nn,Yn="***",ps=".",us,gs=14,bs="nightly",mt,lt,Dt=null;var _=U(()=>{N();P();Do();ss();es();cs();St();hs();nn=x({prefix:"sisyphus"}).child("helpers"),us=/[.ZT:-]/g,mt=["dependency","patch","minor","major","snapshot"],lt={dependency:"\uD83D\uDCE6",patch:"\uD83D\uDC1B",minor:"\u2728",major:"\uD83D\uDEA8",snapshot:"\uD83D\uDCF8"}});B();P();B();B();var Vo=To({errorPrefix:"\u2717"});N();B();P();_();N();P();_();import{parseArgs as Cr}from"util";var{$:Q}=globalThis.Bun;B();P();_();var Bt=x({prefix:"sisyphus"}).child("changelog");async function ds({changelogRoot:t,commit:o,dryRun:s=!1,stones:e}){let r=[""],{lastStone:{commit:i=""}}=await O(),n=jr({stones:e});for(let[a,{bump:c,path:m,changelog:l}]of n.entries()){let p=[...l,ys({commit:o,lastCommit:i})],g=await Bun.file(m).exists(),[d,...u]=g?(await Bun.file(m).text()).split(`
|
|
78
|
+
`):[`# ${a}`],y=[d,...p,...u];if(s)Bt.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
79
|
+
${y.join(`
|
|
80
|
+
`)}`);else if(!await Cn(async()=>{return Bt.info(`Writing changelog to ${m}`),await Bun.write(m,`${y.join(`
|
|
77
81
|
`).trimEnd()}
|
|
78
|
-
`),!0},{logLevel:"error",message:`Failed to write changelog to ${
|
|
79
|
-
`):["# Changelog"],p=[
|
|
82
|
+
`),!0},{logLevel:"error",message:`Failed to write changelog to ${m}`}))continue;let[$="",,,v=""]=l;if(!r.includes(v))r.unshift(v);r.push(`### ${lt[c]} ${a}@${$.slice(7)}`)}if(t){let a=Bun.file("CHANGELOG.md"),c=await a.exists(),[m,...l]=c?(await a.text()).split(`
|
|
83
|
+
`):["# Changelog"],p=[m,"",...r,...l,ys({commit:o,lastCommit:i,root:!0})];if(s)Bt.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
80
84
|
Root changelog:
|
|
81
85
|
${p.join(`
|
|
82
|
-
`)}`);else await
|
|
83
|
-
`))},{logLevel:"error",message:"Failed to write root changelog"})}}function
|
|
84
|
-
`).map((
|
|
85
|
-
<details><summary>${
|
|
86
|
-
${
|
|
86
|
+
`)}`);else await Cn(async()=>{Bt.info(`Writing root changelog to ${a.name}`),await Bun.write(a,p.join(`
|
|
87
|
+
`))},{logLevel:"error",message:"Failed to write root changelog"})}}function jr({stones:t}){let o=new Map;for(let{tag:s,packages:e,message:r}of t)for(let{file:i,name:n,version:a,bump:c}of e){let m=X({bump:c,tag:s,version:a}),{bump:l,path:p,changelog:g}=o.get(n)??{bump:c,changelog:[],path:i.replace("package.json","CHANGELOG.md")},[d="",,,u=""]=g,y=[d.replace("### ","")||"0.0.0",m].sort(Bun.semver.order)[1];o.set(n,{bump:l,changelog:[`### ${lt[c]} ${y}`,"",g.length>0?"__Stones:__":"__Stone:__",`_${r}${u?`, ${u.replace(/_/g,"")}_`:"_"}`],path:p})}return o}var kn="#@!";function ys({root:t,lastCommit:o,commit:s}){let e=(()=>{try{return Bun.spawnSync(["git","remote","get-url","origin"]).stdout.toString().trim().split(":")[1]?.replaceAll(".git","")||""}catch{return""}})(),i=(()=>{try{return Bun.spawnSync(["git","log",`--pretty=format:%H${kn}%s${kn}%cn`,`${o}..${s}`]).stdout.toString()}catch{return Bt.warn("Could not get git commit history"),""}})().split(`
|
|
88
|
+
`).map((n)=>{if(n.length===0)return;let[a="",c="",m=""]=n.split(kn);return`- ${e?`[${a.slice(0,7)} ${c}](https://github.com/${e}/commit/${a})`:c} (by [@${m}](https://github.com/${m}))`}).filter(Boolean);return i.length>0?`
|
|
89
|
+
<details><summary>${i.length} ${t?"Commits in this release":"Commits since last stone"}:</summary>
|
|
90
|
+
${i.join(`
|
|
87
91
|
`)}
|
|
88
|
-
</details>`:""}
|
|
89
|
-
|
|
90
|
-
${
|
|
91
|
-
Please provide one by using ${
|
|
92
|
-
${
|
|
93
|
-
`);await
|
|
94
|
-
${
|
|
95
|
-
Please provide one by using ${
|
|
96
|
-
Error during build step. If you don't have a build step, you can ignore this message.`)}}function
|
|
97
|
-
${
|
|
98
|
-
`).filter(Boolean).map((
|
|
99
|
-
`),[
|
|
100
|
-
${
|
|
92
|
+
</details>`:""}N();P();var Rr=/github\.com[:/]([^/]+)\/([^/]+)/;async function Or(){if(process.env.GITHUB_REPOSITORY){let[t,o]=process.env.GITHUB_REPOSITORY.split("/");return{owner:t,repo:o}}try{let t=await Bun.file("package.json").json(),o=t.repository?.url||t.repository;if(typeof o==="string"){let s=o.replace("git+","").replace(".git","").replace("git@github.com:","https://github.com/"),[,e,r]=s.match(Rr)||[];return{owner:e,repo:r}}}catch{}throw new Error("Could not determine GitHub repository. Please set GITHUB_REPOSITORY environment variable or ensure package.json has a valid repository URL.")}async function ws({token:t,tag:o,name:s,body:e}){let{owner:r,repo:i}=await Or();if(!(r&&i))throw new Error("Could not determine GitHub repository. Please set GITHUB_REPOSITORY environment variable or ensure package.json has a valid repository URL.");let n=`https://api.github.com/repos/${r}/${i}/releases`;try{let a=await fetch(n,{body:JSON.stringify({body:`${s}
|
|
93
|
+
|
|
94
|
+
${e||""}`,draft:!1,name:s,prerelease:o.includes("-"),tag_name:o}),headers:{Accept:"application/vnd.github.v3+json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},method:"POST"});if(!a.ok){let c=await a.text();throw new Error(`GitHub API returned ${a.status}: ${c}`)}return a.json()}catch(a){if(a instanceof Error)throw new Error(`Failed to create GitHub release: ${a.message}`);throw a}}async function $s({dryRun:t,github:o,githubToken:s,packages:e,rootTag:r,withTags:i}){if(t){w.info("Skipping git operations in dry run mode");return}if(Ar(i,e),Ir(r),o)await Pr({githubToken:s,packages:e,rootTag:r,withTags:i})}function Ar(t,o){if(!t)return;for(let{name:s,version:e}of Object.values(o)){let r=`${s}@${e}`;if(Bun.spawnSync(["git","tag",r,"-m",`Release ${r}`,"-f"]).exitCode!==0)w.error(`Failed to create git tag ${r}`)}}function Ir(t){if(!t)return;let o=Bun.spawnSync(["git","tag",t,"-m","Release","-f"]);if(o.exitCode!==0)w.error(`Failed to create root tag ${t}: ${o.stderr?Buffer.from(o.stderr).toString():"Unknown error"}`)}async function Pr({githubToken:t,packages:o,rootTag:s,withTags:e}){let r=t||process.env.GITHUB_TOKEN;if(!r)return I(h.reset(h.bold(`${h.redBright("No Github token found.")}
|
|
95
|
+
Please provide one by using ${h.cyanBright("--githubToken")} flag or by setting ${h.green("GITHUB_TOKEN")} environment variable.`)));try{await Br(r,e,o),await _r(r,s,o)}catch(i){return w.error(`Failed to create GitHub release:
|
|
96
|
+
${i instanceof Error?i.message:i}`),I(h.reset(h.bold(h.redBright("Failed to create GitHub release. Check your token and permissions."))))}}async function Br(t,o,s){if(!o)return;for(let e of Object.values(s)){let r=`${e.name}@${e.version}`;await ws({body:`Release of ${e.name} version ${e.version}`,name:`Release ${r}`,tag:r,token:t}),I(h.green(`\u2713 Created GitHub release for ${r}`))}}async function _r(t,o,s){if(!o)return;let e=Object.values(s).map((r)=>`- ${r.name}@${r.version}`).join(`
|
|
97
|
+
`);await ws({body:`Packages included:
|
|
98
|
+
${e}`,name:`Release ${o}`,tag:o,token:t}),I(h.green(`\u2713 Created GitHub root release ${o}`))}N();B();P();_();var{$:Mr}=globalThis.Bun;async function Ss({packages:t,dryRun:o,npmToken:s}){let e=s||process.env.NPM_CONFIG_TOKEN||process.env.NPM_TOKEN;if(!(e||o))return I(h.reset(h.bold(`${h.redBright("No NPM token found.")}
|
|
99
|
+
Please provide one by using ${h.cyanBright("--npmToken")} flag or by setting one of ${h.green("NPM_CONFIG_TOKEN")} or ${h.green("NPM_TOKEN")} environment variables.`)));await Gr({dryRun:o,packages:t,token:e})}async function Gr({packages:t,dryRun:o,token:s}){let e=await Nr();for(let{name:r,version:i,tag:n,file:a}of Object.values(t)){let c=yt();c.start(`${o?h.yellow("[dry-run]: Test "):""}Publishing ${h.magenta(r)}@${h.cyanBright(i)}...`),await Tr({cwd:a.replace("package.json","")});let m=await(async()=>{try{let l=Ur({dryRun:o,otp:e,tag:n});return await Xo(async()=>{let{stdout:p,exitCode:g}=Bun.spawnSync(l,{cwd:a.replace("package.json",""),env:{...process.env,NPM_CONFIG_TOKEN:s,NPM_TOKEN:s},stderr:"inherit"});if(g!==0)throw new Error(`npm publish failed with exit code ${g}`);return p},{onRetry:(p,g)=>{c.stop(),c.start(`${o?h.yellow("[dry-run]: Test "):""}Retrying publish ${h.magenta(r)}@${h.cyanBright(i)} (attempt ${p})...`)}}),`${h.green("Successfully published")} ${h.magenta(r)}@${h.cyanBright(i)}`}catch(l){return w.error(l instanceof Error?l.message:String(l)),`${h.bold(`${h.redBright("Failed")} ${h.magenta(r)}@${h.cyanBright(i)}`)}`}})();c.stop(`${o?h.yellow("[dry-run]: Test "):""}${m}`)}}async function Nr(){if(!Kn())return"";let t=await W({message:"Provide your NPM one-time password"});return F(t)?"":t}async function Tr({cwd:t}){try{let o=await Mr`cd ${t} && bun run build`.quiet();if(o.exitCode!==0)throw new Error(`Build failed with exit code ${o.exitCode}`)}catch(o){try{if(!(await Bun.file(`${t}/package.json`).json()).scripts?.build)return}catch{}w.warn(`${o instanceof Error?o.message:String(o)}:
|
|
100
|
+
Error during build step. If you don't have a build step, you can ignore this message.`)}}function Ur({dryRun:t,tag:o,otp:s}){return["npm","publish","--access","public"].concat(o?["--tag",o]:[]).concat(t?["--dry-run"]:[]).concat(s?["--otp",s]:[])}var ht=x({prefix:"sisyphus"}).child("roll");function Lr(){let{values:t}=Cr({allowPositionals:!0,args:Bun.argv,options:{changelog:{short:"c",type:"boolean"},changelogRoot:{short:"r",type:"boolean"},dryRun:{default:!1,short:"d",type:"boolean"},github:{short:"g",type:"boolean"},githubToken:{type:"string"},npm:{short:"n",type:"boolean"},npmToken:{type:"string"},rootTag:{type:"string"},withTags:{short:"t",type:"boolean"}},strict:!0});return t}async function xs(){let t=Lr(),{dryRun:o,changelog:s,changelogRoot:e,github:r,githubToken:i,npm:n,npmToken:a,rootTag:c,withTags:m}=t,l=await O(),p=Bun.spawnSync(["git","rev-parse","HEAD"]).stdout.toString().trim(),g=await(async()=>{try{return await _t()}catch{return[]}})();if(g.length===0)return I(h.reset(h.bold(`${h.redBright("No stones found.")}
|
|
101
|
+
${h.reset(`Run ${h.green("bunx @r5n/sisyphus")}${h.yellow(" version")} and create some first.`)}`)));if(typeof s==="boolean"?s:l.changelog?.generate)await ds({changelogRoot:typeof e==="boolean"?e:l.changelog?.root,commit:p,dryRun:o,stones:g});let d=await Hr({dryRun:o,stones:g});if(typeof n==="boolean"?n:l.release?.npm)await Ss({dryRun:o,npmToken:a,packages:d});let u=new Date().toISOString().split(".")[0]||"";if(await $s({dryRun:o,github:typeof r==="boolean"?r:l.release?.github,githubToken:i,packages:d,rootTag:c,withTags:typeof m==="boolean"?m:l.release?.tags}),await Qn({dryRun:o,lastStone:{commit:p,date:u},stones:[]}),!o)await Q`rm -rf .sisyphus/stones`.quiet();if(l.release?.commitAndPush){let y=Object.values(d).map((q)=>`${q.name}@${q.version}`).join(", "),$=l.commit?.message?l.commit.message.replace("{message}",y):`release(\uD83C\uDF89): ${y}`,{stdout:v}=await Q`git config user.name`.quiet(),{stdout:j}=await Q`git config user.email`.quiet();console.log(`git config user.name "${v.toString().trim()}"`,`git config user.email "${j.toString().trim()}"`),await Q`bun lint`.quiet(),await Q`git config user.name "Sisyphus"`,await Q`git config user.email "contact@r5n.dev"`,await Q`git commit --all -m "${$}"`,await Q`git push`,await Q`git config user.name "${v.toString().trim()}"`,await Q`git config user.email "${j.toString().trim()}"`}}async function _t({dryRun:t,silent:o,configPath:s,testModeEnabled:e}={}){let r=e,i=await Z({configPath:s,dryRun:t,silent:o}),{packages:n}=await L({single:r}),a=s||".sisyphus";if(r&&i.length===0&&s)try{let m=`${s}/stones`,p=(await Q`ls ${m} 2>/dev/null || true`.quiet()).stdout.toString().trim(),g=p?p.split(`
|
|
102
|
+
`).filter(Boolean).map((d)=>d.replace(".md","")):[];if(g.length>0)return ht.info(`Found ${g.length} stones in test environment`),[{message:"Test stone config",name:g[0],packages:[{bump:"major",file:`${s}/workspace/packages/test-pkg/package.json`,name:"@test/pkg",version:"1.0.0"}],tag:"latest"}]}catch(m){ht.error(`Test directory read error: ${m}`)}let c=[];for(let m of i)try{let p=(await Bun.file(`${a}/stones/${m}.md`).text()).split(`
|
|
103
|
+
`),[g]=p,d=g?.replace(/^#+\s*/,"")||"",u=p.findIndex((R)=>R.includes("|")&&R.includes(":---:"));if(u===-1){ht.error(`Failed to parse stone ${m} - could not find table format`);continue}let y=p[u-1],$=p[u+1];if(!y||!$){ht.error(`Failed to parse stone ${m} - invalid table structure`);continue}let v=y.split("|").map((R)=>R.trim()).filter(Boolean),j=$.split("|").map((R)=>R.trim()).filter(Boolean),q=[];for(let R=0;R<v.length;R++){let T=v[R],Y=j[R];if(Y){let k=Y.split(",").map((Ut)=>Ut.trim());for(let Ut of k)if(n[Ut])q.push({...n[Ut],bump:T})}}let S=p.find((R)=>R.trim().startsWith("_")&&R.trim().endsWith("_")),E=S?S.replace(/_/g,"").trim():"";c.push({message:d.trim(),name:m,packages:q,tag:E})}catch(l){ht.error(`Error processing stone ${m}
|
|
104
|
+
${l instanceof Error?l.message:String(l)}`)}return c}async function Hr({stones:t,dryRun:o=!1}){let s=[],e={};for(let{tag:i,packages:n,message:a}of t){s.push(a);for(let c of n){e[c.name]||=c;let m=e[c.name]||c;if(i)m.tag=i;m.bump=mt.indexOf(c.bump)>mt.indexOf(m.bump)?c.bump:m.bump,e[c.name]=m}}let r=Object.values(e).reduce((i,n)=>{return i[n.name]={...n,version:n.tag?X({tag:n.tag,version:X({bump:n.bump,version:n.version})}):X({bump:n.bump,version:n.version})},i},{});if(o)ht.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
101
105
|
Config for next release:
|
|
102
|
-
Stones: ${
|
|
103
|
-
${JSON.stringify(
|
|
104
|
-
`)}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
${
|
|
106
|
+
Stones: ${s.join(", ")}
|
|
107
|
+
${JSON.stringify(r,null,2)}`);else{let i={};for(let[a,c]of Object.entries(r))try{let m=await Bun.file(c.file).json();i[a]={...c,version:m.version}}catch(m){ht.error(`Could not read current version for ${a}: ${m}`)}let{updateDependencyVersions:n}=await Promise.resolve().then(() => (_(),Vn));for(let{version:a,file:c,name:m}of Object.values(r)){let l=await Bun.file(c).json();l.version=a;for(let[p,g]of Object.entries(r)){if(p===m)continue;let d=await Bun.file(g.file).json(),u=!1;if(d.dependencies?.[m])d.dependencies=n(d.dependencies,{[m]:a},{preserveConstraintType:!0}),u=!0;if(d.devDependencies?.[m])d.devDependencies=n(d.devDependencies,{[m]:a},{preserveConstraintType:!0}),u=!0;if(d.peerDependencies?.[m])d.peerDependencies=n(d.peerDependencies,{[m]:a},{preserveConstraintType:!0}),u=!0;if(u)await Bun.write(g.file,`${JSON.stringify(d,null,2)}
|
|
108
|
+
`)}await Bun.write(c,`${JSON.stringify(l,null,2)}
|
|
109
|
+
`)}}return r}var vs=x({prefix:"sisyphus"}).child("check");async function Es(){let t=await import("util").then((d)=>d.parseArgs),{values:o}=t({allowPositionals:!0,args:Bun.argv,options:{debug:{type:"boolean"},json:{type:"boolean"}},strict:!1}),{json:s=!1,debug:e=!1}=o,r=Boolean(s);await O({dryRun:!0,silent:r});let{packages:i,packageNames:n,privatePackageCount:a}=await L(),{packages:c,packageNames:[m=""]}=await L({single:!0}),l=await _t({dryRun:!0,silent:r});if(e)vs.info("DEBUG: Stone configs:",JSON.stringify(l,null,2)),vs.info("DEBUG: Packages:",JSON.stringify(i,null,2));if(r){let d={packages:n.map((u)=>({name:u,version:i[u]?.version})),privatePackageCount:a,root:{name:m,version:c[m]?.version},stones:l.map((u)=>({message:u.message,name:u.name,packages:u.packages.map((y)=>({bump:y.bump,name:y.name,newVersion:X({bump:y.bump,tag:u.tag,version:y.version}),version:y.version})),tag:u.tag}))};console.log(JSON.stringify(d,null,2));return}let p=l.length>0?`${f.bold(f.success("Stones:"))}
|
|
110
|
+
${l.map((d)=>`${f.arrow("\u2192")} ${f.bold("Stone:")} ${f.number(d.name)}
|
|
111
|
+
${f.bold("Packages:")}
|
|
112
|
+
${d.packages.map((u)=>` ${lt[u.bump]} ${f.value(u.name)}@${f.success(X({bump:u.bump,tag:d.tag,version:u.version}))} ${f.dim(`(${u.bump})`)}`).join(`
|
|
108
113
|
`)}`).join(`
|
|
109
114
|
|
|
110
|
-
`)}`:"",
|
|
111
|
-
${
|
|
112
|
-
${
|
|
115
|
+
`)}`:"",g=c[m]?.version?`@${c[m]?.version}`:"";if(!r){let d=a>0?`
|
|
116
|
+
${f.dim(`(${a} private package${a>1?"s":""} excluded)`)}`:"";w.step(`${f.bold(f.success("Root package:"))} ${f.value(m)}${f.dim(g)}
|
|
117
|
+
${f.bold(f.success("Packages:"))}${d}
|
|
118
|
+
${n.map((u)=>{let y=i[u]?.version?`@${i[u]?.version}`:"";return` ${f.bullet("\u2022")} ${f.value(u)}${f.dim(y)}`}).join(`
|
|
113
119
|
`)}
|
|
114
120
|
|
|
115
|
-
${
|
|
121
|
+
${p}`),I(f.success("Sisyphus check complete."))}}N();B();P();_();import{parseArgs as qr}from"util";var js=x({prefix:"sisyphus"}).child("graph");function Jr(){let{values:t}=qr({args:process.argv.slice(3),options:{depth:{short:"d",type:"string"},filter:{short:"f",type:"string"},json:{short:"j",type:"boolean"},"show-versions":{short:"v",type:"boolean"}}});return{depth:t.depth?parseInt(t.depth,10):void 0,filter:t.filter,json:t.json,showVersions:t["show-versions"]}}async function Rs(){try{let t=Jr(),{packages:o}=await L(),s=Wr(o);if(t.json){let r=Array.from(s.values());console.log(JSON.stringify(r,null,2));return}let e=s;if(t.filter)e=zr(s,t.filter,t.depth);Yr(e,t.showVersions)}catch(t){js.error("Failed to generate dependency graph:",t),process.exit(1)}}function Wr(t){let o=new Map;for(let[s,e]of Object.entries(t))o.set(s,{dependencies:[],dependents:e.dependencyOf||[],level:0,name:s,version:e.version});for(let s of o.values())for(let e of s.dependents){let r=o.get(e);if(r)r.dependencies.push(s.name)}return Xr(o),o}function Xr(t){let o=Array.from(t.values()).filter((r)=>r.dependencies.length===0),s=new Set,e=o.map((r)=>({level:0,node:r}));while(e.length>0){let r=e.shift();if(!r)continue;let{node:i,level:n}=r;if(s.has(i.name))continue;s.add(i.name),i.level=n;for(let a of i.dependents){let c=t.get(a);if(c&&!s.has(a))e.push({level:n+1,node:c})}}}function zr(t,o,s){let e=new Map,r=Array.from(t.values()).find((a)=>a.name.includes(o));if(!r)return js.warn(`No packages found matching filter: ${o}`),e;let i=[{currentDepth:0,node:r}],n=new Set;while(i.length>0){let a=i.shift();if(!a)continue;let{node:c,currentDepth:m}=a;if(n.has(c.name))continue;if(s!==void 0&&m>s)continue;if(n.add(c.name),e.set(c.name,c),!s||m<s)for(let l of[...c.dependencies,...c.dependents]){let p=t.get(l);if(p&&!n.has(l))i.push({currentDepth:m+1,node:p})}}return e}function Yr(t,o){let s=Array.from(t.values()),e=Math.max(...s.map((i)=>i.level));w.info(`Package Dependency Graph (${t.size} packages)`),console.log();for(let i=0;i<=e;i++){let n=s.filter((a)=>a.level===i);if(n.length===0)continue;console.log(f.dim(`Level ${i}:`));for(let a of n){let m=o?` ${f.dim(`(${a.version})`)}`:"";if(console.log(` ${f.value(a.name)}${m}`),a.dependents.length>0){let l=a.dependents.map((p)=>{return t.get(p)?f.success(p):f.dim(p)}).join(", ");console.log(` ${f.dim("\u2192")} ${l}`)}}console.log()}let r=Kr(t);if(r.length>0){console.log(f.warning("\u26A0\uFE0F Circular dependencies detected:"));for(let i of r)console.log(` ${i.join(" \u2192 ")} \u2192 ${i[0]}`);console.log()}}function Kr(t){let o=[],s=new Set,e=new Set;function r(i,n){if(e.has(i)){let c=n.indexOf(i);if(c!==-1){let m=n.slice(c),l=[...m].sort().join(",");if(!o.some((p)=>[...p].sort().join(",")===l))o.push(m)}return}if(s.has(i))return;s.add(i),e.add(i);let a=t.get(i);if(a)for(let c of a.dependencies)r(c,[...n,c]);e.delete(i)}for(let i of t.keys())if(!s.has(i))r(i,[i]);return o}B();var sn="0.4.0";var Os={check:`
|
|
116
122
|
sisyphus check - Check current state and pending changes
|
|
117
123
|
|
|
118
124
|
USAGE
|
|
@@ -174,6 +180,116 @@ EXAMPLES
|
|
|
174
180
|
|
|
175
181
|
# Reinitialize configuration
|
|
176
182
|
sisyphus init --force
|
|
183
|
+
`,insights:`
|
|
184
|
+
sisyphus insights - Monorepo health analysis and insights
|
|
185
|
+
|
|
186
|
+
USAGE
|
|
187
|
+
sisyphus insights [options]
|
|
188
|
+
|
|
189
|
+
OPTIONS
|
|
190
|
+
-p, --package <name> Analyze specific package [string]
|
|
191
|
+
-j, --json Output in JSON format [boolean]
|
|
192
|
+
|
|
193
|
+
EXAMPLES
|
|
194
|
+
# Show overall monorepo health
|
|
195
|
+
sisyphus insights
|
|
196
|
+
|
|
197
|
+
# Analyze specific package
|
|
198
|
+
sisyphus insights --package @myorg/core
|
|
199
|
+
|
|
200
|
+
# Export insights as JSON
|
|
201
|
+
sisyphus insights --json
|
|
202
|
+
|
|
203
|
+
METRICS
|
|
204
|
+
- Package change frequency and staleness
|
|
205
|
+
- Dependency health and circular dependencies
|
|
206
|
+
- Release velocity and patterns
|
|
207
|
+
- High-impact packages (many dependents)
|
|
208
|
+
- Version mismatch detection
|
|
209
|
+
`,metrics:`
|
|
210
|
+
sisyphus metrics - View release metrics and statistics
|
|
211
|
+
|
|
212
|
+
USAGE
|
|
213
|
+
sisyphus metrics [options]
|
|
214
|
+
|
|
215
|
+
OPTIONS
|
|
216
|
+
-j, --json Output in JSON format [boolean]
|
|
217
|
+
-d, --days <number> Number of days to analyze [number]
|
|
218
|
+
-p, --package <string> Filter to specific package [string]
|
|
219
|
+
-v, --detailed Show detailed package metrics [boolean]
|
|
220
|
+
|
|
221
|
+
EXAMPLES
|
|
222
|
+
# Show metrics for last 30 days
|
|
223
|
+
sisyphus metrics
|
|
224
|
+
|
|
225
|
+
# Show metrics for last 90 days
|
|
226
|
+
sisyphus metrics --days 90
|
|
227
|
+
|
|
228
|
+
# Show detailed metrics
|
|
229
|
+
sisyphus metrics --detailed
|
|
230
|
+
|
|
231
|
+
# Filter to specific package
|
|
232
|
+
sisyphus metrics --package @org/core
|
|
233
|
+
|
|
234
|
+
# Export as JSON
|
|
235
|
+
sisyphus metrics --json > metrics.json
|
|
236
|
+
`,migrate:`
|
|
237
|
+
sisyphus migrate - Migrate from changesets, lerna, or standard-version
|
|
238
|
+
|
|
239
|
+
USAGE
|
|
240
|
+
sisyphus migrate [options]
|
|
241
|
+
|
|
242
|
+
OPTIONS
|
|
243
|
+
-s, --source <type> Source format (auto-detect if not specified) [string]
|
|
244
|
+
-c, --clean Remove source files after migration [boolean]
|
|
245
|
+
-d, --dry-run Preview migration without changes [boolean]
|
|
246
|
+
|
|
247
|
+
EXAMPLES
|
|
248
|
+
# Auto-detect and migrate from changesets
|
|
249
|
+
sisyphus migrate
|
|
250
|
+
|
|
251
|
+
# Migrate and clean up changesets
|
|
252
|
+
sisyphus migrate --clean
|
|
253
|
+
|
|
254
|
+
# Preview migration without making changes
|
|
255
|
+
sisyphus migrate --dry-run
|
|
256
|
+
|
|
257
|
+
NOTES
|
|
258
|
+
- Automatically detects changesets in .changeset directory
|
|
259
|
+
- Converts YAML frontmatter to stone format
|
|
260
|
+
- Preserves commit messages and summaries
|
|
261
|
+
- Creates sequentially numbered stones
|
|
262
|
+
`,pr:`
|
|
263
|
+
sisyphus pr - Create a stone from a pull/merge request
|
|
264
|
+
|
|
265
|
+
USAGE
|
|
266
|
+
sisyphus pr [options]
|
|
267
|
+
|
|
268
|
+
OPTIONS
|
|
269
|
+
-u, --url <url> PR/MR URL to process [string]
|
|
270
|
+
--github Force GitHub mode [boolean]
|
|
271
|
+
--gitlab Force GitLab mode [boolean]
|
|
272
|
+
-d, --dryRun Preview changes without creating stone[boolean]
|
|
273
|
+
-y, --yes Skip confirmation prompt [boolean]
|
|
274
|
+
|
|
275
|
+
EXAMPLES
|
|
276
|
+
# Create stone from current branch's PR (requires gh CLI)
|
|
277
|
+
sisyphus pr
|
|
278
|
+
|
|
279
|
+
# Create stone from specific GitHub PR
|
|
280
|
+
sisyphus pr --url https://github.com/owner/repo/pull/123
|
|
281
|
+
|
|
282
|
+
# Create stone from GitLab MR
|
|
283
|
+
sisyphus pr --url https://gitlab.com/owner/repo/-/merge_requests/123
|
|
284
|
+
|
|
285
|
+
# Preview without creating stone
|
|
286
|
+
sisyphus pr --dryRun
|
|
287
|
+
|
|
288
|
+
NOTES
|
|
289
|
+
- Automatically detects bump type from PR labels and title
|
|
290
|
+
- Labels: breaking-change \u2192 major, feature \u2192 minor, bug/fix \u2192 patch
|
|
291
|
+
- Determines affected packages from changed files
|
|
292
|
+
- Requires GitHub CLI (gh) for GitHub integration
|
|
177
293
|
`,prerelease:`
|
|
178
294
|
sisyphus prerelease - Manage prerelease versions (alpha, beta, rc)
|
|
179
295
|
|
|
@@ -243,6 +359,31 @@ EXAMPLES
|
|
|
243
359
|
|
|
244
360
|
# Release with 'next' tag
|
|
245
361
|
sisyphus roll --tag next
|
|
362
|
+
`,solo:`
|
|
363
|
+
sisyphus solo - Single maintainer workflow (version + roll)
|
|
364
|
+
|
|
365
|
+
USAGE
|
|
366
|
+
sisyphus solo [options]
|
|
367
|
+
|
|
368
|
+
OPTIONS
|
|
369
|
+
-t, --tag NPM dist-tag to use [string]
|
|
370
|
+
-d, --dry-run Preview without releasing [boolean]
|
|
371
|
+
|
|
372
|
+
EXAMPLES
|
|
373
|
+
# Analyze commits and release immediately
|
|
374
|
+
sisyphus solo
|
|
375
|
+
|
|
376
|
+
# Preview what would be released
|
|
377
|
+
sisyphus solo --dry-run
|
|
378
|
+
|
|
379
|
+
# Release with 'next' tag
|
|
380
|
+
sisyphus solo --tag next
|
|
381
|
+
|
|
382
|
+
NOTES
|
|
383
|
+
- Combines 'version --from-commits' and 'roll' in one command
|
|
384
|
+
- Perfect for single maintainer projects
|
|
385
|
+
- Skips stone accumulation phase
|
|
386
|
+
- Uses conventional commits for version determination
|
|
246
387
|
`,stone:`
|
|
247
388
|
sisyphus stone - Manage pending stones
|
|
248
389
|
|
|
@@ -254,7 +395,7 @@ COMMANDS
|
|
|
254
395
|
delete <id> Remove a specific stone by ID
|
|
255
396
|
show <id> Display full content of a stone
|
|
256
397
|
edit <id> Modify stone content or versions
|
|
257
|
-
merge Combine
|
|
398
|
+
merge Combine stones with conflict resolution
|
|
258
399
|
|
|
259
400
|
EXAMPLES
|
|
260
401
|
# List all pending stones
|
|
@@ -297,45 +438,88 @@ EXAMPLES
|
|
|
297
438
|
|
|
298
439
|
# Create with specific bump
|
|
299
440
|
sisyphus version --bump minor --filter @org/core
|
|
300
|
-
`};function
|
|
301
|
-
`).map((
|
|
302
|
-
`);console.log(
|
|
303
|
-
${
|
|
441
|
+
`};function en(t){if(t&&Os[t]){let s=Os[t].split(`
|
|
442
|
+
`).map((e)=>{if(e.startsWith("sisyphus"))return f.bold(e);if(e==="USAGE"||e==="OPTIONS"||e==="EXAMPLES")return f.bold(e);if(e.startsWith(" -")){let r=e.match(/^(\s+-\w,\s--\w+)\s+(.+)$/);if(r){let[,i="",n=""]=r,a=n.replace("(required)",f.error("(required)")).replace(/\(default: ([^)]+)\)/g,(c,m)=>f.dim(`(default: ${m})`)).replace(/\[boolean\]/g,f.boolean("[boolean]")).replace(/\[string\]/g,f.string("[string]")).replace(/\[number\]/g,f.number("[number]"));return` ${f.flag(i.padEnd(26))} ${a}`}}if(e.startsWith(" # "))return f.dim(e);if(e.startsWith(" sisyphus"))return` ${f.value(e.trim())}`;return e}).join(`
|
|
443
|
+
`);console.log(s);return}console.log(`
|
|
444
|
+
${f.bold(`Sisyphus@${sn} - The rock-solid versioning system`)}
|
|
304
445
|
|
|
305
|
-
${
|
|
446
|
+
${f.bold("USAGE")}
|
|
306
447
|
sisyphus <command> [options]
|
|
307
448
|
|
|
308
|
-
${
|
|
309
|
-
${
|
|
310
|
-
${
|
|
311
|
-
${
|
|
312
|
-
${
|
|
313
|
-
${
|
|
314
|
-
${
|
|
315
|
-
${
|
|
316
|
-
${
|
|
317
|
-
${
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
449
|
+
${f.bold("COMMANDS")}
|
|
450
|
+
${f.command("init")} Initialize Sisyphus in your project
|
|
451
|
+
${f.command("check")} Check current state and pending changes
|
|
452
|
+
${f.command("version")} Create a new version stone for next release
|
|
453
|
+
${f.command("roll")} Roll the stones and release packages
|
|
454
|
+
${f.command("solo")} Single-step release (version + roll)
|
|
455
|
+
${f.command("stone")} Manage pending stones (list, delete, edit, merge)
|
|
456
|
+
${f.command("preview")} Preview what versions will be after rolling
|
|
457
|
+
${f.command("prerelease")} Manage prerelease versions (alpha, beta, rc)
|
|
458
|
+
${f.command("graph")} Visualize monorepo package dependencies
|
|
459
|
+
${f.command("metrics")} View release metrics and statistics
|
|
460
|
+
${f.command("insights")} Analyze monorepo health and dependencies
|
|
461
|
+
${f.command("migrate")} Migrate from changesets/lerna/standard-version
|
|
462
|
+
${f.command("pr")} Create stones from pull requests
|
|
463
|
+
${f.command("help")} Show this help message
|
|
464
|
+
|
|
465
|
+
Use ${f.value("sisyphus <command> --help")} for more information about a command.
|
|
466
|
+
`)}N();P();import{parseArgs as Vr}from"util";N();P();_();St();async function As({single:t,tag:o,ignore:s}){let e=await Nn({commitAndPush:()=>G({active:"Yes, commit and push the release",inactive:"Skip commit",initialValue:!1,message:"Should `roll` command commit and push the release?"}),commitConfig:()=>G({active:"Yes, configure commit",inactive:"Skip commit config",initialValue:!1,message:"Configure commit for release? Default commit message is `release(\uD83C\uDF89): <packageName@version>`"}),commitAuthor:({results:{commitConfig:r}})=>r?W({message:"Commit author",placeholder:"r5n-bot"}):void 0,commitEmail:({results:{commitConfig:r}})=>r?W({message:"Commit author email",placeholder:"r5n-bot@users.noreply.github.com"}):void 0,commitMessage:({results:{commitConfig:r}})=>r?W({message:"Commit message",placeholder:"release(\uD83C\uDF89): <packageName@version>"}):void 0,generateChangelog:()=>G({active:"Yes, Generate changelog",inactive:"Skip changelog",initialValue:!0,message:"Generate changelog for release?"}),releaseOnGitHub:()=>G({active:"Yes, create a GitHub release",inactive:"Skip GitHub release",initialValue:!1,message:"Create a release on GitHub when releasing packages?"}),releaseOnNPM:()=>G({active:"Yes, publish packages to NPM",inactive:"Skip NPM release",initialValue:!1,message:"Publish packages to NPM when releasing packages?"}),releaseTags:()=>G({active:"Yes, create tags for the release",inactive:"Skip tags",initialValue:!1,message:"Create tags for the release?"}),rootChangelog:({results:{generateChangelog:r}})=>r?G({active:"Yes, generate combined changelog",inactive:"Skip root changelog",initialValue:!0,message:"Generate combined changelog for monorepo?"}):void 0,single:()=>G({active:"Yes, setup for root package",inactive:"No, setup for monorepo workspace packages",initialValue:t,message:"Setup Sisyphus for only root package?"}),tag:()=>W({initialValue:o,message:"Tag used when versioning packages. Leave `latest` if you are not sure or want to release packages with latest tag.",placeholder:"latest"})},{onCancel:()=>xt()});return{commitAndPush:!!e.commitAndPush,commitAuthor:e.commitAuthor||"",commitConfig:!!e.commitConfig,commitEmail:e.commitEmail||"",commitMessage:e.commitMessage||"",generateChangelog:e.generateChangelog,releaseOnGitHub:!!e.releaseOnGitHub,releaseOnNPM:!!e.releaseOnNPM,releaseTags:!!e.releaseTags,rootChangelog:!!e.rootChangelog,single:e.single,tag:e.tag}}async function Is({bump:t,packages:o,packageNames:s,tag:e}){let r=Qr({packageNames:s,packages:o,tag:e}),i=`
|
|
467
|
+
- ${h.dim(h.italic(`Press ${h.underline(h.bold(h.whiteBright("a")))} to select/unselect all, ${h.underline(h.bold(h.whiteBright("SPACE")))} to select/unselect, ${h.underline(h.bold(h.whiteBright("ARROWS")))} to move, ${h.underline(h.bold(h.whiteBright("ENTER")))} to confirm`))}
|
|
468
|
+
`,n=t?[t]:["major","minor","patch"];w.info(i);let{message:a,majorPackages:c,minorPackages:m,patchPackages:l}=await Nn({majorPackages:()=>n.includes("major")?r({bump:"major"}):void 0,minorPackages:({results:{majorPackages:p}})=>n.includes("minor")?r({bump:"minor",filterPackages:p||[]}):void 0,patchPackages:({results:{majorPackages:p,minorPackages:g}})=>n.includes("patch")?r({bump:"patch",filterPackages:(p||[]).concat(g||[])}):void 0,message:()=>W({message:`Name of the stone. ${h.dim(h.italic("Default prefix or message can be configured in config."))}`,placeholder:"New feature"})},{onCancel:()=>xt()});return{majorPackages:c||[],message:a,minorPackages:m||[],patchPackages:l||[]}}function Qr({packageNames:t,tag:o,packages:s}){return({bump:e,filterPackages:r=[]})=>{let i=t.filter((a)=>!r?.includes(a)).map((a)=>({label:Pt({bump:e,name:a,tag:o,version:s[a]?.version||"0.0.0"}),value:a})),n={major:h.red,minor:h.yellow,patch:h.green};return i.length>0?Kt({initialValues:void 0,message:`Select packages for ${h.bold(n[e](e))} bump.`,options:i,required:!1}):void 0}}_();async function Ps(){let{values:{nonInteractive:t,overwrite:o,tag:s,single:e,ignore:r}}=Vr({allowPositionals:!0,args:Bun.argv,options:{ignore:{default:[],multiple:!0,short:"i",type:"string"},nonInteractive:{default:!1,short:"n",type:"boolean"},overwrite:{default:!1,short:"o",type:"boolean"},single:{default:!1,short:"s",type:"boolean"},tag:{default:"latest",short:"t",type:"string"}},strict:!0});if(t)await O({ignore:r,overwrite:o,single:e,tag:s});else{let{commitAndPush:i,commitAuthor:n,commitConfig:a,commitEmail:c,commitMessage:m,generateChangelog:l,releaseOnGitHub:p,releaseOnNPM:g,releaseTags:d,rootChangelog:u,single:y,tag:$}=await As({ignore:r,single:e,tag:s}),v={ignore:r,single:y,tag:$};if(a)v.commit={author:n,email:c,message:m};if(p||g||i)v.release={commitAndPush:i,github:p,npm:g,tags:d};if(l)v.changelog={generate:l,root:u};await O({overwrite:o,...v})}I(`${h.magenta(`${h.bold("Sisyphus ")}${h.underline(h.italic(`v${sn}`))}`)}${h.green(" is setup to roll stones.")}
|
|
469
|
+
|
|
470
|
+
You can now start by creating a new stone by running ${h.reset(h.green("bunx @r5n/sisyphus"))}${h.blue(" version")}
|
|
325
471
|
and following the prompts.
|
|
326
472
|
|
|
327
|
-
After you finished, you can release it by running ${
|
|
328
|
-
`)}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
`)
|
|
335
|
-
`)
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
473
|
+
After you finished, you can release it by running ${h.reset(h.green("bunx @r5n/sisyphus"))}${h.blue(" roll")}
|
|
474
|
+
`)}N();B();_();import{parseArgs as kr}from"util";var{$:pt}=globalThis.Bun;var Fr=x({prefix:"sisyphus:insights"});async function Bs(){let{values:t}=kr({args:process.argv.slice(3),options:{json:{short:"j",type:"boolean"},package:{short:"p",type:"string"}}}),{package:o}=t;bt(`${f.command("sisyphus insights")} - Monorepo health report`);try{let s=await L(),e=Object.values(s);if(o){let r=s.packages[o];if(!r)H(f.error(`Package ${o} not found`)),process.exit(1);await ti(r,s)}else await Dr(e,s.packages)}catch(s){Fr.error("Failed to generate insights",s),H(f.error(`Failed to generate insights: ${s}`)),process.exit(1)}}async function Dr(t,o){let s=await ni(t,o);if(I(`\uD83D\uDCE6 Total Packages: ${f.value(String(s.totalPackages))}
|
|
475
|
+
`+`\uD83D\uDD04 Circular Dependencies: ${s.circularDeps>0?f.error(String(s.circularDeps)):f.success("0")}
|
|
476
|
+
`+`\uD83D\uDCC8 Most Changed: ${f.value(s.mostChanged.name)} (${s.mostChanged.commits} commits)
|
|
477
|
+
`+`\uD83D\uDC0C Stale Packages: ${s.stalePackages.length>0?f.warning(String(s.stalePackages.length)):f.success("0")}
|
|
478
|
+
`+`\uD83C\uDFAF High Impact Changes: ${f.value(String(s.highImpactPackages))}
|
|
479
|
+
`+`\uD83D\uDE80 Release Velocity: ${f.value(s.releaseVelocity)}`,f.bold("\uD83D\uDCCA Monorepo Health Report")),s.dependencyIssues.length>0)I(s.dependencyIssues.map((e)=>`${f.dim("\u2022")} ${e}`).join(`
|
|
480
|
+
`),f.warning("\u26A0\uFE0F Dependency Issues"));if(s.stalePackages.length>0)I(s.stalePackages.map((e)=>`${f.dim("\u2022")} ${e.name} - ${e.daysSinceUpdate} days since last update`).join(`
|
|
481
|
+
`),f.warning("\uD83D\uDC0C Stale Packages"));H(f.success("Analysis complete"))}async function ti(t,o){let s=await oi(t,o);if(I(`Current: ${f.value(s.version)}
|
|
482
|
+
Path: ${f.dim(s.path)}
|
|
483
|
+
Dependencies: ${f.value(String(s.dependencies))}
|
|
484
|
+
Dependents: ${f.value(String(s.dependents))} internal${s.externalDependents?`, ${f.info(s.externalDependents)} external`:""}
|
|
485
|
+
Last Modified: ${f.dim(s.lastModified||"Unknown")}
|
|
486
|
+
Change Frequency: ${f.value(s.changeFrequency||"Low")}
|
|
487
|
+
Breaking Changes: ${f.value(String(s.breakingChanges))} in last year`,f.bold(`\uD83D\uDCE6 ${t.name}`)),s.dependencyTree.length>0)I(Ms(s.dependencyTree),f.info("\uD83C\uDF33 Dependency Tree"));if(s.internalDependents.length>0)I(s.internalDependents.map((e)=>`${f.dim("\u2022")} ${e}`).join(`
|
|
488
|
+
`),f.info("\uD83D\uDC65 Used By"));H(f.success("Analysis complete"))}async function ni(t,o){let s=await si(t),e=await ei(t),r=await ri(),i=ii(t),n=ai(t,o);return{circularDeps:i.length,dependencyIssues:n,highImpactPackages:t.filter((a)=>a.dependencyOf?.length>5).length,mostChanged:s,releaseVelocity:r,stalePackages:e,totalPackages:t.length}}async function oi(t,o){let s=await ci(t.path),e=await fi(t.path),r=await mi(t.name),i=Object.keys(t.packageJson.dependencies||{}).length,n=Object.values(o).filter((c)=>c.dependencyOf?.includes(t.name)).map((c)=>c.name),a=_s(t,o,3);return{breakingChanges:r,changeFrequency:e,dependencies:i,dependencyTree:a,dependents:n.length,externalDependents:await li(t.name),internalDependents:n,lastModified:s,name:t.name,path:t.path,version:t.version}}async function si(t){let o={commits:0,name:"None"};for(let s of t)try{let e=await pt`cd ${s.path} && git rev-list --count HEAD -- .`.text(),r=parseInt(e.trim(),10);if(r>o.commits)o={commits:r,name:s.name}}catch{}return o}async function ei(t,o=180){let s=[];for(let e of t)try{let r=await pt`cd ${e.path} && git log -1 --format=%ct -- .`.text(),i=parseInt(r.trim(),10),n=Math.floor((Date.now()/1000-i)/86400);if(n>o)s.push({daysSinceUpdate:n,name:e.name})}catch{}return s}async function ri(){try{let o=(await pt`git tag -l "v*" --sort=-creatordate | head -10`.text()).trim().split(`
|
|
489
|
+
`).filter(Boolean);if(o.length<2)return"N/A";let s=[];for(let i of o.slice(0,5)){let n=await pt`git log -1 --format=%ct ${i}`.text();s.push(parseInt(n.trim(),10))}let e=0;for(let i=1;i<s.length;i++){let n=s[i-1],a=s[i];if(n&&a)e+=(n-a)/86400}let r=Math.round(e/(s.length-1));if(r<7)return`${r} days (rapid)`;if(r<14)return`${r} days (fast)`;if(r<30)return`${r} days (regular)`;return`${r} days (slow)`}catch{return"N/A"}}function ii(t){return[]}function ai(t,o){let s=[],e=new Map;for(let r of t){let i={...r.packageJson.dependencies,...r.packageJson.devDependencies};for(let[n,a]of Object.entries(i)){if(!e.has(n))e.set(n,new Set);e.get(n)?.add(a)}}for(let[r,i]of e)if(i.size>1)s.push(`${r} has ${i.size} different versions across packages`);return s}async function ci(t){try{let o=await pt`cd ${t} && git log -1 --format=%ct -- .`.text();return new Date(parseInt(o.trim(),10)*1000).toLocaleDateString()}catch{return"Unknown"}}async function fi(t){try{let o=await pt`cd ${t} && git rev-list --count HEAD --since="6 months ago" -- .`.text(),s=parseInt(o.trim(),10);if(s>50)return"High";if(s>20)return"Medium";if(s>5)return"Low";return"Very Low"}catch{return"Unknown"}}async function mi(t){try{let o=await pt`git log --grep="BREAKING" --grep="breaking change" -i --oneline -- "*${t}*" | wc -l`.text();return parseInt(o.trim(),10)}catch{return 0}}async function li(t){return""}function _s(t,o,s,e=0){if(e>=s)return[];let r=[],i=Object.keys(t.packageJson.dependencies||{});for(let n of i)if(o[n])r.push({children:_s(o[n],o,s,e+1),name:n,version:o[n].version});return r}function Ms(t,o=""){let s="";for(let e=0;e<t.length;e++){let r=e===t.length-1,i=r?"\u2514\u2500":"\u251C\u2500",n=o+(r?" ":"\u2502 ");if(s+=`${o}${i} ${t[e].name}@${t[e].version}
|
|
490
|
+
`,t[e].children?.length>0)s+=Ms(t[e].children,n)}return s.trimEnd()}N();B();P();_();import{parseArgs as hi}from"util";var{$:pi}=globalThis.Bun;var Gs=x({prefix:"sisyphus"}).child("metrics");function ui(){let{values:t}=hi({args:process.argv.slice(3),options:{days:{short:"d",type:"string"},detailed:{short:"v",type:"boolean"},json:{short:"j",type:"boolean"},package:{short:"p",type:"string"}}});return{days:t.days?parseInt(t.days,10):30,detailed:t.detailed,json:t.json,package:t.package}}async function Ns(){try{let t=ui(),{packages:o}=await L(),s=await gi(t.days||30),e=await bi(o,s,t.package);if(t.json){console.log(JSON.stringify({packageMetrics:e,releases:s},null,2));return}if(yi(s,e,t),t.detailed)di(e,t)}catch(t){Gs.error("Failed to generate metrics:",t),process.exit(1)}}async function gi(t){let o=new Date;o.setDate(o.getDate()-t);try{let s=await pi`git log --tags --simplify-by-decoration --pretty="format:%ci %h %d" --since="${o.toISOString()}"`.text(),e=[],r=s.trim().split(`
|
|
491
|
+
`).filter(Boolean);for(let i of r){let n=i.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) ([a-f0-9]+) \(tag: ([^)]+)\)/);if(n){let[,a="",c="",m=""]=n,l=new Date(a),p=m.match(/@[^@]+@[\d.]+(-\w+\.\d+)?/g);if(p){let g={},d=[];for(let u of p){let[y,$]=u.split("@").filter(Boolean);if(y&&$)d.push(`@${y}`),g[`@${y}`]={from:"unknown",to:$}}e.push({commitHash:c,date:l,packages:d,tag:m,versions:g})}}}return e}catch{return Gs.warn("Could not fetch git history, using empty release history"),[]}}async function bi(t,o,s){let e=new Map;for(let[r]of Object.entries(t)){if(s&&!r.includes(s))continue;e.set(r,{majorReleases:0,minorReleases:0,name:r,patchReleases:0,releaseFrequency:"Never",totalReleases:0,versionHistory:[]})}for(let r of o)for(let i of r.packages){let n=e.get(i);if(!n)continue;n.totalReleases++,n.lastRelease=r.date;let a=r.versions[i];if(a?.to){n.versionHistory.push({date:r.date,version:a.to});let c=a.to.match(/(\d+)\.(\d+)\.(\d+)/);if(c){let[,,m,l]=c;if(l!=="0")n.patchReleases++;else if(m!=="0")n.minorReleases++;else n.majorReleases++}}}for(let r of e.values())if(r.totalReleases>1&&r.versionHistory.length>1){let i=r.versionHistory[r.versionHistory.length-1]?.date?.getTime()||0,n=r.versionHistory[0]?.date?.getTime()||0,a=Math.floor((n-i)/86400000),c=Math.floor(a/(r.totalReleases-1));if(c===0)r.releaseFrequency="Daily";else if(c<=7)r.releaseFrequency=`Every ${c} days`;else if(c<=30)r.releaseFrequency=`Every ${Math.floor(c/7)} weeks`;else r.releaseFrequency=`Every ${Math.floor(c/30)} months`}else if(r.totalReleases===1)r.releaseFrequency="Single release";return Array.from(e.values()).sort((r,i)=>i.totalReleases-r.totalReleases)}function yi(t,o,s){let e=t.length,r=o.filter((a)=>a.totalReleases>0).length,i=o.length;if(w.info(`Release Metrics - Last ${s.days} days`),console.log(),console.log(f.bold("\uD83D\uDCCA Overview")),console.log(` Total releases: ${f.value(String(e))}`),console.log(` Active packages: ${f.value(`${r}/${i}`)}`),t.length>0){let[a]=t;console.log(` Last release: ${f.dim(Fn(a?.date))}`)}console.log();let n=o.filter((a)=>a.totalReleases>0).slice(0,5);if(n.length>0){console.log(f.bold("\uD83C\uDFC6 Most Active Packages"));for(let a of n){let c="\u2588".repeat(Math.min(20,a.totalReleases)),m=a.lastRelease?` (${Ts(a.lastRelease)})`:"";console.log(` ${f.value(a.name.padEnd(25))} ${f.dim(c)} ${a.totalReleases} releases${f.dim(m)}`)}console.log()}if(t.length>0){console.log(f.bold("\uD83D\uDCC5 Recent Releases"));let a=t.slice(0,5);for(let c of a){let m=c.packages.slice(0,3).join(", "),l=c.packages.length>3?` +${c.packages.length-3} more`:"";console.log(` ${f.dim(Fn(c.date))} - ${m}${f.dim(l)}`)}console.log()}}function di(t,o){console.log(f.bold("\uD83D\uDCE6 Package Details")),console.log();for(let s of t){if(s.totalReleases===0)continue;if(console.log(`${f.bold(s.name)}`),console.log(` Releases: ${s.totalReleases} (${s.majorReleases} major, ${s.minorReleases} minor, ${s.patchReleases} patch)`),console.log(` Frequency: ${s.releaseFrequency}`),console.log(` Last release: ${s.lastRelease?Fn(s.lastRelease):"Never"}`),s.versionHistory.length>0){console.log(" Recent versions:");let e=s.versionHistory.slice(0,3);for(let{version:r,date:i}of e)console.log(` ${f.value(r)} - ${f.dim(Ts(i))}`)}console.log()}}function Fn(t){if(!t)return"Never";return t.toLocaleDateString("en-US",{day:"numeric",hour:"2-digit",minute:"2-digit",month:"short",year:"numeric"})}function Ts(t){let s=new Date().getTime()-t.getTime(),e=Math.floor(s/86400000);if(e===0)return"today";if(e===1)return"yesterday";if(e<7)return`${e} days ago`;if(e<30)return`${Math.floor(e/7)} weeks ago`;if(e<365)return`${Math.floor(e/30)} months ago`;return`${Math.floor(e/365)} years ago`}N();B();_();import{randomUUID as wi}from"crypto";import{join as ut,relative as $i}from"path";var{$:Dn}=globalThis.Bun;var to=x({prefix:"sisyphus:migrate"});async function Us(){let t=to.child("run");bt(`${f.command("sisyphus migrate")} - Migrate from changesets to stones`);let o=process.cwd(),s=ut(o,".changeset");if(!await Bun.file(s).exists())t.warn("No .changeset directory found"),H(f.error("No changesets found to migrate")),process.exit(1);let e=yt();e.start("Analyzing changesets...");try{let r=await Si(s);if(r.length===0){e.stop("No changesets found"),H(f.warning("No changesets to migrate"));return}e.stop(`Found ${f.value(String(r.length))} changeset(s)`);let i=[];for(let d of r){let u=await xi(d);if(u){i.push(u);let y=$i(o,d);I(`${f.dim("File:")} ${y}
|
|
492
|
+
${f.dim("Packages:")} ${Object.entries(u.packages).map(([$,v])=>`${$} (${v})`).join(", ")}
|
|
493
|
+
${f.dim("Summary:")} ${u.summary.slice(0,80)}${u.summary.length>80?"...":""}`,f.info("Changeset found"))}}if(i.length===0){H(f.warning("No valid changesets found to migrate"));return}if(!await G({initialValue:!0,message:`Migrate ${i.length} changeset(s) to stones?`})){H(f.dim("Migration cancelled"));return}e.start("Migrating changesets to stones...");let a=ut(o,".sisyphus"),c=ut(a,"stones");if(!await Bun.file(a).exists())await Dn`mkdir -p ${c}`,await Bun.write(ut(a,"config.json"),JSON.stringify({stones:[]},null,2));else if(!await Bun.file(c).exists())await Dn`mkdir -p ${c}`;let l=(await Z()).length,p=[];for(let d of i){l++;let u=`${String(l).padStart(4,"0")}-${wi().slice(0,8)}`,y=vi(d),$=ut(c,`${u}.md`);await Bun.write($,y.content),p.push(u),t.info(`Created stone: ${u}`)}if(e.stop(`Created ${f.value(String(p.length))} stone(s)`),p.length>0){let d=ut(a,"config.json"),u=await Bun.file(d).json();u.stones=[...u.stones||[],...p],await Bun.write(d,JSON.stringify(u,null,2))}if(await G({initialValue:!0,message:"Remove .changeset directory?"}))e.start("Cleaning up changesets..."),await Dn`rm -rf ${s}`,e.stop("Changesets cleaned up"),t.info("Removed .changeset directory");H(f.success("Migration completed successfully!"))}catch(r){e.stop("Migration failed"),t.error("Migration failed",r),H(f.error(`Migration failed: ${r}`)),process.exit(1)}}async function Si(t){let o=[];try{let s=await Array.fromAsync(new Bun.Glob("*.md").scan(t));for(let e of s)if(e!=="README.md")o.push(ut(t,e))}catch(s){to.error("Failed to scan changeset directory",s)}return o}async function xi(t){try{let s=(await Bun.file(t).text()).split(`
|
|
494
|
+
`),e=!1,r=[],i=[];for(let c of s)if(c.trim()==="---")if(!e)e=!0;else e=!1;else if(e)r.push(c);else if(!e&&r.length>0)i.push(c);let n={};for(let c of r){let m=c.match(/^"(.+)":\s*(major|minor|patch)$/);if(m){if(m[1]&&m[2])n[m[1]]=m[2]}}let a=i.join(`
|
|
495
|
+
`).trim();if(Object.keys(n).length===0)return null;return{packages:n,summary:a}}catch(o){return to.error(`Failed to parse changeset: ${t}`,o),null}}function vi(t){let o=[],s=[],e=[];for(let[l,p]of Object.entries(t.packages)){let g=l.startsWith("@")?l:`@${l}`;switch(p){case"major":o.push(g);break;case"minor":s.push(g);break;case"patch":e.push(g);break}}let r=t.summary.split(`
|
|
496
|
+
`)[0],n=`### ${r||"Migrated from changesets"}
|
|
497
|
+
|
|
498
|
+
`;if(t.summary&&t.summary!==r){let l=t.summary.split(`
|
|
499
|
+
`).slice(1).join(`
|
|
500
|
+
`).trim();if(l)n+=`${l}
|
|
501
|
+
|
|
502
|
+
`}n+=`***
|
|
503
|
+
|
|
504
|
+
`;let a=[],c=[],m=[];if(o.length>0)a.push("major"),c.push(o.join(", ")),m.push(":---:");if(s.length>0)a.push("minor"),c.push(s.join(", ")),m.push(":---:");if(e.length>0)a.push("patch"),c.push(e.join(", ")),m.push(":---:");return n+=`| ${a.join(" | ")} |
|
|
505
|
+
`,n+=`| ${m.join(" | ")} |
|
|
506
|
+
`,n+=`| ${c.join(" | ")} |
|
|
507
|
+
`,{content:n}}N();B();P();_();import{parseArgs as Oi}from"util";_();St();import{randomUUID as Ei}from"crypto";var ji=["major","minor","patch","dependency","snapshot"];function Ri({message:t,tag:o,packages:s}){let e=s.reduce((i,n)=>{return i[n.bump]=i[n.bump]||[],i[n.bump].push(n.name),i},{}),r=ji.filter((i)=>e[i]?.length>0);return[`### ${t}`,o?`_${o}_`:"",Yn,"",`| ${r.join(" | ")} |`,`| ${r.map(()=>":---:").join(" | ")} |`,`| ${r.map((i)=>e[i]?.join(", ")||"").join(" | ")} |`,""]}function gt(t){let o=t.split(`
|
|
508
|
+
`).filter((i)=>i.trim()),s={commitMessage:"",dependency:[],description:"",major:[],minor:[],patch:[],snapshot:[],tag:""},e=o.findIndex((i)=>i.includes("---"));if(o[0]?.startsWith("###"))s.commitMessage=o[0].replace(/^#+\s*/,"");if(e>1){let i=[];for(let n=1;n<e;n++){let a=o[n];if(a?.startsWith("_")&&a.endsWith("_"))s.tag=a.slice(1,-1);else if(a)i.push(a)}s.description=i.join(`
|
|
509
|
+
`).trim()}let r=o.findIndex((i)=>i.includes("|")&&!i.includes("---"));if(r!==-1&&o[r]){let n=o[r].split("|").map((c)=>c.trim()).filter((c)=>c),a=o[r+2];if(a){let c=a.split("|").map((m)=>m.trim()).filter((m)=>m);n.forEach((m,l)=>{let p=c[l]?.split(",").map((d)=>d.trim()).filter((d)=>d)||[],g=m.toLowerCase();if(g==="major")s.major=p;else if(g==="minor")s.minor=p;else if(g==="patch")s.patch=p;else if(g==="dependency")s.dependency=p;else if(g==="snapshot")s.snapshot=p})}}return s}async function rt({majorPackages:t,message:o,minorPackages:s,packages:e,patchPackages:r,tag:i,configPath:n}){let c=`${`${(await Z({configPath:n})).length+1}`.padStart(4,"0")}-${Ei().slice(0,8)}`,m=[...t,...s,...r],l=m.flatMap((u)=>e[u]?.dependencyOf||[]),g=[{packages:t,type:"major"},{packages:s,type:"minor"},{packages:r,type:"patch"},{packages:l.filter((u)=>!m.includes(u)),type:"dependency"}].flatMap(({packages:u,type:y})=>u.map(($)=>{let v=e[$];if(!v)throw new Error(`Package ${$} not found`);return{...v,bump:y,tag:i}})).filter(Boolean),d=Ri({message:o,packages:g,tag:i});return{packages:g,stoneContent:d,stoneName:c}}var Mt=x({prefix:"sisyphus"}).child("pr"),Ai=/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/,Ii=/gitlab\.com\/(.+)\/-\/merge_requests\/(\d+)/,Pi={"breaking-change":"major",bug:"patch",chore:"patch",documentation:"patch",enhancement:"minor",feature:"minor",fix:"patch"};function Bi(){let{values:t}=Oi({args:process.argv.slice(3),options:{dryRun:{short:"d",type:"boolean"},github:{type:"boolean"},gitlab:{type:"boolean"},url:{short:"u",type:"string"},yes:{short:"y",type:"boolean"}}});return t}async function Cs(){try{let t=Bi(),{packages:o,packageNames:s}=await L(),e;if(t.url)e=await _i(t.url);else e=await Mi(t);if(!e){w.error("Could not determine PR information. Please provide a PR URL with --url");return}if(w.info(`Processing PR #${e.number}: ${e.title}`),console.log(),console.log(` Author: ${f.value(e.author)}`),console.log(` Branch: ${f.value(e.branch)}`),e.labels.length>0)console.log(` Labels: ${e.labels.map((y)=>f.dim(y)).join(", ")}`);console.log();let r;for(let y of e.labels){let $=y.toLowerCase();for(let[v,j]of Object.entries(Pi))if($.includes(v)){if(r=j,j==="major")break}if(r==="major")break}if(!r){let y=e.title.toLowerCase();if(y.includes("breaking")||y.includes("!:"))r="major";else if(y.includes("feat")||y.includes("feature"))r="minor";else if(y.includes("fix")||y.includes("bug"))r="patch"}if(!r&&!t.yes){let y=await W({message:"Could not determine bump type from PR. What type of change is this? (major/minor/patch)",placeholder:"patch"});if(!y||!["major","minor","patch"].includes(y)){w.info("Invalid bump type. Cancelled.");return}r=y}else if(!r)r="patch";w.info(`Detected bump type: ${f.bold(r)}`);let i=await Ti(e.branch),n=await Ui(i,o,s);if(n.length===0){w.warn("No packages affected by this PR");return}console.log(),console.log(f.bold("Affected packages:"));for(let y of n){let $=o[y];if(!$)continue;let v=$.version,j=Ci(v,r);console.log(` ${f.value(y)}: ${v} \u2192 ${f.success(j)}`)}console.log();let a=`${e.title} (#${e.number})`,c;if(!t.yes){let y=await W({initialValue:a,message:"Commit message for this stone",placeholder:a});if(!y){w.info("Cancelled");return}c=y}else c=a;let m=r==="major"?n:[],l=r==="minor"?n:[],p=r==="patch"?n:[],{stoneContent:g,stoneName:d}=await rt({majorPackages:m,message:c,minorPackages:l,packages:o,patchPackages:p,tag:void 0});if(t.dryRun){w.info("Dry run - no changes made"),console.log(f.dim("Stone content:")),console.log(g.join(`
|
|
510
|
+
`));return}if(!t.yes){if(!await G({initialValue:!0,message:"Create stone from this PR?"})){w.info("Cancelled");return}}let u=await O();u.stones.push(d),await Bun.write(`.sisyphus/stones/${d}.md`,g.join(`
|
|
511
|
+
`)),await Bun.write(".sisyphus/config.json",`${JSON.stringify(u,null,2)}
|
|
512
|
+
`),w.success(`Created stone from PR: ${f.bold(d)}`),w.info(`Review the stone with ${f.value(`sisyphus stone show ${d}`)}`)}catch(t){Mt.error("Failed to process PR:",t),process.exit(1)}}async function _i(t){let o=t.match(Ai);if(o){let[,e="",r="",i=""]=o;return await Gi(e,r,i)}let s=t.match(Ii);if(s){let[,e="",r=""]=s;return await Ni(e,r)}throw new Error("Unsupported PR URL format")}async function Mi(t){try{if((await Bun.$`git remote get-url origin`.text()).includes("github.com")||t.github)try{let s=await Bun.$`gh pr view --json number,title,body,labels,author,headRefName`.json();return{author:s.author?.login||"unknown",branch:s.headRefName,description:s.body||"",labels:s.labels?.map((e)=>e.name)||[],number:String(s.number),title:s.title}}catch{Mt.debug("GitHub CLI not available or no PR found")}return null}catch(o){return Mt.debug("Could not detect current PR:",o),null}}async function Gi(t,o,s){try{let e=await Bun.$`gh api repos/${t}/${o}/pulls/${s}`.json();return{author:e.user?.login||"unknown",branch:e.head.ref,description:e.body||"",labels:e.labels?.map((r)=>r.name)||[],number:String(e.number),title:e.title}}catch(e){throw new Error(`Failed to fetch GitHub PR: ${e}`)}}async function Ni(t,o){throw new Error("GitLab integration requires API token configuration")}async function Ti(t){try{let s=(await Bun.$`git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'`.text()).trim()||"main";return(t?await Bun.$`git diff --name-only ${s}...${t}`.text():await Bun.$`git diff --name-only ${s}...HEAD`.text()).trim().split(`
|
|
513
|
+
`).filter(Boolean)}catch(o){return Mt.warn("Could not get changed files, using current uncommitted changes"),(await Bun.$`git status --porcelain`.text()).trim().split(`
|
|
514
|
+
`).map((e)=>e.substring(3)).filter(Boolean)}}async function Ui(t,o,s){let e=new Set,r=new Map;for(let[i,n]of Object.entries(o))if(n.relativePath)r.set(n.relativePath,i);for(let i of t)for(let[n,a]of r)if(i.startsWith(`${n}/`))e.add(a);if(e.size===0&&t.length>0){if(t.filter((n)=>!n.includes("/")||n.startsWith(".")).length>0)return Mt.info("Root files changed, considering all packages affected"),s}return Array.from(e)}function Ci(t,o){let s=t.split("."),e=parseInt(s[0]||"0",10),r=parseInt(s[1]||"0",10),i=parseInt(s[2]||"0",10);switch(o){case"major":return`${e+1}.0.0`;case"minor":return`${e}.${r+1}.0`;case"patch":return`${e}.${r}.${i+1}`;default:return t}}N();B();P();_();St();import{parseArgs as Li}from"util";var Hi=x({prefix:"sisyphus"}).child("prerelease"),qi=["alpha","beta","rc","canary","dev","next"];function Ji(){let{values:t}=Li({args:process.argv.slice(3),options:{bump:{short:"b",type:"string"},dryRun:{short:"d",type:"boolean"},filter:{short:"f",type:"string"},promote:{short:"p",type:"boolean"},type:{short:"t",type:"string"},yes:{short:"y",type:"boolean"}}});return t}async function Ls(){try{let t=Ji(),{packages:o,packageNames:s}=await L({filter:t.filter});if(t.promote)await Xi(t,o,s);else await Wi(t,o,s)}catch(t){Hi.error("Prerelease operation failed:",t),process.exit(1)}}async function Wi(t,o,s){let e=t.type||await et({message:"Select prerelease type",options:qi.map(($)=>({hint:zi($),label:$,value:$}))});if(!e||typeof e!=="string"){w.info("Cancelled");return}let r=t.filter,i=r?s.filter(($)=>$.includes(r)):s;if(i.length===0){w.error(`No packages found matching filter: ${t.filter}`);return}let n=t.filter?i:await Yi(i,o);if(n.length===0){w.info("No packages selected");return}let a;if(t.bump){let v={major:"major",minor:"minor",patch:"patch"}[t.bump.toLowerCase()];if(!v){w.error(`Invalid bump type: ${t.bump}. Must be major, minor, or patch.`);return}a=v}else{let $=await et({message:"What type of change is this prerelease for?",options:[{label:"Major - Breaking changes",value:"major"},{label:"Minor - New features",value:"minor"},{label:"Patch - Bug fixes",value:"patch"}]});if(!$){w.info("Cancelled");return}a=$}let c=`chore: prepare ${e} release`,m;if(t.yes)m=c;else{let $=await W({message:"Commit message for this prerelease",placeholder:c});if(!$||typeof $!=="string"){w.info("Cancelled");return}m=$}let l=[],p=[],g=[];for(let $ of n)switch(a){case"major":l.push($);break;case"minor":p.push($);break;case"patch":g.push($);break}let{stoneContent:d,stoneName:u}=await rt({majorPackages:l,message:m,minorPackages:p,packages:o,patchPackages:g,tag:e});w.step("Preview of prerelease changes:"),console.log();for(let $ of n){let v=o[$],j=X({bump:a,tag:e,version:v.version});console.log(` ${f.value($)}: ${v.version} \u2192 ${f.bold(j)}`)}if(console.log(),t.dryRun){w.info("Dry run - no changes made"),console.log(f.dim("Stone content:")),console.log(d.join(`
|
|
515
|
+
`));return}if(!t.yes){if(!await G({initialValue:!0,message:"Create this prerelease stone?"})){w.info("Cancelled");return}}let y=await O();y.stones.push(u),await Bun.write(`.sisyphus/stones/${u}.md`,d.join(`
|
|
516
|
+
`)),await Bun.write(".sisyphus/config.json",`${JSON.stringify(y,null,2)}
|
|
517
|
+
`),w.success(`Created ${e} prerelease stone: ${f.bold(u)}`),w.info(`Run ${f.value("sisyphus roll")} to publish the prerelease`)}async function Xi(t,o,s){let e=s.filter((u)=>{return o[u].version.includes("-")});if(e.length===0){w.info("No packages with prerelease versions found");return}w.info(`Found ${f.bold(String(e.length))} packages with prerelease versions`),console.log();let r=new Map;for(let u of e){let $=o[u].version.match(/-(\w+)\./);if($){let v=$[1];if(!r.has(v))r.set(v,[]);r.get(v)?.push(u)}}for(let[u,y]of r){console.log(`${f.bold(u)} packages:`);for(let $ of y)console.log(` ${f.value($)}: ${o[$].version}`);console.log()}let i=Array.from(r.keys()),n=[];if(i.includes("alpha"))n.push({label:"Promote alpha \u2192 beta",value:"alpha-to-beta"},{label:"Promote alpha \u2192 rc",value:"alpha-to-rc"},{label:"Promote alpha \u2192 stable",value:"alpha-to-stable"});if(i.includes("beta"))n.push({label:"Promote beta \u2192 rc",value:"beta-to-rc"},{label:"Promote beta \u2192 stable",value:"beta-to-stable"});if(i.includes("rc")||i.includes("next"))n.push({label:"Graduate to stable release",value:"to-stable"});n.push({label:"Increment current prerelease version",value:"increment"});let a=await et({message:"How would you like to promote these prereleases?",options:n});if(!a){w.info("Cancelled");return}let c,m=e,l;switch(a){case"alpha-to-beta":c="beta",m=r.get("alpha")||[],l="chore: promote alpha to beta";break;case"alpha-to-rc":c="rc",m=r.get("alpha")||[],l="chore: promote alpha to rc";break;case"alpha-to-stable":c=void 0,m=r.get("alpha")||[],l="chore: promote alpha to stable release";break;case"beta-to-rc":c="rc",m=r.get("beta")||[],l="chore: promote beta to rc";break;case"beta-to-stable":c=void 0,m=r.get("beta")||[],l="chore: promote beta to stable release";break;case"to-stable":c=void 0,m=[...r.get("rc")||[],...r.get("next")||[]],l="chore: graduate to stable release";break;case"increment":if(i.length>1){let u=await et({message:"Which prerelease type would you like to increment?",options:i.map((y)=>({label:y,value:y}))});if(!u){w.info("Cancelled");return}c=u,m=r.get(c)||[]}else c=i[0],m=c?r.get(c)||[]:[];l=`chore: increment ${c} version`;break;default:w.error("Unknown promotion strategy");return}if(m.length===0){w.info("No packages to promote");return}w.step("Preview of promotion:"),console.log();for(let u of m){let y=o[u].version,$;if(c===void 0)$=y.split("-")[0];else if(a==="increment")$=X({bump:"patch",tag:c,version:y});else $=`${y.split("-")[0]}-${c}.0`;console.log(` ${f.value(u)}: ${y} \u2192 ${f.bold($)}`)}if(console.log(),!t.yes){if(!await G({initialValue:!0,message:"Continue with this promotion?"})){w.info("Cancelled");return}}let{stoneContent:p,stoneName:g}=await rt({majorPackages:[],message:l,minorPackages:[],packages:o,patchPackages:m,tag:c});if(t.dryRun){w.info("Dry run - no changes made"),console.log(p.join(`
|
|
518
|
+
`));return}let d=await O();d.stones.push(g),await Bun.write(`.sisyphus/stones/${g}.md`,p.join(`
|
|
519
|
+
`)),await Bun.write(".sisyphus/config.json",`${JSON.stringify(d,null,2)}
|
|
520
|
+
`),w.success(`Created promotion stone: ${f.bold(g)}`),w.info(`Run ${f.value("sisyphus roll")} to publish the promotion`)}function zi(t){switch(t){case"alpha":return"Early development, unstable";case"beta":return"Feature complete, testing";case"rc":return"Release candidate, final testing";case"canary":return"Latest commit builds";case"dev":return"Development builds";case"next":return"Next version preview";default:return""}}async function Yi(t,o){if(await et({message:"Select packages for prerelease",options:[{label:"All packages",value:"all"},{label:"Select specific packages",value:"select"}]})==="all")return t;w.info("Select packages (space to select, enter to confirm)");let e=[];for(let r of t)if(await G({initialValue:!1,message:`Include ${r} (${o[r].version})?`}))e.push(r);return e}N();B();P();_();import{parseArgs as Ki}from"util";var Zi=x({prefix:"sisyphus"}).child("preview");async function Hs(){let{values:t}=Ki({args:process.argv.slice(3),options:{json:{short:"j",type:"boolean"},verbose:{short:"v",type:"boolean"}}}),{json:o,verbose:s}=t;try{let e=await O(),r=await _t();if(r.length===0){if(o)console.log(JSON.stringify({message:"No pending stones found"}));else w.info("No pending stones found. Nothing to preview.");return}let{packages:i}=await L(),n={},a=[];for(let{tag:m,packages:l,message:p}of r){a.push(p);for(let g of l){if(!n[g.name])n[g.name]={...g};let d=n[g.name];if(!d)continue;if(m)d.tag=m;d.bump=mt.indexOf(g.bump)>mt.indexOf(d.bump)?g.bump:d.bump,n[g.name]=d}}let c=Object.entries(n).map(([m,l])=>{let p=i[m]?.version||"0.0.0",[g="0",d="0",u="0"]=p.split("."),y=p;switch(l.bump){case"major":y=`${Number.parseInt(g,10)+1}.0.0`;break;case"minor":y=`${g}.${Number.parseInt(d,10)+1}.0`;break;case"patch":case"dependency":y=`${g}.${d}.${Number.parseInt(u,10)+1}`;break;case"snapshot":{let $=new Date().toISOString().replace(/[.ZT:-]/g,"").slice(0,14);y=`0.0.0-${l.tag||"nightly"}-${$}`;break}}if(l.tag&&l.bump!=="snapshot")y=`${y}-${l.tag}.0`;return{bump:l.bump,currentVersion:p,name:m,newVersion:y,tag:l.tag}});if(o){console.log(JSON.stringify({messages:a,stones:r.length,updates:c},null,2));return}w.info(`Preview of release with ${f.bold(String(r.length))} stone${r.length>1?"s":""}`),console.log(),console.log(f.bold("Commit Messages:")),a.forEach((m)=>{console.log(` ${f.bullet("\u2022")} ${m}`)}),console.log(),console.log(f.bold("Version Updates:"));for(let m of c){let l=m.bump==="major"?f.error:m.bump==="minor"?f.warning:f.success;console.log(` ${f.value(m.name)}`),console.log(` ${f.dim("Current:")} ${m.currentVersion}`),console.log(` ${f.dim("New:")} ${f.bold(m.newVersion)}`),console.log(` ${f.dim("Bump:")} ${l(m.bump)}${m.tag?` (${f.value(m.tag)})`:""}`),console.log()}if(s)console.log(f.bold("Additional Information:")),console.log(` ${f.dim("Config path:")} ${e.configPath||".sisyphus"}`),console.log(` ${f.dim("Total packages:")} ${Object.keys(i).length}`),console.log(` ${f.dim("Packages to update:")} ${c.length}`)}catch(e){Zi.error("Failed to preview release:",e),process.exit(1)}}N();B();_();import{parseArgs as Qi}from"util";var{$:rn}=globalThis.Bun;var Vi=x({prefix:"sisyphus:solo"});async function qs(){let{values:t}=Qi({args:process.argv.slice(3),options:{"dry-run":{short:"d",type:"boolean"},tag:{short:"t",type:"string"}}}),{"dry-run":o,tag:s}=t;bt(`${f.command("sisyphus solo")} - Single maintainer workflow`);let e=yt();e.start("Creating version from commits and rolling immediately...");try{let r=await rn`git describe --tags --abbrev=0 2>/dev/null || echo ""`.text(),i=await rn`git rev-list ${r?`${r.trim()}..HEAD`:"HEAD"} --count`.text();if(parseInt(i.trim(),10)===0){e.stop("No commits to release"),H(f.dim("Already up to date"));return}e.message("Analyzing commits...");let n=["bunx","@r5n/sisyphus","version","--from-commits","--yes"];if(o)n.push("--dry-run");if(await rn`${n}`,((await O()).stones||[]).length===0&&!o){e.stop("No releasable changes found"),H(f.dim("No version bumps needed"));return}e.message(o?"Previewing release...":"Rolling stones...");let m=["bunx","@r5n/sisyphus","roll"];if(o)m.push("--dry-run");if(s)m.push("--tag",s);await rn`${m}`,e.stop("Release complete!"),H(f.success("Published successfully"))}catch(r){e.stop("Solo release failed"),Vi.error("Failed to complete solo workflow",r),H(f.error(`Solo release failed: ${r}`)),process.exit(1)}}B();P();N();B();P();_();import{existsSync as ki}from"fs";import{unlink as Fi}from"fs/promises";import{join as Di}from"path";import{parseArgs as ta}from"util";var Gt=x({prefix:"sisyphus"}).child("stone:delete");async function Js(t){if(!t)Gt.error("Stone ID is required"),Gt.error("Usage: sisyphus stone delete <id>"),process.exit(1);let{values:o}=ta({args:process.argv.slice(5),options:{force:{short:"f",type:"boolean"}}}),{force:s}=o;try{let r=(await O()).stonesPath||".sisyphus/stones",i=Di(r,`${t}.md`);if(!ki(i))Gt.error(`Stone '${t}' not found`),Gt.info("Run 'sisyphus stone list' to see available stones"),process.exit(1);if(!s){if(!await G({initialValue:!1,message:`Delete stone '${t}'?`})){w.info("Deletion cancelled");return}}await Fi(i),w.success(`Stone '${f.bold(t)}' deleted`)}catch(e){Gt.error(`Failed to delete stone '${t}':`,e),process.exit(1)}}N();B();P();_();import{existsSync as na}from"fs";import{readFile as oa,writeFile as sa}from"fs/promises";import{join as ea}from"path";import{parseArgs as ra}from"util";var vt=x({prefix:"sisyphus"}).child("stone:edit");async function Ws(t){if(!t)vt.error("Stone ID is required"),vt.error("Usage: sisyphus stone edit <id>"),process.exit(1);let{values:o}=ra({args:process.argv.slice(5),options:{interactive:{short:"i",type:"boolean"},message:{short:"m",type:"string"}}}),{message:s,interactive:e}=o;try{let i=(await O()).stonesPath||".sisyphus/stones",n=ea(i,`${t}.md`);if(!na(n))vt.error(`Stone '${t}' not found`),vt.info("Run 'sisyphus stone list' to see available stones"),process.exit(1);let a=await oa(n,"utf-8");if(s){let c=a.split(`
|
|
521
|
+
`);c[0]=`### ${s}`,await sa(n,c.join(`
|
|
522
|
+
`)),w.success(`Updated commit message for stone '${f.bold(t)}'`);return}if(e){w.info("Interactive stone editing coming soon"),w.info("For now, you can manually edit:"),w.info(f.dim(n));return}vt.error("Please specify --message or --interactive"),process.exit(1)}catch(r){vt.error(`Failed to edit stone '${t}':`,r),process.exit(1)}}B();var Xs={delete:`
|
|
339
523
|
sisyphus stone delete - Remove a specific stone before rolling
|
|
340
524
|
|
|
341
525
|
USAGE
|
|
@@ -386,7 +570,7 @@ EXAMPLES
|
|
|
386
570
|
# Output as JSON for scripting
|
|
387
571
|
sisyphus stone list --json
|
|
388
572
|
`,merge:`
|
|
389
|
-
sisyphus stone merge - Combine multiple stones
|
|
573
|
+
sisyphus stone merge - Combine multiple stones with smart conflict resolution
|
|
390
574
|
|
|
391
575
|
USAGE
|
|
392
576
|
sisyphus stone merge [options]
|
|
@@ -395,6 +579,7 @@ OPTIONS
|
|
|
395
579
|
-i, --ids Stone IDs to merge (multiple) [string]
|
|
396
580
|
-m, --message Commit message for merged stone [string]
|
|
397
581
|
-f, --force Skip confirmation [boolean]
|
|
582
|
+
-s, --strategy Conflict resolution (highest/interactive) [string]
|
|
398
583
|
|
|
399
584
|
EXAMPLES
|
|
400
585
|
# Merge stones interactively
|
|
@@ -403,8 +588,16 @@ EXAMPLES
|
|
|
403
588
|
# Merge specific stones
|
|
404
589
|
sisyphus stone merge --ids stone-123 stone-456
|
|
405
590
|
|
|
406
|
-
# Merge with
|
|
407
|
-
sisyphus stone merge --
|
|
591
|
+
# Merge with automatic conflict resolution
|
|
592
|
+
sisyphus stone merge --strategy highest
|
|
593
|
+
|
|
594
|
+
# Merge with interactive conflict resolution
|
|
595
|
+
sisyphus stone merge --strategy interactive --message "feat: combined changes"
|
|
596
|
+
|
|
597
|
+
NOTES
|
|
598
|
+
- Detects when same package has different bump types across stones
|
|
599
|
+
- Default strategy uses highest bump type (major > minor > patch)
|
|
600
|
+
- Interactive strategy lets you choose resolution for each conflict
|
|
408
601
|
`,show:`
|
|
409
602
|
sisyphus stone show - Display full content of a specific stone
|
|
410
603
|
|
|
@@ -420,50 +613,55 @@ EXAMPLES
|
|
|
420
613
|
|
|
421
614
|
# Output as JSON
|
|
422
615
|
sisyphus stone show stone-123 --json
|
|
423
|
-
`};function
|
|
424
|
-
`).map((
|
|
425
|
-
`);console.log(
|
|
426
|
-
${
|
|
616
|
+
`};function an(t){if(t&&Xs[t]){let s=Xs[t].split(`
|
|
617
|
+
`).map((e)=>{if(e.startsWith("sisyphus"))return f.bold(e);if(e==="USAGE"||e==="OPTIONS"||e==="EXAMPLES")return f.bold(e);if(e.startsWith(" -")){let r=e.match(/^(\s+-\w,\s--\w+)\s+(.+)$/);if(r){let[,i="",n=""]=r,a=n.replace("(required)",f.error("(required)")).replace(/\(default: ([^)]+)\)/g,(c,m)=>f.dim(`(default: ${m})`)).replace(/\[boolean\]/g,f.boolean("[boolean]")).replace(/\[string\]/g,f.string("[string]")).replace(/\[number\]/g,f.number("[number]"));return` ${f.flag(i.padEnd(26))} ${a}`}}if(e.startsWith(" # "))return f.dim(e);if(e.startsWith(" sisyphus"))return` ${f.value(e.trim())}`;return e}).join(`
|
|
618
|
+
`);console.log(s);return}console.log(`
|
|
619
|
+
${f.bold("Sisyphus Stone Management")}
|
|
427
620
|
|
|
428
|
-
${
|
|
621
|
+
${f.bold("USAGE")}
|
|
429
622
|
sisyphus stone <command> [options]
|
|
430
623
|
|
|
431
|
-
${
|
|
432
|
-
${
|
|
433
|
-
${
|
|
434
|
-
${
|
|
435
|
-
${
|
|
436
|
-
${
|
|
437
|
-
${
|
|
438
|
-
|
|
439
|
-
Use ${
|
|
440
|
-
`)}
|
|
441
|
-
`).forEach((
|
|
442
|
-
|
|
443
|
-
${
|
|
624
|
+
${f.bold("COMMANDS")}
|
|
625
|
+
${f.command("list")} View all pending stones with details
|
|
626
|
+
${f.command("delete")} Remove a specific stone by ID
|
|
627
|
+
${f.command("show")} Display full content of a stone
|
|
628
|
+
${f.command("edit")} Modify stone content or versions
|
|
629
|
+
${f.command("merge")} Combine multiple stones into one
|
|
630
|
+
${f.command("help")} Show this help message
|
|
631
|
+
|
|
632
|
+
Use ${f.value("sisyphus stone <command> --help")} for more information about a command.
|
|
633
|
+
`)}N();B();P();_();import{readFile as ia}from"fs/promises";import{join as aa}from"path";import{parseArgs as ca}from"util";var zs=x({prefix:"sisyphus"}).child("stone:list");async function Ys(){let{values:t}=ca({args:process.argv.slice(4),options:{json:{short:"j",type:"boolean"},verbose:{short:"v",type:"boolean"}}}),{json:o,verbose:s}=t;try{let r=(await O()).stonesPath||".sisyphus/stones",i=await Z();if(i.length===0){if(o)console.log(JSON.stringify([]));else w.info("No pending stones found");return}let n=[];for(let a of i){let c=aa(r,`${a}.md`);try{let m=await ia(c,"utf-8"),l=gt(m);n.push({id:a,path:c,...l})}catch(m){zs.warn(`Failed to read stone ${a}:`,m)}}if(o){console.log(JSON.stringify(n,null,2));return}w.info(`Found ${f.bold(String(n.length))} pending stone${n.length>1?"s":""}`),console.log();for(let[a,c]of n.entries()){if(console.log(`${f.bullet("\u2022")} ${f.bold(c.id)}`),console.log(` ${f.dim("Message:")} ${c.commitMessage}`),c.tag)console.log(` ${f.dim("Tag:")} ${f.value(c.tag)}`);if(c.major.length>0)console.log(` ${f.error("Major:")} ${c.major.join(", ")}`);if(c.minor.length>0)console.log(` ${f.warning("Minor:")} ${c.minor.join(", ")}`);if(c.patch.length>0)console.log(` ${f.success("Patch:")} ${c.patch.join(", ")}`);if(s&&c.description)console.log(` ${f.dim("Description:")}`),c.description.split(`
|
|
634
|
+
`).forEach((m)=>{console.log(` ${f.dim(m)}`)});if(a<n.length-1)console.log()}}catch(e){zs.error("Failed to list stones:",e),process.exit(1)}}N();B();P();_();import{readFile as Vs,unlink as ks,writeFile as fa}from"fs/promises";import{join as no}from"path";import{parseArgs as ma}from"util";N();B();St();var cn={major:4,minor:3,patch:2,dependency:1,snapshot:5};function Ks(t){let o=new Map;for(let e of t){for(let r of e.major){let i={bumpType:"major",name:r,stoneId:e.id,tag:e.tag};o.set(r,[...o.get(r)||[],i])}for(let r of e.minor){let i={bumpType:"minor",name:r,stoneId:e.id,tag:e.tag};o.set(r,[...o.get(r)||[],i])}for(let r of e.patch){let i={bumpType:"patch",name:r,stoneId:e.id,tag:e.tag};o.set(r,[...o.get(r)||[],i])}}let s=[];for(let[e,r]of o)if(r.length>1){let i=new Set(r.map((a)=>a.bumpType)),n=new Set(r.map((a)=>a.tag).filter(Boolean));if(i.size>1||n.size>1)s.push({conflicts:r,packageName:e})}return s}async function Zs(t,o="highest"){let s=[];for(let e of t){if(o==="highest"){let r=e.conflicts.reduce((i,n)=>cn[n.bumpType]>cn[i.bumpType]?n:i);e.resolution={chosenBumpType:r.bumpType,chosenStoneId:r.stoneId,reason:"Highest bump type selected"}}else{let r=e.conflicts.map((n)=>({label:`${n.bumpType} from ${n.stoneId}${n.tag?` (${n.tag})`:""}`,value:n}));console.log(`
|
|
635
|
+
${f.warning("Conflict detected")} for ${f.value(e.packageName)}:`);for(let n of e.conflicts)console.log(` ${f.dim("\u2022")} ${n.bumpType} from ${n.stoneId}${n.tag?` (${n.tag})`:""}`);let i=await et({message:"How should this conflict be resolved?",options:[{label:"Use highest bump type",value:"highest"},...r]});if(i&&i==="highest"){let n=e.conflicts.reduce((a,c)=>cn[c.bumpType]>cn[a.bumpType]?c:a);e.resolution={chosenBumpType:n.bumpType,chosenStoneId:n.stoneId,reason:"Highest bump type selected"}}else if(i&&typeof i==="object"){let n=i;e.resolution={chosenBumpType:n.bumpType,chosenStoneId:n.stoneId,reason:"Manually selected"}}}s.push(e)}return s}function Qs(t,o){let s={major:new Set,minor:new Set,patch:new Set,tags:{}},e=new Map;for(let r of o)if(r.resolution){let{chosenBumpType:i}=r.resolution,n=r.conflicts.find((a)=>a.stoneId===r.resolution?.chosenStoneId);e.set(r.packageName,{bumpType:i,tag:n?.tag})}for(let r of t){for(let i of r.major){let n=e.get(i);if(n){switch(n.bumpType){case"major":s.major.add(i);break;case"minor":s.minor.add(i);break;case"patch":s.patch.add(i);break}if(n.tag)s.tags[i]=n.tag}else s.major.add(i)}for(let i of r.minor)if(!e.has(i))s.minor.add(i);for(let i of r.patch)if(!e.has(i))s.patch.add(i)}return{major:Array.from(s.major),minor:Array.from(s.minor),patch:Array.from(s.patch),tags:s.tags}}var Fs=x({prefix:"sisyphus"}).child("stone:merge");async function Ds(t){let{values:o}=ma({allowPositionals:!0,args:process.argv.slice(4),options:{force:{short:"f",type:"boolean"},ids:{multiple:!0,short:"i",type:"string"},message:{short:"m",type:"string"},strategy:{short:"s",type:"string"}}}),{ids:s,message:e,force:r,strategy:i}=o;try{let a=(await O()).stonesPath||".sisyphus/stones",c=await Z();if(c.length<2){w.info("Need at least 2 stones to merge");return}let m=[];if(s&&s.length>=2){for(let S of s)if(c.includes(S)){let E=no(a,`${S}.md`),R=await Vs(E,"utf-8"),T=gt(R);m.push({id:S,path:E,...T})}if(m.length<2)Fs.error("Could not find all specified stones"),process.exit(1)}else{let S=[];for(let R of c){let T=no(a,`${R}.md`),Y=await Vs(T,"utf-8"),k=gt(Y);S.push({label:`${R} - ${k.commitMessage}`,value:{id:R,path:T,...k}})}let E=await Kt({message:"Select stones to merge",options:S,required:!0});if(!E||Array.isArray(E)&&E.length<2){w.info("Need to select at least 2 stones");return}m=E}let l=e||await W({message:"Commit message for merged stone",placeholder:"feat: combined changes"});if(!l||typeof l!=="string"){w.info("Merge cancelled");return}let p=Ks(m),g;if(p.length>0){I(`Found ${f.value(String(p.length))} package conflict(s):
|
|
636
|
+
`+p.map((R)=>` ${f.dim("\u2022")} ${R.packageName}`).join(`
|
|
637
|
+
`),f.warning("Conflicts detected"));let E=await Zs(p,i==="highest"||i==="interactive"?i:"highest");if(g=Qs(m,E),E.length>0){let R=E.filter((T)=>T.resolution).map((T)=>` ${f.dim("\u2022")} ${T.packageName}: ${T.resolution?.chosenBumpType} (${T.resolution?.reason})`).join(`
|
|
638
|
+
`);I(R,f.success("Conflicts resolved"))}}else{let S={major:[],minor:[],patch:[]};for(let E of m)S.major.push(...E.major),S.minor.push(...E.minor),S.patch.push(...E.patch);g={major:[...new Set(S.major)],minor:[...new Set(S.minor)],patch:[...new Set(S.patch)],tags:{}}}let d=[];for(let S of m)if(S.description)d.push(S.description);let y=`merged-${Date.now()}`,$=no(a,`${y}.md`),v=`### ${l}
|
|
639
|
+
`,j=[...new Set(Object.values(g.tags))];if(j.length===1)v+=`_${j[0]}_
|
|
640
|
+
`;if(d.length>0)v+=`
|
|
641
|
+
${d.join(`
|
|
444
642
|
|
|
445
643
|
`)}
|
|
446
|
-
`;if(
|
|
644
|
+
`;if(v+=`
|
|
447
645
|
---
|
|
448
646
|
|
|
449
|
-
`,
|
|
450
|
-
`,
|
|
451
|
-
`,
|
|
452
|
-
`}if(await
|
|
453
|
-
`),
|
|
454
|
-
`).filter(Boolean),
|
|
455
|
-
`)),await Bun.write(".sisyphus/config.json",`${JSON.stringify(
|
|
456
|
-
`)}async function
|
|
457
|
-
`)):""}${
|
|
458
|
-
`,`${
|
|
459
|
-
`)),
|
|
647
|
+
`,g.major.length>0||g.minor.length>0||g.patch.length>0){let S=[],E=[];if(g.major.length>0)S.push("major"),E.push(g.major.join(", "));if(g.minor.length>0)S.push("minor"),E.push(g.minor.join(", "));if(g.patch.length>0)S.push("patch"),E.push(g.patch.join(", "));v+=`| ${S.join(" | ")} |
|
|
648
|
+
`,v+=`| ${S.map(()=>":---:").join(" | ")} |
|
|
649
|
+
`,v+=`| ${E.join(" | ")} |
|
|
650
|
+
`}if(await fa($,v),!r){if(await G({initialValue:!0,message:"Delete original stones?"}))for(let E of m)await ks(E.path)}else for(let S of m)await ks(S.path);w.success(`Created merged stone: ${f.bold(y)}`)}catch(n){Fs.error("Failed to merge stones:",n),process.exit(1)}}B();P();_();import{existsSync as la}from"fs";import{readFile as ha}from"fs/promises";import{join as pa}from"path";import{parseArgs as ua}from"util";var Nt=x({prefix:"sisyphus"}).child("stone:show");async function te(t){if(!t)Nt.error("Stone ID is required"),Nt.error("Usage: sisyphus stone show <id>"),process.exit(1);let{values:o}=ua({args:process.argv.slice(5),options:{json:{short:"j",type:"boolean"}}}),{json:s}=o;try{let r=(await O()).stonesPath||".sisyphus/stones",i=pa(r,`${t}.md`);if(!la(i))Nt.error(`Stone '${t}' not found`),Nt.info("Run 'sisyphus stone list' to see available stones"),process.exit(1);let n=await ha(i,"utf-8");if(s){let a=gt(n);console.log(JSON.stringify({id:t,path:i,...a,raw:n},null,2));return}console.log(f.bold(`Stone: ${t}`)),console.log(f.dim(`Path: ${i}`)),console.log(f.dim("\u2500".repeat(50))),console.log(),console.log(n)}catch(e){Nt.error(`Failed to show stone '${t}':`,e),process.exit(1)}}var fn=["list","delete","show","edit","merge","help"],Et=x({prefix:"sisyphus"}).child("stone"),ga={combine:"merge",del:"delete",display:"show",join:"merge",ls:"list",modify:"edit",remove:"delete",rm:"delete",update:"edit",view:"show"};async function ne(){let[,,,t,...o]=process.argv;if(!t||t==="--help"||t==="-h"){an();return}let s=t;if(!fn.includes(t)){let e=Qt(t,ga);if(e&&fn.includes(e))s=e,Et.warn(`Assuming you meant '${e}'`)}if(!fn.includes(s)){Et.error(`Unknown stone command: ${t}`);let e=Zt(t,fn);if(e.length>0){Et.error("Did you mean one of these?");for(let r of e)Et.error(` ${r}`)}Et.error("Run 'sisyphus stone --help' for usage information"),process.exit(1)}if(o.includes("--help")||o.includes("-h")){an(s);return}try{switch(s){case"list":await Ys();break;case"delete":await Js(o[0]);break;case"show":await te(o[0]);break;case"edit":await Ws(o[0]);break;case"merge":await Ds(o);break;case"help":{let e=o[0];an(e);break}default:throw new Error(`Unknown stone command: ${s}`)}}catch(e){Et.error(`Failed to execute stone ${s}:`,e),process.exit(1)}}N();P();import{parseArgs as $a}from"util";_();N();B();P();_();var{$:oe}=globalThis.Bun;var ba=x({prefix:"sisyphus"}).child("from-commits"),ya=/^(\w+)(?:\(([^)]+)\))?(!)?: (.+)$/,se={build:"patch",chore:"patch",ci:"patch",docs:"patch",feat:"minor",fix:"patch",perf:"patch",refactor:"patch",style:"patch",test:"patch"};async function ee(t){try{let s=(await O()).lastStone?.commit||"",e=s?`${s}..HEAD`:"HEAD",{stdout:r}=await oe`git log ${e} --pretty=format:"%H|%s" --no-merges`.quiet();if(!r.toString().trim())return w.info("No commits found since last release"),[];let i=r.toString().trim().split(`
|
|
651
|
+
`),n=[];for(let c of i){let[m,l]=c.split("|");if(!m||!l)continue;let p=da(m,l);if(p){let{stdout:g}=await oe`git diff-tree --no-commit-id --name-only -r ${m}`.quiet();p.files=g.toString().trim().split(`
|
|
652
|
+
`).filter(Boolean),n.push(p)}}if(n.length===0)return w.info("No conventional commits found"),[];let a=await wa(n,t);return w.info(`Found ${f.bold(String(n.length))} conventional commits`),w.info(`Creating ${f.bold(String(a.length))} stone${a.length>1?"s":""}`),a}catch(o){throw ba.error("Failed to analyze commits:",o),o}}function da(t,o){let s=o.match(ya);if(!s)return null;let[,e="",r,i,n=""]=s;if(!e||!se[e])return null;return{breaking:!!i,files:[],hash:t,message:n,scope:r,type:e}}async function wa(t,o){let{packages:s}=await Promise.resolve().then(() => (_(),Vn)).then((i)=>i.getPackages({filter:o})),e=new Map;for(let[i,n]of Object.entries(s)){let a=n.file.substring(0,n.file.lastIndexOf("/"));e.set(a,i)}let r=new Map;for(let i of t){let n=new Set;for(let l of i.files)for(let[p,g]of e.entries())if(l.startsWith(p))n.add(g);if(n.size===0)continue;let a;if(i.breaking)a="major";else a=se[i.type]||"patch";let c=`${i.type}${i.breaking?"!":""}`;if(!r.has(c)){let l=i.breaking?"feat!: breaking changes":`${i.type}: ${i.type} updates`;r.set(c,{bump:a,message:l,packages:new Set})}let m=r.get(c);if(m)for(let l of n)m.packages.add(l)}return Array.from(r.values()).filter((i)=>i.packages.size>0)}function Sa(){let{values:t}=$a({allowPositionals:!0,args:process.argv.slice(3),options:{bump:{default:"",short:"b",type:"string"},dryRun:{default:!1,short:"d",type:"boolean"},filter:{default:"",short:"f",type:"string"},"from-commits":{default:!1,type:"boolean"},snapshot:{default:!1,short:"s",type:"boolean"},tag:{default:"",short:"t",type:"string"},yes:{default:!1,short:"y",type:"boolean"}},strict:!1});return t}function xa(t){let{snapshot:o,bump:s}=t;if(o&&s)throw new Error(`Cannot use both ${h.cyanBright("--snapshot")} and ${h.cyanBright("--bump")} options, pick one.`)}async function va(){let t=await G({active:"Yes, continue",inactive:"No, cancel",message:"Are you sure you want to create a new stone?"});if(!t||F(t))throw new Error("Operation cancelled by user")}async function Ea(t,o,s){await Bun.write(`.sisyphus/stones/${t}.md`,o.join(`
|
|
653
|
+
`)),await Bun.write(".sisyphus/config.json",`${JSON.stringify(s,null,2)}
|
|
654
|
+
`)}async function re(){try{let t=Sa();xa(t);let{dryRun:o}=Zn(t);if(t["from-commits"]){await ja(t);return}let{packages:s,packageNames:e,privatePackageCount:r}=await L({filter:t.filter});if(r>0)w.info(h.dim(`Note: ${r} private package${r>1?"s":""} excluded from versioning`));let{message:i,majorPackages:n,minorPackages:a,patchPackages:c}=await Is({bump:t.bump,packageNames:e,packages:s,tag:t.tag}),{packages:m,stoneContent:l,stoneName:p}=await rt({majorPackages:n,message:i,minorPackages:a,packages:s,patchPackages:c,tag:t.tag});if(w.step([`${t.dryRun?h.bold(h.yellow(`[dry-run]
|
|
655
|
+
`)):""}${h.italic("Changes preview:")}
|
|
656
|
+
`,`${h.italic("Stone: ")}${h.bold(i)}`,...m.map(Pt)].join(`
|
|
657
|
+
`)),o){w.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
460
658
|
Stone file preview:
|
|
461
659
|
${l.join(`
|
|
462
|
-
`)}`);return}if(!
|
|
463
|
-
or create another stone with ${
|
|
660
|
+
`)}`);return}if(!t.yes)await va();let g=await O();g.stones.push(p),await Ea(p,l,g),I(`Now you can run ${h.green("bunx @r5n/sisyphus roll")} to release packages
|
|
661
|
+
or create another stone with ${h.green("bunx @r5n/sisyphus version")}`,`${h.bold("Stone ")}${h.italic(`${p}.md`)} ${h.green("created!")}`)}catch(t){xt(t instanceof Error?t.message:String(t))}}async function ja(t){let o=await ee(t.filter);if(o.length===0)return;let{packages:s,privatePackageCount:e}=await L({filter:t.filter});if(e>0)w.info(h.dim(`Note: ${e} private package${e>1?"s":""} excluded from versioning`));let r=await O(),i=0;for(let n of o){let a=[],c=[],m=[];for(let g of n.packages)switch(n.bump){case"major":a.push(g);break;case"minor":c.push(g);break;case"patch":case"dependency":m.push(g);break}let{stoneContent:l,stoneName:p}=await rt({majorPackages:a,message:n.message,minorPackages:c,packages:s,patchPackages:m,tag:t.tag});if(t.dryRun)w.info(`${h.bold(h.yellow("[dry-run]"))}
|
|
464
662
|
Stone file preview:
|
|
465
663
|
${l.join(`
|
|
466
|
-
`)}`);else
|
|
467
|
-
`)),i++}if(!
|
|
468
|
-
`),
|
|
469
|
-
Run ${
|
|
664
|
+
`)}`);else r.stones.push(p),await Bun.write(`.sisyphus/stones/${p}.md`,l.join(`
|
|
665
|
+
`)),i++}if(!t.dryRun&&i>0)await Bun.write(".sisyphus/config.json",`${JSON.stringify(r,null,2)}
|
|
666
|
+
`),I(`Created ${h.bold(String(i))} stone${i>1?"s":""} from commits.
|
|
667
|
+
Run ${h.green("bunx @r5n/sisyphus preview")} to see what will be released`,h.green("Success!"))}var mn=["init","check","version","roll","solo","stone","preview","prerelease","graph","metrics","insights","migrate","pr","help"],Tt=x({prefix:"sisyphus"}),Ra={c:"check",cheack:"check",chekc:"check",g:"graph",graf:"graph",grah:"graph",h:"help",i:"init",initialise:"init",inti:"init",intialize:"init",m:"metrics",metric:"metrics",mig:"migrate",migration:"migrate",p:"preview",pr:"prerelease",pre:"preview",preivew:"preview",prerelease:"prerelease",publish:"roll",r:"roll",relase:"release",release:"roll",rool:"roll",s:"stone",single:"solo",solo:"solo",st:"stone",state:"check",stats:"metrics",status:"check",stones:"stone",v:"version",ver:"version",verison:"version"};async function Oa(){try{let[,,t,...o]=process.argv;if(!t||t==="--help"||t==="-h"){en();return}let s=t;if(!mn.includes(t)){let e=Qt(t,Ra);if(e&&mn.includes(e))s=e,Tt.warn(`Assuming you meant '${e}'`)}if(!mn.includes(s)){Tt.error(`Unknown command: ${t}`);let e=Zt(t,mn);if(e.length>0){Tt.error("Did you mean one of these?");for(let r of e)Tt.error(` ${r}`)}Tt.error("Run 'sisyphus --help' for usage information"),process.exit(1)}if(o.includes("--help")||o.includes("-h")){en(s);return}switch(s){case"init":await Ps();break;case"check":await Es();break;case"version":await re();break;case"roll":await xs();break;case"solo":await qs();break;case"stone":await ne();break;case"preview":await Hs();break;case"prerelease":await Ls();break;case"graph":await Rs();break;case"metrics":await Ns();break;case"insights":await Bs();break;case"migrate":await Us();break;case"pr":await Cs();break;case"help":{let e=o[0];en(e);break}default:throw new Error(`Unknown command: ${s}`)}}catch(t){Vo(t)}}await Oa();
|