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 /// Optional time window in milliseconds. When set (> 0), only commands invoked
27 /// within the last `since_ms` ms are considered — a non-destructive way to scope
28 /// detection to the current test's traffic without clearing the session's IPC log
29 /// (the alternative, `logs {action:'clear'}`, wipes it for every reader). Pair with
30 /// invoking the suspect action immediately before this call. Omit to scan the whole
31 /// accumulated log.
32 pub since_ms: Option<i64>,
33}
34
35/// Parameters for the `check_ipc_integrity` tool.
36#[derive(Debug, Deserialize, JsonSchema)]
37pub struct IpcIntegrityParams {
38 /// Age in milliseconds after which a pending IPC call is considered stale. Default: 5000.
39 pub stale_threshold_ms: Option<i64>,
40 /// Target webview label.
41 pub webview_label: Option<String>,
42}