@sylphai/adal-cli-darwin-arm64 0.1.0-beta.41 → 0.1.0-beta.50

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
@@ -905,7 +905,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
905
905
  `,e-1),[o,s]=T4l(r);return{line:n===-1?o:t.slice(0,n+1).match(/\n/g).length+o,column:e-n-1+s}}function ptt(t,e,r){if(typeof t!="string")throw new TypeError("Text parameter should be a string");if(!Number.isInteger(e))throw new TypeError("Index parameter should be an integer");if(e<0||e>t.length)throw new RangeError("Index out of bounds");return f4l(t,e,r)}var S4l=t=>`\\u{${t.codePointAt(0).toString(16)}}`,_tt=class t extends Error{name="JSONError";fileName;#e;#t;#r;#n;#o;constructor(e){if(typeof e=="string")super(),this.#r=e;else{let{jsonParseError:r,fileName:n,input:o}=e;super(void 0,{cause:r}),this.#e=o,this.#t=r,this.fileName=n}Error.captureStackTrace?.(this,t)}get message(){this.#r??=`${m4l(this.#t.message)}${this.#e===""?" while parsing empty string":""}`;let{codeFrame:e}=this;return`${this.#r}${this.fileName?` in ${this.fileName}`:""}${e?`
906
906
 
907
907
  ${e}
908
- `:""}`}set message(e){this.#r=e}#s(e){if(!this.#t)return;let r=this.#e,n=h4l(r,this.#t.message);if(n)return(0,L2o.codeFrameColumns)(r,{start:n},{highlightCode:e})}get codeFrame(){return this.#n??=this.#s(!0),this.#n}get rawCodeFrame(){return this.#o??=this.#s(!1),this.#o}},h4l=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:n,line:o,column:s}=r.groups;return o&&s?{line:Number(o),column:Number(s)}:ptt(t,Number(n),{oneBased:!0})},m4l=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,n)=>`"${n}"(${S4l(n)})`);function Ttt(t,e,r){typeof e=="string"&&(r=e,e=void 0);try{return JSON.parse(t,e)}catch(n){throw new _tt({jsonParseError:n,fileName:r,input:t})}}var Pwo=Ve(Dwo(),1);import{fileURLToPath as SHl}from"node:url";function Mwo(t){return t instanceof URL?SHl(t):t}var gHl=t=>mHl.resolve(Mwo(t)??".","package.json"),CHl=(t,e)=>{let r=typeof t=="string"?Ttt(t):t;return e&&(0,Pwo.default)(r),r};async function vwo({cwd:t,normalize:e=!0}={}){let r=await hHl.readFile(gHl(t),"utf8");return CHl(r,e)}async function ywo(t){let e=await a2o("package.json",t);if(e)return{packageJson:await vwo({...t,cwd:RHl.dirname(e)}),path:e}}import{fileURLToPath as IHl}from"url";import NHl from"path";var OHl=IHl(import.meta.url),DHl=NHl.dirname(OHl),SNe;async function j1(){if(SNe)return SNe;let t=await ywo({cwd:DHl});if(t)return SNe=t.packageJson,SNe}async function hNe(){let t=await j1();return"0.1.0-beta.41"}var kwo=Ve(B$e(),1);import*as _X from"node:fs";import*as N0 from"node:path";import*as Utt from"node:os";var pX=Ve(Gwo(),1);import*as Fwo from"node:os";var Qwo=["docker","podman","sandbox-exec"];function BHl(t){return Qwo.includes(t)}function wHl(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(BHl(t)||(console.error(`ERROR: invalid sandbox command '${t}'. Must be one of ${Qwo.join(", ")}`),process.exit(1)),pX.default.sync(t))return t;console.error(`ERROR: missing sandbox command '${t}' (from GEMINI_SANDBOX)`),process.exit(1)}return Fwo.platform()==="darwin"&&pX.default.sync("sandbox-exec")?"sandbox-exec":pX.default.sync("docker")&&t===!0?"docker":pX.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 Hwo(t,e){let r=e.sandbox??t.sandbox,n=wHl(r),o=await j1(),s=e["sandbox-image"]??process.env.GEMINI_SANDBOX_IMAGE??o?.config?.sandboxImageUri;return n&&s?{command:n,image:s}:void 0}var VHl={debug:(...t)=>console.debug("[DEBUG]",...t),warn:(...t)=>console.warn("[WARN]",...t),error:(...t)=>console.error("[ERROR]",...t)};async function GHl(){return await FBo($et(gR.argv)).option("model",{alias:"m",type:"string",description:"Model",default:gR.env.GEMINI_MODEL||Dj}).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 hNe()).alias("v","version").help().alias("h","help").strict().argv}async function btt(t,e,r){Btt();let n=await GHl(),o=n.debug||!1;t.contextFileName?yj(t.contextFileName):yj(Lj());let s=e.flatMap(_=>_.contextFiles),i=new E4(gR.cwd()),a="",c=0,l=FHl(t,e),u=QHl(t,e),d=await Hwo(t,n);return new Bge({sessionId:r,embeddingModel:Mj,sandbox:d,targetDir:gR.cwd(),debugMode:o,question:n.prompt||"",fullContext:n.all_files||!1,coreTools:t.coreTools||void 0,excludeTools:u,toolDiscoveryCommand:t.toolDiscoveryCommand,toolCallCommand:t.toolCallCommand,mcpServerCommand:t.mcpServerCommand,mcpServers:l,userMemory:a,geminiMdFileCount:c,approvalMode:n.yolo?Ja.YOLO:Ja.DEFAULT,showMemoryUsage:n.show_memory_usage||t.showMemoryUsage||!1,accessibility:t.accessibility,telemetry:{enabled:n.telemetry??t.telemetry?.enabled,target:n.telemetryTarget??t.telemetry?.target,otlpEndpoint:n.telemetryOtlpEndpoint??gR.env.OTEL_EXPORTER_OTLP_ENDPOINT??t.telemetry?.otlpEndpoint,logPrompts:n.telemetryLogPrompts??t.telemetry?.logPrompts},usageStatisticsEnabled:t.usageStatisticsEnabled??!0,fileFiltering:{respectGitIgnore:t.fileFiltering?.respectGitIgnore,enableRecursiveFileSearch:t.fileFiltering?.enableRecursiveFileSearch},checkpointing:n.checkpointing||t.checkpointing?.enabled,proxy:gR.env.HTTPS_PROXY||gR.env.https_proxy||gR.env.HTTP_PROXY||gR.env.http_proxy,cwd:gR.cwd(),fileDiscoveryService:i,bugCommand:t.bugCommand,model:n.model,extensionContextFilePaths:s})}function FHl(t,e){let r={...t.mcpServers||{}};for(let n of e)Object.entries(n.config.mcpServers||{}).forEach(([o,s])=>{if(r[o]){VHl.warn(`Skipping extension MCP config for server with key "${o}" as it already exists.`);return}r[o]=s});return r}function QHl(t,e){let r=new Set(t.excludeTools||[]);for(let n of e)for(let o of n.config.excludeTools||[])r.add(o);return[...r]}function HHl(t){let e=N0.resolve(t);for(;;){let r=N0.join(e,r1,".env");if(_X.existsSync(r))return r;let n=N0.join(e,".env");if(_X.existsSync(n))return n;let o=N0.dirname(e);if(o===e||!o){let s=N0.join(Utt.homedir(),r1,".env");if(_X.existsSync(s))return s;let i=N0.join(Utt.homedir(),".env");return _X.existsSync(i)?i:null}e=o}}function Btt(){let t=HHl(gR.cwd());t&&kwo.config({path:t,quiet:!0})}var Tw=t=>{if(Btt(),t===Tc.LOGIN_WITH_ADAL)return null;if(t===Tc.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===Tc.USE_VERTEX_AI){let e=!!process.env.GOOGLE_CLOUD_PROJECT&&!!process.env.GOOGLE_CLOUD_LOCATION,r=!!process.env.GOOGLE_API_KEY;return!e&&!r?`Must specify GOOGLE_GENAI_USE_VERTEXAI=true and either:
908
+ `:""}`}set message(e){this.#r=e}#s(e){if(!this.#t)return;let r=this.#e,n=h4l(r,this.#t.message);if(n)return(0,L2o.codeFrameColumns)(r,{start:n},{highlightCode:e})}get codeFrame(){return this.#n??=this.#s(!0),this.#n}get rawCodeFrame(){return this.#o??=this.#s(!1),this.#o}},h4l=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:n,line:o,column:s}=r.groups;return o&&s?{line:Number(o),column:Number(s)}:ptt(t,Number(n),{oneBased:!0})},m4l=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,n)=>`"${n}"(${S4l(n)})`);function Ttt(t,e,r){typeof e=="string"&&(r=e,e=void 0);try{return JSON.parse(t,e)}catch(n){throw new _tt({jsonParseError:n,fileName:r,input:t})}}var Pwo=Ve(Dwo(),1);import{fileURLToPath as SHl}from"node:url";function Mwo(t){return t instanceof URL?SHl(t):t}var gHl=t=>mHl.resolve(Mwo(t)??".","package.json"),CHl=(t,e)=>{let r=typeof t=="string"?Ttt(t):t;return e&&(0,Pwo.default)(r),r};async function vwo({cwd:t,normalize:e=!0}={}){let r=await hHl.readFile(gHl(t),"utf8");return CHl(r,e)}async function ywo(t){let e=await a2o("package.json",t);if(e)return{packageJson:await vwo({...t,cwd:RHl.dirname(e)}),path:e}}import{fileURLToPath as IHl}from"url";import NHl from"path";var OHl=IHl(import.meta.url),DHl=NHl.dirname(OHl),SNe;async function j1(){if(SNe)return SNe;let t=await ywo({cwd:DHl});if(t)return SNe=t.packageJson,SNe}async function hNe(){let t=await j1();return"0.1.0-beta.50"}var kwo=Ve(B$e(),1);import*as _X from"node:fs";import*as N0 from"node:path";import*as Utt from"node:os";var pX=Ve(Gwo(),1);import*as Fwo from"node:os";var Qwo=["docker","podman","sandbox-exec"];function BHl(t){return Qwo.includes(t)}function wHl(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(BHl(t)||(console.error(`ERROR: invalid sandbox command '${t}'. Must be one of ${Qwo.join(", ")}`),process.exit(1)),pX.default.sync(t))return t;console.error(`ERROR: missing sandbox command '${t}' (from GEMINI_SANDBOX)`),process.exit(1)}return Fwo.platform()==="darwin"&&pX.default.sync("sandbox-exec")?"sandbox-exec":pX.default.sync("docker")&&t===!0?"docker":pX.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 Hwo(t,e){let r=e.sandbox??t.sandbox,n=wHl(r),o=await j1(),s=e["sandbox-image"]??process.env.GEMINI_SANDBOX_IMAGE??o?.config?.sandboxImageUri;return n&&s?{command:n,image:s}:void 0}var VHl={debug:(...t)=>console.debug("[DEBUG]",...t),warn:(...t)=>console.warn("[WARN]",...t),error:(...t)=>console.error("[ERROR]",...t)};async function GHl(){return await FBo($et(gR.argv)).option("model",{alias:"m",type:"string",description:"Model",default:gR.env.GEMINI_MODEL||Dj}).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 hNe()).alias("v","version").help().alias("h","help").strict().argv}async function btt(t,e,r){Btt();let n=await GHl(),o=n.debug||!1;t.contextFileName?yj(t.contextFileName):yj(Lj());let s=e.flatMap(_=>_.contextFiles),i=new E4(gR.cwd()),a="",c=0,l=FHl(t,e),u=QHl(t,e),d=await Hwo(t,n);return new Bge({sessionId:r,embeddingModel:Mj,sandbox:d,targetDir:gR.cwd(),debugMode:o,question:n.prompt||"",fullContext:n.all_files||!1,coreTools:t.coreTools||void 0,excludeTools:u,toolDiscoveryCommand:t.toolDiscoveryCommand,toolCallCommand:t.toolCallCommand,mcpServerCommand:t.mcpServerCommand,mcpServers:l,userMemory:a,geminiMdFileCount:c,approvalMode:n.yolo?Ja.YOLO:Ja.DEFAULT,showMemoryUsage:n.show_memory_usage||t.showMemoryUsage||!1,accessibility:t.accessibility,telemetry:{enabled:n.telemetry??t.telemetry?.enabled,target:n.telemetryTarget??t.telemetry?.target,otlpEndpoint:n.telemetryOtlpEndpoint??gR.env.OTEL_EXPORTER_OTLP_ENDPOINT??t.telemetry?.otlpEndpoint,logPrompts:n.telemetryLogPrompts??t.telemetry?.logPrompts},usageStatisticsEnabled:t.usageStatisticsEnabled??!0,fileFiltering:{respectGitIgnore:t.fileFiltering?.respectGitIgnore,enableRecursiveFileSearch:t.fileFiltering?.enableRecursiveFileSearch},checkpointing:n.checkpointing||t.checkpointing?.enabled,proxy:gR.env.HTTPS_PROXY||gR.env.https_proxy||gR.env.HTTP_PROXY||gR.env.http_proxy,cwd:gR.cwd(),fileDiscoveryService:i,bugCommand:t.bugCommand,model:n.model,extensionContextFilePaths:s})}function FHl(t,e){let r={...t.mcpServers||{}};for(let n of e)Object.entries(n.config.mcpServers||{}).forEach(([o,s])=>{if(r[o]){VHl.warn(`Skipping extension MCP config for server with key "${o}" as it already exists.`);return}r[o]=s});return r}function QHl(t,e){let r=new Set(t.excludeTools||[]);for(let n of e)for(let o of n.config.excludeTools||[])r.add(o);return[...r]}function HHl(t){let e=N0.resolve(t);for(;;){let r=N0.join(e,r1,".env");if(_X.existsSync(r))return r;let n=N0.join(e,".env");if(_X.existsSync(n))return n;let o=N0.dirname(e);if(o===e||!o){let s=N0.join(Utt.homedir(),r1,".env");if(_X.existsSync(s))return s;let i=N0.join(Utt.homedir(),".env");return _X.existsSync(i)?i:null}e=o}}function Btt(){let t=HHl(gR.cwd());t&&kwo.config({path:t,quiet:!0})}var Tw=t=>{if(Btt(),t===Tc.LOGIN_WITH_ADAL)return null;if(t===Tc.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===Tc.USE_VERTEX_AI){let e=!!process.env.GOOGLE_CLOUD_PROJECT&&!!process.env.GOOGLE_CLOUD_LOCATION,r=!!process.env.GOOGLE_API_KEY;return!e&&!r?`Must specify GOOGLE_GENAI_USE_VERTEXAI=true and either:
909
909
  \u2022 GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION environment variables.
910
910
  \u2022 GOOGLE_API_KEY environment variable (if using express mode).
911
911
  Update your .env and try again, no reload needed!`:null}return"Invalid auth method selected."};import*as RO from"fs";import*as bk from"path";import*as qwo from"os";var kHl=bk.join(".gemini","extensions"),YHl="gemini-extension.json";function Wwo(t){let e=[...Ywo(t),...Ywo(qwo.homedir())],r=[],n=new Set;for(let o of e)n.has(o.config.name)||(console.log(`Loading extension: ${o.config.name} (version: ${o.config.version})`),r.push(o),n.add(o.config.name));return r}function Ywo(t){let e=bk.join(t,kHl);if(!RO.existsSync(e))return[];let r=[];for(let n of RO.readdirSync(e)){let o=bk.join(e,n),s=qHl(o);s!=null&&r.push(s)}return r}function qHl(t){if(!RO.statSync(t).isDirectory())return console.error(`Warning: unexpected file ${t} in extensions directory.`),null;let e=bk.join(t,YHl);if(!RO.existsSync(e))return console.error(`Warning: extension directory ${t} does not contain a config file ${e}.`),null;try{let r=RO.readFileSync(e,"utf-8"),n=JSON.parse(r);if(!n.name||!n.version)return console.error(`Invalid extension config in ${e}: missing name or version.`),null;let o=WHl(n).map(s=>bk.join(t,s)).filter(s=>RO.existsSync(s));return{config:n,contextFiles:o}}catch(r){return console.error(`Warning: error parsing extension config in ${e}: ${r}`),null}}function WHl(t){if(t.contextFileName){if(!Array.isArray(t.contextFileName))return[t.contextFileName]}else return["GEMINI.md"];return t.contextFileName}import*as CR from"fs";import*as Vk from"path";import{homedir as zHl}from"os";var Vtt=Ve(Jwo(),1);var di={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"]},rs={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 Ui=class t{constructor(e,r,n,o){this.name=e;this.type=r;this.colors=o;this._colorMap=Object.freeze(this._buildColorMap(n));let s=n.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 r=e.toLowerCase();if(r.startsWith("#"))return r;if(t.inkSupportedNames.has(r))return r;if(t.cssNameToHexMap[r])return t.cssNameToHexMap[r];console.warn(`[Theme] Could not resolve color "${e}" to an Ink-compatible format.`)}_buildColorMap(e){let r={};for(let n in e){if(!n.startsWith("hljs-")&&n!=="hljs")continue;let o=e[n];if(o?.color){let s=t._resolveColor(o.color);s!==void 0&&(r[n]=s)}}return r}};var TX=new Ui("Default Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:di.Background,color:di.Foreground},"hljs-comment":{color:di.Comment},"hljs-quote":{color:di.Comment},"hljs-variable":{color:di.Foreground},"hljs-keyword":{color:di.AccentBlue},"hljs-selector-tag":{color:di.AccentBlue},"hljs-built_in":{color:di.AccentBlue},"hljs-name":{color:di.AccentBlue},"hljs-tag":{color:di.AccentBlue},"hljs-string":{color:di.AccentRed},"hljs-title":{color:di.AccentRed},"hljs-section":{color:di.AccentRed},"hljs-attribute":{color:di.AccentRed},"hljs-literal":{color:di.AccentRed},"hljs-template-tag":{color:di.AccentRed},"hljs-template-variable":{color:di.AccentRed},"hljs-type":{color:di.AccentRed},"hljs-addition":{color:di.AccentGreen},"hljs-deletion":{color:di.AccentRed},"hljs-selector-attr":{color:di.AccentCyan},"hljs-selector-pseudo":{color:di.AccentCyan},"hljs-meta":{color:di.AccentCyan},"hljs-doctag":{color:di.Gray},"hljs-attr":{color:di.AccentRed},"hljs-symbol":{color:di.AccentCyan},"hljs-bullet":{color:di.AccentCyan},"hljs-link":{color:di.AccentCyan},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},di);var Bk=new Ui("Default","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:rs.Background,color:rs.Foreground},"hljs-keyword":{color:rs.AccentBlue},"hljs-literal":{color:rs.AccentBlue},"hljs-symbol":{color:rs.AccentBlue},"hljs-name":{color:rs.AccentBlue},"hljs-link":{color:rs.AccentBlue,textDecoration:"underline"},"hljs-built_in":{color:rs.AccentCyan},"hljs-type":{color:rs.AccentCyan},"hljs-number":{color:rs.AccentGreen},"hljs-class":{color:rs.AccentGreen},"hljs-string":{color:rs.AccentYellow},"hljs-meta-string":{color:rs.AccentYellow},"hljs-regexp":{color:rs.AccentRed},"hljs-template-tag":{color:rs.AccentRed},"hljs-subst":{color:rs.Foreground},"hljs-function":{color:rs.Foreground},"hljs-title":{color:rs.Foreground},"hljs-params":{color:rs.Foreground},"hljs-formula":{color:rs.Foreground},"hljs-comment":{color:rs.Comment,fontStyle:"italic"},"hljs-quote":{color:rs.Comment,fontStyle:"italic"},"hljs-doctag":{color:rs.Comment},"hljs-meta":{color:rs.Gray},"hljs-meta-keyword":{color:rs.Gray},"hljs-tag":{color:rs.Gray},"hljs-variable":{color:rs.AccentPurple},"hljs-template-variable":{color:rs.AccentPurple},"hljs-attr":{color:rs.LightBlue},"hljs-attribute":{color:rs.LightBlue},"hljs-builtin-name":{color:rs.LightBlue},"hljs-section":{color:rs.AccentYellow},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{color:rs.AccentYellow},"hljs-selector-tag":{color:rs.AccentYellow},"hljs-selector-id":{color:rs.AccentYellow},"hljs-selector-class":{color:rs.AccentYellow},"hljs-selector-attr":{color:rs.AccentYellow},"hljs-selector-pseudo":{color:rs.AccentYellow},"hljs-addition":{backgroundColor:"#144212",display:"inline-block",width:"100%"},"hljs-deletion":{backgroundColor:"#600",display:"inline-block",width:"100%"}},rs);var O0=".gemini",Ftt=Vk.join(zHl(),O0),wk=Vk.join(Ftt,"settings.json");var Gtt=class{constructor(e,r,n){this.user=e,this.workspace=r,this.errors=n,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,r,n){let o=this.forScope(e);o.settings[r]=n,this._merged=this.computeMergedSettings(),$Hl(o)}};function XHl(t){let e=/\$(?:(\w+)|{([^}]+)})/g;return t.replace(e,(r,n,o)=>{let s=n||o;return process&&process.env&&typeof process.env[s]=="string"?process.env[s]:r})}function gNe(t){if(t==null||typeof t=="boolean"||typeof t=="number")return t;if(typeof t=="string")return XHl(t);if(Array.isArray(t))return t.map(e=>gNe(e));if(typeof t=="object"){let e={...t};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=gNe(e[r]));return e}return t}function zwo(t){let e={},r={},n=[];try{if(CR.existsSync(wk)){let s=CR.readFileSync(wk,"utf-8"),i=JSON.parse((0,Vtt.default)(s));e=gNe(i),e.theme&&e.theme==="VS"?e.theme=TX.name:e.theme&&e.theme==="VS2015"&&(e.theme=Bk.name)}}catch(s){n.push({message:Sl(s),path:wk})}let o=Vk.join(t,O0,"settings.json");try{if(CR.existsSync(o)){let s=CR.readFileSync(o,"utf-8"),i=JSON.parse((0,Vtt.default)(s));r=gNe(i),r.theme&&r.theme==="VS"?r.theme=TX.name:r.theme&&r.theme==="VS2015"&&(r.theme=Bk.name)}}catch(s){n.push({message:Sl(s),path:o})}return new Gtt({path:wk,settings:e},{path:o,settings:r},n)}function $Hl(t){try{let e=Vk.dirname(t.path);CR.existsSync(e)||CR.mkdirSync(e,{recursive:!0}),CR.writeFileSync(t.path,JSON.stringify(t.settings,null,2),"utf-8")}catch(e){console.error("Error saving user settings file:",e)}}var ZHl=`
@@ -1166,7 +1166,7 @@ ${HYl}
1166
1166
  Try running with %s or get access `,iT.cyan("sudo"))+`
1167
1167
  to the local update config store via
1168
1168
  `+iT.cyan(Bot(" sudo chown -R $USER:$(id -gn $USER) %s ",f9));Ww.on("exit",()=>{console.error(gDe(r,{textAlignment:"center"}))})}}check(){!this.config||this.config.get("optOut")||this.#n||(this.update=this.config.get("update"),this.update&&(this.update.current=this.#t,this.config.delete("update")),!(Date.now()-this.config.get("lastUpdateCheck")<this.#r)&&iql(Ww.execPath,[uko.join(cql,"check.js"),JSON.stringify(this.#e)],{detached:!0,stdio:"ignore"}).unref())}async fetchInfo(){let{distTag:e}=this.#e,r=await mot(this._packageName,{version:e});return{latest:r,current:this.#t,type:(0,Ako.default)(this.#t,r)??e,name:this._packageName}}notify(e){let r=!this._shouldNotifyInNpmScript&&C8o;if(!Ww.stdout.isTTY||r||!this.update||!(0,Eko.default)(this.update.latest,this.update.current))return this;e={isGlobal:x8o,...e};let n=e.isGlobal?`npm i -g ${this._packageName}`:`npm i ${this._packageName}`,o="Update available "+iT.dim("{currentVersion}")+iT.reset(" \u2192 ")+iT.green("{latestVersion}")+`
1169
- Run `+iT.cyan("{updateCommand}")+" to update",s=e.message||o;e.boxenOptions??={padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let i=gDe(bot(s,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:n}),e.boxenOptions);return e.defer===!1?console.error(i):Ww.on("exit",()=>{console.error(i)}),this}};function wot(t){let e=new A$(t);return e.check(),e}var dko=Ve(Hi(),1);import{exec as uql}from"child_process";import{promisify as Aql}from"util";var Eql=Aql(uql);async function pko(){try{let t=await j1();if(!t||!t.name||!t.version)return console.log("[UPDATE] No package.json found"),null;console.log(`[UPDATE] Checking for updates: ${t.name}@${t.version}`);let e=wot({pkg:{name:t.name,version:t.version},updateCheckInterval:0,shouldNotifyInNpmScript:!0});return console.log("[UPDATE] Update info:",e.update),e.update&&dko.default.gt(e.update.latest,e.update.current)?(console.log(`[UPDATE] Update available: ${e.update.current} \u2192 ${e.update.latest}`),{current:e.update.current,latest:e.update.latest,packageName:t.name}):(console.log("[UPDATE] No updates available"),null)}catch(t){return console.error("[UPDATE] Error checking for updates:",t),null}}async function _ko(t){try{let{packageName:e,latest:r}=t;return console.log(`[UPDATE] Installing ${e}@${r}...`),await Eql(`npm install -g ${e}@${r}`,{timeout:6e4}),console.log("[UPDATE] Installation successful"),!0}catch(e){return console.error("[UPDATE] Installation failed:",e),!1}}var Kr=Ve(Ut(),1);var dql=1e3,Tko=t=>(0,Kr.jsx)(_3o,{children:(0,Kr.jsx)(pql,{...t})}),pql=({config:t,settings:e,startupWarnings:r=[]})=>{_4o();let[n,o]=(0,hr.useState)(null),[s,i]=(0,hr.useState)(""),{stdout:a}=oet();(0,hr.useEffect)(()=>{(async()=>{try{let br=await pko();br&&(console.log(`Update available: ${br.current} \u2192 ${br.latest}`),await _ko(br)&&o(`Updated to v${br.latest} (restart to apply)`))}catch{}})()},[]);let{history:c,addItem:l,clearItems:u,loadHistory:d}=S4o(),{consoleMessages:_,handleNewMessage:T,clearConsoleMessages:h}=T4o(),{stats:g}=vO(),[C,N]=(0,hr.useState)(!1),[x,v]=(0,hr.useState)(0),P=(0,hr.useCallback)(()=>{a.write(pR.clearTerminal),v(Ht=>Ht+1)},[v,a]);(0,hr.useEffect)(()=>{(async()=>{try{let br=await j1();br?.version&&(i(br.version),setTimeout(()=>P(),0))}catch{}})()},[P]);let[w,H]=(0,hr.useState)(0),[Y,z]=(0,hr.useState)(""),[b,ce]=(0,hr.useState)(!1),[j,le]=(0,hr.useState)(null),[q,y]=(0,hr.useState)(null),[Q,K]=(0,hr.useState)(null),[se,ie]=(0,hr.useState)(0),[Se,Te]=(0,hr.useState)(!1),[xe,Ue]=(0,hr.useState)(t.getModel()),[Re,Le]=(0,hr.useState)("auto"),[fe,Z]=(0,hr.useState)(!1),[ae,Ce]=(0,hr.useState)(!1),[$,pe]=(0,hr.useState)(!1),[de,Ee]=(0,hr.useState)(!1),[ge,ne]=(0,hr.useState)(!1),[G,k]=(0,hr.useState)(!1),[_e,re]=(0,hr.useState)(!1),[F,me]=(0,hr.useState)(!0),[be,qe]=(0,hr.useState)(!1),[Ot,Vt]=(0,hr.useState)(!1),[Pr,Ct]=(0,hr.useState)(null),Mt=(0,hr.useRef)(null),[Jt,ln]=(0,hr.useState)(!1),co=(0,hr.useRef)(null),[Mn,_o]=(0,hr.useState)(!0),[Ys,Lo]=(0,hr.useState)(!1),Me=(0,hr.useCallback)(()=>{Lo(!0)},[]),ot=(0,hr.useMemo)(()=>_.filter(Ht=>Ht.type==="error").reduce((Ht,br)=>Ht+br.count,0),[_]),{isThemeDialogOpen:Kt,openThemeDialog:zt,handleThemeSelect:Rr,handleThemeHighlight:on}=I4o(e,le,l),fr=(0,hr.useMemo)(()=>Cu(),[]),{isAuthDialogOpen:Rn,openAuthDialog:yr,handleAuthSelect:ya,isAuthenticating:Sa,cancelAuthentication:tA,isAuthenticated:Nu,resetAuthentication:Ou,isInitializing:xc,isInitialized:fi}=E4o(e,y,t,fr);(0,hr.useEffect)(()=>{if(e.merged.selectedAuthType){let Ht=Tw(e.merged.selectedAuthType);Ht&&(y(Ht),yr())}},[e.merged.selectedAuthType,yr,y]);let{isEditorDialogOpen:LA,openEditorDialog:rA,handleEditorSelect:ze,exitEditorDialog:He}=f4o(e,K,l),ct=(0,hr.useCallback)((Ht,br,Bn=!1)=>{Ue(Ht),Z(br),Ce(Bn)},[]),{isModelDialogOpen:mt,openModelDialog:at,handleModelSelect:dr,exitModelDialog:Ur}=C4o(l,ct),{isMCPDialogOpen:bn,openMCPDialog:Xn,exitMCPDialog:ri}=R4o(),ro=(0,hr.useCallback)(()=>{Te(Ht=>!Ht)},[]),jo=(0,hr.useRef)(null),[qs,en]=(0,hr.useState)(null);(0,hr.useEffect)(()=>{let Ht=()=>{let Bn=t.getModel();Bn!==xe&&Ue(Bn)};Ht();let br=setInterval(Ht,1e3);return()=>clearInterval(br)},[t,xe]),(0,hr.useEffect)(()=>{(async()=>{try{let Bn=await Cu().getModelInfo();Bn&&Bn.success&&(Z(Bn.is_thinking_model||!1),Ce(Bn.is_local_model||!1))}catch{Z(!1),Ce(!1)}})()},[xe]),(0,hr.useEffect)(()=>{let Ht=async(br,Bn)=>(l({type:"info",text:`\u26A1 Slow response times detected. Automatically switching from ${br} to ${Bn} for faster responses for the remainder of this session.
1169
+ Run `+iT.cyan("{updateCommand}")+" to update",s=e.message||o;e.boxenOptions??={padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let i=gDe(bot(s,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:n}),e.boxenOptions);return e.defer===!1?console.error(i):Ww.on("exit",()=>{console.error(i)}),this}};function wot(t){let e=new A$(t);return e.check(),e}var dko=Ve(Hi(),1);import{exec as uql}from"child_process";import{promisify as Aql}from"util";var Eql=Aql(uql);async function pko(){try{let t=await j1();if(!t||!t.version)return console.log("[UPDATE] No package.json found"),null;let e="@sylphai/adal-cli";console.log(`[UPDATE] Checking for updates: ${e}@${t.version}`);let r=wot({pkg:{name:e,version:t.version},updateCheckInterval:0,shouldNotifyInNpmScript:!0});return console.log("[UPDATE] Update info:",r.update),r.update&&dko.default.gt(r.update.latest,r.update.current)?(console.log(`[UPDATE] Update available: ${r.update.current} \u2192 ${r.update.latest}`),{current:r.update.current,latest:r.update.latest,packageName:e}):(console.log("[UPDATE] No updates available"),null)}catch(t){return console.error("[UPDATE] Error checking for updates:",t),null}}async function _ko(t){try{let{packageName:e,latest:r}=t;return console.log(`[UPDATE] Installing ${e}@${r}...`),await Eql(`npm install -g ${e}@${r}`,{timeout:6e4}),console.log("[UPDATE] Installation successful"),!0}catch(e){return console.error("[UPDATE] Installation failed:",e),!1}}var Kr=Ve(Ut(),1);var dql=1e3,Tko=t=>(0,Kr.jsx)(_3o,{children:(0,Kr.jsx)(pql,{...t})}),pql=({config:t,settings:e,startupWarnings:r=[]})=>{_4o();let[n,o]=(0,hr.useState)(null),[s,i]=(0,hr.useState)(""),{stdout:a}=oet();(0,hr.useEffect)(()=>{(async()=>{try{let br=await pko();br&&(console.log(`Update available: ${br.current} \u2192 ${br.latest}`),await _ko(br)&&o(`Updated to v${br.latest} (restart to apply)`))}catch{}})()},[]);let{history:c,addItem:l,clearItems:u,loadHistory:d}=S4o(),{consoleMessages:_,handleNewMessage:T,clearConsoleMessages:h}=T4o(),{stats:g}=vO(),[C,N]=(0,hr.useState)(!1),[x,v]=(0,hr.useState)(0),P=(0,hr.useCallback)(()=>{a.write(pR.clearTerminal),v(Ht=>Ht+1)},[v,a]);(0,hr.useEffect)(()=>{(async()=>{try{let br=await j1();br?.version&&(i(br.version),setTimeout(()=>P(),0))}catch{}})()},[P]);let[w,H]=(0,hr.useState)(0),[Y,z]=(0,hr.useState)(""),[b,ce]=(0,hr.useState)(!1),[j,le]=(0,hr.useState)(null),[q,y]=(0,hr.useState)(null),[Q,K]=(0,hr.useState)(null),[se,ie]=(0,hr.useState)(0),[Se,Te]=(0,hr.useState)(!1),[xe,Ue]=(0,hr.useState)(t.getModel()),[Re,Le]=(0,hr.useState)("auto"),[fe,Z]=(0,hr.useState)(!1),[ae,Ce]=(0,hr.useState)(!1),[$,pe]=(0,hr.useState)(!1),[de,Ee]=(0,hr.useState)(!1),[ge,ne]=(0,hr.useState)(!1),[G,k]=(0,hr.useState)(!1),[_e,re]=(0,hr.useState)(!1),[F,me]=(0,hr.useState)(!0),[be,qe]=(0,hr.useState)(!1),[Ot,Vt]=(0,hr.useState)(!1),[Pr,Ct]=(0,hr.useState)(null),Mt=(0,hr.useRef)(null),[Jt,ln]=(0,hr.useState)(!1),co=(0,hr.useRef)(null),[Mn,_o]=(0,hr.useState)(!0),[Ys,Lo]=(0,hr.useState)(!1),Me=(0,hr.useCallback)(()=>{Lo(!0)},[]),ot=(0,hr.useMemo)(()=>_.filter(Ht=>Ht.type==="error").reduce((Ht,br)=>Ht+br.count,0),[_]),{isThemeDialogOpen:Kt,openThemeDialog:zt,handleThemeSelect:Rr,handleThemeHighlight:on}=I4o(e,le,l),fr=(0,hr.useMemo)(()=>Cu(),[]),{isAuthDialogOpen:Rn,openAuthDialog:yr,handleAuthSelect:ya,isAuthenticating:Sa,cancelAuthentication:tA,isAuthenticated:Nu,resetAuthentication:Ou,isInitializing:xc,isInitialized:fi}=E4o(e,y,t,fr);(0,hr.useEffect)(()=>{if(e.merged.selectedAuthType){let Ht=Tw(e.merged.selectedAuthType);Ht&&(y(Ht),yr())}},[e.merged.selectedAuthType,yr,y]);let{isEditorDialogOpen:LA,openEditorDialog:rA,handleEditorSelect:ze,exitEditorDialog:He}=f4o(e,K,l),ct=(0,hr.useCallback)((Ht,br,Bn=!1)=>{Ue(Ht),Z(br),Ce(Bn)},[]),{isModelDialogOpen:mt,openModelDialog:at,handleModelSelect:dr,exitModelDialog:Ur}=C4o(l,ct),{isMCPDialogOpen:bn,openMCPDialog:Xn,exitMCPDialog:ri}=R4o(),ro=(0,hr.useCallback)(()=>{Te(Ht=>!Ht)},[]),jo=(0,hr.useRef)(null),[qs,en]=(0,hr.useState)(null);(0,hr.useEffect)(()=>{let Ht=()=>{let Bn=t.getModel();Bn!==xe&&Ue(Bn)};Ht();let br=setInterval(Ht,1e3);return()=>clearInterval(br)},[t,xe]),(0,hr.useEffect)(()=>{(async()=>{try{let Bn=await Cu().getModelInfo();Bn&&Bn.success&&(Z(Bn.is_thinking_model||!1),Ce(Bn.is_local_model||!1))}catch{Z(!1),Ce(!1)}})()},[xe]),(0,hr.useEffect)(()=>{let Ht=async(br,Bn)=>(l({type:"info",text:`\u26A1 Slow response times detected. Automatically switching from ${br} to ${Bn} for faster responses for the remainder of this session.
1170
1170
  \u26A1 To avoid this you can either upgrade to Standard tier. See: https://goo.gle/set-up-gemini-code-assist
1171
1171
  \u26A1 Or you can utilize a Gemini API Key. See: https://goo.gle/gemini-cli-docs-auth#gemini-api-key
1172
1172
  \u26A1 You can switch authentication methods by typing /auth`},Date.now()),!0);t.setFlashFallbackHandler(Ht)},[t,l]);let{handleSlashCommand:To,slashCommands:xo,pendingHistoryItems:Yo}=K3o(t,e,c,l,u,d,P,ce,z,zt,yr,rA,at,Xn,ro,ge,Ct,Me,Ou,jo,en),Uc=(0,hr.useMemo)(()=>[...Yo],[Yo]),{rows:hs,columns:ms}=tVo(),kn=(0,hr.useRef)(!0),{stdin:ca,setRawMode:is}=Q1(),Vn=(0,hr.useCallback)(Ht=>{try{return CDe.existsSync(Ht)&&CDe.statSync(Ht).isFile()}catch{return!1}},[]),Ws=Math.max(20,Math.floor(ms*.98)+3),Uo=Math.max(60,Math.floor(ms*.8)),tc=pOe({initialText:"",viewport:{height:10,width:Ws},stdin:ca,setRawMode:is,isValidPath:Vn,shellModeActive:$}),ni=(0,hr.useCallback)((Ht,br,Bn)=>{if(Ht){Bn.current&&clearTimeout(Bn.current);let bc=xo.find(nA=>nA.name==="quit"||nA.altName==="exit");bc?bc.action("quit","",""):gf.exit(0)}else br(!0),Bn.current=setTimeout(()=>{br(!1),Bn.current=null},dql)},[xo]);Xa((Ht,br)=>{if(br.ctrl&&Ht==="s"){_o(!Mn);return}if(Yt!=="waiting_for_confirmation"){if(Mn||_o(!0),br.tab&&!br.shift&&!br.ctrl&&!br.meta){if(be)return;fe&&!ae&&Wt();return}else if(br.ctrl&&Ht==="r"){Qt();return}else if(br.ctrl&&Ht==="o")Ee(Bn=>!Bn);else if(br.ctrl&&Ht==="t"){let Bn=!ge;ne(Bn);let bc=t.getMcpServers();Object.keys(bc||{}).length>0&&To(Bn?"/mcp desc":"/mcp nodesc")}else if(br.ctrl&&(Ht==="c"||Ht==="C"))ni(Ot,Vt,Mt);else if(br.ctrl&&(Ht==="d"||Ht==="D")){if(tc.text.length>0)return;ni(Jt,ln,co)}}}),LVo({onNewMessage:T,debugMode:t.getDebugMode()}),(0,hr.useEffect)(()=>{t&&H(t.getGeminiMdFileCount())},[t]);let Ms=(0,hr.useCallback)(Ht=>{Ht==="?"?(k(br=>!br),tc.setText(""),re(!1)):Ht.length>0?(re(!0),k(!1)):Ht.length===0&&re(!1)},[tc]),la=(0,hr.useCallback)(()=>{let Ht=e.merged.preferredEditor;if(!YRe(Ht)){rA();return}return Ht},[e,rA]),De=(0,hr.useCallback)(()=>{y("reauth required"),yr()},[yr,y]),[ve,et]=(0,hr.useState)(!1),{currentDir:lt,branchName:ft,environment:yt}=F4o(ve?fr:null);(0,hr.useEffect)(()=>{fr.getThinkingMode().then(Ht=>{Ht.success&&Ht.thinking_mode&&Le(Ht.thinking_mode)}).catch(Ht=>{console.error("Failed to load thinking mode:",Ht)})},[fr]);let Wt=(0,hr.useCallback)(async()=>{try{let Ht=await fr.toggleThinkingMode();Ht.success&&Ht.new_mode&&Le(Ht.new_mode)}catch(Ht){console.error("Failed to toggle thinking mode:",Ht)}},[fr]),Qt=(0,hr.useCallback)(()=>{me(Ht=>!Ht),setTimeout(()=>P(),0)},[P]);(0,hr.useEffect)(()=>{let Ht=!1,br=wd=>{if(!Ht){Ht=!0,console.log(`
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphai/adal-cli-darwin-arm64",
3
- "version": "0.1.0-beta.41",
3
+ "version": "0.1.0-beta.50",
4
4
  "description": "AI-powered CLI for development and research - darwin-arm64",
5
5
  "bin": {
6
6
  "adal": "adal-cli.js"