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
43
44
45
46
47
48
49
50
51
52
53
54
//! Data-driven provider capabilities.
//!
//! The per-(provider, model) capability matrix (native tools, deferred
//! tool loading, tool-search variants, prompt caching, extended thinking,
//! max tool count) lives in `capability_sources/**/*.toml`, which generates
//! the shipped `capabilities.toml` snapshot, and is
//! overridable per-project via `[[capabilities.provider.<name>]]` blocks
//! in `harn.toml`. This module owns:
//!
//! - loading the built-in TOML (compiled in via `include_str!`);
//! - merging user overrides on top;
//! - matching a `(provider, model)` pair against the rule list with
//! glob + semver semantics;
//! - exposing a stable `Capabilities` struct that the `LlmProvider`
//! trait delegates to as the single source of truth.
//!
//! Provider adapters still supply generation parsers for `version_min`, but
//! feature gates live in this data table instead of adapter-specific boolean
//! branches.
//!
//! The concrete data model and engine are split across submodules: `model`
//! (capability DTOs + [`WireDialect`]), `rule` ([`ProviderRule`] + the
//! resolution engine), `tool_format` (tool-call dialect validation), `audit`
//! (coverage audit + display matrix), and `lookup` (the override facade and
//! public [`lookup`] entry points). Every previously-public item is re-exported
//! here so `capabilities::X` paths resolve unchanged.
/// Generated shipped default rules. Compiled into the binary at build time.
pub const BUILTIN_TOML: &str = include_str!;
/// Generated provider/model snapshot built from catalog_sources/**/*.toml.
pub const BUILTIN_PROVIDERS_TOML: &str = include_str!;
pub use ;
pub use ;
pub use ;
pub use ProviderRule;
pub use ;