Expand description
Hook protocol abstraction for multi-agent support.
Each coding agent sends/receives hook JSON in a different format.
The HookProtocol trait encapsulates these differences so the
core permission logic works identically regardless of which agent
is calling.
Most methods have default implementations that handle the common case.
Adding a new agent typically requires overriding only HookProtocol::agent
and HookProtocol::parse_tool_use. Override format methods only if
the agent uses a non-standard output format.
Traits§
- Hook
Protocol - Abstraction over agent-specific hook JSON formats.
Functions§
- get_
protocol - Construct the appropriate protocol implementation for an agent.
- json_
str - Extract a string field from JSON, returning “” if missing.
- json_
str_ any - Extract a string from one of several possible field names.
- json_
str_ or - Extract a string field from JSON with a default value.
- json_
value_ any - Extract an optional Value from one of several possible field names.
- shell_
escape - Shell-escape a string for safe inclusion in a shell command.