Skip to main content

Crate bnto_core

Crate bnto_core 

Source

Re-exports§

pub use context::NoopContext;
pub use context::ProcessContext;
pub use definition::Definition;
pub use definition::Edge;
pub use definition::Metadata;
pub use definition::Port;
pub use definition::Position;
pub use definition_schema::definition_json_schema;
pub use editor::EditorError;
pub use editor::EditorModel;
pub use editor::EditorNode;
pub use editor::EditorSnapshot;
pub use editor::EditorSource;
pub use errors::BntoError;
pub use events::PipelineEvent;
pub use events::PipelineReporter;
pub use executor::execute_pipeline;
pub use executor::template::build_input_metadata;
pub use executor::template::build_node_outputs_for_input;
pub use executor::template::resolve_ctx_templates;
pub use executor::template::resolve_node_templates;
pub use field_def::FieldDef;
pub use field_def::FieldDefs;
pub use field_def::FieldOption;
pub use file_data::FileData;
pub use logging::LogEntry;
pub use logging::LogLevel;
pub use logging::Logger;
pub use logging::NoopLogger;
pub use metadata::Constraints;
pub use metadata::Dependency;
pub use metadata::InputCardinality;
pub use metadata::NodeCategory;
pub use metadata::NodeMetadata;
pub use metadata::NodeTypeInfo;
pub use metadata::ParamCondition;
pub use metadata::ParamConditionEntry;
pub use metadata::ParameterDef;
pub use metadata::ParameterType;
pub use metadata::all_node_types;
pub use metadata::io_container::io_container_param_defs;
pub use metadata::node_type_params;
pub use pipeline::InputMode;
pub use pipeline::IterationMode;
pub use pipeline::PipelineDefinition;
pub use pipeline::PipelineFile;
pub use pipeline::PipelineFileResult;
pub use pipeline::PipelineNode;
pub use pipeline::PipelineResult;
pub use pipeline::PipelineSettings;
pub use pipeline::first_processing_node_id;
pub use pipeline::resolve_input_mode;
pub use pipeline::resolve_output_directory;
pub use pipeline::resolve_output_mode;
pub use processor::BatchFile;
pub use processor::BatchInput;
pub use processor::NodeProcessor;
pub use progress::ProgressReporter;
pub use registry::NodeRegistry;
pub use secrets::SecretDef;
pub use version::VersionCheckResult;
pub use version::VersionConstraint;
pub use version::check_version;

Modules§

case
Centralized string case/formatting — lower, upper, title, slug, deslug, etc. The Rust equivalent of JS’s change-case library.
context
Controlled system access for processors that need external tools. Browser gets NoopContext, CLI gets NativeContext, desktop gets SandboxedContext.
definition
Document-shape types for .bnto.json files — the authoring view. Mirrors the TypeScript Definition types and round-trips every real recipe fixture. Distinct from pipeline (the execution-pruned view).
definition_schema
Definition JSON Schema — validates .bnto.json files. Generates a JSON Schema (Draft 2020-12) describing the Definition structure so any consumer can validate recipe files without reimplementing TS types.
dotenv
Simple dotenv parser — loads KEY=VALUE pairs from .env files. No crate dependency, handles comments, quotes, and export prefix.
editor
Editor state model — pure-data recipe editing state. Shared by all editor surfaces (TUI List, Wizard, Code, Graph). No TUI dependency. Sprint 15 extracts to standalone bnto-editor crate.
errors
Error types for the WASM engine. Every error that can happen during node execution is defined here.
events
Structured pipeline events — rich progress reporting for multi-node execution. Powers per-node status highlighting in the editor, progress bars, and error display.
executor
The pipeline executor — walks nodes, iterates files, chains outputs. This is the engine’s brain. See .claude/strategy/engine-execution.md.
field_def
Node-level field declarations — typed user-facing controls for nodes. Field values are substituted into {{fields.*}} templates at execution time.
file_data
File content abstraction — in-memory bytes or on-disk path reference. Large files (shell-command outputs) stay on disk as path references to avoid reading multi-GB files into memory.
logging
Engine-level logging — trait + types for structured diagnostics. Browser gets NoopLogger, CLI gets FileLogger.
metadata
Node metadata types — self-describing processor definitions. Each processor declares its name, category, parameters, accepted MIME types, and whether it runs in the browser. Powers the node_catalog() WASM export.
pipeline
Pipeline definition types — what the engine receives to execute. Mirrors the TypeScript PipelineDefinition / PipelineNode types.
processor
The NodeProcessor trait — the contract every node type must implement. If you’re building a new node (like image compression), you implement this.
progress
Progress reporting — how nodes tell the UI “I’m 50% done”. Uses target-agnostic closures (no WASM dependency).
registry
Node registry — maps node type keys (e.g., “image-compress”) to processors. Replaces the JS-side wasmLoader.ts registry.
secrets
Secret declarations for recipes — pre-flight validation of required env vars. Recipes declare what secrets they need; the engine validates before execution.
version
Version constraint checking for external dependencies. Parses --version output, extracts version numbers, validates against constraint strings like ">=6.0". Version constraint checking for external dependencies.

Constants§

DEFAULT_QUALITY
Default quality when not specified by the user (1-100 scale). 80 is the industry sweet spot: significant file size savings with barely noticeable quality loss for most photos. Used by all image operations (compress, resize, convert).
FORMAT_VERSION
The current .bnto.json format version.

Functions§

version
Returns the version of the bnto-core crate.