Skip to main content

systemprompt_content/
lib.rs

1//! # systemprompt-content
2//!
3//! Markdown content management, ingestion, search, and link analytics for the
4//! systemprompt.io AI governance dashboards. The crate provides:
5//!
6//! - **Models** — typed [`Content`], [`ContentMetadata`], [`IngestionOptions`],
7//!   [`IngestionReport`], [`SearchRequest`], and link-tracking types.
8//! - **Repositories** — [`ContentRepository`], [`SearchRepository`],
9//!   [`LinkAnalyticsRepository`] backed by Postgres + `sqlx` macros.
10//! - **Services** — [`IngestionService`], [`SearchService`],
11//!   [`LinkGenerationService`], [`LinkAnalyticsService`], plus a
12//!   [`DefaultContentProvider`] for downstream consumers.
13//! - **Default providers** — [`DefaultBrandingProvider`],
14//!   [`DefaultHomepagePrerenderer`], and [`DefaultListBrandingProvider`] for
15//!   site-generation scaffolding.
16//! - **Job entrypoint** — [`execute_content_ingestion`] runs a single ingestion
17//!   pass against the active profile.
18//!
19//! ## Feature flags
20//!
21//! | Feature | Default | Effect |
22//! |---------|---------|--------|
23//! | _none_  | n/a     | The crate exposes a single feature surface; all modules are compiled unconditionally. The `[package.metadata.docs.rs] all-features = true` setting is retained so future feature additions automatically appear in published docs. |
24//!
25//! ## Layering
26//!
27//! `systemprompt-content` is a **domain** crate. It depends downward on
28//! `systemprompt-database`, `systemprompt-cloud`, `systemprompt-extension`,
29//! `systemprompt-models`, `systemprompt-traits`,
30//! `systemprompt-provider-contracts`, `systemprompt-logging`, and
31//! `systemprompt-identifiers`.
32
33#![expect(
34    clippy::use_self,
35    reason = "explicit type names preferred over Self in this crate's public-facing APIs"
36)]
37
38pub(crate) mod branding_provider;
39pub(crate) mod config;
40pub mod error;
41pub(crate) mod extension;
42pub(crate) mod homepage_prerenderer;
43pub(crate) mod jobs;
44pub(crate) mod list_branding_provider;
45pub(crate) mod list_items_renderer;
46pub mod models;
47pub mod repository;
48pub mod services;
49
50pub use branding_provider::{DefaultBrandingProvider, default_branding_provider};
51pub use extension::ContentExtension;
52pub use homepage_prerenderer::{DefaultHomepagePrerenderer, default_homepage_prerenderer};
53pub use list_branding_provider::{DefaultListBrandingProvider, default_list_branding_provider};
54pub use list_items_renderer::{ListItemsCardRenderer, default_list_items_renderer};
55
56pub use config::{
57    ContentConfigValidated, ContentReady, ContentSourceConfigValidated, LoadStats, ParsedContent,
58    ValidationResult,
59};
60pub use error::{ContentError, ContentResult};
61pub use services::validate_content_metadata;
62
63pub use models::{
64    CategoryIdUpdate, Content, ContentMetadata, IngestionOptions, IngestionReport, IngestionSource,
65    SearchFilters, SearchRequest, SearchResponse, SearchResult, UpdateContentParams,
66};
67
68pub use repository::{ContentRepository, LinkAnalyticsRepository, SearchRepository};
69
70pub use services::{
71    DefaultContentProvider, GenerateLinkParams, IngestionService, LinkAnalyticsService,
72    LinkGenerationService, SearchService,
73};
74
75pub use models::{LinkType, TrackClickParams, UtmParams};
76
77pub use jobs::execute_content_ingestion;