style: fix biome lint (template literal, import sorting)

This commit is contained in:
2026-05-31 04:48:16 +00:00
parent 806edb2750
commit f8c06ada64
2 changed files with 14 additions and 4 deletions
+13 -3
View File
@@ -27,8 +27,8 @@ import type { AdapterOutput } from "@uncaged/workflow-util-agent";
import { getEnvPath, loadWorkflowConfig } from "@uncaged/workflow-util-agent";
import { config as loadDotenv } from "dotenv";
import { parse } from "yaml";
import { createIncludeTag } from "../include.js";
import { createMarker, deleteMarker, isThreadRunning } from "../background/index.js";
import { createIncludeTag } from "../include.js";
import { evaluate } from "../moderator/index.js";
import {
appendThreadHistory,
@@ -121,7 +121,12 @@ async function findWorkflowInDir(dir: string, name: string): Promise<string | nu
}
for (const indexName of ["index.yaml", "index.yml"]) {
const candidate = resolvePath(dir, ".workflow", name, indexName);
try { await access(candidate); return candidate; } catch { /* not found */ }
try {
await access(candidate);
return candidate;
} catch {
/* not found */
}
}
// Check .workflows/ directory as fallback (legacy)
@@ -133,7 +138,12 @@ async function findWorkflowInDir(dir: string, name: string): Promise<string | nu
}
for (const indexName of ["index.yaml", "index.yml"]) {
const candidate = resolvePath(dir, ".workflows", name, indexName);
try { await access(candidate); return candidate; } catch { /* not found */ }
try {
await access(candidate);
return candidate;
} catch {
/* not found */
}
}
return null;
+1 -1
View File
@@ -16,7 +16,7 @@ export function createIncludeTag(baseDir: string) {
resolve(str: string) {
const filePath = resolve(resolvedBase, str);
// Path traversal guard: resolved path must be inside baseDir
if (!filePath.startsWith(resolvedBase + "/") && filePath !== resolvedBase) {
if (!filePath.startsWith(`${resolvedBase}/`) && filePath !== resolvedBase) {
throw new Error(
`!include path traversal blocked: "${str}" resolves outside base directory`,
);