Skip to main content

Crate systemprompt_models

Crate systemprompt_models 

Source
Expand description

Foundation data models for systemprompt.io.

systemprompt-models is the shared shared/* crate that every other layer (infra, domain, app, entry) depends on for the plain DTO and configuration shapes that flow across the system. It owns the wire types of the public HTTP API, the on-disk profile and services configuration, the A2A and AG-UI protocol shapes, the MCP metadata helpers, and the typed error enums returned by every public function in this crate.

§Module map

  • a2a — A2A protocol agent card, message, task, and transport types.
  • agui — AG-UI streaming event protocol.
  • ai — LLM request/response shapes plus the ai::AiProvider trait.
  • api — public HTTP envelopes, error model, pagination, cloud DTOs.
  • artifacts — typed tool-result artifacts.
  • auth — authenticated user, permission, audience, and PKCE types.
  • config — global config::Config singleton and validation helpers.
  • content, content_config — published content metadata.
  • errorsthiserror-derived public error enums.
  • events — analytics, A2A and system event envelopes.
  • execution — request context and execution-step bookkeeping.
  • extension — extension framework manifest types.
  • mcp — MCP protocol metadata helpers.
  • modules — module manifest tree resolution.
  • oauth — OAuth client / server config shapes.
  • paths — well-known directory layout helpers.
  • profile — on-disk profile and bootstrap configuration.
  • repository — repository lifecycle traits and value objects.
  • routing — request routing classification.
  • secrets — secrets document model.
  • services — services manifest (agents, plugins, hooks, MCP, …).
  • users — public user / session summaries.
  • validators — startup configuration validation passes.

§Feature flags

FeatureEffect
defaultAll public DTOs and traits, no axum integration.
webAdds axum::IntoResponse impls for the API envelopes.

Public functions return thiserror-derived enums from errors; anyhow::Error is never used in a public signature.

Re-exports§

pub use a2a::AgentAuthentication;
pub use a2a::AgentCapabilities;
pub use a2a::AgentCard;
pub use a2a::AgentCardBuilder;
pub use a2a::AgentCardSignature;
pub use a2a::AgentExtension;
pub use a2a::AgentInterface;
pub use a2a::AgentProvider;
pub use a2a::AgentSkill;
pub use a2a::ApiKeyLocation;
pub use a2a::Artifact as A2aArtifact;
pub use a2a::ArtifactMetadata;
pub use a2a::ArtifactSummary;
pub use a2a::DataPart;
pub use a2a::FileContent;
pub use a2a::FilePart;
pub use a2a::McpServerMetadata;
pub use a2a::McpToolsParams;
pub use a2a::Message;
pub use a2a::MessageMetadata as A2aMessageMetadata;
pub use a2a::MessageRole as A2aMessageRole;
pub use a2a::OAuth2Flow;
pub use a2a::OAuth2Flows;
pub use a2a::Part;
pub use a2a::ProtocolBinding;
pub use a2a::SecurityScheme;
pub use a2a::Task;
pub use a2a::TaskMetadata;
pub use a2a::TaskState;
pub use a2a::TaskStatus;
pub use a2a::TextPart;
pub use a2a::TransportProtocol;
pub use admin::ActivityTrend;
pub use admin::AnalyticsData as AdminAnalyticsData;
pub use admin::BotTrafficStats;
pub use admin::BrowserBreakdown;
pub use admin::ContentStat;
pub use admin::DeviceBreakdown;
pub use admin::GeographicBreakdown;
pub use admin::LogEntry as AdminLogEntry;
pub use admin::LogLevel as AdminLogLevel;
pub use admin::RecentConversation;
pub use admin::TrafficData as AdminTrafficData;
pub use admin::UserInfo;
pub use admin::UserMetricsWithTrends;
pub use agui::AgUiEvent;
pub use agui::AgUiEventBuilder;
pub use agui::AgUiEventType;
pub use agui::CustomPayload;
pub use agui::GenericCustomPayload;
pub use agui::JsonPatchOperation;
pub use agui::MessageRole as AgUiMessageRole;
pub use agui::MessagesSnapshotPayload;
pub use agui::RunErrorPayload;
pub use agui::RunFinishedPayload;
pub use agui::RunStartedPayload;
pub use agui::StateDeltaBuilder;
pub use agui::StateDeltaPayload;
pub use agui::StateSnapshotPayload;
pub use agui::StepFinishedPayload;
pub use agui::StepStartedPayload;
pub use agui::TextMessageContentPayload;
pub use agui::TextMessageEndPayload;
pub use agui::TextMessageStartPayload;
pub use agui::ToolCallArgsPayload;
pub use agui::ToolCallEndPayload;
pub use agui::ToolCallResultPayload;
pub use agui::ToolCallStartPayload;
pub use ai::AiContentPart;
pub use ai::AiMessage;
pub use ai::AiProvider;
pub use ai::AiRequest;
pub use ai::AiRequestBuilder;
pub use ai::AiResponse;
pub use ai::DynAiProvider;
pub use ai::McpTool;
pub use ai::MessageRole;
pub use ai::ModelConfig;
pub use ai::ModelHint;
pub use ai::ModelPreferences;
pub use ai::ProviderConfig;
pub use ai::ResponseFormat;
pub use ai::SUPPORTED_AUDIO_TYPES;
pub use ai::SUPPORTED_IMAGE_TYPES;
pub use ai::SUPPORTED_TEXT_TYPES;
pub use ai::SUPPORTED_VIDEO_TYPES;
pub use ai::SamplingParams;
pub use ai::SearchGroundedResponse;
pub use ai::StreamChunk;
pub use ai::StructuredOutputOptions;
pub use ai::ToolCall;
pub use ai::ToolExecution;
pub use ai::ToolResultFormatter;
pub use ai::is_supported_audio;
pub use ai::is_supported_image;
pub use ai::is_supported_media;
pub use ai::is_supported_text;
pub use ai::is_supported_video;
pub use api::AcceptedResponse;
pub use api::ApiError;
pub use api::ApiErrorExt;
pub use api::ApiQuery;
pub use api::ApiResponse;
pub use api::CheckoutEvent;
pub use api::CheckoutRequest;
pub use api::CheckoutResponse;
pub use api::CloudApiError;
pub use api::CloudApiErrorDetail;
pub use api::CloudApiResponse;
pub use api::CloudCustomerInfo;
pub use api::CloudListResponse;
pub use api::CloudLogEntry;
pub use api::CloudLogsResponse;
pub use api::CloudPlan;
pub use api::CloudPlanInfo;
pub use api::CloudStatusResponse;
pub use api::CloudTenant;
pub use api::CloudTenantInfo;
pub use api::CloudTenantSecrets;
pub use api::CloudTenantStatus;
pub use api::CloudTenantStatusResponse;
pub use api::CloudUserInfo;
pub use api::CollectionResponse;
pub use api::CreateContextRequest;
pub use api::CreatedResponse;
pub use api::DeployResponse;
pub use api::DiscoveryResponse;
pub use api::ErrorCode;
pub use api::ErrorResponse;
pub use api::ExternalDbAccessResponse;
pub use api::ModuleInfo;
pub use api::PaginationInfo;
pub use api::PaginationParams;
pub use api::ProvisioningEvent;
pub use api::ProvisioningEventType;
pub use api::RegistryToken;
pub use api::ResponseMeta;
pub use api::SearchQuery;
pub use api::SetExternalDbAccessRequest;
pub use api::SetSecretsRequest;
pub use api::SingleResponse;
pub use api::SortOrder;
pub use api::SortParams;
pub use api::SubscriptionStatus;
pub use api::SuccessResponse;
pub use api::UpdateContextRequest;
pub use api::UserContext;
pub use api::UserContextWithStats;
pub use api::UserMeResponse;
pub use api::ValidationError;
pub use artifacts::Alignment;
pub use artifacts::Artifact;
pub use artifacts::ArtifactSchema;
pub use artifacts::ArtifactType;
pub use artifacts::AudioArtifact;
pub use artifacts::AxisType;
pub use artifacts::ChartArtifact;
pub use artifacts::ChartDataset;
pub use artifacts::ChartType;
pub use artifacts::CliArtifact;
pub use artifacts::CliArtifactType;
pub use artifacts::Column;
pub use artifacts::ColumnType;
pub use artifacts::CommandResultRaw;
pub use artifacts::ConversionError;
pub use artifacts::ExecutionMetadata;
pub use artifacts::ImageArtifact;
pub use artifacts::RenderingHints;
pub use artifacts::SortOrder as ArtifactSortOrder;
pub use artifacts::TableArtifact;
pub use artifacts::TableHints;
pub use artifacts::ToolResponse;
pub use artifacts::VideoArtifact;
pub use auth::AuthError;
pub use auth::AuthenticatedUser;
pub use auth::BEARER_PREFIX;
pub use auth::BaseRole;
pub use auth::BaseRoles;
pub use auth::GrantType;
pub use auth::PkceMethod;
pub use auth::ResponseType;
pub use config::Config;
pub use config::PathNotConfiguredError;
pub use content::IngestionReport;
pub use content_config::ArticleDefaults;
pub use content_config::Category;
pub use content_config::ContentConfigError;
pub use content_config::ContentConfigErrors;
pub use content_config::ContentConfigRaw;
pub use content_config::ContentRouting;
pub use content_config::ContentSourceConfigRaw;
pub use content_config::IndexingConfig;
pub use content_config::Metadata;
pub use content_config::OrganizationData;
pub use content_config::ParentRoute;
pub use content_config::SitemapConfig;
pub use content_config::SourceBranding;
pub use content_config::StructuredData;
pub use errors::CoreError;
pub use errors::ServiceError;
pub use events::A2AEvent;
pub use events::A2AEventBuilder;
pub use events::A2AEventType;
pub use events::AnalyticsEvent;
pub use events::AnalyticsEventBuilder;
pub use events::ContextEvent;
pub use events::ContextSummary;
pub use events::SystemEvent;
pub use events::SystemEventBuilder;
pub use events::SystemEventType;
pub use execution::ExecutionStep;
pub use execution::PlannedTool;
pub use execution::RequestContext;
pub use execution::StepContent;
pub use execution::StepId;
pub use execution::StepStatus;
pub use execution::StepType;
pub use execution::TrackedStep;
pub use extension::BuildType;
pub use extension::DiscoveredExtension;
pub use extension::Extension;
pub use extension::ExtensionManifest;
pub use extension::ExtensionType;
pub use extension::ManifestRole;
pub use mcp::Deployment;
pub use mcp::DeploymentConfig;
pub use mcp::DynMcpDeploymentProvider;
pub use mcp::DynMcpRegistry;
pub use mcp::DynMcpToolProvider;
pub use mcp::ERROR as MCP_ERROR;
pub use mcp::McpAuthState;
pub use mcp::McpDeploymentProvider;
pub use mcp::McpProvider;
pub use mcp::McpRegistry;
pub use mcp::McpServerConfig;
pub use mcp::McpServerState;
pub use mcp::McpToolProvider;
pub use mcp::OAuthRequirement;
pub use mcp::RUNNING as MCP_RUNNING;
pub use mcp::RegistryConfig;
pub use mcp::STARTING as MCP_STARTING;
pub use mcp::STOPPED as MCP_STOPPED;
pub use mcp::Settings;
pub use modules::ApiPaths;
pub use modules::CliPaths;
pub use modules::ServiceCategory;
pub use oauth::OAuthClientConfig;
pub use oauth::OAuthServerConfig;
pub use paths::AppPaths;
pub use paths::BuildPaths;
pub use paths::PathError;
pub use paths::StoragePaths;
pub use paths::SystemPaths;
pub use paths::WebPaths;
pub use paths::cloud_container;
pub use paths::dir_names;
pub use paths::file_names;
pub use profile::CloudConfig;
pub use profile::CloudValidationMode;
pub use profile::ContentNegotiationConfig;
pub use profile::DatabaseConfig as ProfileDatabaseConfig;
pub use profile::Environment;
pub use profile::ExtensionsConfig;
pub use profile::LogLevel;
pub use profile::OutputFormat;
pub use profile::PathsConfig;
pub use profile::Profile;
pub use profile::ProfileInfo;
pub use profile::ProfileStyle;
pub use profile::ProfileType;
pub use profile::RateLimitsConfig;
pub use profile::RuntimeConfig;
pub use profile::SecurityConfig;
pub use profile::SecurityHeadersConfig;
pub use profile::ServerConfig;
pub use profile::SiteConfig;
pub use repository::ServiceLifecycle;
pub use repository::ServiceRecord;
pub use repository::WhereClause;
pub use routing::ApiCategory;
pub use routing::AssetType;
pub use routing::RouteClassifier;
pub use routing::RouteType;
pub use secrets::Secrets;
pub use services::AGENT_CONFIG_FILENAME;
pub use services::AgentCardConfig;
pub use services::AgentConfig;
pub use services::AgentMetadataConfig;
pub use services::AgentProviderInfo;
pub use services::AgentSummary;
pub use services::AiConfig;
pub use services::AiProviderConfig;
pub use services::CapabilitiesConfig;
pub use services::ComponentFilter;
pub use services::ComponentSource;
pub use services::DEFAULT_AGENT_SYSTEM_PROMPT_FILE;
pub use services::DEFAULT_SKILL_CONTENT_FILE;
pub use services::DiskAgentConfig;
pub use services::DiskHookConfig;
pub use services::DiskSkillConfig;
pub use services::HOOK_CONFIG_FILENAME;
pub use services::HistoryConfig;
pub use services::HookAction;
pub use services::HookCategory;
pub use services::HookEvent;
pub use services::HookEventsConfig;
pub use services::HookMatcher;
pub use services::HookType;
pub use services::IncludableString;
pub use services::JobConfig;
pub use services::MarketplaceConfig;
pub use services::MarketplaceConfigFile;
pub use services::MarketplaceVisibility;
pub use services::McpConfig;
pub use services::OAuthConfig as AgentOAuthConfig;
pub use services::PluginAuthor;
pub use services::PluginComponentRef;
pub use services::PluginConfig;
pub use services::PluginConfigFile;
pub use services::PluginScript;
pub use services::PluginVariableDef;
pub use services::RuntimeStatus;
pub use services::SKILL_CONFIG_FILENAME;
pub use services::SamplingConfig;
pub use services::SchedulerConfig;
pub use services::ServiceType;
pub use services::ServicesConfig;
pub use services::Settings as ServicesSettings;
pub use services::SkillConfig;
pub use services::SkillsConfig;
pub use services::ToolModelConfig;
pub use services::ToolModelSettings;
pub use services::strip_frontmatter;
pub use users::SessionSummary;
pub use users::UserSummary;

Modules§

a2a
A2A protocol models — agent cards, messages, tasks, artifacts, and transport descriptors. Protocol types retain raw String fields to match the external JSON-RPC specification.
admin
Admin-dashboard read models.
agui
AG-UI streaming event protocol shapes.
ai
AI provider models — requests, responses, tool calls, sampling parameters, execution plans, and the AiProvider trait shared across LLM integrations.
api
api module — see crate-level docs for context.
artifacts
artifacts module — see crate-level docs for context.
auth
Authentication and authorization value types.
bridge
Bridge wire-format models.
config
Global runtime Config singleton and validation helpers.
content
Published-content value types.
content_config
Content-configuration model and routing trait.
errors
Cross-cutting error types for systemprompt-models.
events
Event envelopes flowing across the system bus.
execution
Execution models — request context propagation, per-run execution steps, and the shared context carried through an agent run.
extension
Extension manifest types.
gateway_hash
Stable conversation-prefix hash used to mint deterministic GatewayConversationIds on both sides of the bridge boundary.
macros
Declarative macros shared across the crate’s builder types.
mcp
MCP protocol metadata helpers.
modules
Path constants and service-category classification shared across API/CLI surfaces.
net
Shared network timeout constants.
oauth
OAuth client and server configuration shapes.
paths
Well-known directory layout helpers.
profile
Profile configuration models — the deserialized shape of a .systemprompt/profiles/<name>/profile.yaml document.
repository
Repository lifecycle traits and query value objects.
routing
Request-routing classification.
secrets
Secrets document model.
services
services module — see crate-level docs for context.
text
Text-formatting helpers.
time_format
Human-readable timestamp and duration formatting.
users
Public user and session summary projections.
validators
Domain configuration validators for startup validation.

Macros§

builder_methods
domain_error

Structs§

AgentId
AnimationConfig
CallToolResult
The result of a tool call operation.
CardConfig
ColorsConfig
ContextId
FontsConfig
LayoutConfig
LogoConfig
MobileConfig
RadiusConfig
ScriptConfig
SessionId
ShadowsConfig
SpacingConfig
StartupValidationError
StartupValidationReport
TaskId
TouchTargetsConfig
TraceId
TypographyConfig
UserId
ValidationReport
ValidationWarning
WebConfig
WebPathsConfig
ZIndexConfig

Enums§

RepositoryError
WebConfigError