tako-cli 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +53 -0
  2. package/install.sh +190 -0
  3. package/package.json +23 -0
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ var x$=Object.create;var{getPrototypeOf:p$,defineProperty:xr,getOwnPropertyNames:w$}=Object;var y$=Object.prototype.hasOwnProperty;var M=($,e,t)=>{t=$!=null?x$(p$($)):{};let m=e||!$||!$.__esModule?xr(t,"default",{value:$,enumerable:!0}):t;for(let a of w$($))if(!y$.call(m,a))xr(m,a,{get:()=>$[a],enumerable:!0});return m};var pr=($,e)=>()=>(e||$((e={exports:{}}).exports,e),e.exports);var k=import.meta.require;var $r=pr((st,Qr)=>{var rr={to($,e){if(!e)return`\x1B[${$+1}G`;return`\x1B[${e+1};${$+1}H`},move($,e){let t="";if($<0)t+=`\x1B[${-$}D`;else if($>0)t+=`\x1B[${$}C`;if(e<0)t+=`\x1B[${-e}A`;else if(e>0)t+=`\x1B[${e}B`;return t},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Y$={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},j$={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let e="";for(let t=0;t<$;t++)e+=this.line+(t<$-1?rr.up():"");if($)e+=rr.left;return e}};Qr.exports={cursor:rr,scroll:Y$,erase:j$,beep:"\x07"}});var tr=pr((it,er)=>{var U=process||{},Yr=U.argv||[],I=U.env||{},H$=!(!!I.NO_COLOR||Yr.includes("--no-color"))&&(!!I.FORCE_COLOR||Yr.includes("--color")||U.platform==="win32"||(U.stdout||{}).isTTY&&I.TERM!=="dumb"||!!I.CI),L$=($,e,t=$)=>(m)=>{let a=""+m,s=a.indexOf(e,$.length);return~s?$+V$(a,e,t,s)+e:$+a+e},V$=($,e,t,m)=>{let a="",s=0;do a+=$.substring(s,m)+t,s=m+e.length,m=$.indexOf(e,s);while(~m);return a+$.substring(s)},jr=($=H$)=>{let e=$?L$:()=>String;return{isColorSupported:$,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};er.exports=jr();er.exports.createColors=jr});import{join as Wr}from"path";import{homedir as S$}from"os";import{join as j}from"path";var z=j(S$(),".tako"),yr=j(z,"config.json"),u=j(z,"tools"),J=j(z,"bun"),S=j(J,"bin","bun");var f="https://claude-proxy.shiroha.tech",wr={apiKey:"",apiId:"",installedClients:{}};async function Sr(){let $=await import("fs/promises");try{await $.mkdir(z,{recursive:!0}),await $.mkdir(u,{recursive:!0})}catch{}}async function G(){await Sr();try{let $=Bun.file(yr);if(await $.exists()){let e=await $.json();return{...wr,...e}}}catch{}return{...wr}}async function f$($){await Sr(),await Bun.write(yr,JSON.stringify($,null,2))}async function E($){let t={...await G(),...$};return await f$(t),t}async function fr(){return!!(await G()).apiKey}async function Mr(){return(await G()).apiKey}async function qr(){return(await G()).apiId}function Gr($,e){if(!$.startsWith(z))throw Error(`\u5B89\u5168\u68C0\u67E5\u5931\u8D25: ${e} \u8DEF\u5F84 "${$}" \u4E0D\u5728 Tako \u76EE\u5F55\u4E0B`)}function T($){let e=Wr(u,$);return Gr(e,"\u5BA2\u6237\u7AEF\u5B89\u88C5\u76EE\u5F55"),e}function Zr($){let e=T($.id),t=Wr(e,"node_modules",".bin",$.command);return Gr(t,"\u5BA2\u6237\u7AEF\u53EF\u6267\u884C\u6587\u4EF6"),t}var zr=new Map;function P($){zr.set($.id,$)}function Jr(){return Array.from(zr.values())}var M$={id:"claude-code",name:"Claude Code",package:"@anthropic-ai/claude-code",command:"claude",getEnvVars($){return{ANTHROPIC_BASE_URL:`${f}/api`,ANTHROPIC_AUTH_TOKEN:$}}};P(M$);import{homedir as q$}from"os";import{join as F}from"path";var D=F(q$(),".codex"),W$=F(D,"config.toml"),G$=F(D,"auth.json"),Z$=`model_provider = "crs"
4
+ model = "gpt-5-codex"
5
+ model_reasoning_effort = "high"
6
+ disable_response_storage = true
7
+ preferred_auth_method = "apikey"
8
+
9
+ [model_providers.crs]
10
+ name = "crs"
11
+ base_url = "${f}/openai"
12
+ wire_api = "responses"
13
+ requires_openai_auth = true
14
+ env_key = "CRS_OAI_KEY"
15
+ `,z$=`{
16
+ "OPENAI_API_KEY": null
17
+ }
18
+ `;async function J$($){let e=await import("fs/promises");try{await e.mkdir(D,{recursive:!0})}catch{}await Bun.write(W$,Z$),await Bun.write(G$,z$)}var Q$={id:"codex",name:"Codex",package:"@openai/codex",command:"codex",runtime:"bun",getEnvVars($){return{CRS_OAI_KEY:$}},setupConfigFiles:J$};P(Q$);var p=M($r(),1),O=M(tr(),1);import{stdin as Ir,stdout as Ur}from"process";import*as q from"readline";import Hr from"readline";import{WriteStream as X$}from"tty";function B$({onlyFirst:$=!1}={}){let e=["[\\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(e,$?void 0:"g")}var k$=B$();function Kr($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(k$,"")}function Or($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var Ar={exports:{}};(function($){var e={};$.exports=e,e.eastAsianWidth=function(m){var a=m.charCodeAt(0),s=m.length==2?m.charCodeAt(1):0,r=a;return 55296<=a&&a<=56319&&56320<=s&&s<=57343&&(a&=1023,s&=1023,r=a<<10|s,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"},e.characterLength=function(m){var a=this.eastAsianWidth(m);return a=="F"||a=="W"||a=="A"?2:1};function t(m){return m.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(m){for(var a=t(m),s=0,r=0;r<a.length;r++)s=s+this.characterLength(a[r]);return s},e.slice=function(m,a,s){textLen=e.length(m),a=a||0,s=s||1,a<0&&(a=textLen+a),s<0&&(s=textLen+s);for(var r="",o=0,n=t(m),c=0;c<n.length;c++){var d=n[c],h=e.length(d);if(o>=a-(h==2?1:0))if(o+h<=s)r+=d;else break;o+=h}return r}})(Ar);var E$=Ar.exports,T$=Or(E$),P$=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\u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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])|\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\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\u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B6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},I$=Or(P$);function H($,e={}){if(typeof $!="string"||$.length===0||(e={ambiguousIsNarrow:!0,...e},$=Kr($),$.length===0))return 0;$=$.replace(I$()," ");let t=e.ambiguousIsNarrow?1:2,m=0;for(let a of $){let s=a.codePointAt(0);if(s<=31||s>=127&&s<=159||s>=768&&s<=879)continue;switch(T$.eastAsianWidth(a)){case"F":case"W":m+=2;break;case"A":m+=t;break;default:m+=1}}return m}var mr=10,Lr=($=0)=>(e)=>`\x1B[${e+$}m`,Vr=($=0)=>(e)=>`\x1B[${38+$};5;${e}m`,Xr=($=0)=>(e,t,m)=>`\x1B[${38+$};2;${e};${t};${m}m`,b={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(b.modifier);var U$=Object.keys(b.color),K$=Object.keys(b.bgColor);[...U$,...K$];function O$(){let $=new Map;for(let[e,t]of Object.entries(b)){for(let[m,a]of Object.entries(t))b[m]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},t[m]=b[m],$.set(a[0],a[1]);Object.defineProperty(b,e,{value:t,enumerable:!1})}return Object.defineProperty(b,"codes",{value:$,enumerable:!1}),b.color.close="\x1B[39m",b.bgColor.close="\x1B[49m",b.color.ansi=Lr(),b.color.ansi256=Vr(),b.color.ansi16m=Xr(),b.bgColor.ansi=Lr(mr),b.bgColor.ansi256=Vr(mr),b.bgColor.ansi16m=Xr(mr),Object.defineProperties(b,{rgbToAnsi256:{value:(e,t,m)=>e===t&&t===m?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(m/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[m]=t;m.length===3&&(m=[...m].map((s)=>s+s).join(""));let a=Number.parseInt(m,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:(e)=>b.rgbToAnsi256(...b.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:(e)=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,m,a;if(e>=232)t=((e-232)*10+8)/255,m=t,a=t;else{e-=16;let o=e%36;t=Math.floor(e/36)/5,m=Math.floor(o/6)/5,a=o%6/5}let s=Math.max(t,m,a)*2;if(s===0)return 30;let r=30+(Math.round(a)<<2|Math.round(m)<<1|Math.round(t));return s===2&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(e,t,m)=>b.ansi256ToAnsi(b.rgbToAnsi256(e,t,m)),enumerable:!1},hexToAnsi:{value:(e)=>b.ansi256ToAnsi(b.hexToAnsi256(e)),enumerable:!1}}),b}var A$=O$(),A=new Set(["\x1B","\x9B"]),R$=39,sr="\x07",Rr="[",C$="]",Cr="m",ir=`${C$}8;;`,Br=($)=>`${A.values().next().value}${Rr}${$}${Cr}`,kr=($)=>`${A.values().next().value}${ir}${$}${sr}`,N$=($)=>$.split(" ").map((e)=>H(e)),ar=($,e,t)=>{let m=[...e],a=!1,s=!1,r=H(Kr($[$.length-1]));for(let[o,n]of m.entries()){let c=H(n);if(r+c<=t?$[$.length-1]+=n:($.push(n),r=0),A.has(n)&&(a=!0,s=m.slice(o+1).join("").startsWith(ir)),a){s?n===sr&&(a=!1,s=!1):n===Cr&&(a=!1);continue}r+=c,r===t&&o<m.length-1&&($.push(""),r=0)}!r&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},_$=($)=>{let e=$.split(" "),t=e.length;for(;t>0&&!(H(e[t-1])>0);)t--;return t===e.length?$:e.slice(0,t).join(" ")+e.slice(t).join("")},u$=($,e,t={})=>{if(t.trim!==!1&&$.trim()==="")return"";let m="",a,s,r=N$($),o=[""];for(let[c,d]of $.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let h=H(o[o.length-1]);if(c!==0&&(h>=e&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),h=0),(h>0||t.trim===!1)&&(o[o.length-1]+=" ",h++)),t.hard&&r[c]>e){let v=e-h,W=1+Math.floor((r[c]-v-1)/e);Math.floor((r[c]-1)/e)<W&&o.push(""),ar(o,d,e);continue}if(h+r[c]>e&&h>0&&r[c]>0){if(t.wordWrap===!1&&h<e){ar(o,d,e);continue}o.push("")}if(h+r[c]>e&&t.wordWrap===!1){ar(o,d,e);continue}o[o.length-1]+=d}t.trim!==!1&&(o=o.map((c)=>_$(c)));let n=[...o.join(`
19
+ `)];for(let[c,d]of n.entries()){if(m+=d,A.has(d)){let{groups:v}=new RegExp(`(?:\\${Rr}(?<code>\\d+)m|\\${ir}(?<uri>.*)${sr})`).exec(n.slice(c).join(""))||{groups:{}};if(v.code!==void 0){let W=Number.parseFloat(v.code);a=W===R$?void 0:W}else v.uri!==void 0&&(s=v.uri.length===0?void 0:v.uri)}let h=A$.codes.get(Number(a));n[c+1]===`
20
+ `?(s&&(m+=kr("")),a&&h&&(m+=Br(h))):d===`
21
+ `&&(a&&h&&(m+=Br(a)),s&&(m+=kr(s)))}return m};function Er($,e,t){return String($).normalize().replace(/\r\n/g,`
22
+ `).split(`
23
+ `).map((m)=>u$(m,e,t)).join(`
24
+ `)}var F$=Object.defineProperty,D$=($,e,t)=>(e in $)?F$($,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):$[e]=t,w=($,e,t)=>(D$($,typeof e!="symbol"?e+"":e,t),t);function re($,e){if($===e)return;let t=$.split(`
25
+ `),m=e.split(`
26
+ `),a=[];for(let s=0;s<Math.max(t.length,m.length);s++)t[s]!==m[s]&&a.push(s);return a}var Nr=Symbol("clack:cancel");function L($){return $===Nr}function K($,e){$.isTTY&&$.setRawMode(e)}var Tr=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),$e=new Set(["up","down","left","right","space","enter"]);class or{constructor({render:$,input:e=Ir,output:t=Ur,...m},a=!0){w(this,"input"),w(this,"output"),w(this,"rl"),w(this,"opts"),w(this,"_track",!1),w(this,"_render"),w(this,"_cursor",0),w(this,"state","initial"),w(this,"value"),w(this,"error",""),w(this,"subscribers",new Map),w(this,"_prevFrame",""),this.opts=m,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=a,this.input=e,this.output=t}prompt(){let $=new X$(0);return $._write=(e,t,m)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),m()},this.input.pipe($),this.rl=Hr.createInterface({input:this.input,output:$,tabSize:2,prompt:"",escapeCodeTimeout:50}),Hr.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),K(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((e,t)=>{this.once("submit",()=>{this.output.write(p.cursor.show),this.output.off("resize",this.render),K(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(p.cursor.show),this.output.off("resize",this.render),K(this.input,!1),e(Nr)})})}on($,e){let t=this.subscribers.get($)??[];t.push({cb:e}),this.subscribers.set($,t)}once($,e){let t=this.subscribers.get($)??[];t.push({cb:e,once:!0}),this.subscribers.set($,t)}emit($,...e){let t=this.subscribers.get($)??[],m=[];for(let a of t)a.cb(...e),a.once&&m.push(()=>t.splice(t.indexOf(a),1));for(let a of m)a()}unsubscribe(){this.subscribers.clear()}onKeypress($,e){if(this.state==="error"&&(this.state="active"),e?.name&&!this._track&&Tr.has(e.name)&&this.emit("cursor",Tr.get(e.name)),e?.name&&$e.has(e.name)&&this.emit("cursor",e.name),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),e?.name==="return"){if(this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}$==="\x03"&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
27
+ `),K(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=Er(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
28
+ `).length-1;this.output.write(p.cursor.move(-999,$*-1))}render(){let $=Er(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(p.cursor.hide);else{let e=re(this._prevFrame,$);if(this.restoreCursor(),e&&e?.length===1){let t=e[0];this.output.write(p.cursor.move(0,t)),this.output.write(p.erase.lines(1));let m=$.split(`
29
+ `);this.output.write(m[t]),this._prevFrame=$,this.output.write(p.cursor.move(0,m.length-t-1));return}else if(e&&e?.length>1){let t=e[0];this.output.write(p.cursor.move(0,t)),this.output.write(p.erase.down());let m=$.split(`
30
+ `).slice(t);this.output.write(m.join(`
31
+ `)),this._prevFrame=$;return}this.output.write(p.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}var ee=Object.defineProperty,te=($,e,t)=>(e in $)?ee($,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):$[e]=t,Pr=($,e,t)=>(te($,typeof e!="symbol"?e+"":e,t),t),_r=class extends or{constructor($){super($,!1),Pr(this,"options"),Pr(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:e})=>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}};var me=Object.defineProperty,ae=($,e,t)=>(e in $)?me($,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):$[e]=t,se=($,e,t)=>(ae($,typeof e!="symbol"?e+"":e,t),t);class cr extends or{constructor($){super($),se(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=$.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${O.default.inverse(O.default.hidden("_"))}`;else{let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor);this.valueWithCursor=`${e}${O.default.inverse(t[0])}${t.slice(1)}`}})}get cursor(){return this._cursor}}var ie=globalThis.process.platform.startsWith("win");function ur({input:$=Ir,output:e=Ur,overwrite:t=!0,hideCursor:m=!0}={}){let a=q.createInterface({input:$,output:e,prompt:"",tabSize:1});q.emitKeypressEvents($,a),$.isTTY&&$.setRawMode(!0);let s=(r,{name:o})=>{if(String(r)==="\x03"){m&&e.write(p.cursor.show),process.exit(0);return}if(!t)return;q.moveCursor(e,o==="return"?0:-1,o==="return"?-1:0,()=>{q.clearLine(e,1,()=>{$.once("keypress",s)})})};return m&&e.write(p.cursor.hide),$.once("keypress",s),()=>{$.off("keypress",s),m&&e.write(p.cursor.show),$.isTTY&&!ie&&$.setRawMode(!1),a.terminal=!1,a.close()}}var i=M(tr(),1),Q=M($r(),1);import y from"process";function oe(){return y.platform!=="win32"?y.env.TERM!=="linux":Boolean(y.env.CI)||Boolean(y.env.WT_SESSION)||Boolean(y.env.TERMINUS_SUBLIME)||y.env.ConEmuTask==="{cmd::Cmder}"||y.env.TERM_PROGRAM==="Terminus-Sublime"||y.env.TERM_PROGRAM==="vscode"||y.env.TERM==="xterm-256color"||y.env.TERM==="alacritty"||y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var hr=oe(),g=($,e)=>hr?$:e,ce=g("\u25C6","*"),Fr=g("\u25A0","x"),Dr=g("\u25B2","x"),nr=g("\u25C7","o"),yt=g("\u250C","T"),x=g("\u2502","|"),R=g("\u2514","\u2014"),he=g("\u25CF",">"),ne=g("\u25CB"," "),St=g("\u25FB","[\u2022]"),ft=g("\u25FC","[+]"),Mt=g("\u25FB","[ ]"),qt=g("\u25AA","\u2022"),Wt=g("\u2500","-"),Gt=g("\u256E","+"),Zt=g("\u251C","+"),zt=g("\u256F","+"),be=g("\u25CF","\u2022"),le=g("\u25C6","*"),de=g("\u25B2","!"),ge=g("\u25A0","x"),r$=($)=>{switch($){case"initial":case"active":return i.default.cyan(ce);case"cancel":return i.default.red(Fr);case"error":return i.default.yellow(Dr);case"submit":return i.default.green(nr)}},br=($)=>new cr({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let e=`${i.default.gray(x)}
32
+ ${r$(this.state)} ${$.message}
33
+ `,t=$.placeholder?i.default.inverse($.placeholder[0])+i.default.dim($.placeholder.slice(1)):i.default.inverse(i.default.hidden("_")),m=this.value?this.valueWithCursor:t;switch(this.state){case"error":return`${e.trim()}
34
+ ${i.default.yellow(x)} ${m}
35
+ ${i.default.yellow(R)} ${i.default.yellow(this.error)}
36
+ `;case"submit":return`${e}${i.default.gray(x)} ${i.default.dim(this.value||$.placeholder)}`;case"cancel":return`${e}${i.default.gray(x)} ${i.default.strikethrough(i.default.dim(this.value??""))}${this.value?.trim()?`
37
+ `+i.default.gray(x):""}`;default:return`${e}${i.default.cyan(x)} ${m}
38
+ ${i.default.cyan(R)}
39
+ `}}}).prompt();var $$=($)=>{let e=(m,a)=>{let s=m.label??String(m.value);return a==="active"?`${i.default.green(he)} ${s} ${m.hint?i.default.dim(`(${m.hint})`):""}`:a==="selected"?`${i.default.dim(s)}`:a==="cancelled"?`${i.default.strikethrough(i.default.dim(s))}`:`${i.default.dim(ne)} ${i.default.dim(s)}`},t=0;return new _r({options:$.options,initialValue:$.initialValue,render(){let m=`${i.default.gray(x)}
40
+ ${r$(this.state)} ${$.message}
41
+ `;switch(this.state){case"submit":return`${m}${i.default.gray(x)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${m}${i.default.gray(x)} ${e(this.options[this.cursor],"cancelled")}
42
+ ${i.default.gray(x)}`;default:{let a=$.maxItems===void 0?1/0:Math.max($.maxItems,5);this.cursor>=t+a-3?t=Math.max(Math.min(this.cursor-a+3,this.options.length-a),0):this.cursor<t+2&&(t=Math.max(this.cursor-2,0));let s=a<this.options.length&&t>0,r=a<this.options.length&&t+a<this.options.length;return`${m}${i.default.cyan(x)} ${this.options.slice(t,t+a).map((o,n,c)=>n===0&&s?i.default.dim("..."):n===c.length-1&&r?i.default.dim("..."):e(o,n+t===this.cursor?"active":"inactive")).join(`
43
+ ${i.default.cyan(x)} `)}
44
+ ${i.default.cyan(R)}
45
+ `}}}}).prompt()};var lr=($="")=>{process.stdout.write(`${i.default.gray(x)}
46
+ ${i.default.gray(R)} ${$}
47
+
48
+ `)},l={message:($="",{symbol:e=i.default.gray(x)}={})=>{let t=[`${i.default.gray(x)}`];if($){let[m,...a]=$.split(`
49
+ `);t.push(`${e} ${m}`,...a.map((s)=>`${i.default.gray(x)} ${s}`))}process.stdout.write(`${t.join(`
50
+ `)}
51
+ `)},info:($)=>{l.message($,{symbol:i.default.blue(be)})},success:($)=>{l.message($,{symbol:i.default.green(le)})},step:($)=>{l.message($,{symbol:i.default.green(nr)})},warn:($)=>{l.message($,{symbol:i.default.yellow(de)})},warning:($)=>{l.warn($)},error:($)=>{l.message($,{symbol:i.default.red(ge)})}},Y=()=>{let $=hr?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=hr?80:120,t,m,a=!1,s="",r=(d="")=>{a=!0,t=ur(),s=d.replace(/\.+$/,""),process.stdout.write(`${i.default.gray(x)}
52
+ `);let h=0,v=0;m=setInterval(()=>{let W=i.default.magenta($[h]),X=".".repeat(Math.floor(v)).slice(0,3);process.stdout.write(Q.cursor.move(-999,0)),process.stdout.write(Q.erase.down(1)),process.stdout.write(`${W} ${s}${X}`),h=h+1<$.length?h+1:0,v=v<$.length?v+0.125:0},e)},o=(d="",h=0)=>{s=d??s,a=!1,clearInterval(m);let v=h===0?i.default.green(nr):h===1?i.default.red(Fr):i.default.red(Dr);process.stdout.write(Q.cursor.move(-999,0)),process.stdout.write(Q.erase.down(1)),process.stdout.write(`${v} ${s}
53
+ `),t()},n=(d="")=>{s=d??s},c=(d)=>{let h=d>1?"Something went wrong":"Canceled";a&&o(h,d)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:r,stop:o,message:n}};function xe($){return $.startsWith("cr_")&&$.length>10}async function pe($){try{let t=await(await fetch(`${f}/apiStats/api/get-key-id`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:$})})).json();if(t.success&&t.data?.id)return{valid:!0,apiId:t.data.id};return{valid:!1,error:t.error||"Key \u9A8C\u8BC1\u5931\u8D25"}}catch(e){return{valid:!1,error:e instanceof Error?e.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}async function e$($){if(!xe($))return{success:!1,error:"Key \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4EE5 cr_ \u5F00\u5934"};let e=await pe($);if(!e.valid)return{success:!1,error:e.error};return await E({apiKey:$,apiId:e.apiId}),{success:!0}}import{join as s$}from"path";var C=null,dr={cn:{npm:"https://registry.npmmirror.com",bun:"https://bun.sh/install",bunMirror:"https://registry.npmmirror.com/-/binary/bun"},global:{npm:"https://registry.npmjs.org",bun:"https://bun.sh/install",bunMirror:null}};async function gr(){if(C)return C;let $=[we,ye,Se];for(let e of $)try{let t=await Promise.race([e(),new Promise((m,a)=>setTimeout(()=>a(Error("timeout")),3000))]);if(t)return C=t,t}catch{}return C="cn","cn"}async function we(){try{let $=await fetch("http://ip-api.com/json/?fields=countryCode",{signal:AbortSignal.timeout(2000)});if(!$.ok)return null;return(await $.json()).countryCode==="CN"?"cn":"global"}catch{return null}}async function ye(){try{let $=await fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(2000)});if(!$.ok)return null;return(await $.json()).country==="CN"?"cn":"global"}catch{return null}}async function Se(){try{let $=await fetch("https://api.ip.sb/geoip",{signal:AbortSignal.timeout(2000)});if(!$.ok)return null;return(await $.json()).country_code==="CN"?"cn":"global"}catch{return null}}async function fe(){let $=await gr();return dr[$]}async function V(){return(await fe()).npm}async function t$(){if(await gr()==="cn")return`curl -fsSL https://bun.sh/install | BUN_INSTALL_MIRROR="${dr.cn.bunMirror}" bash`;return"curl -fsSL https://bun.sh/install | bash"}async function m$(){let $=await gr(),e=dr[$];if($==="cn")l.info("\u68C0\u6D4B\u5230\u4E2D\u56FD\u5927\u9646\u7F51\u7EDC\uFF0C\u4F7F\u7528\u56FD\u5185\u955C\u50CF\u6E90"),l.message(` npm: ${e.npm}`);else l.info("\u4F7F\u7528\u56FD\u9645\u6E90")}var Z=null;function Me($){return $.startsWith(J)}async function i$(){try{if(!await Bun.file(S).exists())return!1;let e=Bun.spawn([S,"--version"],{stdout:"pipe",stderr:"pipe"});return await e.exited,e.exitCode===0}catch{return!1}}async function qe(){try{let e=Bun.spawn(["which","unzip"],{stdout:"pipe",stderr:"pipe"});if(await e.exited,e.exitCode===0)return!0}catch{}l.warn("\u6B63\u5728\u5B89\u88C5\u7CFB\u7EDF\u4F9D\u8D56 (unzip)...");let $=["apt-get update -qq && apt-get install -y -qq unzip","yum install -y -q unzip","dnf install -y -q unzip","pacman -S --noconfirm unzip","apk add --quiet unzip"];for(let e of $)try{let t=Bun.spawn(["bash","-c",`sudo ${e} 2>/dev/null || ${e}`],{stdout:"pipe",stderr:"pipe"});if(await t.exited,t.exitCode===0)return!0}catch{}return!1}async function We(){let $=Y();if(!await qe())return l.error("\u8BF7\u5148\u624B\u52A8\u5B89\u88C5 unzip: apt install unzip / yum install unzip"),!1;await m$(),$.start("\u6B63\u5728\u5B89\u88C5 Tako \u4E13\u5C5E Bun \u8FD0\u884C\u65F6...");try{await(await import("fs/promises")).mkdir(J,{recursive:!0});let t=await t$(),m=`BUN_INSTALL="${J}" ${t}`;if(await Bun.spawn(["bash","-c",m],{stdout:"inherit",stderr:"inherit"}).exited!==0)return $.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1;return Z=S,$.stop("Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5B8C\u6210"),l.info(`\u5B89\u88C5\u4F4D\u7F6E: ${J}`),!0}catch(e){return $.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1}}async function Ge(){if(await i$())return Z=S,!0;return l.warn("\u672A\u68C0\u6D4B\u5230 Tako \u4E13\u5C5E Bun\uFF0C\u6B63\u5728\u81EA\u52A8\u5B89\u88C5..."),l.info("\uFF08\u4E0D\u4F1A\u5F71\u54CD\u60A8\u7CFB\u7EDF\u4E2D\u5DF2\u5B89\u88C5\u7684 Node.js \u6216 Bun\uFF09"),await We()}async function vr(){if(Z){if(!Me(Z))Z=S;return Z}if(await i$())return Z=S,S;return S}async function o$($){try{let e=await V(),t=await fetch(`${e}/${$}/latest`);if(!t.ok)return null;return(await t.json()).version}catch{return null}}async function Ze($){return(await G()).installedClients[$.id]?.version||null}async function c$($){let e=T($.id),t=s$(e,"package.json");try{return await Bun.file(t).exists()}catch{return!1}}async function h$($){let e=await Ze($);if(!e)return!0;let t=await o$($.package);if(!t)return!1;return e!==t}async function a$($,e=!1){let t=Y(),m=T($.id);try{if(!await Ge())return{success:!1,error:"Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u624B\u52A8\u5220\u9664 ~/.tako/bun \u76EE\u5F55\u540E\u91CD\u8BD5"};let a=await c$($),s=e||await h$($);if(a&&!s)return{success:!0};let r=a?"\u66F4\u65B0":"\u5B89\u88C5";t.start(`\u6B63\u5728${r} ${$.name}...`),await(await import("fs/promises")).mkdir(m,{recursive:!0});let n=s$(m,"package.json");if(!await Bun.file(n).exists())await Bun.write(n,JSON.stringify({name:`tako-${$.id}`,private:!0,dependencies:{}},null,2));let d=await vr(),h=await V(),v=Bun.spawn([d,"add",$.package,"--registry",h],{cwd:m,stdout:"pipe",stderr:"pipe"});if(await v.exited!==0){let B=await new Response(v.stderr).text();return t.stop(`${r} ${$.name} \u5931\u8D25`),{success:!1,error:B}}let X=await o$($.package);if(X){let B=await G();B.installedClients[$.id]={version:X,installedAt:new Date().toISOString()},await E(B)}return t.stop(`${$.name} ${r}\u5B8C\u6210`),{success:!0}}catch(a){return t.stop("\u64CD\u4F5C\u5931\u8D25"),{success:!1,error:a instanceof Error?a.message:"\u672A\u77E5\u9519\u8BEF"}}}async function n$($){if(!await c$($))return await a$($);if(await h$($))return await a$($,!0);return{success:!0}}async function b$($){try{let e=await n$($);if(!e.success)return e;let t=await Mr();if(!t)return{success:!1,error:"\u672A\u914D\u7F6E API Key"};if($.setupConfigFiles)await $.setupConfigFiles(t);let m=Zr($);if(!await Bun.file(m).exists())return{success:!1,error:`\u627E\u4E0D\u5230\u53EF\u6267\u884C\u6587\u4EF6: ${m}`};let s=$.getEnvVars(t),r={...process.env,...s};l.info(`\u542F\u52A8 ${$.name}...`);let o;if($.runtime==="bun")o=[await vr(),m];else o=[m];return await Bun.spawn(o,{env:r,stdio:["inherit","inherit","inherit"],cwd:process.cwd()}).exited,{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:"\u542F\u52A8\u5931\u8D25"}}}async function l$(){try{let $=await qr();if(!$)return{success:!1,error:"\u672A\u627E\u5230 API ID\uFF0C\u8BF7\u91CD\u65B0\u914D\u7F6E Key"};let t=await(await fetch(`${f}/apiStats/api/user-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:$})})).json(),a=await(await fetch(`${f}/apiStats/api/user-model-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:$,period:"daily"})})).json();if(!t.success)return{success:!1,error:t.error||"\u83B7\u53D6\u7EDF\u8BA1\u5931\u8D25"};return{success:!0,data:{todayCalls:t.data?.todayCalls||0,monthCalls:t.data?.monthCalls||0,modelStats:a.data?.models||[]}}}catch($){return{success:!1,error:$ instanceof Error?$.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}function N($){return $.toLocaleString("en-US")}var ze="1.0.0";function Je(){console.log(),console.log(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log(` \u2551 Tako CLI v${ze} \u2551`),console.log(" \u2551 \u4E2D\u8F6C\u7AD9\u5BA2\u6237\u7AEF\u7BA1\u7406\u5DE5\u5177 \u2551"),console.log(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log()}async function d$(){l.warn("\u672A\u68C0\u6D4B\u5230 API Key"),console.log();let $=await br({message:"\u8BF7\u8F93\u5165\u4F60\u7684 API Key (cr_xxx):",placeholder:"cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",validate(m){if(!m)return"\u8BF7\u8F93\u5165 API Key";if(!m.startsWith("cr_"))return"Key \u5FC5\u987B\u4EE5 cr_ \u5F00\u5934";if(m.length<10)return"Key \u683C\u5F0F\u4E0D\u6B63\u786E"}});if(L($))return!1;let e=Y();e.start("\u9A8C\u8BC1 Key \u4E2D...");let t=await e$($);if(t.success)return e.stop("Key \u9A8C\u8BC1\u6210\u529F\uFF01\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6"),!0;else return e.stop(`\u9A8C\u8BC1\u5931\u8D25: ${t.error}`),!1}async function Qe(){let $=Y();$.start("\u83B7\u53D6\u7528\u91CF\u7EDF\u8BA1...");let e=await l$();if(!e.success){$.stop(`\u83B7\u53D6\u5931\u8D25: ${e.error}`);return}if($.stop("\u7528\u91CF\u7EDF\u8BA1"),console.log(),console.log(" \uD83D\uDCCA \u7528\u91CF\u7EDF\u8BA1"),console.log(),console.log(` \u4ECA\u65E5\u8C03\u7528: ${N(e.data.todayCalls)} \u6B21`),console.log(` \u672C\u6708\u8C03\u7528: ${N(e.data.monthCalls)} \u6B21`),e.data.modelStats.length>0)console.log(),console.log(" \u6A21\u578B\u4F7F\u7528\u5206\u5E03 (\u4ECA\u65E5):"),e.data.modelStats.forEach((t,m)=>{let a=m===e.data.modelStats.length-1?"\u2514\u2500":"\u251C\u2500";console.log(` ${a} ${t.model.padEnd(20)} : ${N(t.calls)} \u6B21`)});console.log(),await br({message:"\u6309\u56DE\u8F66\u952E\u8FD4\u56DE...",placeholder:"",defaultValue:""})}async function Ye(){let e=[...Jr().map((m)=>({value:{type:"launch",client:m},label:`\u542F\u52A8 ${m.name}`,hint:m.package})),{value:{type:"stats"},label:"\u67E5\u770B\u7528\u91CF\u7EDF\u8BA1"},{value:{type:"config"},label:"\u914D\u7F6E API Key"},{value:{type:"exit"},label:"\u9000\u51FA"}],t=await $$({message:"\u8BF7\u9009\u62E9\u64CD\u4F5C:",options:e});if(L(t))return null;return t}async function je($){switch($.type){case"launch":let e=await b$($.client);if(!e.success)l.error(e.error||"\u542F\u52A8\u5931\u8D25");return!0;case"stats":return await Qe(),!0;case"config":return await d$(),!0;case"exit":return!1}}async function g$(){if(Je(),!await fr()){if(!await d$()){lr("\u518D\u89C1\uFF01");return}}while(!0){let e=await Ye();if(e===null)break;if(!await je(e))break}lr("\u518D\u89C1\uFF01")}var He="tako-cli",_="0.1.1";function Le($,e){let t=$.split(".").map(Number),m=e.split(".").map(Number);for(let a=0;a<3;a++){let s=t[a]||0,r=m[a]||0;if(s>r)return 1;if(s<r)return-1}return 0}async function Ve(){try{let $=await V(),e=await fetch(`${$}/${He}/latest`,{signal:AbortSignal.timeout(5000)});if(!e.ok)return null;return(await e.json()).version||null}catch{return null}}async function Xe(){let $=await Ve();if(!$)return{hasUpdate:!1,currentVersion:_};return{hasUpdate:Le($,_)>0,latestVersion:$,currentVersion:_}}async function v$(){try{let $=await Xe();if($.hasUpdate&&$.latestVersion)l.warn(`\u53D1\u73B0\u65B0\u7248\u672C Tako v${$.latestVersion}\uFF08\u5F53\u524D v${_}\uFF09`),l.info("\u8BF7\u91CD\u65B0\u8FD0\u884C\u5B89\u88C5\u811A\u672C\u66F4\u65B0: curl -fsSL https://tako.shiroha.tech/install.sh | bash")}catch{}}async function Be(){await v$(),await g$()}Be().catch(($)=>{console.error("Tako CLI \u53D1\u751F\u9519\u8BEF:",$),process.exit(1)});
package/install.sh ADDED
@@ -0,0 +1,190 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Tako CLI 一键安装脚本
5
+ # 用法: curl -fsSL https://cdn.jsdelivr.net/npm/tako-cli/install.sh | bash
6
+
7
+ TAKO_DIR="$HOME/.tako"
8
+ TAKO_BUN_DIR="$TAKO_DIR/bun"
9
+ INSTALL_DIR="/usr/local/bin"
10
+
11
+ # 颜色
12
+ RED='\033[0;31m'
13
+ GREEN='\033[0;32m'
14
+ YELLOW='\033[1;33m'
15
+ CYAN='\033[0;36m'
16
+ NC='\033[0m' # No Color
17
+
18
+ REGION=""
19
+
20
+ info() {
21
+ echo -e "${GREEN}[INFO]${NC} $1"
22
+ }
23
+
24
+ warn() {
25
+ echo -e "${YELLOW}[WARN]${NC} $1"
26
+ }
27
+
28
+ error() {
29
+ echo -e "${RED}[ERROR]${NC} $1"
30
+ exit 1
31
+ }
32
+
33
+ # 检测用户所在地区
34
+ detect_region() {
35
+ info "检测网络环境..."
36
+
37
+ local country=""
38
+ country=$(curl -s --connect-timeout 2 "http://ip-api.com/line/?fields=countryCode" 2>/dev/null || echo "")
39
+
40
+ if [ -z "$country" ]; then
41
+ country=$(curl -s --connect-timeout 2 "https://ipinfo.io/country" 2>/dev/null || echo "")
42
+ fi
43
+
44
+ if [ "$country" = "CN" ]; then
45
+ REGION="cn"
46
+ info "检测到中国大陆网络,使用国内镜像"
47
+ else
48
+ REGION="global"
49
+ info "使用国际源"
50
+ fi
51
+ }
52
+
53
+ # 安装系统依赖
54
+ install_dependencies() {
55
+ local deps_needed=""
56
+
57
+ command -v curl &> /dev/null || deps_needed="$deps_needed curl"
58
+ command -v unzip &> /dev/null || deps_needed="$deps_needed unzip"
59
+
60
+ if [ -z "$deps_needed" ]; then
61
+ return 0
62
+ fi
63
+
64
+ info "安装系统依赖:$deps_needed"
65
+
66
+ # 检测是否需要 sudo
67
+ if [ -w "/usr" ] 2>/dev/null; then
68
+ SUDO=""
69
+ else
70
+ SUDO="sudo"
71
+ fi
72
+
73
+ if command -v apt-get &> /dev/null; then
74
+ $SUDO apt-get update -qq
75
+ $SUDO apt-get install -y -qq $deps_needed
76
+ elif command -v yum &> /dev/null; then
77
+ $SUDO yum install -y -q $deps_needed
78
+ elif command -v dnf &> /dev/null; then
79
+ $SUDO dnf install -y -q $deps_needed
80
+ elif command -v pacman &> /dev/null; then
81
+ $SUDO pacman -S --noconfirm $deps_needed
82
+ elif command -v apk &> /dev/null; then
83
+ $SUDO apk add --quiet $deps_needed
84
+ else
85
+ error "无法自动安装依赖,请手动安装: $deps_needed"
86
+ fi
87
+ }
88
+
89
+ # 安装 Tako 专属 Bun
90
+ install_bun() {
91
+ # 检查是否已安装
92
+ if [ -x "$TAKO_BUN_DIR/bin/bun" ]; then
93
+ info "Tako 专属 Bun 已安装"
94
+ return 0
95
+ fi
96
+
97
+ info "安装 Tako 专属 Bun 运行时..."
98
+ info "(不会影响您系统中已安装的 Node.js 或 Bun)"
99
+
100
+ mkdir -p "$TAKO_BUN_DIR"
101
+
102
+ local install_cmd="curl -fsSL https://bun.sh/install | BUN_INSTALL=\"$TAKO_BUN_DIR\" bash"
103
+
104
+ # 国内用户使用镜像
105
+ if [ "$REGION" = "cn" ]; then
106
+ install_cmd="curl -fsSL https://bun.sh/install | BUN_INSTALL=\"$TAKO_BUN_DIR\" BUN_INSTALL_MIRROR=\"https://registry.npmmirror.com/-/binary/bun\" bash"
107
+ fi
108
+
109
+ eval "$install_cmd"
110
+
111
+ if [ ! -x "$TAKO_BUN_DIR/bin/bun" ]; then
112
+ error "Bun 安装失败"
113
+ fi
114
+
115
+ info "Tako 专属 Bun 安装完成: $TAKO_BUN_DIR"
116
+ }
117
+
118
+ # 安装 Tako CLI
119
+ install_tako() {
120
+ info "安装 Tako CLI..."
121
+
122
+ local bun="$TAKO_BUN_DIR/bin/bun"
123
+ local registry="https://registry.npmjs.org"
124
+
125
+ if [ "$REGION" = "cn" ]; then
126
+ registry="https://registry.npmmirror.com"
127
+ fi
128
+
129
+ # 使用 Tako 专属 Bun 全局安装 tako-cli
130
+ "$bun" add -g tako-cli --registry "$registry"
131
+
132
+ info "Tako CLI 安装完成"
133
+ }
134
+
135
+ # 创建全局命令
136
+ create_command() {
137
+ info "配置 tako 命令..."
138
+
139
+ # 检测是否需要 sudo
140
+ if [ -w "$INSTALL_DIR" ] 2>/dev/null; then
141
+ SUDO=""
142
+ else
143
+ SUDO="sudo"
144
+ warn "需要 sudo 权限写入 $INSTALL_DIR"
145
+ fi
146
+
147
+ # 创建 wrapper 脚本
148
+ local wrapper="#!/bin/bash
149
+ exec \"$TAKO_BUN_DIR/bin/bun\" run tako-cli \"\$@\"
150
+ "
151
+
152
+ echo "$wrapper" | $SUDO tee "$INSTALL_DIR/tako" > /dev/null
153
+ $SUDO chmod +x "$INSTALL_DIR/tako"
154
+
155
+ info "tako 命令已创建: $INSTALL_DIR/tako"
156
+ }
157
+
158
+ # 验证安装
159
+ verify_installation() {
160
+ if command -v tako &> /dev/null; then
161
+ info "安装成功!"
162
+ echo ""
163
+ echo -e " ${CYAN}运行 'tako' 开始使用${NC}"
164
+ echo ""
165
+ else
166
+ warn "安装完成,但 tako 不在 PATH 中"
167
+ warn "请将 $INSTALL_DIR 添加到 PATH,或直接运行:"
168
+ echo " $TAKO_BUN_DIR/bin/bun run tako-cli"
169
+ fi
170
+ }
171
+
172
+ # 主流程
173
+ main() {
174
+ echo ""
175
+ echo " ╔════════════════════════════════════╗"
176
+ echo " ║ Tako CLI 安装程序 ║"
177
+ echo " ╚════════════════════════════════════╝"
178
+ echo ""
179
+
180
+ detect_region
181
+ install_dependencies
182
+ install_bun
183
+ install_tako
184
+ create_command
185
+ verify_installation
186
+
187
+ echo ""
188
+ }
189
+
190
+ main
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "tako-cli",
3
+ "version": "0.1.1",
4
+ "description": "Tako CLI - AI coding tools launcher",
5
+ "type": "module",
6
+ "bin": {
7
+ "tako": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "install.sh",
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "bun build src/index.ts --outfile dist/index.js --minify --target bun",
15
+ "prepublishOnly": "bun run build"
16
+ },
17
+ "devDependencies": {
18
+ "@clack/prompts": "^0.7.0",
19
+ "bun-types": "latest"
20
+ },
21
+ "keywords": ["cli", "ai", "claude", "codex"],
22
+ "license": "UNLICENSED"
23
+ }