1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//! Daemon subsystem for TLDR CLI
//!
//! Provides a persistent background process that holds indexes in memory for fast
//! queries, implements Salsa-style query memoization, and tracks usage statistics.
//!
//! # Architecture
//!
//! ```text
//! +-----------------------------------------------------------------+
//! | CLI Layer |
//! | daemon start | stop | status | query | notify | stats | warm |
//! +-----------------------------------------------------------------+
//! |
//! +-----------v-----------+
//! | IPC Transport |
//! | Unix Socket (Unix) |
//! | TCP Socket (Windows) |
//! +-----------+-----------+
//! |
//! +-----------------------------------------------------------------+
//! | TLDRDaemon |
//! | +-------------+ +-------------+ +-------------+ |
//! | | SalsaDB | | Dedup Index | | Stats Store | |
//! | | (memoize) | | (content- | | (per-session| |
//! | | | | hash) | | tracking) | |
//! | +-------------+ +-------------+ +-------------+ |
//! +-----------------------------------------------------------------+
//! ```
//!
//! # Modules
//!
//! - `types`: Core data types for configuration, status, and statistics
//! - `error`: Error types for daemon operations
//! - `pid`: PID file locking for daemon singleton enforcement
//! - `ipc`: IPC client/server for socket communication
//! - `salsa`: Salsa-style incremental computation cache
//! - `daemon`: Main daemon process and command handlers
//! - `start`: Daemon start command
//! - `stop`: Daemon stop command
//! - `status`: Daemon status command
//! - `query`: Low-level query passthrough command
//! - `notify`: File change notification command
//! - `warm`: Cache warming command
//! - `stats`: Usage statistics command
//! - `cache_stats`: Cache statistics command
//! - `cache_clear`: Cache clearing command
pub use daemon_impl as daemon;
// Re-export core types for convenience
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export daemon components
pub use TLDRDaemon;
// Re-export CLI argument types for main.rs integration
pub use CacheClearArgs;
pub use CacheStatsArgs;
pub use DaemonNotifyArgs;
pub use DaemonQueryArgs;
pub use DaemonStartArgs;
pub use StatsArgs;
pub use DaemonStatusArgs;
pub use DaemonStopArgs;
pub use WarmArgs;