Skip to main content

scv_tools/
lib.rs

1//! SCV's bounded, workspace-aware built-in tools.
2//!
3//! [`builtin_registry`] builds a session's tools: files (`read`,
4//! `read_skill`, `write`), the shell (`bash`), the web (`web_fetch`,
5//! `web_search`), delegation to other agent CLIs and to a nested SCV
6//! (`agent`, with background jobs), and `chat_attach` for chat sessions.
7//! [`delegation`] records every delegated process so SCV can list, stop, and
8//! clean them up.
9//!
10//! The source is laid out by what a tool does:
11//!
12//! - `builtin/`: tools that run inside SCV (`fs`, `skill`, `shell`, [`web`],
13//!   [`chat_attach`]).
14//! - `delegate/`: the `agent` tool that hands a turn to another agent, named
15//!   as its argument, on one of three backends: one CLI process per turn
16//!   (`native`), a long-lived Agent Client Protocol server (`acp`), or a
17//!   nested SCV (`scv`); the [`adapters`] table,
18//!   [`background`] jobs, [`conversation`] handles, run records
19//!   ([`delegation`]), the agents' own credential files ([`stores`]), and
20//!   how a run's output and progress are read.
21//! - `process`: spawning a child in its own process group and always
22//!   finishing the whole group.
23//! - `registry`, `config`, and `args`: assembling a session's tools, their
24//!   settings, and the argument helpers they share.
25//! - [`workbench`]: the daemon's view of every delegated agent, background
26//!   job, and session of the instance, and the owner's actions on them.
27
28mod args;
29mod builtin;
30mod config;
31mod delegate;
32mod process;
33pub mod project_environment;
34mod registry;
35mod sync;
36pub mod workbench;
37
38pub use builtin::{chat_attach, chat_history, web};
39pub use config::{
40    AcpAgentLaunch, AgentAdapterConfig, AgentAuthPlan, AgentDefaults, BusyBehavior, BusyConfig,
41    DelegationContext, Skill, SkillMap, ToolsConfig,
42};
43pub use delegate::{
44    activity, adapters,
45    agent::offered_agents,
46    background, choice as agent_choice, claude_auth, conversation, options as agent_options,
47    records as delegation,
48    request::{AGENT_EFFORTS, valid_effort, valid_model_name},
49    stores, worktree,
50};
51pub use process::apply_agent_environment;
52pub use registry::{Reach, builtin_registry, call_agent, reach};