openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.04 kB
JavaScript
import{a as normalizeWindowsPathForComparison}from"./path-guards-DGttsOJI.mjs";import{f as resolveIdentityPathViaExistingAncestorSync}from"./path-existence-BR9MXlgL.mjs";import path from"node:path";
//!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)}`}export{resolveSandboxFileIdentity as n,resolveSandboxFileMutationQueueKey as r,SANDBOX_FILE_IDENTITY as t};