use std::path::PathBuf;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProcedureSchema {
pub id: String,
pub title: String,
pub description: String,
pub input: serde_json::Value,
pub output: serde_json::Value,
#[serde(skip_serializing_if = "Option::is_none")]
pub entry_point: Option<EntryPoint>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EntryPoint {
pub filename: String,
pub command: String,
}
#[derive(Debug, Clone)]
pub struct ProcedureDef {
pub id: String,
pub schema: ProcedureSchema,
pub wasm_path: Option<PathBuf>,
pub entry_point: Option<EntryPoint>,
pub doc_path: PathBuf,
pub schema_path: PathBuf,
}
impl ProcedureDef {
pub fn is_runnable(&self) -> bool {
self.wasm_path.is_some() || self.entry_point.is_some()
}
}