Mountain/Binary/IPC/IPCStatusHistoryCommand.rs
1//! # IPCStatusHistoryCommand
2//!
3//! Retrieves historical IPC status information.
4//!
5//! ## RESPONSIBILITIES
6//!
7//! ### History Query
8//! - Get historical IPC status data
9//! - Return status changes over time
10//! - Provide metrics timeline
11//!
12//! ## ARCHITECTURAL ROLE
13//!
14//! ### Position in Mountain
15//! - IPC wrapper command in Binary subsystem
16//! - Status history endpoint
17//!
18//! ### Dependencies
19//! - crate::IPC::StatusReporter: Status history
20//! - tauri: IPC framework
21//! - serde_json: JSON serialization
22//!
23//! ### Dependents
24//! - Wind frontend: Queries IPC history
25//! - DevTools: Monitoring trends
26//!
27//! ## SECURITY
28//!
29//! ### Considerations
30//! - History is read-only, no security impact
31//! - Limit history size for privacy
32//!
33//! ## PERFORMANCE
34//!
35//! ### Considerations
36//! - History queries may be slower with large datasets
37//! - Consider pagination for long history
38
39use serde_json::Value;
40use tauri::AppHandle;
41
42/// Get IPC status history.
43///
44/// Retrieves historical IPC status data for analysis and monitoring.
45///
46/// # Arguments
47///
48/// * `app_handle` - Tauri application handle
49///
50/// # Returns
51///
52/// Returns history JSON, or an error string.
53///
54/// # Errors
55///
56/// Returns an error if history cannot be retrieved.
57#[tauri::command]
58pub async fn MountainGetIPCStatusHistory(app_handle:AppHandle) -> Result<Value, String> {
59 crate::IPC::StatusReporter::mountain_get_ipc_status_history(app_handle).await
60}