fix(agents): split sandbox backend handle types

This commit is contained in:
Vincent Koc
2026-04-09 08:50:30 +01:00
parent f374fff3bd
commit 7d6af7e154
7 changed files with 101 additions and 66 deletions

View File

@@ -1,7 +1,6 @@
import fsPromises from "node:fs/promises";
import path from "node:path";
import type {
SandboxContext,
SandboxFsBridge,
SandboxFsStat,
SandboxResolvedPath,
@@ -10,6 +9,10 @@ import { createWritableRenameTargetResolver } from "openclaw/plugin-sdk/sandbox"
import type { OpenShellSandboxBackend } from "./backend.js";
import { movePathWithCopyFallback } from "./mirror.js";
type OpenShellFsBridgeContext = Parameters<
NonNullable<OpenShellSandboxBackend["createFsBridge"]>
>[0]["sandbox"];
type ResolvedMountPath = SandboxResolvedPath & {
mountHostRoot: string;
writable: boolean;
@@ -17,7 +20,7 @@ type ResolvedMountPath = SandboxResolvedPath & {
};
export function createOpenShellFsBridge(params: {
sandbox: SandboxContext;
sandbox: OpenShellFsBridgeContext;
backend: OpenShellSandboxBackend;
}): SandboxFsBridge {
return new OpenShellFsBridge(params.sandbox, params.backend);
@@ -30,7 +33,7 @@ class OpenShellFsBridge implements SandboxFsBridge {
);
constructor(
private readonly sandbox: SandboxContext,
private readonly sandbox: OpenShellFsBridgeContext,
private readonly backend: OpenShellSandboxBackend,
) {}