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
use crateAutoApprove;
/// Return whether a tool may run under the selected auto-approve policy.
///
/// # Examples
///
/// ```rust
/// use codetether_agent::a2a::worker::AutoApprove;
/// use codetether_agent::a2a::worker_tool_registry::is_tool_allowed;
///
/// assert!(is_tool_allowed("read", AutoApprove::Safe));
/// assert!(is_tool_allowed("todoread", AutoApprove::Safe));
/// assert!(!is_tool_allowed("write", AutoApprove::Safe));
/// assert!(is_tool_allowed("write", AutoApprove::All));
/// ```
/// Return whether a tool belongs to the worker's read-only safe list.
///
/// # Examples
///
/// ```rust
/// use codetether_agent::a2a::worker_tool_registry::is_safe_tool;
///
/// assert!(is_safe_tool("read"));
/// assert!(is_safe_tool("todoread"));
/// assert!(!is_safe_tool("write"));
/// ```