Skip to main content

Daemon

Struct Daemon 

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

Shared daemon state. Cheap to clone (it’s an Arc inside).

Implementations§

Source§

impl Daemon

Source

pub fn skill_list(&self, session_id: &str) -> Result<SkillListResponse>

List skills available in skills_dir. Execution dispatch lands in M6.

Source

pub fn skill_show( &self, session_id: &str, name: &str, ) -> Result<SkillShowResponse>

Show the SKILL.md for a named skill.

Source

pub fn capture( &self, session_id: &str, page_id: &str, scope: CaptureScope, ) -> Result<CaptureResponse>

Take a screenshot. Returns the on-disk path; bytes are not inlined per docs/PROTOCOL.md.

Source

pub fn viewport( &self, session_id: &str, page_id: &str, viewport: Viewport, ) -> Result<ViewportResponse>

Set the page viewport. Triggers a fresh-full re-baseline on the next vs_view (the protocol’s ? viewport_changed warning is the agent-visible cue).

Source

pub fn layout( &self, session_id: &str, page_id: &str, refs: Vec<Ref>, ) -> Result<LayoutResponse>

Source

pub fn auth_save( &self, session_id: &str, page_id: &str, name: &str, ) -> Result<AuthSaveResponse>

Source

pub fn auth_load( &self, session_id: &str, page_id: &str, name: &str, ) -> Result<AuthLoadResponse>

Source

pub fn auth_list(&self, session_id: &str) -> Result<AuthListResponse>

Source

pub fn auth_clear( &self, session_id: &str, name: &str, ) -> Result<AuthClearResponse>

Source§

impl Daemon

Source

pub fn session_open(&self, policy: Option<&str>) -> Result<SessionOpenResponse>

Open a fresh session. Returns the new id and a synthetic empty session-scoped state token (0000…); page-scoped tokens come from vs_open.

Source

pub fn session_close(&self, session_id: &str) -> Result<SessionCloseResponse>

Source

pub fn open(&self, session_id: &str, url: &str) -> Result<OpenResponse>

Source

pub fn close(&self, session_id: &str, page_id: &str) -> Result<CloseResponse>

Source§

impl Daemon

Source

pub fn view( &self, session_id: &str, page_id: &str, force_full: bool, ) -> Result<ViewResponse>

Source

pub fn read( &self, session_id: &str, page_id: &str, r: Ref, ) -> Result<ReadResponse>

Source

pub fn act(&self, call: ActCall) -> Result<ActResponse>

Source

pub fn find(&self, session_id: &str, query: &str) -> Result<FindResponse>

Source

pub fn wait( &self, session_id: &str, page_id: &str, cond: EngineWait, budget: Duration, ) -> Result<WaitResponse>

Source

pub fn status(&self, session_id_opt: Option<&str>) -> Result<StatusResponse>

Single-block summary: open pages, recent actions, total counts. session_id_opt = None returns a workspace-wide summary.

Source§

impl Daemon

Source

pub fn extract( &self, session_id: &str, page_id: &str, schema: &str, before_token: StateToken, ) -> Result<ExtractResponse>

Extract structured data from a page using a known schema.

Source

pub fn mark( &self, session_id: &str, page_id: &str, r: Ref, name: &str, before_token: StateToken, ) -> Result<MarkResponse>

Persist r as a named anchor in the session.

Source

pub fn annotate( &self, session_id: &str, target: &AnnotationTarget, key: &str, value: Option<&str>, ) -> Result<AnnotateResponse>

Attach (key, value) to target.

Source

pub fn log( &self, session_id: &str, page_id: Option<String>, group_label: Option<String>, since_started_at: Option<i64>, limit: Option<i64>, ) -> Result<LogResponse>

Slice the audit log for the session.

Source§

impl Daemon

Source

pub fn new(store: Store, engine: Arc<EngineRuntime>) -> Self

Build a daemon around an existing store and engine. Optional fields default to sensible values; tune via the with_* chain.

Source

pub fn with_captures_dir(self, dir: impl Into<PathBuf>) -> Self

Pin the on-disk path where vs_capture writes images. Must run before the daemon is Arc::cloned.

Source

pub fn with_skills_dir(self, dir: impl Into<PathBuf>) -> Self

Pin the on-disk path where vs_skill looks up composed skills.

Source

pub fn with_master_key(self, key: MasterKey) -> Self

Pin the master key used by vs_auth save|load. Without this, auth-modifying primitives return BadRequest "no master key".

Source

pub fn inspect_console( &self, session_id: &str, page_id: &str, ) -> Result<Vec<ConsoleEntry>>

Snapshot the engine’s console ring buffer for page.

Source

pub fn inspect_network( &self, session_id: &str, page_id: &str, ) -> Result<Vec<NetworkEntry>>

Snapshot the engine’s network ring buffer for page.

Source

pub fn inspect_request( &self, session_id: &str, page_id: &str, seq: u64, ) -> Result<Option<RequestDetail>>

Look up the full detail (headers + bodies) for a captured network request by seq.

Source

pub fn inspect_eval( &self, session_id: &str, page_id: &str, expr: &str, ) -> Result<EvalResult>

Source

pub fn inspect_storage( &self, session_id: &str, page_id: &str, scope: StorageScope, ) -> Result<Vec<StorageEntry>>

Source

pub fn cursor_op( &self, session_id: &str, page_id: &str, op: CursorOp, mode: InputMode, ) -> Result<StateToken>

Source

pub fn inspect_scripts( &self, session_id: &str, page_id: &str, ) -> Result<Vec<ScriptEntry>>

Source

pub fn inspect_script_source( &self, session_id: &str, page_id: &str, seq: u64, ) -> Result<Option<ScriptSource>>

Source

pub fn inspect_dom( &self, session_id: &str, page_id: &str, r: Ref, extra_props: Vec<String>, ) -> Result<Option<DomDetail>>

Source

pub fn inspect_performance( &self, session_id: &str, page_id: &str, ) -> Result<PerformanceMetrics>

Source

pub fn dispatch(&self, primitives: &[Primitive]) -> Vec<DispatchOutcome>

order; per-primitive failures (parse errors, unknown sessions, stale tokens, etc.) produce inline error envelopes but do not abort the rest of the sequence.

Audit rows are written per primitive — a sequence does not become one audit row.

Today every wire frame parses to exactly one [Primitive] (i.e. one Request), so the inbound vec has length 1. Composite-flag primitives (PRs 2–6 of M5.5) and the v2 wire pipeline syntax (ADR 0007) both feed

Trait Implementations§

Source§

impl Clone for Daemon

Source§

fn clone(&self) -> Daemon

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

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> 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> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
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