pub struct Daemon { /* private fields */ }Expand description
Shared daemon state. Cheap to clone (it’s an Arc inside).
Implementations§
Source§impl Daemon
impl Daemon
Sourcepub fn skill_list(&self, session_id: &str) -> Result<SkillListResponse>
pub fn skill_list(&self, session_id: &str) -> Result<SkillListResponse>
List skills available in skills_dir. Execution dispatch lands
in M6.
Sourcepub fn skill_show(
&self,
session_id: &str,
name: &str,
) -> Result<SkillShowResponse>
pub fn skill_show( &self, session_id: &str, name: &str, ) -> Result<SkillShowResponse>
Show the SKILL.md for a named skill.
Sourcepub fn capture(
&self,
session_id: &str,
page_id: &str,
scope: CaptureScope,
) -> Result<CaptureResponse>
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.
Sourcepub fn viewport(
&self,
session_id: &str,
page_id: &str,
viewport: Viewport,
) -> Result<ViewportResponse>
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).
pub fn layout( &self, session_id: &str, page_id: &str, refs: Vec<Ref>, ) -> Result<LayoutResponse>
pub fn auth_save( &self, session_id: &str, page_id: &str, name: &str, ) -> Result<AuthSaveResponse>
pub fn auth_load( &self, session_id: &str, page_id: &str, name: &str, ) -> Result<AuthLoadResponse>
pub fn auth_list(&self, session_id: &str) -> Result<AuthListResponse>
pub fn auth_clear( &self, session_id: &str, name: &str, ) -> Result<AuthClearResponse>
Source§impl Daemon
impl Daemon
Sourcepub fn session_open(&self, policy: Option<&str>) -> Result<SessionOpenResponse>
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.
pub fn session_close(&self, session_id: &str) -> Result<SessionCloseResponse>
pub fn open(&self, session_id: &str, url: &str) -> Result<OpenResponse>
pub fn close(&self, session_id: &str, page_id: &str) -> Result<CloseResponse>
Source§impl Daemon
impl Daemon
pub fn view( &self, session_id: &str, page_id: &str, force_full: bool, ) -> Result<ViewResponse>
pub fn read( &self, session_id: &str, page_id: &str, r: Ref, ) -> Result<ReadResponse>
pub fn act(&self, call: ActCall) -> Result<ActResponse>
pub fn find(&self, session_id: &str, query: &str) -> Result<FindResponse>
pub fn wait( &self, session_id: &str, page_id: &str, cond: EngineWait, budget: Duration, ) -> Result<WaitResponse>
Source§impl Daemon
impl Daemon
Sourcepub fn extract(
&self,
session_id: &str,
page_id: &str,
schema: &str,
before_token: StateToken,
) -> Result<ExtractResponse>
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.
Sourcepub fn mark(
&self,
session_id: &str,
page_id: &str,
r: Ref,
name: &str,
before_token: StateToken,
) -> Result<MarkResponse>
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.
Sourcepub fn annotate(
&self,
session_id: &str,
target: &AnnotationTarget,
key: &str,
value: Option<&str>,
) -> Result<AnnotateResponse>
pub fn annotate( &self, session_id: &str, target: &AnnotationTarget, key: &str, value: Option<&str>, ) -> Result<AnnotateResponse>
Attach (key, value) to target.
Source§impl Daemon
impl Daemon
Sourcepub fn new(store: Store, engine: Arc<EngineRuntime>) -> Self
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.
Sourcepub fn with_captures_dir(self, dir: impl Into<PathBuf>) -> Self
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.
Sourcepub fn with_skills_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_skills_dir(self, dir: impl Into<PathBuf>) -> Self
Pin the on-disk path where vs_skill looks up composed skills.
Sourcepub fn with_master_key(self, key: MasterKey) -> Self
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".
Sourcepub fn inspect_console(
&self,
session_id: &str,
page_id: &str,
) -> Result<Vec<ConsoleEntry>>
pub fn inspect_console( &self, session_id: &str, page_id: &str, ) -> Result<Vec<ConsoleEntry>>
Snapshot the engine’s console ring buffer for page.
Sourcepub fn inspect_network(
&self,
session_id: &str,
page_id: &str,
) -> Result<Vec<NetworkEntry>>
pub fn inspect_network( &self, session_id: &str, page_id: &str, ) -> Result<Vec<NetworkEntry>>
Snapshot the engine’s network ring buffer for page.
Sourcepub fn inspect_request(
&self,
session_id: &str,
page_id: &str,
seq: u64,
) -> Result<Option<RequestDetail>>
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.
pub fn inspect_eval( &self, session_id: &str, page_id: &str, expr: &str, ) -> Result<EvalResult>
pub fn inspect_storage( &self, session_id: &str, page_id: &str, scope: StorageScope, ) -> Result<Vec<StorageEntry>>
pub fn cursor_op( &self, session_id: &str, page_id: &str, op: CursorOp, mode: InputMode, ) -> Result<StateToken>
pub fn inspect_scripts( &self, session_id: &str, page_id: &str, ) -> Result<Vec<ScriptEntry>>
pub fn inspect_script_source( &self, session_id: &str, page_id: &str, seq: u64, ) -> Result<Option<ScriptSource>>
pub fn inspect_dom( &self, session_id: &str, page_id: &str, r: Ref, extra_props: Vec<String>, ) -> Result<Option<DomDetail>>
pub fn inspect_performance( &self, session_id: &str, page_id: &str, ) -> Result<PerformanceMetrics>
Sourcepub fn dispatch(&self, primitives: &[Primitive]) -> Vec<DispatchOutcome>
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