openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
27 lines (26 loc) • 1.15 kB
JavaScript
import { n as resolveIdentityPathViaExistingAncestorSync } from "./boundary-path-C2gXEiXe.mjs";
import { a as normalizeWindowsPathForComparison } from "./path-guards-TIjxtj6H.mjs";
import path from "node:path";
//#region src/agents/sandbox/file-mutation-identity.ts
const SANDBOX_FILE_IDENTITY = Symbol.for("openclaw.sandboxFileIdentity");
function hasSandboxFileIdentity(e) {
return SANDBOX_FILE_IDENTITY in e;
}
async function resolveSandboxFileIdentity(e) {
if (hasSandboxFileIdentity(e.bridge)) return await e.bridge[SANDBOX_FILE_IDENTITY]({
filePath: e.filePath,
cwd: e.cwd,
signal: e.signal
});
const t = e.bridge.resolvePath({
filePath: e.filePath,
cwd: e.cwd
});
const n = t.containerPath;
return t.hostPath ? resolveIdentityPathViaExistingAncestorSync(t.hostPath) : !n.startsWith("/") && path.win32.isAbsolute(n) ? normalizeWindowsPathForComparison(n) : path.posix.normalize(n);
}
async function resolveSandboxFileMutationQueueKey(e) {
return `${e.root}\0${await resolveSandboxFileIdentity(e)}`;
}
//#endregion
export { resolveSandboxFileIdentity as n, resolveSandboxFileMutationQueueKey as r, SANDBOX_FILE_IDENTITY as t };