Skip to main content

soul_coder/
lib.rs

1//! # soul-coder
2//!
3//! Coding-specific tools for [soul-core](https://crates.io/crates/soul-core) —
4//! read, write, edit, bash, grep, find, ls.
5//!
6//! WASM-first, cross-platform. All tools use `soul_core::vfs::VirtualFs` and
7//! `soul_core::vexec::VirtualExecutor` for platform abstraction, enabling
8//! full operation in both native and WebAssembly environments.
9//!
10//! ## Quick Start
11//!
12//! ```rust
13//! use std::sync::Arc;
14//! use soul_core::vfs::MemoryFs;
15//! use soul_core::vexec::NoopExecutor;
16//! use soul_coder::presets;
17//!
18//! // Create all 7 coding tools with in-memory VFS (WASM-ready)
19//! let fs = Arc::new(MemoryFs::new());
20//! let exec = Arc::new(NoopExecutor);
21//! let registry = presets::all_tools(fs, exec, "/workspace");
22//!
23//! assert_eq!(registry.len(), 7);
24//! ```
25//!
26//! ## Tool Presets
27//!
28//! | Preset | Tools | Use Case |
29//! |--------|-------|----------|
30//! | `coding_tools` | read, write, edit, bash | Interactive coding sessions |
31//! | `read_only_tools` | read, grep, find, ls | Codebase exploration |
32//! | `all_tools` | all 7 tools | Full agent capabilities |
33//!
34//! ## Individual Tools
35//!
36//! Each tool can be instantiated independently:
37//!
38//! ```rust
39//! use std::sync::Arc;
40//! use soul_core::vfs::MemoryFs;
41//! use soul_coder::tools::read::ReadTool;
42//!
43//! let fs = Arc::new(MemoryFs::new());
44//! let tool = ReadTool::new(fs, "/workspace");
45//! ```
46
47pub mod presets;
48pub mod tools;
49pub mod truncate;
50
51// Re-export key types for convenience
52pub use presets::{all_tools, coding_tools, read_only_tools};
53pub use tools::{
54    bash::BashTool,
55    edit::EditTool,
56    find::FindTool,
57    grep::GrepTool,
58    ls::LsTool,
59    read::ReadTool,
60    write::WriteTool,
61};