521
522
async getAllFileEdits(): Promise<IFileEditRecord[]> {
524
>
const rows = await dbAll(
525
>
db,
526
>
`SELECT turn_id, tool_call_id, file_path, edit_type, original_path, added_lines, removed_lines
527
>
FROM file_edits
528
>
ORDER BY rowid`,
529
>
[],
530
>
);
531
>
return rows.map(row => ({
532
>
turnId: row.turn_id as string,
533
>
toolCallId: row.tool_call_id as string,
534
>
filePath: row.file_path as string,
535
>
kind: (row.edit_type as IFileEditRecord['kind']) ?? 'edit',
536
>
originalPath: row.original_path as string | undefined ?? undefined,
537
>
addedLines: row.added_lines as number | undefined ?? undefined,
538
>
removedLines: row.removed_lines as number | undefined ?? undefined,
539
>
}));
540
>
}
541
542
async getFileEditsByTurn(turnId: string): Promise<IFileEditRecord[]> {