@fastgpt-plugin/cli 0.1.0-alpha.3 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,45 @@
1
+ import e,{stdin as t,stdout as n}from"node:process";import{WriteStream as r}from"node:tty";import i from"node:readline";function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var o,s;function c(){if(s)return o;s=1;let e={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};return o={cursor:e,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(t){let n=``;for(let r=0;r<t;r++)n+=this.line+(r<t-1?e.up():``);return t&&(n+=e.left),n}},beep:`\x07`},o}var l=c(),u={exports:{}},d;function ee(){if(d)return u.exports;d=1;let e=process||{},t=e.argv||[],n=e.env||{},r=!(n.NO_COLOR||t.includes(`--no-color`))&&(!!n.FORCE_COLOR||t.includes(`--color`)||e.platform===`win32`||(e.stdout||{}).isTTY&&n.TERM!==`dumb`||!!n.CI),i=(e,t,n=e)=>r=>{let i=``+r,o=i.indexOf(t,e.length);return~o?e+a(i,t,n,o)+t:e+i+t},a=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},o=(e=r)=>{let t=e?i:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};return u.exports=o(),u.exports.createColors=o,u.exports}const f=a(ee());function te({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const p=te();function m(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(p,``)}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var g={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-(u==2?1:0))if(o+u<=i)a+=l;else break;o+=u}return a}})(g);var _=g.exports;const ne=h(_),re=h(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});function v(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=m(e),e.length===0))return 0;e=e.replace(re(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(ne.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const y=(e=0)=>t=>`\x1B[${t+e}m`,b=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,x=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,S={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(S.modifier);const ie=Object.keys(S.color),C=Object.keys(S.bgColor);[...ie,...C];function ae(){let e=new Map;for(let[t,n]of Object.entries(S)){for(let[t,r]of Object.entries(n))S[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=S[t],e.set(r[0],r[1]);Object.defineProperty(S,t,{value:n,enumerable:!1})}return Object.defineProperty(S,`codes`,{value:e,enumerable:!1}),S.color.close=`\x1B[39m`,S.bgColor.close=`\x1B[49m`,S.color.ansi=y(),S.color.ansi256=b(),S.color.ansi16m=x(),S.bgColor.ansi=y(10),S.bgColor.ansi256=b(10),S.bgColor.ansi16m=x(10),Object.defineProperties(S,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>S.rgbToAnsi256(...S.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>S.ansi256ToAnsi(S.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>S.ansi256ToAnsi(S.hexToAnsi256(e)),enumerable:!1}}),S}const oe=ae(),w=new Set([`\x1B`,`›`]),T=`]8;;`,E=e=>`${w.values().next().value}[${e}m`,D=e=>`${w.values().next().value}${T}${e}`,O=e=>e.split(` `).map(e=>v(e)),k=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=v(m(e[e.length-1]));for(let[t,s]of r.entries()){let c=v(s);if(o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),w.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(T)),i){a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1);continue}o+=c,o===n&&t<r.length-1&&(e.push(``),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},se=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(v(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},ce=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=O(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=v(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),k(s,i,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){k(s,i,t);continue}s.push(``)}if(e+o[r]>t&&n.wordWrap===!1){k(s,i,t);continue}s[s.length-1]+=i}n.trim!==!1&&(s=s.map(e=>se(e)));let c=[...s.join(`
2
+ `)];for(let[e,t]of c.entries()){if(r+=t,w.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${T}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=oe.codes.get(Number(i));c[e+1]===`
3
+ `?(a&&(r+=D(``)),i&&n&&(r+=E(n))):t===`
4
+ `&&(i&&n&&(r+=E(i)),a&&(r+=D(a)))}return r};function A(e,t,n){return String(e).normalize().replace(/\r\n/g,`
5
+ `).split(`
6
+ `).map(e=>ce(e,t,n)).join(`
7
+ `)}const j={actions:new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function M(e,t){if(typeof e==`string`)return j.aliases.get(e)===t;for(let n of e)if(n!==void 0&&M(n,t))return!0;return!1}function le(e,t){if(e===t)return;let n=e.split(`
8
+ `),r=t.split(`
9
+ `),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}globalThis.process.platform.startsWith(`win`);const N=Symbol(`clack:cancel`);function P(e,t){let n=e;n.isTTY&&n.setRawMode(t)}var ue=Object.defineProperty,F=(e,t,n)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t,n)=>(F(e,typeof t==`symbol`?t:t+``,n),n),L=class{constructor(e,r=!0){I(this,`input`),I(this,`output`),I(this,`_abortSignal`),I(this,`rl`),I(this,`opts`),I(this,`_render`),I(this,`_track`,!1),I(this,`_prevFrame`,``),I(this,`_subscribers`,new Map),I(this,`_cursor`,0),I(this,`state`,`initial`),I(this,`error`,``),I(this,`value`);let{input:i=t,output:a=n,render:o,signal:s,...c}=e;this.opts=c,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=r,this._abortSignal=s,this.input=i,this.output=a}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(N);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new r(0);n._write=(e,t,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,``),this._cursor=this.rl?.cursor??0,this.emit(`value`,this.value)),n()},this.input.pipe(n),this.rl=i.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50}),i.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),P(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(l.cursor.show),this.output.off(`resize`,this.render),P(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(l.cursor.show),this.output.off(`resize`,this.render),P(this.input,!1),e(N)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&j.aliases.has(t.name)&&this.emit(`cursor`,j.aliases.get(t.name)),j.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),e===` `&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit(`value`,this.opts.placeholder))),e&&this.emit(`key`,e.toLowerCase()),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.value))}this.state!==`error`&&(this.state=`submit`)}M([e,t?.name,t?.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(`
10
+ `),P(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=A(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
11
+ `).length-1;this.output.write(l.cursor.move(-999,e*-1))}render(){let e=A(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(l.cursor.hide);else{let t=le(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(l.cursor.move(0,n)),this.output.write(l.erase.lines(1));let r=e.split(`
12
+ `);this.output.write(r[n]),this._prevFrame=e,this.output.write(l.cursor.move(0,r.length-n-1));return}if(t&&t?.length>1){let n=t[0];this.output.write(l.cursor.move(0,n)),this.output.write(l.erase.down());let r=e.split(`
13
+ `).slice(n);this.output.write(r.join(`
14
+ `)),this._prevFrame=e;return}this.output.write(l.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},R=class extends L{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`value`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(l.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},z=Object.defineProperty,B=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t,n)=>(B(e,typeof t==`symbol`?t:t+``,n),n);let H=class extends L{constructor(e){super(e,!1),V(this,`options`),V(this,`cursor`,0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on(`key`,e=>{e===`a`&&this.toggleAll()}),this.on(`cursor`,e=>{switch(e){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(){this.value=this.value.length===this.options.length?[]:this.options.map(e=>e.value)}toggleValue(){this.value=this.value.includes(this._value)?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var U=Object.defineProperty,de=(e,t,n)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>(de(e,typeof t==`symbol`?t:t+``,n),n),fe=class extends L{constructor(e){super(e,!1),W(this,`options`),W(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`cursor`,e=>{switch(e){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}},pe=class extends L{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${f.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}};function me(){return e.platform===`win32`?!!e.env.CI||!!e.env.WT_SESSION||!!e.env.TERMINUS_SUBLIME||e.env.ConEmuTask===`{cmd::Cmder}`||e.env.TERM_PROGRAM===`Terminus-Sublime`||e.env.TERM_PROGRAM===`vscode`||e.env.TERM===`xterm-256color`||e.env.TERM===`alacritty`||e.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:e.env.TERM!==`linux`}const he=me(),G=(e,t)=>he?e:t,ge=G(`❯`,`>`),_e=G(`■`,`x`),ve=G(`▲`,`x`),ye=G(`✔`,`√`),K=G(``),q=G(``),J=G(`●`,`>`),Y=G(`○`,` `),be=G(`◻`,`[•]`),X=G(`◼`,`[+]`),xe=G(`◻`,`[ ]`),Z=e=>{switch(e){case`initial`:case`active`:return f.cyan(ge);case`cancel`:return f.red(_e);case`error`:return f.yellow(ve);case`submit`:return f.green(ye)}},Q=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?f.dim(`...`):r(e,n+s===t)})},Se=e=>new pe({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${f.gray(K)}
15
+ ${Z(this.state)} ${e.message}
16
+ `,n=e.placeholder?f.inverse(e.placeholder[0])+f.dim(e.placeholder.slice(1)):f.inverse(f.hidden(`_`)),r=this.value?this.valueWithCursor:n;switch(this.state){case`error`:return`${t.trim()}
17
+ ${f.yellow(K)} ${r}
18
+ ${f.yellow(q)} ${f.yellow(this.error)}
19
+ `;case`submit`:return`${t}${f.gray(K)} ${f.dim(this.value||e.placeholder)}`;case`cancel`:return`${t}${f.gray(K)} ${f.strikethrough(f.dim(this.value??``))}${this.value?.trim()?`
20
+ ${f.gray(K)}`:``}`;default:return`${t}${f.cyan(K)} ${r}
21
+ ${f.cyan(q)}
22
+ `}}}).prompt(),Ce=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new R({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${f.gray(K)}
23
+ ${Z(this.state)} ${e.message}
24
+ `,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${f.gray(K)} ${f.dim(i)}`;case`cancel`:return`${r}${f.gray(K)} ${f.strikethrough(f.dim(i))}
25
+ ${f.gray(K)}`;default:return`${r}${f.cyan(K)} ${this.value?`${f.green(J)} ${t}`:`${f.dim(Y)} ${f.dim(t)}`} ${f.dim(`/`)} ${this.value?`${f.dim(Y)} ${f.dim(n)}`:`${f.green(J)} ${n}`}
26
+ ${f.cyan(q)}
27
+ `}}}).prompt()},we=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${f.dim(n)}`;case`active`:return`${f.green(J)} ${n} ${e.hint?f.dim(`(${e.hint})`):``}`;case`cancelled`:return`${f.strikethrough(f.dim(n))}`;default:return`${f.dim(Y)} ${f.dim(n)}`}};return new fe({options:e.options,initialValue:e.initialValue,render(){let n=`${f.gray(K)}
28
+ ${Z(this.state)} ${e.message}
29
+ `;switch(this.state){case`submit`:return`${n}${f.gray(K)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${f.gray(K)} ${t(this.options[this.cursor],`cancelled`)}
30
+ ${f.gray(K)}`;default:return`${n}${f.cyan(K)} ${Q({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
31
+ ${f.cyan(K)} `)}
32
+ ${f.cyan(q)}
33
+ `}}}).prompt()},Te=e=>{let t=(e,t)=>{let n=e.label??String(e.value);return t===`active`?`${f.cyan(be)} ${n} ${e.hint?f.dim(`(${e.hint})`):``}`:t===`selected`?`${f.green(X)} ${f.dim(n)}`:t===`cancelled`?`${f.strikethrough(f.dim(n))}`:t===`active-selected`?`${f.green(X)} ${n} ${e.hint?f.dim(`(${e.hint})`):``}`:t===`submitted`?`${f.dim(n)}`:`${f.dim(xe)} ${f.dim(n)}`};return new H({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
34
+ ${f.reset(f.dim(`Press ${f.gray(f.bgWhite(f.inverse(` space `)))} to select, ${f.gray(f.bgWhite(f.inverse(` enter `)))} to submit`))}`},render(){let n=`${f.gray(K)}
35
+ ${Z(this.state)} ${e.message}
36
+ `,r=(e,n)=>{let r=this.value.includes(e.value);return n&&r?t(e,`active-selected`):r?t(e,`selected`):t(e,n?`active`:`inactive`)};switch(this.state){case`submit`:return`${n}${f.gray(K)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,`submitted`)).join(f.dim(`, `))||f.dim(`none`)}`;case`cancel`:{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,`cancelled`)).join(f.dim(`, `));return`${n}${f.gray(K)} ${e.trim()?`${e}
37
+ ${f.gray(K)}`:``}`}case`error`:{let t=this.error.split(`
38
+ `).map((e,t)=>t===0?`${f.yellow(q)} ${f.yellow(e)}`:` ${e}`).join(`
39
+ `);return`${n+f.yellow(K)} ${Q({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
40
+ ${f.yellow(K)} `)}
41
+ ${t}
42
+ `}default:return`${n}${f.cyan(K)} ${Q({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
43
+ ${f.cyan(K)} `)}
44
+ ${f.cyan(q)}
45
+ `}}}).prompt()};`${f.gray(K)}`;const Ee=Symbol.for(`cancel`);async function $(e,t={}){let n=e=>{if(typeof e!=`symbol`||e.toString()!==`Symbol(clack:cancel)`)return e;switch(t.cancel){case`reject`:{let e=Error(`Prompt cancelled.`);throw e.name=`ConsolaPromptCancelledError`,Error.captureStackTrace&&Error.captureStackTrace(e,$),e}case`undefined`:return;case`null`:return null;case`symbol`:return Ee;default:case`default`:return t.default??t.initial}};if(!t.type||t.type===`text`)return await Se({message:e,defaultValue:t.default,placeholder:t.placeholder,initialValue:t.initial}).then(n);if(t.type===`confirm`)return await Ce({message:e,initialValue:t.initial}).then(n);if(t.type===`select`)return await we({message:e,options:t.options.map(e=>typeof e==`string`?{value:e,label:e}:e),initialValue:t.initial}).then(n);if(t.type===`multiselect`)return await Te({message:e,options:t.options.map(e=>typeof e==`string`?{value:e,label:e}:e),required:t.required,initialValues:t.initial}).then(n);throw Error(`Unknown prompt type: ${t.type}`)}export{$ as prompt};
@@ -0,0 +1 @@
1
+ import{y as e}from"./index.js";const t=globalThis.process.getBuiltinModule(`module`).createRequire(import.meta.url),n=globalThis.process.getBuiltinModule(`node:path`),r=t(`typescript`),i=e(`rolldown-plugin-dts:tsc-resolver`);function a(e,t,a,o,s,c){let l=o?n.dirname(o):a,u=r.parseJsonConfigFileContent(s,r.sys,l),d=r.bundlerModuleNameResolver(e,t,{moduleResolution:r.ModuleResolutionKind.Bundler,...u.options},r.sys,void 0,c);return i(`tsc resolving id "%s" from "%s" -> %O`,e,t,d.resolvedModule),d.resolvedModule?.resolvedFileName}export{a as tscResolve};
@@ -0,0 +1 @@
1
+ import{c as e,s as t,y as n}from"./index.js";import{n as r}from"./context-DoVwxr5H-B6IEtQ3M.js";const i=globalThis.process.getBuiltinModule(`module`).createRequire(import.meta.url),{createRequire:a}=globalThis.process.getBuiltinModule(`node:module`),o=globalThis.process.getBuiltinModule(`node:path`),s=i(`typescript`),{pathToFileURL:c}=globalThis.process.getBuiltinModule(`node:url`);var l=a(import.meta.url);const u=n(`rolldown-plugin-dts:tsc-system`);function d(e){return{...s.sys,write(e){u(e)},resolvePath(t){return e.has(t)?t:s.sys.resolvePath(t)},directoryExists(t){return Array.from(e.keys()).some(e=>e.startsWith(t))?!0:s.sys.directoryExists(t)},fileExists(t){return e.has(t)?!0:s.sys.fileExists(t)},readFile(t,...n){return e.has(t)?e.get(t):s.sys.readFile(t,...n)},writeFile(t,n,...r){e.set(t,n),s.sys.writeFile(t,n,...r)},deleteFile(t,...n){e.delete(t),s.sys.deleteFile?.(t,...n)}}}function f(e){return{...d(e),writeFile(t,n){e.set(t,n)},deleteFile(t){e.delete(t)}}}const p={getCurrentDirectory:()=>s.sys.getCurrentDirectory(),getNewLine:()=>s.sys.newLine,getCanonicalFileName:s.sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase()},m={afterDeclarations:[e=>{let t=n=>s.isPropertySignature(n)&&s.isPrivateIdentifier(n.name)?e.factory.updatePropertySignature(n,n.modifiers,e.factory.createStringLiteral(n.name.text),n.questionToken,n.type):s.visitEachChild(n,t,e);return e=>s.visitNode(e,t,s.isSourceFile)??e}]};function h(e,t,n){if(!e||e.sourceRoot)return;let r=o.posix.dirname(c(t).pathname),i=o.posix.dirname(c(n).pathname);r!==i&&(e.sourceRoot=o.posix.relative(i,r))}const g=n(`rolldown-plugin-dts:tsc-build`);function _(n){let{id:i,tsconfig:a,incremental:o,context:c=r,sourcemap:l}=n;if(g(`running tscEmitBuild id: ${i}, tsconfig: ${a}, incremental: ${o}`),!a)return{error:`[rolldown-plugin-dts] build mode requires a tsconfig path`};let u=(o?d:f)(c.files),p=u.resolvePath(i);p!==i&&g(`resolved id from ${i} to ${p}`);let m=v(c,u,a,!o,l).get(p);if(!m)return g(`unable to locate a project containing ${p}`),{error:`Unable to locate ${i} from the given tsconfig file ${a}`};g(`loaded project ${m.tsconfigPath} for ${i}`);let y=!u.useCaseSensitiveFileNames,b=s.getOutputFileNames(m.parsedConfig,p,y),x,S;for(let n of b){if(t.test(n)){if(!u.fileExists(n)){console.warn(`[rolldown-plugin-dts] Unable to read file ${n}`);continue}x=u.readFile(n);continue}if(e.test(n)){if(!u.fileExists(n))continue;let e=u.readFile(n);if(!e){console.warn(`[rolldown-plugin-dts] Unexpected sourcemap ${n}`);continue}S=JSON.parse(e),h(S,n,p)}}return x?{code:x,map:S}:o?(g(`incremental build failed`),_({...n,incremental:!1})):(g(`unable to build .d.ts file for ${i}`),m.parsedConfig.options.declaration===!0?{error:`Unable to build .d.ts file for ${i}; This seems like a bug of rolldown-plugin-dts. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts/issues`}:{error:`Unable to build .d.ts file for ${i}; Make sure the "declaration" option is set to true in ${m.tsconfigPath}`})}function v(e,t,n,r,i){let a=e.projects.get(n);return a?(g(`skip building projects for ${n}`),a):(a=y(t,n,r,i),e.projects.set(n,a),a)}function y(e,t,n,r){g(`start building projects for ${t}`);let i=b(t,e,n,r);g(`collected %d projects: %j`,i.length,i.map(e=>e.tsconfigPath));let a=s.createSolutionBuilderHost(e,C);g(`built solution for ${t} with exit status ${s.createSolutionBuilder(a,[t],{force:n,verbose:!0}).build(void 0,void 0,void 0,e=>(g(`transforming project ${e}`),m))}`);let o=new Map;for(let t of i)for(let n of t.parsedConfig.fileNames)o.set(e.resolvePath(n),t);return o}function b(e,t,n,r){let i=new Set,a=[],o=[t.resolvePath(e)];for(;;){let e=o.pop();if(!e)break;if(i.has(e))continue;i.add(e);let c=x(e,t);if(c){c.options=S(c.options,{tsconfigPath:e,force:n,sourcemap:r}),a.push({tsconfigPath:e,parsedConfig:c});for(let e of c.projectReferences??[])o.push(s.resolveProjectReferencePath(e))}}return a}function x(e,t){let n=[],r=s.getParsedCommandLineOfConfigFile(e,void 0,{...t,onUnRecoverableConfigFileDiagnostic:e=>{n.push(e)}});if(n.length)throw Error(`[rolldown-plugin-dts] Unable to read ${e}: ${s.formatDiagnostics(n,p)}`);return r}function S(e,t){let n=e.noEmit??!1,r=e.declaration??!!e.composite,i=e.declarationMap??!1,a=t?.tsconfigPath&&!t.force;return n===!0&&(e={...e,noEmit:!1},a&&console.warn(`[rolldown-plugin-dts] ${t.tsconfigPath} has "noEmit" set to true. Please set it to false to generate declaration files.`)),r===!1&&(e={...e,declaration:!0},a&&console.warn(`[rolldown-plugin-dts] ${t.tsconfigPath} has "declaration" set to false. Please set it to true to generate declaration files.`)),i===!1&&t?.sourcemap&&(e={...e,declarationMap:!0},a&&console.warn(`[rolldown-plugin-dts] ${t.tsconfigPath} has "declarationMap" set to false. Please set it to true if you want to generate source maps for declaration files.`)),e}const C=(e,t,...n)=>s.createEmitAndSemanticDiagnosticsBuilderProgram(e,S(t??{},null),...n),w=n(`rolldown-plugin-dts:volar`);function T(){w(`loading vue language tools`);try{let e=l.resolve(`vue-tsc`);return{volarTs:l(l.resolve(`@volar/typescript`,{paths:[e]})),vue:l(l.resolve(`@vue/language-core`,{paths:[e]}))}}catch(e){throw w(`vue language tools not found`,e),Error(`Failed to load vue language tools. Please manually install vue-tsc.`)}}function E(){let{vue:e,volarTs:{proxyCreateProgram:t}}=T();return{proxyCreateProgram:t,getLanguagePlugin:(t,n)=>{let r=n.options.$rootDir,i=n.options.$configRaw,a=new e.CompilerOptionsResolver(t,t.sys.readFile);a.addConfig(i?.vueCompilerOptions??{},r);let o=a.build();return e.createVueLanguagePlugin(t,n.options,o,e=>e)}}}function D(){let e=n(`rolldown-plugin-dts:ts-macro`);e(`loading ts-macro language tools`);try{let e=l.resolve(`@ts-macro/tsc`),{proxyCreateProgram:t}=l(l.resolve(`@volar/typescript`,{paths:[e]})),n=l(l.resolve(`@ts-macro/language-plugin`,{paths:[e]})),{getOptions:r}=l(l.resolve(`@ts-macro/language-plugin/options`,{paths:[e]}));return{proxyCreateProgram:t,getLanguagePlugin:(e,t)=>{let i=t.options.$rootDir;return n.getLanguagePlugins(e,t.options,r(e,i))[0]}}}catch(t){throw e(`ts-macro language tools not found`,t),Error(`Failed to load ts-macro language tools. Please manually install @ts-macro/tsc.`)}}function O(e,t){let n=t.vue?E():void 0,r=t.tsMacro?D():void 0,i=n?.proxyCreateProgram||r?.proxyCreateProgram;return i?i(e,e.createProgram,(e,t)=>{let i=[];return n&&i.push(n.getLanguagePlugin(e,t)),r&&i.push(r.getLanguagePlugin(e,t)),{languagePlugins:i}}):e.createProgram}const k=n(`rolldown-plugin-dts:tsc-compiler`),A={declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,target:99,resolveJsonModule:!0,moduleResolution:s.ModuleResolutionKind.Bundler};function j(e){let{id:t,entries:n,context:i=r}=e,a=i.programs.find(e=>{let r=e.getRootFileNames();return n?n.every(e=>r.includes(e)):r.includes(t)});if(a){let e=a.getSourceFile(t);if(e)return{program:a,file:e}}k(`create program for module: ${t}`);let o=M(e);return k(`created program for module: ${t}`),i.programs.push(o.program),o}function M({entries:e,id:t,tsconfig:n,tsconfigRaw:i,vue:a,tsMacro:c,cwd:l,context:u=r}){let f=d(u.files),p=n?o.dirname(n):l,m=s.parseJsonConfigFileContent(i,f,p,void 0,void 0,void 0,a?[{extension:`vue`,isMixedContent:!0,scriptKind:s.ScriptKind.Deferred}]:void 0);return k(`creating program for root project: ${p}`),N({parsedConfig:m,fsSystem:f,baseDir:p,id:t,entries:e,vue:a,tsMacro:c})}function N({parsedConfig:e,fsSystem:t,baseDir:n,id:r,entries:i,vue:a,tsMacro:o}){let c={...A,...e.options,$configRaw:e.raw,$rootDir:n},l=[...new Set([r,...i||e.fileNames].map(e=>t.resolvePath(e)))],u=s.createCompilerHost(c,!0),d=O(s,{vue:a,tsMacro:o})({rootNames:l,options:c,host:u,projectReferences:e.projectReferences}),f=d.getSourceFile(r);if(!f)throw k(`source file not found in program: ${r}`),e.projectReferences?.length?Error(`[rolldown-plugin-dts] Unable to load ${r}; You have "references" in your tsconfig file. Perhaps you want to add \`dts: { build: true }\` in your config?`):t.fileExists(r)?(k(`File ${r} exists on disk.`),Error(`Unable to load file ${r} from the program. This seems like a bug of rolldown-plugin-dts. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts/issues`)):(k(`File ${r} does not exist on disk.`),Error(`Source file not found: ${r}`));return{program:d,file:f}}function P(e){k(`running tscEmitCompiler ${e.id}`);let{program:t,file:n}=j(e);k(`got source file: ${n.fileName}`);let r,i,{emitSkipped:a,diagnostics:o}=t.emit(n,(t,n)=>{t.endsWith(`.map`)?(k(`emit dts sourcemap: ${t}`),i=JSON.parse(n),h(i,t,e.id)):(k(`emit dts: ${t}`),r=n)},void 0,!0,m,!0);return a&&o.length?{error:s.formatDiagnostics(o,p)}:(r||(k(`nothing was emitted.`),n.isDeclarationFile?(k(`source file is a declaration file.`),r=n.getFullText()):console.warn("[rolldown-plugin-dts] Warning: Failed to emit declaration file. Please try to enable `eager` option (`dts.eager` for tsdown).")),{code:r,map:i})}const F=n(`rolldown-plugin-dts:tsc`);F(`loaded typescript: ${s.version}`);function I(e){return F(`running tscEmit ${e.id}`),e.build?_(e):P(e)}export{I as tscEmit};
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import './dist/index.js';
package/package.json CHANGED
@@ -1,44 +1,41 @@
1
1
  {
2
2
  "name": "@fastgpt-plugin/cli",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "bin": {
10
- "@fastgpt-plugin/cli": "dist/index.js"
10
+ "@fastgpt-plugin/cli": "index.js"
11
11
  },
12
12
  "files": [
13
13
  "dist",
14
- "templates",
15
- "README.md",
16
- "LICENSE",
17
- "package.json"
14
+ "index.js",
15
+ "templates"
18
16
  ],
19
17
  "scripts": {
20
18
  "build": "tsdown",
21
19
  "test": "vitest run",
22
- "start": "bun run src/index.ts",
23
- "dev": "bun run src/index.ts"
20
+ "dev": "bun run src/index.ts",
21
+ "prepublishOnly": "npm run build"
24
22
  },
25
- "dependencies": {
26
- "@babel/generator": "^7.26.5",
27
- "@babel/parser": "^7.26.5",
28
- "@babel/traverse": "^7.26.5",
29
- "@babel/types": "^7.26.5",
23
+ "devDependencies": {
30
24
  "@inquirer/prompts": "^8.2.0",
25
+ "@oxc-parser/binding-wasm32-wasi": "^0.112.0",
31
26
  "commander": "^14.0.3",
32
27
  "consola": "^3.4.2",
33
28
  "es-toolkit": "^1.44.0",
34
- "tsdown": "^0.20.1"
35
- },
36
- "devDependencies": {
29
+ "oxc-parser": "^0.112.0",
30
+ "tsdown": "^0.20.1",
37
31
  "typescript": "^5",
38
32
  "vite-tsconfig-paths": "^6.0.5",
39
33
  "vitest": "^4.0.18"
40
34
  },
41
35
  "engines": {
42
- "node": ">=22.0.0"
36
+ "node": "^20.19.0 || >=22.12.0"
37
+ },
38
+ "dependencies": {
39
+ "esrap": "^2.2.2"
43
40
  }
44
41
  }
@@ -1,6 +1,6 @@
1
1
  import type { RunToolSecondParamsType } from '@fastgpt-plugin/helpers/tools/schemas/req';
2
2
  import type { z } from 'zod';
3
- import { InputType, OutputType } from './schemas';
3
+ import type { InputType, OutputType } from './schemas';
4
4
 
5
5
  export async function tool(
6
6
  _input: z.infer<typeof InputType>,
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "target": "es2022",
5
+ "moduleResolution": "bundler",
6
+ "types": [],
7
+ "noUncheckedIndexedAccess": true,
8
+ "exactOptionalPropertyTypes": true,
9
+ "strict": true,
10
+ "jsx": "react-jsx",
11
+ "verbatimModuleSyntax": true,
12
+ "isolatedModules": true,
13
+ "noUncheckedSideEffectImports": true,
14
+ "moduleDetection": "force",
15
+ "skipLibCheck": true
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "target": "es2022",
5
+ "moduleResolution": "bundler",
6
+ "types": [],
7
+ "noUncheckedIndexedAccess": true,
8
+ "exactOptionalPropertyTypes": true,
9
+ "strict": true,
10
+ "jsx": "react-jsx",
11
+ "verbatimModuleSyntax": true,
12
+ "isolatedModules": true,
13
+ "noUncheckedSideEffectImports": true,
14
+ "moduleDetection": "force",
15
+ "skipLibCheck": true
16
+ }
17
+ }
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { };