Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(core): add decode_params method to controller entry

Steven Enamakelf6d06bc231ad
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index a5aea073b4..19680613bf 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -146,6 +146,17 @@ impl ControllerEntry {
rpc_method_name(&self.schema)
}
+ /// Decode params with a bound runtime parser, when this entry has one.
+ pub fn decode_params(&self, params: Map<String, Value>) -> Result<(), String> {
+ match &self.handler {
+ EntryHandler::Legacy(_) => Err(format!(
+ "{} has no bound parser",
+ self.schema.method_name()
+ )),
+ EntryHandler::Bound(handler) => handler.decode_params(params),
+ }
+ }
+
fn legacy_controller(&self) -> Option<RegisteredController> {
match &self.handler {
EntryHandler::Legacy(handler) => Some(RegisteredController {