1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Tool-dispatch: the [`Tool`] trait, registry, typed inputs, and the agent
//! loop runner.
//!
//! Three ergonomic shapes for registering tools:
//!
//! 1. **[`Tool`] trait** -- implement directly when each tool is its own type.
//! Gives full control over the JSON Schema, the async handler, and errors.
//! 2. **[`ToolRegistry::register`]** -- closure-based handler. The registry
//! wraps closures in an internal `FnTool<F>` adapter. Convenient for
//! one-off tools that don't need a dedicated type.
//! 3. **[`TypedTool`] + `ToolRegistry::register_typed`** -- typed-input
//! handler driven by `schemars`. The input JSON is deserialized into a
//! concrete `Args` type before dispatch. Behind the `schemars-tools`
//! feature (or use `#[derive(Tool)]` from `claude-api-derive` for the
//! most ergonomic form).
//!
//! The agent loop lives in [`runner`] (feature `conversation`). It drives
//! repeated `messages.create` calls, dispatching tools in parallel via
//! [`Tool::invoke`], optionally enforcing a cost budget and a mid-stream
//! approval gate.
//!
//! Gated on the `async` feature.
pub use ;
pub use ;
pub use RunOptions;
pub use TypedTool;