feat(cli): Add state management and plumbing for agent configuration dialog (#17259)

This commit is contained in:
Sandy Tao
2026-01-22 10:30:44 -08:00
committed by GitHub
parent ba8c64459b
commit 902e5d6dae
9 changed files with 246 additions and 1 deletions

View File

@@ -8,7 +8,11 @@ import { createContext, useContext } from 'react';
import { type Key } from '../hooks/useKeypress.js';
import { type IdeIntegrationNudgeResult } from '../IdeIntegrationNudge.js';
import { type FolderTrustChoice } from '../components/FolderTrustDialog.js';
import { type AuthType, type EditorType } from '@google/gemini-cli-core';
import {
type AuthType,
type EditorType,
type AgentDefinition,
} from '@google/gemini-cli-core';
import { type LoadableSettingScope } from '../../config/settings.js';
import type { AuthState } from '../types.js';
import { type PermissionsDialogProps } from '../components/PermissionsModifyTrustDialog.js';
@@ -32,6 +36,12 @@ export interface UIActions {
exitPrivacyNotice: () => void;
closeSettingsDialog: () => void;
closeModelDialog: () => void;
openAgentConfigDialog: (
name: string,
displayName: string,
definition: AgentDefinition,
) => void;
closeAgentConfigDialog: () => void;
openPermissionsDialog: (props?: PermissionsDialogProps) => void;
closePermissionsDialog: () => void;
setShellModeActive: (value: boolean) => void;

View File

@@ -24,6 +24,7 @@ import type {
IdeInfo,
FallbackIntent,
ValidationIntent,
AgentDefinition,
} from '@google/gemini-cli-core';
import type { DOMElement } from 'ink';
import type { SessionStatsState } from '../contexts/SessionContext.js';
@@ -70,6 +71,10 @@ export interface UIState {
isSettingsDialogOpen: boolean;
isSessionBrowserOpen: boolean;
isModelDialogOpen: boolean;
isAgentConfigDialogOpen: boolean;
selectedAgentName?: string;
selectedAgentDisplayName?: string;
selectedAgentDefinition?: AgentDefinition;
isPermissionsDialogOpen: boolean;
permissionsDialogProps: { targetDirectory?: string } | null;
slashCommands: readonly SlashCommand[] | undefined;