refactor(backend): split lib.rs into 11 domain command modules

This commit is contained in:
Hibryda 2026-03-11 05:09:15 +01:00
parent b1bc5d18a4
commit 30c21256bc
13 changed files with 884 additions and 874 deletions

View file

@ -0,0 +1,29 @@
use tauri::State;
use crate::AppState;
use crate::sidecar::AgentQueryOptions;
#[tauri::command]
#[tracing::instrument(skip(state, options), fields(session_id = %options.session_id))]
pub fn agent_query(
state: State<'_, AppState>,
options: AgentQueryOptions,
) -> Result<(), String> {
state.sidecar_manager.query(&options)
}
#[tauri::command]
#[tracing::instrument(skip(state))]
pub fn agent_stop(state: State<'_, AppState>, session_id: String) -> Result<(), String> {
state.sidecar_manager.stop_session(&session_id)
}
#[tauri::command]
pub fn agent_ready(state: State<'_, AppState>) -> bool {
state.sidecar_manager.is_ready()
}
#[tauri::command]
#[tracing::instrument(skip(state))]
pub fn agent_restart(state: State<'_, AppState>) -> Result<(), String> {
state.sidecar_manager.restart()
}