| Crates.io | llm-coding-tools-core |
| lib.rs | llm-coding-tools-core |
| version | 0.1.0 |
| created_at | 2026-01-20 19:47:22.563404+00 |
| updated_at | 2026-01-20 19:47:22.563404+00 |
| description | Lightweight, high-performance core types and utilities for coding tools - framework agnostic |
| homepage | |
| repository | https://github.com/Sewer56/llm-coding-tools |
| max_upload_size | |
| id | 2057376 |
| size | 252,848 |
Lightweight, high-performance core types and utilities for coding tools - framework agnostic.
This crate provides the foundational building blocks for coding tool implementations:
ToolError - Unified error type for all tool operationsToolResult<T> - Result type alias using ToolErrorToolOutput - Wrapper for tool responses with truncation metadatacontext module - LLM guidance strings for tool usagetokio (default): Async mode with tokio runtime. Enables async function signatures.blocking: Sync/blocking mode. Mutually exclusive with tokio/async.async: Base async signatures (internal). Requires a runtime; use tokio instead.The async and blocking features are mutually exclusive - enabling both causes a compile error.
Future runtimes (smol, async-std) can be added following the same pattern as tokio.
use llm_coding_tools_core::{ToolError, ToolResult, ToolOutput};
use llm_coding_tools_core::util::{truncate_text, format_numbered_line};
The context module provides embedded strings containing usage guidance for LLM agents.
These can be appended to tool descriptions or system prompts.
Path-based tools have two variants:
*_ABSOLUTE: For unrestricted filesystem access (absolute paths required)*_ALLOWED: For sandboxed access (paths relative to allowed directories)use llm_coding_tools_core::context::{BASH, READ_ABSOLUTE, READ_ALLOWED};
// Non-path tools have a single variant
println!("{}", BASH);
// Path-based tools have absolute and allowed variants
println!("{}", READ_ABSOLUTE);
println!("{}", READ_ALLOWED);
Available context strings:
BASH, TASK, TODO_READ, TODO_WRITE, WEBFETCH - standalone toolsREAD_ABSOLUTE, READ_ALLOWED - file readingWRITE_ABSOLUTE, WRITE_ALLOWED - file writingEDIT_ABSOLUTE, EDIT_ALLOWED - file editingGLOB_ABSOLUTE, GLOB_ALLOWED - pattern matchingGREP_ABSOLUTE, GREP_ALLOWED - content search