makecoder 4.0.27 → 4.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cc.mjs +2 -2
  2. package/dist/coder.js +1 -1
  3. package/dist/darwin-arm64/cc.js +41 -6
  4. package/dist/darwin-x64/cc.js +41 -6
  5. package/dist/gemini/{chunk-2SX35WX4.js → chunk-356OVHGG.js} +1 -1
  6. package/dist/gemini/{chunk-QLWIHN4W.js → chunk-63ULYU4I.js} +2 -2
  7. package/dist/gemini/{chunk-3MILFT2A.js → chunk-ACEDFBEP.js} +2 -2
  8. package/dist/gemini/{chunk-M4VGJYXT.js → chunk-CJ5VLAB6.js} +1 -1
  9. package/dist/gemini/{chunk-L6MG6Y4N.js → chunk-CNS6SZJ6.js} +1 -1
  10. package/dist/gemini/{chunk-CVQSCATI.js → chunk-FJMU6UNE.js} +1 -1
  11. package/dist/gemini/{chunk-REVEB6QQ.js → chunk-G6V3NYLD.js} +1 -1
  12. package/dist/gemini/{chunk-FLHTGF3O.js → chunk-MH5WU37R.js} +1 -1
  13. package/dist/gemini/{chunk-A6MX3ZUI.js → chunk-PZM5Q2NO.js} +2 -2
  14. package/dist/gemini/{chunk-7QO7ZB7U.js → chunk-R4YJJCUP.js} +1 -1
  15. package/dist/gemini/{chunk-GTU5AZLF.js → chunk-RTOTOYZ3.js} +1 -1
  16. package/dist/gemini/{chunk-A3CFCECQ.js → chunk-S5WFVXWE.js} +1 -1
  17. package/dist/gemini/{chunk-RFHUTEFF.js → chunk-VFMKTMIZ.js} +1 -1
  18. package/dist/gemini/{chunk-AHBTQKKJ.js → chunk-VJITGXD7.js} +2 -2
  19. package/dist/gemini/{chunk-QZZSKH6J.js → chunk-W5TDQYOY.js} +1 -1
  20. package/dist/gemini/{chunk-UFGP2VEQ.js → chunk-XPH4EMMZ.js} +1 -1
  21. package/dist/gemini/{cleanup-M2L7Y3J6.js → cleanup-IEMHEGQL.js} +1 -1
  22. package/dist/gemini/{cleanup-ZJ3DDNQU.js → cleanup-SFYLF5RQ.js} +1 -1
  23. package/dist/gemini/{core-SNF4J4VI.js → core-4QE6N7IV.js} +1 -1
  24. package/dist/gemini/{devtoolsService-FDXINY4I.js → devtoolsService-34NLK5WH.js} +2 -2
  25. package/dist/gemini/{devtoolsService-53YKYRAY.js → devtoolsService-J7RUHF7G.js} +2 -2
  26. package/dist/gemini/{dist-OHEMBVSW.js → dist-3KXWDUDH.js} +1 -1
  27. package/dist/gemini/{gemini-UJXQV7SS.js → gemini-VQICWID3.js} +5 -5
  28. package/dist/gemini/{gemini-LJKZO6ID.js → gemini-XKFI76VG.js} +5 -5
  29. package/dist/gemini/gemini.js +2 -2
  30. package/dist/gemini/{interactiveCli-E5EI2CZT.js → interactiveCli-DX6PGO5O.js} +2 -2
  31. package/dist/gemini/{interactiveCli-PRHLNZCE.js → interactiveCli-QF76UNZ5.js} +2 -2
  32. package/dist/gemini/{liteRtServerManager-5SQ2TTDE.js → liteRtServerManager-DQU232O5.js} +1 -1
  33. package/dist/gemini/{liteRtServerManager-JCWKAJFL.js → liteRtServerManager-HXFM7XV2.js} +1 -1
  34. package/dist/gemini/{oauth2-provider-Q6HTZTKH.js → oauth2-provider-3U23IVR2.js} +1 -1
  35. package/dist/gemini/{oauth2-provider-BA4IPWPG.js → oauth2-provider-SFOTVTXE.js} +1 -1
  36. package/dist/gemini/{start-3PMI6ZVJ.js → start-LAWWIE6I.js} +1 -1
  37. package/dist/gemini/{start-DO44GV2B.js → start-RDNQUCPC.js} +1 -1
  38. package/dist/linux-x64/cc.js +41 -6
  39. package/dist/win32-x64/cc.js +41 -6
  40. package/package.json +4 -4
  41. /package/dist/gemini/{tree-sitter-TTHZYMTS.js → tree-sitter-6LGKSRWQ.js} +0 -0
  42. /package/dist/gemini/{tree-sitter-bash-OIMPM64I.js → tree-sitter-bash-T5FTGOXW.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{$ as cd,$a as uC,$b as kC,Aa as wr,Ab as EC,Ba as c,Bb as dl,Ca as QS,Cb as RC,Da as JS,Db as IC,Ea as ZS,Eb as vC,Fa as Xe,Fb as Sd,G as ol,Ga as dd,Gb as AC,H as wS,Ha as P,Hb as ml,I as ld,Ia as eC,Ib as wC,J as Tf,Ja as de,Jb as sn,K as xc,Ka as Et,Kb as Cd,L as rl,La as Cc,Lb as _C,M as ra,Ma as tC,Mb as Xo,N as _S,Na as oC,Nb as Ec,O as DS,Oa as Qe,Ob as DC,P as MS,Pa as rC,Pb as MC,Q as PS,Qa as md,Qb as PC,R as OS,Ra as nn,Rb as ls,S as xf,Sa as pd,Sb as pl,T as LS,Ta as Ue,Tb as fl,U as NS,Ua as nC,Ub as Ce,V as kS,Va as Ef,Vb as an,W as BS,Wa as iC,Wb as ln,X as dr,Xa as sC,Xb as OC,Y as Sf,Ya as aC,Yb as LC,Z as nl,Za as lC,Zb as cs,_ as HS,_a as cC,_b as NC,aa as FS,ab as dC,ac as BC,ba as Kn,bb as mC,bc as aa,ca as Sc,cb as ul,cc as bd,da as US,db as na,dc as HC,e as ES,ea as il,eb as pC,ec as FC,fa as sl,fb as Rf,fc as cn,ga as al,gb as fC,gc as If,h as RS,ha as ud,hb as ia,hc as Ed,i as IS,ia as GS,ib as sa,ic as Rd,j as tl,ja as WS,jb as bc,jc as UC,k as nt,ka as Cf,kb as gC,kc as Mt,la as VS,lb as hC,lc as Ho,ma as bf,mb as fd,mc as GC,na as $S,nb as yt,nc as Id,oa as qS,ob as yC,oc as WC,p as vS,pa as jn,pb as TC,pc as VC,qa as KS,qb as gd,ra as u,rb as Se,rc as vd,sa as l,sb as xC,sc as $C,ta as jS,tb as SC,ua as zS,ub as CC,va as YS,vb as hd,wa as Bo,wb as yd,xa as ll,xb as Td,y as AS,ya as XS,yb as xd,za as cl,zb as bC}from"./chunk-3MILFT2A.js";import{c as Nt}from"./chunk-TU3BMADG.js";import{b as ad}from"./chunk-REVEB6QQ.js";import{$ as xo,A as uS,B as dS,C as mS,D as ta,E as pS,L as fS,M as gS,P as $n,Q as as,U as vi,V as hS,W as oa,X as Zt,Y as sd,Z as Ht,_ as rn,aa as hf,b as ea,ba as Wr,c as Zx,ca as yS,d as Wn,e as yc,f as Ii,fa as TS,g as eS,ga as xS,h as ff,ha as yf,i as tS,j as oS,ja as SS,ma as CS,o as rS,p as nS,q as Vn,r as iS,ra as qn,s as sS,sa as bS,v as aS,w as gf,x as Tc,y as lS,z as cS}from"./chunk-A3CFCECQ.js";import{a as Yx,b as Qx,c as Jx,e as ur}from"./chunk-L6MG6Y4N.js";import{a as X,b as Zs,c as Xx}from"./chunk-RFHUTEFF.js";import{a as ss,b as Js,h as Gn,j as zx}from"./chunk-M4VGJYXT.js";import{$c as WT,$f as sx,$h as io,$m as Lx,Ac as zu,Ag as px,Ah as Sx,Bc as BT,Bd as ns,Cc as Yu,Cn as Gx,Dc as HT,Dd as jT,De as rf,Eb as Ri,Ef as nf,Fd as zT,Ge as tx,Gi as so,Hb as OT,Hd as YT,Hi as Ja,Ia as Zp,Jc as Xu,Jd as XT,Je as ox,Jl as Rn,Kg as fx,Kl as el,Li as lf,M as IT,Mc as FT,Mn as Wx,Nd as QT,Nh as En,Nl as Ax,O as za,Og as sf,Ol as wx,On as Vx,P as gc,Pb as ef,Pn as pf,Qb as tf,Qg as af,Ql as _x,Rm as rd,Se as zs,U as Jp,Ui as bx,Um as nd,Vb as LT,Wa as AT,Wj as Rx,Xa as wT,Xc as UT,Xh as Xs,Y as vT,Ya as _T,Ye as rx,Ym as id,Zc as of,Zm as Px,_c as GT,_g as Zu,_m as Ox,ac as NT,ag as ax,an as Nx,bd as VT,bk as ed,bn as Qs,bo as Yo,cd as $T,dd as qT,dg as Ys,dl as vx,eg as Xa,en as kx,fg as Qa,fj as cf,fn as df,gj as Ex,hg as lx,hm as uf,hn as Bx,ig as cx,ih as gx,jn as Hx,kg as ux,kh as hx,ko as $x,lc as Ar,le as JT,lh as yx,lm as Dx,ln as Fx,ma as qu,mh as Tx,na as Ku,ne as ZT,nk as is,no as qx,oa as se,oc as kT,of as hc,oh as Ve,oo as Kx,pf as nx,pj as Za,pk as Ix,pn as Ux,po as jx,qc as os,qf as Qu,rc as rs,rd as KT,tb as DT,tf as Ju,tk as td,ub as MT,uf as ix,vg as dx,vi as Cx,vn as mf,we as ex,wm as Mx,x as RT,xb as PT,xh as xx,yc as ju,zc as Ya,zg as mx}from"./chunk-AHBTQKKJ.js";import{$a as Xp,$b as cT,$d as bT,Ac as Wu,D as Ge,Jd as Qp,K as Ei,Ka as nT,Ke as od,L as jy,M as zy,Ma as iT,Oa as sT,Ra as ja,Rc as Vu,Rd as pT,S as Yy,Sc as $u,Sd as fT,T as Xy,Tc as uT,Td as gT,U as jp,Uc as dT,V as Qy,Vc as mT,Vd as hT,W as Jy,Wd as yT,X as ku,Xd as TT,Y as $e,Yd as xT,Z as on,Za as zp,Zd as ST,_a as Yp,_d as CT,aa as Zy,ab as uc,b as ue,bb as dc,c as qy,cb as mc,da as eT,db as ts,eb as pc,fa as tT,fb as Hu,ga as oT,gb as Fu,hb as aT,ia as rT,ib as Uu,j as Ky,jb as fc,me as ET,qe as Fe,sb as Lt,se as xe,t as zo,ua as Bu,ub as Gu,wa as Gr,zb as lT}from"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as vt,c as At,d as nD,e as C}from"./chunk-YUXORC52.js";var oE=At((UH,tE)=>{"use strict";var HD="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";tE.exports=HD});var sE=At((GH,iE)=>{"use strict";var FD=oE();function rE(){}function nE(){}nE.resetWarningCache=rE;iE.exports=function(){function e(r,n,s,i,a,d){if(d!==FD){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:nE,resetWarningCache:rE};return o.PropTypes=o,o}});var lE=At(($H,aE)=>{aE.exports=sE()();var WH,VH});var pE=At((qH,jd)=>{"use strict";var uE=ad(),UD=cS(),cE=/\s/g;function Uf(...e){let t=UD.apply(this,e),o=(r,n)=>GD(r?r.toString():"",t,n);return o.multiline=(r,n)=>WD(r?r.toString():"",t,n),o}var dE=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function GD(e,t,o){let r=mE(o),n=Math.max(e.replace(cE,"").length,t.stops.length),s=dE(t,r,n),i="";for(let a of e)i+=a.match(cE)?a:uE.hex(s.shift().toHex())(a);return i}function WD(e,t,o){let r=mE(o),n=e.split(`
2
+ import{$ as cd,$a as uC,$b as kC,Aa as wr,Ab as EC,Ba as c,Bb as dl,Ca as QS,Cb as RC,Da as JS,Db as IC,Ea as ZS,Eb as vC,Fa as Xe,Fb as Sd,G as ol,Ga as dd,Gb as AC,H as wS,Ha as P,Hb as ml,I as ld,Ia as eC,Ib as wC,J as Tf,Ja as de,Jb as sn,K as xc,Ka as Et,Kb as Cd,L as rl,La as Cc,Lb as _C,M as ra,Ma as tC,Mb as Xo,N as _S,Na as oC,Nb as Ec,O as DS,Oa as Qe,Ob as DC,P as MS,Pa as rC,Pb as MC,Q as PS,Qa as md,Qb as PC,R as OS,Ra as nn,Rb as ls,S as xf,Sa as pd,Sb as pl,T as LS,Ta as Ue,Tb as fl,U as NS,Ua as nC,Ub as Ce,V as kS,Va as Ef,Vb as an,W as BS,Wa as iC,Wb as ln,X as dr,Xa as sC,Xb as OC,Y as Sf,Ya as aC,Yb as LC,Z as nl,Za as lC,Zb as cs,_ as HS,_a as cC,_b as NC,aa as FS,ab as dC,ac as BC,ba as Kn,bb as mC,bc as aa,ca as Sc,cb as ul,cc as bd,da as US,db as na,dc as HC,e as ES,ea as il,eb as pC,ec as FC,fa as sl,fb as Rf,fc as cn,ga as al,gb as fC,gc as If,h as RS,ha as ud,hb as ia,hc as Ed,i as IS,ia as GS,ib as sa,ic as Rd,j as tl,ja as WS,jb as bc,jc as UC,k as nt,ka as Cf,kb as gC,kc as Mt,la as VS,lb as hC,lc as Ho,ma as bf,mb as fd,mc as GC,na as $S,nb as yt,nc as Id,oa as qS,ob as yC,oc as WC,p as vS,pa as jn,pb as TC,pc as VC,qa as KS,qb as gd,ra as u,rb as Se,rc as vd,sa as l,sb as xC,sc as $C,ta as jS,tb as SC,ua as zS,ub as CC,va as YS,vb as hd,wa as Bo,wb as yd,xa as ll,xb as Td,y as AS,ya as XS,yb as xd,za as cl,zb as bC}from"./chunk-ACEDFBEP.js";import{c as Nt}from"./chunk-TU3BMADG.js";import{b as ad}from"./chunk-356OVHGG.js";import{$ as xo,A as uS,B as dS,C as mS,D as ta,E as pS,L as fS,M as gS,P as $n,Q as as,U as vi,V as hS,W as oa,X as Zt,Y as sd,Z as Ht,_ as rn,aa as hf,b as ea,ba as Wr,c as Zx,ca as yS,d as Wn,e as yc,f as Ii,fa as TS,g as eS,ga as xS,h as ff,ha as yf,i as tS,j as oS,ja as SS,ma as CS,o as rS,p as nS,q as Vn,r as iS,ra as qn,s as sS,sa as bS,v as aS,w as gf,x as Tc,y as lS,z as cS}from"./chunk-S5WFVXWE.js";import{a as Yx,b as Qx,c as Jx,e as ur}from"./chunk-CNS6SZJ6.js";import{a as X,b as Zs,c as Xx}from"./chunk-VFMKTMIZ.js";import{a as ss,b as Js,h as Gn,j as zx}from"./chunk-CJ5VLAB6.js";import{$c as WT,$f as sx,$h as io,$m as Lx,Ac as zu,Ag as px,Ah as Sx,Bc as BT,Bd as ns,Cc as Yu,Cn as Gx,Dc as HT,Dd as jT,De as rf,Eb as Ri,Ef as nf,Fd as zT,Ge as tx,Gi as so,Hb as OT,Hd as YT,Hi as Ja,Ia as Zp,Jc as Xu,Jd as XT,Je as ox,Jl as Rn,Kg as fx,Kl as el,Li as lf,M as IT,Mc as FT,Mn as Wx,Nd as QT,Nh as En,Nl as Ax,O as za,Og as sf,Ol as wx,On as Vx,P as gc,Pb as ef,Pn as pf,Qb as tf,Qg as af,Ql as _x,Rm as rd,Se as zs,U as Jp,Ui as bx,Um as nd,Vb as LT,Wa as AT,Wj as Rx,Xa as wT,Xc as UT,Xh as Xs,Y as vT,Ya as _T,Ye as rx,Ym as id,Zc as of,Zm as Px,_c as GT,_g as Zu,_m as Ox,ac as NT,ag as ax,an as Nx,bd as VT,bk as ed,bn as Qs,bo as Yo,cd as $T,dd as qT,dg as Ys,dl as vx,eg as Xa,en as kx,fg as Qa,fj as cf,fn as df,gj as Ex,hg as lx,hm as uf,hn as Bx,ig as cx,ih as gx,jn as Hx,kg as ux,kh as hx,ko as $x,lc as Ar,le as JT,lh as yx,lm as Dx,ln as Fx,ma as qu,mh as Tx,na as Ku,ne as ZT,nk as is,no as qx,oa as se,oc as kT,of as hc,oh as Ve,oo as Kx,pf as nx,pj as Za,pk as Ix,pn as Ux,po as jx,qc as os,qf as Qu,rc as rs,rd as KT,tb as DT,tf as Ju,tk as td,ub as MT,uf as ix,vg as dx,vi as Cx,vn as mf,we as ex,wm as Mx,x as RT,xb as PT,xh as xx,yc as ju,zc as Ya,zg as mx}from"./chunk-VJITGXD7.js";import{$a as Xp,$b as cT,$d as bT,Ac as Wu,D as Ge,Jd as Qp,K as Ei,Ka as nT,Ke as od,L as jy,M as zy,Ma as iT,Oa as sT,Ra as ja,Rc as Vu,Rd as pT,S as Yy,Sc as $u,Sd as fT,T as Xy,Tc as uT,Td as gT,U as jp,Uc as dT,V as Qy,Vc as mT,Vd as hT,W as Jy,Wd as yT,X as ku,Xd as TT,Y as $e,Yd as xT,Z as on,Za as zp,Zd as ST,_a as Yp,_d as CT,aa as Zy,ab as uc,b as ue,bb as dc,c as qy,cb as mc,da as eT,db as ts,eb as pc,fa as tT,fb as Hu,ga as oT,gb as Fu,hb as aT,ia as rT,ib as Uu,j as Ky,jb as fc,me as ET,qe as Fe,sb as Lt,se as xe,t as zo,ua as Bu,ub as Gu,wa as Gr,zb as lT}from"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as vt,c as At,d as nD,e as C}from"./chunk-YUXORC52.js";var oE=At((UH,tE)=>{"use strict";var HD="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";tE.exports=HD});var sE=At((GH,iE)=>{"use strict";var FD=oE();function rE(){}function nE(){}nE.resetWarningCache=rE;iE.exports=function(){function e(r,n,s,i,a,d){if(d!==FD){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:nE,resetWarningCache:rE};return o.PropTypes=o,o}});var lE=At(($H,aE)=>{aE.exports=sE()();var WH,VH});var pE=At((qH,jd)=>{"use strict";var uE=ad(),UD=cS(),cE=/\s/g;function Uf(...e){let t=UD.apply(this,e),o=(r,n)=>GD(r?r.toString():"",t,n);return o.multiline=(r,n)=>WD(r?r.toString():"",t,n),o}var dE=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function GD(e,t,o){let r=mE(o),n=Math.max(e.replace(cE,"").length,t.stops.length),s=dE(t,r,n),i="";for(let a of e)i+=a.match(cE)?a:uE.hex(s.shift().toHex())(a);return i}function WD(e,t,o){let r=mE(o),n=e.split(`
3
3
  `),s=Math.max.apply(null,n.map(d=>d.length).concat([t.stops.length])),i=dE(t,r,s),a=[];for(let d of n){let m=i.slice(0),f="";for(let h of d)f+=uE.hex(m.shift().toHex())(h);a.push(f)}return a.join(`
4
4
  `)}function mE(e){let t={interpolation:"rgb",hsvSpin:"short",...e};if(e!==void 0&&typeof e!="object")throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof e}\``);if(typeof t.interpolation!="string")throw new TypeError(`Expected \`options.interpolation\` to be a \`string\`, got \`${typeof t.interpolation}\``);if(t.interpolation.toLowerCase()==="hsv"&&typeof t.hsvSpin!="string")throw new TypeError(`Expected \`options.hsvSpin\` to be a \`string\`, got \`${typeof t.hsvSpin}\``);return t}var Mc={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};jd.exports=Uf;for(let e in Mc)jd.exports[e]=t=>new Uf(Mc[e].colors)(t,Mc[e].options),jd.exports[e].multiline=t=>new Uf(Mc[e].colors).multiline(t,Mc[e].options)});var Bg=At(Ma=>{Ma.parse=Ma.decode=hL;Ma.stringify=Ma.encode=_A;Ma.safe=Vl;Ma.unsafe=np;var kg=typeof process<"u"&&process.platform==="win32"?`\r
5
5
  `:`
@@ -116,7 +116,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
116
116
  `),await ur())}jo("authenticated")},[i,r,jo,Ur,$s]),Ph=(0,$.useCallback)(async U=>{try{if(Ur(null),!U.trim()){Ur("API key cannot be empty or whitespace only.");return}await yx(U),await xh(),await r.refreshAuth(Ve.USE_GEMINI),jo("authenticated")}catch(pe){Ur(`Failed to save API key: ${pe instanceof Error?pe.message:String(pe)}`)}},[jo,Ur,xh,r]),Oh=(0,$.useCallback)(()=>{jo("updating")},[jo]);(0,$.useEffect)(()=>{Hn==="authenticated"&&(F(r.getUserTier()),ot(r.getUserPaidTier()))},[r,Hn]),(0,$.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)Ur(`Authentication is enforced to be ${i.merged.security.auth.enforcedType}, but you are currently using ${i.merged.security.auth.selectedType}.`);else if(i.merged.security.auth.selectedType&&!i.merged.security.auth.useExternal){if(i.merged.security.auth.selectedType===Ve.USE_GEMINI)return;let U=vd(i.merged.security.auth.selectedType);U&&Ur(U)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,Ur]);let{isModelDialogOpen:Ip,openModelDialog:Lh,closeModelDialog:Nh}=Hv(),{isVoiceModelDialogOpen:vp,openVoiceModelDialog:yu,closeVoiceModelDialog:kh}=Fv(),{toggleVimEnabled:I_}=ml(),Ap=(0,$.useRef)(()=>{}),[qa,qs]=(0,$.useState)(!1),{cleanUiDetailsVisible:Tu,setCleanUiDetailsVisible:Bh,toggleCleanUiDetailsVisible:Hh,revealCleanUiDetailsTemporarily:xu}=x_(),v_=(0,$.useMemo)(()=>({openAuthDialog:()=>jo("updating"),openThemeDialog:gh,openEditorDialog:Jl,openPrivacyNotice:()=>N(!0),openSettingsDialog:ph,openSessionBrowser:hu,openModelDialog:Lh,openVoiceModelDialog:yu,openAgentConfigDialog:Ee,openPermissionsDialog:xi,quit:U=>{mu(),M(U),setTimeout(async()=>{await Gn(),lh.exit(0)},100)},setDebugMessage:_,toggleCorgiMode:()=>y(U=>!U),toggleVoiceMode:()=>xt(U=>!U),toggleDebugProfiler:ze,dispatchExtensionStateUpdate:Gs,addConfirmUpdateExtensionRequest:lr,toggleBackgroundTasks:()=>{ee.current(),W.current||(H(!0),K.current.size>1?Ap.current(!0):Ap.current(!1))},toggleShortcutsHelp:()=>qs(U=>!U),setText:ch}),[jo,gh,mu,Jl,ph,hu,Lh,yu,Ee,M,_,N,y,Gs,xi,lr,ze,qs,ch]),{handleSlashCommand:Ci,slashCommands:Su,pendingHistoryItems:Cu,commandContext:Fh,confirmationRequest:Ks}=Wv(r,i,x.addItem,x.clearItems,x.loadHistory,Yt,I_,G,v_,zi,rt,Xr,J),[oc,Uh]=(0,$.useState)(null),[bu,Gh]=(0,$.useState)(null);(0,$.useEffect)(()=>{let U=pe=>{Uh({prompt:pe.prompt,onConfirm:ce=>{Uh(null),pe.onConfirm(ce)}})};return xe.on(Fe.ConsentRequest,U),()=>{xe.off(Fe.ConsentRequest,U)}},[]);let A_=(0,$.useCallback)(async()=>{x.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let U,pe;if(r.isJitContextEnabled())await r.getMemoryContextManager()?.refresh(),r.updateSystemInstructionIfInitialized(),U=uf(r.getUserMemory()),pe=r.getGeminiMdFileCount();else{let ce=await od(r);U=uf(ce.memoryContent),pe=ce.fileCount}x.addItem({type:"info",text:`Memory reloaded successfully. ${U.length>0?`Loaded ${U.length} characters from ${pe} file(s)`:"No memory content found"}`},Date.now()),r.getDebugMode()&&ue.log(`[DEBUG] Refreshed memory content in config: ${U.substring(0,200)}...`)}catch(U){let pe=Gr(U);x.addItem({type:"error",text:`Error refreshing memory: ${pe}`},Date.now()),ue.warn("Error refreshing memory:",U)}},[r,x]),wp=(0,$.useRef)(()=>{}),Wh=(0,$.useCallback)((U,pe=!1)=>{U?Y(!0):(Y(!1),wp.current(!1,pe))},[]);(0,$.useEffect)(()=>{if(V){let U=x.history.findLast(ce=>ce.type==="user"),pe=vo.at(-1);(!U||typeof U.text=="string"&&U.text===pe)&&(wp.current(!0),Y(!1))}},[V,vo,x.history]);let Eu=(0,$.useRef)([]),[w_,Vh]=(0,$.useState)(0),_p=(0,$.useCallback)(()=>{if(Eu.current.length===0)return null;let U=Eu.current.join(`
117
117
  `);return Eu.current=[],Vh(0),U},[]);(0,$.useEffect)(()=>{let U=(pe,ce)=>{ce!=="user_steering"&&ce!=="background_completion"||(Eu.current.push(pe),Vh(ve=>ve+1))};return r.injectionService.onInjection(U),()=>{r.injectionService.offInjection(U)}},[r]);let $h=(0,$.useMemo)(()=>r?.getAgentSessionInteractiveEnabled()?new Gx({config:r,getPreferredEditor:Va}):void 0,[r,Va]),__=$h?rA({agent:$h,addItem:x.addItem,onCancelSubmit:Wh,isShellFocused:B,logger:Io}):tA(r.getGeminiClient(),x.history,x.addItem,r,i,_,Ci,ge,Va,Ur,A_,Vi,gi,Wh,H,Ye,ht,B,_p),{streamingState:To,submitQuery:Ka,initError:Dp,pendingHistoryItems:Ru,thought:rc,cancelOngoingRequest:qh,pendingToolCalls:D_,handleApprovalModeChange:Kh,activePtyId:Ji,loopDetectionConfirmationRequest:Iu,lastOutputTime:Mp,backgroundTaskCount:Pp,isBackgroundTaskVisible:Fn,toggleBackgroundTasks:vu,backgroundCurrentExecution:jh,backgroundTasks:Un,dismissBackgroundTask:zh,retryStatus:M_}=__,wo=(0,$.useMemo)(()=>[...Cu,...Ru],[Cu,Ru]);ee.current=vu,W.current=Fn,K.current=Un;let{activeBackgroundTaskPid:Yh,setIsBackgroundTaskListOpen:js,isBackgroundTaskListOpen:Xh,setActiveBackgroundTaskPid:Qh,backgroundTaskHeight:Op}=i_({backgroundTasks:Un,backgroundTaskCount:Pp,isBackgroundTaskVisible:Fn,activePtyId:Ji,embeddedShellFocused:B,setEmbeddedShellFocused:H,terminalHeight:ht});Ap.current=js;let nc=(0,$.useRef)(0);(0,$.useEffect)(()=>{nc.current=Mp},[Mp]);let{shouldShowFocusHint:P_,inactivityStatus:Jh}=lA({activePtyId:Ji,lastOutputTime:Mp,streamingState:To,pendingToolCalls:D_,embeddedShellFocused:B,isInteractiveShellEnabled:r.isInteractiveShellEnabled()}),Zh=Jh==="action_required",ey=Jh==="silent_working",O_=(0,$.useCallback)(U=>{Kh(U),Tu||xu(ah)},[Kh,Tu,xu]),{isMcpReady:ic}=Yw(r),Au=(0,$.useMemo)(()=>wo.some(U=>U.type==="compression"&&U.compression.isPending),[wo]),{messageQueue:wu,addMessage:_u,clearQueue:ty,getQueuedMessagesText:oy,popAllMessages:ry}=zw({isConfigInitialized:rt,streamingState:To,submitQuery:Ka,isMcpReady:ic,isCompressing:Au});wp.current=(0,$.useCallback)((U=!0,pe=!1)=>{if(!pe&&qd(wo))return;if(!U){pe&&Si.setText("");return}let ve=vo.at(-1)||"",mt=oy();mt&&(ve=ve?`${ve}
118
118
 
119
- ${mt}`:mt,ty()),ve&&Si.setText(ve)},[Si,vo,oy,ty,wo]);let ny=(0,$.useCallback)(U=>{let pe=U.trim();pe&&(r.injectionService.addInjection(pe,"user_steering"),x.addItem({type:"hint",text:pe}))},[r,x]),sc=(0,$.useCallback)(async U=>{a(),ho(null),Ie||(go(!0),S||Yt());let pe=dr(U.trim()),ce=To==="idle",ve=To==="responding"||Bf(wo);if(pe&&ve){let{commandToExecute:es}=nl(U,Su??[]);if(es?.isSafeConcurrent){Ci(U),ko(U);return}}if(r.isModelSteeringEnabled()&&ve&&!pe){ny(U),ko(U);return}let mt=rt&&ic;if(pe&&rt||!Au&&ce&&mt){if(!pe){let es=await NS(U,r);if(es.length>0){Gh({files:es,onComplete:oD=>{Gh(null),oD.allowed&&es.forEach(rD=>r.getWorkspaceContext().addReadOnlyPath(rD)),Ka(U)}}),ko(U);return}}Ka(U)}else ce&&!Au&&!mt&&wu.length===0&&xe.emitFeedback("info",rt?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),_u(U);ko(U)},[_u,ko,Ka,Ci,Su,ic,To,Au,wu.length,wo,r,Ie,go,S,Yt,a,ny,rt,ho]),iy=(0,$.useCallback)(()=>{a(),ho(null),x.clearItems(),Qi(),Yt()},[x,Qi,Yt,a,ho]),{handleInput:sy}=iA(Si,sc),Lp=!Dp&&!L&&!Ep&&(To==="idle"||To==="responding"||To==="waiting_for_confirmation")&&!ec,ac=(0,$.useRef)(null);(0,$.useEffect)(()=>()=>{ac.current?.disconnect()},[]);let[Du,L_]=(0,$.useState)(0),[ay,N_]=(0,$.useState)(0);(0,$.useLayoutEffect)(()=>{!ie&&Du>0&&N_(Du)},[ie,Du]);let Np=ie&&ay>0?ay:Du,ly=(0,$.useCallback)(U=>{if(ac.current&&(ac.current.disconnect(),ac.current=null),U){let pe=new jn(ce=>{let ve=ce[0];if(ve){let mt=Math.round(ve.contentRect.height);L_(es=>mt!==es?mt:es)}});pe.observe(U),ac.current=pe}},[]),kp=Math.max(0,ht-Np-Op-1);r.setShellExecutionConfig({terminalWidth:Math.floor(Ye*LN),terminalHeight:Math.max(Math.floor(kp-NN),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:r.sanitizationConfig,sandboxManager:r.sandboxManager});let{isFocused:Mu,hasReceivedFocusEvent:k_}=JS(),cy=(0,$.useMemo)(()=>{let U=i.merged.context.fileName;return U?Array.isArray(U)?U:[U]:ET()},[i.merged.context.fileName]),Bp=(0,$.useMemo)(()=>r.getQuestion(),[r]),uy=(0,$.useRef)(!1),dy=r.getGeminiClient();(0,$.useEffect)(()=>{Bp&&rt&&!uy.current&&!$a&&!tc&&!Zl&&!Ql&&!D&&dy?.isInitialized?.()&&(sc(Bp),uy.current=!0)},[Bp,rt,sc,$a,tc,Zl,Ql,D,dy]);let[B_,H_]=(0,$.useState)(!1),[Hp,F_]=(0,$.useState)(null);(0,$.useEffect)(()=>{(async()=>{let ce=(await Ys.getInstance()).getCurrentIde();F_(ce||null)})()},[]);let Fp=!!(Hp&&!r.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!B_),[Pu,lc]=(0,$.useState)(!1),[my,U_]=(0,$.useState)(!1),[py,G_]=(0,$.useState)(!0),fy=(0,$.useCallback)(U=>{U>2&&wT(r),U>1&&Ci("/quit",void 0,void 0,!1)},[r,Ci]),{pressCount:gy,handlePress:hy}=Nl({windowMs:Ii,onRepeat:fy}),{pressCount:yy,handlePress:Ty}=Nl({windowMs:Ii,onRepeat:fy}),[Ou,xy]=(0,$.useState)(),[Sy,W_]=(0,$.useState)(!1),[Up,V_]=(0,$.useState)(!1),[Cy,bi]=hp(Ii),{isFolderTrustDialogOpen:Gp,discoveryResults:by,handleFolderTrustSelect:Ey,isRestarting:Ry}=cA(i,Ga,x.addItem),Wp=r.getPolicyUpdateConfirmationRequest(),[Vp,Iy]=(0,$.useState)(!!Wp),{needsRestart:vy,restartReason:Ay}=TC(),wy=(0,$.useRef)(!0);t_(r,hi,x,J);let Zi=(0,$.useRef)(null);(0,$.useEffect)(()=>{let U=ve=>{bi({text:ve.message,type:ve.type})},pe=()=>{bi({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},ce=()=>{bi({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Nt.on("transient-message",U),Nt.on("selection-warning",pe),Nt.on("paste-timeout",ce),()=>{Nt.off("transient-message",U),Nt.off("selection-warning",pe),Nt.off("paste-timeout",ce),Zi.current&&clearTimeout(Zi.current)}},[bi]);let $p=(0,$.useCallback)(U=>{bi({text:U,type:"warning"})},[bi]),{handleSuspend:_y}=l_({handleWarning:$p,setRawMode:zt,refreshStatic:Yt,setForceRerenderKey:R,shouldUseAlternateScreen:xp});(0,$.useEffect)(()=>{vy&&V_(!0)},[vy]),(0,$.useEffect)(()=>{if(wy.current){wy.current=!1;return}let U=setTimeout(()=>{Yt()},300);return()=>{clearTimeout(U)}},[Ye,Yt]),(0,$.useEffect)(()=>{let U=nf.subscribe(xy);return xy(nf.get()),U},[]),(0,$.useEffect)(()=>{let U=()=>{lc(!0),go(!1)};return Nt.on("open-debug-console",U),()=>{Nt.off("open-debug-console",U)}},[r]);let Dy=(0,$.useCallback)(U=>{W_(U)},[]),My=(0,$.useCallback)(U=>{U.userSelection==="yes"?(Ci("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):U.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),H_(!0)},[Ci,i]),$_=(0,$.useCallback)(U=>{if(i.merged.general.debugKeystrokeLogging&&ue.log("[DEBUG] Keystroke:",JSON.stringify(U)),qa&&t(U)&&qs(!1),o["app.toggleMouseMode"](U))return A(ve=>!ve),I&&!S&&Nt.emit("scroll-to-bottom"),!0;if(S&&o["app.toggleCopyMode"](U))return be(!0),rs(),!0;if(o["basic.quit"](U))return qh?.(),hy(),!0;if(o["basic.exit"](U))return Tp.current.text.length>0?!1:(Ty(),!0);if(o["app.suspend"](U))_y();else if(o["app.dumpFrame"](U)){let mt=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return h&&(h(mt),ue.log(`Dumped frame to: ${mt}`)),!0}else if(o["app.startRecording"](U)){let mt=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(mt),g.current=mt,ue.log(`Started recording to: ${mt}`)),!0}else{if(o["app.stopRecording"](U))return T&&(T(),ue.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](U)&&!S)return bi({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let pe=()=>{ho(!0);let ve=zb(x.history,wo);ve.length>0&&Oe(ve)},ce=!1;if(Ie||(ce=!0,go(!0),o["app.showMoreLines"](U)&&pe(),S||Yt()),o["app.showErrorDetails"](U))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:ve}=await import("./devtoolsService-53YKYRAY.js");await ve(r,Pu,()=>lc(mt=>!mt),()=>lc(!0))})():lc(ve=>!ve),!0;if(o["app.showFullTodos"](U))return U_(ve=>!ve),!0;if(o["app.toggleMarkdown"](U))return G_(ve=>{let mt=!ve;return Yt(),mt}),!0;if(o["app.showIdeContextDetail"](U)&&r.getIdeMode()&&Ou)return Ci("/ide status"),!0;if(o["app.showMoreLines"](U)&&!ce)return go(!1),pe(),Yt(),!0;if((o["app.focusShellInput"](U)||o["background.unfocusList"](U))&&(Ji||Fn&&Un.size>0)){if(B){let mt=nc.current;return Zi.current&&clearTimeout(Zi.current),Zi.current=setTimeout(()=>{nc.current===mt?H(!1):bi({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-nc.current>=100&&!Ji&&!Fn?(Zi.current&&clearTimeout(Zi.current),vu(),H(!0),Un.size>1&&js(!0),!0):(H(!0),!0)}else{if(o["app.unfocusShellInput"](U)||o["background.unfocus"](U))return B?(H(!1),!0):!1;if(o["background.toggle"](U))return Ji?jh():(vu(),!Fn&&Un.size>0?(H(!0),Un.size>1&&js(!0)):H(!1)),!0;if(o["background.toggleList"](U))return Un.size>0&&Fn&&(B||H(!0),js(!0)),!0}return!1},[Ie,go,lc,r,Ou,hy,Ty,Ci,qh,Ji,_y,B,i.merged.general.debugKeystrokeLogging,Yt,be,Zi,S,qa,jh,vu,Un,Fn,js,nc,bi,i.merged.general.devtools,Pu,ho,o,t,x.history,wo,Oe,h,p,T,I]);de($_,{isActive:!0,priority:!0}),de(U=>o["scroll.up"](U)||o["scroll.down"](U)||o["scroll.pageUp"](U)||o["scroll.pageDown"](U)||o["scroll.home"](U)||o["scroll.end"](U)?!1:(be(!1),I&&os(),!0),{isActive:ie,priority:200}),(0,$.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let U=jm({streamingState:To,thoughtSubject:rc?.subject,isConfirming:!!Ks||Zh,isSilentWorking:ey,folderName:ON(r.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});Zr.current!==U&&(Zr.current=U,Ko.write(`\x1B]0;${U}\x07`))},[To,rc,Ks,Zh,ey,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,r,Ko]),(0,$.useEffect)(()=>{let U=ce=>{let ve;switch(ce.severity){case"error":ve="error";break;case"warning":ve="warning";break;case"info":ve="info";break;default:throw new Error(`Unexpected severity for user feedback: ${ce.severity}`)}x.addItem({type:ve,text:ce.message},Date.now()),ce.error&&ue.warn(`[Feedback Details for "${ce.message}"]`,ce.error)},pe=ce=>{x.addItem({type:"info",text:ce.message,source:ce.hookName},Date.now())};return xe.on(Fe.UserFeedback,U),xe.on(Fe.HookSystemMessage,pe),xe.drainBacklogs(),()=>{xe.off(Fe.UserFeedback,U),xe.off(Fe.HookSystemMessage,pe)}},[x]);let Py=e.version.includes("nightly"),qp=Hn==="awaiting_login_restart",Oy=i.merged.security.auth.selectedType===Ve.USE_VERTEX_AI?"Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings.":void 0,Ly=Fp||Gp||Vp||j||!!Ks||!!oc||!!bu||!!te||qo.length>0||!!Iu||Zl||Cp||Ip||vp||Nn||Yi||$a||tc||Ql||D||Up||!!ec||!!pu||!!fu||!!gu||Rp||Hn==="awaiting_api_key_input"||qp||!!po,q_=(0,$.useMemo)(()=>qd(wo),[wo]),Ny=qo.length>0,ky=!!Iu,cc=q_||!!Ks||!!oc||Ny||ky||!!ec||!!pu||!!fu||!!gu||!!te,Lu=i.merged.ui.loadingPhrases,K_=Lu==="tips"||Lu==="all",j_=Lu==="witty"||Lu==="all",z_=(!B||Fn)&&To==="responding"&&!cc,Nu=0;if(Ir.length>0&&i.merged.hooksConfig.notifications){let U=Ir.length>1?"Executing Hooks":"Executing Hook",pe=Ir.map(ce=>ce.name+(ce.index&&ce.total&&ce.total>1?` (${ce.index}/${ce.total})`:"")).join(", ");Nu=U.length+pe.length+10}else z_?Nu=(rc?.subject||"Waiting for model...").length+25:cc&&(Nu=35);let Y_=Ye-Nu-5,{elapsedTime:By,currentLoadingPhrase:Hy,currentTip:Fy,currentWittyPhrase:Uy}=aA({streamingState:To,shouldShowFocusHint:P_,retryStatus:M_,showTips:K_,showWit:j_,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:Y_}),Kp=r.isPlanEnabled()&&To==="idle"&&!cc,Gy=Xw({config:r,addItem:x.addItem,onApprovalModeChange:O_,isActive:!B,allowPlanMode:Kp});y_({notificationsEnabled:d,notificationMethod:m,isFocused:Mu,hasReceivedFocusEvent:k_,streamingState:To,hasPendingActionRequired:cc,pendingHistoryItems:wo,commandConfirmationRequest:Ks,authConsentRequest:oc,permissionConfirmationRequest:bu,hasConfirmUpdateExtensionRequests:Ny,hasLoopDetectionConfirmationRequest:ky});let Wy=Lp&&To==="idle"&&!cc;(0,$.useEffect)(()=>{qa&&!Wy&&qs(!1)},[qa,Wy,qs]),(0,$.useEffect)(()=>{if(!rt||!r.isModelSteeringEnabled()||To!=="idle"||!ic||qd(wo))return;let U=_p();U&&Ka([{text:ed(U)}])},[r,x,rt,ic,To,Ka,_p,wo,w_]);let X_=(0,$.useMemo)(()=>Kd(wo),[wo]),[Vy,Q_]=(0,$.useState)(r.getGeminiMdFileCount());(0,$.useEffect)(()=>{let U=pe=>{Q_(pe.fileCount)};return xe.on(Fe.MemoryChanged,U),()=>{xe.off(Fe.MemoryChanged,U)}},[]),(0,$.useEffect)(()=>{let U=!0;return(async()=>{let[ce,ve]=await Promise.all([r.getBannerTextNoCapacityIssues(),r.getBannerTextCapacityIssues()]);U&&(yo(ce),qi(ve),Xr(!0))})(),()=>{U=!1}},[r,Yt]);let J_=(0,$.useMemo)(()=>({buffer:Si,userMessages:vo,shellModeActive:ge,showEscapePrompt:Sy,copyModeEnabled:ie,inputWidth:Bn,suggestionsWidth:Yl}),[Si,vo,ge,Sy,ie,Bn,Yl]),Z_=(0,$.useMemo)(()=>({userTier:Fr,stats:Re,proQuotaRequest:ec,validationRequest:pu,overageMenuRequest:fu,emptyWalletRequest:gu}),[Fr,Re,ec,pu,fu,gu]),eD=(0,$.useMemo)(()=>({history:x.history,historyManager:x,isThemeDialogOpen:Zl,themeError:O,isAuthenticating:$a,isConfigInitialized:rt,authError:yh,accountSuspensionInfo:Sh,isAuthDialogOpen:tc,isAwaitingApiKeyInput:Hn==="awaiting_api_key_input",isAwaitingLoginRestart:qp,loginRestartMessage:Oy,apiKeyDefaultValue:Th,editorError:uh,isEditorDialogOpen:Ql,showPrivacyNotice:D,mouseMode:I,corgiMode:E,debugMessage:b,quittingMessages:w,isSettingsDialogOpen:Cp,isSessionBrowserOpen:Rp,isModelDialogOpen:Ip,isVoiceModelDialogOpen:vp,isAgentConfigDialogOpen:Nn,selectedAgentName:ne,selectedAgentDisplayName:le,selectedAgentDefinition:ye,isPermissionsDialogOpen:Yi,permissionsDialogProps:Qr,slashCommands:Su,pendingSlashCommandHistoryItems:Cu,commandContext:Fh,commandConfirmationRequest:Ks,authConsentRequest:oc,confirmUpdateExtensionRequests:qo,loopDetectionConfirmationRequest:Iu,permissionConfirmationRequest:bu,geminiMdFileCount:Vy,streamingState:To,initError:Dp,pendingGeminiHistoryItems:Ru,thought:rc,isInputActive:Lp,isVoiceModeEnabled:lt,isResuming:Ep,shouldShowIdePrompt:Fp,isFolderTrustDialogOpen:Gp??!1,folderDiscoveryResults:by,isPolicyUpdateDialogOpen:Vp,policyUpdateConfirmationRequest:Wp,isTrustedFolder:hi,constrainHeight:Ie,showErrorDetails:Pu,showFullTodos:my,ideContextState:Ou,renderMarkdown:py,ctrlCPressedOnce:gy>=1,ctrlDPressedOnce:yy>=1,shortcutsHelpVisible:qa,cleanUiDetailsVisible:Tu,isFocused:Mu,elapsedTime:By,currentLoadingPhrase:Hy,currentTip:Fy,currentWittyPhrase:Uy,historyRemountKey:Rr,activeHooks:Ir,messageQueue:wu,queueErrorMessage:Hs,showApprovalModeIndicator:Gy,allowPlanMode:Kp,currentModel:st,contextFileNames:cy,errorCount:tn,availableTerminalHeight:kp,stableControlsHeight:Np,mainAreaWidth:kn,staticAreaMaxItemHeight:Xl,staticExtraHeight:en,dialogsVisible:Ly,pendingHistoryItems:wo,nightly:Py,branchName:bn,sessionStats:Ao,terminalWidth:Ye,terminalHeight:ht,mainControlsRef:ly,rootUiRef:Jr,currentIDE:Hp,updateInfo:Bs,showIdeRestartPrompt:Up,ideTrustRestartReason:Ay,isRestarting:Ry,extensionsUpdateState:ji,activePtyId:Ji,backgroundTaskCount:Pp,isBackgroundTaskVisible:Fn,embeddedShellFocused:B,showDebugProfiler:q,customDialog:te,transientMessage:Cy,bannerData:vr,bannerVisible:$o,terminalBackgroundColor:r.getTerminalBackground(),settingsNonce:Br,backgroundTasks:Un,activeBackgroundTaskPid:Yh,backgroundTaskHeight:Op,isBackgroundTaskListOpen:Xh,adminSettingsChanged:j,newAgents:po,showIsExpandableHint:Hr,hintMode:r.isModelSteeringEnabled()&&Bf(wo),hintBuffer:""}),[Zl,O,$a,rt,yh,Sh,tc,uh,Ql,D,I,E,b,w,Cp,Rp,Ip,vp,Nn,ne,le,ye,Yi,Qr,Su,Cu,Fh,Ks,oc,qo,Iu,bu,Vy,To,Dp,Ru,rc,Lp,lt,Ep,Fp,Gp,by,Vp,Wp,hi,Ie,Pu,my,Ou,py,gy,yy,qa,Tu,Mu,By,Hy,Fy,Uy,Rr,Ir,wu,Hs,Gy,Kp,cy,tn,kp,Np,kn,Xl,en,Ly,wo,Py,bn,Ao,Ye,ht,ly,Jr,Hp,Bs,Up,Ay,Ry,st,ji,Ji,Pp,Fn,x,B,q,te,Th,Hn,qp,Oy,Cy,vr,$o,r,Br,Op,Xh,Yh,Un,j,po,Hr]),$y=(0,$.useCallback)(()=>N(!1),[N]),tD=(0,$.useMemo)(()=>({handleThemeSelect:bp,closeThemeDialog:mu,handleThemeHighlight:hh,handleAuthSelect:Mh,setAuthState:jo,onAuthError:Ur,handleEditorSelect:dh,exitEditorDialog:mh,exitPrivacyNotice:$y,closeSettingsDialog:fh,closeModelDialog:Nh,openVoiceModelDialog:yu,closeVoiceModelDialog:kh,openAgentConfigDialog:Ee,closeAgentConfigDialog:St,openPermissionsDialog:xi,closePermissionsDialog:Ws,setShellModeActive:jt,vimHandleInput:sy,handleIdePromptComplete:My,handleFolderTrustSelect:Ey,setIsPolicyUpdateDialogOpen:Iy,setConstrainHeight:go,onEscapePromptChange:Dy,refreshStatic:Yt,handleFinalSubmit:sc,handleClearScreen:iy,handleProQuotaChoice:Eh,handleValidationChoice:Rh,handleOverageMenuChoice:Ih,handleEmptyWalletChoice:vh,openSessionBrowser:hu,closeSessionBrowser:Ah,handleResumeSession:wh,handleDeleteSession:Dh,setQueueErrorMessage:no,addMessage:_u,popAllMessages:ry,handleApiKeySubmit:Ph,handleApiKeyCancel:Oh,setBannerVisible:Xr,setShortcutsHelpVisible:qs,setCleanUiDetailsVisible:Bh,toggleCleanUiDetailsVisible:Hh,revealCleanUiDetailsTemporarily:xu,handleWarning:$p,setEmbeddedShellFocused:H,dismissBackgroundTask:zh,setActiveBackgroundTaskPid:Qh,setIsBackgroundTaskListOpen:js,setAuthContext:$s,dismissLoginRestart:()=>{$s({}),jo("updating")},onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(lh.send){let U=r.getRemoteAdminSettings();U&&lh.send({type:"admin-settings-update",settings:U})}await ur()},handleNewAgentsSelect:async U=>{if(po&&U==="acknowledge"){let pe=r.getAgentRegistry();try{await Promise.all(po.map(ce=>pe.acknowledgeAgent(ce)))}catch(ce){ue.error("Failed to acknowledge agents:",ce),x.addItem({type:"error",text:`Failed to acknowledge agents: ${Gr(ce)}`},Date.now())}}fo(null)},getPreferredEditor:Va,clearAccountSuspension:()=>{Ch(null),jo("updating")},setVoiceModeEnabled:U=>{xt(U)}}),[bp,mu,hh,Mh,jo,Ur,dh,mh,$y,fh,Nh,yu,kh,Ee,St,xi,Ws,jt,sy,My,Ey,Iy,go,Dy,Yt,sc,iy,Eh,Rh,Ih,vh,hu,Ah,wh,Dh,no,_u,ry,Ph,Oh,Xr,qs,Bh,Hh,xu,$p,H,zh,Qh,js,$s,Ch,po,r,x,Va,xt]);return(0,Cn.jsx)(gd.Provider,{value:eD,children:(0,Cn.jsx)(vC.Provider,{value:Z_,children:(0,Cn.jsx)(wC.Provider,{value:J_,children:(0,Cn.jsx)(kf.Provider,{value:tD,children:(0,Cn.jsx)(fd.Provider,{value:r,children:(0,Cn.jsx)(Vf.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Cn.jsx)(Mb,{config:r,toolCalls:X_,isExpanded:_t,toggleExpansion:Ne,toggleAllExpansion:Oe,children:(0,Cn.jsx)(gg.Provider,{value:Mu,children:(0,Cn.jsx)(md,{mouseEventsEnabled:I,children:(0,Cn.jsx)(bd,{children:(0,Cn.jsx)(Ev,{},`app-${v}`)})})})})})})})})})})};var kr=C(P(),1);var BN=200;async function Tte(e,t,o,r=process.cwd(),n,s){lI();let i=Yu(e.getUseAlternateBuffer(),e.getScreenReader()),a=i;a&&(os(),ss(()=>{rs()}));let{matchers:d,errors:m}=await tC();m.forEach(v=>{xe.emitFeedback("warning",v)});let f=await ax();HN(kN(r),t);let h=new PS({onNewMessage:v=>{xe.emitConsoleLog(v.type,v.content)},debugMode:e.getDebugMode()});h.patch();let{stdout:p,stderr:T}=kT(),g=!!process.env.SHPOOL_SESSION_NAME,x=()=>(Mm(),(0,kr.jsx)(ZS.Provider,{value:t,children:(0,kr.jsx)(oC,{value:d,children:(0,kr.jsx)(eC,{config:e,children:(0,kr.jsx)(md,{mouseEventsEnabled:a,children:(0,kr.jsx)(Av,{children:(0,kr.jsx)(bd,{children:(0,kr.jsx)(pl,{children:(0,kr.jsx)(yE,{sessionId:e.getSessionId(),children:(0,kr.jsx)(AC,{children:(0,kr.jsx)(S_,{config:e,startupWarnings:o,version:f,resumedSessionData:n,initializationResult:s})})})})})})})})})}));g&&await new Promise(v=>setTimeout(v,100));let S=jS(process.env.DEBUG?(0,kr.jsx)(C_.default.StrictMode,{children:(0,kr.jsx)(x,{})}):(0,kr.jsx)(x,{}),{stdout:p,stderr:T,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:v})=>{v>BN&&_T(e,Math.round(v)),IC.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!g,debugRainbow:t.merged.ui.debugRainbow===!0}),I;i&&(Ya(),I=()=>ju(),ss(I)),jw(t).then(v=>{Qx(v,t,e.getProjectRoot(),e.getSandboxEnabled())}).catch(v=>{e.getDebugMode()&&ue.warn("Update check failed:",v)});let A=()=>S.unmount();ss(A);let E=zx();ss(E);let y=()=>h.cleanup();ss(y);try{await S.waitUntilExit()}finally{try{Js(y),y()}catch(v){ue.error("Error cleaning up console patcher:",v)}try{Js(A),S.unmount()}catch(v){ue.error("Error unmounting Ink instance:",v)}try{Js(E),E()}catch(v){ue.error("Error in TTY cleanup:",v)}if(I)try{Js(I),I()}catch(v){ue.error("Error restoring line wrapping:",v)}}}function HN(e,t){if(!t.merged.ui.hideWindowTitle){let o=jm({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Ar(`\x1B]0;${o}\x07`),process.on("exit",()=>{Ar("\x1B]0;\x07")})}}export{Tte as startInteractiveUI};
119
+ ${mt}`:mt,ty()),ve&&Si.setText(ve)},[Si,vo,oy,ty,wo]);let ny=(0,$.useCallback)(U=>{let pe=U.trim();pe&&(r.injectionService.addInjection(pe,"user_steering"),x.addItem({type:"hint",text:pe}))},[r,x]),sc=(0,$.useCallback)(async U=>{a(),ho(null),Ie||(go(!0),S||Yt());let pe=dr(U.trim()),ce=To==="idle",ve=To==="responding"||Bf(wo);if(pe&&ve){let{commandToExecute:es}=nl(U,Su??[]);if(es?.isSafeConcurrent){Ci(U),ko(U);return}}if(r.isModelSteeringEnabled()&&ve&&!pe){ny(U),ko(U);return}let mt=rt&&ic;if(pe&&rt||!Au&&ce&&mt){if(!pe){let es=await NS(U,r);if(es.length>0){Gh({files:es,onComplete:oD=>{Gh(null),oD.allowed&&es.forEach(rD=>r.getWorkspaceContext().addReadOnlyPath(rD)),Ka(U)}}),ko(U);return}}Ka(U)}else ce&&!Au&&!mt&&wu.length===0&&xe.emitFeedback("info",rt?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),_u(U);ko(U)},[_u,ko,Ka,Ci,Su,ic,To,Au,wu.length,wo,r,Ie,go,S,Yt,a,ny,rt,ho]),iy=(0,$.useCallback)(()=>{a(),ho(null),x.clearItems(),Qi(),Yt()},[x,Qi,Yt,a,ho]),{handleInput:sy}=iA(Si,sc),Lp=!Dp&&!L&&!Ep&&(To==="idle"||To==="responding"||To==="waiting_for_confirmation")&&!ec,ac=(0,$.useRef)(null);(0,$.useEffect)(()=>()=>{ac.current?.disconnect()},[]);let[Du,L_]=(0,$.useState)(0),[ay,N_]=(0,$.useState)(0);(0,$.useLayoutEffect)(()=>{!ie&&Du>0&&N_(Du)},[ie,Du]);let Np=ie&&ay>0?ay:Du,ly=(0,$.useCallback)(U=>{if(ac.current&&(ac.current.disconnect(),ac.current=null),U){let pe=new jn(ce=>{let ve=ce[0];if(ve){let mt=Math.round(ve.contentRect.height);L_(es=>mt!==es?mt:es)}});pe.observe(U),ac.current=pe}},[]),kp=Math.max(0,ht-Np-Op-1);r.setShellExecutionConfig({terminalWidth:Math.floor(Ye*LN),terminalHeight:Math.max(Math.floor(kp-NN),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:r.sanitizationConfig,sandboxManager:r.sandboxManager});let{isFocused:Mu,hasReceivedFocusEvent:k_}=JS(),cy=(0,$.useMemo)(()=>{let U=i.merged.context.fileName;return U?Array.isArray(U)?U:[U]:ET()},[i.merged.context.fileName]),Bp=(0,$.useMemo)(()=>r.getQuestion(),[r]),uy=(0,$.useRef)(!1),dy=r.getGeminiClient();(0,$.useEffect)(()=>{Bp&&rt&&!uy.current&&!$a&&!tc&&!Zl&&!Ql&&!D&&dy?.isInitialized?.()&&(sc(Bp),uy.current=!0)},[Bp,rt,sc,$a,tc,Zl,Ql,D,dy]);let[B_,H_]=(0,$.useState)(!1),[Hp,F_]=(0,$.useState)(null);(0,$.useEffect)(()=>{(async()=>{let ce=(await Ys.getInstance()).getCurrentIde();F_(ce||null)})()},[]);let Fp=!!(Hp&&!r.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!B_),[Pu,lc]=(0,$.useState)(!1),[my,U_]=(0,$.useState)(!1),[py,G_]=(0,$.useState)(!0),fy=(0,$.useCallback)(U=>{U>2&&wT(r),U>1&&Ci("/quit",void 0,void 0,!1)},[r,Ci]),{pressCount:gy,handlePress:hy}=Nl({windowMs:Ii,onRepeat:fy}),{pressCount:yy,handlePress:Ty}=Nl({windowMs:Ii,onRepeat:fy}),[Ou,xy]=(0,$.useState)(),[Sy,W_]=(0,$.useState)(!1),[Up,V_]=(0,$.useState)(!1),[Cy,bi]=hp(Ii),{isFolderTrustDialogOpen:Gp,discoveryResults:by,handleFolderTrustSelect:Ey,isRestarting:Ry}=cA(i,Ga,x.addItem),Wp=r.getPolicyUpdateConfirmationRequest(),[Vp,Iy]=(0,$.useState)(!!Wp),{needsRestart:vy,restartReason:Ay}=TC(),wy=(0,$.useRef)(!0);t_(r,hi,x,J);let Zi=(0,$.useRef)(null);(0,$.useEffect)(()=>{let U=ve=>{bi({text:ve.message,type:ve.type})},pe=()=>{bi({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},ce=()=>{bi({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Nt.on("transient-message",U),Nt.on("selection-warning",pe),Nt.on("paste-timeout",ce),()=>{Nt.off("transient-message",U),Nt.off("selection-warning",pe),Nt.off("paste-timeout",ce),Zi.current&&clearTimeout(Zi.current)}},[bi]);let $p=(0,$.useCallback)(U=>{bi({text:U,type:"warning"})},[bi]),{handleSuspend:_y}=l_({handleWarning:$p,setRawMode:zt,refreshStatic:Yt,setForceRerenderKey:R,shouldUseAlternateScreen:xp});(0,$.useEffect)(()=>{vy&&V_(!0)},[vy]),(0,$.useEffect)(()=>{if(wy.current){wy.current=!1;return}let U=setTimeout(()=>{Yt()},300);return()=>{clearTimeout(U)}},[Ye,Yt]),(0,$.useEffect)(()=>{let U=nf.subscribe(xy);return xy(nf.get()),U},[]),(0,$.useEffect)(()=>{let U=()=>{lc(!0),go(!1)};return Nt.on("open-debug-console",U),()=>{Nt.off("open-debug-console",U)}},[r]);let Dy=(0,$.useCallback)(U=>{W_(U)},[]),My=(0,$.useCallback)(U=>{U.userSelection==="yes"?(Ci("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):U.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),H_(!0)},[Ci,i]),$_=(0,$.useCallback)(U=>{if(i.merged.general.debugKeystrokeLogging&&ue.log("[DEBUG] Keystroke:",JSON.stringify(U)),qa&&t(U)&&qs(!1),o["app.toggleMouseMode"](U))return A(ve=>!ve),I&&!S&&Nt.emit("scroll-to-bottom"),!0;if(S&&o["app.toggleCopyMode"](U))return be(!0),rs(),!0;if(o["basic.quit"](U))return qh?.(),hy(),!0;if(o["basic.exit"](U))return Tp.current.text.length>0?!1:(Ty(),!0);if(o["app.suspend"](U))_y();else if(o["app.dumpFrame"](U)){let mt=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return h&&(h(mt),ue.log(`Dumped frame to: ${mt}`)),!0}else if(o["app.startRecording"](U)){let mt=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(mt),g.current=mt,ue.log(`Started recording to: ${mt}`)),!0}else{if(o["app.stopRecording"](U))return T&&(T(),ue.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](U)&&!S)return bi({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let pe=()=>{ho(!0);let ve=zb(x.history,wo);ve.length>0&&Oe(ve)},ce=!1;if(Ie||(ce=!0,go(!0),o["app.showMoreLines"](U)&&pe(),S||Yt()),o["app.showErrorDetails"](U))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:ve}=await import("./devtoolsService-J7RUHF7G.js");await ve(r,Pu,()=>lc(mt=>!mt),()=>lc(!0))})():lc(ve=>!ve),!0;if(o["app.showFullTodos"](U))return U_(ve=>!ve),!0;if(o["app.toggleMarkdown"](U))return G_(ve=>{let mt=!ve;return Yt(),mt}),!0;if(o["app.showIdeContextDetail"](U)&&r.getIdeMode()&&Ou)return Ci("/ide status"),!0;if(o["app.showMoreLines"](U)&&!ce)return go(!1),pe(),Yt(),!0;if((o["app.focusShellInput"](U)||o["background.unfocusList"](U))&&(Ji||Fn&&Un.size>0)){if(B){let mt=nc.current;return Zi.current&&clearTimeout(Zi.current),Zi.current=setTimeout(()=>{nc.current===mt?H(!1):bi({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-nc.current>=100&&!Ji&&!Fn?(Zi.current&&clearTimeout(Zi.current),vu(),H(!0),Un.size>1&&js(!0),!0):(H(!0),!0)}else{if(o["app.unfocusShellInput"](U)||o["background.unfocus"](U))return B?(H(!1),!0):!1;if(o["background.toggle"](U))return Ji?jh():(vu(),!Fn&&Un.size>0?(H(!0),Un.size>1&&js(!0)):H(!1)),!0;if(o["background.toggleList"](U))return Un.size>0&&Fn&&(B||H(!0),js(!0)),!0}return!1},[Ie,go,lc,r,Ou,hy,Ty,Ci,qh,Ji,_y,B,i.merged.general.debugKeystrokeLogging,Yt,be,Zi,S,qa,jh,vu,Un,Fn,js,nc,bi,i.merged.general.devtools,Pu,ho,o,t,x.history,wo,Oe,h,p,T,I]);de($_,{isActive:!0,priority:!0}),de(U=>o["scroll.up"](U)||o["scroll.down"](U)||o["scroll.pageUp"](U)||o["scroll.pageDown"](U)||o["scroll.home"](U)||o["scroll.end"](U)?!1:(be(!1),I&&os(),!0),{isActive:ie,priority:200}),(0,$.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let U=jm({streamingState:To,thoughtSubject:rc?.subject,isConfirming:!!Ks||Zh,isSilentWorking:ey,folderName:ON(r.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});Zr.current!==U&&(Zr.current=U,Ko.write(`\x1B]0;${U}\x07`))},[To,rc,Ks,Zh,ey,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,r,Ko]),(0,$.useEffect)(()=>{let U=ce=>{let ve;switch(ce.severity){case"error":ve="error";break;case"warning":ve="warning";break;case"info":ve="info";break;default:throw new Error(`Unexpected severity for user feedback: ${ce.severity}`)}x.addItem({type:ve,text:ce.message},Date.now()),ce.error&&ue.warn(`[Feedback Details for "${ce.message}"]`,ce.error)},pe=ce=>{x.addItem({type:"info",text:ce.message,source:ce.hookName},Date.now())};return xe.on(Fe.UserFeedback,U),xe.on(Fe.HookSystemMessage,pe),xe.drainBacklogs(),()=>{xe.off(Fe.UserFeedback,U),xe.off(Fe.HookSystemMessage,pe)}},[x]);let Py=e.version.includes("nightly"),qp=Hn==="awaiting_login_restart",Oy=i.merged.security.auth.selectedType===Ve.USE_VERTEX_AI?"Authenticating to Vertex AI in Cloud Shell requires a restart to apply project settings.":void 0,Ly=Fp||Gp||Vp||j||!!Ks||!!oc||!!bu||!!te||qo.length>0||!!Iu||Zl||Cp||Ip||vp||Nn||Yi||$a||tc||Ql||D||Up||!!ec||!!pu||!!fu||!!gu||Rp||Hn==="awaiting_api_key_input"||qp||!!po,q_=(0,$.useMemo)(()=>qd(wo),[wo]),Ny=qo.length>0,ky=!!Iu,cc=q_||!!Ks||!!oc||Ny||ky||!!ec||!!pu||!!fu||!!gu||!!te,Lu=i.merged.ui.loadingPhrases,K_=Lu==="tips"||Lu==="all",j_=Lu==="witty"||Lu==="all",z_=(!B||Fn)&&To==="responding"&&!cc,Nu=0;if(Ir.length>0&&i.merged.hooksConfig.notifications){let U=Ir.length>1?"Executing Hooks":"Executing Hook",pe=Ir.map(ce=>ce.name+(ce.index&&ce.total&&ce.total>1?` (${ce.index}/${ce.total})`:"")).join(", ");Nu=U.length+pe.length+10}else z_?Nu=(rc?.subject||"Waiting for model...").length+25:cc&&(Nu=35);let Y_=Ye-Nu-5,{elapsedTime:By,currentLoadingPhrase:Hy,currentTip:Fy,currentWittyPhrase:Uy}=aA({streamingState:To,shouldShowFocusHint:P_,retryStatus:M_,showTips:K_,showWit:j_,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:Y_}),Kp=r.isPlanEnabled()&&To==="idle"&&!cc,Gy=Xw({config:r,addItem:x.addItem,onApprovalModeChange:O_,isActive:!B,allowPlanMode:Kp});y_({notificationsEnabled:d,notificationMethod:m,isFocused:Mu,hasReceivedFocusEvent:k_,streamingState:To,hasPendingActionRequired:cc,pendingHistoryItems:wo,commandConfirmationRequest:Ks,authConsentRequest:oc,permissionConfirmationRequest:bu,hasConfirmUpdateExtensionRequests:Ny,hasLoopDetectionConfirmationRequest:ky});let Wy=Lp&&To==="idle"&&!cc;(0,$.useEffect)(()=>{qa&&!Wy&&qs(!1)},[qa,Wy,qs]),(0,$.useEffect)(()=>{if(!rt||!r.isModelSteeringEnabled()||To!=="idle"||!ic||qd(wo))return;let U=_p();U&&Ka([{text:ed(U)}])},[r,x,rt,ic,To,Ka,_p,wo,w_]);let X_=(0,$.useMemo)(()=>Kd(wo),[wo]),[Vy,Q_]=(0,$.useState)(r.getGeminiMdFileCount());(0,$.useEffect)(()=>{let U=pe=>{Q_(pe.fileCount)};return xe.on(Fe.MemoryChanged,U),()=>{xe.off(Fe.MemoryChanged,U)}},[]),(0,$.useEffect)(()=>{let U=!0;return(async()=>{let[ce,ve]=await Promise.all([r.getBannerTextNoCapacityIssues(),r.getBannerTextCapacityIssues()]);U&&(yo(ce),qi(ve),Xr(!0))})(),()=>{U=!1}},[r,Yt]);let J_=(0,$.useMemo)(()=>({buffer:Si,userMessages:vo,shellModeActive:ge,showEscapePrompt:Sy,copyModeEnabled:ie,inputWidth:Bn,suggestionsWidth:Yl}),[Si,vo,ge,Sy,ie,Bn,Yl]),Z_=(0,$.useMemo)(()=>({userTier:Fr,stats:Re,proQuotaRequest:ec,validationRequest:pu,overageMenuRequest:fu,emptyWalletRequest:gu}),[Fr,Re,ec,pu,fu,gu]),eD=(0,$.useMemo)(()=>({history:x.history,historyManager:x,isThemeDialogOpen:Zl,themeError:O,isAuthenticating:$a,isConfigInitialized:rt,authError:yh,accountSuspensionInfo:Sh,isAuthDialogOpen:tc,isAwaitingApiKeyInput:Hn==="awaiting_api_key_input",isAwaitingLoginRestart:qp,loginRestartMessage:Oy,apiKeyDefaultValue:Th,editorError:uh,isEditorDialogOpen:Ql,showPrivacyNotice:D,mouseMode:I,corgiMode:E,debugMessage:b,quittingMessages:w,isSettingsDialogOpen:Cp,isSessionBrowserOpen:Rp,isModelDialogOpen:Ip,isVoiceModelDialogOpen:vp,isAgentConfigDialogOpen:Nn,selectedAgentName:ne,selectedAgentDisplayName:le,selectedAgentDefinition:ye,isPermissionsDialogOpen:Yi,permissionsDialogProps:Qr,slashCommands:Su,pendingSlashCommandHistoryItems:Cu,commandContext:Fh,commandConfirmationRequest:Ks,authConsentRequest:oc,confirmUpdateExtensionRequests:qo,loopDetectionConfirmationRequest:Iu,permissionConfirmationRequest:bu,geminiMdFileCount:Vy,streamingState:To,initError:Dp,pendingGeminiHistoryItems:Ru,thought:rc,isInputActive:Lp,isVoiceModeEnabled:lt,isResuming:Ep,shouldShowIdePrompt:Fp,isFolderTrustDialogOpen:Gp??!1,folderDiscoveryResults:by,isPolicyUpdateDialogOpen:Vp,policyUpdateConfirmationRequest:Wp,isTrustedFolder:hi,constrainHeight:Ie,showErrorDetails:Pu,showFullTodos:my,ideContextState:Ou,renderMarkdown:py,ctrlCPressedOnce:gy>=1,ctrlDPressedOnce:yy>=1,shortcutsHelpVisible:qa,cleanUiDetailsVisible:Tu,isFocused:Mu,elapsedTime:By,currentLoadingPhrase:Hy,currentTip:Fy,currentWittyPhrase:Uy,historyRemountKey:Rr,activeHooks:Ir,messageQueue:wu,queueErrorMessage:Hs,showApprovalModeIndicator:Gy,allowPlanMode:Kp,currentModel:st,contextFileNames:cy,errorCount:tn,availableTerminalHeight:kp,stableControlsHeight:Np,mainAreaWidth:kn,staticAreaMaxItemHeight:Xl,staticExtraHeight:en,dialogsVisible:Ly,pendingHistoryItems:wo,nightly:Py,branchName:bn,sessionStats:Ao,terminalWidth:Ye,terminalHeight:ht,mainControlsRef:ly,rootUiRef:Jr,currentIDE:Hp,updateInfo:Bs,showIdeRestartPrompt:Up,ideTrustRestartReason:Ay,isRestarting:Ry,extensionsUpdateState:ji,activePtyId:Ji,backgroundTaskCount:Pp,isBackgroundTaskVisible:Fn,embeddedShellFocused:B,showDebugProfiler:q,customDialog:te,transientMessage:Cy,bannerData:vr,bannerVisible:$o,terminalBackgroundColor:r.getTerminalBackground(),settingsNonce:Br,backgroundTasks:Un,activeBackgroundTaskPid:Yh,backgroundTaskHeight:Op,isBackgroundTaskListOpen:Xh,adminSettingsChanged:j,newAgents:po,showIsExpandableHint:Hr,hintMode:r.isModelSteeringEnabled()&&Bf(wo),hintBuffer:""}),[Zl,O,$a,rt,yh,Sh,tc,uh,Ql,D,I,E,b,w,Cp,Rp,Ip,vp,Nn,ne,le,ye,Yi,Qr,Su,Cu,Fh,Ks,oc,qo,Iu,bu,Vy,To,Dp,Ru,rc,Lp,lt,Ep,Fp,Gp,by,Vp,Wp,hi,Ie,Pu,my,Ou,py,gy,yy,qa,Tu,Mu,By,Hy,Fy,Uy,Rr,Ir,wu,Hs,Gy,Kp,cy,tn,kp,Np,kn,Xl,en,Ly,wo,Py,bn,Ao,Ye,ht,ly,Jr,Hp,Bs,Up,Ay,Ry,st,ji,Ji,Pp,Fn,x,B,q,te,Th,Hn,qp,Oy,Cy,vr,$o,r,Br,Op,Xh,Yh,Un,j,po,Hr]),$y=(0,$.useCallback)(()=>N(!1),[N]),tD=(0,$.useMemo)(()=>({handleThemeSelect:bp,closeThemeDialog:mu,handleThemeHighlight:hh,handleAuthSelect:Mh,setAuthState:jo,onAuthError:Ur,handleEditorSelect:dh,exitEditorDialog:mh,exitPrivacyNotice:$y,closeSettingsDialog:fh,closeModelDialog:Nh,openVoiceModelDialog:yu,closeVoiceModelDialog:kh,openAgentConfigDialog:Ee,closeAgentConfigDialog:St,openPermissionsDialog:xi,closePermissionsDialog:Ws,setShellModeActive:jt,vimHandleInput:sy,handleIdePromptComplete:My,handleFolderTrustSelect:Ey,setIsPolicyUpdateDialogOpen:Iy,setConstrainHeight:go,onEscapePromptChange:Dy,refreshStatic:Yt,handleFinalSubmit:sc,handleClearScreen:iy,handleProQuotaChoice:Eh,handleValidationChoice:Rh,handleOverageMenuChoice:Ih,handleEmptyWalletChoice:vh,openSessionBrowser:hu,closeSessionBrowser:Ah,handleResumeSession:wh,handleDeleteSession:Dh,setQueueErrorMessage:no,addMessage:_u,popAllMessages:ry,handleApiKeySubmit:Ph,handleApiKeyCancel:Oh,setBannerVisible:Xr,setShortcutsHelpVisible:qs,setCleanUiDetailsVisible:Bh,toggleCleanUiDetailsVisible:Hh,revealCleanUiDetailsTemporarily:xu,handleWarning:$p,setEmbeddedShellFocused:H,dismissBackgroundTask:zh,setActiveBackgroundTaskPid:Qh,setIsBackgroundTaskListOpen:js,setAuthContext:$s,dismissLoginRestart:()=>{$s({}),jo("updating")},onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(lh.send){let U=r.getRemoteAdminSettings();U&&lh.send({type:"admin-settings-update",settings:U})}await ur()},handleNewAgentsSelect:async U=>{if(po&&U==="acknowledge"){let pe=r.getAgentRegistry();try{await Promise.all(po.map(ce=>pe.acknowledgeAgent(ce)))}catch(ce){ue.error("Failed to acknowledge agents:",ce),x.addItem({type:"error",text:`Failed to acknowledge agents: ${Gr(ce)}`},Date.now())}}fo(null)},getPreferredEditor:Va,clearAccountSuspension:()=>{Ch(null),jo("updating")},setVoiceModeEnabled:U=>{xt(U)}}),[bp,mu,hh,Mh,jo,Ur,dh,mh,$y,fh,Nh,yu,kh,Ee,St,xi,Ws,jt,sy,My,Ey,Iy,go,Dy,Yt,sc,iy,Eh,Rh,Ih,vh,hu,Ah,wh,Dh,no,_u,ry,Ph,Oh,Xr,qs,Bh,Hh,xu,$p,H,zh,Qh,js,$s,Ch,po,r,x,Va,xt]);return(0,Cn.jsx)(gd.Provider,{value:eD,children:(0,Cn.jsx)(vC.Provider,{value:Z_,children:(0,Cn.jsx)(wC.Provider,{value:J_,children:(0,Cn.jsx)(kf.Provider,{value:tD,children:(0,Cn.jsx)(fd.Provider,{value:r,children:(0,Cn.jsx)(Vf.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Cn.jsx)(Mb,{config:r,toolCalls:X_,isExpanded:_t,toggleExpansion:Ne,toggleAllExpansion:Oe,children:(0,Cn.jsx)(gg.Provider,{value:Mu,children:(0,Cn.jsx)(md,{mouseEventsEnabled:I,children:(0,Cn.jsx)(bd,{children:(0,Cn.jsx)(Ev,{},`app-${v}`)})})})})})})})})})})};var kr=C(P(),1);var BN=200;async function Tte(e,t,o,r=process.cwd(),n,s){lI();let i=Yu(e.getUseAlternateBuffer(),e.getScreenReader()),a=i;a&&(os(),ss(()=>{rs()}));let{matchers:d,errors:m}=await tC();m.forEach(v=>{xe.emitFeedback("warning",v)});let f=await ax();HN(kN(r),t);let h=new PS({onNewMessage:v=>{xe.emitConsoleLog(v.type,v.content)},debugMode:e.getDebugMode()});h.patch();let{stdout:p,stderr:T}=kT(),g=!!process.env.SHPOOL_SESSION_NAME,x=()=>(Mm(),(0,kr.jsx)(ZS.Provider,{value:t,children:(0,kr.jsx)(oC,{value:d,children:(0,kr.jsx)(eC,{config:e,children:(0,kr.jsx)(md,{mouseEventsEnabled:a,children:(0,kr.jsx)(Av,{children:(0,kr.jsx)(bd,{children:(0,kr.jsx)(pl,{children:(0,kr.jsx)(yE,{sessionId:e.getSessionId(),children:(0,kr.jsx)(AC,{children:(0,kr.jsx)(S_,{config:e,startupWarnings:o,version:f,resumedSessionData:n,initializationResult:s})})})})})})})})})}));g&&await new Promise(v=>setTimeout(v,100));let S=jS(process.env.DEBUG?(0,kr.jsx)(C_.default.StrictMode,{children:(0,kr.jsx)(x,{})}):(0,kr.jsx)(x,{}),{stdout:p,stderr:T,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:v})=>{v>BN&&_T(e,Math.round(v)),IC.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!g,debugRainbow:t.merged.ui.debugRainbow===!0}),I;i&&(Ya(),I=()=>ju(),ss(I)),jw(t).then(v=>{Qx(v,t,e.getProjectRoot(),e.getSandboxEnabled())}).catch(v=>{e.getDebugMode()&&ue.warn("Update check failed:",v)});let A=()=>S.unmount();ss(A);let E=zx();ss(E);let y=()=>h.cleanup();ss(y);try{await S.waitUntilExit()}finally{try{Js(y),y()}catch(v){ue.error("Error cleaning up console patcher:",v)}try{Js(A),S.unmount()}catch(v){ue.error("Error unmounting Ink instance:",v)}try{Js(E),E()}catch(v){ue.error("Error in TTY cleanup:",v)}if(I)try{Js(I),I()}catch(v){ue.error("Error restoring line wrapping:",v)}}}function HN(e,t){if(!t.merged.ui.hideWindowTitle){let o=jm({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Ar(`\x1B]0;${o}\x07`),process.on("exit",()=>{Ar("\x1B]0;\x07")})}}export{Tte as startInteractiveUI};
120
120
  /**
121
121
  * @license
122
122
  * Copyright 2025 Google LLC
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{Ga as i,Ka as s,ya as o}from"./chunk-A3CFCECQ.js";import"./chunk-RFHUTEFF.js";import"./chunk-AHBTQKKJ.js";import{b as r}from"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";import u from"node:fs";var g=class{static async ensureRunning(t){if(!t?.enabled||t.autoStartServer===!1)return;let n=i();if(!n||!u.existsSync(n)){r.log('[LiteRtServerManager] Binary not installed, skipping auto-start. Run "gemini gemma setup".');return}let e=parseInt(t.classifier?.host?.match(/:(\d+)/)?.[1]??"",10)||o;if(await s(e)){r.log(`[LiteRtServerManager] Server already running on port ${e}`);return}r.log(`[LiteRtServerManager] Auto-starting LiteRT server on port ${e}...`);try{let{startServer:a}=await import("./start-DO44GV2B.js");await a(n,e)?r.log(`[LiteRtServerManager] Server started on port ${e}`):r.warn(`[LiteRtServerManager] Server may not have started correctly on port ${e}`)}catch(a){r.warn("[LiteRtServerManager] Auto-start failed:",a)}}};export{g as LiteRtServerManager};
2
+ import{Ga as i,Ka as s,ya as o}from"./chunk-S5WFVXWE.js";import"./chunk-VFMKTMIZ.js";import"./chunk-VJITGXD7.js";import{b as r}from"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";import u from"node:fs";var g=class{static async ensureRunning(t){if(!t?.enabled||t.autoStartServer===!1)return;let n=i();if(!n||!u.existsSync(n)){r.log('[LiteRtServerManager] Binary not installed, skipping auto-start. Run "gemini gemma setup".');return}let e=parseInt(t.classifier?.host?.match(/:(\d+)/)?.[1]??"",10)||o;if(await s(e)){r.log(`[LiteRtServerManager] Server already running on port ${e}`);return}r.log(`[LiteRtServerManager] Auto-starting LiteRT server on port ${e}...`);try{let{startServer:a}=await import("./start-RDNQUCPC.js");await a(n,e)?r.log(`[LiteRtServerManager] Server started on port ${e}`):r.warn(`[LiteRtServerManager] Server may not have started correctly on port ${e}`)}catch(a){r.warn("[LiteRtServerManager] Auto-start failed:",a)}}};export{g as LiteRtServerManager};
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2026 Google LLC
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{Ga as i,Ka as s,ya as o}from"./chunk-GTU5AZLF.js";import"./chunk-CVQSCATI.js";import"./chunk-QLWIHN4W.js";import{b as r}from"./chunk-PZNAC7U7.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";import u from"node:fs";var g=class{static async ensureRunning(t){if(!t?.enabled||t.autoStartServer===!1)return;let n=i();if(!n||!u.existsSync(n)){r.log('[LiteRtServerManager] Binary not installed, skipping auto-start. Run "gemini gemma setup".');return}let e=parseInt(t.classifier?.host?.match(/:(\d+)/)?.[1]??"",10)||o;if(await s(e)){r.log(`[LiteRtServerManager] Server already running on port ${e}`);return}r.log(`[LiteRtServerManager] Auto-starting LiteRT server on port ${e}...`);try{let{startServer:a}=await import("./start-3PMI6ZVJ.js");await a(n,e)?r.log(`[LiteRtServerManager] Server started on port ${e}`):r.warn(`[LiteRtServerManager] Server may not have started correctly on port ${e}`)}catch(a){r.warn("[LiteRtServerManager] Auto-start failed:",a)}}};export{g as LiteRtServerManager};
2
+ import{Ga as i,Ka as s,ya as o}from"./chunk-RTOTOYZ3.js";import"./chunk-FJMU6UNE.js";import"./chunk-63ULYU4I.js";import{b as r}from"./chunk-PZNAC7U7.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";import u from"node:fs";var g=class{static async ensureRunning(t){if(!t?.enabled||t.autoStartServer===!1)return;let n=i();if(!n||!u.existsSync(n)){r.log('[LiteRtServerManager] Binary not installed, skipping auto-start. Run "gemini gemma setup".');return}let e=parseInt(t.classifier?.host?.match(/:(\d+)/)?.[1]??"",10)||o;if(await s(e)){r.log(`[LiteRtServerManager] Server already running on port ${e}`);return}r.log(`[LiteRtServerManager] Auto-starting LiteRT server on port ${e}...`);try{let{startServer:a}=await import("./start-LAWWIE6I.js");await a(n,e)?r.log(`[LiteRtServerManager] Server started on port ${e}`):r.warn(`[LiteRtServerManager] Server may not have started correctly on port ${e}`)}catch(a){r.warn("[LiteRtServerManager] Auto-start failed:",a)}}};export{g as LiteRtServerManager};
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2026 Google LLC
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{Bj as a,Dj as p,Ec as f,Ej as m,Fj as A,Gj as T,Hj as w,Ij as y,Jj as U,Kj as C,eg as g}from"./chunk-AHBTQKKJ.js";import{Ga as d,Ra as l,b as o,se as k,wa as n}from"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var v=class extends a{config;agentName;agentCardUrl;type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;constructor(e,t,r,i){super(),this.config=e,this.agentName=t,this.agentCardUrl=i,this.tokenStorage=new m(l.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${n(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${n(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=w(e.redirectUri),i=T(t.state,r),s=await i.port,h=y(e,t,s,void 0);if(!await f(`Authentication required for A2A agent: '${this.agentName}'.`))throw new d("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
2
+ import{Bj as a,Dj as p,Ec as f,Ej as m,Fj as A,Gj as T,Hj as w,Ij as y,Jj as U,Kj as C,eg as g}from"./chunk-VJITGXD7.js";import{Ga as d,Ra as l,b as o,se as k,wa as n}from"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var v=class extends a{config;agentName;agentCardUrl;type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;constructor(e,t,r,i){super(),this.config=e,this.agentName=t,this.agentCardUrl=i,this.tokenStorage=new m(l.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${n(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${n(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=w(e.redirectUri),i=T(t.state,r),s=await i.port,h=y(e,t,s,void 0);if(!await f(`Authentication required for A2A agent: '${this.agentName}'.`))throw new d("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
3
3
 
4
4
  If the browser does not open, copy and paste this URL into your browser:
5
5
  ${h}
@@ -1,5 +1,5 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{Bj as a,Dj as p,Ec as g,Ej as m,Fj as A,Gj as T,Hj as y,Ij as v,Jj as w,Kj as C,eg as f}from"./chunk-QLWIHN4W.js";import{Ga as d,Ra as l,b as o,se as k,wa as i}from"./chunk-PZNAC7U7.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var U=class extends a{constructor(e,t,r,n){super();this.config=e;this.agentName=t;this.agentCardUrl=n;this.tokenStorage=new m(l.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${i(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${i(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=y(e.redirectUri),n=T(t.state,r),s=await n.port,h=v(e,t,s,void 0);if(!await g(`Authentication required for A2A agent: '${this.agentName}'.`))throw new d("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
2
+ import{Bj as a,Dj as p,Ec as g,Ej as m,Fj as A,Gj as T,Hj as y,Ij as v,Jj as w,Kj as C,eg as f}from"./chunk-63ULYU4I.js";import{Ga as d,Ra as l,b as o,se as k,wa as i}from"./chunk-PZNAC7U7.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var U=class extends a{constructor(e,t,r,n){super();this.config=e;this.agentName=t;this.agentCardUrl=n;this.tokenStorage=new m(l.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${i(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${i(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=y(e.redirectUri),n=T(t.state,r),s=await n.port,h=v(e,t,s,void 0);if(!await g(`Authentication required for A2A agent: '${this.agentName}'.`))throw new d("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
3
3
 
4
4
  If the browser does not open, copy and paste this URL into your browser:
5
5
  ${h}
@@ -1,2 +1,2 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{a,b}from"./chunk-QZZSKH6J.js";import"./chunk-2SX35WX4.js";import"./chunk-GTU5AZLF.js";import"./chunk-CVQSCATI.js";import"./chunk-FLHTGF3O.js";import"./chunk-QLWIHN4W.js";import"./chunk-PZNAC7U7.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";export{b as startCommand,a as startServer};
2
+ import{a,b}from"./chunk-W5TDQYOY.js";import"./chunk-G6V3NYLD.js";import"./chunk-RTOTOYZ3.js";import"./chunk-FJMU6UNE.js";import"./chunk-MH5WU37R.js";import"./chunk-63ULYU4I.js";import"./chunk-PZNAC7U7.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";export{b as startCommand,a as startServer};
@@ -1,2 +1,2 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
- import{a,b}from"./chunk-UFGP2VEQ.js";import"./chunk-REVEB6QQ.js";import"./chunk-A3CFCECQ.js";import"./chunk-RFHUTEFF.js";import"./chunk-M4VGJYXT.js";import"./chunk-AHBTQKKJ.js";import"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";export{b as startCommand,a as startServer};
2
+ import{a,b}from"./chunk-XPH4EMMZ.js";import"./chunk-356OVHGG.js";import"./chunk-S5WFVXWE.js";import"./chunk-VFMKTMIZ.js";import"./chunk-CJ5VLAB6.js";import"./chunk-VJITGXD7.js";import"./chunk-7I5Y2LVR.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";export{b as startCommand,a as startServer};