MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / trigger_collect

Function trigger_collect

crates/opencode-plugin/src/lib.rs:316–327  ·  view source on GitHub ↗

Convenience: trigger a hook event and collect successful outputs. Errors from individual hooks are logged but do not propagate.

(context: HookContext)

Source from the content-addressed store, hash-verified

314/// Convenience: trigger a hook event and collect successful outputs.
315/// Errors from individual hooks are logged but do not propagate.
316pub async fn trigger_collect(context: HookContext) -> Vec<HookOutput> {
317 let system = global();
318 let results = system.trigger(context).await;
319 let mut outputs = Vec::new();
320 for result in results {
321 match result {
322 Ok(output) => outputs.push(output),
323 Err(e) => tracing::warn!("Plugin hook error: {}", e),
324 }
325 }
326 outputs
327}
328
329/// Convenience: build a HookContext and trigger it on the global system.
330pub async fn trigger_event(event: HookEvent) {

Callers 10

askMethod · 0.85
loop_innerMethod · 0.85
process_streamMethod · 0.85
stream_from_inputMethod · 0.85
notify_text_completeFunction · 0.85
processMethod · 0.85
execute_with_hooksMethod · 0.85
executeMethod · 0.85
list_schemasMethod · 0.85
executeMethod · 0.85

Calls 3

globalFunction · 0.85
newFunction · 0.85
triggerMethod · 0.80

Tested by

no test coverage detected