@google/gemini-cli-a2a-server 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.
@@ -94139,161 +94139,6 @@ var init_base_token_storage = __esm({
94139
94139
  }
94140
94140
  });
94141
94141
 
94142
- // packages/core/dist/src/mcp/token-storage/file-token-storage.js
94143
- import { promises as fs16 } from "node:fs";
94144
- import * as path9 from "node:path";
94145
- import * as os6 from "node:os";
94146
- import * as crypto11 from "node:crypto";
94147
- var FileTokenStorage;
94148
- var init_file_token_storage = __esm({
94149
- "packages/core/dist/src/mcp/token-storage/file-token-storage.js"() {
94150
- "use strict";
94151
- init_base_token_storage();
94152
- init_paths();
94153
- FileTokenStorage = class extends BaseTokenStorage {
94154
- tokenFilePath;
94155
- encryptionKey;
94156
- constructor(serviceName) {
94157
- super(serviceName);
94158
- const configDir = path9.join(homedir(), GEMINI_DIR);
94159
- this.tokenFilePath = path9.join(configDir, "mcp-oauth-tokens-v2.json");
94160
- this.encryptionKey = this.deriveEncryptionKey();
94161
- }
94162
- deriveEncryptionKey() {
94163
- const salt = `${os6.hostname()}-${os6.userInfo().username}-gemini-cli`;
94164
- return crypto11.scryptSync("gemini-cli-oauth", salt, 32);
94165
- }
94166
- encrypt(text) {
94167
- const iv = crypto11.randomBytes(16);
94168
- const cipher = crypto11.createCipheriv("aes-256-gcm", this.encryptionKey, iv);
94169
- let encrypted = cipher.update(text, "utf8", "hex");
94170
- encrypted += cipher.final("hex");
94171
- const authTag = cipher.getAuthTag();
94172
- return iv.toString("hex") + ":" + authTag.toString("hex") + ":" + encrypted;
94173
- }
94174
- decrypt(encryptedData) {
94175
- const parts2 = encryptedData.split(":");
94176
- if (parts2.length !== 3) {
94177
- throw new Error("Invalid encrypted data format");
94178
- }
94179
- const iv = Buffer.from(parts2[0], "hex");
94180
- const authTag = Buffer.from(parts2[1], "hex");
94181
- const encrypted = parts2[2];
94182
- const decipher = crypto11.createDecipheriv("aes-256-gcm", this.encryptionKey, iv);
94183
- decipher.setAuthTag(authTag);
94184
- let decrypted = decipher.update(encrypted, "hex", "utf8");
94185
- decrypted += decipher.final("utf8");
94186
- return decrypted;
94187
- }
94188
- async ensureDirectoryExists() {
94189
- const dir = path9.dirname(this.tokenFilePath);
94190
- await fs16.mkdir(dir, { recursive: true, mode: 448 });
94191
- }
94192
- async loadTokens() {
94193
- try {
94194
- const data = await fs16.readFile(this.tokenFilePath, "utf-8");
94195
- const decrypted = this.decrypt(data);
94196
- const tokens = JSON.parse(decrypted);
94197
- return new Map(Object.entries(tokens));
94198
- } catch (error2) {
94199
- const err2 = error2;
94200
- if (err2.code === "ENOENT") {
94201
- return /* @__PURE__ */ new Map();
94202
- }
94203
- if (err2.message?.includes("Invalid encrypted data format") || err2.message?.includes("Unsupported state or unable to authenticate data")) {
94204
- throw new Error(`Corrupted token file detected at: ${this.tokenFilePath}
94205
- Please delete or rename this file to resolve the issue.`);
94206
- }
94207
- throw error2;
94208
- }
94209
- }
94210
- async saveTokens(tokens) {
94211
- await this.ensureDirectoryExists();
94212
- const data = Object.fromEntries(tokens);
94213
- const json2 = JSON.stringify(data, null, 2);
94214
- const encrypted = this.encrypt(json2);
94215
- await fs16.writeFile(this.tokenFilePath, encrypted, { mode: 384 });
94216
- }
94217
- async getCredentials(serverName) {
94218
- const tokens = await this.loadTokens();
94219
- const credentials2 = tokens.get(serverName);
94220
- if (!credentials2) {
94221
- return null;
94222
- }
94223
- if (this.isTokenExpired(credentials2)) {
94224
- return null;
94225
- }
94226
- return credentials2;
94227
- }
94228
- async setCredentials(credentials2) {
94229
- this.validateCredentials(credentials2);
94230
- const tokens = await this.loadTokens();
94231
- const updatedCredentials = {
94232
- ...credentials2,
94233
- updatedAt: Date.now()
94234
- };
94235
- tokens.set(credentials2.serverName, updatedCredentials);
94236
- await this.saveTokens(tokens);
94237
- }
94238
- async deleteCredentials(serverName) {
94239
- const tokens = await this.loadTokens();
94240
- if (!tokens.has(serverName)) {
94241
- throw new Error(`No credentials found for ${serverName}`);
94242
- }
94243
- tokens.delete(serverName);
94244
- if (tokens.size === 0) {
94245
- try {
94246
- await fs16.unlink(this.tokenFilePath);
94247
- } catch (error2) {
94248
- const err2 = error2;
94249
- if (err2.code !== "ENOENT") {
94250
- throw error2;
94251
- }
94252
- }
94253
- } else {
94254
- await this.saveTokens(tokens);
94255
- }
94256
- }
94257
- async listServers() {
94258
- const tokens = await this.loadTokens();
94259
- return Array.from(tokens.keys());
94260
- }
94261
- async getAllCredentials() {
94262
- const tokens = await this.loadTokens();
94263
- const result2 = /* @__PURE__ */ new Map();
94264
- for (const [serverName, credentials2] of tokens) {
94265
- if (!this.isTokenExpired(credentials2)) {
94266
- result2.set(serverName, credentials2);
94267
- }
94268
- }
94269
- return result2;
94270
- }
94271
- async clearAll() {
94272
- try {
94273
- await fs16.unlink(this.tokenFilePath);
94274
- } catch (error2) {
94275
- const err2 = error2;
94276
- if (err2.code !== "ENOENT") {
94277
- throw error2;
94278
- }
94279
- }
94280
- }
94281
- };
94282
- }
94283
- });
94284
-
94285
- // packages/core/dist/src/mcp/token-storage/types.js
94286
- var TokenStorageType;
94287
- var init_types = __esm({
94288
- "packages/core/dist/src/mcp/token-storage/types.js"() {
94289
- "use strict";
94290
- (function(TokenStorageType2) {
94291
- TokenStorageType2["KEYCHAIN"] = "keychain";
94292
- TokenStorageType2["ENCRYPTED_FILE"] = "encrypted_file";
94293
- })(TokenStorageType || (TokenStorageType = {}));
94294
- }
94295
- });
94296
-
94297
94142
  // packages/core/dist/src/utils/events.js
94298
94143
  import { EventEmitter as EventEmitter2 } from "node:events";
94299
94144
  var CoreEvent, CoreEventEmitter, coreEvents;
@@ -94477,7 +94322,7 @@ var init_events = __esm({
94477
94322
 
94478
94323
  // packages/core/dist/src/policy/types.js
94479
94324
  var PolicyDecision, ApprovalMode, InProcessCheckerType, PRIORITY_SUBAGENT_TOOL;
94480
- var init_types2 = __esm({
94325
+ var init_types = __esm({
94481
94326
  "packages/core/dist/src/policy/types.js"() {
94482
94327
  "use strict";
94483
94328
  (function(PolicyDecision2) {
@@ -94501,10 +94346,10 @@ var init_types2 = __esm({
94501
94346
 
94502
94347
  // packages/core/dist/src/scheduler/types.js
94503
94348
  var ROOT_SCHEDULER_ID, CoreToolCallStatus;
94504
- var init_types3 = __esm({
94349
+ var init_types2 = __esm({
94505
94350
  "packages/core/dist/src/scheduler/types.js"() {
94506
94351
  "use strict";
94507
- init_types2();
94352
+ init_types();
94508
94353
  ROOT_SCHEDULER_ID = "root";
94509
94354
  (function(CoreToolCallStatus2) {
94510
94355
  CoreToolCallStatus2["Validating"] = "validating";
@@ -107903,7 +107748,7 @@ var init_schemaValidator = __esm({
107903
107748
 
107904
107749
  // packages/core/dist/src/confirmation-bus/types.js
107905
107750
  var MessageBusType, QuestionType;
107906
- var init_types4 = __esm({
107751
+ var init_types3 = __esm({
107907
107752
  "packages/core/dist/src/confirmation-bus/types.js"() {
107908
107753
  "use strict";
107909
107754
  init_node();
@@ -107998,8 +107843,8 @@ var init_tools = __esm({
107998
107843
  "use strict";
107999
107844
  init_tool_error();
108000
107845
  init_schemaValidator();
108001
- init_types4();
108002
- init_types2();
107846
+ init_types3();
107847
+ init_types();
108003
107848
  BaseToolInvocation = class {
108004
107849
  params;
108005
107850
  messageBus;
@@ -108920,7 +108765,7 @@ var init_ComponentLogger = __esm({
108920
108765
 
108921
108766
  // node_modules/@opentelemetry/api/build/esm/diag/types.js
108922
108767
  var DiagLogLevel;
108923
- var init_types5 = __esm({
108768
+ var init_types4 = __esm({
108924
108769
  "node_modules/@opentelemetry/api/build/esm/diag/types.js"() {
108925
108770
  (function(DiagLogLevel2) {
108926
108771
  DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
@@ -108960,7 +108805,7 @@ function createLogLevelDiagLogger(maxLevel, logger7) {
108960
108805
  }
108961
108806
  var init_logLevelLogger = __esm({
108962
108807
  "node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js"() {
108963
- init_types5();
108808
+ init_types4();
108964
108809
  }
108965
108810
  });
108966
108811
 
@@ -108970,7 +108815,7 @@ var init_diag = __esm({
108970
108815
  "node_modules/@opentelemetry/api/build/esm/api/diag.js"() {
108971
108816
  init_ComponentLogger();
108972
108817
  init_logLevelLogger();
108973
- init_types5();
108818
+ init_types4();
108974
108819
  init_global_utils();
108975
108820
  __read2 = function(o3, n3) {
108976
108821
  var m3 = typeof Symbol === "function" && o3[Symbol.iterator];
@@ -110279,7 +110124,7 @@ var init_esm = __esm({
110279
110124
  init_utils();
110280
110125
  init_context();
110281
110126
  init_consoleLogger();
110282
- init_types5();
110127
+ init_types4();
110283
110128
  init_NoopMeter();
110284
110129
  init_Metric();
110285
110130
  init_TextMapPropagator();
@@ -110341,9 +110186,9 @@ var init_constants = __esm({
110341
110186
  });
110342
110187
 
110343
110188
  // packages/core/dist/src/utils/installationManager.js
110344
- import * as fs17 from "node:fs";
110189
+ import * as fs16 from "node:fs";
110345
110190
  import { randomUUID as randomUUID4 } from "node:crypto";
110346
- import * as path10 from "node:path";
110191
+ import * as path9 from "node:path";
110347
110192
  var InstallationManager;
110348
110193
  var init_installationManager = __esm({
110349
110194
  "packages/core/dist/src/utils/installationManager.js"() {
@@ -110356,17 +110201,17 @@ var init_installationManager = __esm({
110356
110201
  }
110357
110202
  readInstallationIdFromFile() {
110358
110203
  const installationIdFile = this.getInstallationIdPath();
110359
- if (fs17.existsSync(installationIdFile)) {
110360
- const installationid = fs17.readFileSync(installationIdFile, "utf-8").trim();
110204
+ if (fs16.existsSync(installationIdFile)) {
110205
+ const installationid = fs16.readFileSync(installationIdFile, "utf-8").trim();
110361
110206
  return installationid || null;
110362
110207
  }
110363
110208
  return null;
110364
110209
  }
110365
110210
  writeInstallationIdToFile(installationId) {
110366
110211
  const installationIdFile = this.getInstallationIdPath();
110367
- const dir = path10.dirname(installationIdFile);
110368
- fs17.mkdirSync(dir, { recursive: true });
110369
- fs17.writeFileSync(installationIdFile, installationId, "utf-8");
110212
+ const dir = path9.dirname(installationIdFile);
110213
+ fs16.mkdirSync(dir, { recursive: true });
110214
+ fs16.writeFileSync(installationIdFile, installationId, "utf-8");
110370
110215
  }
110371
110216
  /**
110372
110217
  * Retrieves the installation ID from a file, creating it if it doesn't exist.
@@ -113702,10 +113547,10 @@ function makeChatCompressionEvent({ tokens_before, tokens_after }) {
113702
113547
  };
113703
113548
  }
113704
113549
  var 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, SlashCommandStatus, EVENT_CHAT_COMPRESSION2, EVENT_MALFORMED_JSON_RESPONSE, MalformedJsonResponseEvent, IdeConnectionType, EVENT_FILE_OPERATION, FileOperationEvent, EVENT_INVALID_CHUNK, InvalidChunkEvent, EVENT_CONTENT_RETRY, ContentRetryEvent, EVENT_CONTENT_RETRY_FAILURE, ContentRetryFailureEvent, EVENT_MODEL_ROUTING, ModelRoutingEvent, EVENT_TOOL_OUTPUT_TRUNCATED, ToolOutputTruncatedEvent, EVENT_TOOL_OUTPUT_MASKING, ToolOutputMaskingEvent, EVENT_LLM_LOOP_CHECK, LlmLoopCheckEvent, 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;
113705
- var init_types6 = __esm({
113550
+ var init_types5 = __esm({
113706
113551
  "packages/core/dist/src/telemetry/types.js"() {
113707
113552
  "use strict";
113708
- init_types3();
113553
+ init_types2();
113709
113554
  init_mcp_tool();
113710
113555
  init_contentGenerator();
113711
113556
  init_tool_call_decision();
@@ -115677,7 +115522,7 @@ function custom(check2, _params = {}, fatal) {
115677
115522
  return ZodAny.create();
115678
115523
  }
115679
115524
  var ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, 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;
115680
- var init_types7 = __esm({
115525
+ var init_types6 = __esm({
115681
115526
  "node_modules/zod/v3/types.js"() {
115682
115527
  init_ZodError();
115683
115528
  init_errors2();
@@ -119057,7 +118902,7 @@ var init_external = __esm({
119057
118902
  init_parseUtil();
119058
118903
  init_typeAliases();
119059
118904
  init_util();
119060
- init_types7();
118905
+ init_types6();
119061
118906
  init_ZodError();
119062
118907
  }
119063
118908
  });
@@ -119179,17 +119024,137 @@ var init_markdownUtils = __esm({
119179
119024
  }
119180
119025
  });
119181
119026
 
119027
+ // packages/core/dist/src/services/fileKeychain.js
119028
+ import { promises as fs17 } from "node:fs";
119029
+ import * as path10 from "node:path";
119030
+ import * as os6 from "node:os";
119031
+ import * as crypto11 from "node:crypto";
119032
+ var FileKeychain;
119033
+ var init_fileKeychain = __esm({
119034
+ "packages/core/dist/src/services/fileKeychain.js"() {
119035
+ "use strict";
119036
+ init_paths();
119037
+ FileKeychain = class {
119038
+ tokenFilePath;
119039
+ encryptionKey;
119040
+ constructor() {
119041
+ const configDir = path10.join(homedir(), GEMINI_DIR);
119042
+ this.tokenFilePath = path10.join(configDir, "gemini-credentials.json");
119043
+ this.encryptionKey = this.deriveEncryptionKey();
119044
+ }
119045
+ deriveEncryptionKey() {
119046
+ const salt = `${os6.hostname()}-${os6.userInfo().username}-gemini-cli`;
119047
+ return crypto11.scryptSync("gemini-cli-oauth", salt, 32);
119048
+ }
119049
+ encrypt(text) {
119050
+ const iv = crypto11.randomBytes(16);
119051
+ const cipher = crypto11.createCipheriv("aes-256-gcm", this.encryptionKey, iv);
119052
+ let encrypted = cipher.update(text, "utf8", "hex");
119053
+ encrypted += cipher.final("hex");
119054
+ const authTag = cipher.getAuthTag();
119055
+ return iv.toString("hex") + ":" + authTag.toString("hex") + ":" + encrypted;
119056
+ }
119057
+ decrypt(encryptedData) {
119058
+ const parts2 = encryptedData.split(":");
119059
+ if (parts2.length !== 3) {
119060
+ throw new Error("Invalid encrypted data format");
119061
+ }
119062
+ const iv = Buffer.from(parts2[0], "hex");
119063
+ const authTag = Buffer.from(parts2[1], "hex");
119064
+ const encrypted = parts2[2];
119065
+ const decipher = crypto11.createDecipheriv("aes-256-gcm", this.encryptionKey, iv);
119066
+ decipher.setAuthTag(authTag);
119067
+ let decrypted = decipher.update(encrypted, "hex", "utf8");
119068
+ decrypted += decipher.final("utf8");
119069
+ return decrypted;
119070
+ }
119071
+ async ensureDirectoryExists() {
119072
+ const dir = path10.dirname(this.tokenFilePath);
119073
+ await fs17.mkdir(dir, { recursive: true, mode: 448 });
119074
+ }
119075
+ async loadData() {
119076
+ try {
119077
+ const data = await fs17.readFile(this.tokenFilePath, "utf-8");
119078
+ const decrypted = this.decrypt(data);
119079
+ return JSON.parse(decrypted);
119080
+ } catch (error2) {
119081
+ const err2 = error2;
119082
+ if (err2.code === "ENOENT") {
119083
+ return {};
119084
+ }
119085
+ if (err2.message?.includes("Invalid encrypted data format") || err2.message?.includes("Unsupported state or unable to authenticate data")) {
119086
+ throw new Error(`Corrupted credentials file detected at: ${this.tokenFilePath}
119087
+ Please delete or rename this file to resolve the issue.`);
119088
+ }
119089
+ throw error2;
119090
+ }
119091
+ }
119092
+ async saveData(data) {
119093
+ await this.ensureDirectoryExists();
119094
+ const json2 = JSON.stringify(data, null, 2);
119095
+ const encrypted = this.encrypt(json2);
119096
+ await fs17.writeFile(this.tokenFilePath, encrypted, { mode: 384 });
119097
+ }
119098
+ async getPassword(service, account) {
119099
+ const data = await this.loadData();
119100
+ return data[service]?.[account] ?? null;
119101
+ }
119102
+ async setPassword(service, account, password) {
119103
+ const data = await this.loadData();
119104
+ if (!data[service]) {
119105
+ data[service] = {};
119106
+ }
119107
+ data[service][account] = password;
119108
+ await this.saveData(data);
119109
+ }
119110
+ async deletePassword(service, account) {
119111
+ const data = await this.loadData();
119112
+ if (data[service] && account in data[service]) {
119113
+ delete data[service][account];
119114
+ if (Object.keys(data[service]).length === 0) {
119115
+ delete data[service];
119116
+ }
119117
+ if (Object.keys(data).length === 0) {
119118
+ try {
119119
+ await fs17.unlink(this.tokenFilePath);
119120
+ } catch (error2) {
119121
+ const err2 = error2;
119122
+ if (err2.code !== "ENOENT") {
119123
+ throw error2;
119124
+ }
119125
+ }
119126
+ } else {
119127
+ await this.saveData(data);
119128
+ }
119129
+ return true;
119130
+ }
119131
+ return false;
119132
+ }
119133
+ async findCredentials(service) {
119134
+ const data = await this.loadData();
119135
+ const serviceData = data[service] || {};
119136
+ return Object.entries(serviceData).map(([account, password]) => ({
119137
+ account,
119138
+ password
119139
+ }));
119140
+ }
119141
+ };
119142
+ }
119143
+ });
119144
+
119182
119145
  // packages/core/dist/src/services/keychainService.js
119183
119146
  import * as crypto12 from "node:crypto";
119184
- var KeychainService;
119147
+ var FORCE_FILE_STORAGE_ENV_VAR, KeychainService;
119185
119148
  var init_keychainService = __esm({
119186
119149
  "packages/core/dist/src/services/keychainService.js"() {
119187
119150
  "use strict";
119188
119151
  init_events();
119189
- init_types6();
119152
+ init_types5();
119190
119153
  init_debugLogger();
119191
119154
  init_keychainTypes();
119192
119155
  init_markdownUtils();
119156
+ init_fileKeychain();
119157
+ FORCE_FILE_STORAGE_ENV_VAR = "GEMINI_FORCE_FILE_STORAGE";
119193
119158
  KeychainService = class {
119194
119159
  serviceName;
119195
119160
  // Track an ongoing initialization attempt to avoid race conditions.
@@ -119203,6 +119168,13 @@ var init_keychainService = __esm({
119203
119168
  async isAvailable() {
119204
119169
  return await this.getKeychain() !== null;
119205
119170
  }
119171
+ /**
119172
+ * Returns true if the service is using the encrypted file fallback backend.
119173
+ */
119174
+ async isUsingFileFallback() {
119175
+ const keychain = await this.getKeychain();
119176
+ return keychain instanceof FileKeychain;
119177
+ }
119206
119178
  /**
119207
119179
  * Retrieves a secret for the given account.
119208
119180
  * @throws Error if the keychain is unavailable.
@@ -119249,20 +119221,27 @@ var init_keychainService = __esm({
119249
119221
  // High-level orchestration of the loading and testing cycle.
119250
119222
  async initializeKeychain() {
119251
119223
  let resultKeychain = null;
119252
- try {
119253
- const keychainModule = await this.loadKeychainModule();
119254
- if (keychainModule) {
119255
- if (await this.isKeychainFunctional(keychainModule)) {
119256
- resultKeychain = keychainModule;
119257
- } else {
119258
- debugLogger.log("Keychain functional verification failed");
119224
+ const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
119225
+ if (!forceFileStorage) {
119226
+ try {
119227
+ const keychainModule = await this.loadKeychainModule();
119228
+ if (keychainModule) {
119229
+ if (await this.isKeychainFunctional(keychainModule)) {
119230
+ resultKeychain = keychainModule;
119231
+ } else {
119232
+ debugLogger.log("Keychain functional verification failed");
119233
+ }
119259
119234
  }
119235
+ } catch (error2) {
119236
+ const message = error2 instanceof Error ? error2.message : String(error2);
119237
+ debugLogger.log("Keychain initialization encountered an error:", message);
119260
119238
  }
119261
- } catch (error2) {
119262
- const message = error2 instanceof Error ? error2.message : String(error2);
119263
- debugLogger.log("Keychain initialization encountered an error:", message);
119264
119239
  }
119265
- coreEvents.emitTelemetryKeychainAvailability(new KeychainAvailabilityEvent(resultKeychain !== null));
119240
+ coreEvents.emitTelemetryKeychainAvailability(new KeychainAvailabilityEvent(resultKeychain !== null && !forceFileStorage));
119241
+ if (!resultKeychain) {
119242
+ resultKeychain = new FileKeychain();
119243
+ debugLogger.log("Using FileKeychain fallback for secure storage.");
119244
+ }
119266
119245
  return resultKeychain;
119267
119246
  }
119268
119247
  // Low-level dynamic loading and structural validation.
@@ -119291,10 +119270,6 @@ var init_keychainService = __esm({
119291
119270
  });
119292
119271
 
119293
119272
  // packages/core/dist/src/mcp/token-storage/keychain-token-storage.js
119294
- var keychain_token_storage_exports = {};
119295
- __export(keychain_token_storage_exports, {
119296
- KeychainTokenStorage: () => KeychainTokenStorage
119297
- });
119298
119273
  var KeychainTokenStorage;
119299
119274
  var init_keychain_token_storage = __esm({
119300
119275
  "packages/core/dist/src/mcp/token-storage/keychain-token-storage.js"() {
@@ -119395,6 +119370,9 @@ var init_keychain_token_storage = __esm({
119395
119370
  async isAvailable() {
119396
119371
  return this.keychainService.isAvailable();
119397
119372
  }
119373
+ async isUsingFileFallback() {
119374
+ return this.keychainService.isUsingFileFallback();
119375
+ }
119398
119376
  async setSecret(key, value) {
119399
119377
  await this.keychainService.setPassword(`${SECRET_PREFIX}${key}`, value);
119400
119378
  }
@@ -119420,17 +119398,29 @@ var init_keychain_token_storage = __esm({
119420
119398
  }
119421
119399
  });
119422
119400
 
119401
+ // packages/core/dist/src/mcp/token-storage/types.js
119402
+ var TokenStorageType;
119403
+ var init_types7 = __esm({
119404
+ "packages/core/dist/src/mcp/token-storage/types.js"() {
119405
+ "use strict";
119406
+ (function(TokenStorageType2) {
119407
+ TokenStorageType2["KEYCHAIN"] = "keychain";
119408
+ TokenStorageType2["ENCRYPTED_FILE"] = "encrypted_file";
119409
+ })(TokenStorageType || (TokenStorageType = {}));
119410
+ }
119411
+ });
119412
+
119423
119413
  // packages/core/dist/src/mcp/token-storage/hybrid-token-storage.js
119424
- var FORCE_FILE_STORAGE_ENV_VAR, HybridTokenStorage;
119414
+ var HybridTokenStorage;
119425
119415
  var init_hybrid_token_storage = __esm({
119426
119416
  "packages/core/dist/src/mcp/token-storage/hybrid-token-storage.js"() {
119427
119417
  "use strict";
119428
119418
  init_base_token_storage();
119429
- init_file_token_storage();
119430
- init_types();
119419
+ init_keychain_token_storage();
119420
+ init_types7();
119431
119421
  init_events();
119432
- init_types6();
119433
- FORCE_FILE_STORAGE_ENV_VAR = "GEMINI_FORCE_FILE_STORAGE";
119422
+ init_types5();
119423
+ init_keychainService();
119434
119424
  HybridTokenStorage = class extends BaseTokenStorage {
119435
119425
  storage = null;
119436
119426
  storageType = null;
@@ -119440,23 +119430,11 @@ var init_hybrid_token_storage = __esm({
119440
119430
  }
119441
119431
  async initializeStorage() {
119442
119432
  const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
119443
- if (!forceFileStorage) {
119444
- try {
119445
- const { KeychainTokenStorage: KeychainTokenStorage2 } = await Promise.resolve().then(() => (init_keychain_token_storage(), keychain_token_storage_exports));
119446
- const keychainStorage = new KeychainTokenStorage2(this.serviceName);
119447
- const isAvailable = await keychainStorage.isAvailable();
119448
- if (isAvailable) {
119449
- this.storage = keychainStorage;
119450
- this.storageType = TokenStorageType.KEYCHAIN;
119451
- coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent("keychain", forceFileStorage));
119452
- return this.storage;
119453
- }
119454
- } catch (_e2) {
119455
- }
119456
- }
119457
- this.storage = new FileTokenStorage(this.serviceName);
119458
- this.storageType = TokenStorageType.ENCRYPTED_FILE;
119459
- coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent("encrypted_file", forceFileStorage));
119433
+ const keychainStorage = new KeychainTokenStorage(this.serviceName);
119434
+ this.storage = keychainStorage;
119435
+ const isUsingFileFallback = await keychainStorage.isUsingFileFallback();
119436
+ this.storageType = isUsingFileFallback ? TokenStorageType.ENCRYPTED_FILE : TokenStorageType.KEYCHAIN;
119437
+ coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent(isUsingFileFallback ? "encrypted_file" : "keychain", forceFileStorage));
119460
119438
  return this.storage;
119461
119439
  }
119462
119440
  async getStorage() {
@@ -119604,10 +119582,10 @@ var DEFAULT_SERVICE_NAME, FORCE_ENCRYPTED_FILE_ENV_VAR;
119604
119582
  var init_token_storage = __esm({
119605
119583
  "packages/core/dist/src/mcp/token-storage/index.js"() {
119606
119584
  "use strict";
119607
- init_types();
119585
+ init_types7();
119608
119586
  init_base_token_storage();
119609
- init_file_token_storage();
119610
119587
  init_hybrid_token_storage();
119588
+ init_keychain_token_storage();
119611
119589
  DEFAULT_SERVICE_NAME = "gemini-cli-oauth";
119612
119590
  FORCE_ENCRYPTED_FILE_ENV_VAR = "GEMINI_FORCE_ENCRYPTED_FILE_STORAGE";
119613
119591
  }
@@ -120367,7 +120345,7 @@ function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false
120367
120345
  return resolveModel(requestedModel, useGemini3_1, useCustomToolModel);
120368
120346
  }
120369
120347
  function isPreviewModel(model) {
120370
- 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;
120348
+ 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;
120371
120349
  }
120372
120350
  function isGemini3Model(model) {
120373
120351
  const resolved = resolveModel(model);
@@ -120391,7 +120369,7 @@ function isAutoModel(model) {
120391
120369
  function supportsMultimodalFunctionResponse(model) {
120392
120370
  return model.startsWith("gemini-3-");
120393
120371
  }
120394
- 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, 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;
120372
+ 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, 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;
120395
120373
  var init_models = __esm({
120396
120374
  "packages/core/dist/src/config/models.js"() {
120397
120375
  "use strict";
@@ -120399,6 +120377,7 @@ var init_models = __esm({
120399
120377
  PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
120400
120378
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
120401
120379
  PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
120380
+ PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL = "gemini-3.1-flash-lite-preview";
120402
120381
  DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
120403
120382
  DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
120404
120383
  DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
@@ -200239,8 +200218,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
200239
200218
  var init_git_commit = __esm({
200240
200219
  "packages/core/dist/src/generated/git-commit.js"() {
200241
200220
  "use strict";
200242
- GIT_COMMIT_INFO = "4085b4f8e";
200243
- CLI_VERSION = "0.34.0-preview.2";
200221
+ GIT_COMMIT_INFO = "72bca215f";
200222
+ CLI_VERSION = "0.34.0-preview.4";
200244
200223
  }
200245
200224
  });
200246
200225
 
@@ -270285,7 +270264,7 @@ var createInitialRoleMetrics, createInitialModelMetrics, createInitialMetrics, U
270285
270264
  var init_uiTelemetry = __esm({
270286
270265
  "packages/core/dist/src/telemetry/uiTelemetry.js"() {
270287
270266
  "use strict";
270288
- init_types6();
270267
+ init_types5();
270289
270268
  init_tool_call_decision();
270290
270269
  createInitialRoleMetrics = () => ({
270291
270270
  totalRequests: 0,
@@ -271166,7 +271145,7 @@ var init_startupProfiler = __esm({
271166
271145
  "use strict";
271167
271146
  init_metrics2();
271168
271147
  init_debugLogger();
271169
- init_types6();
271148
+ init_types5();
271170
271149
  init_loggers();
271171
271150
  StartupProfiler = class _StartupProfiler {
271172
271151
  phases = /* @__PURE__ */ new Map();
@@ -271324,9 +271303,9 @@ var init_telemetry = __esm({
271324
271303
  init_gcp_exporters();
271325
271304
  init_loggers();
271326
271305
  init_conseca_logger();
271327
- init_types6();
271306
+ init_types5();
271328
271307
  init_llmRole();
271329
- init_types6();
271308
+ init_types5();
271330
271309
  init_uiTelemetry();
271331
271310
  init_billingEvents();
271332
271311
  init_memory_monitor();
@@ -272076,7 +272055,7 @@ var init_loggers = __esm({
272076
272055
  "use strict";
272077
272056
  import_api_logs2 = __toESM(require_src17(), 1);
272078
272057
  init_constants();
272079
- init_types6();
272058
+ init_types5();
272080
272059
  init_metrics2();
272081
272060
  init_sdk();
272082
272061
  init_uiTelemetry();
@@ -314530,7 +314509,7 @@ var init_baseLlmClient = __esm({
314530
314509
  init_errorReporting();
314531
314510
  init_errors();
314532
314511
  init_loggers();
314533
- init_types6();
314512
+ init_types5();
314534
314513
  init_retry();
314535
314514
  init_policyHelpers();
314536
314515
  DEFAULT_MAX_ATTEMPTS2 = 5;
@@ -314758,7 +314737,7 @@ var init_llm_edit_fixer = __esm({
314758
314737
  init_mnemonist();
314759
314738
  init_promptIdContext();
314760
314739
  init_debugLogger();
314761
- init_types6();
314740
+ init_types5();
314762
314741
  MAX_CACHE_SIZE = 50;
314763
314742
  GENERATE_JSON_TIMEOUT_MS = 4e4;
314764
314743
  EDIT_SYS_PROMPT = `
@@ -315329,15 +315308,15 @@ var init_edit = __esm({
315329
315308
  init_paths();
315330
315309
  init_errors();
315331
315310
  init_pathCorrector();
315311
+ init_types();
315332
315312
  init_types2();
315333
- init_types3();
315334
315313
  init_diffOptions();
315335
315314
  init_diff_utils();
315336
315315
  init_modifiable_tool();
315337
315316
  init_ide_client();
315338
315317
  init_llm_edit_fixer();
315339
315318
  init_textUtils();
315340
- init_types6();
315319
+ init_types5();
315341
315320
  init_loggers();
315342
315321
  init_tool_names();
315343
315322
  init_debugLogger();
@@ -315926,7 +315905,7 @@ var init_editCorrector = __esm({
315926
315905
  init_promptIdContext();
315927
315906
  init_debugLogger();
315928
315907
  init_mnemonist();
315929
- init_types6();
315908
+ init_types5();
315930
315909
  CODE_CORRECTION_SYSTEM_PROMPT = `
315931
315910
  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.
315932
315911
  The correction should be as minimal as possible, staying very close to the original.
@@ -317205,7 +317184,7 @@ var init_write_file = __esm({
317205
317184
  "use strict";
317206
317185
  init_libesm();
317207
317186
  init_tool_names();
317208
- init_types2();
317187
+ init_types();
317209
317188
  init_tools();
317210
317189
  init_utils4();
317211
317190
  init_tool_error();
@@ -317217,7 +317196,7 @@ var init_write_file = __esm({
317217
317196
  init_diff_utils();
317218
317197
  init_ide_client();
317219
317198
  init_loggers();
317220
- init_types6();
317199
+ init_types5();
317221
317200
  init_metrics2();
317222
317201
  init_fileUtils();
317223
317202
  init_language_detection();
@@ -322632,7 +322611,7 @@ function getVersion() {
322632
322611
  }
322633
322612
  versionPromise = (async () => {
322634
322613
  const pkgJson = await getPackageJson(__dirname3);
322635
- return "0.34.0-preview.2";
322614
+ return "0.34.0-preview.4";
322636
322615
  })();
322637
322616
  return versionPromise;
322638
322617
  }
@@ -322716,7 +322695,7 @@ var init_server = __esm({
322716
322695
  init_converter();
322717
322696
  init_telemetry2();
322718
322697
  init_client_metadata();
322719
- init_types6();
322698
+ init_types5();
322720
322699
  CODE_ASSIST_ENDPOINT = "https://cloudcode-pa.googleapis.com";
322721
322700
  CODE_ASSIST_API_VERSION = "v1internal";
322722
322701
  GENERATE_CONTENT_RETRY_DELAY_IN_MILLISECONDS = 1e3;
@@ -323448,7 +323427,7 @@ var LoggingContentGenerator;
323448
323427
  var init_loggingContentGenerator = __esm({
323449
323428
  "packages/core/dist/src/core/loggingContentGenerator.js"() {
323450
323429
  "use strict";
323451
- init_types6();
323430
+ init_types5();
323452
323431
  init_loggers();
323453
323432
  init_server();
323454
323433
  init_converter();
@@ -324385,7 +324364,7 @@ var init_tool_registry = __esm({
324385
324364
  "packages/core/dist/src/tools/tool-registry.js"() {
324386
324365
  "use strict";
324387
324366
  init_tools();
324388
- init_types2();
324367
+ init_types();
324389
324368
  init_mcp_tool();
324390
324369
  import_shell_quote = __toESM(require_shell_quote(), 1);
324391
324370
  init_tool_error();
@@ -325950,7 +325929,7 @@ var init_read_file = __esm({
325950
325929
  init_metrics2();
325951
325930
  init_telemetry_utils();
325952
325931
  init_loggers();
325953
- init_types6();
325932
+ init_types5();
325954
325933
  init_tool_names();
325955
325934
  init_fileDiscoveryService();
325956
325935
  init_coreTools();
@@ -374309,7 +374288,7 @@ var init_web_fetch = __esm({
374309
374288
  init_utils4();
374310
374289
  init_tool_error();
374311
374290
  init_errors();
374312
- init_types2();
374291
+ init_types();
374313
374292
  init_partUtils();
374314
374293
  init_fetch();
374315
374294
  init_textUtils();
@@ -374913,7 +374892,7 @@ var init_ask_user = __esm({
374913
374892
  "use strict";
374914
374893
  init_tools();
374915
374894
  init_tool_error();
374916
- init_types4();
374895
+ init_types3();
374917
374896
  init_tool_names();
374918
374897
  init_coreTools();
374919
374898
  init_resolver();
@@ -375110,7 +375089,7 @@ function getPlanModeExitMessage(newMode, isManual = false) {
375110
375089
  var init_approvalModeUtils = __esm({
375111
375090
  "packages/core/dist/src/utils/approvalModeUtils.js"() {
375112
375091
  "use strict";
375113
- init_types2();
375092
+ init_types();
375114
375093
  init_checks4();
375115
375094
  }
375116
375095
  });
@@ -375124,10 +375103,10 @@ var init_exit_plan_mode = __esm({
375124
375103
  init_tools();
375125
375104
  init_tool_names();
375126
375105
  init_planUtils();
375127
- init_types2();
375106
+ init_types();
375128
375107
  init_paths();
375129
375108
  init_loggers();
375130
- init_types6();
375109
+ init_types5();
375131
375110
  init_coreTools();
375132
375111
  init_resolver();
375133
375112
  init_approvalModeUtils();
@@ -375278,7 +375257,7 @@ var init_enter_plan_mode = __esm({
375278
375257
  "use strict";
375279
375258
  init_tools();
375280
375259
  init_tool_names();
375281
- init_types2();
375260
+ init_types();
375282
375261
  init_coreTools();
375283
375262
  init_resolver();
375284
375263
  EnterPlanModeTool = class _EnterPlanModeTool extends BaseDeclarativeTool {
@@ -375491,8 +375470,8 @@ var init_tool_utils = __esm({
375491
375470
  init_src2();
375492
375471
  init_shell_utils();
375493
375472
  import_fast_levenshtein2 = __toESM(require_levenshtein(), 1);
375473
+ init_types();
375494
375474
  init_types2();
375495
- init_types3();
375496
375475
  init_tool_names();
375497
375476
  }
375498
375477
  });
@@ -376097,7 +376076,7 @@ var init_tool_executor = __esm({
376097
376076
  init_coreToolHookTriggers();
376098
376077
  init_fileUtils();
376099
376078
  init_generateContentResponseUtilities();
376100
- init_types3();
376079
+ init_types2();
376101
376080
  init_constants();
376102
376081
  ToolExecutor = class {
376103
376082
  config;
@@ -376423,8 +376402,8 @@ var init_policy = __esm({
376423
376402
  "packages/core/dist/src/scheduler/policy.js"() {
376424
376403
  "use strict";
376425
376404
  init_tool_error();
376426
- init_types2();
376427
- init_types4();
376405
+ init_types();
376406
+ init_types3();
376428
376407
  init_tools();
376429
376408
  init_utils4();
376430
376409
  init_paths();
@@ -376439,15 +376418,15 @@ var init_coreToolScheduler = __esm({
376439
376418
  "packages/core/dist/src/core/coreToolScheduler.js"() {
376440
376419
  "use strict";
376441
376420
  init_tools();
376442
- init_types2();
376421
+ init_types();
376443
376422
  init_loggers();
376444
376423
  init_tool_error();
376445
- init_types6();
376424
+ init_types5();
376446
376425
  init_trace3();
376447
376426
  init_tool_modifier();
376448
376427
  init_tool_utils();
376449
- init_types4();
376450
376428
  init_types3();
376429
+ init_types2();
376451
376430
  init_tool_executor();
376452
376431
  init_mcp_tool();
376453
376432
  init_policy();
@@ -377643,7 +377622,7 @@ var init_geminiChat = __esm({
377643
377622
  init_tools();
377644
377623
  init_loggers();
377645
377624
  init_chatRecordingService();
377646
- init_types6();
377625
+ init_types5();
377647
377626
  init_handler();
377648
377627
  init_messageInspectors();
377649
377628
  init_geminiRequest();
@@ -378220,8 +378199,8 @@ var init_turn = __esm({
378220
378199
  init_geminiChat();
378221
378200
  init_thoughtUtils();
378222
378201
  init_generateContentResponseUtilities();
378223
- init_types6();
378224
- init_types3();
378202
+ init_types5();
378203
+ init_types2();
378225
378204
  (function(GeminiEventType2) {
378226
378205
  GeminiEventType2["Content"] = "content";
378227
378206
  GeminiEventType2["ToolCallRequest"] = "tool_call_request";
@@ -379841,7 +379820,7 @@ var init_promptProvider = __esm({
379841
379820
  "packages/core/dist/src/prompts/promptProvider.js"() {
379842
379821
  "use strict";
379843
379822
  init_paths();
379844
- init_types2();
379823
+ init_types();
379845
379824
  init_snippets();
379846
379825
  init_snippets_legacy();
379847
379826
  init_utils6();
@@ -380048,7 +380027,7 @@ var init_nextSpeakerChecker = __esm({
380048
380027
  "use strict";
380049
380028
  init_messageInspectors();
380050
380029
  init_debugLogger();
380051
- init_types6();
380030
+ init_types5();
380052
380031
  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).
380053
380032
  **Decision Rules (apply in order):**
380054
380033
  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.
@@ -380102,7 +380081,7 @@ var init_loopDetectionService = __esm({
380102
380081
  "use strict";
380103
380082
  init_turn();
380104
380083
  init_loggers();
380105
- init_types6();
380084
+ init_types5();
380106
380085
  init_messageInspectors();
380107
380086
  init_debugLogger();
380108
380087
  TOOL_CALL_LOOP_THRESHOLD = 5;
@@ -380687,7 +380666,7 @@ var init_chatCompressionService = __esm({
380687
380666
  init_prompts();
380688
380667
  init_partUtils();
380689
380668
  init_loggers();
380690
- init_types6();
380669
+ init_types5();
380691
380670
  init_fileUtils();
380692
380671
  init_debugLogger();
380693
380672
  init_environmentContext();
@@ -380879,7 +380858,7 @@ var init_toolOutputMaskingService = __esm({
380879
380858
  init_fileUtils();
380880
380859
  init_loggers();
380881
380860
  init_tool_names();
380882
- init_types6();
380861
+ init_types5();
380883
380862
  DEFAULT_TOOL_PROTECTION_THRESHOLD = 5e4;
380884
380863
  DEFAULT_MIN_PRUNABLE_TOKENS_THRESHOLD = 3e4;
380885
380864
  DEFAULT_PROTECT_LATEST_TURN = true;
@@ -381123,7 +381102,7 @@ var init_client3 = __esm({
381123
381102
  init_chatCompressionService();
381124
381103
  init_ideContext();
381125
381104
  init_loggers();
381126
- init_types6();
381105
+ init_types5();
381127
381106
  init_uiTelemetry();
381128
381107
  init_handler();
381129
381108
  init_debugLogger();
@@ -387512,7 +387491,7 @@ var init_classifierStrategy = __esm({
387512
387491
  init_node();
387513
387492
  init_messageInspectors();
387514
387493
  init_debugLogger();
387515
- init_types6();
387494
+ init_types5();
387516
387495
  HISTORY_TURNS_FOR_CONTEXT2 = 4;
387517
387496
  HISTORY_SEARCH_WINDOW2 = 20;
387518
387497
  FLASH_MODEL2 = "flash";
@@ -387677,7 +387656,7 @@ var init_numericalClassifierStrategy = __esm({
387677
387656
  init_models();
387678
387657
  init_node();
387679
387658
  init_debugLogger();
387680
- init_types6();
387659
+ init_types5();
387681
387660
  HISTORY_TURNS_FOR_CONTEXT3 = 8;
387682
387661
  FLASH_MODEL3 = "flash";
387683
387662
  PRO_MODEL3 = "pro";
@@ -387947,7 +387926,7 @@ var init_approvalModeStrategy = __esm({
387947
387926
  "packages/core/dist/src/routing/strategies/approvalModeStrategy.js"() {
387948
387927
  "use strict";
387949
387928
  init_models();
387950
- init_types2();
387929
+ init_types();
387951
387930
  ApprovalModeStrategy = class {
387952
387931
  name = "approval-mode";
387953
387932
  async route(context2, config3, _baseLlmClient) {
@@ -388006,7 +387985,7 @@ var init_modelRouterService = __esm({
388006
387985
  init_overrideStrategy();
388007
387986
  init_approvalModeStrategy();
388008
387987
  init_loggers();
388009
- init_types6();
387988
+ init_types5();
388010
387989
  init_debugLogger();
388011
387990
  ModelRouterService = class {
388012
387991
  config;
@@ -389729,8 +389708,8 @@ var MessageBus;
389729
389708
  var init_message_bus = __esm({
389730
389709
  "packages/core/dist/src/confirmation-bus/message-bus.js"() {
389731
389710
  "use strict";
389732
- init_types2();
389733
- init_types4();
389711
+ init_types();
389712
+ init_types3();
389734
389713
  init_safeJsonStringify();
389735
389714
  init_debugLogger();
389736
389715
  MessageBus = class extends EventEmitter10 {
@@ -389990,7 +389969,7 @@ var init_policy_engine = __esm({
389990
389969
  "packages/core/dist/src/policy/policy-engine.js"() {
389991
389970
  "use strict";
389992
389971
  init_node();
389993
- init_types2();
389972
+ init_types();
389994
389973
  init_stable_stringify();
389995
389974
  init_debugLogger();
389996
389975
  init_protocol2();
@@ -391375,7 +391354,7 @@ var init_hookEventHandler = __esm({
391375
391354
  init_types16();
391376
391355
  init_hookTranslator();
391377
391356
  init_loggers();
391378
- init_types6();
391357
+ init_types5();
391379
391358
  init_debugLogger();
391380
391359
  init_events();
391381
391360
  HookEventHandler = class {
@@ -400138,7 +400117,7 @@ var init_registry = __esm({
400138
400117
  init_debugLogger();
400139
400118
  init_models();
400140
400119
  init_modelConfigService();
400141
- init_types2();
400120
+ init_types();
400142
400121
  init_a2a_errors();
400143
400122
  AgentRegistry = class {
400144
400123
  config;
@@ -400604,8 +400583,8 @@ var SchedulerStateManager;
400604
400583
  var init_state_manager = __esm({
400605
400584
  "packages/core/dist/src/scheduler/state-manager.js"() {
400606
400585
  "use strict";
400586
+ init_types2();
400607
400587
  init_types3();
400608
- init_types4();
400609
400588
  init_tool_utils();
400610
400589
  SchedulerStateManager = class {
400611
400590
  messageBus;
@@ -401130,9 +401109,9 @@ async function waitForConfirmation(messageBus, correlationId, signal, ideConfirm
401130
401109
  var init_confirmation = __esm({
401131
401110
  "packages/core/dist/src/scheduler/confirmation.js"() {
401132
401111
  "use strict";
401133
- init_types4();
401134
- init_tools();
401135
401112
  init_types3();
401113
+ init_tools();
401114
+ init_types2();
401136
401115
  init_editor();
401137
401116
  init_debugLogger();
401138
401117
  init_events();
@@ -401149,15 +401128,15 @@ var init_scheduler2 = __esm({
401149
401128
  init_policy();
401150
401129
  init_tool_executor();
401151
401130
  init_tool_modifier();
401152
- init_types3();
401153
- init_tool_error();
401154
401131
  init_types2();
401132
+ init_tool_error();
401133
+ init_types();
401155
401134
  init_tools();
401156
401135
  init_tool_utils();
401157
401136
  init_trace3();
401158
401137
  init_loggers();
401159
- init_types6();
401160
- init_types4();
401138
+ init_types5();
401139
+ init_types3();
401161
401140
  init_toolCallContext();
401162
401141
  init_events();
401163
401142
  init_constants();
@@ -401744,13 +401723,13 @@ var init_local_executor = __esm({
401744
401723
  init_tools();
401745
401724
  init_mcp_tool();
401746
401725
  init_turn();
401726
+ init_types2();
401747
401727
  init_types3();
401748
- init_types4();
401749
401728
  init_chatCompressionService();
401750
401729
  init_environmentContext();
401751
401730
  init_promptIdContext();
401752
401731
  init_loggers();
401753
- init_types6();
401732
+ init_types5();
401754
401733
  init_types18();
401755
401734
  init_errors();
401756
401735
  init_utils8();
@@ -418710,7 +418689,8 @@ var init_flagNames = __esm({
418710
418689
  MASKING_PROTECTION_THRESHOLD: 45758817,
418711
418690
  MASKING_PRUNABLE_THRESHOLD: 45758818,
418712
418691
  MASKING_PROTECT_LATEST_TURN: 45758819,
418713
- GEMINI_3_1_PRO_LAUNCHED: 45760185
418692
+ GEMINI_3_1_PRO_LAUNCHED: 45760185,
418693
+ PRO_MODEL_NO_ACCESS: 45768879
418714
418694
  };
418715
418695
  }
418716
418696
  });
@@ -421438,7 +421418,7 @@ var import_fast_levenshtein3, import_toml, MAX_TYPO_DISTANCE, PolicyRuleSchema,
421438
421418
  var init_toml_loader = __esm({
421439
421419
  "packages/core/dist/src/policy/toml-loader.js"() {
421440
421420
  "use strict";
421441
- init_types2();
421421
+ init_types();
421442
421422
  init_utils4();
421443
421423
  init_tool_names();
421444
421424
  init_tool_utils();
@@ -421519,11 +421499,11 @@ var init_config3 = __esm({
421519
421499
  "packages/core/dist/src/policy/config.js"() {
421520
421500
  "use strict";
421521
421501
  init_storage();
421522
- init_types2();
421502
+ init_types();
421523
421503
  init_toml_loader();
421524
421504
  init_utils4();
421525
421505
  import_toml2 = __toESM(require_toml(), 1);
421526
- init_types4();
421506
+ init_types3();
421527
421507
  init_message_bus();
421528
421508
  init_events();
421529
421509
  init_debugLogger();
@@ -422294,7 +422274,7 @@ var init_registry2 = __esm({
422294
422274
  "packages/core/dist/src/safety/registry.js"() {
422295
422275
  "use strict";
422296
422276
  init_built_in();
422297
- init_types2();
422277
+ init_types();
422298
422278
  init_conseca();
422299
422279
  CheckerRegistry = class _CheckerRegistry {
422300
422280
  checkersPath;
@@ -425596,7 +425576,7 @@ var init_config4 = __esm({
425596
425576
  init_fileSystemService();
425597
425577
  init_trackerTools2();
425598
425578
  init_loggers();
425599
- init_types6();
425579
+ init_types5();
425600
425580
  init_modelAvailabilityService();
425601
425581
  init_modelRouterService();
425602
425582
  init_types17();
@@ -425609,7 +425589,7 @@ var init_config4 = __esm({
425609
425589
  init_ignorePatterns();
425610
425590
  init_message_bus();
425611
425591
  init_policy_engine();
425612
- init_types2();
425592
+ init_types();
425613
425593
  init_hooks();
425614
425594
  init_codeAssist();
425615
425595
  init_experiments();
@@ -426136,6 +426116,9 @@ var init_config4 = __esm({
426136
426116
  coreEvents.emitAdminSettingsChanged();
426137
426117
  });
426138
426118
  this.setRemoteAdminSettings(adminControls);
426119
+ if (await this.getProModelNoAccess() && isAutoModel(this.model)) {
426120
+ this.setModel(PREVIEW_GEMINI_FLASH_MODEL);
426121
+ }
426139
426122
  }
426140
426123
  async getExperimentsAsync() {
426141
426124
  if (this.experiments) {
@@ -427007,6 +426990,25 @@ var init_config4 = __esm({
427007
426990
  await this.ensureExperimentsLoaded();
427008
426991
  return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]?.stringValue ?? "";
427009
426992
  }
426993
+ /**
426994
+ * Returns whether the user has access to Pro models.
426995
+ * This is determined by the PRO_MODEL_NO_ACCESS experiment flag.
426996
+ */
426997
+ async getProModelNoAccess() {
426998
+ await this.ensureExperimentsLoaded();
426999
+ return this.getProModelNoAccessSync();
427000
+ }
427001
+ /**
427002
+ * Returns whether the user has access to Pro models synchronously.
427003
+ *
427004
+ * Note: This method should only be called after startup, once experiments have been loaded.
427005
+ */
427006
+ getProModelNoAccessSync() {
427007
+ if (this.contentGeneratorConfig?.authType !== AuthType2.LOGIN_WITH_GOOGLE) {
427008
+ return false;
427009
+ }
427010
+ return this.experiments?.flags[ExperimentFlags.PRO_MODEL_NO_ACCESS]?.boolValue ?? false;
427011
+ }
427010
427012
  /**
427011
427013
  * Returns whether Gemini 3.1 has been launched.
427012
427014
  * This method is async and ensures that experiments are loaded before returning the result.
@@ -430341,7 +430343,7 @@ var init_sessionSummaryService = __esm({
430341
430343
  init_geminiRequest();
430342
430344
  init_debugLogger();
430343
430345
  init_partUtils();
430344
- init_types6();
430346
+ init_types5();
430345
430347
  }
430346
430348
  });
430347
430349
 
@@ -430387,7 +430389,7 @@ var init_read_many_files = __esm({
430387
430389
  init_metrics2();
430388
430390
  init_telemetry_utils();
430389
430391
  init_loggers();
430390
- init_types6();
430392
+ init_types5();
430391
430393
  init_tool_error();
430392
430394
  init_tool_names();
430393
430395
  init_coreTools();
@@ -430430,13 +430432,13 @@ var init_src2 = __esm({
430430
430432
  init_types17();
430431
430433
  init_json_formatter();
430432
430434
  init_stream_json_formatter();
430433
- init_types2();
430435
+ init_types();
430434
430436
  init_policy_engine();
430435
430437
  init_toml_loader();
430436
430438
  init_config3();
430437
430439
  init_integrity();
430438
430440
  init_billing2();
430439
- init_types4();
430441
+ init_types3();
430440
430442
  init_message_bus();
430441
430443
  init_extensions();
430442
430444
  init_restore();
@@ -430455,7 +430457,7 @@ var init_src2 = __esm({
430455
430457
  init_geminiRequest();
430456
430458
  init_coreToolScheduler();
430457
430459
  init_scheduler2();
430458
- init_types3();
430460
+ init_types2();
430459
430461
  init_tool_executor();
430460
430462
  init_recordingContentGenerator();
430461
430463
  init_types20();
@@ -430494,7 +430496,7 @@ var init_src2 = __esm({
430494
430496
  init_fileDiffUtils();
430495
430497
  init_retry();
430496
430498
  init_shell_utils();
430497
- init_types2();
430499
+ init_types();
430498
430500
  init_tool_utils();
430499
430501
  init_terminalSerializer();
430500
430502
  init_systemEncoding();
@@ -430619,7 +430621,7 @@ var init_dist7 = __esm({
430619
430621
  init_config4();
430620
430622
  init_detect_ide();
430621
430623
  init_loggers();
430622
- init_types6();
430624
+ init_types5();
430623
430625
  init_config5();
430624
430626
  init_pathReader();
430625
430627
  init_clearcut_logger();