refactor: share api dto types

This commit is contained in:
Federico Jaramillo Martinez
2026-05-07 23:45:13 +02:00
parent ef63a7a063
commit d7cb7ed655
8 changed files with 165 additions and 266 deletions
+1 -11
View File
@@ -1,17 +1,7 @@
import { readFile, stat } from "node:fs/promises";
import type { FileContentResponse } from "../../shared/apiTypes.js";
import { resolveInsideWorkspace } from "./pathSafety.js";
export interface FileContentResponse {
path: string;
language?: string;
encoding: "utf8";
size: number;
modifiedAt: string;
content: string;
truncated: boolean;
binary: boolean;
}
const MAX_BYTES = 512 * 1024;
export async function readWorkspaceFile(rootPath: string, path: string | undefined): Promise<FileContentResponse> {