systemprompt-loader 0.2.2

File and module discovery infrastructure for systemprompt.io AI governance — manifests, schemas, and extension loading. Separates I/O from shared models in the MCP governance pipeline.
Documentation

Production infrastructure for AI agents

Website · Documentation · Guides · Core · Template · Discord


systemprompt-loader

Crates.io Docs.rs License: BSL-1.1

File and module discovery infrastructure for systemprompt.io AI governance — manifests, schemas, and extension loading. Separates I/O from shared models in the MCP governance pipeline. Provides pure I/O operations for loading configuration files, profiles, secrets, extensions, and module definitions without any domain logic.

Layer: Infra — infrastructure primitives (database, security, events, etc.) consumed by domain crates. Part of the systemprompt-core workspace.

Overview

This crate provides pure I/O operations for loading configuration files, profiles, secrets, extensions, and module definitions without any domain logic.

Architecture

The loader crate sits in the infrastructure layer and depends only on systemprompt-models (shared layer). It separates file I/O concerns from business logic, enabling:

  • Testable file operations with clear boundaries
  • Reusable loaders across different entry points (API, CLI)
  • Consistent configuration parsing and validation
src/
├── lib.rs                       # Public API exports
├── config_loader.rs             # Services configuration loader with include merging
├── config_writer.rs             # Agent configuration file writer
├── extension_loader.rs          # Extension manifest discovery and loading
├── extension_registry.rs        # Runtime extension binary registry
├── module_loader.rs             # Module definition aggregator
├── profile_loader.rs            # Profile YAML loader with validation
└── modules/
    └── mod.rs                   # Module collection aggregator

Core Loaders

Module Purpose
ProfileLoader Loads and validates profile YAML files from the profiles directory
ConfigLoader Loads services configuration, merges includes, and validates strict schema
ModuleLoader Aggregates all module definitions for database schema management

Extension Support

Module Purpose
ExtensionLoader Discovers extensions by scanning for manifest.yaml files
ExtensionRegistry Runtime registry mapping binary names to extension metadata
ConfigWriter Creates, updates, and deletes agent configuration files

Module Definitions

The modules/ directory contains definitions for each systemprompt.io module. Each definition specifies:

  • Module metadata (name, version, description)
  • Database schemas with required columns
  • Seed data for initial setup
  • API configuration
  • Module dependencies and load order (weight)

Usage

[dependencies]
systemprompt-loader = "0.2.1"
use systemprompt_loader::{
    ConfigLoader, ProfileLoader,
    ExtensionLoader, ExtensionRegistry, ModuleLoader,
};

let config = ConfigLoader::load()?;

let loader = ConfigLoader::from_env()?;

let profile = ProfileLoader::load_and_validate(services_path, "development")?;

let modules = ModuleLoader::all();

let extensions = ExtensionLoader::discover(project_root);

Dependencies

  • anyhow - Error handling
  • thiserror - Error type definitions
  • serde / serde_yaml / serde_json - Serialization
  • tokio - Async runtime
  • tracing - Logging
  • systemprompt-models - Shared model types

License

BSL-1.1 (Business Source License). Source-available for evaluation, testing, and non-production use. Production use requires a commercial license. Each version converts to Apache 2.0 four years after publication. See LICENSE.


systemprompt.io · Documentation · Guides · Live Demo · Template · crates.io · docs.rs · Discord

Infra layer · Own how your organization uses AI.