@qitqode/qitqode-android-arm64 0.1.20 → 0.1.21
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/bundle/{chunk-xb031er5.js → chunk-0942095s.js} +1 -1
- package/bundle/{chunk-0x0a51w3.js → chunk-0czxqcg7.js} +1 -1
- package/bundle/{chunk-9a5nck3f.js → chunk-1b9ey3yh.js} +1 -1
- package/bundle/{chunk-gspdrdyq.js → chunk-21q96fet.js} +1 -1
- package/bundle/{chunk-wnjg8mmh.js → chunk-21t254fq.js} +1 -1
- package/bundle/{chunk-zfvk6zjj.js → chunk-2db8pn5k.js} +1 -1
- package/bundle/{chunk-r2waj5n2.js → chunk-3gxhdy0c.js} +1 -1
- package/bundle/{chunk-471yj527.js → chunk-3m0t96kb.js} +1 -1
- package/bundle/{chunk-dp3hqm2m.js → chunk-4tk4wppp.js} +1 -1
- package/bundle/{chunk-p77m937s.js → chunk-5k1eyz7y.js} +1 -1
- package/bundle/{chunk-c4mxtqyq.js → chunk-5rcnwm9j.js} +1 -1
- package/bundle/{chunk-k728fzrr.js → chunk-5yghd32r.js} +1 -1
- package/bundle/{chunk-q39h31te.js → chunk-651fyxmn.js} +3 -3
- package/bundle/{chunk-7myavy3p.js → chunk-6ba9fc92.js} +1 -1
- package/bundle/{chunk-w0fg8n1f.js → chunk-6dznrhs4.js} +1 -1
- package/bundle/{chunk-knwayz0m.js → chunk-6t70j1wg.js} +1 -1
- package/bundle/{chunk-3makpbng.js → chunk-767vf2ha.js} +1 -1
- package/bundle/{chunk-k6z419yx.js → chunk-76p9v2jf.js} +1 -1
- package/bundle/{chunk-1brsnwhv.js → chunk-7hxksr4h.js} +1 -1
- package/bundle/{chunk-2w154wad.js → chunk-7jefvta3.js} +1 -1
- package/bundle/{chunk-fegrrsfj.js → chunk-7skp0dmg.js} +1 -1
- package/bundle/{chunk-1qw3yh13.js → chunk-88ckmmdr.js} +3 -3
- package/bundle/{chunk-0pbpzty2.js → chunk-8fn883z8.js} +1 -1
- package/bundle/{chunk-c422awkv.js → chunk-9gfe4wtk.js} +1 -1
- package/bundle/{chunk-rdsae6k4.js → chunk-9hwsz356.js} +1 -1
- package/bundle/{chunk-3fzgbam3.js → chunk-9vvvyk10.js} +1 -1
- package/bundle/{chunk-n0y1ea17.js → chunk-atg7cn5r.js} +1 -1
- package/bundle/{chunk-qq48ffjc.js → chunk-b3721b7c.js} +1 -1
- package/bundle/{chunk-nt07vncv.js → chunk-b4r19v4g.js} +1 -1
- package/bundle/{chunk-b2ky15zx.js → chunk-bsg92mw7.js} +1 -1
- package/bundle/{chunk-skjge2wh.js → chunk-bzj7yxw6.js} +1 -1
- package/bundle/{chunk-1gj0m10e.js → chunk-c1dwcsax.js} +1 -1
- package/bundle/{chunk-ysxmk1z1.js → chunk-c4vfxy1e.js} +1 -1
- package/bundle/{chunk-v7yvnnmr.js → chunk-esjs9s9g.js} +1 -1
- package/bundle/chunk-f2q7cbah.js +2 -0
- package/bundle/{chunk-mpn5qm9j.js → chunk-fssswy6j.js} +1 -1
- package/bundle/{chunk-4pedvzse.js → chunk-ghtm9598.js} +1 -1
- package/bundle/{chunk-p41h8naw.js → chunk-gkz68a5s.js} +1 -1
- package/bundle/{chunk-gfm4vad7.js → chunk-gp6nvjb8.js} +153 -153
- package/bundle/{chunk-6tjghyx6.js → chunk-hkydp4m3.js} +1 -1
- package/bundle/{chunk-hjvje9xj.js → chunk-htdpkk8v.js} +1 -1
- package/bundle/{chunk-ghmctw8s.js → chunk-hvnhkrd3.js} +1 -1
- package/bundle/{chunk-fgqrcjsm.js → chunk-hvqgvsa5.js} +1 -1
- package/bundle/{chunk-dgbvsnqb.js → chunk-js7becx7.js} +1 -1
- package/bundle/{chunk-5549c7mb.js → chunk-jwgqpntf.js} +1 -1
- package/bundle/{chunk-7nas10jx.js → chunk-k44dj66f.js} +1 -1
- package/bundle/{chunk-9g4hz1st.js → chunk-kvs7qbga.js} +1 -1
- package/bundle/{chunk-1q2vhe78.js → chunk-m7q12naw.js} +1 -1
- package/bundle/{chunk-pskkmca2.js → chunk-mc1m6dxk.js} +1 -1
- package/bundle/{chunk-anse7bd0.js → chunk-myjbd0vk.js} +1 -1
- package/bundle/{chunk-b49rxw15.js → chunk-n499tbz0.js} +1 -1
- package/bundle/{chunk-y36ggefa.js → chunk-n5k2c708.js} +1 -1
- package/bundle/{chunk-zafrxr1q.js → chunk-n6fh34xx.js} +1 -1
- package/bundle/{chunk-6bq7rx7m.js → chunk-n7a4wpjj.js} +1 -1
- package/bundle/{chunk-vh8w0ea8.js → chunk-ns0hezdf.js} +1 -1
- package/bundle/{chunk-pn77fh9b.js → chunk-q2zk0z41.js} +1 -1
- package/bundle/{chunk-s2g5989e.js → chunk-qh76pgsk.js} +1 -1
- package/bundle/{chunk-tp7sfreh.js → chunk-qxtz0tfd.js} +1 -1
- package/bundle/{chunk-3gdqmave.js → chunk-qy1s81tv.js} +2 -2
- package/bundle/{chunk-28knamc9.js → chunk-r03jc8xm.js} +1 -1
- package/bundle/{chunk-wmqcz5rb.js → chunk-rkb592nb.js} +1 -1
- package/bundle/{chunk-w8rvjbgr.js → chunk-s811ht10.js} +1 -1
- package/bundle/{chunk-8k1q3g8s.js → chunk-sj8py6vk.js} +1 -1
- package/bundle/{chunk-dvn528qs.js → chunk-t6dymkmx.js} +1 -1
- package/bundle/{chunk-jc0wbpjq.js → chunk-th5z0zx7.js} +1 -1
- package/bundle/chunk-tnn7hm4v.js +2 -0
- package/bundle/{chunk-aej69zjj.js → chunk-v0jnnpsz.js} +1 -1
- package/bundle/{chunk-f57rqsby.js → chunk-vdt8dvqs.js} +1 -1
- package/bundle/{chunk-0fwz5r1k.js → chunk-w2f8sjc4.js} +1 -1
- package/bundle/{chunk-rmmrnx95.js → chunk-w5nwkb0s.js} +1 -1
- package/bundle/{chunk-ckhhm2m8.js → chunk-w9mdrb90.js} +1 -1
- package/bundle/{chunk-xbxgrwvy.js → chunk-y7hkykkj.js} +1 -1
- package/bundle/{chunk-ej3gmaba.js → chunk-yja3y138.js} +1 -1
- package/bundle/{chunk-k5vwx1nv.js → chunk-yt6cfsdh.js} +1 -1
- package/bundle/index.js +3 -3
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-7pqevqry.js +0 -2
- package/bundle/chunk-p4pc1zdd.js +0 -2
package/bundle/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Gf as eD,Hf as d0}from"./chunk-djcsvcby.js";import{Jf as g0,Kf as l0,Of as y0,Pf as s0}from"./chunk-
|
|
2
|
+
import{Gf as eD,Hf as d0}from"./chunk-djcsvcby.js";import{Jf as g0,Kf as l0,Of as y0,Pf as s0}from"./chunk-hkydp4m3.js";import{Sf as Ku}from"./chunk-ntmn6epc.js";import{Cs as k0}from"./chunk-qh76pgsk.js";import{Ds as i0}from"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as zF,Is as hF,Ms as o0}from"./chunk-esjs9s9g.js";import{pt as GF}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import{lP as b2,mP as w2,pP as p}from"./chunk-fa03gsff.js";var eF=w2((Y3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as t2,strictEqual as n2}from"assert";var a0={right:u2,center:F2};class ZF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
|
|
3
3
|
`).map((E)=>E.split("\t")),F=0;return u.forEach((E)=>{if(E.length>1&&JD.stringWidth(E[0])>F)F=Math.min(Math.floor(this.width*0.5),JD.stringWidth(E[0]))}),u.forEach((E)=>{this.div(...E.map((C,f)=>{return{text:C.trim(),padding:this.measurePadding(C),width:f===0&&E.length>1?F:void 0}}))}),this.rows[this.rows.length-1]}colFromString(D){return{text:D,padding:this.measurePadding(D)}}measurePadding(D){let u=JD.stripAnsi(D);return[0,u.match(/\s*$/)[0].length,0,u.match(/^\s*/)[0].length]}toString(){let D=[];return this.rows.forEach((u)=>{this.rowToString(u,D)}),D.filter((u)=>!u.hidden).map((u)=>u.text).join(`
|
|
4
4
|
`)}rowToString(D,u){return this.rasterize(D).forEach((F,E)=>{let C="";F.forEach((f,h)=>{let{width:G}=D[h],J=this.negatePadding(D[h]),Y=f;if(J>JD.stringWidth(f))Y+=" ".repeat(J-JD.stringWidth(f));if(D[h].align&&D[h].align!=="left"&&this.wrap){let Q=a0[D[h].align];if(Y=Q(Y,J),JD.stringWidth(Y)<J)Y+=" ".repeat((G||0)-JD.stringWidth(Y)-1)}let U=D[h].padding||[0,0,0,0];if(U[3])C+=" ".repeat(U[3]);if(C+=XF(D[h],Y,"| "),C+=Y,C+=XF(D[h],Y," |"),U[1])C+=" ".repeat(U[1]);if(E===0&&u.length>0)C=this.renderInline(C,u[u.length-1])}),u.push({text:C.replace(/ +$/,""),span:D.span})}),u}renderInline(D,u){let F=D.match(/^ */),E=F?F[0].length:0,C=u.text,f=JD.stringWidth(C.trimRight());if(!u.span)return D;if(!this.wrap)return u.hidden=!0,C+D;if(E<f)return D;return u.hidden=!0,C.trimRight()+" ".repeat(E-f)+D.trimLeft()}rasterize(D){let u=[],F=this.columnWidths(D),E;return D.forEach((C,f)=>{if(C.width=F[f],this.wrap)E=JD.wrap(C.text,this.negatePadding(C),{hard:!0}).split(`
|
|
5
5
|
`);else E=C.text.split(`
|
|
@@ -77,5 +77,5 @@ ${W.join(`
|
|
|
77
77
|
`;X.forEach((W)=>{O+=W}),u.fail(O)}};let J={};f.conflicts=function(Q,X){if(q("<string|object> [array|string]",[Q,X],arguments.length),typeof Q==="object")Object.keys(Q).forEach((O)=>{f.conflicts(O,Q[O])});else{if(D.global(Q),!J[Q])J[Q]=[];if(Array.isArray(X))X.forEach((O)=>f.conflicts(Q,O));else J[Q].push(X)}},f.getConflicting=()=>J,f.conflicting=function(Q){if(Object.keys(Q).forEach((X)=>{if(J[X])J[X].forEach((O)=>{if(O&&Q[X]!==void 0&&Q[O]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",X,O))})}),D.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(J).forEach((X)=>{J[X].forEach((O)=>{if(O&&Q[F.Parser.camelCase(X)]!==void 0&&Q[F.Parser.camelCase(O)]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",X,O))})})},f.recommendCommands=function(Q,X){X=X.sort((A,v)=>v.length-A.length);let W=null,Z=1/0;for(let A=0,v;(v=X[A])!==void 0;A++){let n=O0(Q,v);if(n<=3&&n<Z)Z=n,W=v}if(W)u.fail(E("Did you mean %s?",W))},f.reset=function(Q){return h=xD(h,(X)=>!Q[X]),J=xD(J,(X)=>!Q[X]),f};let Y=[];return f.freeze=function(){Y.push({implied:h,conflicting:J})},f.unfreeze=function(){let Q=Y.pop();XD(Q,void 0,F),{implied:h,conflicting:J}=Q},f}var yu=[],hu;function $u(D,u,F,E){hu=E;let C={};if(Object.prototype.hasOwnProperty.call(D,"extends")){if(typeof D.extends!=="string")return C;let f=/\.json|\..*rc$/.test(D.extends),h=null;if(!f)try{h=import.meta.resolve(D.extends)}catch(G){return D}else h=h8(u,D.extends);f8(h),yu.push(h),C=f?JSON.parse(hu.readFileSync(h,"utf8")):E.require(D.extends),delete D.extends,C=$u(C,hu.path.dirname(h),F,hu)}return yu=[],F?W0(C,D):Object.assign({},C,D)}function f8(D){if(yu.indexOf(D)>-1)throw new DD(`Circular extended configurations: '${D}'.`)}function h8(D,u){return hu.path.resolve(D,u)}function W0(D,u){let F={};function E(C){return C&&typeof C==="object"&&!Array.isArray(C)}Object.assign(F,D);for(let C of Object.keys(u))if(E(u[C])&&E(F[C]))F[C]=W0(D[C],u[C]);else F[C]=u[C];return F}var H=function(D,u,F,E,C){if(E==="m")throw TypeError("Private method is not writable");if(E==="a"&&!C)throw TypeError("Private accessor was defined without a setter");if(typeof u==="function"?D!==u||!C:!u.has(D))throw TypeError("Cannot write private member to an object whose class did not declare it");return E==="a"?C.call(D,F):C?C.value=F:u.set(D,F),F},B=function(D,u,F,E){if(F==="a"&&!E)throw TypeError("Private accessor was defined without a getter");if(typeof u==="function"?D!==u||!E:!u.has(D))throw TypeError("Cannot read private member from an object whose class did not declare it");return F==="m"?E:F==="a"?E.call(D):E?E.value:u.get(D)},uD,vD,zu,ZD,QD,Wu,wD,mD,Uu,WD,Nu,UD,HD,OD,ND,Ru,iD,$D,K,ju,qu,TD,dD,Fu,oD,bD,Hu,P,kD,gD,lD,b,Iu,ID,r;function c0(D){return(u=[],F=D.process.cwd(),E)=>{let C=new p0(u,F,E,D);return Object.defineProperty(C,"argv",{get:()=>{return C.parse()},enumerable:!0}),C.help(),C.version(),C}}var U0=Symbol("copyDoubleDash"),N0=Symbol("copyDoubleDash"),su=Symbol("deleteFromParserHintObject"),R0=Symbol("emitWarning"),j0=Symbol("freeze"),q0=Symbol("getDollarZero"),yD=Symbol("getParserConfiguration"),H0=Symbol("getUsageConfiguration"),ru=Symbol("guessLocale"),I0=Symbol("guessVersion"),V0=Symbol("parsePositionalNumbers"),au=Symbol("pkgUp"),tD=Symbol("populateParserHintArray"),Eu=Symbol("populateParserHintSingleValueDictionary"),eu=Symbol("populateParserHintArrayDictionary"),DF=Symbol("populateParserHintDictionary"),uF=Symbol("sanitizeKey"),FF=Symbol("setKey"),EF=Symbol("unfreeze"),_0=Symbol("validateAsync"),K0=Symbol("getCommandInstance"),L0=Symbol("getContext"),A0=Symbol("getHasOutput"),S0=Symbol("getLoggerInstance"),x0=Symbol("getParseContext"),P0=Symbol("getUsageInstance"),w0=Symbol("getValidationInstance"),Vu=Symbol("hasParseCallback"),b0=Symbol("isGlobalContext"),sD=Symbol("postProcess"),t0=Symbol("rebase"),CF=Symbol("reset"),Gu=Symbol("runYargsParserAndExecuteCommands"),BF=Symbol("runValidation"),n0=Symbol("setHasOutput"),rD=Symbol("kTrackManuallySetKeys"),$8="en_US";class p0{constructor(D=[],u,F,E){this.customScriptName=!1,this.parsed=!1,uD.set(this,void 0),vD.set(this,void 0),zu.set(this,{commands:[],fullCommands:[]}),ZD.set(this,null),QD.set(this,null),Wu.set(this,"show-hidden"),wD.set(this,null),mD.set(this,!0),Uu.set(this,{}),WD.set(this,!0),Nu.set(this,[]),UD.set(this,void 0),HD.set(this,{}),OD.set(this,!1),ND.set(this,null),Ru.set(this,!0),iD.set(this,void 0),$D.set(this,""),K.set(this,void 0),ju.set(this,void 0),qu.set(this,{}),TD.set(this,null),dD.set(this,null),Fu.set(this,{}),oD.set(this,{}),bD.set(this,void 0),Hu.set(this,!1),P.set(this,void 0),kD.set(this,!1),gD.set(this,!1),lD.set(this,!1),b.set(this,void 0),Iu.set(this,{}),ID.set(this,null),r.set(this,void 0),H(this,P,E,"f"),H(this,bD,D,"f"),H(this,vD,u,"f"),H(this,ju,F,"f"),H(this,UD,new gu(this),"f"),this.$0=this[q0](),this[CF](),H(this,uD,B(this,uD,"f"),"f"),H(this,b,B(this,b,"f"),"f"),H(this,r,B(this,r,"f"),"f"),H(this,K,B(this,K,"f"),"f"),B(this,K,"f").showHiddenOpt=B(this,Wu,"f"),H(this,iD,this[N0](),"f"),B(this,P,"f").y18n.setLocale($8)}addHelpOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),B(this,ND,"f"))this[su](B(this,ND,"f")),H(this,ND,null,"f");if(D===!1&&u===void 0)return this;return H(this,ND,typeof D==="string"?D:"help","f"),this.boolean(B(this,ND,"f")),this.describe(B(this,ND,"f"),u||B(this,b,"f").deferY18nLookup("Show help")),this}help(D,u){return this.addHelpOpt(D,u)}addShowHiddenOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),D===!1&&u===void 0)return this;let F=typeof D==="string"?D:B(this,Wu,"f");return this.boolean(F),this.describe(F,u||B(this,b,"f").deferY18nLookup("Show hidden options")),B(this,K,"f").showHiddenOpt=F,this}showHidden(D,u){return this.addShowHiddenOpt(D,u)}alias(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[eu](this.alias.bind(this),"alias",D,u),this}array(D){return q("<array|string>",[D],arguments.length),this[tD]("array",D),this[rD](D),this}boolean(D){return q("<array|string>",[D],arguments.length),this[tD]("boolean",D),this[rD](D),this}check(D,u){return q("<function> [boolean]",[D,u],arguments.length),this.middleware((F,E)=>{return pD(()=>{return D(F,E.getOptions())},(C)=>{if(!C)B(this,b,"f").fail(B(this,P,"f").y18n.__("Argument check failed: %s",D.toString()));else if(typeof C==="string"||C instanceof Error)B(this,b,"f").fail(C.toString(),C);return F},(C)=>{return B(this,b,"f").fail(C.message?C.message:C.toString(),C),F})},!1,u),this}choices(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[eu](this.choices.bind(this),"choices",D,u),this}coerce(D,u){if(q("<object|string|array> [function]",[D,u],arguments.length),Array.isArray(D)){if(!u)throw new DD("coerce callback must be provided");for(let E of D)this.coerce(E,u);return this}else if(typeof D==="object"){for(let E of Object.keys(D))this.coerce(E,D[E]);return this}if(!u)throw new DD("coerce callback must be provided");let F=D;return B(this,K,"f").key[F]=!0,B(this,UD,"f").addCoerceMiddleware((E,C)=>{var f;let h=(f=C.getAliases()[F])!==null&&f!==void 0?f:[],G=[F,...h].filter((J)=>Object.prototype.hasOwnProperty.call(E,J));if(G.length===0)return E;return pD(()=>{return u(E[G[0]])},(J)=>{return G.forEach((Y)=>{E[Y]=J}),E},(J)=>{throw new DD(J.message)})},F),this}conflicts(D,u){return q("<string|object> [string|array]",[D,u],arguments.length),B(this,r,"f").conflicts(D,u),this}config(D="config",u,F){if(q("[object|string] [string|function] [function]",[D,u,F],arguments.length),typeof D==="object"&&!Array.isArray(D))return D=$u(D,B(this,vD,"f"),this[yD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(D),this;if(typeof u==="function")F=u,u=void 0;return this.describe(D,u||B(this,b,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(D)?D:[D]).forEach((E)=>{B(this,K,"f").config[E]=F||!0}),this}completion(D,u,F){if(q("[string] [string|boolean|function] [function]",[D,u,F],arguments.length),typeof u==="function")F=u,u=void 0;if(H(this,QD,D||B(this,QD,"f")||"completion","f"),!u&&u!==!1)u="generate completion script";if(this.command(B(this,QD,"f"),u),F)B(this,ZD,"f").registerFunction(F);return this}command(D,u,F,E,C,f){return q("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[D,u,F,E,C,f],arguments.length),B(this,uD,"f").addHandler(D,u,F,E,C,f),this}commands(D,u,F,E,C,f){return this.command(D,u,F,E,C,f)}commandDir(D,u){q("<string> [object]",[D,u],arguments.length);let F=B(this,ju,"f")||B(this,P,"f").require;return B(this,uD,"f").addDirectory(D,F,B(this,P,"f").getCallerFile(),u),this}count(D){return q("<array|string>",[D],arguments.length),this[tD]("count",D),this[rD](D),this}default(D,u,F){if(q("<object|string|array> [*] [string]",[D,u,F],arguments.length),F)ku(D,B(this,P,"f")),B(this,K,"f").defaultDescription[D]=F;if(typeof u==="function"){if(ku(D,B(this,P,"f")),!B(this,K,"f").defaultDescription[D])B(this,K,"f").defaultDescription[D]=B(this,b,"f").functionDescription(u);u=u.call()}return this[Eu](this.default.bind(this),"default",D,u),this}defaults(D,u,F){return this.default(D,u,F)}demandCommand(D=1,u,F,E){if(q("[number] [number|string] [string|null|undefined] [string|null|undefined]",[D,u,F,E],arguments.length),typeof u!=="number")F=u,u=1/0;return this.global("_",!1),B(this,K,"f").demandedCommands._={min:D,max:u,minMsg:F,maxMsg:E},this}demand(D,u,F){if(Array.isArray(u))u.forEach((E)=>{XD(F,!0,B(this,P,"f")),this.demandOption(E,F)}),u=1/0;else if(typeof u!=="number")F=u,u=1/0;if(typeof D==="number")XD(F,!0,B(this,P,"f")),this.demandCommand(D,u,F,F);else if(Array.isArray(D))D.forEach((E)=>{XD(F,!0,B(this,P,"f")),this.demandOption(E,F)});else if(typeof F==="string")this.demandOption(D,F);else if(F===!0||typeof F>"u")this.demandOption(D);return this}demandOption(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[Eu](this.demandOption.bind(this),"demandedOptions",D,u),this}deprecateOption(D,u){return q("<string> [string|boolean]",[D,u],arguments.length),B(this,K,"f").deprecatedOptions[D]=u,this}describe(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[FF](D,!0),B(this,b,"f").describe(D,u),this}detectLocale(D){return q("<boolean>",[D],arguments.length),H(this,mD,D,"f"),this}env(D){if(q("[string|boolean]",[D],arguments.length),D===!1)delete B(this,K,"f").envPrefix;else B(this,K,"f").envPrefix=D||"";return this}epilogue(D){return q("<string>",[D],arguments.length),B(this,b,"f").epilog(D),this}epilog(D){return this.epilogue(D)}example(D,u){if(q("<string|array> [string]",[D,u],arguments.length),Array.isArray(D))D.forEach((F)=>this.example(...F));else B(this,b,"f").example(D,u);return this}exit(D,u){if(H(this,OD,!0,"f"),H(this,wD,u,"f"),B(this,WD,"f"))B(this,P,"f").process.exit(D)}exitProcess(D=!0){return q("[boolean]",[D],arguments.length),H(this,WD,D,"f"),this}fail(D){if(q("<function|boolean>",[D],arguments.length),typeof D==="boolean"&&D!==!1)throw new DD("Invalid first argument. Expected function or boolean 'false'");return B(this,b,"f").failFn(D),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(D,u){if(q("<array> [function]",[D,u],arguments.length),!u)return new Promise((F,E)=>{B(this,ZD,"f").getCompletion(D,(C,f)=>{if(C)E(C);else F(f)})});else return B(this,ZD,"f").getCompletion(D,u)}getDemandedOptions(){return q([],0),B(this,K,"f").demandedOptions}getDemandedCommands(){return q([],0),B(this,K,"f").demandedCommands}getDeprecatedOptions(){return q([],0),B(this,K,"f").deprecatedOptions}getDetectLocale(){return B(this,mD,"f")}getExitProcess(){return B(this,WD,"f")}getGroups(){return Object.assign({},B(this,HD,"f"),B(this,oD,"f"))}getHelp(){if(H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let u=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(l(u))return u.then(()=>{return B(this,b,"f").help()})}let D=B(this,uD,"f").runDefaultBuilderOn(this);if(l(D))return D.then(()=>{return B(this,b,"f").help()})}return Promise.resolve(B(this,b,"f").help())}getOptions(){return B(this,K,"f")}getStrict(){return B(this,kD,"f")}getStrictCommands(){return B(this,gD,"f")}getStrictOptions(){return B(this,lD,"f")}global(D,u){if(q("<string|array> [boolean]",[D,u],arguments.length),D=[].concat(D),u!==!1)B(this,K,"f").local=B(this,K,"f").local.filter((F)=>D.indexOf(F)===-1);else D.forEach((F)=>{if(!B(this,K,"f").local.includes(F))B(this,K,"f").local.push(F)});return this}group(D,u){q("<string|array> <string>",[D,u],arguments.length);let F=B(this,oD,"f")[u]||B(this,HD,"f")[u];if(B(this,oD,"f")[u])delete B(this,oD,"f")[u];let E={};return B(this,HD,"f")[u]=(F||[]).concat(D).filter((C)=>{if(E[C])return!1;return E[C]=!0}),this}hide(D){return q("<string>",[D],arguments.length),B(this,K,"f").hiddenOptions.push(D),this}implies(D,u){return q("<string|object> [number|string|array]",[D,u],arguments.length),B(this,r,"f").implies(D,u),this}locale(D){if(q("[string]",[D],arguments.length),D===void 0)return this[ru](),B(this,P,"f").y18n.getLocale();return H(this,mD,!1,"f"),B(this,P,"f").y18n.setLocale(D),this}middleware(D,u,F){return B(this,UD,"f").addMiddleware(D,!!u,F)}nargs(D,u){return q("<string|object|array> [number]",[D,u],arguments.length),this[Eu](this.nargs.bind(this),"narg",D,u),this}normalize(D){return q("<array|string>",[D],arguments.length),this[tD]("normalize",D),this}number(D){return q("<array|string>",[D],arguments.length),this[tD]("number",D),this[rD](D),this}option(D,u){if(q("<string|object> [object]",[D,u],arguments.length),typeof D==="object")Object.keys(D).forEach((F)=>{this.options(F,D[F])});else{if(typeof u!=="object")u={};if(this[rD](D),B(this,ID,"f")&&(D==="version"||(u===null||u===void 0?void 0:u.alias)==="version"))this[R0](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
78
78
|
`),void 0,"versionWarning");if(B(this,K,"f").key[D]=!0,u.alias)this.alias(D,u.alias);let F=u.deprecate||u.deprecated;if(F)this.deprecateOption(D,F);let E=u.demand||u.required||u.require;if(E)this.demand(D,E);if(u.demandOption)this.demandOption(D,typeof u.demandOption==="string"?u.demandOption:void 0);if(u.conflicts)this.conflicts(D,u.conflicts);if("default"in u)this.default(D,u.default);if(u.implies!==void 0)this.implies(D,u.implies);if(u.nargs!==void 0)this.nargs(D,u.nargs);if(u.config)this.config(D,u.configParser);if(u.normalize)this.normalize(D);if(u.choices)this.choices(D,u.choices);if(u.coerce)this.coerce(D,u.coerce);if(u.group)this.group(D,u.group);if(u.boolean||u.type==="boolean"){if(this.boolean(D),u.alias)this.boolean(u.alias)}if(u.array||u.type==="array"){if(this.array(D),u.alias)this.array(u.alias)}if(u.number||u.type==="number"){if(this.number(D),u.alias)this.number(u.alias)}if(u.string||u.type==="string"){if(this.string(D),u.alias)this.string(u.alias)}if(u.count||u.type==="count")this.count(D);if(typeof u.global==="boolean")this.global(D,u.global);if(u.defaultDescription)B(this,K,"f").defaultDescription[D]=u.defaultDescription;if(u.skipValidation)this.skipValidation(D);let C=u.describe||u.description||u.desc,f=B(this,b,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(f,D)||typeof C==="string")this.describe(D,C);if(u.hidden)this.hide(D);if(u.requiresArg)this.requiresArg(D)}return this}options(D,u){return this.option(D,u)}parse(D,u,F){if(q("[string|array] [function|boolean|object] [function]",[D,u,F],arguments.length),this[j0](),typeof D>"u")D=B(this,bD,"f");if(typeof u==="object")H(this,dD,u,"f"),u=F;if(typeof u==="function")H(this,TD,u,"f"),u=!1;if(!u)H(this,bD,D,"f");if(B(this,TD,"f"))H(this,WD,!1,"f");let E=this[Gu](D,!!u),C=this.parsed;if(B(this,ZD,"f").setParsed(this.parsed),l(E))return E.then((f)=>{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),f,B(this,$D,"f"));return f}).catch((f)=>{if(B(this,TD,"f"))B(this,TD,"f")(f,this.parsed.argv,B(this,$D,"f"));throw f}).finally(()=>{this[EF](),this.parsed=C});else{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),E,B(this,$D,"f"));this[EF](),this.parsed=C}return E}parseAsync(D,u,F){let E=this.parse(D,u,F);return!l(E)?Promise.resolve(E):E}parseSync(D,u,F){let E=this.parse(D,u,F);if(l(E))throw new DD(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return E}parserConfiguration(D){return q("<object>",[D],arguments.length),H(this,qu,D,"f"),this}pkgConf(D,u){q("<string> [string]",[D,u],arguments.length);let F=null,E=this[au](u||B(this,vD,"f"));if(E[D]&&typeof E[D]==="object")F=$u(E[D],u||B(this,vD,"f"),this[yD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(F);return this}positional(D,u){q("<string> <object>",[D,u],arguments.length);let F=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];u=xD(u,(f,h)=>{if(f==="type"&&!["string","number","boolean"].includes(h))return!1;return F.includes(f)});let E=B(this,zu,"f").fullCommands[B(this,zu,"f").fullCommands.length-1],C=E?B(this,uD,"f").cmdToParseOptions(E):{array:[],alias:{},default:{},demand:{}};return Du(C).forEach((f)=>{let h=C[f];if(Array.isArray(h)){if(h.indexOf(D)!==-1)u[f]=!0}else if(h[D]&&!(f in u))u[f]=h[D]}),this.group(D,B(this,b,"f").getPositionalGroupName()),this.option(D,u)}recommendCommands(D=!0){return q("[boolean]",[D],arguments.length),H(this,Hu,D,"f"),this}required(D,u,F){return this.demand(D,u,F)}require(D,u,F){return this.demand(D,u,F)}requiresArg(D){if(q("<array|string|object> [number]",[D],arguments.length),typeof D==="string"&&B(this,K,"f").narg[D])return this;else this[Eu](this.requiresArg.bind(this),"narg",D,NaN);return this}showCompletionScript(D,u){return q("[string] [string]",[D,u],arguments.length),D=D||this.$0,B(this,iD,"f").log(B(this,ZD,"f").generateCompletionScript(D,u||B(this,QD,"f")||"completion")),this}showHelp(D){if(q("[string|function]",[D],arguments.length),H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let F=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(l(F))return F.then(()=>{B(this,b,"f").showHelp(D)}),this}let u=B(this,uD,"f").runDefaultBuilderOn(this);if(l(u))return u.then(()=>{B(this,b,"f").showHelp(D)}),this}return B(this,b,"f").showHelp(D),this}scriptName(D){return this.customScriptName=!0,this.$0=D,this}showHelpOnFail(D,u){return q("[boolean|string] [string]",[D,u],arguments.length),B(this,b,"f").showHelpOnFail(D,u),this}showVersion(D){return q("[string|function]",[D],arguments.length),B(this,b,"f").showVersion(D),this}skipValidation(D){return q("<array|string>",[D],arguments.length),this[tD]("skipValidation",D),this}strict(D){return q("[boolean]",[D],arguments.length),H(this,kD,D!==!1,"f"),this}strictCommands(D){return q("[boolean]",[D],arguments.length),H(this,gD,D!==!1,"f"),this}strictOptions(D){return q("[boolean]",[D],arguments.length),H(this,lD,D!==!1,"f"),this}string(D){return q("<array|string>",[D],arguments.length),this[tD]("string",D),this[rD](D),this}terminalWidth(){return q([],0),B(this,P,"f").process.stdColumns}updateLocale(D){return this.updateStrings(D)}updateStrings(D){return q("<object>",[D],arguments.length),H(this,mD,!1,"f"),B(this,P,"f").y18n.updateLocale(D),this}usage(D,u,F,E){if(q("<string|null|undefined> [string|boolean] [function|object] [function]",[D,u,F,E],arguments.length),u!==void 0)if(XD(D,null,B(this,P,"f")),(D||"").match(/^\$0( |$)/))return this.command(D,u,F,E);else throw new DD(".usage() description must start with $0 if being used as alias for .command()");else return B(this,b,"f").usage(D),this}usageConfiguration(D){return q("<object>",[D],arguments.length),H(this,Iu,D,"f"),this}version(D,u,F){if(q("[boolean|string] [string] [string]",[D,u,F],arguments.length),B(this,ID,"f"))this[su](B(this,ID,"f")),B(this,b,"f").version(void 0),H(this,ID,null,"f");if(arguments.length===0)F=this[I0](),D="version";else if(arguments.length===1){if(D===!1)return this;F=D,D="version"}else if(arguments.length===2)F=u,u=void 0;return H(this,ID,typeof D==="string"?D:"version","f"),u=u||B(this,b,"f").deferY18nLookup("Show version number"),B(this,b,"f").version(F||void 0),this.boolean(B(this,ID,"f")),this.describe(B(this,ID,"f"),u),this}wrap(D){return q("<number|null|undefined>",[D],arguments.length),B(this,b,"f").wrap(D),this}[(uD=new WeakMap,vD=new WeakMap,zu=new WeakMap,ZD=new WeakMap,QD=new WeakMap,Wu=new WeakMap,wD=new WeakMap,mD=new WeakMap,Uu=new WeakMap,WD=new WeakMap,Nu=new WeakMap,UD=new WeakMap,HD=new WeakMap,OD=new WeakMap,ND=new WeakMap,Ru=new WeakMap,iD=new WeakMap,$D=new WeakMap,K=new WeakMap,ju=new WeakMap,qu=new WeakMap,TD=new WeakMap,dD=new WeakMap,Fu=new WeakMap,oD=new WeakMap,bD=new WeakMap,Hu=new WeakMap,P=new WeakMap,kD=new WeakMap,gD=new WeakMap,lD=new WeakMap,b=new WeakMap,Iu=new WeakMap,ID=new WeakMap,r=new WeakMap,U0)](D){if(!D._||!D["--"])return D;D._.push.apply(D._,D["--"]);try{delete D["--"]}catch(u){}return D}[N0](){return{log:(...D)=>{if(!this[Vu]())console.log(...D);if(H(this,OD,!0,"f"),B(this,$D,"f").length)H(this,$D,B(this,$D,"f")+`
|
|
79
79
|
`,"f");H(this,$D,B(this,$D,"f")+D.join(" "),"f")},error:(...D)=>{if(!this[Vu]())console.error(...D);if(H(this,OD,!0,"f"),B(this,$D,"f").length)H(this,$D,B(this,$D,"f")+`
|
|
80
|
-
`,"f");H(this,$D,B(this,$D,"f")+D.join(" "),"f")}}}[su](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,HD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,lD,"f"),completionCommand:B(this,QD,"f"),output:B(this,$D,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[yD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[ru](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[au]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[au](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,h)=>{if(h.includes("package.json"))return"package.json";else return});XD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[uF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=h})}[eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat(h)})}[DF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[uF](F),E)}[uF](D){if(D==="__proto__")return"___proto___";return D}[FF](D,u){return this[Eu](this[FF].bind(this),"key",D,u),this}[EF](){var D,u,F,E,C,f,h,G,J,Y,U,Q;let X=B(this,Nu,"f").pop();XD(X,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,h=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,HD,W,"f")}}.value,output:{set value(W){H(E,$D,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H(h,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,lD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=X,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[yD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[CF].bind(this),runValidation:this[BF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(l(D))return D;if(!u)D=this[U0](D);if(this[yD]()["parse-positional-numbers"]||this[yD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[CF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach((h)=>{F[h]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,HD,"f")).reduce((f,h)=>{let G=B(this,HD,"f")[h].filter((J)=>!(J in F));if(G.length>0)f[h]=G;return f},{})),H(this,HD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter((h)=>!F[h])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],(h)=>!F[h])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():$0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,ZD,"f"))H(this,ZD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,$D,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,h,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[yD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),X=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(X.argv,B(this,dD,"f")),W=void 0,Z=X.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,ID,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=X,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[ru](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(Z[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,ZD,"f"))===null||f===void 0?void 0:f.completionKey)?[(h=B(this,ZD,"f"))===null||h===void 0?void 0:h.completionKey,...(J=this.getAliases()[(G=B(this,ZD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let qD=B(this,uD,"f").runCommand(a,this,X,ED+1,C,A||v||C);return this[sD](qD,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,X,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,ZD,"f").completionKey}`)+1);return B(this,ZD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((qD)=>{B(this,iD,"f").log(qD)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(X.error)throw new DD(X.error.message);if(!GD){let g=this[BF](Z,{},X.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),l(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[BF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let h=!1;if(B(this,gD,"f"))h=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!h)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,lD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var z8=c0(ou),v0=z8;import{EOL as LD}from"os";import G8 from"path";var m0=o0("main");k0("main");var VD=iu(process.argv);if(VD.length===1&&(VD[0]==="--version"||VD[0]==="-v"))process.stdout.write(zF+LD),process.exit();var _u={acp:()=>import("./chunk-dgbvsnqb.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-c422awkv.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-p77m937s.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-2w154wad.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-4pedvzse.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-dvn528qs.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-anse7bd0.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-1q2vhe78.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-ysxmk1z1.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-p41h8naw.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-nt07vncv.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-28knamc9.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-1brsnwhv.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-n0y1ea17.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-skjge2wh.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-k6z419yx.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-mpn5qm9j.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-dp3hqm2m.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-y36ggefa.js").then((D)=>D.PrCommand),session:()=>import("./chunk-k728fzrr.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-1gj0m10e.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-1gj0m10e.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-hjvje9xj.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-gspdrdyq.js").then((D)=>D.QreditsCommand),db:()=>import("./chunk-r2waj5n2.js").then((D)=>D.DbCommand),default:()=>import("./chunk-3gdqmave.js").then((D)=>D.TuiThreadCommand)};function s(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function fF(){return[s("acp","start ACP (Agent Client Protocol) server"),s("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(l0).options(y0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}).option("trust",{type:"boolean",describe:"skip workspace trust prompt and trust the directory",default:!1}),handler:async()=>{}},s("attach <url>","attach to a running qitqode server"),s("run [message..]","run qitqode with a message"),s("generate","generate files"),s("debug","debugging and troubleshooting tools"),s("console","manage qitqode accounts"),s("providers","manage AI providers and credentials",["auth"]),s("agent","manage agents"),s("upgrade [target]","upgrade qitqode to the latest or a specific version"),s("uninstall","uninstall qitqode and remove all related files"),s("serve","starts a headless qitqode server"),s("models [provider]","list all available models"),s("stats","show token usage and cost statistics"),s("usage [sessionID]","show per-turn token usage and cost"),s("export [sessionID]","export session data as JSON"),s("import <file>","import session data from JSON file or URL"),s("github","manage GitHub agent"),s("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),s("session","manage sessions"),s("plugin <module>","install plugin and update config",["plug"]),s("auth <command>","Sign in or out of Forgewise"),s("qredits <command>","Check Qredits balance and spend history"),s("db","database tools")]}function $F(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function M8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function X8(D){return D.includes("--help")||D.includes("-h")}async function Z8(D){let u=$F(D);if(D.includes("--get-yargs-completions")||u==="completion")return fF();if(M8(D))return fF();else if(u&&u in _u)return[await _u[u]()];else if(X8(D))return fF();else return[await _u.default()]}function r0(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+LD+LD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=g0(v0(VD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-w8rvjbgr.js"),{Filesystem:F}=await import("./chunk-7nas10jx.js"),{Heap:E}=await import("./chunk-rdsae6k4.js"),{Global:C}=await import("./chunk-b49rxw15.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-0fwz5r1k.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:zF,command:$F(VD)??"tui",process_role:m0.processRole,run_id:m0.runID});let h=G8.join(C.Path.data,"qitqode.db");if(!await F.exists(h)){let{JsonMigration:G,Database:J}=await import("./chunk-6bq7rx7m.js"),{drizzle:Y}=await import("./chunk-khkv9s5c.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+LD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(X)=>{let O=Math.floor(X.current/X.total*100);if(O===Q&&X.current!==X.total)return;if(Q=O,U){if(process.stderr.write(s0(O,`${X.label.padEnd(12)} ${X.current}/${X.total}`)),X.current===X.total)process.stderr.write(`
|
|
81
|
-
`)}else process.stderr.write(`sqlite-migration:${O}${LD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${LD}`)}process.stderr.write("Database migration complete."+LD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-
|
|
80
|
+
`,"f");H(this,$D,B(this,$D,"f")+D.join(" "),"f")}}}[su](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,HD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,lD,"f"),completionCommand:B(this,QD,"f"),output:B(this,$D,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[yD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[ru](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[au]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[au](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,h)=>{if(h.includes("package.json"))return"package.json";else return});XD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[uF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=h})}[eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat(h)})}[DF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[uF](F),E)}[uF](D){if(D==="__proto__")return"___proto___";return D}[FF](D,u){return this[Eu](this[FF].bind(this),"key",D,u),this}[EF](){var D,u,F,E,C,f,h,G,J,Y,U,Q;let X=B(this,Nu,"f").pop();XD(X,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,h=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,HD,W,"f")}}.value,output:{set value(W){H(E,$D,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H(h,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,lD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=X,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[yD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[CF].bind(this),runValidation:this[BF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(l(D))return D;if(!u)D=this[U0](D);if(this[yD]()["parse-positional-numbers"]||this[yD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[CF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach((h)=>{F[h]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,HD,"f")).reduce((f,h)=>{let G=B(this,HD,"f")[h].filter((J)=>!(J in F));if(G.length>0)f[h]=G;return f},{})),H(this,HD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter((h)=>!F[h])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],(h)=>!F[h])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():$0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,ZD,"f"))H(this,ZD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,$D,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,h,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[yD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),X=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(X.argv,B(this,dD,"f")),W=void 0,Z=X.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,ID,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=X,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[ru](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(Z[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,ZD,"f"))===null||f===void 0?void 0:f.completionKey)?[(h=B(this,ZD,"f"))===null||h===void 0?void 0:h.completionKey,...(J=this.getAliases()[(G=B(this,ZD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let qD=B(this,uD,"f").runCommand(a,this,X,ED+1,C,A||v||C);return this[sD](qD,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,X,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,ZD,"f").completionKey}`)+1);return B(this,ZD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((qD)=>{B(this,iD,"f").log(qD)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(X.error)throw new DD(X.error.message);if(!GD){let g=this[BF](Z,{},X.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),l(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[BF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let h=!1;if(B(this,gD,"f"))h=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!h)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,lD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var z8=c0(ou),v0=z8;import{EOL as LD}from"os";import G8 from"path";var m0=o0("main");k0("main");var VD=iu(process.argv);if(VD.length===1&&(VD[0]==="--version"||VD[0]==="-v"))process.stdout.write(zF+LD),process.exit();var _u={acp:()=>import("./chunk-js7becx7.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-9gfe4wtk.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-5k1eyz7y.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-7jefvta3.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-ghtm9598.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-t6dymkmx.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-myjbd0vk.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-m7q12naw.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-c4vfxy1e.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-gkz68a5s.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-b4r19v4g.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-r03jc8xm.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-7hxksr4h.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-atg7cn5r.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-bzj7yxw6.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-76p9v2jf.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-fssswy6j.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-4tk4wppp.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-n5k2c708.js").then((D)=>D.PrCommand),session:()=>import("./chunk-5yghd32r.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-c1dwcsax.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-c1dwcsax.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-htdpkk8v.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-21q96fet.js").then((D)=>D.QreditsCommand),db:()=>import("./chunk-3gxhdy0c.js").then((D)=>D.DbCommand),default:()=>import("./chunk-qy1s81tv.js").then((D)=>D.TuiThreadCommand)};function s(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function fF(){return[s("acp","start ACP (Agent Client Protocol) server"),s("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(l0).options(y0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}).option("trust",{type:"boolean",describe:"skip workspace trust prompt and trust the directory",default:!1}),handler:async()=>{}},s("attach <url>","attach to a running qitqode server"),s("run [message..]","run qitqode with a message"),s("generate","generate files"),s("debug","debugging and troubleshooting tools"),s("console","manage qitqode accounts"),s("providers","manage AI providers and credentials",["auth"]),s("agent","manage agents"),s("upgrade [target]","upgrade qitqode to the latest or a specific version"),s("uninstall","uninstall qitqode and remove all related files"),s("serve","starts a headless qitqode server"),s("models [provider]","list all available models"),s("stats","show token usage and cost statistics"),s("usage [sessionID]","show per-turn token usage and cost"),s("export [sessionID]","export session data as JSON"),s("import <file>","import session data from JSON file or URL"),s("github","manage GitHub agent"),s("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),s("session","manage sessions"),s("plugin <module>","install plugin and update config",["plug"]),s("auth <command>","Sign in or out of Forgewise"),s("qredits <command>","Check Qredits balance and spend history"),s("db","database tools")]}function $F(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function M8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function X8(D){return D.includes("--help")||D.includes("-h")}async function Z8(D){let u=$F(D);if(D.includes("--get-yargs-completions")||u==="completion")return fF();if(M8(D))return fF();else if(u&&u in _u)return[await _u[u]()];else if(X8(D))return fF();else return[await _u.default()]}function r0(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+LD+LD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=g0(v0(VD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-s811ht10.js"),{Filesystem:F}=await import("./chunk-k44dj66f.js"),{Heap:E}=await import("./chunk-9hwsz356.js"),{Global:C}=await import("./chunk-n499tbz0.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-w2f8sjc4.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:zF,command:$F(VD)??"tui",process_role:m0.processRole,run_id:m0.runID});let h=G8.join(C.Path.data,"qitqode.db");if(!await F.exists(h)){let{JsonMigration:G,Database:J}=await import("./chunk-n7a4wpjj.js"),{drizzle:Y}=await import("./chunk-khkv9s5c.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+LD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(X)=>{let O=Math.floor(X.current/X.total*100);if(O===Q&&X.current!==X.total)return;if(Q=O,U){if(process.stderr.write(s0(O,`${X.label.padEnd(12)} ${X.current}/${X.total}`)),X.current===X.total)process.stderr.write(`
|
|
81
|
+
`)}else process.stderr.write(`sqlite-migration:${O}${LD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${LD}`)}process.stderr.write("Database migration complete."+LD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-9vvvyk10.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=$F(VD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Z8(VD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(r0)}if(u)throw u;process.exit(1)}).strict();try{if(VD.includes("-h")||VD.includes("--help"))await Mu.parse(VD,(D,u,F)=>{if(D)throw D;if(!F)return;r0(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof i0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-s811ht10.js");F.Default.error("fatal",u);let E=d0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+LD),process.stderr.write(GF(D)+LD);process.exitCode=1}finally{process.exit()}
|
package/bundle/worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Uf as H}from"./chunk-
|
|
2
|
+
import{Uf as H}from"./chunk-5rcnwm9j.js";import{Zf as x}from"./chunk-b3721b7c.js";import"./chunk-w5nwkb0s.js";import"./chunk-jwgqpntf.js";import"./chunk-q2zk0z41.js";import"./chunk-hkqcpdmt.js";import"./chunk-nfg7nt13.js";import"./chunk-awdpkgxf.js";import"./chunk-0942095s.js";import{Wg as V,qh as O}from"./chunk-88ckmmdr.js";import"./chunk-w9mdrb90.js";import"./chunk-qxtz0tfd.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import{Cj as Y,fl as Z}from"./chunk-651fyxmn.js";import{hl as N}from"./chunk-0czxqcg7.js";import{Pl as q,sl as C}from"./chunk-6ba9fc92.js";import"./chunk-7skp0dmg.js";import"./chunk-c4x99ayd.js";import"./chunk-6dznrhs4.js";import"./chunk-8fn883z8.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-th5z0zx7.js";import"./chunk-jfy6bfvv.js";import"./chunk-v0jnnpsz.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-yt6cfsdh.js";import"./chunk-yja3y138.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import{Cs as k}from"./chunk-qh76pgsk.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as X,Is as G,Ms as j,Ys as z,dt as T,mt as W}from"./chunk-esjs9s9g.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";var $=W.create({service:"upgrade"});function L(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=L(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as P}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});H.start();k("worker");C.on("event",(D)=>{z.emit("global.event",D)});var U,S={async fetch(D){let E={...D.headers},K=w();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return P("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(V),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(S);function w(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{S as rpc};
|
package/package.json
CHANGED
package/bundle/chunk-7pqevqry.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{el as a}from"./chunk-q39h31te.js";import"./chunk-0x0a51w3.js";import"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{a as Session};
|
package/bundle/chunk-p4pc1zdd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{m as a}from"./chunk-gfm4vad7.js";import"./chunk-3makpbng.js";import"./chunk-8k1q3g8s.js";import"./chunk-3w60y2x5.js";import"./chunk-wnjg8mmh.js";import"./chunk-jj7wrfty.js";import"./chunk-43xq4p51.js";import"./chunk-3degq6rv.js";import"./chunk-fgqrcjsm.js";import"./chunk-fd1vbz1f.js";import"./chunk-7b69jj5g.js";import"./chunk-x1dfc7qd.js";import"./chunk-en7nxqvn.js";import"./chunk-v9sfzkg5.js";import"./chunk-djcsvcby.js";import"./chunk-ntmn6epc.js";import"./chunk-5549c7mb.js";import"./chunk-pn77fh9b.js";import"./chunk-ckhhm2m8.js";import"./chunk-tp7sfreh.js";import"./chunk-tz8qhbk9.js";import"./chunk-q39h31te.js";import"./chunk-0x0a51w3.js";import"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{a as tui};
|