victauri_plugin/mcp/
webview_params.rs1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3use std::fmt;
4
5#[derive(Debug, Deserialize, JsonSchema)]
7pub struct EvalJsParams {
8 pub code: String,
10 pub webview_label: Option<String>,
12}
13
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
16#[serde(rename_all = "snake_case")]
17pub enum SnapshotFormat {
18 Compact,
20 Json,
22}
23
24impl fmt::Display for SnapshotFormat {
25 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26 match self {
27 Self::Compact => f.write_str("compact"),
28 Self::Json => f.write_str("json"),
29 }
30 }
31}
32
33#[derive(Debug, Deserialize, JsonSchema)]
35pub struct SnapshotParams {
36 pub webview_label: Option<String>,
38 pub format: Option<SnapshotFormat>,
40}