Skip to main content

Crate entelix_tools

Crate entelix_tools 

Source
Expand description

§entelix-tools

Built-in entelix_core::tools::Tool impls. First-party code touches zero std::fs / std::process (Invariant 9); shell- and filesystem-class tools delegate execution through the entelix_core::sandbox::Sandbox trait, whose concrete implementations ship as 1.x companion crates.

§Surface

  • HttpFetchTool — HTTP fetch with mandatory host allowlist (SSRF defense), redirect cap, response-size cap, method allowlist, cancellation-aware. The allowlist is opt-in by construction: an HttpFetchTool::builder() without any allowed hosts produces a tool that refuses every URL.
  • HostAllowlist — domain / wildcard / literal-IP rules with a fail-closed default policy.
  • Calculator — arithmetic over f64 (+ - * / parens). Recursive-descent parser; no eval or shell-out. Generated from a free async fn via the tool macro.
  • SearchProvider (trait) + SearchTool — adapter for external search APIs (Brave / Tavily / Perplexity / …). Concrete providers are deferred to 1.1 (same trait-only policy as for Embedder).

Coding-agent vertical tools (SandboxedShellTool, SandboxedCodeTool, Sandboxed{Read,Write,ListDir}FileTool, ShellPolicy, CodePolicy, SandboxSkill) live in the entelix-tools-coding companion crate so this horizontal surface stays free of coding-shape opinions.

Re-exports§

pub use calculator::Calculator;
pub use calculator::CalculatorInput;
pub use calculator::CalculatorOutput;
pub use skills::ActivateSkillTool;
pub use skills::InMemorySkill;
pub use skills::InMemorySkillBuilder;
pub use skills::ListSkillsTool;
pub use skills::ReadSkillResourceTool;
pub use skills::StaticResource;

Modules§

calculator
Calculator — arithmetic over f64.
memory
LLM-facing memory tools — let the model query, mutate, and prune the agent’s long-term memory by emitting tool calls.
skills
In-memory skill plus the three LLM-facing tools that drive progressive disclosure.

Structs§

HostAllowlist
Host allowlist. Fail-closed: empty allowlist rejects everything.
HttpFetchTool
HTTP fetch Tool for agentic workflows.
HttpFetchToolBuilder
Builder for HttpFetchTool.
SchemaToolAdapter
Adapter that exposes any SchemaTool through the erased Tool trait.
SearchResult
One search hit.
SearchTool
Tool wrapper around a SearchProvider.
SsrfSafeDnsResolver
reqwest::dns::Resolve impl that vets every resolved IP against is_ssrf_blocked before handing addresses back to the HTTP connector. See module docs for the threat model.

Enums§

HostRule
One allowlist rule.
ToolError
Tool-layer failures.

Constants§

DEFAULT_FETCH_TIMEOUT
Default per-call timeout.
DEFAULT_MAX_REDIRECTS
Default cap on redirect chain length.
DEFAULT_MAX_RESPONSE_BYTES
Default cap on response body size (1 MiB).
DEFAULT_MAX_RESULTS
Default cap on results returned per query.

Traits§

SchemaTool
Typed-I/O sibling of Tool. Implementors get Input/Output typed against the model’s tool dispatch without giving up the erased trait the rest of the SDK speaks.
SchemaToolExt
Provided extension methods on every SchemaTool. Lives in a separate trait so blanket-impls (e.g. Box<dyn SchemaTool>) don’t fight with the user-implemented SchemaTool trait associated types.
SearchProvider
Adapter trait the SearchTool dispatches to.

Functions§

is_ssrf_blocked
Returns true for IPs the SDK refuses to connect to by default.

Type Aliases§

ToolResult
Result alias used inside entelix-tools.

Attribute Macros§

tool
#[tool] attribute macro — generates a SchemaTool impl from an async fn signature. Doc-comment first paragraph becomes the tool description; the function name (snake_case) becomes the tool struct name (PascalCase). See the entelix-tool-derive crate docs for the full contract. Generate an entelix_tools::SchemaTool impl from an async fn. See the crate-level docs for the contract and an example.