openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
28 lines (27 loc) • 1.07 kB
JavaScript
import { t as resolveIdentityPathViaExistingAncestorSync } from "./boundary-path-DMNeww4q.js";
//#region src/agents/sandbox/file-mutation-identity.ts
const SANDBOX_FILE_IDENTITY = Symbol.for("openclaw.sandboxFileIdentity");
function hasSandboxFileIdentity(bridge) {
return SANDBOX_FILE_IDENTITY in bridge;
}
async function resolveSandboxFileIdentity(params) {
let identity;
if (hasSandboxFileIdentity(params.bridge)) identity = await params.bridge[SANDBOX_FILE_IDENTITY]({
filePath: params.filePath,
cwd: params.cwd,
signal: params.signal
});
else {
const resolved = params.bridge.resolvePath({
filePath: params.filePath,
cwd: params.cwd
});
identity = resolved.hostPath ? resolveIdentityPathViaExistingAncestorSync(resolved.hostPath) : resolved.containerPath;
}
return identity;
}
async function resolveSandboxFileMutationQueueKey(params) {
return `${params.root}\0${await resolveSandboxFileIdentity(params)}`;
}
//#endregion
export { resolveSandboxFileIdentity as n, resolveSandboxFileMutationQueueKey as r, SANDBOX_FILE_IDENTITY as t };