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
//! Built-in tools for Merry runtimes.
//!
//! This crate owns Merry-provided tool implementations and adapts filesystem
//! bounded text/image reads and opt-in constrained workspace edits into
//! runtime-registered tools without making the runtime own real workspace
//! access policy. The public `merry::tool` declaration macro is re-exported by
//! the facade crate; this crate only contains the implementation dependency.
//!
//! A workspace has one root. A relative path is normalized to root-relative
//! components and dot segments are resolved lexically; an absolute path is used
//! as the caller named it, and an absolute path below the workspace root is
//! rewritten to its relative spelling so one file never has two identities. A
//! path outside the workspace root is not limited to a configured root, because
//! the process sandbox, accepted process profile, and trusted path rules already
//! decide which paths exist and which of them are writable. Every spelling is
//! accepted, including dot-prefixed components. A relative path is walked
//! without following symlink components, and on Unix file opens also use
//! `O_NOFOLLOW` to avoid following a symlink swapped into the leaf path between
//! validation and open. This is not an OS sandbox and does not claim complete
//! hardening against malicious concurrent filesystem mutation, including
//! replacement of intermediate directories during an operation.
use ToolSpec;
use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use WorkspaceTools;
pub use ;
/// Registered tool name for bounded read-only file reads (UTF-8 text, images, PDFs, Office docs, and notebooks).
pub const READ_FILE_TOOL: &str = "read_file";
/// Registered tool name for opt-in constrained file patches.
pub const APPLY_PATCH_TOOL: &str = "apply_patch";