import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service"; import { IAgentTitleBarStatusService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService.service"; import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service"; import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service"; import { IAgentSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service"; import { BaseActionViewItem, IBaseActionViewItemOptions } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionViewItems"; import { IAction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/actions"; import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service"; import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service"; import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service"; import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service"; import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service"; import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service"; import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions"; import { IActionViewItemService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { WindowTitle } from "@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/titlebar/windowTitle"; import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service"; import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service"; import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service"; import { ITitleService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/title/browser/titleService.service"; /** * Agent Status Widget - renders agent status in the command center. * * Shows two different states: * 1. Default state: Copilot icon pill (turns blue with in-progress count when agents are running) * 2. Agent Session Projection state: Session title + close button (when viewing a session) * * The command center search box and navigation controls remain visible alongside this control. */ export declare class AgentTitleBarStatusWidget extends BaseActionViewItem { private readonly _windowTitle; private readonly instantiationService; private readonly agentTitleBarStatusService; private readonly hoverService; private readonly commandService; private readonly keybindingService; private readonly agentSessionsService; private readonly workspaceContextService; private readonly editorGroupsService; private readonly editorService; private readonly menuService; private readonly contextKeyService; private readonly storageService; private readonly configurationService; private readonly chatEntitlementService; private readonly chatWidgetService; private readonly telemetryService; private _container; private readonly _dynamicDisposables; /** The currently displayed in-progress session (if any) - clicking pill opens this */ /** Cached render state to avoid unnecessary DOM rebuilds */ private _lastRenderState; /** Guard to prevent re-entrant rendering */ private _isRendering; /** Roving tabindex elements for keyboard navigation */ private _rovingElements; private _rovingIndex; /** Tracks if this window applied a badge filter (unread/inProgress), so we only auto-clear our own filters */ private _badgeFilterAppliedByThisWindow; /** Reusable menu for CommandCenterCenter items (e.g., debug toolbar) */ private readonly _commandCenterMenu; /** Menu for ChatTitleBarMenu items (same as chat controls dropdown) */ private readonly _chatTitleBarMenu; constructor(action: IAction, _windowTitle: WindowTitle, options: IBaseActionViewItemOptions | undefined, instantiationService: IInstantiationService, agentTitleBarStatusService: IAgentTitleBarStatusService, hoverService: IHoverService, commandService: ICommandService, keybindingService: IKeybindingService, agentSessionsService: IAgentSessionsService, workspaceContextService: IWorkspaceContextService, editorGroupsService: IEditorGroupsService, editorService: IEditorService, menuService: IMenuService, contextKeyService: IContextKeyService, storageService: IStorageService, configurationService: IConfigurationService, chatEntitlementService: IChatEntitlementService, chatWidgetService: IChatWidgetService, telemetryService: ITelemetryService); render(container: HTMLElement): void; setFocusable(_focusable: boolean): void; focus(): void; blur(): void; private _render; /** * Setup roving tabindex for arrow key navigation between interactive elements. * Uses the elements registered in `this._rovingElements` in their existing order. */ private _setupRovingTabIndex; /** * Moves roving focus from `currentIndex` to `nextIndex`, updating tabIndex and focusing the element. */ private _moveRovingFocus; /** * Returns the next roving index for the given key, or `undefined` if no navigation should occur. */ private _getNextRovingIndex; /** * Get computed session statistics for rendering. * Respects the current provider (session type) filter when calculating counts. */ private _getSessionStats; private _renderChatInputMode; private _renderSessionMode; /** * Render session ready mode - shows session title + enter projection button. * Used when a projection-capable session is available but not yet entered. */ private _renderSessionReadyMode; /** * Render command center toolbar items (like debug toolbar) that are registered to CommandCenter * Filters out the quick open action since we provide our own search UI. * Adds a dot separator after the toolbar if content was rendered. */ private _renderCommandCenterToolbar; /** * Render the search button. If parent is provided, appends to parent; otherwise appends to container. */ private _renderSearchButton; /** * Render the status badge showing in-progress, needs-input, and/or unread session counts. * Shows split UI with sparkle icon on left, then unread, needs-input, and active indicators. * Always renders the sparkle icon section. */ private _renderStatusBadge; /** * Clear the filter if the currently filtered category becomes empty. * For example, if filtered to "unread" but no unread sessions exist, restore user's previous filter. * Only auto-clears if THIS window applied the badge filter to avoid cross-window interference. */ private _clearFilterIfCategoryEmpty; /** * Get the current filter state from storage. */ private _getCurrentFilterState; /** * Get the stored filter object from storage. */ private _getStoredFilter; /** * Store a filter object to storage. */ private _storeFilter; /** * Clear all filters (reset to default). */ private _clearFilter; /** * Save the current user filter before we override it with a badge filter. * Only saves if the current filter is NOT already a badge filter (unread or in-progress). * This preserves the original user filter when switching between badge filters. */ private _saveUserFilter; /** * Restore the user's previous filter (saved before we applied a badge filter). */ private _restoreUserFilter; /** * Opens the agent sessions view with a specific filter applied, or restores previous filter if already applied. * Preserves session type (provider) filters while toggling only status filters. */ private _openSessionsWithFilter; /** * Render the escape button for exiting session projection mode. */ private _renderEscapeButton; /** * Render the enter button for entering session projection mode. */ private _renderEnterButton; /** * Get the session most urgently needing user attention (approval/confirmation/input). * Returns undefined if no sessions need attention. */ private _getSessionNeedingAttention; /** * Compute the label to display in the command center. * Uses the workspace name (folder name) with prefix/suffix decorations. * Falls back to file name when tabs are hidden, or "Search" when empty. */ private _getLabel; } /** * Provides custom rendering for the agent status in the command center. * Uses IActionViewItemService to render a custom AgentStatusWidget * for the AgentsControlMenu submenu. * Also adds CSS classes to the workbench based on settings. */ export declare class AgentTitleBarStatusRendering extends Disposable implements IWorkbenchContribution { static readonly ID = "workbench.contrib.agentStatus.rendering"; constructor(actionViewItemService: IActionViewItemService, instantiationService: IInstantiationService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, titleService: ITitleService); }