innate_core/daemon/
mod.rs1use std::path::Path;
10
11use crate::errors::Result;
12
13const DAEMON_SCHEMA: &str = r#"
16CREATE TABLE IF NOT EXISTS watch_state (
17 watch_path TEXT PRIMARY KEY,
18 last_processed_offset INTEGER NOT NULL DEFAULT 0,
19 last_processed_inode TEXT,
20 updated_at TEXT NOT NULL
21);
22
23CREATE TABLE IF NOT EXISTS processed_events (
24 event_id TEXT PRIMARY KEY,
25 watch_path TEXT,
26 trace_id TEXT,
27 event_type TEXT,
28 ts TEXT NOT NULL
29);
30
31CREATE TABLE IF NOT EXISTS daemon_errors (
32 id INTEGER PRIMARY KEY AUTOINCREMENT,
33 watch_path TEXT,
34 operation TEXT NOT NULL,
35 message TEXT NOT NULL,
36 ts TEXT NOT NULL
37);
38"#;
39
40mod command;
41mod events;
42mod process;
43mod state;
44mod watch;
45
46#[cfg(test)]
47mod tests;
48
49pub(crate) use command::run_command;
50pub use command::DaemonCommands;
51pub use process::{start, status, stop};
52pub use state::{health, is_running};
53pub use watch::run_watch_loop;