import{ha as O}from"./cli-0.5.4-jd78z351.mjs";import{ib as K}from"./cli-0.5.4-rkmb1r23.mjs";import"./cli-0.5.4-q40m3k35.mjs";import"./cli-0.5.4-xk3b6ef9.mjs";import"./cli-0.5.4-5j99cwqy.mjs";import"./cli-0.5.4-zy4nyw3m.mjs";import"./cli-0.5.4-q7qfy21z.mjs";import"./cli-0.5.4-1cnxcper.mjs";import{vd as F,wd as S}from"./cli-0.5.4-jrd2w9wa.mjs";import"./cli-0.5.4-3ne6665p.mjs";import{Qe as B,Re as P}from"./cli-0.5.4-4tsxr87f.mjs";import"./cli-0.5.4-sps90k0m.mjs";import"./cli-0.5.4-7c6wpbhq.mjs";import{OD as Z,PD as C,Ut as Y,Yt as $}from"./cli-0.5.4-k5fz4zd3.mjs";import"./cli-0.5.4-wbqf44ym.mjs";import"./cli-0.5.4-9ewg9gfs.mjs";import"./cli-0.5.4-we3mspgg.mjs";import"./cli-0.5.4-jzhazry0.mjs";import"./cli-0.5.4-82sw3hrw.mjs";import"./cli-0.5.4-31v143kt.mjs";import"./cli-0.5.4-1cy7wd6s.mjs";import"./cli-0.5.4-5e0pk96f.mjs";import"./cli-0.5.4-z154a7bp.mjs";import"./cli-0.5.4-ng5p0zjs.mjs";import"./cli-0.5.4-5hp7ks3t.mjs";import"./cli-0.5.4-8hdwp78f.mjs";import"./cli-0.5.4-mr9aznxx.mjs";import"./cli-0.5.4-jevfk5q7.mjs";import"./cli-0.5.4-27dzbzdy.mjs";import"./cli-0.5.4-a5bkdqqb.mjs";import"./cli-0.5.4-j2hnw539.mjs";import"./cli-0.5.4-9w59nnw4.mjs";import"./cli-0.5.4-z5d3q8kh.mjs";import"./cli-0.5.4-c0r12dqp.mjs";import"./cli-0.5.4-kqh172jk.mjs";import"./cli-0.5.4-vv4jbgkc.mjs";import{KW as Q,MW as U,pX as w,rV as W}from"./cli-0.5.4-s7k1f0wc.mjs";import"./cli-0.5.4-0h0yz2k5.mjs";import"./cli-0.5.4-942dm5q1.mjs";import"./cli-0.5.4-rcmp5h4y.mjs";import"./cli-0.5.4-xdcww3x8.mjs";import"./cli-0.5.4-fq32ny1h.mjs";import"./cli-0.5.4-h1m67ngp.mjs";import"./cli-0.5.4-49erze3e.mjs";import"./cli-0.5.4-jytjks37.mjs";import{PY as f,QY as N,RY as L}from"./cli-0.5.4-mn22gk7g.mjs";import{SY as M}from"./cli-0.5.4-5t3jj85n.mjs";import"./cli-0.5.4-5shjmmkz.mjs";import"./cli-0.5.4-zb412kkm.mjs";import"./cli-0.5.4-prfn3sxd.mjs";import"./cli-0.5.4-6xmgebmk.mjs";import"./cli-0.5.4-vjgejcrz.mjs";import{A2 as _,B3 as E}from"./cli-0.5.4-jqt00ywx.mjs";import"./cli-0.5.4-9e7rkd8e.mjs";import"./cli-0.5.4-jp4wtw87.mjs";import"./cli-0.5.4-hambpq58.mjs";import"./cli-0.5.4-syvgmg9g.mjs";import"./cli-0.5.4-w8ttefr5.mjs";import"./cli-0.5.4-j7kkqxv6.mjs";import"./cli-0.5.4-qrwczx7j.mjs";import"./cli-0.5.4-v2z6p9td.mjs";import"./cli-0.5.4-cbq01zg3.mjs";import"./cli-0.5.4-37v5fhf1.mjs";import"./cli-0.5.4-7grzwf6q.mjs";import"./cli-0.5.4-9qmek5dq.mjs";import"./cli-0.5.4-9c6r1fjg.mjs";import"./cli-0.5.4-2dw33ms6.mjs";import"./cli-0.5.4-x1fzfxmm.mjs";import"./cli-0.5.4-e822fzaq.mjs";import{Nea as X,Pea as y}from"./cli-0.5.4-09dvrzcr.mjs";import"./cli-0.5.4-end8wj9r.mjs";import"./cli-0.5.4-4x206j04.mjs";import"./cli-0.5.4-yd3rd9qt.mjs";import"./cli-0.5.4-sgcaw17t.mjs";import"./cli-0.5.4-jmc3bzbn.mjs";import"./cli-0.5.4-959vxhhb.mjs";import{Vma as V,_ma as I}from"./cli-0.5.4-aacw1src.mjs";var R=V(W(),1),z=V(M(),1);import{cwd as D}from"process";w();C();y();P();$();S();E();L();async function l(k){X("tengu_setup_token_command",{});let q=!_(),{ConsoleOAuthFlow:H}=await import("./ConsoleOAuthFlow-0.5.4-yckbrch5.mjs");await new Promise((G)=>{k.render(f(Y,{onChangeAppState:F,children:f(Z,{children:N(Q,{flexDirection:"column",gap:1,children:[f(O,{}),q&&N(Q,{flexDirection:"column",children:[f(U,{color:"warning",children:"Warning: You already have authentication configured via environment variable or API key helper."}),f(U,{color:"warning",children:"The setup-token command will create a new OAuth token which you can use instead."})]}),f(H,{onDone:()=>{G()},mode:"setup-token",startingMessage:"This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required."})]})})}))}),k.unmount(),process.exit(0)}var d=z.default.lazy(()=>import("./Doctor-0.5.4-qezmg25v.mjs").then((k)=>({default:k.Doctor})));function m(k){let q=R.c(2),{onDone:H}=k;K();let G;if(q[0]!==H)G=f(z.default.Suspense,{fallback:null,children:f(d,{onDone:H})}),q[0]=H,q[1]=G;else G=q[1];return G}async function a(k){X("tengu_doctor_command",{}),await new Promise((q)=>{k.render(f(Y,{children:f(Z,{children:f(B,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:f(m,{onDone:()=>{q()}})})})}))}),k.unmount(),process.exit(0)}async function n(k,q){let{setup:H}=await import("./setup-0.5.4-r8f8xazh.mjs");await H(D(),"default",!1,!1,void 0,!1);let{install:G}=await import("./install-0.5.4-pt95bpda.mjs");await new Promise((T)=>{let J=[];if(k)J.push(k);if(q.force)J.push("--force");G.call((b)=>{T(),process.exit(b.includes("failed")?1:0)},{},J)})}export{l as setupTokenHandler,n as installHandler,a as doctorHandler};
