feat: update webui extensions, models, and agent config
Some checks failed
CI / build-check-test (push) Has been cancelled
npm audit / audit (push) Has been cancelled

This commit is contained in:
2026-06-10 21:45:53 +08:00
parent cf5edd6394
commit d51a055d78
64 changed files with 3238 additions and 1665 deletions

View File

@@ -0,0 +1,22 @@
import { relative, resolve } from "node:path";
/** True when `candidate` resolves to a path under `rootDir` (not the root dir itself). */
export function isPathInsideRoot(rootDir: string, candidate: string): boolean {
const root = resolve(rootDir);
const target = resolve(candidate);
const rel = relative(root, target);
if (rel === "" || rel === ".") return false;
if (rel.startsWith("..")) return false;
// Cross-drive relative paths on Windows are absolute (e.g. D:\other\...)
if (/^[A-Za-z]:[\\/]/.test(rel)) return false;
return true;
}
export function isSameResolvedPath(a: string, b: string): boolean {
const left = resolve(a);
const right = resolve(b);
if (process.platform === "win32") {
return left.toLowerCase() === right.toLowerCase();
}
return left === right;
}