Skip to main content

lean_ctx/
lib.rs

1#![recursion_limit = "256"]
2// Every `unsafe` block must carry a `// SAFETY:` comment justifying soundness.
3// Enforced so the (mostly libc/Win32 syscall) unsafe surface stays documented.
4#![warn(clippy::undocumented_unsafe_blocks)]
5
6#[cfg(all(feature = "jemalloc", not(windows)))]
7#[global_allocator]
8static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
9
10#[cfg(all(feature = "jemalloc", not(windows)))]
11#[allow(non_upper_case_globals)]
12#[unsafe(export_name = "malloc_conf")]
13pub static malloc_conf: &[u8] = b"background_thread:true,dirty_decay_ms:1000,muzzy_decay_ms:1000\0";
14
15// ---------------------------------------------------------------------------
16// Pillar: Engine — context compression, MCP tools, agent hooks, local UX
17// ---------------------------------------------------------------------------
18pub mod compound_lexer;
19pub mod core;
20pub mod daemon;
21pub mod daemon_autostart;
22pub mod daemon_client;
23pub mod dashboard;
24pub mod dropin;
25pub mod engine;
26pub mod heatmap;
27pub mod hook_handlers;
28pub mod hooks;
29pub mod instructions;
30pub mod lsp;
31pub mod marked_block;
32pub mod mcp_stdio;
33pub mod rewrite_registry;
34pub mod rules_inject;
35pub mod server;
36pub mod shell;
37pub mod shell_hook;
38pub mod terminal_ui;
39pub mod token_report;
40pub mod tool_defs;
41pub mod tools;
42pub mod tui;
43
44#[cfg(feature = "http-server")]
45#[allow(dead_code)]
46pub mod proxy;
47pub mod proxy_autostart;
48pub mod proxy_setup;
49
50// ---------------------------------------------------------------------------
51// Pillar: Cloud — hosted API, accounts, sync, billing edge
52// ---------------------------------------------------------------------------
53pub mod cloud_client;
54pub mod cloud_sync;
55#[cfg(feature = "http-server")]
56pub mod http_server;
57
58// ---------------------------------------------------------------------------
59// Shared — CLI, IPC, config, diagnostics, setup
60// ---------------------------------------------------------------------------
61pub mod cli;
62pub mod config_io;
63pub mod doctor;
64pub mod ipc;
65pub mod report;
66pub mod setup;
67pub mod status;
68#[cfg(test)]
69pub(crate) mod test_env;
70pub mod uninstall;
71pub mod wrap;