mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-28 20:16:28 +01:00
49 lines
1.0 KiB
TypeScript
49 lines
1.0 KiB
TypeScript
import type {
|
|
SandboxBrowserConfig,
|
|
SandboxPruneConfig,
|
|
SandboxSshConfig,
|
|
} from "../../src/agents/sandbox/types.js";
|
|
|
|
export function createSandboxBrowserConfig(
|
|
overrides: Partial<SandboxBrowserConfig> = {},
|
|
): SandboxBrowserConfig {
|
|
return {
|
|
enabled: false,
|
|
image: "openclaw-browser",
|
|
containerPrefix: "openclaw-browser-",
|
|
network: "bridge",
|
|
cdpPort: 9222,
|
|
vncPort: 5900,
|
|
noVncPort: 6080,
|
|
headless: true,
|
|
enableNoVnc: false,
|
|
allowHostControl: false,
|
|
autoStart: false,
|
|
autoStartTimeoutMs: 1000,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function createSandboxPruneConfig(
|
|
overrides: Partial<SandboxPruneConfig> = {},
|
|
): SandboxPruneConfig {
|
|
return {
|
|
idleHours: 24,
|
|
maxAgeDays: 7,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function createSandboxSshConfig(
|
|
workspaceRoot: string,
|
|
overrides: Partial<SandboxSshConfig> = {},
|
|
): SandboxSshConfig {
|
|
return {
|
|
command: "ssh",
|
|
workspaceRoot,
|
|
strictHostKeyChecking: true,
|
|
updateHostKeys: true,
|
|
...overrides,
|
|
};
|
|
}
|