Skip to main content

adk_devtools/
lib.rs

1//! # adk-devtools
2//!
3//! Developer tools for ADK-Rust coding agents — `read_file`, `write_file`,
4//! `edit_file`, `glob`, `grep`, and `bash` — all scoped to a sandboxed
5//! [`Workspace`].
6//!
7//! These are the inner-loop tools a coding agent needs: read and edit files,
8//! search the tree, and run commands/tests. Every operation is rooted at a
9//! workspace directory and rejected if it escapes; mutations and `bash` are
10//! gated by the workspace's capability flags.
11//!
12//! ## Quick start
13//!
14//! ```rust,ignore
15//! use adk_devtools::{DevToolset, Workspace};
16//! use adk_agent::LlmAgentBuilder;
17//! use std::sync::Arc;
18//!
19//! let workspace = Workspace::new("./my-repo");
20//! let agent = LlmAgentBuilder::new("coding-agent")
21//!     .model(model)
22//!     .toolset(Arc::new(DevToolset::new(workspace)))
23//!     .build()?;
24//! ```
25//!
26//! ## Sandboxing
27//!
28//! [`Workspace`] enforces **path containment** (no escaping the root),
29//! **read-only** mode (deny writes/bash), and a **bash timeout**. Phase 1 runs
30//! `bash` host-local; for strong isolation, run behind a containerized
31//! `CodeExecutor` (see `docs/design/coding-agent.md`). The policy vocabulary is
32//! aligned with `adk-code`'s `SandboxPolicy` and will integrate with it directly
33//! in a later phase.
34
35mod error;
36mod toolset;
37mod workspace;
38
39pub mod tools;
40
41pub use error::DevToolError;
42pub use tools::{BashTool, EditFileTool, GlobTool, GrepTool, ReadFileTool, WriteFileTool};
43pub use toolset::DevToolset;
44pub use workspace::{DEFAULT_ENV_ALLOWLIST, Workspace};