Proc macros for the Hush workflow engine.
Provides:
#[hush_op] — auto-register Rust ops via inventory
#[hush_model] — shorthand for #[derive(Serialize, Deserialize, Debug, Clone)]
Usage
use hush_serve::{hush_op, hush_model};
#[hush_model]
struct Conversation { vads: Vec<Vad> }
#[hush_op]
fn double(inputs: &Value) -> Value {
let x = inputs["x"].as_i64().unwrap();
serde_json::json!({"result": x * 2})
}
#[hush_op]
fn classify(conversation: Conversation, threshold: f64) -> ClassifyResult {
}
#[hush_op(generator)]
fn each_item(inputs: &Value) -> Value {
let items = inputs["items"].as_array().unwrap();
Value::Array(items.iter().map(|i| serde_json::json!({"value": i})).collect())
}