Skip to main content

systemprompt_loader/
lib.rs

1//! File and module discovery infrastructure for systemprompt.io.
2//!
3//! Reads the active services-config (with include resolution and
4//! deduplication), loads profile YAML, writes agent files, and discovers
5//! extension manifests under `extensions/`. Sits one level above
6//! [`systemprompt_config`] in the dependency graph so that domain crates
7//! never need to know how the on-disk layout is structured.
8//!
9//! # Modules
10//!
11//! - [`config_loader`] — loads and merges `services.yaml` and its includes.
12//! - [`config_writer`] — creates, edits, and deletes agent files.
13//! - [`extension_loader`] / [`extension_registry`] — discover extension
14//!   manifests and resolve binary paths.
15//! - [`module_loader`] — `inventory`-driven extension discovery for the
16//!   compiled-in extension trait registry.
17//! - [`profile_loader`] — reads, validates, and writes profile YAML.
18//! - [`services_bootstrap`] — the process-wide cell holding the loaded services
19//!   config (provider catalog and gateway included), initialised right after
20//!   the profile at boot.
21//! - [`error`] — public error types ([`ConfigLoadError`], [`ConfigWriteError`],
22//!   [`ExtensionLoadError`]).
23//!
24//! # Feature flags
25//!
26//! - `expose-internals` — exposes test-only entry points (notably
27//!   `ConfigLoader::load_from_content`) to dependent crates that exercise the
28//!   loader from outside `cfg(test)`. Off by default.
29//!
30//! Copyright (c) systemprompt.io — Business Source License 1.1.
31//! See <https://systemprompt.io> for licensing details.
32
33pub mod config_loader;
34pub mod config_writer;
35pub mod error;
36pub mod extension_loader;
37pub mod extension_registry;
38pub mod module_loader;
39pub mod profile_loader;
40pub mod services_bootstrap;
41
42pub use config_loader::ConfigLoader;
43pub use config_writer::ConfigWriter;
44pub use error::{
45    ConfigLoadError, ConfigLoadResult, ConfigWriteError, ConfigWriteResult, ExtensionLoadError,
46    ExtensionLoadResult, ProfileLoadError, ProfileLoadResult,
47};
48pub use extension_loader::{ExtensionLoader, ExtensionValidationResult};
49pub use extension_registry::ExtensionRegistry;
50pub use module_loader::ModuleLoader;
51pub use profile_loader::ProfileLoader;
52pub use services_bootstrap::ServicesBootstrap;