Skip to content

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

refactor(flows): re-export node contracts and store types from tinyflows

Steven Enamakel89925b7aaeaf
diff --git a/crates/openhuman-core/src/flows/mod.rs b/crates/openhuman-core/src/flows/mod.rs
index 927eca5f65..bca9f1db99 100644
--- a/crates/openhuman-core/src/flows/mod.rs
+++ b/crates/openhuman-core/src/flows/mod.rs
@@ -65,10 +65,7 @@ pub use schemas::{
// live run observer (`tinyflows::observability::FlowRunObserver`, issue G2)
// lives in the sibling `tinyflows` domain and persists each finished step onto
// the `flow_runs` row through this function as the run executes.
-pub use node_contracts::{
- all_node_kind_contracts, node_kind_contract, render_node_kinds_line,
- render_node_kinds_required, ConfigField, NodeKindContract, PortSpec, NODE_KINDS,
-};
+pub use {node_contracts::all_node_kind_contracts, node_contracts::node_kind_contract, node_contracts::render_node_kinds_line, node_contracts::render_node_kinds_required, tinyflows::catalog::ConfigField, tinyflows::catalog::NodeKindContract, tinyflows::catalog::PortSpec, tinyflows::catalog::NODE_KINDS};
pub use store::{kv_get, kv_set, upsert_flow_run_step};
pub use tinyflows_catalog::{
DraftOrigin, Flow, FlowConnection, FlowDraft, FlowImport, FlowRevision, FlowRun, FlowRunStep,
diff --git a/crates/openhuman-core/src/flows/ops/run_management.rs b/crates/openhuman-core/src/flows/ops/run_management.rs
index 1ff27b6f69..c8c10cf1f2 100644
--- a/crates/openhuman-core/src/flows/ops/run_management.rs
+++ b/crates/openhuman-core/src/flows/ops/run_management.rs
@@ -157,14 +157,14 @@ pub async fn flows_list_all_runs(
}
/// Manually prunes a flow's run history down to the retention cap
-/// ([`store::MAX_FLOW_RUNS_PER_FLOW`]), deleting only terminal runs outside the
+/// ([`tinyflows_sqlite::flows::MAX_FLOW_RUNS_PER_FLOW`]), deleting only terminal runs outside the
/// newest-N window. Never removes a `running` or `pending_approval` run — a
/// parked run must survive for a later `flows_resume`. Pruning also happens
/// automatically on every new-run insert; this RPC exposes it for an explicit
/// on-demand sweep (e.g. a maintenance action). Returns the number of runs
/// pruned.
pub async fn flows_prune_runs(config: &Config, flow_id: &str) -> Result<Outcome<Value>, String> {
- let keep = store::MAX_FLOW_RUNS_PER_FLOW;
+ let keep = tinyflows_sqlite::flows::MAX_FLOW_RUNS_PER_FLOW;
let pruned = store::prune_flow_runs(config, flow_id, keep).map_err(|e| e.to_string())?;
tracing::info!(target: "flows", flow_id, pruned, keep, "[flows] flows_prune_runs: manual retention sweep");
Ok(Outcome::single_log(
diff --git a/crates/openhuman-core/src/flows/ops/updates.rs b/crates/openhuman-core/src/flows/ops/updates.rs
index fff3f8d61e..988e73337d 100644
--- a/crates/openhuman-core/src/flows/ops/updates.rs
+++ b/crates/openhuman-core/src/flows/ops/updates.rs
@@ -1,20 +1,20 @@
use super::*;
-/// Maps a store-level [`FlowUpdateError`](store::FlowUpdateError) to the RPC
+/// Maps a store-level [`FlowUpdateError`](tinyflows_sqlite::flows::FlowUpdateError) to the RPC
/// error string. A concurrency conflict is encoded as a JSON object the UI can
/// parse (`{ code: "version_conflict", message, current }`) so it can offer a
/// reload/diff instead of silently clobbering; other variants are plain text.
-fn map_flow_update_error(e: store::FlowUpdateError) -> String {
+fn map_flow_update_error(e: tinyflows_sqlite::flows::FlowUpdateError) -> String {
match e {
- store::FlowUpdateError::NotFound => "flow not found".to_string(),
- store::FlowUpdateError::Conflict(current) => serde_json::to_string(&json!({
+ tinyflows_sqlite::flows::FlowUpdateError::NotFound => "flow not found".to_string(),
+ tinyflows_sqlite::flows::FlowUpdateError::Conflict(current) => serde_json::to_string(&json!({
"code": "version_conflict",
"message": "This flow changed since you loaded it. Reload to see the latest \
version, then reapply your change.",
"current": *current,
}))
.unwrap_or_else(|_| "version_conflict".to_string()),
- store::FlowUpdateError::Store(err) => err.to_string(),
+ tinyflows_sqlite::flows::FlowUpdateError::Store(err) => err.to_string(),
}
}