Skip to main content

WritAgent

Struct WritAgent 

Source
pub struct WritAgent { /* private fields */ }
Expand description

The async client for a local Writ agent (writ-agentd).

Construct with WritAgent::builder (explicit config, no network I/O) or WritAgent::discover (env + runtime.json walk with a liveness probe). Resource groups hang off accessor methods: WritAgent::workflows, WritAgent::runs, WritAgent::monitors, …

Implementations§

Source§

impl WritAgent

Source

pub fn builder() -> WritAgentBuilder

Start explicit configuration. build() performs no I/O.

Source

pub async fn discover() -> Result<WritAgent>

Discover a live local daemon (env → runtime.json walk → liveness probe) and return a ready client. See DESIGN.md §4 / WritAgentBuilder::discover.

Source

pub fn base_url(&self) -> &str

The resolved base URL (no trailing slash).

Source

pub fn agent(&self) -> Agent<'_>

Agent status/health (/v1/agent, /v1/health).

Source

pub fn workflows(&self) -> Workflows<'_>

Workflows (/v1/workflows).

Source

pub fn runs(&self) -> Runs<'_>

Runs — read + control (/v1/runs).

Source

pub fn monitors(&self) -> Monitors<'_>

Monitors (/v1/monitors, /v1/changes/recent).

Source

pub fn selectors(&self) -> Selectors<'_>

Content selectors nested under monitors (/v1/monitors/:id/selectors).

Source

pub fn extractors(&self) -> Extractors<'_>

Field extractors (/v1/extractors, /v1/selectors/:sid/extractors).

Source

pub fn automations(&self) -> Automations<'_>

Automations (/v1/automations).

Source

pub fn personas(&self) -> Personas<'_>

Personas (/v1/personas).

Source

pub fn secrets(&self) -> Secrets<'_>

Vault secrets — metadata only, values never come back (/v1/secrets).

Source

pub fn vault(&self) -> Vault<'_>

Vault app-lock (/v1/vault/*).

Source

pub fn files(&self) -> Files<'_>

Stored files (/v1/files).

Source

pub fn data(&self) -> Data<'_>

Extracted-data queries and exports (/v1/data, /v1/workflows/:id/data*).

Source

pub fn keys(&self) -> Keys<'_>

Scoped API keys (/v1/keys; requires the manage-capable wlt_ token).

Source

pub fn crawl(&self) -> Crawl<'_>

Dragnet whole-site crawls (/v1/crawl).

Source

pub fn datasets(&self) -> Datasets<'_>

Datasets — the unified crawl + workflow extracted-data index (/v1/datasets).

Source

pub async fn ws_ticket( &self, route: &str, channel: Option<&str>, ) -> Result<WsTicket>

Mint a single-use WebSocket connect ticket (POST /v1/ws-ticket). route"record" | "ai-preview"; ai-preview requires a channel. Opening the WebSocket itself is out of scope for v1.

Trait Implementations§

Source§

impl Clone for WritAgent

Source§

fn clone(&self) -> WritAgent

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 WritAgent

Source§

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

Formats the value using the given formatter. 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: Sized + 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: Sized + 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> 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