ucp_llm/lib.rs
1//! # UCP LLM
2//!
3//! LLM-focused utilities for the Unified Content Protocol.
4//!
5//! This crate provides helpers for turning UCM documents into LLM-friendly
6//! prompts and UCL command scaffolds, with a focus on token efficiency,
7//! deterministic mappings, and safe prompt composition.
8//!
9//! ## Key Types
10//!
11//! - [`ContextManager`] - Context window management with expansion and pruning
12//! - [`IdMapper`] - Token-efficient ID mapping (shortens block IDs for LLMs)
13//! - [`PromptBuilder`] - Dynamic prompt generation with capability scoping
14//!
15//! ## Example
16//!
17//! ```ignore
18//! use ucp_llm::IdMapper;
19//! use ucm_core::BlockId;
20//!
21//! let mut mapper = IdMapper::new();
22//! let block_id = BlockId::new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
23//! let short_id = mapper.register(block_id);
24//! println!("Short ID: {} (saves ~18 tokens)", short_id);
25//! ```
26
27pub mod context;
28pub mod id_mapper;
29pub mod prompt_builder;
30
31pub use context::{
32 CompressionMethod, ContextConstraints, ContextManager, ContextStatistics, ContextUpdateResult,
33 ContextWindow, ExpandDirection, ExpansionPolicy, InclusionReason, PruningPolicy,
34};
35pub use id_mapper::IdMapper;
36pub use prompt_builder::{presets, PromptBuilder, UclCapability};