refactor(agent): isolate node filesystem session dependencies

This commit is contained in:
Mario Zechner
2026-05-15 00:53:33 +02:00
parent 0b54c87e24
commit 80c918c247
25 changed files with 340 additions and 257 deletions
+3 -3
View File
@@ -261,9 +261,9 @@ function parseFrontmatter<T extends Record<string, unknown>>(
async function resolveKind(env: ExecutionEnv, info: FileInfo): Promise<"file" | "directory" | undefined> {
if (info.kind === "file" || info.kind === "directory") return info.kind;
const realPath = await env.realPath(info.path);
if (!realPath.ok) return undefined;
const target = getOrUndefined(await env.fileInfo(realPath.value));
const canonicalPath = await env.canonicalPath(info.path);
if (!canonicalPath.ok) return undefined;
const target = getOrUndefined(await env.fileInfo(canonicalPath.value));
if (!target) return undefined;
return target.kind === "file" || target.kind === "directory" ? target.kind : undefined;
}