vtcode_core/config/core/
automation.rs

1use crate::config::constants::tools;
2use serde::{Deserialize, Serialize};
3use std::path::PathBuf;
4
5/// Automation-specific configuration toggles.
6#[derive(Debug, Clone, Deserialize, Serialize)]
7pub struct AutomationConfig {
8    /// Full-auto execution safeguards.
9    #[serde(default)]
10    pub full_auto: FullAutoConfig,
11}
12
13impl Default for AutomationConfig {
14    fn default() -> Self {
15        Self {
16            full_auto: FullAutoConfig::default(),
17        }
18    }
19}
20
21/// Controls for running the agent without interactive approvals.
22#[derive(Debug, Clone, Deserialize, Serialize)]
23pub struct FullAutoConfig {
24    /// Enable the runtime flag once the workspace is configured for autonomous runs.
25    #[serde(default = "default_full_auto_enabled")]
26    pub enabled: bool,
27
28    /// Allow-list of tools that may execute automatically.
29    #[serde(default = "default_full_auto_allowed_tools")]
30    pub allowed_tools: Vec<String>,
31
32    /// Require presence of a profile/acknowledgement file before activation.
33    #[serde(default = "default_require_profile_ack")]
34    pub require_profile_ack: bool,
35
36    /// Optional path to a profile describing acceptable behaviors.
37    #[serde(default)]
38    pub profile_path: Option<PathBuf>,
39}
40
41impl Default for FullAutoConfig {
42    fn default() -> Self {
43        Self {
44            enabled: default_full_auto_enabled(),
45            allowed_tools: default_full_auto_allowed_tools(),
46            require_profile_ack: default_require_profile_ack(),
47            profile_path: None,
48        }
49    }
50}
51
52fn default_full_auto_enabled() -> bool {
53    false
54}
55
56fn default_full_auto_allowed_tools() -> Vec<String> {
57    vec![
58        tools::READ_FILE.to_string(),
59        tools::LIST_FILES.to_string(),
60        tools::GREP_SEARCH.to_string(),
61        tools::SIMPLE_SEARCH.to_string(),
62    ]
63}
64
65fn default_require_profile_ack() -> bool {
66    true
67}