@google/gemini-cli 0.34.0-preview.1 → 0.34.0-preview.3

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
@@ -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;
@@ -104260,7 +104105,7 @@ var init_mcp_tool = __esm({
104260
104105
  return safeJsonStringify(this.params);
104261
104106
  }
104262
104107
  };
104263
- DiscoveredMCPTool = class _DiscoveredMCPTool extends BaseDeclarativeTool {
104108
+ DiscoveredMCPTool = class extends BaseDeclarativeTool {
104264
104109
  mcpTool;
104265
104110
  serverName;
104266
104111
  serverToolName;
@@ -104312,9 +104157,6 @@ var init_mcp_tool = __esm({
104312
104157
  getFullyQualifiedName() {
104313
104158
  return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${this.serverToolName}`);
104314
104159
  }
104315
- asFullyQualifiedTool() {
104316
- return new _DiscoveredMCPTool(this.mcpTool, this.serverName, this.serverToolName, this.description, this.parameterSchema, this.messageBus, this.trust, this.isReadOnly, this.getFullyQualifiedName(), this.cliConfig, this.extensionName, this.extensionId, this._toolAnnotations);
104317
- }
104318
104160
  createInvocation(params, messageBus, _toolName, _displayName) {
104319
104161
  return new DiscoveredMCPToolInvocation(this.mcpTool, this.serverName, this.serverToolName, _displayName ?? this.displayName, messageBus, this.trust, params, this.cliConfig, this.description, this.parameterSchema, this._toolAnnotations);
104320
104162
  }
@@ -104592,7 +104434,7 @@ var init_ComponentLogger = __esm({
104592
104434
 
104593
104435
  // node_modules/@opentelemetry/api/build/esm/diag/types.js
104594
104436
  var DiagLogLevel;
104595
- var init_types5 = __esm({
104437
+ var init_types4 = __esm({
104596
104438
  "node_modules/@opentelemetry/api/build/esm/diag/types.js"() {
104597
104439
  (function(DiagLogLevel2) {
104598
104440
  DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
@@ -104632,7 +104474,7 @@ function createLogLevelDiagLogger(maxLevel, logger6) {
104632
104474
  }
104633
104475
  var init_logLevelLogger = __esm({
104634
104476
  "node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js"() {
104635
- init_types5();
104477
+ init_types4();
104636
104478
  }
104637
104479
  });
104638
104480
 
@@ -104642,7 +104484,7 @@ var init_diag = __esm({
104642
104484
  "node_modules/@opentelemetry/api/build/esm/api/diag.js"() {
104643
104485
  init_ComponentLogger();
104644
104486
  init_logLevelLogger();
104645
- init_types5();
104487
+ init_types4();
104646
104488
  init_global_utils();
104647
104489
  __read2 = function(o3, n3) {
104648
104490
  var m3 = typeof Symbol === "function" && o3[Symbol.iterator];
@@ -105951,7 +105793,7 @@ var init_esm = __esm({
105951
105793
  init_utils();
105952
105794
  init_context();
105953
105795
  init_consoleLogger();
105954
- init_types5();
105796
+ init_types4();
105955
105797
  init_NoopMeter();
105956
105798
  init_Metric();
105957
105799
  init_TextMapPropagator();
@@ -106014,9 +105856,9 @@ var init_constants = __esm({
106014
105856
  });
106015
105857
 
106016
105858
  // packages/core/dist/src/utils/installationManager.js
106017
- import * as fs15 from "node:fs";
105859
+ import * as fs14 from "node:fs";
106018
105860
  import { randomUUID as randomUUID2 } from "node:crypto";
106019
- import * as path9 from "node:path";
105861
+ import * as path8 from "node:path";
106020
105862
  var InstallationManager;
106021
105863
  var init_installationManager = __esm({
106022
105864
  "packages/core/dist/src/utils/installationManager.js"() {
@@ -106029,17 +105871,17 @@ var init_installationManager = __esm({
106029
105871
  }
106030
105872
  readInstallationIdFromFile() {
106031
105873
  const installationIdFile = this.getInstallationIdPath();
106032
- if (fs15.existsSync(installationIdFile)) {
106033
- const installationid = fs15.readFileSync(installationIdFile, "utf-8").trim();
105874
+ if (fs14.existsSync(installationIdFile)) {
105875
+ const installationid = fs14.readFileSync(installationIdFile, "utf-8").trim();
106034
105876
  return installationid || null;
106035
105877
  }
106036
105878
  return null;
106037
105879
  }
106038
105880
  writeInstallationIdToFile(installationId) {
106039
105881
  const installationIdFile = this.getInstallationIdPath();
106040
- const dir = path9.dirname(installationIdFile);
106041
- fs15.mkdirSync(dir, { recursive: true });
106042
- 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");
106043
105885
  }
106044
105886
  /**
106045
105887
  * Retrieves the installation ID from a file, creating it if it doesn't exist.
@@ -109532,10 +109374,10 @@ function makeChatCompressionEvent({ tokens_before, tokens_after }) {
109532
109374
  };
109533
109375
  }
109534
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;
109535
- var init_types6 = __esm({
109377
+ var init_types5 = __esm({
109536
109378
  "packages/core/dist/src/telemetry/types.js"() {
109537
109379
  "use strict";
109538
- init_types3();
109380
+ init_types2();
109539
109381
  init_mcp_tool();
109540
109382
  init_contentGenerator();
109541
109383
  init_tool_call_decision();
@@ -111907,7 +111749,7 @@ function custom(check2, _params = {}, fatal) {
111907
111749
  return ZodAny.create();
111908
111750
  }
111909
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;
111910
- var init_types7 = __esm({
111752
+ var init_types6 = __esm({
111911
111753
  "node_modules/zod/v3/types.js"() {
111912
111754
  init_ZodError();
111913
111755
  init_errors2();
@@ -115287,7 +115129,7 @@ var init_external = __esm({
115287
115129
  init_parseUtil();
115288
115130
  init_typeAliases();
115289
115131
  init_util();
115290
- init_types7();
115132
+ init_types6();
115291
115133
  init_ZodError();
115292
115134
  }
115293
115135
  });
@@ -115409,17 +115251,137 @@ var init_markdownUtils = __esm({
115409
115251
  }
115410
115252
  });
115411
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
+
115412
115372
  // packages/core/dist/src/services/keychainService.js
115413
115373
  import * as crypto9 from "node:crypto";
115414
- var KeychainService;
115374
+ var FORCE_FILE_STORAGE_ENV_VAR, KeychainService;
115415
115375
  var init_keychainService = __esm({
115416
115376
  "packages/core/dist/src/services/keychainService.js"() {
115417
115377
  "use strict";
115418
115378
  init_events();
115419
- init_types6();
115379
+ init_types5();
115420
115380
  init_debugLogger();
115421
115381
  init_keychainTypes();
115422
115382
  init_markdownUtils();
115383
+ init_fileKeychain();
115384
+ FORCE_FILE_STORAGE_ENV_VAR = "GEMINI_FORCE_FILE_STORAGE";
115423
115385
  KeychainService = class {
115424
115386
  serviceName;
115425
115387
  // Track an ongoing initialization attempt to avoid race conditions.
@@ -115433,6 +115395,13 @@ var init_keychainService = __esm({
115433
115395
  async isAvailable() {
115434
115396
  return await this.getKeychain() !== null;
115435
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
+ }
115436
115405
  /**
115437
115406
  * Retrieves a secret for the given account.
115438
115407
  * @throws Error if the keychain is unavailable.
@@ -115479,20 +115448,27 @@ var init_keychainService = __esm({
115479
115448
  // High-level orchestration of the loading and testing cycle.
115480
115449
  async initializeKeychain() {
115481
115450
  let resultKeychain = null;
115482
- try {
115483
- const keychainModule = await this.loadKeychainModule();
115484
- if (keychainModule) {
115485
- if (await this.isKeychainFunctional(keychainModule)) {
115486
- resultKeychain = keychainModule;
115487
- } else {
115488
- 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
+ }
115489
115461
  }
115462
+ } catch (error40) {
115463
+ const message = error40 instanceof Error ? error40.message : String(error40);
115464
+ debugLogger.log("Keychain initialization encountered an error:", message);
115490
115465
  }
115491
- } catch (error40) {
115492
- const message = error40 instanceof Error ? error40.message : String(error40);
115493
- debugLogger.log("Keychain initialization encountered an error:", message);
115494
115466
  }
115495
- 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
+ }
115496
115472
  return resultKeychain;
115497
115473
  }
115498
115474
  // Low-level dynamic loading and structural validation.
@@ -115521,10 +115497,6 @@ var init_keychainService = __esm({
115521
115497
  });
115522
115498
 
115523
115499
  // packages/core/dist/src/mcp/token-storage/keychain-token-storage.js
115524
- var keychain_token_storage_exports = {};
115525
- __export(keychain_token_storage_exports, {
115526
- KeychainTokenStorage: () => KeychainTokenStorage
115527
- });
115528
115500
  var KeychainTokenStorage;
115529
115501
  var init_keychain_token_storage = __esm({
115530
115502
  "packages/core/dist/src/mcp/token-storage/keychain-token-storage.js"() {
@@ -115625,6 +115597,9 @@ var init_keychain_token_storage = __esm({
115625
115597
  async isAvailable() {
115626
115598
  return this.keychainService.isAvailable();
115627
115599
  }
115600
+ async isUsingFileFallback() {
115601
+ return this.keychainService.isUsingFileFallback();
115602
+ }
115628
115603
  async setSecret(key, value) {
115629
115604
  await this.keychainService.setPassword(`${SECRET_PREFIX}${key}`, value);
115630
115605
  }
@@ -115650,17 +115625,29 @@ var init_keychain_token_storage = __esm({
115650
115625
  }
115651
115626
  });
115652
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
+
115653
115640
  // packages/core/dist/src/mcp/token-storage/hybrid-token-storage.js
115654
- var FORCE_FILE_STORAGE_ENV_VAR, HybridTokenStorage;
115641
+ var HybridTokenStorage;
115655
115642
  var init_hybrid_token_storage = __esm({
115656
115643
  "packages/core/dist/src/mcp/token-storage/hybrid-token-storage.js"() {
115657
115644
  "use strict";
115658
115645
  init_base_token_storage();
115659
- init_file_token_storage();
115660
- init_types();
115646
+ init_keychain_token_storage();
115647
+ init_types7();
115661
115648
  init_events();
115662
- init_types6();
115663
- FORCE_FILE_STORAGE_ENV_VAR = "GEMINI_FORCE_FILE_STORAGE";
115649
+ init_types5();
115650
+ init_keychainService();
115664
115651
  HybridTokenStorage = class extends BaseTokenStorage {
115665
115652
  storage = null;
115666
115653
  storageType = null;
@@ -115670,23 +115657,11 @@ var init_hybrid_token_storage = __esm({
115670
115657
  }
115671
115658
  async initializeStorage() {
115672
115659
  const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
115673
- if (!forceFileStorage) {
115674
- try {
115675
- const { KeychainTokenStorage: KeychainTokenStorage2 } = await Promise.resolve().then(() => (init_keychain_token_storage(), keychain_token_storage_exports));
115676
- const keychainStorage = new KeychainTokenStorage2(this.serviceName);
115677
- const isAvailable = await keychainStorage.isAvailable();
115678
- if (isAvailable) {
115679
- this.storage = keychainStorage;
115680
- this.storageType = TokenStorageType.KEYCHAIN;
115681
- coreEvents.emitTelemetryTokenStorageType(new TokenStorageInitializationEvent("keychain", forceFileStorage));
115682
- return this.storage;
115683
- }
115684
- } catch (_e2) {
115685
- }
115686
- }
115687
- this.storage = new FileTokenStorage(this.serviceName);
115688
- this.storageType = TokenStorageType.ENCRYPTED_FILE;
115689
- 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));
115690
115665
  return this.storage;
115691
115666
  }
115692
115667
  async getStorage() {
@@ -115834,10 +115809,10 @@ var DEFAULT_SERVICE_NAME, FORCE_ENCRYPTED_FILE_ENV_VAR;
115834
115809
  var init_token_storage = __esm({
115835
115810
  "packages/core/dist/src/mcp/token-storage/index.js"() {
115836
115811
  "use strict";
115837
- init_types();
115812
+ init_types7();
115838
115813
  init_base_token_storage();
115839
- init_file_token_storage();
115840
115814
  init_hybrid_token_storage();
115815
+ init_keychain_token_storage();
115841
115816
  DEFAULT_SERVICE_NAME = "gemini-cli-oauth";
115842
115817
  FORCE_ENCRYPTED_FILE_ENV_VAR = "GEMINI_FORCE_ENCRYPTED_FILE_STORAGE";
115843
115818
  }
@@ -195045,18 +195020,28 @@ function isValidToolName(name3, options = {}) {
195045
195020
  if (options.allowWildcards && name3 === "*") {
195046
195021
  return true;
195047
195022
  }
195048
- if (name3.includes("__")) {
195049
- const parts2 = name3.split("__");
195050
- if (parts2.length !== 2 || parts2[0].length === 0 || parts2[1].length === 0) {
195023
+ if (isMcpToolName(name3)) {
195024
+ if (name3 === `${MCP_TOOL_PREFIX}*` && options.allowWildcards) {
195025
+ return true;
195026
+ }
195027
+ if (name3.startsWith(`${MCP_TOOL_PREFIX}_`)) {
195051
195028
  return false;
195052
195029
  }
195053
- const server = parts2[0];
195054
- const tool = parts2[1];
195055
- if (tool === "*") {
195056
- return !!options.allowWildcards;
195030
+ const parsed = parseMcpToolName(name3);
195031
+ if (parsed.serverName && parsed.toolName) {
195032
+ const slugRegex = /^[a-z0-9_.:-]+$/i;
195033
+ if (!slugRegex.test(parsed.serverName)) {
195034
+ return false;
195035
+ }
195036
+ if (parsed.toolName === "*") {
195037
+ return options.allowWildcards === true;
195038
+ }
195039
+ if (/^_*$/.test(parsed.toolName)) {
195040
+ return false;
195041
+ }
195042
+ return slugRegex.test(parsed.toolName);
195057
195043
  }
195058
- const slugRegex = /^[a-z0-9_.:-]+$/i;
195059
- return slugRegex.test(server) && slugRegex.test(tool);
195044
+ return false;
195060
195045
  }
195061
195046
  return false;
195062
195047
  }
@@ -195065,6 +195050,7 @@ var init_tool_names = __esm({
195065
195050
  "packages/core/dist/src/tools/tool-names.js"() {
195066
195051
  "use strict";
195067
195052
  init_coreTools();
195053
+ init_mcp_tool();
195068
195054
  LS_TOOL_NAME_LEGACY = "list_directory";
195069
195055
  EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME]);
195070
195056
  SENSITIVE_TOOLS = /* @__PURE__ */ new Set([
@@ -195136,8 +195122,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
195136
195122
  var init_git_commit = __esm({
195137
195123
  "packages/core/dist/src/generated/git-commit.js"() {
195138
195124
  "use strict";
195139
- GIT_COMMIT_INFO = "c56e58d7a";
195140
- CLI_VERSION = "0.34.0-preview.1";
195125
+ GIT_COMMIT_INFO = "810cd6716";
195126
+ CLI_VERSION = "0.34.0-preview.3";
195141
195127
  }
195142
195128
  });
195143
195129
 
@@ -273277,7 +273263,7 @@ var createInitialRoleMetrics, createInitialModelMetrics, createInitialMetrics, U
273277
273263
  var init_uiTelemetry = __esm({
273278
273264
  "packages/core/dist/src/telemetry/uiTelemetry.js"() {
273279
273265
  "use strict";
273280
- init_types6();
273266
+ init_types5();
273281
273267
  init_tool_call_decision();
273282
273268
  createInitialRoleMetrics = () => ({
273283
273269
  totalRequests: 0,
@@ -274468,7 +274454,7 @@ var init_startupProfiler = __esm({
274468
274454
  "use strict";
274469
274455
  init_metrics2();
274470
274456
  init_debugLogger();
274471
- init_types6();
274457
+ init_types5();
274472
274458
  init_loggers();
274473
274459
  StartupProfiler = class _StartupProfiler {
274474
274460
  phases = /* @__PURE__ */ new Map();
@@ -274626,9 +274612,9 @@ var init_telemetry = __esm({
274626
274612
  init_gcp_exporters();
274627
274613
  init_loggers();
274628
274614
  init_conseca_logger();
274629
- init_types6();
274615
+ init_types5();
274630
274616
  init_llmRole();
274631
- init_types6();
274617
+ init_types5();
274632
274618
  init_esm();
274633
274619
  init_esm2();
274634
274620
  init_uiTelemetry();
@@ -275539,7 +275525,7 @@ var init_loggers = __esm({
275539
275525
  "use strict";
275540
275526
  import_api_logs2 = __toESM(require_src12(), 1);
275541
275527
  init_constants();
275542
- init_types6();
275528
+ init_types5();
275543
275529
  init_metrics2();
275544
275530
  init_sdk();
275545
275531
  init_uiTelemetry();
@@ -325977,7 +325963,7 @@ var init_baseLlmClient = __esm({
325977
325963
  init_errorReporting();
325978
325964
  init_errors();
325979
325965
  init_loggers();
325980
- init_types6();
325966
+ init_types5();
325981
325967
  init_retry();
325982
325968
  init_policyHelpers();
325983
325969
  DEFAULT_MAX_ATTEMPTS2 = 5;
@@ -326205,7 +326191,7 @@ var init_llm_edit_fixer = __esm({
326205
326191
  init_mnemonist();
326206
326192
  init_promptIdContext();
326207
326193
  init_debugLogger();
326208
- init_types6();
326194
+ init_types5();
326209
326195
  MAX_CACHE_SIZE = 50;
326210
326196
  GENERATE_JSON_TIMEOUT_MS = 4e4;
326211
326197
  EDIT_SYS_PROMPT = `
@@ -326782,15 +326768,15 @@ var init_edit = __esm({
326782
326768
  init_paths();
326783
326769
  init_errors();
326784
326770
  init_pathCorrector();
326771
+ init_types();
326785
326772
  init_types2();
326786
- init_types3();
326787
326773
  init_diffOptions();
326788
326774
  init_diff_utils();
326789
326775
  init_modifiable_tool();
326790
326776
  init_ide_client();
326791
326777
  init_llm_edit_fixer();
326792
326778
  init_textUtils();
326793
- init_types6();
326779
+ init_types5();
326794
326780
  init_loggers();
326795
326781
  init_tool_names();
326796
326782
  init_debugLogger();
@@ -327379,7 +327365,7 @@ var init_editCorrector = __esm({
327379
327365
  init_promptIdContext();
327380
327366
  init_debugLogger();
327381
327367
  init_mnemonist();
327382
- init_types6();
327368
+ init_types5();
327383
327369
  CODE_CORRECTION_SYSTEM_PROMPT = `
327384
327370
  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.
327385
327371
  The correction should be as minimal as possible, staying very close to the original.
@@ -328678,7 +328664,7 @@ var init_write_file = __esm({
328678
328664
  "use strict";
328679
328665
  init_libesm();
328680
328666
  init_tool_names();
328681
- init_types2();
328667
+ init_types();
328682
328668
  init_tools();
328683
328669
  init_utils4();
328684
328670
  init_tool_error();
@@ -328690,7 +328676,7 @@ var init_write_file = __esm({
328690
328676
  init_diff_utils();
328691
328677
  init_ide_client();
328692
328678
  init_loggers();
328693
- init_types6();
328679
+ init_types5();
328694
328680
  init_metrics2();
328695
328681
  init_fileUtils();
328696
328682
  init_language_detection();
@@ -334183,7 +334169,7 @@ function getVersion() {
334183
334169
  }
334184
334170
  versionPromise = (async () => {
334185
334171
  const pkgJson = await getPackageJson(__dirname3);
334186
- return "0.34.0-preview.1";
334172
+ return "0.34.0-preview.3";
334187
334173
  })();
334188
334174
  return versionPromise;
334189
334175
  }
@@ -334270,7 +334256,7 @@ var init_server = __esm({
334270
334256
  init_converter();
334271
334257
  init_telemetry2();
334272
334258
  init_client_metadata();
334273
- init_types6();
334259
+ init_types5();
334274
334260
  CODE_ASSIST_ENDPOINT = "https://cloudcode-pa.googleapis.com";
334275
334261
  CODE_ASSIST_API_VERSION = "v1internal";
334276
334262
  GENERATE_CONTENT_RETRY_DELAY_IN_MILLISECONDS = 1e3;
@@ -335007,7 +334993,7 @@ var LoggingContentGenerator;
335007
334993
  var init_loggingContentGenerator = __esm({
335008
334994
  "packages/core/dist/src/core/loggingContentGenerator.js"() {
335009
334995
  "use strict";
335010
- init_types6();
334996
+ init_types5();
335011
334997
  init_loggers();
335012
334998
  init_server();
335013
334999
  init_converter();
@@ -335990,7 +335976,7 @@ var init_tool_registry = __esm({
335990
335976
  "packages/core/dist/src/tools/tool-registry.js"() {
335991
335977
  "use strict";
335992
335978
  init_tools();
335993
- init_types2();
335979
+ init_types();
335994
335980
  init_mcp_tool();
335995
335981
  import_shell_quote = __toESM(require_shell_quote(), 1);
335996
335982
  init_tool_error();
@@ -336138,11 +336124,7 @@ Signal: Signal number or \`(none)\` if no signal was received.
336138
336124
  */
336139
336125
  registerTool(tool) {
336140
336126
  if (this.allKnownTools.has(tool.name)) {
336141
- if (tool instanceof DiscoveredMCPTool) {
336142
- tool = tool.asFullyQualifiedTool();
336143
- } else {
336144
- debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
336145
- }
336127
+ debugLogger.warn(`Tool with name "${tool.name}" is already registered. Overwriting.`);
336146
336128
  }
336147
336129
  this.allKnownTools.set(tool.name, tool);
336148
336130
  }
@@ -336416,7 +336398,14 @@ Signal: Signal number or \`(none)\` if no signal was received.
336416
336398
  for (const name3 of toolNames) {
336417
336399
  const tool = this.getTool(name3);
336418
336400
  if (tool) {
336419
- declarations.push(tool.getSchema(modelId));
336401
+ let schema2 = tool.getSchema(modelId);
336402
+ if (tool instanceof DiscoveredMCPTool) {
336403
+ schema2 = {
336404
+ ...schema2,
336405
+ name: tool.getFullyQualifiedName()
336406
+ };
336407
+ }
336408
+ declarations.push(schema2);
336420
336409
  }
336421
336410
  }
336422
336411
  return declarations;
@@ -336476,16 +336465,6 @@ Signal: Signal number or \`(none)\` if no signal was received.
336476
336465
  debugLogger.debug(`Resolved legacy tool name "${name3}" to current name "${currentName}"`);
336477
336466
  }
336478
336467
  }
336479
- if (!tool && name3.includes("__")) {
336480
- for (const t3 of this.allKnownTools.values()) {
336481
- if (t3 instanceof DiscoveredMCPTool) {
336482
- if (t3.getFullyQualifiedName() === name3) {
336483
- tool = t3;
336484
- break;
336485
- }
336486
- }
336487
- }
336488
- }
336489
336468
  if (tool && this.isActiveTool(tool)) {
336490
336469
  return tool;
336491
336470
  }
@@ -337581,7 +337560,7 @@ var init_read_file = __esm({
337581
337560
  init_metrics2();
337582
337561
  init_telemetry_utils();
337583
337562
  init_loggers();
337584
- init_types6();
337563
+ init_types5();
337585
337564
  init_tool_names();
337586
337565
  init_fileDiscoveryService();
337587
337566
  init_coreTools();
@@ -387964,7 +387943,7 @@ var init_web_fetch = __esm({
387964
387943
  init_utils4();
387965
387944
  init_tool_error();
387966
387945
  init_errors();
387967
- init_types2();
387946
+ init_types();
387968
387947
  init_partUtils();
387969
387948
  init_fetch();
387970
387949
  init_textUtils();
@@ -388571,7 +388550,7 @@ var init_ask_user = __esm({
388571
388550
  "use strict";
388572
388551
  init_tools();
388573
388552
  init_tool_error();
388574
- init_types4();
388553
+ init_types3();
388575
388554
  init_tool_names();
388576
388555
  init_coreTools();
388577
388556
  init_resolver();
@@ -388768,7 +388747,7 @@ function getPlanModeExitMessage(newMode, isManual = false) {
388768
388747
  var init_approvalModeUtils = __esm({
388769
388748
  "packages/core/dist/src/utils/approvalModeUtils.js"() {
388770
388749
  "use strict";
388771
- init_types2();
388750
+ init_types();
388772
388751
  init_checks4();
388773
388752
  }
388774
388753
  });
@@ -388782,10 +388761,10 @@ var init_exit_plan_mode = __esm({
388782
388761
  init_tools();
388783
388762
  init_tool_names();
388784
388763
  init_planUtils();
388785
- init_types2();
388764
+ init_types();
388786
388765
  init_paths();
388787
388766
  init_loggers();
388788
- init_types6();
388767
+ init_types5();
388789
388768
  init_coreTools();
388790
388769
  init_resolver();
388791
388770
  init_approvalModeUtils();
@@ -388936,7 +388915,7 @@ var init_enter_plan_mode = __esm({
388936
388915
  "use strict";
388937
388916
  init_tools();
388938
388917
  init_tool_names();
388939
- init_types2();
388918
+ init_types();
388940
388919
  init_coreTools();
388941
388920
  init_resolver();
388942
388921
  EnterPlanModeTool = class _EnterPlanModeTool extends BaseDeclarativeTool {
@@ -389219,8 +389198,8 @@ var init_tool_utils = __esm({
389219
389198
  init_src2();
389220
389199
  init_shell_utils();
389221
389200
  import_fast_levenshtein2 = __toESM(require_levenshtein(), 1);
389201
+ init_types();
389222
389202
  init_types2();
389223
- init_types3();
389224
389203
  init_tool_names();
389225
389204
  }
389226
389205
  });
@@ -389841,7 +389820,7 @@ var init_tool_executor = __esm({
389841
389820
  init_coreToolHookTriggers();
389842
389821
  init_fileUtils();
389843
389822
  init_generateContentResponseUtilities();
389844
- init_types3();
389823
+ init_types2();
389845
389824
  init_constants();
389846
389825
  ToolExecutor = class {
389847
389826
  config;
@@ -390167,8 +390146,8 @@ var init_policy = __esm({
390167
390146
  "packages/core/dist/src/scheduler/policy.js"() {
390168
390147
  "use strict";
390169
390148
  init_tool_error();
390170
- init_types2();
390171
- init_types4();
390149
+ init_types();
390150
+ init_types3();
390172
390151
  init_tools();
390173
390152
  init_utils4();
390174
390153
  init_paths();
@@ -390183,15 +390162,15 @@ var init_coreToolScheduler = __esm({
390183
390162
  "packages/core/dist/src/core/coreToolScheduler.js"() {
390184
390163
  "use strict";
390185
390164
  init_tools();
390186
- init_types2();
390165
+ init_types();
390187
390166
  init_loggers();
390188
390167
  init_tool_error();
390189
- init_types6();
390168
+ init_types5();
390190
390169
  init_trace3();
390191
390170
  init_tool_modifier();
390192
390171
  init_tool_utils();
390193
- init_types4();
390194
390172
  init_types3();
390173
+ init_types2();
390195
390174
  init_tool_executor();
390196
390175
  init_mcp_tool();
390197
390176
  init_policy();
@@ -391387,7 +391366,7 @@ var init_geminiChat = __esm({
391387
391366
  init_tools();
391388
391367
  init_loggers();
391389
391368
  init_chatRecordingService();
391390
- init_types6();
391369
+ init_types5();
391391
391370
  init_handler();
391392
391371
  init_messageInspectors();
391393
391372
  init_geminiRequest();
@@ -391964,8 +391943,8 @@ var init_turn = __esm({
391964
391943
  init_geminiChat();
391965
391944
  init_thoughtUtils();
391966
391945
  init_generateContentResponseUtilities();
391967
- init_types6();
391968
- init_types3();
391946
+ init_types5();
391947
+ init_types2();
391969
391948
  (function(GeminiEventType2) {
391970
391949
  GeminiEventType2["Content"] = "content";
391971
391950
  GeminiEventType2["ToolCallRequest"] = "tool_call_request";
@@ -393585,7 +393564,7 @@ var init_promptProvider = __esm({
393585
393564
  "packages/core/dist/src/prompts/promptProvider.js"() {
393586
393565
  "use strict";
393587
393566
  init_paths();
393588
- init_types2();
393567
+ init_types();
393589
393568
  init_snippets();
393590
393569
  init_snippets_legacy();
393591
393570
  init_utils6();
@@ -393795,7 +393774,7 @@ var init_nextSpeakerChecker = __esm({
393795
393774
  "use strict";
393796
393775
  init_messageInspectors();
393797
393776
  init_debugLogger();
393798
- init_types6();
393777
+ init_types5();
393799
393778
  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).
393800
393779
  **Decision Rules (apply in order):**
393801
393780
  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.
@@ -393849,7 +393828,7 @@ var init_loopDetectionService = __esm({
393849
393828
  "use strict";
393850
393829
  init_turn();
393851
393830
  init_loggers();
393852
- init_types6();
393831
+ init_types5();
393853
393832
  init_messageInspectors();
393854
393833
  init_debugLogger();
393855
393834
  TOOL_CALL_LOOP_THRESHOLD = 5;
@@ -394434,7 +394413,7 @@ var init_chatCompressionService = __esm({
394434
394413
  init_prompts();
394435
394414
  init_partUtils();
394436
394415
  init_loggers();
394437
- init_types6();
394416
+ init_types5();
394438
394417
  init_fileUtils();
394439
394418
  init_debugLogger();
394440
394419
  init_environmentContext();
@@ -394626,7 +394605,7 @@ var init_toolOutputMaskingService = __esm({
394626
394605
  init_fileUtils();
394627
394606
  init_loggers();
394628
394607
  init_tool_names();
394629
- init_types6();
394608
+ init_types5();
394630
394609
  DEFAULT_TOOL_PROTECTION_THRESHOLD = 5e4;
394631
394610
  DEFAULT_MIN_PRUNABLE_TOKENS_THRESHOLD = 3e4;
394632
394611
  DEFAULT_PROTECT_LATEST_TURN = true;
@@ -394870,7 +394849,7 @@ var init_client3 = __esm({
394870
394849
  init_chatCompressionService();
394871
394850
  init_ideContext();
394872
394851
  init_loggers();
394873
- init_types6();
394852
+ init_types5();
394874
394853
  init_uiTelemetry();
394875
394854
  init_handler();
394876
394855
  init_debugLogger();
@@ -401259,7 +401238,7 @@ var init_classifierStrategy = __esm({
401259
401238
  init_node();
401260
401239
  init_messageInspectors();
401261
401240
  init_debugLogger();
401262
- init_types6();
401241
+ init_types5();
401263
401242
  HISTORY_TURNS_FOR_CONTEXT2 = 4;
401264
401243
  HISTORY_SEARCH_WINDOW2 = 20;
401265
401244
  FLASH_MODEL2 = "flash";
@@ -401424,7 +401403,7 @@ var init_numericalClassifierStrategy = __esm({
401424
401403
  init_models();
401425
401404
  init_node();
401426
401405
  init_debugLogger();
401427
- init_types6();
401406
+ init_types5();
401428
401407
  HISTORY_TURNS_FOR_CONTEXT3 = 8;
401429
401408
  FLASH_MODEL3 = "flash";
401430
401409
  PRO_MODEL3 = "pro";
@@ -401694,7 +401673,7 @@ var init_approvalModeStrategy = __esm({
401694
401673
  "packages/core/dist/src/routing/strategies/approvalModeStrategy.js"() {
401695
401674
  "use strict";
401696
401675
  init_models();
401697
- init_types2();
401676
+ init_types();
401698
401677
  ApprovalModeStrategy = class {
401699
401678
  name = "approval-mode";
401700
401679
  async route(context2, config2, _baseLlmClient) {
@@ -401753,7 +401732,7 @@ var init_modelRouterService = __esm({
401753
401732
  init_overrideStrategy();
401754
401733
  init_approvalModeStrategy();
401755
401734
  init_loggers();
401756
- init_types6();
401735
+ init_types5();
401757
401736
  init_debugLogger();
401758
401737
  ModelRouterService = class {
401759
401738
  config;
@@ -403476,8 +403455,8 @@ var MessageBus;
403476
403455
  var init_message_bus = __esm({
403477
403456
  "packages/core/dist/src/confirmation-bus/message-bus.js"() {
403478
403457
  "use strict";
403479
- init_types2();
403480
- init_types4();
403458
+ init_types();
403459
+ init_types3();
403481
403460
  init_safeJsonStringify();
403482
403461
  init_debugLogger();
403483
403462
  MessageBus = class extends EventEmitter12 {
@@ -403737,7 +403716,7 @@ var init_policy_engine = __esm({
403737
403716
  "packages/core/dist/src/policy/policy-engine.js"() {
403738
403717
  "use strict";
403739
403718
  init_node();
403740
- init_types2();
403719
+ init_types();
403741
403720
  init_stable_stringify();
403742
403721
  init_debugLogger();
403743
403722
  init_protocol2();
@@ -405122,7 +405101,7 @@ var init_hookEventHandler = __esm({
405122
405101
  init_types16();
405123
405102
  init_hookTranslator();
405124
405103
  init_loggers();
405125
- init_types6();
405104
+ init_types5();
405126
405105
  init_debugLogger();
405127
405106
  init_events();
405128
405107
  HookEventHandler = class {
@@ -408735,7 +408714,7 @@ var init_agentLoader = __esm({
408735
408714
  name: nameSchema,
408736
408715
  description: external_exports.string().min(1),
408737
408716
  display_name: external_exports.string().optional(),
408738
- tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val), {
408717
+ tools: external_exports.array(external_exports.string().refine((val) => isValidToolName(val, { allowWildcards: true }), {
408739
408718
  message: "Invalid tool name"
408740
408719
  })).optional(),
408741
408720
  model: external_exports.string().optional(),
@@ -413885,7 +413864,7 @@ var init_registry = __esm({
413885
413864
  init_debugLogger();
413886
413865
  init_models();
413887
413866
  init_modelConfigService();
413888
- init_types2();
413867
+ init_types();
413889
413868
  init_a2a_errors();
413890
413869
  AgentRegistry = class {
413891
413870
  config;
@@ -414351,8 +414330,8 @@ var SchedulerStateManager;
414351
414330
  var init_state_manager = __esm({
414352
414331
  "packages/core/dist/src/scheduler/state-manager.js"() {
414353
414332
  "use strict";
414333
+ init_types2();
414354
414334
  init_types3();
414355
- init_types4();
414356
414335
  init_tool_utils();
414357
414336
  SchedulerStateManager = class {
414358
414337
  messageBus;
@@ -414877,9 +414856,9 @@ async function waitForConfirmation(messageBus, correlationId, signal, ideConfirm
414877
414856
  var init_confirmation = __esm({
414878
414857
  "packages/core/dist/src/scheduler/confirmation.js"() {
414879
414858
  "use strict";
414880
- init_types4();
414881
- init_tools();
414882
414859
  init_types3();
414860
+ init_tools();
414861
+ init_types2();
414883
414862
  init_editor();
414884
414863
  init_debugLogger();
414885
414864
  init_events();
@@ -414896,15 +414875,15 @@ var init_scheduler2 = __esm({
414896
414875
  init_policy();
414897
414876
  init_tool_executor();
414898
414877
  init_tool_modifier();
414899
- init_types3();
414900
- init_tool_error();
414901
414878
  init_types2();
414879
+ init_tool_error();
414880
+ init_types();
414902
414881
  init_tools();
414903
414882
  init_tool_utils();
414904
414883
  init_trace3();
414905
414884
  init_loggers();
414906
- init_types6();
414907
- init_types4();
414885
+ init_types5();
414886
+ init_types3();
414908
414887
  init_toolCallContext();
414909
414888
  init_events();
414910
414889
  init_constants();
@@ -415590,15 +415569,16 @@ var init_local_executor = __esm({
415590
415569
  init_geminiChat();
415591
415570
  init_node();
415592
415571
  init_tool_registry();
415572
+ init_tools();
415593
415573
  init_mcp_tool();
415594
415574
  init_turn();
415575
+ init_types2();
415595
415576
  init_types3();
415596
- init_types4();
415597
415577
  init_chatCompressionService();
415598
415578
  init_environmentContext();
415599
415579
  init_promptIdContext();
415600
415580
  init_loggers();
415601
- init_types6();
415581
+ init_types5();
415602
415582
  init_types18();
415603
415583
  init_errors();
415604
415584
  init_utils8();
@@ -415649,18 +415629,40 @@ var init_local_executor = __esm({
415649
415629
  const agentToolRegistry = new ToolRegistry(runtimeContext, subagentMessageBus);
415650
415630
  const parentToolRegistry = runtimeContext.getToolRegistry();
415651
415631
  const allAgentNames = new Set(runtimeContext.getAgentRegistry().getAllAgentNames());
415632
+ const registerToolInstance = (tool) => {
415633
+ if (allAgentNames.has(tool.name)) {
415634
+ debugLogger.warn(`[LocalAgentExecutor] Skipping subagent tool '${tool.name}' for agent '${definition.name}' to prevent recursion.`);
415635
+ return;
415636
+ }
415637
+ agentToolRegistry.registerTool(tool);
415638
+ };
415652
415639
  const registerToolByName = (toolName) => {
415653
- if (allAgentNames.has(toolName)) {
415654
- debugLogger.warn(`[LocalAgentExecutor] Skipping subagent tool '${toolName}' for agent '${definition.name}' to prevent recursion.`);
415640
+ if (toolName === "*") {
415641
+ for (const tool2 of parentToolRegistry.getAllTools()) {
415642
+ registerToolInstance(tool2);
415643
+ }
415655
415644
  return;
415656
415645
  }
415646
+ if (isMcpToolName(toolName)) {
415647
+ if (toolName === `${MCP_TOOL_PREFIX}*`) {
415648
+ for (const tool2 of parentToolRegistry.getAllTools()) {
415649
+ if (tool2 instanceof DiscoveredMCPTool) {
415650
+ registerToolInstance(tool2);
415651
+ }
415652
+ }
415653
+ return;
415654
+ }
415655
+ const parsed = parseMcpToolName(toolName);
415656
+ if (parsed.serverName && parsed.toolName === "*") {
415657
+ for (const tool2 of parentToolRegistry.getToolsByServer(parsed.serverName)) {
415658
+ registerToolInstance(tool2);
415659
+ }
415660
+ return;
415661
+ }
415662
+ }
415657
415663
  const tool = parentToolRegistry.getTool(toolName);
415658
415664
  if (tool) {
415659
- if (tool instanceof DiscoveredMCPTool) {
415660
- agentToolRegistry.registerTool(tool.asFullyQualifiedTool());
415661
- } else {
415662
- agentToolRegistry.registerTool(tool);
415663
- }
415665
+ registerToolInstance(tool);
415664
415666
  }
415665
415667
  };
415666
415668
  if (definition.toolConfig) {
@@ -416323,17 +416325,12 @@ var init_local_executor = __esm({
416323
416325
  const toolsList = [];
416324
416326
  const { toolConfig, outputConfig } = this.definition;
416325
416327
  if (toolConfig) {
416326
- const toolNamesToLoad = [];
416327
416328
  for (const toolRef of toolConfig.tools) {
416328
- if (typeof toolRef === "string") {
416329
- toolNamesToLoad.push(toolRef);
416330
- } else if (typeof toolRef === "object" && "schema" in toolRef) {
416331
- toolsList.push(toolRef.schema);
416332
- } else {
416329
+ if (typeof toolRef === "object" && !("schema" in toolRef)) {
416333
416330
  toolsList.push(toolRef);
416334
416331
  }
416335
416332
  }
416336
- toolsList.push(...this.toolRegistry.getFunctionDeclarationsFiltered(toolNamesToLoad));
416333
+ toolsList.push(...this.toolRegistry.getFunctionDeclarations());
416337
416334
  }
416338
416335
  const completeTool = {
416339
416336
  name: TASK_COMPLETE_TOOL_NAME,
@@ -435283,7 +435280,7 @@ var import_fast_levenshtein3, import_toml, MAX_TYPO_DISTANCE, PolicyRuleSchema,
435283
435280
  var init_toml_loader = __esm({
435284
435281
  "packages/core/dist/src/policy/toml-loader.js"() {
435285
435282
  "use strict";
435286
- init_types2();
435283
+ init_types();
435287
435284
  init_utils4();
435288
435285
  init_tool_names();
435289
435286
  init_tool_utils();
@@ -435740,11 +435737,11 @@ var init_config3 = __esm({
435740
435737
  "packages/core/dist/src/policy/config.js"() {
435741
435738
  "use strict";
435742
435739
  init_storage();
435743
- init_types2();
435740
+ init_types();
435744
435741
  init_toml_loader();
435745
435742
  init_utils4();
435746
435743
  import_toml2 = __toESM(require_toml(), 1);
435747
- init_types4();
435744
+ init_types3();
435748
435745
  init_message_bus();
435749
435746
  init_events();
435750
435747
  init_debugLogger();
@@ -436518,7 +436515,7 @@ var init_registry2 = __esm({
436518
436515
  "packages/core/dist/src/safety/registry.js"() {
436519
436516
  "use strict";
436520
436517
  init_built_in();
436521
- init_types2();
436518
+ init_types();
436522
436519
  init_conseca();
436523
436520
  CheckerRegistry = class _CheckerRegistry {
436524
436521
  checkersPath;
@@ -439875,7 +439872,7 @@ var init_config4 = __esm({
439875
439872
  init_fileSystemService();
439876
439873
  init_trackerTools2();
439877
439874
  init_loggers();
439878
- init_types6();
439875
+ init_types5();
439879
439876
  init_modelAvailabilityService();
439880
439877
  init_modelRouterService();
439881
439878
  init_types17();
@@ -439888,7 +439885,7 @@ var init_config4 = __esm({
439888
439885
  init_ignorePatterns();
439889
439886
  init_message_bus();
439890
439887
  init_policy_engine();
439891
- init_types2();
439888
+ init_types();
439892
439889
  init_hooks();
439893
439890
  init_codeAssist();
439894
439891
  init_experiments();
@@ -446805,7 +446802,7 @@ var init_sessionSummaryService = __esm({
446805
446802
  init_geminiRequest();
446806
446803
  init_debugLogger();
446807
446804
  init_partUtils();
446808
- init_types6();
446805
+ init_types5();
446809
446806
  DEFAULT_MAX_MESSAGES = 20;
446810
446807
  DEFAULT_TIMEOUT_MS = 5e3;
446811
446808
  MAX_MESSAGE_LENGTH = 500;
@@ -447251,7 +447248,7 @@ var init_read_many_files = __esm({
447251
447248
  init_metrics2();
447252
447249
  init_telemetry_utils();
447253
447250
  init_loggers();
447254
- init_types6();
447251
+ init_types5();
447255
447252
  init_tool_error();
447256
447253
  init_tool_names();
447257
447254
  init_coreTools();
@@ -447711,13 +447708,13 @@ var init_src2 = __esm({
447711
447708
  init_types17();
447712
447709
  init_json_formatter();
447713
447710
  init_stream_json_formatter();
447714
- init_types2();
447711
+ init_types();
447715
447712
  init_policy_engine();
447716
447713
  init_toml_loader();
447717
447714
  init_config3();
447718
447715
  init_integrity();
447719
447716
  init_billing2();
447720
- init_types4();
447717
+ init_types3();
447721
447718
  init_message_bus();
447722
447719
  init_extensions();
447723
447720
  init_restore();
@@ -447736,7 +447733,7 @@ var init_src2 = __esm({
447736
447733
  init_geminiRequest();
447737
447734
  init_coreToolScheduler();
447738
447735
  init_scheduler2();
447739
- init_types3();
447736
+ init_types2();
447740
447737
  init_tool_executor();
447741
447738
  init_recordingContentGenerator();
447742
447739
  init_types20();
@@ -447775,7 +447772,7 @@ var init_src2 = __esm({
447775
447772
  init_fileDiffUtils();
447776
447773
  init_retry();
447777
447774
  init_shell_utils();
447778
- init_types2();
447775
+ init_types();
447779
447776
  init_tool_utils();
447780
447777
  init_terminalSerializer();
447781
447778
  init_systemEncoding();
@@ -448122,6 +448119,7 @@ __export(dist_exports, {
448122
448119
  ExtensionLoader: () => ExtensionLoader,
448123
448120
  ExtensionUninstallEvent: () => ExtensionUninstallEvent,
448124
448121
  ExtensionUpdateEvent: () => ExtensionUpdateEvent,
448122
+ FORCE_FILE_STORAGE_ENV_VAR: () => FORCE_FILE_STORAGE_ENV_VAR,
448125
448123
  FRONTMATTER_REGEX: () => FRONTMATTER_REGEX,
448126
448124
  FatalAuthenticationError: () => FatalAuthenticationError,
448127
448125
  FatalCancellationError: () => FatalCancellationError,
@@ -448846,7 +448844,7 @@ var init_dist7 = __esm({
448846
448844
  init_config4();
448847
448845
  init_detect_ide();
448848
448846
  init_loggers();
448849
- init_types6();
448847
+ init_types5();
448850
448848
  init_config5();
448851
448849
  init_pathReader();
448852
448850
  init_clearcut_logger();
@@ -528062,7 +528060,7 @@ var WarningMessage = ({ text }) => {
528062
528060
  };
528063
528061
 
528064
528062
  // packages/cli/src/generated/git-commit.ts
528065
- var GIT_COMMIT_INFO2 = "881822fab";
528063
+ var GIT_COMMIT_INFO2 = "25bb21ed7";
528066
528064
 
528067
528065
  // packages/cli/src/ui/components/AboutBox.tsx
528068
528066
  init_dist7();
@@ -576943,7 +576941,7 @@ async function loadSandboxConfig(settings, argv) {
576943
576941
  const sandboxOption = argv.sandbox ?? settings.tools?.sandbox;
576944
576942
  const command2 = getSandboxCommand(sandboxOption);
576945
576943
  const packageJson2 = await getPackageJson(__dirname13);
576946
- const image3 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.34.0-preview.1" ?? packageJson2?.config?.sandboxImageUri;
576944
+ const image3 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.34.0-preview.3" ?? packageJson2?.config?.sandboxImageUri;
576947
576945
  return command2 && image3 ? { command: command2, image: image3 } : void 0;
576948
576946
  }
576949
576947