pub struct KernelConfig {
pub name: String,
pub vfs_mode: VfsMountMode,
pub cwd: PathBuf,
pub skip_validation: bool,
pub interactive: bool,
}Expand description
Configuration for kernel initialization.
Fields§
§name: StringName of this kernel (for identification).
vfs_mode: VfsMountModeVFS mount mode — controls how local filesystem is exposed.
cwd: PathBufInitial working directory (VFS path).
skip_validation: boolWhether to skip pre-execution validation.
When false (default), scripts are validated before execution to catch errors early. Set to true to skip validation for performance or to allow dynamic/external commands.
interactive: boolWhen true, standalone external commands inherit stdio for real-time output.
Set by script runner and REPL for human-visible output. Not set by MCP server (output must be captured for structured responses).
Implementations§
Source§impl KernelConfig
impl KernelConfig
Sourcepub fn named(name: &str) -> Self
pub fn named(name: &str) -> Self
Create a kernel config with the given name (sandboxed by default).
Sourcepub fn repl() -> Self
pub fn repl() -> Self
Create a REPL config with passthrough filesystem access.
Native paths like /home/user/project work directly.
The cwd is set to the actual current working directory.
Sourcepub fn mcp() -> Self
pub fn mcp() -> Self
Create an MCP server config with sandboxed filesystem access.
Local filesystem is accessible at its real path (e.g., /home/user),
but sandboxed to $HOME. Paths outside the sandbox are not accessible.
Sourcepub fn mcp_with_root(root: PathBuf) -> Self
pub fn mcp_with_root(root: PathBuf) -> Self
Create an MCP server config with a custom sandbox root.
Use this to restrict access to a subdirectory like ~/src.
Sourcepub fn isolated() -> Self
pub fn isolated() -> Self
Create a config with no local filesystem (memory only).
Useful for tests or pure sandboxed execution.
Sourcepub fn with_vfs_mode(self, mode: VfsMountMode) -> Self
pub fn with_vfs_mode(self, mode: VfsMountMode) -> Self
Set the VFS mount mode.
Sourcepub fn with_skip_validation(self, skip: bool) -> Self
pub fn with_skip_validation(self, skip: bool) -> Self
Skip pre-execution validation.
Sourcepub fn with_interactive(self, interactive: bool) -> Self
pub fn with_interactive(self, interactive: bool) -> Self
Enable interactive mode (external commands inherit stdio).
Trait Implementations§
Source§impl Clone for KernelConfig
impl Clone for KernelConfig
Source§fn clone(&self) -> KernelConfig
fn clone(&self) -> KernelConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more