MCPcopy Create free account
hub / github.com/AI45Lab/Code / response_to_result

Method response_to_result

core/src/hooks/engine.rs:377–386  ·  view source on GitHub ↗

Convert HookResponse to HookResult

(&self, response: HookResponse)

Source from the content-addressed store, hash-verified

375
376 /// Convert HookResponse to HookResult
377 fn response_to_result(&self, response: HookResponse) -> HookResult {
378 match response.action {
379 HookAction::Continue => HookResult::Continue(response.modified),
380 HookAction::Block => {
381 HookResult::Block(response.reason.unwrap_or_else(|| "Blocked".to_string()))
382 }
383 HookAction::Retry => HookResult::Retry(response.retry_delay_ms.unwrap_or(1000)),
384 HookAction::Skip => HookResult::Skip,
385 }
386 }
387
388 /// Get the number of registered hooks
389 pub fn hook_count(&self) -> usize {

Callers 1

execute_hookMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected