@google/gemini-cli 0.54.0-preview.1 → 0.54.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bundle/{chunk-SBSLQYOV.js → chunk-4YSWDUQZ.js} +1 -1
  2. package/bundle/{chunk-JIT42EQ2.js → chunk-5NT754WV.js} +1 -1
  3. package/bundle/{chunk-DIJ6I3G3.js → chunk-6SBXH4D5.js} +1 -1
  4. package/bundle/{chunk-DPIHBZAT.js → chunk-7ELLCO6U.js} +2 -2
  5. package/bundle/{chunk-UZMDXL7Q.js → chunk-7SPI3KN6.js} +1 -1
  6. package/bundle/{chunk-CULEIHKX.js → chunk-B5CTWZND.js} +1 -1
  7. package/bundle/{chunk-D2EAX3ZX.js → chunk-BCKLMRS4.js} +3 -3
  8. package/bundle/{chunk-OGXJPYSG.js → chunk-BS6BSLZD.js} +98 -8
  9. package/bundle/{chunk-AFGG2RPD.js → chunk-D7ZXPN6G.js} +1 -1
  10. package/bundle/{chunk-K3SJRITH.js → chunk-DFZESNXJ.js} +3 -3
  11. package/bundle/{chunk-XE7YFMNO.js → chunk-DJWQKPM3.js} +1 -1
  12. package/bundle/{chunk-PEJMTAMT.js → chunk-FNQ3CHG6.js} +2 -2
  13. package/bundle/{chunk-RDYXVWPW.js → chunk-GHCTXZXJ.js} +3 -3
  14. package/bundle/{chunk-FMTFTARW.js → chunk-HX3M7TQG.js} +1 -1
  15. package/bundle/{chunk-RCBLHUUY.js → chunk-IJK6RPHE.js} +2 -2
  16. package/bundle/{chunk-SMLDN56O.js → chunk-IX4IHGFA.js} +1 -1
  17. package/bundle/{chunk-T6U6FIO7.js → chunk-K6DV6ZQJ.js} +1 -1
  18. package/bundle/{chunk-CVUISPMN.js → chunk-K77W7OAI.js} +2 -2
  19. package/bundle/{chunk-FXXIWHGQ.js → chunk-NWWVQCEM.js} +1 -1
  20. package/bundle/{chunk-VA3G5QBP.js → chunk-PGCIAGXU.js} +1 -1
  21. package/bundle/{chunk-TNVY3HW2.js → chunk-QXLHAGLO.js} +104 -8
  22. package/bundle/{chunk-525VQXSC.js → chunk-RJSQB7MD.js} +7 -7
  23. package/bundle/{chunk-MSUXP6KY.js → chunk-TOGB2OXA.js} +7 -7
  24. package/bundle/{chunk-ZPRVIRJI.js → chunk-TXL73KVK.js} +1 -1
  25. package/bundle/{chunk-RO4LFQ22.js → chunk-TYAF55F7.js} +98 -8
  26. package/bundle/{chunk-TTNCL6R2.js → chunk-UWHDOUIM.js} +1 -1
  27. package/bundle/{chunk-Z62YA2V7.js → chunk-WFY6AHA3.js} +1 -1
  28. package/bundle/{chunk-IO55T6DE.js → chunk-YFMY6TMN.js} +3 -3
  29. package/bundle/{chunk-ZHTU5ILJ.js → chunk-YMKYUNCI.js} +98 -8
  30. package/bundle/{chunk-YDQPFZ2Y.js → chunk-YOVSXRBK.js} +1 -1
  31. package/bundle/{chunk-IYJYJHOC.js → chunk-ZJ6RWJBB.js} +7 -7
  32. package/bundle/{chunk-UUIODUV3.js → chunk-ZT7DTH6P.js} +7 -7
  33. package/bundle/{cleanup-HQV2IFKH.js → cleanup-ID7KOVH6.js} +2 -2
  34. package/bundle/{cleanup-L5VWLPP4.js → cleanup-IQDM3OQH.js} +2 -2
  35. package/bundle/{cleanup-XXP2E7MI.js → cleanup-VC5QYANG.js} +2 -2
  36. package/bundle/{cleanup-ZVT5D3O6.js → cleanup-XKLXHTQY.js} +2 -2
  37. package/bundle/{core-57QOTUGQ.js → core-L2IMO77B.js} +3 -1
  38. package/bundle/{devtoolsService-ZSEA3CMZ.js → devtoolsService-A4MVL3QX.js} +2 -2
  39. package/bundle/{devtoolsService-35UP55Q3.js → devtoolsService-FCZAZ7OL.js} +2 -2
  40. package/bundle/{devtoolsService-3CR2FLT6.js → devtoolsService-MTKVT52L.js} +2 -2
  41. package/bundle/{devtoolsService-6ODDI2AX.js → devtoolsService-OFTYP7HA.js} +2 -2
  42. package/bundle/{dist-47AO7W6O.js → dist-IRKAN2JJ.js} +3 -1
  43. package/bundle/{dist-H6O2HKLX.js → dist-OMDZCEPS.js} +3 -1
  44. package/bundle/{dist-OQCDYU7F.js → dist-UPFVI32N.js} +3 -1
  45. package/bundle/{gemini-UCXGGSBW.js → gemini-A2H7FXLW.js} +14 -14
  46. package/bundle/{gemini-IDZJKL5P.js → gemini-ANKKRIYC.js} +14 -14
  47. package/bundle/{gemini-LO7DND33.js → gemini-RXM642S5.js} +14 -14
  48. package/bundle/{gemini-HAONW54R.js → gemini-TQ4IKPW2.js} +14 -14
  49. package/bundle/gemini.js +7 -7
  50. package/bundle/{interactiveCli-TRSGHNSO.js → interactiveCli-DCR23VNH.js} +21 -15
  51. package/bundle/{interactiveCli-6R7JZJ2X.js → interactiveCli-LU4ELYJR.js} +21 -15
  52. package/bundle/{interactiveCli-3ACLI4L7.js → interactiveCli-MMQJKAMI.js} +21 -15
  53. package/bundle/{interactiveCli-EHIAN3B3.js → interactiveCli-XFHD4NND.js} +21 -15
  54. package/bundle/{liteRtServerManager-3VYWFFDR.js → liteRtServerManager-3XISBZSR.js} +4 -4
  55. package/bundle/{liteRtServerManager-E5CRSVVL.js → liteRtServerManager-AW53PI2D.js} +4 -4
  56. package/bundle/{liteRtServerManager-VFS4GSUO.js → liteRtServerManager-D6QKXOSW.js} +4 -4
  57. package/bundle/{liteRtServerManager-XWQ4FJKY.js → liteRtServerManager-PKONORB7.js} +4 -4
  58. package/bundle/{oauth2-provider-3UXFRSIK.js → oauth2-provider-7KVPKQ4C.js} +1 -1
  59. package/bundle/{oauth2-provider-54DMURL5.js → oauth2-provider-CU4P6HIT.js} +1 -1
  60. package/bundle/{oauth2-provider-66YNXHST.js → oauth2-provider-MRWRX5R2.js} +1 -1
  61. package/bundle/{oauth2-provider-JGXWLD5K.js → oauth2-provider-NQD4RC5Z.js} +1 -1
  62. package/bundle/{start-2X7CSHIJ.js → start-7U2NBBF2.js} +6 -6
  63. package/bundle/{start-JT4SJ6FO.js → start-HBTVIGJK.js} +6 -6
  64. package/bundle/{start-LZJM7TIF.js → start-JQFBJ44Q.js} +6 -6
  65. package/bundle/{start-YHTESBGR.js → start-KLUMUSR7.js} +6 -6
  66. package/package.json +1 -1
@@ -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-SBSLQYOV.js";
5
+ } from "./chunk-DJWQKPM3.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-DIJ6I3G3.js";
62
+ } from "./chunk-6SBXH4D5.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-PEJMTAMT.js";
65
+ } from "./chunk-7ELLCO6U.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-T6U6FIO7.js";
69
+ } from "./chunk-K6DV6ZQJ.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -243,7 +243,7 @@ import {
243
243
  tokenLimit,
244
244
  uiTelemetryService,
245
245
  unescapePath
246
- } from "./chunk-ZHTU5ILJ.js";
246
+ } from "./chunk-TYAF55F7.js";
247
247
  import {
248
248
  require_src
249
249
  } from "./chunk-TUDYL3X4.js";
@@ -77176,7 +77176,7 @@ var authCommand = {
77176
77176
  import process29 from "node:process";
77177
77177
 
77178
77178
  // packages/cli/src/generated/git-commit.ts
77179
- var GIT_COMMIT_INFO = "d3c51f158";
77179
+ var GIT_COMMIT_INFO = "983bbb89d";
77180
77180
 
77181
77181
  // packages/cli/src/ui/utils/historyExportUtils.ts
77182
77182
  import * as fsPromises from "node:fs/promises";
@@ -82957,7 +82957,7 @@ Use /mcp auth <server-name> to authenticate.`
82957
82957
  type: "info",
82958
82958
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82959
82959
  });
82960
- const { MCPOAuthProvider } = await import("./dist-47AO7W6O.js");
82960
+ const { MCPOAuthProvider } = await import("./dist-OMDZCEPS.js");
82961
82961
  let oauthConfig = server.oauth;
82962
82962
  if (!oauthConfig) {
82963
82963
  oauthConfig = { enabled: false };
@@ -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-UZMDXL7Q.js";
5
+ } from "./chunk-B5CTWZND.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-ZPRVIRJI.js";
62
+ } from "./chunk-TXL73KVK.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-DPIHBZAT.js";
65
+ } from "./chunk-K77W7OAI.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-SMLDN56O.js";
69
+ } from "./chunk-IX4IHGFA.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -243,7 +243,7 @@ import {
243
243
  tokenLimit,
244
244
  uiTelemetryService,
245
245
  unescapePath
246
- } from "./chunk-RO4LFQ22.js";
246
+ } from "./chunk-YMKYUNCI.js";
247
247
  import {
248
248
  require_src
249
249
  } from "./chunk-TUDYL3X4.js";
@@ -77176,7 +77176,7 @@ var authCommand = {
77176
77176
  import process29 from "node:process";
77177
77177
 
77178
77178
  // packages/cli/src/generated/git-commit.ts
77179
- var GIT_COMMIT_INFO = "d3c51f158";
77179
+ var GIT_COMMIT_INFO = "10944dcc4";
77180
77180
 
77181
77181
  // packages/cli/src/ui/utils/historyExportUtils.ts
77182
77182
  import * as fsPromises from "node:fs/promises";
@@ -82957,7 +82957,7 @@ Use /mcp auth <server-name> to authenticate.`
82957
82957
  type: "info",
82958
82958
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82959
82959
  });
82960
- const { MCPOAuthProvider } = await import("./dist-H6O2HKLX.js");
82960
+ const { MCPOAuthProvider } = await import("./dist-IRKAN2JJ.js");
82961
82961
  let oauthConfig = server.oauth;
82962
82962
  if (!oauthConfig) {
82963
82963
  oauthConfig = { enabled: false };
@@ -31,7 +31,7 @@ import {
31
31
  partListUnionToString,
32
32
  require_strip_json_comments,
33
33
  sanitizeFilenamePart
34
- } from "./chunk-RO4LFQ22.js";
34
+ } from "./chunk-YMKYUNCI.js";
35
35
  import {
36
36
  __commonJS,
37
37
  __require,
@@ -282510,8 +282510,8 @@ function isValidToolName(name3, options = {}) {
282510
282510
  }
282511
282511
 
282512
282512
  // packages/core/dist/src/generated/git-commit.js
282513
- var GIT_COMMIT_INFO = "d3c51f158";
282514
- var CLI_VERSION = "0.54.0-preview.0";
282513
+ var GIT_COMMIT_INFO = "10944dcc4";
282514
+ var CLI_VERSION = "0.54.4";
282515
282515
 
282516
282516
  // packages/core/dist/src/ide/detect-ide.js
282517
282517
  var IDE_DEFINITIONS = {
@@ -285452,7 +285452,10 @@ var ChatRecordingService = class {
285452
285452
  }
285453
285453
  this.updateMetadata({ sessionId: this.sessionId });
285454
285454
  } else {
285455
- throw new Error("Failed to load resumed session data from file");
285455
+ debugLogger.warn("Failed to reload resumed session data from file; falling back to the in-memory conversation.");
285456
+ this.cachedConversation = resumedSessionData.conversation;
285457
+ this.projectHash = this.cachedConversation.projectHash;
285458
+ this.rewriteConversationFile(this.cachedConversation);
285456
285459
  }
285457
285460
  } else {
285458
285461
  this.sessionId = this.context.promptId;
@@ -285522,6 +285525,57 @@ var ChatRecordingService = class {
285522
285525
  }
285523
285526
  }
285524
285527
  }
285528
+ /**
285529
+ * Rewrites the session file from an in-memory record. Any existing
285530
+ * (unreadable) file is preserved alongside rather than destroyed, and the
285531
+ * new file is written atomically (temp file + rename).
285532
+ */
285533
+ rewriteConversationFile(conversation) {
285534
+ if (!this.conversationFile)
285535
+ return;
285536
+ if (this.conversationFile.endsWith(".json")) {
285537
+ this.conversationFile = this.conversationFile + "l";
285538
+ }
285539
+ const { messages, memoryScratchpad, ...metadata2 } = conversation;
285540
+ const lines = [JSON.stringify(metadata2)];
285541
+ for (const msg of messages) {
285542
+ lines.push(JSON.stringify(msg));
285543
+ }
285544
+ if (memoryScratchpad) {
285545
+ lines.push(JSON.stringify({ $set: { memoryScratchpad } }));
285546
+ }
285547
+ const content = lines.join("\n") + "\n";
285548
+ try {
285549
+ fs30.mkdirSync(path27.dirname(this.conversationFile), { recursive: true });
285550
+ if (fs30.existsSync(this.conversationFile)) {
285551
+ const backup = `${this.conversationFile}.unreadable-${Date.now()}`;
285552
+ try {
285553
+ fs30.renameSync(this.conversationFile, backup);
285554
+ debugLogger.warn(`Preserved the unreadable session file at ${backup}.`);
285555
+ } catch (backupError) {
285556
+ debugLogger.error("Failed to preserve the unreadable session file.", backupError);
285557
+ }
285558
+ }
285559
+ const tempFile = `${this.conversationFile}.tmp-${process.pid}`;
285560
+ try {
285561
+ fs30.writeFileSync(tempFile, content);
285562
+ fs30.renameSync(tempFile, this.conversationFile);
285563
+ } catch (error40) {
285564
+ try {
285565
+ fs30.unlinkSync(tempFile);
285566
+ } catch {
285567
+ }
285568
+ throw error40;
285569
+ }
285570
+ } catch (error40) {
285571
+ if (isNodeError(error40) && error40.code === "ENOSPC") {
285572
+ this.conversationFile = null;
285573
+ debugLogger.warn(ENOSPC_WARNING_MESSAGE);
285574
+ } else {
285575
+ throw error40;
285576
+ }
285577
+ }
285578
+ }
285525
285579
  updateMetadata(updates) {
285526
285580
  if (!this.cachedConversation)
285527
285581
  return;
@@ -305720,7 +305774,7 @@ function getVersion() {
305720
305774
  }
305721
305775
  versionPromise = (async () => {
305722
305776
  const pkgJson = await getPackageJson(__dirname4);
305723
- return "0.54.0-preview.0";
305777
+ return "0.54.4";
305724
305778
  })();
305725
305779
  return versionPromise;
305726
305780
  }
@@ -330272,6 +330326,7 @@ var MID_STREAM_RETRY_OPTIONS = {
330272
330326
  useExponentialBackoff: true
330273
330327
  };
330274
330328
  var SYNTHETIC_THOUGHT_SIGNATURE2 = "skip_thought_signature_validator";
330329
+ var INTERRUPTED_RESPONSE_PLACEHOLDER = "[The previous response was interrupted before it completed.]";
330275
330330
  function isIndexedPart(part) {
330276
330331
  return "callIndex" in part;
330277
330332
  }
@@ -330456,6 +330511,9 @@ var GeminiChat = class {
330456
330511
  this.sendPromise = streamDonePromise;
330457
330512
  let userContent = createUserContent(message);
330458
330513
  const isOriginalFunctionResponse = isFunctionResponse(userContent);
330514
+ if (!isOriginalFunctionResponse) {
330515
+ this.closeUnansweredToolResponseTurn();
330516
+ }
330459
330517
  const { model } = this.context.config.modelConfigService.getResolvedConfig(modelConfigKey);
330460
330518
  const isContextManagementEnabled = this.context.config.isContextManagementEnabled();
330461
330519
  if (!isOriginalFunctionResponse) {
@@ -330623,6 +330681,24 @@ var GeminiChat = class {
330623
330681
  };
330624
330682
  return streamWithRetries.call(this);
330625
330683
  }
330684
+ /**
330685
+ * Appends a closing model turn when history ends with an unanswered tool
330686
+ * response, so the next user message stays a turn of its own.
330687
+ */
330688
+ closeUnansweredToolResponseTurn() {
330689
+ const turns = this.agentHistory.get();
330690
+ const last2 = turns[turns.length - 1];
330691
+ if (last2?.content.role !== "user" || !last2.content.parts?.some((part) => !!part.functionResponse)) {
330692
+ return;
330693
+ }
330694
+ this.agentHistory.push({
330695
+ id: randomUUID6(),
330696
+ content: {
330697
+ role: "model",
330698
+ parts: [{ text: INTERRUPTED_RESPONSE_PLACEHOLDER }]
330699
+ }
330700
+ });
330701
+ }
330626
330702
  extractBinaryInjections(parts2) {
330627
330703
  const binaryParts = [];
330628
330704
  if (parts2) {
@@ -331249,11 +331325,24 @@ function stripThoughts2(history) {
331249
331325
  if (!hasThought)
331250
331326
  return turn;
331251
331327
  const nonThoughtParts = turn.content.parts.filter((p) => p && !p.thought);
331328
+ let patchedFirstCall = false;
331329
+ const finalParts = turn.content.role === "model" ? nonThoughtParts.map((p) => {
331330
+ if (!patchedFirstCall && p.functionCall) {
331331
+ patchedFirstCall = true;
331332
+ if (!p.thoughtSignature) {
331333
+ return {
331334
+ ...p,
331335
+ thoughtSignature: SYNTHETIC_THOUGHT_SIGNATURE2
331336
+ };
331337
+ }
331338
+ }
331339
+ return p;
331340
+ }) : nonThoughtParts;
331252
331341
  return {
331253
331342
  ...turn,
331254
331343
  content: {
331255
331344
  ...turn.content,
331256
- parts: nonThoughtParts
331345
+ parts: finalParts
331257
331346
  }
331258
331347
  };
331259
331348
  }).filter((turn) => !turn.content.parts || turn.content.parts.length > 0);
@@ -338405,7 +338494,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
338405
338494
  return provider;
338406
338495
  }
338407
338496
  case "oauth2": {
338408
- const { OAuth2AuthProvider } = await import("./oauth2-provider-JGXWLD5K.js");
338497
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-NQD4RC5Z.js");
338409
338498
  const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
338410
338499
  await provider.initialize();
338411
338500
  return provider;
@@ -391822,7 +391911,7 @@ var validateSerializable = (newContents) => {
391822
391911
  };
391823
391912
 
391824
391913
  // node_modules/execa/lib/io/output-sync.js
391825
- import { writeFileSync as writeFileSync4, appendFileSync as appendFileSync4 } from "node:fs";
391914
+ import { writeFileSync as writeFileSync5, appendFileSync as appendFileSync4 } from "node:fs";
391826
391915
 
391827
391916
  // node_modules/execa/lib/verbose/output.js
391828
391917
  var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type: type2, value }) => type2 === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type: type2 }) => TRANSFORM_TYPES.has(type2)));
@@ -391949,7 +392038,7 @@ var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
391949
392038
  appendFileSync4(path113, serializedResult);
391950
392039
  } else {
391951
392040
  outputFiles.add(pathString);
391952
- writeFileSync4(path113, serializedResult);
392041
+ writeFileSync5(path113, serializedResult);
391953
392042
  }
391954
392043
  }
391955
392044
  };
@@ -396116,6 +396205,7 @@ export {
396116
396205
  isCompletedAskUserTool,
396117
396206
  StreamEventType,
396118
396207
  SYNTHETIC_THOUGHT_SIGNATURE2 as SYNTHETIC_THOUGHT_SIGNATURE,
396208
+ INTERRUPTED_RESPONSE_PLACEHOLDER,
396119
396209
  isValidNonThoughtTextPart,
396120
396210
  InvalidStreamError,
396121
396211
  AgentExecutionStoppedError,
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-OGXJPYSG.js";
8
+ } from "./chunk-TYAF55F7.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -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-TNVY3HW2.js";
4
+ } from "./chunk-QXLHAGLO.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM
@@ -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-UZMDXL7Q.js";
5
+ } from "./chunk-B5CTWZND.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-ZPRVIRJI.js";
17
+ } from "./chunk-TXL73KVK.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-RO4LFQ22.js";
20
+ } from "./chunk-YMKYUNCI.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -282510,8 +282510,8 @@ function isValidToolName(name3, options = {}) {
282510
282510
  }
282511
282511
 
282512
282512
  // packages/core/dist/src/generated/git-commit.js
282513
- var GIT_COMMIT_INFO = "d3c51f158";
282514
- var CLI_VERSION = "0.54.0-preview.0";
282513
+ var GIT_COMMIT_INFO = "10944dcc4";
282514
+ var CLI_VERSION = "0.54.1";
282515
282515
 
282516
282516
  // packages/core/dist/src/ide/detect-ide.js
282517
282517
  var IDE_DEFINITIONS = {
@@ -285452,7 +285452,10 @@ var ChatRecordingService = class {
285452
285452
  }
285453
285453
  this.updateMetadata({ sessionId: this.sessionId });
285454
285454
  } else {
285455
- throw new Error("Failed to load resumed session data from file");
285455
+ debugLogger.warn("Failed to reload resumed session data from file; falling back to the in-memory conversation.");
285456
+ this.cachedConversation = resumedSessionData.conversation;
285457
+ this.projectHash = this.cachedConversation.projectHash;
285458
+ this.rewriteConversationFile(this.cachedConversation);
285456
285459
  }
285457
285460
  } else {
285458
285461
  this.sessionId = this.context.promptId;
@@ -285522,6 +285525,57 @@ var ChatRecordingService = class {
285522
285525
  }
285523
285526
  }
285524
285527
  }
285528
+ /**
285529
+ * Rewrites the session file from an in-memory record. Any existing
285530
+ * (unreadable) file is preserved alongside rather than destroyed, and the
285531
+ * new file is written atomically (temp file + rename).
285532
+ */
285533
+ rewriteConversationFile(conversation) {
285534
+ if (!this.conversationFile)
285535
+ return;
285536
+ if (this.conversationFile.endsWith(".json")) {
285537
+ this.conversationFile = this.conversationFile + "l";
285538
+ }
285539
+ const { messages, memoryScratchpad, ...metadata2 } = conversation;
285540
+ const lines = [JSON.stringify(metadata2)];
285541
+ for (const msg of messages) {
285542
+ lines.push(JSON.stringify(msg));
285543
+ }
285544
+ if (memoryScratchpad) {
285545
+ lines.push(JSON.stringify({ $set: { memoryScratchpad } }));
285546
+ }
285547
+ const content = lines.join("\n") + "\n";
285548
+ try {
285549
+ fs30.mkdirSync(path27.dirname(this.conversationFile), { recursive: true });
285550
+ if (fs30.existsSync(this.conversationFile)) {
285551
+ const backup = `${this.conversationFile}.unreadable-${Date.now()}`;
285552
+ try {
285553
+ fs30.renameSync(this.conversationFile, backup);
285554
+ debugLogger.warn(`Preserved the unreadable session file at ${backup}.`);
285555
+ } catch (backupError) {
285556
+ debugLogger.error("Failed to preserve the unreadable session file.", backupError);
285557
+ }
285558
+ }
285559
+ const tempFile = `${this.conversationFile}.tmp-${process.pid}`;
285560
+ try {
285561
+ fs30.writeFileSync(tempFile, content);
285562
+ fs30.renameSync(tempFile, this.conversationFile);
285563
+ } catch (error40) {
285564
+ try {
285565
+ fs30.unlinkSync(tempFile);
285566
+ } catch {
285567
+ }
285568
+ throw error40;
285569
+ }
285570
+ } catch (error40) {
285571
+ if (isNodeError(error40) && error40.code === "ENOSPC") {
285572
+ this.conversationFile = null;
285573
+ debugLogger.warn(ENOSPC_WARNING_MESSAGE);
285574
+ } else {
285575
+ throw error40;
285576
+ }
285577
+ }
285578
+ }
285525
285579
  updateMetadata(updates) {
285526
285580
  if (!this.cachedConversation)
285527
285581
  return;
@@ -305720,7 +305774,7 @@ function getVersion() {
305720
305774
  }
305721
305775
  versionPromise = (async () => {
305722
305776
  const pkgJson = await getPackageJson(__dirname4);
305723
- return "0.54.0-preview.1";
305777
+ return "0.54.4";
305724
305778
  })();
305725
305779
  return versionPromise;
305726
305780
  }
@@ -330272,6 +330326,7 @@ var MID_STREAM_RETRY_OPTIONS = {
330272
330326
  useExponentialBackoff: true
330273
330327
  };
330274
330328
  var SYNTHETIC_THOUGHT_SIGNATURE2 = "skip_thought_signature_validator";
330329
+ var INTERRUPTED_RESPONSE_PLACEHOLDER = "[The previous response was interrupted before it completed.]";
330275
330330
  function isIndexedPart(part) {
330276
330331
  return "callIndex" in part;
330277
330332
  }
@@ -330456,6 +330511,9 @@ var GeminiChat = class {
330456
330511
  this.sendPromise = streamDonePromise;
330457
330512
  let userContent = createUserContent(message);
330458
330513
  const isOriginalFunctionResponse = isFunctionResponse(userContent);
330514
+ if (!isOriginalFunctionResponse) {
330515
+ this.closeUnansweredToolResponseTurn();
330516
+ }
330459
330517
  const { model } = this.context.config.modelConfigService.getResolvedConfig(modelConfigKey);
330460
330518
  const isContextManagementEnabled = this.context.config.isContextManagementEnabled();
330461
330519
  if (!isOriginalFunctionResponse) {
@@ -330623,6 +330681,24 @@ var GeminiChat = class {
330623
330681
  };
330624
330682
  return streamWithRetries.call(this);
330625
330683
  }
330684
+ /**
330685
+ * Appends a closing model turn when history ends with an unanswered tool
330686
+ * response, so the next user message stays a turn of its own.
330687
+ */
330688
+ closeUnansweredToolResponseTurn() {
330689
+ const turns = this.agentHistory.get();
330690
+ const last2 = turns[turns.length - 1];
330691
+ if (last2?.content.role !== "user" || !last2.content.parts?.some((part) => !!part.functionResponse)) {
330692
+ return;
330693
+ }
330694
+ this.agentHistory.push({
330695
+ id: randomUUID6(),
330696
+ content: {
330697
+ role: "model",
330698
+ parts: [{ text: INTERRUPTED_RESPONSE_PLACEHOLDER }]
330699
+ }
330700
+ });
330701
+ }
330626
330702
  extractBinaryInjections(parts2) {
330627
330703
  const binaryParts = [];
330628
330704
  if (parts2) {
@@ -331249,11 +331325,24 @@ function stripThoughts2(history) {
331249
331325
  if (!hasThought)
331250
331326
  return turn;
331251
331327
  const nonThoughtParts = turn.content.parts.filter((p) => p && !p.thought);
331328
+ let patchedFirstCall = false;
331329
+ const finalParts = turn.content.role === "model" ? nonThoughtParts.map((p) => {
331330
+ if (!patchedFirstCall && p.functionCall) {
331331
+ patchedFirstCall = true;
331332
+ if (!p.thoughtSignature) {
331333
+ return {
331334
+ ...p,
331335
+ thoughtSignature: SYNTHETIC_THOUGHT_SIGNATURE2
331336
+ };
331337
+ }
331338
+ }
331339
+ return p;
331340
+ }) : nonThoughtParts;
331252
331341
  return {
331253
331342
  ...turn,
331254
331343
  content: {
331255
331344
  ...turn.content,
331256
- parts: nonThoughtParts
331345
+ parts: finalParts
331257
331346
  }
331258
331347
  };
331259
331348
  }).filter((turn) => !turn.content.parts || turn.content.parts.length > 0);
@@ -338405,7 +338494,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
338405
338494
  return provider;
338406
338495
  }
338407
338496
  case "oauth2": {
338408
- const { OAuth2AuthProvider } = await import("./oauth2-provider-3UXFRSIK.js");
338497
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-7KVPKQ4C.js");
338409
338498
  const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
338410
338499
  await provider.initialize();
338411
338500
  return provider;
@@ -391822,7 +391911,7 @@ var validateSerializable = (newContents) => {
391822
391911
  };
391823
391912
 
391824
391913
  // node_modules/execa/lib/io/output-sync.js
391825
- import { writeFileSync as writeFileSync4, appendFileSync as appendFileSync4 } from "node:fs";
391914
+ import { writeFileSync as writeFileSync5, appendFileSync as appendFileSync4 } from "node:fs";
391826
391915
 
391827
391916
  // node_modules/execa/lib/verbose/output.js
391828
391917
  var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type: type2, value }) => type2 === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type: type2 }) => TRANSFORM_TYPES.has(type2)));
@@ -391949,7 +392038,7 @@ var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
391949
392038
  appendFileSync4(path113, serializedResult);
391950
392039
  } else {
391951
392040
  outputFiles.add(pathString);
391952
- writeFileSync4(path113, serializedResult);
392041
+ writeFileSync5(path113, serializedResult);
391953
392042
  }
391954
392043
  }
391955
392044
  };
@@ -396116,6 +396205,7 @@ export {
396116
396205
  isCompletedAskUserTool,
396117
396206
  StreamEventType,
396118
396207
  SYNTHETIC_THOUGHT_SIGNATURE2 as SYNTHETIC_THOUGHT_SIGNATURE,
396208
+ INTERRUPTED_RESPONSE_PLACEHOLDER,
396119
396209
  isValidNonThoughtTextPart,
396120
396210
  InvalidStreamError,
396121
396211
  AgentExecutionStoppedError,
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  CoreToolCallStatus,
4
4
  checkExhaustive
5
- } from "./chunk-OGXJPYSG.js";
5
+ } from "./chunk-BS6BSLZD.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __toESM
@@ -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-XE7YFMNO.js";
5
+ } from "./chunk-7SPI3KN6.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-VA3G5QBP.js";
62
+ } from "./chunk-PGCIAGXU.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-RCBLHUUY.js";
65
+ } from "./chunk-FNQ3CHG6.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-Z62YA2V7.js";
69
+ } from "./chunk-WFY6AHA3.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -230,7 +230,7 @@ import {
230
230
  tokenLimit,
231
231
  uiTelemetryService,
232
232
  unescapePath
233
- } from "./chunk-TNVY3HW2.js";
233
+ } from "./chunk-QXLHAGLO.js";
234
234
  import {
235
235
  require_src
236
236
  } from "./chunk-TUDYL3X4.js";
@@ -77163,7 +77163,7 @@ var authCommand = {
77163
77163
  import process29 from "node:process";
77164
77164
 
77165
77165
  // packages/cli/src/generated/git-commit.ts
77166
- var GIT_COMMIT_INFO = "d3c51f158";
77166
+ var GIT_COMMIT_INFO = "10944dcc4";
77167
77167
 
77168
77168
  // packages/cli/src/ui/utils/historyExportUtils.ts
77169
77169
  import * as fsPromises from "node:fs/promises";
@@ -82944,7 +82944,7 @@ Use /mcp auth <server-name> to authenticate.`
82944
82944
  type: "info",
82945
82945
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82946
82946
  });
82947
- const { MCPOAuthProvider } = await import("./core-57QOTUGQ.js");
82947
+ const { MCPOAuthProvider } = await import("./core-L2IMO77B.js");
82948
82948
  let oauthConfig = server.oauth;
82949
82949
  if (!oauthConfig) {
82950
82950
  oauthConfig = { enabled: false };
@@ -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-CULEIHKX.js";
5
+ } from "./chunk-4YSWDUQZ.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-AFGG2RPD.js";
62
+ } from "./chunk-D7ZXPN6G.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-CVUISPMN.js";
65
+ } from "./chunk-IJK6RPHE.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-YDQPFZ2Y.js";
69
+ } from "./chunk-YOVSXRBK.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -243,7 +243,7 @@ import {
243
243
  tokenLimit,
244
244
  uiTelemetryService,
245
245
  unescapePath
246
- } from "./chunk-OGXJPYSG.js";
246
+ } from "./chunk-BS6BSLZD.js";
247
247
  import {
248
248
  require_src
249
249
  } from "./chunk-TUDYL3X4.js";
@@ -77176,7 +77176,7 @@ var authCommand = {
77176
77176
  import process29 from "node:process";
77177
77177
 
77178
77178
  // packages/cli/src/generated/git-commit.ts
77179
- var GIT_COMMIT_INFO = "a81db2768";
77179
+ var GIT_COMMIT_INFO = "10944dcc4";
77180
77180
 
77181
77181
  // packages/cli/src/ui/utils/historyExportUtils.ts
77182
77182
  import * as fsPromises from "node:fs/promises";
@@ -82957,7 +82957,7 @@ Use /mcp auth <server-name> to authenticate.`
82957
82957
  type: "info",
82958
82958
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82959
82959
  });
82960
- const { MCPOAuthProvider } = await import("./dist-OQCDYU7F.js");
82960
+ const { MCPOAuthProvider } = await import("./dist-UPFVI32N.js");
82961
82961
  let oauthConfig = server.oauth;
82962
82962
  if (!oauthConfig) {
82963
82963
  oauthConfig = { enabled: false };
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-FMTFTARW.js";
15
- import "./chunk-TNVY3HW2.js";
14
+ } from "./chunk-NWWVQCEM.js";
15
+ import "./chunk-QXLHAGLO.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-TTNCL6R2.js";
15
- import "./chunk-OGXJPYSG.js";
14
+ } from "./chunk-UWHDOUIM.js";
15
+ import "./chunk-TYAF55F7.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";