Skip to main content

SensorSourceConfig

Enum SensorSourceConfig 

Source
pub enum SensorSourceConfig {
    JmapEmail {
        name: String,
        server: String,
        username: String,
        password_env: String,
        priority_senders: Vec<String>,
        blocked_senders: Vec<String>,
        poll_interval_seconds: u64,
    },
    Rss {
        name: String,
        feeds: Vec<String>,
        interest_keywords: Vec<String>,
        poll_interval_seconds: u64,
    },
    Image {
        name: String,
        watch_directory: String,
        poll_interval_seconds: u64,
    },
    Audio {
        name: String,
        watch_directory: String,
        whisper_model: String,
        known_contacts: Vec<String>,
        poll_interval_seconds: u64,
    },
    Weather {
        name: String,
        api_key_env: String,
        locations: Vec<String>,
        poll_interval_seconds: u64,
        alert_only: bool,
    },
    Webhook {
        name: String,
        path: String,
        secret_env: Option<String>,
    },
    Mcp {
Show 15 fields name: String, server: Box<McpServerEntry>, tool_name: String, tool_args: Value, kafka_topic: String, modality: SensorModality, poll_interval_seconds: u64, id_field: String, content_field: Option<String>, items_field: Option<String>, priority_senders: Vec<String>, blocked_senders: Vec<String>, enrich_tool: Option<String>, enrich_id_param: Option<String>, dedup_ttl_seconds: u64,
}, }
Expand description

A sensor source definition.

Variants§

§

JmapEmail

JMAP email sensor (push/poll).

Fields

§name: String
§server: String
§username: String
§password_env: String

Environment variable containing the password.

§priority_senders: Vec<String>

Senders that get automatic Priority::High.

§blocked_senders: Vec<String>

Senders whose emails are silently dropped during triage.

§poll_interval_seconds: u64
§

Rss

RSS/Atom feed sensor.

Fields

§name: String
§feeds: Vec<String>
§interest_keywords: Vec<String>
§poll_interval_seconds: u64
§

Image

Directory watcher for images.

Fields

§name: String
§watch_directory: String
§poll_interval_seconds: u64
§

Audio

Directory watcher for audio files.

Fields

§name: String
§watch_directory: String
§whisper_model: String

Whisper model size: “tiny”, “base”, “small”, “medium”, “large”.

§known_contacts: Vec<String>

Known contacts whose voice recordings get priority triage.

§poll_interval_seconds: u64
§

Weather

Weather API sensor.

Fields

§name: String
§api_key_env: String

Environment variable containing the API key.

§locations: Vec<String>
§poll_interval_seconds: u64
§alert_only: bool

When true, only promote weather alerts (not regular readings).

§

Webhook

Generic webhook receiver.

Fields

§name: String
§path: String

URL path for the webhook endpoint (e.g., “/webhooks/github”).

§secret_env: Option<String>

Environment variable containing the webhook secret.

§

Mcp

Generic MCP sensor — polls a tool on any MCP server.

Fields

§name: String
§server: Box<McpServerEntry>

MCP server endpoint (string URL, {url, auth_header}, or {command, args, env}).

§tool_name: String

MCP tool to call each poll cycle.

§tool_args: Value

Arguments passed to the tool (default: {}).

§kafka_topic: String

Kafka topic to produce events to.

§modality: SensorModality

Sensory modality of produced events (default: "text").

§poll_interval_seconds: u64

Poll interval in seconds (default: 60).

§id_field: String

JSON field path for item ID (default: "id").

§content_field: Option<String>

JSON field for event content (default: entire item as JSON).

§items_field: Option<String>

JSON field containing items array in tool result (default: root is array).

§priority_senders: Vec<String>

Priority senders for email triage (only when kafka_topic = "hb.sensor.email").

§blocked_senders: Vec<String>

Blocked senders for email triage.

§enrich_tool: Option<String>

Optional enrichment tool to call for each new item (e.g., gmail_get_message). When set, the sensor calls this tool with the item’s ID to fetch detailed metadata (headers, body, labels) before producing to Kafka.

§enrich_id_param: Option<String>

Parameter name for the item ID when calling the enrichment tool (default: "id").

§dedup_ttl_seconds: u64

Dedup TTL in seconds. Seen IDs older than this are evicted. Default: 7 days.

Implementations§

Source§

impl SensorSourceConfig

Source

pub fn name(&self) -> &str

Get the name of this sensor source.

Source

pub fn sender_lists(&self) -> (&[String], &[String])

Get priority and blocked sender lists for trust resolution.

Returns (priority_senders, blocked_senders). Only email-type sources have these lists; other source types return empty slices.

Trait Implementations§

Source§

impl Clone for SensorSourceConfig

Source§

fn clone(&self) -> SensorSourceConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SensorSourceConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SensorSourceConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,