import { Disposable } from "../../../../../base/common/lifecycle.js"; import { IStorageService } from "../../../../../platform/storage/common/storage.service.js"; import { IChatModelInputState } from "../model/chatModel.js"; import { ChatAgentLocation } from "../constants.js"; import { IChatWidgetHistoryService } from "./chatWidgetHistoryService.service.js"; export type ChatHistoryChange = { kind: "append"; location: ChatAgentLocation; historyKey: string | undefined; entry: IChatModelInputState; } | { kind: "move"; location: ChatAgentLocation; fromHistoryKey: string; toHistoryKey: string; } | { kind: "clear"; }; export declare const ChatInputHistoryMaxEntries = 40; export declare class ChatWidgetHistoryService extends Disposable implements IChatWidgetHistoryService { _serviceBrand: undefined; private memento; private viewState; private readonly _onDidChangeHistory; private changed; readonly onDidChangeHistory: import("../../../../../base/common/event.js").Event; constructor(storageService: IStorageService); getHistory(location: ChatAgentLocation, historyKey?: string): IChatModelInputState[]; private migrateHistoryEntry; private getKey; append(location: ChatAgentLocation, history: IChatModelInputState, historyKey?: string): void; moveHistory(location: ChatAgentLocation, fromHistoryKey: string, toHistoryKey: string): void; clearHistory(): void; } export declare class ChatHistoryNavigator extends Disposable { private readonly location; private readonly chatWidgetHistoryService; /** * Index of our point in history. Goes 1 past the length of `_history` */ private _currentIndex; private _history; private _overlay; private _historyKey; get values(): readonly IChatModelInputState[]; constructor(location: ChatAgentLocation, chatWidgetHistoryService: IChatWidgetHistoryService); setHistoryKey(historyKey: string | undefined): void; isAtEnd(): boolean; isAtStart(): boolean; /** * Replaces a history entry at the current index in this view of the history. * Allows editing of old history entries while preventing accidental navigation * from losing the edits. */ overlay(entry: IChatModelInputState): void; resetCursor(): void; previous(): IChatModelInputState; next(): IChatModelInputState; current(): IChatModelInputState; /** * Appends a new entry to the navigator. Resets the state back to the end * and clears any overlayed entries. */ append(entry: IChatModelInputState): void; }