@sylphai/adal-cli-linux-x64 0.1.3-beta.23 → 0.1.3-beta.24
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/adal-cli.js
CHANGED
|
@@ -959,7 +959,7 @@ $ npm install --save-dev react-devtools-core
|
|
|
959
959
|
`).slice(1):void 0,n=e?t9o.parseLine(e[0]):void 0,r=EAt(n?.file),o,s=0;if(r&&n?.line&&Cve.existsSync(r)){let i=Cve.readFileSync(r,"utf8");if(o=$Yo(i,n.line),o)for(let{line:a}of o)s=Math.max(s,String(a).length)}return Id.default.createElement(Te,{flexDirection:"column",padding:1},Id.default.createElement(Te,null,Id.default.createElement(ee,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Id.default.createElement(ee,null," ",t.message)),n&&r&&Id.default.createElement(Te,{marginTop:1},Id.default.createElement(ee,{dimColor:!0},r,":",n.line,":",n.column)),n&&o&&Id.default.createElement(Te,{marginTop:1,flexDirection:"column"},o.map(({line:i,value:a})=>Id.default.createElement(Te,{key:i},Id.default.createElement(Te,{width:s+1},Id.default.createElement(ee,{dimColor:i!==n.line,backgroundColor:i===n.line?"red":void 0,color:i===n.line?"white":void 0,"aria-label":i===n.line?`Line ${i}, error`:`Line ${i}`},String(i).padStart(s," "),":")),Id.default.createElement(ee,{key:i,backgroundColor:i===n.line?"red":void 0,color:i===n.line?"white":void 0}," "+a)))),t.stack&&Id.default.createElement(Te,{marginTop:1,flexDirection:"column"},t.stack.split(`
|
|
960
960
|
`).slice(1).map(i=>{let a=t9o.parseLine(i);return a?Id.default.createElement(Te,{key:i},Id.default.createElement(ee,{dimColor:!0},"- "),Id.default.createElement(ee,{dimColor:!0,bold:!0},a.function),Id.default.createElement(ee,{dimColor:!0,color:"gray","aria-label":`at ${EAt(a.file)??""} line ${a.line} column ${a.column}`}," ","(",EAt(a.file)??"",":",a.line,":",a.column,")")):Id.default.createElement(Te,{key:i},Id.default.createElement(ee,{dimColor:!0},"- "),Id.default.createElement(ee,{dimColor:!0,bold:!0},i,"\\t"," "))})))}var nru=" ",rru="\x1B[Z",oru="\x1B",lre=class extends rL.PureComponent{static displayName="InternalApp";static getDerivedStateFromError(e){return{error:e}}state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0};rawModeEnabledCount=0;internal_eventEmitter=new eru;isRawModeSupported(){return this.props.stdin.isTTY}render(){return rL.default.createElement(uAt.Provider,{value:{exit:this.handleExit}},rL.default.createElement(Sve.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC,internal_eventEmitter:this.internal_eventEmitter}},rL.default.createElement(hve.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},rL.default.createElement(AAt.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},rL.default.createElement(mve.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?rL.default.createElement(_At,{error:this.state.error}):this.props.children)))))}componentDidMount(){UB.hide(this.props.stdout)}componentWillUnmount(){UB.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}handleSetRawMode=e=>{let{stdin:n}=this.props;if(!this.isRawModeSupported())throw n===tru.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
|
|
961
961
|
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
|
|
962
|
-
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(n.setEncoding("utf8"),e){this.rawModeEnabledCount===0&&(n.ref(),n.setRawMode(!0),n.addListener("readable",this.handleReadable)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(n.setRawMode(!1),n.removeListener("readable",this.handleReadable),n.unref())};handleReadable=()=>{let e;for(;(e=this.props.stdin.read())!==null;)this.handleInput(e),this.internal_eventEmitter.emit("input",e)};handleInput=e=>{e===""&&this.props.exitOnCtrlC&&this.handleExit(),e===oru&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===nru&&this.focusNext(),e===rru&&this.focusPrevious())};handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)};enableFocus=()=>{this.setState({isFocusEnabled:!0})};disableFocus=()=>{this.setState({isFocusEnabled:!1})};focus=e=>{this.setState(n=>n.focusables.some(o=>o?.id===e)?{activeFocusId:e}:n)};focusNext=()=>{this.setState(e=>{let n=e.focusables.find(o=>o.isActive)?.id;return{activeFocusId:this.findNextFocusable(e)??n}})};focusPrevious=()=>{this.setState(e=>{let n=e.focusables.findLast(o=>o.isActive)?.id;return{activeFocusId:this.findPreviousFocusable(e)??n}})};addFocusable=(e,{autoFocus:n})=>{this.setState(r=>{let o=r.activeFocusId;return!o&&n&&(o=e),{activeFocusId:o,focusables:[...r.focusables,{id:e,isActive:!0}]}})};removeFocusable=e=>{this.setState(n=>({activeFocusId:n.activeFocusId===e?void 0:n.activeFocusId,focusables:n.focusables.filter(r=>r.id!==e)}))};activateFocusable=e=>{this.setState(n=>({focusables:n.focusables.map(r=>r.id!==e?r:{id:e,isActive:!0})}))};deactivateFocusable=e=>{this.setState(n=>({activeFocusId:n.activeFocusId===e?void 0:n.activeFocusId,focusables:n.focusables.map(r=>r.id!==e?r:{id:e,isActive:!1})}))};findNextFocusable=e=>{let n=e.focusables.findIndex(r=>r.id===e.activeFocusId);for(let r=n+1;r<e.focusables.length;r++){let o=e.focusables[r];if(o?.isActive)return o.id}};findPreviousFocusable=e=>{let n=e.focusables.findIndex(r=>r.id===e.activeFocusId);for(let r=n-1;r>=0;r--){let o=e.focusables[r];if(o?.isActive)return o.id}}};var o9o=()=>{},ure=class{options;log;throttledLog;isScreenReaderEnabled;isUnmounted;lastOutput;lastOutputHeight;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(e){Aut(this),this.options=e,this.rootNode=tve("ink-root"),this.rootNode.onComputeLayout=this.calculateLayout,this.isScreenReaderEnabled=e.isScreenReaderEnabled??r9o.env.INK_SCREEN_READER==="true";let n=e.debug||this.isScreenReaderEnabled,r=e.maxFps??30,o=r>0?Math.max(1,Math.ceil(1e3/r)):0;this.rootNode.onRender=n?this.onRender:QPe(this.onRender,o,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=bYo.create(e.stdout,{incremental:e.incrementalRendering}),this.throttledLog=n?this.log:QPe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.lastOutputHeight=0,this.fullStaticOutput="",this.container=tL.createContainer(this.rootNode,i9o.LegacyRoot,null,!1,null,"id",()=>{},()=>{},()=>{},()=>{},null),this.unsubscribeExit=(0,s9o.default)(this.unmount,{alwaysLast:!1}),r9o.env.DEV==="true"&&tL.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"}),e.patchConsole&&this.patchConsole(),EQ||(e.stdout.on("resize",this.resized),this.unsubscribeResize=()=>{e.stdout.off("resize",this.resized)})}resized=()=>{this.calculateLayout(),this.onRender()};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{let e=this.
|
|
962
|
+
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(n.setEncoding("utf8"),e){this.rawModeEnabledCount===0&&(n.ref(),n.setRawMode(!0),n.addListener("readable",this.handleReadable)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(n.setRawMode(!1),n.removeListener("readable",this.handleReadable),n.unref())};handleReadable=()=>{let e;for(;(e=this.props.stdin.read())!==null;)this.handleInput(e),this.internal_eventEmitter.emit("input",e)};handleInput=e=>{e===""&&this.props.exitOnCtrlC&&this.handleExit(),e===oru&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===nru&&this.focusNext(),e===rru&&this.focusPrevious())};handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)};enableFocus=()=>{this.setState({isFocusEnabled:!0})};disableFocus=()=>{this.setState({isFocusEnabled:!1})};focus=e=>{this.setState(n=>n.focusables.some(o=>o?.id===e)?{activeFocusId:e}:n)};focusNext=()=>{this.setState(e=>{let n=e.focusables.find(o=>o.isActive)?.id;return{activeFocusId:this.findNextFocusable(e)??n}})};focusPrevious=()=>{this.setState(e=>{let n=e.focusables.findLast(o=>o.isActive)?.id;return{activeFocusId:this.findPreviousFocusable(e)??n}})};addFocusable=(e,{autoFocus:n})=>{this.setState(r=>{let o=r.activeFocusId;return!o&&n&&(o=e),{activeFocusId:o,focusables:[...r.focusables,{id:e,isActive:!0}]}})};removeFocusable=e=>{this.setState(n=>({activeFocusId:n.activeFocusId===e?void 0:n.activeFocusId,focusables:n.focusables.filter(r=>r.id!==e)}))};activateFocusable=e=>{this.setState(n=>({focusables:n.focusables.map(r=>r.id!==e?r:{id:e,isActive:!0})}))};deactivateFocusable=e=>{this.setState(n=>({activeFocusId:n.activeFocusId===e?void 0:n.activeFocusId,focusables:n.focusables.map(r=>r.id!==e?r:{id:e,isActive:!1})}))};findNextFocusable=e=>{let n=e.focusables.findIndex(r=>r.id===e.activeFocusId);for(let r=n+1;r<e.focusables.length;r++){let o=e.focusables[r];if(o?.isActive)return o.id}};findPreviousFocusable=e=>{let n=e.focusables.findIndex(r=>r.id===e.activeFocusId);for(let r=n-1;r>=0;r--){let o=e.focusables[r];if(o?.isActive)return o.id}}};var o9o=()=>{},ure=class{options;log;throttledLog;isScreenReaderEnabled;isUnmounted;lastOutput;lastOutputHeight;lastTerminalWidth;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(e){Aut(this),this.options=e,this.rootNode=tve("ink-root"),this.rootNode.onComputeLayout=this.calculateLayout,this.isScreenReaderEnabled=e.isScreenReaderEnabled??r9o.env.INK_SCREEN_READER==="true";let n=e.debug||this.isScreenReaderEnabled,r=e.maxFps??30,o=r>0?Math.max(1,Math.ceil(1e3/r)):0;this.rootNode.onRender=n?this.onRender:QPe(this.onRender,o,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=bYo.create(e.stdout,{incremental:e.incrementalRendering}),this.throttledLog=n?this.log:QPe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.lastOutputHeight=0,this.lastTerminalWidth=this.getTerminalWidth(),this.fullStaticOutput="",this.container=tL.createContainer(this.rootNode,i9o.LegacyRoot,null,!1,null,"id",()=>{},()=>{},()=>{},()=>{},null),this.unsubscribeExit=(0,s9o.default)(this.unmount,{alwaysLast:!1}),r9o.env.DEV==="true"&&tL.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"}),e.patchConsole&&this.patchConsole(),EQ||(e.stdout.on("resize",this.resized),this.unsubscribeResize=()=>{e.stdout.off("resize",this.resized)})}getTerminalWidth=()=>this.options.stdout.columns||80;resized=()=>{let e=this.getTerminalWidth();e<this.lastTerminalWidth&&(this.log.clear(),this.lastOutput=""),this.calculateLayout(),this.onRender(),this.lastTerminalWidth=e};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{let e=this.getTerminalWidth();this.rootNode.yogaNode.setWidth(e),this.rootNode.yogaNode.calculateLayout(void 0,void 0,er.DIRECTION_LTR)};onRender=()=>{if(this.isUnmounted)return;let e=performance.now(),{output:n,outputHeight:r,staticOutput:o}=IYo(this.rootNode,this.isScreenReaderEnabled);this.options.onRender?.({renderTime:performance.now()-e});let s=o&&o!==`
|
|
963
963
|
`;if(this.options.debug){s&&(this.fullStaticOutput+=o),this.options.stdout.write(this.fullStaticOutput+n);return}if(EQ){s&&this.options.stdout.write(o),this.lastOutput=n,this.lastOutputHeight=r;return}if(this.isScreenReaderEnabled){if(s){let c=this.lastOutputHeight>0?lE.eraseLines(this.lastOutputHeight):"";this.options.stdout.write(c+o),this.lastOutputHeight=0}if(n===this.lastOutput&&!s)return;let i=this.options.stdout.columns||80,a=zne(n,i,{trim:!1,hard:!0});if(s)this.options.stdout.write(a);else{let c=this.lastOutputHeight>0?lE.eraseLines(this.lastOutputHeight):"";this.options.stdout.write(c+a)}this.lastOutput=n,this.lastOutputHeight=a===""?0:a.split(`
|
|
964
964
|
`).length;return}if(s&&(this.fullStaticOutput+=o),this.lastOutputHeight>=this.options.stdout.rows){this.options.stdout.write(lE.clearTerminal+this.fullStaticOutput+n),this.lastOutput=n,this.lastOutputHeight=r,this.log.sync(n);return}s&&(this.log.clear(),this.options.stdout.write(o),this.log(n)),!s&&n!==this.lastOutput&&this.throttledLog(n),this.lastOutput=n,this.lastOutputHeight=r};render(e){let n=fAt.default.createElement(nL.Provider,{value:{isScreenReaderEnabled:this.isScreenReaderEnabled}},fAt.default.createElement(lre,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e));tL.updateContainerSync(n,this.container,null,o9o),tL.flushSyncWork()}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(EQ){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(EQ){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.calculateLayout(),this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),EQ?this.options.stdout.write(this.lastOutput+`
|
|
965
965
|
`):this.options.debug||this.log.done(),this.isUnmounted=!0,tL.updateContainerSync(null,this.container,null,o9o),tL.flushSyncWork(),sq.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}async waitUntilExit(){return this.exitPromise||=new Promise((e,n)=>{this.resolveExitPromise=e,this.rejectExitPromise=n}),this.exitPromise}clear(){!EQ&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=Z6o((e,n)=>{e==="stdout"&&this.writeToStdout(n),e==="stderr"&&(n.startsWith("The above error occurred")||this.writeToStderr(n))}))}};var iru=(t,e)=>{let n={stdout:Rve.stdout,stdin:Rve.stdin,stderr:Rve.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,maxFps:30,incrementalRendering:!1,...aru(e)},r=cru(n.stdout,()=>new ure(n));return r.render(t),{rerender:r.render,unmount(){r.unmount()},waitUntilExit:r.waitUntilExit,cleanup:()=>sq.delete(n.stdout),clear:r.clear}},TAt=iru,aru=(t={})=>t instanceof sru?{stdout:t,stdin:Rve.stdin}:t,cru=(t,e)=>{let n=sq.get(t);return n||(n=e(),sq.set(t,n)),n};var oL=Fe(pn(),1);function Ive(t){let{items:e,children:n,style:r}=t,[o,s]=(0,oL.useState)(0),i=(0,oL.useMemo)(()=>e.slice(o),[e,o]);(0,oL.useLayoutEffect)(()=>{s(e.length)},[e.length]);let a=i.map((l,A)=>n(l,o+A)),c=(0,oL.useMemo)(()=>({position:"absolute",flexDirection:"column",...r}),[r]);return oL.default.createElement("ink-box",{internal_static:!0,style:c},a)}var Nve=Fe(pn(),1);function iq({children:t,transform:e,accessibilityLabel:n}){let{isScreenReaderEnabled:r}=(0,Nve.useContext)(nL);return t==null?null:Nve.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:e},r&&n?n:t)}var a9o=Fe(pn(),1);function v_({count:t=1}){return a9o.default.createElement("ink-text",null,`
|
|
@@ -969,7 +969,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
|
|
|
969
969
|
`)}rowToString(e,n){return this.rasterize(e).forEach((r,o)=>{let s="";r.forEach((i,a)=>{let{width:c}=e[a],l=this.negatePadding(e[a]),A=i;if(l>vg.stringWidth(i)&&(A+=" ".repeat(l-vg.stringWidth(i))),e[a].align&&e[a].align!=="left"&&this.wrap){let _=Kou[e[a].align];A=_(A,l),vg.stringWidth(A)<l&&(A+=" ".repeat((c||0)-vg.stringWidth(A)-1))}let E=e[a].padding||[0,0,0,0];E[zve]&&(s+=" ".repeat(E[zve])),s+=o7o(e[a],A,"| "),s+=A,s+=o7o(e[a],A," |"),E[Kve]&&(s+=" ".repeat(E[Kve])),o===0&&n.length>0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:e.span})}),n}renderInline(e,n){let r=e.match(/^ */),o=r?r[0].length:0,s=n.text,i=vg.stringWidth(s.trimRight());return n.span?this.wrap?o<i?e:(n.hidden=!0,s.trimRight()+" ".repeat(o-i)+e.trimLeft()):(n.hidden=!0,s+e):e}rasterize(e){let n=[],r=this.columnWidths(e),o;return e.forEach((s,i)=>{s.width=r[i],this.wrap?o=vg.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
|
970
970
|
`):o=s.text.split(`
|
|
971
971
|
`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[zou]||0).fill("")),o.push(...new Array(s.padding[Jou]||0).fill(""))),o.forEach((a,c)=>{n[c]||n.push([]);let l=n[c];for(let A=0;A<i;A++)l[A]===void 0&&l.push("");l.push(a)})}),n}negatePadding(e){let n=e.width||0;return e.padding&&(n-=(e.padding[zve]||0)+(e.padding[Kve]||0)),e.border&&(n-=4),n}columnWidths(e){if(!this.wrap)return e.map(i=>i.width||vg.stringWidth(i.text));let n=e.length,r=this.width,o=e.map(i=>{if(i.width)return n--,r-=i.width,i.width}),s=n?Math.floor(r/n):0;return o.map((i,a)=>i===void 0?Math.max(s,$ou(e[a])):i)}};function o7o(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?n:" ":""}function $ou(t){let e=t.padding||[],n=1+(e[zve]||0)+(e[Kve]||0);return t.border?n+4:n}function Xou(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Zou(t,e){t=t.trim();let n=vg.stringWidth(t);return n<e?" ".repeat(e-n)+t:t}function esu(t,e){t=t.trim();let n=vg.stringWidth(t);return n>=e?t:" ".repeat(e-n>>1)+t}var vg;function s7o(t,e){return vg=e,new Sdt({width:t?.width||Xou(),wrap:t?.wrap})}var i7o=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function hdt(t){return t.replace(i7o,"")}function a7o(t,e){let[n,r]=t.match(i7o)||["",""];t=hdt(t);let o="";for(let s=0;s<t.length;s++)s!==0&&s%e===0&&(o+=`
|
|
972
|
-
`),o+=t.charAt(s);return n&&r&&(o=`${n}${o}${r}`),o}function mdt(t){return s7o(t,{stringWidth:e=>[...e].length,stripAnsi:hdt,wrap:a7o})}import{dirname as c7o,resolve as l7o}from"path";import{readdirSync as tsu,statSync as nsu}from"fs";function u7o(t,e){let n=l7o(".",t),r;for(nsu(n).isDirectory()||(n=c7o(n));;){if(r=e(n,tsu(n)),r)return l7o(n,r);if(n=c7o(r=n),r===n)break}}import{inspect as Asu}from"util";import{readFileSync as dsu}from"fs";import{fileURLToPath as Esu}from"url";import{basename as psu,dirname as _su,extname as fsu,relative as Tsu,resolve as p7o}from"path";import{readFileSync as rsu,statSync as osu,writeFile as ssu}from"fs";import{format as isu}from"util";import{resolve as asu}from"path";var A7o={fs:{readFileSync:rsu,writeFile:ssu},format:isu,resolve:asu,exists:t=>{try{return osu(t).isFile()}catch{return!1}}};var WO,gdt=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=e.shift(),r=function(){};return typeof e[e.length-1]=="function"&&(r=e.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),WO.format.apply(WO.format,[this.cache[this.locale][n]||n].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),n=e.shift(),r=e.shift(),o=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let i=o===1?n:r;this.cache[this.locale][n]&&(i=this.cache[this.locale][n][o===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[i];return~i.indexOf("%d")&&a.push(o),WO.format.apply(WO.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.cache[this.locale][n]=e[n])}_taggedLiteral(e,...n){let r="";return e.forEach(function(o,s){let i=n[s+1];r+=o,typeof i<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,n=this.writeQueue[0],r=n.directory,o=n.locale,s=n.cb,i=this._resolveLocaleFile(r,o),a=JSON.stringify(this.cache[o],null,2);WO.fs.writeFile(i,a,"utf-8",function(c){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(c)})}_readLocaleFile(){let e={},n=this._resolveLocaleFile(this.directory,this.locale);try{WO.fs.readFileSync&&(e=JSON.parse(WO.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,n){let r=WO.resolve(e,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let o=WO.resolve(e,"./",n.split("_")[0]+".json");this._fileExistsSync(o)&&(r=o)}return r}_fileExistsSync(e){return WO.exists(e)}};function d7o(t,e){WO=e;let n=new gdt(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var csu=t=>d7o(t,A7o),E7o=csu;var Ssu="require is not supported by ESM",_7o="loading a directory of commands is not supported yet for ESM",Cre;try{Cre=Esu(import.meta.url)}catch{Cre=process.cwd()}var hsu=Cre.substring(0,Cre.lastIndexOf("node_modules")),msu={assert:{notStrictEqual:lsu,strictEqual:usu},cliui:mdt,findUp:u7o,getEnv:t=>process.env[t],inspect:Asu,getCallerFile:()=>{throw new yQ(_7o)},getProcessArgvBin:X5o,mainFilename:hsu||process.cwd(),Parser:Tdt,path:{basename:psu,dirname:_su,extname:fsu,relative:Tsu,resolve:p7o},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:dsu,require:()=>{throw new yQ(Ssu)},requireDirectory:()=>{throw new yQ(_7o)},stringWidth:t=>[...t].length,y18n:E7o({directory:p7o(Cre,"../../../locales"),updateFiles:!1})};ao();import jO from"node:process";Ore();async function iLe(){let t=await LQ();return"0.1.3-beta.23"}var aWo=Fe(Zlt(),1);import*as Dre from"node:fs";import*as aL from"node:path";import*as Kdt from"node:os";var Mre=Fe(rWo(),1);Ore();import*as oWo from"node:os";var sWo=["docker","podman","sandbox-exec"];function uau(t){return sWo.includes(t)}function Aau(t){if(process.env.SANDBOX)return"";let e=process.env.GEMINI_SANDBOX?.toLowerCase().trim()??"";if(t=e?.length>0?e:t,t==="1"||t==="true"?t=!0:(t==="0"||t==="false"||!t)&&(t=!1),t===!1)return"";if(typeof t=="string"&&t){if(uau(t)||(console.error(`ERROR: invalid sandbox command '${t}'. Must be one of ${sWo.join(", ")}`),process.exit(1)),Mre.default.sync(t))return t;console.error(`ERROR: missing sandbox command '${t}' (from GEMINI_SANDBOX)`),process.exit(1)}return oWo.platform()==="darwin"&&Mre.default.sync("sandbox-exec")?"sandbox-exec":Mre.default.sync("docker")&&t===!0?"docker":Mre.default.sync("podman")&&t===!0?"podman":(t===!0&&(console.error("ERROR: GEMINI_SANDBOX is true but failed to determine command for sandbox; install docker or podman or specify command in GEMINI_SANDBOX"),process.exit(1)),"")}async function iWo(t,e){let n=e.sandbox??t.sandbox,r=Aau(n),o=await LQ(),s=e["sandbox-image"]??process.env.GEMINI_SANDBOX_IMAGE??o?.config?.sandboxImageUri;return r&&s?{command:r,image:s}:void 0}var dau={debug:(...t)=>console.debug("[DEBUG]",...t),warn:(...t)=>console.warn("[WARN]",...t),error:(...t)=>console.error("[ERROR]",...t)};async function Eau(){return await J5o(ddt(jO.argv)).option("model",{alias:"m",type:"string",description:"Model",default:jO.env.GEMINI_MODEL||xZ}).option("prompt",{alias:"p",type:"string",description:"Prompt. Appended to input on stdin (if any)."}).option("sandbox",{alias:"s",type:"boolean",description:"Run in sandbox?"}).option("sandbox-image",{type:"string",description:"Sandbox image URI."}).option("debug",{alias:"d",type:"boolean",description:"Run in debug mode?",default:!1}).option("all_files",{alias:"a",type:"boolean",description:"Include ALL files in context?",default:!1}).option("show_memory_usage",{type:"boolean",description:"Show memory usage in status bar",default:!1}).option("yolo",{alias:"y",type:"boolean",description:"Automatically accept all actions (aka YOLO mode, see https://www.youtube.com/watch?v=xvFZjo5PgG0 for more details)?",default:!1}).option("telemetry",{type:"boolean",description:"Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own."}).option("telemetry-target",{type:"string",choices:["local","gcp"],description:"Set the telemetry target (local or gcp). Overrides settings files."}).option("telemetry-otlp-endpoint",{type:"string",description:"Set the OTLP endpoint for telemetry. Overrides environment variables and settings files."}).option("telemetry-log-prompts",{type:"boolean",description:"Enable or disable logging of user prompts for telemetry. Overrides settings files."}).option("checkpointing",{alias:"c",type:"boolean",description:"Enables checkpointing of file edits",default:!1}).version(await iLe()).alias("v","version").help().alias("h","help").strict().argv}async function zdt(t,e,n){Jdt();let r=await Eau(),o=r.debug||!1;t.contextFileName?VZ(t.contextFileName):VZ(GZ());let s=e.flatMap(_=>_.contextFiles),i=new E8(jO.cwd()),a="",c=0,l=pau(t,e),A=_au(t,e),E=await iWo(t,r);return new R0e({sessionId:n,embeddingModel:UZ,sandbox:E,targetDir:jO.cwd(),debugMode:o,question:r.prompt||"",fullContext:r.all_files||!1,coreTools:t.coreTools||void 0,excludeTools:A,toolDiscoveryCommand:t.toolDiscoveryCommand,toolCallCommand:t.toolCallCommand,mcpServerCommand:t.mcpServerCommand,mcpServers:l,userMemory:a,geminiMdFileCount:c,approvalMode:r.yolo?_a.YOLO:_a.DEFAULT,showMemoryUsage:r.show_memory_usage||t.showMemoryUsage||!1,accessibility:t.accessibility,telemetry:{enabled:r.telemetry??t.telemetry?.enabled,target:r.telemetryTarget??t.telemetry?.target,otlpEndpoint:r.telemetryOtlpEndpoint??jO.env.OTEL_EXPORTER_OTLP_ENDPOINT??t.telemetry?.otlpEndpoint,logPrompts:r.telemetryLogPrompts??t.telemetry?.logPrompts},usageStatisticsEnabled:t.usageStatisticsEnabled??!0,fileFiltering:{respectGitIgnore:t.fileFiltering?.respectGitIgnore,enableRecursiveFileSearch:t.fileFiltering?.enableRecursiveFileSearch},checkpointing:r.checkpointing||t.checkpointing?.enabled,proxy:jO.env.HTTPS_PROXY||jO.env.https_proxy||jO.env.HTTP_PROXY||jO.env.http_proxy,cwd:jO.cwd(),fileDiscoveryService:i,bugCommand:t.bugCommand,model:r.model,extensionContextFilePaths:s})}function pau(t,e){let n={...t.mcpServers||{}};for(let r of e)Object.entries(r.config.mcpServers||{}).forEach(([o,s])=>{if(n[o]){dau.warn(`Skipping extension MCP config for server with key "${o}" as it already exists.`);return}n[o]=s});return n}function _au(t,e){let n=new Set(t.excludeTools||[]);for(let r of e)for(let o of r.config.excludeTools||[])n.add(o);return[...n]}function fau(t){let e=aL.resolve(t);for(;;){let n=aL.join(e,UU,".env");if(Dre.existsSync(n))return n;let r=aL.join(e,".env");if(Dre.existsSync(r))return r;let o=aL.dirname(e);if(o===e||!o){let s=aL.join(Kdt.homedir(),UU,".env");if(Dre.existsSync(s))return s;let i=aL.join(Kdt.homedir(),".env");return Dre.existsSync(i)?i:null}e=o}}function Jdt(){let t=fau(jO.cwd());t&&aWo.config({path:t,quiet:!0})}var bQ=t=>{if(Jdt(),t===Il.LOGIN_WITH_ADAL)return null;if(t===Il.USE_ADAL_KEY)return process.env.GEMINI_API_KEY?null:"GEMINI_API_KEY environment variable not found. Add that to your .env and try again, no reload needed!";if(t===Il.USE_VERTEX_AI){let e=!!process.env.GOOGLE_CLOUD_PROJECT&&!!process.env.GOOGLE_CLOUD_LOCATION,n=!!process.env.GOOGLE_API_KEY;return!e&&!n?`Must specify GOOGLE_GENAI_USE_VERTEXAI=true and either:
|
|
972
|
+
`),o+=t.charAt(s);return n&&r&&(o=`${n}${o}${r}`),o}function mdt(t){return s7o(t,{stringWidth:e=>[...e].length,stripAnsi:hdt,wrap:a7o})}import{dirname as c7o,resolve as l7o}from"path";import{readdirSync as tsu,statSync as nsu}from"fs";function u7o(t,e){let n=l7o(".",t),r;for(nsu(n).isDirectory()||(n=c7o(n));;){if(r=e(n,tsu(n)),r)return l7o(n,r);if(n=c7o(r=n),r===n)break}}import{inspect as Asu}from"util";import{readFileSync as dsu}from"fs";import{fileURLToPath as Esu}from"url";import{basename as psu,dirname as _su,extname as fsu,relative as Tsu,resolve as p7o}from"path";import{readFileSync as rsu,statSync as osu,writeFile as ssu}from"fs";import{format as isu}from"util";import{resolve as asu}from"path";var A7o={fs:{readFileSync:rsu,writeFile:ssu},format:isu,resolve:asu,exists:t=>{try{return osu(t).isFile()}catch{return!1}}};var WO,gdt=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=e.shift(),r=function(){};return typeof e[e.length-1]=="function"&&(r=e.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),WO.format.apply(WO.format,[this.cache[this.locale][n]||n].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),n=e.shift(),r=e.shift(),o=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let i=o===1?n:r;this.cache[this.locale][n]&&(i=this.cache[this.locale][n][o===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[i];return~i.indexOf("%d")&&a.push(o),WO.format.apply(WO.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.cache[this.locale][n]=e[n])}_taggedLiteral(e,...n){let r="";return e.forEach(function(o,s){let i=n[s+1];r+=o,typeof i<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,n=this.writeQueue[0],r=n.directory,o=n.locale,s=n.cb,i=this._resolveLocaleFile(r,o),a=JSON.stringify(this.cache[o],null,2);WO.fs.writeFile(i,a,"utf-8",function(c){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(c)})}_readLocaleFile(){let e={},n=this._resolveLocaleFile(this.directory,this.locale);try{WO.fs.readFileSync&&(e=JSON.parse(WO.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,n){let r=WO.resolve(e,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let o=WO.resolve(e,"./",n.split("_")[0]+".json");this._fileExistsSync(o)&&(r=o)}return r}_fileExistsSync(e){return WO.exists(e)}};function d7o(t,e){WO=e;let n=new gdt(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var csu=t=>d7o(t,A7o),E7o=csu;var Ssu="require is not supported by ESM",_7o="loading a directory of commands is not supported yet for ESM",Cre;try{Cre=Esu(import.meta.url)}catch{Cre=process.cwd()}var hsu=Cre.substring(0,Cre.lastIndexOf("node_modules")),msu={assert:{notStrictEqual:lsu,strictEqual:usu},cliui:mdt,findUp:u7o,getEnv:t=>process.env[t],inspect:Asu,getCallerFile:()=>{throw new yQ(_7o)},getProcessArgvBin:X5o,mainFilename:hsu||process.cwd(),Parser:Tdt,path:{basename:psu,dirname:_su,extname:fsu,relative:Tsu,resolve:p7o},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:dsu,require:()=>{throw new yQ(Ssu)},requireDirectory:()=>{throw new yQ(_7o)},stringWidth:t=>[...t].length,y18n:E7o({directory:p7o(Cre,"../../../locales"),updateFiles:!1})};ao();import jO from"node:process";Ore();async function iLe(){let t=await LQ();return"0.1.3-beta.24"}var aWo=Fe(Zlt(),1);import*as Dre from"node:fs";import*as aL from"node:path";import*as Kdt from"node:os";var Mre=Fe(rWo(),1);Ore();import*as oWo from"node:os";var sWo=["docker","podman","sandbox-exec"];function uau(t){return sWo.includes(t)}function Aau(t){if(process.env.SANDBOX)return"";let e=process.env.GEMINI_SANDBOX?.toLowerCase().trim()??"";if(t=e?.length>0?e:t,t==="1"||t==="true"?t=!0:(t==="0"||t==="false"||!t)&&(t=!1),t===!1)return"";if(typeof t=="string"&&t){if(uau(t)||(console.error(`ERROR: invalid sandbox command '${t}'. Must be one of ${sWo.join(", ")}`),process.exit(1)),Mre.default.sync(t))return t;console.error(`ERROR: missing sandbox command '${t}' (from GEMINI_SANDBOX)`),process.exit(1)}return oWo.platform()==="darwin"&&Mre.default.sync("sandbox-exec")?"sandbox-exec":Mre.default.sync("docker")&&t===!0?"docker":Mre.default.sync("podman")&&t===!0?"podman":(t===!0&&(console.error("ERROR: GEMINI_SANDBOX is true but failed to determine command for sandbox; install docker or podman or specify command in GEMINI_SANDBOX"),process.exit(1)),"")}async function iWo(t,e){let n=e.sandbox??t.sandbox,r=Aau(n),o=await LQ(),s=e["sandbox-image"]??process.env.GEMINI_SANDBOX_IMAGE??o?.config?.sandboxImageUri;return r&&s?{command:r,image:s}:void 0}var dau={debug:(...t)=>console.debug("[DEBUG]",...t),warn:(...t)=>console.warn("[WARN]",...t),error:(...t)=>console.error("[ERROR]",...t)};async function Eau(){return await J5o(ddt(jO.argv)).option("model",{alias:"m",type:"string",description:"Model",default:jO.env.GEMINI_MODEL||xZ}).option("prompt",{alias:"p",type:"string",description:"Prompt. Appended to input on stdin (if any)."}).option("sandbox",{alias:"s",type:"boolean",description:"Run in sandbox?"}).option("sandbox-image",{type:"string",description:"Sandbox image URI."}).option("debug",{alias:"d",type:"boolean",description:"Run in debug mode?",default:!1}).option("all_files",{alias:"a",type:"boolean",description:"Include ALL files in context?",default:!1}).option("show_memory_usage",{type:"boolean",description:"Show memory usage in status bar",default:!1}).option("yolo",{alias:"y",type:"boolean",description:"Automatically accept all actions (aka YOLO mode, see https://www.youtube.com/watch?v=xvFZjo5PgG0 for more details)?",default:!1}).option("telemetry",{type:"boolean",description:"Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own."}).option("telemetry-target",{type:"string",choices:["local","gcp"],description:"Set the telemetry target (local or gcp). Overrides settings files."}).option("telemetry-otlp-endpoint",{type:"string",description:"Set the OTLP endpoint for telemetry. Overrides environment variables and settings files."}).option("telemetry-log-prompts",{type:"boolean",description:"Enable or disable logging of user prompts for telemetry. Overrides settings files."}).option("checkpointing",{alias:"c",type:"boolean",description:"Enables checkpointing of file edits",default:!1}).version(await iLe()).alias("v","version").help().alias("h","help").strict().argv}async function zdt(t,e,n){Jdt();let r=await Eau(),o=r.debug||!1;t.contextFileName?VZ(t.contextFileName):VZ(GZ());let s=e.flatMap(_=>_.contextFiles),i=new E8(jO.cwd()),a="",c=0,l=pau(t,e),A=_au(t,e),E=await iWo(t,r);return new R0e({sessionId:n,embeddingModel:UZ,sandbox:E,targetDir:jO.cwd(),debugMode:o,question:r.prompt||"",fullContext:r.all_files||!1,coreTools:t.coreTools||void 0,excludeTools:A,toolDiscoveryCommand:t.toolDiscoveryCommand,toolCallCommand:t.toolCallCommand,mcpServerCommand:t.mcpServerCommand,mcpServers:l,userMemory:a,geminiMdFileCount:c,approvalMode:r.yolo?_a.YOLO:_a.DEFAULT,showMemoryUsage:r.show_memory_usage||t.showMemoryUsage||!1,accessibility:t.accessibility,telemetry:{enabled:r.telemetry??t.telemetry?.enabled,target:r.telemetryTarget??t.telemetry?.target,otlpEndpoint:r.telemetryOtlpEndpoint??jO.env.OTEL_EXPORTER_OTLP_ENDPOINT??t.telemetry?.otlpEndpoint,logPrompts:r.telemetryLogPrompts??t.telemetry?.logPrompts},usageStatisticsEnabled:t.usageStatisticsEnabled??!0,fileFiltering:{respectGitIgnore:t.fileFiltering?.respectGitIgnore,enableRecursiveFileSearch:t.fileFiltering?.enableRecursiveFileSearch},checkpointing:r.checkpointing||t.checkpointing?.enabled,proxy:jO.env.HTTPS_PROXY||jO.env.https_proxy||jO.env.HTTP_PROXY||jO.env.http_proxy,cwd:jO.cwd(),fileDiscoveryService:i,bugCommand:t.bugCommand,model:r.model,extensionContextFilePaths:s})}function pau(t,e){let n={...t.mcpServers||{}};for(let r of e)Object.entries(r.config.mcpServers||{}).forEach(([o,s])=>{if(n[o]){dau.warn(`Skipping extension MCP config for server with key "${o}" as it already exists.`);return}n[o]=s});return n}function _au(t,e){let n=new Set(t.excludeTools||[]);for(let r of e)for(let o of r.config.excludeTools||[])n.add(o);return[...n]}function fau(t){let e=aL.resolve(t);for(;;){let n=aL.join(e,UU,".env");if(Dre.existsSync(n))return n;let r=aL.join(e,".env");if(Dre.existsSync(r))return r;let o=aL.dirname(e);if(o===e||!o){let s=aL.join(Kdt.homedir(),UU,".env");if(Dre.existsSync(s))return s;let i=aL.join(Kdt.homedir(),".env");return Dre.existsSync(i)?i:null}e=o}}function Jdt(){let t=fau(jO.cwd());t&&aWo.config({path:t,quiet:!0})}var bQ=t=>{if(Jdt(),t===Il.LOGIN_WITH_ADAL)return null;if(t===Il.USE_ADAL_KEY)return process.env.GEMINI_API_KEY?null:"GEMINI_API_KEY environment variable not found. Add that to your .env and try again, no reload needed!";if(t===Il.USE_VERTEX_AI){let e=!!process.env.GOOGLE_CLOUD_PROJECT&&!!process.env.GOOGLE_CLOUD_LOCATION,n=!!process.env.GOOGLE_API_KEY;return!e&&!n?`Must specify GOOGLE_GENAI_USE_VERTEXAI=true and either:
|
|
973
973
|
\u2022 GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION environment variables.
|
|
974
974
|
\u2022 GOOGLE_API_KEY environment variable (if using express mode).
|
|
975
975
|
Update your .env and try again, no reload needed!`:null}return"Invalid auth method selected."};import*as K0 from"fs";import*as mq from"path";import*as lWo from"os";var Tau=mq.join(".gemini","extensions"),Sau="gemini-extension.json";function uWo(t){let e=[...cWo(t),...cWo(lWo.homedir())],n=[],r=new Set;for(let o of e)r.has(o.config.name)||(console.log(`Loading extension: ${o.config.name} (version: ${o.config.version})`),n.push(o),r.add(o.config.name));return n}function cWo(t){let e=mq.join(t,Tau);if(!K0.existsSync(e))return[];let n=[];for(let r of K0.readdirSync(e)){let o=mq.join(e,r),s=hau(o);s!=null&&n.push(s)}return n}function hau(t){if(!K0.statSync(t).isDirectory())return console.error(`Warning: unexpected file ${t} in extensions directory.`),null;let e=mq.join(t,Sau);if(!K0.existsSync(e))return console.error(`Warning: extension directory ${t} does not contain a config file ${e}.`),null;try{let n=K0.readFileSync(e,"utf-8"),r=JSON.parse(n);if(!r.name||!r.version)return console.error(`Invalid extension config in ${e}: missing name or version.`),null;let o=mau(r).map(s=>mq.join(t,s)).filter(s=>K0.existsSync(s));return{config:r,contextFiles:o}}catch(n){return console.error(`Warning: error parsing extension config in ${e}: ${n}`),null}}function mau(t){if(t.contextFileName){if(!Array.isArray(t.contextFileName))return[t.contextFileName]}else return["GEMINI.md"];return t.contextFileName}ao();var cLe=Fe(EWo(),1);import*as Lg from"fs";import*as Rq from"path";import{homedir as Iau}from"os";var wi={type:"light",Background:"#FAFAFA",Foreground:"#3C3C43",LightBlue:"#89BDCD",AccentBlue:"#3B82F6",AccentPurple:"#8B5CF6",AccentCyan:"#06B6D4",AccentGreen:"#3CA84B",AccentYellow:"#D5A40A",AccentRed:"#DD4C4C",Comment:"#008000",Gray:"#B7BECC",GradientColors:["#4796E4","#847ACE","#C3677F"]},ps={type:"dark",Background:"#1E1E2E",Foreground:"#CDD6F4",LightBlue:"#ADD8E6",AccentBlue:"#89B4FA",AccentPurple:"#CBA6F7",AccentCyan:"#89DCEB",AccentGreen:"#A6E3A1",AccentYellow:"#F9E2AF",AccentRed:"#F38BA8",Comment:"#6C7086",Gray:"#6C7086",GradientColors:["#4796E4","#847ACE","#C3677F"]};var ra=class t{constructor(e,n,r,o){this.name=e;this.type=n;this.colors=o;this._colorMap=Object.freeze(this._buildColorMap(r));let s=r.hljs?.color;this.defaultColor=(s?t._resolveColor(s):void 0)??""}defaultColor;_colorMap;static cssNameToHexMap={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellowgreen:"#9acd32"};static inkSupportedNames=new Set(["black","red","green","yellow","blue","cyan","magenta","white","gray","grey","blackbright","redbright","greenbright","yellowbright","bluebright","cyanbright","magentabright","whitebright"]);getInkColor(e){return this._colorMap[e]}static _resolveColor(e){let n=e.toLowerCase();if(n.startsWith("#"))return n;if(t.inkSupportedNames.has(n))return n;if(t.cssNameToHexMap[n])return t.cssNameToHexMap[n];console.warn(`[Theme] Could not resolve color "${e}" to an Ink-compatible format.`)}_buildColorMap(e){let n={};for(let r in e){if(!r.startsWith("hljs-")&&r!=="hljs")continue;let o=e[r];if(o?.color){let s=t._resolveColor(o.color);s!==void 0&&(n[r]=s)}}return n}};var yre=new ra("Default Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:wi.Background,color:wi.Foreground},"hljs-comment":{color:wi.Comment},"hljs-quote":{color:wi.Comment},"hljs-variable":{color:wi.Foreground},"hljs-keyword":{color:wi.AccentBlue},"hljs-selector-tag":{color:wi.AccentBlue},"hljs-built_in":{color:wi.AccentBlue},"hljs-name":{color:wi.AccentBlue},"hljs-tag":{color:wi.AccentBlue},"hljs-string":{color:wi.AccentRed},"hljs-title":{color:wi.AccentRed},"hljs-section":{color:wi.AccentRed},"hljs-attribute":{color:wi.AccentRed},"hljs-literal":{color:wi.AccentRed},"hljs-template-tag":{color:wi.AccentRed},"hljs-template-variable":{color:wi.AccentRed},"hljs-type":{color:wi.AccentRed},"hljs-addition":{color:wi.AccentGreen},"hljs-deletion":{color:wi.AccentRed},"hljs-selector-attr":{color:wi.AccentCyan},"hljs-selector-pseudo":{color:wi.AccentCyan},"hljs-meta":{color:wi.AccentCyan},"hljs-doctag":{color:wi.Gray},"hljs-attr":{color:wi.AccentRed},"hljs-symbol":{color:wi.AccentCyan},"hljs-bullet":{color:wi.AccentCyan},"hljs-link":{color:wi.AccentCyan},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},wi);var gq=new ra("Default","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:ps.Background,color:ps.Foreground},"hljs-keyword":{color:ps.AccentBlue},"hljs-literal":{color:ps.AccentBlue},"hljs-symbol":{color:ps.AccentBlue},"hljs-name":{color:ps.AccentBlue},"hljs-link":{color:ps.AccentBlue,textDecoration:"underline"},"hljs-built_in":{color:ps.AccentCyan},"hljs-type":{color:ps.AccentCyan},"hljs-number":{color:ps.AccentGreen},"hljs-class":{color:ps.AccentGreen},"hljs-string":{color:ps.AccentYellow},"hljs-meta-string":{color:ps.AccentYellow},"hljs-regexp":{color:ps.AccentRed},"hljs-template-tag":{color:ps.AccentRed},"hljs-subst":{color:ps.Foreground},"hljs-function":{color:ps.Foreground},"hljs-title":{color:ps.Foreground},"hljs-params":{color:ps.Foreground},"hljs-formula":{color:ps.Foreground},"hljs-comment":{color:ps.Comment,fontStyle:"italic"},"hljs-quote":{color:ps.Comment,fontStyle:"italic"},"hljs-doctag":{color:ps.Comment},"hljs-meta":{color:ps.Gray},"hljs-meta-keyword":{color:ps.Gray},"hljs-tag":{color:ps.Gray},"hljs-variable":{color:ps.AccentPurple},"hljs-template-variable":{color:ps.AccentPurple},"hljs-attr":{color:ps.LightBlue},"hljs-attribute":{color:ps.LightBlue},"hljs-builtin-name":{color:ps.LightBlue},"hljs-section":{color:ps.AccentYellow},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{color:ps.AccentYellow},"hljs-selector-tag":{color:ps.AccentYellow},"hljs-selector-id":{color:ps.AccentYellow},"hljs-selector-class":{color:ps.AccentYellow},"hljs-selector-attr":{color:ps.AccentYellow},"hljs-selector-pseudo":{color:ps.AccentYellow},"hljs-addition":{backgroundColor:"#144212",display:"inline-block",width:"100%"},"hljs-deletion":{backgroundColor:"#600",display:"inline-block",width:"100%"}},ps);var cL=".adal",Zdt=Rq.join(Iau(),cL),Cq=Rq.join(Zdt,"settings.json");var Xdt=class{constructor(e,n,r){this.user=e,this.workspace=n,this.errors=r,this._merged=this.computeMergedSettings()}user;workspace;errors;_merged;get merged(){return this._merged}computeMergedSettings(){return{...this.user.settings,...this.workspace.settings}}forScope(e){switch(e){case"User":return this.user;case"Workspace":return this.workspace;default:throw new Error(`Invalid scope: ${e}`)}}setValue(e,n,r){let o=this.forScope(e);o.settings[n]=r,this._merged=this.computeMergedSettings(),Oau(o)}};function Nau(t){let e=/\$(?:(\w+)|{([^}]+)})/g;return t.replace(e,(n,r,o)=>{let s=r||o;return process&&process.env&&typeof process.env[s]=="string"?process.env[s]:n})}function lLe(t){if(t==null||typeof t=="boolean"||typeof t=="number")return t;if(typeof t=="string")return Nau(t);if(Array.isArray(t))return t.map(e=>lLe(e));if(typeof t=="object"){let e={...t};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lLe(e[n]));return e}return t}function pWo(t){let e={},n={},r=[];try{if(Lg.existsSync(Cq)){let s=Lg.readFileSync(Cq,"utf-8"),i=JSON.parse((0,cLe.default)(s));e=lLe(i),e.theme&&e.theme==="VS"?e.theme=yre.name:e.theme&&e.theme==="VS2015"&&(e.theme=gq.name)}}catch(s){r.push({message:bu(s),path:Cq})}let o=Rq.join(t,cL,"settings.json");try{if(Lg.existsSync(o)){let s=Lg.readFileSync(o,"utf-8"),i=JSON.parse((0,cLe.default)(s));n=lLe(i),n.theme&&n.theme==="VS"?n.theme=yre.name:n.theme&&n.theme==="VS2015"&&(n.theme=gq.name)}}catch(s){r.push({message:bu(s),path:o})}return new Xdt({path:Cq,settings:e},{path:o,settings:n},r)}function Oau(t){try{let e=Rq.dirname(t.path);Lg.existsSync(e)||Lg.mkdirSync(e,{recursive:!0});let n={};if(Lg.existsSync(t.path))try{let o=Lg.readFileSync(t.path,"utf-8");n=JSON.parse((0,cLe.default)(o))}catch{}let r={...n,...t.settings};Lg.writeFileSync(t.path,JSON.stringify(r,null,2),"utf-8")}catch(e){console.error("Error saving user settings file:",e)}}ao();ao();var Mau=`
|
|
Binary file
|
|
Binary file
|