agent-hub-runtime 0.6.0

AgentHub desktop and companion CLI runtime for Tauri applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Application commands belong to the trusted workspace, never previewed pages.
pub fn main_only<R: tauri::Runtime>(
    handler: impl Fn(tauri::ipc::Invoke<R>) -> bool + Send + Sync + 'static,
) -> impl Fn(tauri::ipc::Invoke<R>) -> bool + Send + Sync + 'static {
    move |invoke| {
        if !crate::desktop::workspaces::is_workspace(invoke.message.webview_ref()) {
            invoke
                .resolver
                .reject("Application commands are unavailable to preview pages");
            return true;
        }
        handler(invoke)
    }
}