@google/gemini-cli 0.40.0-preview.2 → 0.40.0-preview.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bundle/{chunk-WL5MCPV2.js → chunk-35STMVQ6.js} +2 -2
  2. package/bundle/{chunk-EFCQXWIF.js → chunk-47HVBRLD.js} +3 -3
  3. package/bundle/{chunk-HV36F4CL.js → chunk-5UA5NDVP.js} +134 -354
  4. package/bundle/{chunk-IUVLJUOL.js → chunk-B4NHGUNE.js} +2 -2
  5. package/bundle/{chunk-NO7STVVM.js → chunk-EEQGWBJU.js} +1413 -1089
  6. package/bundle/{chunk-IMEC72NS.js → chunk-EJ5U5A3P.js} +1 -1
  7. package/bundle/{chunk-33ANPP4S.js → chunk-ELANWZTZ.js} +3 -3
  8. package/bundle/{chunk-3GU3LF3I.js → chunk-F2KGMQCY.js} +180 -9
  9. package/bundle/{chunk-VCGILCZV.js → chunk-F73F75XM.js} +16 -0
  10. package/bundle/{chunk-PLUWJHZZ.js → chunk-FRCZJECU.js} +237 -54
  11. package/bundle/{chunk-UBXB5AEJ.js → chunk-GDNYA45E.js} +3 -3
  12. package/bundle/{chunk-TDW6FM3A.js → chunk-KITSDDOZ.js} +1 -1
  13. package/bundle/{chunk-WHIWQCI5.js → chunk-KKO2XSBY.js} +1 -1
  14. package/bundle/{chunk-GXRQOXQF.js → chunk-KUAEOA2Q.js} +177 -7
  15. package/bundle/{chunk-4IJPDKI6.js → chunk-KVGAAOEJ.js} +146 -364
  16. package/bundle/{chunk-QK7UWGBN.js → chunk-MRSOTTBM.js} +1380 -1081
  17. package/bundle/{chunk-MUGUV6RZ.js → chunk-MUEKKRWF.js} +2 -2
  18. package/bundle/chunk-R4ZCSDPK.js +80018 -0
  19. package/bundle/chunk-RMQT572G.js +156 -0
  20. package/bundle/chunk-RVU5Q4NB.js +118 -0
  21. package/bundle/{chunk-2RHFUIH4.js → chunk-UHHRGNIO.js} +16 -0
  22. package/bundle/chunk-UX5CFZ75.js +17505 -0
  23. package/bundle/{chunk-RM43GNQQ.js → chunk-UZ5SUJO4.js} +7709 -12907
  24. package/bundle/chunk-VQVLJLWD.js +1571 -0
  25. package/bundle/{chunk-NIVCRM5L.js → chunk-VUHGADMU.js} +134 -354
  26. package/bundle/chunk-YCTQOSY2.js +351149 -0
  27. package/bundle/{cleanup-A7WXWAMI.js → cleanup-BWZ7GONS.js} +3 -3
  28. package/bundle/{cleanup-EWPIME2M.js → cleanup-F6XR3KDW.js} +3 -3
  29. package/bundle/{cleanup-IPLJJT5S.js → cleanup-PS3UGKWX.js} +3 -3
  30. package/bundle/cleanup-VV6AV4T2.js +33 -0
  31. package/bundle/{core-VCDK23ZC.js → core-NDKZ44LE.js} +28 -2
  32. package/bundle/{devtoolsService-B5VVZ752.js → devtoolsService-DNFLMYOX.js} +3 -3
  33. package/bundle/{devtoolsService-2JXSALRU.js → devtoolsService-F6QBRWPB.js} +5 -4
  34. package/bundle/{devtoolsService-6Y6YER6T.js → devtoolsService-XGIYIDBD.js} +3 -3
  35. package/bundle/devtoolsService-YD6JSR34.js +852 -0
  36. package/bundle/{dist-UIXQETMC.js → dist-54TUMSKA.js} +28 -2
  37. package/bundle/{core-BQT6T3CH.js → dist-6KUUELBS.js} +28 -2
  38. package/bundle/dist-QHCXV4N4.js +2046 -0
  39. package/bundle/docs/cli/cli-reference.md +1 -0
  40. package/bundle/docs/cli/trusted-folders.md +28 -0
  41. package/bundle/docs/reference/configuration.md +14 -0
  42. package/bundle/{gemini-ID44Z5SV.js → gemini-HLGERR6W.js} +65 -21
  43. package/bundle/{gemini-54LH6RUH.js → gemini-IRPF2U4N.js} +241 -182
  44. package/bundle/gemini-QZM4UKD6.js +16087 -0
  45. package/bundle/{gemini-44W2QEZI.js → gemini-TU6PHHWE.js} +63 -20
  46. package/bundle/gemini.js +3 -3
  47. package/bundle/{interactiveCli-5MTJDFYC.js → interactiveCli-374EDFUA.js} +17 -167
  48. package/bundle/{interactiveCli-JFBPGMNM.js → interactiveCli-EKTBCA5F.js} +30 -179
  49. package/bundle/{interactiveCli-5B3X6RNB.js → interactiveCli-GRSDCSR3.js} +300 -432
  50. package/bundle/interactiveCli-HN4DKCW5.js +34448 -0
  51. package/bundle/{liteRtServerManager-76V63PRJ.js → liteRtServerManager-46V57ROR.js} +4 -4
  52. package/bundle/{liteRtServerManager-WQMDPACQ.js → liteRtServerManager-E34UIEBJ.js} +4 -4
  53. package/bundle/{liteRtServerManager-6GJWEP5W.js → liteRtServerManager-EAWDC35K.js} +4 -4
  54. package/bundle/liteRtServerManager-HTDKEOQC.js +65 -0
  55. package/bundle/{memoryDiscovery-RYHYLAPJ.js → memoryDiscovery-CZURD35O.js} +1 -1
  56. package/bundle/{memoryDiscovery-HWEYBJE7.js → memoryDiscovery-GZLXKRGB.js} +1 -1
  57. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  58. package/bundle/{oauth2-provider-JCKLNKRV.js → oauth2-provider-N7Q7FNNA.js} +2 -2
  59. package/bundle/{oauth2-provider-EX6SQEZP.js → oauth2-provider-TW3RXTUS.js} +2 -2
  60. package/bundle/{oauth2-provider-ZF52AWQY.js → oauth2-provider-UQIDMKYA.js} +39 -73
  61. package/bundle/oauth2-provider-WTRWHBI2.js +237 -0
  62. package/bundle/{start-CYDJTOAP.js → start-4D5PYHGK.js} +6 -6
  63. package/bundle/{start-SHOUHW3Y.js → start-7DJXXKMH.js} +6 -6
  64. package/bundle/{start-B6EMQCH5.js → start-ERRBQVDH.js} +6 -6
  65. package/bundle/start-TKRKH572.js +18 -0
  66. package/package.json +1 -1
@@ -24,6 +24,7 @@ import {
24
24
  initializeApp,
25
25
  installSkill,
26
26
  isAlternateBufferEnabled,
27
+ isRecord,
27
28
  isSlashCommand,
28
29
  linkSkill,
29
30
  normalizeServerId,
@@ -42,18 +43,18 @@ import {
42
43
  updateAllUpdatableExtensions,
43
44
  updateExtension,
44
45
  validateAuthMethod
45
- } from "./chunk-GXRQOXQF.js";
46
+ } from "./chunk-KUAEOA2Q.js";
46
47
  import {
47
48
  appEvents
48
49
  } from "./chunk-5PS3AYFU.js";
49
50
  import {
50
51
  startCommand,
51
52
  startServer
52
- } from "./chunk-33ANPP4S.js";
53
+ } from "./chunk-RVU5Q4NB.js";
53
54
  import {
54
55
  exitCli,
55
56
  require_source
56
- } from "./chunk-WHIWQCI5.js";
57
+ } from "./chunk-KKO2XSBY.js";
57
58
  import {
58
59
  DEFAULT_PORT,
59
60
  GEMMA_MODEL_NAME,
@@ -87,7 +88,7 @@ import {
87
88
  readServerProcessInfo,
88
89
  resolveGemmaConfig,
89
90
  saveModelChange
90
- } from "./chunk-4IJPDKI6.js";
91
+ } from "./chunk-VUHGADMU.js";
91
92
  import {
92
93
  cleanupCheckpoints,
93
94
  registerCleanup,
@@ -96,7 +97,7 @@ import {
96
97
  runExitCleanup,
97
98
  runSyncCleanup,
98
99
  setupSignalHandlers
99
- } from "./chunk-MUGUV6RZ.js";
100
+ } from "./chunk-B4NHGUNE.js";
100
101
  import {
101
102
  AuthType,
102
103
  ChatRecordingService,
@@ -183,7 +184,7 @@ import {
183
184
  updatePolicy,
184
185
  writeToStderr,
185
186
  writeToStdout
186
- } from "./chunk-RM43GNQQ.js";
187
+ } from "./chunk-EEQGWBJU.js";
187
188
  import {
188
189
  ASK_USER_TOOL_NAME,
189
190
  DEFAULT_FILE_FILTERING_OPTIONS,
@@ -202,6 +203,7 @@ import {
202
203
  FatalSandboxError,
203
204
  FatalToolExecutionError,
204
205
  FatalTurnLimitedError,
206
+ FatalUntrustedWorkspaceError,
205
207
  GEMINI_DIR,
206
208
  GEMINI_MODEL_ALIAS_AUTO,
207
209
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
@@ -226,7 +228,7 @@ import {
226
228
  loadServerHierarchicalMemory,
227
229
  resolveToRealPath,
228
230
  setGeminiMdFilename
229
- } from "./chunk-2RHFUIH4.js";
231
+ } from "./chunk-UHHRGNIO.js";
230
232
  import "./chunk-664ZODQF.js";
231
233
  import "./chunk-RJTRUG2J.js";
232
234
  import "./chunk-IUUIT4SU.js";
@@ -8164,6 +8166,10 @@ async function parseArguments(settings) {
8164
8166
  type: "string",
8165
8167
  nargs: 1,
8166
8168
  description: "Execute the provided prompt and continue in interactive mode"
8169
+ }).option("skip-trust", {
8170
+ type: "boolean",
8171
+ description: "Trust the current workspace for this session.",
8172
+ default: false
8167
8173
  }).option("worktree", {
8168
8174
  alias: "w",
8169
8175
  type: "string",
@@ -8285,9 +8291,16 @@ async function parseArguments(settings) {
8285
8291
  yargsInstance.wrap(yargsInstance.terminalWidth());
8286
8292
  let result;
8287
8293
  try {
8288
- result = await yargsInstance.parse();
8294
+ const parsed = await yargsInstance.parse();
8295
+ if (!isRecord(parsed)) {
8296
+ throw new Error("Failed to parse arguments");
8297
+ }
8298
+ result = parsed;
8299
+ if (result["skip-trust"]) {
8300
+ process3.env["GEMINI_CLI_TRUST_WORKSPACE"] = "true";
8301
+ }
8289
8302
  } catch (e) {
8290
- const msg = e instanceof Error ? e.message : String(e);
8303
+ const msg = getErrorMessage(e);
8291
8304
  debugLogger.error(msg);
8292
8305
  yargsInstance.showHelp();
8293
8306
  await runExitCleanup();
@@ -8297,8 +8310,13 @@ async function parseArguments(settings) {
8297
8310
  await runExitCleanup();
8298
8311
  process3.exit(0);
8299
8312
  }
8300
- const queryArg = result.query;
8301
- const q = Array.isArray(queryArg) ? queryArg.join(" ") : queryArg;
8313
+ const queryArg = result["query"];
8314
+ let q;
8315
+ if (Array.isArray(queryArg)) {
8316
+ q = queryArg.join(" ");
8317
+ } else if (typeof queryArg === "string") {
8318
+ q = queryArg;
8319
+ }
8302
8320
  if (q && !result["prompt"]) {
8303
8321
  if (!isHeadlessMode()) {
8304
8322
  startupMessages.push(
@@ -8329,7 +8347,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8329
8347
  const includeDirectoryTree = settings.context?.includeDirectoryTree ?? true;
8330
8348
  const ideMode = settings.ide?.enabled ?? false;
8331
8349
  const folderTrust = process3.env["GEMINI_CLI_INTEGRATION_TEST"] === "true" || process3.env["VITEST"] === "true" ? false : settings.security?.folderTrust?.enabled ?? false;
8332
- const trustedFolder = isWorkspaceTrusted(settings, cwd, void 0, {
8350
+ const trustedFolder = isWorkspaceTrusted(settings, cwd, {
8333
8351
  prompt: argv.prompt,
8334
8352
  query: argv.query
8335
8353
  })?.isTrusted ?? false;
@@ -8358,7 +8376,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8358
8376
  return resolveToRealPath(trimmedPath) !== realCwd;
8359
8377
  } catch (e) {
8360
8378
  debugLogger.debug(
8361
- `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${e instanceof Error ? e.message : String(e)})`
8379
+ `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${getErrorMessage(e)})`
8362
8380
  );
8363
8381
  return false;
8364
8382
  }
@@ -8751,7 +8769,7 @@ async function resolveWorktreeSettings(cwd) {
8751
8769
  worktreeBaseSha = stdout.trim();
8752
8770
  } catch (e) {
8753
8771
  debugLogger.debug(
8754
- `Failed to resolve worktree base SHA at ${worktreePath}: ${e instanceof Error ? e.message : String(e)}`
8772
+ `Failed to resolve worktree base SHA at ${worktreePath}: ${getErrorMessage(e)}`
8755
8773
  );
8756
8774
  }
8757
8775
  if (!worktreeBaseSha) {
@@ -9890,9 +9908,29 @@ var rootDirectoryCheck = {
9890
9908
  }
9891
9909
  }
9892
9910
  };
9911
+ var folderTrustCheck = {
9912
+ id: "folder-trust",
9913
+ priority: "high" /* High */,
9914
+ check: async (workspaceRoot, settings) => {
9915
+ if (!isFolderTrustEnabled(settings)) {
9916
+ return null;
9917
+ }
9918
+ const { isTrusted } = isWorkspaceTrusted(settings, workspaceRoot);
9919
+ if (isTrusted === true) {
9920
+ return null;
9921
+ }
9922
+ if (isHeadlessMode()) {
9923
+ throw new FatalUntrustedWorkspaceError(
9924
+ "Gemini CLI is not running in a trusted directory. To proceed, either use `--skip-trust`, set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, or trust this directory in interactive mode. For more details, see https://geminicli.com/docs/cli/trusted-folders/#headless-and-automated-environments"
9925
+ );
9926
+ }
9927
+ return null;
9928
+ }
9929
+ };
9893
9930
  var WARNING_CHECKS = [
9894
9931
  homeDirectoryCheck,
9895
- rootDirectoryCheck
9932
+ rootDirectoryCheck,
9933
+ folderTrustCheck
9896
9934
  ];
9897
9935
  async function getUserStartupWarnings(settings, workspaceRoot = process4.cwd(), options) {
9898
9936
  const results = await Promise.all(
@@ -10257,7 +10295,7 @@ async function runNonInteractive({
10257
10295
  }
10258
10296
  });
10259
10297
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10260
- const { setupInitialActivityLogger } = await import("./devtoolsService-6Y6YER6T.js");
10298
+ const { setupInitialActivityLogger } = await import("./devtoolsService-XGIYIDBD.js");
10261
10299
  setupInitialActivityLogger(config);
10262
10300
  }
10263
10301
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10708,7 +10746,7 @@ async function runNonInteractive2(params) {
10708
10746
  }
10709
10747
  });
10710
10748
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10711
- const { setupInitialActivityLogger } = await import("./devtoolsService-6Y6YER6T.js");
10749
+ const { setupInitialActivityLogger } = await import("./devtoolsService-XGIYIDBD.js");
10712
10750
  setupInitialActivityLogger(config);
10713
10751
  }
10714
10752
  const { stdout: workingStdout } = createWorkingStdio();
@@ -15557,7 +15595,7 @@ async function resolveSessionId(resumeArg) {
15557
15595
  }
15558
15596
  }
15559
15597
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15560
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-5B3X6RNB.js");
15598
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-374EDFUA.js");
15561
15599
  await doStartUI(
15562
15600
  config,
15563
15601
  settings,
@@ -15759,7 +15797,7 @@ ${finalArgs[promptIndex + 1]}`;
15759
15797
  await config.storage.initialize();
15760
15798
  adminControlsListner.setConfig(config);
15761
15799
  if (config.isInteractive() && settings.merged.general.devtools) {
15762
- const { setupInitialActivityLogger } = await import("./devtoolsService-6Y6YER6T.js");
15800
+ const { setupInitialActivityLogger } = await import("./devtoolsService-XGIYIDBD.js");
15763
15801
  setupInitialActivityLogger(config);
15764
15802
  }
15765
15803
  registerTelemetryConfig(config);
@@ -15815,7 +15853,7 @@ ${finalArgs[promptIndex + 1]}`;
15815
15853
  const initAppHandle = startupProfiler.start("initialize_app");
15816
15854
  const initializationResult = await initializeApp(config, settings);
15817
15855
  initAppHandle?.end();
15818
- import("./liteRtServerManager-WQMDPACQ.js").then(({ LiteRtServerManager }) => {
15856
+ import("./liteRtServerManager-46V57ROR.js").then(({ LiteRtServerManager }) => {
15819
15857
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
15820
15858
  if (!mergedGemma) return;
15821
15859
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -15848,6 +15886,11 @@ ${finalArgs[promptIndex + 1]}`;
15848
15886
  })
15849
15887
  ];
15850
15888
  cliStartupHandle?.end();
15889
+ if (!config.isInteractive()) {
15890
+ for (const warning of startupWarnings) {
15891
+ writeToStderr(warning.message + "\n");
15892
+ }
15893
+ }
15851
15894
  if (config.isInteractive()) {
15852
15895
  if (process.stdin.isTTY) {
15853
15896
  process.stdin.resume();
package/bundle/gemini.js CHANGED
@@ -103,9 +103,9 @@ ${error instanceof Error ? error.stack ?? error.message : String(error)}
103
103
  }
104
104
  }
105
105
  } else {
106
- const { main } = await import("./gemini-ID44Z5SV.js");
107
- const { FatalError, writeToStderr } = await import("./dist-UIXQETMC.js");
108
- const { runExitCleanup } = await import("./cleanup-A7WXWAMI.js");
106
+ const { main } = await import("./gemini-IRPF2U4N.js");
107
+ const { FatalError, writeToStderr } = await import("./dist-QHCXV4N4.js");
108
+ const { runExitCleanup } = await import("./cleanup-F6XR3KDW.js");
109
109
  main().catch(async (error) => {
110
110
  const cleanupTimeout = setTimeout(() => {
111
111
  writeToStderr("Cleanup timed out, forcing exit...\n");
@@ -70,8 +70,15 @@ import {
70
70
  formatDuration,
71
71
  formatResetTime,
72
72
  getBoundingBox,
73
+ getDialogRestartRequiredSettings,
74
+ getDialogSettingKeys,
75
+ getDisplayValue,
76
+ getEditValue,
77
+ getEffectiveValue,
73
78
  getFileExtension,
74
79
  getFormattedSettingValue,
80
+ getNestedValue,
81
+ getSettingDefinition,
75
82
  getStatusColor,
76
83
  getTransformUnderCursor,
77
84
  getUsedStatusColor,
@@ -83,8 +90,10 @@ import {
83
90
  isBrowser,
84
91
  isContextUsageHigh,
85
92
  isDevelopment,
93
+ isInSettingsScope,
86
94
  isNarrowWidth,
87
95
  isNewFile,
96
+ isRecord,
88
97
  isSlashCommand,
89
98
  isUltraTier,
90
99
  loadKeyMatchers,
@@ -93,6 +102,7 @@ import {
93
102
  openFileInEditor,
94
103
  parseColor,
95
104
  parseDiffWithLineNumbers,
105
+ parseEditedValue,
96
106
  parseSlashCommand,
97
107
  persistentState,
98
108
  profiler,
@@ -144,13 +154,13 @@ import {
144
154
  widestLineFromStyledChars,
145
155
  wordBreakStyledChars,
146
156
  wrapStyledChars
147
- } from "./chunk-PLUWJHZZ.js";
157
+ } from "./chunk-KUAEOA2Q.js";
148
158
  import {
149
159
  appEvents
150
160
  } from "./chunk-5PS3AYFU.js";
151
161
  import {
152
162
  require_source
153
- } from "./chunk-TDW6FM3A.js";
163
+ } from "./chunk-KKO2XSBY.js";
154
164
  import {
155
165
  ACTIVE_SHELL_MAX_LINES,
156
166
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -188,7 +198,6 @@ import {
188
198
  getCachedStringWidth,
189
199
  getLuminance,
190
200
  getSessionFiles,
191
- getSettingsSchema,
192
201
  interpolateColor,
193
202
  isLoadableSettingScope,
194
203
  isTodoList,
@@ -204,13 +213,13 @@ import {
204
213
  stringWidth,
205
214
  stripUnsafeCharacters,
206
215
  toCodePoints
207
- } from "./chunk-NIVCRM5L.js";
216
+ } from "./chunk-VUHGADMU.js";
208
217
  import {
209
218
  registerCleanup,
210
219
  removeCleanup,
211
220
  runExitCleanup,
212
221
  setupTtyCheck
213
- } from "./chunk-IUVLJUOL.js";
222
+ } from "./chunk-B4NHGUNE.js";
214
223
  import {
215
224
  ApiKeyUpdatedEvent,
216
225
  AsyncFzf,
@@ -327,7 +336,7 @@ import {
327
336
  validatePlanContent,
328
337
  validatePlanPath,
329
338
  writeToStdout
330
- } from "./chunk-NO7STVVM.js";
339
+ } from "./chunk-EEQGWBJU.js";
331
340
  import {
332
341
  ACTIVATE_SKILL_TOOL_NAME,
333
342
  AGENT_TOOL_NAME,
@@ -385,7 +394,7 @@ import {
385
394
  safeJsonToMarkdown,
386
395
  shortenPath,
387
396
  tildeifyPath
388
- } from "./chunk-2RHFUIH4.js";
397
+ } from "./chunk-UHHRGNIO.js";
389
398
  import "./chunk-664ZODQF.js";
390
399
  import "./chunk-RJTRUG2J.js";
391
400
  import "./chunk-IUUIT4SU.js";
@@ -13514,165 +13523,6 @@ var ConsentPrompt = (props) => {
13514
13523
  // packages/cli/src/ui/components/ThemeDialog.tsx
13515
13524
  var import_react47 = __toESM(require_react(), 1);
13516
13525
 
13517
- // packages/cli/src/utils/settingsUtils.ts
13518
- function flattenSchema(schema, prefix = "") {
13519
- let result = {};
13520
- for (const key in schema) {
13521
- const newKey = prefix ? `${prefix}.${key}` : key;
13522
- const definition = schema[key];
13523
- result[newKey] = { ...definition, key: newKey };
13524
- if (definition.properties) {
13525
- result = { ...result, ...flattenSchema(definition.properties, newKey) };
13526
- }
13527
- }
13528
- return result;
13529
- }
13530
- var _FLATTENED_SCHEMA;
13531
- function getFlattenedSchema() {
13532
- return _FLATTENED_SCHEMA ?? (_FLATTENED_SCHEMA = flattenSchema(getSettingsSchema()));
13533
- }
13534
- function getSettingDefinition(key) {
13535
- return getFlattenedSchema()[key];
13536
- }
13537
- function getDefaultValue(key) {
13538
- return getFlattenedSchema()[key]?.default;
13539
- }
13540
- function getDialogRestartRequiredSettings() {
13541
- return Object.values(getFlattenedSchema()).filter(
13542
- (definition) => definition.requiresRestart && definition.showInDialog !== false
13543
- ).map((definition) => definition.key);
13544
- }
13545
- function isRecord(value) {
13546
- return typeof value === "object" && value !== null;
13547
- }
13548
- function isSettingsValue(value) {
13549
- if (value === void 0) return true;
13550
- if (value === null) return false;
13551
- const type = typeof value;
13552
- return type === "string" || type === "number" || type === "boolean" || type === "object";
13553
- }
13554
- function getNestedValue(obj, path15) {
13555
- let current = obj;
13556
- for (const key of path15) {
13557
- if (!isRecord(current) || !(key in current)) {
13558
- return void 0;
13559
- }
13560
- current = current[key];
13561
- }
13562
- return current;
13563
- }
13564
- function getEffectiveValue(key, settings) {
13565
- const definition = getSettingDefinition(key);
13566
- if (!definition) {
13567
- return void 0;
13568
- }
13569
- const path15 = key.split(".");
13570
- const value = getNestedValue(settings, path15);
13571
- if (value !== void 0 && isSettingsValue(value)) {
13572
- return value;
13573
- }
13574
- return definition.default;
13575
- }
13576
- function getDialogSettingKeys() {
13577
- return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
13578
- }
13579
- function isInSettingsScope(key, scopeSettings) {
13580
- const path15 = key.split(".");
13581
- const value = getNestedValue(scopeSettings, path15);
13582
- return value !== void 0;
13583
- }
13584
- function getDisplayValue(key, scopeSettings, _mergedSettings) {
13585
- const definition = getSettingDefinition(key);
13586
- const existsInScope = isInSettingsScope(key, scopeSettings);
13587
- let value;
13588
- if (existsInScope) {
13589
- value = getEffectiveValue(key, scopeSettings);
13590
- } else {
13591
- value = getDefaultValue(key);
13592
- }
13593
- let valueString = String(value);
13594
- if (definition?.type === "object" && value !== null && typeof value === "object") {
13595
- valueString = JSON.stringify(value);
13596
- } else if (definition?.type === "enum" && definition.options) {
13597
- const option = definition.options?.find((option2) => option2.value === value);
13598
- valueString = option?.label ?? `${value}`;
13599
- }
13600
- if (definition?.unit === "%" && typeof value === "number") {
13601
- valueString = `${value} (${Math.round(value * 100)}%)`;
13602
- } else if (definition?.unit) {
13603
- valueString = `${valueString}${definition.unit}`;
13604
- }
13605
- if (existsInScope) {
13606
- return `${valueString}*`;
13607
- }
13608
- return valueString;
13609
- }
13610
- function tryParseJsonStringArray(input) {
13611
- try {
13612
- const parsed = JSON.parse(input);
13613
- if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
13614
- return parsed;
13615
- }
13616
- return null;
13617
- } catch {
13618
- return null;
13619
- }
13620
- }
13621
- function tryParseJsonObject(input) {
13622
- try {
13623
- const parsed = JSON.parse(input);
13624
- if (isRecord(parsed) && !Array.isArray(parsed)) {
13625
- return parsed;
13626
- }
13627
- return null;
13628
- } catch {
13629
- return null;
13630
- }
13631
- }
13632
- function parseStringArrayValue(input) {
13633
- const trimmed = input.trim();
13634
- if (trimmed === "") return [];
13635
- return tryParseJsonStringArray(trimmed) ?? input.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
13636
- }
13637
- function parseObjectValue(input) {
13638
- const trimmed = input.trim();
13639
- if (trimmed === "") {
13640
- return null;
13641
- }
13642
- return tryParseJsonObject(trimmed);
13643
- }
13644
- function parseEditedValue(type, newValue) {
13645
- if (type === "number") {
13646
- if (newValue.trim() === "") {
13647
- return null;
13648
- }
13649
- const numParsed = Number(newValue.trim());
13650
- if (Number.isNaN(numParsed)) {
13651
- return null;
13652
- }
13653
- return numParsed;
13654
- }
13655
- if (type === "array") {
13656
- return parseStringArrayValue(newValue);
13657
- }
13658
- if (type === "object") {
13659
- return parseObjectValue(newValue);
13660
- }
13661
- return newValue;
13662
- }
13663
- function getEditValue(type, rawValue) {
13664
- if (rawValue === void 0) {
13665
- return void 0;
13666
- }
13667
- if (type === "array" && Array.isArray(rawValue)) {
13668
- return rawValue.join(", ");
13669
- }
13670
- if (type === "object" && rawValue !== null && typeof rawValue === "object") {
13671
- return JSON.stringify(rawValue);
13672
- }
13673
- return void 0;
13674
- }
13675
-
13676
13526
  // packages/cli/src/utils/dialogScopeUtils.ts
13677
13527
  var SCOPE_LABELS = {
13678
13528
  ["User" /* User */]: "User Settings",
@@ -33590,7 +33440,7 @@ ${queuedText}` : queuedText;
33590
33440
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33591
33441
  if (settings.merged.general.devtools) {
33592
33442
  void (async () => {
33593
- const { toggleDevToolsPanel } = await import("./devtoolsService-2JXSALRU.js");
33443
+ const { toggleDevToolsPanel } = await import("./devtoolsService-XGIYIDBD.js");
33594
33444
  await toggleDevToolsPanel(
33595
33445
  config,
33596
33446
  showErrorDetails,