use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ExposureProfile {
#[default]
Full,
Auto,
Minimal,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)]
pub struct ToolExposureConfig {
pub profile: ExposureProfile,
#[serde(default = "default_schema_budget_pct")]
pub schema_budget_pct: u16,
#[serde(default = "default_max_initial_tools")]
pub max_initial_tools: usize,
#[serde(default = "default_supports_dynamic_catalog")]
pub supports_dynamic_catalog: bool,
}
impl Default for ToolExposureConfig {
fn default() -> Self {
Self {
profile: ExposureProfile::default(),
schema_budget_pct: default_schema_budget_pct(),
max_initial_tools: default_max_initial_tools(),
supports_dynamic_catalog: default_supports_dynamic_catalog(),
}
}
}
pub(crate) fn default_schema_budget_pct() -> u16 {
15
}
pub(crate) fn default_max_initial_tools() -> usize {
0
}
pub(crate) fn default_supports_dynamic_catalog() -> bool {
true
}