Skip to main content

Crate vs_store

Crate vs_store 

Source
Expand description

SQLite-backed durable state for vibesurfer.

The store owns one SQLite database file at ~/.vibesurfer/state.db (or in-memory for tests). It is the source of truth for every piece of cross-restart state: sessions, pages, refs, marks, annotations, the audit log, encrypted auth blobs, and the skill cache. The daemon’s in-memory caches are derivative — on restart they are rebuilt from this crate.

§Layout

  • Store — the main handle. CRUD methods for every table.
  • types — owned domain types mirroring the SQL schema.
  • auth — AES-256-GCM helpers and master-key resolution (OS keyring → ~/.vibesurfer/key).
  • error::StoreError — every fallible function returns this.
  • migrate — the migration runner; called automatically by Store::open.

Re-exports§

pub use auth::decrypt;
pub use auth::encrypt;
pub use auth::EncryptedBlob;
pub use auth::MasterKey;
pub use error::Result;
pub use error::StoreError;
pub use types::Action;
pub use types::ActionFilter;
pub use types::ActionInsert;
pub use types::Annotation;
pub use types::AnnotationTarget;
pub use types::AuthBlobMeta;
pub use types::Mark;
pub use types::Page;
pub use types::Session;
pub use types::SessionStatus;
pub use types::SkillEntry;
pub use types::StoredRef;

Modules§

auth
Auth blob encryption and master-key resolution.
error
Crate-wide error type for vs-store.
migrate
Schema migrations.
types
Domain types — owned, plain Rust mirrors of the SQLite tables.

Structs§

Store
SQLite-backed durable state for vibesurfer.

Constants§

IDEMPOTENCY_TTL_SECS
The default idempotency window: a vs_act repeat is treated as a hit only if the prior call started within this many seconds.

Functions§

epoch_secs
Current Unix time in seconds, saturating at i64::MAX for the year-292277026596 case.
version
Returns the crate version (matches the workspace version).