pub struct VictauriBuilder { /* private fields */ }Expand description
Builder for configuring the Victauri plugin before adding it to a Tauri app.
Supports port selection, authentication, privacy controls, output redaction, and capacity tuning. All settings have sensible defaults and can be overridden via environment variables.
Implementations§
Source§impl VictauriBuilder
impl VictauriBuilder
pub fn new() -> Self
Sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Set the TCP port for the MCP server (default: 7373, env: VICTAURI_PORT).
Sourcepub fn event_capacity(self, capacity: usize) -> Self
pub fn event_capacity(self, capacity: usize) -> Self
Set the maximum number of events in the ring-buffer log (default: 10,000).
Sourcepub fn recorder_capacity(self, capacity: usize) -> Self
pub fn recorder_capacity(self, capacity: usize) -> Self
Set the maximum events kept during session recording (default: 50,000).
Sourcepub fn eval_timeout(self, timeout: Duration) -> Self
pub fn eval_timeout(self, timeout: Duration) -> Self
Set the timeout for JavaScript eval operations (default: 30s, env: VICTAURI_EVAL_TIMEOUT).
Sourcepub fn auth_token(self, token: impl Into<String>) -> Self
pub fn auth_token(self, token: impl Into<String>) -> Self
Set an explicit auth token for the MCP server (env: VICTAURI_AUTH_TOKEN).
Sourcepub fn generate_auth_token(self) -> Self
pub fn generate_auth_token(self) -> Self
Generate a random UUID v4 auth token.
Sourcepub fn disable_tools(self, tools: &[&str]) -> Self
pub fn disable_tools(self, tools: &[&str]) -> Self
Disable specific MCP tools by name (e.g., ["eval_js", "screenshot"]).
Sourcepub fn command_allowlist(self, commands: &[&str]) -> Self
pub fn command_allowlist(self, commands: &[&str]) -> Self
Only allow these Tauri commands to be invoked via MCP (positive allowlist).
Sourcepub fn command_blocklist(self, commands: &[&str]) -> Self
pub fn command_blocklist(self, commands: &[&str]) -> Self
Block specific Tauri commands from being invoked via MCP.
Sourcepub fn add_redaction_pattern(self, pattern: impl Into<String>) -> Self
pub fn add_redaction_pattern(self, pattern: impl Into<String>) -> Self
Add a regex pattern for output redaction (e.g., r"SECRET_\w+").
Sourcepub fn enable_redaction(self) -> Self
pub fn enable_redaction(self) -> Self
Enable output redaction with built-in patterns (API keys, emails, tokens).
Sourcepub fn strict_privacy_mode(self) -> Self
pub fn strict_privacy_mode(self) -> Self
Enable strict privacy mode: disables dangerous tools (eval_js, screenshot, inject_css, set_storage, delete_storage, navigate, set_dialog_response, fill, type_text), enables output redaction with built-in PII patterns.
Sourcepub fn console_log_capacity(self, capacity: usize) -> Self
pub fn console_log_capacity(self, capacity: usize) -> Self
Set the maximum console log entries kept in the JS bridge (default: 1000).
Sourcepub fn network_log_capacity(self, capacity: usize) -> Self
pub fn network_log_capacity(self, capacity: usize) -> Self
Set the maximum network log entries kept in the JS bridge (default: 1000).
Set the maximum navigation log entries kept in the JS bridge (default: 200).
Sourcepub fn on_ready(self, f: impl FnOnce(u16) + Send + 'static) -> Self
pub fn on_ready(self, f: impl FnOnce(u16) + Send + 'static) -> Self
Register a callback invoked once the MCP server is listening. The callback receives the port number.