Skip to main content

Crate awaken_tool_pattern

Crate awaken_tool_pattern 

Source
Expand description

Tool call pattern matching engine.

Provides types and functions for matching tool calls by name (glob/regex/exact) and optionally by argument-level conditions on JSON fields. Used by permission rules, reminder rules, and other extensions that need to match tool calls.

Structs§

FieldCondition
A single field-level predicate: path op "value".
PatternParseError
Error returned when a pattern string cannot be parsed.
Specificity
Specificity of a pattern match, used for priority ordering.
ToolCallPattern
A complete pattern matching tool calls by name and optionally by arguments.

Enums§

ArgMatcher
How to match the arguments portion of a tool call.
MatchOp
Comparison operator for field conditions.
MatchResult
Result of matching a pattern against a tool call.
PathSegment
A single segment in a dotted field path.
ToolIdPatternError
ToolMatcher
How to match the tool name portion of a call.

Functions§

evaluate_field_condition
Evaluate a single field condition against a JSON value.
evaluate_op
Evaluate a match operator against a string value.
op_precision
Precision score for an operator (used in specificity).
parse_pattern
Parse a pattern string into a ToolCallPattern.
pattern_matches
Evaluate whether a pattern matches a tool call.
resolve_path
Resolve a dotted path against a JSON value, returning all matching leaf values.
schema_has_path
Check if a JSON Schema has properties along the given path.
tool_id_match
Match a tool-id glob pattern against a literal tool id.
validate_pattern_fields
Validate that a pattern’s field references exist in a tool’s JSON Schema.
validate_tool_id_pattern
Validate that a tool-id pattern string is syntactically well-formed.
value_to_string
Convert a JSON value to a string for matching.
wildcard_match
Wildcard match where * matches any characters including /.