Skip to main content

Crate kaish_kernel

Crate kaish_kernel 

Source
Expand description

kaish-kernel (核): The core of 会sh.

This crate provides:

  • Lexer: Tokenizes kaish source code using logos
  • Parser: Builds AST from tokens using chumsky
  • AST: Type definitions for the abstract syntax tree
  • Interpreter: Expression evaluation, scopes, and the $? result type
  • VFS: Virtual filesystem with mount points
  • Tools: Tool trait, registry, and builtin commands
  • Scheduler: Pipeline execution and background job management
  • Paths: XDG-compliant path helpers

Re-exports§

pub use backend::LocalBackend;
pub use backend::VirtualOverlayBackend;
pub use dispatch::CommandDispatcher;
pub use dispatch::PipelinePosition;
pub use error::KernelError;
pub use ignore_config::IgnoreConfig;
pub use ignore_config::IgnoreScope;
pub use kernel::Kernel;
pub use kernel::KernelConfig;
pub use kernel::VfsMountMode;
pub use kernel::MAX_RECURSION_DEPTH;
pub use kernel::RECOMMENDED_STACK_SIZE;
pub use output_limit::OutputLimitConfig;
pub use scheduler::BoundedStream;
pub use scheduler::StreamStats;
pub use scheduler::DEFAULT_STREAM_MAX_SIZE;
pub use scheduler::drain_to_stream;
pub use scheduler::pipe_stream;
pub use scheduler::pipe_stream_default;
pub use scheduler::PipeReader;
pub use scheduler::PipeWriter;
pub use scheduler::PIPE_BUFFER_SIZE;
pub use vfs::JobFs;
pub use paths::home_dir;
pub use paths::xdg_cache_home;
pub use paths::xdg_config_home;
pub use paths::xdg_data_home;
pub use paths::xdg_runtime_dir;
pub use interpreter::expand_tilde;
pub use tools::ToolRegistry;
pub use tools::ExecContext;
pub use ast::plan::plan_program;
pub use ast::plan::PlannedStatement;
pub use fragment::expand_fragment;
pub use fragment::FragmentError;
pub use kaish_glob as glob_crate;

Modules§

arithmetic
Arithmetic expression evaluation for shell-style $(( )) expressions.
ast
Abstract Syntax Tree types for kaish.
backend
KernelBackend trait for abstracting kaish’s I/O layer.
dispatch
Command dispatch — the single execution path for all commands.
duration
Duration parsing for shell-style time strings.
error
Public error type for the kernel’s execute surface.
fragment
Expanding one heredoc body against a scope the caller supplies.
glob
Glob pattern matching (re-exported from kaish-glob).
help
Help system for kaish.
ignore_config
Configurable ignore file policy for file-walking tools.
interpreter
Interpreter module for kaish.
kernel
The Kernel (核) — the heart of kaish.
lexer
Lexer for kaish source code.
name
What may spell a variable name.
operation
The kernel’s operation taxonomy — what class of effect a builtin can have.
output_limit
Configurable output size limits for agent safety.
parser
Parser for kaish source code.
paths
XDG Base Directory paths for kaish and embedders.
scheduler
Scheduler module for kaish — pipelines, background jobs, and scatter/gather.
tools
Tool system for kaish.
trash
Trash backend trait and types.
validator
Pre-execution validation for kaish scripts.
vfs
Virtual Filesystem (VFS) for kaish.
walker
Recursive file walking infrastructure (re-exported from kaish-glob).
watchdog
Movable-deadline watchdog for the per-execute timeout.

Structs§

ExecuteOptions
Per-call options for Kernel::execute_with_options.
FragmentAddr
Where one heredoc sits in a planned program: which statement, and which heredoc within it.
Hole
One $(…) inside a fragment: what it would run, as a plan.
PlannedHeredoc
One heredoc a PlannedCommand reads on stdin — the body a command is fed, published as data.
ReadRange
Range specification for partial file reads.
ToolInfo
Information about an available tool.
ToolResult
Result from tool execution via backend.

Enums§

BackendError
Backend operation errors.
CommandKind
The category the kernel resolves a command name into.
Expansion
What expanding a fragment produced.
PatchOp
Generic patch operation for file modifications.
WriteMode
Write mode for file operations.

Traits§

KernelBackend
Abstract backend interface for file operations and tool dispatch.
Tool
A tool that can be executed.

Type Aliases§

BackendResult
Result type for backend operations.