use anyhow::Result;
use async_trait::async_trait;
use serde_json::Value;
use std::sync::Arc;
use tokio::sync::Mutex;
use crate::workspace::WorkspaceManager;
#[async_trait]
pub trait VibeToolHandler: Send + Sync {
fn tool_name(&self) -> &str;
fn tool_description(&self) -> &str;
fn input_schema(&self) -> Value;
async fn handle_call(
&self,
args: Value,
workspace: Arc<Mutex<WorkspaceManager>>,
) -> Result<Value>;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct GitOperationResult {
pub success: bool,
pub message: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<Value>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct RepositoryInfo {
pub name: String,
pub path: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub current_branch: Option<String>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct GitStatusInfo {
pub repository: String,
pub path: String,
pub is_dirty: bool,
pub has_staged_changes: bool,
pub has_unstaged_changes: bool,
pub has_untracked_files: bool,
pub ahead: usize,
pub behind: usize,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct AppConfigResult {
pub repository: String,
pub app: String,
pub template: String,
pub success: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}