Skip to main content

victauri_plugin/mcp/
verification_params.rs

1use schemars::JsonSchema;
2use serde::Deserialize;
3
4/// Parameters for the `verify_state` tool.
5#[derive(Debug, Deserialize, JsonSchema)]
6pub struct VerifyStateParams {
7    /// JavaScript expression that returns the frontend state object to compare.
8    pub frontend_expr: String,
9    /// Backend state as a JSON object to compare against.
10    /// Either this or `backend_command` must be provided.
11    pub backend_state: Option<serde_json::Value>,
12    /// Tauri command to invoke to fetch backend state for comparison.
13    /// The command result is used as the backend state. Mutually exclusive with `backend_state`.
14    pub backend_command: Option<String>,
15    /// Arguments for the `backend_command`, if any.
16    pub backend_args: Option<serde_json::Value>,
17    /// Target webview label.
18    pub webview_label: Option<String>,
19}
20
21/// Parameters for the `detect_ghost_commands` tool.
22#[derive(Debug, Deserialize, JsonSchema)]
23pub struct GhostCommandParams {
24    /// Optional filter: only consider IPC calls from this webview label.
25    pub webview_label: Option<String>,
26}
27
28/// Parameters for the `check_ipc_integrity` tool.
29#[derive(Debug, Deserialize, JsonSchema)]
30pub struct IpcIntegrityParams {
31    /// Age in milliseconds after which a pending IPC call is considered stale. Default: 5000.
32    pub stale_threshold_ms: Option<i64>,
33    /// Target webview label.
34    pub webview_label: Option<String>,
35}