@google/gemini-cli 0.63.0-nightly.20260928.g2fe7c2d3f → 0.63.0-preview.0

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.
Files changed (66) hide show
  1. package/bundle/{chunk-QX7M3XMQ.js → chunk-2J6RC447.js} +3 -3
  2. package/bundle/{chunk-DEI3TS7C.js → chunk-2NCBQURB.js} +125 -47
  3. package/bundle/{chunk-C2KZGMGL.js → chunk-2P4ETAEG.js} +1 -1
  4. package/bundle/{chunk-QYTRARRL.js → chunk-5VYF5TVF.js} +30 -3
  5. package/bundle/{chunk-EATZTV2L.js → chunk-B2C7BQ4Z.js} +7 -7
  6. package/bundle/{chunk-2AXHER6I.js → chunk-BVDTRESW.js} +1 -1
  7. package/bundle/{chunk-I5ZBUXWS.js → chunk-CTL6DZSY.js} +1 -1
  8. package/bundle/{chunk-7ZCWMSGJ.js → chunk-EIMVJG2V.js} +1 -1
  9. package/bundle/{chunk-4SQTLFVK.js → chunk-EWEUWTBB.js} +58 -71
  10. package/bundle/{chunk-LNPKSDNP.js → chunk-GRSO6OI3.js} +7 -7
  11. package/bundle/{chunk-SJFSOFYJ.js → chunk-H4WLRV6U.js} +30 -3
  12. package/bundle/{chunk-ERMD62K5.js → chunk-HBZBBLAV.js} +14860 -7829
  13. package/bundle/{chunk-YZPLV23A.js → chunk-JEUVKR2X.js} +3 -3
  14. package/bundle/{chunk-KRI5JA76.js → chunk-KCB54UJ5.js} +73 -17
  15. package/bundle/{chunk-ZAM747AR.js → chunk-KPPDDNGJ.js} +1 -1
  16. package/bundle/{chunk-SZK5XAFL.js → chunk-NTWFJ2RF.js} +30 -3
  17. package/bundle/{chunk-B3EF23HT.js → chunk-NWSCUKK3.js} +70 -19
  18. package/bundle/{chunk-I7XQQVIO.js → chunk-R6Q6D3UA.js} +1 -1
  19. package/bundle/{chunk-RFR5KZGU.js → chunk-RC6VJ6FT.js} +126 -47
  20. package/bundle/{chunk-PGIM2K4Q.js → chunk-RXHIISMM.js} +1 -1
  21. package/bundle/{chunk-UOXIYBXB.js → chunk-SNGNFODQ.js} +1 -1
  22. package/bundle/{chunk-KSWUQTWU.js → chunk-UEOEM4H5.js} +3 -3
  23. package/bundle/{chunk-4PBNRKYJ.js → chunk-Z5RCAIV5.js} +129 -53
  24. package/bundle/{chunk-BRTA6WWG.js → chunk-ZDQYLJYN.js} +8 -9
  25. package/bundle/{cleanup-5PD3O5L7.js → cleanup-EX2L3L3E.js} +2 -2
  26. package/bundle/{cleanup-6IDD7Q3X.js → cleanup-IT7XR7KS.js} +2 -2
  27. package/bundle/{cleanup-7UL3PRLF.js → cleanup-WWLYKZIX.js} +2 -2
  28. package/bundle/{core-IIFMZU4H.js → core-D5D4MF5H.js} +3 -1
  29. package/bundle/{dist-5HHK4577.js → core-GAJB2LOX.js} +3 -1
  30. package/bundle/{devtoolsService-AK7UU2FI.js → devtoolsService-4YTFHHPN.js} +2 -2
  31. package/bundle/{devtoolsService-A7VWEFDQ.js → devtoolsService-S4ZTRGJL.js} +3 -4
  32. package/bundle/{devtoolsService-67KG4JD7.js → devtoolsService-TJPENQSW.js} +2 -2
  33. package/bundle/{dist-I74UZ4GA.js → dist-MTMOCTIW.js} +3 -1
  34. package/bundle/{gemini-OFIYPHV5.js → gemini-5T5BS7L7.js} +14 -14
  35. package/bundle/{gemini-PGIEQLQD.js → gemini-FHORRYHM.js} +13 -13
  36. package/bundle/{gemini-PLPMSDXJ.js → gemini-UQRS6TBE.js} +198 -214
  37. package/bundle/gemini.js +20 -11
  38. package/bundle/{interactiveCli-JLFFVRVY.js → interactiveCli-5YNYZTMK.js} +18 -10
  39. package/bundle/{interactiveCli-JF6LE6RN.js → interactiveCli-I5K7O5Z6.js} +18 -10
  40. package/bundle/{interactiveCli-OG4JE4CU.js → interactiveCli-WOM6QZHM.js} +302 -313
  41. package/bundle/{liteRtServerManager-4LVWWKUV.js → liteRtServerManager-3N5KI6YS.js} +4 -4
  42. package/bundle/{liteRtServerManager-DVDNFJNH.js → liteRtServerManager-EH2L2UVH.js} +4 -4
  43. package/bundle/{liteRtServerManager-G4WG2Q45.js → liteRtServerManager-ZLIHBLZP.js} +4 -4
  44. package/bundle/{oauth2-provider-KPLVYPVA.js → oauth2-provider-5GFYTXFU.js} +1 -1
  45. package/bundle/{oauth2-provider-IBKEWCFT.js → oauth2-provider-NGSH2JQK.js} +72 -38
  46. package/bundle/{oauth2-provider-CEQ4PAUC.js → oauth2-provider-TA2KRXWQ.js} +1 -1
  47. package/bundle/{start-2A3VVOAH.js → start-CWI6OP6N.js} +6 -6
  48. package/bundle/{start-6PINHVUA.js → start-M3IUNCYH.js} +6 -6
  49. package/bundle/{start-BZAGKSC2.js → start-MWDNIQUY.js} +6 -6
  50. package/package.json +1 -1
  51. package/bundle/chunk-5G7FE6LZ.js +0 -102951
  52. package/bundle/chunk-EORMOPQX.js +0 -17368
  53. package/bundle/chunk-EYGY6SJV.js +0 -512
  54. package/bundle/chunk-KCZCDPS2.js +0 -398
  55. package/bundle/chunk-PAIQESPE.js +0 -118
  56. package/bundle/chunk-TXWIPUPY.js +0 -400484
  57. package/bundle/chunk-VAGYZO4R.js +0 -1571
  58. package/bundle/chunk-VNGBTT2C.js +0 -154
  59. package/bundle/cleanup-UTIIPF3A.js +0 -32
  60. package/bundle/devtoolsService-REQSIEPU.js +0 -4359
  61. package/bundle/dist-QMOHSH2B.js +0 -2248
  62. package/bundle/gemini-I47O5YI2.js +0 -17863
  63. package/bundle/interactiveCli-CJEDKYUL.js +0 -34907
  64. package/bundle/liteRtServerManager-MZO6JMNV.js +0 -65
  65. package/bundle/oauth2-provider-UHJTSOLD.js +0 -235
  66. package/bundle/start-ZRUVAD7P.js +0 -18
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-I7XQQVIO.js";
5
+ } from "./chunk-R6Q6D3UA.js";
6
6
  import {
7
7
  DEFAULT_PORT,
8
8
  SERVER_START_WAIT_MS,
@@ -14,10 +14,10 @@ import {
14
14
  isServerRunning,
15
15
  resolveGemmaConfig,
16
16
  writeServerProcessInfo
17
- } from "./chunk-EORMOPQX.js";
17
+ } from "./chunk-2NCBQURB.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-B3EF23HT.js";
20
+ } from "./chunk-NWSCUKK3.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -254248,7 +254248,7 @@ function sanitizeFilenamePart(part) {
254248
254248
  return part.replace(/[^a-zA-Z0-9_-]/g, "_");
254249
254249
  }
254250
254250
  function formatTruncatedToolOutput(contentStr, outputFile, maxChars) {
254251
- if (contentStr.length <= maxChars) return contentStr;
254251
+ if (maxChars <= 0 || contentStr.length <= maxChars) return contentStr;
254252
254252
  const headChars = Math.floor(maxChars * 0.2);
254253
254253
  const tailChars = maxChars - headChars;
254254
254254
  const head = contentStr.slice(0, headChars);
@@ -279008,10 +279008,25 @@ var KeychainService = class {
279008
279008
  getKeychain() {
279009
279009
  return this.initializationPromise ??= this.initializeKeychain();
279010
279010
  }
279011
+ isWsl() {
279012
+ if (os16.platform() !== "linux") {
279013
+ return false;
279014
+ }
279015
+ return !!(process.env["WSL_DISTRO_NAME"] || process.env["WSLENV"] || process.env["WSL_INTEROP"]);
279016
+ }
279011
279017
  // High-level orchestration of the loading and testing cycle.
279012
279018
  async initializeKeychain() {
279013
279019
  const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
279014
- const nativeKeychain = forceFileStorage ? null : await this.getNativeKeychain();
279020
+ let nativeKeychain = null;
279021
+ if (!forceFileStorage) {
279022
+ if (this.isWsl()) {
279023
+ debugLogger.debug(
279024
+ "WSL environment detected; bypassing native keychain to prevent libsecret lockups."
279025
+ );
279026
+ } else {
279027
+ nativeKeychain = await this.getNativeKeychain();
279028
+ }
279029
+ }
279015
279030
  coreEvents.emitTelemetryKeychainAvailability(
279016
279031
  new KeychainAvailabilityEvent(nativeKeychain !== null)
279017
279032
  );
@@ -280123,6 +280138,24 @@ function getAvailablePort() {
280123
280138
  }
280124
280139
  });
280125
280140
  }
280141
+ async function readOAuthCredsWithRetry(filePath, maxRetries = 3) {
280142
+ let attempt = 0;
280143
+ while (attempt < maxRetries) {
280144
+ try {
280145
+ return await fs28.readFile(filePath, "utf-8");
280146
+ } catch (err2) {
280147
+ if (err2 && typeof err2 === "object" && "code" in err2 && err2.code === "ENOENT") {
280148
+ throw err2;
280149
+ }
280150
+ attempt++;
280151
+ if (attempt >= maxRetries) {
280152
+ throw err2;
280153
+ }
280154
+ await new Promise((resolve29) => setTimeout(resolve29, 25 * attempt));
280155
+ }
280156
+ }
280157
+ return "";
280158
+ }
280126
280159
  async function fetchCachedCredentialsList() {
280127
280160
  const credentialsList = [];
280128
280161
  const useEncryptedStorage = getUseEncryptedStorageFlag();
@@ -280145,7 +280178,7 @@ async function fetchCachedCredentialsList() {
280145
280178
  ].filter((p) => !!p);
280146
280179
  for (const keyFile of pathsToTry) {
280147
280180
  try {
280148
- const keyFileString = await fs28.readFile(keyFile, "utf-8");
280181
+ const keyFileString = await readOAuthCredsWithRetry(keyFile);
280149
280182
  const parsed = JSON.parse(keyFileString);
280150
280183
  const isOAuthCreds = (val) => typeof val === "object" && val !== null;
280151
280184
  if (isOAuthCreds(parsed)) {
@@ -280210,12 +280243,14 @@ async function fetchAndCacheUserInfo(client) {
280210
280243
  function resetOauthClientForTesting() {
280211
280244
  oauthClientPromises.clear();
280212
280245
  }
280246
+ var tempCounter = 0;
280213
280247
  async function cacheCredentials(credentials3) {
280214
280248
  const filePath = Storage.getOAuthCredsPath();
280215
- await fs28.mkdir(path26.dirname(filePath), { recursive: true });
280249
+ const dirPath = path26.dirname(filePath);
280250
+ await fs28.mkdir(dirPath, { recursive: true });
280216
280251
  let existing = {};
280217
280252
  try {
280218
- const existingContent = await fs28.readFile(filePath, "utf-8");
280253
+ const existingContent = await readOAuthCredsWithRetry(filePath);
280219
280254
  const parsed = JSON.parse(existingContent);
280220
280255
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
280221
280256
  existing = parsed;
@@ -280236,7 +280271,24 @@ async function cacheCredentials(credentials3) {
280236
280271
  ...cleanCredentials
280237
280272
  };
280238
280273
  const credString = JSON.stringify(finalCredentials, null, 2);
280239
- await fs28.writeFile(filePath, credString, { mode: 384 });
280274
+ const tempPath = path26.join(
280275
+ dirPath,
280276
+ `.${path26.basename(filePath)}.${process.pid}.${Date.now()}.${tempCounter++}.tmp`
280277
+ );
280278
+ try {
280279
+ await fs28.writeFile(tempPath, credString, { mode: 384 });
280280
+ try {
280281
+ await fs28.chmod(tempPath, 384);
280282
+ } catch {
280283
+ }
280284
+ await fs28.rename(tempPath, filePath);
280285
+ } catch {
280286
+ try {
280287
+ await fs28.rm(tempPath, { force: true });
280288
+ } catch {
280289
+ }
280290
+ await fs28.writeFile(filePath, credString, { mode: 384 });
280291
+ }
280240
280292
  try {
280241
280293
  await fs28.chmod(filePath, 384);
280242
280294
  } catch {
@@ -283760,7 +283812,7 @@ function isValidToolName(name3, options = {}) {
283760
283812
  }
283761
283813
 
283762
283814
  // packages/core/src/generated/git-commit.ts
283763
- var GIT_COMMIT_INFO = "2fe7c2d3f";
283815
+ var GIT_COMMIT_INFO = "d75234cae";
283764
283816
  var CLI_VERSION = "0.63.0-nightly.20260923.gf50ba8608";
283765
283817
 
283766
283818
  // packages/core/src/ide/detect-ide.ts
@@ -336678,6 +336730,15 @@ You are operating with a persistent file-based task tracking system located at \
336678
336730
  }
336679
336731
  function renderPlanningWorkflow(options) {
336680
336732
  if (!options) return "";
336733
+ const consultSection = options.interactive ? `### 2. Consult
336734
+ The depth of your consultation should be proportional to the task's complexity. Before proceeding to Step 3 (Draft), you MUST discuss your findings and proposed strategy with the user to reach an informal agreement.
336735
+ - **Simple Tasks:** Briefly describe your proposed strategy in the chat to ensure alignment, then **STOP and wait** for the user to confirm agreement before drafting the plan.
336736
+ - **Standard Tasks:** If multiple viable approaches exist, present a concise summary (including pros/cons and your recommendation) via ${formatToolName(ASK_USER_TOOL_NAME)} and wait for a decision.
336737
+ - **Complex Tasks:** You MUST present at least two viable approaches with detailed trade-offs via ${formatToolName(ASK_USER_TOOL_NAME)} and obtain approval before drafting the plan.
336738
+
336739
+ **CRITICAL:** You MUST NOT proceed to Step 3 (Draft) or Step 4 (Review & Approval) in the same turn as your initial strategy proposal. You MUST wait for user feedback and reach a clear agreement before drafting or submitting the plan.` : `### 2. Determine Strategy
336740
+ Synthesize your exploration findings to select the best approach and implementation strategy. Because you are running non-interactively, proceed directly to Step 3 (Draft) autonomously without halting or waiting for user confirmation.`;
336741
+ const reviewAndApprovalSection = options.interactive ? `ONLY use the built-in ${formatToolName(EXIT_PLAN_MODE_TOOL_NAME)} tool to present the plan for formal approval AFTER you have reached an informal agreement with the user in the chat regarding the proposed strategy. **CRITICAL: NEVER attempt to call this tool via ${formatToolName(SHELL_TOOL_NAME)}.** When called, this tool will present the plan and formally request approval.` : `Use the built-in ${formatToolName(EXIT_PLAN_MODE_TOOL_NAME)} tool to finalize the plan. **CRITICAL: NEVER attempt to call this tool via ${formatToolName(SHELL_TOOL_NAME)}.** When called, this tool will present the plan and begin implementation.`;
336681
336742
  return `
336682
336743
  # Active Approval Mode: Plan
336683
336744
 
@@ -336692,7 +336753,7 @@ ${options.planModeToolsList}
336692
336753
  ## Rules
336693
336754
  1. **Read-Only:** You cannot modify source code. You may ONLY use read-only tools to explore, and you can only write to \`${options.plansDir}/\`. If the user asks you to modify source code directly, you MUST explain that you are in Plan Mode and must first create a plan and get approval.
336694
336755
  2. **Write Constraint:** ${formatToolName(WRITE_FILE_TOOL_NAME)} and ${formatToolName(EDIT_TOOL_NAME)} may ONLY be used to write .md plan files to \`${options.plansDir}/\`. They cannot modify source code.
336695
- 3. **Efficiency:** Autonomously combine discovery and drafting phases to minimize conversational turns. If the request is ambiguous, use ${formatToolName(ASK_USER_TOOL_NAME)} to clarify. Use multi-select to offer flexibility and include detailed descriptions for each option to help the user understand the implications of their choice.
336756
+ 3. **Efficiency:** Autonomously combine discovery and drafting phases to minimize conversational turns.${options.interactive ? ` If the request is ambiguous, use ${formatToolName(ASK_USER_TOOL_NAME)} to clarify. Use multi-select to offer flexibility and include detailed descriptions for each option to help the user understand the implications of their choice.` : ""}
336696
336757
  4. **Inquiries and Directives:** Distinguish between Inquiries and Directives to minimize unnecessary planning.
336697
336758
  - **Inquiries:** If the request is an **Inquiry** (e.g., "How does X work?"), answer directly. DO NOT create a plan.
336698
336759
  - **Directives:** If the request is a **Directive** (e.g., "Fix bug Y"), follow the workflow below.
@@ -336706,13 +336767,7 @@ Plan Mode uses an adaptive planning workflow where the research depth, plan stru
336706
336767
  ### 1. Explore & Analyze
336707
336768
  Analyze requirements and use search/read tools to explore the codebase. Systematically map affected modules, trace data flow, and identify dependencies.
336708
336769
 
336709
- ### 2. Consult
336710
- The depth of your consultation should be proportional to the task's complexity. Before proceeding to Step 3 (Draft), you MUST discuss your findings and proposed strategy with the user to reach an informal agreement.
336711
- - **Simple Tasks:** Briefly describe your proposed strategy in the chat to ensure alignment, then **STOP and wait** for the user to confirm agreement before drafting the plan.
336712
- - **Standard Tasks:** If multiple viable approaches exist, present a concise summary (including pros/cons and your recommendation) via ${formatToolName(ASK_USER_TOOL_NAME)} and wait for a decision.
336713
- - **Complex Tasks:** You MUST present at least two viable approaches with detailed trade-offs via ${formatToolName(ASK_USER_TOOL_NAME)} and obtain approval before drafting the plan.
336714
-
336715
- **CRITICAL:** You MUST NOT proceed to Step 3 (Draft) or Step 4 (Review & Approval) in the same turn as your initial strategy proposal. You MUST wait for user feedback and reach a clear agreement before drafting or submitting the plan.
336770
+ ${consultSection}
336716
336771
 
336717
336772
  ### 3. Draft
336718
336773
  Write the implementation plan to \`${options.plansDir}/\`. The plan's structure adapts to the task:
@@ -336721,7 +336776,7 @@ Write the implementation plan to \`${options.plansDir}/\`. The plan's structure
336721
336776
  - **Complex Tasks:** Include **Background & Motivation**, **Scope & Impact**, **Proposed Solution**, **Alternatives Considered**, a phased **Implementation Plan**, **Verification**, and **Migration & Rollback** strategies.${options.interactive ? "\n- **Alignment Check:** After drafting the plan, you MUST present it to the user in the chat (adhering to Rule 7 for presenting plans) to ensure alignment on the specific details. Ask for feedback or confirmation, and proceed to Step 4 (Review & Approval) once the user agrees with the detailed plan." : ""}
336722
336777
 
336723
336778
  ### 4. Review & Approval
336724
- ONLY use the built-in ${formatToolName(EXIT_PLAN_MODE_TOOL_NAME)} tool to present the plan for formal approval AFTER you have reached an informal agreement with the user in the chat regarding the proposed strategy. **CRITICAL: NEVER attempt to call this tool via ${formatToolName(SHELL_TOOL_NAME)}.** When called, this tool will present the plan and ${options.interactive ? "formally request approval." : "begin implementation."}
336779
+ ${reviewAndApprovalSection}
336725
336780
 
336726
336781
  ${renderApprovedPlanSection(options.approvedPlanPath)}`.trim();
336727
336782
  }
@@ -343794,7 +343849,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
343794
343849
  return provider;
343795
343850
  }
343796
343851
  case "oauth2": {
343797
- const { OAuth2AuthProvider } = await import("./oauth2-provider-KPLVYPVA.js");
343852
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-NGSH2JQK.js");
343798
343853
  const provider = new OAuth2AuthProvider(
343799
343854
  authConfig,
343800
343855
  options.agentName ?? "unknown",
@@ -405989,6 +406044,7 @@ export {
405989
406044
  authEvents,
405990
406045
  getOauthClient,
405991
406046
  getAvailablePort,
406047
+ readOAuthCredsWithRetry,
405992
406048
  clearOauthClientCache,
405993
406049
  clearCachedCredentialFile,
405994
406050
  resetOauthClientForTesting,
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  checkExhaustive
4
- } from "./chunk-KRI5JA76.js";
4
+ } from "./chunk-HBZBBLAV.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM
@@ -1,13 +1,13 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-2AXHER6I.js";
4
+ } from "./chunk-RXHIISMM.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-TXWIPUPY.js";
10
+ } from "./chunk-NWSCUKK3.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -332,10 +332,37 @@ function setUpdateHandler(addItem, setUpdateInfo) {
332
332
  // packages/cli/src/utils/processUtils.ts
333
333
  var RELAUNCH_EXIT_CODE = 199;
334
334
  var isRelaunching = false;
335
- async function relaunchApp() {
335
+ async function relaunchApp(options) {
336
336
  if (isRelaunching) return;
337
337
  isRelaunching = true;
338
338
  await waitForUpdateCompletion();
339
+ if (process.send && !process.env["VITEST"] && options?.overrideAuthType) {
340
+ await new Promise((resolve) => {
341
+ let resolved = false;
342
+ const done = () => {
343
+ if (!resolved) {
344
+ resolved = true;
345
+ resolve();
346
+ }
347
+ };
348
+ const timeout = setTimeout(done, 500);
349
+ try {
350
+ process.send(
351
+ {
352
+ type: "auth-selected-type",
353
+ authType: options.overrideAuthType
354
+ },
355
+ () => {
356
+ clearTimeout(timeout);
357
+ done();
358
+ }
359
+ );
360
+ } catch {
361
+ clearTimeout(timeout);
362
+ done();
363
+ }
364
+ });
365
+ }
339
366
  await runExitCleanup();
340
367
  process.exit(RELAUNCH_EXIT_CODE);
341
368
  }
@@ -254169,7 +254169,7 @@ function sanitizeFilenamePart(part) {
254169
254169
  return part.replace(/[^a-zA-Z0-9_-]/g, "_");
254170
254170
  }
254171
254171
  function formatTruncatedToolOutput(contentStr, outputFile, maxChars) {
254172
- if (contentStr.length <= maxChars)
254172
+ if (maxChars <= 0 || contentStr.length <= maxChars)
254173
254173
  return contentStr;
254174
254174
  const headChars = Math.floor(maxChars * 0.2);
254175
254175
  const tailChars = maxChars - headChars;
@@ -278704,10 +278704,23 @@ var KeychainService = class {
278704
278704
  getKeychain() {
278705
278705
  return this.initializationPromise ??= this.initializeKeychain();
278706
278706
  }
278707
+ isWsl() {
278708
+ if (os16.platform() !== "linux") {
278709
+ return false;
278710
+ }
278711
+ return !!(process.env["WSL_DISTRO_NAME"] || process.env["WSLENV"] || process.env["WSL_INTEROP"]);
278712
+ }
278707
278713
  // High-level orchestration of the loading and testing cycle.
278708
278714
  async initializeKeychain() {
278709
278715
  const forceFileStorage = process.env[FORCE_FILE_STORAGE_ENV_VAR] === "true";
278710
- const nativeKeychain = forceFileStorage ? null : await this.getNativeKeychain();
278716
+ let nativeKeychain = null;
278717
+ if (!forceFileStorage) {
278718
+ if (this.isWsl()) {
278719
+ debugLogger.debug("WSL environment detected; bypassing native keychain to prevent libsecret lockups.");
278720
+ } else {
278721
+ nativeKeychain = await this.getNativeKeychain();
278722
+ }
278723
+ }
278711
278724
  coreEvents.emitTelemetryKeychainAvailability(new KeychainAvailabilityEvent(nativeKeychain !== null));
278712
278725
  if (nativeKeychain) {
278713
278726
  return nativeKeychain;
@@ -279676,6 +279689,24 @@ function getAvailablePort() {
279676
279689
  }
279677
279690
  });
279678
279691
  }
279692
+ async function readOAuthCredsWithRetry(filePath, maxRetries = 3) {
279693
+ let attempt = 0;
279694
+ while (attempt < maxRetries) {
279695
+ try {
279696
+ return await fs28.readFile(filePath, "utf-8");
279697
+ } catch (err2) {
279698
+ if (err2 && typeof err2 === "object" && "code" in err2 && err2.code === "ENOENT") {
279699
+ throw err2;
279700
+ }
279701
+ attempt++;
279702
+ if (attempt >= maxRetries) {
279703
+ throw err2;
279704
+ }
279705
+ await new Promise((resolve29) => setTimeout(resolve29, 25 * attempt));
279706
+ }
279707
+ }
279708
+ return "";
279709
+ }
279679
279710
  async function fetchCachedCredentialsList() {
279680
279711
  const credentialsList = [];
279681
279712
  const useEncryptedStorage = getUseEncryptedStorageFlag();
@@ -279695,7 +279726,7 @@ async function fetchCachedCredentialsList() {
279695
279726
  ].filter((p) => !!p);
279696
279727
  for (const keyFile of pathsToTry) {
279697
279728
  try {
279698
- const keyFileString = await fs28.readFile(keyFile, "utf-8");
279729
+ const keyFileString = await readOAuthCredsWithRetry(keyFile);
279699
279730
  const parsed = JSON.parse(keyFileString);
279700
279731
  const isOAuthCreds = (val) => typeof val === "object" && val !== null;
279701
279732
  if (isOAuthCreds(parsed)) {
@@ -279750,12 +279781,14 @@ async function fetchAndCacheUserInfo(client) {
279750
279781
  function resetOauthClientForTesting() {
279751
279782
  oauthClientPromises.clear();
279752
279783
  }
279784
+ var tempCounter = 0;
279753
279785
  async function cacheCredentials(credentials3) {
279754
279786
  const filePath = Storage.getOAuthCredsPath();
279755
- await fs28.mkdir(path26.dirname(filePath), { recursive: true });
279787
+ const dirPath = path26.dirname(filePath);
279788
+ await fs28.mkdir(dirPath, { recursive: true });
279756
279789
  let existing = {};
279757
279790
  try {
279758
- const existingContent = await fs28.readFile(filePath, "utf-8");
279791
+ const existingContent = await readOAuthCredsWithRetry(filePath);
279759
279792
  const parsed = JSON.parse(existingContent);
279760
279793
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
279761
279794
  existing = parsed;
@@ -279772,7 +279805,21 @@ async function cacheCredentials(credentials3) {
279772
279805
  ...cleanCredentials
279773
279806
  };
279774
279807
  const credString = JSON.stringify(finalCredentials, null, 2);
279775
- await fs28.writeFile(filePath, credString, { mode: 384 });
279808
+ const tempPath = path26.join(dirPath, `.${path26.basename(filePath)}.${process.pid}.${Date.now()}.${tempCounter++}.tmp`);
279809
+ try {
279810
+ await fs28.writeFile(tempPath, credString, { mode: 384 });
279811
+ try {
279812
+ await fs28.chmod(tempPath, 384);
279813
+ } catch {
279814
+ }
279815
+ await fs28.rename(tempPath, filePath);
279816
+ } catch {
279817
+ try {
279818
+ await fs28.rm(tempPath, { force: true });
279819
+ } catch {
279820
+ }
279821
+ await fs28.writeFile(filePath, credString, { mode: 384 });
279822
+ }
279776
279823
  try {
279777
279824
  await fs28.chmod(filePath, 384);
279778
279825
  } catch {
@@ -283453,8 +283500,8 @@ function isValidToolName(name3, options = {}) {
283453
283500
  }
283454
283501
 
283455
283502
  // packages/core/dist/src/generated/git-commit.js
283456
- var GIT_COMMIT_INFO = "2fe7c2d3f";
283457
- var CLI_VERSION = "0.63.0-nightly.20260923.gf50ba8608";
283503
+ var GIT_COMMIT_INFO = "d75234cae";
283504
+ var CLI_VERSION = "0.63.0-preview.0";
283458
283505
 
283459
283506
  // packages/core/dist/src/ide/detect-ide.js
283460
283507
  var IDE_DEFINITIONS = {
@@ -306753,7 +306800,7 @@ function getVersion() {
306753
306800
  }
306754
306801
  versionPromise = (async () => {
306755
306802
  const pkgJson = await getPackageJson(__dirname4);
306756
- return "0.63.0-nightly.20260928.g2fe7c2d3f";
306803
+ return "0.63.0-preview.0";
306757
306804
  })();
306758
306805
  return versionPromise;
306759
306806
  }
@@ -334137,6 +334184,15 @@ You are operating with a persistent file-based task tracking system located at \
334137
334184
  function renderPlanningWorkflow(options) {
334138
334185
  if (!options)
334139
334186
  return "";
334187
+ const consultSection = options.interactive ? `### 2. Consult
334188
+ The depth of your consultation should be proportional to the task's complexity. Before proceeding to Step 3 (Draft), you MUST discuss your findings and proposed strategy with the user to reach an informal agreement.
334189
+ - **Simple Tasks:** Briefly describe your proposed strategy in the chat to ensure alignment, then **STOP and wait** for the user to confirm agreement before drafting the plan.
334190
+ - **Standard Tasks:** If multiple viable approaches exist, present a concise summary (including pros/cons and your recommendation) via ${formatToolName(ASK_USER_TOOL_NAME)} and wait for a decision.
334191
+ - **Complex Tasks:** You MUST present at least two viable approaches with detailed trade-offs via ${formatToolName(ASK_USER_TOOL_NAME)} and obtain approval before drafting the plan.
334192
+
334193
+ **CRITICAL:** You MUST NOT proceed to Step 3 (Draft) or Step 4 (Review & Approval) in the same turn as your initial strategy proposal. You MUST wait for user feedback and reach a clear agreement before drafting or submitting the plan.` : `### 2. Determine Strategy
334194
+ Synthesize your exploration findings to select the best approach and implementation strategy. Because you are running non-interactively, proceed directly to Step 3 (Draft) autonomously without halting or waiting for user confirmation.`;
334195
+ const reviewAndApprovalSection = options.interactive ? `ONLY use the built-in ${formatToolName(EXIT_PLAN_MODE_TOOL_NAME)} tool to present the plan for formal approval AFTER you have reached an informal agreement with the user in the chat regarding the proposed strategy. **CRITICAL: NEVER attempt to call this tool via ${formatToolName(SHELL_TOOL_NAME)}.** When called, this tool will present the plan and formally request approval.` : `Use the built-in ${formatToolName(EXIT_PLAN_MODE_TOOL_NAME)} tool to finalize the plan. **CRITICAL: NEVER attempt to call this tool via ${formatToolName(SHELL_TOOL_NAME)}.** When called, this tool will present the plan and begin implementation.`;
334140
334196
  return `
334141
334197
  # Active Approval Mode: Plan
334142
334198
 
@@ -334151,7 +334207,7 @@ ${options.planModeToolsList}
334151
334207
  ## Rules
334152
334208
  1. **Read-Only:** You cannot modify source code. You may ONLY use read-only tools to explore, and you can only write to \`${options.plansDir}/\`. If the user asks you to modify source code directly, you MUST explain that you are in Plan Mode and must first create a plan and get approval.
334153
334209
  2. **Write Constraint:** ${formatToolName(WRITE_FILE_TOOL_NAME)} and ${formatToolName(EDIT_TOOL_NAME)} may ONLY be used to write .md plan files to \`${options.plansDir}/\`. They cannot modify source code.
334154
- 3. **Efficiency:** Autonomously combine discovery and drafting phases to minimize conversational turns. If the request is ambiguous, use ${formatToolName(ASK_USER_TOOL_NAME)} to clarify. Use multi-select to offer flexibility and include detailed descriptions for each option to help the user understand the implications of their choice.
334210
+ 3. **Efficiency:** Autonomously combine discovery and drafting phases to minimize conversational turns.${options.interactive ? ` If the request is ambiguous, use ${formatToolName(ASK_USER_TOOL_NAME)} to clarify. Use multi-select to offer flexibility and include detailed descriptions for each option to help the user understand the implications of their choice.` : ""}
334155
334211
  4. **Inquiries and Directives:** Distinguish between Inquiries and Directives to minimize unnecessary planning.
334156
334212
  - **Inquiries:** If the request is an **Inquiry** (e.g., "How does X work?"), answer directly. DO NOT create a plan.
334157
334213
  - **Directives:** If the request is a **Directive** (e.g., "Fix bug Y"), follow the workflow below.
@@ -334165,13 +334221,7 @@ Plan Mode uses an adaptive planning workflow where the research depth, plan stru
334165
334221
  ### 1. Explore & Analyze
334166
334222
  Analyze requirements and use search/read tools to explore the codebase. Systematically map affected modules, trace data flow, and identify dependencies.
334167
334223
 
334168
- ### 2. Consult
334169
- The depth of your consultation should be proportional to the task's complexity. Before proceeding to Step 3 (Draft), you MUST discuss your findings and proposed strategy with the user to reach an informal agreement.
334170
- - **Simple Tasks:** Briefly describe your proposed strategy in the chat to ensure alignment, then **STOP and wait** for the user to confirm agreement before drafting the plan.
334171
- - **Standard Tasks:** If multiple viable approaches exist, present a concise summary (including pros/cons and your recommendation) via ${formatToolName(ASK_USER_TOOL_NAME)} and wait for a decision.
334172
- - **Complex Tasks:** You MUST present at least two viable approaches with detailed trade-offs via ${formatToolName(ASK_USER_TOOL_NAME)} and obtain approval before drafting the plan.
334173
-
334174
- **CRITICAL:** You MUST NOT proceed to Step 3 (Draft) or Step 4 (Review & Approval) in the same turn as your initial strategy proposal. You MUST wait for user feedback and reach a clear agreement before drafting or submitting the plan.
334224
+ ${consultSection}
334175
334225
 
334176
334226
  ### 3. Draft
334177
334227
  Write the implementation plan to \`${options.plansDir}/\`. The plan's structure adapts to the task:
@@ -334180,7 +334230,7 @@ Write the implementation plan to \`${options.plansDir}/\`. The plan's structure
334180
334230
  - **Complex Tasks:** Include **Background & Motivation**, **Scope & Impact**, **Proposed Solution**, **Alternatives Considered**, a phased **Implementation Plan**, **Verification**, and **Migration & Rollback** strategies.${options.interactive ? "\n- **Alignment Check:** After drafting the plan, you MUST present it to the user in the chat (adhering to Rule 7 for presenting plans) to ensure alignment on the specific details. Ask for feedback or confirmation, and proceed to Step 4 (Review & Approval) once the user agrees with the detailed plan." : ""}
334181
334231
 
334182
334232
  ### 4. Review & Approval
334183
- ONLY use the built-in ${formatToolName(EXIT_PLAN_MODE_TOOL_NAME)} tool to present the plan for formal approval AFTER you have reached an informal agreement with the user in the chat regarding the proposed strategy. **CRITICAL: NEVER attempt to call this tool via ${formatToolName(SHELL_TOOL_NAME)}.** When called, this tool will present the plan and ${options.interactive ? "formally request approval." : "begin implementation."}
334233
+ ${reviewAndApprovalSection}
334184
334234
 
334185
334235
  ${renderApprovedPlanSection(options.approvedPlanPath)}`.trim();
334186
334236
  }
@@ -340939,7 +340989,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
340939
340989
  return provider;
340940
340990
  }
340941
340991
  case "oauth2": {
340942
- const { OAuth2AuthProvider } = await import("./oauth2-provider-CEQ4PAUC.js");
340992
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-TA2KRXWQ.js");
340943
340993
  const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
340944
340994
  await provider.initialize();
340945
340995
  return provider;
@@ -399014,6 +399064,7 @@ export {
399014
399064
  authEvents,
399015
399065
  getOauthClient,
399016
399066
  getAvailablePort,
399067
+ readOAuthCredsWithRetry,
399017
399068
  clearOauthClientCache,
399018
399069
  clearCachedCredentialFile,
399019
399070
  resetOauthClientForTesting,
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-I5ZBUXWS.js";
4
+ } from "./chunk-RXHIISMM.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require