Skip to main content

vs_daemon/
lib.rs

1//! The vibesurfer daemon library — owns the engine, exposes the protocol.
2//!
3//! The binary at `src/main.rs` is a thin wrapper around this library:
4//! it constructs a [`Daemon`], binds a Unix socket, and runs the
5//! [`server`] loop. Tests bypass the binary and drive [`Daemon`]
6//! directly.
7
8#![forbid(unsafe_code)]
9#![allow(
10    clippy::cast_possible_truncation,
11    clippy::cast_possible_wrap,
12    clippy::cast_sign_loss
13)]
14
15pub mod config;
16pub mod daemon;
17pub mod dispatch;
18pub mod error;
19pub mod page_state;
20pub mod redact;
21pub mod server;
22pub mod tokens;
23pub mod transport;
24
25pub use daemon::{
26    ActCall, ActResponse, AnnotateResponse, AuthClearResponse, AuthListResponse, AuthLoadResponse,
27    AuthSaveResponse, CaptureResponse, CloseResponse, Daemon, ExtractResponse, FindHit,
28    FindResponse, LayoutResponse, LogResponse, MarkResponse, OpenResponse, ReadResponse,
29    SessionCloseResponse, SessionOpenResponse, SkillListResponse, SkillShowResponse,
30    StatusResponse, ViewResponse, ViewportResponse, WaitResponse,
31};
32pub use dispatch::{DispatchOutcome, Primitive};
33pub use error::{DaemonError, Result};
34pub use page_state::{PageState, ViewForm};
35
36/// Returns the crate version (matches the workspace version).
37#[must_use]
38pub fn version() -> &'static str {
39    env!("CARGO_PKG_VERSION")
40}