| Crates.io | systemprompt-runtime |
| lib.rs | systemprompt-runtime |
| version | 0.0.11 |
| created_at | 2026-01-21 19:55:35.584368+00 |
| updated_at | 2026-01-25 21:43:21.628125+00 |
| description | Application runtime context and module registry for systemprompt.io |
| homepage | https://systemprompt.io |
| repository | https://github.com/systempromptio/systemprompt-core |
| max_upload_size | |
| id | 2060001 |
| size | 166,118 |
Application runtime context and module registry for systemprompt.io.
Part of the App layer in the systemprompt.io architecture.
Provides centralized access to database connections, configuration, extension services, and startup validation.
This crate is the application-layer orchestrator that:
AppContext - the central runtime state containerinventory macrossrc/
├── lib.rs # Public exports and registration macros
├── context.rs # AppContext builder and runtime state
├── database_context.rs # Standalone database context for CLI tools
├── installation.rs # Module schema and seed installation
├── registry.rs # Module API registry and routing
├── span.rs # Request tracing span construction
├── startup_validation/ # Multi-domain configuration validation
│ ├── mod.rs # StartupValidator orchestration
│ ├── config_loaders.rs # Config file loading utilities
│ ├── display.rs # Validation report rendering
│ ├── extension_validator.rs # Extension validation logic
│ ├── files_validator.rs # FilesConfig domain validator
│ └── mcp_validator.rs # MCP manifest validation
├── validation.rs # Runtime system checks
└── wellknown.rs # Well-known endpoint metadata registry
context.rsPurpose: Central runtime state container providing access to all shared resources.
| Export | Description |
|---|---|
AppContext |
Holds database pool, config, registries, analytics, and GeoIP reader |
AppContextBuilder |
Fluent builder for customized context initialization |
Key behaviors:
ProfileBootstrap and Config::get()ExtensionRegistrydatabase_context.rsPurpose: Lightweight database-only context for CLI tools that don't need full runtime.
| Export | Description |
|---|---|
DatabaseContext |
Minimal context with just a database pool |
installation.rsPurpose: Module installation orchestration for schema and seed data.
| Export | Description |
|---|---|
install_module |
Installs a module using a new AppContext |
install_module_with_db |
Installs a module with an existing database connection |
Delegates to systemprompt-database for actual SQL execution.
registry.rsPurpose: Compile-time module registration and runtime routing.
| Export | Description |
|---|---|
ModuleApiRegistry |
Collects all registered module routes at startup |
ModuleApiRegistration |
Static registration struct submitted via inventory |
ModuleRuntime |
Trait for modules to expose their routes |
WellKnownRoute |
Registration for .well-known endpoints |
span.rsPurpose: Constructs tracing spans from request context.
| Export | Description |
|---|---|
create_request_span |
Builds a RequestSpan with user, session, trace, and context IDs |
startup_validation/Purpose: Multi-domain configuration validation at application startup.
| Export | Description |
|---|---|
StartupValidator |
Orchestrates validation across all domain config validators |
display_validation_report |
Renders validation errors to console |
display_validation_warnings |
Renders validation warnings to console |
Submodules:
config_loaders.rs - YAML config loading with spinner feedbackdisplay.rs - Console rendering for validation reportsextension_validator.rs - Extension config and asset validationfiles_validator.rs - FilesConfigValidator domain implementationmcp_validator.rs - MCP server manifest validationValidates: files, rate limits, web config, content config, agents, MCP servers, AI providers, and extensions.
validation.rsPurpose: Runtime system prerequisite checks.
| Export | Description |
|---|---|
validate_system |
Validates database connection and path |
wellknown.rsPurpose: Metadata registry for .well-known endpoints.
| Export | Description |
|---|---|
WellKnownMetadata |
Static metadata (path, name, description) for discovery |
get_wellknown_metadata |
Retrieves metadata for a given path |
| Macro | Purpose |
|---|---|
register_module_api! |
Register module routes with the runtime registry |
register_wellknown_route! |
Register .well-known endpoints with optional metadata |
use systemprompt_runtime::{register_module_api, ServiceCategory, ModuleType};
register_module_api!(
"my-module",
ServiceCategory::Core,
my_module::routes,
true,
ModuleType::Regular
);
| Crate | Purpose |
|---|---|
systemprompt-database |
Database pool and migrations |
systemprompt-config |
Configuration loading |
systemprompt-models |
Module and config definitions |
systemprompt-logging |
Tracing and CLI output |
systemprompt-extension |
Extension discovery and validation |
systemprompt-analytics |
Analytics service and GeoIP |
inventory |
Compile-time static registration |
Add to your Cargo.toml:
[dependencies]
systemprompt-runtime = "0.0.1"
FSL-1.1-ALv2 - See LICENSE for details.