Skip to main content

metalcraft_flows/
lib.rs

1//! # metalcraft-flows
2//!
3//! Reference types and helpers for the **Flow** specification — a serializable,
4//! human-authored DAG format for AI agent workflows.
5//!
6//! See [`SPEC.md`](https://github.com/rust4ai/metalcraft-flows/blob/main/SPEC.md)
7//! for the formal wire-format specification.
8//!
9//! ## Modules
10//!
11//! - [`model`] — core types: [`FlowDefinition`], [`FlowNode`], [`FlowEdge`],
12//!   [`SavedFlow`], [`FlowNodeType`], [`CoreNodeType`].
13//! - [`walk`] — generic BFS traversal over a [`FlowDefinition`].
14//! - [`validate`] — spec conformance checks.
15//! - [`store`] — directory-backed CRUD (enabled by the default `fs` feature).
16//! - [`log`] — flow execution log entries (enabled by the `log` feature).
17
18#![deny(missing_docs)]
19#![cfg_attr(docsrs, feature(doc_cfg))]
20
21pub mod model;
22pub mod walk;
23pub mod validate;
24
25#[cfg(feature = "fs")]
26#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
27pub mod store;
28
29#[cfg(feature = "log")]
30#[cfg_attr(docsrs, doc(cfg(feature = "log")))]
31pub mod log;
32
33pub use model::{
34    CoreNodeType, FlowDefinition, FlowEdge, FlowNode, FlowNodeType, FlowSummary, SavedFlow,
35    SPEC_VERSION,
36};
37pub use validate::{validate, ValidationError};
38pub use walk::walk_bfs;
39
40#[cfg(feature = "fs")]
41pub use store::{delete_flow, list_flows, load_flow, save_flow};
42
43#[cfg(feature = "log")]
44pub use log::{append_flow_log, load_flow_logs, FlowLogEntry};