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
// MCP (Model Context Protocol) JSON-RPC Server
//
// This module provides a pure Rust implementation of the MCP protocol
// for LeIndex, enabling AI assistant integration via JSON-RPC 2.0.
//
// # Example
//
// ```ignore
// use leindex::{LeIndex, mcp::McpServer};
//
// #[tokio::main]
// async fn main() -> anyhow::Result<()> {
// // Create LeIndex instance
// let leindex = LeIndex::new("/path/to/project")?;
//
// // Create and run MCP server
// let config = McpServerConfig::default();
// let server = McpServer::new(config, leindex);
// server.run().await?;
//
// Ok(())
// }
// ```
/// Advisory per-project single-instance lock (D-3 memory-pressure).
/// Dispatch macro for `ToolHandler` enum and match-arm generation.
/// Grouped four-tool public surface (`action`-selected sub-tools).
/// Request handlers for MCP tools.
/// Shared helpers for MCP request processing.
/// Beautiful output formatting for LeIndex tools.
/// MCP protocol definitions and JSON-RPC types.
/// Request budgets, timing metadata, and causal-path counters.
/// System-One gate (experimental; `system-one` feature).
/// Response detail tiers (`l0` identity card, `l1` overview, `l2` full detail).
/// Handler for LeIndex \[Context\] — PDG-based context expansion.
/// Handler for LeIndex [Deep Analyze] — deep code analysis.
/// Handler for LeIndex \[Diagnostics\] — project diagnostics.
/// Handler for LeIndex [Edit Apply] — atomic code modifications.
/// Disk-persistent cache for edit previews.
/// Handler for LeIndex [Edit Preview] — dry-run code changes.
/// Handler for LeIndex [File Summary] — structured file analysis.
/// Handler for LeIndex \[Find\] — index-accelerated text/symbol search.
/// Handler for LeIndex [Git Diff] — PDG-enriched diff.
/// Handler for LeIndex [Git Status] — PDG-aware git status.
/// Handler for LeIndex [Impact Analysis] — transitive dependency impact.
/// Handler for LeIndex \[Index\] — project indexing.
/// Handler for LeIndex [Phase Analysis] — multi-phase analysis.
/// Handler for LeIndex [Project Map] — annotated project tree.
/// Handler for LeIndex [Read File] — PDG-annotated file read.
/// Handler for LeIndex [Read Symbol] — targeted symbol source read.
/// Handler for LeIndex [Rename Symbol] — cross-file symbol rename.
/// Handler for LeIndex \[Search\] — semantic code search.
/// Handler for LeIndex [Structural] — ast-grep AST-pattern search.
/// Handler for LeIndex [Symbol Lookup] — full call graph lookup.
/// Handler for LeIndex \[Write\] — atomic file creation with PDG surfacing.
/// MCP server implementation.
/// SSE streaming support for indexing progress.
pub use ;
pub use ;
/// MCP server version
pub const VERSION: &str = env!;