Skip to content

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

refactor(cron): expose shared handler helpers to the schemas module

Steven Enamakel5c20256122e8
diff --git a/crates/openhuman-core/src/cron/schemas.rs b/crates/openhuman-core/src/cron/schemas.rs
index 2a1b9abef5..dc3ad10ebf 100644
--- a/crates/openhuman-core/src/cron/schemas.rs
+++ b/crates/openhuman-core/src/cron/schemas.rs
@@ -8,6 +8,7 @@ use tinyflows_bus::schedule::types::{CronJobPatch, DeliveryConfig};
mod declarations;
mod handlers;
+use handlers::*;
pub use declarations::{all_controller_schemas, all_registered_controllers, schemas};
diff --git a/crates/openhuman-core/src/cron/schemas/handlers.rs b/crates/openhuman-core/src/cron/schemas/handlers.rs
index 049e5ac4b9..60e5ebcce9 100644
--- a/crates/openhuman-core/src/cron/schemas/handlers.rs
+++ b/crates/openhuman-core/src/cron/schemas/handlers.rs
@@ -179,7 +179,7 @@ pub(super) fn handle_runs(ctx: DispatchCtx, params: Map<String, Value>) -> Contr
})
}
-fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) -> Result<T, String> {
+pub(super) fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) -> Result<T, String> {
let value = params
.get(key)
.cloned()
@@ -209,7 +209,7 @@ fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {
outcome.into_cli_compatible_json()
}
-pub(super) fn type_name(value: &Value) -> &'static str {
+pub(super) pub(super) fn type_name(value: &Value) -> &'static str {
match value {
Value::Null => "null",
Value::Bool(_) => "bool",
diff --git a/crates/openhuman-core/src/flows/schemas/handlers/draft.rs b/crates/openhuman-core/src/flows/schemas/handlers/draft.rs
index b6e3c8834a..a6a245a234 100644
--- a/crates/openhuman-core/src/flows/schemas/handlers/draft.rs
+++ b/crates/openhuman-core/src/flows/schemas/handlers/draft.rs
@@ -88,7 +88,7 @@ pub(super) fn handle_draft_promote(
})
}
-fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) -> Result<T, String> {
+pub(super) fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) -> Result<T, String> {
let value = params
.get(key)
.cloned()