lean-ctx-engine 3.12.1

LeanCTX | OSS library: the open-source runtime for the Context Gateway for AI agents behind the lean-ctx CLI, MCP server and proxy integrations.
Documentation
use std::{collections::HashMap, sync::Arc};

use super::memory_policy::MemoryPolicy;
use super::{error, persona, tool_profiles};

mod defaults;
mod defaults_allowlist;
mod enterprise;
mod enums;
pub mod governor;
pub mod hive;
mod intelligence;
mod loader;
mod logic;
mod memory;
mod merge;
mod model;
pub mod provenance;
mod proxy;
mod read_dedup;
pub mod read_redirect;
pub mod renamed;
mod render;
mod response_shaping;
pub mod retired;
pub mod risk;
pub mod schema;
mod sections;
mod semantic;
mod serde_defaults;
pub mod setter;
mod shell_activation;
mod shell_approval;
pub mod shell_policy;
pub mod solution;
mod value_display;

/// Cache payload for [`Config::load_arc`]: the shared config alongside the
/// content hashes of the global and project-local files plus the environment-
/// selected config profile it was built from, so a later load only reuses an
/// entry with identical inputs (#406, #1159). The trailing `bool` is the
/// workspace-trust decision the entry was merged under (#2144).
type ConfigCacheSlot = Option<(
    Arc<Config>,
    Option<String>,
    Option<String>,
    Option<String>,
    bool,
)>;

pub use defaults::*;
#[allow(unreachable_pub, unused_imports)]
pub use logic::*;
pub use model::*;
pub use render::{SIMPLIFIED_TEMPLATE, render_annotated_config};
pub use sections::*;

pub(crate) use defaults_allowlist::{cloud_infra_commands, default_shell_allowlist};
pub use enterprise::EnterpriseConfig;
pub use enums::{
    CompressionLevel, Effort, OutputDensity, PermissionInheritance, RecoveryHints,
    ResponseVerbosity, RulesInjection, RulesScope, SessionDegrade, TeeMode, TerseAgent,
};
pub use intelligence::IntelligenceRuntimeConfig;
pub use loader::ConfigLoadFailure;
pub use loader::global_string_list;
pub use loader::last_config_parse_error;
pub use loader::local_sensitive_overrides;
pub(crate) use loader::strip_sensitive_overrides;
pub use loader::{ConfigMigrationPause, config_migration_pause_status};
pub use memory::{
    CompressionAnnotation, MemoryCleanup, MemoryGuardConfig, MemoryProfile, SavingsFooter,
};
pub(crate) use merge::is_project_key;
pub use provenance::{ConfigProvenance, EnvOverride};
pub use proxy::{
    BaselineConfig, DEFAULT_LOCAL_SHADOW_RATE_PER_MTOK, HistoryMode, PipelineConfig, ProseRanker,
    ProseRole, ProviderEntry, ProxyConfig, ProxyMode, ProxyProvider, ResolvedProvider,
    RoleAggressiveness, RoutingRules, UpstreamDrift, Upstreams, WireShape, diagnose_drift,
    env_upstream_override, is_local_proxy_url, normalize_url, normalize_url_opt,
    parse_route_target,
};
pub use read_dedup::ReadDedup;
pub use read_redirect::ReadRedirect;
pub use response_shaping::ResponseShapingConfig;
pub use semantic::SemanticMode;
pub use shell_activation::ShellActivation;
pub use shell_approval::ShellApproval;
pub use value_display::{StatuslineStyle, ValueDisplayConfig, ValueDisplayMode};

#[cfg(test)]
mod migration_journal_tests;
#[cfg(test)]
mod solution_tests;
#[cfg(test)]
mod telemetry_migration_tests;
#[cfg(any(test, feature = "test-support"))]
pub mod test_support;
#[cfg(test)]
mod tests;
#[cfg(test)]
mod tests_parsing;
#[cfg(test)]
mod v3_config_migration_tests;