@qitqode/qitqode-android-arm64 0.2.5 → 0.2.6
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-45k7qm85.js → chunk-3cr2p4mp.js} +1 -1
- package/bundle/{chunk-ty2vg1a5.js → chunk-3d73kfea.js} +1 -1
- package/bundle/{chunk-xmb8jy13.js → chunk-3ktzxj69.js} +1 -1
- package/bundle/{chunk-0j5rzaxx.js → chunk-43ttzy29.js} +1 -1
- package/bundle/{chunk-3akv2xqh.js → chunk-4pshnq6g.js} +1 -1
- package/bundle/{chunk-kdj7xvz7.js → chunk-5asx1706.js} +1 -1
- package/bundle/{chunk-rn043d0r.js → chunk-5df5aja0.js} +1 -1
- package/bundle/{chunk-h5pnng66.js → chunk-6dvmyeg7.js} +1 -1
- package/bundle/{chunk-acpjrs02.js → chunk-6ex981t8.js} +1 -1
- package/bundle/{chunk-sf5zc4kc.js → chunk-6jeg2r5j.js} +1 -1
- package/bundle/{chunk-03bp59wq.js → chunk-6nry7tah.js} +1 -1
- package/bundle/{chunk-6sxx56b2.js → chunk-7x30x94y.js} +1 -1
- package/bundle/{chunk-xy3c8f1h.js → chunk-86hsh44c.js} +1 -1
- package/bundle/{chunk-fxx0z4yb.js → chunk-8e4s6nc2.js} +1 -1
- package/bundle/{chunk-kf2f3mza.js → chunk-8sbb95a4.js} +1 -1
- package/bundle/{chunk-bch1rj72.js → chunk-8yvx3pgy.js} +1 -1
- package/bundle/{chunk-44723rmb.js → chunk-97q2t1yz.js} +1 -1
- package/bundle/{chunk-xqnzmr7a.js → chunk-99s035f0.js} +1 -1
- package/bundle/{chunk-jxwey5py.js → chunk-a7rp46yt.js} +1 -1
- package/bundle/{chunk-zgcabs1k.js → chunk-bg1t0kke.js} +1 -1
- package/bundle/{chunk-0g7acwt1.js → chunk-bkct64rs.js} +1 -1
- package/bundle/{chunk-wmezdcdh.js → chunk-bzebyyfr.js} +2 -2
- package/bundle/{chunk-xynwfaf1.js → chunk-c3zge8cg.js} +1 -1
- package/bundle/{chunk-41cq88js.js → chunk-cbnkx933.js} +1 -1
- package/bundle/{chunk-kn8w69g9.js → chunk-cfhfc86j.js} +1 -1
- package/bundle/{chunk-5qsr1q4t.js → chunk-cj7r8w1e.js} +1 -1
- package/bundle/{chunk-7ayb3k5p.js → chunk-cng61dby.js} +1 -1
- package/bundle/{chunk-89b4k585.js → chunk-cqkaamvn.js} +1 -1
- package/bundle/{chunk-cq9sd32h.js → chunk-d51908mv.js} +1 -1
- package/bundle/{chunk-93gdcrbc.js → chunk-d7nsd979.js} +1 -1
- package/bundle/{chunk-2nv1scj9.js → chunk-da6kggv7.js} +1 -1
- package/bundle/{chunk-5gsdnejs.js → chunk-f3zmdfqa.js} +1 -1
- package/bundle/{chunk-kj8cmn7z.js → chunk-fr34mnyg.js} +1 -1
- package/bundle/{chunk-826r9svy.js → chunk-fsqses4g.js} +1 -1
- package/bundle/{chunk-m7v4ky0y.js → chunk-fyhqp4pb.js} +1 -1
- package/bundle/{chunk-hgmqz75r.js → chunk-gdn91t9j.js} +1 -1
- package/bundle/{chunk-xhtcegk0.js → chunk-gjd3wf8b.js} +1 -1
- package/bundle/{chunk-r1xh50b2.js → chunk-h9wh48d0.js} +1 -1
- package/bundle/chunk-hjb1etf8.js +2 -0
- package/bundle/{chunk-v3nqkqhz.js → chunk-hjt94wce.js} +223 -223
- package/bundle/{chunk-nw3e93y8.js → chunk-hqbbs9dm.js} +1 -1
- package/bundle/{chunk-t9pwz4ws.js → chunk-jnrnncqc.js} +1 -1
- package/bundle/{chunk-52frd9p0.js → chunk-k3dacdp5.js} +4 -4
- package/bundle/{chunk-vp9scf28.js → chunk-kengqzja.js} +1 -1
- package/bundle/{chunk-pxv12ctq.js → chunk-kth84vdn.js} +1 -1
- package/bundle/{chunk-kxwkab31.js → chunk-ky88ba80.js} +1 -1
- package/bundle/{chunk-cfjjx3sh.js → chunk-m80v76m9.js} +1 -1
- package/bundle/{chunk-c55f729m.js → chunk-mhtxp66q.js} +1 -1
- package/bundle/{chunk-3cqrz7g1.js → chunk-ngfxxfem.js} +1 -1
- package/bundle/{chunk-bbdp6dj4.js → chunk-nmzrrqgb.js} +1 -1
- package/bundle/{chunk-yv5aehqq.js → chunk-nvs0d8jg.js} +1 -1
- package/bundle/{chunk-jyt2xvha.js → chunk-p4b0s5td.js} +1 -1
- package/bundle/{chunk-36xm6mgm.js → chunk-pe2xdkez.js} +1 -1
- package/bundle/{chunk-eb4y8bjv.js → chunk-pt0xphq9.js} +1 -1
- package/bundle/{chunk-6t48g4x5.js → chunk-pz1avwyt.js} +1 -1
- package/bundle/{chunk-a9a0cwmf.js → chunk-q3h42a94.js} +1 -1
- package/bundle/{chunk-2b3fn9xv.js → chunk-q3nvzhyh.js} +1 -1
- package/bundle/{chunk-ct693qsd.js → chunk-q9tgdghx.js} +1 -1
- package/bundle/{chunk-g3y5xemb.js → chunk-qkvqvgcx.js} +1 -1
- package/bundle/{chunk-98b7ecrk.js → chunk-rcrjbhaz.js} +1 -1
- package/bundle/{chunk-np12r26m.js → chunk-t5r3w9e1.js} +1 -1
- package/bundle/{chunk-13rsd5vv.js → chunk-tzb26ntq.js} +1 -1
- package/bundle/{chunk-af81r4v7.js → chunk-v6v9xn81.js} +1 -1
- package/bundle/{chunk-w2cb8cry.js → chunk-vdrz2t9c.js} +1 -1
- package/bundle/{chunk-mtpzcc14.js → chunk-vj4x8hvz.js} +1 -1
- package/bundle/{chunk-nymf08b4.js → chunk-vkaa7k3e.js} +2 -2
- package/bundle/{chunk-dt5aae7t.js → chunk-xwdxgg16.js} +1 -1
- package/bundle/{chunk-t5xxs5kp.js → chunk-xy0gnpen.js} +1 -1
- package/bundle/{chunk-yfzyzsr4.js → chunk-ycvwpmd9.js} +1 -1
- package/bundle/{chunk-vwh6mv37.js → chunk-zkm3yyyf.js} +1 -1
- package/bundle/index.js +3 -3
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-rrd0fdra.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jn as z2}from"./chunk-9zm6r55d.js";import{Fq as i0,Hq as s0}from"./chunk-
|
|
2
|
+
import{Jn as z2}from"./chunk-9zm6r55d.js";import{Fq as i0,Hq as s0}from"./chunk-5df5aja0.js";import{Xr as Q2}from"./chunk-nj1ntakd.js";import{as as E0}from"./chunk-tkrwcjkr.js";import{is as x0}from"./chunk-fr34mnyg.js";import{Es as t}from"./chunk-r5zy4za0.js";import{Ns as e}from"./chunk-tr6rdr6h.js";import{Xs as $2,bt as f,ft as S,gt as a0,it as o,kt as j0}from"./chunk-at22twxx.js";import{lt as p}from"./chunk-kgptyf7n.js";import{Py as d0}from"./chunk-55fcmswd.js";import{DE as g,Qz as o0,TG as K0,TN as w,YE as c,dK as Z2,eH as J,lB as L,zB as V0}from"./chunk-qnvsqnz5.js";import{sO as W0,uO as e0,wO as L2}from"./chunk-r9w0thdk.js";function z0(Z,Q=!1){let z=Z.length,$=0,X="",Y=0,U=16,G=0,W=0,I=0,H=0,q=0;function R(j,_){let V=0,B=0;while(V<j||!_){let M=Z.charCodeAt($);if(M>=48&&M<=57)B=B*16+M-48;else if(M>=65&&M<=70)B=B*16+M-65+10;else if(M>=97&&M<=102)B=B*16+M-97+10;else break;$++,V++}if(V<j)B=-1;return B}function N(j){$=j,X="",Y=0,U=16,q=0}function A(){let j=$;if(Z.charCodeAt($)===48)$++;else{$++;while($<Z.length&&s(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++}else return q=3,Z.substring(j,$);let _=$;if($<Z.length&&(Z.charCodeAt($)===69||Z.charCodeAt($)===101)){if($++,$<Z.length&&Z.charCodeAt($)===43||Z.charCodeAt($)===45)$++;if($<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++;_=$}else q=3}return Z.substring(j,_)}function O(){let j="",_=$;while(!0){if($>=z){j+=Z.substring(_,$),q=2;break}let V=Z.charCodeAt($);if(V===34){j+=Z.substring(_,$),$++;break}if(V===92){if(j+=Z.substring(_,$),$++,$>=z){q=2;break}switch(Z.charCodeAt($++)){case 34:j+='"';break;case 92:j+="\\";break;case 47:j+="/";break;case 98:j+="\b";break;case 102:j+="\f";break;case 110:j+=`
|
|
3
3
|
`;break;case 114:j+="\r";break;case 116:j+="\t";break;case 117:let M=R(4,!0);if(M>=0)j+=String.fromCharCode(M);else q=4;break;default:q=5}_=$;continue}if(V>=0&&V<=31)if(Q0(V)){j+=Z.substring(_,$),q=2;break}else q=6;$++}return j}function K(){if(X="",q=0,Y=$,W=G,H=I,$>=z)return Y=z,U=17;let j=Z.charCodeAt($);if(b0(j)){do $++,X+=String.fromCharCode(j),j=Z.charCodeAt($);while(b0(j));return U=15}if(Q0(j)){if($++,X+=String.fromCharCode(j),j===13&&Z.charCodeAt($)===10)$++,X+=`
|
|
4
4
|
`;return G++,I=$,U=14}switch(j){case 123:return $++,U=1;case 125:return $++,U=2;case 91:return $++,U=3;case 93:return $++,U=4;case 58:return $++,U=6;case 44:return $++,U=5;case 34:return $++,X=O(),U=10;case 47:let _=$-1;if(Z.charCodeAt($+1)===47){$+=2;while($<z){if(Q0(Z.charCodeAt($)))break;$++}return X=Z.substring(_,$),U=12}if(Z.charCodeAt($+1)===42){$+=2;let V=z-1,B=!1;while($<V){let M=Z.charCodeAt($);if(M===42&&Z.charCodeAt($+1)===47){$+=2,B=!0;break}if($++,Q0(M)){if(M===13&&Z.charCodeAt($)===10)$++;G++,I=$}}if(!B)$++,q=1;return X=Z.substring(_,$),U=13}return X+=String.fromCharCode(j),$++,U=16;case 45:if(X+=String.fromCharCode(j),$++,$===z||!s(Z.charCodeAt($)))return U=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return X+=A(),U=11;default:while($<z&&y(j))$++,j=Z.charCodeAt($);if(Y!==$){switch(X=Z.substring(Y,$),X){case"true":return U=8;case"false":return U=9;case"null":return U=7}return U=16}return X+=String.fromCharCode(j),$++,U=16}}function y(j){if(b0(j)||Q0(j))return!1;switch(j){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let j;do j=K();while(j>=12&&j<=15);return j}return{setPosition:N,getPosition:()=>$,scan:Q?v:K,getToken:()=>U,getTokenValue:()=>X,getTokenOffset:()=>Y,getTokenLength:()=>$-Y,getTokenStartLine:()=>W,getTokenStartCharacter:()=>Y-H,getTokenError:()=>q}}function b0(Z){return Z===32||Z===9}function Q0(Z){return Z===10||Z===13}function s(Z){return Z>=48&&Z<=57}var u0;(function(Z){Z[Z.lineFeed=10]="lineFeed",Z[Z.carriageReturn=13]="carriageReturn",Z[Z.space=32]="space",Z[Z._0=48]="_0",Z[Z._1=49]="_1",Z[Z._2=50]="_2",Z[Z._3=51]="_3",Z[Z._4=52]="_4",Z[Z._5=53]="_5",Z[Z._6=54]="_6",Z[Z._7=55]="_7",Z[Z._8=56]="_8",Z[Z._9=57]="_9",Z[Z.a=97]="a",Z[Z.b=98]="b",Z[Z.c=99]="c",Z[Z.d=100]="d",Z[Z.e=101]="e",Z[Z.f=102]="f",Z[Z.g=103]="g",Z[Z.h=104]="h",Z[Z.i=105]="i",Z[Z.j=106]="j",Z[Z.k=107]="k",Z[Z.l=108]="l",Z[Z.m=109]="m",Z[Z.n=110]="n",Z[Z.o=111]="o",Z[Z.p=112]="p",Z[Z.q=113]="q",Z[Z.r=114]="r",Z[Z.s=115]="s",Z[Z.t=116]="t",Z[Z.u=117]="u",Z[Z.v=118]="v",Z[Z.w=119]="w",Z[Z.x=120]="x",Z[Z.y=121]="y",Z[Z.z=122]="z",Z[Z.A=65]="A",Z[Z.B=66]="B",Z[Z.C=67]="C",Z[Z.D=68]="D",Z[Z.E=69]="E",Z[Z.F=70]="F",Z[Z.G=71]="G",Z[Z.H=72]="H",Z[Z.I=73]="I",Z[Z.J=74]="J",Z[Z.K=75]="K",Z[Z.L=76]="L",Z[Z.M=77]="M",Z[Z.N=78]="N",Z[Z.O=79]="O",Z[Z.P=80]="P",Z[Z.Q=81]="Q",Z[Z.R=82]="R",Z[Z.S=83]="S",Z[Z.T=84]="T",Z[Z.U=85]="U",Z[Z.V=86]="V",Z[Z.W=87]="W",Z[Z.X=88]="X",Z[Z.Y=89]="Y",Z[Z.Z=90]="Z",Z[Z.asterisk=42]="asterisk",Z[Z.backslash=92]="backslash",Z[Z.closeBrace=125]="closeBrace",Z[Z.closeBracket=93]="closeBracket",Z[Z.colon=58]="colon",Z[Z.comma=44]="comma",Z[Z.dot=46]="dot",Z[Z.doubleQuote=34]="doubleQuote",Z[Z.minus=45]="minus",Z[Z.openBrace=123]="openBrace",Z[Z.openBracket=91]="openBracket",Z[Z.plus=43]="plus",Z[Z.slash=47]="slash",Z[Z.formFeed=12]="formFeed",Z[Z.tab=9]="tab"})(u0||(u0={}));var x=Array(20).fill(0).map((Z,Q)=>{return" ".repeat(Q)});var L0={" ":{"\n":Array(200).fill(0).map((Z,Q)=>{return`
|
|
5
5
|
`+" ".repeat(Q)}),"\r":Array(200).fill(0).map((Z,Q)=>{return"\r"+" ".repeat(Q)}),"\r\n":Array(200).fill(0).map((Z,Q)=>{return`\r
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{T as I}from"./chunk-gbkz04ke.js";import{U as i,W as r}from"./chunk-
|
|
2
|
+
import{T as I}from"./chunk-gbkz04ke.js";import{U as i,W as r}from"./chunk-4pshnq6g.js";import{Hd as c}from"./chunk-bwbqkfv0.js";import{Id as g}from"./chunk-32j0q58h.js";import{Jd as y}from"./chunk-0cnwsf8p.js";import{Kd as k}from"./chunk-2md6sx8d.js";import{Ld as A}from"./chunk-wyj8cpx5.js";import{Qd as w,Rd as u,Td as W,Ud as L,Vd as T,Xd as p,Yd as o,Zd as b,_d as P}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as z}from"./chunk-5w76kdjr.js";import{dg as Y}from"./chunk-eg3syjtv.js";import{Bh as M}from"./chunk-hjt94wce.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{Qk as a,dl as s,xj as R}from"./chunk-k3dacdp5.js";import{pl as V}from"./chunk-99s035f0.js";import{Nl as n}from"./chunk-h9wh48d0.js";import"./chunk-tzb26ntq.js";import"./chunk-mh19kwzw.js";import"./chunk-q3h42a94.js";import"./chunk-hqbbs9dm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-cfhfc86j.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-q3nvzhyh.js";import"./chunk-5df5aja0.js";import"./chunk-73r8bjjz.js";import"./chunk-xy0gnpen.js";import{Nr as l}from"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-vdrz2t9c.js";import{ks as d}from"./chunk-fr34mnyg.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import{kt as v}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import{eH as O}from"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import{wO as H1}from"./chunk-r9w0thdk.js";import f from"path";import{pathToFileURL as J1}from"url";import Q1 from"os";import{access as S1,readdir as X1}from"fs/promises";var q1={en:A,zh:k,ja:c,fr:y,ru:g},B1=q1[I()]??A;function U($,B){let J=B1[$]??A[$]??$;if(!B)return J;return J.replace(/\{(\w+)\}/g,(X,H)=>(H in B)?String(B[H]):`{${H}}`)}import{text as Z1}from"stream/consumers";var D=($,B)=>M.runPromise(O.gen(function*(){yield*(yield*R.Service).set($,B)}));async function t(){let $=await p({message:"Enter your API key",validate:(B)=>B&&B.length>0?void 0:"Required"});if(w($))throw new Y.CancelledError;return $}async function h($,B){let J=$.provider??B;if("refresh"in $){let{type:X,provider:H,refresh:Z,access:j,expires:q,metadata:S,...G}=$;await D(J,{type:"oauth",refresh:Z,access:j,expires:q,...G})}if("key"in $)await D(J,{type:"api",key:$.key,...$.metadata?{metadata:$.metadata}:{}})}async function x($,B,J){let X=0;if(J){let j=$.auth.methods.findIndex((q)=>q.label.toLowerCase()===J.toLowerCase());if(j===-1)W.error(`Unknown method "${J}" for ${B}. Available: ${$.auth.methods.map((q)=>q.label).join(", ")}`),process.exit(1);X=j}else if($.auth.methods.length>1){let j=await b({message:"Login method",options:$.auth.methods.map((q,S)=>({label:q.label,value:S.toString()}))});if(w(j))throw new Y.CancelledError;X=parseInt(j)}let H=$.auth.methods[X];await new Promise((j)=>setTimeout(j,10));let Z={};if(H.prompts)for(let j of H.prompts){if(j.when){let q=Z[j.when.key];if(q===void 0)continue;if(!(j.when.op==="eq"?q===j.when.value:q!==j.when.value))continue}if(j.condition&&!j.condition(Z))continue;if(j.type==="select"){let q=await b({message:j.message,options:j.options});if(w(q))throw new Y.CancelledError;Z[j.key]=q}else{let q=await P({message:j.message,placeholder:j.placeholder,validate:j.validate?(S)=>j.validate(S??""):void 0});if(w(q))throw new Y.CancelledError;Z[j.key]=q}}if(H.type==="oauth"){let j=await H.authorize(Z);if(j.url)W.info("Go to: "+j.url);if(j.method==="auto"){if(j.instructions)W.info(j.instructions);let q=o();q.start("Waiting for authorization...");let S=await j.callback();if(S.type==="failed")q.stop("Failed to authorize",1);if(S.type==="success")await h(S,B),q.stop("Login successful")}if(j.method==="code"){let q=await P({message:"Paste the authorization code here: ",validate:(G)=>G&&G.length>0?void 0:"Required"});if(w(q))throw new Y.CancelledError;let S=await j.callback(q);if(S.type==="failed")W.error("Failed to authorize");if(S.type==="success")await h(S,B),W.success("Login successful")}return T("Done"),!0}if(H.type==="api"){if(H.authorize){let j=await t(),q=await H.authorize(Z);if(q.type==="failed")W.error("Failed to authorize");if(q.type==="success"){let S=q.provider??B;await D(S,{type:"api",key:q.key??j}),W.success("Login successful")}return T("Done"),!0}}return!1}function G1($){let B=new Set,J=[];for(let X of $.hooks){if(!X.auth)continue;let H=X.auth.provider;if(B.has(H))continue;if(B.add(H),Object.hasOwn($.existingProviders,H))continue;if($.disabled.has(H))continue;if($.enabled&&!$.enabled.has(H))continue;J.push({id:H,name:$.providerNames[H]??H})}return J}function m($){let B=$?.loginExtension;if(!B||typeof B!=="object")return;let J=B;if(typeof J.id!=="string"||typeof J.run!=="function")return;return J}async function W1(){try{let J=await import("./chunk-wbw9zv3h.js");for(let X of Object.values(J.modules??{})){let H=m(X);if(H)return H}}catch{}let $=f.join(import.meta.dir,"..","..","ext");await S1($).catch(()=>{return});let B=await X1($).catch(()=>[]);for(let J of B.filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")))try{let X=m(await import(J1(f.join($,J)).href));if(X)return X}catch{}return}var l1=z({command:"providers",aliases:["auth"],describe:"manage AI providers and credentials",builder:($)=>$.command(Y1).command(_1).command(F1).command(K1).demandCommand(),async handler(){}}),Y1=z({command:"list",aliases:["ls"],describe:"list providers and credentials",async handler($){Y.empty();let B=f.join(v.Path.data,"auth.json"),J=Q1.homedir(),X=B===J||B.startsWith(J+f.sep)?"~"+B.slice(J.length):B;L(`Credentials ${Y.Style.TEXT_DIM}${X}`);let H=await M.runPromise(O.gen(function*(){let q=yield*R.Service;return Object.entries(yield*q.all())})),Z=await V.get();for(let[q,S]of H){let G=Z[q]?.name||q;W.info(`${G} ${Y.Style.TEXT_DIM}${S.type}`)}T(`${H.length} credentials`);let j=[];for(let[q,S]of Object.entries(Z))for(let G of S.env)if(process.env[G])j.push({provider:S.name||q,envVar:G});if(j.length>0){Y.empty(),L("Environment");for(let{provider:q,envVar:S}of j)W.info(`${q} ${Y.Style.TEXT_DIM}${S}`);T(`${j.length} environment variable`+(j.length===1?"":"s"))}}}),_1=z({command:"login [url]",describe:"log in to a provider",builder:($)=>$.positional("url",{describe:"qitqode auth provider",type:"string"}).option("provider",{alias:["p"],describe:"provider id or name to log in to (skips provider selection)",type:"string"}).option("method",{alias:["m"],describe:"login method label (skips method selection)",type:"string"}),async handler($){await n.provide({directory:process.cwd(),async fn(){if(Y.empty(),L("Add credential"),$.url){let Q=$.url.replace(/\/+$/,""),_=await fetch(`${Q}/.well-known/opencode`).then((j1)=>j1.json());W.info(`Running \`${_.auth.command.join(" ")}\``);let F=l.spawn(_.auth.command,{stdout:"pipe"});if(!F.stdout){W.error("Failed"),T("Done");return}let[C,N]=await Promise.all([F.exited,Z1(F.stdout)]);if(C!==0){W.error("Failed"),T("Done");return}await D(Q,{type:"wellknown",key:_.auth.env,token:N.trim()}),W.success("Logged into "+Q),T("Done");return}await V.refresh(!0).catch(()=>{});let B=await M.runPromise(s.Service.use((Q)=>Q.get())),J=new Set(B.disabled_providers??[]),X=B.enabled_providers?new Set(B.enabled_providers):void 0,H=await V.get().then((Q)=>{let _={};for(let[F,C]of Object.entries(Q))if((X?X.has(F):!0)&&!J.has(F))_[F]=C;return _}),Z=await M.runPromise(O.gen(function*(){return yield*(yield*a.Service).list()})),j=i,q=G1({hooks:Z,existingProviders:H,disabled:J,enabled:X,providerNames:Object.fromEntries(Object.entries(B.provider??{}).map(([Q,_])=>[Q,_.name]))}),S=[...r(d(H),j,(Q)=>({openai:"ChatGPT Plus/Pro or API key"})[Q.id]),...q.map((Q)=>({label:Q.name,value:Q.id,hint:"plugin"}))],G=await W1(),e=G?[G.id,...G.aliases??[]]:[],K;if(G&&$.provider&&e.includes($.provider)){await G.run();return}else if($.provider){let Q=$.provider,_=S.find((N)=>N.value===Q),F=S.find((N)=>N.label.toLowerCase()===Q.toLowerCase()),C=_??F;if(!C)W.error(`Unknown provider "${Q}"`),process.exit(1);K=C.value}else{let Q=await b({message:U("cli.providers.select"),options:[...G?.menu?[{label:G.menu.label,value:G.id,hint:G.menu.hint}]:[],{label:U("cli.providers.other"),value:"__other__"}]});if(w(Q))throw new Y.CancelledError;if(G&&Q===G.id){await G.run();return}let _=await u({message:U("cli.providers.select"),maxItems:8,options:[...S,{value:"other",label:"Other"}]});if(w(_))throw new Y.CancelledError;K=_}let E=Z.findLast((Q)=>Q.auth?.provider===K);if(E&&E.auth){if(await x({auth:E.auth},K,$.method))return}if(K==="other"){let Q=await P({message:"Enter provider id",validate:(F)=>F&&F.match(/^[0-9a-z-]+$/)?void 0:"a-z, 0-9 and hyphens only"});if(w(Q))throw new Y.CancelledError;K=Q.replace(/^@ai-sdk\//,"");let _=Z.findLast((F)=>F.auth?.provider===K);if(_&&_.auth){if(await x({auth:_.auth},K,$.method))return}W.warn(`This only stores a credential for ${K} - you will need configure it in qitqode.json, check the docs for examples.`)}if(K==="amazon-bedrock")W.info(`Amazon Bedrock authentication priority:
|
|
3
3
|
1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
|
|
4
4
|
2. AWS credential chain (profile, access keys, IAM roles, EKS IRSA)
|
|
5
5
|
|