# `LlmToolkit`
[🔗](https://github.com/fosferon/llm_toolkit/blob/v0.1.0/{path}#L{line})

Base code tools for agentic LLM execution.

LlmToolkit provides the fundamental tools every agentic consumer needs to
interact with a filesystem, shell, and the web — read, write, edit, bash,
grep, glob, tree, and http_get. Each tool implements `LlmToolkit.ToolResolver`.

## Usage

    # Use the default tool resolver (cwd = ".")
    defmodule MyAgent do
      @resolver LlmToolkit.CodeTools

      def run(task) do
        MyAgent.Loop.run(task, @resolver, [])
      end
    end

    # Use with a specific working directory
    resolver = {LlmToolkit.CodeTools, "/path/to/project"}

# `resolver`

```elixir
@spec resolver(String.t()) :: {module(), String.t()}
```

Creates a ToolResolver function bound to a working directory.

Returns a tuple `{LlmToolkit.CodeTools, cwd}` suitable for use
as a resolver in any agent loop that accepts `ToolResolver` modules.

## Examples

    iex> LlmToolkit.resolver("/tmp/project")
    {LlmToolkit.CodeTools, "/tmp/project"}

# `resolver_fn`

```elixir
@spec resolver_fn(String.t()) :: (LlmToolkit.Tool.Call.t() -&gt;
                              {:ok, String.t()} | {:error, String.t()})
```

Creates a resolver closure for use in contexts that expect
a simple function, not a tuple.

## Examples

    resolver = LlmToolkit.resolver_fn("/tmp/project")
    {:ok, content} = resolver.(%Call{name: "read_file", arguments: %{"path" => "README.md"}})

---

*Consult [api-reference.md](api-reference.md) for complete listing*
