import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser"; import { ICodeEditorService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service"; import { IContextMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service"; import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service"; import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service"; import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service"; import { IChatAgentCommand, IChatAgentData } from "@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/workbench/contrib/chat/common/chatAgents"; import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service"; import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service"; import { IChatModel, IChatResponseModel } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/common/chatModel"; import { IParsedChatRequest } from "@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes"; import { IChatLocationData, IChatSendRequestOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService"; import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service"; import { IChatSlashCommandService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSlashCommands.service"; import { ChatViewModel, IChatResponseViewModel } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/common/chatViewModel"; import { IChatInputState } from "../common/chatWidgetHistoryService.js"; import { ChatAgentLocation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants"; import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service"; import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service"; import { ChatTreeItem, IChatAcceptInputOptions, IChatCodeBlockInfo, IChatFileTreeInfo, IChatWidget, IChatWidgetViewContext, IChatWidgetViewOptions } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/browser/chat"; import { IChatAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service"; import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service"; import { ChatAttachmentModel } from "./chatAttachmentModel.js"; import { ChatInputPart, IChatInputStyles } from "./chatInputPart.js"; import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service"; export interface IChatViewState { inputValue?: string; inputState?: IChatInputState; } export interface IChatWidgetStyles extends IChatInputStyles { inputEditorBackground: string; resultEditorBackground: string; } export interface IChatWidgetContrib extends IDisposable { readonly id: string; getInputState?(): any; setInputState?(s: any): void; } export interface IChatWidgetLocationOptions { location: ChatAgentLocation; resolveData?(): IChatLocationData | undefined; } export declare function isQuickChat(widget: IChatWidget): boolean; export declare function isInlineChat(widget: IChatWidget): boolean; export declare class ChatWidget extends Disposable implements IChatWidget { private readonly viewOptions; private readonly styles; private readonly configurationService; private readonly contextKeyService; private readonly instantiationService; private readonly chatService; private readonly chatAgentService; private readonly chatWidgetService; private readonly contextMenuService; private readonly chatAccessibilityService; private readonly logService; private readonly themeService; private readonly chatSlashCommandService; private readonly telemetryService; private readonly promptsService; private readonly toolsService; private readonly contextService; static readonly CONTRIBS: { new (...args: [ IChatWidget, ...any ]): IChatWidgetContrib; }[]; private readonly _onDidSubmitAgent; readonly onDidSubmitAgent: Event<{ agent: IChatAgentData; slashCommand?: IChatAgentCommand; }>; private _onDidChangeAgent; readonly onDidChangeAgent: Event<{ agent: IChatAgentData; slashCommand?: IChatAgentCommand; }>; private _onDidFocus; readonly onDidFocus: Event; private _onDidChangeViewModel; readonly onDidChangeViewModel: Event; private _onDidScroll; readonly onDidScroll: Event; private _onDidClear; readonly onDidClear: Event; private _onDidAcceptInput; readonly onDidAcceptInput: Event; private _onDidHide; readonly onDidHide: Event; private _onDidChangeParsedInput; readonly onDidChangeParsedInput: Event; private readonly _onWillMaybeChangeHeight; readonly onWillMaybeChangeHeight: Event; private _onDidChangeHeight; readonly onDidChangeHeight: Event; private readonly _onDidChangeContentHeight; readonly onDidChangeContentHeight: Event; private contribs; private tree; private renderer; private readonly _codeBlockModelCollection; private lastItem; private inputPart; private inlineInputPart; private inputContainer; private focusedInputDOM; private editorOptions; private settingChangeCounter; private listContainer; private container; get domNode(): HTMLElement; private welcomeMessageContainer; private readonly welcomePart; private bodyDimension; private visibleChangeCount; private requestInProgress; private isRequestPaused; private canRequestBePaused; private agentInInput; private currentRequest; private _visible; get visible(): boolean; private previousTreeScrollHeight; private scrollLock; private _isReady; private _onDidBecomeReady; private readonly viewModelDisposables; private _viewModel; private set viewModel(value); get viewModel(): ChatViewModel | undefined; private readonly _editingSession; private parsedChatRequest; get parsedInput(): IParsedChatRequest; get scopedContextKeyService(): IContextKeyService; private readonly _location; get location(): ChatAgentLocation; readonly viewContext: IChatWidgetViewContext; get supportsChangingModes(): boolean; constructor(location: ChatAgentLocation | IChatWidgetLocationOptions, _viewContext: IChatWidgetViewContext | undefined, viewOptions: IChatWidgetViewOptions, styles: IChatWidgetStyles, codeEditorService: ICodeEditorService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, instantiationService: IInstantiationService, chatService: IChatService, chatAgentService: IChatAgentService, chatWidgetService: IChatWidgetService, contextMenuService: IContextMenuService, chatAccessibilityService: IChatAccessibilityService, logService: ILogService, themeService: IThemeService, chatSlashCommandService: IChatSlashCommandService, chatEditingService: IChatEditingService, telemetryService: ITelemetryService, promptsService: IPromptsService, toolsService: ILanguageModelToolsService, contextService: IWorkspaceContextService); private _lastSelectedAgent; set lastSelectedAgent(agent: IChatAgentData | undefined); get lastSelectedAgent(): IChatAgentData | undefined; get supportsFileReferences(): boolean; get input(): ChatInputPart; get inputEditor(): ICodeEditor; get inputUri(): URI; get contentHeight(): number; get attachmentModel(): ChatAttachmentModel; waitForReady(): Promise; render(parent: HTMLElement): void; private scrollToEnd; getContrib(id: string): T | undefined; focusInput(): void; hasInputFocus(): boolean; refreshParsedInput(): void; getSibling(item: ChatTreeItem, type: "next" | "previous"): ChatTreeItem | undefined; clear(): void; private onDidChangeItems; private renderWelcomeViewContentIfNeeded; private getWelcomeViewContent; private getExpWelcomeViewContent; private getExpSuggestedPrompts; private renderChatEditingSessionState; private renderFollowups; setVisible(visible: boolean): void; private createList; startEditing(requestId: string): void; private clickedRequest; finishedEditing(completedEdit?: boolean): void; private scrollToCurrentItem; private onContextMenu; private onDidChangeTreeContentHeight; private getWidgetViewKindTag; private createInput; private onDidStyleChange; togglePaused(): void; setModel(model: IChatModel, viewState: IChatViewState): void; getFocus(): ChatTreeItem | undefined; reveal(item: ChatTreeItem, relativeTop?: number): void; focus(item: ChatTreeItem): void; refilter(): void; setInputPlaceholder(placeholder: string): void; resetInputPlaceholder(): void; setInput(value?: string): void; getInput(): string; logInputHistory(): void; acceptInput(query?: string, options?: IChatAcceptInputOptions): Promise; rerunLastRequest(): Promise; private collectInputState; private _findPromptFileInContext; private _applyPromptFileIfSet; private _acceptInput; getUserSelectedTools(): Record | undefined; getModeRequestOptions(): Partial; getCodeBlockInfosForResponse(response: IChatResponseViewModel): IChatCodeBlockInfo[]; getCodeBlockInfoForEditor(uri: URI): IChatCodeBlockInfo | undefined; getFileTreeInfosForResponse(response: IChatResponseViewModel): IChatFileTreeInfo[]; getLastFocusedFileTreeForResponse(response: IChatResponseViewModel): IChatFileTreeInfo | undefined; focusLastMessage(): void; layout(height: number, width: number): void; private _dynamicMessageLayoutData?; setDynamicChatTreeItemLayout(numOfChatTreeItems: number, maxHeight: number): void; updateDynamicChatTreeItemLayout(numOfChatTreeItems: number, maxHeight: number): void; get isDynamicChatTreeItemLayoutEnabled(): boolean; set isDynamicChatTreeItemLayoutEnabled(value: boolean); layoutDynamicChatTreeItemMode(): void; saveState(): void; getViewState(): IChatViewState; private updateChatInputContext; private _applyPromptMetadata; private _autoAttachInstructions; private _getReadFileTool; } export declare class ChatWidgetService extends Disposable implements IChatWidgetService { readonly _serviceBrand: undefined; private _widgets; private _lastFocusedWidget; private readonly _onDidAddWidget; readonly onDidAddWidget: Event; get lastFocusedWidget(): IChatWidget | undefined; getAllWidgets(): ReadonlyArray; getWidgetsByLocations(location: ChatAgentLocation): ReadonlyArray; getWidgetByInputUri(uri: URI): ChatWidget | undefined; getWidgetBySessionId(sessionId: string): ChatWidget | undefined; private setLastFocusedWidget; register(newWidget: ChatWidget): IDisposable; }