Skip to main content

Module backend

Module backend 

Source
Expand description

KernelBackend trait for abstracting kaish’s I/O layer.

This module defines the KernelBackend trait which provides a unified interface for file operations and tool dispatch. Two implementations are provided:

  • LocalBackend: Default implementation wrapping VfsRouter for local filesystem access
  • (Future) KaijutsuBackend: CRDT-backed blocks when running under kaijutsu

§Architecture

Builtins (cat, ls, echo, etc.)
    ↓
ctx.backend: Arc<dyn KernelBackend>
    ↓
┌─────────────────────────────────────────────┐
│  LocalBackend (default)  │  KaijutsuBackend │
│  - wraps VfsRouter       │  - CRDT blocks   │
│  - local ToolRegistry    │  - parent tools  │
└─────────────────────────────────────────────┘

Structs§

ConflictError
Error when CAS (compare-and-set) check fails during patching.
LocalBackend
Local backend implementation using VfsRouter and ToolRegistry.
ReadRange
Range specification for partial file reads.
ToolInfo
Information about an available tool.
ToolResult
Result from tool execution via backend.
VirtualOverlayBackend
Backend that overlays virtual paths (/v/*) on top of a custom backend.

Enums§

BackendError
Backend operation errors.
PatchOp
Generic patch operation for file modifications.
WriteMode
Write mode for file operations.

Traits§

KernelBackend
Abstract backend interface for file operations and tool dispatch.

Type Aliases§

BackendResult
Result type for backend operations.