import { URI } from "../../../base/common/uri.js"; export declare const SESSION_DB_SCHEME = "session-db"; /** * Which content of a file-edit row a `session-db:` URI addresses: the file * before or after the edit, or the file's Working Set baseline up to and * including the edit, which changes made outside of the recorded edits were * moved into (see `workingSetFileContents.ts`). */ export type SessionDbUriPart = "before" | "after" | "workingSetBaseline"; /** * Builds a `session-db:` URI referencing a file-edit content blob in the * session database. The path is the edited file's path so resource labels * show a real path; the lookup fields live in the query, where `filePath` is * kept verbatim because it is part of the database key. * * Only safe to call on the agent host, since `URI.file` interprets `\` per * the operating system it runs on. Clients must use * {@link canonicalizeSessionDbUri}, which takes the path from the file URI * the host already resolved. */ export declare function buildSessionDbUri(sessionUri: string, toolCallId: string, filePath: string, part: SessionDbUriPart): string; /** Parsed fields from a `session-db:` content URI. */ export interface ISessionDbUriFields { sessionUri: string; toolCallId: string; filePath: string; part: SessionDbUriPart; } /** * Parses a `session-db:` URI produced by {@link buildSessionDbUri}. * Returns `undefined` if the URI is not a valid `session-db:` URI. */ export declare function parseSessionDbUri(raw: string): ISessionDbUriFields | undefined; /** * Rewrites a legacy `session-db:` URI so its path is `fileUri`'s, the path of * the file the content belongs to. Snapshots recorded by earlier builds encode * the blob's location in the path (`////`), * which surfaces in resource labels and makes diff editors report the file as * renamed because the original side's path differs from the modified side's. * Any other URI (already-canonical, unparseable, or a different scheme) is * returned unchanged. * * The path is taken from `fileUri` rather than re-derived from the recorded * file system path, so a session recorded on a Windows host canonicalizes the * same way on a POSIX client. */ export declare function canonicalizeSessionDbUri(uri: URI, fileUri: URI): URI;