pub const COMPACT_SURFACE_TOOL_COUNT: usize = 3;
pub const COMPACT_TOOL_NAMES: [&str; COMPACT_SURFACE_TOOL_COUNT] =
["symforge", "symforge_edit", "status"];
pub const CORE_TOOL_NAMES: [&str; 13] = [
"status",
"get_repo_map",
"get_file_context",
"get_file_content",
"search_text",
"search_symbols",
"get_symbol",
"find_references",
"replace_symbol_body",
"edit_within_symbol",
"batch_edit",
"index_folder",
"symforge_retrieve",
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CompactSurfaceTool {
Symforge,
SymforgeEdit,
Status,
}
impl CompactSurfaceTool {
pub const ALL: [Self; COMPACT_SURFACE_TOOL_COUNT] =
[Self::Symforge, Self::SymforgeEdit, Self::Status];
pub const fn as_str(self) -> &'static str {
match self {
Self::Symforge => "symforge",
Self::SymforgeEdit => "symforge_edit",
Self::Status => "status",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SurfaceProfile {
Core,
Full,
Compact,
Meta,
}
pub fn surface_profile_label(profile: SurfaceProfile) -> &'static str {
match profile {
SurfaceProfile::Core => "core",
SurfaceProfile::Full => "full",
SurfaceProfile::Meta => "meta",
SurfaceProfile::Compact => "compact",
}
}
pub fn surface_label_from_str(value: &str) -> Option<&'static str> {
surface_profile_from_label(value).map(surface_profile_label)
}
pub fn surface_profile_from_label(value: &str) -> Option<SurfaceProfile> {
match value {
"core" => Some(SurfaceProfile::Core),
"full" => Some(SurfaceProfile::Full),
"meta" => Some(SurfaceProfile::Meta),
"compact" => Some(SurfaceProfile::Compact),
_ => None,
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn compact_tool_names_match_a019_registry() {
let from_enum: Vec<&str> = CompactSurfaceTool::ALL.iter().map(|t| t.as_str()).collect();
assert_eq!(from_enum.as_slice(), COMPACT_TOOL_NAMES);
}
}