@kubb/agent 4.31.6 → 4.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +174 -247
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/node_modules/@clack/core/dist/index.mjs +6 -6
- package/.output/server/node_modules/@clack/core/package.json +1 -2
- package/.output/server/node_modules/@clack/prompts/dist/index.mjs +106 -106
- package/.output/server/node_modules/@clack/prompts/package.json +2 -3
- package/.output/server/package.json +3 -3
- package/README.md +0 -2
- package/package.json +16 -16
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
import{getColumns as z,getRows as ee,AutocompletePrompt as Bt,settings as P,ConfirmPrompt as se,isCancel as re,GroupMultiSelectPrompt as ie,MultiSelectPrompt as ne,wrapTextWithPrefix as k,PasswordPrompt as ae,block as oe,SelectPrompt as le,SelectKeyPrompt as ue,TextPrompt as ce}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import e from"picocolors";import N from"node:process";import{readdirSync as de,existsSync as $e,lstatSync as xt}from"node:fs";import{dirname as _t,join as he}from"node:path";import{cursor as Dt,erase as Tt}from"sisteransi";import{stripVTControlCharacters as ut}from"node:util";function me(){return N.platform!=="win32"?N.env.TERM!=="linux":!!N.env.CI||!!N.env.WT_SESSION||!!N.env.TERMINUS_SUBLIME||N.env.ConEmuTask==="{cmd::Cmder}"||N.env.TERM_PROGRAM==="Terminus-Sublime"||N.env.TERM_PROGRAM==="vscode"||N.env.TERM==="xterm-256color"||N.env.TERM==="alacritty"||N.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const et=me(),ct=()=>process.env.CI==="true",Mt=t=>t.isTTY===!0,C=(t,r)=>et?t:r,Rt=C("\u25C6","*"),dt=C("\u25A0","x"),$t=C("\u25B2","x"),V=C("\u25C7","o"),ht=C("\u250C","T"),d=C("\u2502","|"),x=C("\u2514","\u2014"),Ot=C("\u2510","T"),Pt=C("\u2518","\u2014"),Q=C("\u25CF",">"),H=C("\u25CB"," "),st=C("\u25FB","[\u2022]"),U=C("\u25FC","[+]"),q=C("\u25FB","[ ]"),Nt=C("\u25AA","\u2022"),rt=C("\u2500","-"),mt=C("\u256E","+"),Wt=C("\u251C","+"),pt=C("\u256F","+"),gt=C("\u2570","+"),Lt=C("\u256D","+"),ft=C("\u25CF","\u2022"),Ft=C("\u25C6","*"),yt=C("\u25B2","!"),Et=C("\u25A0","x"),W=t=>{switch(t){case"initial":case"active":return e.cyan(Rt);case"cancel":return e.red(dt);case"error":return e.yellow($t);case"submit":return e.green(V)}},vt=t=>{switch(t){case"initial":case"active":return e.cyan(d);case"cancel":return e.red(d);case"error":return e.yellow(d);case"submit":return e.green(d)}},pe=t=>t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109,ge=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,fe=t=>t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141,At=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,it=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,nt=/\t{1,1000}/y,wt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,at=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Fe=/\p{M}+/gu,ye={limit:1/0,ellipsis:""},jt=(t,r={},s={})=>{const i=r.limit??1/0,a=r.ellipsis??"",o=r?.ellipsisWidth??(a?jt(a,ye,s).width:0),u=s.ansiWidth??0,l=s.controlWidth??0,n=s.tabWidth??8,c=s.ambiguousWidth??1,g=s.emojiWidth??2,F=s.fullWidthWidth??2,p=s.regularWidth??1,E=s.wideWidth??2;let $=0,m=0,h=t.length,y=0,f=!1,v=h,S=Math.max(0,i-o),I=0,B=0,A=0,w=0;t:for(;;){if(B>I||m>=h&&m>$){const _=t.slice(I,B)||t.slice($,m);y=0;for(const D of _.replaceAll(Fe,"")){const T=D.codePointAt(0)||0;if(ge(T)?w=F:fe(T)?w=E:c!==p&&pe(T)?w=c:w=p,A+w>S&&(v=Math.min(v,Math.max(I,$)+y)),A+w>i){f=!0;break t}y+=D.length,A+=w}I=B=0}if(m>=h)break;if(at.lastIndex=m,at.test(t)){if(y=at.lastIndex-m,w=y*p,A+w>S&&(v=Math.min(v,m+Math.floor((S-A)/p))),A+w>i){f=!0;break}A+=w,I=$,B=m,m=$=at.lastIndex;continue}if(At.lastIndex=m,At.test(t)){if(A+u>S&&(v=Math.min(v,m)),A+u>i){f=!0;break}A+=u,I=$,B=m,m=$=At.lastIndex;continue}if(it.lastIndex=m,it.test(t)){if(y=it.lastIndex-m,w=y*l,A+w>S&&(v=Math.min(v,m+Math.floor((S-A)/l))),A+w>i){f=!0;break}A+=w,I=$,B=m,m=$=it.lastIndex;continue}if(nt.lastIndex=m,nt.test(t)){if(y=nt.lastIndex-m,w=y*n,A+w>S&&(v=Math.min(v,m+Math.floor((S-A)/n))),A+w>i){f=!0;break}A+=w,I=$,B=m,m=$=nt.lastIndex;continue}if(wt.lastIndex=m,wt.test(t)){if(A+g>S&&(v=Math.min(v,m)),A+g>i){f=!0;break}A+=g,I=$,B=m,m=$=wt.lastIndex;continue}m+=1}return{width:f?S:A,index:f?v:h,truncated:f,ellipsed:f&&i>=o}},Ee={limit:1/0,ellipsis:"",ellipsisWidth:0},M=(t,r={})=>jt(t,Ee,r).width,ot="\x1B",Gt="\x9B",ve=39,Ct="\x07",kt="[",Ae="]",Vt="m",St=`${Ae}8;;`,Ht=new RegExp(`(?:\\${kt}(?<code>\\d+)m|\\${St}(?<uri>.*)${Ct})`,"y"),we=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},Ut=t=>`${ot}${kt}${t}${Vt}`,Kt=t=>`${ot}${St}${t}${Ct}`,Ce=t=>t.map(r=>M(r)),It=(t,r,s)=>{const i=r[Symbol.iterator]();let a=!1,o=!1,u=t.at(-1),l=u===void 0?0:M(u),n=i.next(),c=i.next(),g=0;for(;!n.done;){const F=n.value,p=M(F);l+p<=s?t[t.length-1]+=F:(t.push(F),l=0),(F===ot||F===Gt)&&(a=!0,o=r.startsWith(St,g+1)),a?o?F===Ct&&(a=!1,o=!1):F===Vt&&(a=!1):(l+=p,l===s&&!c.done&&(t.push(""),l=0)),n=c,c=i.next(),g+=F.length}u=t.at(-1),!l&&u!==void 0&&u.length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Se=t=>{const r=t.split(" ");let s=r.length;for(;s>0&&!(M(r[s-1])>0);)s--;return s===r.length?t:r.slice(0,s).join(" ")+r.slice(s).join("")},Ie=(t,r,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let i="",a,o;const u=t.split(" "),l=Ce(u);let n=[""];for(const[$,m]of u.entries()){s.trim!==!1&&(n[n.length-1]=(n.at(-1)??"").trimStart());let h=M(n.at(-1)??"");if($!==0&&(h>=r&&(s.wordWrap===!1||s.trim===!1)&&(n.push(""),h=0),(h>0||s.trim===!1)&&(n[n.length-1]+=" ",h++)),s.hard&&l[$]>r){const y=r-h,f=1+Math.floor((l[$]-y-1)/r);Math.floor((l[$]-1)/r)<f&&n.push(""),It(n,m,r);continue}if(h+l[$]>r&&h>0&&l[$]>0){if(s.wordWrap===!1&&h<r){It(n,m,r);continue}n.push("")}if(h+l[$]>r&&s.wordWrap===!1){It(n,m,r);continue}n[n.length-1]+=m}s.trim!==!1&&(n=n.map($=>Se($)));const c=n.join(`
|
|
2
|
-
`),
|
|
3
|
-
`?(o&&(i+=
|
|
4
|
-
`&&(a&&
|
|
1
|
+
import{getColumns as Y,getRows as tt,AutocompletePrompt as Be,settings as _,ConfirmPrompt as st,isCancel as rt,GroupMultiSelectPrompt as it,MultiSelectPrompt as nt,wrapTextWithPrefix as j,PasswordPrompt as at,block as ot,SelectPrompt as lt,SelectKeyPrompt as ut,TextPrompt as ct}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import{styleText as t,stripVTControlCharacters as ue}from"node:util";import N from"node:process";import{readdirSync as $t,existsSync as dt,lstatSync as xe}from"node:fs";import{dirname as _e,join as ht}from"node:path";import{cursor as De,erase as Te}from"sisteransi";function pt(){return N.platform!=="win32"?N.env.TERM!=="linux":!!N.env.CI||!!N.env.WT_SESSION||!!N.env.TERMINUS_SUBLIME||N.env.ConEmuTask==="{cmd::Cmder}"||N.env.TERM_PROGRAM==="Terminus-Sublime"||N.env.TERM_PROGRAM==="vscode"||N.env.TERM==="xterm-256color"||N.env.TERM==="alacritty"||N.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ee=pt(),ce=()=>process.env.CI==="true",Me=e=>e.isTTY===!0,I=(e,r)=>ee?e:r,Re=I("\u25C6","*"),$e=I("\u25A0","x"),de=I("\u25B2","x"),V=I("\u25C7","o"),he=I("\u250C","T"),h=I("\u2502","|"),x=I("\u2514","\u2014"),Oe=I("\u2510","T"),Pe=I("\u2518","\u2014"),z=I("\u25CF",">"),H=I("\u25CB"," "),te=I("\u25FB","[\u2022]"),U=I("\u25FC","[+]"),q=I("\u25FB","[ ]"),Ne=I("\u25AA","\u2022"),se=I("\u2500","-"),pe=I("\u256E","+"),We=I("\u251C","+"),me=I("\u256F","+"),ge=I("\u2570","+"),Ge=I("\u256D","+"),fe=I("\u25CF","\u2022"),Fe=I("\u25C6","*"),ye=I("\u25B2","!"),Ee=I("\u25A0","x"),W=e=>{switch(e){case"initial":case"active":return t("cyan",Re);case"cancel":return t("red",$e);case"error":return t("yellow",de);case"submit":return t("green",V)}},ve=e=>{switch(e){case"initial":case"active":return t("cyan",h);case"cancel":return t("red",h);case"error":return t("yellow",h);case"submit":return t("green",h)}},mt=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,gt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ft=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,we=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,re=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ie=/\t{1,1000}/y,Ae=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,ne=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ft=/\p{M}+/gu,yt={limit:1/0,ellipsis:""},Le=(e,r={},s={})=>{const i=r.limit??1/0,a=r.ellipsis??"",o=r?.ellipsisWidth??(a?Le(a,yt,s).width:0),u=s.ansiWidth??0,l=s.controlWidth??0,n=s.tabWidth??8,c=s.ambiguousWidth??1,p=s.emojiWidth??2,f=s.fullWidthWidth??2,g=s.regularWidth??1,E=s.wideWidth??2;let $=0,m=0,d=e.length,F=0,y=!1,v=d,C=Math.max(0,i-o),A=0,b=0,w=0,S=0;e:for(;;){if(b>A||m>=d&&m>$){const T=e.slice(A,b)||e.slice($,m);F=0;for(const M of T.replaceAll(Ft,"")){const O=M.codePointAt(0)||0;if(gt(O)?S=f:ft(O)?S=E:c!==g&&mt(O)?S=c:S=g,w+S>C&&(v=Math.min(v,Math.max(A,$)+F)),w+S>i){y=!0;break e}F+=M.length,w+=S}A=b=0}if(m>=d)break;if(ne.lastIndex=m,ne.test(e)){if(F=ne.lastIndex-m,S=F*g,w+S>C&&(v=Math.min(v,m+Math.floor((C-w)/g))),w+S>i){y=!0;break}w+=S,A=$,b=m,m=$=ne.lastIndex;continue}if(we.lastIndex=m,we.test(e)){if(w+u>C&&(v=Math.min(v,m)),w+u>i){y=!0;break}w+=u,A=$,b=m,m=$=we.lastIndex;continue}if(re.lastIndex=m,re.test(e)){if(F=re.lastIndex-m,S=F*l,w+S>C&&(v=Math.min(v,m+Math.floor((C-w)/l))),w+S>i){y=!0;break}w+=S,A=$,b=m,m=$=re.lastIndex;continue}if(ie.lastIndex=m,ie.test(e)){if(F=ie.lastIndex-m,S=F*n,w+S>C&&(v=Math.min(v,m+Math.floor((C-w)/n))),w+S>i){y=!0;break}w+=S,A=$,b=m,m=$=ie.lastIndex;continue}if(Ae.lastIndex=m,Ae.test(e)){if(w+p>C&&(v=Math.min(v,m)),w+p>i){y=!0;break}w+=p,A=$,b=m,m=$=Ae.lastIndex;continue}m+=1}return{width:y?C:w,index:y?v:d,truncated:y,ellipsed:y&&i>=o}},Et={limit:1/0,ellipsis:"",ellipsisWidth:0},D=(e,r={})=>Le(e,Et,r).width,ae="\x1B",je="\x9B",vt=39,Ce="\x07",ke="[",wt="]",Ve="m",Se=`${wt}8;;`,He=new RegExp(`(?:\\${ke}(?<code>\\d+)m|\\${Se}(?<uri>.*)${Ce})`,"y"),At=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ue=e=>`${ae}${ke}${e}${Ve}`,Ke=e=>`${ae}${Se}${e}${Ce}`,Ct=e=>e.map(r=>D(r)),Ie=(e,r,s)=>{const i=r[Symbol.iterator]();let a=!1,o=!1,u=e.at(-1),l=u===void 0?0:D(u),n=i.next(),c=i.next(),p=0;for(;!n.done;){const f=n.value,g=D(f);l+g<=s?e[e.length-1]+=f:(e.push(f),l=0),(f===ae||f===je)&&(a=!0,o=r.startsWith(Se,p+1)),a?o?f===Ce&&(a=!1,o=!1):f===Ve&&(a=!1):(l+=g,l===s&&!c.done&&(e.push(""),l=0)),n=c,c=i.next(),p+=f.length}u=e.at(-1),!l&&u!==void 0&&u.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},St=e=>{const r=e.split(" ");let s=r.length;for(;s>0&&!(D(r[s-1])>0);)s--;return s===r.length?e:r.slice(0,s).join(" ")+r.slice(s).join("")},It=(e,r,s={})=>{if(s.trim!==!1&&e.trim()==="")return"";let i="",a,o;const u=e.split(" "),l=Ct(u);let n=[""];for(const[$,m]of u.entries()){s.trim!==!1&&(n[n.length-1]=(n.at(-1)??"").trimStart());let d=D(n.at(-1)??"");if($!==0&&(d>=r&&(s.wordWrap===!1||s.trim===!1)&&(n.push(""),d=0),(d>0||s.trim===!1)&&(n[n.length-1]+=" ",d++)),s.hard&&l[$]>r){const F=r-d,y=1+Math.floor((l[$]-F-1)/r);Math.floor((l[$]-1)/r)<y&&n.push(""),Ie(n,m,r);continue}if(d+l[$]>r&&d>0&&l[$]>0){if(s.wordWrap===!1&&d<r){Ie(n,m,r);continue}n.push("")}if(d+l[$]>r&&s.wordWrap===!1){Ie(n,m,r);continue}n[n.length-1]+=m}s.trim!==!1&&(n=n.map($=>St($)));const c=n.join(`
|
|
2
|
+
`),p=c[Symbol.iterator]();let f=p.next(),g=p.next(),E=0;for(;!f.done;){const $=f.value,m=g.value;if(i+=$,$===ae||$===je){He.lastIndex=E+1;const y=He.exec(c)?.groups;if(y?.code!==void 0){const v=Number.parseFloat(y.code);a=v===vt?void 0:v}else y?.uri!==void 0&&(o=y.uri.length===0?void 0:y.uri)}const d=a?At(a):void 0;m===`
|
|
3
|
+
`?(o&&(i+=Ke("")),a&&d&&(i+=Ue(d))):$===`
|
|
4
|
+
`&&(a&&d&&(i+=Ue(a)),o&&(i+=Ke(o))),E+=$.length,f=g,g=p.next()}return i};function J(e,r,s){return String(e).normalize().replaceAll(`\r
|
|
5
5
|
`,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`).map(i=>
|
|
8
|
-
`)}const
|
|
9
|
-
`);
|
|
7
|
+
`).map(i=>It(i,r,s)).join(`
|
|
8
|
+
`)}const bt=(e,r,s,i,a)=>{let o=r,u=0;for(let l=s;l<i;l++){const n=e[l];if(o=o-n.length,u++,o<=a)break}return{lineCount:o,removals:u}},X=({cursor:e,options:r,style:s,output:i=process.stdout,maxItems:a=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:u=4})=>{const l=Y(i)-o,n=tt(i),c=t("dim","..."),p=Math.max(n-u,0),f=Math.max(Math.min(a,p),5);let g=0;e>=f-3&&(g=Math.max(Math.min(e-f+3,r.length-f),0));let E=f<r.length&&g>0,$=f<r.length&&g+f<r.length;const m=Math.min(g+f,r.length),d=[];let F=0;E&&F++,$&&F++;const y=g+(E?1:0),v=m-($?1:0);for(let A=y;A<v;A++){const b=J(s(r[A],A===e),l,{hard:!0,trim:!1}).split(`
|
|
9
|
+
`);d.push(b),F+=b.length}if(F>p){let A=0,b=0,w=F;const S=e-y,T=(M,O)=>bt(d,w,M,O,p);E?({lineCount:w,removals:A}=T(0,S),w>p&&({lineCount:w,removals:b}=T(S+1,d.length))):({lineCount:w,removals:b}=T(S+1,d.length),w>p&&({lineCount:w,removals:A}=T(0,S))),A>0&&(E=!0,d.splice(0,A)),b>0&&($=!0,d.splice(d.length-b,b))}const C=[];E&&C.push(c);for(const A of d)for(const b of A)C.push(b);return $&&C.push(c),C};function qe(e){return e.label??String(e.value??"")}function Je(e,r){if(!e)return!0;const s=(r.label??String(r.value??"")).toLowerCase(),i=(r.hint??"").toLowerCase(),a=String(r.value).toLowerCase(),o=e.toLowerCase();return s.includes(o)||i.includes(o)||a.includes(o)}function Bt(e,r){const s=[];for(const i of r)e.includes(i.value)&&s.push(i);return s}const Xe=e=>new Be({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,filter:e.filter??((r,s)=>Je(r,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){const r=e.withGuide??_.withGuide,s=r?[`${t("gray",h)}`,`${W(this.state)} ${e.message}`]:[`${W(this.state)} ${e.message}`],i=this.userInput,a=this.options,o=e.placeholder,u=i===""&&o!==void 0,l=(n,c)=>{const p=qe(n),f=n.hint&&n.value===this.focusedValue?t("dim",` (${n.hint})`):"";switch(c){case"active":return`${t("green",z)} ${p}${f}`;case"inactive":return`${t("dim",H)} ${t("dim",p)}`;case"disabled":return`${t("gray",H)} ${t(["strikethrough","gray"],p)}`}};switch(this.state){case"submit":{const n=Bt(this.selectedValues,a),c=n.length>0?` ${t("dim",n.map(qe).join(", "))}`:"",p=r?t("gray",h):"";return`${s.join(`
|
|
10
10
|
`)}
|
|
11
|
-
${
|
|
11
|
+
${p}${c}`}case"cancel":{const n=i?` ${t(["strikethrough","dim"],i)}`:"",c=r?t("gray",h):"";return`${s.join(`
|
|
12
12
|
`)}
|
|
13
|
-
${c}${n}`}default:{const n=this.state==="error"?
|
|
14
|
-
`)}}}}).prompt(),
|
|
15
|
-
${W(this.state)} ${
|
|
16
|
-
`,a=this.userInput,o=
|
|
17
|
-
`),`${
|
|
18
|
-
`)}}}});return s.prompt()},
|
|
19
|
-
`);let
|
|
20
|
-
`);const w
|
|
21
|
-
`);for(const
|
|
22
|
-
`)}i.write(`${c}${
|
|
23
|
-
`)},
|
|
24
|
-
`:""}${W(this.state)} ${
|
|
25
|
-
`,o=this.value?r:s;switch(this.state){case"submit":{const u=i?`${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
`:` ${
|
|
13
|
+
${c}${n}`}default:{const n=this.state==="error"?"yellow":"cyan",c=r?`${t(n,h)} `:"",p=r?t(n,x):"";let f="";if(this.isNavigating||u){const y=u?o:i;f=y!==""?` ${t("dim",y)}`:""}else f=` ${this.userInputWithCursor}`;const g=this.filteredOptions.length!==a.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",E=this.filteredOptions.length===0&&i?[`${c}${t("yellow","No matches found")}`]:[],$=this.state==="error"?[`${c}${t("yellow",this.error)}`]:[];r&&s.push(`${c.trimEnd()}`),s.push(`${c}${t("dim","Search:")}${f}${g}`,...E,...$);const m=[`${t("dim","\u2191/\u2193")} to select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],d=[`${c}${m.join(" \u2022 ")}`,p],F=this.filteredOptions.length===0?[]:X({cursor:this.cursor,options:this.filteredOptions,columnPadding:r?3:0,rowPadding:s.length+d.length,style:(y,v)=>l(y,y.disabled?"disabled":v?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...F.map(y=>`${c}${y}`),...d].join(`
|
|
14
|
+
`)}}}}).prompt(),xt=e=>{const r=(i,a,o,u)=>{const l=o.includes(i.value),n=i.label??String(i.value??""),c=i.hint&&u!==void 0&&i.value===u?t("dim",` (${i.hint})`):"",p=l?t("green",U):t("dim",q);return i.disabled?`${t("gray",q)} ${t(["strikethrough","gray"],n)}`:a?`${p} ${n}${c}`:`${p} ${t("dim",n)}`},s=new Be({options:e.options,multiple:!0,filter:e.filter??((i,a)=>Je(i,a)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){const i=`${t("gray",h)}
|
|
15
|
+
${W(this.state)} ${e.message}
|
|
16
|
+
`,a=this.userInput,o=e.placeholder,u=a===""&&o!==void 0,l=this.isNavigating||u?t("dim",u?o:a):this.userInputWithCursor,n=this.options,c=this.filteredOptions.length!==n.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${i}${t("gray",h)} ${t("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${i}${t("gray",h)} ${t(["strikethrough","dim"],a)}`;default:{const p=this.state==="error"?"yellow":"cyan",f=[`${t("dim","\u2191/\u2193")} to navigate`,`${t("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],g=this.filteredOptions.length===0&&a?[`${t(p,h)} ${t("yellow","No matches found")}`]:[],E=this.state==="error"?[`${t(p,h)} ${t("yellow",this.error)}`]:[],$=[...`${i}${t(p,h)}`.split(`
|
|
17
|
+
`),`${t(p,h)} ${t("dim","Search:")} ${l}${c}`,...g,...E],m=[`${t(p,h)} ${f.join(" \u2022 ")}`,t(p,x)],d=X({cursor:this.cursor,options:this.filteredOptions,style:(F,y)=>r(F,y,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:$.length+m.length});return[...$,...d.map(F=>`${t(p,h)} ${F}`),...m].join(`
|
|
18
|
+
`)}}}});return s.prompt()},_t=[Ge,pe,ge,me],Dt=[he,Oe,x,Pe];function Ye(e,r,s,i){let a=s,o=s;return i==="center"?a=Math.floor((r-e)/2):i==="right"&&(a=r-e-s),o=r-a-e,[a,o]}const Tt=e=>e,Mt=(e="",r="",s)=>{const i=s?.output??process.stdout,a=Y(i),o=2,u=s?.titlePadding??1,l=s?.contentPadding??2,n=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),c=s?.withGuide??_.withGuide?`${h} `:"",p=s?.formatBorder??Tt,f=(s?.rounded?_t:Dt).map(p),g=p(se),E=p(h),$=D(c),m=D(r),d=a-$;let F=Math.floor(a*n)-$;if(s?.width==="auto"){const T=e.split(`
|
|
19
|
+
`);let M=m+u*2;for(const le of T){const k=D(le)+l*2;k>M&&(M=k)}const O=M+o;O<F&&(F=O)}F%2!==0&&(F<d?F++:F--);const y=F-o,v=y-u*2,C=m>v?`${r.slice(0,v-3)}...`:r,[A,b]=Ye(D(C),y,u,s?.titleAlign),w=J(e,y-l*2,{hard:!0,trim:!1});i.write(`${c}${f[0]}${g.repeat(A)}${C}${g.repeat(b)}${f[1]}
|
|
20
|
+
`);const S=w.split(`
|
|
21
|
+
`);for(const T of S){const[M,O]=Ye(D(T),y,l,s?.contentAlign);i.write(`${c}${E}${" ".repeat(M)}${T}${" ".repeat(O)}${E}
|
|
22
|
+
`)}i.write(`${c}${f[2]}${g.repeat(y)}${f[3]}
|
|
23
|
+
`)},Rt=e=>{const r=e.active??"Yes",s=e.inactive??"No";return new st({active:r,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){const i=e.withGuide??_.withGuide,a=`${i?`${t("gray",h)}
|
|
24
|
+
`:""}${W(this.state)} ${e.message}
|
|
25
|
+
`,o=this.value?r:s;switch(this.state){case"submit":{const u=i?`${t("gray",h)} `:"";return`${a}${u}${t("dim",o)}`}case"cancel":{const u=i?`${t("gray",h)} `:"";return`${a}${u}${t(["strikethrough","dim"],o)}${i?`
|
|
26
|
+
${t("gray",h)}`:""}`}default:{const u=i?`${t("cyan",h)} `:"",l=i?t("cyan",x):"";return`${a}${u}${this.value?`${t("green",z)} ${r}`:`${t("dim",H)} ${t("dim",r)}`}${e.vertical?i?`
|
|
27
|
+
${t("cyan",h)} `:`
|
|
28
|
+
`:` ${t("dim","/")} `}${this.value?`${t("dim",H)} ${t("dim",s)}`:`${t("green",z)} ${s}`}
|
|
29
29
|
${l}
|
|
30
|
-
`}}}}).prompt()},
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
${W(this.state)} ${
|
|
34
|
-
`,u=this.value??[];switch(this.state){case"submit":{const l=this.options.filter(({value:c})=>u.includes(c)).map(c=>i(c,"submitted")),n=l.length===0?"":` ${l.join(
|
|
35
|
-
${
|
|
36
|
-
`).map((n,c)=>c===0?`${
|
|
37
|
-
`);return`${o}${
|
|
38
|
-
${
|
|
30
|
+
`}}}}).prompt()},Ot=async(e,r)=>{const s={},i=Object.keys(e);for(const a of i){const o=e[a],u=await o({results:s})?.catch(l=>{throw l});if(typeof r?.onCancel=="function"&&rt(u)){s[a]="canceled",r.onCancel({results:s});continue}s[a]=u}return s},Pt=e=>{const{selectableGroups:r=!0,groupSpacing:s=0}=e,i=(o,u,l=[])=>{const n=o.label??String(o.value),c=typeof o.group=="string",p=c&&(l[l.indexOf(o)+1]??{group:!0}),f=c&&p&&p.group===!0,g=c?r?`${f?x:h} `:" ":"";let E="";if(s>0&&!c){const m=`
|
|
31
|
+
${t("cyan",h)}`;E=`${m.repeat(s-1)}${m} `}if(u==="active")return`${E}${t("dim",g)}${t("cyan",te)} ${n}${o.hint?` ${t("dim",`(${o.hint})`)}`:""}`;if(u==="group-active")return`${E}${g}${t("cyan",te)} ${t("dim",n)}`;if(u==="group-active-selected")return`${E}${g}${t("green",U)} ${t("dim",n)}`;if(u==="selected"){const m=c||r?t("green",U):"";return`${E}${t("dim",g)}${m} ${t("dim",n)}${o.hint?` ${t("dim",`(${o.hint})`)}`:""}`}if(u==="cancelled")return`${t(["strikethrough","dim"],n)}`;if(u==="active-selected")return`${E}${t("dim",g)}${t("green",U)} ${n}${o.hint?` ${t("dim",`(${o.hint})`)}`:""}`;if(u==="submitted")return`${t("dim",n)}`;const $=c||r?t("dim",q):"";return`${E}${t("dim",g)}${$} ${t("dim",n)}`},a=e.required??!0;return new it({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:a,cursorAt:e.cursorAt,selectableGroups:r,validate(o){if(a&&(o===void 0||o.length===0))return`Please select at least one option.
|
|
32
|
+
${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const o=`${t("gray",h)}
|
|
33
|
+
${W(this.state)} ${e.message}
|
|
34
|
+
`,u=this.value??[];switch(this.state){case"submit":{const l=this.options.filter(({value:c})=>u.includes(c)).map(c=>i(c,"submitted")),n=l.length===0?"":` ${l.join(t("dim",", "))}`;return`${o}${t("gray",h)}${n}`}case"cancel":{const l=this.options.filter(({value:n})=>u.includes(n)).map(n=>i(n,"cancelled")).join(t("dim",", "));return`${o}${t("gray",h)} ${l.trim()?`${l}
|
|
35
|
+
${t("gray",h)}`:""}`}case"error":{const l=this.error.split(`
|
|
36
|
+
`).map((n,c)=>c===0?`${t("yellow",x)} ${t("yellow",n)}`:` ${n}`).join(`
|
|
37
|
+
`);return`${o}${t("yellow",h)} ${this.options.map((n,c,p)=>{const f=u.includes(n.value)||n.group===!0&&this.isGroupSelected(`${n.value}`),g=c===this.cursor;return!g&&typeof n.group=="string"&&this.options[this.cursor].value===n.group?i(n,f?"group-active-selected":"group-active",p):g&&f?i(n,"active-selected",p):f?i(n,"selected",p):i(n,g?"active":"inactive",p)}).join(`
|
|
38
|
+
${t("yellow",h)} `)}
|
|
39
39
|
${l}
|
|
40
|
-
`}default:{const l=this.options.map((c,
|
|
40
|
+
`}default:{const l=this.options.map((c,p,f)=>{const g=u.includes(c.value)||c.group===!0&&this.isGroupSelected(`${c.value}`),E=p===this.cursor,$=!E&&typeof c.group=="string"&&this.options[this.cursor].value===c.group;let m="";return $?m=i(c,g?"group-active-selected":"group-active",f):E&&g?m=i(c,"active-selected",f):g?m=i(c,"selected",f):m=i(c,E?"active":"inactive",f),`${p!==0&&!m.startsWith(`
|
|
41
41
|
`)?" ":""}${m}`}).join(`
|
|
42
|
-
${
|
|
43
|
-
`)?"":" ";return`${o}${
|
|
44
|
-
${
|
|
45
|
-
`}}}}).prompt()},R={message:(
|
|
46
|
-
`);if(
|
|
42
|
+
${t("cyan",h)}`),n=l.startsWith(`
|
|
43
|
+
`)?"":" ";return`${o}${t("cyan",h)}${n}${l}
|
|
44
|
+
${t("cyan",x)}
|
|
45
|
+
`}}}}).prompt()},R={message:(e=[],{symbol:r=t("gray",h),secondarySymbol:s=t("gray",h),output:i=process.stdout,spacing:a=1,withGuide:o}={})=>{const u=[],l=o??_.withGuide,n=l?s:"",c=l?`${r} `:"",p=l?`${s} `:"";for(let g=0;g<a;g++)u.push(n);const f=Array.isArray(e)?e:e.split(`
|
|
46
|
+
`);if(f.length>0){const[g,...E]=f;g.length>0?u.push(`${c}${g}`):u.push(l?r:"");for(const $ of E)$.length>0?u.push(`${p}${$}`):u.push(l?s:"")}i.write(`${u.join(`
|
|
47
47
|
`)}
|
|
48
|
-
`)},info:(
|
|
48
|
+
`)},info:(e,r)=>{R.message(e,{...r,symbol:t("blue",fe)})},success:(e,r)=>{R.message(e,{...r,symbol:t("green",Fe)})},step:(e,r)=>{R.message(e,{...r,symbol:t("green",V)})},warn:(e,r)=>{R.message(e,{...r,symbol:t("yellow",ye)})},warning:(e,r)=>{R.warn(e,r)},error:(e,r)=>{R.message(e,{...r,symbol:t("red",Ee)})}},Nt=(e="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${t("gray",x)} `:"";s.write(`${i}${t("red",e)}
|
|
49
49
|
|
|
50
|
-
`)},
|
|
51
|
-
`)},
|
|
52
|
-
${
|
|
50
|
+
`)},Wt=(e="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${t("gray",he)} `:"";s.write(`${i}${e}
|
|
51
|
+
`)},Gt=(e="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${t("gray",h)}
|
|
52
|
+
${t("gray",x)} `:"";s.write(`${i}${e}
|
|
53
53
|
|
|
54
|
-
`)},
|
|
54
|
+
`)},Q=(e,r)=>e.split(`
|
|
55
55
|
`).map(s=>r(s)).join(`
|
|
56
|
-
`),
|
|
57
|
-
${
|
|
56
|
+
`),Lt=e=>{const r=(i,a)=>{const o=i.label??String(i.value);return a==="disabled"?`${t("gray",q)} ${Q(o,u=>t(["strikethrough","gray"],u))}${i.hint?` ${t("dim",`(${i.hint??"disabled"})`)}`:""}`:a==="active"?`${t("cyan",te)} ${o}${i.hint?` ${t("dim",`(${i.hint})`)}`:""}`:a==="selected"?`${t("green",U)} ${Q(o,u=>t("dim",u))}${i.hint?` ${t("dim",`(${i.hint})`)}`:""}`:a==="cancelled"?`${Q(o,u=>t(["strikethrough","dim"],u))}`:a==="active-selected"?`${t("green",U)} ${o}${i.hint?` ${t("dim",`(${i.hint})`)}`:""}`:a==="submitted"?`${Q(o,u=>t("dim",u))}`:`${t("dim",q)} ${Q(o,u=>t("dim",u))}`},s=e.required??!0;return new nt({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(i){if(s&&(i===void 0||i.length===0))return`Please select at least one option.
|
|
57
|
+
${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t("bgWhite",t("inverse"," enter ")))} to submit`))}`},render(){const i=j(e.output,e.message,`${ve(this.state)} `,`${W(this.state)} `),a=`${t("gray",h)}
|
|
58
58
|
${i}
|
|
59
|
-
`,o=this.value??[],u=(l,n)=>{if(l.disabled)return r(l,"disabled");const c=o.includes(l.value);return n&&c?r(l,"active-selected"):c?r(l,"selected"):r(l,n?"active":"inactive")};switch(this.state){case"submit":{const l=this.options.filter(({value:c})=>o.includes(c)).map(c=>r(c,"submitted")).join(
|
|
60
|
-
${
|
|
61
|
-
`).map((
|
|
59
|
+
`,o=this.value??[],u=(l,n)=>{if(l.disabled)return r(l,"disabled");const c=o.includes(l.value);return n&&c?r(l,"active-selected"):c?r(l,"selected"):r(l,n?"active":"inactive")};switch(this.state){case"submit":{const l=this.options.filter(({value:c})=>o.includes(c)).map(c=>r(c,"submitted")).join(t("dim",", "))||t("dim","none"),n=j(e.output,l,`${t("gray",h)} `);return`${a}${n}`}case"cancel":{const l=this.options.filter(({value:c})=>o.includes(c)).map(c=>r(c,"cancelled")).join(t("dim",", "));if(l.trim()==="")return`${a}${t("gray",h)}`;const n=j(e.output,l,`${t("gray",h)} `);return`${a}${n}
|
|
60
|
+
${t("gray",h)}`}case"error":{const l=`${t("yellow",h)} `,n=this.error.split(`
|
|
61
|
+
`).map((f,g)=>g===0?`${t("yellow",x)} ${t("yellow",f)}`:` ${f}`).join(`
|
|
62
62
|
`),c=a.split(`
|
|
63
|
-
`).length,
|
|
64
|
-
`).length+1;return`${a}${l}${X({output:
|
|
63
|
+
`).length,p=n.split(`
|
|
64
|
+
`).length+1;return`${a}${l}${X({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:l.length,rowPadding:c+p,style:u}).join(`
|
|
65
65
|
${l}`)}
|
|
66
66
|
${n}
|
|
67
|
-
`}default:{const l=`${
|
|
68
|
-
`).length;return`${a}${l}${X({output:
|
|
67
|
+
`}default:{const l=`${t("cyan",h)} `,n=a.split(`
|
|
68
|
+
`).length;return`${a}${l}${X({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:l.length,rowPadding:n+2,style:u}).join(`
|
|
69
69
|
${l}`)}
|
|
70
|
-
${
|
|
71
|
-
`}}}}).prompt()},
|
|
72
|
-
`),o=a.reduce((n,c)=>Math.max(
|
|
73
|
-
`).map(o),""],l=
|
|
74
|
-
`),
|
|
75
|
-
`:"",
|
|
70
|
+
${t("cyan",x)}
|
|
71
|
+
`}}}}).prompt()},jt=e=>t("dim",e),kt=(e,r,s)=>{const i={hard:!0,trim:!1},a=J(e,r,i).split(`
|
|
72
|
+
`),o=a.reduce((n,c)=>Math.max(D(c),n),0),u=a.map(s).reduce((n,c)=>Math.max(D(c),n),0),l=r-(u-o);return J(e,l,i)},Vt=(e="",r="",s)=>{const i=s?.output??N.stdout,a=s?.withGuide??_.withGuide,o=s?.format??jt,u=["",...kt(e,Y(i)-6,o).split(`
|
|
73
|
+
`).map(o),""],l=D(r),n=Math.max(u.reduce((g,E)=>{const $=D(E);return $>g?$:g},0),l)+2,c=u.map(g=>`${t("gray",h)} ${g}${" ".repeat(n-D(g))}${t("gray",h)}`).join(`
|
|
74
|
+
`),p=a?`${t("gray",h)}
|
|
75
|
+
`:"",f=a?We:ge;i.write(`${p}${t("green",V)} ${t("reset",r)} ${t("gray",se.repeat(Math.max(n-l-1,1))+pe)}
|
|
76
76
|
${c}
|
|
77
|
-
${
|
|
78
|
-
`)},
|
|
79
|
-
`:""}${W(this.state)} ${
|
|
80
|
-
`,i=this.userInputWithCursor,a=this.masked;switch(this.state){case"error":{const o=r?`${
|
|
77
|
+
${t("gray",f+se.repeat(n+2)+me)}
|
|
78
|
+
`)},Ht=e=>new at({validate:e.validate,mask:e.mask??Ne,signal:e.signal,input:e.input,output:e.output,render(){const r=e.withGuide??_.withGuide,s=`${r?`${t("gray",h)}
|
|
79
|
+
`:""}${W(this.state)} ${e.message}
|
|
80
|
+
`,i=this.userInputWithCursor,a=this.masked;switch(this.state){case"error":{const o=r?`${t("yellow",h)} `:"",u=r?`${t("yellow",x)} `:"",l=a??"";return e.clearOnError&&this.clear(),`${s.trim()}
|
|
81
81
|
${o}${l}
|
|
82
|
-
${u}${
|
|
83
|
-
`}case"submit":{const o=r?`${
|
|
84
|
-
${
|
|
82
|
+
${u}${t("yellow",this.error)}
|
|
83
|
+
`}case"submit":{const o=r?`${t("gray",h)} `:"",u=a?t("dim",a):"";return`${s}${o}${u}`}case"cancel":{const o=r?`${t("gray",h)} `:"",u=a?t(["strikethrough","dim"],a):"";return`${s}${o}${u}${a&&r?`
|
|
84
|
+
${t("gray",h)}`:""}`}default:{const o=r?`${t("cyan",h)} `:"",u=r?t("cyan",x):"";return`${s}${o}${i}
|
|
85
85
|
${u}
|
|
86
|
-
`}}}}).prompt(),
|
|
87
|
-
`);const
|
|
88
|
-
`);
|
|
89
|
-
`);let
|
|
90
|
-
`):s.write(`${
|
|
91
|
-
`)),
|
|
92
|
-
`)?
|
|
86
|
+
`}}}}).prompt(),Ut=e=>{const r=e.validate;return Xe({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(r)return r(s)}},options(){const s=this.userInput;if(s==="")return[];try{let i;return dt(s)?xe(s).isDirectory()?i=s:i=_e(s):i=_e(s),$t(i).map(a=>{const o=ht(i,a),u=xe(o);return{name:a,path:o,isDirectory:u.isDirectory()}}).filter(({path:a,isDirectory:o})=>a.startsWith(s)&&(e.directory||!o)).map(a=>({value:a.path}))}catch{return[]}}})},Kt=e=>t("magenta",e),be=({indicator:e="dots",onCancel:r,output:s=process.stdout,cancelMessage:i,errorMessage:a,frames:o=ee?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:u=ee?80:120,signal:l,...n}={})=>{const c=ce();let p,f,g=!1,E=!1,$="",m,d=performance.now();const F=Y(s),y=n?.styleFrame??Kt,v=B=>{const P=B>1?a??_.messages.error:i??_.messages.cancel;E=B===1,g&&(k(P,B),E&&typeof r=="function"&&r())},C=()=>v(2),A=()=>v(1),b=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",A),process.on("SIGTERM",A),process.on("exit",v),l&&l.addEventListener("abort",A)},w=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",A),process.removeListener("SIGTERM",A),process.removeListener("exit",v),l&&l.removeEventListener("abort",A)},S=()=>{if(m===void 0)return;c&&s.write(`
|
|
87
|
+
`);const B=J(m,F,{hard:!0,trim:!1}).split(`
|
|
88
|
+
`);B.length>1&&s.write(De.up(B.length-1)),s.write(De.to(0)),s.write(Te.down())},T=B=>B.replace(/\.+$/,""),M=B=>{const P=(performance.now()-B)/1e3,G=Math.floor(P/60),L=Math.floor(P%60);return G>0?`[${G}m ${L}s]`:`[${L}s]`},O=n.withGuide??_.withGuide,le=(B="")=>{g=!0,p=ot({output:s}),$=T(B),d=performance.now(),O&&s.write(`${t("gray",h)}
|
|
89
|
+
`);let P=0,G=0;b(),f=setInterval(()=>{if(c&&$===m)return;S(),m=$;const L=y(o[P]);let Z;if(c)Z=`${L} ${$}...`;else if(e==="timer")Z=`${L} ${$} ${M(d)}`;else{const et=".".repeat(Math.floor(G)).slice(0,3);Z=`${L} ${$}${et}`}const Ze=J(Z,F,{hard:!0,trim:!1});s.write(Ze),P=P+1<o.length?P+1:0,G=G<4?G+.125:0},u)},k=(B="",P=0,G=!1)=>{if(!g)return;g=!1,clearInterval(f),S();const L=P===0?t("green",V):P===1?t("red",$e):t("red",de);$=B??$,G||(e==="timer"?s.write(`${L} ${$} ${M(d)}
|
|
90
|
+
`):s.write(`${L} ${$}
|
|
91
|
+
`)),w(),p()};return{start:le,stop:(B="")=>k(B,0),message:(B="")=>{$=T(B??$)},cancel:(B="")=>k(B,1),error:(B="")=>k(B,2),clear:()=>k("",0,!0),get isCancelled(){return E}}},ze={light:I("\u2500","-"),heavy:I("\u2501","="),block:I("\u2588","#")};function qt({style:e="heavy",max:r=100,size:s=40,...i}={}){const a=be(i);let o=0,u="";const l=Math.max(1,r),n=Math.max(1,s),c=E=>{switch(E){case"initial":case"active":return $=>t("magenta",$);case"error":case"cancel":return $=>t("red",$);case"submit":return $=>t("green",$);default:return $=>t("magenta",$)}},p=(E,$)=>{const m=Math.floor(o/l*n);return`${c(E)(ze[e].repeat(m))}${t("dim",ze[e].repeat(n-m))} ${$}`},f=(E="")=>{u=E,a.start(p("initial",E))},g=(E=1,$)=>{o=Math.min(l,E+o),a.message(p("active",$??u)),u=$??u};return{start:f,stop:a.stop,cancel:a.cancel,error:a.error,clear:a.clear,advance:g,isCancelled:a.isCancelled,message:E=>g(0,E)}}const oe=(e,r)=>e.includes(`
|
|
92
|
+
`)?e.split(`
|
|
93
93
|
`).map(s=>r(s)).join(`
|
|
94
|
-
`):r(
|
|
94
|
+
`):r(e),Jt=e=>{const r=(s,i)=>{const a=s.label??String(s.value);switch(i){case"disabled":return`${t("gray",H)} ${oe(a,o=>t("gray",o))}${s.hint?` ${t("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${oe(a,o=>t("dim",o))}`;case"active":return`${t("green",z)} ${a}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${oe(a,o=>t(["strikethrough","dim"],o))}`;default:return`${t("dim",H)} ${oe(a,o=>t("dim",o))}`}};return new lt({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const s=e.withGuide??_.withGuide,i=`${W(this.state)} `,a=`${ve(this.state)} `,o=j(e.output,e.message,a,i),u=`${s?`${t("gray",h)}
|
|
95
95
|
`:""}${o}
|
|
96
|
-
`;switch(this.state){case"submit":{const l=s?`${
|
|
97
|
-
${
|
|
98
|
-
`).length,
|
|
96
|
+
`;switch(this.state){case"submit":{const l=s?`${t("gray",h)} `:"",n=j(e.output,r(this.options[this.cursor],"selected"),l);return`${u}${n}`}case"cancel":{const l=s?`${t("gray",h)} `:"",n=j(e.output,r(this.options[this.cursor],"cancelled"),l);return`${u}${n}${s?`
|
|
97
|
+
${t("gray",h)}`:""}`}default:{const l=s?`${t("cyan",h)} `:"",n=s?t("cyan",x):"",c=u.split(`
|
|
98
|
+
`).length,p=s?2:1;return`${u}${l}${X({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:l.length,rowPadding:c+p,style:(f,g)=>r(f,f.disabled?"disabled":g?"active":"inactive")}).join(`
|
|
99
99
|
${l}`)}
|
|
100
100
|
${n}
|
|
101
|
-
`}}}}).prompt()},
|
|
102
|
-
`:""}${W(this.state)} ${
|
|
103
|
-
`;switch(this.state){case"submit":{const a=s?`${
|
|
104
|
-
${
|
|
101
|
+
`}}}}).prompt()},Xt=e=>{const r=(s,i="inactive")=>{const a=s.label??String(s.value);return i==="selected"?`${t("dim",a)}`:i==="cancelled"?`${t(["strikethrough","dim"],a)}`:i==="active"?`${t(["bgCyan","gray"],` ${s.value} `)} ${a}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:`${t(["gray","bgWhite","inverse"],` ${s.value} `)} ${a}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`};return new ut({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){const s=e.withGuide??_.withGuide,i=`${s?`${t("gray",h)}
|
|
102
|
+
`:""}${W(this.state)} ${e.message}
|
|
103
|
+
`;switch(this.state){case"submit":{const a=s?`${t("gray",h)} `:"",o=this.options.find(l=>l.value===this.value)??e.options[0],u=j(e.output,r(o,"selected"),a);return`${i}${u}`}case"cancel":{const a=s?`${t("gray",h)} `:"",o=j(e.output,r(this.options[0],"cancelled"),a);return`${i}${o}${s?`
|
|
104
|
+
${t("gray",h)}`:""}`}default:{const a=s?`${t("cyan",h)} `:"",o=s?t("cyan",x):"",u=this.options.map((l,n)=>j(e.output,r(l,n===this.cursor?"active":"inactive"),a)).join(`
|
|
105
105
|
`);return`${i}${u}
|
|
106
106
|
${o}
|
|
107
|
-
`}}}}).prompt()},
|
|
108
|
-
${r} `);let s=3;for await(let i of
|
|
109
|
-
${
|
|
110
|
-
`)&&(s=3+
|
|
111
|
-
`))).length);const a=
|
|
112
|
-
${
|
|
113
|
-
`)},info:
|
|
114
|
-
`),r.write(`${
|
|
115
|
-
`);for(let
|
|
116
|
-
`);const n=[{value:"",full:""}];let c=!1;const
|
|
117
|
-
${
|
|
118
|
-
`).reduce((
|
|
119
|
-
${
|
|
120
|
-
`).map(
|
|
121
|
-
`).map(
|
|
122
|
-
`),
|
|
123
|
-
`),
|
|
124
|
-
`)+
|
|
125
|
-
`))}
|
|
126
|
-
`)}l&&$()},$=()=>{for(const
|
|
127
|
-
`:""}${W(this.state)} `}${
|
|
128
|
-
`,i=
|
|
107
|
+
`}}}}).prompt()},Qe=`${t("gray",h)} `,K={message:async(e,{symbol:r=t("gray",h)}={})=>{process.stdout.write(`${t("gray",h)}
|
|
108
|
+
${r} `);let s=3;for await(let i of e){i=i.replace(/\n/g,`
|
|
109
|
+
${Qe}`),i.includes(`
|
|
110
|
+
`)&&(s=3+ue(i.slice(i.lastIndexOf(`
|
|
111
|
+
`))).length);const a=ue(i).length;s+a<process.stdout.columns?(s+=a,process.stdout.write(i)):(process.stdout.write(`
|
|
112
|
+
${Qe}${i.trimStart()}`),s=3+ue(i.trimStart()).length)}process.stdout.write(`
|
|
113
|
+
`)},info:e=>K.message(e,{symbol:t("blue",fe)}),success:e=>K.message(e,{symbol:t("green",Fe)}),step:e=>K.message(e,{symbol:t("green",V)}),warn:e=>K.message(e,{symbol:t("yellow",ye)}),warning:e=>K.warn(e),error:e=>K.message(e,{symbol:t("red",Ee)})},Yt=async(e,r)=>{for(const s of e){if(s.enabled===!1)continue;const i=be(r);i.start(s.title);const a=await s.task(i.message);i.stop(a||s.title)}},zt=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Qt=e=>{const r=e.output??process.stdout,s=Y(r),i=t("gray",h),a=e.spacing??1,o=3,u=e.retainLog===!0,l=!ce()&&Me(r);r.write(`${i}
|
|
114
|
+
`),r.write(`${t("green",V)} ${e.title}
|
|
115
|
+
`);for(let d=0;d<a;d++)r.write(`${i}
|
|
116
|
+
`);const n=[{value:"",full:""}];let c=!1;const p=d=>{if(n.length===0)return;let F=0;d&&(F+=a+2);for(const y of n){const{value:v,result:C}=y;let A=C?.message??v;if(A.length===0)continue;C===void 0&&y.header!==void 0&&y.header!==""&&(A+=`
|
|
117
|
+
${y.header}`);const b=A.split(`
|
|
118
|
+
`).reduce((w,S)=>S===""?w+1:w+Math.ceil((S.length+o)/s),0);F+=b}F>0&&(F+=1,r.write(Te.lines(F)))},f=(d,F,y)=>{const v=y?`${d.full}
|
|
119
|
+
${d.value}`:d.value;d.header!==void 0&&d.header!==""&&R.message(d.header.split(`
|
|
120
|
+
`).map(C=>t("bold",C)),{output:r,secondarySymbol:i,symbol:i,spacing:0}),R.message(v.split(`
|
|
121
|
+
`).map(C=>t("dim",C)),{output:r,secondarySymbol:i,symbol:i,spacing:F??a})},g=()=>{for(const d of n){const{header:F,value:y,full:v}=d;(F===void 0||F.length===0)&&y.length===0||f(d,void 0,u===!0&&v.length>0)}},E=(d,F,y)=>{if(p(!1),(y?.raw!==!0||!c)&&d.value!==""&&(d.value+=`
|
|
122
|
+
`),d.value+=zt(F),c=y?.raw===!0,e.limit!==void 0){const v=d.value.split(`
|
|
123
|
+
`),C=v.length-e.limit;if(C>0){const A=v.splice(0,C);u&&(d.full+=(d.full===""?"":`
|
|
124
|
+
`)+A.join(`
|
|
125
|
+
`))}d.value=v.join(`
|
|
126
|
+
`)}l&&$()},$=()=>{for(const d of n)d.result?d.result.status==="error"?R.error(d.result.message,{output:r,secondarySymbol:i,spacing:0}):R.success(d.result.message,{output:r,secondarySymbol:i,spacing:0}):d.value!==""&&f(d,0)},m=(d,F)=>{p(!1),d.result=F,l&&$()};return{message(d,F){E(n[0],d,F)},group(d){const F={header:d,value:"",full:""};return n.push(F),{message(y,v){E(F,y,v)},error(y){m(F,{status:"error",message:y})},success(y){m(F,{status:"success",message:y})}}},error(d,F){p(!0),R.error(d,{output:r,secondarySymbol:i,spacing:1}),F?.showLog!==!1&&g(),n.splice(1,n.length-1),n[0].value="",n[0].full=""},success(d,F){p(!0),R.success(d,{output:r,secondarySymbol:i,spacing:1}),F?.showLog===!0&&g(),n.splice(1,n.length-1),n[0].value="",n[0].full=""}}},Zt=e=>new ct({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){const r=e?.withGuide??_.withGuide,s=`${`${r?`${t("gray",h)}
|
|
127
|
+
`:""}${W(this.state)} `}${e.message}
|
|
128
|
+
`,i=e.placeholder?t("inverse",e.placeholder[0])+t("dim",e.placeholder.slice(1)):t(["inverse","hidden"],"_"),a=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{const u=this.error?` ${t("yellow",this.error)}`:"",l=r?`${t("yellow",h)} `:"",n=r?t("yellow",x):"";return`${s.trim()}
|
|
129
129
|
${l}${a}
|
|
130
130
|
${n}${u}
|
|
131
|
-
`}case"submit":{const u=o?` ${
|
|
132
|
-
${l}`:""}`}default:{const u=r?`${
|
|
131
|
+
`}case"submit":{const u=o?` ${t("dim",o)}`:"",l=r?t("gray",h):"";return`${s}${l}${u}`}case"cancel":{const u=o?` ${t(["strikethrough","dim"],o)}`:"",l=r?t("gray",h):"";return`${s}${l}${u}${o.trim()?`
|
|
132
|
+
${l}`:""}`}default:{const u=r?`${t("cyan",h)} `:"",l=r?t("cyan",x):"";return`${s}${u}${a}
|
|
133
133
|
${l}
|
|
134
|
-
`}}}}).prompt();export{
|
|
134
|
+
`}}}}).prompt();export{h as S_BAR,x as S_BAR_END,Pe as S_BAR_END_RIGHT,se as S_BAR_H,he as S_BAR_START,Oe as S_BAR_START_RIGHT,te as S_CHECKBOX_ACTIVE,q as S_CHECKBOX_INACTIVE,U as S_CHECKBOX_SELECTED,We as S_CONNECT_LEFT,ge as S_CORNER_BOTTOM_LEFT,me as S_CORNER_BOTTOM_RIGHT,Ge as S_CORNER_TOP_LEFT,pe as S_CORNER_TOP_RIGHT,Ee as S_ERROR,fe as S_INFO,Ne as S_PASSWORD_MASK,z as S_RADIO_ACTIVE,H as S_RADIO_INACTIVE,Re as S_STEP_ACTIVE,$e as S_STEP_CANCEL,de as S_STEP_ERROR,V as S_STEP_SUBMIT,Fe as S_SUCCESS,ye as S_WARN,Xe as autocomplete,xt as autocompleteMultiselect,Mt as box,Nt as cancel,Rt as confirm,Ot as group,Pt as groupMultiselect,Wt as intro,ce as isCI,Me as isTTY,X as limitOptions,R as log,Lt as multiselect,Vt as note,Gt as outro,Ht as password,Ut as path,qt as progress,Jt as select,Xt as selectKey,be as spinner,K as stream,W as symbol,ve as symbolBar,Qt as taskLog,Yt as tasks,Zt as text,ee as unicode,I as unicodeOr};
|
|
135
135
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clack/prompts",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -47,9 +47,8 @@
|
|
|
47
47
|
"ui"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"picocolors": "^1.0.0",
|
|
51
50
|
"sisteransi": "^1.0.5",
|
|
52
|
-
"@clack/core": "1.0
|
|
51
|
+
"@clack/core": "1.1.0"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
54
|
"fast-string-width": "^1.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/agent-prod",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.32.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"@babel/code-frame": "7.27.1",
|
|
9
9
|
"@babel/helper-validator-identifier": "7.28.5",
|
|
10
10
|
"@babel/runtime": "7.28.4",
|
|
11
|
-
"@clack/core": "1.0
|
|
12
|
-
"@clack/prompts": "1.0
|
|
11
|
+
"@clack/core": "1.1.0",
|
|
12
|
+
"@clack/prompts": "1.1.0",
|
|
13
13
|
"@humanwhocodes/momoa": "2.0.4",
|
|
14
14
|
"@kubb/fabric-core": "0.13.3",
|
|
15
15
|
"@kubb/react-fabric": "0.13.3",
|
package/README.md
CHANGED
|
@@ -114,7 +114,6 @@ The `agent_kv` named volume persists the KV store (session cache, machine token)
|
|
|
114
114
|
| `HOST` | `0.0.0.0` | Server host. |
|
|
115
115
|
| `KUBB_STUDIO_URL` | `https://studio.kubb.dev` | Kubb Studio WebSocket URL. |
|
|
116
116
|
| `KUBB_AGENT_TOKEN` | _(empty)_ | Authentication token for Studio. Required to connect. |
|
|
117
|
-
| `KUBB_AGENT_NO_CACHE` | `false` | Set to `true` to disable session caching. |
|
|
118
117
|
| `KUBB_AGENT_ALLOW_WRITE` | `false` | Set to `true` to allow writing generated files to disk. |
|
|
119
118
|
| `KUBB_AGENT_ALLOW_ALL` | `false` | Set to `true` to grant all permissions (implies `KUBB_AGENT_ALLOW_WRITE=true`). |
|
|
120
119
|
| `KUBB_AGENT_RETRY_TIMEOUT` | `30000` | Milliseconds to wait before retrying a failed Studio connection. |
|
|
@@ -132,7 +131,6 @@ PORT=3000
|
|
|
132
131
|
KUBB_AGENT_ROOT=/path/to/your/project
|
|
133
132
|
KUBB_AGENT_CONFIG=/path/to/your/project/kubb.config.ts
|
|
134
133
|
KUBB_AGENT_TOKEN=your-token-here
|
|
135
|
-
KUBB_AGENT_NO_CACHE=false
|
|
136
134
|
KUBB_STUDIO_URL=https://studio.kubb.dev
|
|
137
135
|
```
|
|
138
136
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/agent",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.32.1",
|
|
4
4
|
"description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
"tinyexec": "^1.0.2",
|
|
41
41
|
"unstorage": "^1.17.4",
|
|
42
42
|
"ws": "^8.19.0",
|
|
43
|
-
"@kubb/core": "4.
|
|
44
|
-
"@kubb/plugin-client": "4.
|
|
45
|
-
"@kubb/plugin-cypress": "4.
|
|
46
|
-
"@kubb/plugin-faker": "4.
|
|
47
|
-
"@kubb/plugin-mcp": "4.
|
|
48
|
-
"@kubb/plugin-msw": "4.
|
|
49
|
-
"@kubb/plugin-oas": "4.
|
|
50
|
-
"@kubb/plugin-react-query": "4.
|
|
51
|
-
"@kubb/plugin-redoc": "4.
|
|
52
|
-
"@kubb/plugin-solid-query": "4.
|
|
53
|
-
"@kubb/plugin-svelte-query": "4.
|
|
54
|
-
"@kubb/plugin-swr": "4.
|
|
55
|
-
"@kubb/plugin-ts": "4.
|
|
56
|
-
"@kubb/plugin-vue-query": "4.
|
|
57
|
-
"@kubb/plugin-zod": "4.
|
|
43
|
+
"@kubb/core": "4.32.1",
|
|
44
|
+
"@kubb/plugin-client": "4.32.1",
|
|
45
|
+
"@kubb/plugin-cypress": "4.32.1",
|
|
46
|
+
"@kubb/plugin-faker": "4.32.1",
|
|
47
|
+
"@kubb/plugin-mcp": "4.32.1",
|
|
48
|
+
"@kubb/plugin-msw": "4.32.1",
|
|
49
|
+
"@kubb/plugin-oas": "4.32.1",
|
|
50
|
+
"@kubb/plugin-react-query": "4.32.1",
|
|
51
|
+
"@kubb/plugin-redoc": "4.32.1",
|
|
52
|
+
"@kubb/plugin-solid-query": "4.32.1",
|
|
53
|
+
"@kubb/plugin-svelte-query": "4.32.1",
|
|
54
|
+
"@kubb/plugin-swr": "4.32.1",
|
|
55
|
+
"@kubb/plugin-ts": "4.32.1",
|
|
56
|
+
"@kubb/plugin-vue-query": "4.32.1",
|
|
57
|
+
"@kubb/plugin-zod": "4.32.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/ws": "^8.18.1",
|