Skip to content

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

chore: files changed crates/openhuman-core/src/flows/bus/run_digest.rs,crates/openhuman-core/src/flo

Steven Enamakel332e207c13b8
diff --git a/crates/openhuman-core/src/flows/bus/run_digest.rs b/crates/openhuman-core/src/flows/bus/run_digest.rs
index fddc39b84e..70873defb9 100644
--- a/crates/openhuman-core/src/flows/bus/run_digest.rs
+++ b/crates/openhuman-core/src/flows/bus/run_digest.rs
@@ -12,7 +12,11 @@ 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_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/draft_store.rs b/crates/openhuman-core/src/flows/draft_store.rs
index 865480dc61..0b4ef29417 100644
--- a/crates/openhuman-core/src/flows/draft_store.rs
+++ b/crates/openhuman-core/src/flows/draft_store.rs
@@ -3,10 +3,9 @@
use anyhow::Result;
use serde_json::Value;
use tinyflows_bus::catalog::{
- self, CreateDraftRequest, DraftIdRequest, FlowDraft as WireDraft, UpdateDraftRequest,
+ self, CreateDraftRequest, DraftIdRequest, DraftOrigin, FlowDraft, FlowDraft as WireDraft,
+ UpdateDraftRequest,
};
-use tinyflows_catalog::DraftOrigin;
-use tinyflows_catalog::FlowDraft;
use crate::config::Config;
use crate::flows::{catalog_storage, store};
diff --git a/crates/openhuman-core/src/flows/ops/drafts.rs b/crates/openhuman-core/src/flows/ops/drafts.rs
index 02dd32d1cb..e1d0e5ecb0 100644
--- a/crates/openhuman-core/src/flows/ops/drafts.rs
+++ b/crates/openhuman-core/src/flows/ops/drafts.rs
@@ -10,8 +10,8 @@ pub fn flows_draft_create(
flow_id: Option<String>,
name: String,
graph: Value,
- origin: tinyflows_catalog::DraftOrigin,
-) -> Result<Outcome<tinyflows_catalog::FlowDraft>, String> {
+ origin: tinyflows_bus::catalog::DraftOrigin,
+) -> Result<Outcome<tinyflows_bus::catalog::FlowDraft>, String> {
let draft = draft_store::create_draft(config, flow_id, name, graph, origin)
.map_err(|e| e.to_string())?;
Ok(Outcome::single_log(draft, "draft created"))
@@ -35,7 +35,7 @@ pub(crate) fn flows_draft_create_from_copilot(
pub fn flows_draft_get(
config: &Config,
id: &str,
-) -> Result<Outcome<tinyflows_catalog::FlowDraft>, String> {
+) -> Result<Outcome<tinyflows_bus::catalog::FlowDraft>, String> {
let draft = draft_store::get_draft(config, id)
.map_err(|e| e.to_string())?
.ok_or_else(|| format!("draft '{id}' not found"))?;
@@ -50,7 +50,7 @@ pub fn flows_draft_update(
name: Option<String>,
graph: Option<Value>,
flow_id: Option<Option<String>>,
-) -> Result<Outcome<tinyflows_catalog::FlowDraft>, String> {
+) -> Result<Outcome<tinyflows_bus::catalog::FlowDraft>, String> {
let draft =
draft_store::update_draft(config, id, name, graph, flow_id).map_err(|e| e.to_string())?;
Ok(Outcome::single_log(draft, "draft updated"))
@@ -59,7 +59,7 @@ pub fn flows_draft_update(
/// Lists all drafts, newest-updated first.
pub fn flows_draft_list(
config: &Config,
-) -> Result<Outcome<Vec<tinyflows_catalog::FlowDraft>>, String> {
+) -> Result<Outcome<Vec<tinyflows_bus::catalog::FlowDraft>>, String> {
let drafts = draft_store::list_drafts(config).map_err(|e| e.to_string())?;
Ok(Outcome::single_log(drafts, "drafts listed"))
}
diff --git a/crates/openhuman-core/src/flows/runs_adapter.rs b/crates/openhuman-core/src/flows/runs_adapter.rs
index ff8e094146..718d113960 100644
--- a/crates/openhuman-core/src/flows/runs_adapter.rs
+++ b/crates/openhuman-core/src/flows/runs_adapter.rs
@@ -12,7 +12,8 @@ use std::sync::Arc;
use serde_json::{json, Value};
use tinyflows_bus::runs::{self, ResumeRun, StartRun};
-use tinyflows_catalog::{types::FlowRunTrigger, Flow};
+use tinyflows_bus::catalog::Workflow as Flow;
+use tinyflows_bus::runs::FlowRunTrigger;
use crate::config::Config;
use crate::core::runtime::DispatchCtx;
@@ -134,8 +135,7 @@ pub(crate) async fn start_run(
0,
);
let receiver = session.subscribe();
- let graph = serde_json::to_value(&flow.graph)
- .map_err(|error| format!("encode workflow graph: {error}"))?;
+ let graph = flow.graph.clone();
let proxy = match module::runs_proxy(config).await {
Ok(proxy) => proxy,
Err(error) => return Err(error),
diff --git a/crates/openhuman-core/src/flows/runs_adapter/projection.rs b/crates/openhuman-core/src/flows/runs_adapter/projection.rs
index 8fbc632056..1d05708ce2 100644
--- a/crates/openhuman-core/src/flows/runs_adapter/projection.rs
+++ b/crates/openhuman-core/src/flows/runs_adapter/projection.rs
@@ -5,7 +5,7 @@ use std::sync::{LazyLock, Mutex};
use serde_json::Value;
use tinyflows_bus::runs::{self, RunEvent};
-use tinyflows_catalog::types::FlowRunTrigger;
+use tinyflows_bus::runs::FlowRunTrigger;
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.rs
index a3bf4ad34a..6e9b9aef2c 100644
--- a/crates/openhuman-core/src/flows/runs_adapter/session.rs
+++ b/crates/openhuman-core/src/flows/runs_adapter/session.rs
@@ -5,7 +5,8 @@ use std::sync::{Arc, LazyLock, Mutex};
use std::time::Duration;
use tinyflows_bus::runs::{self, RunEvent};
-use tinyflows_catalog::{types::FlowRunTrigger, Flow};
+use tinyflows_bus::catalog::Workflow as Flow;
+use tinyflows_bus::runs::FlowRunTrigger;
use super::{projection, RunBindings};
use crate::config::Config;
diff --git a/crates/openhuman-core/src/flows/store.rs b/crates/openhuman-core/src/flows/store.rs
index 0b1f72275e..41b7145404 100644
--- a/crates/openhuman-core/src/flows/store.rs
+++ b/crates/openhuman-core/src/flows/store.rs
@@ -12,7 +12,9 @@ use tinyflows_bus::catalog::{
ListRevisionsRequest, ListWorkflowsResult, PutWorkflowRequest, PutWorkflowResponse,
SetEnabledRequest, Workflow, WorkflowRevision,
};
-use tinyflows_catalog::{Flow, FlowRevision, FlowSuggestion, SuggestionStatus};
+use tinyflows_bus::catalog::{
+ Flow as Flow, FlowRevision, FlowSuggestion, SuggestionStatus,
+};
use crate::config::Config;
use crate::modules::tinyflows as module;
@@ -35,18 +37,7 @@ where
}
fn flow_from_wire(workflow: Workflow) -> Result<Flow> {
- Ok(Flow {
- id: workflow.id,
- name: workflow.name,
- enabled: workflow.enabled,
- graph: serde_json::from_value(workflow.graph)
- .map_err(|error| anyhow!("decode workflow graph: {error}"))?,
- created_at: workflow.created_at,
- updated_at: workflow.updated_at,
- last_run_at: workflow.last_run_at,
- last_status: workflow.last_status,
- require_approval: workflow.require_approval,
- })
+ Ok(workflow)
}
pub(crate) fn roundtrip<T, U>(value: T) -> Result<U>
@@ -85,7 +76,7 @@ pub fn insert_duplicate_flow(config: &Config, source: &Flow, new_name: String) -
pub fn create_flow(
config: &Config,
name: String,
- graph: tinyflows::model::WorkflowGraph,
+ graph: Value,
require_approval: bool,
enabled: bool,
) -> Result<Flow> {
@@ -93,7 +84,7 @@ pub fn create_flow(
let request = PutWorkflowRequest::Create {
storage,
name,
- graph: serde_json::to_value(graph)?,
+ graph,
require_approval,
};
let response: PutWorkflowResponse =
@@ -180,7 +171,7 @@ pub fn update_flow_graph(
config: &Config,
id: &str,
name: String,
- graph: tinyflows::model::WorkflowGraph,
+ graph: Value,
require_approval: bool,
_enabled_override: Option<bool>,
force_disarm_if_automatic: bool,
@@ -195,9 +186,7 @@ pub fn update_flow_graph(
storage,
id: id.to_owned(),
name,
- graph: serde_json::to_value(graph).map_err(|error| BusUpdateError::Store {
- message: error.to_string(),
- })?,
+ graph,
require_approval,
expected_version: expected_updated_at.map(str::to_owned),
force_disarm_automatic: force_disarm_if_automatic,
@@ -209,11 +198,7 @@ pub fn update_flow_graph(
}
})?;
match response {
- PutWorkflowResponse::Ok(result) => {
- flow_from_wire(result.workflow).map_err(|error| BusUpdateError::Store {
- message: error.to_string(),
- })
- }
+ PutWorkflowResponse::Ok(result) => Ok(result.workflow),
PutWorkflowResponse::Error(error) => Err(error),
}
}