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 moreSource§impl Debug for KernelConfig
impl Debug for KernelConfig
Auto Trait Implementations§
impl Freeze for KernelConfig
impl RefUnwindSafe for KernelConfig
impl Send for KernelConfig
impl Sync for KernelConfig
impl Unpin for KernelConfig
impl UnwindSafe for KernelConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more