Skip to main content

rig_resources/
lib.rs

1//! Reusable resources for [rig-compose](https://crates.io/crates/rig-compose) agents.
2//!
3//! `rig-compose` owns the kernel traits and runtime composition surfaces.
4//! This crate owns reusable implementations: skills, tools, pattern
5//! registries, baseline stores, and optional graph resources.
6
7#![deny(missing_docs)]
8#![cfg_attr(
9    test,
10    allow(
11        clippy::unwrap_used,
12        clippy::expect_used,
13        clippy::indexing_slicing,
14        clippy::panic,
15        clippy::panic_in_result_fn,
16    )
17)]
18
19pub mod baseline;
20pub mod memory;
21pub mod patterns;
22pub mod projection;
23pub mod skills;
24pub mod trace;
25
26#[cfg(feature = "graph")]
27pub mod graph;
28
29#[cfg(feature = "security")]
30pub mod security;
31
32pub use baseline::{
33    BaselineCompareTool, BaselineError, BaselineStore, EntityBaseline, InMemoryBaselineStore,
34    OnlineStats, baseline_compare_trace_envelope,
35};
36pub use memory::{
37    MemoryLookupError, MemoryLookupHit, MemoryLookupStore, MemoryLookupTool,
38    memory_lookup_trace_envelope,
39};
40pub use patterns::{
41    BehaviorPattern, BehaviorPatternSkill, BehaviorRegistry, PatternId, PatternRule,
42};
43#[cfg(feature = "graph")]
44pub use projection::subgraph_to_context_item;
45pub use projection::{
46    IntoContextItem, evidence_to_context_item, evidence_to_context_items,
47    memory_hit_to_context_item, memory_hits_to_context_items, pack_resource_context,
48};
49pub use skills::{BaselineCompareSkill, MemoryPivotSkill};
50pub use trace::ResourceTraceEnvelope;
51
52#[cfg(feature = "graph")]
53pub use graph::{
54    GraphEdge, GraphError, GraphExpansionConfig, GraphExpansionSkill, GraphStore, GraphTool,
55    InMemoryGraph, Subgraph,
56};
57
58#[cfg(feature = "security")]
59pub use security::{
60    FindingSeverity, SecurityFinding, security_finding_to_context_item,
61    security_finding_trace_envelope, security_findings_to_context_items,
62};