(&self, hook_type: HookType, input: &[u8])
| 30 | } |
| 31 | |
| 32 | fn parse_json(&self, hook_type: HookType, input: &[u8]) -> AgentResult<Value> { |
| 33 | if input.is_empty() { |
| 34 | return Err(AgentError::HookInputEmpty { |
| 35 | agent: self.name().to_string(), |
| 36 | hook_type: hook_type.as_str().to_string(), |
| 37 | }); |
| 38 | } |
| 39 | |
| 40 | serde_json::from_slice(input).map_err(|e| AgentError::HookParseFailed { |
| 41 | agent: self.name().to_string(), |
| 42 | hook_type: hook_type.as_str().to_string(), |
| 43 | reason: e.to_string(), |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | fn extract_session_id(raw: &Value) -> String { |
| 48 | value_string(raw, "session_id") |
no test coverage detected