systemprompt-runtime 0.8.0

Application runtime for systemprompt.io AI governance infrastructure. AppContext, lifecycle builder, extension registry, and module wiring for the MCP governance pipeline.
Documentation
//! Module schema/seed installation helpers.
//!
//! These wrap the lower-level installers in `systemprompt-database` and
//! attach an [`AppContext`] when the caller does not already have one.

use crate::AppContext;
use crate::error::RuntimeResult;
use systemprompt_database::{
    DatabaseProvider, install_module_schemas_from_source, install_module_seeds_from_path,
};
use systemprompt_models::modules::Module;

pub async fn install_module(module: &Module) -> RuntimeResult<()> {
    let app_context = AppContext::new().await?;
    install_module_with_db(module, app_context.db_pool().as_ref()).await
}

pub async fn install_module_with_db(
    module: &Module,
    db: &dyn DatabaseProvider,
) -> RuntimeResult<()> {
    install_module_schemas_from_source(module, db).await?;
    install_module_seeds_from_path(module, db).await?;
    Ok(())
}