import { Event } from "../../../../../../base/common/event.js"; import { IDisposable } from "../../../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../../../base/common/observable.js"; import { ThemeIcon } from "../../../../../../base/common/themables.js"; import { IActionWidgetService } from "../../../../../../platform/actionWidget/browser/actionWidget.service.js"; import { IActionListItemInlineToggle } from "../../../../../../platform/actionWidget/browser/actionList.js"; import { IContextKeyService } from "../../../../../../platform/contextkey/common/contextkey.service.js"; import { IKeybindingService } from "../../../../../../platform/keybinding/common/keybinding.service.js"; import { ITelemetryService } from "../../../../../../platform/telemetry/common/telemetry.service.js"; import { ChatPermissionLevel } from "../../../common/constants.js"; import { IChatSessionProviderOptionItem } from "../../../common/chatSessionsService.js"; import { MenuItemAction } from "../../../../../../platform/actions/common/actions.js"; import { IConfigurationService } from "../../../../../../platform/configuration/common/configuration.service.js"; import { IDialogService } from "../../../../../../platform/dialogs/common/dialogs.service.js"; import { IHoverService } from "../../../../../../platform/hover/browser/hover.service.js"; import { ChatInputPickerActionViewItem, IChatInputPickerOptions } from "./chatInputPickerActionItem.js"; import { IOpenerService } from "../../../../../../platform/opener/common/opener.service.js"; import { IStorageService } from "../../../../../../platform/storage/common/storage.service.js"; import { IUnavailablePermissionLevel } from "../../agentSessions/agentHost/agentHostModePickerPresentation.js"; export interface IExtensionPermissionState { /** Stable identifier for the contributing chat session type, used to namespace action ids. */ readonly sessionType: string; readonly groupId: string; readonly items: readonly IChatSessionProviderOptionItem[]; readonly selectedId: string | undefined; } export interface IPermissionPickerDelegate { readonly isPolicyRestricted?: () => boolean; readonly currentPermissionLevel: IObservable; readonly setPermissionLevel: (level: ChatPermissionLevel) => void; /** * The ordered set of permission levels the picker should offer. When * omitted, the built-in Default/Bypass/Autopilot set is used. Agent-host * sessions override this to Default/Assisted/Bypass (Autopilot lives on the * orthogonal mode axis there). */ readonly availableLevels?: readonly ChatPermissionLevel[]; /** Supported levels the session does not currently allow. They are shown disabled and are never selectable. */ readonly unavailableLevels?: IObservable; /** * The setting id the elevated-level warning dialog links to as "make this * the default". Defaults to `chat.permissions.default`; agent-host sessions * pass `chat.defaultConfiguration`. */ readonly defaultSettingKey?: string; /** * When defined and returns a non-empty state, the picker shows the extension-contributed * items in place of the built-in {@link ChatPermissionLevel} items. */ readonly getExtensionPermissions?: () => IExtensionPermissionState | undefined; readonly setExtensionPermission?: (groupId: string, item: IChatSessionProviderOptionItem) => void; readonly getPermissionLevelHover?: (level: ChatPermissionLevel, meta: IPermissionLevelMeta) => string | undefined; /** * Whether the experimental "Sandboxing for terminal" toggle may be shown. * Evaluated each time the picker opens so a harness switch is reflected. */ readonly isSandboxToggleApplicable?: () => boolean; readonly getSandboxToggleSettingId?: () => string | undefined; /** Tracks asynchronous setting ID changes, including agent host switches. */ readonly sandboxToggleSettingId?: IObservable; readonly sandboxToggleConfigurationKeys?: readonly string[]; readonly managedSandboxEnforced?: IObservable; readonly managedSandboxAllowsBypass?: IObservable; readonly sandboxEnabled?: IObservable; readonly sandboxDevContainerSupported?: IObservable; readonly isApplicable?: IObservable; readonly isResolving?: IObservable; readonly getSandboxToggle?: () => IActionListItemInlineToggle | undefined; } interface IPermissionLevelMeta { readonly id: string; readonly label: string; readonly shortLabel: string; readonly detail: string; readonly icon: ThemeIcon; readonly description: string; /** Elevated levels are disabled when enterprise policy turns off auto-approval and need a warning dialog. */ readonly elevated: boolean; } export declare class PermissionPickerActionItem extends ChatInputPickerActionViewItem { private readonly delegate; private readonly configurationService; private readonly dialogService; private readonly hoverService; private readonly _onDidDispose; readonly onDidDispose: Event; private _currentTooltip; private _hoverElement; private readonly _hover; private _sandboxTogglePresentation; constructor(action: MenuItemAction, delegate: IPermissionPickerDelegate, pickerOptions: IChatInputPickerOptions, actionWidgetService: IActionWidgetService, keybindingService: IKeybindingService, contextKeyService: IContextKeyService, telemetryService: ITelemetryService, configurationService: IConfigurationService, dialogService: IDialogService, openerService: IOpenerService, storageService: IStorageService, hoverService: IHoverService); private refreshSandboxToggle; private isSandboxingEnabled; private isSandboxManaged; private getSandboxToggleSettingId; private isSandboxToggleAvailable; protected renderLabel(element: HTMLElement): IDisposable | null; refresh(): void; dispose(): void; } export {};