@google/gemini-cli 0.34.0-preview.2 → 0.34.0-preview.4

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/bundle/gemini.js CHANGED
@@ -27902,7 +27902,7 @@ var require_backend = __commonJS({
27902
27902
  });
27903
27903
  return value;
27904
27904
  },
27905
- useEffect: function useEffect94(create3) {
27905
+ useEffect: function useEffect95(create3) {
27906
27906
  nextHook();
27907
27907
  hookLog.push({
27908
27908
  displayName: null,
@@ -89787,161 +89787,6 @@ var init_base_token_storage = __esm({
89787
89787
  }
89788
89788
  });
89789
89789
 
89790
- // packages/core/dist/src/mcp/token-storage/file-token-storage.js
89791
- import { promises as fs14 } from "node:fs";
89792
- import * as path8 from "node:path";
89793
- import * as os6 from "node:os";
89794
- import * as crypto8 from "node:crypto";
89795
- var FileTokenStorage;
89796
- var init_file_token_storage = __esm({
89797
- "packages/core/dist/src/mcp/token-storage/file-token-storage.js"() {
89798
- "use strict";
89799
- init_base_token_storage();
89800
- init_paths();
89801
- FileTokenStorage = class extends BaseTokenStorage {
89802
- tokenFilePath;
89803
- encryptionKey;
89804
- constructor(serviceName) {
89805
- super(serviceName);
89806
- const configDir = path8.join(homedir(), GEMINI_DIR);
89807
- this.tokenFilePath = path8.join(configDir, "mcp-oauth-tokens-v2.json");
89808
- this.encryptionKey = this.deriveEncryptionKey();
89809
- }
89810
- deriveEncryptionKey() {
89811
- const salt = `${os6.hostname()}-${os6.userInfo().username}-gemini-cli`;
89812
- return crypto8.scryptSync("gemini-cli-oauth", salt, 32);
89813
- }
89814
- encrypt(text) {
89815
- const iv = crypto8.randomBytes(16);
89816
- const cipher = crypto8.createCipheriv("aes-256-gcm", this.encryptionKey, iv);
89817
- let encrypted = cipher.update(text, "utf8", "hex");
89818
- encrypted += cipher.final("hex");
89819
- const authTag = cipher.getAuthTag();
89820
- return iv.toString("hex") + ":" + authTag.toString("hex") + ":" + encrypted;
89821
- }
89822
- decrypt(encryptedData) {
89823
- const parts2 = encryptedData.split(":");
89824
- if (parts2.length !== 3) {
89825
- throw new Error("Invalid encrypted data format");
89826
- }
89827
- const iv = Buffer.from(parts2[0], "hex");
89828
- const authTag = Buffer.from(parts2[1], "hex");
89829
- const encrypted = parts2[2];
89830
- const decipher = crypto8.createDecipheriv("aes-256-gcm", this.encryptionKey, iv);
89831
- decipher.setAuthTag(authTag);
89832
- let decrypted = decipher.update(encrypted, "hex", "utf8");
89833
- decrypted += decipher.final("utf8");
89834
- return decrypted;
89835
- }
89836
- async ensureDirectoryExists() {
89837
- const dir = path8.dirname(this.tokenFilePath);
89838
- await fs14.mkdir(dir, { recursive: true, mode: 448 });
89839
- }
89840
- async loadTokens() {
89841
- try {
89842
- const data = await fs14.readFile(this.tokenFilePath, "utf-8");
89843
- const decrypted = this.decrypt(data);
89844
- const tokens = JSON.parse(decrypted);
89845
- return new Map(Object.entries(tokens));
89846
- } catch (error40) {
89847
- const err2 = error40;
89848
- if (err2.code === "ENOENT") {
89849
- return /* @__PURE__ */ new Map();
89850
- }
89851
- if (err2.message?.includes("Invalid encrypted data format") || err2.message?.includes("Unsupported state or unable to authenticate data")) {
89852
- throw new Error(`Corrupted token file detected at: ${this.tokenFilePath}
89853
- Please delete or rename this file to resolve the issue.`);
89854
- }
89855
- throw error40;
89856
- }
89857
- }
89858
- async saveTokens(tokens) {
89859
- await this.ensureDirectoryExists();
89860
- const data = Object.fromEntries(tokens);
89861
- const json4 = JSON.stringify(data, null, 2);
89862
- const encrypted = this.encrypt(json4);
89863
- await fs14.writeFile(this.tokenFilePath, encrypted, { mode: 384 });
89864
- }
89865
- async getCredentials(serverName) {
89866
- const tokens = await this.loadTokens();
89867
- const credentials2 = tokens.get(serverName);
89868
- if (!credentials2) {
89869
- return null;
89870
- }
89871
- if (this.isTokenExpired(credentials2)) {
89872
- return null;
89873
- }
89874
- return credentials2;
89875
- }
89876
- async setCredentials(credentials2) {
89877
- this.validateCredentials(credentials2);
89878
- const tokens = await this.loadTokens();
89879
- const updatedCredentials = {
89880
- ...credentials2,
89881
- updatedAt: Date.now()
89882
- };
89883
- tokens.set(credentials2.serverName, updatedCredentials);
89884
- await this.saveTokens(tokens);
89885
- }
89886
- async deleteCredentials(serverName) {
89887
- const tokens = await this.loadTokens();
89888
- if (!tokens.has(serverName)) {
89889
- throw new Error(`No credentials found for ${serverName}`);
89890
- }
89891
- tokens.delete(serverName);
89892
- if (tokens.size === 0) {
89893
- try {
89894
- await fs14.unlink(this.tokenFilePath);
89895
- } catch (error40) {
89896
- const err2 = error40;
89897
- if (err2.code !== "ENOENT") {
89898
- throw error40;
89899
- }
89900
- }
89901
- } else {
89902
- await this.saveTokens(tokens);
89903
- }
89904
- }
89905
- async listServers() {
89906
- const tokens = await this.loadTokens();
89907
- return Array.from(tokens.keys());
89908
- }
89909
- async getAllCredentials() {
89910
- const tokens = await this.loadTokens();
89911
- const result2 = /* @__PURE__ */ new Map();
89912
- for (const [serverName, credentials2] of tokens) {
89913
- if (!this.isTokenExpired(credentials2)) {
89914
- result2.set(serverName, credentials2);
89915
- }
89916
- }
89917
- return result2;
89918
- }
89919
- async clearAll() {
89920
- try {
89921
- await fs14.unlink(this.tokenFilePath);
89922
- } catch (error40) {
89923
- const err2 = error40;
89924
- if (err2.code !== "ENOENT") {
89925
- throw error40;
89926
- }
89927
- }
89928
- }
89929
- };
89930
- }
89931
- });
89932
-
89933
- // packages/core/dist/src/mcp/token-storage/types.js
89934
- var TokenStorageType;
89935
- var init_types = __esm({
89936
- "packages/core/dist/src/mcp/token-storage/types.js"() {
89937
- "use strict";
89938
- (function(TokenStorageType2) {
89939
- TokenStorageType2["KEYCHAIN"] = "keychain";
89940
- TokenStorageType2["ENCRYPTED_FILE"] = "encrypted_file";
89941
- })(TokenStorageType || (TokenStorageType = {}));
89942
- }
89943
- });
89944
-
89945
89790
  // packages/core/dist/src/utils/events.js
89946
89791
  import { EventEmitter as EventEmitter4 } from "node:events";
89947
89792
  var CoreEvent, CoreEventEmitter, coreEvents;
@@ -90133,7 +89978,7 @@ function getHookSource(input) {
90133
89978
  return "project";
90134
89979
  }
90135
89980
  var PolicyDecision, VALID_HOOK_SOURCES, ApprovalMode, InProcessCheckerType, PRIORITY_SUBAGENT_TOOL;
90136
- var init_types2 = __esm({
89981
+ var init_types = __esm({
90137
89982
  "packages/core/dist/src/policy/types.js"() {
90138
89983
  "use strict";
90139
89984
  (function(PolicyDecision2) {
@@ -90163,10 +90008,10 @@ var init_types2 = __esm({
90163
90008
 
90164
90009
  // packages/core/dist/src/scheduler/types.js
90165
90010
  var ROOT_SCHEDULER_ID, CoreToolCallStatus;
90166
- var init_types3 = __esm({
90011
+ var init_types2 = __esm({
90167
90012
  "packages/core/dist/src/scheduler/types.js"() {
90168
90013
  "use strict";
90169
- init_types2();
90014
+ init_types();
90170
90015
  ROOT_SCHEDULER_ID = "root";
90171
90016
  (function(CoreToolCallStatus2) {
90172
90017
  CoreToolCallStatus2["Validating"] = "validating";
@@ -103572,7 +103417,7 @@ var init_schemaValidator = __esm({
103572
103417
 
103573
103418
  // packages/core/dist/src/confirmation-bus/types.js
103574
103419
  var MessageBusType, QuestionType;
103575
- var init_types4 = __esm({
103420
+ var init_types3 = __esm({
103576
103421
  "packages/core/dist/src/confirmation-bus/types.js"() {
103577
103422
  "use strict";
103578
103423
  init_node();
@@ -103667,8 +103512,8 @@ var init_tools = __esm({
103667
103512
  "use strict";
103668
103513
  init_tool_error();
103669
103514
  init_schemaValidator();
103670
- init_types4();
103671
- init_types2();
103515
+ init_types3();
103516
+ init_types();
103672
103517
  BaseToolInvocation = class {
103673
103518
  params;
103674
103519
  messageBus;
@@ -104589,7 +104434,7 @@ var init_ComponentLogger = __esm({
104589
104434
 
104590
104435
  // node_modules/@opentelemetry/api/build/esm/diag/types.js
104591
104436
  var DiagLogLevel;
104592
- var init_types5 = __esm({
104437
+ var init_types4 = __esm({
104593
104438
  "node_modules/@opentelemetry/api/build/esm/diag/types.js"() {
104594
104439
  (function(DiagLogLevel2) {
104595
104440
  DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
@@ -104629,7 +104474,7 @@ function createLogLevelDiagLogger(maxLevel, logger6) {
104629
104474
  }
104630
104475
  var init_logLevelLogger = __esm({
104631
104476
  "node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js"() {
104632
- init_types5();
104477
+ init_types4();
104633
104478
  }
104634
104479
  });
104635
104480
 
@@ -104639,7 +104484,7 @@ var init_diag = __esm({
104639
104484
  "node_modules/@opentelemetry/api/build/esm/api/diag.js"() {
104640
104485
  init_ComponentLogger();
104641
104486
  init_logLevelLogger();
104642
- init_types5();
104487
+ init_types4();
104643
104488
  init_global_utils();
104644
104489
  __read2 = function(o3, n3) {
104645
104490
  var m3 = typeof Symbol === "function" && o3[Symbol.iterator];
@@ -105948,7 +105793,7 @@ var init_esm = __esm({
105948
105793
  init_utils();
105949
105794
  init_context();
105950
105795
  init_consoleLogger();
105951
- init_types5();
105796
+ init_types4();
105952
105797
  init_NoopMeter();
105953
105798
  init_Metric();
105954
105799
  init_TextMapPropagator();
@@ -106011,9 +105856,9 @@ var init_constants = __esm({
106011
105856
  });
106012
105857
 
106013
105858
  // packages/core/dist/src/utils/installationManager.js
106014
- import * as fs15 from "node:fs";
105859
+ import * as fs14 from "node:fs";
106015
105860
  import { randomUUID as randomUUID2 } from "node:crypto";
106016
- import * as path9 from "node:path";
105861
+ import * as path8 from "node:path";
106017
105862
  var InstallationManager;
106018
105863
  var init_installationManager = __esm({
106019
105864
  "packages/core/dist/src/utils/installationManager.js"() {
@@ -106026,17 +105871,17 @@ var init_installationManager = __esm({
106026
105871
  }
106027
105872
  readInstallationIdFromFile() {
106028
105873
  const installationIdFile = this.getInstallationIdPath();
106029
- if (fs15.existsSync(installationIdFile)) {
106030
- const installationid = fs15.readFileSync(installationIdFile, "utf-8").trim();
105874
+ if (fs14.existsSync(installationIdFile)) {
105875
+ const installationid = fs14.readFileSync(installationIdFile, "utf-8").trim();
106031
105876
  return installationid || null;
106032
105877
  }
106033
105878
  return null;
106034
105879
  }
106035
105880
  writeInstallationIdToFile(installationId) {
106036
105881
  const installationIdFile = this.getInstallationIdPath();
106037
- const dir = path9.dirname(installationIdFile);
106038
- fs15.mkdirSync(dir, { recursive: true });
106039
- fs15.writeFileSync(installationIdFile, installationId, "utf-8");
105882
+ const dir = path8.dirname(installationIdFile);
105883
+ fs14.mkdirSync(dir, { recursive: true });
105884
+ fs14.writeFileSync(installationIdFile, installationId, "utf-8");
106040
105885
  }
106041
105886
  /**
106042
105887
  * Retrieves the installation ID from a file, creating it if it doesn't exist.
@@ -109529,10 +109374,10 @@ function makeChatCompressionEvent({ tokens_before, tokens_after }) {
109529
109374
  };
109530
109375
  }
109531
109376
  var EVENT_CLI_CONFIG, StartSessionEvent, EndSessionEvent, EVENT_USER_PROMPT, UserPromptEvent, EVENT_TOOL_CALL, ToolCallEvent, EVENT_API_REQUEST, ApiRequestEvent, EVENT_API_ERROR, ApiErrorEvent, EVENT_API_RESPONSE, EVENT_GEN_AI_OPERATION_DETAILS, ApiResponseEvent, EVENT_FLASH_FALLBACK, FlashFallbackEvent, EVENT_RIPGREP_FALLBACK, RipgrepFallbackEvent, LoopType, LoopDetectedEvent, LoopDetectionDisabledEvent, EVENT_NEXT_SPEAKER_CHECK, NextSpeakerCheckEvent, EVENT_CONSECA_POLICY_GENERATION, ConsecaPolicyGenerationEvent, EVENT_CONSECA_VERDICT, ConsecaVerdictEvent, EVENT_SLASH_COMMAND, SlashCommandStatus, EVENT_REWIND, RewindEvent, EVENT_CHAT_COMPRESSION2, EVENT_MALFORMED_JSON_RESPONSE, MalformedJsonResponseEvent, IdeConnectionType, EVENT_IDE_CONNECTION, IdeConnectionEvent, EVENT_CONVERSATION_FINISHED, ConversationFinishedEvent, EVENT_FILE_OPERATION, FileOperationEvent, EVENT_INVALID_CHUNK, InvalidChunkEvent, EVENT_CONTENT_RETRY, ContentRetryEvent, EVENT_CONTENT_RETRY_FAILURE, ContentRetryFailureEvent, EVENT_MODEL_ROUTING, ModelRoutingEvent, EVENT_EXTENSION_INSTALL, ExtensionInstallEvent, EVENT_TOOL_OUTPUT_TRUNCATED, ToolOutputTruncatedEvent, EVENT_TOOL_OUTPUT_MASKING, ToolOutputMaskingEvent, EVENT_EXTENSION_UNINSTALL, ExtensionUninstallEvent, EVENT_EXTENSION_UPDATE, ExtensionUpdateEvent, EVENT_EXTENSION_ENABLE, ExtensionEnableEvent, EVENT_MODEL_SLASH_COMMAND, ModelSlashCommandEvent, EVENT_LLM_LOOP_CHECK, LlmLoopCheckEvent, EVENT_EXTENSION_DISABLE, ExtensionDisableEvent, EVENT_EDIT_STRATEGY, EditStrategyEvent, EVENT_EDIT_CORRECTION, EditCorrectionEvent, EVENT_STARTUP_STATS, StartupStatsEvent, BaseAgentEvent, EVENT_AGENT_START, AgentStartEvent, EVENT_AGENT_FINISH, AgentFinishEvent, EVENT_AGENT_RECOVERY_ATTEMPT, RecoveryAttemptEvent, EVENT_WEB_FETCH_FALLBACK_ATTEMPT, WebFetchFallbackAttemptEvent, EVENT_HOOK_CALL, EVENT_APPROVAL_MODE_SWITCH, ApprovalModeSwitchEvent, EVENT_APPROVAL_MODE_DURATION, ApprovalModeDurationEvent, EVENT_PLAN_EXECUTION, PlanExecutionEvent, HookCallEvent, EVENT_KEYCHAIN_AVAILABILITY, KeychainAvailabilityEvent, EVENT_TOKEN_STORAGE_INITIALIZATION, TokenStorageInitializationEvent;
109532
- var init_types6 = __esm({
109377
+ var init_types5 = __esm({
109533
109378
  "packages/core/dist/src/telemetry/types.js"() {
109534
109379
  "use strict";
109535
- init_types3();
109380
+ init_types2();
109536
109381
  init_mcp_tool();
109537
109382
  init_contentGenerator();
109538
109383
  init_tool_call_decision();
@@ -111904,7 +111749,7 @@ function custom(check2, _params = {}, fatal) {
111904
111749
  return ZodAny.create();
111905
111750
  }
111906
111751
  var ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex2, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, instanceOfType, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, ostring, onumber, oboolean, coerce, NEVER;
111907
- var init_types7 = __esm({
111752
+ var init_types6 = __esm({
111908
111753
  "node_modules/zod/v3/types.js"() {
111909
111754
  init_ZodError();
111910
111755
  init_errors2();
@@ -115284,7 +115129,7 @@ var init_external = __esm({
115284
115129
  init_parseUtil();
115285
115130
  init_typeAliases();
115286
115131
  init_util();
115287
- init_types7();
115132
+ init_types6();
115288
115133
  init_ZodError();
115289
115134
  }
115290
115135
  });
@@ -115406,17 +115251,137 @@ var init_markdownUtils = __esm({
115406
115251
  }
115407
115252
  });
115408
115253
 
115254
+ // packages/core/dist/src/services/fileKeychain.js
115255
+ import { promises as fs15 } from "node:fs";
115256
+ import * as path9 from "node:path";
115257
+ import * as os6 from "node:os";
115258
+ import * as crypto8 from "node:crypto";
115259
+ var FileKeychain;
115260
+ var init_fileKeychain = __esm({
115261
+ "packages/core/dist/src/services/fileKeychain.js"() {
115262
+ "use strict";
115263
+ init_paths();
115264
+ FileKeychain = class {
115265
+ tokenFilePath;
115266
+ encryptionKey;
115267
+ constructor() {
115268
+ const configDir = path9.join(homedir(), GEMINI_DIR);
115269
+ this.tokenFilePath = path9.join(configDir, "gemini-credentials.json");
115270
+ this.encryptionKey = this.deriveEncryptionKey();
115271
+ }
115272
+ deriveEncryptionKey() {
115273
+ const salt = `${os6.hostname()}-${os6.userInfo().username}-gemini-cli`;
115274
+ return crypto8.scryptSync("gemini-cli-oauth", salt, 32);
115275
+ }
115276
+ encrypt(text) {
115277
+ const iv = crypto8.randomBytes(16);
115278
+ const cipher = crypto8.createCipheriv("aes-256-gcm", this.encryptionKey, iv);
115279
+ let encrypted = cipher.update(text, "utf8", "hex");
115280
+ encrypted += cipher.final("hex");
115281
+ const authTag = cipher.getAuthTag();
115282
+ return iv.toString("hex") + ":" + authTag.toString("hex") + ":" + encrypted;
115283
+ }
115284
+ decrypt(encryptedData) {
115285
+ const parts2 = encryptedData.split(":");
115286
+ if (parts2.length !== 3) {
115287
+ throw new Error("Invalid encrypted data format");
115288
+ }
115289
+ const iv = Buffer.from(parts2[0], "hex");
115290
+ const authTag = Buffer.from(parts2[1], "hex");
115291
+ const encrypted = parts2[2];
115292
+ const decipher = crypto8.createDecipheriv("aes-256-gcm", this.encryptionKey, iv);
115293
+ decipher.setAuthTag(authTag);
115294
+ let decrypted = decipher.update(encrypted, "hex", "utf8");
115295
+ decrypted += decipher.final("utf8");
115296
+ return decrypted;
115297
+ }
115298
+ async ensureDirectoryExists() {
115299
+ const dir = path9.dirname(this.tokenFilePath);
115300
+ await fs15.mkdir(dir, { recursive: true, mode: 448 });
115301
+ }
115302
+ async loadData() {
115303
+ try {
115304
+ const data = await fs15.readFile(this.tokenFilePath, "utf-8");
115305
+ const decrypted = this.decrypt(data);
115306
+ return JSON.parse(decrypted);
115307
+ } catch (error40) {
115308
+ const err2 = error40;
115309
+ if (err2.code === "ENOENT") {
115310
+ return {};
115311
+ }
115312
+ if (err2.message?.includes("Invalid encrypted data format") || err2.message?.includes("Unsupported state or unable to authenticate data")) {
115313
+ throw new Error(`Corrupted credentials file detected at: ${this.tokenFilePath}
115314
+ Please delete or rename this file to resolve the issue.`);
115315
+ }
115316
+ throw error40;
115317
+ }
115318
+ }
115319
+ async saveData(data) {
115320
+ await this.ensureDirectoryExists();
115321
+ const json4 = JSON.stringify(data, null, 2);
115322
+ const encrypted = this.encrypt(json4);
115323
+ await fs15.writeFile(this.tokenFilePath, encrypted, { mode: 384 });
115324
+ }
115325
+ async getPassword(service, account) {
115326
+ const data = await this.loadData();
115327
+ return data[service]?.[account] ?? null;
115328
+ }
115329
+ async setPassword(service, account, password) {
115330
+ const data = await this.loadData();
115331
+ if (!data[service]) {
115332
+ data[service] = {};
115333
+ }
115334
+ data[service][account] = password;
115335
+ await this.saveData(data);
115336
+ }
115337
+ async deletePassword(service, account) {
115338
+ const data = await this.loadData();
115339
+ if (data[service] && account in data[service]) {
115340
+ delete data[service][account];
115341
+ if (Object.keys(data[service]).length === 0) {
115342
+ delete data[service];
115343
+ }
115344
+ if (Object.keys(data).length === 0) {
115345
+ try {
115346
+ await fs15.unlink(this.tokenFilePath);
115347
+ } catch (error40) {
115348
+ const err2 = error40;
115349
+ if (err2.code !== "ENOENT") {
115350
+ throw error40;
115351
+ }
115352
+ }
115353
+ } else {
115354
+ await this.saveData(data);
115355
+ }
115356
+ return true;
115357
+ }
115358
+ return false;
115359
+ }
115360
+ async findCredentials(service) {
115361
+ const data = await this.loadData();
115362
+ const serviceData = data[service] || {};
115363
+ return Object.entries(serviceData).map(([account, password]) => ({
115364
+ account,
115365
+ password
115366
+ }));
115367
+ }
115368
+ };
115369
+ }
115370
+ });
115371
+
115409
115372
  // packages/core/dist/src/services/keychainService.js
115410
115373
  import * as crypto9 from "node:crypto";
115411
- var KeychainService;
115374
+ var FORCE_FILE_STORAGE_ENV_VAR, KeychainService;
115412
115375
  var init_keychainService = __esm({
115413
115376
  "packages/core/dist/src/services/keychainService.js"() {
115414
115377
  "use strict";
115415
115378
  init_events();
115416
- init_types6();
115379
+ init_types5();
115417
115380
  init_debugLogger();
115418
115381
  init_keychainTypes();
115419
115382
  init_markdownUtils();
115383
+ init_fileKeychain();
115384
+ FORCE_FILE_STORAGE_ENV_VAR = "GEMINI_FORCE_FILE_STORAGE";
115420
115385
  KeychainService = class {
115421
115386
  serviceName;
115422
115387
  // Track an ongoing initialization attempt to avoid race conditions.
@@ -115430,6 +115395,13 @@ var init_keychainService = __esm({
115430
115395
  async isAvailable() {
115431
115396
  return await this.getKeychain() !== null;
115432
115397
  }
115398
+ /**
115399
+ * Returns true if the service is using the encrypted file fallback backend.
115400
+ */
115401
+ async isUsingFileFallback() {
115402
+ const keychain = await this.getKeychain();
115403
+ return keychain instanceof FileKeychain;
115404
+ }
115433
115405
  /**
115434
115406
  * Retrieves a secret for the given account.
115435
115407
  * @throws Error if the keychain is unavailable.
@@ -115476,20 +115448,27 @@ var init_keychainService = __esm({
115476
115448
  // High-level orchestration of the loading and testing cycle.
115477
115449
  async initializeKeychain() {
115478
115450
  let resultKeychain = null;
115479
- try {
115480
- const keychainModule = await this.loadKeychainModule();
115481
- if (keychainModule) {
115482
- if (await this.isKeychainFunctional(keychainModule)) {
115483
- resultKeychain = keychainModule;
115484
- } else {
115485
- debugLogger.log("Keychain functional verification failed");
115451
+ const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
115452
+ if (!forceFileStorage) {
115453
+ try {
115454
+ const keychainModule = await this.loadKeychainModule();
115455
+ if (keychainModule) {
115456
+ if (await this.isKeychainFunctional(keychainModule)) {
115457
+ resultKeychain = keychainModule;
115458
+ } else {
115459
+ debugLogger.log("Keychain functional verification failed");
115460
+ }
115486
115461
  }
115462
+ } catch (error40) {
115463
+ const message = error40 instanceof Error ? error40.message : String(error40);
115464
+ debugLogger.log("Keychain initialization encountered an error:", message);
115487
115465
  }
115488
- } catch (error40) {
115489
- const message = error40 instanceof Error ? error40.message : String(error40);
115490
- debugLogger.log("Keychain initialization encountered an error:", message);
115491
115466
  }
115492
- coreEvents.emitTelemetryKeychainAvailability(new KeychainAvailabilityEvent(resultKeychain !== null));
115467
+ coreEvents.emitTelemetryKeychainAvailability(new KeychainAvailabilityEvent(resultKeychain !== null && !forceFileStorage));
115468
+ if (!resultKeychain) {
115469
+ resultKeychain = new FileKeychain();
115470
+ debugLogger.log("Using FileKeychain fallback for secure storage.");
115471
+ }
115493
115472
  return resultKeychain;
115494
115473
  }
115495
115474
  // Low-level dynamic loading and structural validation.
@@ -115518,10 +115497,6 @@ var init_keychainService = __esm({
115518
115497
  });
115519
115498
 
115520
115499
  // packages/core/dist/src/mcp/token-storage/keychain-token-storage.js
115521
- var keychain_token_storage_exports = {};
115522
- __export(keychain_token_storage_exports, {
115523
- KeychainTokenStorage: () => KeychainTokenStorage
115524
- });
115525
115500
  var KeychainTokenStorage;
115526
115501
  var init_keychain_token_storage = __esm({
115527
115502
  "packages/core/dist/src/mcp/token-storage/keychain-token-storage.js"() {
@@ -115622,6 +115597,9 @@ var init_keychain_token_storage = __esm({
115622
115597
  async isAvailable() {
115623
115598
  return this.keychainService.isAvailable();
115624
115599
  }
115600
+ async isUsingFileFallback() {
115601
+ return this.keychainService.isUsingFileFallback();
115602
+ }
115625
115603
  async setSecret(key, value) {
115626
115604
  await this.keychainService.setPassword(`${SECRET_PREFIX}${key}`, value);
115627
115605
  }
@@ -115647,17 +115625,29 @@ var init_keychain_token_storage = __esm({
115647
115625
  }
115648
115626
  });
115649
115627
 
115628
+ // packages/core/dist/src/mcp/token-storage/types.js
115629
+ var TokenStorageType;
115630
+ var init_types7 = __esm({
115631
+ "packages/core/dist/src/mcp/token-storage/types.js"() {
115632
+ "use strict";
115633
+ (function(TokenStorageType2) {
115634
+ TokenStorageType2["KEYCHAIN"] = "keychain";
115635
+ TokenStorageType2["ENCRYPTED_FILE"] = "encrypted_file";
115636
+ })(TokenStorageType || (TokenStorageType = {}));
115637
+ }
115638
+ });
115639
+
115650
115640
  // packages/core/dist/src/mcp/token-storage/hybrid-token-storage.js
115651
- var FORCE_FILE_STORAGE_ENV_VAR, HybridTokenStorage;
115641
+ var HybridTokenStorage;
115652
115642
  var init_hybrid_token_storage = __esm({
115653
115643
  "packages/core/dist/src/mcp/token-storage/hybrid-token-storage.js"() {
115654
115644
  "use strict";
115655
115645
  init_base_token_storage();
115656
- init_file_token_storage();
115657
- init_types();
115646
+ init_keychain_token_storage();
115647
+ init_types7();
115658
115648
  init_events();
115659
- init_types6();
115660
- FORCE_FILE_STORAGE_ENV_VAR = "GEMINI_FORCE_FILE_STORAGE";
115649
+ init_types5();
115650
+ init_keychainService();
115661
115651
  HybridTokenStorage = class extends BaseTokenStorage {
115662
115652
  storage = null;
115663
115653
  storageType = null;
@@ -115667,23 +115657,11 @@ var init_hybrid_token_storage = __esm({
115667
115657
  }
115668
115658
  async initializeStorage() {
115669
115659
  const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
115670
- if (!forceFileStorage) {
115671
- try {
115672
- const { KeychainTokenStorage: KeychainTokenStorage2 } = await Promise.resolve().then(() => (init_keychain_token_storage(), keychain_token_storage_exports));
115673
- const keychainStorage = new KeychainTokenStorage2(this.serviceName);
115674
- const isAvailable = await keychainStorage.isAvailable();
115675
- if (isAvailable) {
115676
- this.storage = keychainStorage;
115677
- this.storageType = TokenStorageType.KEYCHAIN;
115678
- coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent("keychain", forceFileStorage));
115679
- return this.storage;
115680
- }
115681
- } catch (_e2) {
115682
- }
115683
- }
115684
- this.storage = new FileTokenStorage(this.serviceName);
115685
- this.storageType = TokenStorageType.ENCRYPTED_FILE;
115686
- coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent("encrypted_file", forceFileStorage));
115660
+ const keychainStorage = new KeychainTokenStorage(this.serviceName);
115661
+ this.storage = keychainStorage;
115662
+ const isUsingFileFallback = await keychainStorage.isUsingFileFallback();
115663
+ this.storageType = isUsingFileFallback ? TokenStorageType.ENCRYPTED_FILE : TokenStorageType.KEYCHAIN;
115664
+ coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent(isUsingFileFallback ? "encrypted_file" : "keychain", forceFileStorage));
115687
115665
  return this.storage;
115688
115666
  }
115689
115667
  async getStorage() {
@@ -115831,10 +115809,10 @@ var DEFAULT_SERVICE_NAME, FORCE_ENCRYPTED_FILE_ENV_VAR;
115831
115809
  var init_token_storage = __esm({
115832
115810
  "packages/core/dist/src/mcp/token-storage/index.js"() {
115833
115811
  "use strict";
115834
- init_types();
115812
+ init_types7();
115835
115813
  init_base_token_storage();
115836
- init_file_token_storage();
115837
115814
  init_hybrid_token_storage();
115815
+ init_keychain_token_storage();
115838
115816
  DEFAULT_SERVICE_NAME = "gemini-cli-oauth";
115839
115817
  FORCE_ENCRYPTED_FILE_ENV_VAR = "GEMINI_FORCE_ENCRYPTED_FILE_STORAGE";
115840
115818
  }
@@ -116694,7 +116672,7 @@ function getDisplayString(model) {
116694
116672
  }
116695
116673
  }
116696
116674
  function isPreviewModel(model) {
116697
- return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO || model === GEMINI_MODEL_ALIAS_AUTO;
116675
+ return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO || model === GEMINI_MODEL_ALIAS_AUTO || model === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL;
116698
116676
  }
116699
116677
  function isProModel(model) {
116700
116678
  return model.toLowerCase().includes("pro");
@@ -116738,7 +116716,7 @@ function isActiveModel(model, useGemini3_1 = false, useCustomToolModel = false)
116738
116716
  return model !== PREVIEW_GEMINI_3_1_MODEL && model !== PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL;
116739
116717
  }
116740
116718
  }
116741
- var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, VALID_GEMINI_MODELS, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
116719
+ var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, VALID_GEMINI_MODELS, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
116742
116720
  var init_models = __esm({
116743
116721
  "packages/core/dist/src/config/models.js"() {
116744
116722
  "use strict";
@@ -116746,6 +116724,7 @@ var init_models = __esm({
116746
116724
  PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
116747
116725
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
116748
116726
  PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
116727
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL = "gemini-3.1-flash-lite-preview";
116749
116728
  DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
116750
116729
  DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
116751
116730
  DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
@@ -116754,6 +116733,7 @@ var init_models = __esm({
116754
116733
  PREVIEW_GEMINI_3_1_MODEL,
116755
116734
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
116756
116735
  PREVIEW_GEMINI_FLASH_MODEL,
116736
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
116757
116737
  DEFAULT_GEMINI_MODEL,
116758
116738
  DEFAULT_GEMINI_FLASH_MODEL,
116759
116739
  DEFAULT_GEMINI_FLASH_LITE_MODEL
@@ -195144,8 +195124,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
195144
195124
  var init_git_commit = __esm({
195145
195125
  "packages/core/dist/src/generated/git-commit.js"() {
195146
195126
  "use strict";
195147
- GIT_COMMIT_INFO = "4085b4f8e";
195148
- CLI_VERSION = "0.34.0-preview.2";
195127
+ GIT_COMMIT_INFO = "72bca215f";
195128
+ CLI_VERSION = "0.34.0-preview.4";
195149
195129
  }
195150
195130
  });
195151
195131
 
@@ -273285,7 +273265,7 @@ var createInitialRoleMetrics, createInitialModelMetrics, createInitialMetrics, U
273285
273265
  var init_uiTelemetry = __esm({
273286
273266
  "packages/core/dist/src/telemetry/uiTelemetry.js"() {
273287
273267
  "use strict";
273288
- init_types6();
273268
+ init_types5();
273289
273269
  init_tool_call_decision();
273290
273270
  createInitialRoleMetrics = () => ({
273291
273271
  totalRequests: 0,
@@ -274476,7 +274456,7 @@ var init_startupProfiler = __esm({
274476
274456
  "use strict";
274477
274457
  init_metrics2();
274478
274458
  init_debugLogger();
274479
- init_types6();
274459
+ init_types5();
274480
274460
  init_loggers();
274481
274461
  StartupProfiler = class _StartupProfiler {
274482
274462
  phases = /* @__PURE__ */ new Map();
@@ -274634,9 +274614,9 @@ var init_telemetry = __esm({
274634
274614
  init_gcp_exporters();
274635
274615
  init_loggers();
274636
274616
  init_conseca_logger();
274637
- init_types6();
274617
+ init_types5();
274638
274618
  init_llmRole();
274639
- init_types6();
274619
+ init_types5();
274640
274620
  init_esm();
274641
274621
  init_esm2();
274642
274622
  init_uiTelemetry();
@@ -275547,7 +275527,7 @@ var init_loggers = __esm({
275547
275527
  "use strict";
275548
275528
  import_api_logs2 = __toESM(require_src12(), 1);
275549
275529
  init_constants();
275550
- init_types6();
275530
+ init_types5();
275551
275531
  init_metrics2();
275552
275532
  init_sdk();
275553
275533
  init_uiTelemetry();
@@ -325985,7 +325965,7 @@ var init_baseLlmClient = __esm({
325985
325965
  init_errorReporting();
325986
325966
  init_errors();
325987
325967
  init_loggers();
325988
- init_types6();
325968
+ init_types5();
325989
325969
  init_retry();
325990
325970
  init_policyHelpers();
325991
325971
  DEFAULT_MAX_ATTEMPTS2 = 5;
@@ -326213,7 +326193,7 @@ var init_llm_edit_fixer = __esm({
326213
326193
  init_mnemonist();
326214
326194
  init_promptIdContext();
326215
326195
  init_debugLogger();
326216
- init_types6();
326196
+ init_types5();
326217
326197
  MAX_CACHE_SIZE = 50;
326218
326198
  GENERATE_JSON_TIMEOUT_MS = 4e4;
326219
326199
  EDIT_SYS_PROMPT = `
@@ -326790,15 +326770,15 @@ var init_edit = __esm({
326790
326770
  init_paths();
326791
326771
  init_errors();
326792
326772
  init_pathCorrector();
326773
+ init_types();
326793
326774
  init_types2();
326794
- init_types3();
326795
326775
  init_diffOptions();
326796
326776
  init_diff_utils();
326797
326777
  init_modifiable_tool();
326798
326778
  init_ide_client();
326799
326779
  init_llm_edit_fixer();
326800
326780
  init_textUtils();
326801
- init_types6();
326781
+ init_types5();
326802
326782
  init_loggers();
326803
326783
  init_tool_names();
326804
326784
  init_debugLogger();
@@ -327387,7 +327367,7 @@ var init_editCorrector = __esm({
327387
327367
  init_promptIdContext();
327388
327368
  init_debugLogger();
327389
327369
  init_mnemonist();
327390
- init_types6();
327370
+ init_types5();
327391
327371
  CODE_CORRECTION_SYSTEM_PROMPT = `
327392
327372
  You are an expert code-editing assistant. Your task is to analyze a failed edit attempt and provide a corrected version of the text snippets.
327393
327373
  The correction should be as minimal as possible, staying very close to the original.
@@ -328686,7 +328666,7 @@ var init_write_file = __esm({
328686
328666
  "use strict";
328687
328667
  init_libesm();
328688
328668
  init_tool_names();
328689
- init_types2();
328669
+ init_types();
328690
328670
  init_tools();
328691
328671
  init_utils4();
328692
328672
  init_tool_error();
@@ -328698,7 +328678,7 @@ var init_write_file = __esm({
328698
328678
  init_diff_utils();
328699
328679
  init_ide_client();
328700
328680
  init_loggers();
328701
- init_types6();
328681
+ init_types5();
328702
328682
  init_metrics2();
328703
328683
  init_fileUtils();
328704
328684
  init_language_detection();
@@ -334191,7 +334171,7 @@ function getVersion() {
334191
334171
  }
334192
334172
  versionPromise = (async () => {
334193
334173
  const pkgJson = await getPackageJson(__dirname3);
334194
- return "0.34.0-preview.2";
334174
+ return "0.34.0-preview.4";
334195
334175
  })();
334196
334176
  return versionPromise;
334197
334177
  }
@@ -334278,7 +334258,7 @@ var init_server = __esm({
334278
334258
  init_converter();
334279
334259
  init_telemetry2();
334280
334260
  init_client_metadata();
334281
- init_types6();
334261
+ init_types5();
334282
334262
  CODE_ASSIST_ENDPOINT = "https://cloudcode-pa.googleapis.com";
334283
334263
  CODE_ASSIST_API_VERSION = "v1internal";
334284
334264
  GENERATE_CONTENT_RETRY_DELAY_IN_MILLISECONDS = 1e3;
@@ -335015,7 +334995,7 @@ var LoggingContentGenerator;
335015
334995
  var init_loggingContentGenerator = __esm({
335016
334996
  "packages/core/dist/src/core/loggingContentGenerator.js"() {
335017
334997
  "use strict";
335018
- init_types6();
334998
+ init_types5();
335019
334999
  init_loggers();
335020
335000
  init_server();
335021
335001
  init_converter();
@@ -335998,7 +335978,7 @@ var init_tool_registry = __esm({
335998
335978
  "packages/core/dist/src/tools/tool-registry.js"() {
335999
335979
  "use strict";
336000
335980
  init_tools();
336001
- init_types2();
335981
+ init_types();
336002
335982
  init_mcp_tool();
336003
335983
  import_shell_quote = __toESM(require_shell_quote(), 1);
336004
335984
  init_tool_error();
@@ -337582,7 +337562,7 @@ var init_read_file = __esm({
337582
337562
  init_metrics2();
337583
337563
  init_telemetry_utils();
337584
337564
  init_loggers();
337585
- init_types6();
337565
+ init_types5();
337586
337566
  init_tool_names();
337587
337567
  init_fileDiscoveryService();
337588
337568
  init_coreTools();
@@ -387965,7 +387945,7 @@ var init_web_fetch = __esm({
387965
387945
  init_utils4();
387966
387946
  init_tool_error();
387967
387947
  init_errors();
387968
- init_types2();
387948
+ init_types();
387969
387949
  init_partUtils();
387970
387950
  init_fetch();
387971
387951
  init_textUtils();
@@ -388572,7 +388552,7 @@ var init_ask_user = __esm({
388572
388552
  "use strict";
388573
388553
  init_tools();
388574
388554
  init_tool_error();
388575
- init_types4();
388555
+ init_types3();
388576
388556
  init_tool_names();
388577
388557
  init_coreTools();
388578
388558
  init_resolver();
@@ -388769,7 +388749,7 @@ function getPlanModeExitMessage(newMode, isManual = false) {
388769
388749
  var init_approvalModeUtils = __esm({
388770
388750
  "packages/core/dist/src/utils/approvalModeUtils.js"() {
388771
388751
  "use strict";
388772
- init_types2();
388752
+ init_types();
388773
388753
  init_checks4();
388774
388754
  }
388775
388755
  });
@@ -388783,10 +388763,10 @@ var init_exit_plan_mode = __esm({
388783
388763
  init_tools();
388784
388764
  init_tool_names();
388785
388765
  init_planUtils();
388786
- init_types2();
388766
+ init_types();
388787
388767
  init_paths();
388788
388768
  init_loggers();
388789
- init_types6();
388769
+ init_types5();
388790
388770
  init_coreTools();
388791
388771
  init_resolver();
388792
388772
  init_approvalModeUtils();
@@ -388937,7 +388917,7 @@ var init_enter_plan_mode = __esm({
388937
388917
  "use strict";
388938
388918
  init_tools();
388939
388919
  init_tool_names();
388940
- init_types2();
388920
+ init_types();
388941
388921
  init_coreTools();
388942
388922
  init_resolver();
388943
388923
  EnterPlanModeTool = class _EnterPlanModeTool extends BaseDeclarativeTool {
@@ -389220,8 +389200,8 @@ var init_tool_utils = __esm({
389220
389200
  init_src2();
389221
389201
  init_shell_utils();
389222
389202
  import_fast_levenshtein2 = __toESM(require_levenshtein(), 1);
389203
+ init_types();
389223
389204
  init_types2();
389224
- init_types3();
389225
389205
  init_tool_names();
389226
389206
  }
389227
389207
  });
@@ -389842,7 +389822,7 @@ var init_tool_executor = __esm({
389842
389822
  init_coreToolHookTriggers();
389843
389823
  init_fileUtils();
389844
389824
  init_generateContentResponseUtilities();
389845
- init_types3();
389825
+ init_types2();
389846
389826
  init_constants();
389847
389827
  ToolExecutor = class {
389848
389828
  config;
@@ -390168,8 +390148,8 @@ var init_policy = __esm({
390168
390148
  "packages/core/dist/src/scheduler/policy.js"() {
390169
390149
  "use strict";
390170
390150
  init_tool_error();
390171
- init_types2();
390172
- init_types4();
390151
+ init_types();
390152
+ init_types3();
390173
390153
  init_tools();
390174
390154
  init_utils4();
390175
390155
  init_paths();
@@ -390184,15 +390164,15 @@ var init_coreToolScheduler = __esm({
390184
390164
  "packages/core/dist/src/core/coreToolScheduler.js"() {
390185
390165
  "use strict";
390186
390166
  init_tools();
390187
- init_types2();
390167
+ init_types();
390188
390168
  init_loggers();
390189
390169
  init_tool_error();
390190
- init_types6();
390170
+ init_types5();
390191
390171
  init_trace3();
390192
390172
  init_tool_modifier();
390193
390173
  init_tool_utils();
390194
- init_types4();
390195
390174
  init_types3();
390175
+ init_types2();
390196
390176
  init_tool_executor();
390197
390177
  init_mcp_tool();
390198
390178
  init_policy();
@@ -391388,7 +391368,7 @@ var init_geminiChat = __esm({
391388
391368
  init_tools();
391389
391369
  init_loggers();
391390
391370
  init_chatRecordingService();
391391
- init_types6();
391371
+ init_types5();
391392
391372
  init_handler();
391393
391373
  init_messageInspectors();
391394
391374
  init_geminiRequest();
@@ -391965,8 +391945,8 @@ var init_turn = __esm({
391965
391945
  init_geminiChat();
391966
391946
  init_thoughtUtils();
391967
391947
  init_generateContentResponseUtilities();
391968
- init_types6();
391969
- init_types3();
391948
+ init_types5();
391949
+ init_types2();
391970
391950
  (function(GeminiEventType2) {
391971
391951
  GeminiEventType2["Content"] = "content";
391972
391952
  GeminiEventType2["ToolCallRequest"] = "tool_call_request";
@@ -393586,7 +393566,7 @@ var init_promptProvider = __esm({
393586
393566
  "packages/core/dist/src/prompts/promptProvider.js"() {
393587
393567
  "use strict";
393588
393568
  init_paths();
393589
- init_types2();
393569
+ init_types();
393590
393570
  init_snippets();
393591
393571
  init_snippets_legacy();
393592
393572
  init_utils6();
@@ -393796,7 +393776,7 @@ var init_nextSpeakerChecker = __esm({
393796
393776
  "use strict";
393797
393777
  init_messageInspectors();
393798
393778
  init_debugLogger();
393799
- init_types6();
393779
+ init_types5();
393800
393780
  CHECK_PROMPT = `Analyze *only* the content and structure of your immediately preceding response (your last turn in the conversation history). Based *strictly* on that response, determine who should logically speak next: the 'user' or the 'model' (you).
393801
393781
  **Decision Rules (apply in order):**
393802
393782
  1. **Model Continues:** If your last response explicitly states an immediate next action *you* intend to take (e.g., "Next, I will...", "Now I'll process...", "Moving on to analyze...", indicates an intended tool call that didn't execute), OR if the response seems clearly incomplete (cut off mid-thought without a natural conclusion), then the **'model'** should speak next.
@@ -393850,7 +393830,7 @@ var init_loopDetectionService = __esm({
393850
393830
  "use strict";
393851
393831
  init_turn();
393852
393832
  init_loggers();
393853
- init_types6();
393833
+ init_types5();
393854
393834
  init_messageInspectors();
393855
393835
  init_debugLogger();
393856
393836
  TOOL_CALL_LOOP_THRESHOLD = 5;
@@ -394435,7 +394415,7 @@ var init_chatCompressionService = __esm({
394435
394415
  init_prompts();
394436
394416
  init_partUtils();
394437
394417
  init_loggers();
394438
- init_types6();
394418
+ init_types5();
394439
394419
  init_fileUtils();
394440
394420
  init_debugLogger();
394441
394421
  init_environmentContext();
@@ -394627,7 +394607,7 @@ var init_toolOutputMaskingService = __esm({
394627
394607
  init_fileUtils();
394628
394608
  init_loggers();
394629
394609
  init_tool_names();
394630
- init_types6();
394610
+ init_types5();
394631
394611
  DEFAULT_TOOL_PROTECTION_THRESHOLD = 5e4;
394632
394612
  DEFAULT_MIN_PRUNABLE_TOKENS_THRESHOLD = 3e4;
394633
394613
  DEFAULT_PROTECT_LATEST_TURN = true;
@@ -394871,7 +394851,7 @@ var init_client3 = __esm({
394871
394851
  init_chatCompressionService();
394872
394852
  init_ideContext();
394873
394853
  init_loggers();
394874
- init_types6();
394854
+ init_types5();
394875
394855
  init_uiTelemetry();
394876
394856
  init_handler();
394877
394857
  init_debugLogger();
@@ -401260,7 +401240,7 @@ var init_classifierStrategy = __esm({
401260
401240
  init_node();
401261
401241
  init_messageInspectors();
401262
401242
  init_debugLogger();
401263
- init_types6();
401243
+ init_types5();
401264
401244
  HISTORY_TURNS_FOR_CONTEXT2 = 4;
401265
401245
  HISTORY_SEARCH_WINDOW2 = 20;
401266
401246
  FLASH_MODEL2 = "flash";
@@ -401425,7 +401405,7 @@ var init_numericalClassifierStrategy = __esm({
401425
401405
  init_models();
401426
401406
  init_node();
401427
401407
  init_debugLogger();
401428
- init_types6();
401408
+ init_types5();
401429
401409
  HISTORY_TURNS_FOR_CONTEXT3 = 8;
401430
401410
  FLASH_MODEL3 = "flash";
401431
401411
  PRO_MODEL3 = "pro";
@@ -401695,7 +401675,7 @@ var init_approvalModeStrategy = __esm({
401695
401675
  "packages/core/dist/src/routing/strategies/approvalModeStrategy.js"() {
401696
401676
  "use strict";
401697
401677
  init_models();
401698
- init_types2();
401678
+ init_types();
401699
401679
  ApprovalModeStrategy = class {
401700
401680
  name = "approval-mode";
401701
401681
  async route(context2, config2, _baseLlmClient) {
@@ -401754,7 +401734,7 @@ var init_modelRouterService = __esm({
401754
401734
  init_overrideStrategy();
401755
401735
  init_approvalModeStrategy();
401756
401736
  init_loggers();
401757
- init_types6();
401737
+ init_types5();
401758
401738
  init_debugLogger();
401759
401739
  ModelRouterService = class {
401760
401740
  config;
@@ -403477,8 +403457,8 @@ var MessageBus;
403477
403457
  var init_message_bus = __esm({
403478
403458
  "packages/core/dist/src/confirmation-bus/message-bus.js"() {
403479
403459
  "use strict";
403480
- init_types2();
403481
- init_types4();
403460
+ init_types();
403461
+ init_types3();
403482
403462
  init_safeJsonStringify();
403483
403463
  init_debugLogger();
403484
403464
  MessageBus = class extends EventEmitter12 {
@@ -403738,7 +403718,7 @@ var init_policy_engine = __esm({
403738
403718
  "packages/core/dist/src/policy/policy-engine.js"() {
403739
403719
  "use strict";
403740
403720
  init_node();
403741
- init_types2();
403721
+ init_types();
403742
403722
  init_stable_stringify();
403743
403723
  init_debugLogger();
403744
403724
  init_protocol2();
@@ -405123,7 +405103,7 @@ var init_hookEventHandler = __esm({
405123
405103
  init_types16();
405124
405104
  init_hookTranslator();
405125
405105
  init_loggers();
405126
- init_types6();
405106
+ init_types5();
405127
405107
  init_debugLogger();
405128
405108
  init_events();
405129
405109
  HookEventHandler = class {
@@ -413886,7 +413866,7 @@ var init_registry = __esm({
413886
413866
  init_debugLogger();
413887
413867
  init_models();
413888
413868
  init_modelConfigService();
413889
- init_types2();
413869
+ init_types();
413890
413870
  init_a2a_errors();
413891
413871
  AgentRegistry = class {
413892
413872
  config;
@@ -414352,8 +414332,8 @@ var SchedulerStateManager;
414352
414332
  var init_state_manager = __esm({
414353
414333
  "packages/core/dist/src/scheduler/state-manager.js"() {
414354
414334
  "use strict";
414335
+ init_types2();
414355
414336
  init_types3();
414356
- init_types4();
414357
414337
  init_tool_utils();
414358
414338
  SchedulerStateManager = class {
414359
414339
  messageBus;
@@ -414878,9 +414858,9 @@ async function waitForConfirmation(messageBus, correlationId, signal, ideConfirm
414878
414858
  var init_confirmation = __esm({
414879
414859
  "packages/core/dist/src/scheduler/confirmation.js"() {
414880
414860
  "use strict";
414881
- init_types4();
414882
- init_tools();
414883
414861
  init_types3();
414862
+ init_tools();
414863
+ init_types2();
414884
414864
  init_editor();
414885
414865
  init_debugLogger();
414886
414866
  init_events();
@@ -414897,15 +414877,15 @@ var init_scheduler2 = __esm({
414897
414877
  init_policy();
414898
414878
  init_tool_executor();
414899
414879
  init_tool_modifier();
414900
- init_types3();
414901
- init_tool_error();
414902
414880
  init_types2();
414881
+ init_tool_error();
414882
+ init_types();
414903
414883
  init_tools();
414904
414884
  init_tool_utils();
414905
414885
  init_trace3();
414906
414886
  init_loggers();
414907
- init_types6();
414908
- init_types4();
414887
+ init_types5();
414888
+ init_types3();
414909
414889
  init_toolCallContext();
414910
414890
  init_events();
414911
414891
  init_constants();
@@ -415594,13 +415574,13 @@ var init_local_executor = __esm({
415594
415574
  init_tools();
415595
415575
  init_mcp_tool();
415596
415576
  init_turn();
415577
+ init_types2();
415597
415578
  init_types3();
415598
- init_types4();
415599
415579
  init_chatCompressionService();
415600
415580
  init_environmentContext();
415601
415581
  init_promptIdContext();
415602
415582
  init_loggers();
415603
- init_types6();
415583
+ init_types5();
415604
415584
  init_types18();
415605
415585
  init_errors();
415606
415586
  init_utils8();
@@ -432560,7 +432540,8 @@ var init_flagNames = __esm({
432560
432540
  MASKING_PROTECTION_THRESHOLD: 45758817,
432561
432541
  MASKING_PRUNABLE_THRESHOLD: 45758818,
432562
432542
  MASKING_PROTECT_LATEST_TURN: 45758819,
432563
- GEMINI_3_1_PRO_LAUNCHED: 45760185
432543
+ GEMINI_3_1_PRO_LAUNCHED: 45760185,
432544
+ PRO_MODEL_NO_ACCESS: 45768879
432564
432545
  };
432565
432546
  }
432566
432547
  });
@@ -435302,7 +435283,7 @@ var import_fast_levenshtein3, import_toml, MAX_TYPO_DISTANCE, PolicyRuleSchema,
435302
435283
  var init_toml_loader = __esm({
435303
435284
  "packages/core/dist/src/policy/toml-loader.js"() {
435304
435285
  "use strict";
435305
- init_types2();
435286
+ init_types();
435306
435287
  init_utils4();
435307
435288
  init_tool_names();
435308
435289
  init_tool_utils();
@@ -435759,11 +435740,11 @@ var init_config3 = __esm({
435759
435740
  "packages/core/dist/src/policy/config.js"() {
435760
435741
  "use strict";
435761
435742
  init_storage();
435762
- init_types2();
435743
+ init_types();
435763
435744
  init_toml_loader();
435764
435745
  init_utils4();
435765
435746
  import_toml2 = __toESM(require_toml(), 1);
435766
- init_types4();
435747
+ init_types3();
435767
435748
  init_message_bus();
435768
435749
  init_events();
435769
435750
  init_debugLogger();
@@ -436537,7 +436518,7 @@ var init_registry2 = __esm({
436537
436518
  "packages/core/dist/src/safety/registry.js"() {
436538
436519
  "use strict";
436539
436520
  init_built_in();
436540
- init_types2();
436521
+ init_types();
436541
436522
  init_conseca();
436542
436523
  CheckerRegistry = class _CheckerRegistry {
436543
436524
  checkersPath;
@@ -439894,7 +439875,7 @@ var init_config4 = __esm({
439894
439875
  init_fileSystemService();
439895
439876
  init_trackerTools2();
439896
439877
  init_loggers();
439897
- init_types6();
439878
+ init_types5();
439898
439879
  init_modelAvailabilityService();
439899
439880
  init_modelRouterService();
439900
439881
  init_types17();
@@ -439907,7 +439888,7 @@ var init_config4 = __esm({
439907
439888
  init_ignorePatterns();
439908
439889
  init_message_bus();
439909
439890
  init_policy_engine();
439910
- init_types2();
439891
+ init_types();
439911
439892
  init_hooks();
439912
439893
  init_codeAssist();
439913
439894
  init_experiments();
@@ -440476,6 +440457,9 @@ var init_config4 = __esm({
440476
440457
  coreEvents.emitAdminSettingsChanged();
440477
440458
  });
440478
440459
  this.setRemoteAdminSettings(adminControls);
440460
+ if (await this.getProModelNoAccess() && isAutoModel(this.model)) {
440461
+ this.setModel(PREVIEW_GEMINI_FLASH_MODEL);
440462
+ }
440479
440463
  }
440480
440464
  async getExperimentsAsync() {
440481
440465
  if (this.experiments) {
@@ -441347,6 +441331,25 @@ var init_config4 = __esm({
441347
441331
  await this.ensureExperimentsLoaded();
441348
441332
  return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]?.stringValue ?? "";
441349
441333
  }
441334
+ /**
441335
+ * Returns whether the user has access to Pro models.
441336
+ * This is determined by the PRO_MODEL_NO_ACCESS experiment flag.
441337
+ */
441338
+ async getProModelNoAccess() {
441339
+ await this.ensureExperimentsLoaded();
441340
+ return this.getProModelNoAccessSync();
441341
+ }
441342
+ /**
441343
+ * Returns whether the user has access to Pro models synchronously.
441344
+ *
441345
+ * Note: This method should only be called after startup, once experiments have been loaded.
441346
+ */
441347
+ getProModelNoAccessSync() {
441348
+ if (this.contentGeneratorConfig?.authType !== AuthType2.LOGIN_WITH_GOOGLE) {
441349
+ return false;
441350
+ }
441351
+ return this.experiments?.flags[ExperimentFlags.PRO_MODEL_NO_ACCESS]?.boolValue ?? false;
441352
+ }
441350
441353
  /**
441351
441354
  * Returns whether Gemini 3.1 has been launched.
441352
441355
  * This method is async and ensures that experiments are loaded before returning the result.
@@ -446824,7 +446827,7 @@ var init_sessionSummaryService = __esm({
446824
446827
  init_geminiRequest();
446825
446828
  init_debugLogger();
446826
446829
  init_partUtils();
446827
- init_types6();
446830
+ init_types5();
446828
446831
  DEFAULT_MAX_MESSAGES = 20;
446829
446832
  DEFAULT_TIMEOUT_MS = 5e3;
446830
446833
  MAX_MESSAGE_LENGTH = 500;
@@ -447270,7 +447273,7 @@ var init_read_many_files = __esm({
447270
447273
  init_metrics2();
447271
447274
  init_telemetry_utils();
447272
447275
  init_loggers();
447273
- init_types6();
447276
+ init_types5();
447274
447277
  init_tool_error();
447275
447278
  init_tool_names();
447276
447279
  init_coreTools();
@@ -447730,13 +447733,13 @@ var init_src2 = __esm({
447730
447733
  init_types17();
447731
447734
  init_json_formatter();
447732
447735
  init_stream_json_formatter();
447733
- init_types2();
447736
+ init_types();
447734
447737
  init_policy_engine();
447735
447738
  init_toml_loader();
447736
447739
  init_config3();
447737
447740
  init_integrity();
447738
447741
  init_billing2();
447739
- init_types4();
447742
+ init_types3();
447740
447743
  init_message_bus();
447741
447744
  init_extensions();
447742
447745
  init_restore();
@@ -447755,7 +447758,7 @@ var init_src2 = __esm({
447755
447758
  init_geminiRequest();
447756
447759
  init_coreToolScheduler();
447757
447760
  init_scheduler2();
447758
- init_types3();
447761
+ init_types2();
447759
447762
  init_tool_executor();
447760
447763
  init_recordingContentGenerator();
447761
447764
  init_types20();
@@ -447794,7 +447797,7 @@ var init_src2 = __esm({
447794
447797
  init_fileDiffUtils();
447795
447798
  init_retry();
447796
447799
  init_shell_utils();
447797
- init_types2();
447800
+ init_types();
447798
447801
  init_tool_utils();
447799
447802
  init_terminalSerializer();
447800
447803
  init_systemEncoding();
@@ -448141,6 +448144,7 @@ __export(dist_exports, {
448141
448144
  ExtensionLoader: () => ExtensionLoader,
448142
448145
  ExtensionUninstallEvent: () => ExtensionUninstallEvent,
448143
448146
  ExtensionUpdateEvent: () => ExtensionUpdateEvent,
448147
+ FORCE_FILE_STORAGE_ENV_VAR: () => FORCE_FILE_STORAGE_ENV_VAR,
448144
448148
  FRONTMATTER_REGEX: () => FRONTMATTER_REGEX,
448145
448149
  FatalAuthenticationError: () => FatalAuthenticationError,
448146
448150
  FatalCancellationError: () => FatalCancellationError,
@@ -448310,6 +448314,7 @@ __export(dist_exports, {
448310
448314
  PLAN_MODE_PARAM_REASON: () => PLAN_MODE_PARAM_REASON,
448311
448315
  PLAN_MODE_TOOLS: () => PLAN_MODE_TOOLS,
448312
448316
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL: () => PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
448317
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL: () => PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
448313
448318
  PREVIEW_GEMINI_3_1_MODEL: () => PREVIEW_GEMINI_3_1_MODEL,
448314
448319
  PREVIEW_GEMINI_FLASH_MODEL: () => PREVIEW_GEMINI_FLASH_MODEL,
448315
448320
  PREVIEW_GEMINI_MODEL: () => PREVIEW_GEMINI_MODEL,
@@ -448865,7 +448870,7 @@ var init_dist7 = __esm({
448865
448870
  init_config4();
448866
448871
  init_detect_ide();
448867
448872
  init_loggers();
448868
- init_types6();
448873
+ init_types5();
448869
448874
  init_config5();
448870
448875
  init_pathReader();
448871
448876
  init_clearcut_logger();
@@ -528081,7 +528086,7 @@ var WarningMessage = ({ text }) => {
528081
528086
  };
528082
528087
 
528083
528088
  // packages/cli/src/generated/git-commit.ts
528084
- var GIT_COMMIT_INFO2 = "62a4d375a";
528089
+ var GIT_COMMIT_INFO2 = "49a86550c";
528085
528090
 
528086
528091
  // packages/cli/src/ui/components/AboutBox.tsx
528087
528092
  init_dist7();
@@ -542392,8 +542397,24 @@ var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
542392
542397
  function ModelDialog({ onClose }) {
542393
542398
  const config2 = (0, import_react105.useContext)(ConfigContext);
542394
542399
  const settings = useSettings();
542395
- const [view, setView] = (0, import_react105.useState)("main");
542400
+ const [hasAccessToProModel, setHasAccessToProModel] = (0, import_react105.useState)(
542401
+ () => !(config2?.getProModelNoAccessSync() ?? false)
542402
+ );
542403
+ const [view, setView] = (0, import_react105.useState)(
542404
+ () => config2?.getProModelNoAccessSync() ? "manual" : "main"
542405
+ );
542396
542406
  const [persistMode, setPersistMode] = (0, import_react105.useState)(false);
542407
+ (0, import_react105.useEffect)(() => {
542408
+ async function checkAccess() {
542409
+ if (!config2) return;
542410
+ const noAccess = await config2.getProModelNoAccess();
542411
+ setHasAccessToProModel(!noAccess);
542412
+ if (noAccess) {
542413
+ setView("manual");
542414
+ }
542415
+ }
542416
+ void checkAccess();
542417
+ }, [config2]);
542397
542418
  const preferredModel = config2?.getModel() || DEFAULT_GEMINI_MODEL_AUTO;
542398
542419
  const shouldShowPreviewModels = config2?.getHasAccessToPreviewModel();
542399
542420
  const useGemini31 = config2?.getGemini31LaunchedSync?.() ?? false;
@@ -542417,7 +542438,7 @@ function ModelDialog({ onClose }) {
542417
542438
  useKeypress(
542418
542439
  (key) => {
542419
542440
  if (key.name === "escape") {
542420
- if (view === "manual") {
542441
+ if (view === "manual" && hasAccessToProModel) {
542421
542442
  setView("main");
542422
542443
  } else {
542423
542444
  onClose();
@@ -542458,6 +542479,7 @@ function ModelDialog({ onClose }) {
542458
542479
  return list;
542459
542480
  }, [shouldShowPreviewModels, manualModelSelected, useGemini31]);
542460
542481
  const manualOptions = (0, import_react105.useMemo)(() => {
542482
+ const isFreeTier = config2?.getUserTier() === UserTierId.FREE;
542461
542483
  const list = [
542462
542484
  {
542463
542485
  value: DEFAULT_GEMINI_MODEL,
@@ -542478,7 +542500,7 @@ function ModelDialog({ onClose }) {
542478
542500
  if (shouldShowPreviewModels) {
542479
542501
  const previewProModel = useGemini31 ? PREVIEW_GEMINI_3_1_MODEL : PREVIEW_GEMINI_MODEL;
542480
542502
  const previewProValue = useCustomToolModel ? PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL : previewProModel;
542481
- list.unshift(
542503
+ const previewOptions = [
542482
542504
  {
542483
542505
  value: previewProValue,
542484
542506
  title: getDisplayString(previewProModel),
@@ -542489,10 +542511,27 @@ function ModelDialog({ onClose }) {
542489
542511
  title: getDisplayString(PREVIEW_GEMINI_FLASH_MODEL),
542490
542512
  key: PREVIEW_GEMINI_FLASH_MODEL
542491
542513
  }
542492
- );
542514
+ ];
542515
+ if (isFreeTier) {
542516
+ previewOptions.push({
542517
+ value: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
542518
+ title: getDisplayString(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL),
542519
+ key: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL
542520
+ });
542521
+ }
542522
+ list.unshift(...previewOptions);
542523
+ }
542524
+ if (!hasAccessToProModel) {
542525
+ return list.filter((option2) => !isProModel(option2.value));
542493
542526
  }
542494
542527
  return list;
542495
- }, [shouldShowPreviewModels, useGemini31, useCustomToolModel]);
542528
+ }, [
542529
+ shouldShowPreviewModels,
542530
+ useGemini31,
542531
+ useCustomToolModel,
542532
+ hasAccessToProModel,
542533
+ config2
542534
+ ]);
542496
542535
  const options = view === "main" ? mainOptions : manualOptions;
542497
542536
  const initialIndex = (0, import_react105.useMemo)(() => {
542498
542537
  const idx = options.findIndex((option2) => option2.value === preferredModel);
@@ -576962,7 +577001,7 @@ async function loadSandboxConfig(settings, argv) {
576962
577001
  const sandboxOption = argv.sandbox ?? settings.tools?.sandbox;
576963
577002
  const command2 = getSandboxCommand(sandboxOption);
576964
577003
  const packageJson2 = await getPackageJson(__dirname13);
576965
- const image3 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.34.0-preview.2" ?? packageJson2?.config?.sandboxImageUri;
577004
+ const image3 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.34.0-preview.4" ?? packageJson2?.config?.sandboxImageUri;
576966
577005
  return command2 && image3 ? { command: command2, image: image3 } : void 0;
576967
577006
  }
576968
577007
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/gemini-cli-devtools",
3
- "version": "0.34.0-preview.2",
3
+ "version": "0.34.0-preview.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/gemini-cli",
3
- "version": "0.34.0-preview.2",
3
+ "version": "0.34.0-preview.4",
4
4
  "description": "Gemini CLI",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {