| Crates.io | llm-coding-tools-serdesai |
| lib.rs | llm-coding-tools-serdesai |
| version | 0.1.0 |
| created_at | 2026-01-20 20:13:28.214714+00 |
| updated_at | 2026-01-20 20:13:28.214714+00 |
| description | Lightweight, high-performance serdesAI framework Tool implementations for coding tools |
| homepage | |
| repository | https://github.com/Sewer56/llm-coding-tools |
| max_upload_size | |
| id | 2057460 |
| size | 181,655 |
Lightweight, high-performance serdesAI framework Tool implementations for coding tools.
absolute::* - Unrestricted filesystem accessallowed::* - Sandboxed to configured directoriesAdd to your Cargo.toml:
[dependencies]
llm-coding-tools-serdesai = "0.1"
Minimal runnable agent (requires OPENAI_API_KEY):
use llm_coding_tools_serdesai::absolute::{GlobTool, GrepTool, ReadTool};
use llm_coding_tools_serdesai::agent_ext::AgentBuilderExt;
use llm_coding_tools_serdesai::{BashTool, SystemPromptBuilder, create_todo_tools};
use serdes_ai::prelude::*;
#[tokio::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
let (todo_read, todo_write, _state) = create_todo_tools();
let mut pb = SystemPromptBuilder::new();
// Build agent with tools - call .system_prompt() last
let agent = AgentBuilder::<(), String>::from_model("openai:gpt-4o")?
.tool(pb.track(ReadTool::<true>::new()))
.tool(pb.track(GlobTool::new()))
.tool(pb.track(GrepTool::<true>::new()))
.tool(pb.track(BashTool::new()))
.tool(pb.track(todo_read))
.tool(pb.track(todo_write))
.system_prompt(pb.build()) // Last, after tracking all tools
.build();
// Run agent with tools
let response = agent
.run("Search for TODO comments in src/", ())
.await?;
println!("{}", response.output());
Ok(())
}
See the serdesai-basic example for a complete working setup.
File tools come in absolute::* (unrestricted) and allowed::* (sandboxed) variants:
use llm_coding_tools_serdesai::absolute::{ReadTool, WriteTool};
use llm_coding_tools_serdesai::allowed::{ReadTool as AllowedReadTool, WriteTool as AllowedWriteTool};
use llm_coding_tools_serdesai::AllowedPathResolver;
use std::path::PathBuf;
// Unrestricted access (absolute paths)
let read = ReadTool::<true>::new();
// Sandboxed access (paths relative to allowed directories)
let allowed_paths = vec![PathBuf::from("/home/user/project"), PathBuf::from("/tmp")];
let resolver = AllowedPathResolver::new(allowed_paths).unwrap();
let sandboxed_read: AllowedReadTool<true> = AllowedReadTool::new(resolver.clone());
let sandboxed_write = AllowedWriteTool::new(resolver);
Other tools: BashTool, WebFetchTool, TaskTool, TodoReadTool, TodoWriteTool.
Use SystemPromptBuilder to track tools and pass pb.build() to .system_prompt(). Set working_directory() so the environment section is populated.
Use AgentBuilderExt::tool() to add tools that implement Tool<Deps> to the agent.
Context strings are re-exported in llm_coding_tools_serdesai::context (e.g., BASH, READ_ABSOLUTE).
# Basic agent setup with AgentBuilderExt
cargo run --example serdesai-basic -p llm-coding-tools-serdesai
# Sandboxed file access with allowed::* tools
cargo run --example serdesai-sandboxed -p llm-coding-tools-serdesai
Apache 2.0