refactor(agents): centralize sandbox media and fs policy helpers

This commit is contained in:
Peter Steinberger
2026-02-24 02:30:45 +00:00
parent 207ec7cfae
commit ce02ad9643
8 changed files with 178 additions and 198 deletions

View File

@@ -3,6 +3,7 @@ import { resolvePluginTools } from "../plugins/tools.js";
import type { GatewayMessageChannel } from "../utils/message-channel.js";
import { resolveSessionAgentId } from "./agent-scope.js";
import type { SandboxFsBridge } from "./sandbox/fs-bridge.js";
import type { ToolFsPolicy } from "./tool-fs-policy.js";
import { createAgentsListTool } from "./tools/agents-list-tool.js";
import { createBrowserTool } from "./tools/browser-tool.js";
import { createCanvasTool } from "./tools/canvas-tool.js";
@@ -41,7 +42,7 @@ export function createOpenClawTools(options?: {
agentDir?: string;
sandboxRoot?: string;
sandboxFsBridge?: SandboxFsBridge;
workspaceOnly?: boolean;
fsPolicy?: ToolFsPolicy;
workspaceDir?: string;
sandboxed?: boolean;
config?: OpenClawConfig;
@@ -79,7 +80,7 @@ export function createOpenClawTools(options?: {
options?.sandboxRoot && options?.sandboxFsBridge
? { root: options.sandboxRoot, bridge: options.sandboxFsBridge }
: undefined,
workspaceOnly: options?.workspaceOnly,
fsPolicy: options?.fsPolicy,
modelHasVision: options?.modelHasVision,
})
: null;