The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore(flows): apply rustfmt formatting across flow modules
Steven Enamakelbf973f769985
diff --git a/crates/openhuman-core/src/flows/bus/run_digest.rs b/crates/openhuman-core/src/flows/bus/run_digest.rsindex 584f529711..d746b787dc 100644--- a/crates/openhuman-core/src/flows/bus/run_digest.rs+++ b/crates/openhuman-core/src/flows/bus/run_digest.rs@@ -12,11 +12,7 @@ use std::sync::Arc;use tinybus::EventHandler;use tinymemory_api::{Error, Result};use tinymemory_api::{ItemKind, MetaFilter, StoreItem};-use {- crate::flows::flow_meta,- crate::flows::flow_tag,- tinyflows_bus::catalog::FlowRun,-};+use {crate::flows::flow_meta, crate::flows::flow_tag, tinyflows_bus::catalog::FlowRun};/// Bounds a post-run memory digest to a compact, LLM-cheap size — a single/// run's summary must never dominate a later `flow_memory_recall`.diff --git a/crates/openhuman-core/src/flows/catalogue.rs b/crates/openhuman-core/src/flows/catalogue.rsindex 8aaf9974f3..243a4be259 100644--- a/crates/openhuman-core/src/flows/catalogue.rs+++ b/crates/openhuman-core/src/flows/catalogue.rs@@ -128,7 +128,11 @@ fn describe(config: &Config, flow: &tinyflows_bus::catalog::Workflow) -> String/// the record carries. See the module docs: inventing a purpose from node/// internals would read as authoritative and frequently be wrong.fn describe_shape(flow: &tinyflows_bus::catalog::Workflow, trigger: String) -> String {- let steps = flow.graph.get("nodes").and_then(serde_json::Value::as_array).map_or(0, Vec::len)+ let steps = flow+ .graph+ .get("nodes")+ .and_then(serde_json::Value::as_array)+ .map_or(0, Vec::len)// The trigger is not a step the user thinks about..saturating_sub(1);let mut out = format!(diff --git a/crates/openhuman-core/src/flows/catalogue_tests.rs b/crates/openhuman-core/src/flows/catalogue_tests.rsindex 6a3bb6ddfc..5758b2e533 100644--- a/crates/openhuman-core/src/flows/catalogue_tests.rs+++ b/crates/openhuman-core/src/flows/catalogue_tests.rs@@ -184,22 +184,17 @@ fn a_saved_flow_reaches_the_catalogue_with_its_real_id() {let config = store_config(&tmp);let graph = graph(vec![- node(- "t",- NodeKind::Trigger,- serde_json::json!({ "trigger_kind": "manual" }),- ),- node("a", NodeKind::Agent, serde_json::json!({})),- ]);- let saved = super::super::store::create_flow(- &config,- "Weekly Report".to_string(),- graph,- false,- true,- )- .expect("flow saves")- .workflow;+ node(+ "t",+ NodeKind::Trigger,+ serde_json::json!({ "trigger_kind": "manual" }),+ ),+ node("a", NodeKind::Agent, serde_json::json!({})),+ ]);+ let saved =+ super::super::store::create_flow(&config, "Weekly Report".to_string(), graph, false, true)+ .expect("flow saves")+ .workflow;let entries = flow_entries(&config);assert_eq!(entries.len(), 1, "the saved flow must appear: {entries:?}");@@ -222,10 +217,10 @@ fn entries_are_sorted_by_name_so_the_prompt_prefix_is_stable() {let tmp = TempDir::new().unwrap();let config = store_config(&tmp);let graph = graph(vec![node(- "trigger",- NodeKind::Trigger,- serde_json::json!({ "trigger_kind": "manual" }),- )]);+ "trigger",+ NodeKind::Trigger,+ serde_json::json!({ "trigger_kind": "manual" }),+ )]);for name in ["Zebra", "Alpha", "Mango"] {super::super::store::create_flow(&config, name.to_string(), graph.clone(), false, true).expect("flow saves");diff --git a/crates/openhuman-core/src/flows/draft_store.rs b/crates/openhuman-core/src/flows/draft_store.rsindex fce8b80e77..e19725c3fd 100644--- a/crates/openhuman-core/src/flows/draft_store.rs+++ b/crates/openhuman-core/src/flows/draft_store.rs@@ -25,11 +25,7 @@ pub fn create_draft(graph,origin,};- store::call_catalog::<FlowDraft, _>(- config,- catalog::members::CREATE_DRAFT,- (request,),- )+ store::call_catalog::<FlowDraft, _>(config, catalog::members::CREATE_DRAFT, (request,))}/// Read one module-owned draft.diff --git a/crates/openhuman-core/src/flows/ops.rs b/crates/openhuman-core/src/flows/ops.rsindex 5efeed31c1..4e9f2034ff 100644--- a/crates/openhuman-core/src/flows/ops.rs+++ b/crates/openhuman-core/src/flows/ops.rs@@ -49,7 +49,6 @@ use tokio_util::sync::CancellationToken;pub(crate) use tinyflows_bus::catalog::Workflow as Flow;-/// Overall safety bound on a single `flows_run` / `flows_resume`. Individual/// capabilities have their own timeouts (HTTP, sandbox), but a hung LLM/tool/// call must never let the RPC block indefinitely — this caps the whole run.diff --git a/crates/openhuman-core/src/flows/ops/approval_manifest.rs b/crates/openhuman-core/src/flows/ops/approval_manifest.rsindex fd7fd1e221..14393b0265 100644--- a/crates/openhuman-core/src/flows/ops/approval_manifest.rs+++ b/crates/openhuman-core/src/flows/ops/approval_manifest.rs@@ -38,12 +38,7 @@ pub async fn compute_approval_manifest(config: &Config,graph: &Value,) -> Result<Vec<Value>, String> {- compute_approval_manifest_json(- ctx,- config,- graph.clone(),- )- .await+ compute_approval_manifest_json(ctx, config, graph.clone()).await}async fn compute_approval_manifest_json(diff --git a/crates/openhuman-core/src/flows/ops/connections.rs b/crates/openhuman-core/src/flows/ops/connections.rsindex 220f20fc4e..98f93de34e 100644--- a/crates/openhuman-core/src/flows/ops/connections.rs+++ b/crates/openhuman-core/src/flows/ops/connections.rs@@ -276,8 +276,8 @@ pub async fn compute_required_connections(}}// An app_event trigger names its toolkit directly.- if let Some(trigger) = crate::flows::host_gates::nodes(graph)- .find(|node| node.kind == "trigger")+ if let Some(trigger) =+ crate::flows::host_gates::nodes(graph).find(|node| node.kind == "trigger"){if let Some(tk) = trigger.config.get("toolkit").and_then(Value::as_str) {push(tk.to_string());diff --git a/crates/openhuman-core/src/flows/ops/definitions.rs b/crates/openhuman-core/src/flows/ops/definitions.rsindex 83006a6ff3..a113ad0831 100644--- a/crates/openhuman-core/src/flows/ops/definitions.rs+++ b/crates/openhuman-core/src/flows/ops/definitions.rs@@ -158,7 +158,7 @@ pub(crate) async fn load_engine_compatible_flow_graph(ctx: &crate::core::runtime::DispatchCtx,config: &Config,id: &str,- ) -> Result<Option<Value>, String> {+) -> Result<Option<Value>, String> {let graph = load_flow_graph(config, id)?;if let Some(graph) = graph.as_ref() {ensure_config_aware_engine_compatible(ctx, config, graph)diff --git a/crates/openhuman-core/src/flows/ops/execution.rs b/crates/openhuman-core/src/flows/ops/execution.rsindex fecb8be7db..9653f76627 100644--- a/crates/openhuman-core/src/flows/ops/execution.rs+++ b/crates/openhuman-core/src/flows/ops/execution.rs@@ -4,8 +4,8 @@use serde_json::json;use tinyagents_graph::GraphObservation;-use tinyflows_bus::runs::FlowRunTrigger;use tinyflows_bus::catalog::Workflow as Flow;+use tinyflows_bus::runs::FlowRunTrigger;use crate::config::Config;diff --git a/crates/openhuman-core/src/flows/ops/inference_readiness.rs b/crates/openhuman-core/src/flows/ops/inference_readiness.rsindex 7f9456ba6e..12dd8195cb 100644--- a/crates/openhuman-core/src/flows/ops/inference_readiness.rs+++ b/crates/openhuman-core/src/flows/ops/inference_readiness.rs@@ -8,10 +8,7 @@ pub(super) struct InferenceReadinessEvaluation {/// Resolve the effective inference workload for an agent node. This remains/// beside the graph adapter because it depends on TinyFlows node configuration.-pub(super) async fn agent_node_role(- config: &Config,- node_config: &Value,-) -> &'static str {+pub(super) async fn agent_node_role(config: &Config, node_config: &Value) -> &'static str {if let Some(agent_ref) = node_config.get("agent_ref").and_then(Value::as_str)@@ -140,10 +137,11 @@ pub(super) async fn evaluate_inference_readiness(graph: &Value,) -> Option<InferenceReadinessEvaluation> {let mut roles = Vec::new();- for node in crate::flows::host_gates::nodes(graph)- .filter(|node| node.kind == "agent")- {- roles.push((node.id.to_owned(), agent_node_role(config, node.config).await));+ for node in crate::flows::host_gates::nodes(graph).filter(|node| node.kind == "agent") {+ roles.push((+ node.id.to_owned(),+ agent_node_role(config, node.config).await,+ ));}let evaluation = crate::inference::readiness::evaluate(ctx, config, &roles).await?;let message = format_evaluation(&evaluation);diff --git a/crates/openhuman-core/src/flows/ops/run_management.rs b/crates/openhuman-core/src/flows/ops/run_management.rsindex 5138dd7118..9424de4db1 100644--- a/crates/openhuman-core/src/flows/ops/run_management.rs+++ b/crates/openhuman-core/src/flows/ops/run_management.rs@@ -69,8 +69,7 @@ pub async fn flows_list_all_runs(.await?.storage();let request = wire::ListAllRunsRequest { storage, limit };- let runs: Vec<FlowRun> =- catalog_call(config, wire::members::LIST_ALL_RUNS, request).await?;+ let runs: Vec<FlowRun> = catalog_call(config, wire::members::LIST_ALL_RUNS, request).await?;let count = runs.len();Ok(Outcome::single_log(runs,diff --git a/crates/openhuman-core/src/flows/ops/updates.rs b/crates/openhuman-core/src/flows/ops/updates.rsindex 10d938d851..a1953860e3 100644--- a/crates/openhuman-core/src/flows/ops/updates.rs+++ b/crates/openhuman-core/src/flows/ops/updates.rs@@ -135,12 +135,7 @@ async fn flows_update_inner(// Metadata-only updates preserve access to legacy graphs written by// older versions, even when the current engine no longer accepts them.None => {- validate_and_migrate_graph(- ctx,- config,- existing.graph.clone(),- )- .await?;+ validate_and_migrate_graph(ctx, config, existing.graph.clone()).await?;existing.graph.clone()}};diff --git a/crates/openhuman-core/src/flows/ops/validation.rs b/crates/openhuman-core/src/flows/ops/validation.rsindex 4d230381ac..47c79208ce 100644--- a/crates/openhuman-core/src/flows/ops/validation.rs+++ b/crates/openhuman-core/src/flows/ops/validation.rs@@ -153,20 +153,20 @@ pub async fn flows_validate(}if report.graph.is_none() {let error = "TinyFlows validation returned no graph".to_string();- return Outcome::single_log(- FlowValidation {- valid: false,- errors: vec![error.clone()],- error_details: vec![FlowValidationError {- code: "unparseable_graph".into(),- message: error,- node_id: None,- field: None,- }],- warnings: Vec::new(),- },- "flow validation failed",- );+ return Outcome::single_log(+ FlowValidation {+ valid: false,+ errors: vec![error.clone()],+ error_details: vec![FlowValidationError {+ code: "unparseable_graph".into(),+ message: error,+ node_id: None,+ field: None,+ }],+ warnings: Vec::new(),+ },+ "flow validation failed",+ );}let warnings = report.warnings;Outcome::single_log(diff --git a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rsindex 8c8296567f..0fd1d30d3e 100644--- a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs+++ b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs@@ -449,9 +449,10 @@ async fn list_suggestions_filters_by_status() {seed_suggestion(&config, "s1");seed_suggestion(&config, "s2");- let active = flows_list_suggestions(&config, Some(tinyflows_bus::catalog::SuggestionStatus::New))- .await- .unwrap();+ let active =+ flows_list_suggestions(&config, Some(tinyflows_bus::catalog::SuggestionStatus::New))+ .await+ .unwrap();assert_eq!(active.value.len(), 2);// Unfiltered returns all too.@@ -472,9 +473,10 @@ async fn dismiss_and_mark_built_move_suggestions_out_of_active() {assert_eq!(b.value["built"], json!(true));// Neither is in the active (New) set anymore.- let active = flows_list_suggestions(&config, Some(tinyflows_bus::catalog::SuggestionStatus::New))- .await- .unwrap();+ let active =+ flows_list_suggestions(&config, Some(tinyflows_bus::catalog::SuggestionStatus::New))+ .await+ .unwrap();assert!(active.value.is_empty());}diff --git a/crates/openhuman-core/src/flows/runs_adapter.rs b/crates/openhuman-core/src/flows/runs_adapter.rsindex 20a994ffcb..2151575c14 100644--- a/crates/openhuman-core/src/flows/runs_adapter.rs+++ b/crates/openhuman-core/src/flows/runs_adapter.rs@@ -11,9 +11,9 @@ mod session;use std::sync::Arc;use serde_json::{json, Value};-use tinyflows_bus::runs::{self, ResumeRun, StartRun};use tinyflows_bus::catalog::Workflow as Flow;use tinyflows_bus::runs::FlowRunTrigger;+use tinyflows_bus::runs::{self, ResumeRun, StartRun};use crate::config::Config;use crate::core::runtime::DispatchCtx;diff --git a/crates/openhuman-core/src/flows/runs_adapter/projection.rs b/crates/openhuman-core/src/flows/runs_adapter/projection.rsindex 1d05708ce2..aa347d0fc3 100644--- a/crates/openhuman-core/src/flows/runs_adapter/projection.rs+++ b/crates/openhuman-core/src/flows/runs_adapter/projection.rs@@ -4,8 +4,8 @@ use std::collections::{HashSet, VecDeque};use std::sync::{LazyLock, Mutex};use serde_json::Value;-use tinyflows_bus::runs::{self, RunEvent};use tinyflows_bus::runs::FlowRunTrigger;+use tinyflows_bus::runs::{self, RunEvent};use crate::core::events::DomainEvent;use crate::flows::runs_adapter::session::RunSession;diff --git a/crates/openhuman-core/src/flows/runs_adapter/session.rs b/crates/openhuman-core/src/flows/runs_adapter/session.rsindex 6e9b9aef2c..f70d655519 100644--- a/crates/openhuman-core/src/flows/runs_adapter/session.rs+++ b/crates/openhuman-core/src/flows/runs_adapter/session.rs@@ -4,9 +4,9 @@ use std::collections::HashMap;use std::sync::{Arc, LazyLock, Mutex};use std::time::Duration;-use tinyflows_bus::runs::{self, RunEvent};use tinyflows_bus::catalog::Workflow as Flow;use tinyflows_bus::runs::FlowRunTrigger;+use tinyflows_bus::runs::{self, RunEvent};use super::{projection, RunBindings};use crate::config::Config;diff --git a/crates/openhuman-core/src/flows/test_support.rs b/crates/openhuman-core/src/flows/test_support.rsindex c08ee0f389..491dcf4847 100644--- a/crates/openhuman-core/src/flows/test_support.rs+++ b/crates/openhuman-core/src/flows/test_support.rs@@ -2,10 +2,10 @@use anyhow::{anyhow, Result};use serde_json::Value;+use tinyflows_bus::catalog::Workflow as Flow;use tinyflows_bus::catalog::{self, CatalogDocumentPrecondition, CatalogStorageReply, ListWorkflowsResult,};-use tinyflows_bus::catalog::Workflow as Flow;use crate::{config::Config, flows::store};