1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! **forge** — 4-tier code generation engine for the tsx Framework Protocol.
//!
//! ## Overview
//!
//! `forge` is built on [Tera](https://keats.github.io/tera/) and extends it with:
//!
//! - **4-tier template hierarchy** — `Atom → Molecule → Layout → Feature`
//! (classified automatically from template paths)
//! - **Import hoisting** — templates call `{{ "import x from 'x'" | collect_import }}`
//! and `{{ render_imports() }}` at the top of the file to emit a deduplicated import block.
//! - **Token-budget metadata** — knowledge `.md` files carry `token_estimate` in frontmatter
//! so agents can request exactly as much context as they need.
//! - **Framework package loading** — load templates from disk, embedded bytes, or npm packages.
//!
//! ## Quick Start
//!
//! ```rust
//! use forge::{Engine, ForgeContext};
//!
//! let mut engine = Engine::new();
//! engine.add_raw("hello.jinja", "Hello {{ name | pascal_case }}!").unwrap();
//!
//! let ctx = ForgeContext::new().insert("name", "world");
//! let out = engine.render("hello.jinja", &ctx).unwrap();
//! assert_eq!(out, "Hello World!");
//! ```
pub use ForgeContext;
pub use Engine;
pub use ForgeError;
pub use ;
pub use Tier;