Skip to main content

sim_lib_cookbook/
lib.rs

1//! Runtime `cookbook:` operations for SIM.
2//!
3//! This lib exposes the [`sim_cookbook`] engine as registered runtime
4//! operations over a shared recipe store: `cookbook:books|chapters|list|show|
5//! setup|search|next|reload` (ungated), `cookbook:run` (read-eval gated,
6//! decodes a recipe's setup through its codec, evaluates it, and checks
7//! declared expectations), and `cookbook:load-lib|unload-lib` lifecycle
8//! wrappers over a host-owned loadable-lib directory.
9//!
10//! The engine stays in `sim-cookbook` (kernel-free); this crate holds the
11//! kernel integration so the boundary stays clean. CLI, WebUI, browse/help,
12//! and agent cookbook surfaces should call these operations or the same seeded
13//! store helpers instead of creating a second projection path.
14
15#![forbid(unsafe_code)]
16#![deny(missing_docs)]
17
18mod build;
19mod catalog;
20mod cli;
21mod config;
22#[cfg(test)]
23mod config_tests;
24mod loadable;
25#[cfg(test)]
26mod loadable_tests;
27mod ops;
28mod run;
29mod runtime;
30#[cfg(feature = "seed-recipes")]
31mod seed_catalog;
32#[cfg(feature = "seed-recipes")]
33mod seeds;
34
35pub use catalog::{CookbookCapabilityProfile, EmptyCatalog, LibCatalog, load_requires};
36pub use config::{
37    ConfigCookbookProvider, ConfigProvider, CookbookConfig, CookbookOverrides, LoadableLibConfig,
38    LoadableLibResolver, ResolvedLoadable, apply_overrides, built_in_config,
39    cookbook_config_from_effective, cookbook_config_from_effective_with_base, cookbook_lib_symbol,
40    cookbook_overrides_from_effective,
41};
42pub use loadable::{
43    LibFactory, LifecycleAction, LoadableLibEntry, LoadableLibList, lifecycle_action,
44    projected_recipe_store, run_lifecycle_action, run_recipe_with_loadable_libs,
45};
46pub use ops::{CookbookLifecycleOp, CookbookOp, OpKind};
47pub use run::{
48    decode_setup, missing_requires, require_eval_capability, run_recipe, run_recipe_twice,
49    run_recipe_with_catalog,
50};
51pub use runtime::{
52    CookbookLib, CookbookStoreHandle, install_cookbook_lib,
53    install_cookbook_lib_with_loadable_libs, manifest_name, op_exports, store_symbol,
54};
55#[cfg(feature = "seed-recipes")]
56pub use seed_catalog::{BuiltInLoadableResolver, SeededLibCatalog};
57#[cfg(feature = "seed-recipes")]
58pub use seeds::{SEEDED_RECIPE_BOOKS, install_seeded_cookbook_lib, seeded_recipe_store};
59
60/// Cookbook recipes for this lib, embedded at build time.
61pub static RECIPES: sim_cookbook::EmbeddedDir =
62    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
63
64#[cfg(test)]
65mod tests;