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_binary_index`] — 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//! - [`boot`] — [`BootContext`], the owned profile, secrets, resolved config
24//! and services root the entry crates build once at startup.
25//! - [`services_state`] — [`ServicesState`], the owned services config, its
26//! resolved catalog and the discovery report, built once at boot and handed
27//! to every consumer.
28//! - [`fingerprint`] — a size/mtime fingerprint of a services tree, so the
29//! services watch notices an on-disk change.
30//! - [`error`] — public error types ([`ConfigLoadError`], [`ConfigWriteError`],
31//! [`ExtensionLoadError`]).
32//!
33//! Copyright (c) systemprompt.io — Business Source License 1.1.
34//! See <https://systemprompt.io> for licensing details.
35
36pub mod boot;
37pub mod bundle;
38pub mod config_loader;
39pub mod config_writer;
40pub mod error;
41pub mod extension_binary_index;
42pub mod extension_loader;
43pub mod fingerprint;
44pub mod module_loader;
45pub mod profile_loader;
46pub mod services_state;
47pub mod subprocess;
48pub mod vertex_discovery;
49
50pub use boot::BootContext;
51pub use bundle::{BundleError, BundleResult, ServicesSourceBootstrap};
52pub use config_loader::ConfigLoader;
53pub use config_writer::ConfigWriter;
54pub use error::{
55 ConfigLoadError, ConfigLoadResult, ConfigWriteError, ConfigWriteResult, ExtensionLoadError,
56 ExtensionLoadResult, ProfileLoadError, ProfileLoadResult,
57};
58pub use extension_binary_index::ExtensionBinaryIndex;
59pub use extension_loader::{ExtensionLoader, ExtensionValidationResult};
60pub use fingerprint::tree_fingerprint;
61pub use module_loader::ModuleLoader;
62pub use profile_loader::ProfileLoader;
63pub use services_state::{DiscoveryFuture, ServicesState, catalog_context};