@google/gemini-cli 0.39.0 → 0.39.1

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 (46) hide show
  1. package/bundle/{chunk-NWD4JYMB.js → chunk-APBWRLCM.js} +1590 -6638
  2. package/bundle/{chunk-5GTZHSZV.js → chunk-BEUOMVKF.js} +1587 -6636
  3. package/bundle/{chunk-67TFD6HC.js → chunk-FNPZLVJU.js} +16 -0
  4. package/bundle/{chunk-UQGLVPZQ.js → chunk-GDRLBWZL.js} +3884 -2279
  5. package/bundle/{chunk-BL3XXS2L.js → chunk-GRNHS2XR.js} +2 -2
  6. package/bundle/{chunk-LUWQB4AS.js → chunk-N6R5LJKJ.js} +2 -2
  7. package/bundle/{chunk-6NW5RNNH.js → chunk-QPDKVNK5.js} +1656 -6692
  8. package/bundle/{chunk-QM5IP3NK.js → chunk-R32ABRMT.js} +16 -0
  9. package/bundle/chunk-RNWNACRD.js +96654 -0
  10. package/bundle/{chunk-YYY7NKKR.js → chunk-RVSGPQMZ.js} +2 -2
  11. package/bundle/{chunk-RTKRL6Y5.js → chunk-UGFPG7AM.js} +10090 -13916
  12. package/bundle/chunk-UIBQS45C.js +361893 -0
  13. package/bundle/{chunk-3YUTTNJ7.js → chunk-WFCK2Z32.js} +3916 -2286
  14. package/bundle/chunk-ZIXTYG56.js +156 -0
  15. package/bundle/{cleanup-3LELZME2.js → cleanup-DORKD3KW.js} +3 -3
  16. package/bundle/{cleanup-JJEXOHOA.js → cleanup-ROCPAQIR.js} +3 -3
  17. package/bundle/{cleanup-TTGHQXQN.js → cleanup-RV4C23S4.js} +3 -3
  18. package/bundle/cleanup-VFR4VRPU.js +33 -0
  19. package/bundle/{core-LKKLDF4Z.js → core-NHADWRAT.js} +28 -2
  20. package/bundle/{devtoolsService-UQCUIXV5.js → devtoolsService-65SKYXJR.js} +3 -3
  21. package/bundle/{devtoolsService-H64VB4IA.js → devtoolsService-6GKOMHGW.js} +3 -3
  22. package/bundle/{devtoolsService-L5LFSMIR.js → devtoolsService-OIMHTGLW.js} +5 -4
  23. package/bundle/devtoolsService-XJQQUBHU.js +871 -0
  24. package/bundle/{core-Z2SYVMM5.js → dist-2DBCGLDI.js} +28 -2
  25. package/bundle/{dist-FWHS5IHN.js → dist-7UL5MZ3N.js} +28 -2
  26. package/bundle/dist-FMEYWTZB.js +2036 -0
  27. package/bundle/docs/cli/cli-reference.md +1 -0
  28. package/bundle/docs/cli/trusted-folders.md +28 -0
  29. package/bundle/docs/reference/configuration.md +14 -0
  30. package/bundle/{gemini-BI2PCDUT.js → gemini-APY42TPN.js} +62 -18
  31. package/bundle/{gemini-CMXEUOSI.js → gemini-ASA6UVNB.js} +60 -17
  32. package/bundle/{gemini-YNLABPKW.js → gemini-JN2NUSDI.js} +238 -179
  33. package/bundle/gemini-ZVQNZBQE.js +15365 -0
  34. package/bundle/gemini.js +3 -3
  35. package/bundle/{interactiveCli-C46TDPVW.js → interactiveCli-7OEI5K4E.js} +15 -165
  36. package/bundle/{interactiveCli-P35Q3KZ2.js → interactiveCli-F6YUYJT5.js} +28 -177
  37. package/bundle/{interactiveCli-LXXBYVNU.js → interactiveCli-MSV2JUI2.js} +298 -430
  38. package/bundle/interactiveCli-WY7NQZAW.js +34344 -0
  39. package/bundle/{memoryDiscovery-U3XUU4QY.js → memoryDiscovery-OGUXPAKW.js} +1 -1
  40. package/bundle/{memoryDiscovery-MYQ3ZWKM.js → memoryDiscovery-OJZ52WPE.js} +1 -1
  41. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  42. package/bundle/{oauth2-provider-7ZDLUOSM.js → oauth2-provider-5GKHTO3W.js} +2 -2
  43. package/bundle/{oauth2-provider-CRWFOXYR.js → oauth2-provider-J42P6NQU.js} +2 -2
  44. package/bundle/{oauth2-provider-FEM5AIRT.js → oauth2-provider-MJYS4GHA.js} +39 -73
  45. package/bundle/oauth2-provider-UI5C6WYR.js +237 -0
  46. package/package.json +1 -1
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-BI2PCDUT.js");
107
- const { FatalError, writeToStderr } = await import("./dist-FWHS5IHN.js");
108
- const { runExitCleanup } = await import("./cleanup-JJEXOHOA.js");
106
+ const { main } = await import("./gemini-JN2NUSDI.js");
107
+ const { FatalError, writeToStderr } = await import("./dist-7UL5MZ3N.js");
108
+ const { runExitCleanup } = await import("./cleanup-ROCPAQIR.js");
109
109
  main().catch(async (error) => {
110
110
  const cleanupTimeout = setTimeout(() => {
111
111
  writeToStderr("Cleanup timed out, forcing exit...\n");
@@ -104,12 +104,18 @@ import {
104
104
  getAsciiArtWidth,
105
105
  getBoundingBox,
106
106
  getCachedStringWidth,
107
+ getDialogRestartRequiredSettings,
108
+ getDialogSettingKeys,
109
+ getDisplayValue,
110
+ getEditValue,
111
+ getEffectiveValue,
107
112
  getFileExtension,
108
113
  getFormattedSettingValue,
109
114
  getLuminance,
115
+ getNestedValue,
110
116
  getSafeLowColorBackground,
111
117
  getSessionFiles,
112
- getSettingsSchema,
118
+ getSettingDefinition,
113
119
  getStatusColor,
114
120
  getTransformUnderCursor,
115
121
  getUsedStatusColor,
@@ -122,9 +128,11 @@ import {
122
128
  isBrowser,
123
129
  isContextUsageHigh,
124
130
  isDevelopment,
131
+ isInSettingsScope,
125
132
  isLoadableSettingScope,
126
133
  isNarrowWidth,
127
134
  isNewFile,
135
+ isRecord,
128
136
  isSlashCommand,
129
137
  isTodoList,
130
138
  isUltraTier,
@@ -138,6 +146,7 @@ import {
138
146
  openFileInEditor,
139
147
  parseColor,
140
148
  parseDiffWithLineNumbers,
149
+ parseEditedValue,
141
150
  parseSlashCommand,
142
151
  persistentState,
143
152
  pickDefaultThemeName,
@@ -197,7 +206,7 @@ import {
197
206
  widestLineFromStyledChars,
198
207
  wordBreakStyledChars,
199
208
  wrapStyledChars
200
- } from "./chunk-6NW5RNNH.js";
209
+ } from "./chunk-BEUOMVKF.js";
201
210
  import {
202
211
  appEvents
203
212
  } from "./chunk-5PS3AYFU.js";
@@ -206,7 +215,7 @@ import {
206
215
  removeCleanup,
207
216
  runExitCleanup,
208
217
  setupTtyCheck
209
- } from "./chunk-LUWQB4AS.js";
218
+ } from "./chunk-GRNHS2XR.js";
210
219
  import {
211
220
  ApiKeyUpdatedEvent,
212
221
  AsyncFzf,
@@ -323,7 +332,7 @@ import {
323
332
  validatePlanContent,
324
333
  validatePlanPath,
325
334
  writeToStdout
326
- } from "./chunk-RTKRL6Y5.js";
335
+ } from "./chunk-WFCK2Z32.js";
327
336
  import {
328
337
  ACTIVATE_SKILL_TOOL_NAME,
329
338
  AGENT_TOOL_NAME,
@@ -381,7 +390,7 @@ import {
381
390
  safeJsonToMarkdown,
382
391
  shortenPath,
383
392
  tildeifyPath
384
- } from "./chunk-QM5IP3NK.js";
393
+ } from "./chunk-R32ABRMT.js";
385
394
  import "./chunk-664ZODQF.js";
386
395
  import "./chunk-RJTRUG2J.js";
387
396
  import "./chunk-IUUIT4SU.js";
@@ -13475,165 +13484,6 @@ var ConsentPrompt = (props) => {
13475
13484
  // packages/cli/src/ui/components/ThemeDialog.tsx
13476
13485
  var import_react47 = __toESM(require_react(), 1);
13477
13486
 
13478
- // packages/cli/src/utils/settingsUtils.ts
13479
- function flattenSchema(schema, prefix = "") {
13480
- let result = {};
13481
- for (const key in schema) {
13482
- const newKey = prefix ? `${prefix}.${key}` : key;
13483
- const definition = schema[key];
13484
- result[newKey] = { ...definition, key: newKey };
13485
- if (definition.properties) {
13486
- result = { ...result, ...flattenSchema(definition.properties, newKey) };
13487
- }
13488
- }
13489
- return result;
13490
- }
13491
- var _FLATTENED_SCHEMA;
13492
- function getFlattenedSchema() {
13493
- return _FLATTENED_SCHEMA ?? (_FLATTENED_SCHEMA = flattenSchema(getSettingsSchema()));
13494
- }
13495
- function getSettingDefinition(key) {
13496
- return getFlattenedSchema()[key];
13497
- }
13498
- function getDefaultValue(key) {
13499
- return getFlattenedSchema()[key]?.default;
13500
- }
13501
- function getDialogRestartRequiredSettings() {
13502
- return Object.values(getFlattenedSchema()).filter(
13503
- (definition) => definition.requiresRestart && definition.showInDialog !== false
13504
- ).map((definition) => definition.key);
13505
- }
13506
- function isRecord(value) {
13507
- return typeof value === "object" && value !== null;
13508
- }
13509
- function isSettingsValue(value) {
13510
- if (value === void 0) return true;
13511
- if (value === null) return false;
13512
- const type = typeof value;
13513
- return type === "string" || type === "number" || type === "boolean" || type === "object";
13514
- }
13515
- function getNestedValue(obj, path15) {
13516
- let current = obj;
13517
- for (const key of path15) {
13518
- if (!isRecord(current) || !(key in current)) {
13519
- return void 0;
13520
- }
13521
- current = current[key];
13522
- }
13523
- return current;
13524
- }
13525
- function getEffectiveValue(key, settings) {
13526
- const definition = getSettingDefinition(key);
13527
- if (!definition) {
13528
- return void 0;
13529
- }
13530
- const path15 = key.split(".");
13531
- const value = getNestedValue(settings, path15);
13532
- if (value !== void 0 && isSettingsValue(value)) {
13533
- return value;
13534
- }
13535
- return definition.default;
13536
- }
13537
- function getDialogSettingKeys() {
13538
- return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
13539
- }
13540
- function isInSettingsScope(key, scopeSettings) {
13541
- const path15 = key.split(".");
13542
- const value = getNestedValue(scopeSettings, path15);
13543
- return value !== void 0;
13544
- }
13545
- function getDisplayValue(key, scopeSettings, _mergedSettings) {
13546
- const definition = getSettingDefinition(key);
13547
- const existsInScope = isInSettingsScope(key, scopeSettings);
13548
- let value;
13549
- if (existsInScope) {
13550
- value = getEffectiveValue(key, scopeSettings);
13551
- } else {
13552
- value = getDefaultValue(key);
13553
- }
13554
- let valueString = String(value);
13555
- if (definition?.type === "object" && value !== null && typeof value === "object") {
13556
- valueString = JSON.stringify(value);
13557
- } else if (definition?.type === "enum" && definition.options) {
13558
- const option = definition.options?.find((option2) => option2.value === value);
13559
- valueString = option?.label ?? `${value}`;
13560
- }
13561
- if (definition?.unit === "%" && typeof value === "number") {
13562
- valueString = `${value} (${Math.round(value * 100)}%)`;
13563
- } else if (definition?.unit) {
13564
- valueString = `${valueString}${definition.unit}`;
13565
- }
13566
- if (existsInScope) {
13567
- return `${valueString}*`;
13568
- }
13569
- return valueString;
13570
- }
13571
- function tryParseJsonStringArray(input) {
13572
- try {
13573
- const parsed = JSON.parse(input);
13574
- if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
13575
- return parsed;
13576
- }
13577
- return null;
13578
- } catch {
13579
- return null;
13580
- }
13581
- }
13582
- function tryParseJsonObject(input) {
13583
- try {
13584
- const parsed = JSON.parse(input);
13585
- if (isRecord(parsed) && !Array.isArray(parsed)) {
13586
- return parsed;
13587
- }
13588
- return null;
13589
- } catch {
13590
- return null;
13591
- }
13592
- }
13593
- function parseStringArrayValue(input) {
13594
- const trimmed = input.trim();
13595
- if (trimmed === "") return [];
13596
- return tryParseJsonStringArray(trimmed) ?? input.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
13597
- }
13598
- function parseObjectValue(input) {
13599
- const trimmed = input.trim();
13600
- if (trimmed === "") {
13601
- return null;
13602
- }
13603
- return tryParseJsonObject(trimmed);
13604
- }
13605
- function parseEditedValue(type, newValue) {
13606
- if (type === "number") {
13607
- if (newValue.trim() === "") {
13608
- return null;
13609
- }
13610
- const numParsed = Number(newValue.trim());
13611
- if (Number.isNaN(numParsed)) {
13612
- return null;
13613
- }
13614
- return numParsed;
13615
- }
13616
- if (type === "array") {
13617
- return parseStringArrayValue(newValue);
13618
- }
13619
- if (type === "object") {
13620
- return parseObjectValue(newValue);
13621
- }
13622
- return newValue;
13623
- }
13624
- function getEditValue(type, rawValue) {
13625
- if (rawValue === void 0) {
13626
- return void 0;
13627
- }
13628
- if (type === "array" && Array.isArray(rawValue)) {
13629
- return rawValue.join(", ");
13630
- }
13631
- if (type === "object" && rawValue !== null && typeof rawValue === "object") {
13632
- return JSON.stringify(rawValue);
13633
- }
13634
- return void 0;
13635
- }
13636
-
13637
13487
  // packages/cli/src/utils/dialogScopeUtils.ts
13638
13488
  var SCOPE_LABELS = {
13639
13489
  ["User" /* User */]: "User Settings",
@@ -33487,7 +33337,7 @@ ${queuedText}` : queuedText;
33487
33337
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33488
33338
  if (settings.merged.general.devtools) {
33489
33339
  void (async () => {
33490
- const { toggleDevToolsPanel } = await import("./devtoolsService-L5LFSMIR.js");
33340
+ const { toggleDevToolsPanel } = await import("./devtoolsService-65SKYXJR.js");
33491
33341
  await toggleDevToolsPanel(
33492
33342
  config,
33493
33343
  showErrorDetails,
@@ -104,12 +104,18 @@ import {
104
104
  getAsciiArtWidth,
105
105
  getBoundingBox,
106
106
  getCachedStringWidth,
107
+ getDialogRestartRequiredSettings,
108
+ getDialogSettingKeys,
109
+ getDisplayValue,
110
+ getEditValue,
111
+ getEffectiveValue,
107
112
  getFileExtension,
108
113
  getFormattedSettingValue,
109
114
  getLuminance,
115
+ getNestedValue,
110
116
  getSafeLowColorBackground,
111
117
  getSessionFiles,
112
- getSettingsSchema,
118
+ getSettingDefinition,
113
119
  getStatusColor,
114
120
  getTransformUnderCursor,
115
121
  getUsedStatusColor,
@@ -122,9 +128,11 @@ import {
122
128
  isBrowser,
123
129
  isContextUsageHigh,
124
130
  isDevelopment,
131
+ isInSettingsScope,
125
132
  isLoadableSettingScope,
126
133
  isNarrowWidth,
127
134
  isNewFile,
135
+ isRecord,
128
136
  isSlashCommand,
129
137
  isTodoList,
130
138
  isUltraTier,
@@ -138,6 +146,7 @@ import {
138
146
  openFileInEditor,
139
147
  parseColor,
140
148
  parseDiffWithLineNumbers,
149
+ parseEditedValue,
141
150
  parseSlashCommand,
142
151
  persistentState,
143
152
  pickDefaultThemeName,
@@ -197,7 +206,7 @@ import {
197
206
  widestLineFromStyledChars,
198
207
  wordBreakStyledChars,
199
208
  wrapStyledChars
200
- } from "./chunk-NWD4JYMB.js";
209
+ } from "./chunk-APBWRLCM.js";
201
210
  import {
202
211
  appEvents
203
212
  } from "./chunk-5PS3AYFU.js";
@@ -206,7 +215,7 @@ import {
206
215
  removeCleanup,
207
216
  runExitCleanup,
208
217
  setupTtyCheck
209
- } from "./chunk-BL3XXS2L.js";
218
+ } from "./chunk-N6R5LJKJ.js";
210
219
  import {
211
220
  ApiKeyUpdatedEvent,
212
221
  AsyncFzf,
@@ -246,6 +255,7 @@ import {
246
255
  ShellExecutionService,
247
256
  SlashCommandStatus,
248
257
  TerminalQuotaError,
258
+ TrustLevel,
249
259
  UserAccountManager,
250
260
  UserPromptEvent,
251
261
  UserTierId,
@@ -333,7 +343,7 @@ import {
333
343
  validatePlanContent,
334
344
  validatePlanPath,
335
345
  writeToStdout
336
- } from "./chunk-UQGLVPZQ.js";
346
+ } from "./chunk-UIBQS45C.js";
337
347
  import {
338
348
  ACTIVATE_SKILL_TOOL_NAME,
339
349
  AGENT_TOOL_NAME,
@@ -398,7 +408,7 @@ import {
398
408
  safeJsonToMarkdown,
399
409
  shortenPath,
400
410
  tildeifyPath
401
- } from "./chunk-67TFD6HC.js";
411
+ } from "./chunk-FNPZLVJU.js";
402
412
  import "./chunk-664ZODQF.js";
403
413
  import "./chunk-RJTRUG2J.js";
404
414
  import "./chunk-IUUIT4SU.js";
@@ -6751,7 +6761,7 @@ function getInitialTrustState(settings, cwd5, isCurrentWorkspace) {
6751
6761
  settings.merged,
6752
6762
  process4.cwd()
6753
6763
  );
6754
- const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */);
6764
+ const isInheritedTrust = isTrusted && (!explicitTrustLevel || explicitTrustLevel === TrustLevel.DO_NOT_TRUST);
6755
6765
  return {
6756
6766
  currentTrustLevel: explicitTrustLevel,
6757
6767
  isInheritedTrustFromParent: !!(source === "file" && isInheritedTrust),
@@ -6796,7 +6806,7 @@ var usePermissionsModifyTrust = (onExit, addItem, targetDirectory) => {
6796
6806
  process4.cwd(),
6797
6807
  newConfig
6798
6808
  );
6799
- if (trustLevel === "DO_NOT_TRUST" /* DO_NOT_TRUST */ && isTrusted) {
6809
+ if (trustLevel === TrustLevel.DO_NOT_TRUST && isTrusted) {
6800
6810
  let message = "Note: This folder is still trusted because the connected IDE workspace is trusted.";
6801
6811
  if (source === "file") {
6802
6812
  message = "Note: This folder is still trusted because a parent folder is trusted.";
@@ -6870,18 +6880,18 @@ function PermissionsModifyTrustDialog({
6870
6880
  const TRUST_LEVEL_ITEMS = [
6871
6881
  {
6872
6882
  label: `Trust this folder (${dirName})`,
6873
- value: "TRUST_FOLDER" /* TRUST_FOLDER */,
6874
- key: "TRUST_FOLDER" /* TRUST_FOLDER */
6883
+ value: TrustLevel.TRUST_FOLDER,
6884
+ key: TrustLevel.TRUST_FOLDER
6875
6885
  },
6876
6886
  {
6877
6887
  label: `Trust parent folder (${parentFolder})`,
6878
- value: "TRUST_PARENT" /* TRUST_PARENT */,
6879
- key: "TRUST_PARENT" /* TRUST_PARENT */
6888
+ value: TrustLevel.TRUST_PARENT,
6889
+ key: TrustLevel.TRUST_PARENT
6880
6890
  },
6881
6891
  {
6882
6892
  label: "Don't trust",
6883
- value: "DO_NOT_TRUST" /* DO_NOT_TRUST */,
6884
- key: "DO_NOT_TRUST" /* DO_NOT_TRUST */
6893
+ value: TrustLevel.DO_NOT_TRUST,
6894
+ key: TrustLevel.DO_NOT_TRUST
6885
6895
  }
6886
6896
  ];
6887
6897
  const {
@@ -13492,165 +13502,6 @@ var ConsentPrompt = (props) => {
13492
13502
  // packages/cli/src/ui/components/ThemeDialog.tsx
13493
13503
  var import_react47 = __toESM(require_react(), 1);
13494
13504
 
13495
- // packages/cli/src/utils/settingsUtils.ts
13496
- function flattenSchema(schema, prefix = "") {
13497
- let result = {};
13498
- for (const key in schema) {
13499
- const newKey = prefix ? `${prefix}.${key}` : key;
13500
- const definition = schema[key];
13501
- result[newKey] = { ...definition, key: newKey };
13502
- if (definition.properties) {
13503
- result = { ...result, ...flattenSchema(definition.properties, newKey) };
13504
- }
13505
- }
13506
- return result;
13507
- }
13508
- var _FLATTENED_SCHEMA;
13509
- function getFlattenedSchema() {
13510
- return _FLATTENED_SCHEMA ?? (_FLATTENED_SCHEMA = flattenSchema(getSettingsSchema()));
13511
- }
13512
- function getSettingDefinition(key) {
13513
- return getFlattenedSchema()[key];
13514
- }
13515
- function getDefaultValue(key) {
13516
- return getFlattenedSchema()[key]?.default;
13517
- }
13518
- function getDialogRestartRequiredSettings() {
13519
- return Object.values(getFlattenedSchema()).filter(
13520
- (definition) => definition.requiresRestart && definition.showInDialog !== false
13521
- ).map((definition) => definition.key);
13522
- }
13523
- function isRecord(value) {
13524
- return typeof value === "object" && value !== null;
13525
- }
13526
- function isSettingsValue(value) {
13527
- if (value === void 0) return true;
13528
- if (value === null) return false;
13529
- const type = typeof value;
13530
- return type === "string" || type === "number" || type === "boolean" || type === "object";
13531
- }
13532
- function getNestedValue(obj, path15) {
13533
- let current = obj;
13534
- for (const key of path15) {
13535
- if (!isRecord(current) || !(key in current)) {
13536
- return void 0;
13537
- }
13538
- current = current[key];
13539
- }
13540
- return current;
13541
- }
13542
- function getEffectiveValue(key, settings) {
13543
- const definition = getSettingDefinition(key);
13544
- if (!definition) {
13545
- return void 0;
13546
- }
13547
- const path15 = key.split(".");
13548
- const value = getNestedValue(settings, path15);
13549
- if (value !== void 0 && isSettingsValue(value)) {
13550
- return value;
13551
- }
13552
- return definition.default;
13553
- }
13554
- function getDialogSettingKeys() {
13555
- return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
13556
- }
13557
- function isInSettingsScope(key, scopeSettings) {
13558
- const path15 = key.split(".");
13559
- const value = getNestedValue(scopeSettings, path15);
13560
- return value !== void 0;
13561
- }
13562
- function getDisplayValue(key, scopeSettings, _mergedSettings) {
13563
- const definition = getSettingDefinition(key);
13564
- const existsInScope = isInSettingsScope(key, scopeSettings);
13565
- let value;
13566
- if (existsInScope) {
13567
- value = getEffectiveValue(key, scopeSettings);
13568
- } else {
13569
- value = getDefaultValue(key);
13570
- }
13571
- let valueString = String(value);
13572
- if (definition?.type === "object" && value !== null && typeof value === "object") {
13573
- valueString = JSON.stringify(value);
13574
- } else if (definition?.type === "enum" && definition.options) {
13575
- const option = definition.options?.find((option2) => option2.value === value);
13576
- valueString = option?.label ?? `${value}`;
13577
- }
13578
- if (definition?.unit === "%" && typeof value === "number") {
13579
- valueString = `${value} (${Math.round(value * 100)}%)`;
13580
- } else if (definition?.unit) {
13581
- valueString = `${valueString}${definition.unit}`;
13582
- }
13583
- if (existsInScope) {
13584
- return `${valueString}*`;
13585
- }
13586
- return valueString;
13587
- }
13588
- function tryParseJsonStringArray(input) {
13589
- try {
13590
- const parsed = JSON.parse(input);
13591
- if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
13592
- return parsed;
13593
- }
13594
- return null;
13595
- } catch {
13596
- return null;
13597
- }
13598
- }
13599
- function tryParseJsonObject(input) {
13600
- try {
13601
- const parsed = JSON.parse(input);
13602
- if (isRecord(parsed) && !Array.isArray(parsed)) {
13603
- return parsed;
13604
- }
13605
- return null;
13606
- } catch {
13607
- return null;
13608
- }
13609
- }
13610
- function parseStringArrayValue(input) {
13611
- const trimmed = input.trim();
13612
- if (trimmed === "") return [];
13613
- return tryParseJsonStringArray(trimmed) ?? input.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
13614
- }
13615
- function parseObjectValue(input) {
13616
- const trimmed = input.trim();
13617
- if (trimmed === "") {
13618
- return null;
13619
- }
13620
- return tryParseJsonObject(trimmed);
13621
- }
13622
- function parseEditedValue(type, newValue) {
13623
- if (type === "number") {
13624
- if (newValue.trim() === "") {
13625
- return null;
13626
- }
13627
- const numParsed = Number(newValue.trim());
13628
- if (Number.isNaN(numParsed)) {
13629
- return null;
13630
- }
13631
- return numParsed;
13632
- }
13633
- if (type === "array") {
13634
- return parseStringArrayValue(newValue);
13635
- }
13636
- if (type === "object") {
13637
- return parseObjectValue(newValue);
13638
- }
13639
- return newValue;
13640
- }
13641
- function getEditValue(type, rawValue) {
13642
- if (rawValue === void 0) {
13643
- return void 0;
13644
- }
13645
- if (type === "array" && Array.isArray(rawValue)) {
13646
- return rawValue.join(", ");
13647
- }
13648
- if (type === "object" && rawValue !== null && typeof rawValue === "object") {
13649
- return JSON.stringify(rawValue);
13650
- }
13651
- return void 0;
13652
- }
13653
-
13654
13505
  // packages/cli/src/utils/dialogScopeUtils.ts
13655
13506
  var SCOPE_LABELS = {
13656
13507
  ["User" /* User */]: "User Settings",
@@ -30041,9 +29892,9 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30041
29892
  const handleFolderTrustSelect = (0, import_react108.useCallback)(
30042
29893
  async (choice) => {
30043
29894
  const trustLevelMap = {
30044
- ["trust_folder" /* TRUST_FOLDER */]: "TRUST_FOLDER" /* TRUST_FOLDER */,
30045
- ["trust_parent" /* TRUST_PARENT */]: "TRUST_PARENT" /* TRUST_PARENT */,
30046
- ["do_not_trust" /* DO_NOT_TRUST */]: "DO_NOT_TRUST" /* DO_NOT_TRUST */
29895
+ ["trust_folder" /* TRUST_FOLDER */]: TrustLevel.TRUST_FOLDER,
29896
+ ["trust_parent" /* TRUST_PARENT */]: TrustLevel.TRUST_PARENT,
29897
+ ["do_not_trust" /* DO_NOT_TRUST */]: TrustLevel.DO_NOT_TRUST
30047
29898
  };
30048
29899
  const trustLevel = trustLevelMap[choice];
30049
29900
  if (!trustLevel) return;
@@ -30062,7 +29913,7 @@ var useFolderTrust = (settings, onTrustChange, addItem) => {
30062
29913
  }, 100);
30063
29914
  return;
30064
29915
  }
30065
- const currentIsTrusted = trustLevel === "TRUST_FOLDER" /* TRUST_FOLDER */ || trustLevel === "TRUST_PARENT" /* TRUST_PARENT */;
29916
+ const currentIsTrusted = trustLevel === TrustLevel.TRUST_FOLDER || trustLevel === TrustLevel.TRUST_PARENT;
30066
29917
  onTrustChange(currentIsTrusted);
30067
29918
  setIsTrusted(currentIsTrusted);
30068
29919
  const wasTrusted = isTrusted ?? false;
@@ -33504,7 +33355,7 @@ ${queuedText}` : queuedText;
33504
33355
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33505
33356
  if (settings.merged.general.devtools) {
33506
33357
  void (async () => {
33507
- const { toggleDevToolsPanel } = await import("./devtoolsService-H64VB4IA.js");
33358
+ const { toggleDevToolsPanel } = await import("./devtoolsService-6GKOMHGW.js");
33508
33359
  await toggleDevToolsPanel(
33509
33360
  config,
33510
33361
  showErrorDetails,