Skip to main content

VictauriBuilder

Struct VictauriBuilder 

Source
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

Source

pub fn new() -> Self

Source

pub fn port(self, port: u16) -> Self

Set the TCP port for the MCP server (default: 7373, env: VICTAURI_PORT).

Source

pub fn event_capacity(self, capacity: usize) -> Self

Set the maximum number of events in the ring-buffer log (default: 10,000).

Source

pub fn recorder_capacity(self, capacity: usize) -> Self

Set the maximum events kept during session recording (default: 50,000).

Source

pub fn eval_timeout(self, timeout: Duration) -> Self

Set the timeout for JavaScript eval operations (default: 30s, env: VICTAURI_EVAL_TIMEOUT).

Source

pub fn auth_token(self, token: impl Into<String>) -> Self

Set an explicit auth token for the MCP server (env: VICTAURI_AUTH_TOKEN).

Source

pub fn generate_auth_token(self) -> Self

Generate a random UUID v4 auth token.

Source

pub fn disable_tools(self, tools: &[&str]) -> Self

Disable specific MCP tools by name (e.g., ["eval_js", "screenshot"]).

Source

pub fn command_allowlist(self, commands: &[&str]) -> Self

Only allow these Tauri commands to be invoked via MCP (positive allowlist).

Source

pub fn command_blocklist(self, commands: &[&str]) -> Self

Block specific Tauri commands from being invoked via MCP.

Source

pub fn add_redaction_pattern(self, pattern: impl Into<String>) -> Self

Add a regex pattern for output redaction (e.g., r"SECRET_\w+").

Source

pub fn enable_redaction(self) -> Self

Enable output redaction with built-in patterns (API keys, emails, tokens).

Source

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.

Source

pub fn console_log_capacity(self, capacity: usize) -> Self

Set the maximum console log entries kept in the JS bridge (default: 1000).

Source

pub fn network_log_capacity(self, capacity: usize) -> Self

Set the maximum network log entries kept in the JS bridge (default: 1000).

Source

pub fn navigation_log_capacity(self, capacity: usize) -> Self

Set the maximum navigation log entries kept in the JS bridge (default: 200).

Source

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.

Source

pub fn build<R: Runtime>(self) -> Result<TauriPlugin<R>, BuilderError>

Trait Implementations§

Source§

impl Default for VictauriBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,