Extension update confirm dialog (#10183)

This commit is contained in:
Jacob MacDonald
2025-09-29 14:19:19 -07:00
committed by GitHub
parent d6933c77ba
commit cea1a867b6
14 changed files with 310 additions and 50 deletions
@@ -54,7 +54,10 @@ async function updateAction(context: CommandContext, args: string) {
context.services.config!.getWorkingDir(),
// We don't have the ability to prompt for consent yet in this flow.
(description) =>
requestConsentInteractive(description, context.ui.addItem),
requestConsentInteractive(
description,
context.ui.addConfirmUpdateExtensionRequest,
),
context.services.config!.getExtensions(),
context.ui.extensionsUpdateState,
context.ui.setExtensionsUpdateState,
@@ -80,7 +83,10 @@ async function updateAction(context: CommandContext, args: string) {
extension,
workingDir,
(description) =>
requestConsentInteractive(description, context.ui.addItem),
requestConsentInteractive(
description,
context.ui.addConfirmUpdateExtensionRequest,
),
context.ui.extensionsUpdateState.get(extension.name) ??
ExtensionUpdateState.UNKNOWN,
(updateState) => {
+6 -1
View File
@@ -6,7 +6,11 @@
import type { Dispatch, ReactNode, SetStateAction } from 'react';
import type { Content, PartListUnion } from '@google/genai';
import type { HistoryItemWithoutId, HistoryItem } from '../types.js';
import type {
HistoryItemWithoutId,
HistoryItem,
ConfirmationRequest,
} from '../types.js';
import type { Config, GitService, Logger } from '@google/gemini-cli-core';
import type { LoadedSettings } from '../../config/settings.js';
import type { UseHistoryManagerReturn } from '../hooks/useHistoryManager.js';
@@ -66,6 +70,7 @@ export interface CommandContext {
setExtensionsUpdateState: Dispatch<
SetStateAction<Map<string, ExtensionUpdateState>>
>;
addConfirmUpdateExtensionRequest: (value: ConfirmationRequest) => void;
};
// Session-specific data
session: {