Skip to main content

awaken_tool_pattern/
lib.rs

1//! Tool call pattern matching engine.
2//!
3//! Provides types and functions for matching tool calls by name (glob/regex/exact)
4//! and optionally by argument-level conditions on JSON fields. Used by permission
5//! rules, reminder rules, and other extensions that need to match tool calls.
6
7mod matcher;
8mod parser;
9mod tool_id;
10mod types;
11
12pub use matcher::{
13    evaluate_field_condition, evaluate_op, op_precision, pattern_matches, resolve_path,
14    schema_has_path, validate_pattern_fields, value_to_string, wildcard_match,
15};
16pub use parser::{PatternParseError, parse_pattern};
17pub use tool_id::{ToolIdPatternError, tool_id_match, validate_tool_id_pattern};
18pub use types::{
19    ArgMatcher, FieldCondition, MatchOp, MatchResult, PathSegment, Specificity, ToolCallPattern,
20    ToolMatcher,
21};