@google/gemini-cli 0.54.0-preview.0 → 0.54.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 (50) hide show
  1. package/bundle/{chunk-PMUWVEQP.js → chunk-2MRUXBJ5.js} +7 -7
  2. package/bundle/{chunk-XTGYOEM3.js → chunk-43HYOV6F.js} +1 -1
  3. package/bundle/{chunk-CPVZILP2.js → chunk-5SMD2SLQ.js} +2 -2
  4. package/bundle/{chunk-K7T2IFNS.js → chunk-BBNFLOXC.js} +1 -1
  5. package/bundle/{chunk-UOZMJZMA.js → chunk-F6IU45OZ.js} +180 -39
  6. package/bundle/{chunk-KU7W3PYO.js → chunk-G7VQ6O6G.js} +1 -1
  7. package/bundle/{chunk-4GNXWN36.js → chunk-GOQJOV4P.js} +1 -1
  8. package/bundle/{chunk-HM6J5QFA.js → chunk-HS7THREL.js} +208 -42
  9. package/bundle/{chunk-GMYSSSFG.js → chunk-IM5WJKYT.js} +1 -1
  10. package/bundle/{chunk-JKXIXUUH.js → chunk-JPCDQXHB.js} +1 -1
  11. package/bundle/{chunk-I2F6JPKA.js → chunk-LH73BY77.js} +7 -7
  12. package/bundle/{chunk-ZJJUEIJO.js → chunk-MOGTJC2T.js} +1 -1
  13. package/bundle/{chunk-CZ6IKC6W.js → chunk-MZBH35ZS.js} +1 -1
  14. package/bundle/{chunk-HYGO4QEK.js → chunk-NZ6P6XKP.js} +2 -2
  15. package/bundle/{chunk-24AZRO3S.js → chunk-OYZ2XVON.js} +3 -3
  16. package/bundle/{chunk-S2XDE4E6.js → chunk-RHINAWEP.js} +7 -7
  17. package/bundle/{chunk-X7LEASVK.js → chunk-SHZORH3T.js} +1 -1
  18. package/bundle/{chunk-5X6WKNCA.js → chunk-SQWRALPF.js} +1 -1
  19. package/bundle/{chunk-ANCJ47GY.js → chunk-TZAOURRV.js} +1 -1
  20. package/bundle/{chunk-KFW7GOXJ.js → chunk-UTXCUPDT.js} +2 -2
  21. package/bundle/{chunk-BMD42WWR.js → chunk-UW4NSSB6.js} +3 -3
  22. package/bundle/{chunk-QZ32DOIY.js → chunk-VIQEWLM4.js} +1 -1
  23. package/bundle/{chunk-YVWOOS5D.js → chunk-WJKZRJIC.js} +3 -3
  24. package/bundle/{chunk-YOK6TS2W.js → chunk-YYWWE5GW.js} +208 -42
  25. package/bundle/{cleanup-CI4EZBGK.js → cleanup-5UYKVLIF.js} +2 -2
  26. package/bundle/{cleanup-NW33L7BG.js → cleanup-6OO5MA6W.js} +2 -2
  27. package/bundle/{cleanup-WCECJVAH.js → cleanup-ODOGWYRM.js} +2 -2
  28. package/bundle/{core-X6AKTKZS.js → core-JL633Z4N.js} +15 -1
  29. package/bundle/{dist-FM4XWKSV.js → core-S5B3NEKC.js} +15 -1
  30. package/bundle/{devtoolsService-HT4GPBRA.js → devtoolsService-FUTPYP6V.js} +2 -2
  31. package/bundle/{devtoolsService-YWDOWAQ7.js → devtoolsService-NZQZUVCI.js} +2 -2
  32. package/bundle/{devtoolsService-I4VSDXDZ.js → devtoolsService-YWNTGRUE.js} +2 -2
  33. package/bundle/{core-JXOKFSQM.js → dist-DB6LWOKZ.js} +15 -1
  34. package/bundle/{gemini-6QYTVAVR.js → gemini-AQASGK5V.js} +84 -20
  35. package/bundle/{gemini-LAE4PTZV.js → gemini-D3BRVDVJ.js} +84 -20
  36. package/bundle/{gemini-M37ESLGX.js → gemini-PPNY5YY6.js} +84 -20
  37. package/bundle/gemini.js +7 -7
  38. package/bundle/{interactiveCli-353YNM5T.js → interactiveCli-CXCZMXKQ.js} +99 -9
  39. package/bundle/{interactiveCli-D26FIBDY.js → interactiveCli-P7QQLIDS.js} +99 -9
  40. package/bundle/{interactiveCli-OZI3EOZ3.js → interactiveCli-RU7LCVXL.js} +99 -9
  41. package/bundle/{liteRtServerManager-CHOKKKD7.js → liteRtServerManager-FIVLVXQJ.js} +4 -4
  42. package/bundle/{liteRtServerManager-QZER65XK.js → liteRtServerManager-ISKYY742.js} +4 -4
  43. package/bundle/{liteRtServerManager-5L6ZKYIO.js → liteRtServerManager-MPPOFOTR.js} +4 -4
  44. package/bundle/{oauth2-provider-DOSOCLE2.js → oauth2-provider-DOIL6PEC.js} +1 -1
  45. package/bundle/{oauth2-provider-2DMHCM63.js → oauth2-provider-G6DF4NEU.js} +1 -1
  46. package/bundle/{oauth2-provider-RYXZZKGA.js → oauth2-provider-XR5UQYQV.js} +1 -1
  47. package/bundle/{start-GSFOK3MC.js → start-AJW7OVPU.js} +6 -6
  48. package/bundle/{start-H6TOQQTQ.js → start-S77W5RNK.js} +6 -6
  49. package/bundle/{start-6KDQYY22.js → start-YWT3TSZW.js} +6 -6
  50. 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
  startCommand,
4
4
  startServer
5
- } from "./chunk-YVWOOS5D.js";
5
+ } from "./chunk-OYZ2XVON.js";
6
6
  import {
7
7
  BuiltinCommandLoader,
8
8
  CommandService,
@@ -45,11 +45,11 @@ import {
45
45
  updateAllUpdatableExtensions,
46
46
  updateExtension,
47
47
  validateAuthMethod
48
- } from "./chunk-PMUWVEQP.js";
48
+ } from "./chunk-2MRUXBJ5.js";
49
49
  import {
50
50
  exitCli,
51
51
  require_source
52
- } from "./chunk-ZJJUEIJO.js";
52
+ } from "./chunk-G7VQ6O6G.js";
53
53
  import {
54
54
  appEvents
55
55
  } from "./chunk-5PS3AYFU.js";
@@ -87,11 +87,11 @@ import {
87
87
  resolveGemmaConfig,
88
88
  saveModelChange,
89
89
  stripAnsi
90
- } from "./chunk-4GNXWN36.js";
90
+ } from "./chunk-GOQJOV4P.js";
91
91
  import {
92
92
  RELAUNCH_EXIT_CODE
93
- } from "./chunk-HYGO4QEK.js";
94
- import "./chunk-CZ6IKC6W.js";
93
+ } from "./chunk-5SMD2SLQ.js";
94
+ import "./chunk-MZBH35ZS.js";
95
95
  import {
96
96
  cleanupCheckpoints,
97
97
  registerCleanup,
@@ -100,7 +100,7 @@ import {
100
100
  runExitCleanup,
101
101
  runSyncCleanup,
102
102
  setupSignalHandlers
103
- } from "./chunk-X7LEASVK.js";
103
+ } from "./chunk-IM5WJKYT.js";
104
104
  import {
105
105
  ASK_USER_TOOL_NAME,
106
106
  ApprovalMode,
@@ -139,9 +139,11 @@ import {
139
139
  Kind,
140
140
  LegacyAgentSession,
141
141
  Logger,
142
+ MAX_TOKENS_EXCEEDED_SUGGESTION,
142
143
  MCPServerConfig,
143
144
  MCPServerStatus,
144
145
  MessageBusType,
146
+ OTHER_BLOCKED_MESSAGE,
145
147
  OutputFormat,
146
148
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
147
149
  PREVIEW_GEMINI_3_1_MODEL,
@@ -150,9 +152,11 @@ import {
150
152
  PREVIEW_GEMINI_MODEL,
151
153
  PolicyDecision,
152
154
  PolicyIntegrityManager,
155
+ RECITATION_BLOCKED_MESSAGE,
153
156
  REFERENCE_CONTENT_START,
154
157
  ROOT_SCHEDULER_ID,
155
158
  ReadManyFilesTool,
159
+ SAFETY_BLOCKED_MESSAGE,
156
160
  Scheduler,
157
161
  SessionEndReason,
158
162
  SessionStartSource,
@@ -160,6 +164,8 @@ import {
160
164
  SimpleExtensionLoader,
161
165
  Storage,
162
166
  StreamJsonFormatter,
167
+ THINKING_ONLY_COMPRESS_SUGGESTION,
168
+ TRUE_EMPTY_RESPONSE_MESSAGE,
163
169
  ToolCallEvent,
164
170
  ToolConfirmationOutcome,
165
171
  ToolErrorType,
@@ -247,7 +253,7 @@ import {
247
253
  updatePolicy,
248
254
  writeToStderr,
249
255
  writeToStdout
250
- } from "./chunk-UOZMJZMA.js";
256
+ } from "./chunk-F6IU45OZ.js";
251
257
  import "./chunk-664ZODQF.js";
252
258
  import "./chunk-IUUIT4SU.js";
253
259
  import "./chunk-TUDYL3X4.js";
@@ -7841,7 +7847,7 @@ async function loadSandboxConfig(settings, argv) {
7841
7847
  }
7842
7848
  const command2 = getSandboxCommand(sandboxValue);
7843
7849
  const packageJson = await getPackageJson(__dirname3);
7844
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.54.0-preview.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7850
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.54.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7845
7851
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7846
7852
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7847
7853
  }
@@ -10249,7 +10255,7 @@ async function runNonInteractive({
10249
10255
  }
10250
10256
  });
10251
10257
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10252
- const { setupInitialActivityLogger } = await import("./devtoolsService-I4VSDXDZ.js");
10258
+ const { setupInitialActivityLogger } = await import("./devtoolsService-YWNTGRUE.js");
10253
10259
  setupInitialActivityLogger(config);
10254
10260
  }
10255
10261
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10422,14 +10428,14 @@ async function runNonInteractive({
10422
10428
  const text = parts?.map((part) => part.type === "text" ? part.text : "").join("");
10423
10429
  return text ? text : void 0;
10424
10430
  };
10425
- const emitFinalSuccessResult = () => {
10431
+ const emitFinalResult = (errorPayload) => {
10426
10432
  if (streamFormatter) {
10427
10433
  const metrics = uiTelemetryService.getMetrics();
10428
10434
  const durationMs = Date.now() - startTime;
10429
10435
  streamFormatter.emitEvent({
10430
10436
  type: JsonStreamEventType.RESULT,
10431
10437
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10432
- status: "success",
10438
+ status: errorPayload ? "error" : "success",
10433
10439
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
10434
10440
  });
10435
10441
  } else if (config.getOutputFormat() === OutputFormat.JSON) {
@@ -10440,7 +10446,7 @@ async function runNonInteractive({
10440
10446
  config.getSessionId(),
10441
10447
  responseText,
10442
10448
  stats,
10443
- void 0,
10449
+ errorPayload,
10444
10450
  warnings
10445
10451
  )
10446
10452
  );
@@ -10607,6 +10613,45 @@ async function runNonInteractive({
10607
10613
  break;
10608
10614
  }
10609
10615
  case "error": {
10616
+ if (event._meta?.["code"] === "INVALID_STREAM") {
10617
+ const errorTypeVal = event._meta?.["errorType"];
10618
+ const errorType = typeof errorTypeVal === "string" ? errorTypeVal : void 0;
10619
+ let errorMessage = event.message;
10620
+ if (errorType === "NO_RESPONSE_TEXT") {
10621
+ errorMessage = TRUE_EMPTY_RESPONSE_MESSAGE;
10622
+ } else if (errorType === "THINKING_ONLY_RESPONSE") {
10623
+ errorMessage = THINKING_ONLY_COMPRESS_SUGGESTION;
10624
+ } else if (errorType === "MAX_TOKENS_EXCEEDED") {
10625
+ errorMessage = MAX_TOKENS_EXCEEDED_SUGGESTION;
10626
+ } else if (errorType === "SAFETY_BLOCKED") {
10627
+ errorMessage = SAFETY_BLOCKED_MESSAGE;
10628
+ } else if (errorType === "RECITATION_BLOCKED") {
10629
+ errorMessage = RECITATION_BLOCKED_MESSAGE;
10630
+ } else if (errorType === "OTHER_BLOCKED") {
10631
+ errorMessage = OTHER_BLOCKED_MESSAGE;
10632
+ }
10633
+ if (streamFormatter) {
10634
+ streamFormatter.emitEvent({
10635
+ type: JsonStreamEventType.ERROR,
10636
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10637
+ severity: "error",
10638
+ message: errorMessage
10639
+ });
10640
+ } else if (config.getOutputFormat() === OutputFormat.TEXT) {
10641
+ process.stderr.write(`[ERROR] ${errorMessage}
10642
+ `);
10643
+ }
10644
+ uiTelemetryService.recordSemanticValidationError(
10645
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
10646
+ errorType || "INVALID_STREAM"
10647
+ );
10648
+ emitFinalResult({
10649
+ type: "INVALID_STREAM",
10650
+ message: errorMessage
10651
+ });
10652
+ streamEnded = true;
10653
+ break;
10654
+ }
10610
10655
  if (event.fatal) {
10611
10656
  throw reconstructFatalError(event);
10612
10657
  }
@@ -10666,7 +10711,7 @@ async function runNonInteractive({
10666
10711
  process.stderr.write(`Agent execution stopped: ${stopMessage}
10667
10712
  `);
10668
10713
  }
10669
- emitFinalSuccessResult();
10714
+ emitFinalResult();
10670
10715
  streamEnded = true;
10671
10716
  break;
10672
10717
  }
@@ -10720,7 +10765,7 @@ async function runNonInteractive2(params) {
10720
10765
  }
10721
10766
  });
10722
10767
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10723
- const { setupInitialActivityLogger } = await import("./devtoolsService-I4VSDXDZ.js");
10768
+ const { setupInitialActivityLogger } = await import("./devtoolsService-YWNTGRUE.js");
10724
10769
  setupInitialActivityLogger(config);
10725
10770
  }
10726
10771
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10985,7 +11030,26 @@ async function runNonInteractive2(params) {
10985
11030
  }
10986
11031
  warnings.push(blockMessage);
10987
11032
  } else if (event.type === GeminiEventType.InvalidStream) {
10988
- invalidStreamError = "Invalid stream: The model returned an empty response or malformed tool call.";
11033
+ const eventValue = event.value;
11034
+ if (eventValue?.type === "NO_RESPONSE_TEXT") {
11035
+ invalidStreamError = TRUE_EMPTY_RESPONSE_MESSAGE;
11036
+ } else if (eventValue?.type === "THINKING_ONLY_RESPONSE") {
11037
+ invalidStreamError = THINKING_ONLY_COMPRESS_SUGGESTION;
11038
+ } else if (eventValue?.type === "MAX_TOKENS_EXCEEDED") {
11039
+ invalidStreamError = MAX_TOKENS_EXCEEDED_SUGGESTION;
11040
+ } else if (eventValue?.type === "SAFETY_BLOCKED") {
11041
+ invalidStreamError = SAFETY_BLOCKED_MESSAGE;
11042
+ } else if (eventValue?.type === "RECITATION_BLOCKED") {
11043
+ invalidStreamError = RECITATION_BLOCKED_MESSAGE;
11044
+ } else if (eventValue?.type === "OTHER_BLOCKED") {
11045
+ invalidStreamError = OTHER_BLOCKED_MESSAGE;
11046
+ } else {
11047
+ invalidStreamError = eventValue?.message?.trim() || "Invalid stream: The model returned an empty response or malformed tool call.";
11048
+ }
11049
+ uiTelemetryService.recordSemanticValidationError(
11050
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
11051
+ eventValue?.type || "INVALID_STREAM"
11052
+ );
10989
11053
  if (streamFormatter) {
10990
11054
  streamFormatter.emitEvent({
10991
11055
  type: JsonStreamEventType.ERROR,
@@ -14101,7 +14165,7 @@ ${event.value.description}`;
14101
14165
  if (error instanceof RequestError) {
14102
14166
  throw error;
14103
14167
  }
14104
- if (error instanceof InvalidStreamError || error && typeof error === "object" && "type" in error && (error.type === "NO_RESPONSE_TEXT" || error.type === "NO_FINISH_REASON" || error.type === "MALFORMED_FUNCTION_CALL" || error.type === "UNEXPECTED_TOOL_CALL")) {
14168
+ if (error instanceof InvalidStreamError || error && typeof error === "object" && "type" in error && (error.type === "NO_RESPONSE_TEXT" || error.type === "NO_FINISH_REASON" || error.type === "MALFORMED_FUNCTION_CALL" || error.type === "UNEXPECTED_TOOL_CALL" || error.type === "MAX_TOKENS_EXCEEDED" || error.type === "SAFETY_BLOCKED" || error.type === "RECITATION_BLOCKED" || error.type === "OTHER_BLOCKED" || error.type === "THINKING_ONLY_RESPONSE")) {
14105
14169
  return {
14106
14170
  stopReason: "end_turn",
14107
14171
  _meta: {
@@ -15911,7 +15975,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
15911
15975
  }
15912
15976
  }
15913
15977
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15914
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-353YNM5T.js");
15978
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-CXCZMXKQ.js");
15915
15979
  await doStartUI(
15916
15980
  config,
15917
15981
  settings,
@@ -16120,7 +16184,7 @@ ${finalArgs[promptIndex + 1]}`;
16120
16184
  await config.storage.initialize();
16121
16185
  adminControlsListner.setConfig(config);
16122
16186
  if (config.isInteractive() && settings.merged.general.devtools) {
16123
- const { setupInitialActivityLogger } = await import("./devtoolsService-I4VSDXDZ.js");
16187
+ const { setupInitialActivityLogger } = await import("./devtoolsService-YWNTGRUE.js");
16124
16188
  setupInitialActivityLogger(config);
16125
16189
  }
16126
16190
  registerTelemetryConfig(config);
@@ -16179,7 +16243,7 @@ ${finalArgs[promptIndex + 1]}`;
16179
16243
  const initAppHandle = startupProfiler.start("initialize_app");
16180
16244
  const initializationResult = await initializeApp(config, settings);
16181
16245
  initAppHandle?.end();
16182
- import("./liteRtServerManager-QZER65XK.js").then(({ LiteRtServerManager }) => {
16246
+ import("./liteRtServerManager-ISKYY742.js").then(({ LiteRtServerManager }) => {
16183
16247
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
16184
16248
  if (!mergedGemma) return;
16185
16249
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-BMD42WWR.js";
5
+ } from "./chunk-UW4NSSB6.js";
6
6
  import {
7
7
  BuiltinCommandLoader,
8
8
  CommandService,
@@ -45,11 +45,11 @@ import {
45
45
  updateAllUpdatableExtensions,
46
46
  updateExtension,
47
47
  validateAuthMethod
48
- } from "./chunk-I2F6JPKA.js";
48
+ } from "./chunk-RHINAWEP.js";
49
49
  import {
50
50
  exitCli,
51
51
  require_source
52
- } from "./chunk-K7T2IFNS.js";
52
+ } from "./chunk-BBNFLOXC.js";
53
53
  import {
54
54
  appEvents
55
55
  } from "./chunk-5PS3AYFU.js";
@@ -87,11 +87,11 @@ import {
87
87
  resolveGemmaConfig,
88
88
  saveModelChange,
89
89
  stripAnsi
90
- } from "./chunk-JKXIXUUH.js";
90
+ } from "./chunk-VIQEWLM4.js";
91
91
  import {
92
92
  RELAUNCH_EXIT_CODE
93
- } from "./chunk-CPVZILP2.js";
94
- import "./chunk-5X6WKNCA.js";
93
+ } from "./chunk-UTXCUPDT.js";
94
+ import "./chunk-SQWRALPF.js";
95
95
  import {
96
96
  cleanupCheckpoints,
97
97
  registerCleanup,
@@ -100,7 +100,7 @@ import {
100
100
  runExitCleanup,
101
101
  runSyncCleanup,
102
102
  setupSignalHandlers
103
- } from "./chunk-GMYSSSFG.js";
103
+ } from "./chunk-43HYOV6F.js";
104
104
  import {
105
105
  ASK_USER_TOOL_NAME,
106
106
  AuthType,
@@ -132,21 +132,27 @@ import {
132
132
  JsonFormatter,
133
133
  LegacyAgentSession,
134
134
  Logger,
135
+ MAX_TOKENS_EXCEEDED_SUGGESTION,
135
136
  MCPServerConfig,
137
+ OTHER_BLOCKED_MESSAGE,
136
138
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
137
139
  PREVIEW_GEMINI_3_1_MODEL,
138
140
  PREVIEW_GEMINI_FLASH_LITE_MODEL,
139
141
  PREVIEW_GEMINI_FLASH_MODEL,
140
142
  PREVIEW_GEMINI_MODEL,
141
143
  PolicyIntegrityManager,
144
+ RECITATION_BLOCKED_MESSAGE,
142
145
  REFERENCE_CONTENT_START,
143
146
  ROOT_SCHEDULER_ID,
144
147
  ReadManyFilesTool,
148
+ SAFETY_BLOCKED_MESSAGE,
145
149
  Scheduler,
146
150
  ShellExecutionService,
147
151
  SimpleExtensionLoader,
148
152
  Storage,
149
153
  StreamJsonFormatter,
154
+ THINKING_ONLY_COMPRESS_SUGGESTION,
155
+ TRUE_EMPTY_RESPONSE_MESSAGE,
150
156
  ToolCallEvent,
151
157
  ToolConfirmationOutcome,
152
158
  UserAccountManager,
@@ -231,7 +237,7 @@ import {
231
237
  updatePolicy,
232
238
  writeToStderr,
233
239
  writeToStdout
234
- } from "./chunk-HM6J5QFA.js";
240
+ } from "./chunk-HS7THREL.js";
235
241
  import "./chunk-664ZODQF.js";
236
242
  import "./chunk-IUUIT4SU.js";
237
243
  import "./chunk-TUDYL3X4.js";
@@ -7825,7 +7831,7 @@ async function loadSandboxConfig(settings, argv) {
7825
7831
  }
7826
7832
  const command2 = getSandboxCommand(sandboxValue);
7827
7833
  const packageJson = await getPackageJson(__dirname3);
7828
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.54.0-nightly.20260728.gbef611950" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7834
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.54.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7829
7835
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7830
7836
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7831
7837
  }
@@ -10233,7 +10239,7 @@ async function runNonInteractive({
10233
10239
  }
10234
10240
  });
10235
10241
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10236
- const { setupInitialActivityLogger } = await import("./devtoolsService-YWDOWAQ7.js");
10242
+ const { setupInitialActivityLogger } = await import("./devtoolsService-FUTPYP6V.js");
10237
10243
  setupInitialActivityLogger(config);
10238
10244
  }
10239
10245
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10406,14 +10412,14 @@ async function runNonInteractive({
10406
10412
  const text = parts?.map((part) => part.type === "text" ? part.text : "").join("");
10407
10413
  return text ? text : void 0;
10408
10414
  };
10409
- const emitFinalSuccessResult = () => {
10415
+ const emitFinalResult = (errorPayload) => {
10410
10416
  if (streamFormatter) {
10411
10417
  const metrics = uiTelemetryService.getMetrics();
10412
10418
  const durationMs = Date.now() - startTime;
10413
10419
  streamFormatter.emitEvent({
10414
10420
  type: "result" /* RESULT */,
10415
10421
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10416
- status: "success",
10422
+ status: errorPayload ? "error" : "success",
10417
10423
  stats: streamFormatter.convertToStreamStats(metrics, durationMs)
10418
10424
  });
10419
10425
  } else if (config.getOutputFormat() === "json" /* JSON */) {
@@ -10424,7 +10430,7 @@ async function runNonInteractive({
10424
10430
  config.getSessionId(),
10425
10431
  responseText,
10426
10432
  stats,
10427
- void 0,
10433
+ errorPayload,
10428
10434
  warnings
10429
10435
  )
10430
10436
  );
@@ -10591,6 +10597,45 @@ async function runNonInteractive({
10591
10597
  break;
10592
10598
  }
10593
10599
  case "error": {
10600
+ if (event._meta?.["code"] === "INVALID_STREAM") {
10601
+ const errorTypeVal = event._meta?.["errorType"];
10602
+ const errorType = typeof errorTypeVal === "string" ? errorTypeVal : void 0;
10603
+ let errorMessage = event.message;
10604
+ if (errorType === "NO_RESPONSE_TEXT") {
10605
+ errorMessage = TRUE_EMPTY_RESPONSE_MESSAGE;
10606
+ } else if (errorType === "THINKING_ONLY_RESPONSE") {
10607
+ errorMessage = THINKING_ONLY_COMPRESS_SUGGESTION;
10608
+ } else if (errorType === "MAX_TOKENS_EXCEEDED") {
10609
+ errorMessage = MAX_TOKENS_EXCEEDED_SUGGESTION;
10610
+ } else if (errorType === "SAFETY_BLOCKED") {
10611
+ errorMessage = SAFETY_BLOCKED_MESSAGE;
10612
+ } else if (errorType === "RECITATION_BLOCKED") {
10613
+ errorMessage = RECITATION_BLOCKED_MESSAGE;
10614
+ } else if (errorType === "OTHER_BLOCKED") {
10615
+ errorMessage = OTHER_BLOCKED_MESSAGE;
10616
+ }
10617
+ if (streamFormatter) {
10618
+ streamFormatter.emitEvent({
10619
+ type: "error" /* ERROR */,
10620
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10621
+ severity: "error",
10622
+ message: errorMessage
10623
+ });
10624
+ } else if (config.getOutputFormat() === "text" /* TEXT */) {
10625
+ process.stderr.write(`[ERROR] ${errorMessage}
10626
+ `);
10627
+ }
10628
+ uiTelemetryService.recordSemanticValidationError(
10629
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
10630
+ errorType || "INVALID_STREAM"
10631
+ );
10632
+ emitFinalResult({
10633
+ type: "INVALID_STREAM",
10634
+ message: errorMessage
10635
+ });
10636
+ streamEnded = true;
10637
+ break;
10638
+ }
10594
10639
  if (event.fatal) {
10595
10640
  throw reconstructFatalError(event);
10596
10641
  }
@@ -10650,7 +10695,7 @@ async function runNonInteractive({
10650
10695
  process.stderr.write(`Agent execution stopped: ${stopMessage}
10651
10696
  `);
10652
10697
  }
10653
- emitFinalSuccessResult();
10698
+ emitFinalResult();
10654
10699
  streamEnded = true;
10655
10700
  break;
10656
10701
  }
@@ -10704,7 +10749,7 @@ async function runNonInteractive2(params) {
10704
10749
  }
10705
10750
  });
10706
10751
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10707
- const { setupInitialActivityLogger } = await import("./devtoolsService-YWDOWAQ7.js");
10752
+ const { setupInitialActivityLogger } = await import("./devtoolsService-FUTPYP6V.js");
10708
10753
  setupInitialActivityLogger(config);
10709
10754
  }
10710
10755
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10969,7 +11014,26 @@ async function runNonInteractive2(params) {
10969
11014
  }
10970
11015
  warnings.push(blockMessage);
10971
11016
  } else if (event.type === "invalid_stream" /* InvalidStream */) {
10972
- invalidStreamError = "Invalid stream: The model returned an empty response or malformed tool call.";
11017
+ const eventValue = event.value;
11018
+ if (eventValue?.type === "NO_RESPONSE_TEXT") {
11019
+ invalidStreamError = TRUE_EMPTY_RESPONSE_MESSAGE;
11020
+ } else if (eventValue?.type === "THINKING_ONLY_RESPONSE") {
11021
+ invalidStreamError = THINKING_ONLY_COMPRESS_SUGGESTION;
11022
+ } else if (eventValue?.type === "MAX_TOKENS_EXCEEDED") {
11023
+ invalidStreamError = MAX_TOKENS_EXCEEDED_SUGGESTION;
11024
+ } else if (eventValue?.type === "SAFETY_BLOCKED") {
11025
+ invalidStreamError = SAFETY_BLOCKED_MESSAGE;
11026
+ } else if (eventValue?.type === "RECITATION_BLOCKED") {
11027
+ invalidStreamError = RECITATION_BLOCKED_MESSAGE;
11028
+ } else if (eventValue?.type === "OTHER_BLOCKED") {
11029
+ invalidStreamError = OTHER_BLOCKED_MESSAGE;
11030
+ } else {
11031
+ invalidStreamError = eventValue?.message?.trim() || "Invalid stream: The model returned an empty response or malformed tool call.";
11032
+ }
11033
+ uiTelemetryService.recordSemanticValidationError(
11034
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
11035
+ eventValue?.type || "INVALID_STREAM"
11036
+ );
10973
11037
  if (streamFormatter) {
10974
11038
  streamFormatter.emitEvent({
10975
11039
  type: "error" /* ERROR */,
@@ -14085,7 +14149,7 @@ ${event.value.description}`;
14085
14149
  if (error instanceof RequestError) {
14086
14150
  throw error;
14087
14151
  }
14088
- if (error instanceof InvalidStreamError || error && typeof error === "object" && "type" in error && (error.type === "NO_RESPONSE_TEXT" || error.type === "NO_FINISH_REASON" || error.type === "MALFORMED_FUNCTION_CALL" || error.type === "UNEXPECTED_TOOL_CALL")) {
14152
+ if (error instanceof InvalidStreamError || error && typeof error === "object" && "type" in error && (error.type === "NO_RESPONSE_TEXT" || error.type === "NO_FINISH_REASON" || error.type === "MALFORMED_FUNCTION_CALL" || error.type === "UNEXPECTED_TOOL_CALL" || error.type === "MAX_TOKENS_EXCEEDED" || error.type === "SAFETY_BLOCKED" || error.type === "RECITATION_BLOCKED" || error.type === "OTHER_BLOCKED" || error.type === "THINKING_ONLY_RESPONSE")) {
14089
14153
  return {
14090
14154
  stopReason: "end_turn",
14091
14155
  _meta: {
@@ -15895,7 +15959,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
15895
15959
  }
15896
15960
  }
15897
15961
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15898
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-OZI3EOZ3.js");
15962
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-P7QQLIDS.js");
15899
15963
  await doStartUI(
15900
15964
  config,
15901
15965
  settings,
@@ -16104,7 +16168,7 @@ ${finalArgs[promptIndex + 1]}`;
16104
16168
  await config.storage.initialize();
16105
16169
  adminControlsListner.setConfig(config);
16106
16170
  if (config.isInteractive() && settings.merged.general.devtools) {
16107
- const { setupInitialActivityLogger } = await import("./devtoolsService-YWDOWAQ7.js");
16171
+ const { setupInitialActivityLogger } = await import("./devtoolsService-FUTPYP6V.js");
16108
16172
  setupInitialActivityLogger(config);
16109
16173
  }
16110
16174
  registerTelemetryConfig(config);
@@ -16163,7 +16227,7 @@ ${finalArgs[promptIndex + 1]}`;
16163
16227
  const initAppHandle = startupProfiler.start("initialize_app");
16164
16228
  const initializationResult = await initializeApp(config, settings);
16165
16229
  initAppHandle?.end();
16166
- import("./liteRtServerManager-5L6ZKYIO.js").then(({ LiteRtServerManager }) => {
16230
+ import("./liteRtServerManager-FIVLVXQJ.js").then(({ LiteRtServerManager }) => {
16167
16231
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
16168
16232
  if (!mergedGemma) return;
16169
16233
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
package/bundle/gemini.js CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  RELAUNCH_EXIT_CODE,
5
5
  getScriptArgs,
6
6
  getSpawnConfig
7
- } from "./chunk-HYGO4QEK.js";
8
- import "./chunk-CZ6IKC6W.js";
9
- import "./chunk-X7LEASVK.js";
10
- import "./chunk-UOZMJZMA.js";
7
+ } from "./chunk-5SMD2SLQ.js";
8
+ import "./chunk-MZBH35ZS.js";
9
+ import "./chunk-IM5WJKYT.js";
10
+ import "./chunk-F6IU45OZ.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-IUUIT4SU.js";
13
13
  import "./chunk-TUDYL3X4.js";
@@ -115,9 +115,9 @@ ${error instanceof Error ? error.stack ?? error.message : String(error)}
115
115
  }
116
116
  }
117
117
  } else {
118
- const { main } = await import("./gemini-LAE4PTZV.js");
119
- const { FatalError, writeToStderr } = await import("./dist-FM4XWKSV.js");
120
- const { runExitCleanup } = await import("./cleanup-CI4EZBGK.js");
118
+ const { main } = await import("./gemini-D3BRVDVJ.js");
119
+ const { FatalError, writeToStderr } = await import("./dist-DB6LWOKZ.js");
120
+ const { runExitCleanup } = await import("./cleanup-5UYKVLIF.js");
121
121
  main().catch(async (error) => {
122
122
  const cleanupTimeout = setTimeout(() => {
123
123
  writeToStderr("Cleanup timed out, forcing exit...\n");