14
}
15
16
>
function createSessionFileDiff(beforeSessionUri: string, afterSessionUri: string, identity: IFileIdentity, added: number, removed: number): ISessionFileDiff {
sessionDiffAggregator.ts
17
>
const hasBefore = identity.firstKind !== FileEditKind.Create;
18
>
const hasAfter = identity.lastKind !== FileEditKind.Delete;
19
>
return {
20
>
...(hasBefore ? {
21
before: {
22
uri: URI.file(identity.firstFilePath).toString(),
23
content: { uri: buildSessionDbUri(beforeSessionUri, identity.firstToolCallId, identity.firstFilePath, 'before') },
24
},
26
>
...(hasAfter ? {
27
>
after: {
28
>
uri: URI.file(identity.terminalPath).toString(),
29
>
content: { uri: buildSessionDbUri(afterSessionUri, identity.lastToolCallId, identity.lastFilePath, 'after') },
30
>
},
31
>
} : {}),
32
>
diff: { added, removed },
33
>
};
34
>
}
35
36
/**