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//! Copyright (c) systemprompt.io — Business Source License 1.1.
34//! See <https://systemprompt.io> for licensing details.
35
36#![expect(
37 clippy::use_self,
38 reason = "explicit type names preferred over Self in this crate's public-facing APIs"
39)]
40
41pub(crate) mod branding_provider;
42pub(crate) mod config;
43pub mod error;
44pub(crate) mod extension;
45pub(crate) mod homepage_prerenderer;
46pub(crate) mod jobs;
47pub(crate) mod list_branding_provider;
48pub(crate) mod list_items_renderer;
49pub mod models;
50pub mod repository;
51pub mod services;
52
53pub use branding_provider::{DefaultBrandingProvider, default_branding_provider};
54pub use extension::ContentExtension;
55pub use homepage_prerenderer::{DefaultHomepagePrerenderer, default_homepage_prerenderer};
56pub use list_branding_provider::{DefaultListBrandingProvider, default_list_branding_provider};
57pub use list_items_renderer::{ListItemsCardRenderer, default_list_items_renderer};
58
59pub use config::{
60 ContentConfigValidated, ContentReady, ContentSourceConfigValidated, LoadStats, ParsedContent,
61 ValidationResult,
62};
63pub use error::{ContentError, ContentResult};
64pub use services::validate_content_metadata;
65
66pub use models::{
67 CategoryIdUpdate, Content, ContentMetadata, IngestionOptions, IngestionReport, IngestionSource,
68 SearchFilters, SearchRequest, SearchResponse, SearchResult, UpdateContentParams,
69};
70
71pub use repository::{
72 ContentRepositories, ContentRepository, LinkAnalyticsRepository, LinkRepository,
73 SearchRepository,
74};
75
76pub use services::{
77 DefaultContentProvider, GenerateLinkParams, IngestionService, LinkAnalyticsService,
78 LinkGenerationService, SearchService,
79};
80
81pub use models::{LinkType, TrackClickParams, UtmParams};
82
83pub use jobs::execute_content_ingestion;