Expand description
Core tool execution runtime for Statespace.
Provides tool parsing, frontmatter extraction, command validation, and sandboxed execution with security protections (SSRF, path traversal).
ⓘ
use statespace_tool_runtime::{BuiltinTool, ToolExecutor, ExecutionLimits};
let tool = BuiltinTool::from_command(&["cat".to_string(), "file.md".to_string()])?;
let executor = ToolExecutor::new(PathBuf::from("./toolsite"), ExecutionLimits::default());
let output = executor.execute(&tool).await?;Re-exports§
pub use env_validation::EnvValidationError;pub use env_validation::validate_env_map;pub use error::Error;pub use error::Result;pub use executor::ExecutionLimits;pub use executor::ToolExecutor;pub use executor::ToolOutput;pub use frontmatter::Frontmatter;pub use frontmatter::parse_frontmatter;pub use protocol::ActionRequest;pub use protocol::ActionResponse;pub use protocol::ErrorResponse;pub use protocol::SuccessResponse;pub use sandbox::SandboxEnv;pub use security::is_private_or_restricted_ip;pub use security::validate_url_initial;pub use spec::CompiledRegex;pub use spec::SpecError;pub use spec::ToolPart;pub use spec::ToolSpec;pub use spec::find_matching_spec;pub use spec::is_valid_tool_call;pub use tools::BuiltinTool;pub use tools::HttpMethod;pub use validation::expand_command_for_execution;pub use validation::expand_env_vars;pub use validation::validate_command;pub use validation::validate_command_with_specs;
Modules§
- env_
validation - error
- Error types for the tool runtime.
- eval
- Component block processing for dynamic markdown content.
- executor
- Tool execution with sandboxing and resource limits.
- frontmatter
- Frontmatter parsing for YAML (
---) and TOML (+++) formats. - protocol
- Tool execution request/response protocol.
- sandbox
- security
- SSRF protection for the curl tool.
- spec
- Tool specification parsing and validation.
- tools
- Tool domain models
- validation
- Command validation and env expansion.