1
>
/*---------------------------------------------------------------------------------------------
fileEditTracker.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { decodeHex, encodeHex, VSBuffer } from '../../../../base/common/buffer.js';
7
>
import { basename } from '../../../../base/common/path.js';
8
>
import { URI } from '../../../../base/common/uri.js';
9
>
import { IFileService } from '../../../files/common/files.js';
10
>
import { ILogService } from '../../../log/common/log.js';
11
>
import { IDiffComputeService } from '../../common/diffComputeService.js';
12
>
import { ISessionDatabase } from '../../common/sessionDataService.js';
13
>
import { FileEditKind, ToolResultContentType, type ToolResultFileEditContent } from '../../common/state/sessionState.js';
14
>
import { extractAiChunks } from './editChunkExtractor.js';
15
>
import { IEditSurvivalReporterFactory } from './editSurvivalReporter.js';
16
>
17
>
const SESSION_DB_SCHEME = 'session-db';
18
>
19
>
/**
20
>
* Builds a `session-db:` URI that references a file-edit content blob
21
>
* stored in the session database. Parsed by {@link parseSessionDbUri}.
22
>
*/
23
>
export function buildSessionDbUri(sessionUri: string, toolCallId: string, filePath: string, part: 'before' | 'after'): string {
24
return URI.from({
25
scheme: SESSION_DB_SCHEME,