mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 18:04:32 +00:00
Sandbox: add shared bind-aware fs path resolver
This commit is contained in:
@@ -30,11 +30,15 @@ function resolveToCwd(filePath: string, cwd: string): string {
|
||||
return path.resolve(cwd, expanded);
|
||||
}
|
||||
|
||||
export function resolveSandboxInputPath(filePath: string, cwd: string): string {
|
||||
return resolveToCwd(filePath, cwd);
|
||||
}
|
||||
|
||||
export function resolveSandboxPath(params: { filePath: string; cwd: string; root: string }): {
|
||||
resolved: string;
|
||||
relative: string;
|
||||
} {
|
||||
const resolved = resolveToCwd(params.filePath, params.cwd);
|
||||
const resolved = resolveSandboxInputPath(params.filePath, params.cwd);
|
||||
const rootResolved = path.resolve(params.root);
|
||||
const relative = path.relative(rootResolved, resolved);
|
||||
if (!relative || relative === "") {
|
||||
|
||||
Reference in New Issue
Block a user