import { CancellationToken } from "../../../../base/common/cancellation.js";
import { Event } from "../../../../base/common/event.js";
import { ResourceMap } from "../../../../base/common/map.js";
import { IObservable, IReader, ITransaction } from "../../../../base/common/observable.js";
import { URI } from "../../../../base/common/uri.js";
import { IDocumentDiff } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/editor/common/diff/documentDiffProvider";
import { TextEdit } from "../../../../editor/common/languages.js";
import { ITextModel } from "../../../../editor/common/model.js";
import { RawContextKey } from "../../../../platform/contextkey/common/contextkey.js";
import { IChatResponseModel } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatModel";
export interface IChatRequestDraft {
    readonly prompt: string;
    readonly files: readonly URI[];
}
export interface IChatRelatedFileProviderMetadata {
    readonly description: string;
}
export interface IChatRelatedFile {
    readonly uri: URI;
    readonly description: string;
}
export interface IChatRelatedFilesProvider {
    readonly description: string;
    provideRelatedFiles(chatRequest: IChatRequestDraft, token: CancellationToken): Promise<IChatRelatedFile[] | undefined>;
}
export interface WorkingSetDisplayMetadata {
    state: WorkingSetEntryState;
    description?: string;
}
export interface IChatEditingSession {
    readonly chatSessionId: string;
    readonly onDidChange: Event<ChatEditingSessionChangeType>;
    readonly onDidDispose: Event<void>;
    readonly state: IObservable<ChatEditingSessionState>;
    readonly entries: IObservable<readonly IModifiedFileEntry[]>;
    readonly workingSet: ResourceMap<WorkingSetDisplayMetadata>;
    readonly isVisible: boolean;
    addFileToWorkingSet(uri: URI, description?: string, kind?: WorkingSetEntryState.Transient | WorkingSetEntryState.Suggested): void;
    show(): Promise<void>;
    remove(reason: WorkingSetEntryRemovalReason, ...uris: URI[]): void;
    accept(...uris: URI[]): Promise<void>;
    reject(...uris: URI[]): Promise<void>;
    getEntry(uri: URI): IModifiedFileEntry | undefined;
    readEntry(uri: URI, reader?: IReader): IModifiedFileEntry | undefined;
    restoreSnapshot(requestId: string): Promise<void>;
    getSnapshotUri(requestId: string, uri: URI): URI | undefined;
    stop(clearState?: boolean): Promise<void>;
    undoInteraction(): Promise<void>;
    redoInteraction(): Promise<void>;
}
export declare enum WorkingSetEntryRemovalReason {
    User = 0,
    Programmatic = 1
}
export declare enum WorkingSetEntryState {
    Modified = 0,
    Accepted = 1,
    Rejected = 2,
    Transient = 3,
    Attached = 4,
    Sent = 5,
    Suggested = 6
}
export declare enum ChatEditingSessionChangeType {
    WorkingSet = 0,
    Other = 1
}
export interface IModifiedFileEntry {
    readonly originalURI: URI;
    readonly originalModel: ITextModel;
    readonly modifiedURI: URI;
    readonly state: IObservable<WorkingSetEntryState>;
    readonly isCurrentlyBeingModified: IObservable<boolean>;
    readonly rewriteRatio: IObservable<number>;
    readonly maxLineNumber: IObservable<number>;
    readonly diffInfo: IObservable<IDocumentDiff>;
    readonly lastModifyingRequestId: string;
    accept(transaction: ITransaction | undefined): Promise<void>;
    reject(transaction: ITransaction | undefined): Promise<void>;
}
export interface IChatEditingSessionStream {
    textEdits(resource: URI, textEdits: TextEdit[], isLastEdits: boolean, responseModel: IChatResponseModel): void;
}
export declare enum ChatEditingSessionState {
    Initial = 0,
    StreamingEdits = 1,
    Idle = 2,
    Disposed = 3
}
export declare const CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME = "chat-editing-multi-diff-source";
export declare const chatEditingWidgetFileStateContextKey: RawContextKey<WorkingSetEntryState>;
export declare const decidedChatEditingResourceContextKey: RawContextKey<string[]>;
export declare const chatEditingResourceContextKey: RawContextKey<string | undefined>;
export declare const inChatEditingSessionContextKey: RawContextKey<boolean | undefined>;
export declare const applyingChatEditsContextKey: RawContextKey<boolean | undefined>;
export declare const hasUndecidedChatEditingResourceContextKey: RawContextKey<boolean | undefined>;
export declare const hasAppliedChatEditsContextKey: RawContextKey<boolean | undefined>;
export declare const applyingChatEditsFailedContextKey: RawContextKey<boolean | undefined>;
export declare const chatEditingMaxFileAssignmentName = "chatEditingSessionFileLimit";
export declare const defaultChatEditingMaxFileLimit = 10;
export declare enum ChatEditKind {
    Created = 0,
    Modified = 1
}
export interface IChatEditingActionContext {
    sessionId: string;
}
export declare function isChatEditingActionContext(thing: unknown): thing is IChatEditingActionContext;
