import { IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IObservable, ITransaction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { TextEdit } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages"; 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 { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; import { IUndoRedoElement } from "@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo"; import { IUndoRedoService } from "@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo.service"; import { IEditorPane } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor"; import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service"; import { IAiEditTelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.service"; import { CellDiffInfo } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel"; import { NotebookCellTextModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel"; import { ICellEditOperation, IResolvedNotebookEditorModel, NotebookTextModelChangedEvent, TransientOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon"; import { INotebookEditorModelResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service"; import { INotebookLoggingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service"; import { INotebookEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service"; import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service"; import { ChatEditKind, IModifiedEntryTelemetryInfo, IModifiedFileEntryEditorIntegration, ISnapshotEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService"; import { IChatResponseModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel"; import { AbstractChatEditingModifiedFileEntry } from "./chatEditingModifiedFileEntry.js"; import { ChatEditingNotebookCellEntry } from "./notebook/chatEditingNotebookCellEntry.js"; import { ICellDiffInfo } from "./notebook/notebookCellChanges.js"; export declare class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifiedFileEntry { private readonly modifiedResourceRef; private readonly _multiDiffEntryDelegate; private readonly transientOptions; private readonly configurationService; private readonly textModelService; private readonly modelService; private readonly notebookEditorWorkerService; private readonly loggingService; private readonly notebookResolver; static NewModelCounter: number; private readonly modifiedModel; private readonly originalModel; originalURI: URI; /** * JSON stringified version of the original notebook. */ initialContent: string; /** * Whether we're still generating diffs from a response. */ private _isProcessingResponse; get isProcessingResponse(): IObservable; private _isEditFromUs; /** * Whether all edits are from us, e.g. is possible a user has made edits, then this will be false. */ private _allEditsAreFromUs; private readonly _changesCount; changesCount: IObservable; private readonly cellEntryMap; private modifiedToOriginalCell; private readonly _cellsDiffInfo; get cellsDiffInfo(): IObservable; get viewType(): string; /** * List of Cell URIs that are edited, * Will be cleared once all edits have been accepted. * I.e. this will only contain URIS while acceptAgentEdits is being called & before `isLastEdit` is sent. * I.e. this is populated only when edits are being streamed. */ private readonly editedCells; static create(uri: URI, _multiDiffEntryDelegate: { collapse: (transaction: ITransaction | undefined) => void; }, telemetryInfo: IModifiedEntryTelemetryInfo, chatKind: ChatEditKind, initialContent: string | undefined, instantiationService: IInstantiationService): Promise; static canHandleSnapshotContent(initialContent: string | undefined): boolean; static canHandleSnapshot(snapshot: ISnapshotEntry): boolean; private readonly initialContentComparer; constructor(modifiedResourceRef: IReference, originalResourceRef: IReference, _multiDiffEntryDelegate: { collapse: (transaction: ITransaction | undefined) => void; }, transientOptions: TransientOptions | undefined, telemetryInfo: IModifiedEntryTelemetryInfo, kind: ChatEditKind, initialContent: string, configurationService: IConfigurationService, fileConfigService: IFilesConfigurationService, chatService: IChatService, fileService: IFileService, instantiationService: IInstantiationService, textModelService: ITextModelService, modelService: IModelService, undoRedoService: IUndoRedoService, notebookEditorWorkerService: INotebookEditorWorkerService, loggingService: INotebookLoggingService, notebookResolver: INotebookEditorModelResolverService, aiEditTelemetryService: IAiEditTelemetryService); initializeModelsFromDiffImpl(cellsDiffInfo: CellDiffInfo[]): void; getIndexOfCellHandle(handle: number): number; private computeRequestId; initializeModelsFromDiff(): Promise; updateCellDiffInfo(cellsDiffInfo: ICellDiffInfo[], transcation: ITransaction | undefined): void; mirrorNotebookEdits(e: NotebookTextModelChangedEvent): void; protected _doAccept(): Promise; protected _doReject(): Promise; private _collapse; protected _createEditorIntegration(editor: IEditorPane): IModifiedFileEntryEditorIntegration; protected _resetEditsState(tx: ITransaction): void; protected _createUndoRedoElement(response: IChatResponseModel): IUndoRedoElement | undefined; protected _areOriginalAndModifiedIdentical(): Promise; private _areOriginalAndModifiedIdenticalImpl; private newNotebookEditGenerator?; acceptAgentEdits(resource: URI, edits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel | undefined): Promise; private disposeDeletedCellEntries; acceptNotebookEdit(edit: ICellEditOperation): void; private computeStateAfterAcceptingRejectingChanges; createModifiedCellDiffInfo(modifiedCellIndex: number, originalCellIndex: number): ICellDiffInfo; createInsertedCellDiffInfo(modifiedCellIndex: number): ICellDiffInfo; createDeleteCellDiffInfo(originalCellIndex: number): ICellDiffInfo; private undoPreviouslyInsertedCell; private keepPreviouslyInsertedCell; private undoPreviouslyDeletedCell; private keepPreviouslyDeletedCell; private _applyEdits; private _applyEditsSync; private _safeCreateSnapshot; getCurrentSnapshot(): string; createSnapshot(chatSessionResource: URI, requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry; equalsSnapshot(snapshot: ISnapshotEntry | undefined): boolean; restoreFromSnapshot(snapshot: ISnapshotEntry, restoreToDisk?: boolean): Promise; resetEditTrackerToInitialContent(): Promise; resetToInitialContent(): Promise; restoreModifiedModelFromSnapshot(snapshot: string): Promise; private restoreSnapshotInModifiedModel; private readonly cellTextModelMap; private resolveCellModel; getOrCreateModifiedTextFileEntryForCell(cell: NotebookCellTextModel, modifiedCellModel: ITextModel, originalCellModel: ITextModel): ChatEditingNotebookCellEntry | undefined; computeEditsFromSnapshots(beforeSnapshot: string, afterSnapshot: string): Promise<(TextEdit | ICellEditOperation)[]>; private _shouldAutoSave; save(): Promise; revertToDisk(): Promise; }