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
//! The [`Tool`] trait: a leashable capability.
use async_trait;
use crate::;
/// A capability the agent can invoke, governed by the leash.
///
/// A tool declares the authority it needs via [`Tool::required`]; the
/// [`crate::Gate`] confines the grant to `granted.meet(required)` and hands the
/// tool a [`ToolContext`] minted from that meet. The tool can only act through
/// the context's `check_*` methods, so it can never exceed what it declared or
/// what the session was granted.