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 { 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 { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service"; import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions"; import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service"; import { ISCMService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service"; import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service"; import { IExportableRepoData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel"; /** * Generates a unified diff string compatible with `git apply`. * * Note: This implementation has a known limitation - if the only change between * files is the presence/absence of a trailing newline (content otherwise identical), * no diff will be generated because VS Code's diff algorithm treats the lines as equal. */ export declare function generateUnifiedDiff(fileService: IFileService, relPath: string, originalUri: URI | undefined, modifiedUri: URI, changeType: "added" | "modified" | "deleted" | "renamed"): Promise; /** * Captures lightweight repository metadata (branch, commit, remote) from SCM providers. * No file I/O or diff computation - reads only from already-loaded SCM observables. * Used on chat message submission to record the point-in-time commit state. */ export declare function captureRepoMetadata(scmService: ISCMService): IExportableRepoData | undefined; /** * Captures full repository state including working tree diffs. * Performs file I/O and diff computation - should only be called on explicit user action (e.g., export). */ export declare function captureRepoInfo(scmService: ISCMService, fileService: IFileService): Promise; /** * Captures lightweight repository metadata for chat sessions on first message. * Only reads from already-loaded SCM provider observables, no file I/O. * Full diff capture is deferred to export time (see chatExportZip.ts). */ export declare class ChatRepoInfoContribution extends Disposable implements IWorkbenchContribution { private readonly chatService; private readonly chatEntitlementService; private readonly scmService; private readonly logService; private readonly configurationService; static readonly ID = "workbench.contrib.chatRepoInfo"; private _configurationRegistered; constructor(chatService: IChatService, chatEntitlementService: IChatEntitlementService, scmService: ISCMService, logService: ILogService, configurationService: IConfigurationService); private registerConfigurationIfInternal; /** * Captures lightweight metadata (branch, commit, remote refs) on first message. * Synchronous, no file I/O. Reads only from SCM provider observables. */ private captureAndSetRepoMetadata; }