import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation"; import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IDiffEditor } 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 { CodeEditorWidget } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget"; import { IEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions"; import { IRange, Range } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range"; import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model"; import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service"; import { ITextModelContentProvider } from "@codingame/monaco-vscode-model-service-override/vscode/vs/editor/common/services/resolverService"; import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service"; import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service"; import { MenuWorkbenchToolBar } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar"; import { MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions"; 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 { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service"; import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service"; import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service"; import { IMarkdownVulnerability } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/common/annotations"; import { IChatResponseModel, IChatTextEditGroup } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/common/chatModel"; import { IChatResponseViewModel } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/common/chatViewModel"; import { ChatTreeItem } from "@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/browser/chat"; import { IChatRendererDelegate } from "./chatListRenderer.js"; import { ChatEditorOptions } from "./chatOptions.js"; export interface ICodeBlockData { readonly codeBlockIndex: number; readonly codeBlockPartIndex: number; readonly element: unknown; readonly textModel: Promise; readonly languageId: string; readonly codemapperUri?: URI; readonly vulns?: readonly IMarkdownVulnerability[]; readonly range?: Range; readonly parentContextKeyService?: IContextKeyService; readonly renderOptions?: ICodeBlockRenderOptions; readonly chatSessionId: string; } export declare const localFileLanguageId = "vscode-local-file"; export declare function parseLocalFileData(text: string): { uri: URI; range: IRange | undefined; }; export interface ICodeBlockActionContext { code: string; codemapperUri?: URI; languageId?: string; codeBlockIndex: number; element: unknown; chatSessionId: string | undefined; } export interface ICodeBlockRenderOptions { hideToolbar?: boolean; verticalPadding?: number; reserveWidth?: number; editorOptions?: IEditorOptions; maxHeightInLines?: number; } export declare class CodeBlockPart extends Disposable { private readonly editorOptions; readonly menuId: MenuId; protected readonly modelService: IModelService; private readonly configurationService; private readonly accessibilityService; protected readonly _onDidChangeContentHeight: Emitter; readonly onDidChangeContentHeight: Event; readonly editor: CodeEditorWidget; protected readonly toolbar: MenuWorkbenchToolBar; private readonly contextKeyService; readonly element: HTMLElement; private readonly vulnsButton; private readonly vulnsListElement; private currentCodeBlockData; private currentScrollWidth; private isDisposed; private resourceContextKey; private get verticalPadding(); constructor(editorOptions: ChatEditorOptions, menuId: MenuId, delegate: IChatRendererDelegate, overflowWidgetsDomNode: HTMLElement | undefined, instantiationService: IInstantiationService, contextKeyService: IContextKeyService, modelService: IModelService, configurationService: IConfigurationService, accessibilityService: IAccessibilityService); dispose(): void; get uri(): URI | undefined; private createEditor; focus(): void; private updatePaddingForLayout; private _configureForScreenReader; private getEditorOptionsFromConfig; layout(width: number): void; private getContentHeight; render(data: ICodeBlockData, width: number): Promise; reset(): void; private clearWidgets; private updateEditor; private getVulnerabilitiesLabel; } export declare class ChatCodeBlockContentProvider extends Disposable implements ITextModelContentProvider { private readonly _modelService; constructor(textModelService: ITextModelService, _modelService: IModelService); provideTextContent(resource: URI): Promise; } export interface ICodeCompareBlockActionContext { readonly element: IChatResponseViewModel; readonly diffEditor: IDiffEditor; readonly edit: IChatTextEditGroup; } export interface ICodeCompareBlockDiffData { modified: ITextModel; original: ITextModel; originalSha1: string; } export interface ICodeCompareBlockData { readonly element: ChatTreeItem; readonly edit: IChatTextEditGroup; readonly diffData: Promise; readonly parentContextKeyService?: IContextKeyService; } export declare class CodeCompareBlockPart extends Disposable { private readonly options; readonly menuId: MenuId; protected readonly modelService: IModelService; private readonly configurationService; private readonly accessibilityService; private readonly labelService; private readonly openerService; protected readonly _onDidChangeContentHeight: Emitter; readonly onDidChangeContentHeight: Event; private readonly contextKeyService; private readonly diffEditor; private readonly resourceLabel; private readonly toolbar; readonly element: HTMLElement; private readonly messageElement; private readonly _lastDiffEditorViewModel; private currentScrollWidth; constructor(options: ChatEditorOptions, menuId: MenuId, delegate: IChatRendererDelegate, overflowWidgetsDomNode: HTMLElement | undefined, instantiationService: IInstantiationService, contextKeyService: IContextKeyService, modelService: IModelService, configurationService: IConfigurationService, accessibilityService: IAccessibilityService, labelService: ILabelService, openerService: IOpenerService); get uri(): URI | undefined; private createDiffEditor; focus(): void; private updatePaddingForLayout; private _configureForScreenReader; private getEditorOptionsFromConfig; layout(width: number): void; render(data: ICodeCompareBlockData, width: number, token: CancellationToken): Promise; reset(): void; private clearWidgets; private updateEditor; } export declare class DefaultChatTextEditor { private readonly modelService; private readonly editorService; private readonly dialogService; private readonly _sha1; constructor(modelService: ITextModelService, editorService: ICodeEditorService, dialogService: IDialogService); apply(response: IChatResponseModel | IChatResponseViewModel, item: IChatTextEditGroup, diffEditor: IDiffEditor | undefined): Promise; private _applyWithDiffEditor; private _apply; private _checkSha1; discard(response: IChatResponseModel | IChatResponseViewModel, item: IChatTextEditGroup): void; }