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

Method invoke_hook

crates/opencode-plugin/src/subprocess/client.rs:215–228  ·  view source on GitHub ↗

Invoke a hook on the plugin.

(
        &self,
        hook: &str,
        input: Value,
        output: Value,
    )

Source from the content-addressed store, hash-verified

213
214 /// Invoke a hook on the plugin.
215 pub async fn invoke_hook(
216 &self,
217 hook: &str,
218 input: Value,
219 output: Value,
220 ) -> Result<Value, PluginSubprocessError> {
221 let params = serde_json::json!({
222 "hook": hook,
223 "input": input,
224 "output": output,
225 });
226 let result: Value = self.call("hook.invoke", Some(params)).await?;
227 Ok(result.get("output").cloned().unwrap_or(Value::Null))
228 }
229
230 /// Trigger OAuth authorization flow.
231 pub async fn auth_authorize(

Callers 2

register_client_hooksMethod · 0.80

Calls 2

callMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected