//! The Tauri command surface. //! //! Every command is a thin translation between the IPC boundary and the //! workspace actor. No logic lives here. use std::path::PathBuf; use gigit_git::{RefEntry, RepositorySummary}; use tauri::State; use crate::error::Result; use crate::workspace::{OpenedRepository, RepositoryId, WorkspaceHandle}; #[tauri::command] pub async fn open_repository( path: PathBuf, workspace: State<'_, WorkspaceHandle>, ) -> Result { workspace.open(path).await } #[tauri::command] pub async fn close_repository( id: RepositoryId, workspace: State<'_, WorkspaceHandle>, ) -> Result { workspace.close(id).await } #[tauri::command] pub async fn repository_summary( id: RepositoryId, workspace: State<'_, WorkspaceHandle>, ) -> Result { workspace.summary(id).await } #[tauri::command] pub async fn list_references( id: RepositoryId, workspace: State<'_, WorkspaceHandle>, ) -> Result> { workspace.references(id).await }