import { CommandRegistry, Disposable, Emitter, Event, MessageService, PreferenceService, QuickInputButton, QuickInputService, QuickPickItem } from '@theia/core'; import { ILogger } from '@theia/core/lib/common/logger'; import { FrontendApplicationContribution, KeybindingRegistry, Widget } from '@theia/core/lib/browser'; import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service'; import { ChatAgent, ChatService } from '@theia/ai-chat'; import { ChatAgentService } from '@theia/ai-chat/lib/common/chat-agent-service'; import { EditorManager } from '@theia/editor/lib/browser/editor-manager'; import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution'; import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar'; import { ChatViewWidget } from './chat-view-widget.js'; import { SecondaryWindowHandler } from '@theia/core/lib/browser/secondary-window-handler'; import { AIActivationService } from '@theia/ai-core/lib/browser'; import { TaskContextService } from '@theia/ai-chat/lib/browser/task-context-service'; export declare const AI_CHAT_TOGGLE_COMMAND_ID = "aiChat:toggle"; export declare class AIChatContribution extends AbstractViewContribution implements FrontendApplicationContribution, TabBarToolbarContribution { protected readonly chatService: ChatService; protected readonly quickInputService: QuickInputService; protected readonly taskContextService: TaskContextService; protected readonly messageService: MessageService; protected readonly chatAgentService: ChatAgentService; protected readonly contextKeyService: ContextKeyService; /** * Context key set to true while the chat view widget is the active widget in the shell. * Broader than `chatInputFocus`/`chatResponseFocus` (which require DOM focus on a specific * sub-widget): clicks on non-focusable parts of the chat view still flip this key, so chat * view keybindings remain available. */ protected chatViewActiveKey: ContextKey; protected readonly editorManager: EditorManager; protected readonly activationService: AIActivationService; protected readonly logger: ILogger; protected readonly preferenceService: PreferenceService; /** * Store whether there are persisted sessions to make this information available in * command enablement checks which are synchronous. */ protected hasPersistedSessions: boolean; /** * Tracks whether the currently active session is empty (= the home / overview is shown). * Used to hide toolbar items that only make sense within an open chat (Home, * lock/unlock auto-scroll, Summarize Current Session, ...). */ protected activeSessionEmpty: boolean; /** Model listener for the active session; disposed and re-bound on active-session changes. */ protected activeSessionModelListener: Disposable | undefined; protected readonly onActiveSessionEmptyChangedEmitter: Emitter; /** Fires when {@link isActiveSessionEmpty} flips. Consumed by toolbar items that hide on the overview. */ readonly onActiveSessionEmptyChanged: Event; /** True when the chat view currently displays the home/overview (the active session has no requests). */ get isActiveSessionEmpty(): boolean; protected static readonly RENAME_CHAT_BUTTON: QuickInputButton; protected static readonly REMOVE_CHAT_BUTTON: QuickInputButton; protected readonly secondaryWindowHandler: SecondaryWindowHandler; constructor(); initialize(): void; protected updateChatViewActiveKey(): void; /** * (Re-)attach a model listener to the currently active session so the Home * toolbar item can react when the user submits the first message and the welcome view * is replaced by the chat tree. */ protected attachToActiveSession(): void; protected setActiveSessionEmpty(empty: boolean): void; initializeLayout(): Promise; protected checkPersistedSessions(): Promise; registerCommands(registry: CommandRegistry): void; registerKeybindings(keybindings: KeybindingRegistry): void; registerToolbarItems(registry: TabBarToolbarRegistry): void; protected selectChat(sessionId?: string): Promise; protected askForChatSession(): Promise; protected renameSession(sessionId: string): Promise; protected deleteSession(sessionId: string, confirm?: boolean): Promise; protected withWidget(widget?: Widget | undefined, predicate?: (output: ChatViewWidget) => boolean): boolean | false; protected extractChatView(chatView: ChatViewWidget): void; canExtractChatView(chatView: ChatViewWidget): boolean; /** * Summarizes the active session and returns the summary ID. * @param override Whether to regenerate the summary if one already exists for the session. */ protected summarizeActiveSession(override?: boolean): Promise; /** * Prompts the user to select a chat agent with an optional default (pre-selected) agent. * @param defaultAgentId The id of the agent to pre-select, if present * @returns The selected agent or undefined if cancelled */ protected selectAgent(defaultAgentId?: string): Promise; /** * Prompts the user to select a task context with special marking for currently opened files * @returns The selected task context ID or undefined if cancelled */ protected selectTaskContextWithMarking(): Promise; /** * Returns information about task context files that are currently opened * @returns Object with arrays of opened context IDs and the active context ID */ protected getOpenedTaskContextFiles(): { openedIds: string[]; activeId?: string; }; } //# sourceMappingURL=ai-chat-ui-contribution.d.ts.map