import { IListAccessibilityProvider } from "../../../../../base/browser/ui/list/listWidget.js"; import { IAction } from "../../../../../base/common/actions.js"; import { Disposable, IDisposable } from "../../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../../base/common/observable.js"; import { URI } from "../../../../../base/common/uri.js"; import { ThemeIcon } from "../../../../../base/common/themables.js"; import { IActionListItem, IActionListOptions } from "../../../../../platform/actionWidget/browser/actionList.js"; import { IActionWidgetService } from "../../../../../platform/actionWidget/browser/actionWidget.service.js"; import { IHoverService } from "../../../../../platform/hover/browser/hover.service.js"; import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { SessionConfigKey } from "../../../../../platform/agentHost/common/sessionConfigKeys.js"; import { SessionConfigPropertySchema } from "../../../../../platform/agentHost/common/state/protocol/commands.js"; import { ITelemetryService } from "../../../../../platform/telemetry/common/telemetry.service.js"; import { ISessionsProvidersService } from "../../../../services/sessions/browser/sessionsProvidersService.service.js"; import { IActiveSession } from "../../../../services/sessions/common/sessionsManagement.js"; import { type ISessionConfigProvider } from "../../../../services/sessions/common/sessionsProvider.js"; import { IChatPetService } from "../../../../../workbench/contrib/chat/browser/chatPetService.service.js"; import { IPreferencesService } from "../../../../../workbench/services/preferences/common/preferences.service.js"; export interface IAgentHostSessionEnumPickerItem { readonly id?: string; readonly value: string; readonly label: string; readonly description?: string; readonly checked?: boolean; } /** * Shared active-session picker for well-known string-enum session config. * Concrete subclasses provide the property key, schema guard, icon policy, * and labels while this class owns the provider subscription and picker UI. */ export declare abstract class AgentHostSessionEnumPicker extends Disposable { protected readonly _session: IObservable; private readonly _actionWidgetService; private readonly _sessionsProvidersService; private readonly _telemetryService; private readonly _hoverService; private readonly _renderDisposables; private readonly _triggerGesture; private readonly _providerListeners; private readonly _pickerListener; private _containerElement; private _slotElement; protected _triggerElement: HTMLElement | undefined; private _pickerVisible; protected abstract readonly _property: string; protected abstract readonly _pickerId: string; protected abstract readonly _telemetryId: string; constructor(_session: IObservable, _actionWidgetService: IActionWidgetService, _sessionsProvidersService: ISessionsProvidersService, _telemetryService: ITelemetryService, _hoverService: IHoverService); render(container: HTMLElement): HTMLElement; focus(): void; private _watchProviders; protected abstract _isWellKnownSchema(schema: SessionConfigPropertySchema): boolean; protected abstract _getTriggerIcon(value: string | undefined): ThemeIcon | undefined; protected abstract _getActionItemIcon(item: IAgentHostSessionEnumPickerItem, currentValue: string): ThemeIcon | undefined; protected abstract _getTriggerAriaLabel(label: string): string; protected abstract _getWidgetAriaLabel(): string; protected _createTrigger(slot: HTMLElement): HTMLElement; protected _getTriggerTooltip(tooltip: string): string; protected _getFooterActionItems(): readonly IActionListItem[]; protected _watchActionItems(_items: readonly IActionListItem[]): IDisposable; protected _handleFooterActionItem(_item: IAgentHostSessionEnumPickerItem): boolean; protected _onDidSelectValue(_previousValue: string, _selectedValue: string, _chat: URI): void; protected _getActionItems(items: readonly IAgentHostSessionEnumPickerItem[], currentValue: string): IActionListItem[]; protected _getAccessibilityProvider(): Partial>>; /** * Optional list-widget options for the picker popup. Subclasses whose * option descriptions are long (e.g. the Codex approvals presets) return a * bounded `maxWidth` plus a `className`/`detailItemHeight` so the detail text * wraps within a compact box instead of stretching the popup horizontally. */ protected _getListOptions(): IActionListOptions | undefined; /** * `true` while the active session's provider is resolving its config. * Subclasses gate picker-open paths on this; the desktop chip is * rendered visually disabled in {@link _updateTrigger}. */ protected _isCurrentlyResolvingConfig(): boolean; showPicker(anchor: HTMLElement, onHide?: () => void): boolean; protected _getActiveContext(): { provider: ISessionConfigProvider; sessionId: string; chat: URI; currentValue: string; items: readonly IAgentHostSessionEnumPickerItem[]; tooltip: string; } | undefined; protected _updateTrigger(): void; protected _renderTriggerLabel(trigger: HTMLElement, label: string, icon: ThemeIcon | undefined): void; protected _hidePicker(): void; protected _showPicker(anchor?: HTMLElement | undefined, onHide?: () => void, listOptions?: IActionListOptions | undefined): boolean; } /** * Picker widget for the agent-host `mode` session-config property * (`interactive` / `plan` / `autopilot`). */ export declare class AgentHostModePicker extends AgentHostSessionEnumPicker { protected readonly _chatPetService: IChatPetService; private readonly _configurationService; private readonly _preferencesService; private readonly _splitTrigger; private readonly _permissionDelegate; private readonly _permissionPicker; protected readonly _property = SessionConfigKey.Mode; protected readonly _pickerId = "agentHostModePicker"; protected readonly _telemetryId = "NewChatAgentHostModePicker"; constructor(session: IObservable, actionWidgetService: IActionWidgetService, sessionsProvidersService: ISessionsProvidersService, telemetryService: ITelemetryService, hoverService: IHoverService, _chatPetService: IChatPetService, instantiationService: IInstantiationService, _configurationService: IConfigurationService, _preferencesService: IPreferencesService); protected _renderTriggerLabel(trigger: HTMLElement, label: string, icon: ThemeIcon | undefined): void; protected _createTrigger(slot: HTMLElement): HTMLElement; focus(): void; protected _showPicker(anchor?: HTMLElement | undefined, onHide?: () => void, listOptions?: IActionListOptions): boolean; protected _getTriggerTooltip(tooltip: string): string; protected _getFooterActionItems(): readonly IActionListItem[]; protected _getActionItems(items: readonly IAgentHostSessionEnumPickerItem[], currentValue: string): IActionListItem[]; protected _watchActionItems(items: readonly IActionListItem[]): IDisposable; protected _getAccessibilityProvider(): Partial>>; protected _onDidSelectValue(previousValue: string, selectedValue: string): void; protected _getListOptions(): IActionListOptions; protected _isWellKnownSchema(schema: SessionConfigPropertySchema): boolean; protected _getTriggerIcon(value: string | undefined): ThemeIcon | undefined; protected _getActionItemIcon(item: IAgentHostSessionEnumPickerItem): ThemeIcon | undefined; protected _getTriggerAriaLabel(label: string): string; protected _getWidgetAriaLabel(): string; }