vtcode_config/
lib.rs

1//! Shared configuration loader utilities for VTCode and downstream integrations.
2//!
3//! This crate exposes [`VTCodeConfig`] and [`ConfigManager`] for reading and
4//! validating `vtcode.toml` files while allowing applications to customize the
5//! filesystem layout via [`ConfigDefaultsProvider`]. Consumers can opt into the
6//! [`bootstrap`](index.html#features) feature (enabled by default) to scaffold
7//! configuration directories with project-specific defaults.
8//! Disable default features when you only need parsing/validation to omit the
9//! filesystem bootstrap helpers and reduce dependencies.
10//!
11//! # Examples
12//! ```no_run
13//! use vtcode_config::ConfigManager;
14//!
15//! # fn main() -> anyhow::Result<()> {
16//! let manager = ConfigManager::load_from_workspace(".")?;
17//! println!("Active provider: {}", manager.config().agent.provider);
18//! # Ok(())
19//! # }
20//! ```
21//!
22//! Install a custom [`ConfigDefaultsProvider`] with
23//! [`install_config_defaults_provider`] when you need to override search paths
24//! or syntax highlighting defaults exposed by the loader.
25
26pub mod acp;
27pub mod api_keys;
28pub mod constants;
29pub mod context;
30pub mod core;
31pub mod debug;
32pub mod defaults;
33pub mod hooks;
34pub mod loader;
35pub mod mcp;
36pub mod models;
37pub mod root;
38pub mod router;
39#[cfg(feature = "schema")]
40pub mod schema;
41pub mod telemetry;
42pub mod timeouts;
43pub mod types;
44
45pub use acp::{
46    AgentClientProtocolConfig, AgentClientProtocolTransport, AgentClientProtocolZedConfig,
47    AgentClientProtocolZedToolsConfig, AgentClientProtocolZedWorkspaceTrustMode,
48    WorkspaceTrustLevel,
49};
50pub use api_keys::ApiKeySources;
51pub use context::{ContextFeaturesConfig, LedgerConfig};
52pub use core::{
53    AgentConfig, AgentCustomPromptsConfig, AgentOnboardingConfig, AutomationConfig, CommandsConfig,
54    FullAutoConfig, ModelConfig, PromptCachingConfig, ProviderPromptCachingConfig, SecurityConfig,
55    ToolPolicy, ToolsConfig, WebFetchConfig,
56};
57pub use debug::{DebugConfig, TraceLevel};
58pub use defaults::{
59    ConfigDefaultsProvider, ContextStoreDefaults, PerformanceDefaults, ScenarioDefaults,
60    SyntaxHighlightingDefaults, WorkspacePathsDefaults, current_config_defaults,
61    install_config_defaults_provider, reset_to_default_config_defaults, with_config_defaults,
62};
63pub use hooks::{
64    HookCommandConfig, HookCommandKind, HookGroupConfig, HooksConfig, LifecycleHooksConfig,
65};
66pub use loader::{ConfigManager, SyntaxHighlightingConfig, VTCodeConfig};
67pub use mcp::{
68    McpAllowListConfig, McpAllowListRules, McpClientConfig, McpHttpServerConfig, McpProviderConfig,
69    McpStdioServerConfig, McpTransportConfig, McpUiConfig, McpUiMode,
70};
71pub use models::{ModelId, OpenRouterMetadata};
72pub use root::{PtyConfig, StatusLineConfig, StatusLineMode, ToolOutputMode, UiConfig};
73pub use router::{ComplexityModelMap, HeuristicSettings, ResourceBudget, RouterConfig};
74#[cfg(feature = "schema")]
75pub use schema::{vtcode_config_schema, vtcode_config_schema_json, vtcode_config_schema_pretty};
76pub use telemetry::TelemetryConfig;
77pub use timeouts::TimeoutsConfig;
78pub use types::{ReasoningEffortLevel, UiSurfacePreference};