lean_ctx/tools/registered/
mod.rs1pub mod ctx_agent;
2pub mod ctx_analyze;
3pub mod ctx_architecture;
4pub mod ctx_artifacts;
5pub mod ctx_benchmark;
6pub mod ctx_cache;
7pub mod ctx_call;
8pub mod ctx_callgraph;
9pub mod ctx_checkpoint;
10pub mod ctx_compile;
11pub mod ctx_compose;
12pub mod ctx_compress;
13pub mod ctx_compress_memory;
14pub mod ctx_context;
15pub mod ctx_control;
16pub mod ctx_cost;
17pub mod ctx_dedup;
18pub mod ctx_delta;
19pub mod ctx_discover;
20pub mod ctx_discover_tools;
21pub mod ctx_edit;
22pub mod ctx_execute;
23pub mod ctx_expand;
24pub mod ctx_feedback;
25pub mod ctx_fill;
26pub mod ctx_gain;
27pub mod ctx_git_read;
28pub mod ctx_glob;
29pub mod ctx_graph;
30pub mod ctx_handoff;
31pub mod ctx_heatmap;
32pub mod ctx_impact;
33pub mod ctx_index;
34pub mod ctx_intent;
35pub mod ctx_knowledge;
36pub mod ctx_ledger;
37pub mod ctx_load_tools;
38pub mod ctx_metrics;
39pub mod ctx_multi_read;
40pub mod ctx_multi_repo;
41pub mod ctx_outline;
42pub mod ctx_overview;
43pub mod ctx_pack;
44pub mod ctx_package;
45pub mod ctx_plan;
46pub mod ctx_plugins;
47pub mod ctx_prefetch;
48pub mod ctx_preload;
49pub mod ctx_proof;
50pub mod ctx_provider;
51pub mod ctx_radar;
52pub mod ctx_read;
53pub mod ctx_refactor;
54pub mod ctx_repomap;
55pub mod ctx_response;
56pub mod ctx_retrieve;
57pub mod ctx_review;
58pub mod ctx_routes;
59pub mod ctx_rules;
60pub mod ctx_search;
61pub mod ctx_semantic_search;
62pub mod ctx_session;
63pub mod ctx_share;
64pub mod ctx_shell;
65pub mod ctx_skillify;
66pub mod ctx_smart_read;
67pub mod ctx_smells;
68pub mod ctx_summary;
69pub mod ctx_symbol;
70pub mod ctx_task;
71pub mod ctx_tools;
72pub mod ctx_tree;
73pub mod ctx_url_read;
74pub mod ctx_verify;
75pub mod ctx_workflow;
76pub mod plugin_tool;
77pub mod shell_alias;
78
79pub(crate) fn resolve_path_sync(
83 session: &crate::core::session::SessionState,
84 raw: &str,
85) -> Result<String, String> {
86 crate::core::path_resolve::resolve_tool_path(
87 session.project_root.as_deref(),
88 session.shell_cwd.as_deref(),
89 raw,
90 )
91}
92
93#[cfg(test)]
94mod adoption_tests {
95 use super::*;
96 use crate::core::terse::mcp_compress::{compress_description, DescriptionMode};
97 use crate::server::tool_trait::McpTool;
98
99 #[test]
104 fn native_competing_tools_steer_in_first_line() {
105 let tools: Vec<(&str, Box<dyn McpTool>)> = vec![
106 ("ctx_read", Box::new(ctx_read::CtxReadTool)),
107 ("ctx_search", Box::new(ctx_search::CtxSearchTool)),
108 ("ctx_shell", Box::new(ctx_shell::CtxShellTool)),
109 ("ctx_tree", Box::new(ctx_tree::CtxTreeTool)),
110 ];
111 for (name, tool) in tools {
112 let def = tool.tool_def();
113 let desc = def.description.as_deref().unwrap_or("");
114 let first = desc.lines().next().unwrap_or("");
115
116 assert!(
117 first.contains("Prefer over native"),
118 "{name}: first line must steer toward ctx_* over native: {first:?}"
119 );
120 assert!(
121 first.len() <= 80,
122 "{name}: first line is {} bytes (>80 truncates under Lazy mode): {first:?}",
123 first.len()
124 );
125
126 let lazy = compress_description(name, desc, DescriptionMode::Lazy);
128 assert!(
129 lazy.contains("native"),
130 "{name}: steering lost under Lazy compression: {lazy:?}"
131 );
132 }
133 }
134}