mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
feat(admin): Introduce remote admin settings & implement secureModeEnabled/mcpEnabled (#15935)
This commit is contained in:
@@ -88,6 +88,7 @@ import type { PolicyEngineConfig } from '../policy/types.js';
|
||||
import { HookSystem } from '../hooks/index.js';
|
||||
import type { UserTierId } from '../code_assist/types.js';
|
||||
import type { RetrieveUserQuotaResponse } from '../code_assist/types.js';
|
||||
import type { GeminiCodeAssistSetting } from '../code_assist/types.js';
|
||||
import { getCodeAssistServer } from '../code_assist/codeAssist.js';
|
||||
import type { Experiments } from '../code_assist/experiments/experiments.js';
|
||||
import { AgentRegistry } from '../agents/registry.js';
|
||||
@@ -356,6 +357,7 @@ export interface ConfigParameters {
|
||||
disabledSkills?: string[];
|
||||
experimentalJitContext?: boolean;
|
||||
onModelChange?: (model: string) => void;
|
||||
mcpEnabled?: boolean;
|
||||
onReload?: () => Promise<{ disabledSkills?: string[] }>;
|
||||
}
|
||||
|
||||
@@ -389,6 +391,7 @@ export class Config {
|
||||
private readonly toolDiscoveryCommand: string | undefined;
|
||||
private readonly toolCallCommand: string | undefined;
|
||||
private readonly mcpServerCommand: string | undefined;
|
||||
private readonly mcpEnabled: boolean;
|
||||
private mcpServers: Record<string, MCPServerConfig> | undefined;
|
||||
private userMemory: string;
|
||||
private geminiMdFileCount: number;
|
||||
@@ -491,6 +494,7 @@ export class Config {
|
||||
private readonly experimentalJitContext: boolean;
|
||||
private contextManager?: ContextManager;
|
||||
private terminalBackground: string | undefined = undefined;
|
||||
private remoteAdminSettings: GeminiCodeAssistSetting | undefined;
|
||||
|
||||
constructor(params: ConfigParameters) {
|
||||
this.sessionId = params.sessionId;
|
||||
@@ -512,6 +516,7 @@ export class Config {
|
||||
this.toolCallCommand = params.toolCallCommand;
|
||||
this.mcpServerCommand = params.mcpServerCommand;
|
||||
this.mcpServers = params.mcpServers;
|
||||
this.mcpEnabled = params.mcpEnabled ?? true;
|
||||
this.allowedMcpServers = params.allowedMcpServers ?? [];
|
||||
this.blockedMcpServers = params.blockedMcpServers ?? [];
|
||||
this.allowedEnvironmentVariables = params.allowedEnvironmentVariables ?? [];
|
||||
@@ -894,6 +899,14 @@ export class Config {
|
||||
return this.terminalBackground;
|
||||
}
|
||||
|
||||
getRemoteAdminSettings(): GeminiCodeAssistSetting | undefined {
|
||||
return this.remoteAdminSettings;
|
||||
}
|
||||
|
||||
setRemoteAdminSettings(settings: GeminiCodeAssistSetting): void {
|
||||
this.remoteAdminSettings = settings;
|
||||
}
|
||||
|
||||
shouldLoadMemoryFromIncludeDirectories(): boolean {
|
||||
return this.loadMemoryFromIncludeDirectories;
|
||||
}
|
||||
@@ -1125,6 +1138,10 @@ export class Config {
|
||||
return this.mcpServers;
|
||||
}
|
||||
|
||||
getMcpEnabled(): boolean {
|
||||
return this.mcpEnabled;
|
||||
}
|
||||
|
||||
getMcpClientManager(): McpClientManager | undefined {
|
||||
return this.mcpClientManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user