@google/gemini-cli 0.63.0-preview.0 → 0.64.0-nightly.20260930.g38700b4b3

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 (67) hide show
  1. package/bundle/{chunk-GRSO6OI3.js → chunk-25CRZGVM.js} +7 -7
  2. package/bundle/{chunk-NWSCUKK3.js → chunk-2IX6DWAW.js} +4 -4
  3. package/bundle/{chunk-2NCBQURB.js → chunk-3NT2SKFA.js} +1 -1
  4. package/bundle/{chunk-2J6RC447.js → chunk-4HOQUY2N.js} +3 -3
  5. package/bundle/{chunk-ZDQYLJYN.js → chunk-6PPBWNDI.js} +1 -1
  6. package/bundle/{chunk-RC6VJ6FT.js → chunk-7DWXAVQF.js} +1 -1
  7. package/bundle/{chunk-Z5RCAIV5.js → chunk-A2FLYZAG.js} +7 -5
  8. package/bundle/{chunk-R6Q6D3UA.js → chunk-A57G7SIC.js} +1 -1
  9. package/bundle/{chunk-KCB54UJ5.js → chunk-AWSTJUTH.js} +7817 -14797
  10. package/bundle/{chunk-RXHIISMM.js → chunk-BGZD3BMV.js} +1 -1
  11. package/bundle/{chunk-SNGNFODQ.js → chunk-BMTBPV2S.js} +1 -1
  12. package/bundle/{chunk-EIMVJG2V.js → chunk-BXEOD3X3.js} +1 -1
  13. package/bundle/{chunk-UEOEM4H5.js → chunk-DJNZXRA7.js} +3 -3
  14. package/bundle/{chunk-2P4ETAEG.js → chunk-F6JETNEJ.js} +1 -1
  15. package/bundle/{chunk-NTWFJ2RF.js → chunk-GY7Q52OV.js} +2 -2
  16. package/bundle/{chunk-JEUVKR2X.js → chunk-HE52HL64.js} +3 -3
  17. package/bundle/{chunk-EWEUWTBB.js → chunk-HSKWGDF4.js} +71 -58
  18. package/bundle/{chunk-KPPDDNGJ.js → chunk-IAPBP6LA.js} +9 -8
  19. package/bundle/chunk-IHPUGUR4.js +1571 -0
  20. package/bundle/chunk-JOP7W7XN.js +512 -0
  21. package/bundle/{chunk-H4WLRV6U.js → chunk-MDIO6ZGG.js} +2 -2
  22. package/bundle/{chunk-B2C7BQ4Z.js → chunk-MODROUVA.js} +7 -7
  23. package/bundle/{chunk-HBZBBLAV.js → chunk-NXZ6MTBK.js} +4 -4
  24. package/bundle/{chunk-5VYF5TVF.js → chunk-P5COWVAT.js} +2 -2
  25. package/bundle/chunk-P7PQGLTC.js +425 -0
  26. package/bundle/chunk-POADB5TD.js +102951 -0
  27. package/bundle/{chunk-BVDTRESW.js → chunk-PSG2RKYK.js} +1 -1
  28. package/bundle/chunk-QBEQJSQP.js +17446 -0
  29. package/bundle/chunk-RGZWKVK6.js +400535 -0
  30. package/bundle/{chunk-CTL6DZSY.js → chunk-U35AUWCX.js} +1 -1
  31. package/bundle/chunk-XBPTRJT2.js +154 -0
  32. package/bundle/chunk-Z3W7MPKY.js +118 -0
  33. package/bundle/{cleanup-EX2L3L3E.js → cleanup-5ZAFKLQH.js} +2 -2
  34. package/bundle/{cleanup-IT7XR7KS.js → cleanup-HYZM7R5F.js} +2 -2
  35. package/bundle/{cleanup-WWLYKZIX.js → cleanup-TARZADFI.js} +2 -2
  36. package/bundle/cleanup-ZAXFNDOC.js +32 -0
  37. package/bundle/{core-GAJB2LOX.js → core-EPSHE7P6.js} +1 -1
  38. package/bundle/{devtoolsService-4YTFHHPN.js → devtoolsService-56VDVUOL.js} +2 -2
  39. package/bundle/{devtoolsService-TJPENQSW.js → devtoolsService-7XLE4P4S.js} +2 -2
  40. package/bundle/{devtoolsService-S4ZTRGJL.js → devtoolsService-AAFN6NAN.js} +4 -3
  41. package/bundle/devtoolsService-ECAXJUOF.js +4359 -0
  42. package/bundle/{dist-MTMOCTIW.js → dist-M35X4WPV.js} +1 -1
  43. package/bundle/{core-D5D4MF5H.js → dist-NIRQB25Q.js} +1 -1
  44. package/bundle/dist-O3KY6OIH.js +2250 -0
  45. package/bundle/docs/changelogs/preview.md +54 -65
  46. package/bundle/{gemini-5T5BS7L7.js → gemini-6CUIGQWZ.js} +66 -95
  47. package/bundle/{gemini-UQRS6TBE.js → gemini-7ZTG2TNC.js} +266 -279
  48. package/bundle/gemini-LUCGVSW4.js +17834 -0
  49. package/bundle/{gemini-FHORRYHM.js → gemini-XES6PNAG.js} +66 -95
  50. package/bundle/gemini.js +7 -7
  51. package/bundle/{interactiveCli-I5K7O5Z6.js → interactiveCli-33JCR2HW.js} +26 -23
  52. package/bundle/{interactiveCli-5YNYZTMK.js → interactiveCli-BL75HVY6.js} +329 -307
  53. package/bundle/{interactiveCli-WOM6QZHM.js → interactiveCli-HKQPFDGD.js} +26 -23
  54. package/bundle/interactiveCli-QSW3W5ZD.js +34918 -0
  55. package/bundle/{liteRtServerManager-EH2L2UVH.js → liteRtServerManager-LKLAR23I.js} +4 -4
  56. package/bundle/{liteRtServerManager-ZLIHBLZP.js → liteRtServerManager-M6OUSM64.js} +4 -4
  57. package/bundle/{liteRtServerManager-3N5KI6YS.js → liteRtServerManager-SXHC2HTD.js} +4 -4
  58. package/bundle/liteRtServerManager-UKLGHLER.js +65 -0
  59. package/bundle/{oauth2-provider-TA2KRXWQ.js → oauth2-provider-7U4O6OCP.js} +1 -1
  60. package/bundle/{oauth2-provider-5GFYTXFU.js → oauth2-provider-LLJMND6R.js} +38 -72
  61. package/bundle/oauth2-provider-VTAXRE4E.js +235 -0
  62. package/bundle/{oauth2-provider-NGSH2JQK.js → oauth2-provider-XIO422NY.js} +1 -1
  63. package/bundle/{start-M3IUNCYH.js → start-5J7ZUGKX.js} +6 -6
  64. package/bundle/{start-MWDNIQUY.js → start-7FPTLILF.js} +6 -6
  65. package/bundle/{start-CWI6OP6N.js → start-QILES454.js} +6 -6
  66. package/bundle/start-RBND45VF.js +18 -0
  67. 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-UEOEM4H5.js";
5
+ } from "./chunk-DJNZXRA7.js";
6
6
  import {
7
7
  BuiltinCommandLoader,
8
8
  CommandService,
@@ -46,11 +46,11 @@ import {
46
46
  updateExtension,
47
47
  validateAuthMethod,
48
48
  validateContextFilePath
49
- } from "./chunk-EWEUWTBB.js";
49
+ } from "./chunk-MODROUVA.js";
50
50
  import {
51
51
  exitCli,
52
52
  require_source
53
- } from "./chunk-SNGNFODQ.js";
53
+ } from "./chunk-IHPUGUR4.js";
54
54
  import {
55
55
  appEvents
56
56
  } from "./chunk-5PS3AYFU.js";
@@ -88,11 +88,11 @@ import {
88
88
  resolveGemmaConfig,
89
89
  saveModelChange,
90
90
  stripAnsi
91
- } from "./chunk-RC6VJ6FT.js";
91
+ } from "./chunk-7DWXAVQF.js";
92
92
  import {
93
93
  RELAUNCH_EXIT_CODE
94
- } from "./chunk-5VYF5TVF.js";
95
- import "./chunk-ZDQYLJYN.js";
94
+ } from "./chunk-P7PQGLTC.js";
95
+ import "./chunk-6PPBWNDI.js";
96
96
  import {
97
97
  cleanupCheckpoints,
98
98
  registerCleanup,
@@ -101,7 +101,7 @@ import {
101
101
  runExitCleanup,
102
102
  runSyncCleanup,
103
103
  setupSignalHandlers
104
- } from "./chunk-CTL6DZSY.js";
104
+ } from "./chunk-BGZD3BMV.js";
105
105
  import {
106
106
  ASK_USER_TOOL_NAME,
107
107
  AuthType,
@@ -235,11 +235,12 @@ import {
235
235
  shouldEnterAlternateScreen,
236
236
  showMemory,
237
237
  startupProfiler,
238
+ tokenLimit,
238
239
  uiTelemetryService,
239
240
  updatePolicy,
240
241
  writeToStderr,
241
242
  writeToStdout
242
- } from "./chunk-KCB54UJ5.js";
243
+ } from "./chunk-NXZ6MTBK.js";
243
244
  import "./chunk-664ZODQF.js";
244
245
  import "./chunk-IUUIT4SU.js";
245
246
  import "./chunk-L6PII3GR.js";
@@ -7839,7 +7840,7 @@ async function loadSandboxConfig(settings, argv) {
7839
7840
  }
7840
7841
  const command2 = getSandboxCommand(sandboxValue);
7841
7842
  const packageJson = await getPackageJson(__dirname3);
7842
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.63.0-nightly.20260923.gf50ba8608" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7843
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.64.0-nightly.20260929.gd75234cae" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7843
7844
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7844
7845
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7845
7846
  }
@@ -11510,7 +11511,7 @@ async function runNonInteractive({
11510
11511
  }
11511
11512
  });
11512
11513
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
11513
- const { setupInitialActivityLogger } = await import("./devtoolsService-S4ZTRGJL.js");
11514
+ const { setupInitialActivityLogger } = await import("./devtoolsService-56VDVUOL.js");
11514
11515
  setupInitialActivityLogger(config);
11515
11516
  }
11516
11517
  const { stdout: workingStdout } = createWorkingStdio();
@@ -12020,7 +12021,7 @@ async function runNonInteractive2(params) {
12020
12021
  }
12021
12022
  });
12022
12023
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
12023
- const { setupInitialActivityLogger } = await import("./devtoolsService-S4ZTRGJL.js");
12024
+ const { setupInitialActivityLogger } = await import("./devtoolsService-56VDVUOL.js");
12024
12025
  setupInitialActivityLogger(config);
12025
12026
  }
12026
12027
  const { stdout: workingStdout } = createWorkingStdio();
@@ -15294,6 +15295,11 @@ ${thought.description}`;
15294
15295
  if (handled) {
15295
15296
  return {
15296
15297
  stopReason: "end_turn",
15298
+ usage: {
15299
+ inputTokens: 0,
15300
+ outputTokens: 0,
15301
+ totalTokens: 0
15302
+ },
15297
15303
  _meta: {
15298
15304
  quota: {
15299
15305
  token_count: { input_tokens: 0, output_tokens: 0 },
@@ -15305,33 +15311,43 @@ ${thought.description}`;
15305
15311
  }
15306
15312
  let totalInputTokens = 0;
15307
15313
  let totalOutputTokens = 0;
15314
+ let totalCachedTokens = 0;
15315
+ let totalThoughtTokens = 0;
15308
15316
  const modelUsageMap = /* @__PURE__ */ new Map();
15317
+ const buildPromptResponse = (stopReason) => ({
15318
+ stopReason,
15319
+ usage: {
15320
+ inputTokens: totalInputTokens,
15321
+ outputTokens: totalOutputTokens,
15322
+ cachedReadTokens: totalCachedTokens || void 0,
15323
+ thoughtTokens: totalThoughtTokens || void 0,
15324
+ totalTokens: totalInputTokens + totalOutputTokens
15325
+ },
15326
+ _meta: {
15327
+ quota: {
15328
+ token_count: {
15329
+ input_tokens: totalInputTokens,
15330
+ output_tokens: totalOutputTokens
15331
+ },
15332
+ model_usage: Array.from(modelUsageMap.entries()).map(
15333
+ ([modelName, counts]) => ({
15334
+ model: modelName,
15335
+ token_count: {
15336
+ input_tokens: counts.input,
15337
+ output_tokens: counts.output
15338
+ }
15339
+ })
15340
+ )
15341
+ }
15342
+ }
15343
+ });
15309
15344
  let currentParts = parts;
15310
15345
  let turnCount = 0;
15311
15346
  const maxTurns = this.context.config.getMaxSessionTurns();
15312
15347
  while (true) {
15313
15348
  turnCount++;
15314
15349
  if (maxTurns >= 0 && turnCount > maxTurns) {
15315
- return {
15316
- stopReason: "max_turn_requests",
15317
- _meta: {
15318
- quota: {
15319
- token_count: {
15320
- input_tokens: totalInputTokens,
15321
- output_tokens: totalOutputTokens
15322
- },
15323
- model_usage: Array.from(modelUsageMap.entries()).map(
15324
- ([modelName, counts]) => ({
15325
- model: modelName,
15326
- token_count: {
15327
- input_tokens: counts.input,
15328
- output_tokens: counts.output
15329
- }
15330
- })
15331
- )
15332
- }
15333
- }
15334
- };
15350
+ return buildPromptResponse("max_turn_requests");
15335
15351
  }
15336
15352
  if (pendingSend.signal.aborted) {
15337
15353
  return { stopReason: "cancelled" };
@@ -15341,6 +15357,8 @@ ${thought.description}`;
15341
15357
  let turnModelId = this.context.config.getModel();
15342
15358
  let turnInputTokens = 0;
15343
15359
  let turnOutputTokens = 0;
15360
+ let turnCachedTokens = 0;
15361
+ let turnThoughtTokens = 0;
15344
15362
  try {
15345
15363
  const responseStream = this.context.geminiClient.sendMessageStream(
15346
15364
  currentParts,
@@ -15380,6 +15398,15 @@ ${event.value.description}`;
15380
15398
  if (usage2) {
15381
15399
  turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
15382
15400
  turnOutputTokens = usage2.candidatesTokenCount ?? turnOutputTokens;
15401
+ turnCachedTokens = usage2.cachedContentTokenCount ?? turnCachedTokens;
15402
+ turnThoughtTokens = usage2.thoughtsTokenCount ?? turnThoughtTokens;
15403
+ await this.sendUpdate({
15404
+ sessionUpdate: "usage_update",
15405
+ used: turnInputTokens + turnOutputTokens,
15406
+ size: tokenLimit(
15407
+ turnModelId || this.context.config.getModel()
15408
+ )
15409
+ });
15383
15410
  }
15384
15411
  break;
15385
15412
  }
@@ -15423,26 +15450,7 @@ ${event.value.description}`;
15423
15450
  throw error;
15424
15451
  }
15425
15452
  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")) {
15426
- return {
15427
- stopReason: "end_turn",
15428
- _meta: {
15429
- quota: {
15430
- token_count: {
15431
- input_tokens: totalInputTokens,
15432
- output_tokens: totalOutputTokens
15433
- },
15434
- model_usage: Array.from(modelUsageMap.entries()).map(
15435
- ([modelName, counts]) => ({
15436
- model: modelName,
15437
- token_count: {
15438
- input_tokens: counts.input,
15439
- output_tokens: counts.output
15440
- }
15441
- })
15442
- )
15443
- }
15444
- }
15445
- };
15453
+ return buildPromptResponse("end_turn");
15446
15454
  }
15447
15455
  throw new RequestError(
15448
15456
  getErrorStatus(error) || 500,
@@ -15451,6 +15459,8 @@ ${event.value.description}`;
15451
15459
  }
15452
15460
  totalInputTokens += turnInputTokens;
15453
15461
  totalOutputTokens += turnOutputTokens;
15462
+ totalCachedTokens += turnCachedTokens;
15463
+ totalThoughtTokens += turnThoughtTokens;
15454
15464
  if (turnInputTokens > 0 || turnOutputTokens > 0) {
15455
15465
  const existing = modelUsageMap.get(turnModelId) ?? {
15456
15466
  input: 0,
@@ -15461,26 +15471,7 @@ ${event.value.description}`;
15461
15471
  modelUsageMap.set(turnModelId, existing);
15462
15472
  }
15463
15473
  if (stopReason !== "end_turn") {
15464
- return {
15465
- stopReason,
15466
- _meta: {
15467
- quota: {
15468
- token_count: {
15469
- input_tokens: totalInputTokens,
15470
- output_tokens: totalOutputTokens
15471
- },
15472
- model_usage: Array.from(modelUsageMap.entries()).map(
15473
- ([modelName, counts]) => ({
15474
- model: modelName,
15475
- token_count: {
15476
- input_tokens: counts.input,
15477
- output_tokens: counts.output
15478
- }
15479
- })
15480
- )
15481
- }
15482
- }
15483
- };
15474
+ return buildPromptResponse(stopReason);
15484
15475
  }
15485
15476
  if (toolCallRequests.length === 0) {
15486
15477
  break;
@@ -15497,27 +15488,7 @@ ${event.value.description}`;
15497
15488
  }
15498
15489
  currentParts = toolResponseParts;
15499
15490
  }
15500
- const modelUsageArray = Array.from(modelUsageMap.entries()).map(
15501
- ([modelName, counts]) => ({
15502
- model: modelName,
15503
- token_count: {
15504
- input_tokens: counts.input,
15505
- output_tokens: counts.output
15506
- }
15507
- })
15508
- );
15509
- return {
15510
- stopReason: "end_turn",
15511
- _meta: {
15512
- quota: {
15513
- token_count: {
15514
- input_tokens: totalInputTokens,
15515
- output_tokens: totalOutputTokens
15516
- },
15517
- model_usage: modelUsageArray
15518
- }
15519
- }
15520
- };
15491
+ return buildPromptResponse("end_turn");
15521
15492
  }
15522
15493
  async handleCommand(commandText, parts) {
15523
15494
  const gitService = await this.context.config.getGitService();
@@ -17331,7 +17302,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
17331
17302
  }
17332
17303
  }
17333
17304
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
17334
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-WOM6QZHM.js");
17305
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-HKQPFDGD.js");
17335
17306
  await doStartUI(
17336
17307
  config,
17337
17308
  settings,
@@ -17540,7 +17511,7 @@ ${finalArgs[promptIndex + 1]}`;
17540
17511
  await config.storage.initialize();
17541
17512
  adminControlsListner.setConfig(config);
17542
17513
  if (config.isInteractive() && settings.merged.general.devtools) {
17543
- const { setupInitialActivityLogger } = await import("./devtoolsService-S4ZTRGJL.js");
17514
+ const { setupInitialActivityLogger } = await import("./devtoolsService-56VDVUOL.js");
17544
17515
  setupInitialActivityLogger(config);
17545
17516
  }
17546
17517
  registerTelemetryConfig(config);
@@ -17599,7 +17570,7 @@ ${finalArgs[promptIndex + 1]}`;
17599
17570
  const initAppHandle = startupProfiler.start("initialize_app");
17600
17571
  const initializationResult = await initializeApp(config, settings);
17601
17572
  initAppHandle?.end();
17602
- import("./liteRtServerManager-EH2L2UVH.js").then(({ LiteRtServerManager }) => {
17573
+ import("./liteRtServerManager-UKLGHLER.js").then(({ LiteRtServerManager }) => {
17603
17574
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
17604
17575
  if (!mergedGemma) return;
17605
17576
  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-NTWFJ2RF.js";
8
- import "./chunk-EIMVJG2V.js";
9
- import "./chunk-RXHIISMM.js";
10
- import "./chunk-NWSCUKK3.js";
7
+ } from "./chunk-GY7Q52OV.js";
8
+ import "./chunk-JOP7W7XN.js";
9
+ import "./chunk-XBPTRJT2.js";
10
+ import "./chunk-2IX6DWAW.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-IUUIT4SU.js";
13
13
  import "./chunk-L6PII3GR.js";
@@ -107,9 +107,9 @@ ${error instanceof Error ? error.stack ?? error.message : String(error)}
107
107
  }
108
108
  }
109
109
  } else {
110
- const { main } = await import("./gemini-5T5BS7L7.js");
111
- const { FatalError, writeToStderr } = await import("./dist-MTMOCTIW.js");
112
- const { runExitCleanup } = await import("./cleanup-EX2L3L3E.js");
110
+ const { main } = await import("./gemini-7ZTG2TNC.js");
111
+ const { FatalError, writeToStderr } = await import("./dist-M35X4WPV.js");
112
+ const { runExitCleanup } = await import("./cleanup-ZAXFNDOC.js");
113
113
  main().catch(async (error) => {
114
114
  const cleanupTimeout = setTimeout(() => {
115
115
  writeToStderr("Cleanup timed out, forcing exit...\n");
@@ -171,10 +171,10 @@ import {
171
171
  widestLineFromStyledChars,
172
172
  wordBreakStyledChars,
173
173
  wrapStyledChars
174
- } from "./chunk-GRSO6OI3.js";
174
+ } from "./chunk-25CRZGVM.js";
175
175
  import {
176
176
  require_source
177
- } from "./chunk-R6Q6D3UA.js";
177
+ } from "./chunk-F6JETNEJ.js";
178
178
  import {
179
179
  appEvents
180
180
  } from "./chunk-5PS3AYFU.js";
@@ -227,24 +227,24 @@ import {
227
227
  stripAnsi,
228
228
  stripUnsafeCharacters,
229
229
  toCodePoints
230
- } from "./chunk-2NCBQURB.js";
230
+ } from "./chunk-A2FLYZAG.js";
231
231
  import {
232
232
  handleAutoUpdate,
233
233
  isDevelopment,
234
234
  relaunchApp,
235
235
  setUpdateHandler
236
- } from "./chunk-NTWFJ2RF.js";
236
+ } from "./chunk-GY7Q52OV.js";
237
237
  import {
238
238
  isTodoList,
239
239
  mapCoreStatusToDisplayStatus,
240
240
  require_react
241
- } from "./chunk-EIMVJG2V.js";
241
+ } from "./chunk-JOP7W7XN.js";
242
242
  import {
243
243
  registerCleanup,
244
244
  removeCleanup,
245
245
  runExitCleanup,
246
246
  setupTtyCheck
247
- } from "./chunk-RXHIISMM.js";
247
+ } from "./chunk-XBPTRJT2.js";
248
248
  import {
249
249
  ACTIVATE_SKILL_TOOL_NAME,
250
250
  AGENT_TOOL_NAME,
@@ -449,7 +449,7 @@ import {
449
449
  validatePlanContent,
450
450
  validatePlanPath,
451
451
  writeToStdout
452
- } from "./chunk-NWSCUKK3.js";
452
+ } from "./chunk-2IX6DWAW.js";
453
453
  import "./chunk-664ZODQF.js";
454
454
  import "./chunk-IUUIT4SU.js";
455
455
  import "./chunk-L6PII3GR.js";
@@ -30368,10 +30368,20 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30368
30368
  const [discoveryResults, setDiscoveryResults] = (0, import_react103.useState)(null);
30369
30369
  const [isRestarting, setIsRestarting] = (0, import_react103.useState)(false);
30370
30370
  const startupMessageSent = (0, import_react103.useRef)(false);
30371
+ const onTrustChangeRef = (0, import_react103.useRef)(onTrustChange);
30372
+ const addItemRef = (0, import_react103.useRef)(addItem);
30373
+ const settingsRef = (0, import_react103.useRef)(settings);
30374
+ (0, import_react103.useEffect)(() => {
30375
+ onTrustChangeRef.current = onTrustChange;
30376
+ addItemRef.current = addItem;
30377
+ settingsRef.current = settings;
30378
+ }, [onTrustChange, addItem, settings]);
30371
30379
  const folderTrust = settings.merged.security.folderTrust.enabled ?? true;
30372
30380
  (0, import_react103.useEffect)(() => {
30373
30381
  let isMounted = true;
30374
- const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
30382
+ const { isTrusted: trusted } = isWorkspaceTrusted(
30383
+ settingsRef.current.merged
30384
+ );
30375
30385
  if (trusted === void 0 || trusted === false) {
30376
30386
  void FolderTrustDiscoveryService.discover(process10.cwd()).then((results) => {
30377
30387
  if (isMounted) {
@@ -30382,7 +30392,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30382
30392
  }
30383
30393
  const showUntrustedMessage = () => {
30384
30394
  if (trusted === false && !startupMessageSent.current) {
30385
- addItem(
30395
+ addItemRef.current(
30386
30396
  {
30387
30397
  type: "info" /* INFO */,
30388
30398
  text: "This folder is untrusted, project settings, hooks, MCPs, and GEMINI.md files will not be applied for this folder.\nUse the `/permissions` command to change the trust level."
@@ -30392,23 +30402,16 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30392
30402
  startupMessageSent.current = true;
30393
30403
  }
30394
30404
  };
30395
- if (isHeadlessMode()) {
30396
- if (isMounted) {
30397
- setIsTrusted(trusted);
30398
- setIsFolderTrustDialogOpen(false);
30399
- onTrustChange(true);
30400
- showUntrustedMessage();
30401
- }
30402
- } else if (isMounted) {
30405
+ if (isMounted) {
30403
30406
  setIsTrusted(trusted);
30404
- setIsFolderTrustDialogOpen(trusted === void 0);
30405
- onTrustChange(trusted);
30407
+ setIsFolderTrustDialogOpen(!isHeadlessMode() && trusted === void 0);
30408
+ onTrustChangeRef.current(trusted);
30406
30409
  showUntrustedMessage();
30407
30410
  }
30408
30411
  return () => {
30409
30412
  isMounted = false;
30410
30413
  };
30411
- }, [folderTrust, onTrustChange, settings.merged, addItem]);
30414
+ }, [folderTrust]);
30412
30415
  const handleFolderTrustSelect = (0, import_react103.useCallback)(
30413
30416
  async (choice) => {
30414
30417
  const trustLevelMap = {
@@ -30434,7 +30437,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30434
30437
  return;
30435
30438
  }
30436
30439
  const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30437
- onTrustChange(currentIsTrusted);
30440
+ onTrustChangeRef.current(currentIsTrusted);
30438
30441
  setIsTrusted(currentIsTrusted);
30439
30442
  const wasTrusted = isTrusted ?? false;
30440
30443
  if (wasTrusted !== currentIsTrusted) {
@@ -30444,7 +30447,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30444
30447
  setIsFolderTrustDialogOpen(false);
30445
30448
  }
30446
30449
  },
30447
- [onTrustChange, isTrusted]
30450
+ [isTrusted]
30448
30451
  );
30449
30452
  return {
30450
30453
  isTrusted,
@@ -33888,7 +33891,7 @@ ${queuedText}` : queuedText;
33888
33891
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33889
33892
  if (settings.merged.general.devtools) {
33890
33893
  void (async () => {
33891
- const { toggleDevToolsPanel } = await import("./devtoolsService-TJPENQSW.js");
33894
+ const { toggleDevToolsPanel } = await import("./devtoolsService-AAFN6NAN.js");
33892
33895
  await toggleDevToolsPanel(
33893
33896
  config,
33894
33897
  showErrorDetails,