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/builder_tools_save_and_edit_tests.rs,crates/ope

Steven Enamakel655a92421fe5
diff --git a/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs b/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs
index 6e5705e2d0..21d9988ed5 100644
--- a/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs
@@ -450,9 +450,10 @@ async fn get_node_kind_contract_tool_returns_contract_and_rejects_unknown() {
let bad = tool.execute(json!({ "kind": "nope" })).await.unwrap();
assert!(bad.is_error);
assert!(bad.output().contains("list_node_kinds"));
- assert!(bad
- .output()
- .contains(&format!("{} valid kinds", tinyflows::catalog::NODE_KINDS.len())));
+ assert!(bad.output().contains(&format!(
+ "{} valid kinds",
+ tinyflows::catalog::NODE_KINDS.len()
+ )));
let missing = tool.execute(json!({})).await.unwrap();
assert!(missing.is_error);
diff --git a/crates/openhuman-core/src/flows/mod.rs b/crates/openhuman-core/src/flows/mod.rs
index bca9f1db99..a173cbdf22 100644
--- a/crates/openhuman-core/src/flows/mod.rs
+++ b/crates/openhuman-core/src/flows/mod.rs
@@ -65,12 +65,15 @@ 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_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,
FlowRunTrigger, FlowSuggestion, FlowValidation, FlowValidationError, SuggestionStatus,
};
+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,
+};
// Flow memory scoping (`flow:<id>` tags over memory v2) lives in
// `memory_tools`, the sibling that owns the agent tools; the digest
// subscriber, `flows_delete` and the tinyflows `memory` node adapter reach the
diff --git a/crates/openhuman-core/src/flows/node_contracts.rs b/crates/openhuman-core/src/flows/node_contracts.rs
index 81ad85ef95..b2176acbdc 100644
--- a/crates/openhuman-core/src/flows/node_contracts.rs
+++ b/crates/openhuman-core/src/flows/node_contracts.rs
@@ -14,7 +14,7 @@
//! `propose_workflow` description all read the *overlaid* view via
//! [`all_node_kind_contracts`] / [`node_kind_contract`].
-use tinyflows::catalog::{ConfigField, NodeKindContract, PortSpec, NODE_KINDS};
+use tinyflows::catalog::{NodeKindContract, NODE_KINDS};
/// Appends this host's vendor-specific caveats to a portable tinyflows
/// contract. One arm per kind that has host-owned facts; the rest pass through
diff --git a/crates/openhuman-core/src/flows/ops/updates.rs b/crates/openhuman-core/src/flows/ops/updates.rs
index 988e73337d..d181674cd7 100644
--- a/crates/openhuman-core/src/flows/ops/updates.rs
+++ b/crates/openhuman-core/src/flows/ops/updates.rs
@@ -7,13 +7,15 @@ use super::*;
fn map_flow_update_error(e: tinyflows_sqlite::flows::FlowUpdateError) -> String {
match e {
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()),
+ 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())
+ }
tinyflows_sqlite::flows::FlowUpdateError::Store(err) => err.to_string(),
}
}
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod.rs b/crates/openhuman-core/src/inference/tokenjuice/mod.rs
index 245b4820ab..da64387105 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod.rs
@@ -7,15 +7,13 @@ pub mod repl_tools;
pub mod savings;
pub mod schemas;
pub mod tools;
-pub mod types;
use tinyjuice_bus::names::methods;
pub use repl_tools::{is_repl_tool, repl_tools, repl_tools_for, REPL_TOOL_NAMES};
pub use tools::TokenjuiceRetrieveTool;
-pub use {tinyjuice_bus::types::AgentTokenjuiceCompression, tinyjuice_bus::types::CompressorKind, tinyjuice_bus::types::ContentKind};
-use {tinyjuice_bus::wire::InstallRequest};
+use tinyjuice_bus::wire::InstallRequest;
pub const RETRIEVE_TOOL_NAME: &str = "juice_retrieve";
pub const LEGACY_TINYJUICE_RETRIEVE_TOOL_NAME: &str = "tinyjuice_retrieve";
@@ -303,7 +301,11 @@ pub async fn compact_tool_output(call: ToolOutputCompaction<'_>) -> CompactedToo
};
let response = match client(&config)
.with_timeout(COMPACT_WITH_TIMEOUT)
- .call::<tinyjuice_bus::wire::CompactResponse>("tinyjuice", methods::COMPACT_WITH, (request,))
+ .call::<tinyjuice_bus::wire::CompactResponse>(
+ "tinyjuice",
+ methods::COMPACT_WITH,
+ (request,),
+ )
.await
{
Ok(response) => response,
@@ -338,7 +340,10 @@ fn record_savings(response: &tinyjuice_bus::wire::CompactResponse) {
);
}
-pub async fn detect(content: String, hint: tinyjuice_bus::types::ContentHint) -> Result<String, String> {
+pub async fn detect(
+ content: String,
+ hint: tinyjuice_bus::types::ContentHint,
+) -> Result<String, String> {
let config = crate::config::Config::load_or_init()
.await
.map_err(|error| error.to_string())?;
@@ -442,3 +447,7 @@ pub async fn extract_html(html: String) -> Result<String, String> {
.map_err(|e| e.to_string())?;
response.map_err(|_| "juice: HTML input exceeds module limit".into())
}
+
+#[cfg(test)]
+#[path = "mod_contract_tests.rs"]
+mod contract_tests;
diff --git a/crates/openhuman-core/src/inference/tokenjuice/types_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/mod_contract_tests.rs
similarity index 94%
rename from crates/openhuman-core/src/inference/tokenjuice/types_tests.rs
rename to crates/openhuman-core/src/inference/tokenjuice/mod_contract_tests.rs
index 362c84c5ee..aebfc114d3 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/types_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod_contract_tests.rs
@@ -1,4 +1,5 @@
use super::*;
+use tinyjuice_bus::types::{CompressOptions, ContentHint, ContentKind};
#[test]
fn compress_options_accept_omitted_fields() {
diff --git a/crates/openhuman-core/src/inference/tokenjuice/types.rs b/crates/openhuman-core/src/inference/tokenjuice/types.rs
deleted file mode 100644
index eea94a32d1..0000000000
--- a/crates/openhuman-core/src/inference/tokenjuice/types.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-//! The wire types shared with the separately compiled TinyJuice module.
-//!
-//! These were declared here — 259 lines of them, under a doc comment saying
-//! they were "shared with" the module. They were shared by convention: the
-//! module's copy was private to its adapter and the library's copy was the
-//! library's, so neither was reachable from here and nothing checked that the
-//! three agreed. A field added on one side was a decode failure on the other.
-//!
-//! `tinyjuice-bus` is that contract as an ordinary crate, and this module is a
-//! re-export of it. The names below are the ones ~40 call sites in this crate
-//! already use, so the paths are unchanged.
-//!
-//! `RangeUnit`, `RetrieveRange` and `CacheStats` come from the contract's
-//! `wire` module rather than its `types` module — the split there is between
-//! values the `tinyjuice` library itself uses and envelopes that exist only on
-//! the bus. Nothing here needs to care which is which.
-
-use tinyjuice_bus::types::{
- AgentTokenjuiceCompression, CompressOptions, CompressedOutput, CompressorKind, ContentHint,
- ContentKind, LlmSummaryMode,
-};
-use tinyjuice_bus::wire::{
- CacheStats, CompactRequest, CompactResponse, GenerateRequest, InstallRequest, RangeUnit,
- RetrieveRange,
-};
-
-#[cfg(test)]
-#[path = "types_tests.rs"]
-mod tests;
diff --git a/crates/openhuman-core/src/skills/catalog/types.rs b/crates/openhuman-core/src/skills/catalog/types.rs
index 276157960a..8c8e1cc906 100644
--- a/crates/openhuman-core/src/skills/catalog/types.rs
+++ b/crates/openhuman-core/src/skills/catalog/types.rs
@@ -3,9 +3,7 @@
use serde::Serialize;
-use tinyskills::{
- CatalogEntry, Facet, Freshness, RegistryErrorKind, RegistryErrorSummary, RegistryFacets,
-};
+use tinyskills::{CatalogEntry, Freshness, RegistryErrorSummary};
/// Entries per page when a caller pages without naming a size.
pub const DEFAULT_PAGE_SIZE: usize = 25;