feat(admin): implement admin controls polling and restart prompt (#16627)

This commit is contained in:
Shreya Keshive
2026-01-16 15:24:53 -05:00
committed by GitHub
parent 93224e1813
commit d8d4d87e29
20 changed files with 689 additions and 26 deletions
+4
View File
@@ -81,6 +81,7 @@ export enum Command {
FOCUS_SHELL_INPUT = 'app.focusShellInput',
UNFOCUS_SHELL_INPUT = 'app.unfocusShellInput',
CLEAR_SCREEN = 'app.clearScreen',
RESTART_APP = 'app.restart',
}
/**
@@ -238,6 +239,7 @@ export const defaultKeyBindings: KeyBindingConfig = {
[Command.FOCUS_SHELL_INPUT]: [{ key: 'tab', shift: false }],
[Command.UNFOCUS_SHELL_INPUT]: [{ key: 'tab' }],
[Command.CLEAR_SCREEN]: [{ key: 'l', ctrl: true }],
[Command.RESTART_APP]: [{ key: 'r' }],
};
interface CommandCategory {
@@ -343,6 +345,7 @@ export const commandCategories: readonly CommandCategory[] = [
Command.FOCUS_SHELL_INPUT,
Command.UNFOCUS_SHELL_INPUT,
Command.CLEAR_SCREEN,
Command.RESTART_APP,
],
},
];
@@ -428,4 +431,5 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
[Command.FOCUS_SHELL_INPUT]: 'Focus the shell input from the gemini input.',
[Command.UNFOCUS_SHELL_INPUT]: 'Focus the Gemini input from the shell input.',
[Command.CLEAR_SCREEN]: 'Clear the terminal screen and redraw the UI.',
[Command.RESTART_APP]: 'Restart the application.',
};
+2 -2
View File
@@ -16,7 +16,7 @@ import {
Storage,
coreEvents,
homedir,
type GeminiCodeAssistSetting,
type FetchAdminControlsResponse,
} from '@google/gemini-cli-core';
import stripJsonComments from 'strip-json-comments';
import { DefaultLight } from '../ui/themes/default-light.js';
@@ -346,7 +346,7 @@ export class LoadedSettings {
coreEvents.emitSettingsChanged();
}
setRemoteAdminSettings(remoteSettings: GeminiCodeAssistSetting): void {
setRemoteAdminSettings(remoteSettings: FetchAdminControlsResponse): void {
const admin: Settings['admin'] = {};
const { secureModeEnabled, mcpSetting, cliFeatureSetting } = remoteSettings;