(hook_type: HookType, payload: &str)
| 22 | const SESSION_END: &str = include_str!("fixtures/grok-1.0.77/session_end.json"); |
| 23 | |
| 24 | fn parse(hook_type: HookType, payload: &str) -> TurnEvent { |
| 25 | let registry = AgentRegistry::with_defaults(); |
| 26 | let grok = registry.require("grok").unwrap(); |
| 27 | grok.parse_event(hook_type, payload.as_bytes()) |
| 28 | .unwrap_or_else(|error| panic!("grok {hook_type}: {error}")) |
| 29 | } |
| 30 | |
| 31 | fn raw_str<'a>(event: &'a TurnEvent, key: &str) -> Option<&'a str> { |
| 32 | event.raw_json.as_ref()?.get(key).and_then(Value::as_str) |
no test coverage detected