import * as React from '@theia/core/shared/react'; import { Emitter, Event } from '@theia/core'; import { Container, interfaces } from '@theia/core/shared/inversify'; import { ContextMenuRenderer, ExpandableTreeNode, NodeProps, SelectableTreeNode, TreeModel, TreeNode, TreeProps, TreeWidget } from '@theia/core/lib/browser'; import { AIActivationService } from '@theia/ai-core/lib/browser/ai-activation-service'; import { AiConfigurationCategoryRegistry } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category-registry'; import { AiConfigurationSelectionModel } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-selection-model'; import { AiConfigurationAddDescriptor, AiConfigurationCategory, AiConfigurationSelection } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category'; import { AiConfigurationCategoryNode } from './ai-configuration-tree-nodes'; export declare class AiConfigurationTreeWidget extends TreeWidget { static readonly ID = "ai-configuration-tree"; protected readonly registry: AiConfigurationCategoryRegistry; protected readonly selectionModel: AiConfigurationSelectionModel; protected readonly activationService: AIActivationService; /** Guards the tree ↔ selection-model round trip against re-entrant updates. */ protected updatingSelection: boolean; /** Set while a rebuild is in flight, so selection is restored once the tree is refreshed. */ protected pendingSelectionRestore: boolean; protected expansionState: Map; /** Active live-filter terms (empty => no filtering). */ protected filterTerms: string[]; /** Expansion snapshot captured when filtering starts, restored when it ends. */ protected preFilterExpansion: Map | undefined; protected readonly onDidChangeExpansionEmitter: Emitter; /** Fires when a category's expansion changes or the tree rebuilds, so the toolbar toggle can update. */ readonly onDidChangeExpansion: Event; constructor(props: TreeProps, model: TreeModel, contextMenuRenderer: ContextMenuRenderer); protected init(): void; protected buildTree(): void; /** * The categories shown in the tree. While AI features are disabled only General is shown, so the * view focuses on re-enabling them (mirroring how the General page disables its dependent settings). */ protected visibleCategories(): AiConfigurationCategory[]; protected captureExpansion(): Map; /** Restores the selection after a rebuild once the target node has been indexed. */ protected onModelChanged(): void; /** Selection model → tree. */ protected reflectSelection(selection: AiConfigurationSelection | undefined): void; /** Tree → selection model. */ protected handleTreeSelectionChanged(): void; /** * When a live filter is active and a category's own label does not match, returns the navigation target of * the first setting that matches and lives at the requested location (with a `highlight` so the detail pane * scrolls to and flashes the row): page-level settings when `itemId` is omitted, the given child's settings * otherwise. Returns `undefined` otherwise, so selecting the node opens its overview as usual. */ protected matchingSettingTarget(categoryId: string, itemId?: string): AiConfigurationSelection | undefined; protected applyTreeSelection(node: SelectableTreeNode): void; protected selectionNodeId(selection: AiConfigurationSelection): string; /** Expands every collapsible category (used by the Expand All toolbar action). */ expandAll(): void; /** Collapses every collapsible category (used by the Collapse All toolbar action). */ collapseAll(): void; /** * Summarises the tree's expansion for the toolbar toggle: `'none'` when no category can be expanded, * `'all-expanded'` when every expandable category is expanded, otherwise `'partially-collapsed'`. */ getExpansionSummary(): 'none' | 'all-expanded' | 'partially-collapsed'; protected forEachCategory(callback: (node: AiConfigurationCategoryNode & ExpandableTreeNode) => void): void; /** * Live tree filter driven by the search box: hides non-matching category/item * nodes and the separator, and (un)expands categories so matches stay visible. */ setFilter(text: string): void; protected expandMatchingCategories(): void; protected restoreExpansion(): void; protected shouldDisplayNode(node: TreeNode): boolean; /** * A category matches if its own label, any child, or any of its settings match; an item matches if its * label or its category's label matches. Matching a category's settings means their names AND ids are * searchable (via the deep-search index), so typing a setting id/name reveals its owning category. */ protected matchesFilter(node: TreeNode): boolean; /** * Whether a category's deep-search items (setting names, ids/keywords) match the active terms. With `itemId` * only settings that live in that child node are considered; without it, every setting of the category. */ protected settingsMatch(categoryId: string, itemId?: string): boolean; protected labelMatches(label: string | undefined): boolean; protected renderIcon(node: TreeNode, props: NodeProps): React.ReactNode; /** * Trailing decorations: an item's state as a colored dot (e.g. whether an MCP server is running), and a * category's "create item" action, so adding an agent or a server does not require opening the page * first. The action button is revealed on hover/focus of the row, like the Settings UI's gear. */ protected renderTailDecorations(node: TreeNode, props: NodeProps): React.ReactNode; /** * The category's add action, if it offers one. Navigation goes through the selection model, so running the * action from the tree behaves like running it from the category's own page. */ protected getAddAction(categoryId: string): AiConfigurationAddDescriptor | undefined; protected createNodeClassNames(node: TreeNode, props: NodeProps): string[]; } export declare function createAiConfigurationTreeContainer(parent: interfaces.Container): Container; //# sourceMappingURL=ai-configuration-tree-widget.d.ts.map