@google/gemini-cli-a2a-server 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.
@@ -28597,10 +28597,10 @@ var require_object_inspect = __commonJS({
28597
28597
  }
28598
28598
  if (!isDate(obj) && !isRegExp(obj)) {
28599
28599
  var ys2 = arrObjKeys(obj, inspect2);
28600
- var isPlainObject3 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
28600
+ var isPlainObject4 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
28601
28601
  var protoTag = obj instanceof Object ? "" : "null prototype";
28602
- var stringTag = !isPlainObject3 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
28603
- var constructorTag = isPlainObject3 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
28602
+ var stringTag = !isPlainObject4 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
28603
+ var constructorTag = isPlainObject4 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
28604
28604
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
28605
28605
  if (ys2.length === 0) {
28606
28606
  return tag + "{}";
@@ -36169,7 +36169,7 @@ var require_extend = __commonJS({
36169
36169
  }
36170
36170
  return toStr.call(arr) === "[object Array]";
36171
36171
  };
36172
- var isPlainObject3 = function isPlainObject4(obj) {
36172
+ var isPlainObject4 = function isPlainObject5(obj) {
36173
36173
  if (!obj || toStr.call(obj) !== "[object Object]") {
36174
36174
  return false;
36175
36175
  }
@@ -36226,12 +36226,12 @@ var require_extend = __commonJS({
36226
36226
  src = getProperty(target, name3);
36227
36227
  copy = getProperty(options, name3);
36228
36228
  if (target !== copy) {
36229
- if (deep && copy && (isPlainObject3(copy) || (copyIsArray = isArray(copy)))) {
36229
+ if (deep && copy && (isPlainObject4(copy) || (copyIsArray = isArray(copy)))) {
36230
36230
  if (copyIsArray) {
36231
36231
  copyIsArray = false;
36232
36232
  clone4 = src && isArray(src) ? src : [];
36233
36233
  } else {
36234
- clone4 = src && isPlainObject3(src) ? src : {};
36234
+ clone4 = src && isPlainObject4(src) ? src : {};
36235
36235
  }
36236
36236
  setProperty2(target, { name: name3, newValue: extend4(deep, clone4, copy) });
36237
36237
  } else if (typeof copy !== "undefined") {
@@ -142115,7 +142115,7 @@ var require_lodash_merge = __commonJS({
142115
142115
  var hasOwnProperty2 = objectProto.hasOwnProperty;
142116
142116
  var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
142117
142117
  var nativeObjectToString = objectProto.toString;
142118
- function isPlainObject3(value) {
142118
+ function isPlainObject4(value) {
142119
142119
  if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {
142120
142120
  return false;
142121
142121
  }
@@ -142126,7 +142126,7 @@ var require_lodash_merge = __commonJS({
142126
142126
  const Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
142127
142127
  return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString;
142128
142128
  }
142129
- exports2.isPlainObject = isPlainObject3;
142129
+ exports2.isPlainObject = isPlainObject4;
142130
142130
  function isObjectLike(value) {
142131
142131
  return value != null && typeof value == "object";
142132
142132
  }
@@ -221340,8 +221340,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
221340
221340
  var init_git_commit = __esm({
221341
221341
  "packages/core/dist/src/generated/git-commit.js"() {
221342
221342
  "use strict";
221343
- GIT_COMMIT_INFO = "d75234cae";
221344
- CLI_VERSION = "0.63.0-preview.0";
221343
+ GIT_COMMIT_INFO = "38700b4b3";
221344
+ CLI_VERSION = "0.64.0-nightly.20260930.g38700b4b3";
221345
221345
  }
221346
221346
  });
221347
221347
 
@@ -337077,7 +337077,7 @@ function getVersion() {
337077
337077
  }
337078
337078
  versionPromise = (async () => {
337079
337079
  const pkgJson = await getPackageJson(__dirname4);
337080
- return "0.63.0-preview.0";
337080
+ return "0.64.0-nightly.20260930.g38700b4b3";
337081
337081
  })();
337082
337082
  return versionPromise;
337083
337083
  }
@@ -439700,35 +439700,543 @@ import * as path96 from "node:path";
439700
439700
  import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
439701
439701
 
439702
439702
  // packages/a2a-server/src/config/settings.ts
439703
+ init_zod();
439703
439704
  init_dist4();
439704
439705
  var import_strip_json_comments3 = __toESM(require_strip_json_comments(), 1);
439705
439706
  import * as fs84 from "node:fs";
439706
439707
  import * as path95 from "node:path";
439707
439708
  var USER_SETTINGS_DIR = path95.join(homedir(), GEMINI_DIR);
439708
439709
  var USER_SETTINGS_PATH = path95.join(USER_SETTINGS_DIR, "settings.json");
439709
- function loadSettings(workspaceDir, isTrustedOverride) {
439710
- let userSettings = {};
439711
- let workspaceSettings = {};
439712
- const settingsErrors = [];
439713
- try {
439714
- if (fs84.existsSync(USER_SETTINGS_PATH)) {
439715
- const userContent = fs84.readFileSync(USER_SETTINGS_PATH, "utf-8");
439716
- const parsedUserSettings = JSON.parse(
439717
- (0, import_strip_json_comments3.default)(userContent)
439710
+ var MIGRATION_MAP = {
439711
+ accessibility: "ui.accessibility",
439712
+ allowedTools: "tools.allowed",
439713
+ allowMCPServers: "mcp.allowed",
439714
+ autoAccept: "tools.autoAccept",
439715
+ autoConfigureMaxOldSpaceSize: "advanced.autoConfigureMemory",
439716
+ bugCommand: "advanced.bugCommand",
439717
+ chatCompression: "model.compressionThreshold",
439718
+ checkpointing: "general.checkpointing",
439719
+ coreTools: "tools.core",
439720
+ contextFileName: "context.fileName",
439721
+ customThemes: "ui.customThemes",
439722
+ customWittyPhrases: "ui.customWittyPhrases",
439723
+ debugKeystrokeLogging: "general.debugKeystrokeLogging",
439724
+ disableAutoUpdate: "general.disableAutoUpdate",
439725
+ disableUpdateNag: "general.disableUpdateNag",
439726
+ dnsResolutionOrder: "advanced.dnsResolutionOrder",
439727
+ enableHooks: "tools.enableHooks",
439728
+ enablePromptCompletion: "general.enablePromptCompletion",
439729
+ enforcedAuthType: "security.auth.enforcedType",
439730
+ excludeTools: "tools.exclude",
439731
+ excludeMCPServers: "mcp.excluded",
439732
+ excludedProjectEnvVars: "advanced.excludedEnvVars",
439733
+ experimentalSkills: "experimental.skills",
439734
+ extensionManagement: "experimental.extensionManagement",
439735
+ extensions: "extensions",
439736
+ fileFiltering: "context.fileFiltering",
439737
+ folderTrustFeature: "security.folderTrust.featureEnabled",
439738
+ folderTrust: "security.folderTrust.enabled",
439739
+ hasSeenIdeIntegrationNudge: "ide.hasSeenNudge",
439740
+ hideWindowTitle: "ui.hideWindowTitle",
439741
+ showStatusInTitle: "ui.showStatusInTitle",
439742
+ hideTips: "ui.hideTips",
439743
+ hideBanner: "ui.hideBanner",
439744
+ hideFooter: "ui.hideFooter",
439745
+ hideCWD: "ui.footer.hideCWD",
439746
+ hideSandboxStatus: "ui.footer.hideSandboxStatus",
439747
+ hideModelInfo: "ui.footer.hideModelInfo",
439748
+ hideContextSummary: "ui.hideContextSummary",
439749
+ showMemoryUsage: "ui.showMemoryUsage",
439750
+ showLineNumbers: "ui.showLineNumbers",
439751
+ showCitations: "ui.showCitations",
439752
+ ideMode: "ide.enabled",
439753
+ includeDirectories: "context.includeDirectories",
439754
+ loadMemoryFromIncludeDirectories: "context.loadFromIncludeDirectories",
439755
+ logLevel: "logging.level",
439756
+ maxSessionTurns: "model.maxSessionTurns",
439757
+ mcpServers: "mcpServers",
439758
+ mcpServerCommand: "mcp.serverCommand",
439759
+ memoryImportFormat: "context.importFormat",
439760
+ memoryDiscoveryMaxDirs: "context.discoveryMaxDirs",
439761
+ model: "model.name",
439762
+ preferredEditor: "general.preferredEditor",
439763
+ retryFetchErrors: "general.retryFetchErrors",
439764
+ sandbox: "tools.sandbox",
439765
+ selectedAuthType: "security.auth.selectedType",
439766
+ enableInteractiveShell: "tools.shell.enableInteractiveShell",
439767
+ shellPager: "tools.shell.pager",
439768
+ shellShowColor: "tools.shell.showColor",
439769
+ shellInactivityTimeout: "tools.shell.inactivityTimeout",
439770
+ skipNextSpeakerCheck: "model.skipNextSpeakerCheck",
439771
+ summarizeToolOutput: "model.summarizeToolOutput",
439772
+ telemetry: "telemetry",
439773
+ theme: "ui.theme",
439774
+ toolDiscoveryCommand: "tools.discoveryCommand",
439775
+ toolCallCommand: "tools.callCommand",
439776
+ usageStatisticsEnabled: "privacy.usageStatisticsEnabled",
439777
+ useExternalAuth: "security.auth.useExternal",
439778
+ useRipgrep: "tools.useRipgrep",
439779
+ vimMode: "general.vimMode"
439780
+ };
439781
+ var KNOWN_V2_CONTAINERS = new Set(
439782
+ Object.values(MIGRATION_MAP).map((p2) => p2.split(".")[0])
439783
+ );
439784
+ var LEGACY_V1_ONLY_KEYS = /* @__PURE__ */ new Set([
439785
+ ...Object.keys(MIGRATION_MAP).filter(
439786
+ (k2) => k2 !== MIGRATION_MAP[k2] && !KNOWN_V2_CONTAINERS.has(k2)
439787
+ ),
439788
+ "telemetryDisabled"
439789
+ ]);
439790
+ var MERGE_STRATEGIES = {
439791
+ mcpServers: "shallow_merge" /* SHALLOW_MERGE */,
439792
+ policyPaths: "union" /* UNION */,
439793
+ adminPolicyPaths: "union" /* UNION */
439794
+ };
439795
+ function getMergeStrategyForPath(pathSegments) {
439796
+ return MERGE_STRATEGIES[pathSegments.join(".")];
439797
+ }
439798
+ function isPlainObject3(item) {
439799
+ if (typeof item !== "object" || item === null || Array.isArray(item)) {
439800
+ return false;
439801
+ }
439802
+ const proto = Object.getPrototypeOf(item);
439803
+ return proto === null || proto === Object.prototype;
439804
+ }
439805
+ function isUnsafeKey(key) {
439806
+ return key === "__proto__" || key === "constructor" || key === "prototype";
439807
+ }
439808
+ function mergeRecursively(target, source, getStrategy, currentPath = []) {
439809
+ for (const key of Object.keys(source)) {
439810
+ if (isUnsafeKey(key)) {
439811
+ continue;
439812
+ }
439813
+ const srcValue = source[key];
439814
+ if (srcValue === void 0) {
439815
+ continue;
439816
+ }
439817
+ const newPath = [...currentPath, key];
439818
+ const objValue = target[key];
439819
+ const mergeStrategy = getStrategy(newPath);
439820
+ if (mergeStrategy === "shallow_merge" /* SHALLOW_MERGE */ && objValue && srcValue) {
439821
+ const obj1 = isPlainObject3(objValue) ? objValue : {};
439822
+ const obj2 = isPlainObject3(srcValue) ? srcValue : {};
439823
+ const mergedShallow = {};
439824
+ for (const [k2, v2] of Object.entries(obj1)) {
439825
+ if (!isUnsafeKey(k2)) mergedShallow[k2] = v2;
439826
+ }
439827
+ for (const [k2, v2] of Object.entries(obj2)) {
439828
+ if (!isUnsafeKey(k2)) mergedShallow[k2] = v2;
439829
+ }
439830
+ target[key] = mergedShallow;
439831
+ continue;
439832
+ }
439833
+ if (Array.isArray(objValue)) {
439834
+ const srcArray = Array.isArray(srcValue) ? srcValue : [srcValue];
439835
+ if (mergeStrategy === "concat" /* CONCAT */) {
439836
+ target[key] = objValue.concat(srcArray);
439837
+ continue;
439838
+ }
439839
+ if (mergeStrategy === "union" /* UNION */) {
439840
+ target[key] = [...new Set(objValue.concat(srcArray))];
439841
+ continue;
439842
+ }
439843
+ }
439844
+ if (isPlainObject3(objValue) && isPlainObject3(srcValue)) {
439845
+ mergeRecursively(objValue, srcValue, getStrategy, newPath);
439846
+ } else if (isPlainObject3(srcValue)) {
439847
+ const nestedTarget = {};
439848
+ target[key] = nestedTarget;
439849
+ mergeRecursively(nestedTarget, srcValue, getStrategy, newPath);
439850
+ } else {
439851
+ target[key] = srcValue;
439852
+ }
439853
+ }
439854
+ return target;
439855
+ }
439856
+ function customDeepMerge(first2, ...rest) {
439857
+ const getStrategy = typeof first2 === "function" ? first2 : getMergeStrategyForPath;
439858
+ const sources = typeof first2 === "function" ? rest : first2 ? [first2, ...rest] : rest;
439859
+ const result2 = {};
439860
+ for (const source of sources) {
439861
+ if (source && isPlainObject3(source)) {
439862
+ mergeRecursively(result2, source, getStrategy);
439863
+ }
439864
+ }
439865
+ return result2;
439866
+ }
439867
+ function setNestedProperty(obj, dotPath, value) {
439868
+ const keys = dotPath.split(".");
439869
+ const lastKey = keys.pop();
439870
+ if (!lastKey || isUnsafeKey(lastKey)) return;
439871
+ let current = obj;
439872
+ for (const key of keys) {
439873
+ if (isUnsafeKey(key)) return;
439874
+ const existing = current[key];
439875
+ if (existing === void 0) {
439876
+ const nextObj = {};
439877
+ current[key] = nextObj;
439878
+ current = nextObj;
439879
+ } else if (isPlainObject3(existing)) {
439880
+ current = existing;
439881
+ } else {
439882
+ return;
439883
+ }
439884
+ }
439885
+ current[lastKey] = value;
439886
+ }
439887
+ function getNestedProperty(obj, dotPath) {
439888
+ const keys = dotPath.split(".");
439889
+ let current = obj;
439890
+ for (const key of keys) {
439891
+ if (isUnsafeKey(key) || !isPlainObject3(current) || !(key in current)) {
439892
+ return void 0;
439893
+ }
439894
+ current = current[key];
439895
+ }
439896
+ return current;
439897
+ }
439898
+ function migrateInvertedBoolean(container, oldKey, newKey) {
439899
+ const oldVal = container[oldKey];
439900
+ const newVal = container[newKey];
439901
+ if (typeof oldVal === "boolean") {
439902
+ if (typeof newVal !== "boolean") {
439903
+ container[newKey] = !oldVal;
439904
+ }
439905
+ delete container[oldKey];
439906
+ }
439907
+ }
439908
+ function migrateDeprecatedSettings(rawSettings) {
439909
+ if (!isPlainObject3(rawSettings)) {
439910
+ return {};
439911
+ }
439912
+ const v2Settings = {};
439913
+ const remainingKeys = new Set(
439914
+ Object.keys(rawSettings).filter((k2) => !isUnsafeKey(k2))
439915
+ );
439916
+ const rawTelemetry = rawSettings["telemetry"];
439917
+ if (typeof rawTelemetry === "boolean") {
439918
+ setNestedProperty(v2Settings, "telemetry.enabled", rawTelemetry);
439919
+ remainingKeys.delete("telemetry");
439920
+ }
439921
+ const telemetryDisabledVal = rawSettings["telemetryDisabled"];
439922
+ if (typeof telemetryDisabledVal === "boolean") {
439923
+ if (getNestedProperty(v2Settings, "telemetry.enabled") === void 0) {
439924
+ setNestedProperty(v2Settings, "telemetry.enabled", !telemetryDisabledVal);
439925
+ }
439926
+ remainingKeys.delete("telemetryDisabled");
439927
+ }
439928
+ for (const [oldKey, newPath] of Object.entries(MIGRATION_MAP)) {
439929
+ if (oldKey === newPath) {
439930
+ continue;
439931
+ }
439932
+ if (remainingKeys.has(oldKey)) {
439933
+ let val = rawSettings[oldKey];
439934
+ if (KNOWN_V2_CONTAINERS.has(oldKey) && isPlainObject3(val)) {
439935
+ continue;
439936
+ }
439937
+ if (oldKey === "checkpointing" && typeof val === "boolean") {
439938
+ val = { enabled: val };
439939
+ }
439940
+ if (oldKey === "chatCompression" && isPlainObject3(val)) {
439941
+ const threshold = val["contextPercentageThreshold"];
439942
+ if (typeof threshold === "number") {
439943
+ val = threshold;
439944
+ }
439945
+ }
439946
+ setNestedProperty(v2Settings, newPath, val);
439947
+ remainingKeys.delete(oldKey);
439948
+ }
439949
+ }
439950
+ for (const key of remainingKeys) {
439951
+ const newVal = rawSettings[key];
439952
+ if (newVal === void 0) continue;
439953
+ const existingVal = v2Settings[key];
439954
+ if (isPlainObject3(existingVal) && isPlainObject3(newVal)) {
439955
+ v2Settings[key] = customDeepMerge(
439956
+ (subPath) => getMergeStrategyForPath([key, ...subPath]),
439957
+ existingVal,
439958
+ newVal
439959
+ );
439960
+ } else {
439961
+ v2Settings[key] = newVal;
439962
+ }
439963
+ }
439964
+ const generalObj = v2Settings["general"];
439965
+ if (isPlainObject3(generalObj)) {
439966
+ const checkpointingVal = generalObj["checkpointing"];
439967
+ if (typeof checkpointingVal === "boolean") {
439968
+ generalObj["checkpointing"] = { enabled: checkpointingVal };
439969
+ }
439970
+ migrateInvertedBoolean(generalObj, "disableAutoUpdate", "enableAutoUpdate");
439971
+ migrateInvertedBoolean(
439972
+ generalObj,
439973
+ "disableUpdateNag",
439974
+ "enableAutoUpdateNotification"
439975
+ );
439976
+ }
439977
+ const uiObj = v2Settings["ui"];
439978
+ if (isPlainObject3(uiObj)) {
439979
+ const accessibilityObj = uiObj["accessibility"];
439980
+ if (isPlainObject3(accessibilityObj)) {
439981
+ migrateInvertedBoolean(
439982
+ accessibilityObj,
439983
+ "disableLoadingPhrases",
439984
+ "enableLoadingPhrases"
439985
+ );
439986
+ const enableLP = accessibilityObj["enableLoadingPhrases"];
439987
+ if (typeof enableLP === "boolean" && uiObj["loadingPhrases"] === void 0) {
439988
+ if (!enableLP) {
439989
+ uiObj["loadingPhrases"] = "off";
439990
+ }
439991
+ }
439992
+ }
439993
+ }
439994
+ const contextObj = v2Settings["context"];
439995
+ if (isPlainObject3(contextObj)) {
439996
+ const fileFilteringObj = contextObj["fileFiltering"];
439997
+ if (isPlainObject3(fileFilteringObj)) {
439998
+ migrateInvertedBoolean(
439999
+ fileFilteringObj,
440000
+ "disableFuzzySearch",
440001
+ "enableFuzzySearch"
439718
440002
  );
439719
- userSettings = resolveEnvVarsInObject(parsedUserSettings);
440003
+ }
440004
+ }
440005
+ const toolsObj = v2Settings["tools"];
440006
+ if (isPlainObject3(toolsObj)) {
440007
+ const approvalModeVal = toolsObj["approvalMode"];
440008
+ if (approvalModeVal !== void 0) {
440009
+ const targetGeneral = isPlainObject3(v2Settings["general"]) ? v2Settings["general"] : {};
440010
+ if (targetGeneral["defaultApprovalMode"] === void 0) {
440011
+ targetGeneral["defaultApprovalMode"] = approvalModeVal;
440012
+ }
440013
+ v2Settings["general"] = targetGeneral;
440014
+ delete toolsObj["approvalMode"];
440015
+ }
440016
+ }
440017
+ return v2Settings;
440018
+ }
440019
+ var booleanPreprocess = external_exports.preprocess((val) => {
440020
+ if (typeof val === "string") {
440021
+ const lower3 = val.toLowerCase();
440022
+ if (lower3 === "true") return true;
440023
+ if (lower3 === "false") return false;
440024
+ }
440025
+ return val;
440026
+ }, external_exports.boolean());
440027
+ var numberPreprocess = external_exports.preprocess((val) => {
440028
+ if (typeof val === "string" && val.trim() !== "") {
440029
+ const num = Number(val);
440030
+ if (!Number.isNaN(num)) return num;
440031
+ }
440032
+ return val;
440033
+ }, external_exports.number());
440034
+ var settingsZodSchema = external_exports.object({
440035
+ mcpServers: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
440036
+ mcp: external_exports.object({
440037
+ serverCommand: external_exports.string().optional(),
440038
+ allowed: external_exports.array(external_exports.string()).optional(),
440039
+ excluded: external_exports.array(external_exports.string()).optional()
440040
+ }).passthrough().optional(),
440041
+ tools: external_exports.object({
440042
+ allowed: external_exports.array(external_exports.string()).optional(),
440043
+ exclude: external_exports.array(external_exports.string()).optional(),
440044
+ core: external_exports.array(external_exports.string()).optional(),
440045
+ autoAccept: booleanPreprocess.optional(),
440046
+ sandbox: external_exports.union([
440047
+ booleanPreprocess,
440048
+ external_exports.string(),
440049
+ external_exports.record(external_exports.string(), external_exports.unknown())
440050
+ ]).optional(),
440051
+ enableHooks: booleanPreprocess.optional(),
440052
+ discoveryCommand: external_exports.string().optional(),
440053
+ callCommand: external_exports.string().optional(),
440054
+ useRipgrep: booleanPreprocess.optional(),
440055
+ shell: external_exports.object({
440056
+ enableInteractiveShell: booleanPreprocess.optional(),
440057
+ pager: external_exports.string().optional(),
440058
+ showColor: booleanPreprocess.optional(),
440059
+ inactivityTimeout: numberPreprocess.optional()
440060
+ }).passthrough().optional()
440061
+ }).passthrough().optional(),
440062
+ telemetry: external_exports.union([
440063
+ booleanPreprocess,
440064
+ external_exports.object({
440065
+ enabled: booleanPreprocess.optional(),
440066
+ target: external_exports.string().optional(),
440067
+ otlpEndpoint: external_exports.string().optional(),
440068
+ otlpProtocol: external_exports.string().optional(),
440069
+ logPrompts: booleanPreprocess.optional(),
440070
+ outfile: external_exports.string().optional(),
440071
+ useCollector: booleanPreprocess.optional()
440072
+ }).passthrough()
440073
+ ]).optional(),
440074
+ logging: external_exports.object({
440075
+ level: external_exports.string().optional()
440076
+ }).passthrough().optional(),
440077
+ ui: external_exports.object({
440078
+ theme: external_exports.string().optional(),
440079
+ showMemoryUsage: booleanPreprocess.optional(),
440080
+ showLineNumbers: booleanPreprocess.optional(),
440081
+ showCitations: booleanPreprocess.optional(),
440082
+ showStatusInTitle: booleanPreprocess.optional(),
440083
+ hideWindowTitle: booleanPreprocess.optional(),
440084
+ hideTips: booleanPreprocess.optional(),
440085
+ hideBanner: booleanPreprocess.optional(),
440086
+ hideFooter: booleanPreprocess.optional(),
440087
+ hideContextSummary: booleanPreprocess.optional(),
440088
+ loadingPhrases: external_exports.string().optional(),
440089
+ customThemes: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
440090
+ customWittyPhrases: external_exports.array(external_exports.string()).optional(),
440091
+ footer: external_exports.object({
440092
+ hideCWD: booleanPreprocess.optional(),
440093
+ hideSandboxStatus: booleanPreprocess.optional(),
440094
+ hideModelInfo: booleanPreprocess.optional()
440095
+ }).passthrough().optional(),
440096
+ accessibility: external_exports.object({
440097
+ enableLoadingPhrases: booleanPreprocess.optional(),
440098
+ screenReader: booleanPreprocess.optional()
440099
+ }).passthrough().optional()
440100
+ }).passthrough().optional(),
440101
+ general: external_exports.object({
440102
+ previewFeatures: booleanPreprocess.optional(),
440103
+ vimMode: booleanPreprocess.optional(),
440104
+ preferredEditor: external_exports.string().optional(),
440105
+ checkpointing: external_exports.object({
440106
+ enabled: booleanPreprocess.optional()
440107
+ }).passthrough().optional(),
440108
+ enableAutoUpdate: booleanPreprocess.optional(),
440109
+ enableAutoUpdateNotification: booleanPreprocess.optional(),
440110
+ defaultApprovalMode: external_exports.string().optional(),
440111
+ debugKeystrokeLogging: booleanPreprocess.optional(),
440112
+ enablePromptCompletion: booleanPreprocess.optional(),
440113
+ retryFetchErrors: booleanPreprocess.optional(),
440114
+ plan: external_exports.object({
440115
+ enabled: booleanPreprocess.optional()
440116
+ }).passthrough().optional()
440117
+ }).passthrough().optional(),
440118
+ context: external_exports.object({
440119
+ fileName: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
440120
+ includeDirectories: external_exports.array(external_exports.string()).optional(),
440121
+ loadFromIncludeDirectories: booleanPreprocess.optional(),
440122
+ importFormat: external_exports.string().optional(),
440123
+ discoveryMaxDirs: numberPreprocess.optional(),
440124
+ fileFiltering: external_exports.object({
440125
+ respectGitIgnore: booleanPreprocess.optional(),
440126
+ respectGeminiIgnore: booleanPreprocess.optional(),
440127
+ enableRecursiveFileSearch: booleanPreprocess.optional(),
440128
+ enableFuzzySearch: booleanPreprocess.optional(),
440129
+ customIgnoreFilePaths: external_exports.array(external_exports.string()).optional()
440130
+ }).passthrough().optional()
440131
+ }).passthrough().optional(),
440132
+ security: external_exports.object({
440133
+ folderTrust: external_exports.object({
440134
+ enabled: booleanPreprocess.optional(),
440135
+ featureEnabled: booleanPreprocess.optional()
440136
+ }).passthrough().optional(),
440137
+ auth: external_exports.object({
440138
+ selectedType: external_exports.string().optional(),
440139
+ enforcedType: external_exports.string().optional(),
440140
+ useExternal: booleanPreprocess.optional()
440141
+ }).passthrough().optional()
440142
+ }).passthrough().optional(),
440143
+ model: external_exports.object({
440144
+ name: external_exports.string().optional(),
440145
+ maxSessionTurns: numberPreprocess.optional(),
440146
+ compressionThreshold: numberPreprocess.optional(),
440147
+ skipNextSpeakerCheck: booleanPreprocess.optional(),
440148
+ summarizeToolOutput: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
440149
+ }).passthrough().optional(),
440150
+ ide: external_exports.object({
440151
+ enabled: booleanPreprocess.optional(),
440152
+ hasSeenNudge: booleanPreprocess.optional()
440153
+ }).passthrough().optional(),
440154
+ privacy: external_exports.object({
440155
+ usageStatisticsEnabled: booleanPreprocess.optional()
440156
+ }).passthrough().optional(),
440157
+ advanced: external_exports.object({
440158
+ autoConfigureMemory: booleanPreprocess.optional(),
440159
+ bugCommand: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
440160
+ dnsResolutionOrder: external_exports.string().optional(),
440161
+ excludedEnvVars: external_exports.array(external_exports.string()).optional(),
440162
+ ignoreLocalEnv: booleanPreprocess.optional()
440163
+ }).passthrough().optional(),
440164
+ experimental: external_exports.object({
440165
+ enableAgents: booleanPreprocess.optional(),
440166
+ skills: booleanPreprocess.optional(),
440167
+ extensionManagement: booleanPreprocess.optional(),
440168
+ worktrees: booleanPreprocess.optional()
440169
+ }).passthrough().optional(),
440170
+ extensions: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
440171
+ agents: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
440172
+ policyPaths: external_exports.array(external_exports.string()).optional(),
440173
+ adminPolicyPaths: external_exports.array(external_exports.string()).optional()
440174
+ }).passthrough().superRefine((obj, ctx) => {
440175
+ for (const key of Object.keys(obj)) {
440176
+ if (LEGACY_V1_ONLY_KEYS.has(key)) {
440177
+ ctx.addIssue({
440178
+ code: external_exports.ZodIssueCode.custom,
440179
+ path: [key],
440180
+ message: `Unmigrated V1 setting '${key}' is not valid at the root of V2 settings.`
440181
+ });
440182
+ }
440183
+ }
440184
+ });
440185
+ function validateSettings(data) {
440186
+ const result2 = settingsZodSchema.safeParse(data);
440187
+ if (result2.success) {
440188
+ return {
440189
+ success: true,
440190
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
440191
+ data: result2.data
440192
+ };
440193
+ }
440194
+ return {
440195
+ success: false,
440196
+ error: result2.error
440197
+ };
440198
+ }
440199
+ function loadAndMigrateFile(filePath, settingsErrors) {
440200
+ try {
440201
+ if (fs84.existsSync(filePath)) {
440202
+ const content = fs84.readFileSync(filePath, "utf-8");
440203
+ const parsed = JSON.parse((0, import_strip_json_comments3.default)(content));
440204
+ if (!isPlainObject3(parsed)) {
440205
+ settingsErrors.push({
440206
+ message: "Settings file is not a valid JSON object.",
440207
+ path: filePath
440208
+ });
440209
+ return {};
440210
+ }
440211
+ const resolved = resolveEnvVarsInObject(parsed);
440212
+ const migrated = migrateDeprecatedSettings(resolved);
440213
+ const validation = validateSettings(migrated);
440214
+ if (!validation.success && validation.error) {
440215
+ settingsErrors.push({
440216
+ message: validation.error.message,
440217
+ path: filePath
440218
+ });
440219
+ return migrated;
440220
+ }
440221
+ return validation.data ?? migrated;
439720
440222
  }
439721
440223
  } catch (error2) {
439722
440224
  settingsErrors.push({
439723
440225
  message: getErrorMessage(error2),
439724
- path: USER_SETTINGS_PATH
440226
+ path: filePath
439725
440227
  });
439726
440228
  }
440229
+ return {};
440230
+ }
440231
+ function loadSettings(workspaceDir, isTrustedOverride) {
440232
+ const settingsErrors = [];
440233
+ const userSettings = loadAndMigrateFile(USER_SETTINGS_PATH, settingsErrors);
439727
440234
  let isTrusted = isTrustedOverride;
439728
440235
  if (isTrusted === void 0) {
440236
+ const isFolderTrustEnabled = userSettings.security?.folderTrust?.enabled ?? true;
439729
440237
  const { isTrusted: trustResult } = checkPathTrust({
439730
440238
  path: workspaceDir,
439731
- isFolderTrustEnabled: userSettings.folderTrust ?? true,
440239
+ isFolderTrustEnabled,
439732
440240
  isHeadless: isHeadlessMode()
439733
440241
  });
439734
440242
  isTrusted = trustResult ?? false;
@@ -439738,22 +440246,7 @@ function loadSettings(workspaceDir, isTrustedOverride) {
439738
440246
  GEMINI_DIR,
439739
440247
  "settings.json"
439740
440248
  );
439741
- if (isTrusted) {
439742
- try {
439743
- if (fs84.existsSync(workspaceSettingsPath)) {
439744
- const projectContent = fs84.readFileSync(workspaceSettingsPath, "utf-8");
439745
- const parsedWorkspaceSettings = JSON.parse(
439746
- (0, import_strip_json_comments3.default)(projectContent)
439747
- );
439748
- workspaceSettings = resolveEnvVarsInObject(parsedWorkspaceSettings);
439749
- }
439750
- } catch (error2) {
439751
- settingsErrors.push({
439752
- message: getErrorMessage(error2),
439753
- path: workspaceSettingsPath
439754
- });
439755
- }
439756
- }
440249
+ const workspaceSettings = isTrusted ? loadAndMigrateFile(workspaceSettingsPath, settingsErrors) : {};
439757
440250
  if (settingsErrors.length > 0) {
439758
440251
  debugLogger.error("Errors loading settings:");
439759
440252
  for (const error2 of settingsErrors) {
@@ -439761,29 +440254,41 @@ function loadSettings(workspaceDir, isTrustedOverride) {
439761
440254
  debugLogger.error(` Message: ${error2.message}`);
439762
440255
  }
439763
440256
  }
439764
- const mergedSettings = {
439765
- ...userSettings,
439766
- ...workspaceSettings
439767
- };
440257
+ const mergedSettings = customDeepMerge(
440258
+ getMergeStrategyForPath,
440259
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
440260
+ userSettings,
440261
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
440262
+ workspaceSettings
440263
+ );
439768
440264
  mergedSettings.policyPaths = userSettings.policyPaths;
439769
440265
  mergedSettings.adminPolicyPaths = userSettings.adminPolicyPaths;
439770
440266
  return mergedSettings;
439771
440267
  }
439772
440268
  function resolveEnvVarsInString(value) {
439773
- const envVarRegex = /\$(?:(\w+)|{([^}]+)})/g;
440269
+ const envVarRegex = /\$(?:(\w+)|{([^}]+?)(?::-([^}]*))?})/g;
439774
440270
  return value.replace(
439775
440271
  envVarRegex,
439776
- (match2, varName1, varName2) => {
440272
+ (match2, varName1, varName2, defaultValue) => {
439777
440273
  const varName = varName1 || varName2;
440274
+ if (!varName) {
440275
+ return match2;
440276
+ }
439778
440277
  const envValue = process?.env?.[varName];
439779
440278
  if (typeof envValue === "string") {
439780
440279
  return envValue;
439781
440280
  }
440281
+ if (defaultValue !== void 0) {
440282
+ return defaultValue;
440283
+ }
439782
440284
  return match2;
439783
440285
  }
439784
440286
  );
439785
440287
  }
439786
440288
  function resolveEnvVarsInObject(obj) {
440289
+ return resolveEnvVarsInObjectInternal(obj, /* @__PURE__ */ new WeakSet());
440290
+ }
440291
+ function resolveEnvVarsInObjectInternal(obj, visited) {
439787
440292
  if (obj === null || obj === void 0 || typeof obj === "boolean" || typeof obj === "number") {
439788
440293
  return obj;
439789
440294
  }
@@ -439791,15 +440296,34 @@ function resolveEnvVarsInObject(obj) {
439791
440296
  return resolveEnvVarsInString(obj);
439792
440297
  }
439793
440298
  if (Array.isArray(obj)) {
439794
- return obj.map((item) => resolveEnvVarsInObject(item));
440299
+ if (visited.has(obj)) {
440300
+ return [...obj];
440301
+ }
440302
+ visited.add(obj);
440303
+ const mapped = obj.map(
440304
+ (item) => resolveEnvVarsInObjectInternal(item, visited)
440305
+ );
440306
+ visited.delete(obj);
440307
+ return mapped;
439795
440308
  }
439796
440309
  if (typeof obj === "object") {
439797
- const newObj = { ...obj };
439798
- for (const key in newObj) {
439799
- if (Object.prototype.hasOwnProperty.call(newObj, key)) {
439800
- newObj[key] = resolveEnvVarsInObject(newObj[key]);
440310
+ if (!isPlainObject3(obj)) {
440311
+ return obj;
440312
+ }
440313
+ const objRef = obj;
440314
+ if (visited.has(objRef)) {
440315
+ return { ...obj };
440316
+ }
440317
+ visited.add(objRef);
440318
+ const newObj = {};
440319
+ const sourceRecord = obj;
440320
+ for (const key of Object.keys(sourceRecord)) {
440321
+ if (isUnsafeKey(key)) {
440322
+ continue;
439801
440323
  }
440324
+ newObj[key] = resolveEnvVarsInObjectInternal(sourceRecord[key], visited);
439802
440325
  }
440326
+ visited.delete(objRef);
439803
440327
  return newObj;
439804
440328
  }
439805
440329
  return obj;
@@ -440017,8 +440541,8 @@ async function loadConfig(settings, extensionLoader, taskId, trusted = false, wo
440017
440541
  const envVars = { ...process.env };
440018
440542
  Object.assign(envVars, workspaceEnv);
440019
440543
  const getEnvLocal = (key) => envVars[key];
440020
- const folderTrust = settings.folderTrust === true || getEnvLocal("GEMINI_FOLDER_TRUST") === "true";
440021
- let checkpointing = getEnvLocal("CHECKPOINTING") ? getEnvLocal("CHECKPOINTING") === "true" : settings.checkpointing?.enabled;
440544
+ const folderTrust = settings.security?.folderTrust?.enabled === true || getEnvLocal("GEMINI_FOLDER_TRUST") === "true";
440545
+ let checkpointing = getEnvLocal("CHECKPOINTING") ? getEnvLocal("CHECKPOINTING") === "true" : settings.general?.checkpointing?.enabled;
440022
440546
  if (checkpointing) {
440023
440547
  if (!await GitService.verifyGitAvailability()) {
440024
440548
  logger.warn(
@@ -440063,6 +440587,9 @@ async function loadConfig(settings, extensionLoader, taskId, trusted = false, wo
440063
440587
  telemetry: void 0
440064
440588
  };
440065
440589
  }
440590
+ if (settings.logging?.level) {
440591
+ logger.level = settings.logging.level;
440592
+ }
440066
440593
  const safeMcpServers = settings.mcpServers;
440067
440594
  const policySettings = {
440068
440595
  mcpServers: safeMcpServers,
@@ -440080,6 +440607,7 @@ async function loadConfig(settings, extensionLoader, taskId, trusted = false, wo
440080
440607
  void 0,
440081
440608
  true
440082
440609
  );
440610
+ const resolvedFileFiltering = settings.context?.fileFiltering;
440083
440611
  const configParams = {
440084
440612
  sessionId: taskId,
440085
440613
  clientName: "a2a-server",
@@ -440096,7 +440624,7 @@ async function loadConfig(settings, extensionLoader, taskId, trusted = false, wo
440096
440624
  coreTools: settings.tools?.core || void 0,
440097
440625
  excludeTools: settings.tools?.exclude || void 0,
440098
440626
  allowedTools: settings.tools?.allowed || void 0,
440099
- showMemoryUsage: settings.showMemoryUsage || false,
440627
+ showMemoryUsage: settings.ui?.showMemoryUsage || false,
440100
440628
  approvalMode,
440101
440629
  policyEngineConfig,
440102
440630
  mcpServers: safeMcpServers,
@@ -440110,11 +440638,11 @@ async function loadConfig(settings, extensionLoader, taskId, trusted = false, wo
440110
440638
  },
440111
440639
  // Git-aware file filtering settings
440112
440640
  fileFiltering: {
440113
- respectGitIgnore: settings.fileFiltering?.respectGitIgnore,
440114
- respectGeminiIgnore: settings.fileFiltering?.respectGeminiIgnore,
440115
- enableRecursiveFileSearch: settings.fileFiltering?.enableRecursiveFileSearch,
440641
+ respectGitIgnore: resolvedFileFiltering?.respectGitIgnore,
440642
+ respectGeminiIgnore: resolvedFileFiltering?.respectGeminiIgnore,
440643
+ enableRecursiveFileSearch: resolvedFileFiltering?.enableRecursiveFileSearch,
440116
440644
  customIgnoreFilePaths: [
440117
- ...settings.fileFiltering?.customIgnoreFilePaths || [],
440645
+ ...resolvedFileFiltering?.customIgnoreFilePaths || [],
440118
440646
  ...getEnvLocal("CUSTOM_IGNORE_FILE_PATHS") ? getEnvLocal("CUSTOM_IGNORE_FILE_PATHS").split(path96.delimiter) : []
440119
440647
  ]
440120
440648
  },
@@ -440157,14 +440685,14 @@ function setIsTrusted(agentSettings, workspaceRoot) {
440157
440685
  return agentSettings.isTrusted;
440158
440686
  }
440159
440687
  const cliTrustEnv = getEnv2("GEMINI_CLI_TRUST_WORKSPACE");
440160
- if (cliTrustEnv !== void 0) {
440688
+ if (cliTrustEnv !== void 0 && cliTrustEnv !== "") {
440161
440689
  return cliTrustEnv === "true";
440162
440690
  }
440163
440691
  if (workspaceRoot) {
440164
440692
  const initialSettings = loadSettings(workspaceRoot, false);
440165
440693
  const { isTrusted } = checkPathTrust({
440166
440694
  path: workspaceRoot,
440167
- isFolderTrustEnabled: initialSettings.folderTrust ?? true,
440695
+ isFolderTrustEnabled: initialSettings.security?.folderTrust?.enabled ?? true,
440168
440696
  isHeadless: isHeadlessMode()
440169
440697
  });
440170
440698
  return isTrusted ?? false;
@@ -442919,7 +443447,7 @@ async function createApp() {
442919
443447
  const initialSettings = loadSettings(workspaceRoot, false);
442920
443448
  const { isTrusted } = checkPathTrust({
442921
443449
  path: workspaceRoot,
442922
- isFolderTrustEnabled: initialSettings.folderTrust ?? true,
443450
+ isFolderTrustEnabled: initialSettings.security?.folderTrust?.enabled ?? true,
442923
443451
  isHeadless: isHeadlessMode()
442924
443452
  });
442925
443453
  process.chdir(workspaceRoot);