makecoder 2.0.96 → 2.0.97
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/dist/cc.mjs +3 -3
- package/dist/coder.js +1 -1
- package/dist/gemini/{chunk-5ITJYVOM.js → chunk-FZKV2OXC.js} +2 -2
- package/dist/gemini/{chunk-POLHE5RH.js → chunk-RJWN4TV6.js} +2 -2
- package/dist/gemini/{chunk-YPVCYLBU.js → chunk-SZCTACC4.js} +2 -2
- package/dist/gemini/{chunk-S3DUOK6E.js → chunk-WQ23SZKZ.js} +2 -2
- package/dist/gemini/{core-PKUUGZC6.js → core-6CSJEUHD.js} +1 -1
- package/dist/gemini/{devtoolsService-BYHL77Z2.js → devtoolsService-CLP7VYOP.js} +2 -2
- package/dist/gemini/{devtoolsService-DH2OIHZU.js → devtoolsService-TCAPUJWL.js} +2 -2
- package/dist/gemini/{dist-W6BJ4KCW.js → dist-G4EPGJS6.js} +1 -1
- package/dist/gemini/gemini.js +5 -5
- package/dist/gemini/{interactiveCli-LOOUQZAF.js → interactiveCli-BBNEBSZD.js} +2 -2
- package/dist/gemini/{interactiveCli-AKLYGO6O.js → interactiveCli-OSI3BU7D.js} +2 -2
- package/dist/gemini/{oauth2-provider-X3LI2O5D.js → oauth2-provider-FFVQZBNR.js} +1 -1
- package/dist/gemini/{oauth2-provider-NJHLVFY6.js → oauth2-provider-R4BZ7DTI.js} +1 -1
- package/package.json +4 -4
- /package/dist/gemini/{tree-sitter-PGUB3URN.js → tree-sitter-ONNCTZTG.js} +0 -0
- /package/dist/gemini/{tree-sitter-bash-2JNR3SVZ.js → tree-sitter-bash-56AB4HVQ.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{$a as Xx,$b as SS,$c as Ho,A as Ix,Aa as $x,Ab as m,Ac as PS,B as Nx,Ba as Xa,Bb as c,Bc as BS,C as qr,Ca as at,Cb as lS,Cc as Ed,Db as cS,Dc as we,E as ss,Eb as uS,Ec as FS,F as Ri,Fb as dS,Fc as US,G as Ox,Gb as Uo,Gc as HS,H as oa,Ha as Kx,Hb as us,Hc as Cd,I as io,Ib as mS,Ic as _d,J as gd,Jb as Za,Jc as Rd,K as Ht,Kb as wn,Kc as wd,L as ar,Lb as d,Lc as GS,M as mo,Mb as pS,Mc as WS,N as Df,Nb as fS,Nc as ol,O as qn,Ob as Uf,Oc as $S,P as Mx,Pb as gS,Pc as Wf,Q,Qa as qx,Qb as hS,Qc as KS,R as as,Rb as yS,Rc as qS,S as Dx,Sb as bS,Sc as nl,Tb as Je,Tc as VS,Ub as xd,Uc as lr,V as Lx,Vb as M,Vc as vd,W as kx,Wb as TS,Wc as zS,X as Lf,Xa as Vx,Xb as ye,Xc as vn,Ya as zx,Yb as Et,Yc as Ic,Z as Px,Za as kf,Zb as vc,Zc as YS,_a as Yx,_b as xS,_c as XS,aa as Bx,ab as jx,ac as ES,ad as jS,b as ea,ba as Fx,bb as Qx,bc as tt,bd as Ad,c as gx,cb as ln,cc as Sd,cd as QS,d as $r,da as wi,db as Pf,dc as Qe,dd as JS,e as Ec,ea as Ux,eb as ja,ec as CS,ed as ZS,f as _i,fb as Jx,fc as Hf,g as hx,gb as Zx,gc as _S,gd as Id,h as Of,hb as bd,hc as RS,hd as eE,i as yx,ia as ls,ib as eS,ic as wS,id as tE,j as bx,jb as zr,jc as vS,k as Tx,kb as Rc,kc as AS,kd as un,l as xx,lb as tS,lc as IS,ld as oE,m as Kr,ma as Vr,mb as wc,mc as NS,md as Mt,n as Sx,nb as cs,nc as OS,o as Ex,oa as Hx,ob as Qa,oc as el,p as Cx,pb as Td,pc as na,q as Mf,qa as hd,qb as oS,qc as MS,r as Cc,rb as nS,rc as Gf,s as _x,sb as Bf,sc as DS,t as Rx,tb as rS,tc as ra,u as wx,ub as Ff,uc as ia,v as vx,va as Gx,vb as iS,vc as Ac,w as Ax,wb as Ja,wc as LS,x as ta,xb as sS,xc as kS,y as _c,ya as yd,yb as cn,yc as tl,za as Wx,zb as aS,zc as xt}from"./chunk-5ITJYVOM.js";import{$c as ET,$k as nx,Ac as od,Ag as qT,Am as pd,Bc as yT,Bd as vT,Cc as nd,Ce as kT,Dc as bT,Dd as AT,Eb as ed,Em as fd,Fd as IT,Fk as ox,Fm as Zs,Gf as rs,Hb as pT,Hf as Va,Hg as ld,Hl as rx,If as za,Il as ix,Im as cx,Jc as rd,Jd as NT,Jh as an,Jm as Nf,Kf as UT,Kl as sx,L as oT,Le as Qs,Lf as HT,Lm as ux,Mc as TT,Mk as md,N as ju,Ne as PT,Nf as GT,Nm as dx,O as xc,Pb as Cf,Pm as mx,Qb as _f,Qm as px,Rg as VT,T as Ef,Tg as zT,Th as Js,Ug as YT,Ui as Af,Vb as fT,Vg as XT,W as sT,Wi as tx,Xa as aT,Xc as xT,Xg as wr,Xh as uo,Ya as lT,Yf as WT,Za as cT,Zc as Rf,_c as ST,ac as gT,ak as Ya,bd as CT,bf as Sc,cd as _T,ce as id,cf as BT,dd as RT,df as sd,ee as OT,em as ax,ge as MT,gf as ad,gh as jT,hf as FT,hg as $T,lc as Kn,ln as fx,mj as cd,mk as If,na as Ju,oa as Zu,oc as hT,pe as DT,pm as lx,qc as ts,rc as os,rf as vf,ri as QT,tb as uT,tg as KT,ti as JT,ub as dT,ui as ZT,we as wf,wi as is,x as tT,xb as mT,xd as ns,yc as td,yi as ex,yk as dd,zc as qa,zd as wT,ze as LT}from"./chunk-YPVCYLBU.js";import{Aa as Tf,Ba as xf,Ca as gc,Da as hc,Ea as yc,Fa as es,Ga as bc,Gd as eT,Ha as Ub,Ia as qu,Ja as Tc,Ld as Qu,M as Nb,Nd as Rr,S as Ob,Sa as Kt,T as Mb,U as fc,Ua as Vu,V as $u,W as Db,X as Ku,Za as Hb,_b as zu,_d as nT,aa as Lb,ae as rT,b as _e,ca as kb,ce as iT,dd as Sf,ea as Pb,fa as Bb,ge as Re,ha as Fb,j as Ib,ld as qb,md as Vb,od as zb,pc as Yu,pd as Yb,qc as Xu,qd as Xb,rc as Wb,rd as jb,sa as Ka,sc as $b,sd as Qb,t as Xo,tc as Kb,td as Jb,ud as Zb,ye as ud,za as bf,zb as Gb}from"./chunk-F34TWSY4.js";import"./chunk-TWIC4BKL.js";import{c as It}from"./chunk-TU3BMADG.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as At,c as _t,d as nM,e as C}from"./chunk-YUXORC52.js";var kC=_t((QF,LC)=>{function EC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&EC(o)}),e}var $d=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function CC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ps(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var $M="</span>",hC=e=>!!e.scope,KM=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},Xf=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=CC(t)}openNode(t){if(!hC(t))return;let o=KM(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){hC(t)&&(this.buffer+=$M)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},yC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},jf=class e{constructor(){this.rootNode=yC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=yC({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},Qf=class extends jf{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new Xf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Oc(e){return e?typeof e=="string"?e:e.source:null}function _C(e){return aa("(?=",e,")")}function qM(e){return aa("(?:",e,")*")}function VM(e){return aa("(?:",e,")?")}function aa(...e){return e.map(o=>Oc(o)).join("")}function zM(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Zf(...e){return"("+(zM(e).capture?"":"?:")+e.map(n=>Oc(n)).join("|")+")"}function RC(e){return new RegExp(e.toString()+"|").exec("").length-1}function YM(e,t){let o=e&&e.exec(t);return o&&o.index===0}var XM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function eg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,a=Oc(n),i="";for(;a.length>0;){let s=XM.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+r):(i+=s[0],s[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var jM=/\b\B/,wC="[a-zA-Z]\\w*",tg="[a-zA-Z_]\\w*",vC="\\b\\d+(\\.\\d+)?",AC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",IC="\\b(0b[01]+)",QM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",JM=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=aa(t,/.*\b/,e.binary,/\b.*/)),ps({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Mc={begin:"\\\\[\\s\\S]",relevance:0},ZM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Mc]},eD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Mc]},tD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},qd=function(e,t,o={}){let n=ps({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Zf("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:aa(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},oD=qd("//","$"),nD=qd("/\\*","\\*/"),rD=qd("#","$"),iD={scope:"number",begin:vC,relevance:0},sD={scope:"number",begin:AC,relevance:0},aD={scope:"number",begin:IC,relevance:0},lD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Mc,{begin:/\[/,end:/\]/,relevance:0,contains:[Mc]}]},cD={scope:"title",begin:wC,relevance:0},uD={scope:"title",begin:tg,relevance:0},dD={begin:"\\.\\s*"+tg,relevance:0},mD=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Wd=Object.freeze({__proto__:null,APOS_STRING_MODE:ZM,BACKSLASH_ESCAPE:Mc,BINARY_NUMBER_MODE:aD,BINARY_NUMBER_RE:IC,COMMENT:qd,C_BLOCK_COMMENT_MODE:nD,C_LINE_COMMENT_MODE:oD,C_NUMBER_MODE:sD,C_NUMBER_RE:AC,END_SAME_AS_BEGIN:mD,HASH_COMMENT_MODE:rD,IDENT_RE:wC,MATCH_NOTHING_RE:jM,METHOD_GUARD:dD,NUMBER_MODE:iD,NUMBER_RE:vC,PHRASAL_WORDS_MODE:tD,QUOTE_STRING_MODE:eD,REGEXP_MODE:lD,RE_STARTERS_RE:QM,SHEBANG:JM,TITLE_MODE:cD,UNDERSCORE_IDENT_RE:tg,UNDERSCORE_TITLE_MODE:uD});function pD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function fD(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function gD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=pD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function hD(e,t){Array.isArray(e.illegal)&&(e.illegal=Zf(...e.illegal))}function yD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function bD(e,t){e.relevance===void 0&&(e.relevance=1)}var TD=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=aa(o.beforeMatch,_C(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},xD=["of","and","for","in","not","or","if","then","parent","list","value"],SD="keyword";function NC(e,t,o=SD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(a){Object.assign(n,NC(e[a],t,a))}),n;function r(a,i){t&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");n[l[0]]=[a,ED(l[0],l[1])]})}}function ED(e,t){return t?Number(t):CD(e)?0:1}function CD(e){return xD.includes(e.toLowerCase())}var bC={},sa=e=>{console.error(e)},TC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},cl=(e,t)=>{bC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),bC[`${e}/${t}`]=!0)},Kd=new Error;function OC(e,t,{key:o}){let n=0,r=e[o],a={},i={};for(let s=1;s<=t.length;s++)i[s+n]=r[s],a[s+n]=!0,n+=RC(t[s-1]);e[o]=i,e[o]._emit=a,e[o]._multi=!0}function _D(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Kd;if(typeof e.beginScope!="object"||e.beginScope===null)throw sa("beginScope must be object"),Kd;OC(e,e.begin,{key:"beginScope"}),e.begin=eg(e.begin,{joinWith:""})}}function RD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Kd;if(typeof e.endScope!="object"||e.endScope===null)throw sa("endScope must be object"),Kd;OC(e,e.end,{key:"endScope"}),e.end=eg(e.end,{joinWith:""})}}function wD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vD(e){wD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),_D(e),RD(e)}function AD(e){function t(i,s){return new RegExp(Oc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=RC(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=t(eg(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let u=l.findIndex((y,f)=>f>0&&y!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new o;return this.rules.slice(s).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){let s=new n;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[fD,yD,vD,TD].forEach(p=>p(i,s)),e.compilerExtensions.forEach(p=>p(i,s)),i.__beforeBegin=null,[gD,hD,bD].forEach(p=>p(i,s)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=NC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),s&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=Oc(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return ID(p==="self"?i:p)})),i.contains.forEach(function(p){a(p,l)}),i.starts&&a(i.starts,s),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ps(e.classNameAliases||{}),a(e)}function MC(e){return e?e.endsWithParent||MC(e.starts):!1}function ID(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ps(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:MC(e)?ps(e,{starts:e.starts?ps(e.starts):null}):Object.isFrozen(e)?ps(e):e}var ND="11.11.1",Jf=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},Yf=CC,xC=ps,SC=Symbol("nomatch"),OD=7,DC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Qf};function l(O){return s.noHighlightRe.test(O)}function u(O){let L=O.className+" ";L+=O.parentNode?O.parentNode.className:"";let P=s.languageDetectRe.exec(L);if(P){let $=I(P[1]);return $||(TC(a.replace("{}",P[1])),TC("Falling back to no-highlight mode for this block.",O)),$?P[1]:"no-highlight"}return L.split(/\s+/).find($=>l($)||I($))}function p(O,L,P){let $="",K="";typeof L=="object"?($=O,P=L.ignoreIllegals,K=L.language):(cl("10.7.0","highlight(lang, code, ...args) has been deprecated."),cl("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
import{$a as Xx,$b as SS,$c as Ho,A as Ix,Aa as $x,Ab as m,Ac as PS,B as Nx,Ba as Xa,Bb as c,Bc as BS,C as qr,Ca as at,Cb as lS,Cc as Ed,Db as cS,Dc as we,E as ss,Eb as uS,Ec as FS,F as Ri,Fb as dS,Fc as US,G as Ox,Gb as Uo,Gc as HS,H as oa,Ha as Kx,Hb as us,Hc as Cd,I as io,Ib as mS,Ic as _d,J as gd,Jb as Za,Jc as Rd,K as Ht,Kb as wn,Kc as wd,L as ar,Lb as d,Lc as GS,M as mo,Mb as pS,Mc as WS,N as Df,Nb as fS,Nc as ol,O as qn,Ob as Uf,Oc as $S,P as Mx,Pb as gS,Pc as Wf,Q,Qa as qx,Qb as hS,Qc as KS,R as as,Rb as yS,Rc as qS,S as Dx,Sb as bS,Sc as nl,Tb as Je,Tc as VS,Ub as xd,Uc as lr,V as Lx,Vb as M,Vc as vd,W as kx,Wb as TS,Wc as zS,X as Lf,Xa as Vx,Xb as ye,Xc as vn,Ya as zx,Yb as Et,Yc as Ic,Z as Px,Za as kf,Zb as vc,Zc as YS,_a as Yx,_b as xS,_c as XS,aa as Bx,ab as jx,ac as ES,ad as jS,b as ea,ba as Fx,bb as Qx,bc as tt,bd as Ad,c as gx,cb as ln,cc as Sd,cd as QS,d as $r,da as wi,db as Pf,dc as Qe,dd as JS,e as Ec,ea as Ux,eb as ja,ec as CS,ed as ZS,f as _i,fb as Jx,fc as Hf,g as hx,gb as Zx,gc as _S,gd as Id,h as Of,hb as bd,hc as RS,hd as eE,i as yx,ia as ls,ib as eS,ic as wS,id as tE,j as bx,jb as zr,jc as vS,k as Tx,kb as Rc,kc as AS,kd as un,l as xx,lb as tS,lc as IS,ld as oE,m as Kr,ma as Vr,mb as wc,mc as NS,md as Mt,n as Sx,nb as cs,nc as OS,o as Ex,oa as Hx,ob as Qa,oc as el,p as Cx,pb as Td,pc as na,q as Mf,qa as hd,qb as oS,qc as MS,r as Cc,rb as nS,rc as Gf,s as _x,sb as Bf,sc as DS,t as Rx,tb as rS,tc as ra,u as wx,ub as Ff,uc as ia,v as vx,va as Gx,vb as iS,vc as Ac,w as Ax,wb as Ja,wc as LS,x as ta,xb as sS,xc as kS,y as _c,ya as yd,yb as cn,yc as tl,za as Wx,zb as aS,zc as xt}from"./chunk-FZKV2OXC.js";import{$c as ET,$k as nx,Ac as od,Ag as qT,Am as pd,Bc as yT,Bd as vT,Cc as nd,Ce as kT,Dc as bT,Dd as AT,Eb as ed,Em as fd,Fd as IT,Fk as ox,Fm as Zs,Gf as rs,Hb as pT,Hf as Va,Hg as ld,Hl as rx,If as za,Il as ix,Im as cx,Jc as rd,Jd as NT,Jh as an,Jm as Nf,Kf as UT,Kl as sx,L as oT,Le as Qs,Lf as HT,Lm as ux,Mc as TT,Mk as md,N as ju,Ne as PT,Nf as GT,Nm as dx,O as xc,Pb as Cf,Pm as mx,Qb as _f,Qm as px,Rg as VT,T as Ef,Tg as zT,Th as Js,Ug as YT,Ui as Af,Vb as fT,Vg as XT,W as sT,Wi as tx,Xa as aT,Xc as xT,Xg as wr,Xh as uo,Ya as lT,Yf as WT,Za as cT,Zc as Rf,_c as ST,ac as gT,ak as Ya,bd as CT,bf as Sc,cd as _T,ce as id,cf as BT,dd as RT,df as sd,ee as OT,em as ax,ge as MT,gf as ad,gh as jT,hf as FT,hg as $T,lc as Kn,ln as fx,mj as cd,mk as If,na as Ju,oa as Zu,oc as hT,pe as DT,pm as lx,qc as ts,rc as os,rf as vf,ri as QT,tb as uT,tg as KT,ti as JT,ub as dT,ui as ZT,we as wf,wi as is,x as tT,xb as mT,xd as ns,yc as td,yi as ex,yk as dd,zc as qa,zd as wT,ze as LT}from"./chunk-SZCTACC4.js";import{Aa as Tf,Ba as xf,Ca as gc,Da as hc,Ea as yc,Fa as es,Ga as bc,Gd as eT,Ha as Ub,Ia as qu,Ja as Tc,Ld as Qu,M as Nb,Nd as Rr,S as Ob,Sa as Kt,T as Mb,U as fc,Ua as Vu,V as $u,W as Db,X as Ku,Za as Hb,_b as zu,_d as nT,aa as Lb,ae as rT,b as _e,ca as kb,ce as iT,dd as Sf,ea as Pb,fa as Bb,ge as Re,ha as Fb,j as Ib,ld as qb,md as Vb,od as zb,pc as Yu,pd as Yb,qc as Xu,qd as Xb,rc as Wb,rd as jb,sa as Ka,sc as $b,sd as Qb,t as Xo,tc as Kb,td as Jb,ud as Zb,ye as ud,za as bf,zb as Gb}from"./chunk-F34TWSY4.js";import"./chunk-TWIC4BKL.js";import{c as It}from"./chunk-TU3BMADG.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as At,c as _t,d as nM,e as C}from"./chunk-YUXORC52.js";var kC=_t((QF,LC)=>{function EC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&EC(o)}),e}var $d=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function CC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ps(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var $M="</span>",hC=e=>!!e.scope,KM=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},Xf=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=CC(t)}openNode(t){if(!hC(t))return;let o=KM(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){hC(t)&&(this.buffer+=$M)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},yC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},jf=class e{constructor(){this.rootNode=yC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=yC({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},Qf=class extends jf{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new Xf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Oc(e){return e?typeof e=="string"?e:e.source:null}function _C(e){return aa("(?=",e,")")}function qM(e){return aa("(?:",e,")*")}function VM(e){return aa("(?:",e,")?")}function aa(...e){return e.map(o=>Oc(o)).join("")}function zM(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Zf(...e){return"("+(zM(e).capture?"":"?:")+e.map(n=>Oc(n)).join("|")+")"}function RC(e){return new RegExp(e.toString()+"|").exec("").length-1}function YM(e,t){let o=e&&e.exec(t);return o&&o.index===0}var XM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function eg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,a=Oc(n),i="";for(;a.length>0;){let s=XM.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+r):(i+=s[0],s[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var jM=/\b\B/,wC="[a-zA-Z]\\w*",tg="[a-zA-Z_]\\w*",vC="\\b\\d+(\\.\\d+)?",AC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",IC="\\b(0b[01]+)",QM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",JM=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=aa(t,/.*\b/,e.binary,/\b.*/)),ps({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Mc={begin:"\\\\[\\s\\S]",relevance:0},ZM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Mc]},eD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Mc]},tD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},qd=function(e,t,o={}){let n=ps({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Zf("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:aa(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},oD=qd("//","$"),nD=qd("/\\*","\\*/"),rD=qd("#","$"),iD={scope:"number",begin:vC,relevance:0},sD={scope:"number",begin:AC,relevance:0},aD={scope:"number",begin:IC,relevance:0},lD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Mc,{begin:/\[/,end:/\]/,relevance:0,contains:[Mc]}]},cD={scope:"title",begin:wC,relevance:0},uD={scope:"title",begin:tg,relevance:0},dD={begin:"\\.\\s*"+tg,relevance:0},mD=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Wd=Object.freeze({__proto__:null,APOS_STRING_MODE:ZM,BACKSLASH_ESCAPE:Mc,BINARY_NUMBER_MODE:aD,BINARY_NUMBER_RE:IC,COMMENT:qd,C_BLOCK_COMMENT_MODE:nD,C_LINE_COMMENT_MODE:oD,C_NUMBER_MODE:sD,C_NUMBER_RE:AC,END_SAME_AS_BEGIN:mD,HASH_COMMENT_MODE:rD,IDENT_RE:wC,MATCH_NOTHING_RE:jM,METHOD_GUARD:dD,NUMBER_MODE:iD,NUMBER_RE:vC,PHRASAL_WORDS_MODE:tD,QUOTE_STRING_MODE:eD,REGEXP_MODE:lD,RE_STARTERS_RE:QM,SHEBANG:JM,TITLE_MODE:cD,UNDERSCORE_IDENT_RE:tg,UNDERSCORE_TITLE_MODE:uD});function pD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function fD(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function gD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=pD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function hD(e,t){Array.isArray(e.illegal)&&(e.illegal=Zf(...e.illegal))}function yD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function bD(e,t){e.relevance===void 0&&(e.relevance=1)}var TD=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=aa(o.beforeMatch,_C(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},xD=["of","and","for","in","not","or","if","then","parent","list","value"],SD="keyword";function NC(e,t,o=SD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(a){Object.assign(n,NC(e[a],t,a))}),n;function r(a,i){t&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");n[l[0]]=[a,ED(l[0],l[1])]})}}function ED(e,t){return t?Number(t):CD(e)?0:1}function CD(e){return xD.includes(e.toLowerCase())}var bC={},sa=e=>{console.error(e)},TC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},cl=(e,t)=>{bC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),bC[`${e}/${t}`]=!0)},Kd=new Error;function OC(e,t,{key:o}){let n=0,r=e[o],a={},i={};for(let s=1;s<=t.length;s++)i[s+n]=r[s],a[s+n]=!0,n+=RC(t[s-1]);e[o]=i,e[o]._emit=a,e[o]._multi=!0}function _D(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Kd;if(typeof e.beginScope!="object"||e.beginScope===null)throw sa("beginScope must be object"),Kd;OC(e,e.begin,{key:"beginScope"}),e.begin=eg(e.begin,{joinWith:""})}}function RD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Kd;if(typeof e.endScope!="object"||e.endScope===null)throw sa("endScope must be object"),Kd;OC(e,e.end,{key:"endScope"}),e.end=eg(e.end,{joinWith:""})}}function wD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vD(e){wD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),_D(e),RD(e)}function AD(e){function t(i,s){return new RegExp(Oc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=RC(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=t(eg(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let u=l.findIndex((y,f)=>f>0&&y!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new o;return this.rules.slice(s).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){let s=new n;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[fD,yD,vD,TD].forEach(p=>p(i,s)),e.compilerExtensions.forEach(p=>p(i,s)),i.__beforeBegin=null,[gD,hD,bD].forEach(p=>p(i,s)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=NC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),s&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=Oc(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return ID(p==="self"?i:p)})),i.contains.forEach(function(p){a(p,l)}),i.starts&&a(i.starts,s),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ps(e.classNameAliases||{}),a(e)}function MC(e){return e?e.endsWithParent||MC(e.starts):!1}function ID(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ps(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:MC(e)?ps(e,{starts:e.starts?ps(e.starts):null}):Object.isFrozen(e)?ps(e):e}var ND="11.11.1",Jf=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},Yf=CC,xC=ps,SC=Symbol("nomatch"),OD=7,DC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Qf};function l(O){return s.noHighlightRe.test(O)}function u(O){let L=O.className+" ";L+=O.parentNode?O.parentNode.className:"";let P=s.languageDetectRe.exec(L);if(P){let $=I(P[1]);return $||(TC(a.replace("{}",P[1])),TC("Falling back to no-highlight mode for this block.",O)),$?P[1]:"no-highlight"}return L.split(/\s+/).find($=>l($)||I($))}function p(O,L,P){let $="",K="";typeof L=="object"?($=O,P=L.ignoreIllegals,K=L.language):(cl("10.7.0","highlight(lang, code, ...args) has been deprecated."),cl("10.7.0",`Please use highlight(code, options) instead.
|
|
3
3
|
https://github.com/highlightjs/highlight.js/issues/2277`),K=O,$=L),P===void 0&&(P=!0);let z={code:$,language:K};F("before:highlight",z);let H=z.result?z.result:y(z.language,z.code,P);return H.code=z.code,F("after:highlight",H),H}function y(O,L,P,$){let K=Object.create(null);function z(j,Z){return j.keywords[Z]}function H(){if(!te.keywords){$e.addText(qe);return}let j=0;te.keywordPatternRe.lastIndex=0;let Z=te.keywordPatternRe.exec(qe),ie="";for(;Z;){ie+=qe.substring(j,Z.index);let he=Ne.case_insensitive?Z[0].toLowerCase():Z[0],ke=z(te,he);if(ke){let[pe,ft]=ke;if($e.addText(ie),ie="",K[he]=(K[he]||0)+1,K[he]<=OD&&(bo+=ft),pe.startsWith("_"))ie+=Z[0];else{let Ao=Ne.classNameAliases[pe]||pe;U(Z[0],Ao)}}else ie+=Z[0];j=te.keywordPatternRe.lastIndex,Z=te.keywordPatternRe.exec(qe)}ie+=qe.substring(j),$e.addText(ie)}function J(){if(qe==="")return;let j=null;if(typeof te.subLanguage=="string"){if(!t[te.subLanguage]){$e.addText(qe);return}j=y(te.subLanguage,qe,!0,Ze[te.subLanguage]),Ze[te.subLanguage]=j._top}else j=g(qe,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(bo+=j.relevance),$e.__addSublanguage(j._emitter,j.language)}function ce(){te.subLanguage!=null?J():H(),qe=""}function U(j,Z){j!==""&&($e.startScope(Z),$e.addText(j),$e.endScope())}function Y(j,Z){let ie=1,he=Z.length-1;for(;ie<=he;){if(!j._emit[ie]){ie++;continue}let ke=Ne.classNameAliases[j[ie]]||j[ie],pe=Z[ie];ke?U(pe,ke):(qe=pe,H(),qe=""),ie++}}function ee(j,Z){return j.scope&&typeof j.scope=="string"&&$e.openNode(Ne.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(U(qe,Ne.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),qe=""):j.beginScope._multi&&(Y(j.beginScope,Z),qe="")),te=Object.create(j,{parent:{value:te}}),te}function X(j,Z,ie){let he=YM(j.endRe,ie);if(he){if(j["on:end"]){let ke=new $d(j);j["on:end"](Z,ke),ke.isMatchIgnored&&(he=!1)}if(he){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return X(j.parent,Z,ie)}function ne(j){return te.matcher.regexIndex===0?(qe+=j[0],1):(Ft=!0,0)}function le(j){let Z=j[0],ie=j.rule,he=new $d(ie),ke=[ie.__beforeBegin,ie["on:begin"]];for(let pe of ke)if(pe&&(pe(j,he),he.isMatchIgnored))return ne(Z);return ie.skip?qe+=Z:(ie.excludeBegin&&(qe+=Z),ce(),!ie.returnBegin&&!ie.excludeBegin&&(qe=Z)),ee(ie,j),ie.returnBegin?0:Z.length}function re(j){let Z=j[0],ie=L.substring(j.index),he=X(te,j,ie);if(!he)return SC;let ke=te;te.endScope&&te.endScope._wrap?(ce(),U(Z,te.endScope._wrap)):te.endScope&&te.endScope._multi?(ce(),Y(te.endScope,j)):ke.skip?qe+=Z:(ke.returnEnd||ke.excludeEnd||(qe+=Z),ce(),ke.excludeEnd&&(qe=Z));do te.scope&&$e.closeNode(),!te.skip&&!te.subLanguage&&(bo+=te.relevance),te=te.parent;while(te!==he.parent);return he.starts&&ee(he.starts,j),ke.returnEnd?0:Z.length}function ae(){let j=[];for(let Z=te;Z!==Ne;Z=Z.parent)Z.scope&&j.unshift(Z.scope);j.forEach(Z=>$e.openNode(Z))}let ge={};function Xe(j,Z){let ie=Z&&Z[0];if(qe+=j,ie==null)return ce(),0;if(ge.type==="begin"&&Z.type==="end"&&ge.index===Z.index&&ie===""){if(qe+=L.slice(Z.index,Z.index+1),!r){let he=new Error(`0 width match regex (${O})`);throw he.languageName=O,he.badRule=ge.rule,he}return 1}if(ge=Z,Z.type==="begin")return le(Z);if(Z.type==="illegal"&&!P){let he=new Error('Illegal lexeme "'+ie+'" for mode "'+(te.scope||"<unnamed>")+'"');throw he.mode=te,he}else if(Z.type==="end"){let he=re(Z);if(he!==SC)return he}if(Z.type==="illegal"&&ie==="")return qe+=`
|
|
4
4
|
`,1;if(oo>1e5&&oo>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=ie,ie.length}let Ne=I(O);if(!Ne)throw sa(a.replace("{}",O)),new Error('Unknown language: "'+O+'"');let Ae=AD(Ne),nt="",te=$||Ae,Ze={},$e=new s.__emitter(s);ae();let qe="",bo=0,To=0,oo=0,Ft=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(L,$e);else{for(te.matcher.considerAll();;){oo++,Ft?Ft=!1:te.matcher.considerAll(),te.matcher.lastIndex=To;let j=te.matcher.exec(L);if(!j)break;let Z=L.substring(To,j.index),ie=Xe(Z,j);To=j.index+ie}Xe(L.substring(To))}return $e.finalize(),nt=$e.toHTML(),{language:O,value:nt,relevance:bo,illegal:!1,_emitter:$e,_top:te}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:O,value:Yf(L),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:To,context:L.slice(To-100,To+100),mode:j.mode,resultSoFar:nt},_emitter:$e};if(r)return{language:O,value:Yf(L),illegal:!1,relevance:0,errorRaised:j,_emitter:$e,_top:te};throw j}}function f(O){let L={value:Yf(O),illegal:!1,relevance:0,_top:i,_emitter:new s.__emitter(s)};return L._emitter.addText(O),L}function g(O,L){L=L||s.languages||Object.keys(t);let P=f(O),$=L.filter(I).filter(D).map(ce=>y(ce,O,!1));$.unshift(P);let K=$.sort((ce,U)=>{if(ce.relevance!==U.relevance)return U.relevance-ce.relevance;if(ce.language&&U.language){if(I(ce.language).supersetOf===U.language)return 1;if(I(U.language).supersetOf===ce.language)return-1}return 0}),[z,H]=K,J=z;return J.secondBest=H,J}function h(O,L,P){let $=L&&o[L]||P;O.classList.add("hljs"),O.classList.add(`language-${$}`)}function x(O){let L=null,P=u(O);if(l(P))return;if(F("before:highlightElement",{el:O,language:P}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(O)),s.throwUnescapedHTML))throw new Jf("One of your code blocks includes unescaped HTML.",O.innerHTML);L=O;let $=L.textContent,K=P?p($,{language:P,ignoreIllegals:!0}):g($);O.innerHTML=K.value,O.dataset.highlighted="yes",h(O,P,K.language),O.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(O.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),F("after:highlightElement",{el:O,result:K,text:$})}function T(O){s=xC(s,O)}let E=()=>{b(),cl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){b(),cl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function b(){function O(){b()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",O,!1),S=!0;return}document.querySelectorAll(s.cssSelector).forEach(x)}function v(O,L){let P=null;try{P=L(e)}catch($){if(sa("Language definition for '{}' could not be registered.".replace("{}",O)),r)sa($);else throw $;P=i}P.name||(P.name=O),t[O]=P,P.rawDefinition=L.bind(null,e),P.aliases&&A(P.aliases,{languageName:O})}function R(O){delete t[O];for(let L of Object.keys(o))o[L]===O&&delete o[L]}function _(){return Object.keys(t)}function I(O){return O=(O||"").toLowerCase(),t[O]||t[o[O]]}function A(O,{languageName:L}){typeof O=="string"&&(O=[O]),O.forEach(P=>{o[P.toLowerCase()]=L})}function D(O){let L=I(O);return L&&!L.disableAutodetect}function N(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=L=>{O["before:highlightBlock"](Object.assign({block:L.el},L))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=L=>{O["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(O){N(O),n.push(O)}function G(O){let L=n.indexOf(O);L!==-1&&n.splice(L,1)}function F(O,L){let P=O;n.forEach(function($){$[P]&&$[P](L)})}function k(O){return cl("10.7.0","highlightBlock will be removed entirely in v12.0"),cl("10.7.0","Please use highlightElement now."),x(O)}Object.assign(e,{highlight:p,highlightAuto:g,highlightAll:b,highlightElement:x,highlightBlock:k,configure:T,initHighlighting:E,initHighlightingOnLoad:w,registerLanguage:v,unregisterLanguage:R,listLanguages:_,getLanguage:I,registerAliases:A,autoDetection:D,inherit:xC,addPlugin:B,removePlugin:G}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=ND,e.regex={concat:aa,lookahead:_C,either:Zf,optional:VM,anyNumberOfTimes:qM};for(let O in Wd)typeof Wd[O]=="object"&&EC(Wd[O]);return Object.assign(e,Wd),e},ul=DC({});ul.newInstance=()=>DC({});LC.exports=ul;ul.HighlightJS=ul;ul.default=ul});var rR=_t((KK,nR)=>{"use strict";var lL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";nR.exports=lL});var lR=_t((qK,aR)=>{"use strict";var cL=rR();function iR(){}function sR(){}sR.resetWarningCache=iR;aR.exports=function(){function e(n,r,a,i,s,l){if(l!==cL){var u=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 u.name="Invariant Violation",u}}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:sR,resetWarningCache:iR};return o.PropTypes=o,o}});var uR=_t((YK,cR)=>{cR.exports=lR()();var VK,zK});var gR=_t((XK,xm)=>{"use strict";var mR=hd(),uL=Rx(),dR=/\s/g;function vg(...e){let t=uL.apply(this,e),o=(n,r)=>dL(n?n.toString():"",t,r);return o.multiline=(n,r)=>mL(n?n.toString():"",t,r),o}var pR=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function dL(e,t,o){let n=fR(o),r=Math.max(e.replace(dR,"").length,t.stops.length),a=pR(t,n,r),i="";for(let s of e)i+=s.match(dR)?s:mR.hex(a.shift().toHex())(s);return i}function mL(e,t,o){let n=fR(o),r=e.split(`
|
|
5
5
|
`),a=Math.max.apply(null,r.map(l=>l.length).concat([t.stops.length])),i=pR(t,n,a),s=[];for(let l of r){let u=i.slice(0),p="";for(let y of l)p+=mR.hex(u.shift().toHex())(y);s.push(p)}return s.join(`
|
|
@@ -117,7 +117,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
117
117
|
`),await un())}Yo("authenticated")},[i,n,Yo,$n,zs]),xy=(0,V.useCallback)(async W=>{try{if($n(null),!W.trim()&&W.length>1){$n("API key cannot be empty string with length greater than 1.");return}await YT(W),await ay(),await n.refreshAuth("gemini-api-key"),Yo("authenticated")}catch(Ee){$n(`Failed to save API key: ${Ee instanceof Error?Ee.message:String(Ee)}`)}},[Yo,$n,ay,n]),Sy=(0,V.useCallback)(()=>{Yo("updating")},[Yo]);(0,V.useEffect)(()=>{Hr==="authenticated"&&(fe(n.getUserTier()),xe(n.getUserPaidTier()))},[n,Hr]),(0,V.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)$n(`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==="gemini-api-key")return;let W=Id(i.merged.security.auth.selectedType);W&&$n(W)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,$n]);let{isModelDialogOpen:Jp,openModelDialog:Ey,closeModelDialog:Cy}=UA(),{toggleVimEnabled:RO}=nl(),Zp=(0,V.useRef)(()=>{}),[Wa,Ys]=(0,V.useState)(!1),{cleanUiDetailsVisible:Ru,setCleanUiDetailsVisible:_y,toggleCleanUiDetailsVisible:Ry,revealCleanUiDetailsTemporarily:wu}=TO(),wO=(0,V.useMemo)(()=>({openAuthDialog:()=>Yo("updating"),openThemeDialog:oy,openEditorDialog:oc,openPrivacyNotice:()=>N(!0),openSettingsDialog:ey,openSessionBrowser:_u,openModelDialog:Ey,openAgentConfigDialog:de,openPermissionsDialog:Fr,quit:W=>{A(W),setTimeout(async()=>{await Vr(),Yh.exit(0)},100)},setDebugMessage:_,toggleCorgiMode:()=>S(W=>!W),toggleDebugProfiler:Te,dispatchExtensionStateUpdate:tr,addConfirmUpdateExtensionRequest:Er,toggleBackgroundTasks:()=>{Y.current(),ee.current||(L(!0),X.current.size>1?Zp.current(!0):Zp.current(!1))},toggleShortcutsHelp:()=>Ys(W=>!W),setText:jh}),[Yo,oy,oc,ey,_u,Ey,de,A,_,N,S,tr,Fr,Er,Te,Ys,jh]),{handleSlashCommand:Ei,slashCommands:vu,pendingHistoryItems:Au,commandContext:wy,confirmationRequest:Xs}=WA(n,i,h.addItem,h.clearItems,h.loadHistory,Qt,RO,k,wO,Ks,Me,Po,z),[sc,vy]=(0,V.useState)(null),[Iu,Ay]=(0,V.useState)(null);(0,V.useEffect)(()=>{let W=Ee=>{vy({prompt:Ee.prompt,onConfirm:me=>{vy(null),Ee.onConfirm(me)}})};return Re.on("consent-request",W),()=>{Re.off("consent-request",W)}},[]);let vO=(0,V.useCallback)(async()=>{h.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let W,Ee;if(n.isJitContextEnabled())await n.getMemoryContextManager()?.refresh(),n.updateSystemInstructionIfInitialized(),W=If(n.getUserMemory()),Ee=n.getGeminiMdFileCount();else{let me=await ud(n);W=If(me.memoryContent),Ee=me.fileCount}h.addItem({type:"info",text:`Memory reloaded successfully. ${W.length>0?`Loaded ${W.length} characters from ${Ee} file(s)`:"No memory content found"}`},Date.now()),n.getDebugMode()&&_e.log(`[DEBUG] Refreshed memory content in config: ${W.substring(0,200)}...`)}catch(W){let Ee=Rr(W);h.addItem({type:"error",text:`Error refreshing memory: ${Ee}`},Date.now()),_e.warn("Error refreshing memory:",W)}},[n,h]),ef=(0,V.useRef)(()=>{}),AO=(0,V.useCallback)(W=>{W?U(!0):(U(!1),ef.current(!1))},[]);(0,V.useEffect)(()=>{if(ce){let W=h.history.findLast(me=>me.type==="user"),Ee=jt.at(-1);(!W||typeof W.text=="string"&&W.text===Ee)&&(ef.current(!0),U(!1))}},[ce,jt,h.history]);let Nu=(0,V.useRef)([]),[IO,Iy]=(0,V.useState)(0),tf=(0,V.useCallback)(()=>{if(Nu.current.length===0)return null;let W=Nu.current.join(`
|
|
118
118
|
`);return Nu.current=[],Iy(0),W},[]);(0,V.useEffect)(()=>{let W=(Ee,me)=>{me!=="user_steering"&&me!=="background_completion"||(Nu.current.push(Ee),Iy(He=>He+1))};return n.injectionService.onInjection(W),()=>{n.injectionService.offInjection(W)}},[n]);let{streamingState:xo,submitQuery:$a,initError:of,pendingHistoryItems:Ou,thought:ac,cancelOngoingRequest:Ny,pendingToolCalls:NO,handleApprovalModeChange:Oy,activePtyId:Qi,loopDetectionConfirmationRequest:Mu,lastOutputTime:nf,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,toggleBackgroundTasks:Du,backgroundCurrentExecution:My,backgroundTasks:Wr,dismissBackgroundTask:Dy,retryStatus:OO}=oI(n.getGeminiClient(),h.history,h.addItem,n,i,_,Ei,Ae,xu,$n,vO,te,Ze,AO,L,yt,Tt,O,tf),Fo=(0,V.useMemo)(()=>[...Au,...Ou],[Au,Ou]);Y.current=Du,ee.current=Gr,X.current=Wr;let{activeBackgroundTaskPid:Ly,setIsBackgroundTaskListOpen:js,isBackgroundTaskListOpen:ky,setActiveBackgroundTaskPid:Py,backgroundTaskHeight:sf}=iO({backgroundTasks:Wr,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,activePtyId:Qi,embeddedShellFocused:O,setEmbeddedShellFocused:L,terminalHeight:Tt});Zp.current=js;let lc=(0,V.useRef)(0);(0,V.useEffect)(()=>{lc.current=nf},[nf]);let{shouldShowFocusHint:MO,inactivityStatus:By}=lI({activePtyId:Qi,lastOutputTime:nf,streamingState:xo,pendingToolCalls:NO,embeddedShellFocused:O,isInteractiveShellEnabled:n.isInteractiveShellEnabled()}),Fy=By==="action_required",Uy=By==="silent_working",DO=(0,V.useCallback)(W=>{Oy(W),Ru||wu(zh)},[Oy,Ru,wu]),{isMcpReady:cc}=XN(n),{messageQueue:Lu,addMessage:ku,clearQueue:Hy,getQueuedMessagesText:Gy,popAllMessages:Wy}=YN({isConfigInitialized:Me,streamingState:xo,submitQuery:$a,isMcpReady:cc});ef.current=(0,V.useCallback)((W=!0)=>{if(km(Fo))return;if(Lm(Fo)){Si.setText("");return}if(!W)return;let me=jt.at(-1)||"",He=Gy();He&&(me=me?`${me}
|
|
119
119
|
|
|
120
|
-
${He}`:He,Hy()),me&&Si.setText(me)},[Si,jt,Gy,Hy,Fo]);let $y=(0,V.useCallback)(W=>{let Ee=W.trim();Ee&&(n.injectionService.addInjection(Ee,"user_steering"),h.addItem({type:"hint",text:Ee}))},[n,h]),uc=(0,V.useCallback)(async W=>{s(),ht(null),Ao||(ko(!0),x||Qt());let Ee=ln(W.trim()),me=xo==="idle",He=xo==="responding"||Lm(Fo);if(Ee&&He){let{commandToExecute:Zi}=ja(W,vu??[]);if(Zi?.isSafeConcurrent){Ei(W),no(W);return}}if(n.isModelSteeringEnabled()&&He&&!Ee){$y(W),no(W);return}let Ut=Me&&cc;if(Ee&&Me||me&&Ut){if(!Ee){let Zi=await Xx(W,n);if(Zi.length>0){Ay({files:Zi,onComplete:tM=>{Ay(null),tM.allowed&&Zi.forEach(oM=>n.getWorkspaceContext().addReadOnlyPath(oM)),$a(W)}}),no(W);return}}$a(W)}else me&&!Ut&&Lu.length===0&&Re.emitFeedback("info",Me?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),ku(W);no(W)},[ku,no,$a,Ei,vu,cc,xo,Lu.length,Fo,n,Ao,ko,x,Qt,s,$y,Me,ht]),Ky=(0,V.useCallback)(()=>{s(),ht(null),h.clearItems(),ji(),Qt()},[h,ji,Qt,s,ht]),{handleInput:qy}=rI(Si,uc),af=!of&&!F&&!jp&&(xo==="idle"||xo==="responding"||xo==="waiting_for_confirmation")&&!rc,dc=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{dc.current?.disconnect()},[]);let[Pu,LO]=(0,V.useState)(0),[Vy,kO]=(0,V.useState)(0);(0,V.useLayoutEffect)(()=>{!H&&Pu>0&&kO(Pu)},[H,Pu]);let lf=H&&Vy>0?Vy:Pu,zy=(0,V.useCallback)(W=>{if(dc.current&&(dc.current.disconnect(),dc.current=null),W){let Ee=new cn(me=>{let He=me[0];if(He){let Ut=Math.round(He.contentRect.height);LO(Zi=>Ut!==Zi?Ut:Zi)}});Ee.observe(W),dc.current=Ee}},[]),cf=Math.max(0,Tt-lf-sf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(yt*o1),terminalHeight:Math.max(Math.floor(cf-n1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Bu,hasReceivedFocusEvent:PO}=yS(),Yy=(0,V.useMemo)(()=>{let W=i.merged.context.fileName;return W?Array.isArray(W)?W:[W]:eT()},[i.merged.context.fileName]),uf=(0,V.useMemo)(()=>n.getQuestion(),[n]),Xy=(0,V.useRef)(!1),jy=n.getGeminiClient();(0,V.useEffect)(()=>{uf&&Me&&!Xy.current&&!Ga&&!ic&&!nc&&!tc&&!D&&jy?.isInitialized?.()&&(uc(uf),Xy.current=!0)},[uf,Me,uc,Ga,ic,nc,tc,D,jy]);let[BO,FO]=(0,V.useState)(!1),[df,UO]=(0,V.useState)(null);(0,V.useEffect)(()=>{(async()=>{let me=(await rs.getInstance()).getCurrentIde();UO(me||null)})()},[]);let Fu=!!(df&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!BO),[Uu,mc]=(0,V.useState)(!1),[Qy,HO]=(0,V.useState)(!1),[Jy,GO]=(0,V.useState)(!0),Zy=(0,V.useCallback)(W=>{W>2&&lT(n),W>1&&Ei("/quit",void 0,void 0,!1)},[n,Ei]),{pressCount:eb,handlePress:tb}=Pl({windowMs:_i,onRepeat:Zy}),{pressCount:ob,handlePress:nb}=Pl({windowMs:_i,onRepeat:Zy}),[Hu,rb]=(0,V.useState)(),[ib,WO]=(0,V.useState)(!1),[mf,$O]=(0,V.useState)(!1),[sb,Ci]=Kp(_i),{isFolderTrustDialogOpen:pf,discoveryResults:ab,handleFolderTrustSelect:lb,isRestarting:cb}=cI(i,ie,h.addItem),ff=n.getPolicyUpdateConfirmationRequest(),[gf,ub]=(0,V.useState)(!!ff),{needsRestart:db,restartReason:mb}=BS(),pb=(0,V.useRef)(!0);tO(n,Z,h,z);let Ji=(0,V.useRef)(null);(0,V.useEffect)(()=>{let W=He=>{Ci({text:He.message,type:He.type})},Ee=()=>{Ci({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},me=()=>{Ci({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return It.on("transient-message",W),It.on("selection-warning",Ee),It.on("paste-timeout",me),()=>{It.off("transient-message",W),It.off("selection-warning",Ee),It.off("paste-timeout",me),Ji.current&&clearTimeout(Ji.current)}},[Ci]);let hf=(0,V.useCallback)(W=>{Ci({text:W,type:"warning"})},[Ci]),{handleSuspend:fb}=cO({handleWarning:hf,setRawMode:Rn,refreshStatic:Qt,setForceRerenderKey:v,shouldUseAlternateScreen:Vp});(0,V.useEffect)(()=>{db&&$O(!0)},[db]),(0,V.useEffect)(()=>{if(pb.current){pb.current=!1;return}let W=setTimeout(()=>{Qt()},300);return()=>{clearTimeout(W)}},[yt,Qt]),(0,V.useEffect)(()=>{let W=vf.subscribe(rb);return rb(vf.get()),W},[]),(0,V.useEffect)(()=>{let W=()=>{mc(!0),ko(!1)};return It.on("open-debug-console",W),()=>{It.off("open-debug-console",W)}},[n]);let gb=(0,V.useCallback)(W=>{WO(W)},[]),hb=(0,V.useCallback)(W=>{W.userSelection==="yes"?(Ei("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):W.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),FO(!0)},[Ei,i]),KO=(0,V.useCallback)(W=>{if(i.merged.general.debugKeystrokeLogging&&_e.log("[DEBUG] Keystroke:",JSON.stringify(W)),Wa&&t(W)&&Ys(!1),o["app.toggleMouseMode"](W))return E(He=>!He),T&&!x&&It.emit("scroll-to-bottom"),!0;if(x&&o["app.toggleCopyMode"](W))return J(!0),os(),!0;if(o["basic.quit"](W))return Ny?.(),tb(),!0;if(o["basic.exit"](W))return qp.current.text.length>0?!1:(nb(),!0);if(o["app.suspend"](W))fb();else if(o["app.dumpFrame"](W)){let Ut=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(Ut),_e.log(`Dumped frame to: ${Ut}`)),!0}else if(o["app.startRecording"](W)){let Ut=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return y&&(y(Ut),g.current=Ut,_e.log(`Started recording to: ${Ut}`)),!0}else{if(o["app.stopRecording"](W))return f&&(f(),_e.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](W)&&!x)return Ci({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let Ee=()=>{ht(!0);let He=ZR(h.history,Fo);He.length>0&&Xe(He)},me=!1;if(Ao||(me=!0,ko(!0),o["app.showMoreLines"](W)&&Ee(),x||Qt()),o["app.showErrorDetails"](W))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:He}=await import("./devtoolsService-BYHL77Z2.js");await He(n,Uu,()=>mc(Ut=>!Ut),()=>mc(!0))})():mc(He=>!He),!0;if(o["app.showFullTodos"](W))return HO(He=>!He),!0;if(o["app.toggleMarkdown"](W))return GO(He=>{let Ut=!He;return Qt(),Ut}),!0;if(o["app.showIdeContextDetail"](W)&&n.getIdeMode()&&Hu)return Ei("/ide status"),!0;if(o["app.showMoreLines"](W)&&!me)return ko(!1),Ee(),Qt(),!0;if((o["app.focusShellInput"](W)||o["background.unfocusList"](W))&&(Qi||Gr&&Wr.size>0)){if(O){let Ut=lc.current;return Ji.current&&clearTimeout(Ji.current),Ji.current=setTimeout(()=>{lc.current===Ut?L(!1):Ci({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-lc.current>=100&&!Qi&&!Gr?(Ji.current&&clearTimeout(Ji.current),Du(),L(!0),Wr.size>1&&js(!0),!0):(L(!0),!0)}else{if(o["app.unfocusShellInput"](W)||o["background.unfocus"](W))return O?(L(!1),!0):!1;if(o["background.toggle"](W))return Qi?My():(Du(),!Gr&&Wr.size>0?(L(!0),Wr.size>1&&js(!0)):L(!1)),!0;if(o["background.toggleList"](W))return Wr.size>0&&Gr&&(O||L(!0),js(!0)),!0}return!1},[Ao,ko,mc,n,Hu,tb,nb,Ei,Ny,Qi,fb,O,i.merged.general.debugKeystrokeLogging,Qt,J,Ji,x,Wa,My,Du,Wr,Gr,js,lc,Ci,i.merged.general.devtools,Uu,ht,o,t,h.history,Fo,Xe,p,y,f,T]);ye(KO,{isActive:!0,priority:!0}),ye(W=>o["scroll.up"](W)||o["scroll.down"](W)||o["scroll.pageUp"](W)||o["scroll.pageDown"](W)||o["scroll.home"](W)||o["scroll.end"](W)?!1:(J(!1),T&&ts(),!0),{isActive:H,priority:200}),(0,V.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let W=Ep({streamingState:xo,thoughtSubject:ac?.subject,isConfirming:!!Xs||Fy,isSilentWorking:Uy,folderName:t1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});ir.current!==W&&(ir.current=W,mt.write(`\x1B]0;${W}\x07`))},[xo,ac,Xs,Fy,Uy,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,mt]),(0,V.useEffect)(()=>{let W=me=>{let He;switch(me.severity){case"error":He="error";break;case"warning":He="warning";break;case"info":He="info";break;default:throw new Error(`Unexpected severity for user feedback: ${me.severity}`)}h.addItem({type:He,text:me.message},Date.now()),me.error&&_e.warn(`[Feedback Details for "${me.message}"]`,me.error)},Ee=me=>{h.addItem({type:"info",text:me.message,source:me.hookName},Date.now())};return Re.on("user-feedback",W),Re.on("hook-system-message",Ee),Re.drainBacklogs(),()=>{Re.off("user-feedback",W),Re.off("hook-system-message",Ee)}},[h]);let yb=e.version.includes("nightly"),bb=Fu||Fu||pf||gf||ne||!!Xs||!!sc||!!Iu||!!K||Pr.length>0||!!Mu||nc||Yp||Jp||Ti||Vi||Ga||ic||tc||D||mf||!!rc||!!Su||!!Eu||!!Cu||Qp||Hr==="awaiting_api_key_input"||!!pe,qO=(0,V.useMemo)(()=>km(Fo),[Fo]),Tb=Pr.length>0,xb=!!Mu,pc=qO||!!Xs||!!sc||Tb||xb||!!rc||!!Su||!!Eu||!!Cu||!!K,Gu=i.merged.ui.loadingPhrases,VO=Gu==="tips"||Gu==="all",zO=Gu==="witty"||Gu==="all",YO=(!O||Gr)&&xo==="responding"&&!pc,Wu=0;if(oo.length>0&&i.merged.hooksConfig.notifications){let W=oo.length>1?"Executing Hooks":"Executing Hook",Ee=oo.map(me=>me.name+(me.index&&me.total&&me.total>1?` (${me.index}/${me.total})`:"")).join(", ");Wu=W.length+Ee.length+10}else YO?Wu=(ac?.subject||"Waiting for model...").length+25:pc&&(Wu=35);let XO=yt-Wu-5,{elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b}=sI({streamingState:xo,shouldShowFocusHint:MO,retryStatus:OO,showTips:VO,showWit:zO,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:XO}),yf=n.isPlanEnabled()&&xo==="idle"&&!pc,Rb=jN({config:n,addItem:h.addItem,onApprovalModeChange:DO,isActive:!O,allowPlanMode:yf});yO({notificationsEnabled:l,isFocused:Bu,hasReceivedFocusEvent:PO,streamingState:xo,hasPendingActionRequired:pc,pendingHistoryItems:Fo,commandConfirmationRequest:Xs,authConsentRequest:sc,permissionConfirmationRequest:Iu,hasConfirmUpdateExtensionRequests:Tb,hasLoopDetectionConfirmationRequest:xb});let wb=af&&xo==="idle"&&!pc;(0,V.useEffect)(()=>{Wa&&!wb&&Ys(!1)},[Wa,wb,Ys]),(0,V.useEffect)(()=>{if(!Me||!n.isModelSteeringEnabled()||xo!=="idle"||!cc||km(Fo))return;let W=tf();W&&$a([{text:md(W)}])},[n,h,Me,cc,xo,$a,tf,Fo,IO]);let jO=(0,V.useMemo)(()=>Pm(Fo),[Fo]),[vb,QO]=(0,V.useState)(n.getGeminiMdFileCount());(0,V.useEffect)(()=>{let W=Ee=>{QO(Ee.fileCount)};return Re.on("memory-changed",W),()=>{Re.off("memory-changed",W)}},[]),(0,V.useEffect)(()=>{let W=!0;return(async()=>{let[me,He]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);W&&(qi(me),er(He),Po(!0))})(),()=>{W=!1}},[n,Qt]);let JO=(0,V.useMemo)(()=>({buffer:Si,userMessages:jt,shellModeActive:Ae,showEscapePrompt:ib,copyModeEnabled:H,inputWidth:Ha,suggestionsWidth:ec}),[Si,jt,Ae,ib,H,Ha,ec]),ZO=(0,V.useMemo)(()=>({history:h.history,historyManager:h,isThemeDialogOpen:nc,themeError:B,isAuthenticating:Ga,isConfigInitialized:Me,authError:iy,accountSuspensionInfo:ly,isAuthDialogOpen:ic,isAwaitingApiKeyInput:Hr==="awaiting_api_key_input",apiKeyDefaultValue:sy,editorError:Qh,isEditorDialogOpen:tc,showPrivacyNotice:D,mouseMode:T,corgiMode:w,debugMessage:R,quittingMessages:I,isSettingsDialogOpen:Yp,isSessionBrowserOpen:Qp,isModelDialogOpen:Jp,isAgentConfigDialogOpen:Ti,selectedAgentName:xi,selectedAgentDisplayName:Vs,selectedAgentDefinition:ue,isPermissionsDialogOpen:Vi,permissionsDialogProps:Yi,slashCommands:vu,pendingSlashCommandHistoryItems:Au,commandContext:wy,commandConfirmationRequest:Xs,authConsentRequest:sc,confirmUpdateExtensionRequests:Pr,loopDetectionConfirmationRequest:Mu,permissionConfirmationRequest:Iu,geminiMdFileCount:vb,streamingState:xo,initError:of,pendingGeminiHistoryItems:Ou,thought:ac,isInputActive:af,isResuming:jp,shouldShowIdePrompt:Fu,isFolderTrustDialogOpen:pf??!1,folderDiscoveryResults:ab,isPolicyUpdateDialogOpen:gf,policyUpdateConfirmationRequest:ff,isTrustedFolder:Z,constrainHeight:Ao,showErrorDetails:Uu,showFullTodos:Qy,ideContextState:Hu,renderMarkdown:Jy,ctrlCPressedOnce:eb>=1,ctrlDPressedOnce:ob>=1,shortcutsHelpVisible:Wa,cleanUiDetailsVisible:Ru,isFocused:Bu,elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b,historyRemountKey:$e,activeHooks:oo,messageQueue:Lu,queueErrorMessage:he,showApprovalModeIndicator:Rb,allowPlanMode:yf,currentModel:Se,quota:{userTier:q,stats:Oe,proQuotaRequest:rc,validationRequest:Su,overageMenuRequest:Eu,emptyWalletRequest:Cu},contextFileNames:Yy,errorCount:Xi,availableTerminalHeight:cf,stableControlsHeight:lf,mainAreaWidth:_r,staticAreaMaxItemHeight:Xh,staticExtraHeight:sr,dialogsVisible:bb,pendingHistoryItems:Fo,nightly:yb,branchName:nr,sessionStats:Cr,terminalWidth:yt,terminalHeight:Tt,mainControlsRef:zy,rootUiRef:rr,currentIDE:df,updateInfo:Ft,showIdeRestartPrompt:mf,ideTrustRestartReason:mb,isRestarting:cb,extensionsUpdateState:$s,activePtyId:Qi,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,embeddedShellFocused:O,showDebugProfiler:P,customDialog:K,transientMessage:sb,bannerData:Cn,bannerVisible:sn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:bo,backgroundTasks:Wr,activeBackgroundTaskPid:Ly,backgroundTaskHeight:sf,isBackgroundTaskListOpen:ky,adminSettingsChanged:ne,newAgents:pe,showIsExpandableHint:Ki,hintMode:n.isModelSteeringEnabled()&&Lm(Fo),hintBuffer:""}),[nc,B,Ga,Me,iy,ly,ic,Qh,tc,D,T,w,R,I,Yp,Qp,Jp,Ti,xi,Vs,ue,Vi,Yi,vu,Au,wy,Xs,sc,Pr,Mu,Iu,vb,xo,of,Ou,ac,af,jp,Fu,pf,ab,gf,ff,Z,Ao,Uu,Qy,Hu,Jy,eb,ob,Wa,Ru,Bu,Sb,Eb,Cb,_b,$e,oo,Lu,he,Rb,yf,q,Oe,rc,Su,Eu,Cu,Yy,Xi,cf,lf,_r,Xh,sr,bb,Fo,yb,nr,Cr,yt,Tt,zy,rr,df,Ft,mf,mb,cb,Se,$s,Qi,rf,Gr,h,O,P,K,sy,Hr,sb,Cn,sn,n,bo,sf,ky,Ly,Wr,ne,pe,Ki]),Ab=(0,V.useCallback)(()=>N(!1),[N]),eM=(0,V.useMemo)(()=>({handleThemeSelect:Xp,closeThemeDialog:ny,handleThemeHighlight:ry,handleAuthSelect:Ty,setAuthState:Yo,onAuthError:$n,handleEditorSelect:Jh,exitEditorDialog:Zh,exitPrivacyNotice:Ab,closeSettingsDialog:ty,closeModelDialog:Cy,openAgentConfigDialog:de,closeAgentConfigDialog:Ie,openPermissionsDialog:Fr,closePermissionsDialog:or,setShellModeActive:nt,vimHandleInput:qy,handleIdePromptComplete:hb,handleFolderTrustSelect:lb,setIsPolicyUpdateDialogOpen:ub,setConstrainHeight:ko,onEscapePromptChange:gb,refreshStatic:Qt,handleFinalSubmit:uc,handleClearScreen:Ky,handleProQuotaChoice:dy,handleValidationChoice:my,handleOverageMenuChoice:py,handleEmptyWalletChoice:fy,openSessionBrowser:_u,closeSessionBrowser:gy,handleResumeSession:hy,handleDeleteSession:by,setQueueErrorMessage:ke,addMessage:ku,popAllMessages:Wy,handleApiKeySubmit:xy,handleApiKeyCancel:Sy,setBannerVisible:Po,setShortcutsHelpVisible:Ys,setCleanUiDetailsVisible:_y,toggleCleanUiDetailsVisible:Ry,revealCleanUiDetailsTemporarily:wu,handleWarning:hf,setEmbeddedShellFocused:L,dismissBackgroundTask:Dy,setActiveBackgroundTaskPid:Py,setIsBackgroundTaskListOpen:js,setAuthContext:zs,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Yh.send){let W=n.getRemoteAdminSettings();W&&Yh.send({type:"admin-settings-update",settings:W})}await un()},handleNewAgentsSelect:async W=>{if(pe&&W==="acknowledge"){let Ee=n.getAgentRegistry();try{await Promise.all(pe.map(me=>Ee.acknowledgeAgent(me)))}catch(me){_e.error("Failed to acknowledge agents:",me),h.addItem({type:"error",text:`Failed to acknowledge agents: ${Rr(me)}`},Date.now())}}ft(null)},getPreferredEditor:xu,clearAccountSuspension:()=>{cy(null),Yo("updating")}}),[Xp,ny,ry,Ty,Yo,$n,Jh,Zh,Ab,ty,Cy,de,Ie,Fr,or,nt,qy,hb,lb,ub,ko,gb,Qt,uc,Ky,dy,my,py,fy,_u,gy,hy,by,ke,ku,Wy,xy,Sy,Po,Ys,_y,Ry,wu,hf,L,Dy,Py,js,zs,cy,pe,n,h,xu]);return Hr==="awaiting_google_login_restart"?(0,Sr.jsx)(sO,{onDismiss:()=>{zs({}),Yo("updating")},config:n}):(0,Sr.jsx)(Ed.Provider,{value:ZO,children:(0,Sr.jsx)(VS.Provider,{value:JO,children:(0,Sr.jsx)(Cg.Provider,{value:eM,children:(0,Sr.jsx)(tl.Provider,{value:n,children:(0,Sr.jsx)(Ng.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Sr.jsx)(W_,{config:n,toolCalls:jO,isExpanded:Ne,toggleExpansion:ge,toggleAllExpansion:Xe,children:(0,Sr.jsx)(oh.Provider,{value:Bu,children:(0,Sr.jsx)(Qd,{mouseEventsEnabled:T,children:(0,Sr.jsx)(Jd,{children:(0,Sr.jsx)(_A,{},`app-${b}`)})})})})})})})})})};var Hn=C(M(),1);var i1=200;async function oae(e,t,o,n=process.cwd(),r,a){mv();let i=nd(e.getUseAlternateBuffer(),e.getScreenReader()),s=i;s&&(ts(),ls(()=>{os()}));let{matchers:l,errors:u}=await SS();u.forEach(E=>{Re.emitFeedback("warning",E)});let p=await qT();s1(r1(n),t);let y=new Vx({onNewMessage:E=>{Re.emitConsoleLog(E.type,E.content)},debugMode:e.getDebugMode()});y.patch(),ls(y.cleanup);let{stdout:f,stderr:g}=hT(),h=!!process.env.SHPOOL_SESSION_NAME,x=()=>(ip(),(0,Hn.jsx)(bS.Provider,{value:t,children:(0,Hn.jsx)(ES,{value:l,children:(0,Hn.jsx)(TS,{config:e,children:(0,Hn.jsx)(Qd,{mouseEventsEnabled:s,children:(0,Hn.jsx)(AA,{children:(0,Hn.jsx)(Jd,{children:(0,Hn.jsx)(dl,{children:(0,Hn.jsx)(TR,{children:(0,Hn.jsx)(qS,{children:(0,Hn.jsx)(xO,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:a})})})})})})})})})}));h&&await new Promise(E=>setTimeout(E,100));let T=lS(process.env.DEBUG?(0,Hn.jsx)(SO.default.StrictMode,{children:(0,Hn.jsx)(x,{})}):(0,Hn.jsx)(x,{}),{stdout:f,stderr:g,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:E})=>{E>i1&&cT(e,E),KS.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(qa(),ls(()=>{td()})),zN(t).then(E=>{eE(E,t,e.getProjectRoot())}).catch(E=>{e.getDebugMode()&&_e.warn("Update check failed:",E)}),ls(()=>T.unmount()),ls(Hx())}function s1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Ep({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Kn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Kn("\x1B]0;\x07")})}}export{oae as startInteractiveUI};
|
|
120
|
+
${He}`:He,Hy()),me&&Si.setText(me)},[Si,jt,Gy,Hy,Fo]);let $y=(0,V.useCallback)(W=>{let Ee=W.trim();Ee&&(n.injectionService.addInjection(Ee,"user_steering"),h.addItem({type:"hint",text:Ee}))},[n,h]),uc=(0,V.useCallback)(async W=>{s(),ht(null),Ao||(ko(!0),x||Qt());let Ee=ln(W.trim()),me=xo==="idle",He=xo==="responding"||Lm(Fo);if(Ee&&He){let{commandToExecute:Zi}=ja(W,vu??[]);if(Zi?.isSafeConcurrent){Ei(W),no(W);return}}if(n.isModelSteeringEnabled()&&He&&!Ee){$y(W),no(W);return}let Ut=Me&&cc;if(Ee&&Me||me&&Ut){if(!Ee){let Zi=await Xx(W,n);if(Zi.length>0){Ay({files:Zi,onComplete:tM=>{Ay(null),tM.allowed&&Zi.forEach(oM=>n.getWorkspaceContext().addReadOnlyPath(oM)),$a(W)}}),no(W);return}}$a(W)}else me&&!Ut&&Lu.length===0&&Re.emitFeedback("info",Me?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),ku(W);no(W)},[ku,no,$a,Ei,vu,cc,xo,Lu.length,Fo,n,Ao,ko,x,Qt,s,$y,Me,ht]),Ky=(0,V.useCallback)(()=>{s(),ht(null),h.clearItems(),ji(),Qt()},[h,ji,Qt,s,ht]),{handleInput:qy}=rI(Si,uc),af=!of&&!F&&!jp&&(xo==="idle"||xo==="responding"||xo==="waiting_for_confirmation")&&!rc,dc=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{dc.current?.disconnect()},[]);let[Pu,LO]=(0,V.useState)(0),[Vy,kO]=(0,V.useState)(0);(0,V.useLayoutEffect)(()=>{!H&&Pu>0&&kO(Pu)},[H,Pu]);let lf=H&&Vy>0?Vy:Pu,zy=(0,V.useCallback)(W=>{if(dc.current&&(dc.current.disconnect(),dc.current=null),W){let Ee=new cn(me=>{let He=me[0];if(He){let Ut=Math.round(He.contentRect.height);LO(Zi=>Ut!==Zi?Ut:Zi)}});Ee.observe(W),dc.current=Ee}},[]),cf=Math.max(0,Tt-lf-sf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(yt*o1),terminalHeight:Math.max(Math.floor(cf-n1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Bu,hasReceivedFocusEvent:PO}=yS(),Yy=(0,V.useMemo)(()=>{let W=i.merged.context.fileName;return W?Array.isArray(W)?W:[W]:eT()},[i.merged.context.fileName]),uf=(0,V.useMemo)(()=>n.getQuestion(),[n]),Xy=(0,V.useRef)(!1),jy=n.getGeminiClient();(0,V.useEffect)(()=>{uf&&Me&&!Xy.current&&!Ga&&!ic&&!nc&&!tc&&!D&&jy?.isInitialized?.()&&(uc(uf),Xy.current=!0)},[uf,Me,uc,Ga,ic,nc,tc,D,jy]);let[BO,FO]=(0,V.useState)(!1),[df,UO]=(0,V.useState)(null);(0,V.useEffect)(()=>{(async()=>{let me=(await rs.getInstance()).getCurrentIde();UO(me||null)})()},[]);let Fu=!!(df&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!BO),[Uu,mc]=(0,V.useState)(!1),[Qy,HO]=(0,V.useState)(!1),[Jy,GO]=(0,V.useState)(!0),Zy=(0,V.useCallback)(W=>{W>2&&lT(n),W>1&&Ei("/quit",void 0,void 0,!1)},[n,Ei]),{pressCount:eb,handlePress:tb}=Pl({windowMs:_i,onRepeat:Zy}),{pressCount:ob,handlePress:nb}=Pl({windowMs:_i,onRepeat:Zy}),[Hu,rb]=(0,V.useState)(),[ib,WO]=(0,V.useState)(!1),[mf,$O]=(0,V.useState)(!1),[sb,Ci]=Kp(_i),{isFolderTrustDialogOpen:pf,discoveryResults:ab,handleFolderTrustSelect:lb,isRestarting:cb}=cI(i,ie,h.addItem),ff=n.getPolicyUpdateConfirmationRequest(),[gf,ub]=(0,V.useState)(!!ff),{needsRestart:db,restartReason:mb}=BS(),pb=(0,V.useRef)(!0);tO(n,Z,h,z);let Ji=(0,V.useRef)(null);(0,V.useEffect)(()=>{let W=He=>{Ci({text:He.message,type:He.type})},Ee=()=>{Ci({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},me=()=>{Ci({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return It.on("transient-message",W),It.on("selection-warning",Ee),It.on("paste-timeout",me),()=>{It.off("transient-message",W),It.off("selection-warning",Ee),It.off("paste-timeout",me),Ji.current&&clearTimeout(Ji.current)}},[Ci]);let hf=(0,V.useCallback)(W=>{Ci({text:W,type:"warning"})},[Ci]),{handleSuspend:fb}=cO({handleWarning:hf,setRawMode:Rn,refreshStatic:Qt,setForceRerenderKey:v,shouldUseAlternateScreen:Vp});(0,V.useEffect)(()=>{db&&$O(!0)},[db]),(0,V.useEffect)(()=>{if(pb.current){pb.current=!1;return}let W=setTimeout(()=>{Qt()},300);return()=>{clearTimeout(W)}},[yt,Qt]),(0,V.useEffect)(()=>{let W=vf.subscribe(rb);return rb(vf.get()),W},[]),(0,V.useEffect)(()=>{let W=()=>{mc(!0),ko(!1)};return It.on("open-debug-console",W),()=>{It.off("open-debug-console",W)}},[n]);let gb=(0,V.useCallback)(W=>{WO(W)},[]),hb=(0,V.useCallback)(W=>{W.userSelection==="yes"?(Ei("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):W.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),FO(!0)},[Ei,i]),KO=(0,V.useCallback)(W=>{if(i.merged.general.debugKeystrokeLogging&&_e.log("[DEBUG] Keystroke:",JSON.stringify(W)),Wa&&t(W)&&Ys(!1),o["app.toggleMouseMode"](W))return E(He=>!He),T&&!x&&It.emit("scroll-to-bottom"),!0;if(x&&o["app.toggleCopyMode"](W))return J(!0),os(),!0;if(o["basic.quit"](W))return Ny?.(),tb(),!0;if(o["basic.exit"](W))return qp.current.text.length>0?!1:(nb(),!0);if(o["app.suspend"](W))fb();else if(o["app.dumpFrame"](W)){let Ut=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(Ut),_e.log(`Dumped frame to: ${Ut}`)),!0}else if(o["app.startRecording"](W)){let Ut=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return y&&(y(Ut),g.current=Ut,_e.log(`Started recording to: ${Ut}`)),!0}else{if(o["app.stopRecording"](W))return f&&(f(),_e.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](W)&&!x)return Ci({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let Ee=()=>{ht(!0);let He=ZR(h.history,Fo);He.length>0&&Xe(He)},me=!1;if(Ao||(me=!0,ko(!0),o["app.showMoreLines"](W)&&Ee(),x||Qt()),o["app.showErrorDetails"](W))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:He}=await import("./devtoolsService-CLP7VYOP.js");await He(n,Uu,()=>mc(Ut=>!Ut),()=>mc(!0))})():mc(He=>!He),!0;if(o["app.showFullTodos"](W))return HO(He=>!He),!0;if(o["app.toggleMarkdown"](W))return GO(He=>{let Ut=!He;return Qt(),Ut}),!0;if(o["app.showIdeContextDetail"](W)&&n.getIdeMode()&&Hu)return Ei("/ide status"),!0;if(o["app.showMoreLines"](W)&&!me)return ko(!1),Ee(),Qt(),!0;if((o["app.focusShellInput"](W)||o["background.unfocusList"](W))&&(Qi||Gr&&Wr.size>0)){if(O){let Ut=lc.current;return Ji.current&&clearTimeout(Ji.current),Ji.current=setTimeout(()=>{lc.current===Ut?L(!1):Ci({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-lc.current>=100&&!Qi&&!Gr?(Ji.current&&clearTimeout(Ji.current),Du(),L(!0),Wr.size>1&&js(!0),!0):(L(!0),!0)}else{if(o["app.unfocusShellInput"](W)||o["background.unfocus"](W))return O?(L(!1),!0):!1;if(o["background.toggle"](W))return Qi?My():(Du(),!Gr&&Wr.size>0?(L(!0),Wr.size>1&&js(!0)):L(!1)),!0;if(o["background.toggleList"](W))return Wr.size>0&&Gr&&(O||L(!0),js(!0)),!0}return!1},[Ao,ko,mc,n,Hu,tb,nb,Ei,Ny,Qi,fb,O,i.merged.general.debugKeystrokeLogging,Qt,J,Ji,x,Wa,My,Du,Wr,Gr,js,lc,Ci,i.merged.general.devtools,Uu,ht,o,t,h.history,Fo,Xe,p,y,f,T]);ye(KO,{isActive:!0,priority:!0}),ye(W=>o["scroll.up"](W)||o["scroll.down"](W)||o["scroll.pageUp"](W)||o["scroll.pageDown"](W)||o["scroll.home"](W)||o["scroll.end"](W)?!1:(J(!1),T&&ts(),!0),{isActive:H,priority:200}),(0,V.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let W=Ep({streamingState:xo,thoughtSubject:ac?.subject,isConfirming:!!Xs||Fy,isSilentWorking:Uy,folderName:t1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});ir.current!==W&&(ir.current=W,mt.write(`\x1B]0;${W}\x07`))},[xo,ac,Xs,Fy,Uy,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,mt]),(0,V.useEffect)(()=>{let W=me=>{let He;switch(me.severity){case"error":He="error";break;case"warning":He="warning";break;case"info":He="info";break;default:throw new Error(`Unexpected severity for user feedback: ${me.severity}`)}h.addItem({type:He,text:me.message},Date.now()),me.error&&_e.warn(`[Feedback Details for "${me.message}"]`,me.error)},Ee=me=>{h.addItem({type:"info",text:me.message,source:me.hookName},Date.now())};return Re.on("user-feedback",W),Re.on("hook-system-message",Ee),Re.drainBacklogs(),()=>{Re.off("user-feedback",W),Re.off("hook-system-message",Ee)}},[h]);let yb=e.version.includes("nightly"),bb=Fu||Fu||pf||gf||ne||!!Xs||!!sc||!!Iu||!!K||Pr.length>0||!!Mu||nc||Yp||Jp||Ti||Vi||Ga||ic||tc||D||mf||!!rc||!!Su||!!Eu||!!Cu||Qp||Hr==="awaiting_api_key_input"||!!pe,qO=(0,V.useMemo)(()=>km(Fo),[Fo]),Tb=Pr.length>0,xb=!!Mu,pc=qO||!!Xs||!!sc||Tb||xb||!!rc||!!Su||!!Eu||!!Cu||!!K,Gu=i.merged.ui.loadingPhrases,VO=Gu==="tips"||Gu==="all",zO=Gu==="witty"||Gu==="all",YO=(!O||Gr)&&xo==="responding"&&!pc,Wu=0;if(oo.length>0&&i.merged.hooksConfig.notifications){let W=oo.length>1?"Executing Hooks":"Executing Hook",Ee=oo.map(me=>me.name+(me.index&&me.total&&me.total>1?` (${me.index}/${me.total})`:"")).join(", ");Wu=W.length+Ee.length+10}else YO?Wu=(ac?.subject||"Waiting for model...").length+25:pc&&(Wu=35);let XO=yt-Wu-5,{elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b}=sI({streamingState:xo,shouldShowFocusHint:MO,retryStatus:OO,showTips:VO,showWit:zO,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:XO}),yf=n.isPlanEnabled()&&xo==="idle"&&!pc,Rb=jN({config:n,addItem:h.addItem,onApprovalModeChange:DO,isActive:!O,allowPlanMode:yf});yO({notificationsEnabled:l,isFocused:Bu,hasReceivedFocusEvent:PO,streamingState:xo,hasPendingActionRequired:pc,pendingHistoryItems:Fo,commandConfirmationRequest:Xs,authConsentRequest:sc,permissionConfirmationRequest:Iu,hasConfirmUpdateExtensionRequests:Tb,hasLoopDetectionConfirmationRequest:xb});let wb=af&&xo==="idle"&&!pc;(0,V.useEffect)(()=>{Wa&&!wb&&Ys(!1)},[Wa,wb,Ys]),(0,V.useEffect)(()=>{if(!Me||!n.isModelSteeringEnabled()||xo!=="idle"||!cc||km(Fo))return;let W=tf();W&&$a([{text:md(W)}])},[n,h,Me,cc,xo,$a,tf,Fo,IO]);let jO=(0,V.useMemo)(()=>Pm(Fo),[Fo]),[vb,QO]=(0,V.useState)(n.getGeminiMdFileCount());(0,V.useEffect)(()=>{let W=Ee=>{QO(Ee.fileCount)};return Re.on("memory-changed",W),()=>{Re.off("memory-changed",W)}},[]),(0,V.useEffect)(()=>{let W=!0;return(async()=>{let[me,He]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);W&&(qi(me),er(He),Po(!0))})(),()=>{W=!1}},[n,Qt]);let JO=(0,V.useMemo)(()=>({buffer:Si,userMessages:jt,shellModeActive:Ae,showEscapePrompt:ib,copyModeEnabled:H,inputWidth:Ha,suggestionsWidth:ec}),[Si,jt,Ae,ib,H,Ha,ec]),ZO=(0,V.useMemo)(()=>({history:h.history,historyManager:h,isThemeDialogOpen:nc,themeError:B,isAuthenticating:Ga,isConfigInitialized:Me,authError:iy,accountSuspensionInfo:ly,isAuthDialogOpen:ic,isAwaitingApiKeyInput:Hr==="awaiting_api_key_input",apiKeyDefaultValue:sy,editorError:Qh,isEditorDialogOpen:tc,showPrivacyNotice:D,mouseMode:T,corgiMode:w,debugMessage:R,quittingMessages:I,isSettingsDialogOpen:Yp,isSessionBrowserOpen:Qp,isModelDialogOpen:Jp,isAgentConfigDialogOpen:Ti,selectedAgentName:xi,selectedAgentDisplayName:Vs,selectedAgentDefinition:ue,isPermissionsDialogOpen:Vi,permissionsDialogProps:Yi,slashCommands:vu,pendingSlashCommandHistoryItems:Au,commandContext:wy,commandConfirmationRequest:Xs,authConsentRequest:sc,confirmUpdateExtensionRequests:Pr,loopDetectionConfirmationRequest:Mu,permissionConfirmationRequest:Iu,geminiMdFileCount:vb,streamingState:xo,initError:of,pendingGeminiHistoryItems:Ou,thought:ac,isInputActive:af,isResuming:jp,shouldShowIdePrompt:Fu,isFolderTrustDialogOpen:pf??!1,folderDiscoveryResults:ab,isPolicyUpdateDialogOpen:gf,policyUpdateConfirmationRequest:ff,isTrustedFolder:Z,constrainHeight:Ao,showErrorDetails:Uu,showFullTodos:Qy,ideContextState:Hu,renderMarkdown:Jy,ctrlCPressedOnce:eb>=1,ctrlDPressedOnce:ob>=1,shortcutsHelpVisible:Wa,cleanUiDetailsVisible:Ru,isFocused:Bu,elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b,historyRemountKey:$e,activeHooks:oo,messageQueue:Lu,queueErrorMessage:he,showApprovalModeIndicator:Rb,allowPlanMode:yf,currentModel:Se,quota:{userTier:q,stats:Oe,proQuotaRequest:rc,validationRequest:Su,overageMenuRequest:Eu,emptyWalletRequest:Cu},contextFileNames:Yy,errorCount:Xi,availableTerminalHeight:cf,stableControlsHeight:lf,mainAreaWidth:_r,staticAreaMaxItemHeight:Xh,staticExtraHeight:sr,dialogsVisible:bb,pendingHistoryItems:Fo,nightly:yb,branchName:nr,sessionStats:Cr,terminalWidth:yt,terminalHeight:Tt,mainControlsRef:zy,rootUiRef:rr,currentIDE:df,updateInfo:Ft,showIdeRestartPrompt:mf,ideTrustRestartReason:mb,isRestarting:cb,extensionsUpdateState:$s,activePtyId:Qi,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,embeddedShellFocused:O,showDebugProfiler:P,customDialog:K,transientMessage:sb,bannerData:Cn,bannerVisible:sn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:bo,backgroundTasks:Wr,activeBackgroundTaskPid:Ly,backgroundTaskHeight:sf,isBackgroundTaskListOpen:ky,adminSettingsChanged:ne,newAgents:pe,showIsExpandableHint:Ki,hintMode:n.isModelSteeringEnabled()&&Lm(Fo),hintBuffer:""}),[nc,B,Ga,Me,iy,ly,ic,Qh,tc,D,T,w,R,I,Yp,Qp,Jp,Ti,xi,Vs,ue,Vi,Yi,vu,Au,wy,Xs,sc,Pr,Mu,Iu,vb,xo,of,Ou,ac,af,jp,Fu,pf,ab,gf,ff,Z,Ao,Uu,Qy,Hu,Jy,eb,ob,Wa,Ru,Bu,Sb,Eb,Cb,_b,$e,oo,Lu,he,Rb,yf,q,Oe,rc,Su,Eu,Cu,Yy,Xi,cf,lf,_r,Xh,sr,bb,Fo,yb,nr,Cr,yt,Tt,zy,rr,df,Ft,mf,mb,cb,Se,$s,Qi,rf,Gr,h,O,P,K,sy,Hr,sb,Cn,sn,n,bo,sf,ky,Ly,Wr,ne,pe,Ki]),Ab=(0,V.useCallback)(()=>N(!1),[N]),eM=(0,V.useMemo)(()=>({handleThemeSelect:Xp,closeThemeDialog:ny,handleThemeHighlight:ry,handleAuthSelect:Ty,setAuthState:Yo,onAuthError:$n,handleEditorSelect:Jh,exitEditorDialog:Zh,exitPrivacyNotice:Ab,closeSettingsDialog:ty,closeModelDialog:Cy,openAgentConfigDialog:de,closeAgentConfigDialog:Ie,openPermissionsDialog:Fr,closePermissionsDialog:or,setShellModeActive:nt,vimHandleInput:qy,handleIdePromptComplete:hb,handleFolderTrustSelect:lb,setIsPolicyUpdateDialogOpen:ub,setConstrainHeight:ko,onEscapePromptChange:gb,refreshStatic:Qt,handleFinalSubmit:uc,handleClearScreen:Ky,handleProQuotaChoice:dy,handleValidationChoice:my,handleOverageMenuChoice:py,handleEmptyWalletChoice:fy,openSessionBrowser:_u,closeSessionBrowser:gy,handleResumeSession:hy,handleDeleteSession:by,setQueueErrorMessage:ke,addMessage:ku,popAllMessages:Wy,handleApiKeySubmit:xy,handleApiKeyCancel:Sy,setBannerVisible:Po,setShortcutsHelpVisible:Ys,setCleanUiDetailsVisible:_y,toggleCleanUiDetailsVisible:Ry,revealCleanUiDetailsTemporarily:wu,handleWarning:hf,setEmbeddedShellFocused:L,dismissBackgroundTask:Dy,setActiveBackgroundTaskPid:Py,setIsBackgroundTaskListOpen:js,setAuthContext:zs,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Yh.send){let W=n.getRemoteAdminSettings();W&&Yh.send({type:"admin-settings-update",settings:W})}await un()},handleNewAgentsSelect:async W=>{if(pe&&W==="acknowledge"){let Ee=n.getAgentRegistry();try{await Promise.all(pe.map(me=>Ee.acknowledgeAgent(me)))}catch(me){_e.error("Failed to acknowledge agents:",me),h.addItem({type:"error",text:`Failed to acknowledge agents: ${Rr(me)}`},Date.now())}}ft(null)},getPreferredEditor:xu,clearAccountSuspension:()=>{cy(null),Yo("updating")}}),[Xp,ny,ry,Ty,Yo,$n,Jh,Zh,Ab,ty,Cy,de,Ie,Fr,or,nt,qy,hb,lb,ub,ko,gb,Qt,uc,Ky,dy,my,py,fy,_u,gy,hy,by,ke,ku,Wy,xy,Sy,Po,Ys,_y,Ry,wu,hf,L,Dy,Py,js,zs,cy,pe,n,h,xu]);return Hr==="awaiting_google_login_restart"?(0,Sr.jsx)(sO,{onDismiss:()=>{zs({}),Yo("updating")},config:n}):(0,Sr.jsx)(Ed.Provider,{value:ZO,children:(0,Sr.jsx)(VS.Provider,{value:JO,children:(0,Sr.jsx)(Cg.Provider,{value:eM,children:(0,Sr.jsx)(tl.Provider,{value:n,children:(0,Sr.jsx)(Ng.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Sr.jsx)(W_,{config:n,toolCalls:jO,isExpanded:Ne,toggleExpansion:ge,toggleAllExpansion:Xe,children:(0,Sr.jsx)(oh.Provider,{value:Bu,children:(0,Sr.jsx)(Qd,{mouseEventsEnabled:T,children:(0,Sr.jsx)(Jd,{children:(0,Sr.jsx)(_A,{},`app-${b}`)})})})})})})})})})};var Hn=C(M(),1);var i1=200;async function oae(e,t,o,n=process.cwd(),r,a){mv();let i=nd(e.getUseAlternateBuffer(),e.getScreenReader()),s=i;s&&(ts(),ls(()=>{os()}));let{matchers:l,errors:u}=await SS();u.forEach(E=>{Re.emitFeedback("warning",E)});let p=await qT();s1(r1(n),t);let y=new Vx({onNewMessage:E=>{Re.emitConsoleLog(E.type,E.content)},debugMode:e.getDebugMode()});y.patch(),ls(y.cleanup);let{stdout:f,stderr:g}=hT(),h=!!process.env.SHPOOL_SESSION_NAME,x=()=>(ip(),(0,Hn.jsx)(bS.Provider,{value:t,children:(0,Hn.jsx)(ES,{value:l,children:(0,Hn.jsx)(TS,{config:e,children:(0,Hn.jsx)(Qd,{mouseEventsEnabled:s,children:(0,Hn.jsx)(AA,{children:(0,Hn.jsx)(Jd,{children:(0,Hn.jsx)(dl,{children:(0,Hn.jsx)(TR,{children:(0,Hn.jsx)(qS,{children:(0,Hn.jsx)(xO,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:a})})})})})})})})})}));h&&await new Promise(E=>setTimeout(E,100));let T=lS(process.env.DEBUG?(0,Hn.jsx)(SO.default.StrictMode,{children:(0,Hn.jsx)(x,{})}):(0,Hn.jsx)(x,{}),{stdout:f,stderr:g,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:E})=>{E>i1&&cT(e,E),KS.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(qa(),ls(()=>{td()})),zN(t).then(E=>{eE(E,t,e.getProjectRoot())}).catch(E=>{e.getDebugMode()&&_e.warn("Update check failed:",E)}),ls(()=>T.unmount()),ls(Hx())}function s1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Ep({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Kn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Kn("\x1B]0;\x07")})}}export{oae as startInteractiveUI};
|
|
121
121
|
/**
|
|
122
122
|
* @license
|
|
123
123
|
* 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{Ec as g,Hf as f,nk as a,pk as p,qk as m,rk as A,sk as T,tk as y,uk as v,vk as w,wk as C}from"./chunk-
|
|
2
|
+
import{Ec as g,Hf as f,nk as a,pk as p,qk as m,rk as A,sk as T,tk as y,uk as v,vk as w,wk as C}from"./chunk-SZCTACC4.js";import{Nd as i,Wd as l,b as o,ge as k,sa as d}from"./chunk-F34TWSY4.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(d.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 l("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{Ec as f,Hf as g,nk as a,pk as p,qk as m,rk as A,sk as T,tk as w,uk as y,vk as U,wk as C}from"./chunk-
|
|
2
|
+
import{Ec as f,Hf as g,nk as a,pk as p,qk as m,rk as A,sk as T,tk as w,uk as y,vk as U,wk as C}from"./chunk-RJWN4TV6.js";import{Nd as n,Wd as l,b as o,ge as k,sa as d}from"./chunk-7FAQMMW2.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(d.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 l("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}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "makecoder",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.97",
|
|
4
4
|
"description": "MakeCoder: Unified AI agent CLI tool integrating Claude Code, Codex and Gemini CLI",
|
|
5
5
|
"main": "./dist/coder.js",
|
|
6
6
|
"bin": {
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"zod": "^3.25.76"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"makecoder-codex-darwin-arm64": "2.0.
|
|
39
|
-
"makecoder-codex-linux-x64": "2.0.
|
|
40
|
-
"makecoder-codex-win32-x64": "2.0.
|
|
38
|
+
"makecoder-codex-darwin-arm64": "2.0.97",
|
|
39
|
+
"makecoder-codex-linux-x64": "2.0.97",
|
|
40
|
+
"makecoder-codex-win32-x64": "2.0.97"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=20.0.0"
|
|
File without changes
|
|
File without changes
|