openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
25 lines (24 loc) • 1.38 kB
JavaScript
import { l as realpathExistingAncestor, u as realpathExistingAncestorSync } from "./path-existence-Co7-GyVr.mjs";
import path from "node:path";
import { AsyncLocalStorage } from "node:async_hooks";
import { resolvePathViaExistingAncestorSync, resolveRootPath, resolveRootPathSync as resolveRootPathSync$1 } from "@openclaw/fs-safe/advanced";
import { safeRealpathSync, safeRealpathSync as safeRealpathSync$1 } from "@openclaw/fs-safe/path";
//#region src/infra/boundary-path.ts
const runInBoundaryPathContext = AsyncLocalStorage.snapshot();
function resolvePathViaExistingAncestorSync$1(e) {
return runInBoundaryPathContext(resolvePathViaExistingAncestorSync, e);
}
/** Returns a canonical path when resolvable, otherwise an absolute lexical path. */
function resolveRealpathOrAbsolute(e) {
return safeRealpathSync(e) ?? path.resolve(e);
}
function resolveIdentityPathViaExistingAncestorSync(e) {
const t = path.resolve(e);
return realpathExistingAncestorSync(t) ?? t;
}
async function resolveIdentityPathViaExistingAncestor(e) {
const t = path.resolve(e);
return await realpathExistingAncestor(t) ?? t;
}
//#endregion
export { resolveRootPath as a, resolveRealpathOrAbsolute as i, resolveIdentityPathViaExistingAncestorSync as n, resolveRootPathSync$1 as o, resolvePathViaExistingAncestorSync$1 as r, safeRealpathSync$1 as s, resolveIdentityPathViaExistingAncestor as t };