BigSaltyMan/cuesmith/modsys does not have a README file

    FsError

    pub(all) enum FsError {
    NotFound(String)
    TooLarge(Int, Int)
    InvalidUtf8(String)
    SymlinkRejected(String)
    PathEscape(String)
    IoFailure(String)
    } derive(Eq,
    Debug
    )

    Low-level filesystem error reported by ModuleFs callbacks.

    FsPathKind

    pub(all) enum FsPathKind {
    Missing
    File
    Dir
    SymlinkOrSpecial
    } derive(Eq,
    Debug
    )

    Kind of filesystem entry reported by ModuleFs::path_kind.

    LoadedFile

    pub(all) struct LoadedFile {
    path : String
    source : String
    ast :
    File

    } derive(Eq,
    Debug
    )

    A loaded and parsed .cue source file belonging to a package.

    LoadedPackage

    pub(all) struct LoadedPackage {
    import_path : String?
    dir : String
    pkg_name : String
    files : Array[LoadedFile]
    } derive(Eq,
    Debug
    )

    A resolved CUE package and its loaded source files.

    MemoryFs

    pub struct MemoryFs {
    // private fields
    }

    In-memory filesystem for deterministic, sandboxed module resolution tests.

    MemoryFs::add_dir

    fn MemoryFs::add_dir(self : MemoryFs, path : String) -> Unit

    Adds a directory at path, creating all parent directories.

    MemoryFs::add_file

    fn MemoryFs::add_file(self : MemoryFs, path : String, content : String) -> Unit

    Adds or overwrites a file at path with content, creating parent dirs.
    fn MemoryFs::add_symlink(self : MemoryFs, path : String) -> Unit

    Registers a symlink entry at path (rejected fail-closed on access).

    MemoryFs::from_files

    fn MemoryFs::from_files(files : Array[(String, String)]) -> MemoryFs

    Constructs a MemoryFs populated with (path, content) pairs.

    MemoryFs::new

    fn MemoryFs::new() -> MemoryFs

    Creates an empty MemoryFs.

    MemoryFs::to_module_fs

    fn MemoryFs::to_module_fs(self : MemoryFs) -> ModuleFs

    Adapts self into a fail-closed ModuleFs.

    ModError

    pub(all) struct ModError {
    kind : ModErrorKind
    path : String
    message : String
    span :
    Span
    ?
    } derive(Eq,
    Debug
    )

    Structured module system diagnostic.

    ModError::format

    fn ModError::format(self : ModError) -> String

    Formats self as a human-readable diagnostic string.

    ModError::to_cue_error

    Converts self into an @eval.CueError.

    ModErrorKind

    pub(all) enum ModErrorKind {
    InvalidPath
    PathEscape
    SymlinkRejected
    InvalidManifest
    PackageNotFound
    AmbiguousPackage
    EmptyPackage
    PackageMismatch
    InvalidImport
    ImportCycle
    ParseError
    EvalError
    ResourceLimit
    IoError
    } derive(Eq,
    Debug
    )

    Diagnostic category for module discovery, import resolution, and evaluation errors.

    ModLimits

    pub(all) struct ModLimits {
    max_files : Int
    max_packages : Int
    max_import_depth : Int
    max_dir_entries : Int
    eval_limits :
    EvalLimits

    } derive(Eq,
    Debug
    )

    Resource limits governing module discovery, directory traversal, and evaluation.

    ModLimits::default

    fn ModLimits::default() -> ModLimits

    Returns the default ModLimits.

    ModuleFs

    pub(all) struct ModuleFs {
    read_file : (String, Int) -> Result[String, FsError]
    list_dir : (String, Int) -> Result[Array[String], FsError]
    path_kind : (String) -> Result[FsPathKind, FsError]
    }

    Abstract, fail-closed filesystem interface used by the module system.

    ModuleManifest

    pub(all) struct ModuleManifest {
    root_dir : String
    raw_module : String
    import_prefix : String
    major_version : String?
    language_version : String?
    } derive(Eq,
    Debug
    )

    Parsed cue.mod/module.cue manifest metadata.

    PackageDepGraph

    pub(all) struct PackageDepGraph {
    module_name : String?
    root_id : String
    nodes : Array[PackageGraphNode]
    edges : Array[PackageGraphEdge]
    } derive(Eq,
    Debug
    )

    Resolved, deduplicated, and deterministically ordered package dependency graph.

    PackageGraphEdge

    pub(all) struct PackageGraphEdge {
    from : String
    to : String
    is_stdlib : Bool
    } derive(Eq,
    Debug
    )

    A directed dependency edge (from imports to) in a CUE package dependency graph.

    PackageGraphNode

    pub(all) struct PackageGraphNode {
    id : String
    label : String
    pkg_name : String
    is_root : Bool
    is_stdlib : Bool
    file_count : Int
    } derive(Eq,
    Debug
    )

    A node in a resolved CUE package dependency graph.

    ResolvedPackageGraph

    pub(all) struct ResolvedPackageGraph {
    manifest : ModuleManifest?
    root : LoadedPackage
    deps : Array[
    PackageUnit
    ]
    } derive(Eq,
    Debug
    )

    Result of resolving a target package and its topological dependencies.

    DEFAULT_MAX_DIR_ENTRIES

    let DEFAULT_MAX_DIR_ENTRIES : Int

    DEFAULT_MAX_IMPORT_DEPTH

    let DEFAULT_MAX_IMPORT_DEPTH : Int

    DEFAULT_MAX_MOD_FILES

    let DEFAULT_MAX_MOD_FILES : Int

    DEFAULT_MAX_PACKAGES

    let DEFAULT_MAX_PACKAGES : Int

    build_dep_graph

    fn build_dep_graph(graph : ResolvedPackageGraph, include_stdlib? : Bool) -> PackageDepGraph

    Builds a deduplicated, deterministically sorted PackageDepGraph from a resolved CUE package graph.

    eval_package

    fn eval_package(fs : ModuleFs, target_dir : String, pkg_name? : String, expr? :
    Expr
    , cwd? : String, limits? : ModLimits) -> Result[
    Value
    , Array[ModError]]

    Resolves and evaluates a CUE package using the default CueSmith stdlib configuration.

    eval_package_with_config

    fn eval_package_with_config(fs : ModuleFs, target_dir : String, config :
    EvalConfig
    , pkg_name? : String, expr? :
    Expr
    , cwd? : String, limits? : ModLimits) -> Result[
    Value
    , Array[ModError]]

    Resolves and evaluates a CUE package using a caller-supplied @eval.EvalConfig.

    find_module_root

    fn find_module_root(fs : ModuleFs, start_dir : String) -> Result[String?, ModError]

    Walks upward from start_dir to locate the enclosing module root containing cue.mod/module.cue, failing closed on any symlink along the path.

    format_graph_dot

    fn format_graph_dot(graph : PackageDepGraph) -> String

    Formats a PackageDepGraph as a Graphviz DOT digraph cuesmith_deps.

    format_graph_dot_bounded

    fn format_graph_dot_bounded(graph : PackageDepGraph, max_output_bytes : Int) -> Result[String,
    LimitError
    ]

    Formats a PackageDepGraph as a Graphviz DOT digraph cuesmith_deps while enforcing max_output_bytes.

    format_graph_json

    fn format_graph_json(graph : PackageDepGraph, indent? : Int) -> String

    Formats a PackageDepGraph as strict RFC 8259 JSON.

    format_graph_json_bounded

    fn format_graph_json_bounded(graph : PackageDepGraph, max_output_bytes : Int, indent? : Int) -> Result[String,
    LimitError
    ]

    Formats a PackageDepGraph as strict RFC 8259 JSON while enforcing max_output_bytes.

    format_graph_mermaid

    fn format_graph_mermaid(graph : PackageDepGraph) -> String

    Formats a PackageDepGraph as a Mermaid graph TD flowchart.

    format_graph_mermaid_bounded

    fn format_graph_mermaid_bounded(graph : PackageDepGraph, max_output_bytes : Int) -> Result[String,
    LimitError
    ]

    Formats a PackageDepGraph as a Mermaid graph TD flowchart while enforcing max_output_bytes.

    is_stdlib_import

    fn is_stdlib_import(path : String) -> Bool

    Returns true iff path is one of the 14 built-in CUE standard library packages.

    load_module_manifest

    fn load_module_manifest(fs : ModuleFs, start_dir : String, limits? : ModLimits) -> Result[ModuleManifest?, ModError]

    Finds the enclosing module root from start_dir and loads cue.mod/module.cue.

    parse_module_manifest

    fn parse_module_manifest(source : String, root_dir? : String, limits? :
    EvalLimits
    ) -> Result[ModuleManifest, ModError]

    Parses and validates a cue.mod/module.cue manifest source.

    parse_package_target

    fn parse_package_target(raw : String) -> Result[(String, String?), ModError]

    Splits an optional :pkg qualifier from a package directory target without breaking Windows drive-letter colons (C:\foo or C:/foo).

    resolve_files_imports

    fn resolve_files_imports(fs : ModuleFs, file_paths : Array[String], parsed_files : Array[
    File
    ], cwd? : String, limits? : ModLimits) -> Result[Array[
    PackageUnit
    ], Array[ModError]]

    Resolves all package imports across pre-parsed parsed_files, returning Ok([]) with zero filesystem calls when all imports are standard library packages.

    resolve_package

    fn resolve_package(fs : ModuleFs, target_dir : String, pkg_name? : String, cwd? : String, limits? : ModLimits) -> Result[ResolvedPackageGraph, Array[ModError]]

    Resolves target_dir (and optional pkg_name) into a ResolvedPackageGraph with dependencies ordered topologically.