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//! - [`bundle`] — signed services bundles: fetch, verify, compose, and the boot
19//! path that installs the active services root.
20//! - [`vertex_discovery`] — boot-time catalog discovery: each provider's
21//! credential decides which `CatalogSource` may list it, and every priced,
22//! serverless model it returns is folded into the provider registry.
23//! - [`services_root`] — the process-wide cell naming the services root the
24//! instance actually runs, with its provenance.
25//! - [`services_bootstrap`] — the process-wide cell holding the loaded services
26//! config (provider catalog and gateway included), initialised right after
27//! the profile at boot.
28//! - [`error`] — public error types ([`ConfigLoadError`], [`ConfigWriteError`],
29//! [`ExtensionLoadError`]).
30//!
31//! # Feature flags
32//!
33//! - `expose-internals` — exposes test-only entry points (notably
34//! `ConfigLoader::load_from_content`) to dependent crates that exercise the
35//! loader from outside `cfg(test)`. Off by default.
36//!
37//! Copyright (c) systemprompt.io — Business Source License 1.1.
38//! See <https://systemprompt.io> for licensing details.
39
40pub mod bundle;
41pub mod config_loader;
42pub mod config_writer;
43pub mod error;
44pub mod extension_loader;
45pub mod extension_registry;
46pub mod module_loader;
47pub mod profile_loader;
48pub mod services_bootstrap;
49pub mod services_root;
50pub mod vertex_discovery;
51
52pub use bundle::{BundleError, BundleResult, ServicesSourceBootstrap};
53pub use config_loader::ConfigLoader;
54pub use config_writer::ConfigWriter;
55pub use error::{
56 ConfigLoadError, ConfigLoadResult, ConfigWriteError, ConfigWriteResult, ExtensionLoadError,
57 ExtensionLoadResult, ProfileLoadError, ProfileLoadResult,
58};
59pub use extension_loader::{ExtensionLoader, ExtensionValidationResult};
60pub use extension_registry::ExtensionRegistry;
61pub use module_loader::ModuleLoader;
62pub use profile_loader::ProfileLoader;
63pub use services_bootstrap::ServicesBootstrap;
64pub use services_root::{ActiveServicesRoot, ServicesProvenance, ServicesRootBootstrap};